signet.js 0.0.10-beta9 → 0.0.10
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/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 -3
- package/types/index.d.cts +101 -402
- package/types/index.d.ts +101 -402
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signet.js",
|
|
3
|
-
"version": "0.0.10
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "A TypeScript library for handling multi-chain transactions and signatures using Signet MPC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -82,7 +82,6 @@
|
|
|
82
82
|
"vocs": "1.0.0-alpha.62"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@coral-xyz/anchor": "^0.31.0",
|
|
86
85
|
"@cosmjs/amino": "^0.32.4",
|
|
87
86
|
"@cosmjs/crypto": "^0.32.4",
|
|
88
87
|
"@cosmjs/encoding": "^0.32.4",
|
|
@@ -96,7 +95,6 @@
|
|
|
96
95
|
"@near-js/types": "^0.3.1",
|
|
97
96
|
"@near-wallet-selector/core": "^8.9.5",
|
|
98
97
|
"@scure/base": "^1.2.4",
|
|
99
|
-
"@solana/web3.js": "^1.98.0",
|
|
100
98
|
"bech32": "^2.0.0",
|
|
101
99
|
"bitcoinjs-lib": "^6.1.5",
|
|
102
100
|
"bn.js": "^5.2.1",
|
package/types/index.d.cts
CHANGED
|
@@ -8,9 +8,6 @@ import { Action as Action$1 } from '@near-js/transactions';
|
|
|
8
8
|
import { TxExecutionStatus } from '@near-js/types';
|
|
9
9
|
import { NetworkId, Action, FinalExecutionOutcome } from '@near-wallet-selector/core';
|
|
10
10
|
import { KeyPair as KeyPair$1 } from 'near-api-js';
|
|
11
|
-
import * as _solana_web3_js from '@solana/web3.js';
|
|
12
|
-
import { PublicKey } from '@solana/web3.js';
|
|
13
|
-
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
|
|
14
11
|
|
|
15
12
|
interface SignArgs {
|
|
16
13
|
/** The payload to sign as an array of 32 bytes */
|
|
@@ -49,7 +46,7 @@ declare abstract class BaseChainSignatureContract {
|
|
|
49
46
|
/**
|
|
50
47
|
* Full contract interface that extends BaseChainSignatureContract to provide all Sig Network Smart Contract capabilities.
|
|
51
48
|
*/
|
|
52
|
-
declare abstract class ChainSignatureContract$
|
|
49
|
+
declare abstract class ChainSignatureContract$2 extends BaseChainSignatureContract {
|
|
53
50
|
/**
|
|
54
51
|
* Signs a payload using Sig Network MPC.
|
|
55
52
|
*
|
|
@@ -107,12 +104,10 @@ declare const ENVS: {
|
|
|
107
104
|
readonly TESTNET_DEV: "TESTNET_DEV";
|
|
108
105
|
readonly TESTNET: "TESTNET";
|
|
109
106
|
readonly MAINNET: "MAINNET";
|
|
110
|
-
readonly SOLANA_STUB: "SOLANA_STUB";
|
|
111
107
|
};
|
|
112
108
|
declare const CHAINS: {
|
|
113
109
|
readonly ETHEREUM: "ETHEREUM";
|
|
114
110
|
readonly NEAR: "NEAR";
|
|
115
|
-
readonly SOLANA: "SOLANA";
|
|
116
111
|
};
|
|
117
112
|
/**
|
|
118
113
|
* Root public keys for the Sig Network Smart Contracts across different environments.
|
|
@@ -129,7 +124,6 @@ declare const ROOT_PUBLIC_KEYS: Record<keyof typeof ENVS, NajPublicKey>;
|
|
|
129
124
|
declare const KDF_CHAIN_IDS: {
|
|
130
125
|
readonly ETHEREUM: "0x1";
|
|
131
126
|
readonly NEAR: "0x18d";
|
|
132
|
-
readonly SOLANA: "0x800001f5";
|
|
133
127
|
};
|
|
134
128
|
/**
|
|
135
129
|
* Contract addresses for different chains and environments.
|
|
@@ -140,7 +134,7 @@ declare const KDF_CHAIN_IDS: {
|
|
|
140
134
|
*
|
|
141
135
|
* @see ChainSignatureContract documentation for implementation details
|
|
142
136
|
*/
|
|
143
|
-
declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS,
|
|
137
|
+
declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Record<keyof typeof ENVS, string>>;
|
|
144
138
|
|
|
145
139
|
declare const constants_CHAINS: typeof CHAINS;
|
|
146
140
|
declare const constants_CONTRACT_ADDRESSES: typeof CONTRACT_ADDRESSES;
|
|
@@ -188,9 +182,9 @@ declare namespace cryptography {
|
|
|
188
182
|
export { cryptography_compressPubKey as compressPubKey, cryptography_deriveChildPublicKey as deriveChildPublicKey, cryptography_najToUncompressedPubKeySEC1 as najToUncompressedPubKeySEC1, cryptography_toRSV as toRSV };
|
|
189
183
|
}
|
|
190
184
|
|
|
191
|
-
declare const index$
|
|
192
|
-
declare namespace index$
|
|
193
|
-
export { index$
|
|
185
|
+
declare const index$7_cryptography: typeof cryptography;
|
|
186
|
+
declare namespace index$7 {
|
|
187
|
+
export { index$7_cryptography as cryptography };
|
|
194
188
|
}
|
|
195
189
|
|
|
196
190
|
declare abstract class ChainAdapter<TransactionRequest, UnsignedTransaction> {
|
|
@@ -388,15 +382,15 @@ interface EVMFeeProperties {
|
|
|
388
382
|
}
|
|
389
383
|
declare function fetchEVMFeeProperties(client: PublicClient, transaction: TransactionRequest): Promise<EVMFeeProperties>;
|
|
390
384
|
|
|
391
|
-
type index$
|
|
392
|
-
declare const index$
|
|
393
|
-
type index$
|
|
394
|
-
type index$
|
|
395
|
-
type index$
|
|
396
|
-
type index$
|
|
397
|
-
declare const index$
|
|
398
|
-
declare namespace index$
|
|
399
|
-
export { index$
|
|
385
|
+
type index$6_EVM = EVM;
|
|
386
|
+
declare const index$6_EVM: typeof EVM;
|
|
387
|
+
type index$6_EVMMessage = EVMMessage;
|
|
388
|
+
type index$6_EVMTransactionRequest = EVMTransactionRequest;
|
|
389
|
+
type index$6_EVMTypedData = EVMTypedData;
|
|
390
|
+
type index$6_EVMUnsignedTransaction = EVMUnsignedTransaction;
|
|
391
|
+
declare const index$6_fetchEVMFeeProperties: typeof fetchEVMFeeProperties;
|
|
392
|
+
declare namespace index$6 {
|
|
393
|
+
export { index$6_EVM as EVM, type index$6_EVMMessage as EVMMessage, type index$6_EVMTransactionRequest as EVMTransactionRequest, type index$6_EVMTypedData as EVMTypedData, type index$6_EVMUnsignedTransaction as EVMUnsignedTransaction, index$6_fetchEVMFeeProperties as fetchEVMFeeProperties };
|
|
400
394
|
}
|
|
401
395
|
|
|
402
396
|
interface BTCTransaction$1 {
|
|
@@ -534,18 +528,18 @@ declare class Bitcoin extends ChainAdapter<BTCTransactionRequest, BTCUnsignedTra
|
|
|
534
528
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
535
529
|
}
|
|
536
530
|
|
|
537
|
-
type index$
|
|
538
|
-
type index$
|
|
539
|
-
type index$
|
|
540
|
-
type index$
|
|
541
|
-
declare const index$
|
|
542
|
-
declare const index$
|
|
543
|
-
type index$
|
|
544
|
-
type index$
|
|
545
|
-
type index$
|
|
546
|
-
declare const index$
|
|
547
|
-
declare namespace index$
|
|
548
|
-
export { type index$
|
|
531
|
+
type index$5_BTCInput = BTCInput;
|
|
532
|
+
type index$5_BTCNetworkIds = BTCNetworkIds;
|
|
533
|
+
type index$5_BTCOutput = BTCOutput;
|
|
534
|
+
type index$5_BTCRpcAdapter = BTCRpcAdapter;
|
|
535
|
+
declare const index$5_BTCRpcAdapter: typeof BTCRpcAdapter;
|
|
536
|
+
declare const index$5_BTCRpcAdapters: typeof BTCRpcAdapters;
|
|
537
|
+
type index$5_BTCTransactionRequest = BTCTransactionRequest;
|
|
538
|
+
type index$5_BTCUnsignedTransaction = BTCUnsignedTransaction;
|
|
539
|
+
type index$5_Bitcoin = Bitcoin;
|
|
540
|
+
declare const index$5_Bitcoin: typeof Bitcoin;
|
|
541
|
+
declare namespace index$5 {
|
|
542
|
+
export { type index$5_BTCInput as BTCInput, type index$5_BTCNetworkIds as BTCNetworkIds, type index$5_BTCOutput as BTCOutput, index$5_BTCRpcAdapter as BTCRpcAdapter, index$5_BTCRpcAdapters as BTCRpcAdapters, type BTCTransaction$1 as BTCTransaction, type index$5_BTCTransactionRequest as BTCTransactionRequest, type index$5_BTCUnsignedTransaction as BTCUnsignedTransaction, index$5_Bitcoin as Bitcoin };
|
|
549
543
|
}
|
|
550
544
|
|
|
551
545
|
type CosmosNetworkIds = string;
|
|
@@ -607,19 +601,19 @@ declare class Cosmos extends ChainAdapter<CosmosTransactionRequest, CosmosUnsign
|
|
|
607
601
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
608
602
|
}
|
|
609
603
|
|
|
610
|
-
type index$
|
|
611
|
-
declare const index$
|
|
612
|
-
type index$
|
|
613
|
-
type index$
|
|
614
|
-
type index$
|
|
615
|
-
declare namespace index$
|
|
616
|
-
export { index$
|
|
604
|
+
type index$4_Cosmos = Cosmos;
|
|
605
|
+
declare const index$4_Cosmos: typeof Cosmos;
|
|
606
|
+
type index$4_CosmosNetworkIds = CosmosNetworkIds;
|
|
607
|
+
type index$4_CosmosTransactionRequest = CosmosTransactionRequest;
|
|
608
|
+
type index$4_CosmosUnsignedTransaction = CosmosUnsignedTransaction;
|
|
609
|
+
declare namespace index$4 {
|
|
610
|
+
export { index$4_Cosmos as Cosmos, type index$4_CosmosNetworkIds as CosmosNetworkIds, type index$4_CosmosTransactionRequest as CosmosTransactionRequest, type index$4_CosmosUnsignedTransaction as CosmosUnsignedTransaction };
|
|
617
611
|
}
|
|
618
612
|
|
|
619
|
-
type index$
|
|
620
|
-
declare const index$
|
|
621
|
-
declare namespace index$
|
|
622
|
-
export { index$
|
|
613
|
+
type index$3_ChainAdapter<TransactionRequest, UnsignedTransaction> = ChainAdapter<TransactionRequest, UnsignedTransaction>;
|
|
614
|
+
declare const index$3_ChainAdapter: typeof ChainAdapter;
|
|
615
|
+
declare namespace index$3 {
|
|
616
|
+
export { index$3_ChainAdapter as ChainAdapter, index$5 as btc, index$4 as cosmos, index$6 as evm };
|
|
623
617
|
}
|
|
624
618
|
|
|
625
619
|
type ChainSignatureContractIds = string;
|
|
@@ -740,7 +734,7 @@ interface ChainSignatureContractArgs {
|
|
|
740
734
|
*
|
|
741
735
|
* @extends AbstractChainSignatureContract
|
|
742
736
|
*/
|
|
743
|
-
declare class ChainSignatureContract$
|
|
737
|
+
declare class ChainSignatureContract$1 extends ChainSignatureContract$2 {
|
|
744
738
|
private readonly networkId;
|
|
745
739
|
private readonly contractId;
|
|
746
740
|
private readonly accountId;
|
|
@@ -772,13 +766,13 @@ declare class ChainSignatureContract$2 extends ChainSignatureContract$3 {
|
|
|
772
766
|
private requireAccount;
|
|
773
767
|
}
|
|
774
768
|
|
|
775
|
-
declare const utils$
|
|
769
|
+
declare const utils$1: {
|
|
776
770
|
transaction: typeof transaction;
|
|
777
771
|
signAndSend: typeof signAndSend;
|
|
778
772
|
};
|
|
779
773
|
|
|
780
|
-
declare namespace index$
|
|
781
|
-
export { ChainSignatureContract$
|
|
774
|
+
declare namespace index$2 {
|
|
775
|
+
export { ChainSignatureContract$1 as ChainSignatureContract, utils$1 as utils };
|
|
782
776
|
}
|
|
783
777
|
|
|
784
778
|
declare const abi: ({
|
|
@@ -899,41 +893,56 @@ declare class ChainSignatureError extends Error {
|
|
|
899
893
|
receipt: TransactionReceipt;
|
|
900
894
|
constructor(message: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
901
895
|
}
|
|
902
|
-
declare class SignatureNotFoundError
|
|
896
|
+
declare class SignatureNotFoundError extends ChainSignatureError {
|
|
903
897
|
constructor(requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
904
898
|
}
|
|
905
|
-
declare class SignatureContractError
|
|
899
|
+
declare class SignatureContractError extends ChainSignatureError {
|
|
906
900
|
errorCode: string;
|
|
907
901
|
constructor(errorCode: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
908
902
|
}
|
|
909
|
-
declare class SigningError
|
|
903
|
+
declare class SigningError extends ChainSignatureError {
|
|
910
904
|
originalError?: Error;
|
|
911
905
|
constructor(requestId: `0x${string}`, receipt: TransactionReceipt, originalError?: Error);
|
|
912
906
|
}
|
|
913
907
|
|
|
914
|
-
type
|
|
915
|
-
declare const
|
|
916
|
-
|
|
917
|
-
|
|
908
|
+
type errors_ChainSignatureError = ChainSignatureError;
|
|
909
|
+
declare const errors_ChainSignatureError: typeof ChainSignatureError;
|
|
910
|
+
type errors_SignatureContractError = SignatureContractError;
|
|
911
|
+
declare const errors_SignatureContractError: typeof SignatureContractError;
|
|
912
|
+
type errors_SignatureNotFoundError = SignatureNotFoundError;
|
|
913
|
+
declare const errors_SignatureNotFoundError: typeof SignatureNotFoundError;
|
|
914
|
+
type errors_SigningError = SigningError;
|
|
915
|
+
declare const errors_SigningError: typeof SigningError;
|
|
916
|
+
declare namespace errors {
|
|
917
|
+
export { errors_ChainSignatureError as ChainSignatureError, errors_SignatureContractError as SignatureContractError, errors_SignatureNotFoundError as SignatureNotFoundError, errors_SigningError as SigningError };
|
|
918
918
|
}
|
|
919
919
|
|
|
920
|
-
interface RetryOptions {
|
|
921
|
-
delay?: number;
|
|
922
|
-
retryCount?: number;
|
|
923
|
-
}
|
|
924
920
|
interface SignOptions {
|
|
925
921
|
sign: {
|
|
926
922
|
algo?: string;
|
|
927
923
|
dest?: string;
|
|
928
924
|
params?: string;
|
|
929
925
|
};
|
|
930
|
-
retry:
|
|
926
|
+
retry: {
|
|
927
|
+
delay?: number;
|
|
928
|
+
retryCount?: number;
|
|
929
|
+
};
|
|
931
930
|
}
|
|
932
|
-
interface SignatureErrorData
|
|
931
|
+
interface SignatureErrorData {
|
|
933
932
|
requestId: string;
|
|
934
933
|
responder: string;
|
|
935
934
|
error: string;
|
|
936
935
|
}
|
|
936
|
+
interface RequestIdArgs {
|
|
937
|
+
address: Address;
|
|
938
|
+
payload: Hex;
|
|
939
|
+
path: string;
|
|
940
|
+
keyVersion: number;
|
|
941
|
+
chainId: bigint;
|
|
942
|
+
algo: string;
|
|
943
|
+
dest: string;
|
|
944
|
+
params: string;
|
|
945
|
+
}
|
|
937
946
|
|
|
938
947
|
/**
|
|
939
948
|
* Implementation of the ChainSignatureContract for EVM chains.
|
|
@@ -943,7 +952,7 @@ interface SignatureErrorData$1 {
|
|
|
943
952
|
* once it's available. The sign method handles this process automatically by polling
|
|
944
953
|
* for the signature using the requestId.
|
|
945
954
|
*/
|
|
946
|
-
declare class ChainSignatureContract
|
|
955
|
+
declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
947
956
|
private readonly publicClient;
|
|
948
957
|
private readonly walletClient;
|
|
949
958
|
private readonly contractAddress;
|
|
@@ -970,49 +979,54 @@ declare class ChainSignatureContract$1 extends ChainSignatureContract$3 {
|
|
|
970
979
|
}): Promise<UncompressedPubKeySEC1>;
|
|
971
980
|
getPublicKey(): Promise<UncompressedPubKeySEC1>;
|
|
972
981
|
getLatestKeyVersion(): Promise<number>;
|
|
982
|
+
/**
|
|
983
|
+
* Sends a sign request transaction and return the transaction hash.
|
|
984
|
+
*
|
|
985
|
+
* @param args - The signature arguments
|
|
986
|
+
* @param options - The signing options
|
|
987
|
+
* @returns The transaction hash
|
|
988
|
+
*/
|
|
989
|
+
createSignatureRequest(args: SignArgs, options?: Pick<SignOptions, 'sign'>): Promise<{
|
|
990
|
+
txHash: Hex;
|
|
991
|
+
requestId: Hex;
|
|
992
|
+
}>;
|
|
973
993
|
/**
|
|
974
994
|
* Sends a transaction to the contract to request a signature, then
|
|
975
995
|
* polls for the signature result. If the signature is not found within the retry
|
|
976
996
|
* parameters, it will throw an error.
|
|
977
997
|
*/
|
|
978
998
|
sign(args: SignArgs, options?: SignOptions): Promise<RSVSignature>;
|
|
979
|
-
pollForRequestId({ requestId, payload, path, fromBlock, options, }: {
|
|
980
|
-
requestId: Hex;
|
|
981
|
-
payload: number[];
|
|
982
|
-
path: string;
|
|
983
|
-
fromBlock: bigint;
|
|
984
|
-
options?: RetryOptions;
|
|
985
|
-
}): Promise<RSVSignature | SignatureErrorData$1 | undefined>;
|
|
986
|
-
getSignRequestParams(args: SignArgs, options?: SignOptions['sign']): Promise<{
|
|
987
|
-
target: Hex;
|
|
988
|
-
data: Hex;
|
|
989
|
-
value: bigint;
|
|
990
|
-
}>;
|
|
991
999
|
/**
|
|
992
1000
|
* Generates the request ID for a signature request allowing to track the response.
|
|
993
1001
|
*
|
|
994
|
-
* @param
|
|
995
|
-
* @param
|
|
996
|
-
* @param
|
|
997
|
-
* @param
|
|
998
|
-
*
|
|
999
|
-
* @param
|
|
1000
|
-
* @param
|
|
1001
|
-
* @param
|
|
1002
|
+
* @param request - The signature request object containing:
|
|
1003
|
+
* @param request.address - The contract/wallet address calling the signing contract
|
|
1004
|
+
* @param request.payload - The data payload to be signed as a hex string
|
|
1005
|
+
* @param request.path - The derivation path for the key
|
|
1006
|
+
* @param request.keyVersion - The version of the key to use
|
|
1007
|
+
* @param request.chainId - The chain ID as a bigint
|
|
1008
|
+
* @param request.algo - The signing algorithm to use
|
|
1009
|
+
* @param request.dest - The destination for the signature
|
|
1010
|
+
* @param request.params - Additional parameters for the signing process
|
|
1002
1011
|
* @returns A hex string representing the unique request ID
|
|
1003
1012
|
*
|
|
1004
1013
|
* @example
|
|
1005
1014
|
* ```typescript
|
|
1006
1015
|
* const requestId = ChainSignatureContract.getRequestId({
|
|
1016
|
+
* address: walletClient.account.address,
|
|
1007
1017
|
* payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
|
|
1008
1018
|
* path: '',
|
|
1009
|
-
* keyVersion: 0
|
|
1019
|
+
* keyVersion: 0,
|
|
1020
|
+
* chainId: 1n,
|
|
1021
|
+
* algo: '',
|
|
1022
|
+
* dest: '',
|
|
1023
|
+
* params: ''
|
|
1010
1024
|
* });
|
|
1011
1025
|
* console.log(requestId); // 0x...
|
|
1012
1026
|
* ```
|
|
1013
1027
|
*/
|
|
1014
|
-
getRequestId(
|
|
1015
|
-
getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData
|
|
1028
|
+
getRequestId(request: RequestIdArgs): Hex;
|
|
1029
|
+
getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
|
|
1016
1030
|
/**
|
|
1017
1031
|
* Searches for SignatureResponded events that match the given requestId.
|
|
1018
1032
|
* It works in conjunction with the getRequestId method which generates the unique
|
|
@@ -1025,323 +1039,8 @@ declare class ChainSignatureContract$1 extends ChainSignatureContract$3 {
|
|
|
1025
1039
|
getSignatureFromEvents(requestId: Hex, fromBlock: bigint): Promise<RSVSignature | undefined>;
|
|
1026
1040
|
}
|
|
1027
1041
|
|
|
1028
|
-
declare const utils$1: {
|
|
1029
|
-
ChainSignaturesContractABI: typeof ChainSignaturesContractABI;
|
|
1030
|
-
errors: typeof errors$1;
|
|
1031
|
-
};
|
|
1032
|
-
|
|
1033
|
-
declare namespace index$2 {
|
|
1034
|
-
export { ChainSignatureContract$1 as ChainSignatureContract, utils$1 as utils };
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
type SignatureErrorData = {
|
|
1038
|
-
requestId: Uint8Array;
|
|
1039
|
-
responder: PublicKey;
|
|
1040
|
-
error: string;
|
|
1041
|
-
};
|
|
1042
|
-
declare class SignatureNotFoundError extends Error {
|
|
1043
|
-
readonly requestId?: string;
|
|
1044
|
-
readonly hash?: string;
|
|
1045
|
-
constructor(requestId?: string, metadata?: {
|
|
1046
|
-
hash?: string;
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
declare class SignatureContractError extends Error {
|
|
1050
|
-
readonly requestId?: string;
|
|
1051
|
-
readonly hash?: string;
|
|
1052
|
-
readonly originalError?: any;
|
|
1053
|
-
constructor(message: string, requestId?: string, metadata?: {
|
|
1054
|
-
hash?: string;
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
declare class SigningError extends Error {
|
|
1058
|
-
readonly requestId: string;
|
|
1059
|
-
readonly hash?: string;
|
|
1060
|
-
readonly originalError?: Error;
|
|
1061
|
-
constructor(requestId: string, metadata?: {
|
|
1062
|
-
hash?: string;
|
|
1063
|
-
}, originalError?: Error);
|
|
1064
|
-
}
|
|
1065
|
-
declare class ResponseError extends Error {
|
|
1066
|
-
constructor(message: string);
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
type errors_ResponseError = ResponseError;
|
|
1070
|
-
declare const errors_ResponseError: typeof ResponseError;
|
|
1071
|
-
type errors_SignatureContractError = SignatureContractError;
|
|
1072
|
-
declare const errors_SignatureContractError: typeof SignatureContractError;
|
|
1073
|
-
type errors_SignatureErrorData = SignatureErrorData;
|
|
1074
|
-
type errors_SignatureNotFoundError = SignatureNotFoundError;
|
|
1075
|
-
declare const errors_SignatureNotFoundError: typeof SignatureNotFoundError;
|
|
1076
|
-
type errors_SigningError = SigningError;
|
|
1077
|
-
declare const errors_SigningError: typeof SigningError;
|
|
1078
|
-
declare namespace errors {
|
|
1079
|
-
export { errors_ResponseError as ResponseError, errors_SignatureContractError as SignatureContractError, type errors_SignatureErrorData as SignatureErrorData, errors_SignatureNotFoundError as SignatureNotFoundError, errors_SigningError as SigningError };
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
declare class ChainSignatureContract extends ChainSignatureContract$3 {
|
|
1083
|
-
private readonly provider;
|
|
1084
|
-
private readonly program;
|
|
1085
|
-
private readonly programId;
|
|
1086
|
-
private readonly rootPublicKey;
|
|
1087
|
-
/**
|
|
1088
|
-
* Creates a new instance of the ChainSignatureContract for Solana chains.
|
|
1089
|
-
*
|
|
1090
|
-
* @param args - Configuration options for the contract
|
|
1091
|
-
* @param args.provider - An Anchor Provider for interacting with Solana
|
|
1092
|
-
* @param args.programId - The program ID as a string or PublicKey
|
|
1093
|
-
* @param args.rootPublicKey - Optional root public key. If not provided, it will be derived from the program ID
|
|
1094
|
-
*/
|
|
1095
|
-
constructor(args: {
|
|
1096
|
-
provider: AnchorProvider;
|
|
1097
|
-
programId: string | PublicKey;
|
|
1098
|
-
rootPublicKey?: NajPublicKey;
|
|
1099
|
-
});
|
|
1100
|
-
/**
|
|
1101
|
-
* Gets the connection from the provider
|
|
1102
|
-
*/
|
|
1103
|
-
get connection(): _solana_web3_js.Connection;
|
|
1104
|
-
getCurrentSignatureDeposit(): Promise<BN>;
|
|
1105
|
-
/**
|
|
1106
|
-
* Get the Program State PDA
|
|
1107
|
-
*/
|
|
1108
|
-
getProgramStatePDA(): Promise<PublicKey>;
|
|
1109
|
-
getDerivedPublicKey(args: {
|
|
1110
|
-
path: string;
|
|
1111
|
-
predecessor: string;
|
|
1112
|
-
}): Promise<UncompressedPubKeySEC1>;
|
|
1113
|
-
getPublicKey(): Promise<UncompressedPubKeySEC1>;
|
|
1114
|
-
/**
|
|
1115
|
-
* Sends a transaction to the program to request a signature, then
|
|
1116
|
-
* polls for the signature result. If the signature is not found within the retry
|
|
1117
|
-
* parameters, it will throw an error.
|
|
1118
|
-
*/
|
|
1119
|
-
sign(args: SignArgs & {
|
|
1120
|
-
feePayer?: Wallet;
|
|
1121
|
-
}, options?: SignOptions): Promise<RSVSignature>;
|
|
1122
|
-
/**
|
|
1123
|
-
* Listens for signature or error events matching the given requestId.
|
|
1124
|
-
* Sets up listeners for both event types and returns a promise that resolves when
|
|
1125
|
-
* either a valid signature or an error is received.
|
|
1126
|
-
*/
|
|
1127
|
-
listenForSignatureEvents({ requestId, payload, path, options, }: {
|
|
1128
|
-
requestId: string;
|
|
1129
|
-
payload: number[];
|
|
1130
|
-
path: string;
|
|
1131
|
-
options?: RetryOptions;
|
|
1132
|
-
}): Promise<RSVSignature | SignatureErrorData$1 | undefined>;
|
|
1133
|
-
/**
|
|
1134
|
-
* Generates the request ID for a signature request allowing to track the response.
|
|
1135
|
-
*/
|
|
1136
|
-
getRequestId(args: SignArgs, options?: SignOptions['sign']): string;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
1042
|
declare const utils: {
|
|
1140
|
-
|
|
1141
|
-
address: string;
|
|
1142
|
-
metadata: {
|
|
1143
|
-
name: string;
|
|
1144
|
-
version: string;
|
|
1145
|
-
spec: string;
|
|
1146
|
-
description: string;
|
|
1147
|
-
};
|
|
1148
|
-
instructions: ({
|
|
1149
|
-
name: string;
|
|
1150
|
-
discriminator: number[];
|
|
1151
|
-
accounts: {
|
|
1152
|
-
name: string;
|
|
1153
|
-
signer: boolean;
|
|
1154
|
-
}[];
|
|
1155
|
-
args: ({
|
|
1156
|
-
name: string;
|
|
1157
|
-
type: {
|
|
1158
|
-
vec: {
|
|
1159
|
-
array: (string | number)[];
|
|
1160
|
-
defined?: undefined;
|
|
1161
|
-
};
|
|
1162
|
-
};
|
|
1163
|
-
} | {
|
|
1164
|
-
name: string;
|
|
1165
|
-
type: {
|
|
1166
|
-
vec: {
|
|
1167
|
-
defined: {
|
|
1168
|
-
name: string;
|
|
1169
|
-
};
|
|
1170
|
-
array?: undefined;
|
|
1171
|
-
};
|
|
1172
|
-
};
|
|
1173
|
-
})[];
|
|
1174
|
-
} | {
|
|
1175
|
-
name: string;
|
|
1176
|
-
discriminator: number[];
|
|
1177
|
-
accounts: {
|
|
1178
|
-
name: string;
|
|
1179
|
-
signer: boolean;
|
|
1180
|
-
}[];
|
|
1181
|
-
args: ({
|
|
1182
|
-
name: string;
|
|
1183
|
-
type: {
|
|
1184
|
-
vec: {
|
|
1185
|
-
array: (string | number)[];
|
|
1186
|
-
};
|
|
1187
|
-
};
|
|
1188
|
-
} | {
|
|
1189
|
-
name: string;
|
|
1190
|
-
type: {
|
|
1191
|
-
vec: string;
|
|
1192
|
-
};
|
|
1193
|
-
})[];
|
|
1194
|
-
} | {
|
|
1195
|
-
name: string;
|
|
1196
|
-
discriminator: number[];
|
|
1197
|
-
accounts: ({
|
|
1198
|
-
name: string;
|
|
1199
|
-
writable: boolean;
|
|
1200
|
-
pda: {
|
|
1201
|
-
seeds: {
|
|
1202
|
-
kind: string;
|
|
1203
|
-
value: number[];
|
|
1204
|
-
}[];
|
|
1205
|
-
};
|
|
1206
|
-
signer?: undefined;
|
|
1207
|
-
optional?: undefined;
|
|
1208
|
-
address?: undefined;
|
|
1209
|
-
} | {
|
|
1210
|
-
name: string;
|
|
1211
|
-
writable: boolean;
|
|
1212
|
-
signer: boolean;
|
|
1213
|
-
pda?: undefined;
|
|
1214
|
-
optional?: undefined;
|
|
1215
|
-
address?: undefined;
|
|
1216
|
-
} | {
|
|
1217
|
-
name: string;
|
|
1218
|
-
writable: boolean;
|
|
1219
|
-
signer: boolean;
|
|
1220
|
-
optional: boolean;
|
|
1221
|
-
pda?: undefined;
|
|
1222
|
-
address?: undefined;
|
|
1223
|
-
} | {
|
|
1224
|
-
name: string;
|
|
1225
|
-
address: string;
|
|
1226
|
-
writable?: undefined;
|
|
1227
|
-
pda?: undefined;
|
|
1228
|
-
signer?: undefined;
|
|
1229
|
-
optional?: undefined;
|
|
1230
|
-
})[];
|
|
1231
|
-
args: ({
|
|
1232
|
-
name: string;
|
|
1233
|
-
type: {
|
|
1234
|
-
array: (string | number)[];
|
|
1235
|
-
};
|
|
1236
|
-
} | {
|
|
1237
|
-
name: string;
|
|
1238
|
-
type: string;
|
|
1239
|
-
})[];
|
|
1240
|
-
} | {
|
|
1241
|
-
name: string;
|
|
1242
|
-
discriminator: number[];
|
|
1243
|
-
accounts: ({
|
|
1244
|
-
name: string;
|
|
1245
|
-
writable: boolean;
|
|
1246
|
-
pda: {
|
|
1247
|
-
seeds: {
|
|
1248
|
-
kind: string;
|
|
1249
|
-
value: number[];
|
|
1250
|
-
}[];
|
|
1251
|
-
};
|
|
1252
|
-
signer?: undefined;
|
|
1253
|
-
relations?: undefined;
|
|
1254
|
-
docs?: undefined;
|
|
1255
|
-
address?: undefined;
|
|
1256
|
-
} | {
|
|
1257
|
-
name: string;
|
|
1258
|
-
writable: boolean;
|
|
1259
|
-
signer: boolean;
|
|
1260
|
-
relations: string[];
|
|
1261
|
-
pda?: undefined;
|
|
1262
|
-
docs?: undefined;
|
|
1263
|
-
address?: undefined;
|
|
1264
|
-
} | {
|
|
1265
|
-
name: string;
|
|
1266
|
-
docs: string[];
|
|
1267
|
-
writable: boolean;
|
|
1268
|
-
pda?: undefined;
|
|
1269
|
-
signer?: undefined;
|
|
1270
|
-
relations?: undefined;
|
|
1271
|
-
address?: undefined;
|
|
1272
|
-
} | {
|
|
1273
|
-
name: string;
|
|
1274
|
-
address: string;
|
|
1275
|
-
writable?: undefined;
|
|
1276
|
-
pda?: undefined;
|
|
1277
|
-
signer?: undefined;
|
|
1278
|
-
relations?: undefined;
|
|
1279
|
-
docs?: undefined;
|
|
1280
|
-
})[];
|
|
1281
|
-
args: {
|
|
1282
|
-
name: string;
|
|
1283
|
-
type: string;
|
|
1284
|
-
}[];
|
|
1285
|
-
})[];
|
|
1286
|
-
accounts: {
|
|
1287
|
-
name: string;
|
|
1288
|
-
discriminator: number[];
|
|
1289
|
-
}[];
|
|
1290
|
-
events: {
|
|
1291
|
-
name: string;
|
|
1292
|
-
discriminator: number[];
|
|
1293
|
-
}[];
|
|
1294
|
-
errors: {
|
|
1295
|
-
code: number;
|
|
1296
|
-
name: string;
|
|
1297
|
-
msg: string;
|
|
1298
|
-
}[];
|
|
1299
|
-
types: ({
|
|
1300
|
-
name: string;
|
|
1301
|
-
type: {
|
|
1302
|
-
kind: string;
|
|
1303
|
-
fields: ({
|
|
1304
|
-
name: string;
|
|
1305
|
-
type: {
|
|
1306
|
-
defined: {
|
|
1307
|
-
name: string;
|
|
1308
|
-
};
|
|
1309
|
-
array?: undefined;
|
|
1310
|
-
};
|
|
1311
|
-
} | {
|
|
1312
|
-
name: string;
|
|
1313
|
-
type: {
|
|
1314
|
-
array: (string | number)[];
|
|
1315
|
-
defined?: undefined;
|
|
1316
|
-
};
|
|
1317
|
-
} | {
|
|
1318
|
-
name: string;
|
|
1319
|
-
type: string;
|
|
1320
|
-
})[];
|
|
1321
|
-
};
|
|
1322
|
-
} | {
|
|
1323
|
-
name: string;
|
|
1324
|
-
type: {
|
|
1325
|
-
kind: string;
|
|
1326
|
-
fields: ({
|
|
1327
|
-
name: string;
|
|
1328
|
-
type: string;
|
|
1329
|
-
} | {
|
|
1330
|
-
name: string;
|
|
1331
|
-
type: {
|
|
1332
|
-
array: (string | number)[];
|
|
1333
|
-
option?: undefined;
|
|
1334
|
-
};
|
|
1335
|
-
} | {
|
|
1336
|
-
name: string;
|
|
1337
|
-
type: {
|
|
1338
|
-
option: string;
|
|
1339
|
-
array?: undefined;
|
|
1340
|
-
};
|
|
1341
|
-
})[];
|
|
1342
|
-
};
|
|
1343
|
-
})[];
|
|
1344
|
-
};
|
|
1043
|
+
ChainSignaturesContractABI: typeof ChainSignaturesContractABI;
|
|
1345
1044
|
errors: typeof errors;
|
|
1346
1045
|
};
|
|
1347
1046
|
|
|
@@ -1354,7 +1053,7 @@ declare namespace index$1 {
|
|
|
1354
1053
|
|
|
1355
1054
|
type index_SignArgs = SignArgs;
|
|
1356
1055
|
declare namespace index {
|
|
1357
|
-
export { ChainSignatureContract$
|
|
1056
|
+
export { ChainSignatureContract$2 as ChainSignatureContract, type index_SignArgs as SignArgs, index$1 as evm, index$2 as near };
|
|
1358
1057
|
}
|
|
1359
1058
|
|
|
1360
|
-
export { type CompressedPubKeySEC1, type HashToSign, type KeyDerivationPath, type MPCSignature, type NajPublicKey, type NearNearMpcSignature, type RSVSignature, type SigNetEvmMpcSignature, type SigNetNearMpcSignature, type UncompressedPubKeySEC1, index$
|
|
1059
|
+
export { type CompressedPubKeySEC1, type HashToSign, type KeyDerivationPath, type MPCSignature, type NajPublicKey, type NearNearMpcSignature, type RSVSignature, type SigNetEvmMpcSignature, type SigNetNearMpcSignature, type UncompressedPubKeySEC1, index$3 as chainAdapters, constants, index as contracts, index$7 as utils };
|