signet.js 0.0.12-beta1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/index.d.ts DELETED
@@ -1,1372 +0,0 @@
1
- import BN from 'bn.js';
2
- import { TransactionRequest, Address, SignableMessage, TypedDataDefinition, Hex, PublicClient, Hash, TransactionReceipt, WalletClient } from 'viem';
3
- import * as bitcoin from 'bitcoinjs-lib';
4
- import { EncodeObject } from '@cosmjs/proto-signing';
5
- import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx';
6
- import { KeyPair } from '@near-js/crypto';
7
- import { Action as Action$1 } from '@near-js/transactions';
8
- import { TxExecutionStatus } from '@near-js/types';
9
- import { NetworkId, Action, FinalExecutionOutcome } from '@near-wallet-selector/core';
10
- import { KeyPair as KeyPair$1 } from 'near-api-js';
11
- import * as _solana_web3_js from '@solana/web3.js';
12
- import { PublicKey, AccountMeta, TransactionInstruction, Signer } from '@solana/web3.js';
13
- import { AnchorProvider } from '@coral-xyz/anchor';
14
-
15
- interface SignArgs {
16
- /** The payload to sign as an array of 32 bytes */
17
- payload: number[];
18
- /** The derivation path for key generation */
19
- path: string;
20
- /** Version of the key to use */
21
- key_version: number;
22
- }
23
- /**
24
- * Base contract interface required for compatibility with ChainAdapter instances like EVM and Bitcoin.
25
- *
26
- * See {@link EVM} and {@link Bitcoin} for example implementations.
27
- */
28
- declare abstract class BaseChainSignatureContract {
29
- /**
30
- * Gets the current signature deposit required by the contract.
31
- * This deposit amount helps manage network congestion.
32
- *
33
- * @returns Promise resolving to the required deposit amount as a BigNumber
34
- */
35
- abstract getCurrentSignatureDeposit(): Promise<BN>;
36
- /**
37
- * Derives a child public key using a\ derivation path and predecessor.
38
- *
39
- * @param args - Arguments for key derivation
40
- * @param args.path - The string path to use derive the key
41
- * @param args.predecessor - The id/address of the account requesting signature
42
- * @returns Promise resolving to the derived SEC1 uncompressed public key
43
- */
44
- abstract getDerivedPublicKey(args: {
45
- path: string;
46
- predecessor: string;
47
- } & Record<string, unknown>): Promise<UncompressedPubKeySEC1>;
48
- }
49
- /**
50
- * Full contract interface that extends BaseChainSignatureContract to provide all Sig Network Smart Contract capabilities.
51
- */
52
- declare abstract class ChainSignatureContract$3 extends BaseChainSignatureContract {
53
- /**
54
- * Signs a payload using Sig Network MPC.
55
- *
56
- * @param args - Arguments for the signing operation
57
- * @param args.payload - The data to sign as an array of 32 bytes
58
- * @param args.path - The string path to use derive the key
59
- * @param args.key_version - Version of the key to use
60
- * @returns Promise resolving to the RSV signature
61
- */
62
- abstract sign(args: SignArgs & Record<string, unknown>): Promise<RSVSignature>;
63
- /**
64
- * Gets the public key associated with this contract instance.
65
- *
66
- * @returns Promise resolving to the SEC1 uncompressed public key
67
- */
68
- abstract getPublicKey(): Promise<UncompressedPubKeySEC1>;
69
- }
70
-
71
- type HashToSign = SignArgs['payload'];
72
- type Base58String = string;
73
- type NajPublicKey = `secp256k1:${Base58String}`;
74
- type UncompressedPubKeySEC1 = `04${string}`;
75
- type CompressedPubKeySEC1 = `02${string}` | `03${string}`;
76
- type KeyDerivationPath = string;
77
- interface RSVSignature {
78
- r: string;
79
- s: string;
80
- v: number;
81
- }
82
- interface NearNearMpcSignature {
83
- big_r: {
84
- affine_point: string;
85
- };
86
- s: {
87
- scalar: string;
88
- };
89
- recovery_id: number;
90
- }
91
- interface SigNetNearMpcSignature {
92
- big_r: string;
93
- s: string;
94
- recovery_id: number;
95
- }
96
- interface SigNetEvmMpcSignature {
97
- bigR: {
98
- x: bigint;
99
- y: bigint;
100
- };
101
- s: bigint;
102
- recoveryId: number;
103
- }
104
- type MPCSignature = NearNearMpcSignature | SigNetNearMpcSignature | SigNetEvmMpcSignature;
105
-
106
- declare const ENVS: {
107
- readonly TESTNET_DEV: "TESTNET_DEV";
108
- readonly TESTNET: "TESTNET";
109
- readonly MAINNET: "MAINNET";
110
- };
111
- declare const CHAINS: {
112
- readonly ETHEREUM: "ETHEREUM";
113
- readonly NEAR: "NEAR";
114
- readonly SOLANA: "SOLANA";
115
- };
116
- /**
117
- * Root public keys for the Sig Network Smart Contracts across different environments.
118
- *
119
- * These keys should never change.
120
- */
121
- declare const ROOT_PUBLIC_KEYS: Record<keyof typeof ENVS, NajPublicKey>;
122
- /**
123
- * Chain IDs used in the key derivation function (KDF) for deriving child public keys to
124
- * distinguish between different chains.
125
- *
126
- * @see {@link deriveChildPublicKey} in cryptography.ts for usage details
127
- */
128
- declare const KDF_CHAIN_IDS: {
129
- readonly ETHEREUM: "0x1";
130
- readonly NEAR: "0x18d";
131
- readonly SOLANA: "0x800001f5";
132
- };
133
- /**
134
- * Contract addresses for different chains and environments.
135
- *
136
- * - Testnet Dev: Used for internal development, very unstable
137
- * - Testnet: Used for external development, stable
138
- * - Mainnet: Production contract address
139
- *
140
- * @see ChainSignatureContract documentation for implementation details
141
- */
142
- declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Record<keyof typeof ENVS, string>>;
143
-
144
- declare const constants_CHAINS: typeof CHAINS;
145
- declare const constants_CONTRACT_ADDRESSES: typeof CONTRACT_ADDRESSES;
146
- declare const constants_ENVS: typeof ENVS;
147
- declare const constants_KDF_CHAIN_IDS: typeof KDF_CHAIN_IDS;
148
- declare const constants_ROOT_PUBLIC_KEYS: typeof ROOT_PUBLIC_KEYS;
149
- declare namespace constants {
150
- export { constants_CHAINS as CHAINS, constants_CONTRACT_ADDRESSES as CONTRACT_ADDRESSES, constants_ENVS as ENVS, constants_KDF_CHAIN_IDS as KDF_CHAIN_IDS, constants_ROOT_PUBLIC_KEYS as ROOT_PUBLIC_KEYS };
151
- }
152
-
153
- declare const toRSV: (signature: MPCSignature) => RSVSignature;
154
- /**
155
- * Compresses an uncompressed public key to its compressed format following SEC1 standards.
156
- * In SEC1, a compressed public key consists of a prefix (02 or 03) followed by the x-coordinate.
157
- * The prefix indicates whether the y-coordinate is even (02) or odd (03).
158
- *
159
- * @param uncompressedPubKeySEC1 - The uncompressed public key in hex format, with or without '04' prefix
160
- * @returns The compressed public key in hex format
161
- * @throws Error if the uncompressed public key length is invalid
162
- */
163
- declare const compressPubKey: (uncompressedPubKeySEC1: UncompressedPubKeySEC1) => string;
164
- /**
165
- * Converts a NAJ public key to an uncompressed SEC1 public key.
166
- *
167
- * @param najPublicKey - The NAJ public key to convert (e.g. secp256k1:3Ww8iFjqTHufye5aRGUvrQqETegR4gVUcW8FX5xzscaN9ENhpkffojsxJwi6N1RbbHMTxYa9UyKeqK3fsMuwxjR5)
168
- * @returns The uncompressed SEC1 public key (e.g. 04 || x || y)
169
- */
170
- declare const najToUncompressedPubKeySEC1: (najPublicKey: NajPublicKey) => UncompressedPubKeySEC1;
171
- /**
172
- * Derives a child public key from a parent public key using the sig.network v1.0.0 epsilon derivation scheme.
173
- * The parent public keys are defined in @constants.ts
174
- *
175
- * @param najPublicKey - The parent public key in uncompressed SEC1 format (e.g. 04 || x || y)
176
- * @param predecessorId - The predecessor ID is the address of the account calling the signer contract (e.g EOA or Contract Address)
177
- * @param path - Optional derivation path suffix (defaults to empty string)
178
- * @returns The derived child public key in uncompressed SEC1 format (04 || x || y)
179
- */
180
- declare function deriveChildPublicKey(rootUncompressedPubKeySEC1: UncompressedPubKeySEC1, predecessorId: string, path: string | undefined, chainId: string): UncompressedPubKeySEC1;
181
-
182
- declare const cryptography_compressPubKey: typeof compressPubKey;
183
- declare const cryptography_deriveChildPublicKey: typeof deriveChildPublicKey;
184
- declare const cryptography_najToUncompressedPubKeySEC1: typeof najToUncompressedPubKeySEC1;
185
- declare const cryptography_toRSV: typeof toRSV;
186
- declare namespace cryptography {
187
- export { cryptography_compressPubKey as compressPubKey, cryptography_deriveChildPublicKey as deriveChildPublicKey, cryptography_najToUncompressedPubKeySEC1 as najToUncompressedPubKeySEC1, cryptography_toRSV as toRSV };
188
- }
189
-
190
- declare const index$8_cryptography: typeof cryptography;
191
- declare namespace index$8 {
192
- export { index$8_cryptography as cryptography };
193
- }
194
-
195
- declare abstract class ChainAdapter<TransactionRequest, UnsignedTransaction> {
196
- /**
197
- * Gets the native token balance and decimals for a given address
198
- *
199
- * @param address - The address to check
200
- * @returns Promise resolving to an object containing:
201
- * - balance: The balance as a bigint, in the chain's base units
202
- * - decimals: The number of decimals used to format the balance
203
- */
204
- abstract getBalance(address: string): Promise<{
205
- balance: bigint;
206
- decimals: number;
207
- }>;
208
- /**
209
- * Uses Sig Network Key Derivation Function to derive the address and public key. from a signer ID and string path.
210
- *
211
- * @param predecessor - The id/address of the account requesting signature
212
- * @param path - The string path used to derive the key
213
- * @returns Promise resolving to the derived address and public key
214
- */
215
- abstract deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
216
- address: string;
217
- publicKey: string;
218
- }>;
219
- /**
220
- * Serializes an unsigned transaction to a string format.
221
- * This is useful for storing or transmitting the transaction.
222
- *
223
- * @param transaction - The unsigned transaction to serialize
224
- * @returns The serialized transaction string
225
- */
226
- abstract serializeTransaction(transaction: UnsignedTransaction): string;
227
- /**
228
- * Deserializes a transaction string back into an unsigned transaction object.
229
- * This reverses the serialization done by serializeTransaction().
230
- *
231
- * @param serialized - The serialized transaction string
232
- * @returns The deserialized unsigned transaction
233
- */
234
- abstract deserializeTransaction(serialized: string): UnsignedTransaction;
235
- /**
236
- * Prepares a transaction for Sig Network MPC signing by creating the necessary payloads.
237
- * This method handles chain-specific transaction preparation including:
238
- * - Fee calculation
239
- * - Nonce/sequence management
240
- * - UTXO selection (for UTXO-based chains)
241
- * - Transaction encoding
242
- *
243
- * @param transactionRequest - The transaction request containing parameters like recipient, amount, etc.
244
- * @returns Promise resolving to an object containing:
245
- * - transaction: The unsigned transaction
246
- * - hashesToSign: Array of payloads to be signed by MPC. The order of these payloads must match
247
- * the order of signatures provided to finalizeTransactionSigning()
248
- */
249
- abstract prepareTransactionForSigning(transactionRequest: TransactionRequest): Promise<{
250
- transaction: UnsignedTransaction;
251
- hashesToSign: HashToSign[];
252
- }>;
253
- /**
254
- * Adds Sig Network MPC-generated signatures to an unsigned transaction.
255
- *
256
- * @param params - Parameters for adding signatures
257
- * @param params.transaction - The unsigned transaction to add signatures to
258
- * @param params.rsvSignatures - Array of RSV signatures generated through MPC. Must be in the same order
259
- * as the payloads returned by prepareTransactionForSigning()
260
- * @returns The serialized signed transaction ready for broadcast
261
- */
262
- abstract finalizeTransactionSigning(params: {
263
- transaction: UnsignedTransaction;
264
- rsvSignatures: RSVSignature[];
265
- }): string;
266
- /**
267
- * Broadcasts a signed transaction to the network.
268
- *
269
- * @param txSerialized - The serialized signed transaction
270
- * @returns Promise resolving to the transaction hash/ID
271
- */
272
- abstract broadcastTx(txSerialized: string): Promise<string>;
273
- }
274
-
275
- type EVMUnsignedTransaction = TransactionRequest & {
276
- type: 'eip1559';
277
- chainId: number;
278
- };
279
- interface EVMTransactionRequest extends Omit<EVMUnsignedTransaction, 'chainId' | 'type'> {
280
- from: Address;
281
- }
282
- type EVMMessage = SignableMessage;
283
- type EVMTypedData = TypedDataDefinition;
284
- interface UserOperationV7 {
285
- sender: Hex;
286
- nonce: Hex;
287
- factory: Hex;
288
- factoryData: Hex;
289
- callData: Hex;
290
- callGasLimit: Hex;
291
- verificationGasLimit: Hex;
292
- preVerificationGas: Hex;
293
- maxFeePerGas: Hex;
294
- maxPriorityFeePerGas: Hex;
295
- paymaster: Hex;
296
- paymasterVerificationGasLimit: Hex;
297
- paymasterPostOpGasLimit: Hex;
298
- paymasterData: Hex;
299
- signature: Hex;
300
- }
301
- interface UserOperationV6 {
302
- sender: Hex;
303
- nonce: Hex;
304
- initCode: Hex;
305
- callData: Hex;
306
- callGasLimit: Hex;
307
- verificationGasLimit: Hex;
308
- preVerificationGas: Hex;
309
- maxFeePerGas: Hex;
310
- maxPriorityFeePerGas: Hex;
311
- paymasterAndData: Hex;
312
- signature: Hex;
313
- }
314
-
315
- /**
316
- * Implementation of the ChainAdapter interface for EVM-compatible networks.
317
- * Handles interactions with Ethereum Virtual Machine based blockchains like Ethereum, BSC, Polygon, etc.
318
- */
319
- declare class EVM extends ChainAdapter<EVMTransactionRequest, EVMUnsignedTransaction> {
320
- private readonly client;
321
- private readonly contract;
322
- /**
323
- * Creates a new EVM chain instance
324
- * @param params - Configuration parameters
325
- * @param params.publicClient - A Viem PublicClient instance for reading from the blockchain
326
- * @param params.contract - Instance of the chain signature contract for MPC operations
327
- */
328
- constructor({ publicClient, contract, }: {
329
- publicClient: PublicClient;
330
- contract: BaseChainSignatureContract;
331
- });
332
- private attachGasAndNonce;
333
- private transformRSVSignature;
334
- private assembleSignature;
335
- deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
336
- address: string;
337
- publicKey: string;
338
- }>;
339
- getBalance(address: string): Promise<{
340
- balance: bigint;
341
- decimals: number;
342
- }>;
343
- serializeTransaction(transaction: EVMUnsignedTransaction): `0x${string}`;
344
- deserializeTransaction(serialized: `0x${string}`): EVMUnsignedTransaction;
345
- prepareTransactionForSigning(transactionRequest: EVMTransactionRequest): Promise<{
346
- transaction: EVMUnsignedTransaction;
347
- hashesToSign: HashToSign[];
348
- }>;
349
- prepareMessageForSigning(message: EVMMessage): Promise<{
350
- hashToSign: HashToSign;
351
- }>;
352
- prepareTypedDataForSigning(typedDataRequest: EVMTypedData): Promise<{
353
- hashToSign: HashToSign;
354
- }>;
355
- /**
356
- * This implementation is a common step for Biconomy and Alchemy.
357
- * Key differences between implementations:
358
- * - Signature format: Biconomy omits 0x00 prefix when concatenating, Alchemy includes it
359
- * - Version support: Biconomy only supports v6, Alchemy supports both v6 and v7
360
- * - Validation: Biconomy uses modules for signature validation, Alchemy uses built-in validation
361
- */
362
- prepareUserOpForSigning(userOp: UserOperationV7 | UserOperationV6, entryPointAddress?: Address, chainIdArgs?: number): Promise<{
363
- userOp: UserOperationV7 | UserOperationV6;
364
- hashToSign: HashToSign;
365
- }>;
366
- finalizeTransactionSigning({ transaction, rsvSignatures, }: {
367
- transaction: EVMUnsignedTransaction;
368
- rsvSignatures: RSVSignature[];
369
- }): `0x02${string}`;
370
- finalizeMessageSigning({ rsvSignature, }: {
371
- rsvSignature: RSVSignature;
372
- }): Hex;
373
- finalizeTypedDataSigning({ rsvSignature, }: {
374
- rsvSignature: RSVSignature;
375
- }): Hex;
376
- finalizeUserOpSigning({ userOp, rsvSignature, }: {
377
- userOp: UserOperationV7 | UserOperationV6;
378
- rsvSignature: RSVSignature;
379
- }): UserOperationV7 | UserOperationV6;
380
- broadcastTx(txSerialized: `0x${string}`): Promise<Hash>;
381
- }
382
-
383
- interface EVMFeeProperties {
384
- gas: bigint;
385
- maxFeePerGas: bigint;
386
- maxPriorityFeePerGas: bigint;
387
- }
388
- declare function fetchEVMFeeProperties(client: PublicClient, transaction: TransactionRequest): Promise<EVMFeeProperties>;
389
-
390
- type index$7_EVM = EVM;
391
- declare const index$7_EVM: typeof EVM;
392
- type index$7_EVMMessage = EVMMessage;
393
- type index$7_EVMTransactionRequest = EVMTransactionRequest;
394
- type index$7_EVMTypedData = EVMTypedData;
395
- type index$7_EVMUnsignedTransaction = EVMUnsignedTransaction;
396
- declare const index$7_fetchEVMFeeProperties: typeof fetchEVMFeeProperties;
397
- declare namespace index$7 {
398
- export { index$7_EVM as EVM, type index$7_EVMMessage as EVMMessage, type index$7_EVMTransactionRequest as EVMTransactionRequest, type index$7_EVMTypedData as EVMTypedData, type index$7_EVMUnsignedTransaction as EVMUnsignedTransaction, index$7_fetchEVMFeeProperties as fetchEVMFeeProperties };
399
- }
400
-
401
- interface BTCTransaction$1 {
402
- vout: Array<{
403
- scriptpubkey: string;
404
- value: number;
405
- }>;
406
- }
407
- interface BTCInput {
408
- txid: string;
409
- vout: number;
410
- value: number;
411
- scriptPubKey: Buffer;
412
- }
413
- type BTCOutput = {
414
- value: number;
415
- } | {
416
- address: string;
417
- value: number;
418
- } | {
419
- script: Buffer;
420
- value: number;
421
- };
422
- type BTCTransactionRequest = {
423
- publicKey: string;
424
- } & ({
425
- inputs: BTCInput[];
426
- outputs: BTCOutput[];
427
- from?: never;
428
- to?: never;
429
- value?: never;
430
- } | {
431
- inputs?: never;
432
- outputs?: never;
433
- from: string;
434
- to: string;
435
- value: string;
436
- });
437
- interface BTCUnsignedTransaction {
438
- psbt: bitcoin.Psbt;
439
- publicKey: string;
440
- }
441
- type BTCNetworkIds = 'mainnet' | 'testnet' | 'regtest';
442
-
443
- declare abstract class BTCRpcAdapter {
444
- abstract selectUTXOs(from: string, targets: BTCOutput[]): Promise<{
445
- inputs: BTCInput[];
446
- outputs: BTCOutput[];
447
- }>;
448
- abstract broadcastTransaction(transactionHex: string): Promise<string>;
449
- abstract getBalance(address: string): Promise<number>;
450
- abstract getTransaction(txid: string): Promise<BTCTransaction$1>;
451
- }
452
-
453
- declare class Mempool extends BTCRpcAdapter {
454
- private readonly providerUrl;
455
- constructor(providerUrl: string);
456
- private fetchFeeRate;
457
- private fetchUTXOs;
458
- selectUTXOs(from: string, targets: BTCOutput[], confirmationTarget?: number): Promise<{
459
- inputs: BTCInput[];
460
- outputs: BTCOutput[];
461
- }>;
462
- broadcastTransaction(transactionHex: string): Promise<string>;
463
- getBalance(address: string): Promise<number>;
464
- getTransaction(txid: string): Promise<BTCTransaction$1>;
465
- }
466
-
467
- declare const BTCRpcAdapters: {
468
- Mempool: typeof Mempool;
469
- };
470
-
471
- /**
472
- * Implementation of the ChainAdapter interface for Bitcoin network.
473
- * Handles interactions with both Bitcoin mainnet and testnet, supporting P2WPKH transactions.
474
- */
475
- declare class Bitcoin extends ChainAdapter<BTCTransactionRequest, BTCUnsignedTransaction> {
476
- private static readonly SATOSHIS_PER_BTC;
477
- private readonly network;
478
- private readonly btcRpcAdapter;
479
- private readonly contract;
480
- /**
481
- * Creates a new Bitcoin chain instance
482
- * @param params - Configuration parameters
483
- * @param params.network - Network identifier (mainnet/testnet)
484
- * @param params.contract - Instance of the chain signature contract for MPC operations
485
- * @param params.btcRpcAdapter - Bitcoin RPC adapter for network interactions
486
- */
487
- constructor({ network, contract, btcRpcAdapter, }: {
488
- network: BTCNetworkIds;
489
- contract: BaseChainSignatureContract;
490
- btcRpcAdapter: BTCRpcAdapter;
491
- });
492
- /**
493
- * Converts satoshis to BTC
494
- * @param satoshis - Amount in satoshis
495
- * @returns Amount in BTC
496
- */
497
- static toBTC(satoshis: number): number;
498
- /**
499
- * Converts BTC to satoshis
500
- * @param btc - Amount in BTC
501
- * @returns Amount in satoshis (rounded)
502
- */
503
- static toSatoshi(btc: number): number;
504
- private fetchTransaction;
505
- private static transformRSVSignature;
506
- /**
507
- * Creates a Partially Signed Bitcoin Transaction (PSBT)
508
- * @param params - Parameters for creating the PSBT
509
- * @param params.transactionRequest - Transaction request containing inputs and outputs
510
- * @returns Created PSBT instance
511
- */
512
- createPSBT({ transactionRequest, }: {
513
- transactionRequest: BTCTransactionRequest;
514
- }): Promise<bitcoin.Psbt>;
515
- getBalance(address: string): Promise<{
516
- balance: bigint;
517
- decimals: number;
518
- }>;
519
- deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
520
- address: string;
521
- publicKey: string;
522
- }>;
523
- serializeTransaction(transaction: BTCUnsignedTransaction): string;
524
- deserializeTransaction(serialized: string): BTCUnsignedTransaction;
525
- prepareTransactionForSigning(transactionRequest: BTCTransactionRequest): Promise<{
526
- transaction: BTCUnsignedTransaction;
527
- hashesToSign: HashToSign[];
528
- }>;
529
- finalizeTransactionSigning({ transaction: { psbt, publicKey }, rsvSignatures, }: {
530
- transaction: BTCUnsignedTransaction;
531
- rsvSignatures: RSVSignature[];
532
- }): string;
533
- broadcastTx(txSerialized: string): Promise<string>;
534
- }
535
-
536
- type index$6_BTCInput = BTCInput;
537
- type index$6_BTCNetworkIds = BTCNetworkIds;
538
- type index$6_BTCOutput = BTCOutput;
539
- type index$6_BTCRpcAdapter = BTCRpcAdapter;
540
- declare const index$6_BTCRpcAdapter: typeof BTCRpcAdapter;
541
- declare const index$6_BTCRpcAdapters: typeof BTCRpcAdapters;
542
- type index$6_BTCTransactionRequest = BTCTransactionRequest;
543
- type index$6_BTCUnsignedTransaction = BTCUnsignedTransaction;
544
- type index$6_Bitcoin = Bitcoin;
545
- declare const index$6_Bitcoin: typeof Bitcoin;
546
- declare namespace index$6 {
547
- export { type index$6_BTCInput as BTCInput, type index$6_BTCNetworkIds as BTCNetworkIds, type index$6_BTCOutput as BTCOutput, index$6_BTCRpcAdapter as BTCRpcAdapter, index$6_BTCRpcAdapters as BTCRpcAdapters, type BTCTransaction$1 as BTCTransaction, type index$6_BTCTransactionRequest as BTCTransactionRequest, type index$6_BTCUnsignedTransaction as BTCUnsignedTransaction, index$6_Bitcoin as Bitcoin };
548
- }
549
-
550
- type CosmosNetworkIds = string;
551
- type CosmosUnsignedTransaction = TxRaw;
552
- interface CosmosTransactionRequest {
553
- address: string;
554
- publicKey: string;
555
- messages: EncodeObject[];
556
- memo?: string;
557
- gas?: number;
558
- }
559
-
560
- /**
561
- * Implementation of the ChainAdapter interface for Cosmos-based networks.
562
- * Handles interactions with Cosmos SDK chains like Cosmos Hub, Osmosis, etc.
563
- */
564
- declare class Cosmos extends ChainAdapter<CosmosTransactionRequest, CosmosUnsignedTransaction> {
565
- private readonly registry;
566
- private readonly chainId;
567
- private readonly contract;
568
- private readonly endpoints?;
569
- /**
570
- * Creates a new Cosmos chain instance
571
- * @param params - Configuration parameters
572
- * @param params.chainId - Chain id for the Cosmos network
573
- * @param params.contract - Instance of the chain signature contract for MPC operations
574
- * @param params.endpoints - Optional RPC and REST endpoints
575
- * @param params.endpoints.rpcUrl - Optional RPC endpoint URL
576
- * @param params.endpoints.restUrl - Optional REST endpoint URL
577
- */
578
- constructor({ chainId, contract, endpoints, }: {
579
- contract: BaseChainSignatureContract;
580
- chainId: CosmosNetworkIds;
581
- endpoints?: {
582
- rpcUrl?: string;
583
- restUrl?: string;
584
- };
585
- });
586
- private transformRSVSignature;
587
- private getChainInfo;
588
- getBalance(address: string): Promise<{
589
- balance: bigint;
590
- decimals: number;
591
- }>;
592
- deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
593
- address: string;
594
- publicKey: string;
595
- }>;
596
- serializeTransaction(transaction: CosmosUnsignedTransaction): string;
597
- deserializeTransaction(serialized: string): CosmosUnsignedTransaction;
598
- prepareTransactionForSigning(transactionRequest: CosmosTransactionRequest): Promise<{
599
- transaction: CosmosUnsignedTransaction;
600
- hashesToSign: HashToSign[];
601
- }>;
602
- finalizeTransactionSigning({ transaction, rsvSignatures, }: {
603
- transaction: CosmosUnsignedTransaction;
604
- rsvSignatures: RSVSignature[];
605
- }): string;
606
- broadcastTx(txSerialized: string): Promise<string>;
607
- }
608
-
609
- type index$5_Cosmos = Cosmos;
610
- declare const index$5_Cosmos: typeof Cosmos;
611
- type index$5_CosmosNetworkIds = CosmosNetworkIds;
612
- type index$5_CosmosTransactionRequest = CosmosTransactionRequest;
613
- type index$5_CosmosUnsignedTransaction = CosmosUnsignedTransaction;
614
- declare namespace index$5 {
615
- export { index$5_Cosmos as Cosmos, type index$5_CosmosNetworkIds as CosmosNetworkIds, type index$5_CosmosTransactionRequest as CosmosTransactionRequest, type index$5_CosmosUnsignedTransaction as CosmosUnsignedTransaction };
616
- }
617
-
618
- type index$4_ChainAdapter<TransactionRequest, UnsignedTransaction> = ChainAdapter<TransactionRequest, UnsignedTransaction>;
619
- declare const index$4_ChainAdapter: typeof ChainAdapter;
620
- declare namespace index$4 {
621
- export { index$4_ChainAdapter as ChainAdapter, index$6 as btc, index$5 as cosmos, index$7 as evm };
622
- }
623
-
624
- type ChainSignatureContractIds = string;
625
- type NearNetworkIds = 'mainnet' | 'testnet';
626
- interface ChainProvider {
627
- providerUrl: string;
628
- contract: ChainSignatureContractIds;
629
- }
630
- interface NearAuthentication {
631
- networkId: NearNetworkIds;
632
- accountId: string;
633
- }
634
- interface SuccessResponse {
635
- transactionHash: string;
636
- success: true;
637
- }
638
- interface FailureResponse {
639
- success: false;
640
- errorMessage: string;
641
- }
642
- type Response = SuccessResponse | FailureResponse;
643
- type EVMChainConfigWithProviders = ChainProvider;
644
- interface EVMRequest {
645
- transaction: EVMTransactionRequest;
646
- chainConfig: EVMChainConfigWithProviders;
647
- nearAuthentication: NearAuthentication;
648
- fastAuthRelayerUrl?: string;
649
- derivationPath: KeyDerivationPath;
650
- }
651
- type BTCChainConfigWithProviders = ChainProvider & {
652
- network: BTCNetworkIds;
653
- };
654
- interface BitcoinRequest {
655
- transaction: BTCTransactionRequest;
656
- chainConfig: BTCChainConfigWithProviders;
657
- nearAuthentication: NearAuthentication;
658
- fastAuthRelayerUrl?: string;
659
- derivationPath: KeyDerivationPath;
660
- }
661
- interface CosmosChainConfig {
662
- contract: ChainSignatureContractIds;
663
- chainId: CosmosNetworkIds;
664
- }
665
- interface CosmosRequest {
666
- chainConfig: CosmosChainConfig;
667
- transaction: CosmosTransactionRequest;
668
- nearAuthentication: NearAuthentication;
669
- derivationPath: KeyDerivationPath;
670
- fastAuthRelayerUrl?: string;
671
- }
672
-
673
- declare const EVMTransaction: (req: EVMRequest, keyPair: KeyPair) => Promise<Response>;
674
- declare const BTCTransaction: (req: BitcoinRequest, keyPair: KeyPair) => Promise<Response>;
675
- declare const CosmosTransaction: (req: CosmosRequest, keyPair: KeyPair) => Promise<Response>;
676
-
677
- declare const keypair_BTCTransaction: typeof BTCTransaction;
678
- declare const keypair_CosmosTransaction: typeof CosmosTransaction;
679
- declare const keypair_EVMTransaction: typeof EVMTransaction;
680
- declare namespace keypair {
681
- export { keypair_BTCTransaction as BTCTransaction, keypair_CosmosTransaction as CosmosTransaction, keypair_EVMTransaction as EVMTransaction };
682
- }
683
-
684
- declare const signAndSend_keypair: typeof keypair;
685
- declare namespace signAndSend {
686
- export { signAndSend_keypair as keypair };
687
- }
688
-
689
- declare const mpcPayloadsToChainSigTransaction: ({ networkId, contractId, hashesToSign, path, }: {
690
- networkId: NetworkId;
691
- contractId: ChainSignatureContractIds;
692
- hashesToSign: HashToSign[];
693
- path: KeyDerivationPath;
694
- }) => Promise<{
695
- receiverId: string;
696
- actions: Action[];
697
- }>;
698
- declare const responseToMpcSignature: ({ response, }: {
699
- response: FinalExecutionOutcome;
700
- }) => RSVSignature | undefined;
701
- interface SendTransactionOptions {
702
- until: TxExecutionStatus;
703
- retryCount: number;
704
- delay: number;
705
- nodeUrl: string;
706
- }
707
- declare const sendTransactionUntil: ({ accountId, keypair, networkId, receiverId, actions, nonce, options, }: {
708
- accountId: string;
709
- keypair: KeyPair$1;
710
- networkId: NetworkId;
711
- receiverId: string;
712
- actions: Action$1[];
713
- nonce?: number;
714
- options?: SendTransactionOptions;
715
- }) => Promise<FinalExecutionOutcome>;
716
-
717
- type transaction_SendTransactionOptions = SendTransactionOptions;
718
- declare const transaction_mpcPayloadsToChainSigTransaction: typeof mpcPayloadsToChainSigTransaction;
719
- declare const transaction_responseToMpcSignature: typeof responseToMpcSignature;
720
- declare const transaction_sendTransactionUntil: typeof sendTransactionUntil;
721
- declare namespace transaction {
722
- export { type transaction_SendTransactionOptions as SendTransactionOptions, transaction_mpcPayloadsToChainSigTransaction as mpcPayloadsToChainSigTransaction, transaction_responseToMpcSignature as responseToMpcSignature, transaction_sendTransactionUntil as sendTransactionUntil };
723
- }
724
-
725
- interface ChainSignatureContractArgs {
726
- networkId: NearNetworkIds;
727
- contractId: ChainSignatureContractIds;
728
- accountId?: string;
729
- keypair?: KeyPair;
730
- rootPublicKey?: NajPublicKey;
731
- sendTransactionOptions?: SendTransactionOptions;
732
- }
733
- /**
734
- * Implementation of the ChainSignatureContract for NEAR chains.
735
- *
736
- * This class provides an interface to interact with the ChainSignatures contract
737
- * deployed on NEAR. It supports both view methods (which don't require authentication)
738
- * and change methods (which require a valid NEAR account and keypair).
739
- *
740
- * @extends AbstractChainSignatureContract
741
- */
742
- declare class ChainSignatureContract$2 extends ChainSignatureContract$3 {
743
- private readonly networkId;
744
- private readonly contractId;
745
- private readonly accountId;
746
- private readonly keypair;
747
- private readonly rootPublicKey?;
748
- private readonly sendTransactionOptions?;
749
- /**
750
- * Creates a new instance of the ChainSignatureContract for NEAR chains.
751
- *
752
- * @param args - Configuration options for the contract
753
- * @param args.networkId - The NEAR network ID (e.g. 'testnet', 'mainnet')
754
- * @param args.contractId - The contract ID of the deployed ChainSignatures contract
755
- * @param args.accountId - Optional NEAR account ID for signing transactions. Required for change methods.
756
- * @param args.keypair - Optional NEAR KeyPair for signing transactions. Required for change methods.
757
- * @param args.rootPublicKey - Optional root public key for the contract. If not provided, it will be derived from the contract ID.
758
- * @param args.sendTransactionOptions - Optional configuration for transaction sending behavior.
759
- */
760
- constructor({ networkId, contractId, accountId, keypair, rootPublicKey, sendTransactionOptions, }: ChainSignatureContractArgs);
761
- private getContract;
762
- getCurrentSignatureDeposit(): Promise<BN>;
763
- getDerivedPublicKey(args: {
764
- path: string;
765
- predecessor: string;
766
- }): Promise<UncompressedPubKeySEC1>;
767
- getPublicKey(): Promise<UncompressedPubKeySEC1>;
768
- sign(args: SignArgs, options?: {
769
- nonce?: number;
770
- }): Promise<RSVSignature>;
771
- private requireAccount;
772
- }
773
-
774
- declare const utils$2: {
775
- transaction: typeof transaction;
776
- signAndSend: typeof signAndSend;
777
- };
778
-
779
- declare namespace index$3 {
780
- export { ChainSignatureContract$2 as ChainSignatureContract, utils$2 as utils };
781
- }
782
-
783
- declare const abi: ({
784
- inputs: {
785
- internalType: string;
786
- name: string;
787
- type: string;
788
- }[];
789
- stateMutability: string;
790
- type: string;
791
- name?: undefined;
792
- anonymous?: undefined;
793
- outputs?: undefined;
794
- } | {
795
- inputs: {
796
- internalType: string;
797
- name: string;
798
- type: string;
799
- }[];
800
- name: string;
801
- type: string;
802
- stateMutability?: undefined;
803
- anonymous?: undefined;
804
- outputs?: undefined;
805
- } | {
806
- anonymous: boolean;
807
- inputs: ({
808
- indexed: boolean;
809
- internalType: string;
810
- name: string;
811
- type: string;
812
- components?: undefined;
813
- } | {
814
- components: ({
815
- components: {
816
- internalType: string;
817
- name: string;
818
- type: string;
819
- }[];
820
- internalType: string;
821
- name: string;
822
- type: string;
823
- } | {
824
- internalType: string;
825
- name: string;
826
- type: string;
827
- components?: undefined;
828
- })[];
829
- indexed: boolean;
830
- internalType: string;
831
- name: string;
832
- type: string;
833
- })[];
834
- name: string;
835
- type: string;
836
- stateMutability?: undefined;
837
- outputs?: undefined;
838
- } | {
839
- inputs: {
840
- internalType: string;
841
- name: string;
842
- type: string;
843
- }[];
844
- name: string;
845
- outputs: {
846
- internalType: string;
847
- name: string;
848
- type: string;
849
- }[];
850
- stateMutability: string;
851
- type: string;
852
- anonymous?: undefined;
853
- } | {
854
- inputs: {
855
- components: ({
856
- internalType: string;
857
- name: string;
858
- type: string;
859
- components?: undefined;
860
- } | {
861
- components: ({
862
- components: {
863
- internalType: string;
864
- name: string;
865
- type: string;
866
- }[];
867
- internalType: string;
868
- name: string;
869
- type: string;
870
- } | {
871
- internalType: string;
872
- name: string;
873
- type: string;
874
- components?: undefined;
875
- })[];
876
- internalType: string;
877
- name: string;
878
- type: string;
879
- })[];
880
- internalType: string;
881
- name: string;
882
- type: string;
883
- }[];
884
- name: string;
885
- outputs: never[];
886
- stateMutability: string;
887
- type: string;
888
- anonymous?: undefined;
889
- })[];
890
-
891
- declare const ChainSignaturesContractABI_abi: typeof abi;
892
- declare namespace ChainSignaturesContractABI {
893
- export { ChainSignaturesContractABI_abi as abi };
894
- }
895
-
896
- declare class ChainSignatureError extends Error {
897
- requestId: `0x${string}`;
898
- receipt: TransactionReceipt;
899
- constructor(message: string, requestId: `0x${string}`, receipt: TransactionReceipt);
900
- }
901
- declare class SignatureNotFoundError$1 extends ChainSignatureError {
902
- constructor(requestId: `0x${string}`, receipt: TransactionReceipt);
903
- }
904
- declare class SignatureContractError$1 extends ChainSignatureError {
905
- errorCode: string;
906
- constructor(errorCode: string, requestId: `0x${string}`, receipt: TransactionReceipt);
907
- }
908
- declare class SigningError$1 extends ChainSignatureError {
909
- originalError?: Error;
910
- constructor(requestId: `0x${string}`, receipt: TransactionReceipt, originalError?: Error);
911
- }
912
-
913
- type errors$1_ChainSignatureError = ChainSignatureError;
914
- declare const errors$1_ChainSignatureError: typeof ChainSignatureError;
915
- declare namespace errors$1 {
916
- export { errors$1_ChainSignatureError as ChainSignatureError, SignatureContractError$1 as SignatureContractError, SignatureNotFoundError$1 as SignatureNotFoundError, SigningError$1 as SigningError };
917
- }
918
-
919
- interface RetryOptions {
920
- delay?: number;
921
- retryCount?: number;
922
- }
923
- interface SignOptions {
924
- sign: {
925
- algo?: string;
926
- dest?: string;
927
- params?: string;
928
- };
929
- retry: RetryOptions;
930
- }
931
- interface SignatureErrorData {
932
- requestId: string;
933
- error: string;
934
- }
935
-
936
- /**
937
- * Implementation of the ChainSignatureContract for EVM chains.
938
- *
939
- * When signing data, the contract emits a SignatureRequested event with a requestId.
940
- * This requestId is used to track the signature request and retrieve the signature
941
- * once it's available. The sign method handles this process automatically by polling
942
- * for the signature using the requestId.
943
- */
944
- declare class ChainSignatureContract$1 extends ChainSignatureContract$3 {
945
- private readonly publicClient;
946
- private readonly walletClient;
947
- private readonly contractAddress;
948
- private readonly rootPublicKey;
949
- /**
950
- * Creates a new instance of the ChainSignatureContract for EVM chains.
951
- *
952
- * @param args - Configuration options for the contract
953
- * @param args.publicClient - A Viem PublicClient instance for reading from the blockchain
954
- * @param args.walletClient - A Viem WalletClient instance for sending transactions
955
- * @param args.contractAddress - The address of the deployed ChainSignatures contract (e.g. `0x857ED3A242B59cC24144814a0DF41C397a3811E6`)
956
- * @param args.rootPublicKey - Optional root public key. If not provided, it will be derived from the contract address
957
- */
958
- constructor(args: {
959
- publicClient: PublicClient;
960
- walletClient: WalletClient;
961
- contractAddress: Hex;
962
- rootPublicKey?: NajPublicKey;
963
- });
964
- getCurrentSignatureDeposit(): Promise<BN>;
965
- getDerivedPublicKey(args: {
966
- path: string;
967
- predecessor: string;
968
- }): Promise<UncompressedPubKeySEC1>;
969
- getPublicKey(): Promise<UncompressedPubKeySEC1>;
970
- getLatestKeyVersion(): Promise<number>;
971
- /**
972
- * Sends a sign request transaction and return the transaction hash.
973
- *
974
- * @param args - The signature arguments
975
- * @param options - The signing options
976
- * @returns The transaction hash
977
- */
978
- createSignatureRequest(args: SignArgs, options?: Pick<SignOptions, 'sign'>): Promise<{
979
- txHash: Hex;
980
- requestId: Hex;
981
- }>;
982
- /**
983
- * Sends a transaction to the contract to request a signature, then
984
- * polls for the signature result. If the signature is not found within the retry
985
- * parameters, it will throw an error.
986
- */
987
- sign(args: SignArgs, options?: SignOptions): Promise<RSVSignature>;
988
- pollForRequestId({ requestId, payload, path, fromBlock, options, }: {
989
- requestId: Hex;
990
- payload: number[];
991
- path: string;
992
- fromBlock: bigint;
993
- options?: RetryOptions;
994
- }): Promise<RSVSignature | SignatureErrorData | undefined>;
995
- getSignRequestParams(args: SignArgs, options?: SignOptions['sign']): Promise<{
996
- target: Hex;
997
- data: Hex;
998
- value: bigint;
999
- }>;
1000
- /**
1001
- * Generates the request ID for a signature request allowing to track the response.
1002
- *
1003
- * @param args - The signature request object containing:
1004
- * @param args.payload - The data payload to be signed as a hex string
1005
- * @param args.path - The derivation path for the key
1006
- * @param args.keyVersion - The version of the key to use
1007
- * @param options - The signature request object containing:
1008
- * @param options.algo - The signing algorithm to use
1009
- * @param options.dest - The destination for the signature
1010
- * @param options.params - Additional parameters for the signing process
1011
- * @returns A hex string representing the unique request ID
1012
- *
1013
- * @example
1014
- * ```typescript
1015
- * const requestId = ChainSignatureContract.getRequestId({
1016
- * payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
1017
- * path: '',
1018
- * keyVersion: 0
1019
- * });
1020
- * console.log(requestId); // 0x...
1021
- * ```
1022
- */
1023
- getRequestId(args: SignArgs, options?: SignOptions['sign']): Hex;
1024
- getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
1025
- /**
1026
- * Searches for SignatureResponded events that match the given requestId.
1027
- * It works in conjunction with the getRequestId method which generates the unique
1028
- * identifier for a signature request.
1029
- *
1030
- * @param requestId - The identifier for the signature request
1031
- * @param fromBlock - The block number to start searching from
1032
- * @returns The RSV signature if found, undefined otherwise
1033
- */
1034
- getSignatureFromEvents(requestId: Hex, fromBlock: bigint): Promise<RSVSignature | undefined>;
1035
- }
1036
-
1037
- declare const utils$1: {
1038
- ChainSignaturesContractABI: typeof ChainSignaturesContractABI;
1039
- errors: typeof errors$1;
1040
- };
1041
-
1042
- declare namespace index$2 {
1043
- export { ChainSignatureContract$1 as ChainSignatureContract, utils$1 as utils };
1044
- }
1045
-
1046
- declare class SignatureNotFoundError extends Error {
1047
- readonly requestId?: string;
1048
- readonly hash?: string;
1049
- constructor(requestId?: string, metadata?: {
1050
- hash?: string;
1051
- });
1052
- }
1053
- declare class SignatureContractError extends Error {
1054
- readonly requestId?: string;
1055
- readonly hash?: string;
1056
- readonly originalError?: {
1057
- hash: string;
1058
- };
1059
- constructor(message: string, requestId?: string, metadata?: {
1060
- hash?: string;
1061
- });
1062
- }
1063
- declare class SigningError extends Error {
1064
- readonly requestId: string;
1065
- readonly hash?: string;
1066
- readonly originalError?: Error;
1067
- constructor(requestId: string, metadata?: {
1068
- hash?: string;
1069
- }, originalError?: Error);
1070
- }
1071
- declare class ResponseError extends Error {
1072
- constructor(message: string);
1073
- }
1074
-
1075
- type errors_ResponseError = ResponseError;
1076
- declare const errors_ResponseError: typeof ResponseError;
1077
- type errors_SignatureContractError = SignatureContractError;
1078
- declare const errors_SignatureContractError: typeof SignatureContractError;
1079
- type errors_SignatureNotFoundError = SignatureNotFoundError;
1080
- declare const errors_SignatureNotFoundError: typeof SignatureNotFoundError;
1081
- type errors_SigningError = SigningError;
1082
- declare const errors_SigningError: typeof SigningError;
1083
- declare namespace errors {
1084
- export { errors_ResponseError as ResponseError, errors_SignatureContractError as SignatureContractError, errors_SignatureNotFoundError as SignatureNotFoundError, errors_SigningError as SigningError };
1085
- }
1086
-
1087
- declare class ChainSignatureContract extends ChainSignatureContract$3 {
1088
- private readonly provider;
1089
- private readonly program;
1090
- private readonly programId;
1091
- private readonly rootPublicKey;
1092
- private readonly requesterAddress;
1093
- /**
1094
- * Creates a new instance of the ChainSignatureContract for Solana chains.
1095
- *
1096
- * @param args - Configuration options for the contract
1097
- * @param args.provider - An Anchor Provider for interacting with Solana
1098
- * @param args.programId - The program ID as a string or PublicKey
1099
- * @param args.rootPublicKey - Optional root public key. If not provided, it will be derived from the program ID
1100
- * @param args.requesterAddress - Provider wallet address is always the fee payer but requester can be overridden
1101
- */
1102
- constructor(args: {
1103
- provider: AnchorProvider;
1104
- programId: string | PublicKey;
1105
- rootPublicKey?: NajPublicKey;
1106
- requesterAddress?: string;
1107
- });
1108
- /**
1109
- * Gets the connection from the provider
1110
- */
1111
- get connection(): _solana_web3_js.Connection;
1112
- getCurrentSignatureDeposit(): Promise<BN>;
1113
- /**
1114
- * Get the Program State PDA
1115
- */
1116
- getProgramStatePDA(): Promise<PublicKey>;
1117
- getDerivedPublicKey(args: {
1118
- path: string;
1119
- predecessor: string;
1120
- }): Promise<UncompressedPubKeySEC1>;
1121
- getPublicKey(): Promise<UncompressedPubKeySEC1>;
1122
- getSignRequestInstruction(args: SignArgs, options?: Pick<SignOptions, 'sign'> & {
1123
- remainingAccounts?: Array<AccountMeta>;
1124
- }): Promise<TransactionInstruction>;
1125
- /**
1126
- * Sends a transaction to the program to request a signature, then
1127
- * polls for the signature result. If the signature is not found within the retry
1128
- * parameters, it will throw an error.
1129
- */
1130
- sign(args: SignArgs, options?: Partial<SignOptions> & {
1131
- remainingAccounts?: Array<AccountMeta>;
1132
- remainingSigners?: Array<Signer>;
1133
- }): Promise<RSVSignature>;
1134
- /**
1135
- * Listens for signature or error events matching the given requestId.
1136
- * Sets up listeners for both event types and returns a promise that resolves when
1137
- * either a valid signature or an error is received.
1138
- */
1139
- listenForSignatureEvents({ requestId, payload, path, options, }: {
1140
- requestId: string;
1141
- payload: number[];
1142
- path: string;
1143
- options?: RetryOptions;
1144
- }): Promise<RSVSignature | SignatureErrorData | undefined>;
1145
- /**
1146
- * Generates the request ID for a signature request allowing to track the response.
1147
- */
1148
- getRequestId(args: SignArgs, options?: SignOptions['sign']): string;
1149
- }
1150
-
1151
- declare const utils: {
1152
- ChainSignaturesContractIdl: {
1153
- address: string;
1154
- metadata: {
1155
- name: string;
1156
- version: string;
1157
- spec: string;
1158
- description: string;
1159
- };
1160
- instructions: ({
1161
- name: string;
1162
- discriminator: number[];
1163
- accounts: {
1164
- name: string;
1165
- signer: boolean;
1166
- }[];
1167
- args: ({
1168
- name: string;
1169
- type: {
1170
- vec: {
1171
- array: (string | number)[];
1172
- defined?: undefined;
1173
- };
1174
- };
1175
- } | {
1176
- name: string;
1177
- type: {
1178
- vec: {
1179
- defined: {
1180
- name: string;
1181
- };
1182
- array?: undefined;
1183
- };
1184
- };
1185
- })[];
1186
- } | {
1187
- name: string;
1188
- discriminator: number[];
1189
- accounts: {
1190
- name: string;
1191
- signer: boolean;
1192
- }[];
1193
- args: ({
1194
- name: string;
1195
- type: {
1196
- vec: {
1197
- array: (string | number)[];
1198
- };
1199
- };
1200
- } | {
1201
- name: string;
1202
- type: {
1203
- vec: string;
1204
- };
1205
- })[];
1206
- } | {
1207
- name: string;
1208
- discriminator: number[];
1209
- accounts: ({
1210
- name: string;
1211
- writable: boolean;
1212
- pda: {
1213
- seeds: {
1214
- kind: string;
1215
- value: number[];
1216
- }[];
1217
- };
1218
- signer?: undefined;
1219
- optional?: undefined;
1220
- address?: undefined;
1221
- } | {
1222
- name: string;
1223
- writable: boolean;
1224
- signer: boolean;
1225
- pda?: undefined;
1226
- optional?: undefined;
1227
- address?: undefined;
1228
- } | {
1229
- name: string;
1230
- writable: boolean;
1231
- signer: boolean;
1232
- optional: boolean;
1233
- pda?: undefined;
1234
- address?: undefined;
1235
- } | {
1236
- name: string;
1237
- address: string;
1238
- writable?: undefined;
1239
- pda?: undefined;
1240
- signer?: undefined;
1241
- optional?: undefined;
1242
- })[];
1243
- args: ({
1244
- name: string;
1245
- type: {
1246
- array: (string | number)[];
1247
- };
1248
- } | {
1249
- name: string;
1250
- type: string;
1251
- })[];
1252
- } | {
1253
- name: string;
1254
- discriminator: number[];
1255
- accounts: ({
1256
- name: string;
1257
- writable: boolean;
1258
- pda: {
1259
- seeds: {
1260
- kind: string;
1261
- value: number[];
1262
- }[];
1263
- };
1264
- signer?: undefined;
1265
- relations?: undefined;
1266
- docs?: undefined;
1267
- address?: undefined;
1268
- } | {
1269
- name: string;
1270
- writable: boolean;
1271
- signer: boolean;
1272
- relations: string[];
1273
- pda?: undefined;
1274
- docs?: undefined;
1275
- address?: undefined;
1276
- } | {
1277
- name: string;
1278
- docs: string[];
1279
- writable: boolean;
1280
- pda?: undefined;
1281
- signer?: undefined;
1282
- relations?: undefined;
1283
- address?: undefined;
1284
- } | {
1285
- name: string;
1286
- address: string;
1287
- writable?: undefined;
1288
- pda?: undefined;
1289
- signer?: undefined;
1290
- relations?: undefined;
1291
- docs?: undefined;
1292
- })[];
1293
- args: {
1294
- name: string;
1295
- type: string;
1296
- }[];
1297
- })[];
1298
- accounts: {
1299
- name: string;
1300
- discriminator: number[];
1301
- }[];
1302
- events: {
1303
- name: string;
1304
- discriminator: number[];
1305
- }[];
1306
- errors: {
1307
- code: number;
1308
- name: string;
1309
- msg: string;
1310
- }[];
1311
- types: ({
1312
- name: string;
1313
- type: {
1314
- kind: string;
1315
- fields: ({
1316
- name: string;
1317
- type: {
1318
- defined: {
1319
- name: string;
1320
- };
1321
- array?: undefined;
1322
- };
1323
- } | {
1324
- name: string;
1325
- type: {
1326
- array: (string | number)[];
1327
- defined?: undefined;
1328
- };
1329
- } | {
1330
- name: string;
1331
- type: string;
1332
- })[];
1333
- };
1334
- } | {
1335
- name: string;
1336
- type: {
1337
- kind: string;
1338
- fields: ({
1339
- name: string;
1340
- type: string;
1341
- } | {
1342
- name: string;
1343
- type: {
1344
- array: (string | number)[];
1345
- option?: undefined;
1346
- };
1347
- } | {
1348
- name: string;
1349
- type: {
1350
- option: string;
1351
- array?: undefined;
1352
- };
1353
- })[];
1354
- };
1355
- })[];
1356
- };
1357
- errors: typeof errors;
1358
- };
1359
-
1360
- type index$1_ChainSignatureContract = ChainSignatureContract;
1361
- declare const index$1_ChainSignatureContract: typeof ChainSignatureContract;
1362
- declare const index$1_utils: typeof utils;
1363
- declare namespace index$1 {
1364
- export { index$1_ChainSignatureContract as ChainSignatureContract, index$1_utils as utils };
1365
- }
1366
-
1367
- type index_SignArgs = SignArgs;
1368
- declare namespace index {
1369
- export { ChainSignatureContract$3 as ChainSignatureContract, type index_SignArgs as SignArgs, index$2 as evm, index$3 as near, index$1 as solana };
1370
- }
1371
-
1372
- export { type CompressedPubKeySEC1, type HashToSign, type KeyDerivationPath, type MPCSignature, type NajPublicKey, type NearNearMpcSignature, type RSVSignature, type SigNetEvmMpcSignature, type SigNetNearMpcSignature, type UncompressedPubKeySEC1, index$4 as chainAdapters, constants, index as contracts, index$8 as utils };