@fastxyz/cli 1.0.0 → 1.0.2

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/main.js CHANGED
@@ -166,12 +166,12 @@ import {
166
166
  import "./chunk-MWATGKBS.js";
167
167
  import {
168
168
  NetworkConfigService
169
- } from "./chunk-FLS2KI2D.js";
169
+ } from "./chunk-F4CXF26J.js";
170
170
  import {
171
171
  AppConfigLive,
172
172
  getAppName,
173
173
  getVersion
174
- } from "./chunk-MIRQRJSD.js";
174
+ } from "./chunk-ECO24H3M.js";
175
175
  import {
176
176
  AccountExistsError,
177
177
  AccountNotFoundError,
@@ -213,7 +213,7 @@ import { Option as Option7 } from "effect";
213
213
  // src/app.ts
214
214
  import { Effect as Effect14, Layer as Layer6 } from "effect";
215
215
 
216
- // ../../packages/fast-sdk/dist/chunk-J4LYMR5I.mjs
216
+ // ../../packages/fast-sdk/dist/chunk-2WOJNW4N.js
217
217
  import { Data } from "effect";
218
218
 
219
219
  // ../../node_modules/.pnpm/@noble+hashes@2.0.1/node_modules/@noble/hashes/_u64.js
@@ -602,21 +602,125 @@ var Keccak = class _Keccak {
602
602
  var genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);
603
603
  var keccak_2562 = /* @__PURE__ */ genKeccak(1, 136, 32);
604
604
 
605
- // ../../packages/fast-sdk/dist/chunk-J4LYMR5I.mjs
605
+ // ../../packages/fast-sdk/dist/chunk-2WOJNW4N.js
606
606
  import { Effect, Encoding } from "effect";
607
607
  import { Cause, Effect as Effect2, Exit, Option } from "effect";
608
608
  import { Data as Data2 } from "effect";
609
609
  import { Data as Data3 } from "effect";
610
610
  import { Data as Data4 } from "effect";
611
+ import { Effect as Effect3, Schema as Schema19 } from "effect";
611
612
 
612
- // ../../packages/fast-schema/dist/index.mjs
613
- import { Schema as Schema5 } from "effect";
613
+ // ../../node_modules/.pnpm/json-with-bigint@3.5.8/node_modules/json-with-bigint/json-with-bigint.js
614
+ var intRegex = /^-?\d+$/;
615
+ var noiseValue = /^-?\d+n+$/;
616
+ var originalStringify = JSON.stringify;
617
+ var originalParse = JSON.parse;
618
+ var customFormat = /^-?\d+n$/;
619
+ var bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
620
+ var noiseStringify = /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
621
+ var JSONStringify = (value, replacer, space) => {
622
+ if ("rawJSON" in JSON) {
623
+ return originalStringify(
624
+ value,
625
+ (key, value2) => {
626
+ if (typeof value2 === "bigint") return JSON.rawJSON(value2.toString());
627
+ if (typeof replacer === "function") return replacer(key, value2);
628
+ if (Array.isArray(replacer) && replacer.includes(key)) return value2;
629
+ return value2;
630
+ },
631
+ space
632
+ );
633
+ }
634
+ if (!value) return originalStringify(value, replacer, space);
635
+ const convertedToCustomJSON = originalStringify(
636
+ value,
637
+ (key, value2) => {
638
+ const isNoise = typeof value2 === "string" && noiseValue.test(value2);
639
+ if (isNoise) return value2.toString() + "n";
640
+ if (typeof value2 === "bigint") return value2.toString() + "n";
641
+ if (typeof replacer === "function") return replacer(key, value2);
642
+ if (Array.isArray(replacer) && replacer.includes(key)) return value2;
643
+ return value2;
644
+ },
645
+ space
646
+ );
647
+ const processedJSON = convertedToCustomJSON.replace(
648
+ bigIntsStringify,
649
+ "$1$2$3"
650
+ );
651
+ const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3");
652
+ return denoisedJSON;
653
+ };
654
+ var featureCache = /* @__PURE__ */ new Map();
655
+ var isContextSourceSupported = () => {
656
+ const parseFingerprint = JSON.parse.toString();
657
+ if (featureCache.has(parseFingerprint)) {
658
+ return featureCache.get(parseFingerprint);
659
+ }
660
+ try {
661
+ const result2 = JSON.parse(
662
+ "1",
663
+ (_, __, context) => !!context?.source && context.source === "1"
664
+ );
665
+ featureCache.set(parseFingerprint, result2);
666
+ return result2;
667
+ } catch {
668
+ featureCache.set(parseFingerprint, false);
669
+ return false;
670
+ }
671
+ };
672
+ var convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
673
+ const isCustomFormatBigInt = typeof value === "string" && customFormat.test(value);
674
+ if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
675
+ const isNoiseValue = typeof value === "string" && noiseValue.test(value);
676
+ if (isNoiseValue) return value.slice(0, -1);
677
+ if (typeof userReviver !== "function") return value;
678
+ return userReviver(key, value, context);
679
+ };
680
+ var JSONParseV2 = (text, reviver) => {
681
+ return JSON.parse(text, (key, value, context) => {
682
+ const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
683
+ const isInt = context && intRegex.test(context.source);
684
+ const isBigInt = isBigNumber && isInt;
685
+ if (isBigInt) return BigInt(context.source);
686
+ if (typeof reviver !== "function") return value;
687
+ return reviver(key, value, context);
688
+ });
689
+ };
690
+ var MAX_INT = Number.MAX_SAFE_INTEGER.toString();
691
+ var MAX_DIGITS = MAX_INT.length;
692
+ var stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
693
+ var noiseValueWithQuotes = /^"-?\d+n+"$/;
694
+ var JSONParse = (text, reviver) => {
695
+ if (!text) return originalParse(text, reviver);
696
+ if (isContextSourceSupported()) return JSONParseV2(text, reviver);
697
+ const serializedData = text.replace(
698
+ stringsOrLargeNumbers,
699
+ (text2, digits, fractional, exponential) => {
700
+ const isString = text2[0] === '"';
701
+ const isNoise = isString && noiseValueWithQuotes.test(text2);
702
+ if (isNoise) return text2.substring(0, text2.length - 1) + 'n"';
703
+ const isFractionalOrExponential = fractional || exponential;
704
+ const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
705
+ if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
706
+ return text2;
707
+ return '"' + text2 + 'n"';
708
+ }
709
+ );
710
+ return originalParse(
711
+ serializedData,
712
+ (key, value, context) => convertMarkedBigIntsReviver(key, value, context, reviver)
713
+ );
714
+ };
715
+
716
+ // ../../packages/fast-schema/dist/index.js
717
+ import { Schema as Schema6 } from "effect";
614
718
  import { bech32m } from "bech32";
615
719
  import { ParseResult, Schema } from "effect";
616
720
  import { Schema as Schema2 } from "effect";
617
721
  import { Schema as Schema3, String as Str } from "effect";
618
722
  import { Either, ParseResult as ParseResult2, Schema as Schema4 } from "effect";
619
- import { Schema as Schema6 } from "effect";
723
+ import { Schema as Schema5 } from "effect";
620
724
  import { Schema as Schema7 } from "effect";
621
725
  import { Schema as Schema8 } from "effect";
622
726
  import { Schema as Schema9 } from "effect";
@@ -1612,7 +1716,7 @@ var bcs = {
1612
1716
  }
1613
1717
  };
1614
1718
 
1615
- // ../../packages/fast-schema/dist/index.mjs
1719
+ // ../../packages/fast-schema/dist/index.js
1616
1720
  import { Schema as Schema10 } from "effect";
1617
1721
  import { Schema as Schema13 } from "effect";
1618
1722
  import { Schema as Schema12 } from "effect";
@@ -1621,6 +1725,7 @@ import { Schema as Schema14 } from "effect";
1621
1725
  import { Schema as Schema15 } from "effect";
1622
1726
  import { Schema as Schema16 } from "effect";
1623
1727
  import { Schema as Schema17 } from "effect";
1728
+ import { Schema as Schema18 } from "effect";
1624
1729
  var __defProp = Object.defineProperty;
