Interface IApSdk
- Namespace
- AkashicPaySDK.Sdk
- Assembly
- AkashicPaySDK.dll
The IApSdk interface defines the main functionalities of the AkashicPay SDK. This interface includes initializing the SDK, retrieving deposit addresses, performing payouts, retrieving the list of transfers, getting the current balance, fetching the details of a specific transaction, and looking up L2 addresses.
public interface IApSdk
Methods
GetBalanceAsync()
Gets the current balance.
Task<ApBalanceResult?> GetBalanceAsync()
Returns
- Task<ApBalanceResult>
The result containing the balance information, or null if not available.
GetDepositAddressAsync(BaseNetworkSymbol, string, string?, ApCurrencySymbol?, double?)
Gets a deposit address for the specified network, identifier, and optional parameters.
Task<ApDepositAddressResult> GetDepositAddressAsync(BaseNetworkSymbol networkSymbol, string identifier, string? referenceId = null, ApCurrencySymbol? currencySymbol = null, double? requestedAmount = null)
Parameters
networkSymbol
BaseNetworkSymbolThe network symbol.
identifier
stringThe identifier.
referenceId
stringA reference ID for tracking or correlation purposes (optional).
currencySymbol
ApCurrencySymbol?An optional currency symbol specifying the blockchain network and token (e.g., ETH, USDT).
requestedAmount
double?The amount intended to be deposited (optional).
Returns
- Task<ApDepositAddressResult>
The result containing the deposit address.
GetDepositUrlAsync(string, string?, ApCurrencySymbol?, double?)
Retrieves the deposit URL for the specified identifier, with optional parameters to customize the deposit request.
Task<ApDepositUrlResult> GetDepositUrlAsync(string identifier, string? referenceId = null, ApCurrencySymbol? currencySymbol = null, double? requestedAmount = null)
Parameters
identifier
stringThe unique identifier associated with the deposit.
referenceId
stringAn optional reference ID provided by the client to track the deposit request.
currencySymbol
ApCurrencySymbol?An optional currency symbol specifying the blockchain network and token (e.g., ETH, USDT).
requestedAmount
double?An optional amount the user intends to deposit.
Returns
- Task<ApDepositUrlResult>
A task that represents the asynchronous operation, containing the deposit URL result.
GetKeysByOwnerAndIdentifierAsync(string)
Gets the keys associated with a specific identifier.
Task<ApKeysByIdentifierResult> GetKeysByOwnerAndIdentifierAsync(string identifier)
Parameters
identifier
stringThe unique identifier for which the keys are to be retrieved.
Returns
- Task<ApKeysByIdentifierResult>
The result containing the keys associated with the identifier.
GetTransactionDetailAsync(string)
Gets the details of a specific transaction by L2 transaction hash.
Task<ApTransactionDetailResult?> GetTransactionDetailAsync(string l2TxHash)
Parameters
l2TxHash
stringThe L2 transaction hash.
Returns
- Task<ApTransactionDetailResult>
The result containing the transaction details, or null if not available.
GetTransfersAsync(ApTransactionsParam)
Gets the list of transfers based on provided transaction parameters.
Task<ApTransfersResult> GetTransfersAsync(ApTransactionsParam param)
Parameters
param
ApTransactionsParamThe transaction parameters.
Returns
- Task<ApTransfersResult>
The result containing the list of transfers.
Init()
Initializes the SDK.
Task Init()
Returns
KeyBackup()
Backs up the key associated with the OTK (one-time key).
AcOtk KeyBackup()
Returns
- AcOtk
The result containing the OTK details, or null if not available.
PayoutAsync(string, string, double, BaseNetworkSymbol)
Performs a payout operation.
Task<ApPayoutResult> PayoutAsync(string recipientId, string to, double amount, BaseNetworkSymbol networkSymbol)
Parameters
recipientId
stringThe recipient's ID.
to
stringThe address to payout to.
amount
doubleThe amount to payout.
networkSymbol
BaseNetworkSymbolThe network symbol.
Returns
- Task<ApPayoutResult>
The result of the payout operation.
PayoutAsync(string, string, double, BaseNetworkSymbol, ApTokenSymbol)
Performs a payout operation.
Task<ApPayoutResult> PayoutAsync(string recipientId, string to, double amount, BaseNetworkSymbol networkSymbol, ApTokenSymbol tokenSymbol)
Parameters
recipientId
stringThe recipient's ID.
to
stringThe address to payout to.
amount
doubleThe amount to payout.
networkSymbol
BaseNetworkSymbolThe network symbol.
tokenSymbol
ApTokenSymbolThe token symbol.
Returns
- Task<ApPayoutResult>
The result of the payout operation.