CodeChain Credit SDK for JavaScript
How to install
# npm npm install codechain-credit-sdk # yarn yarn add codechain-credit-sdk
How to configure the API key
The SDK detects an environment variable and uses them for SDK requests. The environment variable that you set to provide your API key is:
CODECHAIN_CREDIT_API_KEY
Functions
- getAddress(): PlatformAddress
- signTransaction(Transaction): SignedTransaction
Example
const SDK = ;const getAddress signTransaction = ; { const sdk = server: "https://rpc.codechain.io" networkId: "cc" ; const assetAddress = await sdkkey; const platformAddress = await ; const tx = sdkcore; tx; tx; const signedTx = await ; const txhash = await sdkrpcchain; console;} ;