@sats-connect/core 0.4.0-c4d80ec → 0.4.0-de32322
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/dist/index.d.mts +418 -171
- package/dist/index.d.ts +418 -171
- package/dist/index.js +586 -197
- package/dist/index.mjs +554 -197
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -113,16 +113,127 @@ var rpcResponseMessageSchema = v2.union([
|
|
|
113
113
|
]);
|
|
114
114
|
|
|
115
115
|
// src/request/index.ts
|
|
116
|
-
import * as
|
|
116
|
+
import * as v17 from "valibot";
|
|
117
|
+
|
|
118
|
+
// src/request/types/stxMethods/callContract.ts
|
|
119
|
+
import * as v3 from "valibot";
|
|
120
|
+
var stxCallContractMethodName = "stx_callContract";
|
|
121
|
+
var stxCallContractParamsSchema = v3.object({
|
|
122
|
+
/**
|
|
123
|
+
* The contract principal.
|
|
124
|
+
*
|
|
125
|
+
* E.g. `"SPKE...GD5C.my-contract"`
|
|
126
|
+
*/
|
|
127
|
+
contract: v3.string(),
|
|
128
|
+
/**
|
|
129
|
+
* The name of the function to call.
|
|
130
|
+
*
|
|
131
|
+
* Note: spec changes ongoing,
|
|
132
|
+
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
133
|
+
*/
|
|
134
|
+
functionName: v3.string(),
|
|
135
|
+
/**
|
|
136
|
+
* The function's arguments. The arguments are expected to be hex-encoded
|
|
137
|
+
* strings of Clarity values.
|
|
138
|
+
*
|
|
139
|
+
* To convert Clarity values to their hex representation, the `cvToString`
|
|
140
|
+
* helper from the `@stacks/transactions` package may be helpful.
|
|
141
|
+
*
|
|
142
|
+
* ```js
|
|
143
|
+
* import { cvToString } from '@stacks/transactions';
|
|
144
|
+
*
|
|
145
|
+
* const functionArgs = [someClarityValue1, someClarityValue2];
|
|
146
|
+
* const hexArgs = functionArgs.map(cvToString);
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
arguments: v3.optional(v3.array(v3.string()))
|
|
150
|
+
});
|
|
151
|
+
var stxCallContractResultSchema = v3.object({
|
|
152
|
+
/**
|
|
153
|
+
* The ID of the transaction.
|
|
154
|
+
*/
|
|
155
|
+
txid: v3.string(),
|
|
156
|
+
/**
|
|
157
|
+
* A Stacks transaction as a hex-encoded string.
|
|
158
|
+
*/
|
|
159
|
+
transaction: v3.string()
|
|
160
|
+
});
|
|
161
|
+
var stxCallContractRequestMessageSchema = v3.object({
|
|
162
|
+
...rpcRequestMessageSchema.entries,
|
|
163
|
+
...v3.object({
|
|
164
|
+
method: v3.literal(stxCallContractMethodName),
|
|
165
|
+
params: stxCallContractParamsSchema,
|
|
166
|
+
id: v3.string()
|
|
167
|
+
}).entries
|
|
168
|
+
});
|
|
117
169
|
|
|
118
|
-
// src/request/types/stxMethods.ts
|
|
170
|
+
// src/request/types/stxMethods/deployContract.ts
|
|
119
171
|
import * as v4 from "valibot";
|
|
172
|
+
var stxDeployContractMethodName = "stx_deployContract";
|
|
173
|
+
var stxDeployContractParamsSchema = v4.object({
|
|
174
|
+
/**
|
|
175
|
+
* Name of the contract.
|
|
176
|
+
*/
|
|
177
|
+
name: v4.string(),
|
|
178
|
+
/**
|
|
179
|
+
* The source code of the Clarity contract.
|
|
180
|
+
*/
|
|
181
|
+
clarityCode: v4.string(),
|
|
182
|
+
/**
|
|
183
|
+
* The version of the Clarity contract.
|
|
184
|
+
*/
|
|
185
|
+
clarityVersion: v4.optional(v4.string())
|
|
186
|
+
});
|
|
187
|
+
var stxDeployContractResultSchema = v4.object({
|
|
188
|
+
/**
|
|
189
|
+
* The ID of the transaction.
|
|
190
|
+
*/
|
|
191
|
+
txid: v4.string(),
|
|
192
|
+
/**
|
|
193
|
+
* A Stacks transaction as a hex-encoded string.
|
|
194
|
+
*/
|
|
195
|
+
transaction: v4.string()
|
|
196
|
+
});
|
|
197
|
+
var stxDeployContractRequestMessageSchema = v4.object({
|
|
198
|
+
...rpcRequestMessageSchema.entries,
|
|
199
|
+
...v4.object({
|
|
200
|
+
method: v4.literal(stxDeployContractMethodName),
|
|
201
|
+
params: stxDeployContractParamsSchema,
|
|
202
|
+
id: v4.string()
|
|
203
|
+
}).entries
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// src/request/types/stxMethods/getAccounts.ts
|
|
207
|
+
import * as v5 from "valibot";
|
|
208
|
+
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
209
|
+
var stxGetAccountsParamsSchema = v5.nullish(v5.null());
|
|
210
|
+
var stxGetAccountsResultSchema = v5.object({
|
|
211
|
+
/**
|
|
212
|
+
* The addresses generated for the given purposes.
|
|
213
|
+
*/
|
|
214
|
+
addresses: v5.array(
|
|
215
|
+
v5.object({
|
|
216
|
+
address: v5.string(),
|
|
217
|
+
publicKey: v5.string(),
|
|
218
|
+
gaiaHubUrl: v5.string(),
|
|
219
|
+
gaiaAppKey: v5.string()
|
|
220
|
+
})
|
|
221
|
+
)
|
|
222
|
+
});
|
|
223
|
+
var stxGetAccountsRequestMessageSchema = v5.object({
|
|
224
|
+
...rpcRequestMessageSchema.entries,
|
|
225
|
+
...v5.object({
|
|
226
|
+
method: v5.literal(stxGetAccountsMethodName),
|
|
227
|
+
params: stxGetAccountsParamsSchema,
|
|
228
|
+
id: v5.string()
|
|
229
|
+
}).entries
|
|
230
|
+
});
|
|
120
231
|
|
|
121
232
|
// src/addresses/index.ts
|
|
122
233
|
import { createUnsecuredToken } from "jsontokens";
|
|
123
234
|
|
|
124
235
|
// src/addresses/types.ts
|
|
125
|
-
import * as
|
|
236
|
+
import * as v6 from "valibot";
|
|
126
237
|
var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
|
|
127
238
|
AddressPurpose2["Ordinals"] = "ordinals";
|
|
128
239
|
AddressPurpose2["Payment"] = "payment";
|
|
@@ -138,11 +249,11 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
|
|
|
138
249
|
AddressType3["stacks"] = "stacks";
|
|
139
250
|
return AddressType3;
|
|
140
251
|
})(AddressType || {});
|
|
141
|
-
var addressSchema =
|
|
142
|
-
address:
|
|
143
|
-
publicKey:
|
|
144
|
-
purpose:
|
|
145
|
-
addressType:
|
|
252
|
+
var addressSchema = v6.object({
|
|
253
|
+
address: v6.string(),
|
|
254
|
+
publicKey: v6.string(),
|
|
255
|
+
purpose: v6.enum(AddressPurpose),
|
|
256
|
+
addressType: v6.enum(AddressType)
|
|
146
257
|
});
|
|
147
258
|
|
|
148
259
|
// src/addresses/index.ts
|
|
@@ -162,118 +273,269 @@ var getAddress = async (options) => {
|
|
|
162
273
|
}
|
|
163
274
|
};
|
|
164
275
|
|
|
165
|
-
// src/request/types/stxMethods.ts
|
|
276
|
+
// src/request/types/stxMethods/getAddresses.ts
|
|
277
|
+
import * as v7 from "valibot";
|
|
166
278
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
167
|
-
var stxGetAddressesParamsSchema =
|
|
168
|
-
|
|
279
|
+
var stxGetAddressesParamsSchema = v7.nullish(
|
|
280
|
+
v7.object({
|
|
169
281
|
/**
|
|
170
282
|
* A message to be displayed to the user in the request prompt.
|
|
171
283
|
*/
|
|
172
|
-
message:
|
|
284
|
+
message: v7.optional(v7.string())
|
|
173
285
|
})
|
|
174
286
|
);
|
|
175
|
-
var stxGetAddressesResultSchema =
|
|
287
|
+
var stxGetAddressesResultSchema = v7.object({
|
|
176
288
|
/**
|
|
177
289
|
* The addresses generated for the given purposes.
|
|
178
290
|
*/
|
|
179
|
-
addresses:
|
|
291
|
+
addresses: v7.array(addressSchema)
|
|
180
292
|
});
|
|
181
|
-
var stxGetAddressesRequestMessageSchema =
|
|
293
|
+
var stxGetAddressesRequestMessageSchema = v7.object({
|
|
182
294
|
...rpcRequestMessageSchema.entries,
|
|
183
|
-
...
|
|
184
|
-
method:
|
|
295
|
+
...v7.object({
|
|
296
|
+
method: v7.literal(stxGetAddressesMethodName),
|
|
185
297
|
params: stxGetAddressesParamsSchema,
|
|
186
|
-
id:
|
|
298
|
+
id: v7.string()
|
|
299
|
+
}).entries
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// src/request/types/stxMethods/signMessage.ts
|
|
303
|
+
import * as v8 from "valibot";
|
|
304
|
+
var stxSignMessageMethodName = "stx_signMessage";
|
|
305
|
+
var stxSignMessageParamsSchema = v8.object({
|
|
306
|
+
/**
|
|
307
|
+
* The message to sign.
|
|
308
|
+
*/
|
|
309
|
+
message: v8.string(),
|
|
310
|
+
/**
|
|
311
|
+
* The public key to sign the message with.
|
|
312
|
+
*/
|
|
313
|
+
publicKey: v8.string(),
|
|
314
|
+
/**
|
|
315
|
+
* The format version of the parameter.
|
|
316
|
+
*/
|
|
317
|
+
parameterFormatVersion: v8.optional(v8.number())
|
|
318
|
+
});
|
|
319
|
+
var stxSignMessageResultSchema = v8.object({
|
|
320
|
+
/**
|
|
321
|
+
* The signature of the message.
|
|
322
|
+
*/
|
|
323
|
+
signature: v8.string(),
|
|
324
|
+
/**
|
|
325
|
+
* The public key used to sign the message.
|
|
326
|
+
*/
|
|
327
|
+
publicKey: v8.string()
|
|
328
|
+
});
|
|
329
|
+
var stxSignMessageRequestMessageSchema = v8.object({
|
|
330
|
+
...rpcRequestMessageSchema.entries,
|
|
331
|
+
...v8.object({
|
|
332
|
+
method: v8.literal(stxSignMessageMethodName),
|
|
333
|
+
params: stxSignMessageParamsSchema,
|
|
334
|
+
id: v8.string()
|
|
335
|
+
}).entries
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
339
|
+
import * as v9 from "valibot";
|
|
340
|
+
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
341
|
+
var stxSignStructuredMessageParamsSchema = v9.object({
|
|
342
|
+
/**
|
|
343
|
+
* The domain to be signed.
|
|
344
|
+
*/
|
|
345
|
+
domain: v9.string(),
|
|
346
|
+
/**
|
|
347
|
+
* Message payload to be signed.
|
|
348
|
+
*/
|
|
349
|
+
message: v9.string(),
|
|
350
|
+
/**
|
|
351
|
+
* The format version of the parameter.
|
|
352
|
+
*/
|
|
353
|
+
parameterFormatVersion: v9.optional(v9.number()),
|
|
354
|
+
/**
|
|
355
|
+
* The public key to sign the message with.
|
|
356
|
+
*/
|
|
357
|
+
publicKey: v9.optional(v9.string())
|
|
358
|
+
});
|
|
359
|
+
var stxSignStructuredMessageResultSchema = v9.object({
|
|
360
|
+
/**
|
|
361
|
+
* Signature of the message.
|
|
362
|
+
*/
|
|
363
|
+
signature: v9.string(),
|
|
364
|
+
/**
|
|
365
|
+
* Public key as hex-encoded string.
|
|
366
|
+
*/
|
|
367
|
+
publicKey: v9.string()
|
|
368
|
+
});
|
|
369
|
+
var stxSignStructuredMessageRequestMessageSchema = v9.object({
|
|
370
|
+
...rpcRequestMessageSchema.entries,
|
|
371
|
+
...v9.object({
|
|
372
|
+
method: v9.literal(stxSignStructuredMessageMethodName),
|
|
373
|
+
params: stxSignStructuredMessageParamsSchema,
|
|
374
|
+
id: v9.string()
|
|
187
375
|
}).entries
|
|
188
376
|
});
|
|
377
|
+
|
|
378
|
+
// src/request/types/stxMethods/signTransaction.ts
|
|
379
|
+
import * as v10 from "valibot";
|
|
189
380
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
190
|
-
var stxSignTransactionParamsSchema =
|
|
381
|
+
var stxSignTransactionParamsSchema = v10.object({
|
|
191
382
|
/**
|
|
192
383
|
* The transaction to sign as a hex-encoded string.
|
|
193
384
|
*/
|
|
194
|
-
transaction:
|
|
385
|
+
transaction: v10.string(),
|
|
195
386
|
/**
|
|
196
387
|
* The public key to sign the transaction with. The wallet may use any key
|
|
197
388
|
* when not provided.
|
|
198
389
|
*/
|
|
199
|
-
pubkey:
|
|
390
|
+
pubkey: v10.optional(v10.string()),
|
|
200
391
|
/**
|
|
201
392
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
202
393
|
*/
|
|
203
|
-
broadcast:
|
|
394
|
+
broadcast: v10.optional(v10.boolean())
|
|
204
395
|
});
|
|
205
|
-
var stxSignTransactionResultSchema =
|
|
396
|
+
var stxSignTransactionResultSchema = v10.object({
|
|
206
397
|
/**
|
|
207
398
|
* The signed transaction as a hex-encoded string.
|
|
208
399
|
*/
|
|
209
|
-
transaction:
|
|
400
|
+
transaction: v10.string()
|
|
210
401
|
});
|
|
211
|
-
var stxSignTransactionRequestMessageSchema =
|
|
402
|
+
var stxSignTransactionRequestMessageSchema = v10.object({
|
|
212
403
|
...rpcRequestMessageSchema.entries,
|
|
213
|
-
...
|
|
214
|
-
method:
|
|
404
|
+
...v10.object({
|
|
405
|
+
method: v10.literal(stxSignTransactionMethodName),
|
|
215
406
|
params: stxSignTransactionParamsSchema,
|
|
216
|
-
id:
|
|
407
|
+
id: v10.string()
|
|
408
|
+
}).entries
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// src/request/types/stxMethods/transferStx.ts
|
|
412
|
+
import * as v11 from "valibot";
|
|
413
|
+
var stxTransferStxMethodName = "stx_transferStx";
|
|
414
|
+
var stxTransferStxParamsSchema = v11.object({
|
|
415
|
+
/**
|
|
416
|
+
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
417
|
+
* parseable by `BigInt` is acceptable.
|
|
418
|
+
*
|
|
419
|
+
* Example,
|
|
420
|
+
*
|
|
421
|
+
* ```js
|
|
422
|
+
* const amount1 = 1234;
|
|
423
|
+
* const amount2 = 1234n;
|
|
424
|
+
* const amount3 = '1234';
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
amount: v11.union([v11.number(), v11.string()]),
|
|
428
|
+
/**
|
|
429
|
+
* The recipeint's principal.
|
|
430
|
+
*/
|
|
431
|
+
recipient: v11.string(),
|
|
432
|
+
/**
|
|
433
|
+
* A string representing the memo.
|
|
434
|
+
*/
|
|
435
|
+
memo: v11.optional(v11.string()),
|
|
436
|
+
/**
|
|
437
|
+
* Version of parameter format.
|
|
438
|
+
*/
|
|
439
|
+
version: v11.optional(v11.string()),
|
|
440
|
+
/**
|
|
441
|
+
* The mode of the post conditions.
|
|
442
|
+
*/
|
|
443
|
+
postConditionMode: v11.optional(v11.number()),
|
|
444
|
+
/**
|
|
445
|
+
* A hex-encoded string representing the post conditions.
|
|
446
|
+
*
|
|
447
|
+
* A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
|
|
448
|
+
*
|
|
449
|
+
* ```js
|
|
450
|
+
* import { serializePostCondition } from '@stacks/transactions';
|
|
451
|
+
*
|
|
452
|
+
* const postCondition = somePostCondition;
|
|
453
|
+
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
454
|
+
* ```
|
|
455
|
+
*/
|
|
456
|
+
postConditions: v11.optional(v11.array(v11.string())),
|
|
457
|
+
/**
|
|
458
|
+
* The public key to sign the transaction with. The wallet may use any key
|
|
459
|
+
* when not provided.
|
|
460
|
+
*/
|
|
461
|
+
pubkey: v11.optional(v11.string())
|
|
462
|
+
});
|
|
463
|
+
var stxTransferStxResultSchema = v11.object({
|
|
464
|
+
/**
|
|
465
|
+
* The ID of the transaction.
|
|
466
|
+
*/
|
|
467
|
+
txid: v11.string(),
|
|
468
|
+
/**
|
|
469
|
+
* A Stacks transaction as a hex-encoded string.
|
|
470
|
+
*/
|
|
471
|
+
transaction: v11.string()
|
|
472
|
+
});
|
|
473
|
+
var stxTransferStxRequestMessageSchema = v11.object({
|
|
474
|
+
...rpcRequestMessageSchema.entries,
|
|
475
|
+
...v11.object({
|
|
476
|
+
method: v11.literal(stxTransferStxMethodName),
|
|
477
|
+
params: stxTransferStxParamsSchema,
|
|
478
|
+
id: v11.string()
|
|
217
479
|
}).entries
|
|
218
480
|
});
|
|
219
481
|
|
|
220
482
|
// src/request/types/btcMethods.ts
|
|
221
|
-
import * as
|
|
483
|
+
import * as v13 from "valibot";
|
|
222
484
|
|
|
223
485
|
// src/request/types/common.ts
|
|
224
|
-
import * as
|
|
486
|
+
import * as v12 from "valibot";
|
|
225
487
|
var walletTypes = ["software", "ledger"];
|
|
226
|
-
var walletTypeSchema =
|
|
488
|
+
var walletTypeSchema = v12.picklist(walletTypes);
|
|
227
489
|
|
|
228
490
|
// src/request/types/btcMethods.ts
|
|
229
491
|
var getInfoMethodName = "getInfo";
|
|
230
|
-
var getInfoParamsSchema =
|
|
231
|
-
var getInfoResultSchema =
|
|
492
|
+
var getInfoParamsSchema = v13.nullish(v13.null());
|
|
493
|
+
var getInfoResultSchema = v13.object({
|
|
232
494
|
/**
|
|
233
495
|
* Version of the wallet.
|
|
234
496
|
*/
|
|
235
|
-
version:
|
|
497
|
+
version: v13.string(),
|
|
236
498
|
/**
|
|
237
499
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
238
500
|
*/
|
|
239
|
-
methods:
|
|
501
|
+
methods: v13.optional(v13.array(v13.string())),
|
|
240
502
|
/**
|
|
241
503
|
* List of WBIP standards supported by the wallet. Not currently used.
|
|
242
504
|
*/
|
|
243
|
-
supports:
|
|
505
|
+
supports: v13.array(v13.string())
|
|
244
506
|
});
|
|
245
|
-
var getInfoRequestMessageSchema =
|
|
507
|
+
var getInfoRequestMessageSchema = v13.object({
|
|
246
508
|
...rpcRequestMessageSchema.entries,
|
|
247
|
-
...
|
|
248
|
-
method:
|
|
509
|
+
...v13.object({
|
|
510
|
+
method: v13.literal(getInfoMethodName),
|
|
249
511
|
params: getInfoParamsSchema,
|
|
250
|
-
id:
|
|
512
|
+
id: v13.string()
|
|
251
513
|
}).entries
|
|
252
514
|
});
|
|
253
515
|
var getAddressesMethodName = "getAddresses";
|
|
254
|
-
var getAddressesParamsSchema =
|
|
516
|
+
var getAddressesParamsSchema = v13.object({
|
|
255
517
|
/**
|
|
256
518
|
* The purposes for which to generate addresses. See
|
|
257
519
|
* {@linkcode AddressPurpose} for available purposes.
|
|
258
520
|
*/
|
|
259
|
-
purposes:
|
|
521
|
+
purposes: v13.array(v13.enum(AddressPurpose)),
|
|
260
522
|
/**
|
|
261
523
|
* A message to be displayed to the user in the request prompt.
|
|
262
524
|
*/
|
|
263
|
-
message:
|
|
525
|
+
message: v13.optional(v13.string())
|
|
264
526
|
});
|
|
265
|
-
var getAddressesResultSchema =
|
|
527
|
+
var getAddressesResultSchema = v13.object({
|
|
266
528
|
/**
|
|
267
529
|
* The addresses generated for the given purposes.
|
|
268
530
|
*/
|
|
269
|
-
addresses:
|
|
531
|
+
addresses: v13.array(addressSchema)
|
|
270
532
|
});
|
|
271
|
-
var getAddressesRequestMessageSchema =
|
|
533
|
+
var getAddressesRequestMessageSchema = v13.object({
|
|
272
534
|
...rpcRequestMessageSchema.entries,
|
|
273
|
-
...
|
|
274
|
-
method:
|
|
535
|
+
...v13.object({
|
|
536
|
+
method: v13.literal(getAddressesMethodName),
|
|
275
537
|
params: getAddressesParamsSchema,
|
|
276
|
-
id:
|
|
538
|
+
id: v13.string()
|
|
277
539
|
}).entries
|
|
278
540
|
});
|
|
279
541
|
var signMessageMethodName = "signMessage";
|
|
@@ -282,301 +544,364 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
|
282
544
|
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
283
545
|
return MessageSigningProtocols2;
|
|
284
546
|
})(MessageSigningProtocols || {});
|
|
285
|
-
var signMessageParamsSchema =
|
|
547
|
+
var signMessageParamsSchema = v13.object({
|
|
286
548
|
/**
|
|
287
549
|
* The address used for signing.
|
|
288
550
|
**/
|
|
289
|
-
address:
|
|
551
|
+
address: v13.string(),
|
|
290
552
|
/**
|
|
291
553
|
* The message to sign.
|
|
292
554
|
**/
|
|
293
|
-
message:
|
|
555
|
+
message: v13.string(),
|
|
294
556
|
/**
|
|
295
557
|
* The protocol to use for signing the message.
|
|
296
558
|
*/
|
|
297
|
-
protocol:
|
|
559
|
+
protocol: v13.optional(v13.enum(MessageSigningProtocols))
|
|
298
560
|
});
|
|
299
|
-
var signMessageResultSchema =
|
|
561
|
+
var signMessageResultSchema = v13.object({
|
|
300
562
|
/**
|
|
301
563
|
* The signature of the message.
|
|
302
564
|
*/
|
|
303
|
-
signature:
|
|
565
|
+
signature: v13.string(),
|
|
304
566
|
/**
|
|
305
567
|
* hash of the message.
|
|
306
568
|
*/
|
|
307
|
-
messageHash:
|
|
569
|
+
messageHash: v13.string(),
|
|
308
570
|
/**
|
|
309
571
|
* The address used for signing.
|
|
310
572
|
*/
|
|
311
|
-
address:
|
|
573
|
+
address: v13.string(),
|
|
312
574
|
/**
|
|
313
575
|
* The protocol to use for signing the message.
|
|
314
576
|
*/
|
|
315
|
-
protocol:
|
|
577
|
+
protocol: v13.enum(MessageSigningProtocols)
|
|
316
578
|
});
|
|
317
|
-
var signMessageRequestMessageSchema =
|
|
579
|
+
var signMessageRequestMessageSchema = v13.object({
|
|
318
580
|
...rpcRequestMessageSchema.entries,
|
|
319
|
-
...
|
|
320
|
-
method:
|
|
581
|
+
...v13.object({
|
|
582
|
+
method: v13.literal(signMessageMethodName),
|
|
321
583
|
params: signMessageParamsSchema,
|
|
322
|
-
id:
|
|
584
|
+
id: v13.string()
|
|
585
|
+
}).entries
|
|
586
|
+
});
|
|
587
|
+
var sendTransferMethodName = "sendTransfer";
|
|
588
|
+
var sendTransferParamsSchema = v13.object({
|
|
589
|
+
/**
|
|
590
|
+
* Array of recipients to send to.
|
|
591
|
+
* The amount to send to each recipient is in satoshis.
|
|
592
|
+
*/
|
|
593
|
+
recipients: v13.array(
|
|
594
|
+
v13.object({
|
|
595
|
+
address: v13.string(),
|
|
596
|
+
amount: v13.number()
|
|
597
|
+
})
|
|
598
|
+
)
|
|
599
|
+
});
|
|
600
|
+
var sendTransferResultSchema = v13.object({
|
|
601
|
+
/**
|
|
602
|
+
* The transaction id as a hex-encoded string.
|
|
603
|
+
*/
|
|
604
|
+
txid: v13.string()
|
|
605
|
+
});
|
|
606
|
+
var sendTransferRequestMessageSchema = v13.object({
|
|
607
|
+
...rpcRequestMessageSchema.entries,
|
|
608
|
+
...v13.object({
|
|
609
|
+
method: v13.literal(sendTransferMethodName),
|
|
610
|
+
params: sendTransferParamsSchema,
|
|
611
|
+
id: v13.string()
|
|
612
|
+
}).entries
|
|
613
|
+
});
|
|
614
|
+
var signPsbtMethodName = "signPsbt";
|
|
615
|
+
var signPsbtParamsSchema = v13.object({
|
|
616
|
+
/**
|
|
617
|
+
* The base64 encoded PSBT to sign.
|
|
618
|
+
*/
|
|
619
|
+
psbt: v13.string(),
|
|
620
|
+
/**
|
|
621
|
+
* The inputs to sign.
|
|
622
|
+
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
623
|
+
*/
|
|
624
|
+
signInputs: v13.record(v13.string(), v13.array(v13.number())),
|
|
625
|
+
allowedSignHash: v13.optional(v13.number()),
|
|
626
|
+
/**
|
|
627
|
+
* Whether to broadcast the transaction after signing.
|
|
628
|
+
**/
|
|
629
|
+
broadcast: v13.optional(v13.boolean())
|
|
630
|
+
});
|
|
631
|
+
var signPsbtResultSchema = v13.object({
|
|
632
|
+
/**
|
|
633
|
+
* The base64 encoded PSBT after signing.
|
|
634
|
+
*/
|
|
635
|
+
psbt: v13.string(),
|
|
636
|
+
/**
|
|
637
|
+
* The transaction id as a hex-encoded string.
|
|
638
|
+
* This is only returned if the transaction was broadcast.
|
|
639
|
+
**/
|
|
640
|
+
txid: v13.optional(v13.string())
|
|
641
|
+
});
|
|
642
|
+
var signPsbtRequestMessageSchema = v13.object({
|
|
643
|
+
...rpcRequestMessageSchema.entries,
|
|
644
|
+
...v13.object({
|
|
645
|
+
method: v13.literal(signPsbtMethodName),
|
|
646
|
+
params: signPsbtParamsSchema,
|
|
647
|
+
id: v13.string()
|
|
323
648
|
}).entries
|
|
324
649
|
});
|
|
325
650
|
var getAccountsMethodName = "getAccounts";
|
|
326
|
-
var getAccountsParamsSchema =
|
|
651
|
+
var getAccountsParamsSchema = v13.object({
|
|
327
652
|
/**
|
|
328
653
|
* The purposes for which to generate addresses. See
|
|
329
654
|
* {@linkcode AddressPurpose} for available purposes.
|
|
330
655
|
*/
|
|
331
|
-
purposes:
|
|
656
|
+
purposes: v13.array(v13.enum(AddressPurpose)),
|
|
332
657
|
/**
|
|
333
658
|
* A message to be displayed to the user in the request prompt.
|
|
334
659
|
*/
|
|
335
|
-
message:
|
|
660
|
+
message: v13.optional(v13.string())
|
|
336
661
|
});
|
|
337
|
-
var getAccountsResultSchema =
|
|
338
|
-
|
|
662
|
+
var getAccountsResultSchema = v13.array(
|
|
663
|
+
v13.object({
|
|
339
664
|
...addressSchema.entries,
|
|
340
|
-
...
|
|
665
|
+
...v13.object({
|
|
341
666
|
walletType: walletTypeSchema
|
|
342
667
|
}).entries
|
|
343
668
|
})
|
|
344
669
|
);
|
|
345
|
-
var getAccountsRequestMessageSchema =
|
|
670
|
+
var getAccountsRequestMessageSchema = v13.object({
|
|
346
671
|
...rpcRequestMessageSchema.entries,
|
|
347
|
-
...
|
|
348
|
-
method:
|
|
672
|
+
...v13.object({
|
|
673
|
+
method: v13.literal(getAccountsMethodName),
|
|
349
674
|
params: getAccountsParamsSchema,
|
|
350
|
-
id:
|
|
675
|
+
id: v13.string()
|
|
351
676
|
}).entries
|
|
352
677
|
});
|
|
353
678
|
var getBalanceMethodName = "getBalance";
|
|
354
|
-
var getBalanceParamsSchema =
|
|
355
|
-
var getBalanceResultSchema =
|
|
679
|
+
var getBalanceParamsSchema = v13.nullish(v13.null());
|
|
680
|
+
var getBalanceResultSchema = v13.object({
|
|
356
681
|
/**
|
|
357
682
|
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
358
683
|
* messages not supporting bigint
|
|
359
684
|
* (https://issues.chromium.org/issues/40116184).
|
|
360
685
|
*/
|
|
361
|
-
confirmed:
|
|
686
|
+
confirmed: v13.string(),
|
|
362
687
|
/**
|
|
363
688
|
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
364
689
|
* messages not supporting bigint
|
|
365
690
|
* (https://issues.chromium.org/issues/40116184).
|
|
366
691
|
*/
|
|
367
|
-
unconfirmed:
|
|
692
|
+
unconfirmed: v13.string(),
|
|
368
693
|
/**
|
|
369
694
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
370
695
|
* sats. Using a string due to chrome messages not supporting bigint
|
|
371
696
|
* (https://issues.chromium.org/issues/40116184).
|
|
372
697
|
*/
|
|
373
|
-
total:
|
|
698
|
+
total: v13.string()
|
|
374
699
|
});
|
|
375
|
-
var getBalanceRequestMessageSchema =
|
|
700
|
+
var getBalanceRequestMessageSchema = v13.object({
|
|
376
701
|
...rpcRequestMessageSchema.entries,
|
|
377
|
-
...
|
|
378
|
-
method:
|
|
379
|
-
id:
|
|
702
|
+
...v13.object({
|
|
703
|
+
method: v13.literal(getBalanceMethodName),
|
|
704
|
+
id: v13.string()
|
|
380
705
|
}).entries
|
|
381
706
|
});
|
|
382
707
|
|
|
383
708
|
// src/request/types/walletMethods.ts
|
|
384
|
-
import * as
|
|
709
|
+
import * as v14 from "valibot";
|
|
385
710
|
import { permissions } from "@secretkeylabs/xverse-core";
|
|
386
|
-
var permissionTemplate =
|
|
387
|
-
|
|
388
|
-
...
|
|
389
|
-
actions:
|
|
711
|
+
var permissionTemplate = v14.variant("type", [
|
|
712
|
+
v14.object({
|
|
713
|
+
...v14.omit(permissions.resources.account.accountPermissionSchema, ["clientId", "actions"]).entries,
|
|
714
|
+
actions: v14.partial(permissions.resources.account.accountActionsSchema)
|
|
390
715
|
}),
|
|
391
|
-
|
|
392
|
-
...
|
|
393
|
-
actions:
|
|
716
|
+
v14.object({
|
|
717
|
+
...v14.omit(permissions.resources.wallet.walletPermissionSchema, ["clientId"]).entries,
|
|
718
|
+
actions: v14.partial(permissions.resources.wallet.walletActionsSchema)
|
|
394
719
|
})
|
|
395
720
|
]);
|
|
396
721
|
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
397
|
-
var requestPermissionsParamsSchema =
|
|
398
|
-
var requestPermissionsResultSchema =
|
|
399
|
-
var requestPermissionsRequestMessageSchema =
|
|
722
|
+
var requestPermissionsParamsSchema = v14.nullish(v14.array(permissionTemplate));
|
|
723
|
+
var requestPermissionsResultSchema = v14.literal(true);
|
|
724
|
+
var requestPermissionsRequestMessageSchema = v14.object({
|
|
400
725
|
...rpcRequestMessageSchema.entries,
|
|
401
|
-
...
|
|
402
|
-
method:
|
|
726
|
+
...v14.object({
|
|
727
|
+
method: v14.literal(requestPermissionsMethodName),
|
|
403
728
|
params: requestPermissionsParamsSchema,
|
|
404
|
-
id:
|
|
729
|
+
id: v14.string()
|
|
405
730
|
}).entries
|
|
406
731
|
});
|
|
407
732
|
var renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
408
|
-
var renouncePermissionsParamsSchema =
|
|
409
|
-
var renouncePermissionsResultSchema =
|
|
410
|
-
var renouncePermissionsRequestMessageSchema =
|
|
733
|
+
var renouncePermissionsParamsSchema = v14.nullish(v14.null());
|
|
734
|
+
var renouncePermissionsResultSchema = v14.nullish(v14.null());
|
|
735
|
+
var renouncePermissionsRequestMessageSchema = v14.object({
|
|
411
736
|
...rpcRequestMessageSchema.entries,
|
|
412
|
-
...
|
|
413
|
-
method:
|
|
737
|
+
...v14.object({
|
|
738
|
+
method: v14.literal(renouncePermissionsMethodName),
|
|
414
739
|
params: renouncePermissionsParamsSchema,
|
|
415
|
-
id:
|
|
740
|
+
id: v14.string()
|
|
416
741
|
}).entries
|
|
417
742
|
});
|
|
418
743
|
var disconnectMethodName = "wallet_disconnect";
|
|
419
|
-
var disconnectParamsSchema =
|
|
420
|
-
var disconnectResultSchema =
|
|
421
|
-
var disconnectRequestMessageSchema =
|
|
744
|
+
var disconnectParamsSchema = v14.nullish(v14.null());
|
|
745
|
+
var disconnectResultSchema = v14.nullish(v14.null());
|
|
746
|
+
var disconnectRequestMessageSchema = v14.object({
|
|
422
747
|
...rpcRequestMessageSchema.entries,
|
|
423
|
-
...
|
|
424
|
-
method:
|
|
748
|
+
...v14.object({
|
|
749
|
+
method: v14.literal(disconnectMethodName),
|
|
425
750
|
params: disconnectParamsSchema,
|
|
426
|
-
id:
|
|
751
|
+
id: v14.string()
|
|
427
752
|
}).entries
|
|
428
753
|
});
|
|
429
754
|
var getWalletTypeMethodName = "wallet_getWalletType";
|
|
430
|
-
var getWalletTypeParamsSchema =
|
|
755
|
+
var getWalletTypeParamsSchema = v14.nullish(v14.null());
|
|
431
756
|
var getWalletTypeResultSchema = walletTypeSchema;
|
|
432
|
-
var getWalletTypeRequestMessageSchema =
|
|
757
|
+
var getWalletTypeRequestMessageSchema = v14.object({
|
|
433
758
|
...rpcRequestMessageSchema.entries,
|
|
434
|
-
...
|
|
435
|
-
method:
|
|
759
|
+
...v14.object({
|
|
760
|
+
method: v14.literal(getWalletTypeMethodName),
|
|
436
761
|
params: getWalletTypeParamsSchema,
|
|
437
|
-
id:
|
|
762
|
+
id: v14.string()
|
|
438
763
|
}).entries
|
|
439
764
|
});
|
|
440
765
|
var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
|
|
441
|
-
var getCurrentPermissionsParamsSchema =
|
|
442
|
-
var getCurrentPermissionsResultSchema =
|
|
443
|
-
var getCurrentPermissionsRequestMessageSchema =
|
|
766
|
+
var getCurrentPermissionsParamsSchema = v14.nullish(v14.null());
|
|
767
|
+
var getCurrentPermissionsResultSchema = v14.array(permissions.store.permission);
|
|
768
|
+
var getCurrentPermissionsRequestMessageSchema = v14.object({
|
|
444
769
|
...rpcRequestMessageSchema.entries,
|
|
445
|
-
...
|
|
446
|
-
method:
|
|
770
|
+
...v14.object({
|
|
771
|
+
method: v14.literal(getCurrentPermissionsMethodName),
|
|
447
772
|
params: getCurrentPermissionsParamsSchema,
|
|
448
|
-
id:
|
|
773
|
+
id: v14.string()
|
|
449
774
|
}).entries
|
|
450
775
|
});
|
|
451
776
|
var getAccountMethodName = "wallet_getAccount";
|
|
452
|
-
var getAccountParamsSchema =
|
|
453
|
-
var getAccountResultSchema =
|
|
777
|
+
var getAccountParamsSchema = v14.nullish(v14.null());
|
|
778
|
+
var getAccountResultSchema = v14.object({
|
|
454
779
|
id: permissions.utils.account.accountIdSchema,
|
|
455
|
-
addresses:
|
|
780
|
+
addresses: v14.array(addressSchema),
|
|
456
781
|
walletType: walletTypeSchema
|
|
457
782
|
});
|
|
458
|
-
var getAccountRequestMessageSchema =
|
|
783
|
+
var getAccountRequestMessageSchema = v14.object({
|
|
459
784
|
...rpcRequestMessageSchema.entries,
|
|
460
|
-
...
|
|
461
|
-
method:
|
|
785
|
+
...v14.object({
|
|
786
|
+
method: v14.literal(getAccountMethodName),
|
|
462
787
|
params: getAccountParamsSchema,
|
|
463
|
-
id:
|
|
788
|
+
id: v14.string()
|
|
464
789
|
}).entries
|
|
465
790
|
});
|
|
466
791
|
var connectMethodName = "wallet_connect";
|
|
467
|
-
var connectParamsSchema =
|
|
468
|
-
|
|
469
|
-
permissions:
|
|
792
|
+
var connectParamsSchema = v14.nullish(
|
|
793
|
+
v14.object({
|
|
794
|
+
permissions: v14.optional(v14.array(permissionTemplate))
|
|
470
795
|
})
|
|
471
796
|
);
|
|
472
797
|
var connectResultSchema = getAccountResultSchema;
|
|
473
|
-
var connectRequestMessageSchema =
|
|
798
|
+
var connectRequestMessageSchema = v14.object({
|
|
474
799
|
...rpcRequestMessageSchema.entries,
|
|
475
|
-
...
|
|
476
|
-
method:
|
|
800
|
+
...v14.object({
|
|
801
|
+
method: v14.literal(connectMethodName),
|
|
477
802
|
params: connectParamsSchema,
|
|
478
|
-
id:
|
|
803
|
+
id: v14.string()
|
|
479
804
|
}).entries
|
|
480
805
|
});
|
|
481
806
|
|
|
482
807
|
// src/request/types/runesMethods.ts
|
|
483
|
-
import * as
|
|
808
|
+
import * as v15 from "valibot";
|
|
484
809
|
var getRunesBalanceMethodName = "runes_getBalance";
|
|
485
|
-
var getRunesBalanceParamsSchema =
|
|
486
|
-
var getRunesBalanceResultSchema =
|
|
487
|
-
balances:
|
|
488
|
-
|
|
489
|
-
runeName:
|
|
490
|
-
amount:
|
|
491
|
-
divisibility:
|
|
492
|
-
symbol:
|
|
493
|
-
inscriptionId:
|
|
810
|
+
var getRunesBalanceParamsSchema = v15.nullish(v15.null());
|
|
811
|
+
var getRunesBalanceResultSchema = v15.object({
|
|
812
|
+
balances: v15.array(
|
|
813
|
+
v15.object({
|
|
814
|
+
runeName: v15.string(),
|
|
815
|
+
amount: v15.string(),
|
|
816
|
+
divisibility: v15.number(),
|
|
817
|
+
symbol: v15.string(),
|
|
818
|
+
inscriptionId: v15.nullish(v15.string())
|
|
494
819
|
})
|
|
495
820
|
)
|
|
496
821
|
});
|
|
497
|
-
var getRunesBalanceRequestMessageSchema =
|
|
822
|
+
var getRunesBalanceRequestMessageSchema = v15.object({
|
|
498
823
|
...rpcRequestMessageSchema.entries,
|
|
499
|
-
...
|
|
500
|
-
method:
|
|
824
|
+
...v15.object({
|
|
825
|
+
method: v15.literal(getRunesBalanceMethodName),
|
|
501
826
|
params: getRunesBalanceParamsSchema,
|
|
502
|
-
id:
|
|
827
|
+
id: v15.string()
|
|
503
828
|
}).entries
|
|
504
829
|
});
|
|
505
830
|
var transferRunesMethodName = "runes_transfer";
|
|
506
|
-
var transferRunesParamsSchema =
|
|
507
|
-
recipients:
|
|
508
|
-
|
|
509
|
-
runeName:
|
|
510
|
-
amount:
|
|
511
|
-
address:
|
|
831
|
+
var transferRunesParamsSchema = v15.object({
|
|
832
|
+
recipients: v15.array(
|
|
833
|
+
v15.object({
|
|
834
|
+
runeName: v15.string(),
|
|
835
|
+
amount: v15.string(),
|
|
836
|
+
address: v15.string()
|
|
512
837
|
})
|
|
513
838
|
)
|
|
514
839
|
});
|
|
515
|
-
var transferRunesRequestSchema =
|
|
840
|
+
var transferRunesRequestSchema = v15.object({
|
|
516
841
|
...rpcRequestMessageSchema.entries,
|
|
517
|
-
...
|
|
518
|
-
method:
|
|
842
|
+
...v15.object({
|
|
843
|
+
method: v15.literal(transferRunesMethodName),
|
|
519
844
|
params: transferRunesParamsSchema,
|
|
520
|
-
id:
|
|
845
|
+
id: v15.string()
|
|
521
846
|
}).entries
|
|
522
847
|
});
|
|
523
|
-
var TransferRunesResultSchema =
|
|
524
|
-
txid:
|
|
848
|
+
var TransferRunesResultSchema = v15.object({
|
|
849
|
+
txid: v15.string()
|
|
525
850
|
});
|
|
526
851
|
|
|
527
852
|
// src/request/types/ordinalsMethods.ts
|
|
528
|
-
import * as
|
|
853
|
+
import * as v16 from "valibot";
|
|
529
854
|
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
530
|
-
var getInscriptionsParamsSchema =
|
|
531
|
-
offset:
|
|
532
|
-
limit:
|
|
533
|
-
});
|
|
534
|
-
var getInscriptionsResultSchema =
|
|
535
|
-
total:
|
|
536
|
-
limit:
|
|
537
|
-
offset:
|
|
538
|
-
inscriptions:
|
|
539
|
-
|
|
540
|
-
inscriptionId:
|
|
541
|
-
inscriptionNumber:
|
|
542
|
-
address:
|
|
543
|
-
collectionName:
|
|
544
|
-
postage:
|
|
545
|
-
contentLength:
|
|
546
|
-
contentType:
|
|
547
|
-
timestamp:
|
|
548
|
-
offset:
|
|
549
|
-
genesisTransaction:
|
|
550
|
-
output:
|
|
855
|
+
var getInscriptionsParamsSchema = v16.object({
|
|
856
|
+
offset: v16.number(),
|
|
857
|
+
limit: v16.number()
|
|
858
|
+
});
|
|
859
|
+
var getInscriptionsResultSchema = v16.object({
|
|
860
|
+
total: v16.number(),
|
|
861
|
+
limit: v16.number(),
|
|
862
|
+
offset: v16.number(),
|
|
863
|
+
inscriptions: v16.array(
|
|
864
|
+
v16.object({
|
|
865
|
+
inscriptionId: v16.string(),
|
|
866
|
+
inscriptionNumber: v16.string(),
|
|
867
|
+
address: v16.string(),
|
|
868
|
+
collectionName: v16.optional(v16.string()),
|
|
869
|
+
postage: v16.string(),
|
|
870
|
+
contentLength: v16.string(),
|
|
871
|
+
contentType: v16.string(),
|
|
872
|
+
timestamp: v16.number(),
|
|
873
|
+
offset: v16.number(),
|
|
874
|
+
genesisTransaction: v16.string(),
|
|
875
|
+
output: v16.string()
|
|
551
876
|
})
|
|
552
877
|
)
|
|
553
878
|
});
|
|
554
|
-
var getInscriptionsSchema =
|
|
879
|
+
var getInscriptionsSchema = v16.object({
|
|
555
880
|
...rpcRequestMessageSchema.entries,
|
|
556
|
-
...
|
|
557
|
-
method:
|
|
881
|
+
...v16.object({
|
|
882
|
+
method: v16.literal(getInscriptionsMethodName),
|
|
558
883
|
params: getInscriptionsParamsSchema,
|
|
559
|
-
id:
|
|
884
|
+
id: v16.string()
|
|
560
885
|
}).entries
|
|
561
886
|
});
|
|
562
887
|
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
563
|
-
var sendInscriptionsParamsSchema =
|
|
564
|
-
transfers:
|
|
565
|
-
|
|
566
|
-
address:
|
|
567
|
-
inscriptionId:
|
|
888
|
+
var sendInscriptionsParamsSchema = v16.object({
|
|
889
|
+
transfers: v16.array(
|
|
890
|
+
v16.object({
|
|
891
|
+
address: v16.string(),
|
|
892
|
+
inscriptionId: v16.string()
|
|
568
893
|
})
|
|
569
894
|
)
|
|
570
895
|
});
|
|
571
|
-
var sendInscriptionsResultSchema =
|
|
572
|
-
txid:
|
|
896
|
+
var sendInscriptionsResultSchema = v16.object({
|
|
897
|
+
txid: v16.string()
|
|
573
898
|
});
|
|
574
|
-
var sendInscriptionsSchema =
|
|
899
|
+
var sendInscriptionsSchema = v16.object({
|
|
575
900
|
...rpcRequestMessageSchema.entries,
|
|
576
|
-
...
|
|
577
|
-
method:
|
|
901
|
+
...v16.object({
|
|
902
|
+
method: v16.literal(sendInscriptionsMethodName),
|
|
578
903
|
params: sendInscriptionsParamsSchema,
|
|
579
|
-
id:
|
|
904
|
+
id: v16.string()
|
|
580
905
|
}).entries
|
|
581
906
|
});
|
|
582
907
|
|
|
@@ -593,13 +918,13 @@ var request = async (method, params, providerId) => {
|
|
|
593
918
|
throw new Error("A wallet method is required");
|
|
594
919
|
}
|
|
595
920
|
const response = await provider.request(method, params);
|
|
596
|
-
if (
|
|
921
|
+
if (v17.is(rpcErrorResponseMessageSchema, response)) {
|
|
597
922
|
return {
|
|
598
923
|
status: "error",
|
|
599
924
|
error: response.error
|
|
600
925
|
};
|
|
601
926
|
}
|
|
602
|
-
if (
|
|
927
|
+
if (v17.is(rpcSuccessResponseMessageSchema, response)) {
|
|
603
928
|
return {
|
|
604
929
|
status: "success",
|
|
605
930
|
result: response.result
|
|
@@ -1634,6 +1959,10 @@ export {
|
|
|
1634
1959
|
sendInscriptionsParamsSchema,
|
|
1635
1960
|
sendInscriptionsResultSchema,
|
|
1636
1961
|
sendInscriptionsSchema,
|
|
1962
|
+
sendTransferMethodName,
|
|
1963
|
+
sendTransferParamsSchema,
|
|
1964
|
+
sendTransferRequestMessageSchema,
|
|
1965
|
+
sendTransferResultSchema,
|
|
1637
1966
|
setDefaultProvider,
|
|
1638
1967
|
signMessage,
|
|
1639
1968
|
signMessageMethodName,
|
|
@@ -1641,15 +1970,43 @@ export {
|
|
|
1641
1970
|
signMessageRequestMessageSchema,
|
|
1642
1971
|
signMessageResultSchema,
|
|
1643
1972
|
signMultipleTransactions,
|
|
1973
|
+
signPsbtMethodName,
|
|
1974
|
+
signPsbtParamsSchema,
|
|
1975
|
+
signPsbtRequestMessageSchema,
|
|
1976
|
+
signPsbtResultSchema,
|
|
1644
1977
|
signTransaction,
|
|
1978
|
+
stxCallContractMethodName,
|
|
1979
|
+
stxCallContractParamsSchema,
|
|
1980
|
+
stxCallContractRequestMessageSchema,
|
|
1981
|
+
stxCallContractResultSchema,
|
|
1982
|
+
stxDeployContractMethodName,
|
|
1983
|
+
stxDeployContractParamsSchema,
|
|
1984
|
+
stxDeployContractRequestMessageSchema,
|
|
1985
|
+
stxDeployContractResultSchema,
|
|
1986
|
+
stxGetAccountsMethodName,
|
|
1987
|
+
stxGetAccountsParamsSchema,
|
|
1988
|
+
stxGetAccountsRequestMessageSchema,
|
|
1989
|
+
stxGetAccountsResultSchema,
|
|
1645
1990
|
stxGetAddressesMethodName,
|
|
1646
1991
|
stxGetAddressesParamsSchema,
|
|
1647
1992
|
stxGetAddressesRequestMessageSchema,
|
|
1648
1993
|
stxGetAddressesResultSchema,
|
|
1994
|
+
stxSignMessageMethodName,
|
|
1995
|
+
stxSignMessageParamsSchema,
|
|
1996
|
+
stxSignMessageRequestMessageSchema,
|
|
1997
|
+
stxSignMessageResultSchema,
|
|
1998
|
+
stxSignStructuredMessageMethodName,
|
|
1999
|
+
stxSignStructuredMessageParamsSchema,
|
|
2000
|
+
stxSignStructuredMessageRequestMessageSchema,
|
|
2001
|
+
stxSignStructuredMessageResultSchema,
|
|
1649
2002
|
stxSignTransactionMethodName,
|
|
1650
2003
|
stxSignTransactionParamsSchema,
|
|
1651
2004
|
stxSignTransactionRequestMessageSchema,
|
|
1652
2005
|
stxSignTransactionResultSchema,
|
|
2006
|
+
stxTransferStxMethodName,
|
|
2007
|
+
stxTransferStxParamsSchema,
|
|
2008
|
+
stxTransferStxRequestMessageSchema,
|
|
2009
|
+
stxTransferStxResultSchema,
|
|
1653
2010
|
transferRunesMethodName,
|
|
1654
2011
|
transferRunesParamsSchema,
|
|
1655
2012
|
transferRunesRequestSchema,
|