@akashicpay/sdk
Version:
SDK to interact with the Akashic ecosystem
122 lines (121 loc) • 3.21 kB
TypeScript
import type { IKey } from '@activeledger/sdk';
import type { Currency, IBaseAcTransaction, ITransaction, NetworkSymbol, TokenSymbol, TransactionStatus } from './types';
export interface IPrepareL1TxnResponse {
fromAddress: string;
preparedTxn: IBaseAcTransaction;
delegatedFee?: string;
}
export declare enum FeeDelegationStrategy {
None = "None",
Delegate = "Delegate"
}
export interface PrepareTxnDto {
identity: string;
toAddress: string;
amount: string;
coinSymbol: NetworkSymbol;
tokenSymbol?: TokenSymbol;
referenceId: string;
feeDelegationStrategy?: FeeDelegationStrategy;
}
export interface IOwnerTransactionsResponse {
transactionCount: number;
transactions: ITransaction[];
transactionCountsGroupedByStatus: {
status: TransactionStatus;
count: number;
}[];
}
export interface IOwnerDetailsResponse {
readonly totalBalances: IOwnerBalancesResponse[];
readonly pendingDepositBalances?: IOwnerBalancesResponse[];
readonly pendingSendBalances?: IOwnerBalancesResponse[];
readonly ownerIdentity?: string;
readonly transactionCount?: number;
readonly isFxBp?: boolean;
}
interface IOwnerBalancesResponse {
readonly coinSymbol: NetworkSymbol;
readonly tokenSymbol?: TokenSymbol;
readonly balance: string;
}
export interface ITransactionDetailsResponse {
transaction?: ITransaction;
}
export interface ActiveLedgerResponse<ResponseT = unknown, StreamT = unknown> {
$umid: string;
$summary: {
total: number;
vote: number;
commit: number;
errors?: string[];
};
$streams: {
new: StreamT[];
updated: StreamT[];
};
$responses?: ResponseT[];
$debug?: unknown;
}
export interface IKeyCreationResponse {
id: string;
address: string;
hashes: string[];
}
export interface IL2Transaction {
otk: IKey;
coinSymbol: NetworkSymbol;
amount: string;
toAddress: string;
tokenSymbol?: TokenSymbol;
initiatedToNonL2?: string;
referenceId: string;
}
export interface IL2ToL1SignTransaction {
otk: IKey;
keyLedgerId: string;
coinSymbol: NetworkSymbol;
amount: string;
toAddress: string;
referenceId: string;
tokenSymbol?: TokenSymbol;
feesEstimate: string;
ethGasPrice?: string;
}
export interface IGetByOwnerAndIdentifierResponse {
address?: string;
unassignedLedgerId?: string;
}
export interface ICreateDepositOrderResponse {
id: string;
referenceId?: string;
identifier: string;
toAddress?: string;
coinSymbol?: NetworkSymbol;
tokenSymbol?: TokenSymbol;
requestedValue?: {
amount: string;
currency: Currency;
};
amount?: string;
exchangeRate?: string;
expires: string;
markupPercentage?: string;
}
export interface IKeyByOwnerAndIdentifier {
coinSymbol: NetworkSymbol;
address: string;
}
export interface NodeStatus {
status: number;
left: string;
right: string;
reference: string;
}
export interface IPrepareL2Withdrawal {
signedTx: IBaseAcTransaction;
}
export interface IPrepareL2WithdrawalResponse {
preparedTxn: IBaseAcTransaction;
}
export {};