signet.js 0.0.11 → 0.0.12
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 +400 -88
- package/types/index.d.ts +400 -88
package/types/index.d.ts
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, AccountMeta, TransactionInstruction } from '@solana/web3.js';
|
|
13
|
+
import { AnchorProvider } 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
|
*
|
|
@@ -108,6 +111,7 @@ declare const ENVS: {
|
|
|
108
111
|
declare const CHAINS: {
|
|
109
112
|
readonly ETHEREUM: "ETHEREUM";
|
|
110
113
|
readonly NEAR: "NEAR";
|
|
114
|
+
readonly SOLANA: "SOLANA";
|
|
111
115
|
};
|
|
112
116
|
/**
|
|
113
117
|
* Root public keys for the Sig Network Smart Contracts across different environments.
|
|
@@ -124,6 +128,7 @@ declare const ROOT_PUBLIC_KEYS: Record<keyof typeof ENVS, NajPublicKey>;
|
|
|
124
128
|
declare const KDF_CHAIN_IDS: {
|
|
125
129
|
readonly ETHEREUM: "0x1";
|
|
126
130
|
readonly NEAR: "0x18d";
|
|
131
|
+
readonly SOLANA: "0x800001f5";
|
|
127
132
|
};
|
|
128
133
|
/**
|
|
129
134
|
* Contract addresses for different chains and environments.
|
|
@@ -182,9 +187,9 @@ declare namespace cryptography {
|
|
|
182
187
|
export { cryptography_compressPubKey as compressPubKey, cryptography_deriveChildPublicKey as deriveChildPublicKey, cryptography_najToUncompressedPubKeySEC1 as najToUncompressedPubKeySEC1, cryptography_toRSV as toRSV };
|
|
183
188
|
}
|
|
184
189
|
|
|
185
|
-
declare const index$
|
|
186
|
-
declare namespace index$
|
|
187
|
-
export { index$
|
|
190
|
+
declare const index$8_cryptography: typeof cryptography;
|
|
191
|
+
declare namespace index$8 {
|
|
192
|
+
export { index$8_cryptography as cryptography };
|
|
188
193
|
}
|
|
189
194
|
|
|
190
195
|
declare abstract class ChainAdapter<TransactionRequest, UnsignedTransaction> {
|
|
@@ -382,15 +387,15 @@ interface EVMFeeProperties {
|
|
|
382
387
|
}
|
|
383
388
|
declare function fetchEVMFeeProperties(client: PublicClient, transaction: TransactionRequest): Promise<EVMFeeProperties>;
|
|
384
389
|
|
|
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$
|
|
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 };
|
|
394
399
|
}
|
|
395
400
|
|
|
396
401
|
interface BTCTransaction$1 {
|
|
@@ -528,18 +533,18 @@ declare class Bitcoin extends ChainAdapter<BTCTransactionRequest, BTCUnsignedTra
|
|
|
528
533
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
529
534
|
}
|
|
530
535
|
|
|
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$
|
|
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 };
|
|
543
548
|
}
|
|
544
549
|
|
|
545
550
|
type CosmosNetworkIds = string;
|
|
@@ -601,19 +606,19 @@ declare class Cosmos extends ChainAdapter<CosmosTransactionRequest, CosmosUnsign
|
|
|
601
606
|
broadcastTx(txSerialized: string): Promise<string>;
|
|
602
607
|
}
|
|
603
608
|
|
|
604
|
-
type index$
|
|
605
|
-
declare const index$
|
|
606
|
-
type index$
|
|
607
|
-
type index$
|
|
608
|
-
type index$
|
|
609
|
-
declare namespace index$
|
|
610
|
-
export { index$
|
|
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 };
|
|
611
616
|
}
|
|
612
617
|
|
|
613
|
-
type index$
|
|
614
|
-
declare const index$
|
|
615
|
-
declare namespace index$
|
|
616
|
-
export { index$
|
|
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 };
|
|
617
622
|
}
|
|
618
623
|
|
|
619
624
|
type ChainSignatureContractIds = string;
|
|
@@ -734,7 +739,7 @@ interface ChainSignatureContractArgs {
|
|
|
734
739
|
*
|
|
735
740
|
* @extends AbstractChainSignatureContract
|
|
736
741
|
*/
|
|
737
|
-
declare class ChainSignatureContract$
|
|
742
|
+
declare class ChainSignatureContract$2 extends ChainSignatureContract$3 {
|
|
738
743
|
private readonly networkId;
|
|
739
744
|
private readonly contractId;
|
|
740
745
|
private readonly accountId;
|
|
@@ -766,13 +771,13 @@ declare class ChainSignatureContract$1 extends ChainSignatureContract$2 {
|
|
|
766
771
|
private requireAccount;
|
|
767
772
|
}
|
|
768
773
|
|
|
769
|
-
declare const utils$
|
|
774
|
+
declare const utils$2: {
|
|
770
775
|
transaction: typeof transaction;
|
|
771
776
|
signAndSend: typeof signAndSend;
|
|
772
777
|
};
|
|
773
778
|
|
|
774
|
-
declare namespace index$
|
|
775
|
-
export { ChainSignatureContract$
|
|
779
|
+
declare namespace index$3 {
|
|
780
|
+
export { ChainSignatureContract$2 as ChainSignatureContract, utils$2 as utils };
|
|
776
781
|
}
|
|
777
782
|
|
|
778
783
|
declare const abi: ({
|
|
@@ -893,56 +898,40 @@ declare class ChainSignatureError extends Error {
|
|
|
893
898
|
receipt: TransactionReceipt;
|
|
894
899
|
constructor(message: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
895
900
|
}
|
|
896
|
-
declare class SignatureNotFoundError extends ChainSignatureError {
|
|
901
|
+
declare class SignatureNotFoundError$1 extends ChainSignatureError {
|
|
897
902
|
constructor(requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
898
903
|
}
|
|
899
|
-
declare class SignatureContractError extends ChainSignatureError {
|
|
904
|
+
declare class SignatureContractError$1 extends ChainSignatureError {
|
|
900
905
|
errorCode: string;
|
|
901
906
|
constructor(errorCode: string, requestId: `0x${string}`, receipt: TransactionReceipt);
|
|
902
907
|
}
|
|
903
|
-
declare class SigningError extends ChainSignatureError {
|
|
908
|
+
declare class SigningError$1 extends ChainSignatureError {
|
|
904
909
|
originalError?: Error;
|
|
905
910
|
constructor(requestId: `0x${string}`, receipt: TransactionReceipt, originalError?: Error);
|
|
906
911
|
}
|
|
907
912
|
|
|
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 };
|
|
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 };
|
|
918
917
|
}
|
|
919
918
|
|
|
919
|
+
interface RetryOptions {
|
|
920
|
+
delay?: number;
|
|
921
|
+
retryCount?: number;
|
|
922
|
+
}
|
|
920
923
|
interface SignOptions {
|
|
921
924
|
sign: {
|
|
922
925
|
algo?: string;
|
|
923
926
|
dest?: string;
|
|
924
927
|
params?: string;
|
|
925
928
|
};
|
|
926
|
-
retry:
|
|
927
|
-
delay?: number;
|
|
928
|
-
retryCount?: number;
|
|
929
|
-
};
|
|
929
|
+
retry: RetryOptions;
|
|
930
930
|
}
|
|
931
931
|
interface SignatureErrorData {
|
|
932
932
|
requestId: string;
|
|
933
|
-
responder: string;
|
|
934
933
|
error: string;
|
|
935
934
|
}
|
|
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
|
-
}
|
|
946
935
|
|
|
947
936
|
/**
|
|
948
937
|
* Implementation of the ChainSignatureContract for EVM chains.
|
|
@@ -952,7 +941,7 @@ interface RequestIdArgs {
|
|
|
952
941
|
* once it's available. The sign method handles this process automatically by polling
|
|
953
942
|
* for the signature using the requestId.
|
|
954
943
|
*/
|
|
955
|
-
declare class ChainSignatureContract extends ChainSignatureContract$
|
|
944
|
+
declare class ChainSignatureContract$1 extends ChainSignatureContract$3 {
|
|
956
945
|
private readonly publicClient;
|
|
957
946
|
private readonly walletClient;
|
|
958
947
|
private readonly contractAddress;
|
|
@@ -996,36 +985,42 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
|
996
985
|
* parameters, it will throw an error.
|
|
997
986
|
*/
|
|
998
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
|
+
}>;
|
|
999
1000
|
/**
|
|
1000
1001
|
* Generates the request ID for a signature request allowing to track the response.
|
|
1001
1002
|
*
|
|
1002
|
-
* @param
|
|
1003
|
-
* @param
|
|
1004
|
-
* @param
|
|
1005
|
-
* @param
|
|
1006
|
-
*
|
|
1007
|
-
* @param
|
|
1008
|
-
* @param
|
|
1009
|
-
* @param
|
|
1010
|
-
* @param request.params - Additional parameters for the signing process
|
|
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
1011
|
* @returns A hex string representing the unique request ID
|
|
1012
1012
|
*
|
|
1013
1013
|
* @example
|
|
1014
1014
|
* ```typescript
|
|
1015
1015
|
* const requestId = ChainSignatureContract.getRequestId({
|
|
1016
|
-
* address: walletClient.account.address,
|
|
1017
1016
|
* payload: payload: `0x${Buffer.from(args.payload).toString('hex')}`,,
|
|
1018
1017
|
* path: '',
|
|
1019
|
-
* keyVersion: 0
|
|
1020
|
-
* chainId: 1n,
|
|
1021
|
-
* algo: '',
|
|
1022
|
-
* dest: '',
|
|
1023
|
-
* params: ''
|
|
1018
|
+
* keyVersion: 0
|
|
1024
1019
|
* });
|
|
1025
1020
|
* console.log(requestId); // 0x...
|
|
1026
1021
|
* ```
|
|
1027
1022
|
*/
|
|
1028
|
-
getRequestId(
|
|
1023
|
+
getRequestId(args: SignArgs, options?: SignOptions['sign']): Hex;
|
|
1029
1024
|
getErrorFromEvents(requestId: Hex, fromBlock: bigint): Promise<SignatureErrorData | undefined>;
|
|
1030
1025
|
/**
|
|
1031
1026
|
* Searches for SignatureResponded events that match the given requestId.
|
|
@@ -1039,8 +1034,325 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
|
1039
1034
|
getSignatureFromEvents(requestId: Hex, fromBlock: bigint): Promise<RSVSignature | undefined>;
|
|
1040
1035
|
}
|
|
1041
1036
|
|
|
1042
|
-
declare const utils: {
|
|
1037
|
+
declare const utils$1: {
|
|
1043
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
|
+
}): Promise<RSVSignature>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Listens for signature or error events matching the given requestId.
|
|
1135
|
+
* Sets up listeners for both event types and returns a promise that resolves when
|
|
1136
|
+
* either a valid signature or an error is received.
|
|
1137
|
+
*/
|
|
1138
|
+
listenForSignatureEvents({ requestId, payload, path, options, }: {
|
|
1139
|
+
requestId: string;
|
|
1140
|
+
payload: number[];
|
|
1141
|
+
path: string;
|
|
1142
|
+
options?: RetryOptions;
|
|
1143
|
+
}): Promise<RSVSignature | SignatureErrorData | undefined>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Generates the request ID for a signature request allowing to track the response.
|
|
1146
|
+
*/
|
|
1147
|
+
getRequestId(args: SignArgs, options?: SignOptions['sign']): string;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
declare const utils: {
|
|
1151
|
+
ChainSignaturesContractIdl: {
|
|
1152
|
+
address: string;
|
|
1153
|
+
metadata: {
|
|
1154
|
+
name: string;
|
|
1155
|
+
version: string;
|
|
1156
|
+
spec: string;
|
|
1157
|
+
description: string;
|
|
1158
|
+
};
|
|
1159
|
+
instructions: ({
|
|
1160
|
+
name: string;
|
|
1161
|
+
discriminator: number[];
|
|
1162
|
+
accounts: {
|
|
1163
|
+
name: string;
|
|
1164
|
+
signer: boolean;
|
|
1165
|
+
}[];
|
|
1166
|
+
args: ({
|
|
1167
|
+
name: string;
|
|
1168
|
+
type: {
|
|
1169
|
+
vec: {
|
|
1170
|
+
array: (string | number)[];
|
|
1171
|
+
defined?: undefined;
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
} | {
|
|
1175
|
+
name: string;
|
|
1176
|
+
type: {
|
|
1177
|
+
vec: {
|
|
1178
|
+
defined: {
|
|
1179
|
+
name: string;
|
|
1180
|
+
};
|
|
1181
|
+
array?: undefined;
|
|
1182
|
+
};
|
|
1183
|
+
};
|
|
1184
|
+
})[];
|
|
1185
|
+
} | {
|
|
1186
|
+
name: string;
|
|
1187
|
+
discriminator: number[];
|
|
1188
|
+
accounts: {
|
|
1189
|
+
name: string;
|
|
1190
|
+
signer: boolean;
|
|
1191
|
+
}[];
|
|
1192
|
+
args: ({
|
|
1193
|
+
name: string;
|
|
1194
|
+
type: {
|
|
1195
|
+
vec: {
|
|
1196
|
+
array: (string | number)[];
|
|
1197
|
+
};
|
|
1198
|
+
};
|
|
1199
|
+
} | {
|
|
1200
|
+
name: string;
|
|
1201
|
+
type: {
|
|
1202
|
+
vec: string;
|
|
1203
|
+
};
|
|
1204
|
+
})[];
|
|
1205
|
+
} | {
|
|
1206
|
+
name: string;
|
|
1207
|
+
discriminator: number[];
|
|
1208
|
+
accounts: ({
|
|
1209
|
+
name: string;
|
|
1210
|
+
writable: boolean;
|
|
1211
|
+
pda: {
|
|
1212
|
+
seeds: {
|
|
1213
|
+
kind: string;
|
|
1214
|
+
value: number[];
|
|
1215
|
+
}[];
|
|
1216
|
+
};
|
|
1217
|
+
signer?: undefined;
|
|
1218
|
+
optional?: undefined;
|
|
1219
|
+
address?: undefined;
|
|
1220
|
+
} | {
|
|
1221
|
+
name: string;
|
|
1222
|
+
writable: boolean;
|
|
1223
|
+
signer: boolean;
|
|
1224
|
+
pda?: undefined;
|
|
1225
|
+
optional?: undefined;
|
|
1226
|
+
address?: undefined;
|
|
1227
|
+
} | {
|
|
1228
|
+
name: string;
|
|
1229
|
+
writable: boolean;
|
|
1230
|
+
signer: boolean;
|
|
1231
|
+
optional: boolean;
|
|
1232
|
+
pda?: undefined;
|
|
1233
|
+
address?: undefined;
|
|
1234
|
+
} | {
|
|
1235
|
+
name: string;
|
|
1236
|
+
address: string;
|
|
1237
|
+
writable?: undefined;
|
|
1238
|
+
pda?: undefined;
|
|
1239
|
+
signer?: undefined;
|
|
1240
|
+
optional?: undefined;
|
|
1241
|
+
})[];
|
|
1242
|
+
args: ({
|
|
1243
|
+
name: string;
|
|
1244
|
+
type: {
|
|
1245
|
+
array: (string | number)[];
|
|
1246
|
+
};
|
|
1247
|
+
} | {
|
|
1248
|
+
name: string;
|
|
1249
|
+
type: string;
|
|
1250
|
+
})[];
|
|
1251
|
+
} | {
|
|
1252
|
+
name: string;
|
|
1253
|
+
discriminator: number[];
|
|
1254
|
+
accounts: ({
|
|
1255
|
+
name: string;
|
|
1256
|
+
writable: boolean;
|
|
1257
|
+
pda: {
|
|
1258
|
+
seeds: {
|
|
1259
|
+
kind: string;
|
|
1260
|
+
value: number[];
|
|
1261
|
+
}[];
|
|
1262
|
+
};
|
|
1263
|
+
signer?: undefined;
|
|
1264
|
+
relations?: undefined;
|
|
1265
|
+
docs?: undefined;
|
|
1266
|
+
address?: undefined;
|
|
1267
|
+
} | {
|
|
1268
|
+
name: string;
|
|
1269
|
+
writable: boolean;
|
|
1270
|
+
signer: boolean;
|
|
1271
|
+
relations: string[];
|
|
1272
|
+
pda?: undefined;
|
|
1273
|
+
docs?: undefined;
|
|
1274
|
+
address?: undefined;
|
|
1275
|
+
} | {
|
|
1276
|
+
name: string;
|
|
1277
|
+
docs: string[];
|
|
1278
|
+
writable: boolean;
|
|
1279
|
+
pda?: undefined;
|
|
1280
|
+
signer?: undefined;
|
|
1281
|
+
relations?: undefined;
|
|
1282
|
+
address?: undefined;
|
|
1283
|
+
} | {
|
|
1284
|
+
name: string;
|
|
1285
|
+
address: string;
|
|
1286
|
+
writable?: undefined;
|
|
1287
|
+
pda?: undefined;
|
|
1288
|
+
signer?: undefined;
|
|
1289
|
+
relations?: undefined;
|
|
1290
|
+
docs?: undefined;
|
|
1291
|
+
})[];
|
|
1292
|
+
args: {
|
|
1293
|
+
name: string;
|
|
1294
|
+
type: string;
|
|
1295
|
+
}[];
|
|
1296
|
+
})[];
|
|
1297
|
+
accounts: {
|
|
1298
|
+
name: string;
|
|
1299
|
+
discriminator: number[];
|
|
1300
|
+
}[];
|
|
1301
|
+
events: {
|
|
1302
|
+
name: string;
|
|
1303
|
+
discriminator: number[];
|
|
1304
|
+
}[];
|
|
1305
|
+
errors: {
|
|
1306
|
+
code: number;
|
|
1307
|
+
name: string;
|
|
1308
|
+
msg: string;
|
|
1309
|
+
}[];
|
|
1310
|
+
types: ({
|
|
1311
|
+
name: string;
|
|
1312
|
+
type: {
|
|
1313
|
+
kind: string;
|
|
1314
|
+
fields: ({
|
|
1315
|
+
name: string;
|
|
1316
|
+
type: {
|
|
1317
|
+
defined: {
|
|
1318
|
+
name: string;
|
|
1319
|
+
};
|
|
1320
|
+
array?: undefined;
|
|
1321
|
+
};
|
|
1322
|
+
} | {
|
|
1323
|
+
name: string;
|
|
1324
|
+
type: {
|
|
1325
|
+
array: (string | number)[];
|
|
1326
|
+
defined?: undefined;
|
|
1327
|
+
};
|
|
1328
|
+
} | {
|
|
1329
|
+
name: string;
|
|
1330
|
+
type: string;
|
|
1331
|
+
})[];
|
|
1332
|
+
};
|
|
1333
|
+
} | {
|
|
1334
|
+
name: string;
|
|
1335
|
+
type: {
|
|
1336
|
+
kind: string;
|
|
1337
|
+
fields: ({
|
|
1338
|
+
name: string;
|
|
1339
|
+
type: string;
|
|
1340
|
+
} | {
|
|
1341
|
+
name: string;
|
|
1342
|
+
type: {
|
|
1343
|
+
array: (string | number)[];
|
|
1344
|
+
option?: undefined;
|
|
1345
|
+
};
|
|
1346
|
+
} | {
|
|
1347
|
+
name: string;
|
|
1348
|
+
type: {
|
|
1349
|
+
option: string;
|
|
1350
|
+
array?: undefined;
|
|
1351
|
+
};
|
|
1352
|
+
})[];
|
|
1353
|
+
};
|
|
1354
|
+
})[];
|
|
1355
|
+
};
|
|
1044
1356
|
errors: typeof errors;
|
|
1045
1357
|
};
|
|
1046
1358
|
|
|
@@ -1053,7 +1365,7 @@ declare namespace index$1 {
|
|
|
1053
1365
|
|
|
1054
1366
|
type index_SignArgs = SignArgs;
|
|
1055
1367
|
declare namespace index {
|
|
1056
|
-
export { ChainSignatureContract$
|
|
1368
|
+
export { ChainSignatureContract$3 as ChainSignatureContract, type index_SignArgs as SignArgs, index$2 as evm, index$3 as near, index$1 as solana };
|
|
1057
1369
|
}
|
|
1058
1370
|
|
|
1059
|
-
export { type CompressedPubKeySEC1, type HashToSign, type KeyDerivationPath, type MPCSignature, type NajPublicKey, type NearNearMpcSignature, type RSVSignature, type SigNetEvmMpcSignature, type SigNetNearMpcSignature, type UncompressedPubKeySEC1, index$
|
|
1371
|
+
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 };
|