⛏️How to use SDK to submit a transaction
Last updated
Last updated
We can guide you on adding your smart contract to the Bitkub Chain Developer Console and configure your web application to interact with the smart contract using the Bitkub Chain Developer Console SDK. Here's an explanation of the process:
Description: Once the smart contract is deployed, your smart contract needs to connect with Bitkub Chain Developer Center, which typically provides an API or SDK that allows you to interact with the smart contract.
Go to menu: Smart contract.
Click “Add Smart Contract"
Input smart contract name, smart contract address, smart contract type
When selecting the smart contract type, it will prefill the required smart contract ABI
Input/Update Smart contract ABI
If your smart contract type: is KAP20, we already have two default ABI and can configure them.
If your smart contract type: is KAP721, we already have two default ABI and can configure them.
If your smart contract type: Is a logic Contract, you can free-style configure them.
Click the “Add.”
Congratulations, you successfully added a smart contract.
Description: In versioning, selecting the deployed smart contract to group means organizing deployed smart contracts into groups based on their version number. It is especially in complex smart contract systems where multiple contracts may be interacting with each other.
Go to menu: Smart contract Version.
Click the “Create Smart Contract Version.”
Select deployed and added smart contract from the list, then click the “Create” button.
When creating a new smart contract. Its version is automatically created; the previous version will be inactive.
Information:
You can only activate one smart contract version per project.
Once you have successfully config the smart contract in SDK, you can now use the smart contract function on your website.
See how to create `BitkubNextSdkContext`
Contract
We will use this object to show how to submit a transaction.
As you can see, that function approveBySDK
required two arguments
spender
amount
You can use a contract.approve (same method as approveBySDK)
Replace the spender and amount with your parameters
🥳 If you have successfully submitted the approve function, you can go back to see the transaction list in SDK Console.
Go to menu: Transaction List
Able to search by transaction address
View transaction id, status, create date, transaction
Able to view more detail
Able to view transaction log