@akashicpay/sdk
Version:
SDK to interact with the Akashic ecosystem
42 lines (41 loc) • 2.92 kB
TypeScript
import type { IKey } from '@activeledger/sdk';
import type { ActiveLedgerResponse, IKeyCreationResponse, IL2ToL1SignTransaction, IL2Transaction } from './APACTypes';
import { Environment } from './constants';
import { AkashicErrorCode } from './error';
import { type IBaseAcTransaction, NetworkSymbol, type Otk } from './types';
export declare const L2Regex: RegExp;
export declare const nitr0genNativeCoin = "#native";
export declare enum AkashicChainContracts {
Namespace = "akashicchain",
Create = "50e1372f0d3805dac4a51299bb0e99960862d7d01f247e85725d99011682b8ac@1",
CryptoTransfer = "2bae6ea681826c0307ee047ef68eb0cf53487a257c498de7d081d66de119d666@1",
DiffConsensus = "94479927cbe0860a3f51cbd36230faef7d1b69974323a83c8abcc78e3d0e8dd9@1",
Onboard = "a456ddc07da6d46a6897d24de188e767b87a9d9f2f3c617d858aaf819e0e5bce@1",
AssignKey = "7afea15e8028af9f5aeafb6db6c0d2e8969c0c0492360ab15a6bc3754b818e19@1"
}
export declare enum TestNetContracts {
Namespace = "akashicchain",
Create = "ad171259a7c628ba6993c6bd555f07111525128194aa4226662e48a0b0a93116@1",
CreateSecondaryOtk = "3030f7c2bda3a02330ef3bfd9a1a1f66fec4a96c0c04c019b64255a4e8ba31ca@1",
CryptoTransfer = "a32a8bc21ceaeeaa671573126a246c15ec4dc3a5c825e3cffc9441636019acb1@1",
DiffConsensus = "17be1db84dbf81c1ff1b2f5aebd4ba4e95d81338daf98d7c2bc7b54ad8994d1c@1",
Onboard = "c19c6f4d3c443ae7abb14d17d33b29d134df8d11bdabc568bd23f7023ee991fd@1",
AssignKey = "a6e95e2f563bdac69bfa265b1c215bf2125e1c50048f68f9c0b52982e320d675@1"
}
export declare function checkForAkashicChainError(response: ActiveLedgerResponse): AkashicErrorCode | undefined;
export declare function getACSymbol(coinSymbol: NetworkSymbol): NetworkSymbol | "trx" | "eth";
export declare function getACNetwork(coinSymbol: NetworkSymbol): "ETH" | "SEP" | "trx" | "shasta";
export declare class AkashicChain {
protected contracts: typeof AkashicChainContracts | typeof TestNetContracts;
protected dbIndex: number;
protected fxMultiSignIdentity: string;
constructor(env: Environment);
keyCreateTransaction(coinSymbol: NetworkSymbol, otk: IKey): Promise<IBaseAcTransaction>;
differentialConsensusTransaction(otk: IKey, key: IKeyCreationResponse, identifier: string): Promise<IBaseAcTransaction>;
onboardOtkTransaction(otk: IKey): Promise<IBaseAcTransaction>;
l2Transaction({ otk, coinSymbol, amount, toAddress, tokenSymbol, initiatedToNonL2, identifier, }: IL2Transaction, isFxbp?: boolean): Promise<IBaseAcTransaction>;
buildPayoutTransaction({ otk, keyLedgerId, coinSymbol, amount, toAddress, tokenSymbol, identifier, feesEstimate, ethGasPrice, }: IL2ToL1SignTransaction): Promise<IBaseAcTransaction>;
signPayoutTransaction(txn: IBaseAcTransaction, otk: Otk): Promise<IBaseAcTransaction>;
private addExpireToTxBody;
assign(ledgerId: string, otk: IKey, identifier: string): Promise<IBaseAcTransaction>;
}