@1sat/wallet-toolbox 0.0.54 → 0.0.56
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/api/inscriptions/index.js +1 -0
- package/dist/api/locks/index.js +2 -0
- package/dist/api/ordinals/index.d.ts +10 -5
- package/dist/api/ordinals/index.js +15 -7
- package/dist/api/payments/index.js +2 -2
- package/dist/api/sweep/index.js +3 -0
- package/dist/api/tokens/index.js +2 -0
- package/package.json +1 -1
package/dist/api/locks/index.js
CHANGED
|
@@ -140,6 +140,7 @@ export const lockBsv = {
|
|
|
140
140
|
const result = await ctx.wallet.createAction({
|
|
141
141
|
description: `Lock BSV in ${requests.length} output(s)`,
|
|
142
142
|
outputs,
|
|
143
|
+
options: { signAndProcess: true, acceptDelayedBroadcast: false },
|
|
143
144
|
});
|
|
144
145
|
if (!result.txid) {
|
|
145
146
|
return { error: "no-txid-returned" };
|
|
@@ -270,6 +271,7 @@ export const unlockBsv = {
|
|
|
270
271
|
const signResult = await ctx.wallet.signAction({
|
|
271
272
|
reference: createResult.signableTransaction.reference,
|
|
272
273
|
spends,
|
|
274
|
+
options: { acceptDelayedBroadcast: false },
|
|
273
275
|
});
|
|
274
276
|
if ("error" in signResult) {
|
|
275
277
|
return { error: String(signResult.error) };
|
|
@@ -64,17 +64,22 @@ export declare function buildTransferOrdinals(ctx: OneSatContext, request: Trans
|
|
|
64
64
|
export declare function buildListOrdinal(ctx: OneSatContext, request: ListOrdinalRequest): Promise<CreateActionArgs | {
|
|
65
65
|
error: string;
|
|
66
66
|
}>;
|
|
67
|
-
/** Input for
|
|
68
|
-
export interface
|
|
67
|
+
/** Input for getOrdinals skill */
|
|
68
|
+
export interface GetOrdinalsInput {
|
|
69
69
|
/** Max number of ordinals to return */
|
|
70
70
|
limit?: number;
|
|
71
71
|
/** Offset for pagination */
|
|
72
72
|
offset?: number;
|
|
73
73
|
}
|
|
74
|
+
/** Result from getOrdinals skill */
|
|
75
|
+
export interface GetOrdinalsResult {
|
|
76
|
+
outputs: WalletOutput[];
|
|
77
|
+
BEEF?: number[];
|
|
78
|
+
}
|
|
74
79
|
/**
|
|
75
|
-
*
|
|
80
|
+
* Get ordinals from the wallet with BEEF for spending.
|
|
76
81
|
*/
|
|
77
|
-
export declare const
|
|
82
|
+
export declare const getOrdinals: Skill<GetOrdinalsInput, GetOrdinalsResult>;
|
|
78
83
|
/** Input for deriveCancelAddress skill */
|
|
79
84
|
export interface DeriveCancelAddressInput {
|
|
80
85
|
/** Outpoint of the ordinal listing */
|
|
@@ -108,5 +113,5 @@ export declare const cancelListing: Skill<CancelListingInput, OrdinalOperationRe
|
|
|
108
113
|
*/
|
|
109
114
|
export declare const purchaseOrdinal: Skill<PurchaseOrdinalRequest, OrdinalOperationResponse>;
|
|
110
115
|
/** All ordinals skills for registry */
|
|
111
|
-
export declare const ordinalsSkills: (Skill<
|
|
116
|
+
export declare const ordinalsSkills: (Skill<GetOrdinalsInput, GetOrdinalsResult> | Skill<DeriveCancelAddressInput, string> | Skill<TransferOrdinalsRequest, OrdinalOperationResponse> | Skill<ListOrdinalRequest, OrdinalOperationResponse> | Skill<CancelListingInput, OrdinalOperationResponse> | Skill<PurchaseOrdinalRequest, OrdinalOperationResponse>)[];
|
|
112
117
|
export {};
|
|
@@ -257,17 +257,17 @@ export async function buildListOrdinal(ctx, request) {
|
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
260
|
-
*
|
|
260
|
+
* Get ordinals from the wallet with BEEF for spending.
|
|
261
261
|
*/
|
|
262
|
-
export const
|
|
262
|
+
export const getOrdinals = {
|
|
263
263
|
meta: {
|
|
264
|
-
name: "
|
|
265
|
-
description: "
|
|
264
|
+
name: "getOrdinals",
|
|
265
|
+
description: "Get ordinals/inscriptions from the wallet with BEEF for spending",
|
|
266
266
|
category: "ordinals",
|
|
267
267
|
inputSchema: {
|
|
268
268
|
type: "object",
|
|
269
269
|
properties: {
|
|
270
|
-
limit: { type: "integer", description: "Max
|
|
270
|
+
limit: { type: "integer", description: "Max ordinals to return (default: 100)" },
|
|
271
271
|
offset: { type: "integer", description: "Offset for pagination (default: 0)" },
|
|
272
272
|
},
|
|
273
273
|
},
|
|
@@ -277,10 +277,14 @@ export const listOrdinals = {
|
|
|
277
277
|
basket: ORDINALS_BASKET,
|
|
278
278
|
includeTags: true,
|
|
279
279
|
includeCustomInstructions: true,
|
|
280
|
+
include: 'entire transactions',
|
|
280
281
|
limit: input.limit ?? 100,
|
|
281
282
|
offset: input.offset ?? 0,
|
|
282
283
|
});
|
|
283
|
-
return
|
|
284
|
+
return {
|
|
285
|
+
outputs: result.outputs,
|
|
286
|
+
BEEF: result.BEEF,
|
|
287
|
+
};
|
|
284
288
|
},
|
|
285
289
|
};
|
|
286
290
|
/**
|
|
@@ -383,6 +387,7 @@ export const transferOrdinals = {
|
|
|
383
387
|
const signResult = await ctx.wallet.signAction({
|
|
384
388
|
reference: createResult.signableTransaction.reference,
|
|
385
389
|
spends,
|
|
390
|
+
options: { acceptDelayedBroadcast: false },
|
|
386
391
|
});
|
|
387
392
|
if ("error" in signResult) {
|
|
388
393
|
return { error: String(signResult.error) };
|
|
@@ -440,6 +445,7 @@ export const listOrdinal = {
|
|
|
440
445
|
const signResult = await ctx.wallet.signAction({
|
|
441
446
|
reference: createResult.signableTransaction.reference,
|
|
442
447
|
spends: { 0: { unlockingScript: unlocking } },
|
|
448
|
+
options: { acceptDelayedBroadcast: false },
|
|
443
449
|
});
|
|
444
450
|
if ("error" in signResult) {
|
|
445
451
|
return { error: String(signResult.error) };
|
|
@@ -564,6 +570,7 @@ export const cancelListing = {
|
|
|
564
570
|
spends: {
|
|
565
571
|
0: { unlockingScript: unlockingScript.toHex() },
|
|
566
572
|
},
|
|
573
|
+
options: { acceptDelayedBroadcast: false },
|
|
567
574
|
});
|
|
568
575
|
if ("error" in signResult) {
|
|
569
576
|
return { error: String(signResult.error) };
|
|
@@ -707,6 +714,7 @@ export const purchaseOrdinal = {
|
|
|
707
714
|
spends: {
|
|
708
715
|
0: { unlockingScript: unlockingScript.toHex() },
|
|
709
716
|
},
|
|
717
|
+
options: { acceptDelayedBroadcast: false },
|
|
710
718
|
});
|
|
711
719
|
if ("error" in signResult) {
|
|
712
720
|
return { error: String(signResult.error) };
|
|
@@ -726,7 +734,7 @@ export const purchaseOrdinal = {
|
|
|
726
734
|
// ============================================================================
|
|
727
735
|
/** All ordinals skills for registry */
|
|
728
736
|
export const ordinalsSkills = [
|
|
729
|
-
|
|
737
|
+
getOrdinals,
|
|
730
738
|
deriveCancelAddress,
|
|
731
739
|
transferOrdinals,
|
|
732
740
|
listOrdinal,
|
|
@@ -101,7 +101,7 @@ export const sendBsv = {
|
|
|
101
101
|
const result = await ctx.wallet.createAction({
|
|
102
102
|
description: `Send ${requests.length} payment(s)`,
|
|
103
103
|
outputs,
|
|
104
|
-
options: { signAndProcess: true },
|
|
104
|
+
options: { signAndProcess: true, acceptDelayedBroadcast: false },
|
|
105
105
|
});
|
|
106
106
|
if (!result.txid) {
|
|
107
107
|
return { error: "no-txid-returned" };
|
|
@@ -166,7 +166,7 @@ export const sendAllBsv = {
|
|
|
166
166
|
outputDescription: "Sweep all funds",
|
|
167
167
|
},
|
|
168
168
|
],
|
|
169
|
-
options: { signAndProcess: true },
|
|
169
|
+
options: { signAndProcess: true, acceptDelayedBroadcast: false },
|
|
170
170
|
});
|
|
171
171
|
if (!result.txid) {
|
|
172
172
|
return { error: "no-txid-returned" };
|
package/dist/api/sweep/index.js
CHANGED
|
@@ -204,6 +204,7 @@ export const sweepBsv = {
|
|
|
204
204
|
const signResult = await ctx.wallet.signAction({
|
|
205
205
|
reference: createResult.signableTransaction.reference,
|
|
206
206
|
spends,
|
|
207
|
+
options: { acceptDelayedBroadcast: false },
|
|
207
208
|
});
|
|
208
209
|
if ("error" in signResult) {
|
|
209
210
|
return { error: String(signResult.error) };
|
|
@@ -430,6 +431,7 @@ export const sweepOrdinals = {
|
|
|
430
431
|
const signResult = await ctx.wallet.signAction({
|
|
431
432
|
reference: createResult.signableTransaction.reference,
|
|
432
433
|
spends,
|
|
434
|
+
options: { acceptDelayedBroadcast: false },
|
|
433
435
|
});
|
|
434
436
|
if ("error" in signResult) {
|
|
435
437
|
return { error: String(signResult.error) };
|
|
@@ -643,6 +645,7 @@ export const sweepBsv21 = {
|
|
|
643
645
|
const signResult = await ctx.wallet.signAction({
|
|
644
646
|
reference: createResult.signableTransaction.reference,
|
|
645
647
|
spends,
|
|
648
|
+
options: { acceptDelayedBroadcast: false },
|
|
646
649
|
});
|
|
647
650
|
if ("error" in signResult) {
|
|
648
651
|
return { error: String(signResult.error) };
|
package/dist/api/tokens/index.js
CHANGED
|
@@ -304,6 +304,7 @@ export const sendBsv21 = {
|
|
|
304
304
|
const signResult = await ctx.wallet.signAction({
|
|
305
305
|
reference: createResult.signableTransaction.reference,
|
|
306
306
|
spends: {},
|
|
307
|
+
options: { acceptDelayedBroadcast: false },
|
|
307
308
|
});
|
|
308
309
|
if ("error" in signResult) {
|
|
309
310
|
return { error: String(signResult.error) };
|
|
@@ -451,6 +452,7 @@ export const purchaseBsv21 = {
|
|
|
451
452
|
spends: {
|
|
452
453
|
0: { unlockingScript: unlockingScript.toHex() },
|
|
453
454
|
},
|
|
455
|
+
options: { acceptDelayedBroadcast: false },
|
|
454
456
|
});
|
|
455
457
|
if ("error" in signResult) {
|
|
456
458
|
return { error: String(signResult.error) };
|