Blade SDKs

Intro

Blade offers SDKs for the most popular platforms, making it easy for you to implement our code, whatever your tech stack looks like.

Supported features across SDKs

  • ✅ - implemented

  • ⭕️ - partly implemented

  • ❌ - not implemented

Features

init

This method initializes instance of BladeSDK. To work properly it requires next parameters:

  • dAppCode - your dAppCode

  • apiKey - your apiKey (unique per platform, network and sdkEnvironment)

  • network - Hedera network, supported: Testnet or Mainnet

  • sdkEnvironment - Blade API environment: Prod or CI

getInfo

This method return basic params of initialized instance of BladeSDK. This params may useful for support. Returned object likely will contain next fields: apiKey, dAppCode, network, visitorId, sdkEnvironment, sdkVersion, nonce In case of support please not provide full apiKey, limit yourself to the part of the code that includes a few characters at the beginning and at the end (eg. AdR3....BFgd)

createAccount

Create new Hedera account (ECDSA). Only for configured dApps. Depending on dApp config Blade create account, associate tokens, etc. In case of not using pre-created accounts pool and network high load, this method can return transactionId and no accountId. In that case account creation added to queue, and you should wait some time and call getPendingAccount() method.

deleteAccount

Delete Hedera account. This method requires account private key and operator private key. Operator is the one who paying fees

getAccountInfo

Get account info. EvmAddress is address of Hedera account if exists. Else accountId will be converted to solidity address. CalculatedEvmAddress is calculated from account public key. May be different from evmAddress.

getBalance

Get hbar and token balances for specific account.

getKeysFromMnemonic

Get ECDSA private key from mnemonic. Also try to find accountIds based on public key if lookupNames is true. Returned keys with DER header. EvmAddress computed from Public key.

transferHbars

Send hbars to specific account.

transferTokens

Send token to specific account.

contractCallFunction

Call contract function. Directly or via Blade Payer account (fee will be paid by Blade), depending on your dApp configuration. Parameters:

  • contractId - contract id

  • functionName - contract function name

  • paramsEncoded - contract function parameters: instance of ParametersBuilder. ParametersBuilder is a helper class to build contract function parameters. Check syntax in context of selected SDK

  • accountId - account id

  • accountPrivateKey - private key for transaction signature

  • gas - gas amount

  • bladePayFee - if true - fees will be covered by Blade. Mind that payer id will be Blade system account instead of account if

contractCallQueryFunction

Call query on contract function. Similar to contractCallFunction can be called directly or via Blade Payer account. Additionally, to parameters that used in contractCallFunction there is parameter resultTypes contains array of return types

sign

Sign message with private key. Syntax may vary according to picked SDK. Returns hex-encoded signature.

signVerify

Verify message signature by public key

ethersSign

Sign message using ethers lib. Returns hex-encoded signature.

splitSignature

Split signature to v-r-s format.

getParamsSignature

Get v-r-s signature of contract function params

getTransactions

Get transactions history for account. Can be filtered by transaction type. Transaction requested from mirror node. Every transaction requested for child transactions. Result are flattened. If transaction type is not provided, all transactions will be returned. If transaction type is CRYPTOTRANSFERTOKEN records will additionally contain plainData field with decoded data.

getC14url

Get configured url for C14 integration (iframe or popup)

exchangeGetQuotes

Get quotes from different services for buy, sell or swap

swapTokens

Swap tokens

getTradeUrl

Get configured url to buy or sell tokens or fiat

createToken

Create token (NFT or Fungible Token)

associateToken

Associate token to account

nftMint

Mint one NFT

Last updated