@agether/sdk 2.3.2 → 2.3.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/cli.js +7 -4
- package/dist/index.d.mts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -4
- package/dist/index.mjs +7 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1449,10 +1449,8 @@ var init_MorphoClient = __esm({
|
|
|
1449
1449
|
* through an ERC-4337 UserOperation.
|
|
1450
1450
|
*/
|
|
1451
1451
|
async exec(target, data, value = 0n) {
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1454
|
-
[target, value, data]
|
|
1455
|
-
);
|
|
1452
|
+
const valueHex = import_ethers.ethers.zeroPadValue(import_ethers.ethers.toBeHex(value), 32);
|
|
1453
|
+
const executionCalldata = import_ethers.ethers.concat([target, valueHex, data]);
|
|
1456
1454
|
const safe7579Iface = new import_ethers.ethers.Interface(SAFE7579_ACCOUNT_ABI);
|
|
1457
1455
|
const callData = safe7579Iface.encodeFunctionData("execute", [MODE_SINGLE, executionCalldata]);
|
|
1458
1456
|
return this._submitUserOp(callData);
|
|
@@ -1573,6 +1571,11 @@ var init_X402Client = __esm({
|
|
|
1573
1571
|
},
|
|
1574
1572
|
async signTypedData(typedData) {
|
|
1575
1573
|
const sig = await inner.signTypedData(typedData);
|
|
1574
|
+
if (config.validatorModule) {
|
|
1575
|
+
const validatorHex = config.validatorModule.replace("0x", "").toLowerCase();
|
|
1576
|
+
const sigHex = sig.replace("0x", "");
|
|
1577
|
+
return `0x${validatorHex}${sigHex}`;
|
|
1578
|
+
}
|
|
1576
1579
|
return `${sig}00`;
|
|
1577
1580
|
}
|
|
1578
1581
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -646,6 +646,13 @@ interface X402BaseConfig {
|
|
|
646
646
|
* Helps avoid rounding issues. Default: '0.5'
|
|
647
647
|
*/
|
|
648
648
|
autoDrawBuffer?: string;
|
|
649
|
+
/**
|
|
650
|
+
* ERC-7579 validator module address (e.g. Agether8004ValidationModule).
|
|
651
|
+
* Required for Safe7579 smart wallets so that `isValidSignature` calls
|
|
652
|
+
* are routed through the correct validator. The signature is prefixed
|
|
653
|
+
* with this 20-byte address before being sent.
|
|
654
|
+
*/
|
|
655
|
+
validatorModule?: string;
|
|
649
656
|
}
|
|
650
657
|
/** Config with SDK-managed private key (existing behavior). */
|
|
651
658
|
interface X402PrivateKeyConfig extends X402BaseConfig {
|
package/dist/index.d.ts
CHANGED
|
@@ -646,6 +646,13 @@ interface X402BaseConfig {
|
|
|
646
646
|
* Helps avoid rounding issues. Default: '0.5'
|
|
647
647
|
*/
|
|
648
648
|
autoDrawBuffer?: string;
|
|
649
|
+
/**
|
|
650
|
+
* ERC-7579 validator module address (e.g. Agether8004ValidationModule).
|
|
651
|
+
* Required for Safe7579 smart wallets so that `isValidSignature` calls
|
|
652
|
+
* are routed through the correct validator. The signature is prefixed
|
|
653
|
+
* with this 20-byte address before being sent.
|
|
654
|
+
*/
|
|
655
|
+
validatorModule?: string;
|
|
649
656
|
}
|
|
650
657
|
/** Config with SDK-managed private key (existing behavior). */
|
|
651
658
|
interface X402PrivateKeyConfig extends X402BaseConfig {
|
package/dist/index.js
CHANGED
|
@@ -1698,10 +1698,8 @@ var MorphoClient = class {
|
|
|
1698
1698
|
* through an ERC-4337 UserOperation.
|
|
1699
1699
|
*/
|
|
1700
1700
|
async exec(target, data, value = 0n) {
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1703
|
-
[target, value, data]
|
|
1704
|
-
);
|
|
1701
|
+
const valueHex = import_ethers2.ethers.zeroPadValue(import_ethers2.ethers.toBeHex(value), 32);
|
|
1702
|
+
const executionCalldata = import_ethers2.ethers.concat([target, valueHex, data]);
|
|
1705
1703
|
const safe7579Iface = new import_ethers2.ethers.Interface(SAFE7579_ACCOUNT_ABI);
|
|
1706
1704
|
const callData = safe7579Iface.encodeFunctionData("execute", [MODE_SINGLE, executionCalldata]);
|
|
1707
1705
|
return this._submitUserOp(callData);
|
|
@@ -1815,6 +1813,11 @@ var X402Client = class {
|
|
|
1815
1813
|
},
|
|
1816
1814
|
async signTypedData(typedData) {
|
|
1817
1815
|
const sig = await inner.signTypedData(typedData);
|
|
1816
|
+
if (config.validatorModule) {
|
|
1817
|
+
const validatorHex = config.validatorModule.replace("0x", "").toLowerCase();
|
|
1818
|
+
const sigHex = sig.replace("0x", "");
|
|
1819
|
+
return `0x${validatorHex}${sigHex}`;
|
|
1820
|
+
}
|
|
1818
1821
|
return `${sig}00`;
|
|
1819
1822
|
}
|
|
1820
1823
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1626,10 +1626,8 @@ var MorphoClient = class {
|
|
|
1626
1626
|
* through an ERC-4337 UserOperation.
|
|
1627
1627
|
*/
|
|
1628
1628
|
async exec(target, data, value = 0n) {
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1631
|
-
[target, value, data]
|
|
1632
|
-
);
|
|
1629
|
+
const valueHex = ethers2.zeroPadValue(ethers2.toBeHex(value), 32);
|
|
1630
|
+
const executionCalldata = ethers2.concat([target, valueHex, data]);
|
|
1633
1631
|
const safe7579Iface = new ethers2.Interface(SAFE7579_ACCOUNT_ABI);
|
|
1634
1632
|
const callData = safe7579Iface.encodeFunctionData("execute", [MODE_SINGLE, executionCalldata]);
|
|
1635
1633
|
return this._submitUserOp(callData);
|
|
@@ -1743,6 +1741,11 @@ var X402Client = class {
|
|
|
1743
1741
|
},
|
|
1744
1742
|
async signTypedData(typedData) {
|
|
1745
1743
|
const sig = await inner.signTypedData(typedData);
|
|
1744
|
+
if (config.validatorModule) {
|
|
1745
|
+
const validatorHex = config.validatorModule.replace("0x", "").toLowerCase();
|
|
1746
|
+
const sigHex = sig.replace("0x", "");
|
|
1747
|
+
return `0x${validatorHex}${sigHex}`;
|
|
1748
|
+
}
|
|
1746
1749
|
return `${sig}00`;
|
|
1747
1750
|
}
|
|
1748
1751
|
});
|