agentcash 0.9.1 → 0.9.3
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/cjs/run-server.cjs +349 -323
- package/dist/esm/{add-skill-CPSJHRFF.js → add-skill-U34U44YC.js} +5 -4
- package/dist/esm/{add-skill-CPSJHRFF.js.map → add-skill-U34U44YC.js.map} +1 -1
- package/dist/esm/{check-YVZ3KR2P.js → check-DXJXBWT2.js} +5 -4
- package/dist/esm/{check-YVZ3KR2P.js.map → check-DXJXBWT2.js.map} +1 -1
- package/dist/esm/{chunk-CM6NIM6K.js → chunk-I5GPG6M6.js} +4 -2
- package/dist/esm/chunk-I5GPG6M6.js.map +1 -0
- package/dist/esm/{chunk-6FEDQ4HI.js → chunk-I64SAKMT.js} +6 -3
- package/dist/esm/chunk-I64SAKMT.js.map +1 -0
- package/dist/esm/{chunk-IB75YFBW.js → chunk-IMJKJGRG.js} +2 -2
- package/dist/esm/chunk-JPUCBTWC.js +79 -0
- package/dist/esm/chunk-JPUCBTWC.js.map +1 -0
- package/dist/esm/{chunk-NEJKY3UL.js → chunk-KFJDRCNE.js} +7 -2
- package/dist/esm/{chunk-NEJKY3UL.js.map → chunk-KFJDRCNE.js.map} +1 -1
- package/dist/esm/{chunk-G3AVBW3H.js → chunk-LOKWX2HK.js} +36 -13
- package/dist/esm/chunk-LOKWX2HK.js.map +1 -0
- package/dist/esm/{chunk-UVO3ZZGC.js → chunk-LUWOAFE2.js} +30 -18
- package/dist/esm/chunk-LUWOAFE2.js.map +1 -0
- package/dist/esm/{chunk-7QBTMZ6P.js → chunk-OJ7TLSTP.js} +2 -2
- package/dist/esm/{chunk-VBQYLC7F.js → chunk-RXSYAZUA.js} +2 -2
- package/dist/esm/chunk-TTAO2EJK.js +10 -0
- package/dist/esm/chunk-TTAO2EJK.js.map +1 -0
- package/dist/esm/{chunk-RAFN7MFS.js → chunk-UPEWVW6F.js} +22 -5
- package/dist/esm/chunk-UPEWVW6F.js.map +1 -0
- package/dist/esm/{chunk-WROGRZ4L.js → chunk-X46IRIC5.js} +2 -2
- package/dist/esm/{chunk-ST5ITYIM.js → chunk-X6IKKHHP.js} +5 -4
- package/dist/esm/{chunk-ST5ITYIM.js.map → chunk-X6IKKHHP.js.map} +1 -1
- package/dist/esm/{chunk-4Q7QFS3O.js → chunk-XADII4KF.js} +2 -2
- package/dist/esm/{chunk-U2I7LBH4.js → chunk-XGV3H2AG.js} +6 -3
- package/dist/esm/{chunk-U2I7LBH4.js.map → chunk-XGV3H2AG.js.map} +1 -1
- package/dist/esm/chunk-XZVPAEDA.js +7 -0
- package/dist/esm/{fetch-IQ6WDIU7.js → fetch-WVBTB2ZC.js} +11 -10
- package/dist/esm/{fetch-IQ6WDIU7.js.map → fetch-WVBTB2ZC.js.map} +1 -1
- package/dist/esm/{fetch-auth-KEO66U6Q.js → fetch-auth-L43YZQKM.js} +8 -7
- package/dist/esm/{fetch-auth-KEO66U6Q.js.map → fetch-auth-L43YZQKM.js.map} +1 -1
- package/dist/esm/{fund-WJNWLQWZ.js → fund-GDQGBL4O.js} +4 -4
- package/dist/esm/index.js +25 -24
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{install-ZGLLK225.js → install-DSGVSQUA.js} +9 -8
- package/dist/esm/install-DSGVSQUA.js.map +1 -0
- package/dist/esm/{onboard-KORBDJEE.js → onboard-6QKPAT4E.js} +13 -9
- package/dist/esm/onboard-6QKPAT4E.js.map +1 -0
- package/dist/esm/{origins-EYBTV3GF.js → origins-GFGI6TY3.js} +5 -4
- package/dist/esm/{origins-EYBTV3GF.js.map → origins-GFGI6TY3.js.map} +1 -1
- package/dist/esm/{report-error-352HDKYW.js → report-error-4S3UZ6UV.js} +7 -6
- package/dist/esm/{report-error-352HDKYW.js.map → report-error-4S3UZ6UV.js.map} +1 -1
- package/dist/esm/{server-UAIAMGJS.js → server-6VNA4WK6.js} +2 -2
- package/dist/esm/{server-45ZQGODV.js → server-DXRVE6YW.js} +24 -21
- package/dist/esm/server-DXRVE6YW.js.map +1 -0
- package/dist/esm/{settings-NIG3JCWL.js → settings-XQZYE7XS.js} +7 -6
- package/dist/esm/{settings-NIG3JCWL.js.map → settings-XQZYE7XS.js.map} +1 -1
- package/dist/esm/{try-IH77VUTC.js → try-WPFY4KZL.js} +9 -8
- package/dist/esm/{try-IH77VUTC.js.map → try-WPFY4KZL.js.map} +1 -1
- package/dist/esm/{wallet-RXHBDJED.js → wallet-2GMS734S.js} +13 -15
- package/dist/esm/wallet-2GMS734S.js.map +1 -0
- package/package.json +4 -4
- package/dist/esm/chunk-6FEDQ4HI.js.map +0 -1
- package/dist/esm/chunk-CM6NIM6K.js.map +0 -1
- package/dist/esm/chunk-G3AVBW3H.js.map +0 -1
- package/dist/esm/chunk-P7WFI336.js +0 -112
- package/dist/esm/chunk-P7WFI336.js.map +0 -1
- package/dist/esm/chunk-RAFN7MFS.js.map +0 -1
- package/dist/esm/chunk-SF3JWCTJ.js +0 -7
- package/dist/esm/chunk-UVO3ZZGC.js.map +0 -1
- package/dist/esm/install-ZGLLK225.js.map +0 -1
- package/dist/esm/onboard-KORBDJEE.js.map +0 -1
- package/dist/esm/server-45ZQGODV.js.map +0 -1
- package/dist/esm/wallet-RXHBDJED.js.map +0 -1
- /package/dist/esm/{chunk-IB75YFBW.js.map → chunk-IMJKJGRG.js.map} +0 -0
- /package/dist/esm/{chunk-7QBTMZ6P.js.map → chunk-OJ7TLSTP.js.map} +0 -0
- /package/dist/esm/{chunk-VBQYLC7F.js.map → chunk-RXSYAZUA.js.map} +0 -0
- /package/dist/esm/{chunk-WROGRZ4L.js.map → chunk-X46IRIC5.js.map} +0 -0
- /package/dist/esm/{chunk-4Q7QFS3O.js.map → chunk-XADII4KF.js.map} +0 -0
- /package/dist/esm/{chunk-SF3JWCTJ.js.map → chunk-XZVPAEDA.js.map} +0 -0
- /package/dist/esm/{fund-WJNWLQWZ.js.map → fund-GDQGBL4O.js.map} +0 -0
- /package/dist/esm/{server-UAIAMGJS.js.map → server-6VNA4WK6.js.map} +0 -0
package/dist/cjs/run-server.cjs
CHANGED
|
@@ -13061,12 +13061,12 @@ var init_lru = __esm({
|
|
|
13061
13061
|
});
|
|
13062
13062
|
|
|
13063
13063
|
// ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/address/getAddress.js
|
|
13064
|
-
function checksumAddress(address_,
|
|
13065
|
-
if (checksumAddressCache.has(`${address_}.${
|
|
13066
|
-
return checksumAddressCache.get(`${address_}.${
|
|
13067
|
-
const hexAddress =
|
|
13064
|
+
function checksumAddress(address_, chainId2) {
|
|
13065
|
+
if (checksumAddressCache.has(`${address_}.${chainId2}`))
|
|
13066
|
+
return checksumAddressCache.get(`${address_}.${chainId2}`);
|
|
13067
|
+
const hexAddress = chainId2 ? `${chainId2}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
|
|
13068
13068
|
const hash8 = keccak2562(stringToBytes(hexAddress), "bytes");
|
|
13069
|
-
const address2 = (
|
|
13069
|
+
const address2 = (chainId2 ? hexAddress.substring(`${chainId2}0x`.length) : hexAddress).split("");
|
|
13070
13070
|
for (let i = 0; i < 40; i += 2) {
|
|
13071
13071
|
if (hash8[i >> 1] >> 4 >= 8 && address2[i]) {
|
|
13072
13072
|
address2[i] = address2[i].toUpperCase();
|
|
@@ -13076,13 +13076,13 @@ function checksumAddress(address_, chainId3) {
|
|
|
13076
13076
|
}
|
|
13077
13077
|
}
|
|
13078
13078
|
const result = `0x${address2.join("")}`;
|
|
13079
|
-
checksumAddressCache.set(`${address_}.${
|
|
13079
|
+
checksumAddressCache.set(`${address_}.${chainId2}`, result);
|
|
13080
13080
|
return result;
|
|
13081
13081
|
}
|
|
13082
|
-
function getAddress(address2,
|
|
13082
|
+
function getAddress(address2, chainId2) {
|
|
13083
13083
|
if (!isAddress(address2, { strict: false }))
|
|
13084
13084
|
throw new InvalidAddressError2({ address: address2 });
|
|
13085
|
-
return checksumAddress(address2,
|
|
13085
|
+
return checksumAddress(address2, chainId2);
|
|
13086
13086
|
}
|
|
13087
13087
|
var checksumAddressCache;
|
|
13088
13088
|
var init_getAddress = __esm({
|
|
@@ -16329,8 +16329,8 @@ var init_chain = __esm({
|
|
|
16329
16329
|
}
|
|
16330
16330
|
};
|
|
16331
16331
|
InvalidChainIdError2 = class extends BaseError3 {
|
|
16332
|
-
constructor({ chainId:
|
|
16333
|
-
super(typeof
|
|
16332
|
+
constructor({ chainId: chainId2 }) {
|
|
16333
|
+
super(typeof chainId2 === "number" ? `Chain ID "${chainId2}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
|
16334
16334
|
}
|
|
16335
16335
|
};
|
|
16336
16336
|
}
|
|
@@ -22189,12 +22189,12 @@ var init_lru2 = __esm({
|
|
|
22189
22189
|
});
|
|
22190
22190
|
|
|
22191
22191
|
// ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@3.25.76/node_modules/viem/_esm/utils/address/getAddress.js
|
|
22192
|
-
function checksumAddress2(address_,
|
|
22193
|
-
if (checksumAddressCache2.has(`${address_}.${
|
|
22194
|
-
return checksumAddressCache2.get(`${address_}.${
|
|
22195
|
-
const hexAddress =
|
|
22192
|
+
function checksumAddress2(address_, chainId2) {
|
|
22193
|
+
if (checksumAddressCache2.has(`${address_}.${chainId2}`))
|
|
22194
|
+
return checksumAddressCache2.get(`${address_}.${chainId2}`);
|
|
22195
|
+
const hexAddress = chainId2 ? `${chainId2}${address_.toLowerCase()}` : address_.substring(2).toLowerCase();
|
|
22196
22196
|
const hash8 = keccak2563(stringToBytes2(hexAddress), "bytes");
|
|
22197
|
-
const address2 = (
|
|
22197
|
+
const address2 = (chainId2 ? hexAddress.substring(`${chainId2}0x`.length) : hexAddress).split("");
|
|
22198
22198
|
for (let i = 0; i < 40; i += 2) {
|
|
22199
22199
|
if (hash8[i >> 1] >> 4 >= 8 && address2[i]) {
|
|
22200
22200
|
address2[i] = address2[i].toUpperCase();
|
|
@@ -22204,13 +22204,13 @@ function checksumAddress2(address_, chainId3) {
|
|
|
22204
22204
|
}
|
|
22205
22205
|
}
|
|
22206
22206
|
const result = `0x${address2.join("")}`;
|
|
22207
|
-
checksumAddressCache2.set(`${address_}.${
|
|
22207
|
+
checksumAddressCache2.set(`${address_}.${chainId2}`, result);
|
|
22208
22208
|
return result;
|
|
22209
22209
|
}
|
|
22210
|
-
function getAddress2(address2,
|
|
22210
|
+
function getAddress2(address2, chainId2) {
|
|
22211
22211
|
if (!isAddress3(address2, { strict: false }))
|
|
22212
22212
|
throw new InvalidAddressError3({ address: address2 });
|
|
22213
|
-
return checksumAddress2(address2,
|
|
22213
|
+
return checksumAddress2(address2, chainId2);
|
|
22214
22214
|
}
|
|
22215
22215
|
var checksumAddressCache2;
|
|
22216
22216
|
var init_getAddress2 = __esm({
|
|
@@ -35985,14 +35985,14 @@ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
|
|
35985
35985
|
return ret;
|
|
35986
35986
|
};
|
|
35987
35987
|
parser.ast.callbacks.version = version7;
|
|
35988
|
-
const
|
|
35988
|
+
const chainId2 = function(state, chars, phraseIndex, phraseLength, data) {
|
|
35989
35989
|
const ret = id.SEM_OK;
|
|
35990
35990
|
if (state === id.SEM_PRE) {
|
|
35991
35991
|
data.chainId = (0, utils_1.parseIntegerNumber)(node_exports_1.default.utils.charsToString(chars, phraseIndex, phraseLength));
|
|
35992
35992
|
}
|
|
35993
35993
|
return ret;
|
|
35994
35994
|
};
|
|
35995
|
-
parser.ast.callbacks["chain-id"] =
|
|
35995
|
+
parser.ast.callbacks["chain-id"] = chainId2;
|
|
35996
35996
|
const nonce2 = function(state, chars, phraseIndex, phraseLength, data) {
|
|
35997
35997
|
const ret = id.SEM_OK;
|
|
35998
35998
|
if (state === id.SEM_PRE) {
|
|
@@ -43657,8 +43657,8 @@ var require_signature = __commonJS({
|
|
|
43657
43657
|
* //_result:
|
|
43658
43658
|
*
|
|
43659
43659
|
*/
|
|
43660
|
-
static getChainIdV(
|
|
43661
|
-
return (0, index_js_2.getBigInt)(
|
|
43660
|
+
static getChainIdV(chainId2, v) {
|
|
43661
|
+
return (0, index_js_2.getBigInt)(chainId2) * BN_2 + BigInt(35 + v - 27);
|
|
43662
43662
|
}
|
|
43663
43663
|
/**
|
|
43664
43664
|
* Compute the normalized legacy transaction ``v`` from a ``yParirty``,
|
|
@@ -45787,12 +45787,12 @@ var require_transaction = __commonJS({
|
|
|
45787
45787
|
if (r === BN_0 && s === BN_0) {
|
|
45788
45788
|
tx.chainId = v;
|
|
45789
45789
|
} else {
|
|
45790
|
-
let
|
|
45791
|
-
if (
|
|
45792
|
-
|
|
45790
|
+
let chainId2 = (v - BN_35) / BN_2;
|
|
45791
|
+
if (chainId2 < BN_0) {
|
|
45792
|
+
chainId2 = BN_0;
|
|
45793
45793
|
}
|
|
45794
|
-
tx.chainId =
|
|
45795
|
-
(0, index_js_3.assertArgument)(
|
|
45794
|
+
tx.chainId = chainId2;
|
|
45795
|
+
(0, index_js_3.assertArgument)(chainId2 !== BN_0 || (v === BN_27 || v === BN_28), "non-canonical legacy v", "v", fields[6]);
|
|
45796
45796
|
tx.signature = index_js_2.Signature.from({
|
|
45797
45797
|
r: (0, index_js_3.zeroPadValue)(fields[7], 32),
|
|
45798
45798
|
s: (0, index_js_3.zeroPadValue)(fields[8], 32),
|
|
@@ -45810,27 +45810,27 @@ var require_transaction = __commonJS({
|
|
|
45810
45810
|
formatNumber(tx.value, "value"),
|
|
45811
45811
|
tx.data
|
|
45812
45812
|
];
|
|
45813
|
-
let
|
|
45813
|
+
let chainId2 = BN_0;
|
|
45814
45814
|
if (tx.chainId != BN_0) {
|
|
45815
|
-
|
|
45816
|
-
(0, index_js_3.assertArgument)(!sig || sig.networkV == null || sig.legacyChainId ===
|
|
45815
|
+
chainId2 = (0, index_js_3.getBigInt)(tx.chainId, "tx.chainId");
|
|
45816
|
+
(0, index_js_3.assertArgument)(!sig || sig.networkV == null || sig.legacyChainId === chainId2, "tx.chainId/sig.v mismatch", "sig", sig);
|
|
45817
45817
|
} else if (tx.signature) {
|
|
45818
45818
|
const legacy = tx.signature.legacyChainId;
|
|
45819
45819
|
if (legacy != null) {
|
|
45820
|
-
|
|
45820
|
+
chainId2 = legacy;
|
|
45821
45821
|
}
|
|
45822
45822
|
}
|
|
45823
45823
|
if (!sig) {
|
|
45824
|
-
if (
|
|
45825
|
-
fields.push((0, index_js_3.toBeArray)(
|
|
45824
|
+
if (chainId2 !== BN_0) {
|
|
45825
|
+
fields.push((0, index_js_3.toBeArray)(chainId2));
|
|
45826
45826
|
fields.push("0x");
|
|
45827
45827
|
fields.push("0x");
|
|
45828
45828
|
}
|
|
45829
45829
|
return (0, index_js_3.encodeRlp)(fields);
|
|
45830
45830
|
}
|
|
45831
45831
|
let v = BigInt(27 + sig.yParity);
|
|
45832
|
-
if (
|
|
45833
|
-
v = index_js_2.Signature.getChainIdV(
|
|
45832
|
+
if (chainId2 !== BN_0) {
|
|
45833
|
+
v = index_js_2.Signature.getChainIdV(chainId2, sig.v);
|
|
45834
45834
|
} else if (BigInt(sig.v) !== v) {
|
|
45835
45835
|
(0, index_js_3.assertArgument)(false, "tx.chainId/sig.v mismatch", "sig", sig);
|
|
45836
45836
|
}
|
|
@@ -54419,9 +54419,9 @@ var require_format3 = __commonJS({
|
|
|
54419
54419
|
result.signature = index_js_2.Signature.from(value);
|
|
54420
54420
|
}
|
|
54421
54421
|
if (result.chainId == null) {
|
|
54422
|
-
const
|
|
54423
|
-
if (
|
|
54424
|
-
result.chainId =
|
|
54422
|
+
const chainId2 = result.signature.legacyChainId;
|
|
54423
|
+
if (chainId2 != null) {
|
|
54424
|
+
result.chainId = chainId2;
|
|
54425
54425
|
}
|
|
54426
54426
|
}
|
|
54427
54427
|
if (result.blockHash && (0, index_js_4.getBigInt)(result.blockHash) === BN_0) {
|
|
@@ -54632,9 +54632,9 @@ var require_network = __commonJS({
|
|
|
54632
54632
|
/**
|
|
54633
54633
|
* Creates a new **Network** for %%name%% and %%chainId%%.
|
|
54634
54634
|
*/
|
|
54635
|
-
constructor(name,
|
|
54635
|
+
constructor(name, chainId2) {
|
|
54636
54636
|
this.#name = name;
|
|
54637
|
-
this.#chainId = (0, index_js_2.getBigInt)(
|
|
54637
|
+
this.#chainId = (0, index_js_2.getBigInt)(chainId2);
|
|
54638
54638
|
this.#plugins = /* @__PURE__ */ new Map();
|
|
54639
54639
|
}
|
|
54640
54640
|
/**
|
|
@@ -54878,9 +54878,9 @@ var require_network = __commonJS({
|
|
|
54878
54878
|
return;
|
|
54879
54879
|
}
|
|
54880
54880
|
injected = true;
|
|
54881
|
-
function registerEth(name,
|
|
54881
|
+
function registerEth(name, chainId2, options) {
|
|
54882
54882
|
const func = function() {
|
|
54883
|
-
const network = new Network2(name,
|
|
54883
|
+
const network = new Network2(name, chainId2);
|
|
54884
54884
|
if (options.ensNetwork != null) {
|
|
54885
54885
|
network.attachPlugin(new plugins_network_js_1.EnsPlugin(null, options.ensNetwork));
|
|
54886
54886
|
}
|
|
@@ -54891,7 +54891,7 @@ var require_network = __commonJS({
|
|
|
54891
54891
|
return network;
|
|
54892
54892
|
};
|
|
54893
54893
|
Network2.register(name, func);
|
|
54894
|
-
Network2.register(
|
|
54894
|
+
Network2.register(chainId2, func);
|
|
54895
54895
|
if (options.altNames) {
|
|
54896
54896
|
options.altNames.forEach((name2) => {
|
|
54897
54897
|
Network2.register(name2, func);
|
|
@@ -56015,7 +56015,7 @@ var require_abstract_provider = __commonJS({
|
|
|
56015
56015
|
return params.map((p) => this._wrapLog(p, network));
|
|
56016
56016
|
}
|
|
56017
56017
|
// ENS
|
|
56018
|
-
_getProvider(
|
|
56018
|
+
_getProvider(chainId2) {
|
|
56019
56019
|
(0, index_js_6.assert)(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", {
|
|
56020
56020
|
operation: "_getProvider()"
|
|
56021
56021
|
});
|
|
@@ -56630,8 +56630,8 @@ var require_abstract_signer = __commonJS({
|
|
|
56630
56630
|
}
|
|
56631
56631
|
const network = await this.provider.getNetwork();
|
|
56632
56632
|
if (pop.chainId != null) {
|
|
56633
|
-
const
|
|
56634
|
-
(0, index_js_3.assertArgument)(
|
|
56633
|
+
const chainId2 = (0, index_js_3.getBigInt)(pop.chainId);
|
|
56634
|
+
(0, index_js_3.assertArgument)(chainId2 === network.chainId, "transaction chainId mismatch", "tx.chainId", tx.chainId);
|
|
56635
56635
|
} else {
|
|
56636
56636
|
pop.chainId = network.chainId;
|
|
56637
56637
|
}
|
|
@@ -57910,12 +57910,12 @@ var require_provider_ankr = __commonJS({
|
|
|
57910
57910
|
super(request, network, options);
|
|
57911
57911
|
(0, index_js_1.defineProperties)(this, { apiKey });
|
|
57912
57912
|
}
|
|
57913
|
-
_getProvider(
|
|
57913
|
+
_getProvider(chainId2) {
|
|
57914
57914
|
try {
|
|
57915
|
-
return new _AnkrProvider(
|
|
57915
|
+
return new _AnkrProvider(chainId2, this.apiKey);
|
|
57916
57916
|
} catch (error48) {
|
|
57917
57917
|
}
|
|
57918
|
-
return super._getProvider(
|
|
57918
|
+
return super._getProvider(chainId2);
|
|
57919
57919
|
}
|
|
57920
57920
|
/**
|
|
57921
57921
|
* Returns a prepared request for connecting to %%network%% with
|
|
@@ -58012,12 +58012,12 @@ var require_provider_alchemy = __commonJS({
|
|
|
58012
58012
|
super(request, network, { staticNetwork: network });
|
|
58013
58013
|
(0, index_js_1.defineProperties)(this, { apiKey });
|
|
58014
58014
|
}
|
|
58015
|
-
_getProvider(
|
|
58015
|
+
_getProvider(chainId2) {
|
|
58016
58016
|
try {
|
|
58017
|
-
return new _AlchemyProvider(
|
|
58017
|
+
return new _AlchemyProvider(chainId2, this.apiKey);
|
|
58018
58018
|
} catch (error48) {
|
|
58019
58019
|
}
|
|
58020
|
-
return super._getProvider(
|
|
58020
|
+
return super._getProvider(chainId2);
|
|
58021
58021
|
}
|
|
58022
58022
|
async _perform(req) {
|
|
58023
58023
|
if (req.method === "getTransactionResult") {
|
|
@@ -58130,12 +58130,12 @@ var require_provider_chainstack = __commonJS({
|
|
|
58130
58130
|
super(request, network, { staticNetwork: network });
|
|
58131
58131
|
(0, index_js_1.defineProperties)(this, { apiKey });
|
|
58132
58132
|
}
|
|
58133
|
-
_getProvider(
|
|
58133
|
+
_getProvider(chainId2) {
|
|
58134
58134
|
try {
|
|
58135
|
-
return new _ChainstackProvider(
|
|
58135
|
+
return new _ChainstackProvider(chainId2, this.apiKey);
|
|
58136
58136
|
} catch (error48) {
|
|
58137
58137
|
}
|
|
58138
|
-
return super._getProvider(
|
|
58138
|
+
return super._getProvider(chainId2);
|
|
58139
58139
|
}
|
|
58140
58140
|
isCommunityResource() {
|
|
58141
58141
|
return this.apiKey === getApiKey(this._network.name);
|
|
@@ -62987,12 +62987,12 @@ var require_provider_infura = __commonJS({
|
|
|
62987
62987
|
super(request, network, { staticNetwork: network });
|
|
62988
62988
|
(0, index_js_1.defineProperties)(this, { projectId, projectSecret });
|
|
62989
62989
|
}
|
|
62990
|
-
_getProvider(
|
|
62990
|
+
_getProvider(chainId2) {
|
|
62991
62991
|
try {
|
|
62992
|
-
return new _InfuraProvider(
|
|
62992
|
+
return new _InfuraProvider(chainId2, this.projectId, this.projectSecret);
|
|
62993
62993
|
} catch (error48) {
|
|
62994
62994
|
}
|
|
62995
|
-
return super._getProvider(
|
|
62995
|
+
return super._getProvider(chainId2);
|
|
62996
62996
|
}
|
|
62997
62997
|
isCommunityResource() {
|
|
62998
62998
|
return this.projectId === defaultProjectId;
|
|
@@ -63105,12 +63105,12 @@ var require_provider_quicknode = __commonJS({
|
|
|
63105
63105
|
super(request, network, { staticNetwork: network });
|
|
63106
63106
|
(0, index_js_1.defineProperties)(this, { token });
|
|
63107
63107
|
}
|
|
63108
|
-
_getProvider(
|
|
63108
|
+
_getProvider(chainId2) {
|
|
63109
63109
|
try {
|
|
63110
|
-
return new _QuickNodeProvider(
|
|
63110
|
+
return new _QuickNodeProvider(chainId2, this.token);
|
|
63111
63111
|
} catch (error48) {
|
|
63112
63112
|
}
|
|
63113
|
-
return super._getProvider(
|
|
63113
|
+
return super._getProvider(chainId2);
|
|
63114
63114
|
}
|
|
63115
63115
|
isCommunityResource() {
|
|
63116
63116
|
return this.token === defaultToken;
|
|
@@ -63521,15 +63521,15 @@ var require_provider_fallback = __commonJS({
|
|
|
63521
63521
|
});
|
|
63522
63522
|
this.#initialSyncPromise = initialSync = (async () => {
|
|
63523
63523
|
await Promise.all(promises);
|
|
63524
|
-
let
|
|
63524
|
+
let chainId2 = null;
|
|
63525
63525
|
for (const config2 of this.#configs) {
|
|
63526
63526
|
if (config2._lastFatalError) {
|
|
63527
63527
|
continue;
|
|
63528
63528
|
}
|
|
63529
63529
|
const network = config2._network;
|
|
63530
|
-
if (
|
|
63531
|
-
|
|
63532
|
-
} else if (network.chainId !==
|
|
63530
|
+
if (chainId2 == null) {
|
|
63531
|
+
chainId2 = network.chainId;
|
|
63532
|
+
} else if (network.chainId !== chainId2) {
|
|
63533
63533
|
(0, index_js_1.assert)(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", {
|
|
63534
63534
|
operation: "new FallbackProvider"
|
|
63535
63535
|
});
|
|
@@ -64148,12 +64148,12 @@ var require_provider_blockscout = __commonJS({
|
|
|
64148
64148
|
super(request, network, { staticNetwork: network });
|
|
64149
64149
|
(0, index_js_1.defineProperties)(this, { apiKey });
|
|
64150
64150
|
}
|
|
64151
|
-
_getProvider(
|
|
64151
|
+
_getProvider(chainId2) {
|
|
64152
64152
|
try {
|
|
64153
|
-
return new _BlockscoutProvider(
|
|
64153
|
+
return new _BlockscoutProvider(chainId2, this.apiKey);
|
|
64154
64154
|
} catch (error48) {
|
|
64155
64155
|
}
|
|
64156
|
-
return super._getProvider(
|
|
64156
|
+
return super._getProvider(chainId2);
|
|
64157
64157
|
}
|
|
64158
64158
|
isCommunityResource() {
|
|
64159
64159
|
return this.apiKey === null;
|
|
@@ -64264,12 +64264,12 @@ var require_provider_pocket = __commonJS({
|
|
|
64264
64264
|
super(request, network, options);
|
|
64265
64265
|
(0, index_js_1.defineProperties)(this, { applicationId, applicationSecret });
|
|
64266
64266
|
}
|
|
64267
|
-
_getProvider(
|
|
64267
|
+
_getProvider(chainId2) {
|
|
64268
64268
|
try {
|
|
64269
|
-
return new _PocketProvider(
|
|
64269
|
+
return new _PocketProvider(chainId2, this.applicationId, this.applicationSecret);
|
|
64270
64270
|
} catch (error48) {
|
|
64271
64271
|
}
|
|
64272
|
-
return super._getProvider(
|
|
64272
|
+
return super._getProvider(chainId2);
|
|
64273
64273
|
}
|
|
64274
64274
|
/**
|
|
64275
64275
|
* Returns a prepared request for connecting to %%network%% with
|
|
@@ -95225,7 +95225,7 @@ var import_path2 = require("path");
|
|
|
95225
95225
|
var import_url = require("url");
|
|
95226
95226
|
function getVersion() {
|
|
95227
95227
|
if (true) {
|
|
95228
|
-
return "0.9.
|
|
95228
|
+
return "0.9.3";
|
|
95229
95229
|
}
|
|
95230
95230
|
const __dirname3 = (0, import_path2.dirname)((0, import_url.fileURLToPath)(importMetaUrl));
|
|
95231
95231
|
const pkg2 = JSON.parse(
|
|
@@ -95378,7 +95378,7 @@ var isFetchError = (error48) => {
|
|
|
95378
95378
|
|
|
95379
95379
|
// src/shared/mpp-enabled.ts
|
|
95380
95380
|
init_cjs_shims();
|
|
95381
|
-
var isMppEnabled = () => "0.9.
|
|
95381
|
+
var isMppEnabled = () => "0.9.3".includes("-mpp");
|
|
95382
95382
|
|
|
95383
95383
|
// src/operations/fetch-with-payment.ts
|
|
95384
95384
|
init_cjs_shims();
|
|
@@ -97659,11 +97659,11 @@ function from11(authorization, options = {}) {
|
|
|
97659
97659
|
return { ...authorization, ...options.signature };
|
|
97660
97660
|
}
|
|
97661
97661
|
function fromRpc2(authorization) {
|
|
97662
|
-
const { address: address2, chainId:
|
|
97662
|
+
const { address: address2, chainId: chainId2, nonce: nonce2 } = authorization;
|
|
97663
97663
|
const signature2 = extract(authorization);
|
|
97664
97664
|
return {
|
|
97665
97665
|
address: address2,
|
|
97666
|
-
chainId: Number(
|
|
97666
|
+
chainId: Number(chainId2),
|
|
97667
97667
|
nonce: BigInt(nonce2),
|
|
97668
97668
|
...signature2
|
|
97669
97669
|
};
|
|
@@ -97683,10 +97683,10 @@ function hash3(authorization, options = {}) {
|
|
|
97683
97683
|
} : authorization))));
|
|
97684
97684
|
}
|
|
97685
97685
|
function toRpc2(authorization) {
|
|
97686
|
-
const { address: address2, chainId:
|
|
97686
|
+
const { address: address2, chainId: chainId2, nonce: nonce2, ...signature2 } = authorization;
|
|
97687
97687
|
return {
|
|
97688
97688
|
address: address2,
|
|
97689
|
-
chainId: fromNumber(
|
|
97689
|
+
chainId: fromNumber(chainId2),
|
|
97690
97690
|
nonce: fromNumber(nonce2),
|
|
97691
97691
|
...toRpc(signature2)
|
|
97692
97692
|
};
|
|
@@ -97695,10 +97695,10 @@ function toRpcList(authorizationList) {
|
|
|
97695
97695
|
return authorizationList.map(toRpc2);
|
|
97696
97696
|
}
|
|
97697
97697
|
function toTuple2(authorization) {
|
|
97698
|
-
const { address: address2, chainId:
|
|
97698
|
+
const { address: address2, chainId: chainId2, nonce: nonce2 } = authorization;
|
|
97699
97699
|
const signature2 = extract(authorization);
|
|
97700
97700
|
return [
|
|
97701
|
-
|
|
97701
|
+
chainId2 ? fromNumber(chainId2) : "0x",
|
|
97702
97702
|
address2,
|
|
97703
97703
|
nonce2 ? fromNumber(nonce2) : "0x",
|
|
97704
97704
|
...signature2 ? toTuple(signature2) : []
|
|
@@ -98201,8 +98201,8 @@ var FeeCapTooHighError = class extends BaseError2 {
|
|
|
98201
98201
|
}
|
|
98202
98202
|
};
|
|
98203
98203
|
var InvalidChainIdError = class extends BaseError2 {
|
|
98204
|
-
constructor({ chainId:
|
|
98205
|
-
super(typeof
|
|
98204
|
+
constructor({ chainId: chainId2 }) {
|
|
98205
|
+
super(typeof chainId2 !== "undefined" ? `Chain ID "${chainId2}" is invalid.` : "Chain ID is invalid.");
|
|
98206
98206
|
Object.defineProperty(this, "name", {
|
|
98207
98207
|
enumerable: true,
|
|
98208
98208
|
configurable: true,
|
|
@@ -98989,12 +98989,12 @@ function getSizeOfLength2(length) {
|
|
|
98989
98989
|
// ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/utils/authorization/hashAuthorization.js
|
|
98990
98990
|
init_keccak256();
|
|
98991
98991
|
function hashAuthorization(parameters) {
|
|
98992
|
-
const { chainId:
|
|
98992
|
+
const { chainId: chainId2, nonce: nonce2, to: to2 } = parameters;
|
|
98993
98993
|
const address2 = parameters.contractAddress ?? parameters.address;
|
|
98994
98994
|
const hash8 = keccak2562(concatHex([
|
|
98995
98995
|
"0x05",
|
|
98996
98996
|
toRlp([
|
|
98997
|
-
|
|
98997
|
+
chainId2 ? numberToHex(chainId2) : "0x",
|
|
98998
98998
|
address2,
|
|
98999
98999
|
nonce2 ? numberToHex(nonce2) : "0x"
|
|
99000
99000
|
])
|
|
@@ -99641,10 +99641,10 @@ async function fillTransaction(client, parameters) {
|
|
|
99641
99641
|
if (typeof nonce_ !== "undefined")
|
|
99642
99642
|
return nonce_;
|
|
99643
99643
|
const account_ = parseAccount(account);
|
|
99644
|
-
const
|
|
99644
|
+
const chainId2 = chain3 ? chain3.id : await getAction(client, getChainId, "getChainId")({});
|
|
99645
99645
|
return await nonceManager2.consume({
|
|
99646
99646
|
address: account_.address,
|
|
99647
|
-
chainId:
|
|
99647
|
+
chainId: chainId2,
|
|
99648
99648
|
client
|
|
99649
99649
|
});
|
|
99650
99650
|
})();
|
|
@@ -99761,25 +99761,25 @@ async function prepareTransactionRequest(client, args) {
|
|
|
99761
99761
|
};
|
|
99762
99762
|
return void 0;
|
|
99763
99763
|
})();
|
|
99764
|
-
let
|
|
99764
|
+
let chainId2;
|
|
99765
99765
|
async function getChainId2() {
|
|
99766
|
-
if (
|
|
99767
|
-
return
|
|
99766
|
+
if (chainId2)
|
|
99767
|
+
return chainId2;
|
|
99768
99768
|
if (typeof request.chainId !== "undefined")
|
|
99769
99769
|
return request.chainId;
|
|
99770
99770
|
if (chain3)
|
|
99771
99771
|
return chain3.id;
|
|
99772
99772
|
const chainId_ = await getAction(client, getChainId, "getChainId")({});
|
|
99773
|
-
|
|
99774
|
-
return
|
|
99773
|
+
chainId2 = chainId_;
|
|
99774
|
+
return chainId2;
|
|
99775
99775
|
}
|
|
99776
99776
|
const account = account_ ? parseAccount(account_) : account_;
|
|
99777
99777
|
let nonce2 = request.nonce;
|
|
99778
99778
|
if (parameters.includes("nonce") && typeof nonce2 === "undefined" && account && nonceManager2) {
|
|
99779
|
-
const
|
|
99779
|
+
const chainId3 = await getChainId2();
|
|
99780
99780
|
nonce2 = await nonceManager2.consume({
|
|
99781
99781
|
address: account.address,
|
|
99782
|
-
chainId:
|
|
99782
|
+
chainId: chainId3,
|
|
99783
99783
|
client
|
|
99784
99784
|
});
|
|
99785
99785
|
}
|
|
@@ -99808,13 +99808,13 @@ async function prepareTransactionRequest(client, args) {
|
|
|
99808
99808
|
return false;
|
|
99809
99809
|
})();
|
|
99810
99810
|
const fillResult = attemptFill ? await getAction(client, fillTransaction, "fillTransaction")({ ...request, nonce: nonce2 }).then((result) => {
|
|
99811
|
-
const { chainId:
|
|
99811
|
+
const { chainId: chainId3, from: from25, gas: gas2, gasPrice, nonce: nonce3, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, type: type5, ...rest } = result.transaction;
|
|
99812
99812
|
supportsFillTransaction.set(client.uid, true);
|
|
99813
99813
|
return {
|
|
99814
99814
|
...request,
|
|
99815
99815
|
...from25 ? { from: from25 } : {},
|
|
99816
99816
|
...type5 ? { type: type5 } : {},
|
|
99817
|
-
...typeof
|
|
99817
|
+
...typeof chainId3 !== "undefined" ? { chainId: chainId3 } : {},
|
|
99818
99818
|
...typeof gas2 !== "undefined" ? { gas: gas2 } : {},
|
|
99819
99819
|
...typeof gasPrice !== "undefined" ? { gasPrice } : {},
|
|
99820
99820
|
...typeof nonce3 !== "undefined" ? { nonce: nonce3 } : {},
|
|
@@ -100850,12 +100850,12 @@ async function sendTransaction(client, parameters) {
|
|
|
100850
100850
|
return void 0;
|
|
100851
100851
|
})();
|
|
100852
100852
|
if (account?.type === "json-rpc" || account === null) {
|
|
100853
|
-
let
|
|
100853
|
+
let chainId2;
|
|
100854
100854
|
if (chain3 !== null) {
|
|
100855
|
-
|
|
100855
|
+
chainId2 = await getAction(client, getChainId, "getChainId")({});
|
|
100856
100856
|
if (assertChainId)
|
|
100857
100857
|
assertCurrentChain({
|
|
100858
|
-
currentChainId:
|
|
100858
|
+
currentChainId: chainId2,
|
|
100859
100859
|
chain: chain3
|
|
100860
100860
|
});
|
|
100861
100861
|
}
|
|
@@ -100868,7 +100868,7 @@ async function sendTransaction(client, parameters) {
|
|
|
100868
100868
|
account,
|
|
100869
100869
|
authorizationList,
|
|
100870
100870
|
blobs,
|
|
100871
|
-
chainId:
|
|
100871
|
+
chainId: chainId2,
|
|
100872
100872
|
data: data ? concat3([data, dataSuffix ?? "0x"]) : data,
|
|
100873
100873
|
gas,
|
|
100874
100874
|
gasPrice,
|
|
@@ -101213,7 +101213,7 @@ async function getCallsStatus(client, parameters) {
|
|
|
101213
101213
|
async function getStatus(id) {
|
|
101214
101214
|
const isTransactions = id.endsWith(fallbackMagicIdentifier.slice(2));
|
|
101215
101215
|
if (isTransactions) {
|
|
101216
|
-
const
|
|
101216
|
+
const chainId3 = trim3(sliceHex(id, -64, -32));
|
|
101217
101217
|
const hashes = sliceHex(id, 0, -64).slice(2).match(/.{1,64}/g);
|
|
101218
101218
|
const receipts2 = await Promise.all(hashes.map((hash8) => fallbackTransactionErrorMagicIdentifier.slice(2) !== hash8 ? client.request({
|
|
101219
101219
|
method: "eth_getTransactionReceipt",
|
|
@@ -101230,7 +101230,7 @@ async function getCallsStatus(client, parameters) {
|
|
|
101230
101230
|
})();
|
|
101231
101231
|
return {
|
|
101232
101232
|
atomic: false,
|
|
101233
|
-
chainId: hexToNumber2(
|
|
101233
|
+
chainId: hexToNumber2(chainId3),
|
|
101234
101234
|
receipts: receipts2.filter(Boolean),
|
|
101235
101235
|
status: status2,
|
|
101236
101236
|
version: "2.0.0"
|
|
@@ -101241,7 +101241,7 @@ async function getCallsStatus(client, parameters) {
|
|
|
101241
101241
|
params: [id]
|
|
101242
101242
|
});
|
|
101243
101243
|
}
|
|
101244
|
-
const { atomic = false, chainId:
|
|
101244
|
+
const { atomic = false, chainId: chainId2, receipts, version: version7 = "2.0.0", ...response } = await getStatus(parameters.id);
|
|
101245
101245
|
const [status, statusCode] = (() => {
|
|
101246
101246
|
const statusCode2 = response.status;
|
|
101247
101247
|
if (statusCode2 >= 100 && statusCode2 < 200)
|
|
@@ -101260,7 +101260,7 @@ async function getCallsStatus(client, parameters) {
|
|
|
101260
101260
|
...response,
|
|
101261
101261
|
atomic,
|
|
101262
101262
|
// @ts-expect-error: for backwards compatibility
|
|
101263
|
-
chainId:
|
|
101263
|
+
chainId: chainId2 ? hexToNumber2(chainId2) : void 0,
|
|
101264
101264
|
receipts: receipts?.map((receipt) => ({
|
|
101265
101265
|
...receipt,
|
|
101266
101266
|
blockNumber: hexToBigInt(receipt.blockNumber),
|
|
@@ -102215,7 +102215,7 @@ var Eip712DomainNotFoundError = class extends BaseError3 {
|
|
|
102215
102215
|
async function getEip712Domain(client, parameters) {
|
|
102216
102216
|
const { address: address2, factory, factoryData } = parameters;
|
|
102217
102217
|
try {
|
|
102218
|
-
const [fields, name, version7,
|
|
102218
|
+
const [fields, name, version7, chainId2, verifyingContract, salt, extensions] = await getAction(client, readContract, "readContract")({
|
|
102219
102219
|
abi,
|
|
102220
102220
|
address: address2,
|
|
102221
102221
|
functionName: "eip712Domain",
|
|
@@ -102226,7 +102226,7 @@ async function getEip712Domain(client, parameters) {
|
|
|
102226
102226
|
domain: {
|
|
102227
102227
|
name,
|
|
102228
102228
|
version: version7,
|
|
102229
|
-
chainId: Number(
|
|
102229
|
+
chainId: Number(chainId2),
|
|
102230
102230
|
verifyingContract,
|
|
102231
102231
|
salt
|
|
102232
102232
|
},
|
|
@@ -102343,12 +102343,12 @@ function assertTransactionEIP7702(transaction) {
|
|
|
102343
102343
|
const { authorizationList } = transaction;
|
|
102344
102344
|
if (authorizationList) {
|
|
102345
102345
|
for (const authorization of authorizationList) {
|
|
102346
|
-
const { chainId:
|
|
102346
|
+
const { chainId: chainId2 } = authorization;
|
|
102347
102347
|
const address2 = authorization.address;
|
|
102348
102348
|
if (!isAddress(address2))
|
|
102349
102349
|
throw new InvalidAddressError2({ address: address2 });
|
|
102350
|
-
if (
|
|
102351
|
-
throw new InvalidChainIdError2({ chainId:
|
|
102350
|
+
if (chainId2 < 0)
|
|
102351
|
+
throw new InvalidChainIdError2({ chainId: chainId2 });
|
|
102352
102352
|
}
|
|
102353
102353
|
}
|
|
102354
102354
|
assertTransactionEIP1559(transaction);
|
|
@@ -102373,9 +102373,9 @@ function assertTransactionEIP4844(transaction) {
|
|
|
102373
102373
|
assertTransactionEIP1559(transaction);
|
|
102374
102374
|
}
|
|
102375
102375
|
function assertTransactionEIP1559(transaction) {
|
|
102376
|
-
const { chainId:
|
|
102377
|
-
if (
|
|
102378
|
-
throw new InvalidChainIdError2({ chainId:
|
|
102376
|
+
const { chainId: chainId2, maxPriorityFeePerGas, maxFeePerGas, to: to2 } = transaction;
|
|
102377
|
+
if (chainId2 <= 0)
|
|
102378
|
+
throw new InvalidChainIdError2({ chainId: chainId2 });
|
|
102379
102379
|
if (to2 && !isAddress(to2))
|
|
102380
102380
|
throw new InvalidAddressError2({ address: to2 });
|
|
102381
102381
|
if (maxFeePerGas && maxFeePerGas > maxUint2562)
|
|
@@ -102384,9 +102384,9 @@ function assertTransactionEIP1559(transaction) {
|
|
|
102384
102384
|
throw new TipAboveFeeCapError2({ maxFeePerGas, maxPriorityFeePerGas });
|
|
102385
102385
|
}
|
|
102386
102386
|
function assertTransactionEIP2930(transaction) {
|
|
102387
|
-
const { chainId:
|
|
102388
|
-
if (
|
|
102389
|
-
throw new InvalidChainIdError2({ chainId:
|
|
102387
|
+
const { chainId: chainId2, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to: to2 } = transaction;
|
|
102388
|
+
if (chainId2 <= 0)
|
|
102389
|
+
throw new InvalidChainIdError2({ chainId: chainId2 });
|
|
102390
102390
|
if (to2 && !isAddress(to2))
|
|
102391
102391
|
throw new InvalidAddressError2({ address: to2 });
|
|
102392
102392
|
if (maxPriorityFeePerGas || maxFeePerGas)
|
|
@@ -102395,11 +102395,11 @@ function assertTransactionEIP2930(transaction) {
|
|
|
102395
102395
|
throw new FeeCapTooHighError2({ maxFeePerGas: gasPrice });
|
|
102396
102396
|
}
|
|
102397
102397
|
function assertTransactionLegacy(transaction) {
|
|
102398
|
-
const { chainId:
|
|
102398
|
+
const { chainId: chainId2, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to: to2 } = transaction;
|
|
102399
102399
|
if (to2 && !isAddress(to2))
|
|
102400
102400
|
throw new InvalidAddressError2({ address: to2 });
|
|
102401
|
-
if (typeof
|
|
102402
|
-
throw new InvalidChainIdError2({ chainId:
|
|
102401
|
+
if (typeof chainId2 !== "undefined" && chainId2 <= 0)
|
|
102402
|
+
throw new InvalidChainIdError2({ chainId: chainId2 });
|
|
102403
102403
|
if (maxPriorityFeePerGas || maxFeePerGas)
|
|
102404
102404
|
throw new BaseError3("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
|
102405
102405
|
if (gasPrice && gasPrice > maxUint2562)
|
|
@@ -102444,14 +102444,14 @@ function serializeTransaction(transaction, signature2) {
|
|
|
102444
102444
|
return serializeTransactionLegacy(transaction, signature2);
|
|
102445
102445
|
}
|
|
102446
102446
|
function serializeTransactionEIP7702(transaction, signature2) {
|
|
102447
|
-
const { authorizationList, chainId:
|
|
102447
|
+
const { authorizationList, chainId: chainId2, gas, nonce: nonce2, to: to2, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
|
|
102448
102448
|
assertTransactionEIP7702(transaction);
|
|
102449
102449
|
const serializedAccessList = serializeAccessList(accessList);
|
|
102450
102450
|
const serializedAuthorizationList = serializeAuthorizationList(authorizationList);
|
|
102451
102451
|
return concatHex([
|
|
102452
102452
|
"0x04",
|
|
102453
102453
|
toRlp([
|
|
102454
|
-
numberToHex(
|
|
102454
|
+
numberToHex(chainId2),
|
|
102455
102455
|
nonce2 ? numberToHex(nonce2) : "0x",
|
|
102456
102456
|
maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : "0x",
|
|
102457
102457
|
maxFeePerGas ? numberToHex(maxFeePerGas) : "0x",
|
|
@@ -102466,7 +102466,7 @@ function serializeTransactionEIP7702(transaction, signature2) {
|
|
|
102466
102466
|
]);
|
|
102467
102467
|
}
|
|
102468
102468
|
function serializeTransactionEIP4844(transaction, signature2) {
|
|
102469
|
-
const { chainId:
|
|
102469
|
+
const { chainId: chainId2, gas, nonce: nonce2, to: to2, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
|
|
102470
102470
|
assertTransactionEIP4844(transaction);
|
|
102471
102471
|
let blobVersionedHashes = transaction.blobVersionedHashes;
|
|
102472
102472
|
let sidecars = transaction.sidecars;
|
|
@@ -102488,7 +102488,7 @@ function serializeTransactionEIP4844(transaction, signature2) {
|
|
|
102488
102488
|
}
|
|
102489
102489
|
const serializedAccessList = serializeAccessList(accessList);
|
|
102490
102490
|
const serializedTransaction = [
|
|
102491
|
-
numberToHex(
|
|
102491
|
+
numberToHex(chainId2),
|
|
102492
102492
|
nonce2 ? numberToHex(nonce2) : "0x",
|
|
102493
102493
|
maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : "0x",
|
|
102494
102494
|
maxFeePerGas ? numberToHex(maxFeePerGas) : "0x",
|
|
@@ -102523,11 +102523,11 @@ function serializeTransactionEIP4844(transaction, signature2) {
|
|
|
102523
102523
|
]);
|
|
102524
102524
|
}
|
|
102525
102525
|
function serializeTransactionEIP1559(transaction, signature2) {
|
|
102526
|
-
const { chainId:
|
|
102526
|
+
const { chainId: chainId2, gas, nonce: nonce2, to: to2, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
|
|
102527
102527
|
assertTransactionEIP1559(transaction);
|
|
102528
102528
|
const serializedAccessList = serializeAccessList(accessList);
|
|
102529
102529
|
const serializedTransaction = [
|
|
102530
|
-
numberToHex(
|
|
102530
|
+
numberToHex(chainId2),
|
|
102531
102531
|
nonce2 ? numberToHex(nonce2) : "0x",
|
|
102532
102532
|
maxPriorityFeePerGas ? numberToHex(maxPriorityFeePerGas) : "0x",
|
|
102533
102533
|
maxFeePerGas ? numberToHex(maxFeePerGas) : "0x",
|
|
@@ -102544,11 +102544,11 @@ function serializeTransactionEIP1559(transaction, signature2) {
|
|
|
102544
102544
|
]);
|
|
102545
102545
|
}
|
|
102546
102546
|
function serializeTransactionEIP2930(transaction, signature2) {
|
|
102547
|
-
const { chainId:
|
|
102547
|
+
const { chainId: chainId2, gas, data, nonce: nonce2, to: to2, value, accessList, gasPrice } = transaction;
|
|
102548
102548
|
assertTransactionEIP2930(transaction);
|
|
102549
102549
|
const serializedAccessList = serializeAccessList(accessList);
|
|
102550
102550
|
const serializedTransaction = [
|
|
102551
|
-
numberToHex(
|
|
102551
|
+
numberToHex(chainId2),
|
|
102552
102552
|
nonce2 ? numberToHex(nonce2) : "0x",
|
|
102553
102553
|
gasPrice ? numberToHex(gasPrice) : "0x",
|
|
102554
102554
|
gas ? numberToHex(gas) : "0x",
|
|
@@ -102564,7 +102564,7 @@ function serializeTransactionEIP2930(transaction, signature2) {
|
|
|
102564
102564
|
]);
|
|
102565
102565
|
}
|
|
102566
102566
|
function serializeTransactionLegacy(transaction, signature2) {
|
|
102567
|
-
const { chainId:
|
|
102567
|
+
const { chainId: chainId2 = 0, gas, data, nonce: nonce2, to: to2, value, gasPrice } = transaction;
|
|
102568
102568
|
assertTransactionLegacy(transaction);
|
|
102569
102569
|
let serializedTransaction = [
|
|
102570
102570
|
nonce2 ? numberToHex(nonce2) : "0x",
|
|
@@ -102582,8 +102582,8 @@ function serializeTransactionLegacy(transaction, signature2) {
|
|
|
102582
102582
|
return signature2.v;
|
|
102583
102583
|
return 27n + (signature2.v === 35n ? 0n : 1n);
|
|
102584
102584
|
}
|
|
102585
|
-
if (
|
|
102586
|
-
return BigInt(
|
|
102585
|
+
if (chainId2 > 0)
|
|
102586
|
+
return BigInt(chainId2 * 2) + BigInt(35n + signature2.v - 27n);
|
|
102587
102587
|
const v2 = 27n + (signature2.v === 27n ? 0n : 1n);
|
|
102588
102588
|
if (signature2.v !== v2)
|
|
102589
102589
|
throw new InvalidLegacyVError({ v: signature2.v });
|
|
@@ -102597,10 +102597,10 @@ function serializeTransactionLegacy(transaction, signature2) {
|
|
|
102597
102597
|
r === "0x00" ? "0x" : r,
|
|
102598
102598
|
s === "0x00" ? "0x" : s
|
|
102599
102599
|
];
|
|
102600
|
-
} else if (
|
|
102600
|
+
} else if (chainId2 > 0) {
|
|
102601
102601
|
serializedTransaction = [
|
|
102602
102602
|
...serializedTransaction,
|
|
102603
|
-
numberToHex(
|
|
102603
|
+
numberToHex(chainId2),
|
|
102604
102604
|
"0x",
|
|
102605
102605
|
"0x"
|
|
102606
102606
|
];
|
|
@@ -102636,10 +102636,10 @@ function serializeAuthorizationList(authorizationList) {
|
|
|
102636
102636
|
return [];
|
|
102637
102637
|
const serializedAuthorizationList = [];
|
|
102638
102638
|
for (const authorization of authorizationList) {
|
|
102639
|
-
const { chainId:
|
|
102639
|
+
const { chainId: chainId2, nonce: nonce2, ...signature2 } = authorization;
|
|
102640
102640
|
const contractAddress = authorization.address;
|
|
102641
102641
|
serializedAuthorizationList.push([
|
|
102642
|
-
|
|
102642
|
+
chainId2 ? toHex6(chainId2) : "0x",
|
|
102643
102643
|
contractAddress,
|
|
102644
102644
|
nonce2 ? toHex6(nonce2) : "0x",
|
|
102645
102645
|
...toYParitySignatureArray({}, signature2)
|
|
@@ -104933,12 +104933,12 @@ init_cjs_shims();
|
|
|
104933
104933
|
init_cjs_shims();
|
|
104934
104934
|
function parseSiweMessage(message) {
|
|
104935
104935
|
const { scheme, statement, ...prefix } = message.match(prefixRegex)?.groups ?? {};
|
|
104936
|
-
const { chainId:
|
|
104936
|
+
const { chainId: chainId2, expirationTime, issuedAt, notBefore, requestId, ...suffix } = message.match(suffixRegex)?.groups ?? {};
|
|
104937
104937
|
const resources = message.split("Resources:")[1]?.split("\n- ").slice(1);
|
|
104938
104938
|
return {
|
|
104939
104939
|
...prefix,
|
|
104940
104940
|
...suffix,
|
|
104941
|
-
...
|
|
104941
|
+
...chainId2 ? { chainId: Number(chainId2) } : {},
|
|
104942
104942
|
...expirationTime ? { expirationTime: new Date(expirationTime) } : {},
|
|
104943
104943
|
...issuedAt ? { issuedAt: new Date(issuedAt) } : {},
|
|
104944
104944
|
...notBefore ? { notBefore: new Date(notBefore) } : {},
|
|
@@ -105144,12 +105144,12 @@ async function sendTransactionSync(client, parameters) {
|
|
|
105144
105144
|
return void 0;
|
|
105145
105145
|
})();
|
|
105146
105146
|
if (account?.type === "json-rpc" || account === null) {
|
|
105147
|
-
let
|
|
105147
|
+
let chainId2;
|
|
105148
105148
|
if (chain3 !== null) {
|
|
105149
|
-
|
|
105149
|
+
chainId2 = await getAction(client, getChainId, "getChainId")({});
|
|
105150
105150
|
if (assertChainId)
|
|
105151
105151
|
assertCurrentChain({
|
|
105152
|
-
currentChainId:
|
|
105152
|
+
currentChainId: chainId2,
|
|
105153
105153
|
chain: chain3
|
|
105154
105154
|
});
|
|
105155
105155
|
}
|
|
@@ -105162,7 +105162,7 @@ async function sendTransactionSync(client, parameters) {
|
|
|
105162
105162
|
account,
|
|
105163
105163
|
authorizationList,
|
|
105164
105164
|
blobs,
|
|
105165
|
-
chainId:
|
|
105165
|
+
chainId: chainId2,
|
|
105166
105166
|
data: data ? concat3([data, dataSuffix ?? "0x"]) : data,
|
|
105167
105167
|
gas,
|
|
105168
105168
|
gasPrice,
|
|
@@ -105286,10 +105286,10 @@ async function signTransaction(client, parameters) {
|
|
|
105286
105286
|
account,
|
|
105287
105287
|
...parameters
|
|
105288
105288
|
});
|
|
105289
|
-
const
|
|
105289
|
+
const chainId2 = await getAction(client, getChainId, "getChainId")({});
|
|
105290
105290
|
if (chain3 !== null)
|
|
105291
105291
|
assertCurrentChain({
|
|
105292
|
-
currentChainId:
|
|
105292
|
+
currentChainId: chainId2,
|
|
105293
105293
|
chain: chain3
|
|
105294
105294
|
});
|
|
105295
105295
|
const formatters2 = chain3?.formatters || client.chain?.formatters;
|
|
@@ -105297,7 +105297,7 @@ async function signTransaction(client, parameters) {
|
|
|
105297
105297
|
if (account.signTransaction)
|
|
105298
105298
|
return account.signTransaction({
|
|
105299
105299
|
...transaction,
|
|
105300
|
-
chainId:
|
|
105300
|
+
chainId: chainId2
|
|
105301
105301
|
}, { serializer: client.chain?.serializers?.transaction });
|
|
105302
105302
|
return await client.request({
|
|
105303
105303
|
method: "eth_signTransaction",
|
|
@@ -105307,7 +105307,7 @@ async function signTransaction(client, parameters) {
|
|
|
105307
105307
|
...transaction,
|
|
105308
105308
|
account
|
|
105309
105309
|
}, "signTransaction"),
|
|
105310
|
-
chainId: numberToHex(
|
|
105310
|
+
chainId: numberToHex(chainId2),
|
|
105311
105311
|
from: account.address
|
|
105312
105312
|
}
|
|
105313
105313
|
]
|
|
@@ -105472,12 +105472,12 @@ var charge = from13({
|
|
|
105472
105472
|
feePayer: optional(pipe(union([boolean2(), custom()]), transform((v) => typeof v === "object" ? true : v))),
|
|
105473
105473
|
memo: optional(hash4()),
|
|
105474
105474
|
recipient: optional(string2())
|
|
105475
|
-
}), transform(({ amount: amount2, chainId:
|
|
105475
|
+
}), transform(({ amount: amount2, chainId: chainId2, decimals: decimals2, feePayer, memo, ...rest }) => ({
|
|
105476
105476
|
...rest,
|
|
105477
105477
|
amount: parseUnits(amount2, decimals2).toString(),
|
|
105478
|
-
...
|
|
105478
|
+
...chainId2 !== void 0 || feePayer !== void 0 || memo !== void 0 ? {
|
|
105479
105479
|
methodDetails: {
|
|
105480
|
-
...
|
|
105480
|
+
...chainId2 !== void 0 && { chainId: chainId2 },
|
|
105481
105481
|
...feePayer !== void 0 && { feePayer },
|
|
105482
105482
|
...memo !== void 0 && { memo }
|
|
105483
105483
|
}
|
|
@@ -105533,7 +105533,7 @@ var session = from13({
|
|
|
105533
105533
|
recipient: optional(string2()),
|
|
105534
105534
|
suggestedDeposit: optional(amount()),
|
|
105535
105535
|
unitType: string2()
|
|
105536
|
-
}), transform(({ amount: amount2, chainId:
|
|
105536
|
+
}), transform(({ amount: amount2, chainId: chainId2, channelId, decimals: decimals2, escrowContract: escrowContract2, feePayer, minVoucherDelta, suggestedDeposit, ...rest }) => ({
|
|
105537
105537
|
...rest,
|
|
105538
105538
|
amount: parseUnits(amount2, decimals2).toString(),
|
|
105539
105539
|
...suggestedDeposit ? {
|
|
@@ -105545,7 +105545,7 @@ var session = from13({
|
|
|
105545
105545
|
...minVoucherDelta !== void 0 && {
|
|
105546
105546
|
minVoucherDelta: parseUnits(minVoucherDelta, decimals2).toString()
|
|
105547
105547
|
},
|
|
105548
|
-
...
|
|
105548
|
+
...chainId2 !== void 0 && { chainId: chainId2 },
|
|
105549
105549
|
...feePayer !== void 0 && { feePayer }
|
|
105550
105550
|
}
|
|
105551
105551
|
})))
|
|
@@ -106020,11 +106020,11 @@ function from18(authorization, options = {}) {
|
|
|
106020
106020
|
return authorization;
|
|
106021
106021
|
}
|
|
106022
106022
|
function fromRpc6(authorization) {
|
|
106023
|
-
const { address: address2, chainId:
|
|
106023
|
+
const { address: address2, chainId: chainId2, nonce: nonce2 } = authorization;
|
|
106024
106024
|
const signature2 = fromRpc5(authorization.signature);
|
|
106025
106025
|
return {
|
|
106026
106026
|
address: address2,
|
|
106027
|
-
chainId: Number(
|
|
106027
|
+
chainId: Number(chainId2),
|
|
106028
106028
|
nonce: BigInt(nonce2),
|
|
106029
106029
|
signature: signature2
|
|
106030
106030
|
};
|
|
@@ -106033,10 +106033,10 @@ function fromRpcList2(authorizationList) {
|
|
|
106033
106033
|
return authorizationList.map((x) => fromRpc6(x));
|
|
106034
106034
|
}
|
|
106035
106035
|
function fromTuple2(tuple3) {
|
|
106036
|
-
const [
|
|
106036
|
+
const [chainId2, address2, nonce2, signatureSerialized] = tuple3;
|
|
106037
106037
|
const args = {
|
|
106038
106038
|
address: address2,
|
|
106039
|
-
chainId:
|
|
106039
|
+
chainId: chainId2 === "0x" ? 0 : Number(chainId2),
|
|
106040
106040
|
nonce: nonce2 === "0x" ? 0n : BigInt(nonce2)
|
|
106041
106041
|
};
|
|
106042
106042
|
if (signatureSerialized)
|
|
@@ -106050,10 +106050,10 @@ function fromTupleList2(tupleList) {
|
|
|
106050
106050
|
return list2;
|
|
106051
106051
|
}
|
|
106052
106052
|
function toRpc8(authorization) {
|
|
106053
|
-
const { address: address2, chainId:
|
|
106053
|
+
const { address: address2, chainId: chainId2, nonce: nonce2, signature: signature2 } = authorization;
|
|
106054
106054
|
return {
|
|
106055
106055
|
address: address2,
|
|
106056
|
-
chainId: fromNumber(
|
|
106056
|
+
chainId: fromNumber(chainId2),
|
|
106057
106057
|
nonce: fromNumber(nonce2),
|
|
106058
106058
|
signature: toRpc7(signature2)
|
|
106059
106059
|
};
|
|
@@ -106062,10 +106062,10 @@ function toRpcList2(authorizationList) {
|
|
|
106062
106062
|
return authorizationList.map((x) => toRpc8(x));
|
|
106063
106063
|
}
|
|
106064
106064
|
function toTuple3(authorization) {
|
|
106065
|
-
const { address: address2, chainId:
|
|
106065
|
+
const { address: address2, chainId: chainId2, nonce: nonce2 } = authorization;
|
|
106066
106066
|
const signature2 = authorization.signature ? serialize5(authorization.signature) : void 0;
|
|
106067
106067
|
return [
|
|
106068
|
-
|
|
106068
|
+
chainId2 ? fromNumber(chainId2) : "0x",
|
|
106069
106069
|
address2,
|
|
106070
106070
|
nonce2 ? fromNumber(nonce2) : "0x",
|
|
106071
106071
|
...signature2 ? [signature2] : []
|
|
@@ -106094,11 +106094,11 @@ function from19(authorization, options = {}) {
|
|
|
106094
106094
|
return authorization;
|
|
106095
106095
|
}
|
|
106096
106096
|
function fromRpc7(authorization) {
|
|
106097
|
-
const { chainId:
|
|
106097
|
+
const { chainId: chainId2 = "0x0", keyId, expiry = 0, limits, keyType } = authorization;
|
|
106098
106098
|
const signature2 = fromRpc5(authorization.signature);
|
|
106099
106099
|
return {
|
|
106100
106100
|
address: keyId,
|
|
106101
|
-
chainId:
|
|
106101
|
+
chainId: chainId2 === "0x" ? 0n : toBigInt(chainId2),
|
|
106102
106102
|
expiry: Number(expiry),
|
|
106103
106103
|
limits: limits?.map((limit) => ({
|
|
106104
106104
|
token: limit.token,
|
|
@@ -106110,7 +106110,7 @@ function fromRpc7(authorization) {
|
|
|
106110
106110
|
}
|
|
106111
106111
|
function fromTuple3(tuple3) {
|
|
106112
106112
|
const [authorization, signatureSerialized] = tuple3;
|
|
106113
|
-
const [
|
|
106113
|
+
const [chainId2, keyType_hex, keyId, expiry, limits] = authorization;
|
|
106114
106114
|
const keyType = (() => {
|
|
106115
106115
|
switch (keyType_hex) {
|
|
106116
106116
|
case "0x":
|
|
@@ -106128,7 +106128,7 @@ function fromTuple3(tuple3) {
|
|
|
106128
106128
|
address: keyId,
|
|
106129
106129
|
expiry: typeof expiry !== "undefined" ? hexToNumber3(expiry) : void 0,
|
|
106130
106130
|
type: keyType,
|
|
106131
|
-
...
|
|
106131
|
+
...chainId2 !== "0x" ? { chainId: toBigInt(chainId2) } : {},
|
|
106132
106132
|
...typeof expiry !== "undefined" ? { expiry: hexToNumber3(expiry) } : {},
|
|
106133
106133
|
...typeof limits !== "undefined" ? {
|
|
106134
106134
|
limits: limits.map(([token, limit]) => ({
|
|
@@ -106142,9 +106142,9 @@ function fromTuple3(tuple3) {
|
|
|
106142
106142
|
return from19(args);
|
|
106143
106143
|
}
|
|
106144
106144
|
function toRpc9(authorization) {
|
|
106145
|
-
const { address: address2, chainId:
|
|
106145
|
+
const { address: address2, chainId: chainId2 = 0n, expiry, limits, type: type4, signature: signature2 } = authorization;
|
|
106146
106146
|
return {
|
|
106147
|
-
chainId:
|
|
106147
|
+
chainId: chainId2 === 0n ? "0x" : fromNumber(chainId2),
|
|
106148
106148
|
expiry: typeof expiry === "number" ? fromNumber(expiry) : null,
|
|
106149
106149
|
limits: limits?.map(({ token, limit }) => ({
|
|
106150
106150
|
token,
|
|
@@ -106156,7 +106156,7 @@ function toRpc9(authorization) {
|
|
|
106156
106156
|
};
|
|
106157
106157
|
}
|
|
106158
106158
|
function toTuple4(authorization) {
|
|
106159
|
-
const { address: address2, chainId:
|
|
106159
|
+
const { address: address2, chainId: chainId2 = 0n, expiry, limits } = authorization;
|
|
106160
106160
|
const signature2 = authorization.signature ? serialize5(authorization.signature) : void 0;
|
|
106161
106161
|
const type4 = (() => {
|
|
106162
106162
|
switch (authorization.type) {
|
|
@@ -106171,7 +106171,7 @@ function toTuple4(authorization) {
|
|
|
106171
106171
|
}
|
|
106172
106172
|
})();
|
|
106173
106173
|
const authorizationTuple = [
|
|
106174
|
-
bigintToHex(
|
|
106174
|
+
bigintToHex(chainId2),
|
|
106175
106175
|
type4,
|
|
106176
106176
|
address2,
|
|
106177
106177
|
typeof expiry === "number" ? numberToHex2(expiry) : void 0,
|
|
@@ -106422,7 +106422,7 @@ var feePayerMagic = "0x78";
|
|
|
106422
106422
|
var serializedType = "0x76";
|
|
106423
106423
|
var type2 = "tempo";
|
|
106424
106424
|
function assert10(envelope) {
|
|
106425
|
-
const { calls, chainId:
|
|
106425
|
+
const { calls, chainId: chainId2, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter } = envelope;
|
|
106426
106426
|
if (!calls || calls.length === 0)
|
|
106427
106427
|
throw new CallsEmptyError();
|
|
106428
106428
|
if (typeof validBefore === "number" && typeof validAfter === "number" && validBefore <= validAfter) {
|
|
@@ -106436,8 +106436,8 @@ function assert10(envelope) {
|
|
|
106436
106436
|
if (call2.to)
|
|
106437
106437
|
assert5(call2.to, { strict: false });
|
|
106438
106438
|
}
|
|
106439
|
-
if (
|
|
106440
|
-
throw new InvalidChainIdError({ chainId:
|
|
106439
|
+
if (chainId2 <= 0)
|
|
106440
|
+
throw new InvalidChainIdError({ chainId: chainId2 });
|
|
106441
106441
|
if (maxFeePerGas && BigInt(maxFeePerGas) > 2n ** 256n - 1n)
|
|
106442
106442
|
throw new FeeCapTooHighError({
|
|
106443
106443
|
feeCap: maxFeePerGas
|
|
@@ -106450,14 +106450,14 @@ function assert10(envelope) {
|
|
|
106450
106450
|
}
|
|
106451
106451
|
function deserialize5(serialized) {
|
|
106452
106452
|
const transactionArray = toHex3(slice(serialized, 1));
|
|
106453
|
-
const [
|
|
106453
|
+
const [chainId2, maxPriorityFeePerGas, maxFeePerGas, gas, calls, accessList, nonceKey, nonce2, validBefore, validAfter, feeToken, feePayerSignatureOrSender, authorizationList, keyAuthorizationOrSignature, maybeSignature] = transactionArray;
|
|
106454
106454
|
const keyAuthorization = Array.isArray(keyAuthorizationOrSignature) ? keyAuthorizationOrSignature : void 0;
|
|
106455
106455
|
const signature2 = keyAuthorization ? maybeSignature : keyAuthorizationOrSignature;
|
|
106456
106456
|
if (!(transactionArray.length === 13 || transactionArray.length === 14 || transactionArray.length === 15))
|
|
106457
106457
|
throw new InvalidSerializedError({
|
|
106458
106458
|
attributes: {
|
|
106459
106459
|
authorizationList,
|
|
106460
|
-
chainId:
|
|
106460
|
+
chainId: chainId2,
|
|
106461
106461
|
maxPriorityFeePerGas,
|
|
106462
106462
|
maxFeePerGas,
|
|
106463
106463
|
gas,
|
|
@@ -106478,7 +106478,7 @@ function deserialize5(serialized) {
|
|
|
106478
106478
|
type: type2
|
|
106479
106479
|
});
|
|
106480
106480
|
let transaction = {
|
|
106481
|
-
chainId: Number(
|
|
106481
|
+
chainId: Number(chainId2),
|
|
106482
106482
|
type: type2
|
|
106483
106483
|
};
|
|
106484
106484
|
if (validate(gas) && gas !== "0x")
|
|
@@ -106560,7 +106560,7 @@ function from22(envelope, options = {}) {
|
|
|
106560
106560
|
};
|
|
106561
106561
|
}
|
|
106562
106562
|
function serialize7(envelope, options = {}) {
|
|
106563
|
-
const { accessList, authorizationList, calls, chainId:
|
|
106563
|
+
const { accessList, authorizationList, calls, chainId: chainId2, feeToken, gas, keyAuthorization, nonce: nonce2, nonceKey, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter } = envelope;
|
|
106564
106564
|
assert10(envelope);
|
|
106565
106565
|
const accessTupleList = toTupleList(accessList);
|
|
106566
106566
|
const signature2 = options.signature || envelope.signature;
|
|
@@ -106593,7 +106593,7 @@ function serialize7(envelope, options = {}) {
|
|
|
106593
106593
|
return toTuple(feePayerSignature);
|
|
106594
106594
|
})();
|
|
106595
106595
|
const serialized = [
|
|
106596
|
-
fromNumber(
|
|
106596
|
+
fromNumber(chainId2),
|
|
106597
106597
|
maxPriorityFeePerGas ? fromNumber(maxPriorityFeePerGas) : "0x",
|
|
106598
106598
|
maxFeePerGas ? fromNumber(maxFeePerGas) : "0x",
|
|
106599
106599
|
gas ? fromNumber(gas) : "0x",
|
|
@@ -108290,7 +108290,7 @@ async function serializeTempo(transaction, sig) {
|
|
|
108290
108290
|
});
|
|
108291
108291
|
return void 0;
|
|
108292
108292
|
})();
|
|
108293
|
-
const { chainId:
|
|
108293
|
+
const { chainId: chainId2, feePayer, feePayerSignature, nonce: nonce2, ...rest } = transaction;
|
|
108294
108294
|
const transaction_ox = {
|
|
108295
108295
|
...rest,
|
|
108296
108296
|
calls: rest.calls?.length ? rest.calls : [
|
|
@@ -108300,7 +108300,7 @@ async function serializeTempo(transaction, sig) {
|
|
|
108300
108300
|
data: rest.data
|
|
108301
108301
|
}
|
|
108302
108302
|
],
|
|
108303
|
-
chainId: Number(
|
|
108303
|
+
chainId: Number(chainId2),
|
|
108304
108304
|
feePayerSignature: feePayerSignature ? {
|
|
108305
108305
|
r: BigInt(feePayerSignature.r),
|
|
108306
108306
|
s: BigInt(feePayerSignature.s),
|
|
@@ -112535,11 +112535,11 @@ function parseEvent(raw) {
|
|
|
112535
112535
|
init_cjs_shims();
|
|
112536
112536
|
var DOMAIN_NAME = "Tempo Stream Channel";
|
|
112537
112537
|
var DOMAIN_VERSION = "1";
|
|
112538
|
-
function getVoucherDomain(escrowContract2,
|
|
112538
|
+
function getVoucherDomain(escrowContract2, chainId2) {
|
|
112539
112539
|
return {
|
|
112540
112540
|
name: DOMAIN_NAME,
|
|
112541
112541
|
version: DOMAIN_VERSION,
|
|
112542
|
-
chainId:
|
|
112542
|
+
chainId: chainId2,
|
|
112543
112543
|
verifyingContract: escrowContract2
|
|
112544
112544
|
};
|
|
112545
112545
|
}
|
|
@@ -112549,10 +112549,10 @@ var voucherTypes = {
|
|
|
112549
112549
|
{ name: "cumulativeAmount", type: "uint128" }
|
|
112550
112550
|
]
|
|
112551
112551
|
};
|
|
112552
|
-
async function signVoucher(client, account, message, escrowContract2,
|
|
112552
|
+
async function signVoucher(client, account, message, escrowContract2, chainId2, authorizedSigner) {
|
|
112553
112553
|
const signature2 = await signTypedData(client, {
|
|
112554
112554
|
account,
|
|
112555
|
-
domain: getVoucherDomain(escrowContract2,
|
|
112555
|
+
domain: getVoucherDomain(escrowContract2, chainId2),
|
|
112556
112556
|
types: voucherTypes,
|
|
112557
112557
|
primaryType: "Voucher",
|
|
112558
112558
|
message: {
|
|
@@ -112970,17 +112970,17 @@ async function sign({ hash: hash8, privateKey, to: to2 = "object" }) {
|
|
|
112970
112970
|
// ../../../node_modules/.pnpm/viem@2.46.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.3.6/node_modules/viem/_esm/accounts/utils/signAuthorization.js
|
|
112971
112971
|
init_cjs_shims();
|
|
112972
112972
|
async function signAuthorization(parameters) {
|
|
112973
|
-
const { chainId:
|
|
112973
|
+
const { chainId: chainId2, nonce: nonce2, privateKey, to: to2 = "object" } = parameters;
|
|
112974
112974
|
const address2 = parameters.contractAddress ?? parameters.address;
|
|
112975
112975
|
const signature2 = await sign({
|
|
112976
|
-
hash: hashAuthorization({ address: address2, chainId:
|
|
112976
|
+
hash: hashAuthorization({ address: address2, chainId: chainId2, nonce: nonce2 }),
|
|
112977
112977
|
privateKey,
|
|
112978
112978
|
to: to2
|
|
112979
112979
|
});
|
|
112980
112980
|
if (to2 === "object")
|
|
112981
112981
|
return {
|
|
112982
112982
|
address: address2,
|
|
112983
|
-
chainId:
|
|
112983
|
+
chainId: chainId2,
|
|
112984
112984
|
nonce: nonce2,
|
|
112985
112985
|
...signature2
|
|
112986
112986
|
};
|
|
@@ -113078,10 +113078,10 @@ function getResolver2(parameters) {
|
|
|
113078
113078
|
const { chain: chain3, getClient, rpcUrl: rpcUrl2 } = parameters;
|
|
113079
113079
|
if (getClient)
|
|
113080
113080
|
return getClient;
|
|
113081
|
-
return ({ chainId:
|
|
113081
|
+
return ({ chainId: chainId2 }) => {
|
|
113082
113082
|
if (!rpcUrl2)
|
|
113083
113083
|
throw new Error("No `rpcUrl` provided.");
|
|
113084
|
-
const resolvedChainId =
|
|
113084
|
+
const resolvedChainId = chainId2 || Number(Object.keys(rpcUrl2)[0]);
|
|
113085
113085
|
const url3 = rpcUrl2[resolvedChainId];
|
|
113086
113086
|
if (!url3)
|
|
113087
113087
|
throw new Error(`No \`rpcUrl\` configured for \`chainId\` (${resolvedChainId}).`);
|
|
@@ -113202,8 +113202,8 @@ function charge2(parameters = {}) {
|
|
|
113202
113202
|
mode: optional(_enum2(["push", "pull"]))
|
|
113203
113203
|
}),
|
|
113204
113204
|
async createCredential({ challenge: challenge2, context: context2 }) {
|
|
113205
|
-
const
|
|
113206
|
-
const client = await getClient({ chainId:
|
|
113205
|
+
const chainId2 = challenge2.request.methodDetails?.chainId;
|
|
113206
|
+
const client = await getClient({ chainId: chainId2 });
|
|
113207
113207
|
const account = getAccount(client, context2);
|
|
113208
113208
|
const mode = context2?.mode ?? parameters.mode ?? (account.type === "json-rpc" ? "push" : "pull");
|
|
113209
113209
|
const { request } = challenge2;
|
|
@@ -113238,7 +113238,7 @@ function charge2(parameters = {}) {
|
|
|
113238
113238
|
return serialize3({
|
|
113239
113239
|
challenge: challenge2,
|
|
113240
113240
|
payload: { hash: hash8, type: "hash" },
|
|
113241
|
-
source: `did:pkh:eip155:${
|
|
113241
|
+
source: `did:pkh:eip155:${chainId2}:${account.address}`
|
|
113242
113242
|
});
|
|
113243
113243
|
}
|
|
113244
113244
|
const prepared = await prepareTransactionRequest(client, {
|
|
@@ -113252,7 +113252,7 @@ function charge2(parameters = {}) {
|
|
|
113252
113252
|
return serialize3({
|
|
113253
113253
|
challenge: challenge2,
|
|
113254
113254
|
payload: { signature: signature2, type: "transaction" },
|
|
113255
|
-
source: `did:pkh:eip155:${
|
|
113255
|
+
source: `did:pkh:eip155:${chainId2}:${account.address}`
|
|
113256
113256
|
});
|
|
113257
113257
|
}
|
|
113258
113258
|
});
|
|
@@ -113266,22 +113266,22 @@ init_cjs_shims();
|
|
|
113266
113266
|
|
|
113267
113267
|
// ../../../node_modules/.pnpm/mppx@0.3.14_@modelcontextprotocol+sdk@1.27.0_zod@4.3.6__express@5.2.1_hono@4.11.9_types_ea09b9c3a16abe3257a3d17da2074d9c/node_modules/mppx/dist/tempo/client/ChannelOps.js
|
|
113268
113268
|
init_cjs_shims();
|
|
113269
|
-
function resolveEscrow(challenge2,
|
|
113269
|
+
function resolveEscrow(challenge2, chainId2, escrowContractOverride) {
|
|
113270
113270
|
const challengeEscrow = challenge2.request.methodDetails?.escrowContract;
|
|
113271
|
-
const escrow = challengeEscrow ?? escrowContractOverride ?? escrowContract[
|
|
113271
|
+
const escrow = challengeEscrow ?? escrowContractOverride ?? escrowContract[chainId2];
|
|
113272
113272
|
if (!escrow)
|
|
113273
113273
|
throw new Error("No `escrowContract` available. Provide it in parameters or ensure the server challenge includes it.");
|
|
113274
113274
|
return escrow;
|
|
113275
113275
|
}
|
|
113276
|
-
function serializeCredential(challenge2, payload,
|
|
113276
|
+
function serializeCredential(challenge2, payload, chainId2, account) {
|
|
113277
113277
|
return serialize3({
|
|
113278
113278
|
challenge: challenge2,
|
|
113279
113279
|
payload,
|
|
113280
|
-
source: `did:pkh:eip155:${
|
|
113280
|
+
source: `did:pkh:eip155:${chainId2}:${account.address}`
|
|
113281
113281
|
});
|
|
113282
113282
|
}
|
|
113283
|
-
async function createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2,
|
|
113284
|
-
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2,
|
|
113283
|
+
async function createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2, chainId2, authorizedSigner) {
|
|
113284
|
+
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId2, authorizedSigner);
|
|
113285
113285
|
return {
|
|
113286
113286
|
action: "voucher",
|
|
113287
113287
|
channelId,
|
|
@@ -113290,12 +113290,12 @@ async function createVoucherPayload(client, account, channelId, cumulativeAmount
|
|
|
113290
113290
|
};
|
|
113291
113291
|
}
|
|
113292
113292
|
async function createOpenPayload(client, account, options) {
|
|
113293
|
-
const { escrowContract: escrowContract2, payee, currency: currency2, deposit, initialAmount, chainId:
|
|
113293
|
+
const { escrowContract: escrowContract2, payee, currency: currency2, deposit, initialAmount, chainId: chainId2, feePayer } = options;
|
|
113294
113294
|
const authorizedSigner = options.authorizedSigner ?? account.address;
|
|
113295
113295
|
const salt = Hex_exports.random(32);
|
|
113296
113296
|
const channelId = computeId2({
|
|
113297
113297
|
authorizedSigner,
|
|
113298
|
-
chainId:
|
|
113298
|
+
chainId: chainId2,
|
|
113299
113299
|
escrowContract: escrowContract2,
|
|
113300
113300
|
payee,
|
|
113301
113301
|
payer: account.address,
|
|
@@ -113322,14 +113322,14 @@ async function createOpenPayload(client, account, options) {
|
|
|
113322
113322
|
});
|
|
113323
113323
|
prepared.gas = prepared.gas + 5000n;
|
|
113324
113324
|
const transaction = await signTransaction(client, prepared);
|
|
113325
|
-
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount: initialAmount }, escrowContract2,
|
|
113325
|
+
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount: initialAmount }, escrowContract2, chainId2, options.authorizedSigner);
|
|
113326
113326
|
return {
|
|
113327
113327
|
entry: {
|
|
113328
113328
|
channelId,
|
|
113329
113329
|
salt,
|
|
113330
113330
|
cumulativeAmount: initialAmount,
|
|
113331
113331
|
escrowContract: escrowContract2,
|
|
113332
|
-
chainId:
|
|
113332
|
+
chainId: chainId2,
|
|
113333
113333
|
opened: true
|
|
113334
113334
|
},
|
|
113335
113335
|
payload: {
|
|
@@ -113343,7 +113343,7 @@ async function createOpenPayload(client, account, options) {
|
|
|
113343
113343
|
}
|
|
113344
113344
|
};
|
|
113345
113345
|
}
|
|
113346
|
-
async function tryRecoverChannel(client, escrowContract2, channelId,
|
|
113346
|
+
async function tryRecoverChannel(client, escrowContract2, channelId, chainId2) {
|
|
113347
113347
|
try {
|
|
113348
113348
|
const onChain = await getOnChainChannel(client, escrowContract2, channelId);
|
|
113349
113349
|
if (onChain.deposit > 0n && !onChain.finalized) {
|
|
@@ -113352,7 +113352,7 @@ async function tryRecoverChannel(client, escrowContract2, channelId, chainId3) {
|
|
|
113352
113352
|
salt: "0x",
|
|
113353
113353
|
cumulativeAmount: onChain.settled,
|
|
113354
113354
|
escrowContract: escrowContract2,
|
|
113355
|
-
chainId:
|
|
113355
|
+
chainId: chainId2,
|
|
113356
113356
|
opened: true
|
|
113357
113357
|
};
|
|
113358
113358
|
}
|
|
@@ -113393,19 +113393,19 @@ function session2(parameters = {}) {
|
|
|
113393
113393
|
function channelKey(payee, currency2, escrow) {
|
|
113394
113394
|
return `${payee.toLowerCase()}:${currency2.toLowerCase()}:${escrow.toLowerCase()}`;
|
|
113395
113395
|
}
|
|
113396
|
-
function resolveEscrowCached(challenge2,
|
|
113396
|
+
function resolveEscrowCached(challenge2, chainId2, channelId) {
|
|
113397
113397
|
if (channelId) {
|
|
113398
113398
|
const cached2 = escrowContractMap.get(channelId);
|
|
113399
113399
|
if (cached2)
|
|
113400
113400
|
return cached2;
|
|
113401
113401
|
}
|
|
113402
|
-
return resolveEscrow(challenge2,
|
|
113402
|
+
return resolveEscrow(challenge2, chainId2, parameters.escrowContract);
|
|
113403
113403
|
}
|
|
113404
113404
|
async function autoManageCredential(challenge2, account, context2) {
|
|
113405
113405
|
const md = challenge2.request.methodDetails;
|
|
113406
|
-
const
|
|
113407
|
-
const client = await getClient({ chainId:
|
|
113408
|
-
const escrowContract2 = resolveEscrowCached(challenge2,
|
|
113406
|
+
const chainId2 = md?.chainId ?? 0;
|
|
113407
|
+
const client = await getClient({ chainId: chainId2 });
|
|
113408
|
+
const escrowContract2 = resolveEscrowCached(challenge2, chainId2);
|
|
113409
113409
|
const payee = challenge2.request.recipient;
|
|
113410
113410
|
const currency2 = challenge2.request.currency;
|
|
113411
113411
|
const amount2 = BigInt(challenge2.request.amount);
|
|
@@ -113430,7 +113430,7 @@ function session2(parameters = {}) {
|
|
|
113430
113430
|
if (!entry) {
|
|
113431
113431
|
const suggestedChannelId = context2?.channelId ?? md?.channelId;
|
|
113432
113432
|
if (suggestedChannelId) {
|
|
113433
|
-
const recovered = await tryRecoverChannel(client, escrowContract2, suggestedChannelId,
|
|
113433
|
+
const recovered = await tryRecoverChannel(client, escrowContract2, suggestedChannelId, chainId2);
|
|
113434
113434
|
if (recovered) {
|
|
113435
113435
|
const contextCumulative = context2?.cumulativeAmountRaw ? BigInt(context2.cumulativeAmountRaw) : context2?.cumulativeAmount ? parseUnits(context2.cumulativeAmount, decimals2) : void 0;
|
|
113436
113436
|
if (contextCumulative !== void 0)
|
|
@@ -113448,7 +113448,7 @@ function session2(parameters = {}) {
|
|
|
113448
113448
|
let payload;
|
|
113449
113449
|
if (entry?.opened) {
|
|
113450
113450
|
entry.cumulativeAmount += amount2;
|
|
113451
|
-
payload = await createVoucherPayload(client, account, entry.channelId, entry.cumulativeAmount, escrowContract2,
|
|
113451
|
+
payload = await createVoucherPayload(client, account, entry.channelId, entry.cumulativeAmount, escrowContract2, chainId2, authorizedSigner);
|
|
113452
113452
|
notifyUpdate(entry);
|
|
113453
113453
|
} else {
|
|
113454
113454
|
const result = await createOpenPayload(client, account, {
|
|
@@ -113458,7 +113458,7 @@ function session2(parameters = {}) {
|
|
|
113458
113458
|
currency: currency2,
|
|
113459
113459
|
deposit,
|
|
113460
113460
|
initialAmount: amount2,
|
|
113461
|
-
chainId:
|
|
113461
|
+
chainId: chainId2,
|
|
113462
113462
|
feePayer: md?.feePayer
|
|
113463
113463
|
});
|
|
113464
113464
|
channels.set(key, result.entry);
|
|
@@ -113467,19 +113467,19 @@ function session2(parameters = {}) {
|
|
|
113467
113467
|
payload = result.payload;
|
|
113468
113468
|
notifyUpdate(result.entry);
|
|
113469
113469
|
}
|
|
113470
|
-
return serializeCredential(challenge2, payload,
|
|
113470
|
+
return serializeCredential(challenge2, payload, chainId2, account);
|
|
113471
113471
|
}
|
|
113472
113472
|
async function manualCredential(challenge2, account, context2) {
|
|
113473
113473
|
const md = challenge2.request.methodDetails;
|
|
113474
|
-
const
|
|
113475
|
-
const client = await getClient({ chainId:
|
|
113474
|
+
const chainId2 = md?.chainId ?? 0;
|
|
113475
|
+
const client = await getClient({ chainId: chainId2 });
|
|
113476
113476
|
const action = context2.action;
|
|
113477
113477
|
const { channelId: channelIdRaw, transaction, authorizedSigner: contextAuthorizedSigner } = context2;
|
|
113478
113478
|
const authorizedSigner = contextAuthorizedSigner ?? getAuthorizedSigner(account);
|
|
113479
113479
|
const channelId = channelIdRaw;
|
|
113480
113480
|
const cumulativeAmount = context2.cumulativeAmountRaw ? BigInt(context2.cumulativeAmountRaw) : context2.cumulativeAmount ? parseUnits(context2.cumulativeAmount, decimals2) : void 0;
|
|
113481
113481
|
const resolvedAdditionalDeposit = context2.additionalDepositRaw ? BigInt(context2.additionalDepositRaw) : context2.additionalDeposit ? parseUnits(context2.additionalDeposit, decimals2) : void 0;
|
|
113482
|
-
const escrowContract2 = resolveEscrowCached(challenge2,
|
|
113482
|
+
const escrowContract2 = resolveEscrowCached(challenge2, chainId2, channelId);
|
|
113483
113483
|
escrowContractMap.set(channelId, escrowContract2);
|
|
113484
113484
|
let payload;
|
|
113485
113485
|
switch (action) {
|
|
@@ -113488,7 +113488,7 @@ function session2(parameters = {}) {
|
|
|
113488
113488
|
throw new Error("transaction required for open action");
|
|
113489
113489
|
if (cumulativeAmount === void 0)
|
|
113490
113490
|
throw new Error("cumulativeAmount required for open action");
|
|
113491
|
-
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2,
|
|
113491
|
+
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId2, authorizedSigner);
|
|
113492
113492
|
payload = {
|
|
113493
113493
|
action: "open",
|
|
113494
113494
|
type: "transaction",
|
|
@@ -113516,7 +113516,7 @@ function session2(parameters = {}) {
|
|
|
113516
113516
|
case "voucher": {
|
|
113517
113517
|
if (cumulativeAmount === void 0)
|
|
113518
113518
|
throw new Error("cumulativeAmount required for voucher action");
|
|
113519
|
-
payload = await createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2,
|
|
113519
|
+
payload = await createVoucherPayload(client, account, channelId, cumulativeAmount, escrowContract2, chainId2, authorizedSigner);
|
|
113520
113520
|
const key = channelIdToKey.get(channelId);
|
|
113521
113521
|
if (key) {
|
|
113522
113522
|
const entry = channels.get(key);
|
|
@@ -113530,7 +113530,7 @@ function session2(parameters = {}) {
|
|
|
113530
113530
|
case "close": {
|
|
113531
113531
|
if (cumulativeAmount === void 0)
|
|
113532
113532
|
throw new Error("cumulativeAmount required for close action");
|
|
113533
|
-
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2,
|
|
113533
|
+
const signature2 = await signVoucher(client, account, { channelId, cumulativeAmount }, escrowContract2, chainId2, authorizedSigner);
|
|
113534
113534
|
payload = {
|
|
113535
113535
|
action: "close",
|
|
113536
113536
|
channelId,
|
|
@@ -113549,13 +113549,13 @@ function session2(parameters = {}) {
|
|
|
113549
113549
|
break;
|
|
113550
113550
|
}
|
|
113551
113551
|
}
|
|
113552
|
-
return serializeCredential(challenge2, payload,
|
|
113552
|
+
return serializeCredential(challenge2, payload, chainId2, account);
|
|
113553
113553
|
}
|
|
113554
113554
|
return toClient(session, {
|
|
113555
113555
|
context: sessionContextSchema,
|
|
113556
113556
|
async createCredential({ challenge: challenge2, context: context2 }) {
|
|
113557
|
-
const
|
|
113558
|
-
const client = await getClient({ chainId:
|
|
113557
|
+
const chainId2 = challenge2.request.methodDetails?.chainId ?? 0;
|
|
113558
|
+
const client = await getClient({ chainId: chainId2 });
|
|
113559
113559
|
const account = getAccount(client, context2);
|
|
113560
113560
|
if (!context2?.action && (parameters.deposit !== void 0 || maxDeposit !== void 0))
|
|
113561
113561
|
return autoManageCredential(challenge2, account, context2);
|
|
@@ -114620,9 +114620,9 @@ init_cjs_shims();
|
|
|
114620
114620
|
// ../../internal/networks/src/types.ts
|
|
114621
114621
|
init_cjs_shims();
|
|
114622
114622
|
var Network = /* @__PURE__ */ ((Network2) => {
|
|
114623
|
-
Network2["BASE"] = "
|
|
114624
|
-
Network2["TEMPO"] = "
|
|
114625
|
-
Network2["SOLANA"] = "solana
|
|
114623
|
+
Network2["BASE"] = "base";
|
|
114624
|
+
Network2["TEMPO"] = "tempo";
|
|
114625
|
+
Network2["SOLANA"] = "solana";
|
|
114626
114626
|
return Network2;
|
|
114627
114627
|
})(Network || {});
|
|
114628
114628
|
|
|
@@ -114631,7 +114631,7 @@ init_cjs_shims();
|
|
|
114631
114631
|
init_index_node33();
|
|
114632
114632
|
var networkSchema = zod_default.enum(Network);
|
|
114633
114633
|
var optionalNetworkSchema = networkSchema.optional();
|
|
114634
|
-
var evmNetworkSchema = networkSchema.refine((network) => network !== "solana
|
|
114634
|
+
var evmNetworkSchema = networkSchema.refine((network) => network !== "solana" /* SOLANA */, {
|
|
114635
114635
|
message: "Invalid EVM chain"
|
|
114636
114636
|
}).transform((network) => network);
|
|
114637
114637
|
var ethereumAddressSchema = zod_default.string().refine(isAddress, "Invalid EVM address");
|
|
@@ -114641,25 +114641,46 @@ var mixedAddressSchema = zod_default.union([ethereumAddressSchema, solanaAddress
|
|
|
114641
114641
|
// ../../internal/networks/src/configs.ts
|
|
114642
114642
|
init_cjs_shims();
|
|
114643
114643
|
var EVM_CONFIGS = {
|
|
114644
|
-
["
|
|
114644
|
+
["base" /* BASE */]: {
|
|
114645
114645
|
chain: base,
|
|
114646
114646
|
name: "Base",
|
|
114647
|
-
caip2: "eip155:8453"
|
|
114647
|
+
caip2: "eip155:8453",
|
|
114648
114648
|
usdcAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
|
|
114649
114649
|
},
|
|
114650
|
-
["
|
|
114650
|
+
["tempo" /* TEMPO */]: {
|
|
114651
114651
|
chain: tempo,
|
|
114652
114652
|
name: "Tempo",
|
|
114653
|
-
caip2: "eip155:4217"
|
|
114653
|
+
caip2: "eip155:4217",
|
|
114654
114654
|
usdcAddress: "0x20c0000000000000000000000000000000000000"
|
|
114655
114655
|
}
|
|
114656
114656
|
};
|
|
114657
|
-
var chainId2 = (network) => EVM_CONFIGS[network].chain.id;
|
|
114658
114657
|
var SOLANA_CONFIG = {
|
|
114659
114658
|
name: "Solana",
|
|
114660
|
-
caip2: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp"
|
|
114659
|
+
caip2: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
114661
114660
|
usdcAddress: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
|
|
114662
114661
|
};
|
|
114662
|
+
var ALL_NETWORK_CONFIGS = {
|
|
114663
|
+
...EVM_CONFIGS,
|
|
114664
|
+
["solana" /* SOLANA */]: SOLANA_CONFIG
|
|
114665
|
+
};
|
|
114666
|
+
var networkToCaip2 = (network) => {
|
|
114667
|
+
if (network === "solana" /* SOLANA */) {
|
|
114668
|
+
return SOLANA_CONFIG.caip2;
|
|
114669
|
+
}
|
|
114670
|
+
return EVM_CONFIGS[network].caip2;
|
|
114671
|
+
};
|
|
114672
|
+
var caip2ToNetwork = (caip2) => {
|
|
114673
|
+
if (caip2 === SOLANA_CONFIG.caip2) {
|
|
114674
|
+
return "solana" /* SOLANA */;
|
|
114675
|
+
}
|
|
114676
|
+
const evmNetwork = Object.entries(EVM_CONFIGS).find(
|
|
114677
|
+
([, config2]) => config2.caip2 === caip2
|
|
114678
|
+
)?.[0];
|
|
114679
|
+
if (evmNetwork) {
|
|
114680
|
+
return evmNetwork;
|
|
114681
|
+
}
|
|
114682
|
+
return null;
|
|
114683
|
+
};
|
|
114663
114684
|
|
|
114664
114685
|
// ../../internal/balance/src/index.ts
|
|
114665
114686
|
var evmNetworks = Object.keys(EVM_CONFIGS);
|
|
@@ -114672,12 +114693,26 @@ var getEvmBalanceInputSchema = external_exports3.object({
|
|
|
114672
114693
|
tokenAddress: ethereumAddressSchema.optional()
|
|
114673
114694
|
});
|
|
114674
114695
|
var getBalanceInputSchema = external_exports3.discriminatedUnion("network", [
|
|
114675
|
-
getSolanaBalanceInputSchema.extend({
|
|
114676
|
-
|
|
114696
|
+
getSolanaBalanceInputSchema.extend({
|
|
114697
|
+
network: external_exports3.union([
|
|
114698
|
+
external_exports3.literal("solana" /* SOLANA */),
|
|
114699
|
+
external_exports3.literal(SOLANA_CONFIG.caip2).transform(() => "solana" /* SOLANA */)
|
|
114700
|
+
])
|
|
114701
|
+
}),
|
|
114702
|
+
getEvmBalanceInputSchema.extend({
|
|
114703
|
+
network: external_exports3.union([
|
|
114704
|
+
external_exports3.enum(evmNetworks),
|
|
114705
|
+
external_exports3.enum(Object.values(EVM_CONFIGS).map((config2) => config2.caip2)).transform((caip2) => caip2ToNetwork(caip2))
|
|
114706
|
+
])
|
|
114707
|
+
})
|
|
114677
114708
|
]);
|
|
114678
114709
|
var getBalanceOutputSchema = external_exports3.object({
|
|
114679
114710
|
balance: external_exports3.number(),
|
|
114680
|
-
|
|
114711
|
+
// this should be deprecated in the future
|
|
114712
|
+
network: external_exports3.enum(
|
|
114713
|
+
Object.values(ALL_NETWORK_CONFIGS).map((config2) => config2.caip2)
|
|
114714
|
+
),
|
|
114715
|
+
paymentNetwork: networkSchema,
|
|
114681
114716
|
chainId: external_exports3.number()
|
|
114682
114717
|
});
|
|
114683
114718
|
|
|
@@ -114706,7 +114741,7 @@ async function pickByBalance(response, options) {
|
|
|
114706
114741
|
surface,
|
|
114707
114742
|
{
|
|
114708
114743
|
address: wallets.evmAccount.account.address,
|
|
114709
|
-
network: "
|
|
114744
|
+
network: "base" /* BASE */
|
|
114710
114745
|
},
|
|
114711
114746
|
flags
|
|
114712
114747
|
).then((r) => r.isOk() ? r.value.balance : 0),
|
|
@@ -114730,7 +114765,7 @@ async function pickByBalance(response, options) {
|
|
|
114730
114765
|
surface,
|
|
114731
114766
|
{
|
|
114732
114767
|
address: wallets.evmAccount.account.address,
|
|
114733
|
-
network: "
|
|
114768
|
+
network: "tempo" /* TEMPO */
|
|
114734
114769
|
},
|
|
114735
114770
|
flags
|
|
114736
114771
|
);
|
|
@@ -114779,7 +114814,7 @@ async function handleMppPayment({
|
|
|
114779
114814
|
protocol: "mpp",
|
|
114780
114815
|
amount: amount2,
|
|
114781
114816
|
currency: currency2,
|
|
114782
|
-
network: "
|
|
114817
|
+
network: "tempo" /* TEMPO */
|
|
114783
114818
|
}),
|
|
114784
114819
|
(e5) => ({
|
|
114785
114820
|
cause: "before_payment_hook_failed",
|
|
@@ -114832,25 +114867,24 @@ var choosePaymentRequirement = async ({
|
|
|
114832
114867
|
}) => {
|
|
114833
114868
|
const { surface, paymentNetwork, wallets, flags } = options;
|
|
114834
114869
|
if (paymentNetwork) {
|
|
114835
|
-
|
|
114836
|
-
|
|
114837
|
-
);
|
|
114870
|
+
const caip2 = networkToCaip2(paymentNetwork);
|
|
114871
|
+
return paymentRequirements.find((pr) => pr.network === caip2);
|
|
114838
114872
|
}
|
|
114839
114873
|
const requirementsWithBalance = await Promise.all(
|
|
114840
114874
|
paymentRequirements.map(async (pr) => {
|
|
114841
|
-
const
|
|
114842
|
-
if (
|
|
114875
|
+
const network = caip2ToNetwork(pr.network);
|
|
114876
|
+
if (network === null) {
|
|
114843
114877
|
return {
|
|
114844
114878
|
balance: 0,
|
|
114845
114879
|
requirement: pr
|
|
114846
114880
|
};
|
|
114847
114881
|
}
|
|
114848
|
-
if (
|
|
114882
|
+
if (network === "solana" /* SOLANA */) {
|
|
114849
114883
|
const balanceResult = await getBalance4(
|
|
114850
114884
|
surface,
|
|
114851
114885
|
{
|
|
114852
114886
|
address: wallets.svmAccount.account.address,
|
|
114853
|
-
network
|
|
114887
|
+
network
|
|
114854
114888
|
},
|
|
114855
114889
|
flags
|
|
114856
114890
|
);
|
|
@@ -114863,7 +114897,7 @@ var choosePaymentRequirement = async ({
|
|
|
114863
114897
|
surface,
|
|
114864
114898
|
{
|
|
114865
114899
|
address: wallets.evmAccount.account.address,
|
|
114866
|
-
network
|
|
114900
|
+
network
|
|
114867
114901
|
},
|
|
114868
114902
|
flags
|
|
114869
114903
|
);
|
|
@@ -115464,11 +115498,11 @@ var x402ExactPermit2ProxyAddress = "0x402085c248EeA27D92E8b30b2C58ed07f9E20001";
|
|
|
115464
115498
|
function getEvmChainId(network) {
|
|
115465
115499
|
if (network.startsWith("eip155:")) {
|
|
115466
115500
|
const idStr = network.split(":")[1];
|
|
115467
|
-
const
|
|
115468
|
-
if (isNaN(
|
|
115501
|
+
const chainId2 = parseInt(idStr, 10);
|
|
115502
|
+
if (isNaN(chainId2)) {
|
|
115469
115503
|
throw new Error(`Invalid CAIP-2 chain ID: ${network}`);
|
|
115470
115504
|
}
|
|
115471
|
-
return
|
|
115505
|
+
return chainId2;
|
|
115472
115506
|
}
|
|
115473
115507
|
throw new Error(`Unsupported network format: ${network} (expected eip155:CHAIN_ID)`);
|
|
115474
115508
|
}
|
|
@@ -119658,8 +119692,8 @@ var SIWxPayloadSchema = external_exports4.object({
|
|
|
119658
119692
|
signatureScheme: external_exports4.enum(["eip191", "eip1271", "eip6492", "siws"]).optional(),
|
|
119659
119693
|
signature: external_exports4.string()
|
|
119660
119694
|
});
|
|
119661
|
-
function extractSolanaChainReference(
|
|
119662
|
-
const [, reference] =
|
|
119695
|
+
function extractSolanaChainReference(chainId2) {
|
|
119696
|
+
const [, reference] = chainId2.split(":");
|
|
119663
119697
|
return reference;
|
|
119664
119698
|
}
|
|
119665
119699
|
function formatSIWSMessage(info, address2) {
|
|
@@ -119699,10 +119733,10 @@ function encodeBase58(bytes) {
|
|
|
119699
119733
|
return base58.encode(bytes);
|
|
119700
119734
|
}
|
|
119701
119735
|
var DEFAULT_MAX_AGE_MS = 5 * 60 * 1e3;
|
|
119702
|
-
function extractEVMChainId(
|
|
119703
|
-
const match = /^eip155:(\d+)$/.exec(
|
|
119736
|
+
function extractEVMChainId(chainId2) {
|
|
119737
|
+
const match = /^eip155:(\d+)$/.exec(chainId2);
|
|
119704
119738
|
if (!match) {
|
|
119705
|
-
throw new Error(`Invalid EVM chainId format: ${
|
|
119739
|
+
throw new Error(`Invalid EVM chainId format: ${chainId2}. Expected eip155:<number>`);
|
|
119706
119740
|
}
|
|
119707
119741
|
return parseInt(match[1], 10);
|
|
119708
119742
|
}
|
|
@@ -119836,7 +119870,7 @@ async function createEIP3009Payload(signer, x402Version2, paymentRequirements) {
|
|
|
119836
119870
|
};
|
|
119837
119871
|
}
|
|
119838
119872
|
async function signEIP3009Authorization(signer, authorization, requirements) {
|
|
119839
|
-
const
|
|
119873
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
119840
119874
|
if (!requirements.extra?.name || !requirements.extra?.version) {
|
|
119841
119875
|
throw new Error(
|
|
119842
119876
|
`EIP-712 domain parameters (name, version) are required in payment requirements for asset ${requirements.asset}`
|
|
@@ -119846,7 +119880,7 @@ async function signEIP3009Authorization(signer, authorization, requirements) {
|
|
|
119846
119880
|
const domain2 = {
|
|
119847
119881
|
name,
|
|
119848
119882
|
version: version7,
|
|
119849
|
-
chainId:
|
|
119883
|
+
chainId: chainId2,
|
|
119850
119884
|
verifyingContract: getAddress2(requirements.asset)
|
|
119851
119885
|
};
|
|
119852
119886
|
const message = {
|
|
@@ -119899,10 +119933,10 @@ async function createPermit2Payload(signer, x402Version2, paymentRequirements) {
|
|
|
119899
119933
|
};
|
|
119900
119934
|
}
|
|
119901
119935
|
async function signPermit2Authorization(signer, permit2Authorization, requirements) {
|
|
119902
|
-
const
|
|
119936
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
119903
119937
|
const domain2 = {
|
|
119904
119938
|
name: "Permit2",
|
|
119905
|
-
chainId:
|
|
119939
|
+
chainId: chainId2,
|
|
119906
119940
|
verifyingContract: PERMIT2_ADDRESS
|
|
119907
119941
|
};
|
|
119908
119942
|
const message = {
|
|
@@ -119925,7 +119959,7 @@ async function signPermit2Authorization(signer, permit2Authorization, requiremen
|
|
|
119925
119959
|
message
|
|
119926
119960
|
});
|
|
119927
119961
|
}
|
|
119928
|
-
async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
119962
|
+
async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion, chainId2, deadline, permittedAmount) {
|
|
119929
119963
|
const owner = signer.address;
|
|
119930
119964
|
const spender = getAddress2(PERMIT2_ADDRESS);
|
|
119931
119965
|
const nonce2 = await signer.readContract({
|
|
@@ -119937,7 +119971,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
|
119937
119971
|
const domain2 = {
|
|
119938
119972
|
name: tokenName,
|
|
119939
119973
|
version: tokenVersion,
|
|
119940
|
-
chainId:
|
|
119974
|
+
chainId: chainId2,
|
|
119941
119975
|
verifyingContract: tokenAddress
|
|
119942
119976
|
};
|
|
119943
119977
|
const approvalAmount = BigInt(permittedAmount);
|
|
@@ -119965,7 +119999,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
|
119965
119999
|
version: "1"
|
|
119966
120000
|
};
|
|
119967
120001
|
}
|
|
119968
|
-
async function signErc20ApprovalTransaction(signer, tokenAddress,
|
|
120002
|
+
async function signErc20ApprovalTransaction(signer, tokenAddress, chainId2) {
|
|
119969
120003
|
const from25 = signer.address;
|
|
119970
120004
|
const spender = getAddress2(PERMIT2_ADDRESS);
|
|
119971
120005
|
const data = encodeFunctionData2({
|
|
@@ -119991,7 +120025,7 @@ async function signErc20ApprovalTransaction(signer, tokenAddress, chainId3) {
|
|
|
119991
120025
|
gas: ERC20_APPROVE_GAS_LIMIT,
|
|
119992
120026
|
maxFeePerGas,
|
|
119993
120027
|
maxPriorityFeePerGas,
|
|
119994
|
-
chainId:
|
|
120028
|
+
chainId: chainId2
|
|
119995
120029
|
});
|
|
119996
120030
|
return {
|
|
119997
120031
|
from: from25,
|
|
@@ -120077,7 +120111,7 @@ var ExactEvmScheme = class {
|
|
|
120077
120111
|
if (!tokenName || !tokenVersion) {
|
|
120078
120112
|
return void 0;
|
|
120079
120113
|
}
|
|
120080
|
-
const
|
|
120114
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
120081
120115
|
const tokenAddress = getAddress2(requirements.asset);
|
|
120082
120116
|
try {
|
|
120083
120117
|
const allowance = await this.signer.readContract({
|
|
@@ -120098,7 +120132,7 @@ var ExactEvmScheme = class {
|
|
|
120098
120132
|
tokenAddress,
|
|
120099
120133
|
tokenName,
|
|
120100
120134
|
tokenVersion,
|
|
120101
|
-
|
|
120135
|
+
chainId2,
|
|
120102
120136
|
deadline,
|
|
120103
120137
|
requirements.amount
|
|
120104
120138
|
);
|
|
@@ -120132,7 +120166,7 @@ var ExactEvmScheme = class {
|
|
|
120132
120166
|
if (!this.signer.signTransaction || !this.signer.getTransactionCount) {
|
|
120133
120167
|
return void 0;
|
|
120134
120168
|
}
|
|
120135
|
-
const
|
|
120169
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
120136
120170
|
const tokenAddress = getAddress2(requirements.asset);
|
|
120137
120171
|
try {
|
|
120138
120172
|
const allowance = await this.signer.readContract({
|
|
@@ -120146,7 +120180,7 @@ var ExactEvmScheme = class {
|
|
|
120146
120180
|
}
|
|
120147
120181
|
} catch {
|
|
120148
120182
|
}
|
|
120149
|
-
const info = await signErc20ApprovalTransaction(this.signer, tokenAddress,
|
|
120183
|
+
const info = await signErc20ApprovalTransaction(this.signer, tokenAddress, chainId2);
|
|
120150
120184
|
return {
|
|
120151
120185
|
[ERC20_APPROVAL_GAS_SPONSORING.key]: { info }
|
|
120152
120186
|
};
|
|
@@ -120528,7 +120562,7 @@ var safeCreatePaymentPayload = (surface, wallets, paymentRequired, paymentRequir
|
|
|
120528
120562
|
x402Client.fromConfig({
|
|
120529
120563
|
schemes: [
|
|
120530
120564
|
{
|
|
120531
|
-
network: "
|
|
120565
|
+
network: networkToCaip2("base" /* BASE */),
|
|
120532
120566
|
client: new ExactEvmScheme(
|
|
120533
120567
|
toClientEvmSigner(
|
|
120534
120568
|
wallets.evmAccount.account,
|
|
@@ -120540,7 +120574,7 @@ var safeCreatePaymentPayload = (surface, wallets, paymentRequired, paymentRequir
|
|
|
120540
120574
|
)
|
|
120541
120575
|
},
|
|
120542
120576
|
{
|
|
120543
|
-
network: "solana
|
|
120577
|
+
network: networkToCaip2("solana" /* SOLANA */),
|
|
120544
120578
|
client: new PatchedExactSvmScheme(
|
|
120545
120579
|
toClientSvmSigner(wallets.svmAccount.account)
|
|
120546
120580
|
)
|
|
@@ -120630,7 +120664,7 @@ async function handleX402Payment({
|
|
|
120630
120664
|
protocol: "x402",
|
|
120631
120665
|
amount: amount3,
|
|
120632
120666
|
currency: "USDC",
|
|
120633
|
-
network: accept.network
|
|
120667
|
+
network: caip2ToNetwork(accept.network)
|
|
120634
120668
|
}),
|
|
120635
120669
|
(e5) => ({
|
|
120636
120670
|
cause: "payment_already_attempted",
|
|
@@ -120713,12 +120747,28 @@ var setSettings = (settings) => {
|
|
|
120713
120747
|
import_fs4.default.writeFileSync(SETTINGS_FILE, JSON.stringify(newSettings, null, 2));
|
|
120714
120748
|
};
|
|
120715
120749
|
|
|
120750
|
+
// src/shared/origins.ts
|
|
120751
|
+
init_cjs_shims();
|
|
120752
|
+
var BLACKLISTED_ORIGINS = [
|
|
120753
|
+
"https://twit.sh",
|
|
120754
|
+
"https://x402.twit.sh"
|
|
120755
|
+
];
|
|
120756
|
+
|
|
120716
120757
|
// src/operations/fetch-with-payment.ts
|
|
120717
120758
|
var DEFAULT_MAX_AMOUNT = 5;
|
|
120718
120759
|
function createFetchWithPayment(options) {
|
|
120719
120760
|
const { surface, paymentMethod, timeout, maxAmount } = options;
|
|
120720
120761
|
const effectiveMaxAmount = maxAmount ?? getSettings().maxAmount ?? DEFAULT_MAX_AMOUNT;
|
|
120721
120762
|
return async (request) => {
|
|
120763
|
+
const blocked = BLACKLISTED_ORIGINS.find(
|
|
120764
|
+
(origin) => request.url.startsWith(origin)
|
|
120765
|
+
);
|
|
120766
|
+
if (blocked) {
|
|
120767
|
+
return fetchErr(surface, {
|
|
120768
|
+
cause: "network",
|
|
120769
|
+
message: `${blocked} is no longer available. This origin has been deprecated.`
|
|
120770
|
+
});
|
|
120771
|
+
}
|
|
120722
120772
|
const clonedRequest = request.clone();
|
|
120723
120773
|
const fallbackRequest = request.clone();
|
|
120724
120774
|
const probeResult = await safeFetch(surface, request, timeout);
|
|
@@ -120944,11 +120994,6 @@ init_cjs_shims();
|
|
|
120944
120994
|
|
|
120945
120995
|
// src/shared/descriptions.ts
|
|
120946
120996
|
init_cjs_shims();
|
|
120947
|
-
|
|
120948
|
-
// src/shared/origins.ts
|
|
120949
|
-
init_cjs_shims();
|
|
120950
|
-
|
|
120951
|
-
// src/shared/descriptions.ts
|
|
120952
120997
|
var ORIGIN_METADATA = {
|
|
120953
120998
|
["https://stableenrich.dev" /* StableEnrich */]: {
|
|
120954
120999
|
title: "StableEnrich",
|
|
@@ -120985,6 +121030,10 @@ var ORIGIN_METADATA = {
|
|
|
120985
121030
|
["https://x402facilitator.com" /* X402Facilitator */]: {
|
|
120986
121031
|
title: "X402 Facilitator",
|
|
120987
121032
|
description: "Payment facilitation"
|
|
121033
|
+
},
|
|
121034
|
+
["https://stablemerch.dev" /* StableMerch */]: {
|
|
121035
|
+
title: "StableMerch",
|
|
121036
|
+
description: "Create shirts and mugs with custom images and have them shipped to your address."
|
|
120988
121037
|
}
|
|
120989
121038
|
};
|
|
120990
121039
|
var PRIMARY_ORIGINS = [
|
|
@@ -120992,7 +121041,8 @@ var PRIMARY_ORIGINS = [
|
|
|
120992
121041
|
"https://stablesocial.dev" /* StableSocial */,
|
|
120993
121042
|
"https://stablestudio.dev" /* StableStudio */,
|
|
120994
121043
|
"https://stableupload.dev" /* StableUpload */,
|
|
120995
|
-
"https://stableemail.dev" /* StableEmail
|
|
121044
|
+
"https://stableemail.dev" /* StableEmail */,
|
|
121045
|
+
"https://stablemerch.dev" /* StableMerch */
|
|
120996
121046
|
];
|
|
120997
121047
|
var DESCRIPTIONS = {
|
|
120998
121048
|
fetch: {
|
|
@@ -121213,7 +121263,7 @@ var toolName = "fetch";
|
|
|
121213
121263
|
var paymentMethodEnum = isMppEnabled() ? external_exports3.enum(["x402", "mpp"]) : external_exports3.enum(["x402"]);
|
|
121214
121264
|
var fetchInputSchema = requestSchema.extend({
|
|
121215
121265
|
paymentMethod: paymentMethodEnum.optional().describe(TOOL_PARAMS.fetch.paymentMethod),
|
|
121216
|
-
paymentNetwork: external_exports3.enum(["
|
|
121266
|
+
paymentNetwork: external_exports3.enum(["base" /* BASE */, "solana" /* SOLANA */]).optional(),
|
|
121217
121267
|
maxAmount: external_exports3.number().positive().optional().describe(TOOL_PARAMS.fetch.maxAmount)
|
|
121218
121268
|
});
|
|
121219
121269
|
var registerFetchTool = ({
|
|
@@ -121241,12 +121291,12 @@ var registerFetchTool = ({
|
|
|
121241
121291
|
await checkBalance({
|
|
121242
121292
|
surface: toolName,
|
|
121243
121293
|
server,
|
|
121244
|
-
input: ctx.network === "solana
|
|
121294
|
+
input: ctx.network === "solana" /* SOLANA */ ? {
|
|
121245
121295
|
address: wallets.svmAccount.account.address,
|
|
121246
|
-
network: "solana
|
|
121296
|
+
network: "solana" /* SOLANA */
|
|
121247
121297
|
} : {
|
|
121248
121298
|
address: wallets.evmAccount.account.address,
|
|
121249
|
-
network: "
|
|
121299
|
+
network: "base" /* BASE */
|
|
121250
121300
|
},
|
|
121251
121301
|
amountNeeded: ctx.amount,
|
|
121252
121302
|
message: (balance) => `This request costs ${ctx.amount} USDC. Your current balance is ${balance} USDC.`,
|
|
@@ -121258,7 +121308,7 @@ var registerFetchTool = ({
|
|
|
121258
121308
|
server,
|
|
121259
121309
|
input: {
|
|
121260
121310
|
address: wallets.evmAccount.account.address,
|
|
121261
|
-
network: "
|
|
121311
|
+
network: "tempo" /* TEMPO */,
|
|
121262
121312
|
tokenAddress: ctx.currency
|
|
121263
121313
|
},
|
|
121264
121314
|
flags,
|
|
@@ -121317,7 +121367,7 @@ var getSiwxExtension = (extensions, paymentNetwork) => {
|
|
|
121317
121367
|
return void 0;
|
|
121318
121368
|
}
|
|
121319
121369
|
const chain3 = siwx.supportedChains?.find(
|
|
121320
|
-
(c) => paymentNetwork ? c.chainId === paymentNetwork : c.chainId.startsWith("eip155:")
|
|
121370
|
+
(c) => paymentNetwork ? c.chainId === networkToCaip2(paymentNetwork) : c.chainId.startsWith("eip155:")
|
|
121321
121371
|
);
|
|
121322
121372
|
return {
|
|
121323
121373
|
...siwx.info,
|
|
@@ -121386,7 +121436,7 @@ var registerAuthTools = ({
|
|
|
121386
121436
|
title: "Fetch with Authentication",
|
|
121387
121437
|
description: DESCRIPTIONS.fetchWithAuth.mcp,
|
|
121388
121438
|
inputSchema: requestSchema.extend({
|
|
121389
|
-
paymentNetwork: zod_default.enum(["
|
|
121439
|
+
paymentNetwork: zod_default.enum(["base" /* BASE */, "solana" /* SOLANA */]).optional()
|
|
121390
121440
|
}),
|
|
121391
121441
|
annotations: {
|
|
121392
121442
|
readOnlyHint: true,
|
|
@@ -121491,54 +121541,26 @@ async function getWalletInfo(surface, wallets, flags) {
|
|
|
121491
121541
|
account: { address: svmAddress }
|
|
121492
121542
|
}
|
|
121493
121543
|
} = wallets;
|
|
121494
|
-
const
|
|
121495
|
-
getBalance4(surface, { address: evmAddress, network: "
|
|
121544
|
+
const balances = await Promise.all([
|
|
121545
|
+
getBalance4(surface, { address: evmAddress, network: "base" /* BASE */ }, flags),
|
|
121496
121546
|
getBalance4(
|
|
121497
121547
|
surface,
|
|
121498
|
-
{ address: svmAddress, network: "solana
|
|
121548
|
+
{ address: svmAddress, network: "solana" /* SOLANA */ },
|
|
121499
121549
|
flags
|
|
121500
121550
|
),
|
|
121501
|
-
isMppEnabled() ?
|
|
121502
|
-
|
|
121503
|
-
|
|
121504
|
-
|
|
121505
|
-
|
|
121506
|
-
|
|
121507
|
-
|
|
121508
|
-
network: "eip155:4217" /* TEMPO */,
|
|
121509
|
-
chainId: chainId2("eip155:4217" /* TEMPO */)
|
|
121510
|
-
})
|
|
121511
|
-
)
|
|
121551
|
+
...isMppEnabled() ? [
|
|
121552
|
+
getBalance4(
|
|
121553
|
+
surface,
|
|
121554
|
+
{ address: evmAddress, network: "tempo" /* TEMPO */ },
|
|
121555
|
+
flags
|
|
121556
|
+
)
|
|
121557
|
+
] : []
|
|
121512
121558
|
]);
|
|
121513
|
-
|
|
121514
|
-
|
|
121515
|
-
|
|
121516
|
-
|
|
121517
|
-
|
|
121518
|
-
}
|
|
121519
|
-
if (tempoBalance.isErr()) {
|
|
121520
|
-
return tempoBalance;
|
|
121521
|
-
}
|
|
121522
|
-
const totalBalance = baseBalance.value.balance + solanaBalance.value.balance + tempoBalance.value.balance;
|
|
121523
|
-
const chains = [
|
|
121524
|
-
{
|
|
121525
|
-
chain: EVM_CONFIGS["eip155:8453" /* BASE */].name,
|
|
121526
|
-
balance: baseBalance.value.balance,
|
|
121527
|
-
paymentNetworkId: "eip155:8453" /* BASE */
|
|
121528
|
-
},
|
|
121529
|
-
{
|
|
121530
|
-
chain: SOLANA_CONFIG.name,
|
|
121531
|
-
balance: solanaBalance.value.balance,
|
|
121532
|
-
paymentNetworkId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" /* SOLANA */
|
|
121533
|
-
}
|
|
121534
|
-
];
|
|
121535
|
-
if (isMppEnabled()) {
|
|
121536
|
-
chains.push({
|
|
121537
|
-
chain: EVM_CONFIGS["eip155:4217" /* TEMPO */].name,
|
|
121538
|
-
balance: tempoBalance.value.balance,
|
|
121539
|
-
paymentNetworkId: "eip155:4217" /* TEMPO */
|
|
121540
|
-
});
|
|
121541
|
-
}
|
|
121559
|
+
const chains = balances.filter((balance) => balance.isOk()).map((balance) => ({
|
|
121560
|
+
balance: balance.value.balance,
|
|
121561
|
+
paymentNetwork: balance.value.paymentNetwork
|
|
121562
|
+
}));
|
|
121563
|
+
const totalBalance = balances.filter((balance) => balance.isOk()).reduce((acc, balance) => acc + balance.value.balance, 0);
|
|
121542
121564
|
return ok2({
|
|
121543
121565
|
address: evmAddress,
|
|
121544
121566
|
solanaAddress: svmAddress,
|
|
@@ -121554,7 +121576,7 @@ async function getWalletInfo(surface, wallets, flags) {
|
|
|
121554
121576
|
|
|
121555
121577
|
// src/server/tools/wallet.ts
|
|
121556
121578
|
var chainBalanceSchema = external_exports3.object({
|
|
121557
|
-
|
|
121579
|
+
paymentNetwork: external_exports3.string().describe(TOOL_PARAMS.getWalletInfo.output.chain),
|
|
121558
121580
|
balance: external_exports3.number().describe(TOOL_PARAMS.getWalletInfo.output.chainBalance)
|
|
121559
121581
|
});
|
|
121560
121582
|
var registerWalletTools = ({
|
|
@@ -122317,7 +122339,7 @@ function extractPaymentOptions4(wwwAuthenticate) {
|
|
|
122317
122339
|
const decimals2 = typeof request["decimals"] === "number" ? request["decimals"] : void 0;
|
|
122318
122340
|
const payTo = typeof request["recipient"] === "string" ? request["recipient"] : void 0;
|
|
122319
122341
|
const methodDetails = request["methodDetails"];
|
|
122320
|
-
const
|
|
122342
|
+
const chainId2 = methodDetails !== null && typeof methodDetails === "object" && !Array.isArray(methodDetails) && typeof methodDetails["chainId"] === "number" ? methodDetails["chainId"] : TEMPO_DEFAULT_CHAIN_ID;
|
|
122321
122343
|
if (!asset || !amount2) continue;
|
|
122322
122344
|
options.push({
|
|
122323
122345
|
protocol: "mpp",
|
|
@@ -122325,7 +122347,7 @@ function extractPaymentOptions4(wwwAuthenticate) {
|
|
|
122325
122347
|
paymentMethod,
|
|
122326
122348
|
intent,
|
|
122327
122349
|
realm,
|
|
122328
|
-
network: `tempo:${String(
|
|
122350
|
+
network: `tempo:${String(chainId2)}`,
|
|
122329
122351
|
// isMmmEnabled
|
|
122330
122352
|
asset,
|
|
122331
122353
|
amount: amount2,
|
|
@@ -122667,6 +122689,7 @@ var redeemInviteResponseSchema = zod_default.object({
|
|
|
122667
122689
|
var redeemInviteCode = async ({
|
|
122668
122690
|
code,
|
|
122669
122691
|
address: address2,
|
|
122692
|
+
solanaAddr,
|
|
122670
122693
|
surface,
|
|
122671
122694
|
dev = false
|
|
122672
122695
|
}) => {
|
|
@@ -122686,7 +122709,8 @@ var redeemInviteCode = async ({
|
|
|
122686
122709
|
},
|
|
122687
122710
|
body: JSON.stringify({
|
|
122688
122711
|
code,
|
|
122689
|
-
recipientAddr: address2
|
|
122712
|
+
recipientAddr: address2,
|
|
122713
|
+
solanaAddr: solanaAddr ?? null
|
|
122690
122714
|
})
|
|
122691
122715
|
}),
|
|
122692
122716
|
redeemInviteResponseSchema
|
|
@@ -122750,6 +122774,7 @@ var registerRedeemInviteTool = ({
|
|
|
122750
122774
|
const result = await redeemInviteCode({
|
|
122751
122775
|
code,
|
|
122752
122776
|
address: wallets.evmAccount.account.address,
|
|
122777
|
+
solanaAddr: wallets.svmAccount.account.address,
|
|
122753
122778
|
surface: "redeem_invite",
|
|
122754
122779
|
dev: false
|
|
122755
122780
|
});
|
|
@@ -123030,7 +123055,7 @@ var import_path3 = require("path");
|
|
|
123030
123055
|
var import_url2 = require("url");
|
|
123031
123056
|
function getVersion3() {
|
|
123032
123057
|
if (true) {
|
|
123033
|
-
return "0.9.
|
|
123058
|
+
return "0.9.3";
|
|
123034
123059
|
}
|
|
123035
123060
|
const __dirname3 = (0, import_path3.dirname)((0, import_url2.fileURLToPath)(importMetaUrl));
|
|
123036
123061
|
const pkg2 = JSON.parse(
|
|
@@ -123399,6 +123424,7 @@ var startServer = async (flags) => {
|
|
|
123399
123424
|
await redeemInviteCode({
|
|
123400
123425
|
code,
|
|
123401
123426
|
address: wallets.evmAccount.account.address,
|
|
123427
|
+
solanaAddr: wallets.svmAccount.account.address,
|
|
123402
123428
|
surface: "startServer"
|
|
123403
123429
|
});
|
|
123404
123430
|
}
|