Public methods 📢

Get SDK-instance info

Returns:

  • an instance of InfoData containing SDK-related properties.

public async Task<InfoData> getInfo() {
    return new InfoData {
        apiKey = this.apiKey,
        dAppCode = this.dAppCode,
        network = this.network,
        visitorId = "[not implemented yet]",
        sdkEnvironment = this.sdkEnvironment,
        sdkVersion = this.sdkVersion
    };
}

Get balances by Hedera id (address)

Parameters:

  • accountId: Hedera id (address), example: 0.0.112233

Returns:

  • an instance of AccountBalanceData containing account hbar and token balances.

Get account evmAddress and calculated evmAddress from public key

Parameters:

  • accountId: Hedera id (address), example: 0.0.112233

Returns:

  • an instance of AccountInfoData containing account id, evmAddress, calculatedEvmAddress

Method to execute Hbar transfers from current account to receiver

Parameters:

  • accountId: sender

  • accountPrivateKey: sender's private key to sign transfer transaction

  • receiverId: receiver

  • amount: amount

  • memo: memo (limited to 100 characters)

Returns:

  • an instance of ExecuteTxReceipt containing transaction receipt

Method to execute token transfers from current account to receiver

Parameters:

  • tokenId: token

  • accountId: sender

  • accountPrivateKey: sender's private key to sign transfer transaction

  • receiverId: receiver

  • amount: amount

  • memo: memo (limited to 100 characters)

  • freeTransfer: for tokens configured for this dAppCode on Blade backend

Returns:

  • an instance of ExecuteTxReceipt containing transaction receipt

Method to create Hedera account

Parameters:

  • deviceId: unique device id (advanced security feature, required only for some dApps)

Returns:

  • an instance of CreateAccountData containing new account data

Method to delete Hedera account

Parameters:

  • deleteAccountId: account to delete - id

  • deletePrivateKey: account to delete - private key

  • transferAccountId: The ID of the account to transfer the remaining funds to.

  • operatorAccountId: operator account Id

  • operatorPrivateKey: operator account private key

Returns:

  • an instance of ExecuteTxReceipt containing transaction receipt

Method to call smart-contract function

Parameters:

  • contractId: contract id

  • functionName: contract function name

  • params: function arguments (instance of ContractFunctionParameters)

  • accountId: sender account id

  • accountPrivateKey: sender's private key to sign transfer transaction

  • gas: gas amount for transaction (default 100000)

  • bladePayFee: blade pay fee, otherwise fee will be pay from sender accountId

Returns:

  • an instance of ExecuteTxReceipt containing transaction receipt

Method to call smart-contract query

Parameters:

  • contractId: contract id

  • functionName: contract function name

  • params: function arguments (instance of ContractFunctionParameters)

  • accountId: sender account id

  • accountPrivateKey: sender's private key to sign transfer transaction

  • gas: gas amount for transaction (default 100000)

  • bladePayFee: blade pay fee, otherwise fee will be pay from sender accountId

  • returnTypes: array of return types, e.g. ["string", "int32"]

Returns:

  • an instance of ContractQueryData containing result from query with types

Method to get C14 url for payment

Parameters:

  • asset: USDC, HBAR, KARATE or C14 asset uuid

  • account: receiver account id

  • amount: amount to buy

Returns:

  • string with C14 url with preseted paramsbalances.

Sign message with private key

Parameters:

  • messageEncoded: encoder message string

  • accountPrivateKey: private key string

  • encoding: message encoding. One of: hex, base64, utf8

Returns:

  • an instance of SignMessageData containing signature

Verify message signature with public key

Parameters:

  • messageEncoded: message encoded

  • signatureHex: hex-encoded signature string

  • publicKey: public key string

  • encoding: message encoding. One of: hex, base64, utf8

Returns:

  • boolean. True if signature is valid

Sign message with private key (hethers lib)

Parameters:

  • messageEncoded: encoder message string

  • accountPrivateKey: private key string

  • encoding: message encoding. One of: hex, base64, utf8

Returns:

  • an instance of SignMessageData containing signature

Method to split signature into v-r-s

Parameters:

  • signature: signature string "0x21fbf0696......"

Returns:

  • an instance of SplitSignatureData containing v, r, s

Get signature for contract params into v-r-s

Parameters:

  • params: function arguments (instance of ContractFunctionParameters)

  • accountPrivateKey: account private key string

Returns:

  • an instance of SplitSignatureData containing v, r, s

Method to get transactions history

Parameters:

  • accountId: accountId of history

  • transactionType: filter by type of transaction

  • nextPage: link from response to load next page of history

  • transactionsLimit: limit of transactions to load

Returns:

  • an instance of TransactionsHistoryData containing transaction records, filtered and aggregated

Last updated