import type { DelegatedWalletClient, RawSignPreImage, ServerKeyShare, TraceContext, SignMessageContext } from '@dynamic-labs-wallet/node'; import type { Transaction } from '@solana/web3.js'; import { VersionedTransaction } from '@solana/web3.js'; export type DelegatedSvmClientConfig = { environmentId: string; baseApiUrl?: string; baseMPCRelayApiUrl?: string; apiKey: string; debug?: boolean; /** @default true — see `CoreConfig.errorLogging` */ errorLogging?: boolean; }; export type DelegatedSvmWalletClient = DelegatedWalletClient & { readonly chainName: 'SVM'; }; /** * Creates a delegated SVM wallet client for functional operations */ export declare const createDelegatedSvmWalletClient: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug, errorLogging, }: DelegatedSvmClientConfig) => DelegatedSvmWalletClient; /** * Signs a message using delegated signing for SVM */ export declare const delegatedSignMessage: (client: DelegatedSvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, message, derivationPath, isFormatted, context, onError, }: { walletId: string; /** * Optional. The `shareSetId` from the `wallet.delegation.created` * webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from * `byWalletAddress` (that's a `WalletKeyShares.id`, a different * primary key). Omit and the server resolves the right share set * by walletId + shareSetType. */ shareSetId?: string; walletApiKey: string; keyShare: ServerKeyShare; message: string; derivationPath?: Uint32Array; isFormatted?: boolean; context?: SignMessageContext; onError?: (error: Error) => void; }) => Promise; export declare const delegatedSponsorTransaction: (client: DelegatedSvmWalletClient, { transaction, userId, traceContext, }: { transaction: VersionedTransaction | Transaction; userId: string; traceContext?: TraceContext; }) => Promise; export declare const ERROR_DELEGATED_SIGN_TRANSACTION_CONTEXT_REQUIRED = "SVM transaction signing requires a chainId or an explicit context.svmTransaction."; export declare const delegatedSignTransaction: (client: DelegatedSvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, transaction, signerAddress, derivationPath, chainId, context, sponsor, userId, traceContext, onError, }: { walletId: string; /** * Optional. The `shareSetId` from the `wallet.delegation.created` * webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from * `byWalletAddress` (that's a `WalletKeyShares.id`, a different * primary key). Omit and the server resolves the right share set * by walletId + shareSetType. */ shareSetId?: string; walletApiKey: string; keyShare: any; transaction: VersionedTransaction | Transaction; signerAddress?: string; derivationPath?: Uint32Array; chainId?: string; context?: SignMessageContext; /** If true, sponsors the transaction (swapping its fee payer) before signing. */ sponsor?: boolean; /** Required when `sponsor` is true. UUID of the wallet's owner. */ userId?: string; traceContext?: TraceContext; onError?: (error: Error) => void; }) => Promise; /** * Signs a pre-formatted (raw) message using delegated signing for SVM. * The message must be a hex string representing already-hashed data. * * @param client - The delegated SVM wallet client * @param options - Signing options * @param options.walletId - The wallet ID * @param options.walletApiKey - The wallet API key * @param options.keyShare - The server key share * @param options.message - Hex string of the already-hashed data to sign * @param options.rawSign - Pre-image the digest is derived from, used to build the policy context * @param options.context - Explicit policy context, when the caller builds one itself * * @returns The base58-encoded signature * * @example * // Sign a SHA-256 hash derived from arbitrary application data * import { createHash } from 'crypto'; * const payload = Buffer.from('my application data', 'utf8').toString('hex'); * const hash = createHash('sha256').update(Buffer.from(payload, 'hex')).digest('hex'); * const signature = await delegatedSignRawMessage(client, { * walletId, * walletApiKey, * keyShare, * message: hash, * rawSign: { hashFunction: SignMessageRawSignHashFunctionEnum.Sha256, payload }, * }); * */ export declare const delegatedSignRawMessage: (client: DelegatedSvmWalletClient, { walletId, shareSetId, walletApiKey, keyShare, message, derivationPath, context, rawSign, onError, }: { walletId: string; /** * Optional. The `shareSetId` from the `wallet.delegation.created` * webhook payload — a `WaasWallets.id`. NOT `keyShares[].id` from * `byWalletAddress` (that's a `WalletKeyShares.id`, a different * primary key). Omit and the server resolves the right share set * by walletId + shareSetType. */ shareSetId?: string; walletApiKey: string; keyShare: ServerKeyShare; message: string; derivationPath?: Uint32Array; context?: SignMessageContext; rawSign?: RawSignPreImage; onError?: (error: Error) => void; }) => Promise; /** * Revoke delegation - delegates to the node package */ export declare const revokeDelegation: (client: DelegatedSvmWalletClient, { walletId }: { walletId: string; }) => Promise; //# sourceMappingURL=delegatedClient.d.ts.map