@rozoai/checkout 0.1.4 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rozoai/checkout",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "Pay an OpenRouter Coinbase Payment Link with BTC Lightning, or USDT/USDC on Solana, BNB Chain, Ethereum, Polygon, Base or Stellar.",
6
6
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "devDependencies": {
50
50
  "@solana/spl-token": "^0.4.9",
51
51
  "@solana/web3.js": "^1.95.0",
52
- "esbuild": "^0.24.0",
52
+ "esbuild": "^0.28.2",
53
53
  "viem": "^2.21.0"
54
54
  }
55
55
  }
@@ -17,11 +17,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
17
17
  if (typeof require !== "undefined") return require.apply(this, arguments);
18
18
  throw Error('Dynamic require of "' + x + '" is not supported');
19
19
  });
20
- var __esm = (fn, res) => function __init() {
21
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
20
+ var __esm = (fn, res, err) => function __init() {
21
+ if (err) throw err[0];
22
+ try {
23
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
24
+ } catch (e) {
25
+ throw err = [e], e;
26
+ }
22
27
  };
23
28
  var __commonJS = (cb, mod3) => function __require2() {
24
- return mod3 || (0, cb[__getOwnPropNames(cb)[0]])((mod3 = { exports: {} }).exports, mod3), mod3.exports;
29
+ try {
30
+ return mod3 || (0, cb[__getOwnPropNames(cb)[0]])((mod3 = { exports: {} }).exports, mod3), mod3.exports;
31
+ } catch (e) {
32
+ throw mod3 = 0, e;
33
+ }
25
34
  };
26
35
  var __export = (target, all) => {
27
36
  for (var name in all)
@@ -13580,7 +13589,7 @@ var require_bn = __commonJS({
13580
13589
  };
13581
13590
  if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") {
13582
13591
  try {
13583
- BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
13592
+ BN.prototype[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = inspect;
13584
13593
  } catch (e) {
13585
13594
  BN.prototype.inspect = inspect;
13586
13595
  }
@@ -16758,18 +16767,18 @@ var require_encoding_lib = __commonJS({
16758
16767
  var require_lib = __commonJS({
16759
16768
  "node_modules/borsh/lib/index.js"(exports) {
16760
16769
  "use strict";
16761
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
16770
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
16762
16771
  if (k2 === void 0) k2 = k;
16763
16772
  Object.defineProperty(o, k2, { enumerable: true, get: function() {
16764
16773
  return m[k];
16765
16774
  } });
16766
- } : function(o, m, k, k2) {
16775
+ }) : (function(o, m, k, k2) {
16767
16776
  if (k2 === void 0) k2 = k;
16768
16777
  o[k2] = m[k];
16769
- });
16770
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
16778
+ }));
16779
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
16771
16780
  Object.defineProperty(o, "default", { enumerable: true, value: v });
16772
- } : function(o, v) {
16781
+ }) : function(o, v) {
16773
16782
  o["default"] = v;
16774
16783
  });
16775
16784
  var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
@@ -17316,7 +17325,7 @@ var require_Layout = __commonJS({
17316
17325
  }
17317
17326
  Class.layout_ = layout;
17318
17327
  layout.boundConstructor_ = Class;
17319
- layout.makeDestinationObject = () => new Class();
17328
+ layout.makeDestinationObject = (() => new Class());
17320
17329
  Object.defineProperty(Class.prototype, "encode", {
17321
17330
  value(b, offset) {
17322
17331
  return layout.encode(this, b, offset);
@@ -18493,47 +18502,47 @@ var require_Layout = __commonJS({
18493
18502
  }
18494
18503
  };
18495
18504
  exports.Constant = Constant;
18496
- exports.greedy = (elementSpan, property) => new GreedyCount(elementSpan, property);
18497
- exports.offset = (layout, offset, property) => new OffsetLayout(layout, offset, property);
18498
- exports.u8 = (property) => new UInt(1, property);
18499
- exports.u16 = (property) => new UInt(2, property);
18500
- exports.u24 = (property) => new UInt(3, property);
18501
- exports.u32 = (property) => new UInt(4, property);
18502
- exports.u40 = (property) => new UInt(5, property);
18503
- exports.u48 = (property) => new UInt(6, property);
18504
- exports.nu64 = (property) => new NearUInt64(property);
18505
- exports.u16be = (property) => new UIntBE(2, property);
18506
- exports.u24be = (property) => new UIntBE(3, property);
18507
- exports.u32be = (property) => new UIntBE(4, property);
18508
- exports.u40be = (property) => new UIntBE(5, property);
18509
- exports.u48be = (property) => new UIntBE(6, property);
18510
- exports.nu64be = (property) => new NearUInt64BE(property);
18511
- exports.s8 = (property) => new Int(1, property);
18512
- exports.s16 = (property) => new Int(2, property);
18513
- exports.s24 = (property) => new Int(3, property);
18514
- exports.s32 = (property) => new Int(4, property);
18515
- exports.s40 = (property) => new Int(5, property);
18516
- exports.s48 = (property) => new Int(6, property);
18517
- exports.ns64 = (property) => new NearInt64(property);
18518
- exports.s16be = (property) => new IntBE(2, property);
18519
- exports.s24be = (property) => new IntBE(3, property);
18520
- exports.s32be = (property) => new IntBE(4, property);
18521
- exports.s40be = (property) => new IntBE(5, property);
18522
- exports.s48be = (property) => new IntBE(6, property);
18523
- exports.ns64be = (property) => new NearInt64BE(property);
18524
- exports.f32 = (property) => new Float(property);
18525
- exports.f32be = (property) => new FloatBE(property);
18526
- exports.f64 = (property) => new Double(property);
18527
- exports.f64be = (property) => new DoubleBE(property);
18528
- exports.struct = (fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes);
18529
- exports.bits = (word, msb, property) => new BitStructure(word, msb, property);
18530
- exports.seq = (elementLayout, count, property) => new Sequence(elementLayout, count, property);
18531
- exports.union = (discr, defaultLayout, property) => new Union(discr, defaultLayout, property);
18532
- exports.unionLayoutDiscriminator = (layout, property) => new UnionLayoutDiscriminator(layout, property);
18533
- exports.blob = (length, property) => new Blob2(length, property);
18534
- exports.cstr = (property) => new CString(property);
18535
- exports.utf8 = (maxSpan, property) => new UTF8(maxSpan, property);
18536
- exports.constant = (value, property) => new Constant(value, property);
18505
+ exports.greedy = ((elementSpan, property) => new GreedyCount(elementSpan, property));
18506
+ exports.offset = ((layout, offset, property) => new OffsetLayout(layout, offset, property));
18507
+ exports.u8 = ((property) => new UInt(1, property));
18508
+ exports.u16 = ((property) => new UInt(2, property));
18509
+ exports.u24 = ((property) => new UInt(3, property));
18510
+ exports.u32 = ((property) => new UInt(4, property));
18511
+ exports.u40 = ((property) => new UInt(5, property));
18512
+ exports.u48 = ((property) => new UInt(6, property));
18513
+ exports.nu64 = ((property) => new NearUInt64(property));
18514
+ exports.u16be = ((property) => new UIntBE(2, property));
18515
+ exports.u24be = ((property) => new UIntBE(3, property));
18516
+ exports.u32be = ((property) => new UIntBE(4, property));
18517
+ exports.u40be = ((property) => new UIntBE(5, property));
18518
+ exports.u48be = ((property) => new UIntBE(6, property));
18519
+ exports.nu64be = ((property) => new NearUInt64BE(property));
18520
+ exports.s8 = ((property) => new Int(1, property));
18521
+ exports.s16 = ((property) => new Int(2, property));
18522
+ exports.s24 = ((property) => new Int(3, property));
18523
+ exports.s32 = ((property) => new Int(4, property));
18524
+ exports.s40 = ((property) => new Int(5, property));
18525
+ exports.s48 = ((property) => new Int(6, property));
18526
+ exports.ns64 = ((property) => new NearInt64(property));
18527
+ exports.s16be = ((property) => new IntBE(2, property));
18528
+ exports.s24be = ((property) => new IntBE(3, property));
18529
+ exports.s32be = ((property) => new IntBE(4, property));
18530
+ exports.s40be = ((property) => new IntBE(5, property));
18531
+ exports.s48be = ((property) => new IntBE(6, property));
18532
+ exports.ns64be = ((property) => new NearInt64BE(property));
18533
+ exports.f32 = ((property) => new Float(property));
18534
+ exports.f32be = ((property) => new FloatBE(property));
18535
+ exports.f64 = ((property) => new Double(property));
18536
+ exports.f64be = ((property) => new DoubleBE(property));
18537
+ exports.struct = ((fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes));
18538
+ exports.bits = ((word, msb, property) => new BitStructure(word, msb, property));
18539
+ exports.seq = ((elementLayout, count, property) => new Sequence(elementLayout, count, property));
18540
+ exports.union = ((discr, defaultLayout, property) => new Union(discr, defaultLayout, property));
18541
+ exports.unionLayoutDiscriminator = ((layout, property) => new UnionLayoutDiscriminator(layout, property));
18542
+ exports.blob = ((length, property) => new Blob2(length, property));
18543
+ exports.cstr = ((property) => new CString(property));
18544
+ exports.utf8 = ((maxSpan, property) => new UTF8(maxSpan, property));
18545
+ exports.constant = ((value, property) => new Constant(value, property));
18537
18546
  }
18538
18547
  });
18539
18548
 
@@ -20455,7 +20464,7 @@ var require_dist = __commonJS({
20455
20464
  "node_modules/superstruct/dist/index.cjs"(exports, module) {
20456
20465
  (function(global2, factory) {
20457
20466
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.Superstruct = {}));
20458
- })(exports, function(exports2) {
20467
+ })(exports, (function(exports2) {
20459
20468
  "use strict";
20460
20469
  class StructError extends TypeError {
20461
20470
  constructor(failure, failures) {
@@ -21256,7 +21265,7 @@ var require_dist = __commonJS({
21256
21265
  exports2.union = union;
21257
21266
  exports2.unknown = unknown;
21258
21267
  exports2.validate = validate8;
21259
- });
21268
+ }));
21260
21269
  }
21261
21270
  });
21262
21271
 
@@ -21907,8 +21916,8 @@ var require_utils3 = __commonJS({
21907
21916
  Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));
21908
21917
  }
21909
21918
  };
