@fileverse/api 0.0.20 → 0.0.21
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/index.js.map +1 -1
- package/dist/cloudflare.js +40 -57
- package/dist/cloudflare.js.map +1 -1
- package/dist/commands/index.js +1 -6
- package/dist/commands/index.js.map +1 -1
- package/dist/index.js +22 -45
- package/dist/index.js.map +1 -1
- package/dist/worker.js +21 -39
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/public/llm.txt +478 -204
package/dist/worker.js
CHANGED
|
@@ -1672,29 +1672,19 @@ var init_pimlico_utils = __esm({
|
|
|
1672
1672
|
version: "0.7"
|
|
1673
1673
|
}
|
|
1674
1674
|
});
|
|
1675
|
-
signerToSmartAccount = async (signer) => {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
version: "0.7"
|
|
1685
|
-
},
|
|
1686
|
-
version: "1.4.1"
|
|
1687
|
-
});
|
|
1688
|
-
console.log("[pimlico] safe smart account created");
|
|
1689
|
-
return account;
|
|
1690
|
-
};
|
|
1675
|
+
signerToSmartAccount = async (signer) => await toSafeSmartAccount({
|
|
1676
|
+
client: getPublicClient(),
|
|
1677
|
+
owners: [signer],
|
|
1678
|
+
entryPoint: {
|
|
1679
|
+
address: entryPoint07Address,
|
|
1680
|
+
version: "0.7"
|
|
1681
|
+
},
|
|
1682
|
+
version: "1.4.1"
|
|
1683
|
+
});
|
|
1691
1684
|
getSmartAccountClient = async (signer, authToken, portalAddress) => {
|
|
1692
|
-
console.log("[pimlico] signerToSmartAccount start");
|
|
1693
1685
|
const smartAccount = await signerToSmartAccount(signer);
|
|
1694
|
-
console.log("[pimlico] creating pimlico client");
|
|
1695
1686
|
const pimlicoClient = getPimlicoClient(authToken, portalAddress, smartAccount.address);
|
|
1696
|
-
|
|
1697
|
-
const result = createSmartAccountClient({
|
|
1687
|
+
return createSmartAccountClient({
|
|
1698
1688
|
account: smartAccount,
|
|
1699
1689
|
chain: CHAIN,
|
|
1700
1690
|
paymaster: pimlicoClient,
|
|
@@ -1712,8 +1702,6 @@ var init_pimlico_utils = __esm({
|
|
|
1712
1702
|
estimateFeesPerGas: async () => (await pimlicoClient.getUserOperationGasPrice()).fast
|
|
1713
1703
|
}
|
|
1714
1704
|
});
|
|
1715
|
-
console.log("[pimlico] smart account client created");
|
|
1716
|
-
return result;
|
|
1717
1705
|
};
|
|
1718
1706
|
getNonce = () => hexToBigInt(
|
|
1719
1707
|
toHex(toBytes(generatePrivateKey()).slice(0, 24), {
|
|
@@ -1749,17 +1737,13 @@ var init_smart_agent = __esm({
|
|
|
1749
1737
|
MAX_CALL_GAS_LIMIT = 5e5;
|
|
1750
1738
|
authOptions = { namespace: "proxy", segment: "ACCESS", scheme: "pimlico" };
|
|
1751
1739
|
async initializeAgentClient(keyMaterial) {
|
|
1752
|
-
console.log("[agent] creating account from key");
|
|
1753
1740
|
const agentAccount = privateKeyToAccount(toHex2(keyMaterial));
|
|
1754
|
-
console.log("[agent] getting auth token");
|
|
1755
1741
|
const authToken = await this.authTokenProvider.getAuthToken(STATIC_CONFIG.PROXY_SERVER_DID, this.authOptions);
|
|
1756
|
-
console.log("[agent] getting smart account client");
|
|
1757
1742
|
const smartAccountClient = await getSmartAccountClient(
|
|
1758
1743
|
agentAccount,
|
|
1759
1744
|
authToken,
|
|
1760
1745
|
this.authTokenProvider.portalAddress
|
|
1761
1746
|
);
|
|
1762
|
-
console.log("[agent] smart account client ready");
|
|
1763
1747
|
this.smartAccountAgent = smartAccountClient;
|
|
1764
1748
|
}
|
|
1765
1749
|
getSmartAccountAgent() {
|
|
@@ -1799,19 +1783,17 @@ var init_smart_agent = __esm({
|
|
|
1799
1783
|
]);
|
|
1800
1784
|
}
|
|
1801
1785
|
async sendUserOperation(request, customGasLimit) {
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
}
|
|
1813
|
-
console.log("[agent] user operation sent");
|
|
1814
|
-
return hash;
|
|
1786
|
+
try {
|
|
1787
|
+
const smartAccountAgent = this.getSmartAccountAgent();
|
|
1788
|
+
const callData = await this.getCallData(request);
|
|
1789
|
+
return await smartAccountAgent.sendUserOperation({
|
|
1790
|
+
callData,
|
|
1791
|
+
callGasLimit: BigInt(customGasLimit || this.MAX_CALL_GAS_LIMIT),
|
|
1792
|
+
nonce: getNonce()
|
|
1793
|
+
});
|
|
1794
|
+
} catch (error) {
|
|
1795
|
+
throw error;
|
|
1796
|
+
}
|
|
1815
1797
|
}
|
|
1816
1798
|
async executeUserOperationRequest(request, timeout, customGasLimit) {
|
|
1817
1799
|
const userOpHash = await this.sendUserOperation(request, customGasLimit);
|