@turnkey/solana
Version:
Turnkey Solana Signer for @solana/web3js
49 lines • 2.35 kB
TypeScript
import { Transaction, VersionedTransaction } from "@solana/web3.js";
import type { TurnkeySDKClientBase } from "@turnkey/core";
import { TurnkeyClient } from "@turnkey/http";
import type { TurnkeyBrowserClient } from "@turnkey/sdk-browser";
import type { TurnkeyServerClient } from "@turnkey/sdk-server";
type TClient = TurnkeyClient | TurnkeyBrowserClient | TurnkeyServerClient | TurnkeySDKClientBase;
export declare class TurnkeySigner {
readonly organizationId: string;
readonly client: TClient;
constructor(input: {
organizationId: string;
client: TClient;
});
/**
* This function takes an array of Solana transactions and adds a signature with Turnkey to each of them
*
* @param txs array of Transaction | VersionedTransaction (native @solana/web3.js type)
* @param fromAddress Solana address (base58 encoded)
*/
signAllTransactions(txs: (Transaction | VersionedTransaction)[], fromAddress: string, organizationId?: string): Promise<(Transaction | VersionedTransaction)[]>;
/**
* This function takes a Solana transaction and adds a signature with Turnkey
*
* @param tx Transaction | VersionedTransaction object (native @solana/web3.js type)
* @param fromAddress Solana address (base58 encoded)
*/
addSignature(tx: Transaction | VersionedTransaction, fromAddress: string, organizationId?: string): Promise<void>;
/**
* This function takes a message and returns it after being signed with Turnkey
*
* @param message The message to sign (Uint8Array)
* @param fromAddress Solana address (base58 encoded)
*/
signMessage(message: Uint8Array, fromAddress: string, organizationId?: string): Promise<Uint8Array>;
/**
* This function takes a Solana transaction, adds a signature via Turnkey,
* and returns a new transaction
*
* @param tx Transaction | VersionedTransaction object (native @solana/web3.js type)
* @param fromAddress Solana address (base58 encoded)
*/
signTransaction(tx: Transaction | VersionedTransaction, fromAddress: string, organizationId?: string): Promise<Transaction | VersionedTransaction>;
private signTransactionImpl;
private signRawPayload;
private signRawPayloads;
private getMessageToSign;
}
export {};
//# sourceMappingURL=index.d.ts.map