Expand description
Ink! smart contract deployment and interaction
This module provides functionality for deploying and interacting with ink! smart contracts on Substrate-based chains.
§Features
- Deploy compiled ink! contracts (Wasm)
- Call contract methods (read and write)
- Parse contract metadata
- Handle contract events
- Gas estimation for contract calls
§Example
ⓘ
use apex_sdk_substrate::contracts::ContractClient;
// Deploy a contract
let contract = ContractClient::deploy(
client,
wasm_code,
metadata,
constructor_args,
).await?;
// Call a contract method
let result = contract
.call("transfer")
.args(&[recipient, amount])
.execute(&wallet)
.await?;Structs§
- Constructor
Spec - Constructor specification
- Contract
Call Builder - Contract call builder
- Contract
Client - Contract client for interacting with deployed contracts
- Contract
Metadata - Contract metadata from the ink! compilation
- Contract
Spec - Contract specification
- Event
Arg - Event argument
- Event
Spec - Event specification
- Field
- Field definition
- GasLimit
- Gas limit for contract calls
- Layout
Key - Layout key
- Message
Arg - Message argument
- Message
Spec - Message (method) specification
- Storage
Layout - Storage layout
- TypeDef
- Type definition
- Type
Param - Type parameter
- TypeRef
- Type reference
- Variant
- Variant definition
Enums§
- Storage
Deposit Limit - Storage deposit limit
- Type
DefVariant - Type definition variant
Functions§
- parse_
metadata - Parse contract metadata from JSON
Type Aliases§
- Contract
Address - Contract address type (32-byte account ID)