UNPKG

@akashicpay/sdk

Version:

SDK to interact with the Akashic ecosystem

43 lines (42 loc) 3.32 kB
import { type Logger } from 'winston'; import { AkashicChain } from './akashicChain'; import type { ICreateDepositOrderResponse, IGetByOwnerAndIdentifierResponse, IKeyByOwnerAndIdentifier, IPrepareL2Withdrawal, IPrepareL2WithdrawalResponse } from './APACTypes'; import { Environment } from './constants'; import { type ACNodeT, type AkashicPayUrlT, type AkashicUrlT, type APBuilderArgs, type APConstructorArgs, type APInitialisationArgs, type HTTPResponse, type IBalance, type ICreateDepositOrder, type IDepositAddress, type IGetByOwnerAndIdentifier, type IGetKeysByOwnerAndIdentifier, type IGetTransactions, type IHttpClient, type ILookForL2AddressResult, type IPayoutResponse, type ITransaction, type KeyBackup, type NetworkSymbol, TokenSymbol } from './types'; export declare class AkashicPay<Env extends Environment = Environment.Production> { #private; static readonly ACPrivateKeyRegex: RegExp; static readonly DatadogApiKey = "10f3796eb5494075b36b7d89ae456a65"; private isFxBp; protected targetNode: ACNodeT<Env>; protected akashicUrl: AkashicUrlT<Env>; protected akashicPayUrl: AkashicPayUrlT<Env>; protected logger: Logger; protected env: Env; protected httpClient: IHttpClient; protected akashicChain: AkashicChain; static build<Env extends Environment = Environment.Production>(args: APBuilderArgs<Env>): Promise<AkashicPay<Env>>; get keyBackup(): Env extends Environment.Production ? never : KeyBackup; payout(recipientId: string, to: string, amount: string, network: NetworkSymbol, token?: TokenSymbol): Promise<IPayoutResponse>; getDepositAddress(network: NetworkSymbol, identifier: string, referenceId?: string): Promise<IDepositAddress>; getDepositUrl(identifier: string, referenceId?: string): Promise<string>; verifyDepositAddress(): unknown; lookForL2Address(aliasOrL1OrL2Address: string, network?: NetworkSymbol): Promise<ILookForL2AddressResult>; getTransfers(getTransactionParams: IGetTransactions): Promise<ITransaction[]>; getBalance(): Promise<IBalance[]>; getTransactionDetails(l2TxHash: string): Promise<ITransaction | undefined>; getSupportedCurrencies(): Promise<Record<string, string[]>>; getByOwnerAndIdentifier(getByOwnerAndIdentifierParams: IGetByOwnerAndIdentifier): Promise<IGetByOwnerAndIdentifierResponse>; createDepositOrder(createDepositOrderParams: ICreateDepositOrder): Promise<ICreateDepositOrderResponse>; getKeysByOwnerAndIdentifier(getKeysByOwnerAndIdentifierParams: IGetKeysByOwnerAndIdentifier): Promise<IKeyByOwnerAndIdentifier[]>; protected constructor(args: APConstructorArgs<Env>); protected init(args: APInitialisationArgs<Env>): Promise<void>; protected chooseBestACNode(): Promise<ACNodeT<Env>>; protected setNewOTK(): Promise<void>; protected setOtkFromKeyPair(privateKey: string, l2Address: string): void; protected setOtkFromRecoveryPhrase(recoveryPhrase: string, l2Address: string): Promise<void>; protected post<T>(url: string, payload: unknown): Promise<HTTPResponse<T>>; protected get<T>(url: string): Promise<HTTPResponse<T>>; protected prepareL2Transaction(transactionData: IPrepareL2Withdrawal): Promise<IPrepareL2WithdrawalResponse>; protected sign(otkPriv: string, data: string | Record<string, unknown>): string; }