signet.js 0.0.2-beta.5 → 0.0.2
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/README.md +3 -3
- package/browser/index.browser.cjs +2 -2
- package/browser/index.browser.cjs.map +1 -1
- package/browser/index.browser.js +2 -2
- package/browser/index.browser.js.map +1 -1
- package/node/index.node.cjs +2 -2
- package/node/index.node.cjs.map +1 -1
- package/node/index.node.js +2 -2
- package/node/index.node.js.map +1 -1
- package/package.json +1 -1
- package/types/index.d.cts +282 -56
- package/types/index.d.ts +282 -56
package/types/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ declare abstract class ChainSignatureContract$2 extends BaseChainSignatureContra
|
|
|
62
62
|
abstract getPublicKey(): Promise<UncompressedPubKeySEC1>;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
type
|
|
65
|
+
type HashToSign = SignArgs['payload'];
|
|
66
66
|
type Base58String = string;
|
|
67
67
|
type NajPublicKey = `secp256k1:${Base58String}`;
|
|
68
68
|
type UncompressedPubKeySEC1 = `04${string}`;
|
|
@@ -73,7 +73,7 @@ interface RSVSignature {
|
|
|
73
73
|
s: string;
|
|
74
74
|
v: number;
|
|
75
75
|
}
|
|
76
|
-
interface
|
|
76
|
+
interface NearNearMpcSignature {
|
|
77
77
|
big_r: {
|
|
78
78
|
affine_point: string;
|
|
79
79
|
};
|
|
@@ -82,12 +82,20 @@ interface OldMpcSignature {
|
|
|
82
82
|
};
|
|
83
83
|
recovery_id: number;
|
|
84
84
|
}
|
|
85
|
-
interface
|
|
85
|
+
interface SigNetNearMpcSignature {
|
|
86
86
|
big_r: string;
|
|
87
87
|
s: string;
|
|
88
88
|
recovery_id: number;
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
interface SigNetEvmMpcSignature {
|
|
91
|
+
bigR: {
|
|
92
|
+
x: bigint;
|
|
93
|
+
y: bigint;
|
|
94
|
+
};
|
|
95
|
+
s: bigint;
|
|
96
|
+
recoveryId: number;
|
|
97
|
+
}
|
|
98
|
+
type MPCSignature = NearNearMpcSignature | SigNetNearMpcSignature | SigNetEvmMpcSignature;
|
|
91
99
|
|
|
92
100
|
interface BTCTransaction$1 {
|
|
93
101
|
vout: Array<{
|
|
@@ -236,10 +244,10 @@ interface CosmosRequest {
|
|
|
236
244
|
fastAuthRelayerUrl?: string;
|
|
237
245
|
}
|
|
238
246
|
|
|
239
|
-
declare const mpcPayloadsToChainSigTransaction: ({ networkId, contractId,
|
|
247
|
+
declare const mpcPayloadsToChainSigTransaction: ({ networkId, contractId, hashesToSign, path, }: {
|
|
240
248
|
networkId: NetworkId;
|
|
241
249
|
contractId: ChainSignatureContractIds;
|
|
242
|
-
|
|
250
|
+
hashesToSign: HashToSign[];
|
|
243
251
|
path: KeyDerivationPath;
|
|
244
252
|
}) => Promise<{
|
|
245
253
|
receiverId: string;
|
|
@@ -271,22 +279,36 @@ declare namespace index$4 {
|
|
|
271
279
|
export { index$4_keypair as keypair };
|
|
272
280
|
}
|
|
273
281
|
|
|
274
|
-
interface ChainSignatureContractArgs
|
|
282
|
+
interface ChainSignatureContractArgs {
|
|
275
283
|
networkId: NearNetworkIds;
|
|
276
284
|
contractId: ChainSignatureContractIds;
|
|
277
285
|
accountId?: string;
|
|
278
286
|
keypair?: KeyPair;
|
|
279
287
|
}
|
|
280
288
|
/**
|
|
281
|
-
*
|
|
282
|
-
*
|
|
289
|
+
* Implementation of the ChainSignatureContract for NEAR chains.
|
|
290
|
+
*
|
|
291
|
+
* This class provides an interface to interact with the ChainSignatures contract
|
|
292
|
+
* deployed on NEAR. It supports both view methods (which don't require authentication)
|
|
293
|
+
* and change methods (which require a valid NEAR account and keypair).
|
|
294
|
+
*
|
|
295
|
+
* @extends AbstractChainSignatureContract
|
|
283
296
|
*/
|
|
284
297
|
declare class ChainSignatureContract$1 extends ChainSignatureContract$2 {
|
|
285
298
|
private readonly networkId;
|
|
286
299
|
private readonly contractId;
|
|
287
300
|
private readonly accountId;
|
|
288
301
|
private readonly keypair;
|
|
289
|
-
|
|
302
|
+
/**
|
|
303
|
+
* Creates a new instance of the ChainSignatureContract for NEAR chains.
|
|
304
|
+
*
|
|
305
|
+
* @param args - Configuration options for the contract
|
|
306
|
+
* @param args.networkId - The NEAR network ID (e.g. 'testnet', 'mainnet')
|
|
307
|
+
* @param args.contractId - The contract ID of the deployed ChainSignatures contract
|
|
308
|
+
* @param args.accountId - Optional NEAR account ID for signing transactions. Required for change methods.
|
|
309
|
+
* @param args.keypair - Optional NEAR KeyPair for signing transactions. Required for change methods.
|
|
310
|
+
*/
|
|
311
|
+
constructor({ networkId, contractId, accountId, keypair, }: ChainSignatureContractArgs);
|
|
290
312
|
private getContract;
|
|
291
313
|
getCurrentSignatureDeposit(): Promise<BN>;
|
|
292
314
|
getDerivedPublicKey(args: {
|
|
@@ -302,12 +324,6 @@ declare namespace index$3 {
|
|
|
302
324
|
export { ChainSignatureContract$1 as ChainSignatureContract, index$4 as signAndSend, index$3_transactionBuilder as transactionBuilder };
|
|
303
325
|
}
|
|
304
326
|
|
|
305
|
-
interface ChainSignatureContractArgs {
|
|
306
|
-
publicClient: PublicClient;
|
|
307
|
-
walletClient: WalletClient;
|
|
308
|
-
contractAddress: Hex;
|
|
309
|
-
rootPublicKey?: NajPublicKey;
|
|
310
|
-
}
|
|
311
327
|
interface SignOptions {
|
|
312
328
|
sign: {
|
|
313
329
|
algo?: string;
|
|
@@ -325,12 +341,34 @@ interface SignatureErrorData {
|
|
|
325
341
|
error: string;
|
|
326
342
|
}
|
|
327
343
|
|
|
344
|
+
/**
|
|
345
|
+
* Implementation of the ChainSignatureContract for EVM chains.
|
|
346
|
+
*
|
|
347
|
+
* When signing data, the contract emits a SignatureRequested event with a requestId.
|
|
348
|
+
* This requestId is used to track the signature request and retrieve the signature
|
|
349
|
+
* once it's available. The sign method handles this process automatically by polling
|
|
350
|
+
* for the signature using the requestId.
|
|
351
|
+
*/
|
|
328
352
|
declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
329
353
|
private readonly publicClient;
|
|
330
354
|
private readonly walletClient;
|
|
331
355
|
private readonly contractAddress;
|
|
332
356
|
private readonly rootPublicKey;
|
|
333
|
-
|
|
357
|
+
/**
|
|
358
|
+
* Creates a new instance of the ChainSignatureContract for EVM chains.
|
|
359
|
+
*
|
|
360
|
+
* @param args - Configuration options for the contract
|
|
361
|
+
* @param args.publicClient - A Viem PublicClient instance for reading from the blockchain
|
|
362
|
+
* @param args.walletClient - A Viem WalletClient instance for sending transactions
|
|
363
|
+
* @param args.contractAddress - The address of the deployed ChainSignatures contract (e.g. `0x857ED3A242B59cC24144814a0DF41C397a3811E6`)
|
|
364
|
+
* @param args.rootPublicKey - Optional root public key. If not provided, it will be derived from the contract address
|
|
365
|
+
*/
|
|
366
|
+
constructor(args: {
|
|
367
|
+
publicClient: PublicClient;
|
|
368
|
+
walletClient: WalletClient;
|
|
369
|
+
contractAddress: Hex;
|
|
370
|
+
rootPublicKey?: NajPublicKey;
|
|
371
|
+
});
|
|
334
372
|
getCurrentSignatureDeposit(): Promise<BN>;
|
|
335
373
|
getDerivedPublicKey(args: {
|
|
336
374
|
path: string;
|
|
@@ -344,10 +382,149 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
|
344
382
|
getSignatureFromEvents(requestId: `0x${string}`, receipt: TransactionReceipt): Promise<RSVSignature | undefined>;
|
|
345
383
|
}
|
|
346
384
|
|
|
385
|
+
declare const abi: ({
|
|
386
|
+
inputs: {
|
|
387
|
+
internalType: string;
|
|
388
|
+
name: string;
|
|
389
|
+
type: string;
|
|
390
|
+
}[];
|
|
391
|
+
stateMutability: string;
|
|
392
|
+
type: string;
|
|
393
|
+
name?: undefined;
|
|
394
|
+
anonymous?: undefined;
|
|
395
|
+
outputs?: undefined;
|
|
396
|
+
} | {
|
|
397
|
+
inputs: {
|
|
398
|
+
internalType: string;
|
|
399
|
+
name: string;
|
|
400
|
+
type: string;
|
|
401
|
+
}[];
|
|
402
|
+
name: string;
|
|
403
|
+
type: string;
|
|
404
|
+
stateMutability?: undefined;
|
|
405
|
+
anonymous?: undefined;
|
|
406
|
+
outputs?: undefined;
|
|
407
|
+
} | {
|
|
408
|
+
anonymous: boolean;
|
|
409
|
+
inputs: ({
|
|
410
|
+
indexed: boolean;
|
|
411
|
+
internalType: string;
|
|
412
|
+
name: string;
|
|
413
|
+
type: string;
|
|
414
|
+
components?: undefined;
|
|
415
|
+
} | {
|
|
416
|
+
components: ({
|
|
417
|
+
components: {
|
|
418
|
+
internalType: string;
|
|
419
|
+
name: string;
|
|
420
|
+
type: string;
|
|
421
|
+
}[];
|
|
422
|
+
internalType: string;
|
|
423
|
+
name: string;
|
|
424
|
+
type: string;
|
|
425
|
+
} | {
|
|
426
|
+
internalType: string;
|
|
427
|
+
name: string;
|
|
428
|
+
type: string;
|
|
429
|
+
components?: undefined;
|
|
430
|
+
})[];
|
|
431
|
+
indexed: boolean;
|
|
432
|
+
internalType: string;
|
|
433
|
+
name: string;
|
|
434
|
+
type: string;
|
|
435
|
+
})[];
|
|
436
|
+
name: string;
|
|
437
|
+
type: string;
|
|
438
|
+
stateMutability?: undefined;
|
|
439
|
+
outputs?: undefined;
|
|
440
|
+
} | {
|
|
441
|
+
inputs: {
|
|
442
|
+
internalType: string;
|
|
443
|
+
name: string;
|
|
444
|
+
type: string;
|
|
445
|
+
}[];
|
|
446
|
+
name: string;
|
|
447
|
+
outputs: {
|
|
448
|
+
internalType: string;
|
|
449
|
+
name: string;
|
|
450
|
+
type: string;
|
|
451
|
+
}[];
|
|
452
|
+
stateMutability: string;
|
|
453
|
+
type: string;
|
|
454
|
+
anonymous?: undefined;
|
|
455
|
+
} | {
|
|
456
|
+
inputs: {
|
|
457
|
+
components: ({
|
|
458
|
+
internalType: string;
|
|
459
|
+
name: string;
|
|
460
|
+
type: string;
|
|
461
|
+
components?: undefined;
|
|
462
|
+
} | {
|
|
463
|
+
components: ({
|
|
464
|
+
components: {
|
|
465
|
+
internalType: string;
|
|
466
|
+
name: string;
|
|
467
|
+
type: string;
|
|
468
|
+
}[];
|
|
469
|
+
internalType: string;
|
|
470
|
+
name: string;
|
|
471
|
+
type: string;
|
|
472
|
+
} | {
|
|
473
|
+
internalType: string;
|
|
474
|
+
name: string;
|
|
475
|
+
type: string;
|
|
476
|
+
components?: undefined;
|
|
477
|
+
})[];
|
|
478
|
+
internalType: string;
|
|
479
|
+
name: string;
|
|
480
|
+
type: string;
|
|
481
|
+
})[];
|
|
482
|
+
internalType: string;
|
|
483
|
+
name: string;
|
|
484
|
+
type: string;
|
|
485
|
+
}[];
|
|
486
|
+
name: string;
|
|
487
|
+
outputs: never[];
|
|
488
|
+
stateMutability: string;
|
|
489
|
+
type: string;
|
|
490
|
+
anonymous?: undefined;
|
|
491
|
+
})[];
|
|
492
|
+
|
|
493
|
+
declare class ChainSignatureError extends Error {
|
|
494
|
+
requestId: `0x${string}`;
|
|
495
|
+
receipt: TransactionReceipt;
|
|
496
|
+
constructor(message: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
497
|
+
}
|
|
498
|
+
declare class SignatureNotFoundError extends ChainSignatureError {
|
|
499
|
+
constructor(requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
500
|
+
}
|
|
501
|
+
declare class SignatureContractError extends ChainSignatureError {
|
|
502
|
+
errorCode: string;
|
|
503
|
+
constructor(errorCode: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
504
|
+
}
|
|
505
|
+
declare class SigningError extends ChainSignatureError {
|
|
506
|
+
originalError?: Error;
|
|
507
|
+
constructor(requestId: `0x${string}`, receipt: TransactionReceipt, originalError?: Error);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
type errors_ChainSignatureError = ChainSignatureError;
|
|
511
|
+
declare const errors_ChainSignatureError: typeof ChainSignatureError;
|
|
512
|
+
type errors_SignatureContractError = SignatureContractError;
|
|
513
|
+
declare const errors_SignatureContractError: typeof SignatureContractError;
|
|
514
|
+
type errors_SignatureNotFoundError = SignatureNotFoundError;
|
|
515
|
+
declare const errors_SignatureNotFoundError: typeof SignatureNotFoundError;
|
|
516
|
+
type errors_SigningError = SigningError;
|
|
517
|
+
declare const errors_SigningError: typeof SigningError;
|
|
518
|
+
declare namespace errors {
|
|
519
|
+
export { errors_ChainSignatureError as ChainSignatureError, errors_SignatureContractError as SignatureContractError, errors_SignatureNotFoundError as SignatureNotFoundError, errors_SigningError as SigningError };
|
|
520
|
+
}
|
|
521
|
+
|
|
347
522
|
type index$2_ChainSignatureContract = ChainSignatureContract;
|
|
348
523
|
declare const index$2_ChainSignatureContract: typeof ChainSignatureContract;
|
|
524
|
+
declare const index$2_abi: typeof abi;
|
|
525
|
+
declare const index$2_errors: typeof errors;
|
|
349
526
|
declare namespace index$2 {
|
|
350
|
-
export { index$2_ChainSignatureContract as ChainSignatureContract };
|
|
527
|
+
export { index$2_ChainSignatureContract as ChainSignatureContract, index$2_abi as abi, index$2_errors as errors };
|
|
351
528
|
}
|
|
352
529
|
|
|
353
530
|
declare namespace index$1 {
|
|
@@ -365,13 +542,19 @@ declare const toRSV: (signature: MPCSignature) => RSVSignature;
|
|
|
365
542
|
* @throws Error if the uncompressed public key length is invalid
|
|
366
543
|
*/
|
|
367
544
|
declare const compressPubKey: (uncompressedPubKeySEC1: UncompressedPubKeySEC1) => string;
|
|
545
|
+
/**
|
|
546
|
+
* Converts a NAJ public key to an uncompressed SEC1 public key.
|
|
547
|
+
*
|
|
548
|
+
* @param najPublicKey - The NAJ public key to convert (e.g. secp256k1:3Ww8iFjqTHufye5aRGUvrQqETegR4gVUcW8FX5xzscaN9ENhpkffojsxJwi6N1RbbHMTxYa9UyKeqK3fsMuwxjR5)
|
|
549
|
+
* @returns The uncompressed SEC1 public key (e.g. 04 || x || y)
|
|
550
|
+
*/
|
|
368
551
|
declare const najToUncompressedPubKeySEC1: (najPublicKey: NajPublicKey) => UncompressedPubKeySEC1;
|
|
369
552
|
/**
|
|
370
553
|
* Derives a child public key from a parent public key using the sig.network v1.0.0 epsilon derivation scheme.
|
|
371
|
-
* The parent public keys are defined in @constants.ts
|
|
554
|
+
* The parent public keys are defined in @constants.ts
|
|
372
555
|
*
|
|
373
|
-
* @param najPublicKey - The parent public key in
|
|
374
|
-
* @param predecessorId - The predecessor ID calling the signer contract
|
|
556
|
+
* @param najPublicKey - The parent public key in uncompressed SEC1 format (e.g. 04 || x || y)
|
|
557
|
+
* @param predecessorId - The predecessor ID is the address of the account calling the signer contract (e.g EOA or Contract Address)
|
|
375
558
|
* @param path - Optional derivation path suffix (defaults to empty string)
|
|
376
559
|
* @returns The derived child public key in uncompressed SEC1 format (04 || x || y)
|
|
377
560
|
*/
|
|
@@ -385,11 +568,6 @@ declare namespace cryptography {
|
|
|
385
568
|
export { cryptography_compressPubKey as compressPubKey, cryptography_deriveChildPublicKey as deriveChildPublicKey, cryptography_najToUncompressedPubKeySEC1 as najToUncompressedPubKeySEC1, cryptography_toRSV as toRSV };
|
|
386
569
|
}
|
|
387
570
|
|
|
388
|
-
declare const index_cryptography: typeof cryptography;
|
|
389
|
-
declare namespace index {
|
|
390
|
-
export { index$1 as chains, index_cryptography as cryptography };
|
|
391
|
-
}
|
|
392
|
-
|
|
393
571
|
declare abstract class Chain<TransactionRequest, UnsignedTransaction> {
|
|
394
572
|
/**
|
|
395
573
|
* Gets the native token balance and decimals for a given address
|
|
@@ -441,25 +619,25 @@ declare abstract class Chain<TransactionRequest, UnsignedTransaction> {
|
|
|
441
619
|
* @param transactionRequest - The transaction request containing parameters like recipient, amount, etc.
|
|
442
620
|
* @returns Promise resolving to an object containing:
|
|
443
621
|
* - transaction: The unsigned transaction
|
|
444
|
-
* -
|
|
622
|
+
* - hashesToSign: Array of payloads to be signed by MPC. The order of these payloads must match
|
|
445
623
|
* the order of signatures provided to attachTransactionSignature()
|
|
446
624
|
*/
|
|
447
625
|
abstract prepareTransactionForSigning(transactionRequest: TransactionRequest): Promise<{
|
|
448
626
|
transaction: UnsignedTransaction;
|
|
449
|
-
|
|
627
|
+
hashesToSign: HashToSign[];
|
|
450
628
|
}>;
|
|
451
629
|
/**
|
|
452
630
|
* Adds Sig Network MPC-generated signatures to an unsigned transaction.
|
|
453
631
|
*
|
|
454
632
|
* @param params - Parameters for adding signatures
|
|
455
633
|
* @param params.transaction - The unsigned transaction to add signatures to
|
|
456
|
-
* @param params.
|
|
634
|
+
* @param params.rsvSignatures - Array of RSV signatures generated through MPC. Must be in the same order
|
|
457
635
|
* as the payloads returned by prepareTransactionForSigning()
|
|
458
636
|
* @returns The serialized signed transaction ready for broadcast
|
|
459
637
|
*/
|
|
460
638
|
abstract attachTransactionSignature(params: {
|
|
461
639
|
transaction: UnsignedTransaction;
|
|
462
|
-
|
|
640
|
+
rsvSignatures: RSVSignature[];
|
|
463
641
|
}): string;
|
|
464
642
|
/**
|
|
465
643
|
* Broadcasts a signed transaction to the network.
|
|
@@ -488,7 +666,8 @@ declare class EVM extends Chain<EVMTransactionRequest, EVMUnsignedTransaction> {
|
|
|
488
666
|
contract: BaseChainSignatureContract;
|
|
489
667
|
});
|
|
490
668
|
private attachGasAndNonce;
|
|
491
|
-
private
|
|
669
|
+
private transformRSVSignature;
|
|
670
|
+
private assembleSignature;
|
|
492
671
|
deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
|
|
493
672
|
address: string;
|
|
494
673
|
publicKey: string;
|
|
@@ -501,15 +680,13 @@ declare class EVM extends Chain<EVMTransactionRequest, EVMUnsignedTransaction> {
|
|
|
501
680
|
deserializeTransaction(serialized: `0x${string}`): EVMUnsignedTransaction;
|
|
502
681
|
prepareTransactionForSigning(transactionRequest: EVMTransactionRequest): Promise<{
|
|
503
682
|
transaction: EVMUnsignedTransaction;
|
|
504
|
-
|
|
683
|
+
hashesToSign: HashToSign[];
|
|
505
684
|
}>;
|
|
506
685
|
prepareMessageForSigning(message: EVMMessage): Promise<{
|
|
507
|
-
|
|
508
|
-
mpcPayloads: MPCPayloads;
|
|
686
|
+
hashesToSign: HashToSign[];
|
|
509
687
|
}>;
|
|
510
688
|
prepareTypedDataForSigning(typedDataRequest: EVMTypedData): Promise<{
|
|
511
|
-
|
|
512
|
-
mpcPayloads: MPCPayloads;
|
|
689
|
+
hashesToSign: HashToSign[];
|
|
513
690
|
}>;
|
|
514
691
|
/**
|
|
515
692
|
* This implementation is a common step for Biconomy and Alchemy.
|
|
@@ -520,23 +697,21 @@ declare class EVM extends Chain<EVMTransactionRequest, EVMUnsignedTransaction> {
|
|
|
520
697
|
*/
|
|
521
698
|
prepareUserOpForSigning(userOp: UserOperationV7 | UserOperationV6, entryPointAddress?: Address, chainIdArgs?: number): Promise<{
|
|
522
699
|
userOp: UserOperationV7 | UserOperationV6;
|
|
523
|
-
|
|
700
|
+
hashesToSign: HashToSign[];
|
|
524
701
|
}>;
|
|
525
|
-
attachTransactionSignature({ transaction,
|
|
702
|
+
attachTransactionSignature({ transaction, rsvSignatures, }: {
|
|
526
703
|
transaction: EVMUnsignedTransaction;
|
|
527
|
-
|
|
704
|
+
rsvSignatures: RSVSignature[];
|
|
528
705
|
}): `0x02${string}`;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
mpcSignatures: RSVSignature[];
|
|
706
|
+
assembleMessageSignature({ rsvSignatures, }: {
|
|
707
|
+
rsvSignatures: RSVSignature[];
|
|
532
708
|
}): Hex;
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
mpcSignatures: RSVSignature[];
|
|
709
|
+
assembleTypedDataSignature({ rsvSignatures, }: {
|
|
710
|
+
rsvSignatures: RSVSignature[];
|
|
536
711
|
}): Hex;
|
|
537
|
-
attachUserOpSignature({ userOp,
|
|
712
|
+
attachUserOpSignature({ userOp, rsvSignatures, }: {
|
|
538
713
|
userOp: UserOperationV7 | UserOperationV6;
|
|
539
|
-
|
|
714
|
+
rsvSignatures: RSVSignature[];
|
|
540
715
|
}): UserOperationV7 | UserOperationV6;
|
|
541
716
|
broadcastTx(txSerialized: `0x${string}`): Promise<Hash>;
|
|
542
717
|
}
|
|
@@ -610,7 +785,7 @@ declare class Bitcoin extends Chain<BTCTransactionRequest, BTCUnsignedTransactio
|
|
|
610
785
|
*/
|
|
611
786
|
static toSatoshi(btc: number): number;
|
|
612
787
|
private fetchTransaction;
|
|
613
|
-
private static
|
|
788
|
+
private static transformRSVSignature;
|
|
614
789
|
/**
|
|
615
790
|
* Creates a Partially Signed Bitcoin Transaction (PSBT)
|
|
616
791
|
* @param params - Parameters for creating the PSBT
|
|
@@ -632,11 +807,11 @@ declare class Bitcoin extends Chain<BTCTransactionRequest, BTCUnsignedTransactio
|
|
|
632
807
|
deserializeTransaction(serialized: string): BTCUnsignedTransaction;
|
|
633
808
|
prepareTransactionForSigning(transactionRequest: BTCTransactionRequest): Promise<{
|
|
634
809
|
transaction: BTCUnsignedTransaction;
|
|
635
|
-
|
|
810
|
+
hashesToSign: HashToSign[];
|
|
636
811
|
}>;
|
|
637
|
-
attachTransactionSignature({ transaction: { psbt, publicKey },
|
|
812
|
+
attachTransactionSignature({ transaction: { psbt, publicKey }, rsvSignatures, }: {
|
|
638
813
|
transaction: BTCUnsignedTransaction;
|
|
639
|
-
|
|
814
|
+
rsvSignatures: RSVSignature[];
|
|
640
815
|
}): string;
|
|
641
816
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
642
817
|
}
|
|
@@ -667,7 +842,7 @@ declare class Cosmos extends Chain<CosmosTransactionRequest, CosmosUnsignedTrans
|
|
|
667
842
|
restUrl?: string;
|
|
668
843
|
};
|
|
669
844
|
});
|
|
670
|
-
private
|
|
845
|
+
private transformRSVSignature;
|
|
671
846
|
private getChainInfo;
|
|
672
847
|
getBalance(address: string): Promise<{
|
|
673
848
|
balance: bigint;
|
|
@@ -681,13 +856,64 @@ declare class Cosmos extends Chain<CosmosTransactionRequest, CosmosUnsignedTrans
|
|
|
681
856
|
deserializeTransaction(serialized: string): CosmosUnsignedTransaction;
|
|
682
857
|
prepareTransactionForSigning(transactionRequest: CosmosTransactionRequest): Promise<{
|
|
683
858
|
transaction: CosmosUnsignedTransaction;
|
|
684
|
-
|
|
859
|
+
hashesToSign: HashToSign[];
|
|
685
860
|
}>;
|
|
686
|
-
attachTransactionSignature({ transaction,
|
|
861
|
+
attachTransactionSignature({ transaction, rsvSignatures, }: {
|
|
687
862
|
transaction: CosmosUnsignedTransaction;
|
|
688
|
-
|
|
863
|
+
rsvSignatures: RSVSignature[];
|
|
689
864
|
}): string;
|
|
690
865
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
691
866
|
}
|
|
692
867
|
|
|
693
|
-
|
|
868
|
+
declare const ENVS: {
|
|
869
|
+
readonly TESTNET_DEV: "TESTNET_DEV";
|
|
870
|
+
readonly TESTNET: "TESTNET";
|
|
871
|
+
readonly MAINNET: "MAINNET";
|
|
872
|
+
};
|
|
873
|
+
declare const CHAINS: {
|
|
874
|
+
readonly ETHEREUM: "ETHEREUM";
|
|
875
|
+
readonly NEAR: "NEAR";
|
|
876
|
+
};
|
|
877
|
+
/**
|
|
878
|
+
* Root public keys for the Sig Network Smart Contracts across different environments.
|
|
879
|
+
*
|
|
880
|
+
* These keys should never change.
|
|
881
|
+
*/
|
|
882
|
+
declare const ROOT_PUBLIC_KEYS: Record<keyof typeof ENVS, NajPublicKey>;
|
|
883
|
+
/**
|
|
884
|
+
* Chain IDs used in the key derivation function (KDF) for deriving child public keys to
|
|
885
|
+
* distinguish between different chains.
|
|
886
|
+
*
|
|
887
|
+
* @see {@link deriveChildPublicKey} in cryptography.ts for usage details
|
|
888
|
+
*/
|
|
889
|
+
declare const KDF_CHAIN_IDS: {
|
|
890
|
+
readonly ETHEREUM: "0x1";
|
|
891
|
+
readonly NEAR: "0x18d";
|
|
892
|
+
};
|
|
893
|
+
/**
|
|
894
|
+
* Contract addresses for different chains and environments.
|
|
895
|
+
*
|
|
896
|
+
* - Testnet Dev: Used for internal development, very unstable
|
|
897
|
+
* - Testnet: Used for external development, stable
|
|
898
|
+
* - Mainnet: Production contract address
|
|
899
|
+
*
|
|
900
|
+
* @see ChainSignatureContract documentation for implementation details
|
|
901
|
+
*/
|
|
902
|
+
declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Record<keyof typeof ENVS, string>>;
|
|
903
|
+
|
|
904
|
+
declare const constants_CHAINS: typeof CHAINS;
|
|
905
|
+
declare const constants_CONTRACT_ADDRESSES: typeof CONTRACT_ADDRESSES;
|
|
906
|
+
declare const constants_ENVS: typeof ENVS;
|
|
907
|
+
declare const constants_KDF_CHAIN_IDS: typeof KDF_CHAIN_IDS;
|
|
908
|
+
declare const constants_ROOT_PUBLIC_KEYS: typeof ROOT_PUBLIC_KEYS;
|
|
909
|
+
declare namespace constants {
|
|
910
|
+
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 };
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
declare const index_constants: typeof constants;
|
|
914
|
+
declare const index_cryptography: typeof cryptography;
|
|
915
|
+
declare namespace index {
|
|
916
|
+
export { index$1 as chains, index_constants as constants, index_cryptography as cryptography };
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
export { type BTCInput, type BTCNetworkIds, type BTCOutput, BTCRpcAdapter, BTCRpcAdapters, type BTCTransaction$1 as BTCTransaction, type BTCTransactionRequest, type BTCUnsignedTransaction, Bitcoin, Chain, ChainSignatureContract$2 as ChainSignatureContract, type CompressedPubKeySEC1, Cosmos, type CosmosNetworkIds, type CosmosTransactionRequest, type CosmosUnsignedTransaction, EVM, type EVMMessage, type EVMTransactionRequest, type EVMTypedData, type EVMUnsignedTransaction, type HashToSign, type KeyDerivationPath, type MPCSignature, type NajPublicKey, type NearNearMpcSignature, type RSVSignature, type SigNetEvmMpcSignature, type SigNetNearMpcSignature, type SignArgs, type UncompressedPubKeySEC1, fetchEVMFeeProperties, index as utils };
|