import { NearTxOutcome } from '@galacticcouncil/xc-core'; import { NearCall, NearFunctionCall } from './types'; /** * An ed25519 key a NEAR account signs with. * * - Read from the `ed25519:` base58 secret key near-cli and wallets export: * the 32 byte seed, followed by its public key or alone */ export declare class NearKeyPair { #private; readonly publicKey: Uint8Array; private constructor(); static fromSecretKey(secretKey: string): NearKeyPair; /** Base58 public key, `ed25519:` prefixed - as NEAR names access keys. */ getPublicKey(): string; sign(message: Uint8Array): Uint8Array; toString(): string; } export interface NearTransaction { signerId: string; publicKey: Uint8Array; nonce: bigint; receiverId: string; blockHash: Uint8Array; actions: NearFunctionCall[]; } /** * Borsh encoding of a NEAR transaction, function calls only. * * - Its sha256 is the transaction hash, and what the key signs */ export declare function encodeTransaction(tx: NearTransaction): Uint8Array; /** * Sign a NEAR transaction. * * @param tx - transaction to sign * @param keyPair - key of the signer account * @returns base58 transaction hash, and the borsh signed transaction */ export declare function signTransaction(tx: NearTransaction, keyPair: NearKeyPair): { hash: string; signedTx: Uint8Array; }; /** One transaction to one receiver, as a signable call. */ export declare function toNearCall(from: string, receiverId: string, actions: NearFunctionCall[]): NearCall; /** * Receipts that failed anywhere in a transaction's tree. * * - A transaction succeeds around a failed callback, e.g. a token refunding a * transfer its receiver refused */ export declare function getFailures(outcome: NearTxOutcome): { executor: string; failure: unknown; }[];