Class ApSdk
- Namespace
- AkashicPaySDK.Sdk
- Assembly
- AkashicPaySDK.dll
public sealed class ApSdk : IApSdk, IDisposable
- Inheritance
-
ApSdk
- Implements
- Inherited Members
Constructors
ApSdk(APEnvironment, ApBaseUrl, AcBaseContract, AcOtk)
public ApSdk(APEnvironment environment, ApBaseUrl apBaseUrl, AcBaseContract contract, AcOtk otk)
Parameters
environment
APEnvironmentapBaseUrl
ApBaseUrlcontract
AcBaseContractotk
AcOtk
ApSdk(APEnvironment, ApBaseUrl, AcBaseContract, AcOtk, UriInfo)
public ApSdk(APEnvironment environment, ApBaseUrl apBaseUrl, AcBaseContract contract, AcOtk otk, AcBaseNode.UriInfo acTargetNode)
Parameters
environment
APEnvironmentapBaseUrl
ApBaseUrlcontract
AcBaseContractotk
AcOtkacTargetNode
AcBaseNode.UriInfo
Methods
Dispose()
public void Dispose()
GetBalanceAsync()
Gets the current balance.
public 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.
public 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.
public 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.
public 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.
public 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.
public Task<ApTransfersResult> GetTransfersAsync(ApTransactionsParam param)
Parameters
param
ApTransactionsParamThe transaction parameters.
Returns
- Task<ApTransfersResult>
The result containing the list of transfers.
Init()
Initializes the SDK.
public Task Init()
Returns
KeyBackup()
Backs up the key associated with the OTK (one-time key).
public AcOtk KeyBackup()
Returns
- AcOtk
The result containing the OTK details, or null if not available.
PayoutAsync(string, string, double, BaseNetworkSymbol)
Performs a payout operation.
public 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.
public 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.