21910
- module.exports.wrapperSymbol = Symbol("wrapper");
21911
- module.exports.implSymbol = Symbol("impl");
21919
+ module.exports.wrapperSymbol = /* @__PURE__ */ Symbol("wrapper");
21920
+ module.exports.implSymbol = /* @__PURE__ */ Symbol("impl");
21912
21921
  module.exports.wrapperForImpl = function(impl) {
21913
21922
  return impl[module.exports.wrapperSymbol];
21914
21923
  };
@@ -22101,7 +22110,7 @@ var require_url_state_machine = __commonJS({
22101
22110
  ws: 80,
22102
22111
  wss: 443
22103
22112
  };
22104
- var failure = Symbol("failure");
22113
+ var failure = /* @__PURE__ */ Symbol("failure");
22105
22114
  function countSymbols(str) {
22106
22115
  return punycode.ucs2.decode(str).length;
22107
22116
  }
@@ -23528,8 +23537,8 @@ var require_lib3 = __commonJS({
23528
23537
  var https = _interopDefault(__require("https"));
23529
23538
  var zlib = _interopDefault(__require("zlib"));
23530
23539
  var Readable = Stream.Readable;
23531
- var BUFFER = Symbol("buffer");
23532
- var TYPE = Symbol("type");
23540
+ var BUFFER = /* @__PURE__ */ Symbol("buffer");
23541
+ var TYPE = /* @__PURE__ */ Symbol("type");
23533
23542
  var Blob2 = class _Blob {
23534
23543
  constructor() {
23535
23544
  this[TYPE] = "";
@@ -23644,7 +23653,7 @@ var require_lib3 = __commonJS({
23644
23653
  convert = __require("encoding").convert;
23645
23654
  } catch (e) {
23646
23655
  }
23647
- var INTERNALS = Symbol("Body internals");
23656
+ var INTERNALS = /* @__PURE__ */ Symbol("Body internals");
23648
23657
  var PassThrough = Stream.PassThrough;
23649
23658
  function Body(body) {
23650
23659
  var _this = this;
@@ -23984,7 +23993,7 @@ var require_lib3 = __commonJS({
23984
23993
  }
23985
23994
  return void 0;
23986
23995
  }
23987
- var MAP = Symbol("map");
23996
+ var MAP = /* @__PURE__ */ Symbol("map");
23988
23997
  var Headers = class _Headers {
23989
23998
  /**
23990
23999
  * Headers class
@@ -24192,7 +24201,7 @@ var require_lib3 = __commonJS({
24192
24201
  return [k.toLowerCase(), headers[MAP][k].join(", ")];
24193
24202
  });
24194
24203
  }
24195
- var INTERNAL = Symbol("internal");
24204
+ var INTERNAL = /* @__PURE__ */ Symbol("internal");
24196
24205
  function createHeadersIterator(target, kind) {
24197
24206
  const iterator = Object.create(HeadersIteratorPrototype);
24198
24207
  iterator[INTERNAL] = {
@@ -24261,7 +24270,7 @@ var require_lib3 = __commonJS({
24261
24270
  }
24262
24271
  return headers;
24263
24272
  }
24264
- var INTERNALS$1 = Symbol("Response internals");
24273
+ var INTERNALS$1 = /* @__PURE__ */ Symbol("Response internals");
24265
24274
  var STATUS_CODES = http2.STATUS_CODES;
24266
24275
  var Response = class _Response {
24267
24276
  constructor() {
@@ -24337,7 +24346,7 @@ var require_lib3 = __commonJS({
24337
24346
  enumerable: false,
24338
24347
  configurable: true
24339
24348
  });
24340
- var INTERNALS$2 = Symbol("Request internals");
24349
+ var INTERNALS$2 = /* @__PURE__ */ Symbol("Request internals");
24341
24350
  var URL4 = Url.URL || whatwgUrl.URL;
24342
24351
  var parse_url = Url.parse;
24343
24352
  var format_url = Url.format;
@@ -24765,10 +24774,10 @@ var require_constants = __commonJS({
24765
24774
  EMPTY_BUFFER: Buffer.alloc(0),
24766
24775
  GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
24767
24776
  hasBlob,
24768
- kForOnEventAttribute: Symbol("kIsForOnEventAttribute"),
24769
- kListener: Symbol("kListener"),
24770
- kStatusCode: Symbol("status-code"),
24771
- kWebSocket: Symbol("websocket"),
24777
+ kForOnEventAttribute: /* @__PURE__ */ Symbol("kIsForOnEventAttribute"),
24778
+ kListener: /* @__PURE__ */ Symbol("kListener"),
24779
+ kStatusCode: /* @__PURE__ */ Symbol("status-code"),
24780
+ kWebSocket: /* @__PURE__ */ Symbol("websocket"),
24772
24781
  NOOP: () => {
24773
24782
  }
24774
24783
  };
@@ -25066,8 +25075,8 @@ var require_buffer_util = __commonJS({
25066
25075
  var require_limiter = __commonJS({
25067
25076
  "node_modules/rpc-websockets/node_modules/ws/lib/limiter.js"(exports, module) {
25068
25077
  "use strict";
25069
- var kDone = Symbol("kDone");
25070
- var kRun = Symbol("kRun");
25078
+ var kDone = /* @__PURE__ */ Symbol("kDone");
25079
+ var kRun = /* @__PURE__ */ Symbol("kRun");
25071
25080
  var Limiter = class {
25072
25081
  /**
25073
25082
  * Creates a new `Limiter`.
@@ -25122,11 +25131,11 @@ var require_permessage_deflate = __commonJS({
25122
25131
  var { kStatusCode } = require_constants();
25123
25132
  var FastBuffer = Buffer[Symbol.species];
25124
25133
  var TRAILER = Buffer.from([0, 0, 255, 255]);
25125
- var kPerMessageDeflate = Symbol("permessage-deflate");
25126
- var kTotalLength = Symbol("total-length");
25127
- var kCallback = Symbol("callback");
25128
- var kBuffers = Symbol("buffers");
25129
- var kError = Symbol("error");
25134
+ var kPerMessageDeflate = /* @__PURE__ */ Symbol("permessage-deflate");
25135
+ var kTotalLength = /* @__PURE__ */ Symbol("total-length");
25136
+ var kCallback = /* @__PURE__ */ Symbol("callback");
25137
+ var kBuffers = /* @__PURE__ */ Symbol("buffers");
25138
+ var kError = /* @__PURE__ */ Symbol("error");
25130
25139
  var zlibLimiter;
25131
25140
  var PerMessageDeflate = class {
25132
25141
  /**
@@ -26381,7 +26390,7 @@ var require_sender = __commonJS({
26381
26390
  var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
26382
26391
  var { isBlob, isValidStatusCode } = require_validation();
26383
26392
  var { mask: applyMask, toBuffer } = require_buffer_util();
26384
- var kByteLength = Symbol("kByteLength");
26393
+ var kByteLength = /* @__PURE__ */ Symbol("kByteLength");
26385
26394
  var maskBuffer = Buffer.alloc(4);
26386
26395
  var RANDOM_POOL_SIZE = 8 * 1024;
26387
26396
  var randomPool;
@@ -26866,14 +26875,14 @@ var require_event_target = __commonJS({
26866
26875
  "node_modules/rpc-websockets/node_modules/ws/lib/event-target.js"(exports, module) {
26867
26876
  "use strict";
26868
26877
  var { kForOnEventAttribute, kListener } = require_constants();
26869
- var kCode = Symbol("kCode");
26870
- var kData = Symbol("kData");
26871
- var kError = Symbol("kError");
26872
- var kMessage = Symbol("kMessage");
26873
- var kReason = Symbol("kReason");
26874
- var kTarget = Symbol("kTarget");
26875
- var kType = Symbol("kType");
26876
- var kWasClean = Symbol("kWasClean");
26878
+ var kCode = /* @__PURE__ */ Symbol("kCode");
26879
+ var kData = /* @__PURE__ */ Symbol("kData");
26880
+ var kError = /* @__PURE__ */ Symbol("kError");
26881
+ var kMessage = /* @__PURE__ */ Symbol("kMessage");
26882
+ var kReason = /* @__PURE__ */ Symbol("kReason");
26883
+ var kTarget = /* @__PURE__ */ Symbol("kTarget");
26884
+ var kType = /* @__PURE__ */ Symbol("kType");
26885
+ var kWasClean = /* @__PURE__ */ Symbol("kWasClean");
26877
26886
  var Event = class {
26878
26887
  /**
26879
26888
  * Create a new `Event`.
@@ -27275,7 +27284,7 @@ var require_websocket = __commonJS({
27275
27284
  } = require_event_target();
27276
27285
  var { format: format2, parse: parse3 } = require_extension();
27277
27286
  var { toBuffer } = require_buffer_util();
27278
- var kAborted = Symbol("kAborted");
27287
+ var kAborted = /* @__PURE__ */ Symbol("kAborted");
27279
27288
  var protocolVersions = [8, 13];
27280
27289
  var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
27281
27290
  var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
@@ -33014,13 +33023,13 @@ var require_index_cjs = __commonJS({
33014
33023
  }
33015
33024
  }
33016
33025
  };
33017
- var TransactionStatus = /* @__PURE__ */ function(TransactionStatus2) {
33026
+ var TransactionStatus = /* @__PURE__ */ (function(TransactionStatus2) {
33018
33027
  TransactionStatus2[TransactionStatus2["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED";
33019
33028
  TransactionStatus2[TransactionStatus2["PROCESSED"] = 1] = "PROCESSED";
33020
33029
  TransactionStatus2[TransactionStatus2["TIMED_OUT"] = 2] = "TIMED_OUT";
33021
33030
  TransactionStatus2[TransactionStatus2["NONCE_INVALID"] = 3] = "NONCE_INVALID";
33022
33031
  return TransactionStatus2;
33023
- }({});
33032
+ })({});
33024
33033
  var DEFAULT_SIGNATURE = buffer2.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
33025
33034
  var TransactionInstruction3 = class {
33026
33035
  constructor(opts) {
@@ -34996,15 +35005,15 @@ Message: ${transactionMessage}.
34996
35005
  hasRequiredConstants = 1;
34997
35006
  constants = {
34998
35007
  // agent
34999
- CURRENT_ID: Symbol("agentkeepalive#currentId"),
35000
- CREATE_ID: Symbol("agentkeepalive#createId"),
35001
- INIT_SOCKET: Symbol("agentkeepalive#initSocket"),
35002
- CREATE_HTTPS_CONNECTION: Symbol("agentkeepalive#createHttpsConnection"),
35008
+ CURRENT_ID: /* @__PURE__ */ Symbol("agentkeepalive#currentId"),
35009
+ CREATE_ID: /* @__PURE__ */ Symbol("agentkeepalive#createId"),
35010
+ INIT_SOCKET: /* @__PURE__ */ Symbol("agentkeepalive#initSocket"),
35011
+ CREATE_HTTPS_CONNECTION: /* @__PURE__ */ Symbol("agentkeepalive#createHttpsConnection"),
35003
35012
  // socket
35004
- SOCKET_CREATED_TIME: Symbol("agentkeepalive#socketCreatedTime"),
35005
- SOCKET_NAME: Symbol("agentkeepalive#socketName"),
35006
- SOCKET_REQUEST_COUNT: Symbol("agentkeepalive#socketRequestCount"),
35007
- SOCKET_REQUEST_FINISHED_COUNT: Symbol("agentkeepalive#socketRequestFinishedCount")
35013
+ SOCKET_CREATED_TIME: /* @__PURE__ */ Symbol("agentkeepalive#socketCreatedTime"),
35014
+ SOCKET_NAME: /* @__PURE__ */ Symbol("agentkeepalive#socketName"),
35015
+ SOCKET_REQUEST_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestCount"),
35016
+ SOCKET_REQUEST_FINISHED_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestFinishedCount")
35008
35017
  };
35009
35018
  return constants;
35010
35019
  }
@@ -42579,6 +42588,143 @@ function maskMemo(memo) {
42579
42588
  return `${s.slice(0, 4)}...${s.slice(-3)}`;
42580
42589
  }
42581
42590
 
42591
+ // scripts/src/lib/expiry.mjs
42592
+ var MINUTE = 6e4;
42593
+ var MARGINS_MS = {
42594
+ 1: 10 * MINUTE,
42595
+ 56: 10 * MINUTE,
42596
+ 137: 10 * MINUTE,
42597
+ 8453: 10 * MINUTE,
42598
+ 900: 5 * MINUTE,
42599
+ 1500: 10 * MINUTE,
42600
+ lightning: 10 * MINUTE
42601
+ };
42602
+ var BOLT11_MIN_VALIDITY_MS = 10 * MINUTE;
42603
+ var DEFAULT_MARGIN_MS = 10 * MINUTE;
42604
+ function formatRemaining(ms) {
42605
+ if (!Number.isFinite(ms)) return "unknown";
42606
+ if (ms <= 0) return "expired";
42607
+ const totalMinutes = Math.floor(ms / 6e4);
42608
+ if (totalMinutes < 1) return `${Math.floor(ms / 1e3)}s`;
42609
+ if (totalMinutes < 60) return `${totalMinutes}m`;
42610
+ const h = Math.floor(totalMinutes / 60);
42611
+ const m = totalMinutes % 60;
42612
+ return m ? `${h}h ${m}m` : `${h}h`;
42613
+ }
42614
+ function formatDeadline(iso, { now = Date.now(), locale, timeZone } = {}) {
42615
+ if (!iso) return null;
42616
+ const at = new Date(iso);
42617
+ if (Number.isNaN(at.getTime())) return null;
42618
+ const msLeft = at.getTime() - now;
42619
+ if (msLeft <= 0) return "expired";
42620
+ const minutes = Math.round(msLeft / 6e4);
42621
+ const human = minutes < 1 ? "less than a minute" : minutes < 60 ? `about ${minutes} minute${minutes === 1 ? "" : "s"}` : `about ${Math.floor(minutes / 60)}h ${minutes % 60}m`;
42622
+ const clock = at.toLocaleTimeString(locale, {
42623
+ hour: "numeric",
42624
+ minute: "2-digit",
42625
+ ...timeZone ? { timeZone } : {}
42626
+ });
42627
+ return `in ${human}, at ${clock} local time`;
42628
+ }
42629
+ function marginFor(chainId) {
42630
+ const key = String(chainId);
42631
+ return MARGINS_MS[key] ?? MARGINS_MS[chainId] ?? DEFAULT_MARGIN_MS;
42632
+ }
42633
+ function parseDeadline(value) {
42634
+ if (value === null || value === void 0 || value === "") return null;
42635
+ if (typeof value === "number" && Number.isFinite(value)) {
42636
+ return value < 1e12 ? Math.round(value * 1e3) : Math.round(value);
42637
+ }
42638
+ const s = String(value).trim();
42639
+ if (/^\d+$/.test(s)) {
42640
+ const n = Number(s);
42641
+ return n < 1e12 ? n * 1e3 : n;
42642
+ }
42643
+ const t = Date.parse(s);
42644
+ return Number.isFinite(t) ? t : null;
42645
+ }
42646
+ function checkExpiry({
42647
+ now,
42648
+ chainId,
42649
+ intentExpiresAt,
42650
+ coinbaseExpiry,
42651
+ bolt11ExpiresAt = void 0
42652
+ }) {
42653
+ const marginMs = marginFor(chainId);
42654
+ const intentMs = parseDeadline(intentExpiresAt);
42655
+ const coinbaseMs = parseDeadline(coinbaseExpiry);
42656
+ const bolt11Ms = bolt11ExpiresAt === void 0 ? void 0 : parseDeadline(bolt11ExpiresAt);
42657
+ const deadlines = { intentMs, coinbaseMs, bolt11Ms: bolt11Ms ?? null };
42658
+ const base = {
42659
+ marginMs,
42660
+ effectiveDeadlineMs: null,
42661
+ msRemaining: null,
42662
+ msOfSlack: null,
42663
+ deadlines
42664
+ };
42665
+ if (intentMs === null) {
42666
+ return {
42667
+ ...base,
42668
+ ok: false,
42669
+ code: "EXPIRY_UNPARSABLE",
42670
+ reason: "Intent expiresAt is missing or unparsable."
42671
+ };
42672
+ }
42673
+ if (coinbaseMs === null) {
42674
+ return {
42675
+ ...base,
42676
+ ok: false,
42677
+ code: "EXPIRY_UNPARSABLE",
42678
+ reason: "Coinbase preApprovalExpiry is missing or unparsable."
42679
+ };
42680
+ }
42681
+ const effective = Math.min(intentMs, coinbaseMs);
42682
+ const msRemaining = effective - now;
42683
+ const msOfSlack = msRemaining - marginMs;
42684
+ const withDeadline = {
42685
+ ...base,
42686
+ effectiveDeadlineMs: effective,
42687
+ msRemaining,
42688
+ msOfSlack
42689
+ };
42690
+ if (msRemaining <= 0) {
42691
+ return {
42692
+ ...withDeadline,
42693
+ ok: false,
42694
+ code: "EXPIRED",
42695
+ reason: "The order or the Coinbase link has already expired."
42696
+ };
42697
+ }
42698
+ if (msOfSlack <= 0) {
42699
+ return {
42700
+ ...withDeadline,
42701
+ ok: false,
42702
+ code: "EXPIRY_MARGIN",
42703
+ reason: `Only ${Math.floor(msRemaining / 1e3)}s left before the earliest deadline; this chain needs a ${Math.floor(marginMs / 6e4)} min safety margin.`
42704
+ };
42705
+ }
42706
+ if (bolt11ExpiresAt !== void 0) {
42707
+ if (bolt11Ms === null) {
42708
+ return {
42709
+ ...withDeadline,
42710
+ ok: false,
42711
+ code: "EXPIRY_UNPARSABLE",
42712
+ reason: "BOLT11 invoice expiry is missing or unparsable."
42713
+ };
42714
+ }
42715
+ const bolt11Remaining = bolt11Ms - now;
42716
+ if (bolt11Remaining < BOLT11_MIN_VALIDITY_MS) {
42717
+ return {
42718
+ ...withDeadline,
42719
+ ok: false,
42720
+ code: "BOLT11_TOO_SHORT",
42721
+ reason: `BOLT11 invoice has ${Math.max(0, Math.floor(bolt11Remaining / 1e3))}s of validity left; at least 10 min is required. Request a fresh invoice.`
42722
+ };
42723
+ }
42724
+ }
42725
+ return { ...withDeadline, ok: true, code: null, reason: null };
42726
+ }
42727
+
42582
42728
  // scripts/src/lib/key-source.mjs
42583
42729
  import fs5 from "node:fs";
42584
42730
  import path5 from "node:path";
@@ -42665,7 +42811,7 @@ function createFilterRequestScope(client, { method }) {
42665
42811
  if (status === "success" && method === method_)
42666
42812
  requestMap[id] = transport.request;
42667
42813
  });
42668
- return (id) => requestMap[id] || client.request;
42814
+ return ((id) => requestMap[id] || client.request);
42669
42815
  }
42670
42816
 
42671
42817
  // node_modules/viem/_esm/actions/public/createContractEventFilter.js
@@ -44339,13 +44485,13 @@ function observe(observerId, callbacks, fn) {
44339
44485
  return unwatch;
44340
44486
  const emit2 = {};
44341
44487
  for (const key in callbacks) {
44342
- emit2[key] = (...args) => {
44488
+ emit2[key] = ((...args) => {
44343
44489
  const listeners2 = getListeners();
44344
44490
  if (listeners2.length === 0)
44345
44491
  return;
44346
44492
  for (const listener of listeners2)
44347
44493
  listener.fns[key]?.(...args);
44348
- };
44494
+ });
44349
44495
  }
44350
44496
  const cleanup = fn(emit2);
44351
44497
  if (typeof cleanup === "function")
@@ -54146,128 +54292,6 @@ function snapshotFromQuote(quote) {
54146
54292
  };
54147
54293
  }
54148
54294
 
54149
- // scripts/src/lib/expiry.mjs
54150
- var MINUTE = 6e4;
54151
- var MARGINS_MS = {
54152
- 1: 10 * MINUTE,
54153
- 56: 10 * MINUTE,
54154
- 137: 10 * MINUTE,
54155
- 8453: 10 * MINUTE,
54156
- 900: 5 * MINUTE,
54157
- 1500: 10 * MINUTE,
54158
- lightning: 10 * MINUTE
54159
- };
54160
- var BOLT11_MIN_VALIDITY_MS = 10 * MINUTE;
54161
- var DEFAULT_MARGIN_MS = 10 * MINUTE;
54162
- function formatRemaining(ms) {
54163
- if (!Number.isFinite(ms)) return "unknown";
54164
- if (ms <= 0) return "expired";
54165
- const totalMinutes = Math.floor(ms / 6e4);
54166
- if (totalMinutes < 1) return `${Math.floor(ms / 1e3)}s`;
54167
- if (totalMinutes < 60) return `${totalMinutes}m`;
54168
- const h = Math.floor(totalMinutes / 60);
54169
- const m = totalMinutes % 60;
54170
- return m ? `${h}h ${m}m` : `${h}h`;
54171
- }
54172
- function marginFor(chainId) {
54173
- const key = String(chainId);
54174
- return MARGINS_MS[key] ?? MARGINS_MS[chainId] ?? DEFAULT_MARGIN_MS;
54175
- }
54176
- function parseDeadline(value) {
54177
- if (value === null || value === void 0 || value === "") return null;
54178
- if (typeof value === "number" && Number.isFinite(value)) {
54179
- return value < 1e12 ? Math.round(value * 1e3) : Math.round(value);
54180
- }
54181
- const s = String(value).trim();
54182
- if (/^\d+$/.test(s)) {
54183
- const n = Number(s);
54184
- return n < 1e12 ? n * 1e3 : n;
54185
- }
54186
- const t = Date.parse(s);
54187
- return Number.isFinite(t) ? t : null;
54188
- }
54189
- function checkExpiry({
54190
- now,
54191
- chainId,
54192
- intentExpiresAt,
54193
- coinbaseExpiry,
54194
- bolt11ExpiresAt = void 0
54195
- }) {
54196
- const marginMs = marginFor(chainId);
54197
- const intentMs = parseDeadline(intentExpiresAt);
54198
- const coinbaseMs = parseDeadline(coinbaseExpiry);
54199
- const bolt11Ms = bolt11ExpiresAt === void 0 ? void 0 : parseDeadline(bolt11ExpiresAt);
54200
- const deadlines = { intentMs, coinbaseMs, bolt11Ms: bolt11Ms ?? null };
54201
- const base = {
54202
- marginMs,
54203
- effectiveDeadlineMs: null,
54204
- msRemaining: null,
54205
- msOfSlack: null,
54206
- deadlines
54207
- };
54208
- if (intentMs === null) {
54209
- return {
54210
- ...base,
54211
- ok: false,
54212
- code: "EXPIRY_UNPARSABLE",
54213
- reason: "Intent expiresAt is missing or unparsable."
54214
- };
54215
- }
54216
- if (coinbaseMs === null) {
54217
- return {
54218
- ...base,
54219
- ok: false,
54220
- code: "EXPIRY_UNPARSABLE",
54221
- reason: "Coinbase preApprovalExpiry is missing or unparsable."
54222
- };
54223
- }
54224
- const effective = Math.min(intentMs, coinbaseMs);
54225
- const msRemaining = effective - now;
54226
- const msOfSlack = msRemaining - marginMs;
54227
- const withDeadline = {
54228
- ...base,
54229
- effectiveDeadlineMs: effective,
54230
- msRemaining,
54231
- msOfSlack
54232
- };
54233
- if (msRemaining <= 0) {
54234
- return {
54235
- ...withDeadline,
54236
- ok: false,
54237
- code: "EXPIRED",
54238
- reason: "The order or the Coinbase link has already expired."
54239
- };
54240
- }
54241
- if (msOfSlack <= 0) {
54242
- return {
54243
- ...withDeadline,
54244
- ok: false,
54245
- code: "EXPIRY_MARGIN",
54246
- reason: `Only ${Math.floor(msRemaining / 1e3)}s left before the earliest deadline; this chain needs a ${Math.floor(marginMs / 6e4)} min safety margin.`
54247
- };
54248
- }
54249
- if (bolt11ExpiresAt !== void 0) {
54250
- if (bolt11Ms === null) {
54251
- return {
54252
- ...withDeadline,
54253
- ok: false,
54254
- code: "EXPIRY_UNPARSABLE",
54255
- reason: "BOLT11 invoice expiry is missing or unparsable."
54256
- };
54257
- }
54258
- const bolt11Remaining = bolt11Ms - now;
54259
- if (bolt11Remaining < BOLT11_MIN_VALIDITY_MS) {
54260
- return {
54261
- ...withDeadline,
54262
- ok: false,
54263
- code: "BOLT11_TOO_SHORT",
54264
- reason: `BOLT11 invoice has ${Math.max(0, Math.floor(bolt11Remaining / 1e3))}s of validity left; at least 10 min is required. Request a fresh invoice.`
54265
- };
54266
- }
54267
- }
54268
- return { ...withDeadline, ok: true, code: null, reason: null };
54269
- }
54270
-
54271
54295
  // scripts/src/lib/guards.mjs
54272
54296
  var UNPAID_STATUS = "payment_unpaid";
54273
54297
  function receiptSignal(source) {
@@ -56124,7 +56148,7 @@ function clone(configObject) {
56124
56148
  BigNumber2.minimum = BigNumber2.min = function() {
56125
56149
  return maxOrMin(arguments, 1);
56126
56150
  };
56127
- BigNumber2.random = function() {
56151
+ BigNumber2.random = (function() {
56128
56152
  var pow2_53 = 9007199254740992;
56129
56153
  var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
56130
56154
  return mathfloor(Math.random() * pow2_53);
@@ -56192,13 +56216,13 @@ function clone(configObject) {
56192
56216
  rand.c = c2;
56193
56217
  return rand;
56194
56218
  };
56195
- }();
56219
+ })();
56196
56220
  BigNumber2.sum = function() {
56197
56221
  var i = 1, args = arguments, sum = new BigNumber2(args[0]);
56198
56222
  for (; i < args.length; ) sum = sum.plus(args[i++]);
56199
56223
  return sum;
56200
56224
  };
56201
- convertBase = /* @__PURE__ */ function() {
56225
+ convertBase = /* @__PURE__ */ (function() {
56202
56226
  var decimal = "0123456789";
56203
56227
  function toBaseOut(str, baseIn, baseOut, alphabet) {
56204
56228
  var j, arr = [0], arrL, i = 0, len = str.length;
@@ -56271,8 +56295,8 @@ function clone(configObject) {
56271
56295
  }
56272
56296
  return str;
56273
56297
  };
56274
- }();
56275
- div = /* @__PURE__ */ function() {
56298
+ })();
56299
+ div = /* @__PURE__ */ (function() {
56276
56300
  function multiply(x, k, base) {
56277
56301
  var m, temp, xlo, xhi, carry2 = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
56278
56302
  for (x = x.slice(); i--; ) {
@@ -56413,7 +56437,7 @@ function clone(configObject) {
56413
56437
  }
56414
56438
  return q;
56415
56439
  };
56416
- }();
56440
+ })();
56417
56441
  function format2(n, i, rm, id) {
56418
56442
  var c0, e, ne, len, str;
56419
56443
  if (rm == null) rm = ROUNDING_MODE;
@@ -56472,7 +56496,7 @@ function clone(configObject) {
56472
56496
  }
56473
56497
  return n;
56474
56498
  }
56475
- parseNumeric = /* @__PURE__ */ function() {
56499
+ parseNumeric = /* @__PURE__ */ (function() {
56476
56500
  var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
56477
56501
  return function(x, str, isNum, b) {
56478
56502
  var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
@@ -56497,7 +56521,7 @@ function clone(configObject) {
56497
56521
  }
56498
56522
  x.c = x.e = null;
56499
56523
  };
56500
- }();
56524
+ })();
56501
56525
  function round(x, sd, rm, r) {
56502
56526
  var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
56503
56527
  if (xc) {
@@ -57124,7 +57148,7 @@ function clone(configObject) {
57124
57148
  };
57125
57149
  P._isBigNumber = true;
57126
57150
  P[Symbol.toStringTag] = "BigNumber";
57127
- P[Symbol.for("nodejs.util.inspect.custom")] = P.valueOf;
57151
+ P[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = P.valueOf;
57128
57152
  if (configObject != null) BigNumber2.set(configObject);
57129
57153
  return BigNumber2;
57130
57154
  }
@@ -58048,6 +58072,16 @@ async function cmdPay(opts) {
58048
58072
  }
58049
58073
  if (!result.ok && !opts.json) {
58050
58074
  out(` ${yellow(`Could not check balances (${result.reason}). Continuing.`)}`);
58075
+ } else if (result.ok && !opts.json) {
58076
+ const hit = (result.options ?? []).find(
58077
+ (o) => o.chainId === String(opts.source.chainId) && o.tokenSymbol === String(opts.source.tokenSymbol).toUpperCase()
58078
+ );
58079
+ const short = `${opts.payer.slice(0, 6)}\u2026${opts.payer.slice(-4)}`;
58080
+ if (hit?.balanceUsd != null) {
58081
+ out(` ${dim(`Payer ${short} holds about $${hit.balanceUsd} of ${opts.source.tokenSymbol} \u2014 enough for this invoice.`)}`);
58082
+ } else {
58083
+ out(` ${dim(`Payer ${short}: balance not reported for this coin, so it was not verified.`)}`);
58084
+ }
58051
58085
  }
58052
58086
  payer = { address: opts.payer, family };
58053
58087
  }
@@ -58090,10 +58124,12 @@ async function cmdPay(opts) {
58090
58124
  if (p.display?.hasMemo) {
58091
58125
  out(` Memo ${p.display.receiverMemoMasked} ${dim(`(${p.display.memoType})`)}`);
58092
58126
  }
58093
- out(` Expires in ${bold(p.expiry?.expiresIn ?? "?")} ${dim(`(${p.expiry?.effectiveDeadlineIso})`)}`);
58094
- if (p.reused) {
58095
- out(` ${dim(`Reusing the existing unpaid order ${p.rozoPaymentId} \u2014 nothing new was created.`)}`);
58096
- }
58127
+ const deadline = formatDeadline(p.expiry?.effectiveDeadlineIso);
58128
+ out(` Expires ${bold(deadline ?? `in ${p.expiry?.expiresIn ?? "?"}`)}`);
58129
+ out(` ${dim("After that this order cannot be used and a new one must be created.")}`);
58130
+ out(
58131
+ p.reused ? ` ${dim(`Reusing existing unpaid order ${p.rozoPaymentId} \u2014 nothing new was created.`)}` : ` ${dim(`Order created: ${p.rozoPaymentId}`)}`
58132
+ );
58097
58133
  out(` ${dim("An order you never fund simply expires and costs nothing.")}`);
58098
58134
  out();
58099
58135
  out(dim(` The amount you send includes bridge and network fees, so it is`));
@@ -58129,6 +58165,9 @@ async function cmdPay(opts) {
58129
58165
  return confirmed.exitCode;
58130
58166
  }
58131
58167
  const deposit = confirmed.payload.deposit;
58168
+ if (!opts.json) {
58169
+ out(` ${dim(`Confirming order ${rozoPaymentId} \u2014 no second order was created.`)}`);
58170
+ }
58132
58171
  if (opts.send) {
58133
58172
  const family = chainFamily(deposit.chainId);
58134
58173
  const sender = family === "evm" ? run4 : family === "solana" ? run5 : null;
@@ -7,8 +7,13 @@ const __filename = __rozoFileURLToPath(import.meta.url);
7
7
  const __dirname = __rozoDirname(__filename);
8
8
  var __defProp = Object.defineProperty;
9
9
  var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __esm = (fn, res) => function __init() {
11
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ var __esm = (fn, res, err) => function __init() {
11
+ if (err) throw err[0];
12
+ try {
13
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
+ } catch (e) {
15
+ throw err = [e], e;
16
+ }
12
17
  };
13
18
  var __export = (target, all) => {
14
19
  for (var name in all)
@@ -10390,7 +10395,7 @@ function createFilterRequestScope(client, { method }) {
10390
10395
  if (status === "success" && method === method_)
10391
10396
  requestMap[id] = transport.request;
10392
10397
  });
10393
- return (id) => requestMap[id] || client.request;
10398
+ return ((id) => requestMap[id] || client.request);
10394
10399
  }
10395
10400
 
10396
10401
  // node_modules/viem/_esm/actions/public/createContractEventFilter.js
@@ -12064,13 +12069,13 @@ function observe(observerId, callbacks, fn) {
12064
12069
  return unwatch;
12065
12070
  const emit2 = {};
12066
12071
  for (const key in callbacks) {
12067
- emit2[key] = (...args) => {
12072
+ emit2[key] = ((...args) => {
12068
12073
  const listeners2 = getListeners();
12069
12074
  if (listeners2.length === 0)
12070
12075
  return;
12071
12076
  for (const listener of listeners2)
12072
12077
  listener.fns[key]?.(...args);
12073
- };
12078
+ });
12074
12079
  }
12075
12080
  const cleanup = fn(emit2);
12076
12081
  if (typeof cleanup === "function")
@@ -17,11 +17,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
17
17
  if (typeof require !== "undefined") return require.apply(this, arguments);
18
18
  throw Error('Dynamic require of "' + x + '" is not supported');
19
19
  });
20
- var __esm = (fn, res) => function __init() {
21
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
20
+ var __esm = (fn, res, err) => function __init() {
21
+ if (err) throw err[0];
22
+ try {
23
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
24
+ } catch (e) {
25
+ throw err = [e], e;
26
+ }
22
27
  };
23
28
  var __commonJS = (cb, mod) => function __require2() {
24
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
29
+ try {
30
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
31
+ } catch (e) {
32
+ throw mod = 0, e;
33
+ }
25
34
  };
26
35
  var __export = (target, all) => {
27
36
  for (var name in all)
@@ -4298,7 +4307,7 @@ var require_bn = __commonJS({
4298
4307
  };
4299
4308
  if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") {
4300
4309
  try {
4301
- BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
4310
+ BN.prototype[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = inspect;
4302
4311
  } catch (e) {
4303
4312
  BN.prototype.inspect = inspect;
4304
4313
  }
@@ -7476,18 +7485,18 @@ var require_encoding_lib = __commonJS({
7476
7485
  var require_lib = __commonJS({
7477
7486
  "node_modules/borsh/lib/index.js"(exports) {
7478
7487
  "use strict";
7479
- var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
7488
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
7480
7489
  if (k2 === void 0) k2 = k;
7481
7490
  Object.defineProperty(o, k2, { enumerable: true, get: function() {
7482
7491
  return m[k];
7483
7492
  } });
7484
- } : function(o, m, k, k2) {
7493
+ }) : (function(o, m, k, k2) {
7485
7494
  if (k2 === void 0) k2 = k;
7486
7495
  o[k2] = m[k];
7487
- });
7488
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
7496
+ }));
7497
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
7489
7498
  Object.defineProperty(o, "default", { enumerable: true, value: v });
7490
- } : function(o, v) {
7499
+ }) : function(o, v) {
7491
7500
  o["default"] = v;
7492
7501
  });
7493
7502
  var __decorate = exports && exports.__decorate || function(decorators, target, key, desc) {
@@ -8034,7 +8043,7 @@ var require_Layout = __commonJS({
8034
8043
  }
8035
8044
  Class.layout_ = layout;
8036
8045
  layout.boundConstructor_ = Class;
8037
- layout.makeDestinationObject = () => new Class();
8046
+ layout.makeDestinationObject = (() => new Class());
8038
8047
  Object.defineProperty(Class.prototype, "encode", {
8039
8048
  value(b, offset) {
8040
8049
  return layout.encode(this, b, offset);
@@ -9211,47 +9220,47 @@ var require_Layout = __commonJS({
9211
9220
  }
9212
9221
  };
9213
9222
  exports.Constant = Constant;
9214
- exports.greedy = (elementSpan, property) => new GreedyCount(elementSpan, property);
9215
- exports.offset = (layout, offset, property) => new OffsetLayout(layout, offset, property);
9216
- exports.u8 = (property) => new UInt(1, property);
9217
- exports.u16 = (property) => new UInt(2, property);
9218
- exports.u24 = (property) => new UInt(3, property);
9219
- exports.u32 = (property) => new UInt(4, property);
9220
- exports.u40 = (property) => new UInt(5, property);
9221
- exports.u48 = (property) => new UInt(6, property);
9222
- exports.nu64 = (property) => new NearUInt64(property);
9223
- exports.u16be = (property) => new UIntBE(2, property);
9224
- exports.u24be = (property) => new UIntBE(3, property);
9225
- exports.u32be = (property) => new UIntBE(4, property);
9226
- exports.u40be = (property) => new UIntBE(5, property);
9227
- exports.u48be = (property) => new UIntBE(6, property);
9228
- exports.nu64be = (property) => new NearUInt64BE(property);
9229
- exports.s8 = (property) => new Int(1, property);
9230
- exports.s16 = (property) => new Int(2, property);
9231
- exports.s24 = (property) => new Int(3, property);
9232
- exports.s32 = (property) => new Int(4, property);
9233
- exports.s40 = (property) => new Int(5, property);
9234
- exports.s48 = (property) => new Int(6, property);
9235
- exports.ns64 = (property) => new NearInt64(property);
9236
- exports.s16be = (property) => new IntBE(2, property);
9237
- exports.s24be = (property) => new IntBE(3, property);
9238
- exports.s32be = (property) => new IntBE(4, property);
9239
- exports.s40be = (property) => new IntBE(5, property);
9240
- exports.s48be = (property) => new IntBE(6, property);
9241
- exports.ns64be = (property) => new NearInt64BE(property);
9242
- exports.f32 = (property) => new Float(property);
9243
- exports.f32be = (property) => new FloatBE(property);
9244
- exports.f64 = (property) => new Double(property);
9245
- exports.f64be = (property) => new DoubleBE(property);
9246
- exports.struct = (fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes);
9247
- exports.bits = (word, msb, property) => new BitStructure(word, msb, property);
9248
- exports.seq = (elementLayout, count, property) => new Sequence(elementLayout, count, property);
9249
- exports.union = (discr, defaultLayout, property) => new Union(discr, defaultLayout, property);
9250
- exports.unionLayoutDiscriminator = (layout, property) => new UnionLayoutDiscriminator(layout, property);
9251
- exports.blob = (length, property) => new Blob2(length, property);
9252
- exports.cstr = (property) => new CString(property);
9253
- exports.utf8 = (maxSpan, property) => new UTF8(maxSpan, property);
9254
- exports.constant = (value, property) => new Constant(value, property);
9223
+ exports.greedy = ((elementSpan, property) => new GreedyCount(elementSpan, property));
9224
+ exports.offset = ((layout, offset, property) => new OffsetLayout(layout, offset, property));
9225
+ exports.u8 = ((property) => new UInt(1, property));
9226
+ exports.u16 = ((property) => new UInt(2, property));
9227
+ exports.u24 = ((property) => new UInt(3, property));
9228
+ exports.u32 = ((property) => new UInt(4, property));
9229
+ exports.u40 = ((property) => new UInt(5, property));
9230
+ exports.u48 = ((property) => new UInt(6, property));
9231
+ exports.nu64 = ((property) => new NearUInt64(property));
9232
+ exports.u16be = ((property) => new UIntBE(2, property));
9233
+ exports.u24be = ((property) => new UIntBE(3, property));
9234
+ exports.u32be = ((property) => new UIntBE(4, property));
9235
+ exports.u40be = ((property) => new UIntBE(5, property));
9236
+ exports.u48be = ((property) => new UIntBE(6, property));
9237
+ exports.nu64be = ((property) => new NearUInt64BE(property));
9238
+ exports.s8 = ((property) => new Int(1, property));
9239
+ exports.s16 = ((property) => new Int(2, property));
9240
+ exports.s24 = ((property) => new Int(3, property));
9241
+ exports.s32 = ((property) => new Int(4, property));
9242
+ exports.s40 = ((property) => new Int(5, property));
9243
+ exports.s48 = ((property) => new Int(6, property));
9244
+ exports.ns64 = ((property) => new NearInt64(property));
9245
+ exports.s16be = ((property) => new IntBE(2, property));
9246
+ exports.s24be = ((property) => new IntBE(3, property));
9247
+ exports.s32be = ((property) => new IntBE(4, property));
9248
+ exports.s40be = ((property) => new IntBE(5, property));
9249
+ exports.s48be = ((property) => new IntBE(6, property));
9250
+ exports.ns64be = ((property) => new NearInt64BE(property));
9251
+ exports.f32 = ((property) => new Float(property));
9252
+ exports.f32be = ((property) => new FloatBE(property));
9253
+ exports.f64 = ((property) => new Double(property));
9254
+ exports.f64be = ((property) => new DoubleBE(property));
9255
+ exports.struct = ((fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes));
9256
+ exports.bits = ((word, msb, property) => new BitStructure(word, msb, property));
9257
+ exports.seq = ((elementLayout, count, property) => new Sequence(elementLayout, count, property));
9258
+ exports.union = ((discr, defaultLayout, property) => new Union(discr, defaultLayout, property));
9259
+ exports.unionLayoutDiscriminator = ((layout, property) => new UnionLayoutDiscriminator(layout, property));
9260
+ exports.blob = ((length, property) => new Blob2(length, property));
9261
+ exports.cstr = ((property) => new CString(property));
9262
+ exports.utf8 = ((maxSpan, property) => new UTF8(maxSpan, property));
9263
+ exports.constant = ((value, property) => new Constant(value, property));
9255
9264
  }
9256
9265
  });
9257
9266
 
@@ -11173,7 +11182,7 @@ var require_dist = __commonJS({
11173
11182
  "node_modules/superstruct/dist/index.cjs"(exports, module) {
11174
11183
  (function(global2, factory) {
11175
11184
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.Superstruct = {}));
11176
- })(exports, function(exports2) {
11185
+ })(exports, (function(exports2) {
11177
11186
  "use strict";
11178
11187
  class StructError extends TypeError {
11179
11188
  constructor(failure, failures) {
@@ -11974,7 +11983,7 @@ var require_dist = __commonJS({
11974
11983
  exports2.union = union;
11975
11984
  exports2.unknown = unknown;
11976
11985
  exports2.validate = validate3;
11977
- });
11986
+ }));
11978
11987
  }
11979
11988
  });
11980
11989
 
@@ -12625,8 +12634,8 @@ var require_utils3 = __commonJS({
12625
12634
  Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));
12626
12635
  }
12627
12636
  };
12628
- module.exports.wrapperSymbol = Symbol("wrapper");
12629
- module.exports.implSymbol = Symbol("impl");
12637
+ module.exports.wrapperSymbol = /* @__PURE__ */ Symbol("wrapper");
12638
+ module.exports.implSymbol = /* @__PURE__ */ Symbol("impl");
12630
12639
  module.exports.wrapperForImpl = function(impl) {
12631
12640
  return impl[module.exports.wrapperSymbol];
12632
12641
  };
@@ -12819,7 +12828,7 @@ var require_url_state_machine = __commonJS({
12819
12828
  ws: 80,
12820
12829
  wss: 443
12821
12830
  };
12822
- var failure = Symbol("failure");
12831
+ var failure = /* @__PURE__ */ Symbol("failure");
12823
12832
  function countSymbols(str) {
12824
12833
  return punycode.ucs2.decode(str).length;
12825
12834
  }
@@ -14246,8 +14255,8 @@ var require_lib3 = __commonJS({
14246
14255
  var https = _interopDefault(__require("https"));
14247
14256
  var zlib = _interopDefault(__require("zlib"));
14248
14257
  var Readable = Stream.Readable;
14249
- var BUFFER = Symbol("buffer");
14250
- var TYPE = Symbol("type");
14258
+ var BUFFER = /* @__PURE__ */ Symbol("buffer");
14259
+ var TYPE = /* @__PURE__ */ Symbol("type");
14251
14260
  var Blob2 = class _Blob {
14252
14261
  constructor() {
14253
14262
  this[TYPE] = "";
@@ -14362,7 +14371,7 @@ var require_lib3 = __commonJS({
14362
14371
  convert = __require("encoding").convert;
14363
14372
  } catch (e) {
14364
14373
  }
14365
- var INTERNALS = Symbol("Body internals");
14374
+ var INTERNALS = /* @__PURE__ */ Symbol("Body internals");
14366
14375
  var PassThrough = Stream.PassThrough;
14367
14376
  function Body(body) {
14368
14377
  var _this = this;
@@ -14702,7 +14711,7 @@ var require_lib3 = __commonJS({
14702
14711
  }
14703
14712
  return void 0;
14704
14713
  }
14705
- var MAP = Symbol("map");
14714
+ var MAP = /* @__PURE__ */ Symbol("map");
14706
14715
  var Headers = class _Headers {
14707
14716
  /**
14708
14717
  * Headers class
@@ -14910,7 +14919,7 @@ var require_lib3 = __commonJS({
14910
14919
  return [k.toLowerCase(), headers[MAP][k].join(", ")];
14911
14920
  });
14912
14921
  }
14913
- var INTERNAL = Symbol("internal");
14922
+ var INTERNAL = /* @__PURE__ */ Symbol("internal");
14914
14923
  function createHeadersIterator(target, kind) {
14915
14924
  const iterator = Object.create(HeadersIteratorPrototype);
14916
14925
  iterator[INTERNAL] = {
@@ -14979,7 +14988,7 @@ var require_lib3 = __commonJS({
14979
14988
  }
14980
14989
  return headers;
14981
14990
  }
14982
- var INTERNALS$1 = Symbol("Response internals");
14991
+ var INTERNALS$1 = /* @__PURE__ */ Symbol("Response internals");
14983
14992
  var STATUS_CODES = http.STATUS_CODES;
14984
14993
  var Response = class _Response {
14985
14994
  constructor() {
@@ -15055,7 +15064,7 @@ var require_lib3 = __commonJS({
15055
15064
  enumerable: false,
15056
15065
  configurable: true
15057
15066
  });
15058
- var INTERNALS$2 = Symbol("Request internals");
15067
+ var INTERNALS$2 = /* @__PURE__ */ Symbol("Request internals");
15059
15068
  var URL4 = Url.URL || whatwgUrl.URL;
15060
15069
  var parse_url = Url.parse;
15061
15070
  var format_url = Url.format;
@@ -15483,10 +15492,10 @@ var require_constants = __commonJS({
15483
15492
  EMPTY_BUFFER: Buffer.alloc(0),
15484
15493
  GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
15485
15494
  hasBlob,
15486
- kForOnEventAttribute: Symbol("kIsForOnEventAttribute"),
15487
- kListener: Symbol("kListener"),
15488
- kStatusCode: Symbol("status-code"),
15489
- kWebSocket: Symbol("websocket"),
15495
+ kForOnEventAttribute: /* @__PURE__ */ Symbol("kIsForOnEventAttribute"),
15496
+ kListener: /* @__PURE__ */ Symbol("kListener"),
15497
+ kStatusCode: /* @__PURE__ */ Symbol("status-code"),
15498
+ kWebSocket: /* @__PURE__ */ Symbol("websocket"),
15490
15499
  NOOP: () => {
15491
15500
  }
15492
15501
  };
@@ -15784,8 +15793,8 @@ var require_buffer_util = __commonJS({
15784
15793
  var require_limiter = __commonJS({
15785
15794
  "node_modules/rpc-websockets/node_modules/ws/lib/limiter.js"(exports, module) {
15786
15795
  "use strict";
15787
- var kDone = Symbol("kDone");
15788
- var kRun = Symbol("kRun");
15796
+ var kDone = /* @__PURE__ */ Symbol("kDone");
15797
+ var kRun = /* @__PURE__ */ Symbol("kRun");
15789
15798
  var Limiter = class {
15790
15799
  /**
15791
15800
  * Creates a new `Limiter`.
@@ -15840,11 +15849,11 @@ var require_permessage_deflate = __commonJS({
15840
15849
  var { kStatusCode } = require_constants();
15841
15850
  var FastBuffer = Buffer[Symbol.species];
15842
15851
  var TRAILER = Buffer.from([0, 0, 255, 255]);
15843
- var kPerMessageDeflate = Symbol("permessage-deflate");
15844
- var kTotalLength = Symbol("total-length");
15845
- var kCallback = Symbol("callback");
15846
- var kBuffers = Symbol("buffers");
15847
- var kError = Symbol("error");
15852
+ var kPerMessageDeflate = /* @__PURE__ */ Symbol("permessage-deflate");
15853
+ var kTotalLength = /* @__PURE__ */ Symbol("total-length");
15854
+ var kCallback = /* @__PURE__ */ Symbol("callback");
15855
+ var kBuffers = /* @__PURE__ */ Symbol("buffers");
15856
+ var kError = /* @__PURE__ */ Symbol("error");
15848
15857
  var zlibLimiter;
15849
15858
  var PerMessageDeflate = class {
15850
15859
  /**
@@ -17099,7 +17108,7 @@ var require_sender = __commonJS({
17099
17108
  var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
17100
17109
  var { isBlob, isValidStatusCode } = require_validation();
17101
17110
  var { mask: applyMask, toBuffer } = require_buffer_util();
17102
- var kByteLength = Symbol("kByteLength");
17111
+ var kByteLength = /* @__PURE__ */ Symbol("kByteLength");
17103
17112
  var maskBuffer = Buffer.alloc(4);
17104
17113
  var RANDOM_POOL_SIZE = 8 * 1024;
17105
17114
  var randomPool;
@@ -17584,14 +17593,14 @@ var require_event_target = __commonJS({
17584
17593
  "node_modules/rpc-websockets/node_modules/ws/lib/event-target.js"(exports, module) {
17585
17594
  "use strict";
17586
17595
  var { kForOnEventAttribute, kListener } = require_constants();
17587
- var kCode = Symbol("kCode");
17588
- var kData = Symbol("kData");
17589
- var kError = Symbol("kError");
17590
- var kMessage = Symbol("kMessage");
17591
- var kReason = Symbol("kReason");
17592
- var kTarget = Symbol("kTarget");
17593
- var kType = Symbol("kType");
17594
- var kWasClean = Symbol("kWasClean");
17596
+ var kCode = /* @__PURE__ */ Symbol("kCode");
17597
+ var kData = /* @__PURE__ */ Symbol("kData");
17598
+ var kError = /* @__PURE__ */ Symbol("kError");
17599
+ var kMessage = /* @__PURE__ */ Symbol("kMessage");
17600
+ var kReason = /* @__PURE__ */ Symbol("kReason");
17601
+ var kTarget = /* @__PURE__ */ Symbol("kTarget");
17602
+ var kType = /* @__PURE__ */ Symbol("kType");
17603
+ var kWasClean = /* @__PURE__ */ Symbol("kWasClean");
17595
17604
  var Event = class {
17596
17605
  /**
17597
17606
  * Create a new `Event`.
@@ -17993,7 +18002,7 @@ var require_websocket = __commonJS({
17993
18002
  } = require_event_target();
17994
18003
  var { format, parse: parse3 } = require_extension();
17995
18004
  var { toBuffer } = require_buffer_util();
17996
- var kAborted = Symbol("kAborted");
18005
+ var kAborted = /* @__PURE__ */ Symbol("kAborted");
17997
18006
  var protocolVersions = [8, 13];
17998
18007
  var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
17999
18008
  var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
@@ -23732,13 +23741,13 @@ var require_index_cjs = __commonJS({
23732
23741
  }
23733
23742
  }
23734
23743
  };
23735
- var TransactionStatus = /* @__PURE__ */ function(TransactionStatus2) {
23744
+ var TransactionStatus = /* @__PURE__ */ (function(TransactionStatus2) {
23736
23745
  TransactionStatus2[TransactionStatus2["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED";
23737
23746
  TransactionStatus2[TransactionStatus2["PROCESSED"] = 1] = "PROCESSED";
23738
23747
  TransactionStatus2[TransactionStatus2["TIMED_OUT"] = 2] = "TIMED_OUT";
23739
23748
  TransactionStatus2[TransactionStatus2["NONCE_INVALID"] = 3] = "NONCE_INVALID";
23740
23749
  return TransactionStatus2;
23741
- }({});
23750
+ })({});
23742
23751
  var DEFAULT_SIGNATURE = buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);
23743
23752
  var TransactionInstruction3 = class {
23744
23753
  constructor(opts) {
@@ -25714,15 +25723,15 @@ Message: ${transactionMessage}.
25714
25723
  hasRequiredConstants = 1;
25715
25724
  constants = {
25716
25725
  // agent
25717
- CURRENT_ID: Symbol("agentkeepalive#currentId"),
25718
- CREATE_ID: Symbol("agentkeepalive#createId"),
25719
- INIT_SOCKET: Symbol("agentkeepalive#initSocket"),
25720
- CREATE_HTTPS_CONNECTION: Symbol("agentkeepalive#createHttpsConnection"),
25726
+ CURRENT_ID: /* @__PURE__ */ Symbol("agentkeepalive#currentId"),
25727
+ CREATE_ID: /* @__PURE__ */ Symbol("agentkeepalive#createId"),
25728
+ INIT_SOCKET: /* @__PURE__ */ Symbol("agentkeepalive#initSocket"),
25729
+ CREATE_HTTPS_CONNECTION: /* @__PURE__ */ Symbol("agentkeepalive#createHttpsConnection"),
25721
25730
  // socket
25722
- SOCKET_CREATED_TIME: Symbol("agentkeepalive#socketCreatedTime"),
25723
- SOCKET_NAME: Symbol("agentkeepalive#socketName"),
25724
- SOCKET_REQUEST_COUNT: Symbol("agentkeepalive#socketRequestCount"),
25725
- SOCKET_REQUEST_FINISHED_COUNT: Symbol("agentkeepalive#socketRequestFinishedCount")
25731
+ SOCKET_CREATED_TIME: /* @__PURE__ */ Symbol("agentkeepalive#socketCreatedTime"),
25732
+ SOCKET_NAME: /* @__PURE__ */ Symbol("agentkeepalive#socketName"),
25733
+ SOCKET_REQUEST_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestCount"),
25734
+ SOCKET_REQUEST_FINISHED_COUNT: /* @__PURE__ */ Symbol("agentkeepalive#socketRequestFinishedCount")
25726
25735
  };
25727
25736
  return constants;
25728
25737
  }
@@ -34083,7 +34092,7 @@ function clone(configObject) {
34083
34092
  BigNumber2.minimum = BigNumber2.min = function() {
34084
34093
  return maxOrMin(arguments, 1);
34085
34094
  };
34086
- BigNumber2.random = function() {
34095
+ BigNumber2.random = (function() {
34087
34096
  var pow2_53 = 9007199254740992;
34088
34097
  var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
34089
34098
  return mathfloor(Math.random() * pow2_53);
@@ -34151,13 +34160,13 @@ function clone(configObject) {
34151
34160
  rand.c = c;
34152
34161
  return rand;
34153
34162
  };
34154
- }();
34163
+ })();
34155
34164
  BigNumber2.sum = function() {
34156
34165
  var i = 1, args = arguments, sum = new BigNumber2(args[0]);
34157
34166
  for (; i < args.length; ) sum = sum.plus(args[i++]);
34158
34167
  return sum;
34159
34168
  };
34160
- convertBase = /* @__PURE__ */ function() {
34169
+ convertBase = /* @__PURE__ */ (function() {
34161
34170
  var decimal = "0123456789";
34162
34171
  function toBaseOut(str, baseIn, baseOut, alphabet) {
34163
34172
  var j, arr = [0], arrL, i = 0, len = str.length;
@@ -34230,8 +34239,8 @@ function clone(configObject) {
34230
34239
  }
34231
34240
  return str;
34232
34241
  };
34233
- }();
34234
- div = /* @__PURE__ */ function() {
34242
+ })();
34243
+ div = /* @__PURE__ */ (function() {
34235
34244
  function multiply(x, k, base) {
34236
34245
  var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
34237
34246
  for (x = x.slice(); i--; ) {
@@ -34372,7 +34381,7 @@ function clone(configObject) {
34372
34381
  }
34373
34382
  return q;
34374
34383
  };
34375
- }();
34384
+ })();
34376
34385
  function format(n, i, rm, id) {
34377
34386
  var c0, e, ne, len, str;
34378
34387
  if (rm == null) rm = ROUNDING_MODE;
@@ -34431,7 +34440,7 @@ function clone(configObject) {
34431
34440
  }
34432
34441
  return n;
34433
34442
  }
34434
- parseNumeric = /* @__PURE__ */ function() {
34443
+ parseNumeric = /* @__PURE__ */ (function() {
34435
34444
  var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
34436
34445
  return function(x, str, isNum, b) {
34437
34446
  var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
@@ -34456,7 +34465,7 @@ function clone(configObject) {
34456
34465
  }
34457
34466
  x.c = x.e = null;
34458
34467
  };
34459
- }();
34468
+ })();
34460
34469
  function round(x, sd, rm, r) {
34461
34470
  var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
34462
34471
  if (xc) {
@@ -35083,7 +35092,7 @@ function clone(configObject) {
35083
35092
  };
35084
35093
  P._isBigNumber = true;
35085
35094
  P[Symbol.toStringTag] = "BigNumber";
35086
- P[Symbol.for("nodejs.util.inspect.custom")] = P.valueOf;
35095
+ P[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = P.valueOf;
35087
35096
  if (configObject != null) BigNumber2.set(configObject);
35088
35097
  return BigNumber2;
35089
35098
  }