1625
1730
  var __export2 = (target, all) => {
1626
1731
  for (var name in all)
@@ -1690,6 +1795,9 @@ var HexBigInt = Schema2.transform(Schema2.String, Schema2.BigIntFromSelf, {
1690
1795
  decode: (s) => {
1691
1796
  const sign2 = s[0] === "-" ? -1n : 1n;
1692
1797
  const digits = s[0] === "-" ? s.slice(1) : s;
1798
+ if (digits.length === 0 || !/^[0-9a-fA-F]+$/.test(digits)) {
1799
+ throw new Error(`Invalid hex string: "${s}"`);
1800
+ }
1693
1801
  return sign2 * BigInt(`0x${digits}`);
1694
1802
  },
1695
1803
  encode: (n) => n.toString(16)
@@ -1697,14 +1805,23 @@ var HexBigInt = Schema2.transform(Schema2.String, Schema2.BigIntFromSelf, {
1697
1805
  var DecimalNumber = Schema2.NumberFromString;
1698
1806
  var HexNumber = Schema2.transform(Schema2.String, Schema2.Number, {
1699
1807
  strict: true,
1700
- decode: (s) => Number(`0x${s}`),
1808
+ decode: (s) => {
1809
+ if (s.length === 0 || !/^[0-9a-fA-F]+$/.test(s)) {
1810
+ throw new Error(`Invalid hex string: "${s}"`);
1811
+ }
1812
+ return Number(`0x${s}`);
1813
+ },
1701
1814
  encode: (n) => n.toString(16)
1702
1815
  });
1703
- var BigIntFromNumberOrSelf = Schema2.transform(Schema2.Union(Schema2.Number, Schema2.BigIntFromSelf), Schema2.BigIntFromSelf, {
1704
- strict: true,
1705
- decode: (n) => typeof n === "bigint" ? n : BigInt(n),
1706
- encode: (n) => n
1707
- });
1816
+ var BigIntFromNumberOrStringOrSelf = Schema2.transform(
1817
+ Schema2.Union(Schema2.Number, Schema2.BigIntFromSelf, Schema2.String),
1818
+ Schema2.BigIntFromSelf,
1819
+ {
1820
+ strict: true,
1821
+ decode: (n) => typeof n === "bigint" ? n : BigInt(n),
1822
+ encode: (n) => n
1823
+ }
1824
+ );
1708
1825
  var UintNumber = (bits) => Schema2.Number.pipe(Schema2.int(), Schema2.between(0, 2 ** bits - 1), Schema2.brand(`Uint${bits}`));
1709
1826
  var IntNumber = (bits) => Schema2.Number.pipe(Schema2.int(), Schema2.between(-(2 ** (bits - 1)), 2 ** (bits - 1) - 1), Schema2.brand(`Int${bits}`));
1710
1827
  var UintBigInt = (bits) => Schema2.BigIntFromSelf.pipe(Schema2.betweenBigInt(0n, 2n ** BigInt(bits) - 1n), Schema2.brand(`Uint${bits}`));
@@ -1713,8 +1830,8 @@ var HexUintBigInt = (bits) => Schema2.compose(HexBigInt, UintBigInt(bits));
1713
1830
  var HexIntBigInt = (bits) => Schema2.compose(HexBigInt, IntBigInt(bits));
1714
1831
  var DecimalUintBigInt = (bits) => Schema2.compose(DecimalBigInt, UintBigInt(bits));
1715
1832
  var DecimalIntBigInt = (bits) => Schema2.compose(DecimalBigInt, IntBigInt(bits));
1716
- var UintBigIntFromNumberOrSelf = (bits) => Schema2.compose(BigIntFromNumberOrSelf, UintBigInt(bits));
1717
- var IntBigIntFromNumberOrSelf = (bits) => Schema2.compose(BigIntFromNumberOrSelf, IntBigInt(bits));
1833
+ var UintBigIntFromNumberOrStringOrSelf = (bits) => Schema2.compose(BigIntFromNumberOrStringOrSelf, UintBigInt(bits));
1834
+ var IntBigIntFromNumberOrStringOrSelf = (bits) => Schema2.compose(BigIntFromNumberOrStringOrSelf, IntBigInt(bits));
1718
1835
  var Uint8Array32 = FixedUint8Array(32);
1719
1836
  var Uint8Array64 = FixedUint8Array(64);
1720
1837
  var Uint8Array32FromNumberArray = FixedUint8ArrayFromNumberArray(32);
@@ -1738,9 +1855,9 @@ var HexInt320 = HexIntBigInt(320);
1738
1855
  var DecimalUint64 = DecimalUintBigInt(64);
1739
1856
  var DecimalUint256 = DecimalUintBigInt(256);
1740
1857
  var DecimalInt320 = DecimalIntBigInt(320);
1741
- var Uint64FromNumberOrSelf = UintBigIntFromNumberOrSelf(64);
1742
- var Uint256FromNumberOrSelf = UintBigIntFromNumberOrSelf(256);
1743
- var Int320FromNumberOrSelf = IntBigIntFromNumberOrSelf(320);
1858
+ var Uint64FromNumberOrStringOrSelf = UintBigIntFromNumberOrStringOrSelf(64);
1859
+ var Uint256FromNumberOrStringOrSelf = UintBigIntFromNumberOrStringOrSelf(256);
1860
+ var Int320FromNumberOrStringOrSelf = IntBigIntFromNumberOrStringOrSelf(320);
1744
1861
  var CamelCaseStruct = (fields) => {
1745
1862
  const structFields = {};
1746
1863
  for (const key of Object.keys(fields)) {
@@ -1797,58 +1914,60 @@ var TypedVariant = (variants, options) => {
1797
1914
  }
1798
1915
  });
1799
1916
  };
1800
- var AmountFromBcs = Uint256FromNumberOrSelf.pipe(Schema5.brand("Amount"));
1801
- var BalanceFromBcs = Int320FromNumberOrSelf.pipe(Schema5.brand("Balance"));
1802
- var NonceFromBcs = Uint64FromNumberOrSelf.pipe(Schema5.brand("Nonce"));
1803
- var QuorumFromBcs = Uint64FromNumberOrSelf.pipe(Schema5.brand("Quorum"));
1804
- var NetworkIdFromBcs = Schema5.Literal("fast:localnet", "fast:devnet", "fast:testnet", "fast:mainnet");
1805
- var AddressFromBcs = Uint8Array32FromNumberArray.pipe(Schema5.brand("Address"));
1806
- var SignatureFromBcs = Uint8Array64FromNumberArray.pipe(Schema5.brand("Signature"));
1807
- var TokenIdFromBcs = Uint8Array32FromNumberArray.pipe(Schema5.brand("TokenId"));
1808
- var StateKeyFromBcs = Uint8Array32FromNumberArray.pipe(Schema5.brand("StateKey"));
1809
- var StateFromBcs = Uint8Array32FromNumberArray.pipe(Schema5.brand("State"));
1810
- var ClaimDataFromBcs = Uint8ArrayFromNumberArray.pipe(Schema5.brand("ClaimData"));
1811
- var UserDataFromBcs = Schema5.NullOr(Uint8Array32FromNumberArray.pipe(Schema5.brand("UserData")));
1812
- var AmountFromInput = Schema6.Union(Uint256FromNumberOrSelf, HexUint256, DecimalUint256).pipe(Schema6.brand("Amount"));
1813
- var BalanceFromInput = Schema6.Union(Int320FromNumberOrSelf, HexInt320, DecimalInt320).pipe(Schema6.brand("Balance"));
1814
- var NonceFromInput = Uint64FromNumberOrSelf.pipe(Schema6.brand("Nonce"));
1815
- var QuorumFromInput = Uint64FromNumberOrSelf.pipe(Schema6.brand("Quorum"));
1816
- var NetworkIdFromInput = Schema6.Literal("fast:localnet", "fast:devnet", "fast:testnet", "fast:mainnet");
1817
- var AddressFromInput = Schema6.Union(
1917
+ var Amount = Uint256.pipe(Schema5.brand("Amount"));
1918
+ var Balance = Int320.pipe(Schema5.brand("Balance"));
1919
+ var Nonce = Uint64.pipe(Schema5.brand("Nonce"));
1920
+ var Quorum = Uint64.pipe(Schema5.brand("Quorum"));
1921
+ var NetworkId = Schema5.Literal("fast:localnet", "fast:devnet", "fast:testnet", "fast:mainnet");
1922
+ var TransactionVersion = Schema5.Literal("Release20260319", "Release20260407");
1923
+ var SupportedTransactionVersions = TransactionVersion.literals;
1924
+ var LatestTransactionVersion = "Release20260407";
1925
+ var Address = Uint8Array32.pipe(Schema5.brand("Address"));
1926
+ var Signature = Uint8Array64.pipe(Schema5.brand("Signature"));
1927
+ var TokenId = Uint8Array32.pipe(Schema5.brand("TokenId"));
1928
+ var StateKey = Uint8Array32.pipe(Schema5.brand("StateKey"));
1929
+ var State = Uint8Array32.pipe(Schema5.brand("State"));
1930
+ var ClaimData = Schema5.Uint8ArrayFromSelf.pipe(Schema5.brand("ClaimData"));
1931
+ var UserData = Schema5.NullOr(Uint8Array32.pipe(Schema5.brand("UserData")));
1932
+ var AmountFromBcs = Uint256FromNumberOrStringOrSelf.pipe(Schema6.brand("Amount"));
1933
+ var BalanceFromBcs = Int320FromNumberOrStringOrSelf.pipe(Schema6.brand("Balance"));
1934
+ var NonceFromBcs = Uint64FromNumberOrStringOrSelf.pipe(Schema6.brand("Nonce"));
1935
+ var QuorumFromBcs = Uint64FromNumberOrStringOrSelf.pipe(Schema6.brand("Quorum"));
1936
+ var NetworkIdFromBcs = NetworkId;
1937
+ var AddressFromBcs = Uint8Array32FromNumberArray.pipe(Schema6.brand("Address"));
1938
+ var SignatureFromBcs = Uint8Array64FromNumberArray.pipe(Schema6.brand("Signature"));
1939
+ var TokenIdFromBcs = Uint8Array32FromNumberArray.pipe(Schema6.brand("TokenId"));
1940
+ var StateKeyFromBcs = Uint8Array32FromNumberArray.pipe(Schema6.brand("StateKey"));
1941
+ var StateFromBcs = Uint8Array32FromNumberArray.pipe(Schema6.brand("State"));
1942
+ var ClaimDataFromBcs = Uint8ArrayFromNumberArray.pipe(Schema6.brand("ClaimData"));
1943
+ var UserDataFromBcs = Schema6.NullOr(Uint8Array32FromNumberArray.pipe(Schema6.brand("UserData")));
1944
+ var AmountFromInput = Schema7.Union(Uint256FromNumberOrStringOrSelf, HexUint256, DecimalUint256).pipe(Schema7.brand("Amount"));
1945
+ var BalanceFromInput = Schema7.Union(Int320FromNumberOrStringOrSelf, HexInt320, DecimalInt320).pipe(Schema7.brand("Balance"));
1946
+ var NonceFromInput = Uint64FromNumberOrStringOrSelf.pipe(Schema7.brand("Nonce"));
1947
+ var QuorumFromInput = Uint64FromNumberOrStringOrSelf.pipe(Schema7.brand("Quorum"));
1948
+ var NetworkIdFromInput = NetworkId;
1949
+ var AddressFromInput = Schema7.Union(
1818
1950
  Uint8Array32,
1819
1951
  Uint8Array32FromNumberArray,
1820
1952
  Uint8Array32FromHex0x,
1821
- Schema6.compose(Uint8ArrayFromBech32m("fast"), Uint8Array32)
1822
- ).pipe(Schema6.brand("Address"));
1823
- var SignatureFromInput = Schema6.Union(Uint8Array64, Uint8Array64FromNumberArray, Uint8Array64FromHex0x).pipe(Schema6.brand("Signature"));
1824
- var TokenIdFromInput = Schema6.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema6.brand("TokenId"));
1825
- var StateKeyFromInput = Schema6.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema6.brand("StateKey"));
1826
- var StateFromInput = Schema6.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema6.brand("State"));
1827
- var ClaimDataFromInput = Schema6.Union(Schema6.Uint8ArrayFromSelf, Uint8ArrayFromNumberArray, Uint8ArrayFromHexOptional0x).pipe(
1828
- Schema6.brand("ClaimData")
1953
+ Schema7.compose(Uint8ArrayFromBech32m("fast"), Uint8Array32)
1954
+ ).pipe(Schema7.brand("Address"));
1955
+ var SignatureFromInput = Schema7.Union(Uint8Array64, Uint8Array64FromNumberArray, Uint8Array64FromHex0x).pipe(Schema7.brand("Signature"));
1956
+ var TokenIdFromInput = Schema7.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema7.brand("TokenId"));
1957
+ var StateKeyFromInput = Schema7.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema7.brand("StateKey"));
1958
+ var StateFromInput = Schema7.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema7.brand("State"));
1959
+ var ClaimDataFromInput = Schema7.Union(Schema7.Uint8ArrayFromSelf, Uint8ArrayFromNumberArray, Uint8ArrayFromHexOptional0x).pipe(
1960
+ Schema7.brand("ClaimData")
1829
1961
  );
1830
- var UserDataFromInput = Schema6.NullOr(
1831
- Schema6.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema6.brand("UserData"))
1962
+ var UserDataFromInput = Schema7.NullOr(
1963
+ Schema7.Union(Uint8Array32, Uint8Array32FromNumberArray, Uint8Array32FromHex0x).pipe(Schema7.brand("UserData"))
1832
1964
  );
1833
- var Amount = Uint256.pipe(Schema7.brand("Amount"));
1834
- var Balance = Int320.pipe(Schema7.brand("Balance"));
1835
- var Nonce = Uint64.pipe(Schema7.brand("Nonce"));
1836
- var Quorum = Uint64.pipe(Schema7.brand("Quorum"));
1837
- var NetworkId = Schema7.Literal("fast:localnet", "fast:devnet", "fast:testnet", "fast:mainnet");
1838
- var TransactionVersion = Schema7.Literal("Release20260319");
1839
- var Address = Uint8Array32.pipe(Schema7.brand("Address"));
1840
- var Signature = Uint8Array64.pipe(Schema7.brand("Signature"));
1841
- var TokenId = Uint8Array32.pipe(Schema7.brand("TokenId"));
1842
- var StateKey = Uint8Array32.pipe(Schema7.brand("StateKey"));
1843
- var State = Uint8Array32.pipe(Schema7.brand("State"));
1844
- var ClaimData = Schema7.Uint8ArrayFromSelf.pipe(Schema7.brand("ClaimData"));
1845
- var UserData = Schema7.NullOr(Uint8Array32.pipe(Schema7.brand("UserData")));
1846
1965
  var AmountFromRest = DecimalUint256.pipe(Schema8.brand("Amount"));
1847
1966
  var BalanceFromRest = DecimalInt320.pipe(Schema8.brand("Balance"));
1848
- var NonceFromRest = Uint64FromNumberOrSelf.pipe(Schema8.brand("Nonce"));
1849
- var QuorumFromRest = Uint64FromNumberOrSelf.pipe(Schema8.brand("Quorum"));
1850
- var NetworkIdFromRest = Schema8.Literal("fast:localnet", "fast:devnet", "fast:testnet", "fast:mainnet");
1851
- var AddressFromRest = Uint8ArrayFromBech32m("fast").pipe(Schema8.brand("Address"));
1967
+ var NonceFromRest = Uint64FromNumberOrStringOrSelf.pipe(Schema8.brand("Nonce"));
1968
+ var QuorumFromRest = Uint64FromNumberOrStringOrSelf.pipe(Schema8.brand("Quorum"));
1969
+ var NetworkIdFromRest = NetworkId;
1970
+ var AddressFromRest = Schema8.compose(Uint8ArrayFromBech32m("fast"), Uint8Array32).pipe(Schema8.brand("Address"));
1852
1971
  var SignatureFromRest = Uint8Array64FromHex.pipe(Schema8.brand("Signature"));
1853
1972
  var TokenIdFromRest = Uint8Array32FromHex.pipe(Schema8.brand("TokenId"));
1854
1973
  var StateKeyFromRest = Uint8Array32FromHex.pipe(Schema8.brand("StateKey"));
