Table of Contents

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 BaseNetworkSymbol

The blockchain network symbol (e.g., ETH, TRON).

identifier string

The user or client identifier.

referenceId string

Optional 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 BaseNetworkSymbol

The blockchain network (e.g., ETH, BSC).

identifier string

The user or application identifier.

referenceId string

A reference ID to correlate this request with the client system.

requestedCurrency ApCurrencySymbol

The currency intended for deposit (e.g., USDT).

requestedAmount double

The amount intended to be deposited.

token ApTokenSymbol

The 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 ApDepositUrlRequest

The 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 string

The identifier associated with the deposit.

referenceId string

Optional 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 ApDepositUrlWithRequestedValueRequest

The 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 string

The identifier associated with the deposit.

referenceId string

A client-side reference ID to associate with this request.

requestedCurrency ApCurrencySymbol

The currency the user wants to deposit.

requestedAmount double

The 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 ApCurrencySymbol

The 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 string

The 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 string

The 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 ApTransactionsParam

The 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

Task

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 string

The internal recipient identifier.

to string

The blockchain address to send funds to.

amount double

The amount to send.

networkSymbol BaseNetworkSymbol

The 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 string

The internal recipient identifier.

to string

The blockchain address to send funds to.

amount double

The amount to send.

networkSymbol BaseNetworkSymbol

The blockchain network.

tokenSymbol ApTokenSymbol

The 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 string

The raw body content of the request.

signature string

The signature to verify against the body.

Returns

bool

True if the signature is valid; otherwise, false.