UNPKG

@akashicpay/sdk

Version:

SDK to interact with the Akashic ecosystem

51 lines (50 loc) 3.6 kB
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 StagingContracts { Namespace = "akashicdev", Create = "2c6fd805a95196b641c21e23a3d47d63570d8cb4d1025a7951ae4561e4dc5de7@1", CreateSecondaryOtk = "e719d2086a98881cd4ac620550387224216af8423bbeffe6c32945e140e7a1f8@1", CryptoTransfer = "6d67fb1befa15a27a712b7b525b6053f0c10a16089e0527b55a9be58121da248@1", DiffConsensus = "0d46b234d158b83fcc382287bbda934d5001c6e73b2a1e04e5ff4160b857ddaa@1", Onboard = "41830891180c33873532f9a8f10a5bb1f28052e98341ae2a362688e15042bae7@1", AssignKey = "d7499c07cb3bf4d3ef9f533e6c5b86ad939f2c61af7ddef8b3c73906ca216706@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" | "bnb" | "sol"; export declare function getACNetwork(coinSymbol: NetworkSymbol): "ETH" | "SEP" | "BNB" | "tBNB" | "trx" | "sol" | "shasta" | "soldev"; export declare class AkashicChain { protected contracts: typeof AkashicChainContracts | typeof TestNetContracts | typeof StagingContracts; 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, referenceId, }: IL2Transaction, isFxbp?: boolean): Promise<IBaseAcTransaction>; buildPayoutTransaction({ otk, keyLedgerId, coinSymbol, amount, toAddress, tokenSymbol, referenceId, feesEstimate, ethGasPrice, }: IL2ToL1SignTransaction): Promise<IBaseAcTransaction>; signPayoutTransaction(txn: IBaseAcTransaction, otk: Otk): Promise<IBaseAcTransaction>; private addExpireToTxBody; assign(ledgerIds: string[], otk: IKey, identifier: string): Promise<IBaseAcTransaction>; }