signet.js 0.0.10-beta → 0.0.10-beta10
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 +3 -1
- package/types/index.d.cts +391 -87
- package/types/index.d.ts +391 -87
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-beta10",
|
|
4
4
|
"description": "A TypeScript library for handling multi-chain transactions and signatures using Signet MPC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"vocs": "1.0.0-alpha.62"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
+
"@coral-xyz/anchor": "^0.31.0",
|
|
85
86
|
"@cosmjs/amino": "^0.32.4",
|
|
86
87
|
"@cosmjs/crypto": "^0.32.4",
|
|
87
88
|
"@cosmjs/encoding": "^0.32.4",
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
"@near-js/types": "^0.3.1",
|
|
96
97
|
"@near-wallet-selector/core": "^8.9.5",
|
|
97
98
|
"@scure/base": "^1.2.4",
|
|
99
|
+
"@solana/web3.js": "^1.98.0",
|
|
98
100
|
"bech32": "^2.0.0",
|
|
99
101
|
"bitcoinjs-lib": "^6.1.5",
|
|
100
102
|
"bn.js": "^5.2.1",
|
package/types/index.d.cts
CHANGED
|
@@ -8,6 +8,9 @@ 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';
|
|
11
14
|
|
|
12
15
|
interface SignArgs {
|
|
13
16
|
/** The payload to sign as an array of 32 bytes */
|
|
@@ -46,7 +49,7 @@ declare abstract class BaseChainSignatureContract {
|
|
|
46
49
|
/**
|
|
47
50
|
* Full contract interface that extends BaseChainSignatureContract to provide all Sig Network Smart Contract capabilities.
|
|
48
51
|
*/
|
|
49
|
-
declare abstract class ChainSignatureContract$
|
|
52
|
+
declare abstract class ChainSignatureContract$3 extends BaseChainSignatureContract {
|
|
50
53
|
/**
|
|
51
54
|
* Signs a payload using Sig Network MPC.
|
|
52
55
|
*
|
|
@@ -104,10 +107,12 @@ declare const ENVS: {
|
|
|
104
107
|
readonly TESTNET_DEV: "TESTNET_DEV";
|
|
105
108
|
readonly TESTNET: "TESTNET";
|
|
106
109
|
readonly MAINNET: "MAINNET";
|
|
110
|
+
readonly SOLANA_STUB: "SOLANA_STUB";
|
|
107
111
|
};
|
|
108
112
|
declare const CHAINS: {
|
|
109
113
|
readonly ETHEREUM: "ETHEREUM";
|
|
110
114
|
readonly NEAR: "NEAR";
|
|
115
|
+
readonly SOLANA: "SOLANA";
|
|
111
116
|
};
|
|
112
117
|
/**
|
|
113
118
|
* Root public keys for the Sig Network Smart Contracts across different environments.
|
|
@@ -124,6 +129,7 @@ declare const ROOT_PUBLIC_KEYS: Record<keyof typeof ENVS, NajPublicKey>;
|
|
|
124
129
|
declare const KDF_CHAIN_IDS: {
|
|
125
130
|
readonly ETHEREUM: "0x1";
|
|
126
131
|
readonly NEAR: "0x18d";
|
|
132
|
+
readonly SOLANA: "0x800001f5";
|
|
127
133
|
};
|
|
128
134
|
/**
|
|
129
135
|
* Contract addresses for different chains and environments.
|
|
@@ -134,7 +140,7 @@ declare const KDF_CHAIN_IDS: {
|
|
|
134
140
|
*
|
|
135
141
|
* @see ChainSignatureContract documentation for implementation details
|
|
136
142
|
*/
|
|
137
|
-
declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Record<keyof typeof ENVS, string
|
|
143
|
+
declare const CONTRACT_ADDRESSES: Record<keyof typeof CHAINS, Partial<Record<keyof typeof ENVS, string>>>;
|
|
138
144
|
|
|
139
145
|
declare const constants_CHAINS: typeof CHAINS;
|
|
140
146
|
declare const constants_CONTRACT_ADDRESSES: typeof CONTRACT_ADDRESSES;
|
|
@@ -182,9 +188,9 @@ declare namespace cryptography {
|
|
|
182
188
|
export { cryptography_compressPubKey as compressPubKey, cryptography_deriveChildPublicKey as deriveChildPublicKey, cryptography_najToUncompressedPubKeySEC1 as najToUncompressedPubKeySEC1, cryptography_toRSV as toRSV };
|
|
183
189
|
}
|
|
184
190
|
|
|
185
|
-
declare const index$
|
|
186
|
-
declare namespace index$
|
|
187
|
-
export { index$
|
|
191
|
+
declare const index$8_cryptography: typeof cryptography;
|
|
192
|
+
declare namespace index$8 {
|
|
193
|
+
export { index$8_cryptography as cryptography };
|
|
188
194
|
}
|
|
189
195
|
|
|
190
196
|
declare abstract class ChainAdapter<TransactionRequest, UnsignedTransaction> {
|
|
@@ -382,15 +388,15 @@ interface EVMFeeProperties {
|
|
|
382
388
|
}
|
|
383
389
|
declare function fetchEVMFeeProperties(client: PublicClient, transaction: TransactionRequest): Promise<EVMFeeProperties>;
|
|
384
390
|
|
|
385
|
-
type index$
|
|
386
|
-
declare const index$
|
|
387
|
-
type index$
|
|
388
|
-
type index$
|
|
389
|
-
type index$
|
|
390
|
-
type index$
|
|
391
|
-
declare const index$
|
|
392
|
-
declare namespace index$
|
|
393
|
-
export { index$
|
|
391
|
+
type index$7_EVM = EVM;
|
|
392
|
+
declare const index$7_EVM: typeof EVM;
|
|
393
|
+
type index$7_EVMMessage = EVMMessage;
|
|
394
|
+
type index$7_EVMTransactionRequest = EVMTransactionRequest;
|
|
395
|
+
type index$7_EVMTypedData = EVMTypedData;
|
|
396
|
+
type index$7_EVMUnsignedTransaction = EVMUnsignedTransaction;
|
|
397
|
+
declare const index$7_fetchEVMFeeProperties: typeof fetchEVMFeeProperties;
|
|
398
|
+
declare namespace index$7 {
|
|
399
|
+
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 };
|
|
394
400
|
}
|
|
395
401
|
|
|
396
402
|
interface BTCTransaction$1 {
|
|
@@ -528,18 +534,18 @@ declare class Bitcoin extends ChainAdapter<BTCTransactionRequest, BTCUnsignedTra
|
|
|
528
534
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
529
535
|
}
|
|
530
536
|
|
|
531
|
-
type index$
|
|
532
|
-
type index$
|
|
533
|
-
type index$
|
|
534
|
-
type index$
|
|
535
|
-
declare const index$
|
|
536
|
-
declare const index$
|
|
537
|
-
type index$
|
|
538
|
-
type index$
|
|
539
|
-
type index$
|
|
540
|
-
declare const index$
|
|
541
|
-
declare namespace index$
|
|
542
|
-
export { type index$
|
|
537
|
+
type index$6_BTCInput = BTCInput;
|
|
538
|
+
type index$6_BTCNetworkIds = BTCNetworkIds;
|
|
539
|
+
type index$6_BTCOutput = BTCOutput;
|
|
540
|
+
type index$6_BTCRpcAdapter = BTCRpcAdapter;
|
|
541
|
+
declare const index$6_BTCRpcAdapter: typeof BTCRpcAdapter;
|
|
542
|
+
declare const index$6_BTCRpcAdapters: typeof BTCRpcAdapters;
|
|
543
|
+
type index$6_BTCTransactionRequest = BTCTransactionRequest;
|
|
544
|
+
type index$6_BTCUnsignedTransaction = BTCUnsignedTransaction;
|
|
545
|
+
type index$6_Bitcoin = Bitcoin;
|
|
546
|
+
declare const index$6_Bitcoin: typeof Bitcoin;
|
|
547
|
+
declare namespace index$6 {
|
|
548
|
+
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 };
|
|
543
549
|
}
|
|
544
550
|
|
|
545
551
|
type CosmosNetworkIds = string;
|
|
@@ -601,19 +607,19 @@ declare class Cosmos extends ChainAdapter<CosmosTransactionRequest, CosmosUnsign
|
|
|
601
607
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
602
608
|
}
|
|
603
609
|
|
|
604
|
-
type index$
|
|
605
|
-
declare const index$
|
|
606
|
-
type index$
|
|
607
|
-
type index$
|
|
608
|
-
type index$
|
|
609
|
-
declare namespace index$
|
|
610
|
-
export { index$
|
|
610
|
+
type index$5_Cosmos = Cosmos;
|
|
611
|
+
declare const index$5_Cosmos: typeof Cosmos;
|
|
612
|
+
type index$5_CosmosNetworkIds = CosmosNetworkIds;
|
|
613
|
+
type index$5_CosmosTransactionRequest = CosmosTransactionRequest;
|
|
614
|
+
type index$5_CosmosUnsignedTransaction = CosmosUnsignedTransaction;
|
|
615
|
+
declare namespace index$5 {
|
|
616
|
+
export { index$5_Cosmos as Cosmos, type index$5_CosmosNetworkIds as CosmosNetworkIds, type index$5_CosmosTransactionRequest as CosmosTransactionRequest, type index$5_CosmosUnsignedTransaction as CosmosUnsignedTransaction };
|
|
611
617
|
}
|
|
612
618
|
|
|
613
|
-
type index$
|
|
614
|
-
declare const index$
|
|
615
|
-
declare namespace index$
|
|
616
|
-
export { index$
|
|
619
|
+
type index$4_ChainAdapter<TransactionRequest, UnsignedTransaction> = ChainAdapter<TransactionRequest, UnsignedTransaction>;
|
|
620
|
+
declare const index$4_ChainAdapter: typeof ChainAdapter;
|
|
621
|
+
declare namespace index$4 {
|
|
622
|
+
export { index$4_ChainAdapter as ChainAdapter, index$6 as btc, index$5 as cosmos, index$7 as evm };
|
|
617
623
|
}
|
|
618
624
|
|
|
619
625
|
type ChainSignatureContractIds = string;
|
|
@@ -734,7 +740,7 @@ interface ChainSignatureContractArgs {
|
|
|
734
740
|
*
|
|
735
741
|
* @extends AbstractChainSignatureContract
|
|
736
742
|
*/
|
|
737
|
-
declare class ChainSignatureContract$
|
|
743
|
+
declare class ChainSignatureContract$2 extends ChainSignatureContract$3 {
|
|
738
744
|
private readonly networkId;
|
|
739
745
|
private readonly contractId;
|
|
740
746
|
private readonly accountId;
|
|
@@ -766,13 +772,13 @@ declare class ChainSignatureContract$1 extends ChainSignatureContract$2 {
|
|
|
766
772
|
private requireAccount;
|
|
767
773
|
}
|
|
768
774
|
|
|
769
|
-
declare const utils$
|
|
775
|
+
declare const utils$2: {
|
|
770
776
|
transaction: typeof transaction;
|
|
771
777
|
signAndSend: typeof signAndSend;
|
|
772
778
|
};
|
|
773
779
|
|
|
774
|
-
declare namespace index$
|
|
775
|
-
export { ChainSignatureContract$
|
|
780
|
+
declare namespace index$3 {
|
|
781
|
+
export { ChainSignatureContract$2 as ChainSignatureContract, utils$2 as utils };
|
|
776
782
|
}
|
|
777
783
|
|
|
778
784
|
declare const abi: ({
|
|
@@ -893,28 +899,22 @@ declare class ChainSignatureError extends Error {
|
|
|
893
899
|
receipt: TransactionReceipt;
|
|
894
900
|
constructor(message: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
895
901
|
}
|
|
896
|
-
declare class SignatureNotFoundError extends ChainSignatureError {
|
|
902
|
+
declare class SignatureNotFoundError$1 extends ChainSignatureError {
|
|
897
903
|
constructor(requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
898
904
|
}
|
|
899
|
-
declare class SignatureContractError extends ChainSignatureError {
|
|
905
|
+
declare class SignatureContractError$1 extends ChainSignatureError {
|
|
900
906
|
errorCode: string;
|
|
901
907
|
constructor(errorCode: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
902
908
|
}
|
|
903
|
-
declare class SigningError extends ChainSignatureError {
|
|
909
|
+
declare class SigningError$1 extends ChainSignatureError {
|
|
904
910
|
originalError?: Error;
|
|
905
911
|
constructor(requestId: `0x${string}`, receipt: TransactionReceipt, originalError?: Error);
|
|
906
912
|
}
|
|
907
913
|
|
|
908
|
-
type
|
|
909
|
-
declare const
|
|
910
|
-
|
|
911
|
-
|
|
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 };
|
|
914
|
+
type errors$1_ChainSignatureError = ChainSignatureError;
|
|
915
|
+
declare const errors$1_ChainSignatureError: typeof ChainSignatureError;
|
|
916
|
+
declare namespace errors$1 {
|
|
917
|
+
export { errors$1_ChainSignatureError as ChainSignatureError, SignatureContractError$1 as SignatureContractError, SignatureNotFoundError$1 as SignatureNotFoundError, SigningError$1 as SigningError };
|
|
918
918
|
}
|
|
919
919
|
|
|
920
920
|
interface RetryOptions {
|
|
@@ -929,21 +929,11 @@ interface SignOptions {
|
|
|
929
929
|
};
|
|
930
930
|
retry: RetryOptions;
|
|
931
931
|
}
|
|
932
|
-
interface SignatureErrorData {
|
|
932
|
+
interface SignatureErrorData$1 {
|
|
933
933
|
requestId: string;
|
|
934
934
|
responder: string;
|
|
935
935
|
error: string;
|
|
936
936
|
}
|
|
937
|
-
interface RequestIdArgs {
|
|
938
|
-
address: Address;
|
|
939
|
-
payload: Hex;
|
|
940
|
-
path: string;
|
|
941
|
-
keyVersion: number;
|
|
942
|
-
chainId: bigint;
|
|
943
|
-
algo: string;
|
|
944
|
-
dest: string;
|
|
945
|
-
params: string;
|
|
946
|
-
}
|
|
947
937
|
|
|
948
938
|
/**
|
|
949
939
|
* Implementation of the ChainSignatureContract for EVM chains.
|
|
@@ -953,7 +943,7 @@ interface RequestIdArgs {
|
|
|
953
943
|
* once it's available. The sign method handles this process automatically by polling
|
|
954
944
|
* for the signature using the requestId.
|
|
955
945
|
*/
|
|
956
|
-
declare class ChainSignatureContract extends ChainSignatureContract$
|
|
946
|
+
declare class ChainSignatureContract$1 extends ChainSignatureContract$3 {
|
|
957
947
|
private readonly publicClient;
|
|
958
948
|
private readonly walletClient;
|
|
959
949
|
private readonly contractAddress;
|
|
@@ -992,38 +982,37 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
|
992
982
|
path: string;
|
|
993
983
|
fromBlock: bigint;
|
|
994
984
|
options?: RetryOptions;
|
|
995
|
-
}): Promise<RSVSignature | SignatureErrorData | undefined>;
|
|
985
|
+
}): Promise<RSVSignature | SignatureErrorData$1 | undefined>;
|
|
986
|
+
getSignRequestParams(args: SignArgs, options?: SignOptions['sign']): Promise<{
|
|
987
|
+
target: Hex;
|
|
988
|
+
data: Hex;
|
|
989
|
+
value: bigint;
|
|
990
|
+
}>;
|
|
996
991
|
/**
|
|
997
992
|
* Generates the request ID for a signature request allowing to track the response.
|
|
998
993
|
*
|
|
999
|
-
* @param
|
|
1000
|
-
* @param
|
|
1001
|
-
* @param
|
|
1002
|
-
* @param
|
|
1003
|
-
*
|
|
1004
|
-
* @param
|
|
1005
|
-
* @param
|
|
1006
|
-
* @param
|
|
1007
|
-
* @param request.params - Additional parameters for the signing process
|
|
994
|
+
* @param args - The signature request object containing:
|
|
995
|
+
* @param args.payload - The data payload to be signed as a hex string
|
|
996
|
+
* @param args.path - The derivation path for the key
|
|
997
|
+
* @param args.keyVersion - The version of the key to use
|
|
998
|
+
* @param options - The signature request object containing:
|
|
999
|
+
* @param options.algo - The signing algorithm to use
|
|
1000
|
+
* @param options.dest - The destination for the signature
|
|
1001
|
+
* @param options.params - Additional parameters for the signing process
|
|
1008
1002
|
* @returns A hex string representing the unique request ID
|
|
1009
1003
|
*
|
|
1010
1004
|
* @example
|
|
1011
1005
|
* ```typescript
|
|
1012
1006
|
* const requestId = ChainSignatureContract.getRequestId({
|
|
1013
|
-
* address: walletClient.account.address,
|
|
1014
1007
|
* payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
|
|
1015
1008
|
* path: '',
|
|
1016
|
-
* keyVersion: 0
|
|
1017
|
-
* chainId: 1n,
|
|
1018
|
-
* algo: '',
|
|
1019
|
-
* dest: '',
|
|
1020
|
-
* params: ''
|
|
1009
|
+
* keyVersion: 0
|
|
1021
1010
|
* });
|
|
1022
1011
|
* console.log(requestId); // 0x...
|
|
1023
1012
|
* ```
|
|
1024
1013
|
*/
|
|
1025
|
-
getRequestId(
|
|
1026
|
-
getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
|
|
1014
|
+
getRequestId(args: SignArgs, options?: SignOptions['sign']): Hex;
|
|
1015
|
+
getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData$1 | undefined>;
|
|
1027
1016
|
/**
|
|
1028
1017
|
* Searches for SignatureResponded events that match the given requestId.
|
|
1029
1018
|
* It works in conjunction with the getRequestId method which generates the unique
|
|
@@ -1036,8 +1025,323 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
|
1036
1025
|
getSignatureFromEvents(requestId: Hex, fromBlock: bigint): Promise<RSVSignature | undefined>;
|
|
1037
1026
|
}
|
|
1038
1027
|
|
|
1039
|
-
declare const utils: {
|
|
1028
|
+
declare const utils$1: {
|
|
1040
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
|
+
declare const utils: {
|
|
1140
|
+
ChainSignaturesContractIdl: {
|
|
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
|
+
};
|
|
1041
1345
|
errors: typeof errors;
|
|
1042
1346
|
};
|
|
1043
1347
|
|
|
@@ -1050,7 +1354,7 @@ declare namespace index$1 {
|
|
|
1050
1354
|
|
|
1051
1355
|
type index_SignArgs = SignArgs;
|
|
1052
1356
|
declare namespace index {
|
|
1053
|
-
export { ChainSignatureContract$
|
|
1357
|
+
export { ChainSignatureContract$3 as ChainSignatureContract, type index_SignArgs as SignArgs, index$2 as evm, index$3 as near, index$1 as solana };
|
|
1054
1358
|
}
|
|
1055
1359
|
|
|
1056
|
-
export { type CompressedPubKeySEC1, type HashToSign, type KeyDerivationPath, type MPCSignature, type NajPublicKey, type NearNearMpcSignature, type RSVSignature, type SigNetEvmMpcSignature, type SigNetNearMpcSignature, type UncompressedPubKeySEC1, index$
|
|
1360
|
+
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 };
|