signet.js 0.0.12-beta.13 → 0.0.12-beta.17
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 +67 -2
- package/browser/index.browser.cjs.map +1 -1
- package/browser/index.browser.js +67 -2
- package/browser/index.browser.js.map +1 -1
- package/node/index.node.cjs +67 -2
- package/node/index.node.cjs.map +1 -1
- package/node/index.node.js +67 -2
- package/node/index.node.js.map +1 -1
- package/package.json +5 -1
- package/types/index.d.cts +619 -28
- package/types/index.d.ts +619 -28
package/types/index.d.ts
CHANGED
|
@@ -33,11 +33,13 @@ declare abstract class BaseChainSignatureContract {
|
|
|
33
33
|
* @param args - Arguments for key derivation
|
|
34
34
|
* @param args.path - The string path to use derive the key
|
|
35
35
|
* @param args.predecessor - The id/address of the account requesting signature
|
|
36
|
+
* @param args.keyVersion - Optional key version controlling the derivation prefix (defaults to 0)
|
|
36
37
|
* @returns Promise resolving to the derived SEC1 uncompressed public key
|
|
37
38
|
*/
|
|
38
39
|
abstract getDerivedPublicKey(args: {
|
|
39
40
|
path: string;
|
|
40
41
|
predecessor: string;
|
|
42
|
+
keyVersion: number;
|
|
41
43
|
} & Record<string, unknown>): Promise<UncompressedPubKeySEC1>;
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
@@ -105,8 +107,8 @@ declare const ROOT_PUBLIC_KEYS: Record<keyof typeof ENVS, NajPublicKey>;
|
|
|
105
107
|
* @see {@link deriveChildPublicKey} in cryptography.ts for usage details
|
|
106
108
|
*/
|
|
107
109
|
declare const KDF_CHAIN_IDS: {
|
|
108
|
-
readonly ETHEREUM: "
|
|
109
|
-
readonly SOLANA: "
|
|
110
|
+
readonly ETHEREUM: "eip155:1";
|
|
111
|
+
readonly SOLANA: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
110
112
|
};
|
|
111
113
|
/**
|
|
112
114
|
* Contract addresses for different chains and environments.
|
|
@@ -147,15 +149,17 @@ declare const compressPubKey: (uncompressedPubKeySEC1: UncompressedPubKeySEC1) =
|
|
|
147
149
|
*/
|
|
148
150
|
declare const najToUncompressedPubKeySEC1: (najPublicKey: NajPublicKey) => UncompressedPubKeySEC1;
|
|
149
151
|
/**
|
|
150
|
-
* Derives a child public key from a parent public key using the
|
|
152
|
+
* Derives a child public key from a parent public key using the Sig.Network epsilon derivation scheme.
|
|
151
153
|
* The parent public keys are defined in @constants.ts
|
|
152
154
|
*
|
|
153
|
-
* @param
|
|
155
|
+
* @param rootUncompressedPubKeySEC1 - The parent public key in uncompressed SEC1 format (e.g. 04 || x || y)
|
|
154
156
|
* @param predecessorId - The predecessor ID is the address of the account calling the signer contract (e.g EOA or Contract Address)
|
|
155
157
|
* @param path - Optional derivation path suffix (defaults to empty string)
|
|
158
|
+
* @param chainId - CAIP-2 chain identifier used for derivation
|
|
159
|
+
* @param keyVersion - Key version controlling which derivation prefix to use (legacy v1 for 0, CAIP-2 v2 otherwise)
|
|
156
160
|
* @returns The derived child public key in uncompressed SEC1 format (04 || x || y)
|
|
157
161
|
*/
|
|
158
|
-
declare function deriveChildPublicKey(rootUncompressedPubKeySEC1: UncompressedPubKeySEC1, predecessorId: string, path: string | undefined, chainId: string): UncompressedPubKeySEC1;
|
|
162
|
+
declare function deriveChildPublicKey(rootUncompressedPubKeySEC1: UncompressedPubKeySEC1, predecessorId: string, path: string | undefined, chainId: string, keyVersion: number): UncompressedPubKeySEC1;
|
|
159
163
|
/**
|
|
160
164
|
* Verifies that a secp256k1 signature was created by the expected derived address
|
|
161
165
|
* by recovering the signing address and comparing it with the address derived from the contract.
|
|
@@ -167,7 +171,7 @@ declare function deriveChildPublicKey(rootUncompressedPubKeySEC1: UncompressedPu
|
|
|
167
171
|
* @param contract - The contract instance for deriving addresses
|
|
168
172
|
* @returns Promise resolving to true if the recovered address matches the expected address
|
|
169
173
|
*/
|
|
170
|
-
declare function verifyRecoveredAddress(signature: RSVSignature, payload: number[] | Uint8Array, requesterAddress: string, path: string, contract: BaseChainSignatureContract): Promise<boolean>;
|
|
174
|
+
declare function verifyRecoveredAddress(signature: RSVSignature, payload: number[] | Uint8Array, requesterAddress: string, path: string, contract: BaseChainSignatureContract, keyVersion: number): Promise<boolean>;
|
|
171
175
|
|
|
172
176
|
declare const cryptography_compressPubKey: typeof compressPubKey;
|
|
173
177
|
declare const cryptography_deriveChildPublicKey: typeof deriveChildPublicKey;
|
|
@@ -203,7 +207,7 @@ declare abstract class ChainAdapter<TransactionRequest, UnsignedTransaction> {
|
|
|
203
207
|
* @param path - The string path used to derive the key
|
|
204
208
|
* @returns Promise resolving to the derived address and public key
|
|
205
209
|
*/
|
|
206
|
-
abstract deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
|
|
210
|
+
abstract deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath, keyVersion: number): Promise<{
|
|
207
211
|
address: string;
|
|
208
212
|
publicKey: string;
|
|
209
213
|
}>;
|
|
@@ -323,7 +327,7 @@ declare class EVM extends ChainAdapter<EVMTransactionRequest, EVMUnsignedTransac
|
|
|
323
327
|
private attachGasAndNonce;
|
|
324
328
|
private transformRSVSignature;
|
|
325
329
|
private assembleSignature;
|
|
326
|
-
deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
|
|
330
|
+
deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath, keyVersion: number): Promise<{
|
|
327
331
|
address: string;
|
|
328
332
|
publicKey: string;
|
|
329
333
|
}>;
|
|
@@ -507,7 +511,7 @@ declare class Bitcoin extends ChainAdapter<BTCTransactionRequest, BTCUnsignedTra
|
|
|
507
511
|
balance: bigint;
|
|
508
512
|
decimals: number;
|
|
509
513
|
}>;
|
|
510
|
-
deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
|
|
514
|
+
deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath, keyVersion: number): Promise<{
|
|
511
515
|
address: string;
|
|
512
516
|
publicKey: string;
|
|
513
517
|
}>;
|
|
@@ -581,7 +585,7 @@ declare class Cosmos extends ChainAdapter<CosmosTransactionRequest, CosmosUnsign
|
|
|
581
585
|
balance: bigint;
|
|
582
586
|
decimals: number;
|
|
583
587
|
}>;
|
|
584
|
-
deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath): Promise<{
|
|
588
|
+
deriveAddressAndPublicKey(predecessor: string, path: KeyDerivationPath, keyVersion: number): Promise<{
|
|
585
589
|
address: string;
|
|
586
590
|
publicKey: string;
|
|
587
591
|
}>;
|
|
@@ -804,6 +808,7 @@ declare class ChainSignatureContract$1 extends ChainSignatureContract$2 {
|
|
|
804
808
|
getDerivedPublicKey(args: {
|
|
805
809
|
path: string;
|
|
806
810
|
predecessor: string;
|
|
811
|
+
keyVersion: number;
|
|
807
812
|
}): Promise<UncompressedPubKeySEC1>;
|
|
808
813
|
getPublicKey(): Promise<UncompressedPubKeySEC1>;
|
|
809
814
|
getLatestKeyVersion(): Promise<number>;
|
|
@@ -824,10 +829,11 @@ declare class ChainSignatureContract$1 extends ChainSignatureContract$2 {
|
|
|
824
829
|
* parameters, it will throw an error.
|
|
825
830
|
*/
|
|
826
831
|
sign(args: SignArgs, options?: SignOptions): Promise<RSVSignature>;
|
|
827
|
-
pollForRequestId({ requestId, payload, path, fromBlock, options, }: {
|
|
832
|
+
pollForRequestId({ requestId, payload, path, keyVersion, fromBlock, options, }: {
|
|
828
833
|
requestId: Hex;
|
|
829
834
|
payload: number[];
|
|
830
835
|
path: string;
|
|
836
|
+
keyVersion: number;
|
|
831
837
|
fromBlock: bigint;
|
|
832
838
|
options?: RetryOptions;
|
|
833
839
|
}): Promise<RSVSignature | SignatureErrorData | undefined>;
|
|
@@ -930,16 +936,56 @@ declare namespace errors {
|
|
|
930
936
|
* IDL can be found at `target/idl/chain_signatures_project.json`.
|
|
931
937
|
*/
|
|
932
938
|
interface ChainSignaturesProject {
|
|
933
|
-
address: '
|
|
939
|
+
address: 'H5tHfpYoEnarrrzcV7sWBcZhiKMvL2aRpUYvb1ydWkwS';
|
|
934
940
|
metadata: {
|
|
935
|
-
name: '
|
|
936
|
-
version: '0.
|
|
941
|
+
name: 'chainSignatures';
|
|
942
|
+
version: '0.4.0';
|
|
937
943
|
spec: '0.1.0';
|
|
938
|
-
description: '
|
|
944
|
+
description: 'Chain signatures program for cross-chain signing on Solana';
|
|
945
|
+
repository: 'https://github.com/sig-net/signet-solana-program';
|
|
939
946
|
};
|
|
940
947
|
instructions: [
|
|
948
|
+
{
|
|
949
|
+
name: 'getSignatureDeposit';
|
|
950
|
+
docs: [
|
|
951
|
+
'* @dev Function to get the current signature deposit amount.\n * @return The current signature deposit amount.'
|
|
952
|
+
];
|
|
953
|
+
discriminator: [45, 243, 86, 86, 58, 57, 172, 253];
|
|
954
|
+
accounts: [
|
|
955
|
+
{
|
|
956
|
+
name: 'programState';
|
|
957
|
+
pda: {
|
|
958
|
+
seeds: [
|
|
959
|
+
{
|
|
960
|
+
kind: 'const';
|
|
961
|
+
value: [
|
|
962
|
+
112,
|
|
963
|
+
114,
|
|
964
|
+
111,
|
|
965
|
+
103,
|
|
966
|
+
114,
|
|
967
|
+
97,
|
|
968
|
+
109,
|
|
969
|
+
45,
|
|
970
|
+
115,
|
|
971
|
+
116,
|
|
972
|
+
97,
|
|
973
|
+
116,
|
|
974
|
+
101
|
|
975
|
+
];
|
|
976
|
+
}
|
|
977
|
+
];
|
|
978
|
+
};
|
|
979
|
+
}
|
|
980
|
+
];
|
|
981
|
+
args: [];
|
|
982
|
+
returns: 'u64';
|
|
983
|
+
},
|
|
941
984
|
{
|
|
942
985
|
name: 'initialize';
|
|
986
|
+
docs: [
|
|
987
|
+
'* @dev Function to initialize the program state.\n * @param signature_deposit The deposit required for signature requests.\n * @param chain_id The CAIP-2 chain identifier.'
|
|
988
|
+
];
|
|
943
989
|
discriminator: [175, 175, 109, 31, 13, 152, 155, 237];
|
|
944
990
|
accounts: [
|
|
945
991
|
{
|
|
@@ -982,16 +1028,55 @@ interface ChainSignaturesProject {
|
|
|
982
1028
|
{
|
|
983
1029
|
name: 'signatureDeposit';
|
|
984
1030
|
type: 'u64';
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
name: 'chainId';
|
|
1034
|
+
type: 'string';
|
|
985
1035
|
}
|
|
986
1036
|
];
|
|
987
1037
|
},
|
|
988
1038
|
{
|
|
989
1039
|
name: 'respond';
|
|
1040
|
+
docs: [
|
|
1041
|
+
'* @dev Function to respond to signature requests.\n * @param request_ids The array of request IDs.\n * @param signatures The array of signature responses.\n * @notice When multiple entries reuse a request id, events emit in canonical signature order (PSBT-style).'
|
|
1042
|
+
];
|
|
990
1043
|
discriminator: [72, 65, 227, 97, 42, 255, 147, 12];
|
|
991
1044
|
accounts: [
|
|
992
1045
|
{
|
|
993
1046
|
name: 'responder';
|
|
994
1047
|
signer: true;
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
name: 'eventAuthority';
|
|
1051
|
+
pda: {
|
|
1052
|
+
seeds: [
|
|
1053
|
+
{
|
|
1054
|
+
kind: 'const';
|
|
1055
|
+
value: [
|
|
1056
|
+
95,
|
|
1057
|
+
95,
|
|
1058
|
+
101,
|
|
1059
|
+
118,
|
|
1060
|
+
101,
|
|
1061
|
+
110,
|
|
1062
|
+
116,
|
|
1063
|
+
95,
|
|
1064
|
+
97,
|
|
1065
|
+
117,
|
|
1066
|
+
116,
|
|
1067
|
+
104,
|
|
1068
|
+
111,
|
|
1069
|
+
114,
|
|
1070
|
+
105,
|
|
1071
|
+
116,
|
|
1072
|
+
121
|
|
1073
|
+
];
|
|
1074
|
+
}
|
|
1075
|
+
];
|
|
1076
|
+
};
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
name: 'program';
|
|
995
1080
|
}
|
|
996
1081
|
];
|
|
997
1082
|
args: [
|
|
@@ -1016,8 +1101,11 @@ interface ChainSignaturesProject {
|
|
|
1016
1101
|
];
|
|
1017
1102
|
},
|
|
1018
1103
|
{
|
|
1019
|
-
name: '
|
|
1020
|
-
|
|
1104
|
+
name: 'respondBidirectional';
|
|
1105
|
+
docs: [
|
|
1106
|
+
'* @dev Function to finalize bidirectional flow\n * @param request_id The ID of the signature request to respond to\n * @param serialized_output output of the previously executed transaction\n * @param signature ECDSA signature of the serialized output and request_id (keccak256(request_id.concat(serialized_output)))'
|
|
1107
|
+
];
|
|
1108
|
+
discriminator: [138, 0, 45, 246, 236, 211, 109, 81];
|
|
1021
1109
|
accounts: [
|
|
1022
1110
|
{
|
|
1023
1111
|
name: 'responder';
|
|
@@ -1026,23 +1114,55 @@ interface ChainSignaturesProject {
|
|
|
1026
1114
|
];
|
|
1027
1115
|
args: [
|
|
1028
1116
|
{
|
|
1029
|
-
name: '
|
|
1117
|
+
name: 'requestId';
|
|
1030
1118
|
type: {
|
|
1031
|
-
|
|
1032
|
-
array: ['u8', 32];
|
|
1033
|
-
};
|
|
1119
|
+
array: ['u8', 32];
|
|
1034
1120
|
};
|
|
1035
1121
|
},
|
|
1122
|
+
{
|
|
1123
|
+
name: 'serializedOutput';
|
|
1124
|
+
type: 'bytes';
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
name: 'signature';
|
|
1128
|
+
type: {
|
|
1129
|
+
defined: {
|
|
1130
|
+
name: 'signature';
|
|
1131
|
+
};
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
];
|
|
1135
|
+
},
|
|
1136
|
+
{
|
|
1137
|
+
name: 'respondError';
|
|
1138
|
+
docs: [
|
|
1139
|
+
'* @dev Function to emit signature generation errors.\n * @param errors The array of signature generation errors.'
|
|
1140
|
+
];
|
|
1141
|
+
discriminator: [3, 170, 41, 132, 72, 184, 252, 69];
|
|
1142
|
+
accounts: [
|
|
1143
|
+
{
|
|
1144
|
+
name: 'responder';
|
|
1145
|
+
signer: true;
|
|
1146
|
+
}
|
|
1147
|
+
];
|
|
1148
|
+
args: [
|
|
1036
1149
|
{
|
|
1037
1150
|
name: 'errors';
|
|
1038
1151
|
type: {
|
|
1039
|
-
vec:
|
|
1152
|
+
vec: {
|
|
1153
|
+
defined: {
|
|
1154
|
+
name: 'errorResponse';
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1040
1157
|
};
|
|
1041
1158
|
}
|
|
1042
1159
|
];
|
|
1043
1160
|
},
|
|
1044
1161
|
{
|
|
1045
1162
|
name: 'sign';
|
|
1163
|
+
docs: [
|
|
1164
|
+
'* @dev Function to request a signature.\n * @param payload The payload to be signed.\n * @param key_version The version of the key used for signing.\n * @param path The derivation path for the user account.\n * @param algo The algorithm used for signing.\n * @param dest The response destination.\n * @param params Additional parameters.'
|
|
1165
|
+
];
|
|
1046
1166
|
discriminator: [5, 221, 155, 46, 237, 91, 28, 236];
|
|
1047
1167
|
accounts: [
|
|
1048
1168
|
{
|
|
@@ -1085,6 +1205,38 @@ interface ChainSignaturesProject {
|
|
|
1085
1205
|
{
|
|
1086
1206
|
name: 'systemProgram';
|
|
1087
1207
|
address: '11111111111111111111111111111111';
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
name: 'eventAuthority';
|
|
1211
|
+
pda: {
|
|
1212
|
+
seeds: [
|
|
1213
|
+
{
|
|
1214
|
+
kind: 'const';
|
|
1215
|
+
value: [
|
|
1216
|
+
95,
|
|
1217
|
+
95,
|
|
1218
|
+
101,
|
|
1219
|
+
118,
|
|
1220
|
+
101,
|
|
1221
|
+
110,
|
|
1222
|
+
116,
|
|
1223
|
+
95,
|
|
1224
|
+
97,
|
|
1225
|
+
117,
|
|
1226
|
+
116,
|
|
1227
|
+
104,
|
|
1228
|
+
111,
|
|
1229
|
+
114,
|
|
1230
|
+
105,
|
|
1231
|
+
116,
|
|
1232
|
+
121
|
|
1233
|
+
];
|
|
1234
|
+
}
|
|
1235
|
+
];
|
|
1236
|
+
};
|
|
1237
|
+
},
|
|
1238
|
+
{
|
|
1239
|
+
name: 'program';
|
|
1088
1240
|
}
|
|
1089
1241
|
];
|
|
1090
1242
|
args: [
|
|
@@ -1116,8 +1268,139 @@ interface ChainSignaturesProject {
|
|
|
1116
1268
|
}
|
|
1117
1269
|
];
|
|
1118
1270
|
},
|
|
1271
|
+
{
|
|
1272
|
+
name: 'signBidirectional';
|
|
1273
|
+
docs: [
|
|
1274
|
+
'* @dev Function to initiate bidirectional flow\n * @param serialized_transaction transaction to be signed\n * @param caip2_id chain identifier\n * @param key_version The version of the key used for signing.\n * @param path The derivation path for the user account.\n * @param algo The algorithm used for signing.\n * @param dest The response destination.\n * @param params Additional parameters.\n * @param program_id Program ID to callback after execution (not yet enabled).\n * @param output_deserialization_schema schema for transaction output deserialization\n * @param respond_serialization_schema serialization schema for respond_bidirectional payload'
|
|
1275
|
+
];
|
|
1276
|
+
discriminator: [21, 104, 182, 213, 189, 143, 219, 48];
|
|
1277
|
+
accounts: [
|
|
1278
|
+
{
|
|
1279
|
+
name: 'programState';
|
|
1280
|
+
writable: true;
|
|
1281
|
+
pda: {
|
|
1282
|
+
seeds: [
|
|
1283
|
+
{
|
|
1284
|
+
kind: 'const';
|
|
1285
|
+
value: [
|
|
1286
|
+
112,
|
|
1287
|
+
114,
|
|
1288
|
+
111,
|
|
1289
|
+
103,
|
|
1290
|
+
114,
|
|
1291
|
+
97,
|
|
1292
|
+
109,
|
|
1293
|
+
45,
|
|
1294
|
+
115,
|
|
1295
|
+
116,
|
|
1296
|
+
97,
|
|
1297
|
+
116,
|
|
1298
|
+
101
|
|
1299
|
+
];
|
|
1300
|
+
}
|
|
1301
|
+
];
|
|
1302
|
+
};
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
name: 'requester';
|
|
1306
|
+
writable: true;
|
|
1307
|
+
signer: true;
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
name: 'feePayer';
|
|
1311
|
+
writable: true;
|
|
1312
|
+
signer: true;
|
|
1313
|
+
optional: true;
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
name: 'systemProgram';
|
|
1317
|
+
address: '11111111111111111111111111111111';
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
name: 'instructions';
|
|
1321
|
+
optional: true;
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
name: 'eventAuthority';
|
|
1325
|
+
pda: {
|
|
1326
|
+
seeds: [
|
|
1327
|
+
{
|
|
1328
|
+
kind: 'const';
|
|
1329
|
+
value: [
|
|
1330
|
+
95,
|
|
1331
|
+
95,
|
|
1332
|
+
101,
|
|
1333
|
+
118,
|
|
1334
|
+
101,
|
|
1335
|
+
110,
|
|
1336
|
+
116,
|
|
1337
|
+
95,
|
|
1338
|
+
97,
|
|
1339
|
+
117,
|
|
1340
|
+
116,
|
|
1341
|
+
104,
|
|
1342
|
+
111,
|
|
1343
|
+
114,
|
|
1344
|
+
105,
|
|
1345
|
+
116,
|
|
1346
|
+
121
|
|
1347
|
+
];
|
|
1348
|
+
}
|
|
1349
|
+
];
|
|
1350
|
+
};
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
name: 'program';
|
|
1354
|
+
}
|
|
1355
|
+
];
|
|
1356
|
+
args: [
|
|
1357
|
+
{
|
|
1358
|
+
name: 'serializedTransaction';
|
|
1359
|
+
type: 'bytes';
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
name: 'caip2Id';
|
|
1363
|
+
type: 'string';
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
name: 'keyVersion';
|
|
1367
|
+
type: 'u32';
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
name: 'path';
|
|
1371
|
+
type: 'string';
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
name: 'algo';
|
|
1375
|
+
type: 'string';
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
name: 'dest';
|
|
1379
|
+
type: 'string';
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
name: 'params';
|
|
1383
|
+
type: 'string';
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
name: 'programId';
|
|
1387
|
+
type: 'pubkey';
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
name: 'outputDeserializationSchema';
|
|
1391
|
+
type: 'bytes';
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
name: 'respondSerializationSchema';
|
|
1395
|
+
type: 'bytes';
|
|
1396
|
+
}
|
|
1397
|
+
];
|
|
1398
|
+
},
|
|
1119
1399
|
{
|
|
1120
1400
|
name: 'updateDeposit';
|
|
1401
|
+
docs: [
|
|
1402
|
+
'* @dev Function to set the signature deposit amount.\n * @param new_deposit The new deposit amount.'
|
|
1403
|
+
];
|
|
1121
1404
|
discriminator: [126, 116, 15, 164, 238, 179, 155, 59];
|
|
1122
1405
|
accounts: [
|
|
1123
1406
|
{
|
|
@@ -1166,6 +1449,9 @@ interface ChainSignaturesProject {
|
|
|
1166
1449
|
},
|
|
1167
1450
|
{
|
|
1168
1451
|
name: 'withdrawFunds';
|
|
1452
|
+
docs: [
|
|
1453
|
+
'* @dev Function to withdraw funds from the program.\n * @param amount The amount to withdraw.'
|
|
1454
|
+
];
|
|
1169
1455
|
discriminator: [241, 36, 29, 111, 208, 31, 104, 217];
|
|
1170
1456
|
accounts: [
|
|
1171
1457
|
{
|
|
@@ -1233,6 +1519,14 @@ interface ChainSignaturesProject {
|
|
|
1233
1519
|
name: 'fundsWithdrawnEvent';
|
|
1234
1520
|
discriminator: [86, 232, 194, 4, 211, 69, 172, 202];
|
|
1235
1521
|
},
|
|
1522
|
+
{
|
|
1523
|
+
name: 'respondBidirectionalEvent';
|
|
1524
|
+
discriminator: [195, 195, 28, 1, 102, 100, 189, 234];
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
name: 'signBidirectionalEvent';
|
|
1528
|
+
discriminator: [135, 205, 217, 152, 96, 187, 11, 124];
|
|
1529
|
+
},
|
|
1236
1530
|
{
|
|
1237
1531
|
name: 'signatureErrorEvent';
|
|
1238
1532
|
discriminator: [42, 28, 210, 105, 9, 196, 189, 51];
|
|
@@ -1271,6 +1565,16 @@ interface ChainSignaturesProject {
|
|
|
1271
1565
|
code: 6004;
|
|
1272
1566
|
name: 'invalidRecipient';
|
|
1273
1567
|
msg: 'Invalid recipient address';
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
code: 6005;
|
|
1571
|
+
name: 'invalidTransaction';
|
|
1572
|
+
msg: 'Invalid transaction data';
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
code: 6006;
|
|
1576
|
+
name: 'missingInstructionSysvar';
|
|
1577
|
+
msg: 'Missing instruction sysvar';
|
|
1274
1578
|
}
|
|
1275
1579
|
];
|
|
1276
1580
|
types: [
|
|
@@ -1296,6 +1600,9 @@ interface ChainSignaturesProject {
|
|
|
1296
1600
|
},
|
|
1297
1601
|
{
|
|
1298
1602
|
name: 'depositUpdatedEvent';
|
|
1603
|
+
docs: [
|
|
1604
|
+
'* @dev Emitted when the deposit amount is updated.\n * @param old_deposit The previous deposit amount.\n * @param new_deposit The new deposit amount.'
|
|
1605
|
+
];
|
|
1299
1606
|
type: {
|
|
1300
1607
|
kind: 'struct';
|
|
1301
1608
|
fields: [
|
|
@@ -1310,8 +1617,29 @@ interface ChainSignaturesProject {
|
|
|
1310
1617
|
];
|
|
1311
1618
|
};
|
|
1312
1619
|
},
|
|
1620
|
+
{
|
|
1621
|
+
name: 'errorResponse';
|
|
1622
|
+
type: {
|
|
1623
|
+
kind: 'struct';
|
|
1624
|
+
fields: [
|
|
1625
|
+
{
|
|
1626
|
+
name: 'requestId';
|
|
1627
|
+
type: {
|
|
1628
|
+
array: ['u8', 32];
|
|
1629
|
+
};
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
name: 'errorMessage';
|
|
1633
|
+
type: 'string';
|
|
1634
|
+
}
|
|
1635
|
+
];
|
|
1636
|
+
};
|
|
1637
|
+
},
|
|
1313
1638
|
{
|
|
1314
1639
|
name: 'fundsWithdrawnEvent';
|
|
1640
|
+
docs: [
|
|
1641
|
+
'* @dev Emitted when a withdrawal is made.\n * @param amount The amount withdrawn.\n * @param recipient The address of the recipient.'
|
|
1642
|
+
];
|
|
1315
1643
|
type: {
|
|
1316
1644
|
kind: 'struct';
|
|
1317
1645
|
fields: [
|
|
@@ -1338,6 +1666,102 @@ interface ChainSignaturesProject {
|
|
|
1338
1666
|
{
|
|
1339
1667
|
name: 'signatureDeposit';
|
|
1340
1668
|
type: 'u64';
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
name: 'chainId';
|
|
1672
|
+
type: 'string';
|
|
1673
|
+
}
|
|
1674
|
+
];
|
|
1675
|
+
};
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
name: 'respondBidirectionalEvent';
|
|
1679
|
+
docs: [
|
|
1680
|
+
'* @dev Emitted when a read response is received.\n * @param request_id The ID of the request. Must be calculated off-chain.\n * @param responder The address of the responder.\n * @param serialized_output The serialized output.\n * @param signature The signature.'
|
|
1681
|
+
];
|
|
1682
|
+
type: {
|
|
1683
|
+
kind: 'struct';
|
|
1684
|
+
fields: [
|
|
1685
|
+
{
|
|
1686
|
+
name: 'requestId';
|
|
1687
|
+
type: {
|
|
1688
|
+
array: ['u8', 32];
|
|
1689
|
+
};
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
name: 'responder';
|
|
1693
|
+
type: 'pubkey';
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
name: 'serializedOutput';
|
|
1697
|
+
type: 'bytes';
|
|
1698
|
+
},
|
|
1699
|
+
{
|
|
1700
|
+
name: 'signature';
|
|
1701
|
+
type: {
|
|
1702
|
+
defined: {
|
|
1703
|
+
name: 'signature';
|
|
1704
|
+
};
|
|
1705
|
+
};
|
|
1706
|
+
}
|
|
1707
|
+
];
|
|
1708
|
+
};
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
name: 'signBidirectionalEvent';
|
|
1712
|
+
docs: [
|
|
1713
|
+
'* @dev Emitted when a sign_bidirectional request is made.\n * @param sender The address of the sender.\n * @param serialized_transaction The serialized transaction to be signed.\n * @param caip2_id The SLIP-44 chain ID.\n * @param key_version The version of the key used for signing.\n * @param deposit The deposit amount.\n * @param path The derivation path for the user account.\n * @param algo The algorithm used for signing.\n * @param dest The response destination.\n * @param params Additional parameters.\n * @param program_id Program ID to callback after execution (not yet enabled).\n * @param output_deserialization_schema Schema for transaction output deserialization.\n * @param respond_serialization_schema Serialization schema for respond_bidirectional payload.'
|
|
1714
|
+
];
|
|
1715
|
+
type: {
|
|
1716
|
+
kind: 'struct';
|
|
1717
|
+
fields: [
|
|
1718
|
+
{
|
|
1719
|
+
name: 'sender';
|
|
1720
|
+
type: 'pubkey';
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
name: 'serializedTransaction';
|
|
1724
|
+
type: 'bytes';
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
name: 'caip2Id';
|
|
1728
|
+
type: 'string';
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
name: 'keyVersion';
|
|
1732
|
+
type: 'u32';
|
|
1733
|
+
},
|
|
1734
|
+
{
|
|
1735
|
+
name: 'deposit';
|
|
1736
|
+
type: 'u64';
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
name: 'path';
|
|
1740
|
+
type: 'string';
|
|
1741
|
+
},
|
|
1742
|
+
{
|
|
1743
|
+
name: 'algo';
|
|
1744
|
+
type: 'string';
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
name: 'dest';
|
|
1748
|
+
type: 'string';
|
|
1749
|
+
},
|
|
1750
|
+
{
|
|
1751
|
+
name: 'params';
|
|
1752
|
+
type: 'string';
|
|
1753
|
+
},
|
|
1754
|
+
{
|
|
1755
|
+
name: 'programId';
|
|
1756
|
+
type: 'pubkey';
|
|
1757
|
+
},
|
|
1758
|
+
{
|
|
1759
|
+
name: 'outputDeserializationSchema';
|
|
1760
|
+
type: 'bytes';
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
name: 'respondSerializationSchema';
|
|
1764
|
+
type: 'bytes';
|
|
1341
1765
|
}
|
|
1342
1766
|
];
|
|
1343
1767
|
};
|
|
@@ -1370,6 +1794,9 @@ interface ChainSignaturesProject {
|
|
|
1370
1794
|
},
|
|
1371
1795
|
{
|
|
1372
1796
|
name: 'signatureErrorEvent';
|
|
1797
|
+
docs: [
|
|
1798
|
+
'* @dev Emitted when a signature error is received.\n * @notice Any address can emit this event. Do not rely on it for business logic.\n * @param request_id The ID of the request. Must be calculated off-chain.\n * @param responder The address of the responder.\n * @param error The error message.'
|
|
1799
|
+
];
|
|
1373
1800
|
type: {
|
|
1374
1801
|
kind: 'struct';
|
|
1375
1802
|
fields: [
|
|
@@ -1392,6 +1819,9 @@ interface ChainSignaturesProject {
|
|
|
1392
1819
|
},
|
|
1393
1820
|
{
|
|
1394
1821
|
name: 'signatureRequestedEvent';
|
|
1822
|
+
docs: [
|
|
1823
|
+
'* @dev Emitted when a signature is requested.\n * @param sender The address of the sender.\n * @param payload The payload to be signed.\n * @param key_version The version of the key used for signing.\n * @param deposit The deposit amount.\n * @param chain_id The CAIP-2 ID of the blockchain.\n * @param path The derivation path for the user account.\n * @param algo The algorithm used for signing.\n * @param dest The response destination.\n * @param params Additional parameters.\n * @param fee_payer Optional fee payer account.'
|
|
1824
|
+
];
|
|
1395
1825
|
type: {
|
|
1396
1826
|
kind: 'struct';
|
|
1397
1827
|
fields: [
|
|
@@ -1415,7 +1845,7 @@ interface ChainSignaturesProject {
|
|
|
1415
1845
|
},
|
|
1416
1846
|
{
|
|
1417
1847
|
name: 'chainId';
|
|
1418
|
-
type: '
|
|
1848
|
+
type: 'string';
|
|
1419
1849
|
},
|
|
1420
1850
|
{
|
|
1421
1851
|
name: 'path';
|
|
@@ -1444,6 +1874,9 @@ interface ChainSignaturesProject {
|
|
|
1444
1874
|
},
|
|
1445
1875
|
{
|
|
1446
1876
|
name: 'signatureRespondedEvent';
|
|
1877
|
+
docs: [
|
|
1878
|
+
'* @dev Emitted when a signature response is received.\n * @notice Any address can emit this event. Clients should always verify the validity of the signature.\n * @param request_id The ID of the request. Must be calculated off-chain.\n * @param responder The address of the responder.\n * @param signature The signature response.'
|
|
1879
|
+
];
|
|
1447
1880
|
type: {
|
|
1448
1881
|
kind: 'struct';
|
|
1449
1882
|
fields: [
|
|
@@ -1529,6 +1962,7 @@ declare class ChainSignatureContract extends ChainSignatureContract$2 {
|
|
|
1529
1962
|
getDerivedPublicKey(args: {
|
|
1530
1963
|
path: string;
|
|
1531
1964
|
predecessor: string;
|
|
1965
|
+
keyVersion: number;
|
|
1532
1966
|
}): Promise<UncompressedPubKeySEC1>;
|
|
1533
1967
|
getPublicKey(): Promise<UncompressedPubKeySEC1>;
|
|
1534
1968
|
getSignRequestInstruction(args: SignArgs, options?: Pick<SignOptions, 'sign'> & {
|
|
@@ -1582,14 +2016,45 @@ declare const utils: {
|
|
|
1582
2016
|
version: string;
|
|
1583
2017
|
spec: string;
|
|
1584
2018
|
description: string;
|
|
2019
|
+
repository: string;
|
|
1585
2020
|
};
|
|
1586
2021
|
instructions: ({
|
|
1587
2022
|
name: string;
|
|
2023
|
+
docs: string[];
|
|
1588
2024
|
discriminator: number[];
|
|
1589
2025
|
accounts: {
|
|
1590
2026
|
name: string;
|
|
1591
|
-
|
|
2027
|
+
pda: {
|
|
2028
|
+
seeds: {
|
|
2029
|
+
kind: string;
|
|
2030
|
+
value: number[];
|
|
2031
|
+
}[];
|
|
2032
|
+
};
|
|
1592
2033
|
}[];
|
|
2034
|
+
args: never[];
|
|
2035
|
+
returns: string;
|
|
2036
|
+
} | {
|
|
2037
|
+
name: string;
|
|
2038
|
+
docs: string[];
|
|
2039
|
+
discriminator: number[];
|
|
2040
|
+
accounts: ({
|
|
2041
|
+
name: string;
|
|
2042
|
+
signer: boolean;
|
|
2043
|
+
pda?: undefined;
|
|
2044
|
+
} | {
|
|
2045
|
+
name: string;
|
|
2046
|
+
pda: {
|
|
2047
|
+
seeds: {
|
|
2048
|
+
kind: string;
|
|
2049
|
+
value: number[];
|
|
2050
|
+
}[];
|
|
2051
|
+
};
|
|
2052
|
+
signer?: undefined;
|
|
2053
|
+
} | {
|
|
2054
|
+
name: string;
|
|
2055
|
+
signer?: undefined;
|
|
2056
|
+
pda?: undefined;
|
|
2057
|
+
})[];
|
|
1593
2058
|
args: ({
|
|
1594
2059
|
name: string;
|
|
1595
2060
|
type: {
|
|
@@ -1609,8 +2074,10 @@ declare const utils: {
|
|
|
1609
2074
|
};
|
|
1610
2075
|
};
|
|
1611
2076
|
})[];
|
|
2077
|
+
returns?: undefined;
|
|
1612
2078
|
} | {
|
|
1613
2079
|
name: string;
|
|
2080
|
+
docs: string[];
|
|
1614
2081
|
discriminator: number[];
|
|
1615
2082
|
accounts: {
|
|
1616
2083
|
name: string;
|
|
@@ -1619,18 +2086,25 @@ declare const utils: {
|
|
|
1619
2086
|
args: ({
|
|
1620
2087
|
name: string;
|
|
1621
2088
|
type: {
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
};
|
|
2089
|
+
array: (string | number)[];
|
|
2090
|
+
defined?: undefined;
|
|
1625
2091
|
};
|
|
2092
|
+
} | {
|
|
2093
|
+
name: string;
|
|
2094
|
+
type: string;
|
|
1626
2095
|
} | {
|
|
1627
2096
|
name: string;
|
|
1628
2097
|
type: {
|
|
1629
|
-
|
|
2098
|
+
defined: {
|
|
2099
|
+
name: string;
|
|
2100
|
+
};
|
|
2101
|
+
array?: undefined;
|
|
1630
2102
|
};
|
|
1631
2103
|
})[];
|
|
2104
|
+
returns?: undefined;
|
|
1632
2105
|
} | {
|
|
1633
2106
|
name: string;
|
|
2107
|
+
docs: string[];
|
|
1634
2108
|
discriminator: number[];
|
|
1635
2109
|
accounts: ({
|
|
1636
2110
|
name: string;
|
|
@@ -1665,6 +2139,25 @@ declare const utils: {
|
|
|
1665
2139
|
pda?: undefined;
|
|
1666
2140
|
signer?: undefined;
|
|
1667
2141
|
optional?: undefined;
|
|
2142
|
+
} | {
|
|
2143
|
+
name: string;
|
|
2144
|
+
pda: {
|
|
2145
|
+
seeds: {
|
|
2146
|
+
kind: string;
|
|
2147
|
+
value: number[];
|
|
2148
|
+
}[];
|
|
2149
|
+
};
|
|
2150
|
+
writable?: undefined;
|
|
2151
|
+
signer?: undefined;
|
|
2152
|
+
optional?: undefined;
|
|
2153
|
+
address?: undefined;
|
|
2154
|
+
} | {
|
|
2155
|
+
name: string;
|
|
2156
|
+
writable?: undefined;
|
|
2157
|
+
pda?: undefined;
|
|
2158
|
+
signer?: undefined;
|
|
2159
|
+
optional?: undefined;
|
|
2160
|
+
address?: undefined;
|
|
1668
2161
|
})[];
|
|
1669
2162
|
args: ({
|
|
1670
2163
|
name: string;
|
|
@@ -1675,8 +2168,79 @@ declare const utils: {
|
|
|
1675
2168
|
name: string;
|
|
1676
2169
|
type: string;
|
|
1677
2170
|
})[];
|
|
2171
|
+
returns?: undefined;
|
|
2172
|
+
} | {
|
|
2173
|
+
name: string;
|
|
2174
|
+
docs: string[];
|
|
2175
|
+
discriminator: number[];
|
|
2176
|
+
accounts: ({
|
|
2177
|
+
name: string;
|
|
2178
|
+
writable: boolean;
|
|
2179
|
+
pda: {
|
|
2180
|
+
seeds: {
|
|
2181
|
+
kind: string;
|
|
2182
|
+
value: number[];
|
|
2183
|
+
}[];
|
|
2184
|
+
};
|
|
2185
|
+
signer?: undefined;
|
|
2186
|
+
optional?: undefined;
|
|
2187
|
+
address?: undefined;
|
|
2188
|
+
} | {
|
|
2189
|
+
name: string;
|
|
2190
|
+
writable: boolean;
|
|
2191
|
+
signer: boolean;
|
|
2192
|
+
pda?: undefined;
|
|
2193
|
+
optional?: undefined;
|
|
2194
|
+
address?: undefined;
|
|
2195
|
+
} | {
|
|
2196
|
+
name: string;
|
|
2197
|
+
writable: boolean;
|
|
2198
|
+
signer: boolean;
|
|
2199
|
+
optional: boolean;
|
|
2200
|
+
pda?: undefined;
|
|
2201
|
+
address?: undefined;
|
|
2202
|
+
} | {
|
|
2203
|
+
name: string;
|
|
2204
|
+
address: string;
|
|
2205
|
+
writable?: undefined;
|
|
2206
|
+
pda?: undefined;
|
|
2207
|
+
signer?: undefined;
|
|
2208
|
+
optional?: undefined;
|
|
2209
|
+
} | {
|
|
2210
|
+
name: string;
|
|
2211
|
+
optional: boolean;
|
|
2212
|
+
writable?: undefined;
|
|
2213
|
+
pda?: undefined;
|
|
2214
|
+
signer?: undefined;
|
|
2215
|
+
address?: undefined;
|
|
2216
|
+
} | {
|
|
2217
|
+
name: string;
|
|
2218
|
+
pda: {
|
|
2219
|
+
seeds: {
|
|
2220
|
+
kind: string;
|
|
2221
|
+
value: number[];
|
|
2222
|
+
}[];
|
|
2223
|
+
};
|
|
2224
|
+
writable?: undefined;
|
|
2225
|
+
signer?: undefined;
|
|
2226
|
+
optional?: undefined;
|
|
2227
|
+
address?: undefined;
|
|
2228
|
+
} | {
|
|
2229
|
+
name: string;
|
|
2230
|
+
writable?: undefined;
|
|
2231
|
+
pda?: undefined;
|
|
2232
|
+
signer?: undefined;
|
|
2233
|
+
optional?: undefined;
|
|
2234
|
+
address?: undefined;
|
|
2235
|
+
})[];
|
|
2236
|
+
args: {
|
|
2237
|
+
name: string;
|
|
2238
|
+
type: string;
|
|
2239
|
+
}[];
|
|
2240
|
+
returns?: undefined;
|
|
1678
2241
|
} | {
|
|
1679
2242
|
name: string;
|
|
2243
|
+
docs: string[];
|
|
1680
2244
|
discriminator: number[];
|
|
1681
2245
|
accounts: ({
|
|
1682
2246
|
name: string;
|
|
@@ -1720,6 +2284,7 @@ declare const utils: {
|
|
|
1720
2284
|
name: string;
|
|
1721
2285
|
type: string;
|
|
1722
2286
|
}[];
|
|
2287
|
+
returns?: undefined;
|
|
1723
2288
|
})[];
|
|
1724
2289
|
accounts: {
|
|
1725
2290
|
name: string;
|
|
@@ -1735,6 +2300,30 @@ declare const utils: {
|
|
|
1735
2300
|
msg: string;
|
|
1736
2301
|
}[];
|
|
1737
2302
|
types: ({
|
|
2303
|
+
name: string;
|
|
2304
|
+
docs: string[];
|
|
2305
|
+
type: {
|
|
2306
|
+
kind: string;
|
|
2307
|
+
fields: ({
|
|
2308
|
+
name: string;
|
|
2309
|
+
type: {
|
|
2310
|
+
array: (string | number)[];
|
|
2311
|
+
defined?: undefined;
|
|
2312
|
+
};
|
|
2313
|
+
} | {
|
|
2314
|
+
name: string;
|
|
2315
|
+
type: string;
|
|
2316
|
+
} | {
|
|
2317
|
+
name: string;
|
|
2318
|
+
type: {
|
|
2319
|
+
defined: {
|
|
2320
|
+
name: string;
|
|
2321
|
+
};
|
|
2322
|
+
array?: undefined;
|
|
2323
|
+
};
|
|
2324
|
+
})[];
|
|
2325
|
+
};
|
|
2326
|
+
} | {
|
|
1738
2327
|
name: string;
|
|
1739
2328
|
type: {
|
|
1740
2329
|
kind: string;
|
|
@@ -1757,8 +2346,10 @@ declare const utils: {
|
|
|
1757
2346
|
type: string;
|
|
1758
2347
|
})[];
|
|
1759
2348
|
};
|
|
2349
|
+
docs?: undefined;
|
|
1760
2350
|
} | {
|
|
1761
2351
|
name: string;
|
|
2352
|
+
docs: string[];
|
|
1762
2353
|
type: {
|
|
1763
2354
|
kind: string;
|
|
1764
2355
|
fields: ({
|