Example Use Cases
- Telegram bots for anything: Beyond swapping and sending, developers can create Telegram bots for any smart contract functionality.
- Multi-step smart contract interactions: Create complex, programmatic DeFi applications that abstract difficult steps from your user. Truly programmatic money legos.
Smart Contract Writes
Smart contracts live on a blockchain and programmatically enforce and execute the terms of an agreement. Integrating smart contracts with API Wallets enables:- Complex, multi-step operations triggered by a single user action.
- Offchain actions with onchain verification and execution.
- Limitless interactions with any onchain app or protocol.
Examples
Invoking (Calling) a Contract
We natively support the following standard contract interfaces, without you providing an ABI: However, any other contracts require providing the ABI. If you are interested in cached ABIs for more common smart contracts, reach out to us in the #wallet-api channel of the CDP Discord. A contract ABI (Application Binary Interface) is the way to interact with a smart contract, both externally and contract-to-contract. It is a file defining the various methods and parameters of the contract. The SDK also supports payable transactions, which are transactions that send ETH to the contract. See the Basename Registration guide for an example of a payable transaction.Transfer an ERC-721 NFT
Here’s an example of usinginvokeContract
to transfer an ERC-721 NFT:
Invoking an arbitrary smart contract
This is an example of usinginvokeContract
on an arbitrary contract, where the ABI must be explicitly provided.