Response types
The Result interface is a generic interface that defines two properties:
completionKey: A String that represents a unique identifier for the result.
data: A generic type T that represents the actual data of the result. This interface is implemented by various classes in the io.bladewallet.bladesdk package, which represent the different types of responses that can be returned by the Blade API. The completionKey property is used to correlate the response with the original request, and the data property contains the actual data returned by the API.
Copy interface Result < T >{
var completionKey: String
var data : T
}
This is a data class definition for BladeJSError with two properties: name and reason. In this case, BladeJSError has two properties: name and reason. The purpose of this class is to hold information about an error that occurred in the context of BladeJS, with the name property indicating the type of the error and the reason property providing more detailed information about what went wrong.
Copy data class BladeJSError (
var name: String ,
var reason: String
)
ENUMs
BladeEnv
Copy enum class BladeEnv ( val value : String ) {
Prod ( "Prod" ),
CI ( "CI" )
}
CryptoFlowServiceStrategy
Copy enum class CryptoFlowServiceStrategy ( val value : String ) {
BUY ( "Buy" ),
SELL ( "Sell" ),
SWAP ( "Swap" );
companion object {
fun fromValue ( value : String ): CryptoFlowServiceStrategy ? {
return values (). find { it. value == value }
}
}
}
CryptoKeyType
Copy enum class CryptoKeyType ( val value : String ) {
ECDSA_SECP256K1 ( "ECDSA_SECP256K1" ),
ED25519 ( "ED25519" );
companion object {
fun fromValue ( value : String ): CryptoKeyType ? {
return CryptoKeyType. values (). find { it. value == value }
}
}
}
IPFSProvider
Copy enum class IPFSProvider ( val value : String ) {
pinata ( "pinata" );
companion object {
fun fromValue ( value : String ): IPFSProvider ? {
return IPFSProvider. values (). find { it. value == value }
}
}
}
KeyType
Copy enum class KeyType ( val value : String ) {
admin ( "admin" ),
kyc ( "kyc" ),
freeze ( "freeze" ),
wipe ( "wipe" ),
pause ( "pause" ),
feeSchedule ( "feeSchedule" );
companion object {
fun fromValue ( value : String ): KeyType ? {
return KeyType. values (). find { it. value == value }
}
}
}
ScheduleTransactionType
Copy enum class ScheduleTransactionType ( val value : String ) {
TRANSFER ( "TRANSFER" );
// SUBMIT_MESSAGE("SUBMIT_MESSAGE"),
// APPROVE_ALLOWANCE("APPROVE_ALLOWANCE"),
// TOKEN_MINT("TOKEN_MINT"),
// TOKEN_BURN("TOKEN_BURN");
}
ScheduleTransferType
Copy enum class ScheduleTransferType ( val value : String ) {
HBAR ( "HBAR" ),
FT ( "FT" ),
NFT ( "NFT" )
}
Data types
AccountInfoData
Copy data class AccountInfoData (
var accountId: String ,
var evmAddress: String ,
var calculatedEvmAddress: String ,
var publicKey: String ,
var stakingInfo: StakingInfo
)
AccountInfoResponse
Copy data class AccountInfoResponse (
override var completionKey: String ,
override var data : AccountInfoData
): Result < AccountInfoData >
AccountPrivateData
Copy data class AccountPrivateData (
var accounts: List < AccountPrivateRecord >
)
AccountPrivateRecord
Copy data class AccountPrivateRecord (
var privateKey: String ,
var publicKey: String ,
var evmAddress: String ,
var address: String ,
var path: String ,
val keyType: CryptoKeyType
)
AccountPrivateResponse
Copy data class AccountPrivateResponse (
override var completionKey: String ,
override var data : AccountPrivateData
): Result < AccountPrivateData >
BalanceData
Copy data class BalanceData (
var hbars: Double ,
var tokens: List < BalanceDataToken >
)
BalanceDataToken
Copy data class BalanceDataToken (
var balance: Double ,
var tokenId: String
)
BalanceResponse
Copy data class BalanceResponse (
override var completionKey: String ,
override var data : BalanceData
) : Result < BalanceData >
BladeJSError
Copy data class BladeJSError (
var name: String ,
var reason: String
) : Throwable ()
CoinData
Copy data class CoinData (
var id: String ,
var symbol: String ,
var name: String ,
var web_slug: String ,
var description: CoinDataDescription ,
var image: CoinDataImage ,
var market_data: CoinDataMarket ,
var platforms: List < CoinGeckoPlatform >
)
CoinDataDescription
Copy data class CoinDataDescription (
val en: String
)
CoinDataImage
Copy data class CoinDataImage (
val thumb: String ,
val small: String ,
val large: String
)
CoinDataMarket
Copy data class CoinDataMarket (
val current_price: Map < String , Double >
)
CoinGeckoPlatform
Copy data class CoinGeckoPlatform (
var name: String ,
var address: String
)
CoinInfoData
Copy data class CoinInfoData (
var coin: CoinData ,
var priceUsd: Double ,
var price: Double ?,
var currency: String
)
CoinInfoResponse
Copy data class CoinInfoResponse (
override var completionKey: String ,
override var data : CoinInfoData
) : Result < CoinInfoData >
CoinItem
Copy data class CoinItem (
var id: String ,
var symbol: String ,
var name: String ,
var platforms: List < CoinGeckoPlatform >
)
CoinListData
Copy data class CoinListData (
var coins: List < CoinItem >
)
CoinListResponse
Copy data class CoinListResponse (
override var completionKey: String ,
override var data : CoinListData
) : Result < CoinListData >
ContractFunctionParameter
Copy data class ContractFunctionParameter (
var type: String ,
var value : List < String >
)
ContractQueryData
Copy data class ContractQueryData (
var gasUsed: Int ,
var values: List < ContractQueryRecord >
)
ContractQueryRecord
Copy data class ContractQueryRecord (
var type: String ,
var value : String
)
ContractQueryResponse
Copy data class ContractQueryResponse (
override var completionKey: String ,
override var data : ContractQueryData
): Result < ContractQueryData >
CreatedAccountData
Copy data class CreatedAccountData (
var seedPhrase: String ,
var publicKey: String ,
var privateKey: String ,
var accountId: String ?,
var evmAddress: String ,
var transactionId: String ?,
var status: String ,
var queueNumber: Int ?
)
CreatedAccountResponse
Copy data class CreatedAccountResponse (
override var completionKey: String ,
override var data : CreatedAccountData
): Result < CreatedAccountData >
CreateScheduleData
Copy data class CreateScheduleData (
var scheduleId: String
)
CreateScheduleResponse
Copy data class CreateScheduleResponse (
override var completionKey: String ,
override var data : CreateScheduleData
) : Result < CreateScheduleData >
CreateTokenData
Copy data class CreateTokenData (
var tokenId: String
)
CreateTokenResponse
Copy data class CreateTokenResponse (
override var completionKey: String ,
override var data : CreateTokenData
) : Result < CreateTokenData >
EmergencyTransferData
Copy data class EmergencyTransferData (
var isValid: Boolean ,
var transferStatus: String
)
EmergencyTransferResponse
Copy data class EmergencyTransferResponse (
override var completionKey: String ,
override var data : EmergencyTransferData
): Result < EmergencyTransferData >
IAssetQuote
Copy data class IAssetQuote (
var asset: ICryptoFlowAsset ,
var amountExpected: Double ,
var totalFee: Double ?,
)
ICryptoFlowAsset
Copy data class ICryptoFlowAsset (
var name: String ,
var code: String ,
var type: String ,
// crypto only
var address: String ?,
var chainId: Int ?,
var decimals: Int ?,
var minAmount: Double ?,
var maxAmount: Double ?,
// fiat only
var symbol: String ?,
// both
var imageUrl: String ?,
)
ICryptoFlowQuote
Copy data class ICryptoFlowQuote (
var service: ICryptoFlowQuoteService ,
var source: IAssetQuote ,
var target: IAssetQuote ,
var rate: Double ?,
var widgetUrl: String ?,
var paymentMethods: List < String >?
)
ICryptoFlowQuoteService
Copy data class ICryptoFlowQuoteService (
var id: String ,
var name: String ,
var logo: String ,
var description: String ?
)
InfoData
Copy data class InfoData (
var apiKey: String ,
var dAppCode: String ,
var network: String ,
var visitorId: String ,
var sdkEnvironment: String ,
var sdkVersion: String ,
var nonce: Int
)
InfoResponse
Copy data class InfoResponse (
override var completionKey: String ,
override var data : InfoData
): Result < InfoData >
IntegrationUrlData
Copy data class IntegrationUrlData (
var url: String ?,
)
IntegrationUrlResponse
Copy data class IntegrationUrlResponse (
override var completionKey: String ,
override var data : IntegrationUrlData
): Result < IntegrationUrlData >
IPFSProviderConfig
Copy data class IPFSProviderConfig (
val provider: IPFSProvider ,
val token: String
)
KeyRecord
Copy data class KeyRecord (
val privateKey: String ,
val type: KeyType
)
NodeInfo
Copy data class NodeInfo (
var description: String ,
var max_stake: Long ,
var min_stake: Long ,
var node_id: Int ,
var node_account_id: String ,
var stake: Long ,
var stake_not_rewarded: Long ,
var stake_rewarded: Long ,
)
NodesData
Copy data class NodesData (
var nodes: List < NodeInfo >,
)
NodesResponse
Copy data class NodesResponse (
override var completionKey: String ,
override var data : NodesData
): Result < NodesData >
PrivateKeyData
Copy data class PrivateKeyData (
var privateKey: String ,
var publicKey: String ,
var accounts: List < String >,
var evmAddress: String
)
PrivateKeyResponse
Copy data class PrivateKeyResponse (
override var completionKey: String ,
override var data : PrivateKeyData
): Result < PrivateKeyData >
RemoteConfig
Copy data class RemoteConfig (
var fpApiKey: String ,
var fpSubdomain: String
)
Response
Copy data class Response (
override var completionKey: String ,
override var data : Any ,
var error: BladeJSError ?,
) : Result < Any >
Result
Copy interface Result < T >{
var completionKey: String
var data : T
}
ResultData
Copy data class ResultData (
var success: Boolean
)
ResultResponse
Copy data class ResultResponse (
override var completionKey: String ,
override var data : ResultData
): Result < ResultData >
ScheduleTransactionTransfer
Copy abstract class ScheduleTransactionTransfer (
var type: ScheduleTransferType ,
sender: String ,
receiver: String ,
value : Int ,
tokenId: String = "" ,
serial: Int
)
ScheduleTransactionTransferHbar
Copy data class ScheduleTransactionTransferHbar (
var sender: String ,
var receiver: String ,
var value : Int ,
) : ScheduleTransactionTransfer (ScheduleTransferType.HBAR, sender, receiver, value , "" , 0 )
ScheduleTransactionTransferNFT
Copy data class ScheduleTransactionTransferNFT (
var sender: String ,
var receiver: String ,
var tokenId: String ,
var serial: Int
) : ScheduleTransactionTransfer ( ScheduleTransferType . NFT , sender , receiver , 0 , tokenId , serial )
ScheduleTransactionTransferToken
Copy data class ScheduleTransactionTransferToken (
var sender: String ,
var receiver: String ,
var tokenId: String ,
var value : Int ,
) : ScheduleTransactionTransfer ( ScheduleTransferType . FT , sender , receiver , value , tokenId , 0 )
SignMessageData
Copy data class SignMessageData (
var signedMessage: String
)
SignMessageResponse
Copy data class SignMessageResponse (
override var completionKey: String ,
override var data : SignMessageData
): Result < SignMessageData >
SignVerifyMessageData
Copy data class SignVerifyMessageData (
var valid: Boolean
)
SignVerifyMessageResponse
Copy data class SignVerifyMessageResponse (
override var completionKey: String ,
override var data : SignVerifyMessageData
): Result < SignVerifyMessageData >
SplitSignatureData
Copy data class SplitSignatureData (
var v: Int ,
var r: String ,
var s: String ,
)
SplitSignatureResponse
Copy data class SplitSignatureResponse (
override var completionKey: String ,
override var data : SplitSignatureData
): Result < SplitSignatureData >
StakingInfo
Copy data class StakingInfo (
val pendingReward: Long ,
val stakedNodeId: Int ?,
val stakePeriodStart: String ?
)
SwapQuotesData
Copy data class SwapQuotesData (
var quotes: List < ICryptoFlowQuote >
)
SwapQuotesResponse
Copy data class SwapQuotesResponse (
override var completionKey: String ,
override var data : SwapQuotesData
): Result < SwapQuotesData >
SwapResultData
Copy data class SwapResultData (
var success: Boolean ,
var sourceAddress: String ,
var targetAddress: String ,
var balance: BalanceData
)
SwapResultResponse
Copy data class SwapResultResponse (
override var completionKey: String ,
override var data : SwapResultData
): Result < SwapResultData >
TokenDropData
Copy data class TokenDropData (
var status: String ,
var statusCode: Int ,
var timestamp: String ,
var executionStatus: String ,
var requestId: String ,
var accountId: String ,
var redirectUrl: String
)
TokenDropResponse
Copy data class TokenDropResponse (
override var completionKey: String ,
override var data : TokenDropData
) : Result < TokenDropData >
TransactionHistoryDetail
Copy data class TransactionHistoryDetail (
var fee: Double ,
var memo: String ,
var nftTransfers: List < TransactionHistoryNftTransfer >?,
var time: String ,
var transactionId: String ,
var transfers: List < TransactionHistoryTransfer >,
var type: String ,
var plainData: TransactionHistoryPlainData ?,
var consensusTimestamp: String
)
TransactionHistoryNftTransfer
Copy data class TransactionHistoryNftTransfer (
var is_approval: Boolean ,
var receiver_account_id: String ,
var sender_account_id: String ?,
var serial_number: Int ,
var token_id: String
)
TransactionHistoryPlainData
Copy data class TransactionHistoryPlainData (
var type: String ,
var token_id: String ,
var amount: Double ,
var senders: List < String >,
var receivers: List < String >
)
TransactionHistoryTransfer
Copy data class TransactionHistoryTransfer (
var account: String ,
var amount: Double ,
var is_approval: Boolean ,
var token_id: String ?
)
TransactionReceiptData
Copy data class TransactionReceiptData (
var status: String ,
var contractId: String ?,
var topicSequenceNumber: String ?,
var totalSupply: String ?,
var serials: List < String >?
)
TransactionReceiptResponse
Copy data class TransactionReceiptResponse (
override var completionKey: String ,
override var data : TransactionReceiptData
): Result < TransactionReceiptData >
TransactionsHistoryData
Copy data class TransactionsHistoryData (
var nextPage: String ?,
var transactions: List < TransactionHistoryDetail >
)
TransactionsHistoryResponse
Copy data class TransactionsHistoryResponse (
override var completionKey: String ,
override var data : TransactionsHistoryData
): Result < TransactionsHistoryData >
TransakOrderInfoData
Copy data class TransakOrderInfoData (
var orderId: String ,
var status: String ,
var walletAddress: String ?,
var createdAt: String ,
var autoExpiresAt: String ,
var isBuyOrSell: String ,
var network: String ,
var notes: List < String >?,
var fiatCurrency: String ,
var fiatAmount: Double ,
var cryptoCurrency: String ,
var cryptoAmount: Double ,
var conversionPrice: Double ?,
var slippage: Double ?,
var totalFeeInFiat: Double ,
var totalFee: Double ?,
)
TransakOrderInfoResponse
Copy data class TransakOrderInfoResponse (
override var completionKey: String ,
override var data : TransakOrderInfoData
): Result < TransakOrderInfoData >