Interface IApSdk
- Namespace
- AkashicPaySDK.Sdk
- Assembly
- AkashicPaySDK.dll
The IApSdk interface defines the main functionalities of the AkashicPay SDK. It includes initializing the SDK, retrieving deposit addresses, performing payouts, fetching transaction details, viewing balances, and retrieving exchange rates and keys.
public interface IApSdk
Methods
GetBalanceAsync()
Gets the current balance of the account associated with the SDK.
Task<ApBalanceResult?> GetBalanceAsync()
Returns
- Task<ApBalanceResult>
The result containing balance details, or null if the account is not initialized or inaccessible.
GetDepositAddressAsync(BaseNetworkSymbol, string, string?)
Gets a deposit address for the specified network and identifier.
Task<ApDepositAddressResult> GetDepositAddressAsync(BaseNetworkSymbol networkSymbol, string identifier, string? referenceId = null)
Parameters
networkSymbol
BaseNetworkSymbolThe blockchain network symbol (e.g., ETH, TRON).
identifier
stringThe user or client identifier.
referenceId
stringOptional client-provided reference ID for tracking.
Returns
- Task<ApDepositAddressResult>
The result containing the deposit address.
GetDepositAddressWithRequestedValueAsync(BaseNetworkSymbol, string, string, ApCurrencySymbol, double, ApTokenSymbol)
Gets a deposit address for a specific currency and amount. Useful for requests that specify how much and in what token the user wants to deposit.
Task<ApExtendedDepositAddressResult> GetDepositAddressWithRequestedValueAsync(BaseNetworkSymbol network, string identifier, string referenceId, ApCurrencySymbol requestedCurrency, double requestedAmount, ApTokenSymbol token)
Parameters
network
BaseNetworkSymbolThe blockchain network (e.g., ETH, BSC).
identifier
stringThe user or application identifier.
referenceId
stringA reference ID to correlate this request with the client system.
requestedCurrency
ApCurrencySymbolThe currency intended for deposit (e.g., USDT).
requestedAmount
doubleThe amount intended to be deposited.
token
ApTokenSymbolThe token symbol used in the network.
Returns
- Task<ApExtendedDepositAddressResult>
The result containing extended deposit address details.
GetDepositUrlAsync(ApDepositUrlRequest)
Retrieves a deposit URL using a strongly-typed request object.
Task<ApDepositUrlResult> GetDepositUrlAsync(ApDepositUrlRequest request)
Parameters
request
ApDepositUrlRequestThe deposit URL request including identifier and optional reference ID.
Returns
- Task<ApDepositUrlResult>
The result containing the generated deposit URL.
GetDepositUrlAsync(string, string?)
Retrieves a deposit URL for a specific identifier. This URL can be shared with a user to initiate a deposit session.
Task<ApDepositUrlResult> GetDepositUrlAsync(string identifier, string? referenceId = null)
Parameters
identifier
stringThe identifier associated with the deposit.
referenceId
stringOptional client-provided reference ID for tracking.
Returns
- Task<ApDepositUrlResult>
A task that represents the asynchronous operation, containing the deposit URL result.
GetDepositUrlWithRequestedValueAsync(ApDepositUrlWithRequestedValueRequest)
Retrieves a deposit URL with a strongly-typed request containing deposit expectations.
Task<ApDepositUrlResult> GetDepositUrlWithRequestedValueAsync(ApDepositUrlWithRequestedValueRequest request)
Parameters
request
ApDepositUrlWithRequestedValueRequestThe request containing all parameters for generating a deposit URL.
Returns
- Task<ApDepositUrlResult>
The result containing the deposit URL.
GetDepositUrlWithRequestedValueAsync(string, string, ApCurrencySymbol, double)
Retrieves a deposit URL where the user intends to deposit a specific currency and amount.
Task<ApDepositUrlResult> GetDepositUrlWithRequestedValueAsync(string identifier, string referenceId, ApCurrencySymbol requestedCurrency, double requestedAmount)
Parameters
identifier
stringThe identifier associated with the deposit.
referenceId
stringA client-side reference ID to associate with this request.
requestedCurrency
ApCurrencySymbolThe currency the user wants to deposit.
requestedAmount
doubleThe expected deposit amount.
Returns
- Task<ApDepositUrlResult>
The result containing the deposit URL with pre-configured expectations.
GetExchangeRatesAsync(ApCurrencySymbol)
Gets the latest exchange rates for the given currency.
Task<ApExchangeRatesResult> GetExchangeRatesAsync(ApCurrencySymbol currencySymbol)
Parameters
currencySymbol
ApCurrencySymbolThe base currency symbol for exchange rate lookup.
Returns
- Task<ApExchangeRatesResult>
The result containing current exchange rates.
GetKeysByOwnerAndIdentifierAsync(string)
Retrieves public keys or verification keys associated with the given identifier.
Task<ApKeysByIdentifierResult> GetKeysByOwnerAndIdentifierAsync(string identifier)
Parameters
identifier
stringThe unique identifier (e.g., user or app ID).
Returns
- Task<ApKeysByIdentifierResult>
The result containing the associated key information.
GetTransactionDetailAsync(string)
Retrieves detailed information about a transaction using its L2 transaction hash.
Task<ApTransactionDetailResult?> GetTransactionDetailAsync(string l2TxHash)
Parameters
l2TxHash
stringThe L2 transaction hash (unique ID from Layer 2).
Returns
- Task<ApTransactionDetailResult>
The result containing transaction details, or null if not found.
GetTransfersAsync(ApTransactionsParam)
Retrieves a list of transfers based on the provided filter parameters.
Task<ApTransfersResult> GetTransfersAsync(ApTransactionsParam param)
Parameters
param
ApTransactionsParamThe filtering parameters for transactions (e.g., date range, type).
Returns
- Task<ApTransfersResult>
The result containing the list of matching transfers.
Init()
Initializes the SDK by setting up internal configurations and authentication. This method must be called before using any other SDK functionalities.
Task Init()
Returns
PayoutAsync(string, string, double, BaseNetworkSymbol)
Performs a payout using the default token for the specified network.
Task<ApPayoutResult> PayoutAsync(string recipientId, string to, double amount, BaseNetworkSymbol networkSymbol)
Parameters
recipientId
stringThe internal recipient identifier.
to
stringThe blockchain address to send funds to.
amount
doubleThe amount to send.
networkSymbol
BaseNetworkSymbolThe blockchain network.
Returns
- Task<ApPayoutResult>
The result of the payout operation.
PayoutAsync(string, string, double, BaseNetworkSymbol, ApTokenSymbol)
Performs a payout to a recipient using the specified token.
Task<ApPayoutResult> PayoutAsync(string recipientId, string to, double amount, BaseNetworkSymbol networkSymbol, ApTokenSymbol tokenSymbol)
Parameters
recipientId
stringThe internal recipient identifier.
to
stringThe blockchain address to send funds to.
amount
doubleThe amount to send.
networkSymbol
BaseNetworkSymbolThe blockchain network.
tokenSymbol
ApTokenSymbolThe token symbol used for the payout.
Returns
- Task<ApPayoutResult>
The result of the payout operation.
VerifySignature(string, string)
Verifies the digital signature of a request body.
bool VerifySignature(string body, string signature)
Parameters
body
stringThe raw body content of the request.
signature
stringThe signature to verify against the body.
Returns
- bool
True if the signature is valid; otherwise, false.