agentcash 0.9.2 → 0.9.4
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 +334 -317
- package/dist/esm/{chunk-G3AVBW3H.js → chunk-6RPXYBHW.js} +58 -26
- package/dist/esm/chunk-6RPXYBHW.js.map +1 -0
- package/dist/esm/{chunk-CGFED7FU.js → chunk-BZUAKI72.js} +2 -2
- package/dist/esm/chunk-EV4ASZA5.js +79 -0
- package/dist/esm/chunk-EV4ASZA5.js.map +1 -0
- package/dist/esm/{chunk-RAFN7MFS.js → chunk-G6QIDBTO.js} +22 -5
- package/dist/esm/chunk-G6QIDBTO.js.map +1 -0
- package/dist/esm/{chunk-PGMMXO5J.js → chunk-GQW673BP.js} +18 -18
- package/dist/esm/chunk-GQW673BP.js.map +1 -0
- package/dist/esm/{chunk-ST5ITYIM.js → chunk-HKNVLD7T.js} +12 -7
- package/dist/esm/chunk-HKNVLD7T.js.map +1 -0
- package/dist/esm/chunk-KKGRBCO7.js +7 -0
- package/dist/esm/{chunk-6FEDQ4HI.js → chunk-O3TDXKU6.js} +6 -3
- package/dist/esm/chunk-O3TDXKU6.js.map +1 -0
- package/dist/esm/{chunk-G5IKWSIV.js → chunk-TTRO2X7I.js} +2 -2
- package/dist/esm/{chunk-6ZASEAWN.js → chunk-VP4UJCTZ.js} +2 -2
- package/dist/esm/{chunk-CM6NIM6K.js → chunk-WTIOX2O6.js} +6 -2
- package/dist/esm/chunk-WTIOX2O6.js.map +1 -0
- package/dist/esm/{chunk-U2I7LBH4.js → chunk-ZQ2YF2PK.js} +6 -3
- package/dist/esm/{chunk-U2I7LBH4.js.map → chunk-ZQ2YF2PK.js.map} +1 -1
- package/dist/esm/{fetch-4X4N7TSG.js → fetch-374ILNGI.js} +7 -7
- package/dist/esm/{fetch-auth-R54NXQBZ.js → fetch-auth-KJU755M5.js} +4 -4
- package/dist/esm/{fund-WJNWLQWZ.js → fund-SSHNLEE3.js} +4 -4
- package/dist/esm/index.js +18 -18
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/{install-GB7Z3Y7Y.js → install-SX6MU34Z.js} +16 -10
- package/dist/esm/install-SX6MU34Z.js.map +1 -0
- package/dist/esm/{onboard-IOSC3DTG.js → onboard-QCEVIWQE.js} +19 -10
- package/dist/esm/onboard-QCEVIWQE.js.map +1 -0
- package/dist/esm/{report-error-CSI2EPQJ.js → report-error-FNQJ4Q5F.js} +3 -3
- package/dist/esm/{server-QT37RZYD.js → server-3CD3JI6I.js} +21 -19
- package/dist/esm/server-3CD3JI6I.js.map +1 -0
- package/dist/esm/{server-EM2KLQJY.js → server-D2PKZW5Y.js} +2 -2
- package/dist/esm/{settings-I7MPPOB7.js → settings-7MUKYBZ5.js} +6 -6
- package/dist/esm/{try-2XWGGAAP.js → try-NBARMW7Q.js} +5 -5
- package/dist/esm/{wallet-3ZWXDQNE.js → wallet-XOMKZAVH.js} +9 -12
- package/dist/esm/wallet-XOMKZAVH.js.map +1 -0
- package/package.json +5 -5
- 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-GQTOWVH6.js +0 -7
- package/dist/esm/chunk-PGMMXO5J.js.map +0 -1
- package/dist/esm/chunk-RAFN7MFS.js.map +0 -1
- package/dist/esm/chunk-ST5ITYIM.js.map +0 -1
- package/dist/esm/chunk-UJO2BWV6.js +0 -112
- package/dist/esm/chunk-UJO2BWV6.js.map +0 -1
- package/dist/esm/install-GB7Z3Y7Y.js.map +0 -1
- package/dist/esm/onboard-IOSC3DTG.js.map +0 -1
- package/dist/esm/server-QT37RZYD.js.map +0 -1
- package/dist/esm/wallet-3ZWXDQNE.js.map +0 -1
- /package/dist/esm/{chunk-CGFED7FU.js.map → chunk-BZUAKI72.js.map} +0 -0
- /package/dist/esm/{chunk-GQTOWVH6.js.map → chunk-KKGRBCO7.js.map} +0 -0
- /package/dist/esm/{chunk-G5IKWSIV.js.map → chunk-TTRO2X7I.js.map} +0 -0
- /package/dist/esm/{chunk-6ZASEAWN.js.map → chunk-VP4UJCTZ.js.map} +0 -0
- /package/dist/esm/{fetch-4X4N7TSG.js.map → fetch-374ILNGI.js.map} +0 -0
- /package/dist/esm/{fetch-auth-R54NXQBZ.js.map → fetch-auth-KJU755M5.js.map} +0 -0
- /package/dist/esm/{fund-WJNWLQWZ.js.map → fund-SSHNLEE3.js.map} +0 -0
- /package/dist/esm/{report-error-CSI2EPQJ.js.map → report-error-FNQJ4Q5F.js.map} +0 -0
- /package/dist/esm/{server-EM2KLQJY.js.map → server-D2PKZW5Y.js.map} +0 -0
- /package/dist/esm/{settings-I7MPPOB7.js.map → settings-7MUKYBZ5.js.map} +0 -0
- /package/dist/esm/{try-2XWGGAAP.js.map → try-NBARMW7Q.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.4";
|
|
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.4".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,51 @@ 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 TX_EXPLORER_URLS = {
|
|
114673
|
+
["base" /* BASE */]: "https://basescan.org/tx/",
|
|
114674
|
+
["tempo" /* TEMPO */]: "https://testnet.tempo.xyz/tx/",
|
|
114675
|
+
["solana" /* SOLANA */]: "https://solscan.io/tx/"
|
|
114676
|
+
};
|
|
114677
|
+
var caip2ToNetwork = (caip2) => {
|
|
114678
|
+
if (caip2 === SOLANA_CONFIG.caip2) {
|
|
114679
|
+
return "solana" /* SOLANA */;
|
|
114680
|
+
}
|
|
114681
|
+
const evmNetwork = Object.entries(EVM_CONFIGS).find(
|
|
114682
|
+
([, config2]) => config2.caip2 === caip2
|
|
114683
|
+
)?.[0];
|
|
114684
|
+
if (evmNetwork) {
|
|
114685
|
+
return evmNetwork;
|
|
114686
|
+
}
|
|
114687
|
+
return null;
|
|
114688
|
+
};
|
|
114663
114689
|
|
|
114664
114690
|
// ../../internal/balance/src/index.ts
|
|
114665
114691
|
var evmNetworks = Object.keys(EVM_CONFIGS);
|
|
@@ -114672,12 +114698,26 @@ var getEvmBalanceInputSchema = external_exports3.object({
|
|
|
114672
114698
|
tokenAddress: ethereumAddressSchema.optional()
|
|
114673
114699
|
});
|
|
114674
114700
|
var getBalanceInputSchema = external_exports3.discriminatedUnion("network", [
|
|
114675
|
-
getSolanaBalanceInputSchema.extend({
|
|
114676
|
-
|
|
114701
|
+
getSolanaBalanceInputSchema.extend({
|
|
114702
|
+
network: external_exports3.union([
|
|
114703
|
+
external_exports3.literal("solana" /* SOLANA */),
|
|
114704
|
+
external_exports3.literal(SOLANA_CONFIG.caip2).transform(() => "solana" /* SOLANA */)
|
|
114705
|
+
])
|
|
114706
|
+
}),
|
|
114707
|
+
getEvmBalanceInputSchema.extend({
|
|
114708
|
+
network: external_exports3.union([
|
|
114709
|
+
external_exports3.enum(evmNetworks),
|
|
114710
|
+
external_exports3.enum(Object.values(EVM_CONFIGS).map((config2) => config2.caip2)).transform((caip2) => caip2ToNetwork(caip2))
|
|
114711
|
+
])
|
|
114712
|
+
})
|
|
114677
114713
|
]);
|
|
114678
114714
|
var getBalanceOutputSchema = external_exports3.object({
|
|
114679
114715
|
balance: external_exports3.number(),
|
|
114680
|
-
|
|
114716
|
+
// this should be deprecated in the future
|
|
114717
|
+
network: external_exports3.enum(
|
|
114718
|
+
Object.values(ALL_NETWORK_CONFIGS).map((config2) => config2.caip2)
|
|
114719
|
+
),
|
|
114720
|
+
paymentNetwork: networkSchema,
|
|
114681
114721
|
chainId: external_exports3.number()
|
|
114682
114722
|
});
|
|
114683
114723
|
|
|
@@ -114706,7 +114746,7 @@ async function pickByBalance(response, options) {
|
|
|
114706
114746
|
surface,
|
|
114707
114747
|
{
|
|
114708
114748
|
address: wallets.evmAccount.account.address,
|
|
114709
|
-
network: "
|
|
114749
|
+
network: "base" /* BASE */
|
|
114710
114750
|
},
|
|
114711
114751
|
flags
|
|
114712
114752
|
).then((r) => r.isOk() ? r.value.balance : 0),
|
|
@@ -114730,7 +114770,7 @@ async function pickByBalance(response, options) {
|
|
|
114730
114770
|
surface,
|
|
114731
114771
|
{
|
|
114732
114772
|
address: wallets.evmAccount.account.address,
|
|
114733
|
-
network: "
|
|
114773
|
+
network: "tempo" /* TEMPO */
|
|
114734
114774
|
},
|
|
114735
114775
|
flags
|
|
114736
114776
|
);
|
|
@@ -114779,7 +114819,7 @@ async function handleMppPayment({
|
|
|
114779
114819
|
protocol: "mpp",
|
|
114780
114820
|
amount: amount2,
|
|
114781
114821
|
currency: currency2,
|
|
114782
|
-
network: "
|
|
114822
|
+
network: "tempo" /* TEMPO */
|
|
114783
114823
|
}),
|
|
114784
114824
|
(e5) => ({
|
|
114785
114825
|
cause: "before_payment_hook_failed",
|
|
@@ -114832,25 +114872,24 @@ var choosePaymentRequirement = async ({
|
|
|
114832
114872
|
}) => {
|
|
114833
114873
|
const { surface, paymentNetwork, wallets, flags } = options;
|
|
114834
114874
|
if (paymentNetwork) {
|
|
114835
|
-
|
|
114836
|
-
|
|
114837
|
-
);
|
|
114875
|
+
const caip2 = networkToCaip2(paymentNetwork);
|
|
114876
|
+
return paymentRequirements.find((pr) => pr.network === caip2);
|
|
114838
114877
|
}
|
|
114839
114878
|
const requirementsWithBalance = await Promise.all(
|
|
114840
114879
|
paymentRequirements.map(async (pr) => {
|
|
114841
|
-
const
|
|
114842
|
-
if (
|
|
114880
|
+
const network = caip2ToNetwork(pr.network);
|
|
114881
|
+
if (network === null) {
|
|
114843
114882
|
return {
|
|
114844
114883
|
balance: 0,
|
|
114845
114884
|
requirement: pr
|
|
114846
114885
|
};
|
|
114847
114886
|
}
|
|
114848
|
-
if (
|
|
114887
|
+
if (network === "solana" /* SOLANA */) {
|
|
114849
114888
|
const balanceResult = await getBalance4(
|
|
114850
114889
|
surface,
|
|
114851
114890
|
{
|
|
114852
114891
|
address: wallets.svmAccount.account.address,
|
|
114853
|
-
network
|
|
114892
|
+
network
|
|
114854
114893
|
},
|
|
114855
114894
|
flags
|
|
114856
114895
|
);
|
|
@@ -114863,7 +114902,7 @@ var choosePaymentRequirement = async ({
|
|
|
114863
114902
|
surface,
|
|
114864
114903
|
{
|
|
114865
114904
|
address: wallets.evmAccount.account.address,
|
|
114866
|
-
network
|
|
114905
|
+
network
|
|
114867
114906
|
},
|
|
114868
114907
|
flags
|
|
114869
114908
|
);
|
|
@@ -115464,11 +115503,11 @@ var x402ExactPermit2ProxyAddress = "0x402085c248EeA27D92E8b30b2C58ed07f9E20001";
|
|
|
115464
115503
|
function getEvmChainId(network) {
|
|
115465
115504
|
if (network.startsWith("eip155:")) {
|
|
115466
115505
|
const idStr = network.split(":")[1];
|
|
115467
|
-
const
|
|
115468
|
-
if (isNaN(
|
|
115506
|
+
const chainId2 = parseInt(idStr, 10);
|
|
115507
|
+
if (isNaN(chainId2)) {
|
|
115469
115508
|
throw new Error(`Invalid CAIP-2 chain ID: ${network}`);
|
|
115470
115509
|
}
|
|
115471
|
-
return
|
|
115510
|
+
return chainId2;
|
|
115472
115511
|
}
|
|
115473
115512
|
throw new Error(`Unsupported network format: ${network} (expected eip155:CHAIN_ID)`);
|
|
115474
115513
|
}
|
|
@@ -119658,8 +119697,8 @@ var SIWxPayloadSchema = external_exports4.object({
|
|
|
119658
119697
|
signatureScheme: external_exports4.enum(["eip191", "eip1271", "eip6492", "siws"]).optional(),
|
|
119659
119698
|
signature: external_exports4.string()
|
|
119660
119699
|
});
|
|
119661
|
-
function extractSolanaChainReference(
|
|
119662
|
-
const [, reference] =
|
|
119700
|
+
function extractSolanaChainReference(chainId2) {
|
|
119701
|
+
const [, reference] = chainId2.split(":");
|
|
119663
119702
|
return reference;
|
|
119664
119703
|
}
|
|
119665
119704
|
function formatSIWSMessage(info, address2) {
|
|
@@ -119699,10 +119738,10 @@ function encodeBase58(bytes) {
|
|
|
119699
119738
|
return base58.encode(bytes);
|
|
119700
119739
|
}
|
|
119701
119740
|
var DEFAULT_MAX_AGE_MS = 5 * 60 * 1e3;
|
|
119702
|
-
function extractEVMChainId(
|
|
119703
|
-
const match = /^eip155:(\d+)$/.exec(
|
|
119741
|
+
function extractEVMChainId(chainId2) {
|
|
119742
|
+
const match = /^eip155:(\d+)$/.exec(chainId2);
|
|
119704
119743
|
if (!match) {
|
|
119705
|
-
throw new Error(`Invalid EVM chainId format: ${
|
|
119744
|
+
throw new Error(`Invalid EVM chainId format: ${chainId2}. Expected eip155:<number>`);
|
|
119706
119745
|
}
|
|
119707
119746
|
return parseInt(match[1], 10);
|
|
119708
119747
|
}
|
|
@@ -119836,7 +119875,7 @@ async function createEIP3009Payload(signer, x402Version2, paymentRequirements) {
|
|
|
119836
119875
|
};
|
|
119837
119876
|
}
|
|
119838
119877
|
async function signEIP3009Authorization(signer, authorization, requirements) {
|
|
119839
|
-
const
|
|
119878
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
119840
119879
|
if (!requirements.extra?.name || !requirements.extra?.version) {
|
|
119841
119880
|
throw new Error(
|
|
119842
119881
|
`EIP-712 domain parameters (name, version) are required in payment requirements for asset ${requirements.asset}`
|
|
@@ -119846,7 +119885,7 @@ async function signEIP3009Authorization(signer, authorization, requirements) {
|
|
|
119846
119885
|
const domain2 = {
|
|
119847
119886
|
name,
|
|
119848
119887
|
version: version7,
|
|
119849
|
-
chainId:
|
|
119888
|
+
chainId: chainId2,
|
|
119850
119889
|
verifyingContract: getAddress2(requirements.asset)
|
|
119851
119890
|
};
|
|
119852
119891
|
const message = {
|
|
@@ -119899,10 +119938,10 @@ async function createPermit2Payload(signer, x402Version2, paymentRequirements) {
|
|
|
119899
119938
|
};
|
|
119900
119939
|
}
|
|
119901
119940
|
async function signPermit2Authorization(signer, permit2Authorization, requirements) {
|
|
119902
|
-
const
|
|
119941
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
119903
119942
|
const domain2 = {
|
|
119904
119943
|
name: "Permit2",
|
|
119905
|
-
chainId:
|
|
119944
|
+
chainId: chainId2,
|
|
119906
119945
|
verifyingContract: PERMIT2_ADDRESS
|
|
119907
119946
|
};
|
|
119908
119947
|
const message = {
|
|
@@ -119925,7 +119964,7 @@ async function signPermit2Authorization(signer, permit2Authorization, requiremen
|
|
|
119925
119964
|
message
|
|
119926
119965
|
});
|
|
119927
119966
|
}
|
|
119928
|
-
async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
119967
|
+
async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion, chainId2, deadline, permittedAmount) {
|
|
119929
119968
|
const owner = signer.address;
|
|
119930
119969
|
const spender = getAddress2(PERMIT2_ADDRESS);
|
|
119931
119970
|
const nonce2 = await signer.readContract({
|
|
@@ -119937,7 +119976,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
|
119937
119976
|
const domain2 = {
|
|
119938
119977
|
name: tokenName,
|
|
119939
119978
|
version: tokenVersion,
|
|
119940
|
-
chainId:
|
|
119979
|
+
chainId: chainId2,
|
|
119941
119980
|
verifyingContract: tokenAddress
|
|
119942
119981
|
};
|
|
119943
119982
|
const approvalAmount = BigInt(permittedAmount);
|
|
@@ -119965,7 +120004,7 @@ async function signEip2612Permit(signer, tokenAddress, tokenName, tokenVersion,
|
|
|
119965
120004
|
version: "1"
|
|
119966
120005
|
};
|
|
119967
120006
|
}
|
|
119968
|
-
async function signErc20ApprovalTransaction(signer, tokenAddress,
|
|
120007
|
+
async function signErc20ApprovalTransaction(signer, tokenAddress, chainId2) {
|
|
119969
120008
|
const from25 = signer.address;
|
|
119970
120009
|
const spender = getAddress2(PERMIT2_ADDRESS);
|
|
119971
120010
|
const data = encodeFunctionData2({
|
|
@@ -119991,7 +120030,7 @@ async function signErc20ApprovalTransaction(signer, tokenAddress, chainId3) {
|
|
|
119991
120030
|
gas: ERC20_APPROVE_GAS_LIMIT,
|
|
119992
120031
|
maxFeePerGas,
|
|
119993
120032
|
maxPriorityFeePerGas,
|
|
119994
|
-
chainId:
|
|
120033
|
+
chainId: chainId2
|
|
119995
120034
|
});
|
|
119996
120035
|
return {
|
|
119997
120036
|
from: from25,
|
|
@@ -120077,7 +120116,7 @@ var ExactEvmScheme = class {
|
|
|
120077
120116
|
if (!tokenName || !tokenVersion) {
|
|
120078
120117
|
return void 0;
|
|
120079
120118
|
}
|
|
120080
|
-
const
|
|
120119
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
120081
120120
|
const tokenAddress = getAddress2(requirements.asset);
|
|
120082
120121
|
try {
|
|
120083
120122
|
const allowance = await this.signer.readContract({
|
|
@@ -120098,7 +120137,7 @@ var ExactEvmScheme = class {
|
|
|
120098
120137
|
tokenAddress,
|
|
120099
120138
|
tokenName,
|
|
120100
120139
|
tokenVersion,
|
|
120101
|
-
|
|
120140
|
+
chainId2,
|
|
120102
120141
|
deadline,
|
|
120103
120142
|
requirements.amount
|
|
120104
120143
|
);
|
|
@@ -120132,7 +120171,7 @@ var ExactEvmScheme = class {
|
|
|
120132
120171
|
if (!this.signer.signTransaction || !this.signer.getTransactionCount) {
|
|
120133
120172
|
return void 0;
|
|
120134
120173
|
}
|
|
120135
|
-
const
|
|
120174
|
+
const chainId2 = getEvmChainId(requirements.network);
|
|
120136
120175
|
const tokenAddress = getAddress2(requirements.asset);
|
|
120137
120176
|
try {
|
|
120138
120177
|
const allowance = await this.signer.readContract({
|
|
@@ -120146,7 +120185,7 @@ var ExactEvmScheme = class {
|
|
|
120146
120185
|
}
|
|
120147
120186
|
} catch {
|
|
120148
120187
|
}
|
|
120149
|
-
const info = await signErc20ApprovalTransaction(this.signer, tokenAddress,
|
|
120188
|
+
const info = await signErc20ApprovalTransaction(this.signer, tokenAddress, chainId2);
|
|
120150
120189
|
return {
|
|
120151
120190
|
[ERC20_APPROVAL_GAS_SPONSORING.key]: { info }
|
|
120152
120191
|
};
|
|
@@ -120528,7 +120567,7 @@ var safeCreatePaymentPayload = (surface, wallets, paymentRequired, paymentRequir
|
|
|
120528
120567
|
x402Client.fromConfig({
|
|
120529
120568
|
schemes: [
|
|
120530
120569
|
{
|
|
120531
|
-
network: "
|
|
120570
|
+
network: networkToCaip2("base" /* BASE */),
|
|
120532
120571
|
client: new ExactEvmScheme(
|
|
120533
120572
|
toClientEvmSigner(
|
|
120534
120573
|
wallets.evmAccount.account,
|
|
@@ -120540,7 +120579,7 @@ var safeCreatePaymentPayload = (surface, wallets, paymentRequired, paymentRequir
|
|
|
120540
120579
|
)
|
|
120541
120580
|
},
|
|
120542
120581
|
{
|
|
120543
|
-
network: "solana
|
|
120582
|
+
network: networkToCaip2("solana" /* SOLANA */),
|
|
120544
120583
|
client: new PatchedExactSvmScheme(
|
|
120545
120584
|
toClientSvmSigner(wallets.svmAccount.account)
|
|
120546
120585
|
)
|
|
@@ -120630,7 +120669,7 @@ async function handleX402Payment({
|
|
|
120630
120669
|
protocol: "x402",
|
|
120631
120670
|
amount: amount3,
|
|
120632
120671
|
currency: "USDC",
|
|
120633
|
-
network: accept.network
|
|
120672
|
+
network: caip2ToNetwork(accept.network)
|
|
120634
120673
|
}),
|
|
120635
120674
|
(e5) => ({
|
|
120636
120675
|
cause: "payment_already_attempted",
|
|
@@ -121229,7 +121268,7 @@ var toolName = "fetch";
|
|
|
121229
121268
|
var paymentMethodEnum = isMppEnabled() ? external_exports3.enum(["x402", "mpp"]) : external_exports3.enum(["x402"]);
|
|
121230
121269
|
var fetchInputSchema = requestSchema.extend({
|
|
121231
121270
|
paymentMethod: paymentMethodEnum.optional().describe(TOOL_PARAMS.fetch.paymentMethod),
|
|
121232
|
-
paymentNetwork: external_exports3.enum(["
|
|
121271
|
+
paymentNetwork: external_exports3.enum(["base" /* BASE */, "solana" /* SOLANA */]).optional(),
|
|
121233
121272
|
maxAmount: external_exports3.number().positive().optional().describe(TOOL_PARAMS.fetch.maxAmount)
|
|
121234
121273
|
});
|
|
121235
121274
|
var registerFetchTool = ({
|
|
@@ -121257,12 +121296,12 @@ var registerFetchTool = ({
|
|
|
121257
121296
|
await checkBalance({
|
|
121258
121297
|
surface: toolName,
|
|
121259
121298
|
server,
|
|
121260
|
-
input: ctx.network === "solana
|
|
121299
|
+
input: ctx.network === "solana" /* SOLANA */ ? {
|
|
121261
121300
|
address: wallets.svmAccount.account.address,
|
|
121262
|
-
network: "solana
|
|
121301
|
+
network: "solana" /* SOLANA */
|
|
121263
121302
|
} : {
|
|
121264
121303
|
address: wallets.evmAccount.account.address,
|
|
121265
|
-
network: "
|
|
121304
|
+
network: "base" /* BASE */
|
|
121266
121305
|
},
|
|
121267
121306
|
amountNeeded: ctx.amount,
|
|
121268
121307
|
message: (balance) => `This request costs ${ctx.amount} USDC. Your current balance is ${balance} USDC.`,
|
|
@@ -121274,7 +121313,7 @@ var registerFetchTool = ({
|
|
|
121274
121313
|
server,
|
|
121275
121314
|
input: {
|
|
121276
121315
|
address: wallets.evmAccount.account.address,
|
|
121277
|
-
network: "
|
|
121316
|
+
network: "tempo" /* TEMPO */,
|
|
121278
121317
|
tokenAddress: ctx.currency
|
|
121279
121318
|
},
|
|
121280
121319
|
flags,
|
|
@@ -121333,7 +121372,7 @@ var getSiwxExtension = (extensions, paymentNetwork) => {
|
|
|
121333
121372
|
return void 0;
|
|
121334
121373
|
}
|
|
121335
121374
|
const chain3 = siwx.supportedChains?.find(
|
|
121336
|
-
(c) => paymentNetwork ? c.chainId === paymentNetwork : c.chainId.startsWith("eip155:")
|
|
121375
|
+
(c) => paymentNetwork ? c.chainId === networkToCaip2(paymentNetwork) : c.chainId.startsWith("eip155:")
|
|
121337
121376
|
);
|
|
121338
121377
|
return {
|
|
121339
121378
|
...siwx.info,
|
|
@@ -121402,7 +121441,7 @@ var registerAuthTools = ({
|
|
|
121402
121441
|
title: "Fetch with Authentication",
|
|
121403
121442
|
description: DESCRIPTIONS.fetchWithAuth.mcp,
|
|
121404
121443
|
inputSchema: requestSchema.extend({
|
|
121405
|
-
paymentNetwork: zod_default.enum(["
|
|
121444
|
+
paymentNetwork: zod_default.enum(["base" /* BASE */, "solana" /* SOLANA */]).optional()
|
|
121406
121445
|
}),
|
|
121407
121446
|
annotations: {
|
|
121408
121447
|
readOnlyHint: true,
|
|
@@ -121507,54 +121546,26 @@ async function getWalletInfo(surface, wallets, flags) {
|
|
|
121507
121546
|
account: { address: svmAddress }
|
|
121508
121547
|
}
|
|
121509
121548
|
} = wallets;
|
|
121510
|
-
const
|
|
121511
|
-
getBalance4(surface, { address: evmAddress, network: "
|
|
121549
|
+
const balances = await Promise.all([
|
|
121550
|
+
getBalance4(surface, { address: evmAddress, network: "base" /* BASE */ }, flags),
|
|
121512
121551
|
getBalance4(
|
|
121513
121552
|
surface,
|
|
121514
|
-
{ address: svmAddress, network: "solana
|
|
121553
|
+
{ address: svmAddress, network: "solana" /* SOLANA */ },
|
|
121515
121554
|
flags
|
|
121516
121555
|
),
|
|
121517
|
-
isMppEnabled() ?
|
|
121518
|
-
|
|
121519
|
-
|
|
121520
|
-
|
|
121521
|
-
|
|
121522
|
-
|
|
121523
|
-
|
|
121524
|
-
network: "eip155:4217" /* TEMPO */,
|
|
121525
|
-
chainId: chainId2("eip155:4217" /* TEMPO */)
|
|
121526
|
-
})
|
|
121527
|
-
)
|
|
121556
|
+
...isMppEnabled() ? [
|
|
121557
|
+
getBalance4(
|
|
121558
|
+
surface,
|
|
121559
|
+
{ address: evmAddress, network: "tempo" /* TEMPO */ },
|
|
121560
|
+
flags
|
|
121561
|
+
)
|
|
121562
|
+
] : []
|
|
121528
121563
|
]);
|
|
121529
|
-
|
|
121530
|
-
|
|
121531
|
-
|
|
121532
|
-
|
|
121533
|
-
|
|
121534
|
-
}
|
|
121535
|
-
if (tempoBalance.isErr()) {
|
|
121536
|
-
return tempoBalance;
|
|
121537
|
-
}
|
|
121538
|
-
const totalBalance = baseBalance.value.balance + solanaBalance.value.balance + tempoBalance.value.balance;
|
|
121539
|
-
const chains = [
|
|
121540
|
-
{
|
|
121541
|
-
chain: EVM_CONFIGS["eip155:8453" /* BASE */].name,
|
|
121542
|
-
balance: baseBalance.value.balance,
|
|
121543
|
-
paymentNetworkId: "eip155:8453" /* BASE */
|
|
121544
|
-
},
|
|
121545
|
-
{
|
|
121546
|
-
chain: SOLANA_CONFIG.name,
|
|
121547
|
-
balance: solanaBalance.value.balance,
|
|
121548
|
-
paymentNetworkId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" /* SOLANA */
|
|
121549
|
-
}
|
|
121550
|
-
];
|
|
121551
|
-
if (isMppEnabled()) {
|
|
121552
|
-
chains.push({
|
|
121553
|
-
chain: EVM_CONFIGS["eip155:4217" /* TEMPO */].name,
|
|
121554
|
-
balance: tempoBalance.value.balance,
|
|
121555
|
-
paymentNetworkId: "eip155:4217" /* TEMPO */
|
|
121556
|
-
});
|
|
121557
|
-
}
|
|
121564
|
+
const chains = balances.filter((balance) => balance.isOk()).map((balance) => ({
|
|
121565
|
+
balance: balance.value.balance,
|
|
121566
|
+
paymentNetwork: balance.value.paymentNetwork
|
|
121567
|
+
}));
|
|
121568
|
+
const totalBalance = balances.filter((balance) => balance.isOk()).reduce((acc, balance) => acc + balance.value.balance, 0);
|
|
121558
121569
|
return ok2({
|
|
121559
121570
|
address: evmAddress,
|
|
121560
121571
|
solanaAddress: svmAddress,
|
|
@@ -121570,7 +121581,7 @@ async function getWalletInfo(surface, wallets, flags) {
|
|
|
121570
121581
|
|
|
121571
121582
|
// src/server/tools/wallet.ts
|
|
121572
121583
|
var chainBalanceSchema = external_exports3.object({
|
|
121573
|
-
|
|
121584
|
+
paymentNetwork: external_exports3.string().describe(TOOL_PARAMS.getWalletInfo.output.chain),
|
|
121574
121585
|
balance: external_exports3.number().describe(TOOL_PARAMS.getWalletInfo.output.chainBalance)
|
|
121575
121586
|
});
|
|
121576
121587
|
var registerWalletTools = ({
|
|
@@ -122333,7 +122344,7 @@ function extractPaymentOptions4(wwwAuthenticate) {
|
|
|
122333
122344
|
const decimals2 = typeof request["decimals"] === "number" ? request["decimals"] : void 0;
|
|
122334
122345
|
const payTo = typeof request["recipient"] === "string" ? request["recipient"] : void 0;
|
|
122335
122346
|
const methodDetails = request["methodDetails"];
|
|
122336
|
-
const
|
|
122347
|
+
const chainId2 = methodDetails !== null && typeof methodDetails === "object" && !Array.isArray(methodDetails) && typeof methodDetails["chainId"] === "number" ? methodDetails["chainId"] : TEMPO_DEFAULT_CHAIN_ID;
|
|
122337
122348
|
if (!asset || !amount2) continue;
|
|
122338
122349
|
options.push({
|
|
122339
122350
|
protocol: "mpp",
|
|
@@ -122341,7 +122352,7 @@ function extractPaymentOptions4(wwwAuthenticate) {
|
|
|
122341
122352
|
paymentMethod,
|
|
122342
122353
|
intent,
|
|
122343
122354
|
realm,
|
|
122344
|
-
network: `tempo:${String(
|
|
122355
|
+
network: `tempo:${String(chainId2)}`,
|
|
122345
122356
|
// isMmmEnabled
|
|
122346
122357
|
asset,
|
|
122347
122358
|
amount: amount2,
|
|
@@ -122671,7 +122682,9 @@ init_cjs_shims();
|
|
|
122671
122682
|
var redeemInviteResponseSchema = zod_default.object({
|
|
122672
122683
|
redemptionId: zod_default.string(),
|
|
122673
122684
|
txHash: zod_default.string(),
|
|
122685
|
+
solanaTxHash: zod_default.string().optional(),
|
|
122674
122686
|
amount: zod_default.coerce.number(),
|
|
122687
|
+
network: zod_default.enum(["base", "solana"]).optional(),
|
|
122675
122688
|
prompts: zod_default.array(
|
|
122676
122689
|
zod_default.object({
|
|
122677
122690
|
label: zod_default.string(),
|
|
@@ -122683,6 +122696,7 @@ var redeemInviteResponseSchema = zod_default.object({
|
|
|
122683
122696
|
var redeemInviteCode = async ({
|
|
122684
122697
|
code,
|
|
122685
122698
|
address: address2,
|
|
122699
|
+
solanaAddr,
|
|
122686
122700
|
surface,
|
|
122687
122701
|
dev = false
|
|
122688
122702
|
}) => {
|
|
@@ -122702,7 +122716,8 @@ var redeemInviteCode = async ({
|
|
|
122702
122716
|
},
|
|
122703
122717
|
body: JSON.stringify({
|
|
122704
122718
|
code,
|
|
122705
|
-
recipientAddr: address2
|
|
122719
|
+
recipientAddr: address2,
|
|
122720
|
+
solanaAddr: solanaAddr ?? null
|
|
122706
122721
|
})
|
|
122707
122722
|
}),
|
|
122708
122723
|
redeemInviteResponseSchema
|
|
@@ -122766,6 +122781,7 @@ var registerRedeemInviteTool = ({
|
|
|
122766
122781
|
const result = await redeemInviteCode({
|
|
122767
122782
|
code,
|
|
122768
122783
|
address: wallets.evmAccount.account.address,
|
|
122784
|
+
solanaAddr: wallets.svmAccount.account.address,
|
|
122769
122785
|
surface: "redeem_invite",
|
|
122770
122786
|
dev: false
|
|
122771
122787
|
});
|
|
@@ -123046,7 +123062,7 @@ var import_path3 = require("path");
|
|
|
123046
123062
|
var import_url2 = require("url");
|
|
123047
123063
|
function getVersion3() {
|
|
123048
123064
|
if (true) {
|
|
123049
|
-
return "0.9.
|
|
123065
|
+
return "0.9.4";
|
|
123050
123066
|
}
|
|
123051
123067
|
const __dirname3 = (0, import_path3.dirname)((0, import_url2.fileURLToPath)(importMetaUrl));
|
|
123052
123068
|
const pkg2 = JSON.parse(
|
|
@@ -123415,6 +123431,7 @@ var startServer = async (flags) => {
|
|
|
123415
123431
|
await redeemInviteCode({
|
|
123416
123432
|
code,
|
|
123417
123433
|
address: wallets.evmAccount.account.address,
|
|
123434
|
+
solanaAddr: wallets.svmAccount.account.address,
|
|
123418
123435
|
surface: "startServer"
|
|
123419
123436
|
});
|
|
123420
123437
|
}
|