tenjin-cli 0.1.0-alpha.3 → 0.1.0-alpha.5
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/README.md +322 -197
- package/dist/{_esm-FEASBWRP.js → _esm-N4KAVXQR.js} +9 -9
- package/dist/buy-YMXXVNFH.js +42 -0
- package/dist/candidate-H7FR4AU5.js +22 -0
- package/dist/{ccip-XR5NE5QK.js → ccip-RPPPKTJR.js} +5 -5
- package/dist/{ccip-NQXCEK2U.js → ccip-ZGGWQN4X.js} +4 -4
- package/dist/{chunk-MUBUQVC3.js → chunk-2JQ5JSG6.js} +3 -2
- package/dist/{chunk-MUBUQVC3.js.map → chunk-2JQ5JSG6.js.map} +1 -1
- package/dist/{chunk-662MSGZB.js → chunk-3IRDP7TN.js} +100 -66
- package/dist/chunk-3IRDP7TN.js.map +1 -0
- package/dist/{chunk-YALGASEU.js → chunk-47PP7TAG.js} +1610 -1610
- package/dist/chunk-47PP7TAG.js.map +1 -0
- package/dist/{buy-EE6SEXP6.js → chunk-4WVKXKDK.js} +27 -59
- package/dist/chunk-4WVKXKDK.js.map +1 -0
- package/dist/chunk-5SCU253N.js +412 -0
- package/dist/chunk-5SCU253N.js.map +1 -0
- package/dist/{chunk-UGX7YPX2.js → chunk-7FK2UN2T.js} +65 -65
- package/dist/{chunk-UGX7YPX2.js.map → chunk-7FK2UN2T.js.map} +1 -1
- package/dist/chunk-ADJYSM45.js +135 -0
- package/dist/chunk-ADJYSM45.js.map +1 -0
- package/dist/{chunk-DXTQ3CSI.js → chunk-BIKAUVC2.js} +43 -11
- package/dist/chunk-BIKAUVC2.js.map +1 -0
- package/dist/{chunk-Z6MFJV5Z.js → chunk-C444K6MI.js} +266 -55
- package/dist/chunk-C444K6MI.js.map +1 -0
- package/dist/{chunk-JPHG2JW3.js → chunk-CVX6JNGD.js} +26 -26
- package/dist/chunk-CVX6JNGD.js.map +1 -0
- package/dist/{chunk-S3IGX57D.js → chunk-FU6MCSLG.js} +9 -9
- package/dist/{lookup-ZPN2Q67N.js → chunk-HTDALK7M.js} +46 -32
- package/dist/chunk-HTDALK7M.js.map +1 -0
- package/dist/chunk-IOPWPMT2.js +239 -0
- package/dist/chunk-IOPWPMT2.js.map +1 -0
- package/dist/{chunk-5CLSD5YN.js → chunk-KYQVEKP5.js} +7 -7
- package/dist/{chunk-RRN3YTK7.js → chunk-KZAAWQNP.js} +3 -3
- package/dist/{chunk-7KUW4MJD.js → chunk-L4IHCN6B.js} +11 -7
- package/dist/chunk-L4IHCN6B.js.map +1 -0
- package/dist/{chunk-XHC6FCGZ.js → chunk-LAM66WFJ.js} +25 -11
- package/dist/chunk-LAM66WFJ.js.map +1 -0
- package/dist/{chunk-NCE5NSN6.js → chunk-M2O56UK7.js} +158 -158
- package/dist/chunk-M2O56UK7.js.map +1 -0
- package/dist/{chunk-GO75V3NZ.js → chunk-MDDGEGSW.js} +8 -6
- package/dist/chunk-MDDGEGSW.js.map +1 -0
- package/dist/{chunk-XJIW7USF.js → chunk-MJZZTKCC.js} +112 -6
- package/dist/chunk-MJZZTKCC.js.map +1 -0
- package/dist/{chunk-Z52RA3NC.js → chunk-NFSOVL3C.js} +51 -21
- package/dist/chunk-NFSOVL3C.js.map +1 -0
- package/dist/{chunk-FJPLRISB.js → chunk-NJF2WENW.js} +5 -4
- package/dist/chunk-NJF2WENW.js.map +1 -0
- package/dist/{chunk-OYMYCW7J.js → chunk-PAUXMRSF.js} +45 -4
- package/dist/{chunk-OYMYCW7J.js.map → chunk-PAUXMRSF.js.map} +1 -1
- package/dist/{chunk-ZABPQJ3M.js → chunk-POJRB2AE.js} +2 -2
- package/dist/{publish-BKBQQAW4.js → chunk-PYNSGYBE.js} +254 -57
- package/dist/chunk-PYNSGYBE.js.map +1 -0
- package/dist/{chunk-YN5SHIXQ.js → chunk-QONTBYQW.js} +12 -9
- package/dist/chunk-QONTBYQW.js.map +1 -0
- package/dist/chunk-QW2Q2KAH.js +27 -0
- package/dist/chunk-QW2Q2KAH.js.map +1 -0
- package/dist/chunk-RTJLLPFA.js +599 -0
- package/dist/chunk-RTJLLPFA.js.map +1 -0
- package/dist/{chunk-CYOF7ROH.js → chunk-S5RYMCV6.js} +3 -3
- package/dist/chunk-TXPPMK4L.js +59 -0
- package/dist/chunk-TXPPMK4L.js.map +1 -0
- package/dist/{chunk-ZMHYXMO6.js → chunk-U5S527PP.js} +3 -3
- package/dist/{chunk-RY4XKNV3.js → chunk-UHTVXQ2O.js} +3 -3
- package/dist/{chunk-QVX5MWJZ.js → chunk-W6R3HAAG.js} +2 -2
- package/dist/{chunk-3OV7E5G5.js → chunk-WWX32ML4.js} +1 -1
- package/dist/{chunk-3OV7E5G5.js.map → chunk-WWX32ML4.js.map} +1 -1
- package/dist/{chunk-HIVZG55D.js → chunk-XJN5WUKL.js} +2 -2
- package/dist/{chunk-HSDCI7OV.js → chunk-YLYINX2H.js} +3 -3
- package/dist/{chunk-4ONXEEQL.js → chunk-ZDY2KY5X.js} +2 -2
- package/dist/{chunk-4ONXEEQL.js.map → chunk-ZDY2KY5X.js.map} +1 -1
- package/dist/{chunk-TLCMMYLY.js → chunk-ZIYVN4CD.js} +6 -6
- package/dist/chunk-ZIYVN4CD.js.map +1 -0
- package/dist/{candidate-ERMSYYQZ.js → chunk-ZW3B5LWX.js} +15 -19
- package/dist/{candidate-ERMSYYQZ.js.map → chunk-ZW3B5LWX.js.map} +1 -1
- package/dist/{cli-SBXI5AMS.js → cli-IW76QTN3.js} +64 -40
- package/dist/{cli-SBXI5AMS.js.map → cli-IW76QTN3.js.map} +1 -1
- package/dist/{config-VELDKLHY.js → config-VCOS7P5K.js} +8 -6
- package/dist/{doctor-T3KWNNP2.js → doctor-WS65JG3V.js} +9 -8
- package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js → ethersCompat-Df4a6QIZ-WHYKB6HA.js} +5 -5
- package/dist/index.js +1 -1
- package/dist/inspect-SFJWUQHO.js +33 -0
- package/dist/install-RVPQPCKH.js +589 -0
- package/dist/install-RVPQPCKH.js.map +1 -0
- package/dist/outcome-GNYCSZ7J.js +20 -0
- package/dist/publish-DSFWQRUN.js +36 -0
- package/dist/publish-DSFWQRUN.js.map +1 -0
- package/dist/run-OMPKA43G.js +16807 -0
- package/dist/run-OMPKA43G.js.map +1 -0
- package/dist/search-KOI6Y7P6.js +24 -0
- package/dist/search-KOI6Y7P6.js.map +1 -0
- package/dist/{secp256k1-N3ZHU7LB.js → secp256k1-XRPVBC6V.js} +3 -3
- package/dist/secp256k1-XRPVBC6V.js.map +1 -0
- package/dist/send-3G4C64HJ.js +222 -0
- package/dist/send-3G4C64HJ.js.map +1 -0
- package/dist/usdc-4VCDHFWX.js +38 -0
- package/dist/usdc-4VCDHFWX.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js → viemAdapter-By13KInL-TUQJBMHM.js} +5 -5
- package/dist/viemAdapter-By13KInL-TUQJBMHM.js.map +1 -0
- package/dist/wallet-B7KJS2R5.js +40 -0
- package/dist/wallet-B7KJS2R5.js.map +1 -0
- package/dist/wallet-PP22LAX7.js +31 -0
- package/dist/wallet-PP22LAX7.js.map +1 -0
- package/package.json +4 -3
- package/skills/tenjin/SKILL.md +83 -15
- package/skills/tenjin-publish/SKILL.md +118 -18
- package/skills/tenjin-search/SKILL.md +149 -31
- package/dist/buy-EE6SEXP6.js.map +0 -1
- package/dist/chunk-662MSGZB.js.map +0 -1
- package/dist/chunk-7KUW4MJD.js.map +0 -1
- package/dist/chunk-AWPAWHNX.js +0 -333
- package/dist/chunk-AWPAWHNX.js.map +0 -1
- package/dist/chunk-DXTQ3CSI.js.map +0 -1
- package/dist/chunk-ESPNTPQ2.js +0 -207
- package/dist/chunk-ESPNTPQ2.js.map +0 -1
- package/dist/chunk-FJPLRISB.js.map +0 -1
- package/dist/chunk-GO75V3NZ.js.map +0 -1
- package/dist/chunk-JPHG2JW3.js.map +0 -1
- package/dist/chunk-NCE5NSN6.js.map +0 -1
- package/dist/chunk-TLCMMYLY.js.map +0 -1
- package/dist/chunk-XHC6FCGZ.js.map +0 -1
- package/dist/chunk-XJIW7USF.js.map +0 -1
- package/dist/chunk-YALGASEU.js.map +0 -1
- package/dist/chunk-YN5SHIXQ.js.map +0 -1
- package/dist/chunk-Z52RA3NC.js.map +0 -1
- package/dist/chunk-Z6MFJV5Z.js.map +0 -1
- package/dist/inspect-LMKOXE4Y.js +0 -96
- package/dist/inspect-LMKOXE4Y.js.map +0 -1
- package/dist/install-LEX3ENQ6.js +0 -387
- package/dist/install-LEX3ENQ6.js.map +0 -1
- package/dist/lookup-ZPN2Q67N.js.map +0 -1
- package/dist/outcome-N7TAK6WR.js +0 -66
- package/dist/outcome-N7TAK6WR.js.map +0 -1
- package/dist/publish-BKBQQAW4.js.map +0 -1
- package/dist/usdc-JIAJW4SV.js +0 -22
- package/dist/wallet-CWEMYVIH.js +0 -179
- package/dist/wallet-CWEMYVIH.js.map +0 -1
- package/dist/wallet-PA54CRBL.js +0 -30
- /package/dist/{_esm-FEASBWRP.js.map → _esm-N4KAVXQR.js.map} +0 -0
- /package/dist/{ccip-NQXCEK2U.js.map → buy-YMXXVNFH.js.map} +0 -0
- /package/dist/{ccip-XR5NE5QK.js.map → candidate-H7FR4AU5.js.map} +0 -0
- /package/dist/{config-VELDKLHY.js.map → ccip-RPPPKTJR.js.map} +0 -0
- /package/dist/{doctor-T3KWNNP2.js.map → ccip-ZGGWQN4X.js.map} +0 -0
- /package/dist/{chunk-S3IGX57D.js.map → chunk-FU6MCSLG.js.map} +0 -0
- /package/dist/{chunk-5CLSD5YN.js.map → chunk-KYQVEKP5.js.map} +0 -0
- /package/dist/{chunk-RRN3YTK7.js.map → chunk-KZAAWQNP.js.map} +0 -0
- /package/dist/{chunk-ZABPQJ3M.js.map → chunk-POJRB2AE.js.map} +0 -0
- /package/dist/{chunk-CYOF7ROH.js.map → chunk-S5RYMCV6.js.map} +0 -0
- /package/dist/{chunk-ZMHYXMO6.js.map → chunk-U5S527PP.js.map} +0 -0
- /package/dist/{chunk-RY4XKNV3.js.map → chunk-UHTVXQ2O.js.map} +0 -0
- /package/dist/{chunk-QVX5MWJZ.js.map → chunk-W6R3HAAG.js.map} +0 -0
- /package/dist/{chunk-HIVZG55D.js.map → chunk-XJN5WUKL.js.map} +0 -0
- /package/dist/{chunk-HSDCI7OV.js.map → chunk-YLYINX2H.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-3YZIAXDK.js.map → config-VCOS7P5K.js.map} +0 -0
- /package/dist/{secp256k1-N3ZHU7LB.js.map → doctor-WS65JG3V.js.map} +0 -0
- /package/dist/{usdc-JIAJW4SV.js.map → ethersCompat-Df4a6QIZ-WHYKB6HA.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-ZZE6UV4Y.js.map → inspect-SFJWUQHO.js.map} +0 -0
- /package/dist/{wallet-PA54CRBL.js.map → outcome-GNYCSZ7J.js.map} +0 -0
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
toBlobSidecars,
|
|
24
24
|
toRlp,
|
|
25
25
|
validateTypedData
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-M2O56UK7.js";
|
|
27
27
|
import {
|
|
28
28
|
ripemd160
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-UHTVXQ2O.js";
|
|
30
30
|
import {
|
|
31
31
|
secp256k1
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-W6R3HAAG.js";
|
|
33
33
|
import {
|
|
34
34
|
AtomicReadyWalletRejectedUpgradeError,
|
|
35
35
|
AtomicityNotSupportedError,
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
erc6492SignatureValidatorAbi,
|
|
88
88
|
erc6492SignatureValidatorByteCode,
|
|
89
89
|
extract,
|
|
90
|
-
formatAbiItem
|
|
90
|
+
formatAbiItem,
|
|
91
91
|
formatAbiParameters,
|
|
92
92
|
formatTransactionRequest,
|
|
93
93
|
getAbiItem,
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
universalResolverResolveAbi,
|
|
111
111
|
universalResolverReverseAbi,
|
|
112
112
|
withResolvers
|
|
113
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-U5S527PP.js";
|
|
114
114
|
import {
|
|
115
115
|
AbiConstructorNotFoundError,
|
|
116
116
|
AbiConstructorParamsNotFoundError,
|
|
@@ -153,17 +153,17 @@ import {
|
|
|
153
153
|
bytesToHex,
|
|
154
154
|
checksumAddress,
|
|
155
155
|
concat,
|
|
156
|
-
concat2,
|
|
156
|
+
concat3 as concat2,
|
|
157
157
|
concatHex,
|
|
158
158
|
createCursor,
|
|
159
159
|
encodeAbiParameters,
|
|
160
160
|
etherUnits,
|
|
161
|
-
formatAbiItem,
|
|
161
|
+
formatAbiItem as formatAbiItem2,
|
|
162
162
|
formatBlockParameter,
|
|
163
163
|
formatEther,
|
|
164
164
|
formatGwei,
|
|
165
165
|
formatUnits,
|
|
166
|
-
from,
|
|
166
|
+
from2 as from,
|
|
167
167
|
fromBoolean,
|
|
168
168
|
fromBytes,
|
|
169
169
|
fromHex2 as fromHex,
|
|
@@ -210,7 +210,7 @@ import {
|
|
|
210
210
|
trimLeft2,
|
|
211
211
|
validate,
|
|
212
212
|
validate2
|
|
213
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-47PP7TAG.js";
|
|
214
214
|
import {
|
|
215
215
|
__export
|
|
216
216
|
} from "./chunk-ZXTAQYNA.js";
|
|
@@ -262,7 +262,7 @@ function encodeEventTopics(parameters) {
|
|
|
262
262
|
}
|
|
263
263
|
if (abiItem.anonymous)
|
|
264
264
|
return topics;
|
|
265
|
-
const definition =
|
|
265
|
+
const definition = formatAbiItem2(abiItem);
|
|
266
266
|
const signature = toEventSelector(definition);
|
|
267
267
|
return [signature, ...topics];
|
|
268
268
|
}
|
|
@@ -350,7 +350,7 @@ function getContractError(err, { abi: abi2, address, args, docsPath: docsPath4,
|
|
|
350
350
|
// node_modules/.pnpm/viem@2.55.2_typescript@6.0.3_zod@4.4.3/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
|
|
351
351
|
async function recoverPublicKey({ hash: hash2, signature }) {
|
|
352
352
|
const hashHex = isHex(hash2) ? hash2 : toHex(hash2);
|
|
353
|
-
const { secp256k1: secp256k12 } = await import("./secp256k1-
|
|
353
|
+
const { secp256k1: secp256k12 } = await import("./secp256k1-XRPVBC6V.js");
|
|
354
354
|
const signature_ = (() => {
|
|
355
355
|
if (typeof signature === "object" && "r" in signature && "s" in signature) {
|
|
356
356
|
const { r, s, v, yParity } = signature;
|
|
@@ -1166,7 +1166,7 @@ function decodeEventLog(parameters) {
|
|
|
1166
1166
|
const [signature, ...argTopics] = topics;
|
|
1167
1167
|
if (!signature)
|
|
1168
1168
|
throw new AbiEventSignatureEmptyTopicsError({ docsPath: docsPath2 });
|
|
1169
|
-
const abiItem = abi2.find((x) => x.type === "event" && signature === toEventSelector(
|
|
1169
|
+
const abiItem = abi2.find((x) => x.type === "event" && signature === toEventSelector(formatAbiItem2(x)));
|
|
1170
1170
|
if (!(abiItem && "name" in abiItem) || abiItem.type !== "event")
|
|
1171
1171
|
throw new AbiEventSignatureNotFoundError(signature, { docsPath: docsPath2 });
|
|
1172
1172
|
const { name, inputs } = abiItem;
|
|
@@ -4537,9 +4537,9 @@ function assert(publicKey, options = {}) {
|
|
|
4537
4537
|
}
|
|
4538
4538
|
function from2(value) {
|
|
4539
4539
|
const publicKey = (() => {
|
|
4540
|
-
if (validate(value))
|
|
4541
|
-
return fromHex2(value);
|
|
4542
4540
|
if (validate2(value))
|
|
4541
|
+
return fromHex2(value);
|
|
4542
|
+
if (validate(value))
|
|
4543
4543
|
return fromBytes2(value);
|
|
4544
4544
|
const { prefix, x, y } = value;
|
|
4545
4545
|
if (typeof x === "bigint" && typeof y === "bigint")
|
|
@@ -4556,8 +4556,8 @@ function fromHex2(publicKey) {
|
|
|
4556
4556
|
if (publicKey.length !== 132 && publicKey.length !== 130 && publicKey.length !== 68)
|
|
4557
4557
|
throw new InvalidSerializedSizeError({ publicKey });
|
|
4558
4558
|
if (publicKey.length === 130) {
|
|
4559
|
-
const x2 = BigInt(
|
|
4560
|
-
const y = BigInt(
|
|
4559
|
+
const x2 = BigInt(slice3(publicKey, 0, 32));
|
|
4560
|
+
const y = BigInt(slice3(publicKey, 32, 64));
|
|
4561
4561
|
return {
|
|
4562
4562
|
prefix: 4,
|
|
4563
4563
|
x: x2,
|
|
@@ -4565,17 +4565,17 @@ function fromHex2(publicKey) {
|
|
|
4565
4565
|
};
|
|
4566
4566
|
}
|
|
4567
4567
|
if (publicKey.length === 132) {
|
|
4568
|
-
const prefix2 = Number(
|
|
4569
|
-
const x2 = BigInt(
|
|
4570
|
-
const y = BigInt(
|
|
4568
|
+
const prefix2 = Number(slice3(publicKey, 0, 1));
|
|
4569
|
+
const x2 = BigInt(slice3(publicKey, 1, 33));
|
|
4570
|
+
const y = BigInt(slice3(publicKey, 33, 65));
|
|
4571
4571
|
return {
|
|
4572
4572
|
prefix: prefix2,
|
|
4573
4573
|
x: x2,
|
|
4574
4574
|
y
|
|
4575
4575
|
};
|
|
4576
4576
|
}
|
|
4577
|
-
const prefix = Number(
|
|
4578
|
-
const x = BigInt(
|
|
4577
|
+
const prefix = Number(slice3(publicKey, 0, 1));
|
|
4578
|
+
const x = BigInt(slice3(publicKey, 1, 33));
|
|
4579
4579
|
return {
|
|
4580
4580
|
prefix,
|
|
4581
4581
|
x
|
|
@@ -4650,7 +4650,7 @@ var InvalidSerializedSizeError = class extends BaseError2 {
|
|
|
4650
4650
|
super(`Value \`${publicKey}\` is an invalid public key size.`, {
|
|
4651
4651
|
metaMessages: [
|
|
4652
4652
|
"Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",
|
|
4653
|
-
`Received ${
|
|
4653
|
+
`Received ${size3(from(publicKey))} bytes.`
|
|
4654
4654
|
]
|
|
4655
4655
|
});
|
|
4656
4656
|
Object.defineProperty(this, "name", {
|
|
@@ -4686,7 +4686,7 @@ function checksum2(address) {
|
|
|
4686
4686
|
return checksum.get(address);
|
|
4687
4687
|
assert2(address, { strict: false });
|
|
4688
4688
|
const hexAddress = address.substring(2).toLowerCase();
|
|
4689
|
-
const hash2 = keccak2562(
|
|
4689
|
+
const hash2 = keccak2562(fromString(hexAddress), { as: "Bytes" });
|
|
4690
4690
|
const characters = hexAddress.split("");
|
|
4691
4691
|
for (let i = 0; i < 40; i += 2) {
|
|
4692
4692
|
if (hash2[i >> 1] >> 4 >= 8 && characters[i]) {
|
|
@@ -4888,16 +4888,16 @@ function decodeAddress2(cursor, options = {}) {
|
|
|
4888
4888
|
const { checksum: checksum3 = false } = options;
|
|
4889
4889
|
const value = cursor.readBytes(32);
|
|
4890
4890
|
const wrap3 = (address) => checksum3 ? checksum2(address) : address;
|
|
4891
|
-
return [wrap3(fromBytes(
|
|
4891
|
+
return [wrap3(fromBytes(slice2(value, -20))), 32];
|
|
4892
4892
|
}
|
|
4893
4893
|
function decodeArray(cursor, param, options) {
|
|
4894
4894
|
const { checksumAddress: checksumAddress2, length, staticPosition } = options;
|
|
4895
4895
|
if (!length) {
|
|
4896
|
-
const offset =
|
|
4896
|
+
const offset = toNumber(cursor.readBytes(sizeOfOffset));
|
|
4897
4897
|
const start = staticPosition + offset;
|
|
4898
4898
|
const startOfData = start + sizeOfLength;
|
|
4899
4899
|
cursor.setPosition(start);
|
|
4900
|
-
const length2 =
|
|
4900
|
+
const length2 = toNumber(cursor.readBytes(sizeOfLength));
|
|
4901
4901
|
const dynamicChild = hasDynamicChild(param);
|
|
4902
4902
|
let consumed2 = 0;
|
|
4903
4903
|
const value2 = [];
|
|
@@ -4914,7 +4914,7 @@ function decodeArray(cursor, param, options) {
|
|
|
4914
4914
|
return [value2, 32];
|
|
4915
4915
|
}
|
|
4916
4916
|
if (hasDynamicChild(param)) {
|
|
4917
|
-
const offset =
|
|
4917
|
+
const offset = toNumber(cursor.readBytes(sizeOfOffset));
|
|
4918
4918
|
const start = staticPosition + offset;
|
|
4919
4919
|
const value2 = [];
|
|
4920
4920
|
for (let i = 0; i < length; ++i) {
|
|
@@ -4946,9 +4946,9 @@ function decodeBool(cursor) {
|
|
|
4946
4946
|
function decodeBytes(cursor, param, { staticPosition }) {
|
|
4947
4947
|
const [_, size5] = param.type.split("bytes");
|
|
4948
4948
|
if (!size5) {
|
|
4949
|
-
const offset =
|
|
4949
|
+
const offset = toNumber(cursor.readBytes(32));
|
|
4950
4950
|
cursor.setPosition(staticPosition + offset);
|
|
4951
|
-
const length =
|
|
4951
|
+
const length = toNumber(cursor.readBytes(32));
|
|
4952
4952
|
if (length === 0) {
|
|
4953
4953
|
cursor.setPosition(staticPosition + 32);
|
|
4954
4954
|
return ["0x", 32];
|
|
@@ -4965,7 +4965,7 @@ function decodeNumber(cursor, param) {
|
|
|
4965
4965
|
const size5 = Number.parseInt(param.type.split("int")[1] || "256", 10);
|
|
4966
4966
|
const value = cursor.readBytes(32);
|
|
4967
4967
|
return [
|
|
4968
|
-
size5 > 48 ? toBigInt(value, { signed }) :
|
|
4968
|
+
size5 > 48 ? toBigInt(value, { signed }) : toNumber(value, { signed }),
|
|
4969
4969
|
32
|
|
4970
4970
|
];
|
|
4971
4971
|
}
|
|
@@ -4975,7 +4975,7 @@ function decodeTuple(cursor, param, options) {
|
|
|
4975
4975
|
const value = hasUnnamedChild ? [] : {};
|
|
4976
4976
|
let consumed = 0;
|
|
4977
4977
|
if (hasDynamicChild(param)) {
|
|
4978
|
-
const offset =
|
|
4978
|
+
const offset = toNumber(cursor.readBytes(sizeOfOffset));
|
|
4979
4979
|
const start = staticPosition + offset;
|
|
4980
4980
|
for (let i = 0; i < param.components.length; ++i) {
|
|
4981
4981
|
const component = param.components[i];
|
|
@@ -5002,16 +5002,16 @@ function decodeTuple(cursor, param, options) {
|
|
|
5002
5002
|
return [value, consumed];
|
|
5003
5003
|
}
|
|
5004
5004
|
function decodeString(cursor, { staticPosition }) {
|
|
5005
|
-
const offset =
|
|
5005
|
+
const offset = toNumber(cursor.readBytes(32));
|
|
5006
5006
|
const start = staticPosition + offset;
|
|
5007
5007
|
cursor.setPosition(start);
|
|
5008
|
-
const length =
|
|
5008
|
+
const length = toNumber(cursor.readBytes(32));
|
|
5009
5009
|
if (length === 0) {
|
|
5010
5010
|
cursor.setPosition(staticPosition + 32);
|
|
5011
5011
|
return ["", 32];
|
|
5012
5012
|
}
|
|
5013
5013
|
const data = cursor.readBytes(length, 32);
|
|
5014
|
-
const value = toString(
|
|
5014
|
+
const value = toString(trimLeft(data));
|
|
5015
5015
|
cursor.setPosition(staticPosition + 32);
|
|
5016
5016
|
return [value, 32];
|
|
5017
5017
|
}
|
|
@@ -5077,7 +5077,7 @@ function encode2(preparedParameters) {
|
|
|
5077
5077
|
if (dynamic)
|
|
5078
5078
|
staticSize += 32;
|
|
5079
5079
|
else
|
|
5080
|
-
staticSize +=
|
|
5080
|
+
staticSize += size3(encoded);
|
|
5081
5081
|
}
|
|
5082
5082
|
const staticParameters = [];
|
|
5083
5083
|
const dynamicParameters = [];
|
|
@@ -5087,7 +5087,7 @@ function encode2(preparedParameters) {
|
|
|
5087
5087
|
if (dynamic) {
|
|
5088
5088
|
staticParameters.push(fromNumber(staticSize + dynamicSize, { size: 32 }));
|
|
5089
5089
|
dynamicParameters.push(encoded);
|
|
5090
|
-
dynamicSize +=
|
|
5090
|
+
dynamicSize += size3(encoded);
|
|
5091
5091
|
} else {
|
|
5092
5092
|
staticParameters.push(encoded);
|
|
5093
5093
|
}
|
|
@@ -5144,7 +5144,7 @@ function encodeArray(value, options) {
|
|
|
5144
5144
|
}
|
|
5145
5145
|
function encodeBytes(value, { type }) {
|
|
5146
5146
|
const [, parametersize] = type.split("bytes");
|
|
5147
|
-
const bytesSize =
|
|
5147
|
+
const bytesSize = size3(value);
|
|
5148
5148
|
if (!parametersize) {
|
|
5149
5149
|
let value_ = value;
|
|
5150
5150
|
if (bytesSize % 32 !== 0)
|
|
@@ -5188,15 +5188,15 @@ function encodeNumber(value, { signed, size: size5 }) {
|
|
|
5188
5188
|
};
|
|
5189
5189
|
}
|
|
5190
5190
|
function encodeString(value) {
|
|
5191
|
-
const hexValue =
|
|
5192
|
-
const partsLength = Math.ceil(
|
|
5191
|
+
const hexValue = fromString2(value);
|
|
5192
|
+
const partsLength = Math.ceil(size3(hexValue) / 32);
|
|
5193
5193
|
const parts = [];
|
|
5194
5194
|
for (let i = 0; i < partsLength; i++) {
|
|
5195
|
-
parts.push(padRight(
|
|
5195
|
+
parts.push(padRight(slice3(hexValue, i * 32, (i + 1) * 32)));
|
|
5196
5196
|
}
|
|
5197
5197
|
return {
|
|
5198
5198
|
dynamic: true,
|
|
5199
|
-
encoded: concat2(padRight(fromNumber(
|
|
5199
|
+
encoded: concat2(padRight(fromNumber(size3(hexValue), { size: 32 })), ...parts)
|
|
5200
5200
|
};
|
|
5201
5201
|
}
|
|
5202
5202
|
function encodeTuple(value, options) {
|
|
@@ -5453,13 +5453,13 @@ function decode(parameters, data, options = {}) {
|
|
|
5453
5453
|
const { as = "Array", checksumAddress: checksumAddress2 = false } = options;
|
|
5454
5454
|
const bytes = typeof data === "string" ? fromHex(data) : data;
|
|
5455
5455
|
const cursor = create(bytes);
|
|
5456
|
-
if (
|
|
5456
|
+
if (size2(bytes) === 0 && parameters.length > 0)
|
|
5457
5457
|
throw new ZeroDataError();
|
|
5458
|
-
if (
|
|
5458
|
+
if (size2(bytes) && size2(bytes) < 32)
|
|
5459
5459
|
throw new DataSizeTooSmallError({
|
|
5460
5460
|
data: typeof data === "string" ? data : fromBytes(data),
|
|
5461
5461
|
parameters,
|
|
5462
|
-
size:
|
|
5462
|
+
size: size2(bytes)
|
|
5463
5463
|
});
|
|
5464
5464
|
let consumed = 0;
|
|
5465
5465
|
const values = as === "Array" ? [] : {};
|
|
@@ -5517,7 +5517,7 @@ function encodePacked2(types, values) {
|
|
|
5517
5517
|
return padLeft(address.toLowerCase(), isArray ? 32 : 0);
|
|
5518
5518
|
}
|
|
5519
5519
|
if (type === "string")
|
|
5520
|
-
return
|
|
5520
|
+
return fromString2(value);
|
|
5521
5521
|
if (type === "bytes")
|
|
5522
5522
|
return value;
|
|
5523
5523
|
if (type === "bool")
|
|
@@ -5603,7 +5603,7 @@ var ArrayLengthMismatchError = class extends BaseError2 {
|
|
|
5603
5603
|
};
|
|
5604
5604
|
var BytesSizeMismatchError2 = class extends BaseError2 {
|
|
5605
5605
|
constructor({ expectedSize, value }) {
|
|
5606
|
-
super(`Size of bytes "${value}" (bytes${
|
|
5606
|
+
super(`Size of bytes "${value}" (bytes${size3(value)}) does not match expected size (bytes${expectedSize}).`);
|
|
5607
5607
|
Object.defineProperty(this, "name", {
|
|
5608
5608
|
enumerable: true,
|
|
5609
5609
|
configurable: true,
|
|
@@ -5766,8 +5766,8 @@ function fromBytes3(signature) {
|
|
|
5766
5766
|
function fromHex4(signature) {
|
|
5767
5767
|
if (signature.length !== 130 && signature.length !== 132)
|
|
5768
5768
|
throw new InvalidSerializedSizeError2({ signature });
|
|
5769
|
-
const r = BigInt(
|
|
5770
|
-
const s = BigInt(
|
|
5769
|
+
const r = BigInt(slice3(signature, 0, 32));
|
|
5770
|
+
const s = BigInt(slice3(signature, 32, 64));
|
|
5771
5771
|
const yParity = (() => {
|
|
5772
5772
|
const yParity2 = Number(`0x${signature.slice(130)}`);
|
|
5773
5773
|
if (Number.isNaN(yParity2))
|
|
@@ -5842,8 +5842,8 @@ function toTuple(signature) {
|
|
|
5842
5842
|
const { r, s, yParity } = signature;
|
|
5843
5843
|
return [
|
|
5844
5844
|
yParity ? "0x01" : "0x",
|
|
5845
|
-
r === 0n ? "0x" :
|
|
5846
|
-
s === 0n ? "0x" :
|
|
5845
|
+
r === 0n ? "0x" : trimLeft2(fromNumber(r)),
|
|
5846
|
+
s === 0n ? "0x" : trimLeft2(fromNumber(s))
|
|
5847
5847
|
];
|
|
5848
5848
|
}
|
|
5849
5849
|
function vToYParity(v) {
|
|
@@ -5860,7 +5860,7 @@ var InvalidSerializedSizeError2 = class extends BaseError2 {
|
|
|
5860
5860
|
super(`Value \`${signature}\` is an invalid signature size.`, {
|
|
5861
5861
|
metaMessages: [
|
|
5862
5862
|
"Expected: 64 bytes or 65 bytes.",
|
|
5863
|
-
`Received ${
|
|
5863
|
+
`Received ${size3(from(signature))} bytes.`
|
|
5864
5864
|
]
|
|
5865
5865
|
});
|
|
5866
5866
|
Object.defineProperty(this, "name", {
|
|
@@ -5982,7 +5982,7 @@ var magicBytes = "0x801080108010801080108010801080108010801080108010801080108010
|
|
|
5982
5982
|
var suffixParameters = from4("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");
|
|
5983
5983
|
function assert4(value) {
|
|
5984
5984
|
if (typeof value === "string") {
|
|
5985
|
-
if (
|
|
5985
|
+
if (slice3(value, -32) !== magicBytes)
|
|
5986
5986
|
throw new InvalidWrappedSignatureError(value);
|
|
5987
5987
|
} else
|
|
5988
5988
|
assert3(value.authorization);
|
|
@@ -5994,9 +5994,9 @@ function from8(value) {
|
|
|
5994
5994
|
}
|
|
5995
5995
|
function unwrap(wrapped) {
|
|
5996
5996
|
assert4(wrapped);
|
|
5997
|
-
const suffixLength =
|
|
5998
|
-
const suffix =
|
|
5999
|
-
const signature =
|
|
5997
|
+
const suffixLength = toNumber2(slice3(wrapped, -64, -32));
|
|
5998
|
+
const suffix = slice3(wrapped, -suffixLength - 64, -64);
|
|
5999
|
+
const signature = slice3(wrapped, 0, -suffixLength - 64);
|
|
6000
6000
|
const [auth, to, data] = decode(suffixParameters, suffix);
|
|
6001
6001
|
const authorization = from7({
|
|
6002
6002
|
address: auth.delegation,
|
|
@@ -6028,7 +6028,7 @@ function wrap(value) {
|
|
|
6028
6028
|
value.to ?? self,
|
|
6029
6029
|
data ?? "0x"
|
|
6030
6030
|
]);
|
|
6031
|
-
const suffixLength = fromNumber(
|
|
6031
|
+
const suffixLength = fromNumber(size3(suffix), { size: 32 });
|
|
6032
6032
|
return concat2(signature, suffix, suffixLength, magicBytes);
|
|
6033
6033
|
}
|
|
6034
6034
|
function validate4(value) {
|
|
@@ -7002,11 +7002,11 @@ function from9(abiItem, options = {}) {
|
|
|
7002
7002
|
}
|
|
7003
7003
|
function fromAbi(abi2, name, options) {
|
|
7004
7004
|
const { args = [], prepare = true } = options ?? {};
|
|
7005
|
-
const isSelector =
|
|
7005
|
+
const isSelector = validate2(name, { strict: false });
|
|
7006
7006
|
const abiItems = abi2.filter((abiItem2) => {
|
|
7007
7007
|
if (isSelector) {
|
|
7008
7008
|
if (abiItem2.type === "function" || abiItem2.type === "error")
|
|
7009
|
-
return getSelector(abiItem2) ===
|
|
7009
|
+
return getSelector(abiItem2) === slice3(name, 0, 4);
|
|
7010
7010
|
if (abiItem2.type === "event")
|
|
7011
7011
|
return getSignatureHash(abiItem2) === name;
|
|
7012
7012
|
return false;
|
|
@@ -7080,7 +7080,7 @@ function getSelector(...parameters) {
|
|
|
7080
7080
|
}
|
|
7081
7081
|
return parameters[0];
|
|
7082
7082
|
})();
|
|
7083
|
-
return
|
|
7083
|
+
return slice3(getSignatureHash(abiItem), 0, 4);
|
|
7084
7084
|
}
|
|
7085
7085
|
function getSignature(...parameters) {
|
|
7086
7086
|
const abiItem = (() => {
|
|
@@ -7093,7 +7093,7 @@ function getSignature(...parameters) {
|
|
|
7093
7093
|
const signature = (() => {
|
|
7094
7094
|
if (typeof abiItem === "string")
|
|
7095
7095
|
return abiItem;
|
|
7096
|
-
return
|
|
7096
|
+
return formatAbiItem(abiItem);
|
|
7097
7097
|
})();
|
|
7098
7098
|
return normalizeSignature(signature);
|
|
7099
7099
|
}
|
|
@@ -7107,15 +7107,15 @@ function getSignatureHash(...parameters) {
|
|
|
7107
7107
|
})();
|
|
7108
7108
|
if (typeof abiItem !== "string" && "hash" in abiItem && abiItem.hash)
|
|
7109
7109
|
return abiItem.hash;
|
|
7110
|
-
return keccak2562(
|
|
7110
|
+
return keccak2562(fromString2(getSignature(abiItem)));
|
|
7111
7111
|
}
|
|
7112
7112
|
var AmbiguityError = class extends BaseError2 {
|
|
7113
7113
|
constructor(x, y) {
|
|
7114
7114
|
super("Found ambiguous types in overloaded ABI Items.", {
|
|
7115
7115
|
metaMessages: [
|
|
7116
7116
|
// TODO: abitype to add support for signature-formatted ABI items.
|
|
7117
|
-
`\`${x.type}\` in \`${normalizeSignature(
|
|
7118
|
-
`\`${y.type}\` in \`${normalizeSignature(
|
|
7117
|
+
`\`${x.type}\` in \`${normalizeSignature(formatAbiItem(x.abiItem))}\`, and`,
|
|
7118
|
+
`\`${y.type}\` in \`${normalizeSignature(formatAbiItem(y.abiItem))}\``,
|
|
7119
7119
|
"",
|
|
7120
7120
|
"These types encode differently and cannot be distinguished at runtime.",
|
|
7121
7121
|
"Remove one of the ambiguous items in the ABI."
|
|
@@ -7462,7 +7462,7 @@ var universalSignatureValidatorAbi = [
|
|
|
7462
7462
|
}
|
|
7463
7463
|
];
|
|
7464
7464
|
function assert5(wrapped) {
|
|
7465
|
-
if (
|
|
7465
|
+
if (slice3(wrapped, -32) !== magicBytes2)
|
|
7466
7466
|
throw new InvalidWrappedSignatureError2(wrapped);
|
|
7467
7467
|
}
|
|
7468
7468
|
function from12(wrapped) {
|
|
@@ -10302,4 +10302,4 @@ export {
|
|
|
10302
10302
|
serializeCompactSignature,
|
|
10303
10303
|
signatureToCompactSignature
|
|
10304
10304
|
};
|
|
10305
|
-
//# sourceMappingURL=chunk-
|
|
10305
|
+
//# sourceMappingURL=chunk-7FK2UN2T.js.map
|