@debridge-finance/solana-utils
Version:
Common utils package to power communication with Solana contracts at deBridge
48 lines • 1.62 kB
TypeScript
import { Buffer } from "buffer";
import { PublicKey, Signer, Transaction, VersionedTransaction } from "@solana/web3.js";
import BN from "bn.js";
export interface IWallet {
publicKey: PublicKey;
signTransaction: <T extends Transaction | VersionedTransaction>(tx: T, additionalSigners?: Signer[]) => Promise<T>;
signAllTransactions: <T extends Transaction | VersionedTransaction>(txs: T[], additionalSigners?: (Signer[] | undefined)[]) => Promise<T[]>;
}
export declare function isBuffer(arg: unknown): arg is Buffer;
export interface HashDeployInfoParams {
/**
* Hex-encdoded debridge id
*/
debridgeId: string;
tokenName: string;
tokenSymbol: string;
decimals: number;
}
export interface AutoParamsType {
executionFee: BNable;
flags?: number | Buffer | string;
/**
* if 0x prefix exists - hex-encoded string, else Base58-encoded pubkey
*/
fallbackAddress: string;
/**
* external call data, buffer or hex-encoded string
*/
data?: Buffer | HexString;
shortcut?: Buffer | HexString;
/**
* hex-encoded sender
*/
nativeSender: string;
}
export type HexString = string;
export type SolanaPubkey = string | PublicKey;
export type BNable = number | string | BN | Buffer;
export declare enum ContractErrors {
InsufficientLamports = "InsufficientLamports",
InsufficientFunds = "InsufficientFunds"
}
export declare enum RpcErrors {
AccountNotFound = "AccountNotFound",
InsufficientFundsForRent = "InsufficientFundsForRent",
InstructionError = "InstructionError"
}
//# sourceMappingURL=interfaces.d.ts.map