@vultisig/cli 2.2.0 → 2.3.1
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/CHANGELOG.md +19 -0
- package/dist/index.js +41 -23
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @vultisig/cli
|
|
2
2
|
|
|
3
|
+
## 2.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#701](https://github.com/vultisig/vultisig-sdk/pull/701) [`1bcb195`](https://github.com/vultisig/vultisig-sdk/commit/1bcb195013b9730bf6ed0e2c42209d2285a357e8) Thanks [@neavra](https://github.com/neavra)! - Fix EIP-712 domain hashing for domains that omit standard fields. The agent executor's `sign_typed_data` hardcoded the `EIP712Domain` type to all four standard fields while skipping absent values during data encoding, producing non-canonical hashes for domains without `verifyingContract` (e.g. Polymarket's `ClobAuthDomain`) — CLOB rejected every auto-submitted order with `401 Invalid L1 Request headers`. The domain type is now derived from the fields actually present, matching viem/ethers canonical hashing (verified live against the Polymarket CLOB: L1 auth now accepted and L2 API credentials derived).
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`cb2e8f0`](https://github.com/vultisig/vultisig-sdk/commit/cb2e8f00861daff26ac8b04a34e22be9b243235c)]:
|
|
10
|
+
- @vultisig/core-chain@2.16.1
|
|
11
|
+
- @vultisig/sdk@2.3.1
|
|
12
|
+
|
|
13
|
+
## 2.3.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`fcfd1f9`](https://github.com/vultisig/vultisig-sdk/commit/fcfd1f90550d8f62821167ea349b3e8ee2bf9d24)]:
|
|
18
|
+
- @vultisig/core-chain@2.16.0
|
|
19
|
+
- @vultisig/sdk@2.3.0
|
|
20
|
+
- @vultisig/rujira@36.0.0
|
|
21
|
+
|
|
3
22
|
## 2.2.0
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -5,11 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __esm = (fn, res) => function __init() {
|
|
9
|
-
|
|
8
|
+
var __esm = (fn, res, err) => function __init() {
|
|
9
|
+
if (err) throw err[0];
|
|
10
|
+
try {
|
|
11
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw err = [e], e;
|
|
14
|
+
}
|
|
10
15
|
};
|
|
11
16
|
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
-
|
|
17
|
+
try {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
} catch (e) {
|
|
20
|
+
throw mod = 0, e;
|
|
21
|
+
}
|
|
13
22
|
};
|
|
14
23
|
var __export = (target, all) => {
|
|
15
24
|
for (var name in all)
|
|
@@ -6718,7 +6727,11 @@ var AgentExecutor = class {
|
|
|
6718
6727
|
if (this.verbose)
|
|
6719
6728
|
process.stderr.write(`[sign_thor_msg_deposit_lp] chain=${chain}, memo='${memo}', amountBaseUnits=${amountRaw}
|
|
6720
6729
|
`);
|
|
6721
|
-
const result = await this.vault.signMsgDeposit({
|
|
6730
|
+
const result = await this.vault.signMsgDeposit({
|
|
6731
|
+
chain,
|
|
6732
|
+
amountBaseUnits: amountRaw,
|
|
6733
|
+
memo
|
|
6734
|
+
});
|
|
6722
6735
|
this.pendingPayloads.clear();
|
|
6723
6736
|
const explorerUrl = VultisigSdk.getTxExplorerUrl(chain, result.txHash);
|
|
6724
6737
|
return {
|
|
@@ -7500,8 +7513,12 @@ function resolveChainId(chainId) {
|
|
|
7500
7513
|
}
|
|
7501
7514
|
async function computeEIP712Hash(domain, types, primaryType, message) {
|
|
7502
7515
|
const { keccak_256: keccak_2562 } = await Promise.resolve().then(() => (init_sha3(), sha3_exports));
|
|
7503
|
-
const
|
|
7504
|
-
|
|
7516
|
+
const typesWithDomain = types["EIP712Domain"] ? types : {
|
|
7517
|
+
...types,
|
|
7518
|
+
EIP712Domain: EIP712_DOMAIN_FIELDS.filter((f) => domain[f.name] !== void 0 && domain[f.name] !== null)
|
|
7519
|
+
};
|
|
7520
|
+
const domainSeparator = hashStruct("EIP712Domain", domain, typesWithDomain, keccak_2562);
|
|
7521
|
+
const messageHash = hashStruct(primaryType, message, typesWithDomain, keccak_2562);
|
|
7505
7522
|
const prefix = new Uint8Array([25, 1]);
|
|
7506
7523
|
const combined = new Uint8Array(2 + 32 + 32);
|
|
7507
7524
|
combined.set(prefix, 0);
|
|
@@ -7524,7 +7541,6 @@ function hashType(typeName, types, keccak) {
|
|
|
7524
7541
|
}
|
|
7525
7542
|
function encodeType(typeName, types) {
|
|
7526
7543
|
const fields = getTypeFields(typeName, types);
|
|
7527
|
-
if (!fields) return "";
|
|
7528
7544
|
const refs = /* @__PURE__ */ new Set();
|
|
7529
7545
|
findReferencedTypes(typeName, types, refs);
|
|
7530
7546
|
refs.delete(typeName);
|
|
@@ -7532,16 +7548,13 @@ function encodeType(typeName, types) {
|
|
|
7532
7548
|
let result = `${typeName}(${fields.map((f) => `${f.type} ${f.name}`).join(",")})`;
|
|
7533
7549
|
for (const ref of sortedRefs) {
|
|
7534
7550
|
const refFields = getTypeFields(ref, types);
|
|
7535
|
-
|
|
7536
|
-
result += `${ref}(${refFields.map((f) => `${f.type} ${f.name}`).join(",")})`;
|
|
7537
|
-
}
|
|
7551
|
+
result += `${ref}(${refFields.map((f) => `${f.type} ${f.name}`).join(",")})`;
|
|
7538
7552
|
}
|
|
7539
7553
|
return result;
|
|
7540
7554
|
}
|
|
7541
7555
|
function findReferencedTypes(typeName, types, refs) {
|
|
7542
7556
|
if (refs.has(typeName)) return;
|
|
7543
7557
|
const fields = getTypeFields(typeName, types);
|
|
7544
|
-
if (!fields) return;
|
|
7545
7558
|
refs.add(typeName);
|
|
7546
7559
|
for (const field of fields) {
|
|
7547
7560
|
const baseType = field.type.replace(/\[\d*\]$/, "");
|
|
@@ -7550,25 +7563,30 @@ function findReferencedTypes(typeName, types, refs) {
|
|
|
7550
7563
|
}
|
|
7551
7564
|
}
|
|
7552
7565
|
}
|
|
7566
|
+
var EIP712_DOMAIN_FIELDS = [
|
|
7567
|
+
{ name: "name", type: "string" },
|
|
7568
|
+
{ name: "version", type: "string" },
|
|
7569
|
+
{ name: "chainId", type: "uint256" },
|
|
7570
|
+
{ name: "verifyingContract", type: "address" },
|
|
7571
|
+
{ name: "salt", type: "bytes32" }
|
|
7572
|
+
];
|
|
7553
7573
|
function getTypeFields(typeName, types) {
|
|
7554
|
-
|
|
7555
|
-
if (
|
|
7556
|
-
|
|
7557
|
-
{ name: "name", type: "string" },
|
|
7558
|
-
{ name: "version", type: "string" },
|
|
7559
|
-
{ name: "chainId", type: "uint256" },
|
|
7560
|
-
{ name: "verifyingContract", type: "address" }
|
|
7561
|
-
];
|
|
7574
|
+
const fields = types[typeName];
|
|
7575
|
+
if (!fields) {
|
|
7576
|
+
throw new Error(`EIP-712 encode: missing type definition for struct "${typeName}"`);
|
|
7562
7577
|
}
|
|
7563
|
-
return
|
|
7578
|
+
return fields;
|
|
7564
7579
|
}
|
|
7565
7580
|
function encodeData(typeName, data, types, keccak) {
|
|
7566
7581
|
const fields = getTypeFields(typeName, types);
|
|
7567
|
-
if (!fields) return new Uint8Array(0);
|
|
7568
7582
|
const chunks = [];
|
|
7569
7583
|
for (const field of fields) {
|
|
7570
7584
|
const value = data[field.name];
|
|
7571
|
-
if (value === void 0 || value === null)
|
|
7585
|
+
if (value === void 0 || value === null) {
|
|
7586
|
+
throw new Error(
|
|
7587
|
+
`EIP-712 encode: missing value for declared field "${field.name}" (${field.type}) in struct "${typeName}"`
|
|
7588
|
+
);
|
|
7589
|
+
}
|
|
7572
7590
|
chunks.push(encodeField(field.type, value, types, keccak));
|
|
7573
7591
|
}
|
|
7574
7592
|
const totalLen = chunks.reduce((sum, c) => sum + c.length, 0);
|
|
@@ -8903,7 +8921,7 @@ var cachedVersion = null;
|
|
|
8903
8921
|
function getVersion() {
|
|
8904
8922
|
if (cachedVersion) return cachedVersion;
|
|
8905
8923
|
if (true) {
|
|
8906
|
-
cachedVersion = "2.
|
|
8924
|
+
cachedVersion = "2.3.1";
|
|
8907
8925
|
return cachedVersion;
|
|
8908
8926
|
}
|
|
8909
8927
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vultisig/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "The self-custody MPC wallet CLI for AI coding agents (Claude Code, Cursor, OpenCode). Natural-language agent mode, 36+ chains, DKLS23 threshold signatures. Seedless.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"@napi-rs/keyring": "^1.3.0",
|
|
75
75
|
"@noble/hashes": "^2.2.0",
|
|
76
76
|
"@vultisig/client-shared": "^0.2.15",
|
|
77
|
-
"@vultisig/core-chain": "^2.
|
|
78
|
-
"@vultisig/rujira": "^
|
|
79
|
-
"@vultisig/sdk": "^2.
|
|
77
|
+
"@vultisig/core-chain": "^2.16.1",
|
|
78
|
+
"@vultisig/rujira": "^36.0.0",
|
|
79
|
+
"@vultisig/sdk": "^2.3.1",
|
|
80
80
|
"chalk": "^5.6.2",
|
|
81
81
|
"cli-table3": "^0.6.5",
|
|
82
82
|
"commander": "^15.0.0",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@types/node": "^25.9.2",
|
|
93
93
|
"@types/tabtab": "^3.0.4",
|
|
94
94
|
"@types/ws": "^8.18.1",
|
|
95
|
-
"esbuild": "^0.28.
|
|
95
|
+
"esbuild": "^0.28.1",
|
|
96
96
|
"tsx": "^4.22.4",
|
|
97
97
|
"typescript": "^6.0.3",
|
|
98
98
|
"vitest": "^4.1.8"
|