@@ -1857,9 +1976,9 @@ var ClaimDataFromRest = Schema8.Uint8ArrayFromHex.pipe(Schema8.brand("ClaimData"
1857
1976
  var UserDataFromRest = Schema8.NullOr(Uint8Array32FromHex.pipe(Schema8.brand("UserData")));
1858
1977
  var AmountFromRpc = HexUint256.pipe(Schema9.brand("Amount"));
1859
1978
  var BalanceFromRpc = HexInt320.pipe(Schema9.brand("Balance"));
1860
- var NonceFromRpc = Uint64FromNumberOrSelf.pipe(Schema9.brand("Nonce"));
1861
- var QuorumFromRpc = Uint64FromNumberOrSelf.pipe(Schema9.brand("Quorum"));
1862
- var NetworkIdFromRpc = Schema9.Literal("fast:localnet", "fast:devnet", "fast:testnet", "fast:mainnet");
1979
+ var NonceFromRpc = Uint64FromNumberOrStringOrSelf.pipe(Schema9.brand("Nonce"));
1980
+ var QuorumFromRpc = Uint64FromNumberOrStringOrSelf.pipe(Schema9.brand("Quorum"));
1981
+ var NetworkIdFromRpc = NetworkId;
1863
1982
  var AddressFromRpc = Uint8Array32FromNumberArray.pipe(Schema9.brand("Address"));
1864
1983
  var SignatureFromRpc = Uint8Array64FromNumberArray.pipe(Schema9.brand("Signature"));
1865
1984
  var TokenIdFromRpc = Uint8Array32FromNumberArray.pipe(Schema9.brand("TokenId"));
@@ -1876,14 +1995,24 @@ __export2(bcs_layout_exports, {
1876
1995
  ClaimType: () => ClaimType,
1877
1996
  CommitteeChange: () => CommitteeChange,
1878
1997
  CommitteeConfig: () => CommitteeConfig,
1998
+ Escrow: () => Escrow,
1999
+ EscrowComplete: () => EscrowComplete,
2000
+ EscrowCreateConfig: () => EscrowCreateConfig,
2001
+ EscrowCreateJob: () => EscrowCreateJob,
2002
+ EscrowReject: () => EscrowReject,
2003
+ EscrowSubmit: () => EscrowSubmit,
1879
2004
  ExternalClaim: () => ExternalClaim,
1880
2005
  ExternalClaimBody: () => ExternalClaimBody,
2006
+ FixedAmountOrBps: () => FixedAmountOrBps,
1881
2007
  Mint: () => Mint,
2008
+ MultiSig: () => MultiSig,
2009
+ MultiSigConfig: () => MultiSigConfig,
1882
2010
  Nonce: () => Nonce2,
1883
2011
  Operation: () => Operation,
1884
2012
  PublicKeyBytes: () => PublicKeyBytes,
1885
2013
  Quorum: () => Quorum2,
1886
2014
  Signature: () => Signature2,
2015
+ SignatureOrMultiSig: () => SignatureOrMultiSig,
1887
2016
  State: () => State2,
1888
2017
  StateInitialization: () => StateInitialization,
1889
2018
  StateKey: () => StateKey2,
@@ -1897,6 +2026,7 @@ __export2(bcs_layout_exports, {
1897
2026
  TokenName: () => TokenName,
1898
2027
  TokenTransfer: () => TokenTransfer,
1899
2028
  Transaction20260319: () => Transaction20260319,
2029
+ Transaction20260407: () => Transaction20260407,
1900
2030
  UserData: () => UserData2,
1901
2031
  ValidatorConfig: () => ValidatorConfig,
1902
2032
  VerifierSig: () => VerifierSig,
@@ -1915,6 +2045,19 @@ var State2 = bcs.fixedArray(32, bcs.u8());
1915
2045
  var Quorum2 = bcs.u64();
1916
2046
  var ClaimData2 = bcs.vector(bcs.u8());
1917
2047
  var Signature2 = bcs.fixedArray(64, bcs.u8());
2048
+ var MultiSigConfig = bcs.struct("MultiSigConfig", {
2049
+ authorized_signers: bcs.vector(PublicKeyBytes),
2050
+ quorum: Quorum2,
2051
+ nonce: Nonce2
2052
+ });
2053
+ var MultiSig = bcs.struct("MultiSig", {
2054
+ config: MultiSigConfig,
2055
+ signatures: bcs.vector(bcs.tuple([PublicKeyBytes, Signature2]))
2056
+ });
2057
+ var SignatureOrMultiSig = bcs.enum("SignatureOrMultiSig", {
2058
+ Signature: Signature2,
2059
+ MultiSig
2060
+ });
1918
2061
  var AddressChange = bcs.enum("AddressChange", {
1919
2062
  Add: bcs.tuple([]),
1920
2063
  Remove: bcs.tuple([])
@@ -1988,6 +2131,39 @@ var CommitteeChange = bcs.struct("CommitteeChange", {
1988
2131
  new_committee: CommitteeConfig,
1989
2132
  epoch: bcs.u32()
1990
2133
  });
2134
+ var FixedAmountOrBps = bcs.enum("FixedAmountOrBps", {
2135
+ Fixed: Amount2,
2136
+ Bps: bcs.u16()
2137
+ });
2138
+ var EscrowCreateConfig = bcs.struct("EscrowCreateConfig", {
2139
+ token_id: TokenId2,
2140
+ evaluator: PublicKeyBytes,
2141
+ evaluation_fee: FixedAmountOrBps,
2142
+ min_evaluator_fee: Amount2
2143
+ });
2144
+ var EscrowCreateJob = bcs.struct("EscrowCreateJob", {
2145
+ config_id: bcs.fixedArray(32, bcs.u8()),
2146
+ provider: PublicKeyBytes,
2147
+ provider_fee: Amount2,
2148
+ description: bcs.string()
2149
+ });
2150
+ var EscrowSubmit = bcs.struct("EscrowSubmit", {
2151
+ job_id: bcs.fixedArray(32, bcs.u8()),
2152
+ deliverable: bcs.fixedArray(32, bcs.u8())
2153
+ });
2154
+ var EscrowReject = bcs.struct("EscrowReject", {
2155
+ job_id: bcs.fixedArray(32, bcs.u8())
2156
+ });
2157
+ var EscrowComplete = bcs.struct("EscrowComplete", {
2158
+ job_id: bcs.fixedArray(32, bcs.u8())
2159
+ });
2160
+ var Escrow = bcs.enum("Escrow", {
2161
+ CreateConfig: EscrowCreateConfig,
2162
+ CreateJob: EscrowCreateJob,
2163
+ Submit: EscrowSubmit,
2164
+ Reject: EscrowReject,
2165
+ Complete: EscrowComplete
2166
+ });
1991
2167
  var Operation = bcs.enum("Operation", {
1992
2168
  TokenTransfer,
1993
2169
  TokenCreation,
@@ -2000,7 +2176,8 @@ var Operation = bcs.enum("Operation", {
2000
2176
  StateReset,
2001
2177
  JoinCommittee: ValidatorConfig,
2002
2178
  LeaveCommittee: bcs.tuple([]),
2003
- ChangeCommittee: CommitteeChange
2179
+ ChangeCommittee: CommitteeChange,
2180
+ Escrow
2004
2181
  });
2005
2182
  var ClaimType = bcs.enum("ClaimType", {
2006
2183
  TokenTransfer,
@@ -2015,6 +2192,7 @@ var ClaimType = bcs.enum("ClaimType", {
2015
2192
  JoinCommittee: ValidatorConfig,
2016
2193
  LeaveCommittee: bcs.tuple([]),
2017
2194
  ChangeCommittee: CommitteeChange,
2195
+ Escrow,
2018
2196
  Batch: bcs.vector(Operation)
2019
2197
  });
2020
2198
  var Transaction20260319 = bcs.struct("Transaction", {
@@ -2026,15 +2204,25 @@ var Transaction20260319 = bcs.struct("Transaction", {
2026
2204
  archival: bcs.bool(),
2027
2205
  fee_token: bcs.option(TokenId2)
2028
2206
  });
2207
+ var Transaction20260407 = bcs.struct("Transaction20260407", {
2208
+ network_id: bcs.string(),
2209
+ sender: PublicKeyBytes,
2210
+ nonce: Nonce2,
2211
+ timestamp_nanos: TimestampNanos,
2212
+ claims: bcs.vector(Operation),
2213
+ archival: bcs.bool(),
2214
+ fee_token: bcs.option(TokenId2)
2215
+ });
2029
2216
  var VersionedTransaction = bcs.enum("VersionedTransaction", {
2030
- Release20260319: Transaction20260319
2217
+ Release20260319: Transaction20260319,
2218
+ Release20260407: Transaction20260407
2031
2219
  });
2032
2220
  var FastSetErrorData = TypedVariant({
2033
2221
  UnexpectedNonce: CamelCaseStruct({
2034
- expected_nonce: BigIntFromNumberOrSelf
2222
+ expected_nonce: BigIntFromNumberOrStringOrSelf
2035
2223
  }),
2036
2224
  InsufficientFunding: CamelCaseStruct({
2037
- current_balance: BigIntFromNumberOrSelf
2225
+ current_balance: BigIntFromNumberOrStringOrSelf
2038
2226
  }),
2039
2227
  PreviousTransactionMustBeConfirmedFirst: CamelCaseStruct({
2040
2228
  pending_confirmation: Schema10.Unknown
@@ -2043,10 +2231,10 @@ var FastSetErrorData = TypedVariant({
2043
2231
  error: Schema10.String
2044
2232
  }),
2045
2233
  MissingEarlierConfirmations: CamelCaseStruct({
2046
- current_nonce: BigIntFromNumberOrSelf
2234
+ current_nonce: BigIntFromNumberOrStringOrSelf
2047
2235
  }),
2048
2236
  CertificateTooYoung: CamelCaseStruct({
2049
- resend_after_nanos: BigIntFromNumberOrSelf
2237
+ resend_after_nanos: BigIntFromNumberOrStringOrSelf
2050
2238
  }),
2051
2239
  NonSubmittableOperation: Schema10.Struct({
2052
2240
  reason: Schema10.String
@@ -2067,8 +2255,8 @@ var ProxyErrorData = TypedVariant({
2067
2255
  DatabaseError: Schema10.String,
2068
2256
  TooManyCertificatesRequested: null,
2069
2257
  UnexpectedNonce: CamelCaseStruct({
2070
- tx_nonce: BigIntFromNumberOrSelf,
2071
- expected_nonce: BigIntFromNumberOrSelf
2258
+ tx_nonce: BigIntFromNumberOrStringOrSelf,
2259
+ expected_nonce: BigIntFromNumberOrStringOrSelf
2072
2260
  }),
2073
2261
  InvalidRequest: Schema10.String
2074
2262
  });
@@ -2106,6 +2294,32 @@ var makeExternalClaim = (p4) => Schema11.Struct({ claim: makeExternalClaimBody(p
2106
2294
  var makeValidatorConfig = (p4) => CamelCaseStruct({ address: p4.Address, host: Schema11.String, rpc_port: Schema11.Number });
2107
2295
  var makeCommitteeConfig = (p4) => Schema11.Struct({ validators: Schema11.Array(makeValidatorConfig(p4)) });
2108
2296
  var makeCommitteeChange = (p4) => CamelCaseStruct({ new_committee: makeCommitteeConfig(p4), epoch: Schema11.Number });
2297
+ var makeFixedAmountOrBps = (p4, options) => TypedVariant({ Fixed: p4.Amount, Bps: Schema11.Number }, options);
2298
+ var makeEscrowCreateConfig = (p4, options) => CamelCaseStruct({
2299
+ token_id: p4.TokenId,
2300
+ evaluator: p4.Address,
2301
+ evaluation_fee: makeFixedAmountOrBps(p4, options),
2302
+ min_evaluator_fee: p4.Amount
2303
+ });
2304
+ var makeEscrowCreateJob = (p4) => CamelCaseStruct({
2305
+ config_id: p4.TokenId,
2306
+ provider: p4.Address,
2307
+ provider_fee: p4.Amount,
2308
+ description: Schema11.String
2309
+ });
2310
+ var makeEscrowSubmit = (p4) => CamelCaseStruct({ job_id: p4.TokenId, deliverable: p4.TokenId });
2311
+ var makeEscrowReject = (p4) => CamelCaseStruct({ job_id: p4.TokenId });
2312
+ var makeEscrowComplete = (p4) => CamelCaseStruct({ job_id: p4.TokenId });
2313
+ var makeEscrow = (p4, options) => TypedVariant(
2314
+ {
2315
+ CreateConfig: makeEscrowCreateConfig(p4, options),
2316
+ CreateJob: makeEscrowCreateJob(p4),
2317
+ Submit: makeEscrowSubmit(p4),
2318
+ Reject: makeEscrowReject(p4),
2319
+ Complete: makeEscrowComplete(p4)
2320
+ },
2321
+ options
2322
+ );
2109
2323
  var makeOperation = (p4, options) => TypedVariant(
2110
2324
  {
2111
2325
  TokenTransfer: makeTokenTransfer(p4),
@@ -2119,7 +2333,8 @@ var makeOperation = (p4, options) => TypedVariant(
2119
2333
  ExternalClaim: makeExternalClaim(p4),
2120
2334
  JoinCommittee: makeValidatorConfig(p4),
2121
2335
  LeaveCommittee: null,
2122
- ChangeCommittee: makeCommitteeChange(p4)
2336
+ ChangeCommittee: makeCommitteeChange(p4),
2337
+ Escrow: makeEscrow(p4, options)
2123
2338
  },
2124
2339
  options
2125
2340
  );
@@ -2137,11 +2352,12 @@ var makeClaimType = (p4, options) => TypedVariant(
2137
2352
  JoinCommittee: makeValidatorConfig(p4),
2138
2353
  LeaveCommittee: null,
2139
2354
  ChangeCommittee: makeCommitteeChange(p4),
2355
+ Escrow: makeEscrow(p4, options),
2140
2356
  Batch: Schema11.Array(makeOperation(p4, options))
2141
2357
  },
2142
2358
  options
2143
2359
  );
2144
- var makeTransaction = (p4, options) => CamelCaseStruct({
2360
+ var makeTransactionRelease20260319 = (p4, options) => CamelCaseStruct({
2145
2361
  network_id: p4.NetworkId,
2146
2362
  sender: p4.Address,
2147
2363
  nonce: p4.Nonce,
@@ -2150,7 +2366,20 @@ var makeTransaction = (p4, options) => CamelCaseStruct({
2150
2366
  archival: Schema12.Boolean,
2151
2367
  fee_token: Schema12.NullOr(p4.TokenId)
2152
2368
  });
2153
- var makeVersionedTransaction = (p4, options) => TypedVariant({ Release20260319: makeTransaction(p4, options) });
2369
+ var makeTransactionRelease20260407 = (p4, options) => CamelCaseStruct({
2370
+ network_id: p4.NetworkId,
2371
+ sender: p4.Address,
2372
+ nonce: p4.Nonce,
2373
+ timestamp_nanos: p4.BigInt,
2374
+ claims: Schema12.Array(makeOperation(p4, options)),
2375
+ archival: Schema12.Boolean,
2376
+ fee_token: Schema12.NullOr(p4.TokenId)
2377
+ });
2378
+ var makeTransaction = makeTransactionRelease20260407;
2379
+ var makeVersionedTransaction = (p4, options) => TypedVariant({
2380
+ Release20260319: makeTransactionRelease20260319(p4, options),
2381
+ Release20260407: makeTransactionRelease20260407(p4, options)
2382
+ });
2154
2383
  var makeMultiSigConfig = (p4) => CamelCaseStruct({ authorized_signers: Schema13.Array(p4.Address), quorum: p4.Quorum, nonce: p4.Nonce });
2155
2384
  var makeMultiSig = (p4) => Schema13.Struct({
2156
2385
  config: makeMultiSigConfig(p4),
@@ -2203,6 +2432,23 @@ var makeProxySubmitTransactionResult = (p4) => TypedVariant({
2203
2432
  IncompleteVerifierSigs: null,
2204
2433
  IncompleteMultiSig: null
2205
2434
  });
2435
+ var makeEscrowJobRecord = (p4) => CamelCaseStruct({
2436
+ job_id: p4.TokenId,
2437
+ config_id: p4.TokenId,
2438
+ client: p4.Address,
2439
+ provider: p4.Address,
2440
+ evaluator: p4.Address,
2441
+ token_id: p4.TokenId,
2442
+ provider_fee: p4.Amount,
2443
+ evaluator_fee: p4.Amount,
2444
+ description: Schema14.String,
2445
+ deliverable: Schema14.NullOr(p4.TokenId),
2446
+ status: Schema14.String
2447
+ });
2448
+ var makeEscrowJobWithCerts = (p4) => Schema14.Struct({
2449
+ job: makeEscrowJobRecord(p4),
2450
+ certificates: Schema14.Array(makeTransactionCertificate(p4))
2451
+ });
2206
2452
  var makeSubmitTransactionParams = (p4) => makeTransactionEnvelope(p4);
2207
2453
  var makeFaucetDripParams = (p4) => CamelCaseStruct({
2208
2454
  recipient: p4.Address,
@@ -2252,6 +2498,17 @@ var GetTransactionCertificatesInput = Schema15.Struct({
2252
2498
  fromNonce: NonceFromInput,
2253
2499
  limit: Schema15.Number
2254
2500
  });
2501
+ var GetEscrowJobInput = Schema15.Struct({
2502
+ jobId: TokenIdFromInput,
2503
+ certs: Schema15.optionalWith(Schema15.Boolean, { default: () => false })
2504
+ });
2505
+ var GetEscrowJobsInput = Schema15.Struct({
2506
+ client: Schema15.optional(AddressFromInput),
2507
+ provider: Schema15.optional(AddressFromInput),
2508
+ evaluator: Schema15.optional(AddressFromInput),
2509
+ status: Schema15.optional(Schema15.String),
2510
+ certs: Schema15.optionalWith(Schema15.Boolean, { default: () => false })
2511
+ });
2255
2512
  var PrivateKeyFromInput = Schema16.Union(Uint8Array32, Uint8Array32FromHex0x, Uint8Array32FromNumberArray).pipe(Schema16.brand("PrivateKey"));
2256
2513
  var TokenTransferInput = Schema17.Struct({
2257
2514
  tokenId: TokenIdFromInput,
@@ -2293,7 +2550,7 @@ var StateUpdateInput = Schema17.Struct({
2293
2550
  previousState: StateFromInput,
2294
2551
  nextState: StateFromInput,
2295
2552
  computeClaimTxHash: StateKeyFromInput,
2296
- computeClaimTxTimestamp: BigIntFromNumberOrSelf
2553
+ computeClaimTxTimestamp: BigIntFromNumberOrStringOrSelf
2297
2554
  });
2298
2555
  var StateResetInput = Schema17.Struct({
2299
2556
  key: StateKeyFromInput,
@@ -2323,6 +2580,39 @@ var CommitteeChangeInput = Schema17.Struct({
2323
2580
  }),
2324
2581
  epoch: Schema17.Number
2325
2582
  });
2583
+ var FixedAmountOrBpsInput = Schema17.Union(
2584
+ Schema17.Struct({ type: Schema17.Literal("Fixed"), value: AmountFromInput }),
2585
+ Schema17.Struct({ type: Schema17.Literal("Bps"), value: Schema17.Number })
2586
+ );
2587
+ var EscrowCreateConfigInput = Schema17.Struct({
2588
+ tokenId: TokenIdFromInput,
2589
+ evaluator: AddressFromInput,
2590
+ evaluationFee: FixedAmountOrBpsInput,
2591
+ minEvaluatorFee: AmountFromInput
2592
+ });
2593
+ var EscrowCreateJobInput = Schema17.Struct({
2594
+ configId: TokenIdFromInput,
2595
+ provider: AddressFromInput,
2596
+ providerFee: AmountFromInput,
2597
+ description: Schema17.String
2598
+ });
2599
+ var EscrowSubmitInput = Schema17.Struct({
2600
+ jobId: TokenIdFromInput,
2601
+ deliverable: TokenIdFromInput
2602
+ });
2603
+ var EscrowRejectInput = Schema17.Struct({
2604
+ jobId: TokenIdFromInput
2605
+ });
2606
+ var EscrowCompleteInput = Schema17.Struct({
2607
+ jobId: TokenIdFromInput
2608
+ });
2609
+ var EscrowInput = Schema17.Union(
2610
+ Schema17.Struct({ type: Schema17.Literal("CreateConfig"), value: EscrowCreateConfigInput }),
2611
+ Schema17.Struct({ type: Schema17.Literal("CreateJob"), value: EscrowCreateJobInput }),
2612
+ Schema17.Struct({ type: Schema17.Literal("Submit"), value: EscrowSubmitInput }),
2613
+ Schema17.Struct({ type: Schema17.Literal("Reject"), value: EscrowRejectInput }),
2614
+ Schema17.Struct({ type: Schema17.Literal("Complete"), value: EscrowCompleteInput })
2615
+ );
2326
2616
  var OperationInput = Schema17.Union(
2327
2617
  Schema17.Struct({
2328
2618
  type: Schema17.Literal("TokenTransfer"),
@@ -2359,6 +2649,10 @@ var OperationInput = Schema17.Union(
2359
2649
  Schema17.Struct({
2360
2650
  type: Schema17.Literal("ChangeCommittee"),
2361
2651
  value: CommitteeChangeInput
2652
+ }),
2653
+ Schema17.Struct({
2654
+ type: Schema17.Literal("Escrow"),
2655
+ value: EscrowInput
2362
2656
  })
2363
2657
  );
2364
2658
  var ClaimTypeInput = Schema17.Union(
@@ -2368,15 +2662,66 @@ var ClaimTypeInput = Schema17.Union(
2368
2662
  value: Schema17.Array(OperationInput)
2369
2663
  })
2370
2664
  );
2371
- var TransactionInput = Schema17.Struct({
2665
+ var TransactionRelease20260319Input = Schema17.Struct({
2372
2666
  networkId: NetworkIdFromInput,
2373
2667
  sender: AddressFromInput,
2374
2668
  nonce: NonceFromInput,
2375
- timestampNanos: BigIntFromNumberOrSelf,
2669
+ timestampNanos: BigIntFromNumberOrStringOrSelf,
2376
2670
  claim: ClaimTypeInput,
2377
2671
  archival: Schema17.Boolean,
2378
2672
  feeToken: Schema17.NullOr(TokenIdFromInput)
2379
2673
  });
2674
+ var TransactionRelease20260407Input = Schema17.Struct({
2675
+ networkId: NetworkIdFromInput,
2676
+ sender: AddressFromInput,
2677
+ nonce: NonceFromInput,
2678
+ timestampNanos: BigIntFromNumberOrStringOrSelf,
2679
+ claims: Schema17.Array(OperationInput),
2680
+ archival: Schema17.Boolean,
2681
+ feeToken: Schema17.NullOr(TokenIdFromInput)
2682
+ });
2683
+ var TransactionVersionRegistry = {
2684
+ Release20260319: {
2685
+ wrapOperations(ops) {
2686
+ if (ops.length === 0) {
2687
+ throw new Error("Release20260319 transactions require at least one operation");
2688
+ }
2689
+ const claim = ops.length === 1 ? ops[0] : { type: "Batch", value: ops };
2690
+ return { claim };
2691
+ },
2692
+ extractOperations(decoded) {
2693
+ const claim = decoded.claim;
2694
+ if (claim == null) return [];
2695
+ if (typeof claim === "object" && !Array.isArray(claim)) {
2696
+ const rec = claim;
2697
+ if ("Batch" in rec && Array.isArray(rec.Batch)) {
2698
+ return rec.Batch;
2699
+ }
2700
+ if (rec.type === "Batch" && Array.isArray(rec.value)) {
2701
+ return rec.value;
2702
+ }
2703
+ return [claim];
2704
+ }
2705
+ return [];
2706
+ },
2707
+ inputSchema: TransactionRelease20260319Input
2708
+ },
2709
+ Release20260407: {
2710
+ wrapOperations(ops) {
2711
+ return { claims: ops };
2712
+ },
2713
+ extractOperations(decoded) {
2714
+ return Array.isArray(decoded.claims) ? decoded.claims : [];
2715
+ },
2716
+ inputSchema: TransactionRelease20260407Input
2717
+ }
2718
+ };
2719
+ function getTransactionVersionConfig(version) {
2720
+ if (!(version in TransactionVersionRegistry)) {
2721
+ throw new Error(`Unknown transaction version: ${version}`);
2722
+ }
2723
+ return TransactionVersionRegistry[version];
2724
+ }
2380
2725
  var RpcPalette = {
2381
2726
  Amount: AmountFromRpc,
2382
2727
  Balance: BalanceFromRpc,
@@ -2390,7 +2735,7 @@ var RpcPalette = {
2390
2735
  State: StateFromRpc,
2391
2736
  ClaimData: ClaimDataFromRpc,
2392
2737
  UserData: UserDataFromRpc,
2393
- BigInt: BigIntFromNumberOrSelf
2738
+ BigInt: BigIntFromNumberOrStringOrSelf
2394
2739
  };
2395
2740
  var RestPalette = {
2396
2741
  Amount: AmountFromRest,
@@ -2405,7 +2750,7 @@ var RestPalette = {
2405
2750
  State: StateFromRest,
2406
2751
  ClaimData: ClaimDataFromRest,
2407
2752
  UserData: UserDataFromRest,
2408
- BigInt: BigIntFromNumberOrSelf
2753
+ BigInt: BigIntFromNumberOrStringOrSelf
2409
2754
  };
2410
2755
  var BcsPalette = {
2411
2756
  Amount: AmountFromBcs,
@@ -2420,7 +2765,7 @@ var BcsPalette = {
2420
2765
  State: StateFromBcs,
2421
2766
  ClaimData: ClaimDataFromBcs,
2422
2767
  UserData: UserDataFromBcs,
2423
- BigInt: BigIntFromNumberOrSelf
2768
+ BigInt: BigIntFromNumberOrStringOrSelf
2424
2769
  };
2425
2770
  var p = BcsPalette;
2426
2771
  var TokenTransferFromBcs = makeTokenTransfer(p);
@@ -2438,8 +2783,17 @@ var ValidatorConfigFromBcs = makeValidatorConfig(p);
2438
2783
  var CommitteeConfigFromBcs = makeCommitteeConfig(p);
2439
2784
  var CommitteeChangeFromBcs = makeCommitteeChange(p);
2440
2785
  var bcsOpts = { unitEncoding: "bcs" };
2786
+ var FixedAmountOrBpsFromBcs = makeFixedAmountOrBps(p, bcsOpts);
2787
+ var EscrowCreateConfigFromBcs = makeEscrowCreateConfig(p, bcsOpts);
2788
+ var EscrowCreateJobFromBcs = makeEscrowCreateJob(p);
2789
+ var EscrowSubmitFromBcs = makeEscrowSubmit(p);
2790
+ var EscrowRejectFromBcs = makeEscrowReject(p);
2791
+ var EscrowCompleteFromBcs = makeEscrowComplete(p);
2792
+ var EscrowFromBcs = makeEscrow(p, bcsOpts);
2441
2793
  var OperationFromBcs = makeOperation(p, bcsOpts);
2442
2794
  var ClaimTypeFromBcs = makeClaimType(p, bcsOpts);
2795
+ var TransactionRelease20260319FromBcs = makeTransactionRelease20260319(p, bcsOpts);
2796
+ var TransactionRelease20260407FromBcs = makeTransactionRelease20260407(p, bcsOpts);
2443
2797
  var TransactionFromBcs = makeTransaction(p, bcsOpts);
2444
2798
  var VersionedTransactionFromBcs = makeVersionedTransaction(p, bcsOpts);
2445
2799
  var MultiSigConfigFromBcs = makeMultiSigConfig(p);
@@ -2456,6 +2810,8 @@ var TokenInfoResponseFromBcs = makeTokenInfoResponse(p);
2456
2810
  var SubmitTransactionResponseFromBcs = makeSubmitTransactionResponse(p);
2457
2811
  var ConfirmTransactionResponseFromBcs = makeConfirmTransactionResponse(p);
2458
2812
  var ProxySubmitTransactionResultFromBcs = makeProxySubmitTransactionResult(p);
2813
+ var EscrowJobRecordFromBcs = makeEscrowJobRecord(p);
2814
+ var EscrowJobWithCertsFromBcs = makeEscrowJobWithCerts(p);
2459
2815
  var p2 = RestPalette;
2460
2816
  var TokenTransferFromRest = makeTokenTransfer(p2);
2461
2817
  var TokenCreationFromRest = makeTokenCreation(p2);
@@ -2471,8 +2827,17 @@ var ExternalClaimFromRest = makeExternalClaim(p2);
2471
2827
  var ValidatorConfigFromRest = makeValidatorConfig(p2);
2472
2828
  var CommitteeConfigFromRest = makeCommitteeConfig(p2);
2473
2829
  var CommitteeChangeFromRest = makeCommitteeChange(p2);
2830
+ var FixedAmountOrBpsFromRest = makeFixedAmountOrBps(p2);
2831
+ var EscrowCreateConfigFromRest = makeEscrowCreateConfig(p2);
2832
+ var EscrowCreateJobFromRest = makeEscrowCreateJob(p2);
2833
+ var EscrowSubmitFromRest = makeEscrowSubmit(p2);
2834
+ var EscrowRejectFromRest = makeEscrowReject(p2);
2835
+ var EscrowCompleteFromRest = makeEscrowComplete(p2);
2836
+ var EscrowFromRest = makeEscrow(p2);
2474
2837
  var OperationFromRest = makeOperation(p2);
2475
2838
  var ClaimTypeFromRest = makeClaimType(p2);
2839
+ var TransactionRelease20260319FromRest = makeTransactionRelease20260319(p2);
2840
+ var TransactionRelease20260407FromRest = makeTransactionRelease20260407(p2);
2476
2841
  var TransactionFromRest = makeTransaction(p2);
2477
2842
  var VersionedTransactionFromRest = makeVersionedTransaction(p2);
2478
2843
  var MultiSigConfigFromRest = makeMultiSigConfig(p2);
@@ -2489,6 +2854,8 @@ var TokenInfoResponseFromRest = makeTokenInfoResponse(p2);
2489
2854
  var SubmitTransactionResponseFromRest = makeSubmitTransactionResponse(p2);
2490
2855
  var ConfirmTransactionResponseFromRest = makeConfirmTransactionResponse(p2);
2491
2856
  var ProxySubmitTransactionResultFromRest = makeProxySubmitTransactionResult(p2);
2857
+ var EscrowJobRecordFromRest = makeEscrowJobRecord(p2);
2858
+ var EscrowJobWithCertsFromRest = makeEscrowJobWithCerts(p2);
2492
2859
  var p3 = RpcPalette;
2493
2860
  var TokenTransferFromRpc = makeTokenTransfer(p3);
2494
2861
  var TokenCreationFromRpc = makeTokenCreation(p3);
@@ -2504,8 +2871,17 @@ var ExternalClaimFromRpc = makeExternalClaim(p3);
2504
2871
  var ValidatorConfigFromRpc = makeValidatorConfig(p3);
2505
2872
  var CommitteeConfigFromRpc = makeCommitteeConfig(p3);
2506
2873
  var CommitteeChangeFromRpc = makeCommitteeChange(p3);
2874
+ var FixedAmountOrBpsFromRpc = makeFixedAmountOrBps(p3);
2875
+ var EscrowCreateConfigFromRpc = makeEscrowCreateConfig(p3);
2876
+ var EscrowCreateJobFromRpc = makeEscrowCreateJob(p3);
2877
+ var EscrowSubmitFromRpc = makeEscrowSubmit(p3);
2878
+ var EscrowRejectFromRpc = makeEscrowReject(p3);
2879
+ var EscrowCompleteFromRpc = makeEscrowComplete(p3);
2880
+ var EscrowFromRpc = makeEscrow(p3);
2507
2881
  var OperationFromRpc = makeOperation(p3);
2508
2882
  var ClaimTypeFromRpc = makeClaimType(p3);
2883
+ var TransactionRelease20260319FromRpc = makeTransactionRelease20260319(p3);
2884
+ var TransactionRelease20260407FromRpc = makeTransactionRelease20260407(p3);
2509
2885
  var TransactionFromRpc = makeTransaction(p3);
2510
2886
  var VersionedTransactionFromRpc = makeVersionedTransaction(p3);
2511
2887
  var MultiSigConfigFromRpc = makeMultiSigConfig(p3);
@@ -2522,6 +2898,8 @@ var TokenInfoResponseFromRpc = makeTokenInfoResponse(p3);
2522
2898
  var SubmitTransactionResponseFromRpc = makeSubmitTransactionResponse(p3);
2523
2899
  var ConfirmTransactionResponseFromRpc = makeConfirmTransactionResponse(p3);
2524
2900
  var ProxySubmitTransactionResultFromRpc = makeProxySubmitTransactionResult(p3);
2901
+ var EscrowJobRecordFromRpc = makeEscrowJobRecord(p3);
2902
+ var EscrowJobWithCertsFromRpc = makeEscrowJobWithCerts(p3);
2525
2903
  var SubmitTransactionParamsFromRpc = makeSubmitTransactionParams(p3);
2526
2904
  var FaucetDripParamsFromRpc = makeFaucetDripParams(p3);
2527
2905
  var GetAccountInfoParamsFromRpc = makeGetAccountInfoParams(p3);
@@ -2529,115 +2907,8 @@ var GetPendingMultisigParamsFromRpc = makeGetPendingMultisigParams(p3);
2529
2907
  var GetTokenInfoParamsFromRpc = makeGetTokenInfoParams(p3);
2530
2908
  var GetTransactionCertificatesParamsFromRpc = makeGetTransactionCertificatesParams(p3);
2531
2909
 
2532
- // ../../packages/fast-sdk/dist/chunk-J4LYMR5I.mjs
2533
- import { Schema as Schema18 } from "effect";
2534
- import { Effect as Effect3, Schema as Schema22 } from "effect";
2535
-
2536
- // ../../node_modules/.pnpm/json-with-bigint@3.5.8/node_modules/json-with-bigint/json-with-bigint.js
2537
- var intRegex = /^-?\d+$/;
2538
- var noiseValue = /^-?\d+n+$/;
2539
- var originalStringify = JSON.stringify;
2540
- var originalParse = JSON.parse;
2541
- var customFormat = /^-?\d+n$/;
2542
- var bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
2543
- var noiseStringify = /([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
2544
- var JSONStringify = (value, replacer, space) => {
2545
- if ("rawJSON" in JSON) {
2546
- return originalStringify(
2547
- value,
2548
- (key, value2) => {
2549
- if (typeof value2 === "bigint") return JSON.rawJSON(value2.toString());
2550
- if (typeof replacer === "function") return replacer(key, value2);
2551
- if (Array.isArray(replacer) && replacer.includes(key)) return value2;
2552
- return value2;
2553
- },
2554
- space
2555
- );
2556
- }
2557
- if (!value) return originalStringify(value, replacer, space);
2558
- const convertedToCustomJSON = originalStringify(
2559
- value,
2560
- (key, value2) => {
2561
- const isNoise = typeof value2 === "string" && noiseValue.test(value2);
2562
- if (isNoise) return value2.toString() + "n";
2563
- if (typeof value2 === "bigint") return value2.toString() + "n";
2564
- if (typeof replacer === "function") return replacer(key, value2);
2565
- if (Array.isArray(replacer) && replacer.includes(key)) return value2;
2566
- return value2;
2567
- },
2568
- space
2569
- );
2570
- const processedJSON = convertedToCustomJSON.replace(
2571
- bigIntsStringify,
2572
- "$1$2$3"
2573
- );
2574
- const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3");
2575
- return denoisedJSON;
2576
- };
2577
- var featureCache = /* @__PURE__ */ new Map();
2578
- var isContextSourceSupported = () => {
2579
- const parseFingerprint = JSON.parse.toString();
2580
- if (featureCache.has(parseFingerprint)) {
2581
- return featureCache.get(parseFingerprint);
2582
- }
2583
- try {
2584
- const result2 = JSON.parse(
2585
- "1",
2586
- (_, __, context) => !!context?.source && context.source === "1"
2587
- );
2588
- featureCache.set(parseFingerprint, result2);
2589
- return result2;
2590
- } catch {
2591
- featureCache.set(parseFingerprint, false);
2592
- return false;
2593
- }
2594
- };
2595
- var convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
2596
- const isCustomFormatBigInt = typeof value === "string" && customFormat.test(value);
2597
- if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
2598
- const isNoiseValue = typeof value === "string" && noiseValue.test(value);
2599
- if (isNoiseValue) return value.slice(0, -1);
2600
- if (typeof userReviver !== "function") return value;
2601
- return userReviver(key, value, context);
2602
- };
2603
- var JSONParseV2 = (text, reviver) => {
2604
- return JSON.parse(text, (key, value, context) => {
2605
- const isBigNumber = typeof value === "number" && (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
2606
- const isInt = context && intRegex.test(context.source);
2607
- const isBigInt = isBigNumber && isInt;
2608
- if (isBigInt) return BigInt(context.source);
2609
- if (typeof reviver !== "function") return value;
2610
- return reviver(key, value, context);
2611
- });
2612
- };
2613
- var MAX_INT = Number.MAX_SAFE_INTEGER.toString();
2614
- var MAX_DIGITS = MAX_INT.length;
2615
- var stringsOrLargeNumbers = /"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
2616
- var noiseValueWithQuotes = /^"-?\d+n+"$/;
2617
- var JSONParse = (text, reviver) => {
2618
- if (!text) return originalParse(text, reviver);
2619
- if (isContextSourceSupported()) return JSONParseV2(text, reviver);
2620
- const serializedData = text.replace(
2621
- stringsOrLargeNumbers,
2622
- (text2, digits, fractional, exponential) => {
2623
- const isString = text2[0] === '"';
2624
- const isNoise = isString && noiseValueWithQuotes.test(text2);
2625
- if (isNoise) return text2.substring(0, text2.length - 1) + 'n"';
2626
- const isFractionalOrExponential = fractional || exponential;
2627
- const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
2628
- if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
2629
- return text2;
2630
- return '"' + text2 + 'n"';
2631
- }
2632
- );
2633
- return originalParse(
2634
- serializedData,
2635
- (key, value, context) => convertMarkedBigIntsReviver(key, value, context, reviver)
2636
- );
2637
- };
2638
-
2639
- // ../../packages/fast-sdk/dist/chunk-J4LYMR5I.mjs
2640
- import { Effect as Effect4, Schema as Schema32 } from "effect";
2910
+ // ../../packages/fast-sdk/dist/chunk-2WOJNW4N.js
2911
+ import { Effect as Effect4, Encoding as Encoding2, Schema as Schema22 } from "effect";
2641
2912
 
2642
2913
  // ../../node_modules/.pnpm/@noble+ed25519@3.0.1/node_modules/@noble/ed25519/index.js
2643
2914
  var ed25519_CURVE = {
@@ -3088,9 +3359,9 @@ var wNAF = (n) => {
3088
3359
  return { p: p4, f };
3089
3360
  };
3090
3361
 
3091
- // ../../packages/fast-sdk/dist/chunk-J4LYMR5I.mjs
3362
+ // ../../packages/fast-sdk/dist/chunk-2WOJNW4N.js
3092
3363
  import { Effect as Effect5 } from "effect";
3093
- import { Effect as Effect6, Schema as Schema42 } from "effect";
3364
+ import { Effect as Effect6, Schema as Schema32 } from "effect";
3094
3365
  var BcsEncodeError = class extends Data.TaggedError("BcsEncodeError") {
3095
3366
  };
3096
3367
  var SigningError = class extends Data.TaggedError("SigningError") {
@@ -3152,30 +3423,12 @@ var ValidatorGenericError = class extends Data2.TaggedError(
3152
3423
  };
3153
3424
  var RpcTimeoutError = class extends Data3.TaggedError("RpcTimeoutError") {
3154
3425
  };
3155
- var JsonRpcProtocolError = class extends Data3.TaggedError(
3156
- "JsonRpcProtocolError"
3157
- ) {
3426
+ var RestTimeoutError = class extends Data3.TaggedError("RestTimeoutError") {
3158
3427
  };
3159
- var RpcError = class extends Data3.TaggedError("RpcError") {
3428
+ var RestError = class extends Data3.TaggedError("RestError") {
3160
3429
  };
3161
3430
  var GeneralError = class extends Data4.TaggedError("GeneralError") {
3162
3431
  };
3163
- var FaucetDisabledError = class extends Data4.TaggedError(
3164
- "FaucetDisabledError"
3165
- ) {
3166
- };
3167
- var FaucetThrottledError = class extends Data4.TaggedError(
3168
- "FaucetThrottledError"
3169
- ) {
3170
- };
3171
- var FaucetTxnFailedError = class extends Data4.TaggedError(
3172
- "FaucetTxnFailedError"
3173
- ) {
3174
- };
3175
- var FaucetThresholdExceededError = class extends Data4.TaggedError(
3176
- "FaucetThresholdExceededError"
3177
- ) {
3178
- };
3179
3432
  var VerifierSigsInvalidError = class extends Data4.TaggedError(
3180
3433
  "VerifierSigsInvalidError"
3181
3434
  ) {
@@ -3194,174 +3447,214 @@ var InvalidRequestError = class extends Data4.TaggedError(
3194
3447
  "InvalidRequestError"
3195
3448
  ) {
3196
3449
  };
3197
- var toFastSetError = (message2, rpcErr) => {
3198
- if (rpcErr.type === "Generic") {
3199
- return new ValidatorGenericError({ message: rpcErr.value });
3200
- }
3201
- const err2 = rpcErr.value;
3202
- switch (err2.type) {
3203
- case "UnexpectedNonce":
3204
- return new UnexpectedNonceError({
3205
- message: message2,
3206
- expectedNonce: err2.value.expectedNonce
3207
- });
3208
- case "InsufficientFunding":
3209
- return new InsufficientFundingError({
3210
- message: message2,
3211
- currentBalance: err2.value.currentBalance
3212
- });
3213
- case "PreviousTransactionMustBeConfirmedFirst":
3214
- return new PreviousTransactionPendingError({
3215
- message: message2,
3216
- pendingConfirmation: err2.value.pendingConfirmation
3217
- });
3218
- case "InvalidSignature":
3219
- return new InvalidSignatureError({ message: message2, error: err2.value.error });
3220
- case "MissingEarlierConfirmations":
3221
- return new MissingEarlierConfirmationsError({
3222
- message: message2,
3223
- currentNonce: err2.value.currentNonce
3224
- });
3225
- case "CertificateTooYoung":
3226
- return new CertificateTooYoungError({
3227
- message: message2,
3228
- resendAfterNanos: err2.value.resendAfterNanos
3229
- });
3230
- case "NonSubmittableOperation":
3231
- return new NonSubmittableOperationError({
3232
- message: message2,
3233
- reason: err2.value.reason
3234
- });
3235
- default:
3236
- return new GeneralError({ message: message2 });
3237
- }
3450
+ var NotFoundError = class extends Data4.TaggedError("NotFoundError") {
3238
3451
  };
3239
- var parseRpcError = (err2) => {
3240
- const { code, message: message2, data } = err2;
3241
- if (code <= -32600 && code >= -32700) {
3242
- return new JsonRpcProtocolError({ code, message: message2 });
3243
- }
3244
- let parsed2;
3245
- try {
3246
- parsed2 = Schema18.decodeUnknownSync(ProxyErrorData)(data);
3247
- } catch {
3248
- return new RpcError({ code, message: message2, data });
3249
- }
3250
- switch (parsed2.type) {
3251
- case "RpcError":
3252
- return toFastSetError(message2, parsed2.value);
3253
- case "UnexpectedNonce":
3452
+ var IpRateLimitedError = class extends Data4.TaggedError(
3453
+ "IpRateLimitedError"
3454
+ ) {
3455
+ };
3456
+ var UpstreamError = class extends Data4.TaggedError("UpstreamError") {
3457
+ };
3458
+ var ServiceUnavailableError = class extends Data4.TaggedError(
3459
+ "ServiceUnavailableError"
3460
+ ) {
3461
+ };
3462
+ var parseRestError = (status, err2) => {
3463
+ const { code, message: message2, details } = err2;
3464
+ const d = details;
3465
+ switch (code) {
3466
+ case "INVALID_REQUEST":
3467
+ return new InvalidRequestError({ message: message2 });
3468
+ case "NOT_FOUND":
3469
+ return new NotFoundError({ message: message2 });
3470
+ case "TOO_MANY_CERTIFICATES_REQUESTED":
3471
+ return new TooManyCertificatesRequestedError({ message: message2 });
3472
+ case "UNEXPECTED_NONCE":
3254
3473
  return new ProxyUnexpectedNonceError({
3255
3474
  message: message2,
3256
- txNonce: parsed2.value.txNonce,
3257
- expectedNonce: parsed2.value.expectedNonce
3475
+ txNonce: BigInt(d?.tx_nonce ?? 0),
3476
+ expectedNonce: BigInt(d?.expected_nonce ?? 0)
3258
3477
  });
3259
- case "GeneralError":
3260
- return new GeneralError({ message: parsed2.value });
3261
- case "FaucetDisabled":
3262
- return new FaucetDisabledError({ message: message2 });
3263
- case "FaucetThrottled":
3264
- return new FaucetThrottledError({ message: message2 });
3265
- case "FaucetTxnFailed":
3266
- return new FaucetTxnFailedError({ message: message2 });
3267
- case "FaucetThresholdExceeded":
3268
- return new FaucetThresholdExceededError({ message: message2 });
3269
- case "VerifierSigsInvalid":
3478
+ case "VERIFIER_SIGNATURES_INVALID":
3270
3479
  return new VerifierSigsInvalidError({ message: message2 });
3271
- case "DatabaseError":
3272
- return new DatabaseError2({ message: parsed2.value });
3273
- case "TooManyCertificatesRequested":
3274
- return new TooManyCertificatesRequestedError({ message: message2 });
3275
- case "InvalidRequest":
3276
- return new InvalidRequestError({ message: parsed2.value });
3480
+ case "INTERNAL_ERROR":
3481
+ return new GeneralError({ message: message2 });
3482
+ case "UPSTREAM_ERROR":
3483
+ return new UpstreamError({ message: message2 });
3484
+ case "IP_RATE_LIMITED":
3485
+ return new IpRateLimitedError({
3486
+ message: message2,
3487
+ retryAfterSecs: d?.retry_after_secs ?? 0
3488
+ });
3489
+ case "SERVICE_UNAVAILABLE":
3490
+ return new ServiceUnavailableError({ message: message2 });
3491
+ case "DATABASE_ERROR":
3492
+ return new DatabaseError2({ message: message2 });
3277
3493
  default:
3278
- return new RpcError({ code, message: message2, data });
3494
+ return new RestError({ status, code, message: message2, details });
3279
3495
  }
3280
3496
  };
3281
- var nextId = 1;
3282
- var RpcResponse = Schema22.Struct({
3283
- jsonrpc: Schema22.Literal("2.0"),
3284
- id: Schema22.Number,
3285
- result: Schema22.optional(Schema22.Unknown),
3286
- error: Schema22.optional(
3287
- Schema22.Struct({
3288
- code: Schema22.Number,
3289
- message: Schema22.String,
3290
- data: Schema22.optional(Schema22.Unknown)
3291
- })
3292
- )
3497
+ var RestSuccessEnvelope = Schema19.Struct({
3498
+ data: Schema19.Unknown,
3499
+ meta: Schema19.Struct({ timestamp: Schema19.String })
3293
3500
  });
3294
- var rpcCallEffect = (url, method, params, timeoutMs = 15e3) => Effect3.gen(function* () {
3295
- const id = nextId++;
3296
- const body = JSONStringify({ jsonrpc: "2.0", id, method, params });
3297
- const res = yield* Effect3.tryPromise(
3298
- () => fetch(url, {
3299
- method: "POST",
3300
- headers: { "Content-Type": "application/json" },
3301
- body
3302
- })
3501
+ var RestErrorEnvelope = Schema19.Struct({
3502
+ error: Schema19.Struct({
3503
+ code: Schema19.String,
3504
+ message: Schema19.String,
3505
+ details: Schema19.optional(Schema19.Unknown)
3506
+ }),
3507
+ meta: Schema19.Struct({ timestamp: Schema19.String })
3508
+ });
3509
+ var restCallEffect = (baseUrl, opts) => {
3510
+ const timeoutMs = opts.timeoutMs ?? 15e3;
3511
+ return Effect3.gen(function* () {
3512
+ const url = new URL(`${baseUrl.replace(/\/$/, "")}${opts.path}`);
3513
+ if (opts.query) {
3514
+ for (const [k, v] of Object.entries(opts.query)) {
3515
+ if (v !== void 0) url.searchParams.set(k, v);
3516
+ }
3517
+ }
3518
+ const fetchOpts = { method: opts.method };
3519
+ if (opts.body !== void 0) {
3520
+ fetchOpts.headers = { "Content-Type": "application/json" };
3521
+ fetchOpts.body = JSONStringify(opts.body);
3522
+ }
3523
+ const res = yield* Effect3.tryPromise(() => fetch(url.toString(), fetchOpts));
3524
+ const text = yield* Effect3.tryPromise(() => res.text());
3525
+ let json;
3526
+ try {
3527
+ json = JSONParse(text);
3528
+ } catch {
3529
+ return yield* parseRestError(res.status, {
3530
+ code: `HTTP_${res.status}`,
3531
+ message: text.slice(0, 200)
3532
+ });
3533
+ }
3534
+ if (!res.ok) {
3535
+ const errEnv = yield* Schema19.decodeUnknown(RestErrorEnvelope)(json);
3536
+ return yield* parseRestError(res.status, errEnv.error);
3537
+ }
3538
+ const okEnv = yield* Schema19.decodeUnknown(RestSuccessEnvelope)(json);
3539
+ return okEnv.data;
3540
+ }).pipe(
3541
+ Effect3.timeout(`${timeoutMs} millis`),
3542
+ Effect3.catchTag(
3543
+ "TimeoutException",
3544
+ () => new RestTimeoutError({ path: opts.path, timeoutMs })
3545
+ )
3303
3546
  );
3304
- const text = yield* Effect3.tryPromise(() => res.text());
3305
- const json = yield* Schema22.decodeUnknown(RpcResponse)(JSONParse(text));
3306
- if (json.error) {
3307
- return yield* parseRpcError(json.error);
3308
- }
3309
- return json.result;
3310
- }).pipe(
3311
- Effect3.timeout(`${timeoutMs} millis`),
3312
- Effect3.catchTag(
3313
- "TimeoutException",
3314
- () => new RpcTimeoutError({ method, timeoutMs })
3315
- )
3316
- );
3317
- var submitTransaction = (rpcUrl, params) => Effect4.gen(function* () {
3318
- const wire = yield* Schema32.encode(SubmitTransactionParamsFromRpc)(params);
3319
- const result2 = yield* rpcCallEffect(
3320
- rpcUrl,
3321
- "proxy_submitTransaction",
3322
- wire
3547
+ };
3548
+ var addressToStr = (addr) => Schema22.encodeSync(AddressFromRest)(addr);
3549
+ var tokenIdToHex = (id) => Schema22.encodeSync(TokenIdFromRest)(id);
3550
+ var submitTransaction = (url, params) => Effect4.gen(function* () {
3551
+ const bcsEncoded = yield* Schema22.encode(VersionedTransactionFromBcs)(
3552
+ params.transaction
3553
+ );
3554
+ const txBytes = yield* encode(
3555
+ bcs_layout_exports.VersionedTransaction,
3556
+ bcsEncoded
3557
+ );
3558
+ const txHex = Encoding2.encodeHex(txBytes);
3559
+ const sigBcsEncoded = yield* Schema22.encode(SignatureOrMultiSigFromBcs)(
3560
+ params.signature
3561
+ );
3562
+ const sigBytes = yield* encode(
3563
+ bcs_layout_exports.SignatureOrMultiSig,
3564
+ sigBcsEncoded
3323
3565
  );
3324
- return yield* Schema32.decodeUnknown(ProxySubmitTransactionResultFromRpc)(
3566
+ const sigHex = Encoding2.encodeHex(sigBytes);
3567
+ const result2 = yield* restCallEffect(url, {
3568
+ method: "POST",
3569
+ path: "/v1/submit-transaction",
3570
+ body: {
3571
+ transaction: txHex,
3572
+ signature: sigHex,
3573
+ witness_certificates: []
3574
+ }
3575
+ });
3576
+ return yield* Schema22.decodeUnknown(ProxySubmitTransactionResultFromRest)(
3325
3577
  result2
3326
3578
  );
3327
3579
  });
3328
- var faucetDrip = (rpcUrl, params) => Effect4.gen(function* () {
3329
- const wire = yield* Schema32.encode(FaucetDripParamsFromRpc)(params);
3330
- yield* rpcCallEffect(rpcUrl, "proxy_faucetDrip", wire);
3580
+ var getAccountInfo = (url, params) => Effect4.gen(function* () {
3581
+ const addr = addressToStr(params.address);
3582
+ const result2 = yield* restCallEffect(url, {
3583
+ method: "GET",
3584
+ path: `/v1/accounts/${addr}`,
3585
+ query: {
3586
+ token_balances_filter: params.tokenBalancesFilter ? params.tokenBalancesFilter.map(tokenIdToHex).join(",") : void 0,
3587
+ state_key_filter: params.stateKeyFilter ? params.stateKeyFilter.map((k) => Encoding2.encodeHex(k)).join(",") : void 0
3588
+ }
3589
+ });
3590
+ return yield* Schema22.decodeUnknown(AccountInfoResponseFromRest)(result2);
3591
+ });
3592
+ var getPendingMultisigTransactions = (url, params) => Effect4.gen(function* () {
3593
+ const addr = addressToStr(params.address);
3594
+ const result2 = yield* restCallEffect(url, {
3595
+ method: "GET",
3596
+ path: `/v1/accounts/${addr}/pending-multisig-transactions`
3597
+ });
3598
+ return yield* Schema22.decodeUnknown(
3599
+ Schema22.Array(TransactionEnvelopeFromRest)
3600
+ )(result2);
3331
3601
  });
3332
- var getAccountInfo = (rpcUrl, params) => Effect4.gen(function* () {
3333
- const wire = yield* Schema32.encode(GetAccountInfoParamsFromRpc)(params);
3334
- const result2 = yield* rpcCallEffect(rpcUrl, "proxy_getAccountInfo", wire);
3335
- return yield* Schema32.decodeUnknown(AccountInfoResponseFromRpc)(result2);
3602
+ var getTokenInfo = (url, params) => Effect4.gen(function* () {
3603
+ const result2 = yield* restCallEffect(url, {
3604
+ method: "GET",
3605
+ path: "/v1/tokens",
3606
+ query: {
3607
+ token_ids: params.tokenIds.map(tokenIdToHex).join(",")
3608
+ }
3609
+ });
3610
+ return yield* Schema22.decodeUnknown(TokenInfoResponseFromRest)(result2);
3336
3611
  });
3337
- var getPendingMultisigTransactions = (rpcUrl, params) => Effect4.gen(function* () {
3338
- const wire = yield* Schema32.encode(GetPendingMultisigParamsFromRpc)(params);
3339
- const result2 = yield* rpcCallEffect(
3340
- rpcUrl,
3341
- "proxy_getPendingMultisigTransactions",
3342
- wire
3343
- );
3344
- return yield* Schema32.decodeUnknown(
3345
- Schema32.Array(TransactionEnvelopeFromRpc)
3612
+ var getTransactionCertificates = (url, params) => Effect4.gen(function* () {
3613
+ const addr = addressToStr(params.address);
3614
+ const result2 = yield* restCallEffect(url, {
3615
+ method: "GET",
3616
+ path: `/v1/accounts/${addr}/certificates`,
3617
+ query: {
3618
+ from_nonce: params.fromNonce.toString(),
3619
+ limit: params.limit.toString()
3620
+ }
3621
+ });
3622
+ return yield* Schema22.decodeUnknown(
3623
+ Schema22.Array(TransactionCertificateFromRest)
3346
3624
  )(result2);
3347
3625
  });
3348
- var getTokenInfo = (rpcUrl, params) => Effect4.gen(function* () {
3349
- const wire = yield* Schema32.encode(GetTokenInfoParamsFromRpc)(params);
3350
- const result2 = yield* rpcCallEffect(rpcUrl, "proxy_getTokenInfo", wire);
3351
- return yield* Schema32.decodeUnknown(TokenInfoResponseFromRpc)(result2);
3626
+ var getEscrowJob = (url, params) => Effect4.gen(function* () {
3627
+ const jobIdHex = tokenIdToHex(params.jobId);
3628
+ const result2 = yield* restCallEffect(url, {
3629
+ method: "GET",
3630
+ path: `/v1/escrow-jobs/${jobIdHex}`,
3631
+ query: { certs: params.certs ? "true" : void 0 }
3632
+ });
3633
+ if (params.certs) {
3634
+ return yield* Schema22.decodeUnknown(EscrowJobWithCertsFromRest)(result2);
3635
+ }
3636
+ return yield* Schema22.decodeUnknown(EscrowJobRecordFromRest)(result2);
3352
3637
  });
3353
- var getTransactionCertificates = (rpcUrl, params) => Effect4.gen(function* () {
3354
- const wire = yield* Schema32.encode(GetTransactionCertificatesParamsFromRpc)(
3355
- params
3356
- );
3357
- const result2 = yield* rpcCallEffect(
3358
- rpcUrl,
3359
- "proxy_getTransactionCertificates",
3360
- wire
3638
+ var getEscrowJobs = (url, params) => Effect4.gen(function* () {
3639
+ const result2 = yield* restCallEffect(url, {
3640
+ method: "GET",
3641
+ path: "/v1/escrow-jobs",
3642
+ query: {
3643
+ client: params.client ? addressToStr(params.client) : void 0,
3644
+ provider: params.provider ? addressToStr(params.provider) : void 0,
3645
+ evaluator: params.evaluator ? addressToStr(params.evaluator) : void 0,
3646
+ status: params.status,
3647
+ certs: params.certs ? "true" : void 0
3648
+ }
3649
+ });
3650
+ if (params.certs) {
3651
+ return yield* Schema22.decodeUnknown(
3652
+ Schema22.Array(EscrowJobWithCertsFromRest)
3653
+ )(result2);
3654
+ }
3655
+ return yield* Schema22.decodeUnknown(Schema22.Array(EscrowJobRecordFromRest))(
3656
+ result2
3361
3657
  );
3362
- return yield* Schema32.decodeUnknown(
3363
- Schema32.Array(TransactionCertificateFromRpc)
3364
- )(result2);
3365
3658
  });
3366
3659
  var signMessage = (privateKey, message2) => Effect5.tryPromise({
3367
3660
  try: () => signAsync(message2, privateKey),
@@ -3376,7 +3669,7 @@ var getPublicKey = (privateKey) => Effect5.tryPromise({
3376
3669
  catch: (cause) => new PublicKeyError({ cause })
3377
3670
  });
3378
3671
  var buildSignedEnvelope = (privateKey, transaction) => Effect6.gen(function* () {
3379
- const bcsEncoded = yield* Schema42.encode(VersionedTransactionFromBcs)(
3672
+ const bcsEncoded = yield* Schema32.encode(VersionedTransactionFromBcs)(
3380
3673
  transaction
3381
3674
  );
3382
3675
  const rawSig = yield* signTypedData(
@@ -3384,23 +3677,23 @@ var buildSignedEnvelope = (privateKey, transaction) => Effect6.gen(function* ()
3384
3677
  bcs_layout_exports.VersionedTransaction,
3385
3678
  bcsEncoded
3386
3679
  );
3387
- const signature = yield* Schema42.decodeUnknown(SignatureFromInput)(rawSig);
3680
+ const signature = yield* Schema32.decodeUnknown(SignatureFromInput)(rawSig);
3388
3681
  return {
3389
3682
  transaction,
3390
3683
  signature: { type: "Signature", value: signature }
3391
3684
  };
3392
3685
  });
3393
3686
 
3394
- // ../../packages/fast-sdk/dist/index.mjs
3687
+ // ../../packages/fast-sdk/dist/index.js
3395
3688
  import { bech32m as bech32m2 } from "bech32";
3396
- import { Encoding as Encoding2 } from "effect";
3397
- import { Schema as Schema19 } from "effect";
3689
+ import { Encoding as Encoding3 } from "effect";
3690
+ import { Schema as Schema20 } from "effect";
3398
3691
  import { Redacted, Schema as Schema23 } from "effect";
3399
3692
  import { Schema as Schema33 } from "effect";
3400
- var toHex3 = (bytes) => `0x${Encoding2.encodeHex(bytes)}`;
3693
+ var toHex3 = (bytes) => `0x${Encoding3.encodeHex(bytes)}`;
3401
3694
  var fromHex3 = (hex) => {
3402
3695
  const stripped = hex.startsWith("0x") || hex.startsWith("0X") ? hex.slice(2) : hex;
3403
- const result2 = Encoding2.decodeHex(stripped);
3696
+ const result2 = Encoding3.decodeHex(stripped);
3404
3697
  if (result2._tag === "Left") throw new Error(`Invalid hex string: ${hex}`);
3405
3698
  return result2.right;
3406
3699
  };
@@ -3413,53 +3706,61 @@ var fromFastAddress = (address) => {
3413
3706
  };
3414
3707
  var hashHex2 = (schema, message2) => run(hashHex(schema, message2));
3415
3708
  var FastProvider = class {
3416
- _rpcUrl;
3709
+ _url;
3417
3710
  constructor(opts) {
3418
- this._rpcUrl = opts.rpcUrl;
3711
+ this._url = opts.url;
3419
3712
  }
3420
- /** The proxy RPC URL this provider was constructed with. */
3421
- get rpcUrl() {
3422
- return this._rpcUrl;
3713
+ /** The proxy base URL this provider was constructed with. */
3714
+ get url() {
3715
+ return this._url;
3423
3716
  }
3424
3717
  /**
3425
3718
  * Submit a signed transaction envelope to the network.
3426
3719
  * The envelope should be produced by {@link TransactionBuilder.sign}.
3427
3720
  */
3428
3721
  async submitTransaction(params) {
3429
- return run(submitTransaction(this._rpcUrl, params));
3430
- }
3431
- /** Request a faucet drip for the given recipient. */
3432
- async faucetDrip(params) {
3433
- const internal = Schema19.decodeUnknownSync(FaucetDripInput)(params);
3434
- return run(faucetDrip(this._rpcUrl, internal));
3722
+ return run(submitTransaction(this._url, params));
3435
3723
  }
3436
3724
  /**
3437
3725
  * Fetch account information including balance, nonce, token balances, and state.
3438
3726
  * Use filters to request specific token balances or state keys.
3439
3727
  */
3440
3728
  async getAccountInfo(params) {
3441
- const internal = Schema19.decodeUnknownSync(GetAccountInfoInput)(params);
3442
- return run(getAccountInfo(this._rpcUrl, internal));
3729
+ const internal = Schema20.decodeUnknownSync(GetAccountInfoInput)(params);
3730
+ return run(getAccountInfo(this._url, internal));
3443
3731
  }
3444
3732
  /** Fetch pending multisig transactions for the given address. */
3445
3733
  async getPendingMultisigTransactions(params) {
3446
- const internal = Schema19.decodeUnknownSync(GetPendingMultisigInput)(params);
3447
- return run(getPendingMultisigTransactions(this._rpcUrl, internal));
3734
+ const internal = Schema20.decodeUnknownSync(GetPendingMultisigInput)(params);
3735
+ return run(getPendingMultisigTransactions(this._url, internal));
3448
3736
  }
3449
3737
  /** Fetch metadata for one or more tokens by their IDs. */
3450
3738
  async getTokenInfo(params) {
3451
- const internal = Schema19.decodeUnknownSync(GetTokenInfoInput)(params);
3452
- return run(getTokenInfo(this._rpcUrl, internal));
3739
+ const internal = Schema20.decodeUnknownSync(GetTokenInfoInput)(params);
3740
+ return run(getTokenInfo(this._url, internal));
3453
3741
  }
3454
3742
  /**
3455
3743
  * Fetch finalized transaction certificates for an address.
3456
3744
  * Results are paginated by nonce range.
3457
3745
  */
3458
3746
  async getTransactionCertificates(params) {
3459
- const internal = Schema19.decodeUnknownSync(GetTransactionCertificatesInput)(
3747
+ const internal = Schema20.decodeUnknownSync(GetTransactionCertificatesInput)(
3460
3748
  params
3461
3749
  );
3462
- return run(getTransactionCertificates(this._rpcUrl, internal));
3750
+ return run(getTransactionCertificates(this._url, internal));
3751
+ }
3752
+ /** Fetch a single escrow job by ID, optionally including certificates. */
3753
+ async getEscrowJob(params) {
3754
+ const internal = Schema20.decodeUnknownSync(GetEscrowJobInput)(params);
3755
+ return run(getEscrowJob(this._url, internal));
3756
+ }
3757
+ /**
3758
+ * List escrow jobs filtered by role (client, provider, or evaluator).
3759
+ * Optionally filter by status and include certificates.
3760
+ */
3761
+ async getEscrowJobs(params) {
3762
+ const internal = Schema20.decodeUnknownSync(GetEscrowJobsInput)(params);
3763
+ return run(getEscrowJobs(this._url, internal));
3463
3764
  }
3464
3765
  };
3465
3766
  var Signer = class {
@@ -3560,6 +3861,11 @@ var TransactionBuilder = class {
3560
3861
  this.operations.push({ type: "LeaveCommittee" });
3561
3862
  return this;
3562
3863
  }
3864
+ /** Add an escrow operation (CreateConfig, CreateJob, Submit, Reject, Complete). */
3865
+ addEscrow(params) {
3866
+ this.operations.push({ type: "Escrow", value: params });
3867
+ return this;
3868
+ }
3563
3869
  /** Update the nonce for the next {@link sign} call. */
3564
3870
  setNonce(nonce) {
3565
3871
  this.options = { ...this.options, nonce };
@@ -3585,22 +3891,24 @@ var TransactionBuilder = class {
3585
3891
  * @returns A signed {@link TransactionEnvelope} ready for submission.
3586
3892
  */
3587
3893
  async sign() {
3894
+ if (this.operations.length === 0) {
3895
+ throw new Error("TransactionBuilder.sign() requires at least one operation");
3896
+ }
3588
3897
  const { signer, networkId, nonce, version, archival, feeToken } = this.options;
3589
3898
  const sender = await signer.getPublicKey();
3590
3899
  const privateKey = await signer.getPrivateKey();
3591
3900
  const ops = this.operations;
3592
- const claim = ops.length === 1 ? ops[0] : { type: "Batch", value: ops };
3593
- const txInput = {
3901
+ const type = version ?? LatestTransactionVersion;
3902
+ const config = getTransactionVersionConfig(type);
3903
+ const internal = Schema33.decodeUnknownSync(config.inputSchema)({
3594
3904
  networkId,
3595
3905
  sender,
3596
3906
  nonce,
3597
3907
  timestampNanos: BigInt(Date.now()) * 1000000n,
3598
- claim,
3908
+ ...config.wrapOperations(ops),
3599
3909
  archival: archival ?? false,
3600
3910
  feeToken: feeToken ?? null
3601
- };
3602
- const internal = Schema33.decodeUnknownSync(TransactionInput)(txInput);
3603
- const type = version ?? "Release20260319";
3911
+ });
3604
3912
  const versioned = { type, value: internal };
3605
3913
  return run(buildSignedEnvelope(privateKey, versioned));
3606
3914
  }
@@ -9827,7 +10135,7 @@ function fromAbi(abi2, name, options) {
9827
10135
  return "name" in abiItem2 && abiItem2.name === name;
9828
10136
  });
9829
10137
  if (abiItems.length === 0)
9830
- throw new NotFoundError({ name });
10138
+ throw new NotFoundError2({ name });
9831
10139
  if (abiItems.length === 1)
9832
10140
  return {
9833
10141
  ...abiItems[0],
@@ -9879,7 +10187,7 @@ function fromAbi(abi2, name, options) {
9879
10187
  return { ...abiItem2, overloads };
9880
10188
  })();
9881
10189
  if (!abiItem)
9882
- throw new NotFoundError({ name });
10190
+ throw new NotFoundError2({ name });
9883
10191
  return {
9884
10192
  ...abiItem,
9885
10193
  ...prepare ? { hash: getSignatureHash(abiItem) } : {}
@@ -9942,7 +10250,7 @@ var AmbiguityError = class extends BaseError2 {
9942
10250
  });
9943
10251
  }
9944
10252
  };
9945
- var NotFoundError = class extends BaseError2 {
10253
+ var NotFoundError2 = class extends BaseError2 {
9946
10254
  constructor({ name, data, type = "item" }) {
9947
10255
  const selector = (() => {
9948
10256
  if (name)
@@ -9979,7 +10287,7 @@ function from11(abiConstructor) {
9979
10287
  function fromAbi2(abi2) {
9980
10288
  const item = abi2.find((item2) => item2.type === "constructor");
9981
10289
  if (!item)
9982
- throw new NotFoundError({ name: "constructor" });
10290
+ throw new NotFoundError2({ name: "constructor" });
9983
10291
  return item;
9984
10292
  }
9985
10293
 
@@ -10007,7 +10315,7 @@ function from12(abiFunction, options = {}) {
10007
10315
  function fromAbi3(abi2, name, options) {
10008
10316
  const item = fromAbi(abi2, name, options);
10009
10317
  if (item.type !== "function")
10010
- throw new NotFoundError({ name, type: "function" });
10318
+ throw new NotFoundError2({ name, type: "function" });
10011
10319
  return item;
10012
10320
  }
10013
10321
  function getSelector2(abiItem) {
@@ -12329,7 +12637,7 @@ var sepolia = /* @__PURE__ */ defineChain({
12329
12637
  });
12330
12638
 
12331
12639
  // ../../packages/allset-sdk/dist/index.js
12332
- import { Schema as Schema20 } from "effect";
12640
+ import { Schema as Schema21 } from "effect";
12333
12641
  function fastAddressToBytes(address) {
12334
12642
  try {
12335
12643
  return fromFastAddress(address);
@@ -12865,7 +13173,7 @@ async function approveErc20(clients, token, spender, amount) {
12865
13173
  }
12866
13174
  }
12867
13175
  async function evmSign(certificate, crossSignUrl) {
12868
- const wireFormat = Schema20.encodeSync(TransactionCertificateFromRpc)(
13176
+ const wireFormat = Schema21.encodeSync(TransactionCertificateFromRpc)(
12869
13177
  certificate
12870
13178
  );
12871
13179
  const serialized = bigIntToNumber(wireFormat);
@@ -13182,9 +13490,9 @@ var FastRpcLive = Layer3.effect(
13182
13490
  const config = yield* ClientConfig;
13183
13491
  const getRpcUrl = () => networkConfig.resolve(config.network).pipe(
13184
13492
  Effect8.map((n) => {
13185
- if (config.debug) process.stderr.write(`[debug] rpcUrl: ${n.rpcUrl}
13493
+ if (config.debug) process.stderr.write(`[debug] url: ${n.url}
13186
13494
  `);
13187
- return n.rpcUrl;
13495
+ return n.url;
13188
13496
  }),
13189
13497
  Effect8.mapError(
13190
13498
  (e) => new FastSdkError({ message: e.message, cause: e })
@@ -13228,7 +13536,7 @@ var FastRpcLive = Layer3.effect(
13228
13536
 
13229
13537
  // ../../packages/x402-client/dist/bridge.js
13230
13538
  async function getFastBalance(wallet, options) {
13231
- const provider = new FastProvider({ rpcUrl: options.rpcUrl });
13539
+ const provider = new FastProvider({ url: options.rpcUrl });
13232
13540
  const signer = new Signer(wallet.privateKey);
13233
13541
  const publicKey = await signer.getPublicKey();
13234
13542
  try {
@@ -13265,7 +13573,7 @@ async function bridgeFastusdcToUsdc(params) {
13265
13573
  log(` From: ${fastWallet.address}`);
13266
13574
  log(` To: ${evmReceiverAddress}`);
13267
13575
  try {
13268
- const provider = new FastProvider({ rpcUrl });
13576
+ const provider = new FastProvider({ url: rpcUrl });
13269
13577
  const signer = new Signer(fastWallet.privateKey);
13270
13578
  const publicKey = await signer.getPublicKey();
13271
13579
  const derivedAddress = toFastAddress(publicKey);
@@ -13298,12 +13606,13 @@ async function bridgeFastusdcToUsdc(params) {
13298
13606
  }
13299
13607
 
13300
13608
  // ../../packages/x402-client/dist/fast.js
13609
+ import { Schema as Schema24 } from "effect";
13301
13610
  var fastProviders = {};
13302
- function getFastProvider(rpcUrl) {
13303
- if (!fastProviders[rpcUrl]) {
13304
- fastProviders[rpcUrl] = new FastProvider({ rpcUrl });
13611
+ function getFastProvider(url) {
13612
+ if (!fastProviders[url]) {
13613
+ fastProviders[url] = new FastProvider({ url });
13305
13614
  }
13306
- return fastProviders[rpcUrl];
13615
+ return fastProviders[url];
13307
13616
  }
13308
13617
  function toHuman(rawAmount, decimals) {
13309
13618
  return (Number(rawAmount) / Math.pow(10, decimals)).toString();
@@ -13408,8 +13717,7 @@ async function handleFastPayment(url, method, customHeaders, requestBody, paymen
13408
13717
  }
13409
13718
  log(` Transaction complete in ${Date.now() - txStartTime}ms`);
13410
13719
  const certificate = submitResult.value;
13411
- const tx = certificate.envelope.transaction;
13412
- const bcsInput = { [tx.type]: tx.value };
13720
+ const bcsInput = Schema24.encodeSync(VersionedTransactionFromBcs)(certificate.envelope.transaction);
13413
13721
  const txHash = await hashHex2(bcs_layout_exports.VersionedTransaction, bcsInput);
13414
13722
  log(` txHash: ${txHash}`);
13415
13723
  log(`[Fast] Building x402 payment payload...`);
@@ -17780,13 +18088,13 @@ var infoStatus = {
17780
18088
  const defaultLabel = isDefault ? " (default)" : "";
17781
18089
  yield* output.humanLine(`Network: ${config.network}${defaultLabel}`);
17782
18090
  yield* output.humanLine(
17783
- ` Fast RPC: ${network2.rpcUrl} ${healthy ? "\u2713 healthy" : "\u2717 unreachable"}`
18091
+ ` Fast RPC: ${network2.url} ${healthy ? "\u2713 healthy" : "\u2717 unreachable"}`
17784
18092
  );
17785
18093
  yield* output.humanLine(` Explorer: ${network2.explorerUrl}`);
17786
18094
  yield* output.ok({
17787
18095
  network: config.network,
17788
18096
  fast: {
17789
- rpcUrl: network2.rpcUrl,
18097
+ url: network2.url,
17790
18098
  explorerUrl: network2.explorerUrl,
17791
18099
  healthy
17792
18100
  }
@@ -18295,7 +18603,7 @@ var pay2 = {
18295
18603
  privateKey: toHex3(seed),
18296
18604
  publicKey,
18297
18605
  address: fastAddress,
18298
- rpcUrl: network2.rpcUrl
18606
+ rpcUrl: network2.url
18299
18607
  };
18300
18608
  const evmWallet = {
18301
18609
  type: "evm",
@@ -18370,7 +18678,7 @@ var pay2 = {
18370
18678
 
18371
18679
  // src/commands/send.ts
18372
18680
  import { bech32m as bech32m4 } from "bech32";
18373
- import { Effect as Effect34, Schema as Schema21 } from "effect";
18681
+ import { Effect as Effect34, Schema as Schema25 } from "effect";
18374
18682
  var send = {
18375
18683
  cmd: "send",
18376
18684
  handler: (args) => Effect34.gen(function* () {
@@ -18553,7 +18861,7 @@ var send = {
18553
18861
  );
18554
18862
  }
18555
18863
  const signer = new Signer(seed);
18556
- const provider = new FastProvider({ rpcUrl: network2.rpcUrl });
18864
+ const provider = new FastProvider({ url: network2.url });
18557
18865
  const bridgeResult = yield* bridge.withdraw({
18558
18866
  fastBridgeAddress: chainCfg.fastBridgeAddress,
18559
18867
  relayerUrl: chainCfg.relayerUrl,
@@ -18605,7 +18913,7 @@ var send = {
18605
18913
  })
18606
18914
  });
18607
18915
  yield* rpc.submitTransaction(envelope);
18608
- const bcsInput = yield* Schema21.encode(VersionedTransactionFromBcs)(
18916
+ const bcsInput = yield* Schema25.encode(VersionedTransactionFromBcs)(
18609
18917
  envelope.transaction
18610
18918
  ).pipe(
18611
18919
  Effect34.mapError(
@@ -19001,9 +19309,9 @@ var resolveNetwork = async () => {
19001
19309
  if (parsed.network) return parsed.network;
19002
19310
  try {
19003
19311
  const { Effect: Eff, ManagedRuntime, Layer: Layer7 } = await import("effect");
19004
- const { NetworkConfigService: NetworkConfigService2 } = await import("./network-5PLYLKX3.js");
19312
+ const { NetworkConfigService: NetworkConfigService2 } = await import("./network-QDRK4P6X.js");
19005
19313
  const { DatabaseLive: DatabaseLive2 } = await import("./database-NXA7GQKE.js");
19006
- const { AppConfigLive: AppConfigLive2 } = await import("./app-IJ6QEQ2I.js");
19314
+ const { AppConfigLive: AppConfigLive2 } = await import("./app-PZWIJK2U.js");
19007
19315
  const layer = Layer7.provide(NetworkConfigService2.Default, Layer7.merge(DatabaseLive2, AppConfigLive2));
19008
19316
  const runtime = ManagedRuntime.make(layer);
19009
19317
  const name = await runtime.runPromise(