@arkade-os/swap 0.1.9 → 0.1.10
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/advanced.cjs +1097 -541
- package/dist/advanced.d.cts +19 -21
- package/dist/advanced.d.ts +19 -21
- package/dist/advanced.js +40 -34
- package/dist/{chunk-FQNG4XMF.js → chunk-2HQZLIVX.js} +98 -37
- package/dist/{chunk-5QPJWOCN.js → chunk-6RJVT65W.js} +2 -0
- package/dist/chunk-AUJDREZN.js +445 -0
- package/dist/{chunk-I7WEXXZX.js → chunk-FWRDAL73.js} +157 -477
- package/dist/{chunk-552GDPBU.js → chunk-LCO6AJOS.js} +433 -59
- package/dist/index.cjs +1083 -530
- package/dist/index.d.cts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.js +24 -22
- package/dist/{lockupContract-DguuT7NK.d.cts → lockupContract-BTTRVwOt.d.cts} +1 -1
- package/dist/{lockupContract-BUOsghl1.d.ts → lockupContract-aFarhlxj.d.ts} +1 -1
- package/dist/node/index.d.cts +97 -67
- package/dist/node/index.d.ts +97 -67
- package/dist/nostr.cjs +925 -516
- package/dist/nostr.d.cts +1 -1
- package/dist/nostr.d.ts +1 -1
- package/dist/nostr.js +3 -2
- package/dist/{offerFillPlan-_AOLo6kh.d.ts → offerFillPlan-CJC5tnEd.d.ts} +10 -42
- package/dist/{offerFillPlan-Bp6-z6dS.d.cts → offerFillPlan-FmyaQoYT.d.cts} +10 -42
- package/dist/protocol.cjs +1054 -175
- package/dist/protocol.d.cts +42 -23
- package/dist/protocol.d.ts +42 -23
- package/dist/protocol.js +20 -7
- package/dist/repositories/realm/index.d.cts +3 -2
- package/dist/repositories/realm/index.d.ts +3 -2
- package/dist/repositories/sqlite/index.d.cts +3 -2
- package/dist/repositories/sqlite/index.d.ts +3 -2
- package/dist/{repository-CkKK0dGO.d.ts → repository-CwwhIAEd.d.cts} +406 -74
- package/dist/{repository--pfikw2R.d.cts → repository-DO6QKxBx.d.ts} +406 -74
- package/dist/{rfq-IzhOCG02.d.ts → rfq-CYxOyniL.d.ts} +52 -11
- package/dist/rfq-contract.cjs +3 -0
- package/dist/rfq-contract.d.cts +3 -1
- package/dist/rfq-contract.d.ts +3 -1
- package/dist/rfq-contract.js +3 -1
- package/dist/{rfq-BRpo5uWU.d.cts → rfq-nMGywkqI.d.cts} +52 -11
- package/dist/verify-ENO36VPK.js +33 -0
- package/dist/{watch-pvTVFp6-.d.cts → watch-DpDSP2tu.d.cts} +4 -3
- package/dist/{watch-DDNycuUa.d.ts → watch-_fZSgx_l.d.ts} +4 -3
- package/package.json +2 -2
- package/dist/offer-BhonWuKR.d.ts +0 -274
- package/dist/offer-D_qHpWo2.d.cts +0 -274
|
@@ -2,10 +2,11 @@ import {
|
|
|
2
2
|
ASSET_SWAP_BASELINE,
|
|
3
3
|
ASSET_SWAP_V2,
|
|
4
4
|
ASSET_SWAP_V3,
|
|
5
|
+
ASSET_SWAP_V4,
|
|
5
6
|
RFQ_CONTRACT_VERSIONS_KEY,
|
|
6
7
|
RFQ_CONTRACT_VERSION_KEY,
|
|
7
8
|
RFQ_CONTRACT_VERSION_UNSUPPORTED
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6RJVT65W.js";
|
|
9
10
|
import {
|
|
10
11
|
collectAssetSwaps
|
|
11
12
|
} from "./chunk-A3SHHRX4.js";
|
|
@@ -132,6 +133,136 @@ var asset_swap_default = {
|
|
|
132
133
|
fingerprint: "sha256:e2b80add6237f6c7e2c69a96ae46d55abe6de5f71c3718106f4d5b22ac9e6d0a"
|
|
133
134
|
};
|
|
134
135
|
|
|
136
|
+
// src/contracts/asset-swap-v4.json
|
|
137
|
+
var asset_swap_v4_default = {
|
|
138
|
+
formatVersion: 1,
|
|
139
|
+
contractName: "AssetSwap",
|
|
140
|
+
constructorInputs: [
|
|
141
|
+
{
|
|
142
|
+
name: "receiver",
|
|
143
|
+
type: "pubkey"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "amount",
|
|
147
|
+
type: "int"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "assetTxid",
|
|
151
|
+
type: "bytes32"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "assetGroupIndex",
|
|
155
|
+
type: "int"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "user",
|
|
159
|
+
type: "pubkey"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "taker",
|
|
163
|
+
type: "pubkey"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
functions: [
|
|
167
|
+
{
|
|
168
|
+
name: "fulfill",
|
|
169
|
+
arkade: {
|
|
170
|
+
inputs: [],
|
|
171
|
+
asm: [
|
|
172
|
+
"OP_PUSHCURRENTINPUTINDEX",
|
|
173
|
+
"OP_DUP",
|
|
174
|
+
"<assetTxid>",
|
|
175
|
+
"<assetGroupIndex>",
|
|
176
|
+
"OP_INSPECTOUTASSETLOOKUP",
|
|
177
|
+
"OP_VERIFY",
|
|
178
|
+
"<amount>",
|
|
179
|
+
"OP_GREATERTHANOREQUAL",
|
|
180
|
+
"OP_VERIFY",
|
|
181
|
+
"OP_INSPECTOUTPUTSCRIPTPUBKEY",
|
|
182
|
+
"1",
|
|
183
|
+
"OP_NUMEQUALVERIFY",
|
|
184
|
+
"<receiver>",
|
|
185
|
+
"OP_EQUAL"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
leaves: [
|
|
189
|
+
{
|
|
190
|
+
name: "fulfill",
|
|
191
|
+
witness: [
|
|
192
|
+
{
|
|
193
|
+
name: "takerSig",
|
|
194
|
+
type: "signature",
|
|
195
|
+
encoding: "schnorr-64"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "serverSig",
|
|
199
|
+
type: "signature",
|
|
200
|
+
encoding: "schnorr-64",
|
|
201
|
+
injected: true
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "emulatorSig",
|
|
205
|
+
type: "signature",
|
|
206
|
+
encoding: "schnorr-64",
|
|
207
|
+
injected: true
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
asm: [
|
|
211
|
+
"<taker>",
|
|
212
|
+
"OP_CHECKSIGVERIFY",
|
|
213
|
+
"<SERVER_KEY>",
|
|
214
|
+
"OP_CHECKSIGVERIFY",
|
|
215
|
+
"<EMULATOR_KEY:fulfill>",
|
|
216
|
+
"OP_CHECKSIG"
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "cancel",
|
|
223
|
+
leaves: [
|
|
224
|
+
{
|
|
225
|
+
name: "cancel",
|
|
226
|
+
witness: [
|
|
227
|
+
{
|
|
228
|
+
name: "userSig",
|
|
229
|
+
type: "signature",
|
|
230
|
+
encoding: "schnorr-64"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: "serverSig",
|
|
234
|
+
type: "signature",
|
|
235
|
+
encoding: "schnorr-64",
|
|
236
|
+
injected: true
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
asm: [
|
|
240
|
+
"<user>",
|
|
241
|
+
"OP_CHECKSIGVERIFY",
|
|
242
|
+
"<SERVER_KEY>",
|
|
243
|
+
"OP_CHECKSIG"
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
source: {
|
|
250
|
+
entry: "asset-swap-v4.ark",
|
|
251
|
+
files: {
|
|
252
|
+
"asset-swap-v4.ark": "pragma arkade ^0.1.0;\n\n// The output at this input's index pays `receiver` at least `amount` of the asset,\n// and only `taker` can make that spend.\ncontract AssetSwap(\n pubkey receiver,\n int amount,\n bytes32 assetTxid,\n int assetGroupIndex,\n pubkey user,\n pubkey taker\n) {\n function fulfill() {\n int i = this.activeInputIndex;\n require(tx.outputs[i].assets.lookup(assetTxid, assetGroupIndex) >= amount);\n let paid = tx.outputs[i].script;\n require(paid.version == 1);\n require(paid.program == receiver);\n }\n\n // Replaces the synthesized collaborative leaf: the quoting solver is a third\n // conjunct, so an observer who reads the deposit cannot complete it.\n function fulfill(signature takerSig, signature serverSig, signature emulatorSig) tapscript {\n require(checkMultisig([taker, server, emulator], [takerSig, serverSig, emulatorSig], 3));\n }\n\n function cancel(signature userSig, signature serverSig) tapscript {\n require(checkMultisig([user, server], [userSig, serverSig], 2));\n }\n}\n"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
compiler: {
|
|
256
|
+
name: "arkadec",
|
|
257
|
+
version: "0.1.0-rc.1",
|
|
258
|
+
options: {
|
|
259
|
+
optimize: true
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
updatedAt: "2026-11-19T20:57:50.605738400+00:00",
|
|
263
|
+
fingerprint: "sha256:d830de32cd1d286a0a1fac698ff114a6c8ef5338a69f9f813717d1038ab2fb4a"
|
|
264
|
+
};
|
|
265
|
+
|
|
135
266
|
// src/contracts/sats-swap.json
|
|
136
267
|
var sats_swap_default = {
|
|
137
268
|
formatVersion: 1,
|
|
@@ -240,6 +371,125 @@ var sats_swap_default = {
|
|
|
240
371
|
fingerprint: "sha256:d7a60ab2178ede40a2e4867816689ea022641531cc662b562bebd7caa1ef96c4"
|
|
241
372
|
};
|
|
242
373
|
|
|
374
|
+
// src/contracts/sats-swap-v4.json
|
|
375
|
+
var sats_swap_v4_default = {
|
|
376
|
+
formatVersion: 1,
|
|
377
|
+
contractName: "SatsSwap",
|
|
378
|
+
constructorInputs: [
|
|
379
|
+
{
|
|
380
|
+
name: "receiver",
|
|
381
|
+
type: "pubkey"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
name: "amount",
|
|
385
|
+
type: "int"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
name: "user",
|
|
389
|
+
type: "pubkey"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: "taker",
|
|
393
|
+
type: "pubkey"
|
|
394
|
+
}
|
|
395
|
+
],
|
|
396
|
+
functions: [
|
|
397
|
+
{
|
|
398
|
+
name: "fulfill",
|
|
399
|
+
arkade: {
|
|
400
|
+
inputs: [],
|
|
401
|
+
asm: [
|
|
402
|
+
"OP_PUSHCURRENTINPUTINDEX",
|
|
403
|
+
"OP_DUP",
|
|
404
|
+
"OP_INSPECTOUTPUTVALUE",
|
|
405
|
+
"<amount>",
|
|
406
|
+
"OP_GREATERTHANOREQUAL",
|
|
407
|
+
"OP_VERIFY",
|
|
408
|
+
"OP_INSPECTOUTPUTSCRIPTPUBKEY",
|
|
409
|
+
"1",
|
|
410
|
+
"OP_NUMEQUALVERIFY",
|
|
411
|
+
"<receiver>",
|
|
412
|
+
"OP_EQUAL"
|
|
413
|
+
]
|
|
414
|
+
},
|
|
415
|
+
leaves: [
|
|
416
|
+
{
|
|
417
|
+
name: "fulfill",
|
|
418
|
+
witness: [
|
|
419
|
+
{
|
|
420
|
+
name: "takerSig",
|
|
421
|
+
type: "signature",
|
|
422
|
+
encoding: "schnorr-64"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
name: "serverSig",
|
|
426
|
+
type: "signature",
|
|
427
|
+
encoding: "schnorr-64",
|
|
428
|
+
injected: true
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
name: "emulatorSig",
|
|
432
|
+
type: "signature",
|
|
433
|
+
encoding: "schnorr-64",
|
|
434
|
+
injected: true
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
asm: [
|
|
438
|
+
"<taker>",
|
|
439
|
+
"OP_CHECKSIGVERIFY",
|
|
440
|
+
"<SERVER_KEY>",
|
|
441
|
+
"OP_CHECKSIGVERIFY",
|
|
442
|
+
"<EMULATOR_KEY:fulfill>",
|
|
443
|
+
"OP_CHECKSIG"
|
|
444
|
+
]
|
|
445
|
+
}
|
|
446
|
+
]
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
name: "cancel",
|
|
450
|
+
leaves: [
|
|
451
|
+
{
|
|
452
|
+
name: "cancel",
|
|
453
|
+
witness: [
|
|
454
|
+
{
|
|
455
|
+
name: "userSig",
|
|
456
|
+
type: "signature",
|
|
457
|
+
encoding: "schnorr-64"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "serverSig",
|
|
461
|
+
type: "signature",
|
|
462
|
+
encoding: "schnorr-64",
|
|
463
|
+
injected: true
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
asm: [
|
|
467
|
+
"<user>",
|
|
468
|
+
"OP_CHECKSIGVERIFY",
|
|
469
|
+
"<SERVER_KEY>",
|
|
470
|
+
"OP_CHECKSIG"
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
],
|
|
476
|
+
source: {
|
|
477
|
+
entry: "sats-swap-v4.ark",
|
|
478
|
+
files: {
|
|
479
|
+
"sats-swap-v4.ark": "pragma arkade ^0.1.0;\n\n// The output at this input's index pays `receiver` at least `amount` sats,\n// and only `taker` can make that spend.\ncontract SatsSwap(\n pubkey receiver,\n int amount,\n pubkey user,\n pubkey taker\n) {\n function fulfill() {\n int i = this.activeInputIndex;\n require(tx.outputs[i].value >= amount);\n let paid = tx.outputs[i].script;\n require(paid.version == 1);\n require(paid.program == receiver);\n }\n\n function fulfill(signature takerSig, signature serverSig, signature emulatorSig) tapscript {\n require(checkMultisig([taker, server, emulator], [takerSig, serverSig, emulatorSig], 3));\n }\n\n function cancel(signature userSig, signature serverSig) tapscript {\n require(checkMultisig([user, server], [userSig, serverSig], 2));\n }\n}\n"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
compiler: {
|
|
483
|
+
name: "arkadec",
|
|
484
|
+
version: "0.1.0-rc.1",
|
|
485
|
+
options: {
|
|
486
|
+
optimize: true
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
updatedAt: "2026-11-19T20:57:50.848496600+00:00",
|
|
490
|
+
fingerprint: "sha256:6ca61bf7ed8d8f65af3141da4e95fcc896863650127dd20949a84e72258053f4"
|
|
491
|
+
};
|
|
492
|
+
|
|
243
493
|
// src/legacy/swap-want-asset.program.v1.json
|
|
244
494
|
var swap_want_asset_program_v1_default = {
|
|
245
495
|
version: 1,
|
|
@@ -324,38 +574,60 @@ var legacySwapPrograms = {
|
|
|
324
574
|
wantAsset: arkade.parseArtifact(swap_want_asset_program_v1_default),
|
|
325
575
|
wantBtc: arkade.parseArtifact(swap_want_btc_program_v1_default)
|
|
326
576
|
};
|
|
577
|
+
var directedSwapPrograms = {
|
|
578
|
+
wantAsset: arkade.programFromArtifact(asset_swap_v4_default),
|
|
579
|
+
wantBtc: arkade.programFromArtifact(sats_swap_v4_default)
|
|
580
|
+
};
|
|
327
581
|
var sharedArgs = ({ user, server, exitDelay }) => ({
|
|
328
582
|
user,
|
|
329
583
|
server,
|
|
330
584
|
...exitDelay && { exitDelay }
|
|
331
585
|
});
|
|
586
|
+
var refuseTaker = (version, { taker }) => {
|
|
587
|
+
if (taker !== void 0) throw new Error(`${version} binds no taker key`);
|
|
588
|
+
};
|
|
589
|
+
var v3Args = (inputs) => ({
|
|
590
|
+
receiver: inputs.receiver,
|
|
591
|
+
amount: inputs.amount,
|
|
592
|
+
...inputs.asset && {
|
|
593
|
+
assetTxid: inputs.asset.txid,
|
|
594
|
+
assetGroupIndex: inputs.asset.groupIndex
|
|
595
|
+
},
|
|
596
|
+
...sharedArgs(inputs)
|
|
597
|
+
});
|
|
332
598
|
var ASSET_SWAP_CONTRACTS = {
|
|
333
599
|
[ASSET_SWAP_V2]: {
|
|
334
600
|
programs: legacySwapPrograms,
|
|
335
|
-
args: (inputs) =>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
601
|
+
args: (inputs) => {
|
|
602
|
+
refuseTaker(ASSET_SWAP_V2, inputs);
|
|
603
|
+
return {
|
|
604
|
+
makerWP: inputs.receiver,
|
|
605
|
+
wantAmount: inputs.amount,
|
|
606
|
+
...inputs.asset && {
|
|
607
|
+
wantAssetTxid: inputs.asset.txid,
|
|
608
|
+
wantAssetGroupIndex: inputs.asset.groupIndex
|
|
609
|
+
},
|
|
610
|
+
...sharedArgs(inputs)
|
|
611
|
+
};
|
|
612
|
+
}
|
|
344
613
|
},
|
|
345
614
|
[ASSET_SWAP_V3]: {
|
|
346
615
|
programs: swapPrograms,
|
|
347
|
-
args: (inputs) =>
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
616
|
+
args: (inputs) => {
|
|
617
|
+
refuseTaker(ASSET_SWAP_V3, inputs);
|
|
618
|
+
return v3Args(inputs);
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
[ASSET_SWAP_V4]: {
|
|
622
|
+
programs: directedSwapPrograms,
|
|
623
|
+
args: (inputs) => {
|
|
624
|
+
if (inputs.taker === void 0) throw new Error(`${ASSET_SWAP_V4} needs a taker key`);
|
|
625
|
+
return { ...v3Args(inputs), taker: inputs.taker };
|
|
626
|
+
}
|
|
356
627
|
}
|
|
357
628
|
};
|
|
358
|
-
var ASSET_SWAP_CONTRACT_VERSIONS = [
|
|
629
|
+
var ASSET_SWAP_CONTRACT_VERSIONS = [ASSET_SWAP_V4];
|
|
630
|
+
var ASSET_SWAP_DERIVABLE_VERSIONS = [ASSET_SWAP_V4, ASSET_SWAP_V3, ASSET_SWAP_V2];
|
|
359
631
|
var assetSwapContractVersion = (id) => {
|
|
360
632
|
if (id === void 0) return ASSET_SWAP_BASELINE;
|
|
361
633
|
if (Object.hasOwn(ASSET_SWAP_CONTRACTS, id)) return id;
|
|
@@ -370,9 +642,9 @@ var BTC_ASSET_ID = "btc";
|
|
|
370
642
|
var byNewest = (a, b) => b.createdAt - a.createdAt;
|
|
371
643
|
var getAssetSwapsOrThrow = async (repository) => {
|
|
372
644
|
return (await collectAssetSwaps(repository)).filter(
|
|
373
|
-
(s) => s && typeof s.id === "string" && // offer swaps carry the TLV; onchain-corridor swaps carry
|
|
374
|
-
// the payment hash instead —
|
|
375
|
-
(typeof s.offerHex === "string" || typeof s.paymentHash === "string")
|
|
645
|
+
(s) => s && typeof s.id === "string" && // offer swaps carry the TLV or the binding; onchain-corridor swaps carry
|
|
646
|
+
// the payment hash instead — any of them marks a valid record
|
|
647
|
+
(typeof s.offerHex === "string" || s.binding !== void 0 || typeof s.paymentHash === "string")
|
|
376
648
|
).sort(byNewest);
|
|
377
649
|
};
|
|
378
650
|
var getAssetSwaps = async (repository) => {
|
|
@@ -705,28 +977,28 @@ function withExitClosure(program, exit) {
|
|
|
705
977
|
}
|
|
706
978
|
};
|
|
707
979
|
}
|
|
708
|
-
function swapProgramBinding(offer, operatorPubkey, contractVersion
|
|
980
|
+
function swapProgramBinding(offer, operatorPubkey, contractVersion) {
|
|
709
981
|
if (offer.makerPkScript.length !== FIELDS.makerPkScript.width) {
|
|
710
982
|
throw new Error("makerPkScript is not a 34-byte taproot scriptPubKey");
|
|
711
983
|
}
|
|
984
|
+
const directed = offer.taker !== void 0;
|
|
985
|
+
const version = contractVersion ?? (directed ? ASSET_SWAP_V4 : ASSET_SWAP_BASELINE);
|
|
712
986
|
const expected = offer.swapPkScript;
|
|
713
|
-
if (!expected?.length) return bindSwapProgram(offer, operatorPubkey,
|
|
987
|
+
if (!expected?.length) return bindSwapProgram(offer, operatorPubkey, version);
|
|
714
988
|
const funded = hex2.encode(expected);
|
|
715
|
-
const order = [
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
];
|
|
719
|
-
for (const version of order) {
|
|
720
|
-
const binding = bindSwapProgram(offer, operatorPubkey, version);
|
|
989
|
+
const order = directed ? [ASSET_SWAP_V4] : [ASSET_SWAP_BASELINE, ASSET_SWAP_V3];
|
|
990
|
+
for (const candidate of order) {
|
|
991
|
+
const binding = bindSwapProgram(offer, operatorPubkey, candidate);
|
|
721
992
|
if (pkOf(binding) === funded) return binding;
|
|
722
993
|
}
|
|
723
|
-
return bindSwapProgram(offer, operatorPubkey,
|
|
994
|
+
return bindSwapProgram(offer, operatorPubkey, directed ? ASSET_SWAP_V4 : version);
|
|
724
995
|
}
|
|
725
996
|
function bindSwapProgram(offer, operatorPubkey, contractVersion) {
|
|
726
997
|
const { programs, args } = ASSET_SWAP_CONTRACTS[contractVersion];
|
|
727
998
|
const user = offer.makerPublicKey;
|
|
728
999
|
const assetId = offer.wantAsset;
|
|
729
1000
|
return {
|
|
1001
|
+
version: contractVersion,
|
|
730
1002
|
program: withExitClosure(assetId ? programs.wantAsset : programs.wantBtc, offer.exitDelay),
|
|
731
1003
|
args: args({
|
|
732
1004
|
receiver: offer.makerPkScript.subarray(2),
|
|
@@ -737,7 +1009,8 @@ function bindSwapProgram(offer, operatorPubkey, contractVersion) {
|
|
|
737
1009
|
},
|
|
738
1010
|
user,
|
|
739
1011
|
server: operatorPubkey,
|
|
740
|
-
...offer.exitDelay && { exitDelay: offer.exitDelay.value }
|
|
1012
|
+
...offer.exitDelay && { exitDelay: offer.exitDelay.value },
|
|
1013
|
+
...offer.taker && { taker: offer.taker }
|
|
741
1014
|
}),
|
|
742
1015
|
keys: {
|
|
743
1016
|
serverKey: operatorPubkey,
|
|
@@ -761,11 +1034,94 @@ function pkOf(binding) {
|
|
|
761
1034
|
function offerContract(offer, operatorPubkey, contractVersion) {
|
|
762
1035
|
return compileSwapBinding(swapProgramBinding(offer, operatorPubkey, contractVersion));
|
|
763
1036
|
}
|
|
1037
|
+
var isOfferBinding = (offer) => "version" in offer;
|
|
1038
|
+
var termsOf = (binding) => ({
|
|
1039
|
+
wantAmount: binding.amount,
|
|
1040
|
+
...binding.wantAsset && { wantAsset: binding.wantAsset },
|
|
1041
|
+
...binding.offerAsset && { offerAsset: binding.offerAsset },
|
|
1042
|
+
makerPkScript: binding.receiverPkScript,
|
|
1043
|
+
makerPublicKey: binding.userPublicKey,
|
|
1044
|
+
emulatorPubkey: binding.emulatorPublicKey,
|
|
1045
|
+
...binding.exitDelay && { exitDelay: binding.exitDelay },
|
|
1046
|
+
...binding.taker && { taker: binding.taker }
|
|
1047
|
+
});
|
|
1048
|
+
var offerOf = (offer, swapPkScript) => isOfferBinding(offer) ? { ...termsOf(offer), swapPkScript } : offer;
|
|
1049
|
+
function bindingProgram(binding) {
|
|
1050
|
+
if (Boolean(binding.wantAsset) === Boolean(binding.offerAsset)) {
|
|
1051
|
+
throw new Error("an offer binding names exactly one of wantAsset or offerAsset");
|
|
1052
|
+
}
|
|
1053
|
+
return swapProgramBinding(termsOf(binding), binding.serverPublicKey, binding.version);
|
|
1054
|
+
}
|
|
1055
|
+
function bindingFromOffer(offer, operatorPubkey) {
|
|
1056
|
+
const program = swapProgramBinding(offer, operatorPubkey);
|
|
1057
|
+
if (pkOf(program) !== hex2.encode(offer.swapPkScript)) {
|
|
1058
|
+
throw new OfferCovenantMismatchError(hex2.encode(offer.swapPkScript));
|
|
1059
|
+
}
|
|
1060
|
+
return {
|
|
1061
|
+
version: program.version,
|
|
1062
|
+
receiverPkScript: offer.makerPkScript,
|
|
1063
|
+
amount: offer.wantAmount,
|
|
1064
|
+
...offer.wantAsset && { wantAsset: offer.wantAsset },
|
|
1065
|
+
...offer.offerAsset && { offerAsset: offer.offerAsset },
|
|
1066
|
+
userPublicKey: offer.makerPublicKey,
|
|
1067
|
+
serverPublicKey: operatorPubkey,
|
|
1068
|
+
emulatorPublicKey: offer.emulatorPubkey,
|
|
1069
|
+
...offer.exitDelay && { exitDelay: offer.exitDelay },
|
|
1070
|
+
...offer.taker && { taker: offer.taker }
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
function offerFromBinding(binding) {
|
|
1074
|
+
return offerOf(binding, compileSwapBinding(bindingProgram(binding)).pkScript);
|
|
1075
|
+
}
|
|
1076
|
+
var recordOfferBinding = (binding) => ({
|
|
1077
|
+
version: binding.version,
|
|
1078
|
+
receiverPkScript: hex2.encode(binding.receiverPkScript),
|
|
1079
|
+
amount: binding.amount.toString(),
|
|
1080
|
+
...binding.wantAsset && { wantAsset: binding.wantAsset.toString() },
|
|
1081
|
+
...binding.offerAsset && { offerAsset: binding.offerAsset.toString() },
|
|
1082
|
+
userPublicKey: hex2.encode(binding.userPublicKey),
|
|
1083
|
+
serverPublicKey: hex2.encode(binding.serverPublicKey),
|
|
1084
|
+
emulatorPublicKey: hex2.encode(binding.emulatorPublicKey),
|
|
1085
|
+
...binding.exitDelay && {
|
|
1086
|
+
exitDelay: { type: binding.exitDelay.type, value: binding.exitDelay.value.toString() }
|
|
1087
|
+
},
|
|
1088
|
+
...binding.taker && { taker: hex2.encode(binding.taker) }
|
|
1089
|
+
});
|
|
1090
|
+
var decimal = (value, name) => {
|
|
1091
|
+
if (!/^\d+$/.test(value)) throw new Error(`recorded binding ${name} is not a decimal amount`);
|
|
1092
|
+
return BigInt(value);
|
|
1093
|
+
};
|
|
1094
|
+
var offerBindingOf = (recorded) => {
|
|
1095
|
+
if (typeof recorded.version !== "string" || !Object.hasOwn(ASSET_SWAP_CONTRACTS, recorded.version)) {
|
|
1096
|
+
throw new Error(`recorded binding names no known contract version (${recorded.version})`);
|
|
1097
|
+
}
|
|
1098
|
+
const { exitDelay, wantAsset, offerAsset, taker } = recorded;
|
|
1099
|
+
return {
|
|
1100
|
+
version: recorded.version,
|
|
1101
|
+
receiverPkScript: hex2.decode(recorded.receiverPkScript),
|
|
1102
|
+
amount: decimal(recorded.amount, "amount"),
|
|
1103
|
+
...wantAsset !== void 0 && { wantAsset: asset.AssetId.fromString(wantAsset) },
|
|
1104
|
+
...offerAsset !== void 0 && { offerAsset: asset.AssetId.fromString(offerAsset) },
|
|
1105
|
+
userPublicKey: hex2.decode(recorded.userPublicKey),
|
|
1106
|
+
serverPublicKey: hex2.decode(recorded.serverPublicKey),
|
|
1107
|
+
emulatorPublicKey: hex2.decode(recorded.emulatorPublicKey),
|
|
1108
|
+
...exitDelay && {
|
|
1109
|
+
exitDelay: { type: exitDelay.type, value: decimal(exitDelay.value, "exitDelay") }
|
|
1110
|
+
},
|
|
1111
|
+
...taker !== void 0 && { taker: hex2.decode(taker) }
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
var storedOffer = (swap) => {
|
|
1115
|
+
if (swap.binding !== void 0) return offerBindingOf(swap.binding);
|
|
1116
|
+
if (typeof swap.offerHex === "string") return decodeOffer(hex2.decode(swap.offerHex));
|
|
1117
|
+
throw new Error("this offer swap carries neither a binding nor an offerHex to rebuild from");
|
|
1118
|
+
};
|
|
764
1119
|
var OFFER_PACKET_TYPE = 3;
|
|
765
1120
|
var FIELDS = {
|
|
766
1121
|
swapPkScript: { tag: 1, width: 34 },
|
|
767
1122
|
wantAmount: { tag: 2, width: 8 },
|
|
768
1123
|
wantAsset: { tag: 3, width: void 0 },
|
|
1124
|
+
taker: { tag: 4, width: 32 },
|
|
769
1125
|
makerPkScript: { tag: 5, width: 34 },
|
|
770
1126
|
makerPublicKey: { tag: 7, width: 32 },
|
|
771
1127
|
emulatorPubkey: { tag: 8, width: 32 },
|
|
@@ -808,6 +1164,9 @@ function encodeOffer(offer) {
|
|
|
808
1164
|
throw new Error(`${name} must be ${FIELDS[name].width} bytes`);
|
|
809
1165
|
}
|
|
810
1166
|
}
|
|
1167
|
+
if (offer.taker !== void 0 && offer.taker.length !== FIELDS.taker.width) {
|
|
1168
|
+
throw new Error(`taker must be ${FIELDS.taker.width} bytes`);
|
|
1169
|
+
}
|
|
811
1170
|
const ratioNum = setRatio("ratioNum", offer.ratioNum);
|
|
812
1171
|
const ratioDen = setRatio("ratioDen", offer.ratioDen);
|
|
813
1172
|
if (ratioNum === void 0 !== (ratioDen === void 0)) {
|
|
@@ -823,9 +1182,10 @@ function encodeOffer(offer) {
|
|
|
823
1182
|
if (offer.offerAsset) recs.push(tlv(FIELDS.offerAsset.tag, offer.offerAsset.serialize()));
|
|
824
1183
|
recs.push(
|
|
825
1184
|
tlv(FIELDS.makerPkScript.tag, offer.makerPkScript),
|
|
826
|
-
tlv(FIELDS.makerPublicKey.tag, offer.makerPublicKey)
|
|
827
|
-
tlv(FIELDS.emulatorPubkey.tag, offer.emulatorPubkey)
|
|
1185
|
+
tlv(FIELDS.makerPublicKey.tag, offer.makerPublicKey)
|
|
828
1186
|
);
|
|
1187
|
+
if (offer.taker) recs.push(tlv(FIELDS.taker.tag, offer.taker));
|
|
1188
|
+
recs.push(tlv(FIELDS.emulatorPubkey.tag, offer.emulatorPubkey));
|
|
829
1189
|
if (offer.exitDelay) recs.push(tlv(FIELDS.exitTimelock.tag, encodeExitDelay(offer.exitDelay)));
|
|
830
1190
|
return concatBytes(...recs);
|
|
831
1191
|
}
|
|
@@ -903,7 +1263,8 @@ function decodeOffer(data) {
|
|
|
903
1263
|
emulatorPubkey: need("emulatorPubkey"),
|
|
904
1264
|
...ratioNum !== void 0 && { ratioNum },
|
|
905
1265
|
...ratioDen !== void 0 && { ratioDen },
|
|
906
|
-
...fields.exitTimelock && { exitDelay: decodeExitDelay(fields.exitTimelock) }
|
|
1266
|
+
...fields.exitTimelock && { exitDelay: decodeExitDelay(fields.exitTimelock) },
|
|
1267
|
+
...fields.taker && { taker: fields.taker }
|
|
907
1268
|
};
|
|
908
1269
|
}
|
|
909
1270
|
function decodeExitDelay(value) {
|
|
@@ -931,10 +1292,7 @@ var derivingClient = (wallet, info, contractManager) => arkade2.Arkade.connect({
|
|
|
931
1292
|
contractManager
|
|
932
1293
|
});
|
|
933
1294
|
function offerContractParams(client, binding, operatorPubkey, expectedPkScript) {
|
|
934
|
-
const { program, args, keys } = swapProgramBinding(
|
|
935
|
-
{ ...binding, swapPkScript: expectedPkScript },
|
|
936
|
-
operatorPubkey
|
|
937
|
-
);
|
|
1295
|
+
const { program, args, keys } = "version" in binding ? bindingProgram(binding) : swapProgramBinding({ ...binding, swapPkScript: expectedPkScript }, operatorPubkey);
|
|
938
1296
|
const contract = new arkade2.ArkadeContract(client, program, args, keys);
|
|
939
1297
|
if (hex2.encode(contract.pkScript) !== hex2.encode(expectedPkScript)) {
|
|
940
1298
|
throw new Error("derived covenant does not match the offer's swapPkScript");
|
|
@@ -966,7 +1324,7 @@ async function restoreOfferCoverage(wallet, swaps) {
|
|
|
966
1324
|
if (seen.has(swap.swapPkScript)) continue;
|
|
967
1325
|
seen.add(swap.swapPkScript);
|
|
968
1326
|
try {
|
|
969
|
-
const
|
|
1327
|
+
const binding = storedOffer(swap);
|
|
970
1328
|
const stored = fundedKey.get(swap.swapPkScript);
|
|
971
1329
|
covenants.push({
|
|
972
1330
|
script: swap.swapPkScript,
|
|
@@ -1075,7 +1433,8 @@ async function deriveOffer(wallet, params) {
|
|
|
1075
1433
|
makerPublicKey: maker.publicKey,
|
|
1076
1434
|
emulatorPubkey: emuKey,
|
|
1077
1435
|
// checked before registration below. @see assertExitDelay
|
|
1078
|
-
exitDelay: params.noExit ? void 0 : params.exitDelay ? assertExitDelay(params.exitDelay) : serverExitDelay(info.unilateralExitDelay)
|
|
1436
|
+
exitDelay: params.noExit ? void 0 : params.exitDelay ? assertExitDelay(params.exitDelay) : serverExitDelay(info.unilateralExitDelay),
|
|
1437
|
+
...params.taker && { taker: params.taker }
|
|
1079
1438
|
});
|
|
1080
1439
|
const script = offerContract(binding, operatorPubKey, params.contractVersion);
|
|
1081
1440
|
const offer = { ...binding, swapPkScript: script.pkScript };
|
|
@@ -1088,6 +1447,7 @@ async function deriveOffer(wallet, params) {
|
|
|
1088
1447
|
address: script.address(network.hrp, operatorPubKey).encode(),
|
|
1089
1448
|
swapPkScript: script.pkScript,
|
|
1090
1449
|
binding,
|
|
1450
|
+
offerBinding: Object.freeze(bindingFromOffer(offer, operatorPubKey)),
|
|
1091
1451
|
info,
|
|
1092
1452
|
operatorPubkey: operatorPubKey
|
|
1093
1453
|
});
|
|
@@ -1149,7 +1509,7 @@ var OfferCovenantMismatchError = class extends Error {
|
|
|
1149
1509
|
};
|
|
1150
1510
|
async function prepareOfferCancel(wallet, offerHex, opts) {
|
|
1151
1511
|
const { fundingTxid, fundingOutpoint, swapAddress } = opts;
|
|
1152
|
-
const
|
|
1512
|
+
const decoded = typeof offerHex === "string" ? decodeOffer(hex2.decode(offerHex)) : isOfferBinding(offerHex) ? void 0 : offerHex;
|
|
1153
1513
|
const [contractManager, info, reader, broadcaster] = await Promise.all([
|
|
1154
1514
|
wallet.getContractManager(),
|
|
1155
1515
|
wallet.getArkadeInfo({ requireLive: true }),
|
|
@@ -1166,18 +1526,20 @@ async function prepareOfferCancel(wallet, offerHex, opts) {
|
|
|
1166
1526
|
// no `network`: the row lookup is by script and the payout comes from wallet.getAddress()
|
|
1167
1527
|
oneShotSubmit: wallet.oneShotSubmit
|
|
1168
1528
|
});
|
|
1169
|
-
const
|
|
1529
|
+
const pinned = swapAddress ? ArkAddress.decode(swapAddress) : void 0;
|
|
1530
|
+
const funded = decoded ? decoded.swapPkScript : pinned?.pkScript;
|
|
1170
1531
|
let binding;
|
|
1171
1532
|
let rebuilt;
|
|
1172
1533
|
try {
|
|
1173
|
-
binding = swapProgramBinding(
|
|
1534
|
+
binding = decoded ? swapProgramBinding(decoded, pinned?.serverPubKey ?? client.serverKey) : bindingProgram(offerHex);
|
|
1174
1535
|
rebuilt = compileSwapBinding(binding);
|
|
1175
1536
|
} catch (cause) {
|
|
1176
|
-
throw new OfferCovenantMismatchError(hex2.encode(
|
|
1537
|
+
throw new OfferCovenantMismatchError(hex2.encode(funded ?? new Uint8Array()), { cause });
|
|
1177
1538
|
}
|
|
1178
|
-
if (hex2.encode(rebuilt.pkScript) !== hex2.encode(
|
|
1179
|
-
throw new OfferCovenantMismatchError(hex2.encode(
|
|
1539
|
+
if (funded && hex2.encode(rebuilt.pkScript) !== hex2.encode(funded)) {
|
|
1540
|
+
throw new OfferCovenantMismatchError(hex2.encode(funded));
|
|
1180
1541
|
}
|
|
1542
|
+
const offer = decoded ?? offerOf(offerHex, rebuilt.pkScript);
|
|
1181
1543
|
const contract = new arkade2.ArkadeContract(client, binding.program, binding.args, binding.keys);
|
|
1182
1544
|
const [vtxos, makerAddress] = await Promise.all([contract.getUtxos(), wallet.getAddress()]);
|
|
1183
1545
|
const vtxo = resolveDeposit(vtxos, { fundingTxid, fundingOutpoint });
|
|
@@ -1208,8 +1570,8 @@ async function fillOffer(wallet, arkServerUrl, offerHex, opts) {
|
|
|
1208
1570
|
emulator,
|
|
1209
1571
|
emulatorPubkey
|
|
1210
1572
|
} = opts;
|
|
1211
|
-
const
|
|
1212
|
-
const contract = await connectFillContract(wallet, arkServerUrl,
|
|
1573
|
+
const target = typeof offerHex === "string" ? decodeOffer(hex2.decode(offerHex)) : offerHex;
|
|
1574
|
+
const contract = await connectFillContract(wallet, arkServerUrl, target, {
|
|
1213
1575
|
swapAddress,
|
|
1214
1576
|
emulator,
|
|
1215
1577
|
emulatorPubkey
|
|
@@ -1218,7 +1580,7 @@ async function fillOffer(wallet, arkServerUrl, offerHex, opts) {
|
|
|
1218
1580
|
const vtxo = resolveDeposit(vtxos, { fundingTxid, fundingOutpoint });
|
|
1219
1581
|
const fill = contract.functions.fulfill();
|
|
1220
1582
|
assembleOfferFill(fill, {
|
|
1221
|
-
offer,
|
|
1583
|
+
offer: offerOf(target, contract.pkScript),
|
|
1222
1584
|
vtxo,
|
|
1223
1585
|
solverFund: fund,
|
|
1224
1586
|
solverPayout: payoutScript ?? ArkAddress.decode(takerAddress).pkScript,
|
|
@@ -1240,10 +1602,11 @@ async function connectFillContract(wallet, arkServerUrl, offer, opts = {}) {
|
|
|
1240
1602
|
} : {},
|
|
1241
1603
|
...emulatorPubkey ? { emulatorPubkey } : {}
|
|
1242
1604
|
});
|
|
1243
|
-
const
|
|
1244
|
-
const binding = swapProgramBinding(offer, serverKey);
|
|
1605
|
+
const pinned = swapAddress ? ArkAddress.decode(swapAddress) : void 0;
|
|
1606
|
+
const binding = isOfferBinding(offer) ? bindingProgram(offer) : swapProgramBinding(offer, pinned?.serverPubKey ?? client.serverKey);
|
|
1607
|
+
const funded = isOfferBinding(offer) ? pinned?.pkScript : offer.swapPkScript;
|
|
1245
1608
|
const rebuilt = compileSwapBinding(binding);
|
|
1246
|
-
if (hex2.encode(rebuilt.pkScript) !== hex2.encode(
|
|
1609
|
+
if (funded && hex2.encode(rebuilt.pkScript) !== hex2.encode(funded)) {
|
|
1247
1610
|
throw new Error(
|
|
1248
1611
|
"rebuilt covenant does not match the offer's swapPkScript \u2014 the server signing key has likely rotated since funding; pass swapAddress (the funded address) to pin the original key"
|
|
1249
1612
|
);
|
|
@@ -2373,7 +2736,7 @@ var requestVersionedQuote = async (transport, request, advertised) => {
|
|
|
2373
2736
|
const version = selected ?? ASSET_SWAP_BASELINE;
|
|
2374
2737
|
if (!advertised.includes(version)) {
|
|
2375
2738
|
throw new Error(
|
|
2376
|
-
`solver chose contract version ${version}, not one of ${advertised.join(", ")}`
|
|
2739
|
+
selected === void 0 ? `solver negotiated no contract version; advertised ${advertised.join(", ")}` : `solver chose contract version ${version}, not one of ${advertised.join(", ")}`
|
|
2377
2740
|
);
|
|
2378
2741
|
}
|
|
2379
2742
|
return { quote, rfqId: sent.rfq_id, contractVersion: assetSwapContractVersion(version) };
|
|
@@ -2729,7 +3092,6 @@ async function requestArkadeSwap(wallet, transport, params) {
|
|
|
2729
3092
|
params.offerAsset ? arkadeAssetLeg(params.offerAsset) : ARKADE_BTC,
|
|
2730
3093
|
params.wantAsset ? arkadeAssetLeg(params.wantAsset) : ARKADE_BTC
|
|
2731
3094
|
);
|
|
2732
|
-
const contractVersions = [...params.contractVersions ?? ASSET_SWAP_CONTRACT_VERSIONS];
|
|
2733
3095
|
const { quote, rfqId, contractVersion } = await requestVersionedQuote(
|
|
2734
3096
|
transport,
|
|
2735
3097
|
arkadeSwapRequest({
|
|
@@ -2740,13 +3102,17 @@ async function requestArkadeSwap(wallet, transport, params) {
|
|
|
2740
3102
|
amountSide,
|
|
2741
3103
|
makerPkScript,
|
|
2742
3104
|
makerPublicKey,
|
|
2743
|
-
contractVersions
|
|
3105
|
+
contractVersions: ASSET_SWAP_CONTRACT_VERSIONS
|
|
2744
3106
|
}),
|
|
2745
|
-
|
|
3107
|
+
ASSET_SWAP_CONTRACT_VERSIONS
|
|
2746
3108
|
);
|
|
2747
3109
|
if (quote.pair !== pair) {
|
|
2748
3110
|
throw new Error(`solver quoted ${JSON.stringify(quote.pair)}, not the requested ${pair}`);
|
|
2749
3111
|
}
|
|
3112
|
+
const taker = contractVersion === ASSET_SWAP_V4 ? (await import("./verify-ENO36VPK.js")).verifyTaker({
|
|
3113
|
+
attested: transport.attestedResponder,
|
|
3114
|
+
solverPubkey: quote.solver_pubkey
|
|
3115
|
+
}) : void 0;
|
|
2750
3116
|
assertArkadeFundable({ quote, ...params.now !== void 0 ? { now: params.now } : {} });
|
|
2751
3117
|
const terms = offerTermsFromQuote(quote, {
|
|
2752
3118
|
...params.offerAsset !== void 0 ? { offerAsset: params.offerAsset } : {},
|
|
@@ -2784,7 +3150,8 @@ async function requestArkadeSwap(wallet, transport, params) {
|
|
|
2784
3150
|
...terms.wantAsset !== void 0 ? { wantAsset: terms.wantAsset } : {},
|
|
2785
3151
|
...terms.offerAsset !== void 0 ? { offerAsset: terms.offerAsset } : {},
|
|
2786
3152
|
...params.emulatorPubkey !== void 0 ? { emulatorPubkey: params.emulatorPubkey } : {},
|
|
2787
|
-
contractVersion
|
|
3153
|
+
contractVersion,
|
|
3154
|
+
...taker === void 0 ? {} : { taker }
|
|
2788
3155
|
});
|
|
2789
3156
|
verifyOfferAddress(quote, offer);
|
|
2790
3157
|
const fundAmount = BigInt(quote.from_amount);
|
|
@@ -3291,6 +3658,7 @@ export {
|
|
|
3291
3658
|
swapPrograms,
|
|
3292
3659
|
legacySwapPrograms,
|
|
3293
3660
|
ASSET_SWAP_CONTRACT_VERSIONS,
|
|
3661
|
+
ASSET_SWAP_DERIVABLE_VERSIONS,
|
|
3294
3662
|
assetSwapContractVersion,
|
|
3295
3663
|
RETIRABLE,
|
|
3296
3664
|
LOCKUP_RETIRABLE,
|
|
@@ -3313,6 +3681,12 @@ export {
|
|
|
3313
3681
|
rfqClaimDestinationOf,
|
|
3314
3682
|
withExitClosure,
|
|
3315
3683
|
offerContract,
|
|
3684
|
+
offerOf,
|
|
3685
|
+
bindingProgram,
|
|
3686
|
+
bindingFromOffer,
|
|
3687
|
+
offerFromBinding,
|
|
3688
|
+
recordOfferBinding,
|
|
3689
|
+
storedOffer,
|
|
3316
3690
|
OFFER_PACKET_TYPE,
|
|
3317
3691
|
encodeOffer,
|
|
3318
3692
|
decodeOffer,
|