@epoch-protocol/epoch-commons-sdk 0.1.4 → 0.1.6
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/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/path.d.ts +10 -0
- package/dist/utils/path.js +32 -0
- package/package.json +1 -1
- package/dist/utils/web3.d.ts +0 -9
- package/dist/utils/web3.js +0 -115
- package/dist/web3/abis/epochModuleAbi.d.ts +0 -2
- package/dist/web3/abis/epochModuleAbi.js +0 -233
- package/dist/web3/abis/erc20Abi.d.ts +0 -2
- package/dist/web3/abis/erc20Abi.js +0 -224
- package/dist/web3/abis/intentRegistryAbi.d.ts +0 -2
- package/dist/web3/abis/intentRegistryAbi.js +0 -925
- package/dist/web3/abis/safe7702ProxyFactoryAbi.d.ts +0 -2
- package/dist/web3/abis/safe7702ProxyFactoryAbi.js +0 -107
- package/dist/web3/abis/safeProxyFactoryAbi.d.ts +0 -2
- package/dist/web3/abis/safeProxyFactoryAbi.js +0 -3
- package/dist/web3/abis/solverRegistryAbi.d.ts +0 -2
- package/dist/web3/abis/solverRegistryAbi.js +0 -236
- package/dist/web3/registry.d.ts +0 -5
- package/dist/web3/registry.js +0 -29
- package/dist/web3/wallet.d.ts +0 -26
- package/dist/web3/wallet.js +0 -390
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Path } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts tokenIn (first token amount) and tokenOut (last token amount) from a path.
|
|
4
|
+
* Path structure: path[chainPathIndex][entityRow][item].
|
|
5
|
+
* Rows per chain: chain, protocol, tokens, calldata.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseQuoteFromPath(path: Path): {
|
|
8
|
+
tokenIn: string;
|
|
9
|
+
tokenOut: string;
|
|
10
|
+
} | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseQuoteFromPath = parseQuoteFromPath;
|
|
4
|
+
/**
|
|
5
|
+
* Extracts tokenIn (first token amount) and tokenOut (last token amount) from a path.
|
|
6
|
+
* Path structure: path[chainPathIndex][entityRow][item].
|
|
7
|
+
* Rows per chain: chain, protocol, tokens, calldata.
|
|
8
|
+
*/
|
|
9
|
+
function parseQuoteFromPath(path) {
|
|
10
|
+
if (!path || path.length === 0)
|
|
11
|
+
return null;
|
|
12
|
+
let tokenIn;
|
|
13
|
+
for (const chainPath of path) {
|
|
14
|
+
for (const entityRow of chainPath) {
|
|
15
|
+
for (const item of entityRow) {
|
|
16
|
+
if (item.token?.amount) {
|
|
17
|
+
tokenIn = item.token.amount;
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
if (tokenIn)
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
if (tokenIn)
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
// Last chain path, row before calldata (at(-2)), last item's token.amount
|
|
28
|
+
const tokenOut = path.at(-1)?.at(-2)?.at(-1)?.token?.amount;
|
|
29
|
+
if (tokenIn && tokenOut)
|
|
30
|
+
return { tokenIn, tokenOut };
|
|
31
|
+
return null;
|
|
32
|
+
}
|
package/package.json
CHANGED
package/dist/utils/web3.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ethers } from "ethers";
|
|
2
|
-
import { SignAuthorizationReturnType } from "viem/_types/accounts/utils/signAuthorization";
|
|
3
|
-
import { AuthorizationListEntryAny } from "../types";
|
|
4
|
-
export declare const encodeRLPAuthorizationEntryUnsigned: (chainId: number, address: any, nonce: bigint) => string;
|
|
5
|
-
export declare const getAuthorizationList: (chainId: number, nonce: bigint, authorizer: string, signer: ethers.Wallet | ethers.VoidSigner) => Promise<AuthorizationListEntryAny[]>;
|
|
6
|
-
export declare const getSignedTransaction: (provider: ethers.Provider, relayer: ethers.SigningKey, authorizationList: SignAuthorizationReturnType | AuthorizationListEntryAny[], to?: string, value?: bigint | number, data?: string, nonce?: number) => Promise<string>;
|
|
7
|
-
export declare const serializeEip7702: (tx: any, _sig: null | ethers.Signature) => string;
|
|
8
|
-
export declare const ACCOUNT_CODE_PREFIX = "0xef0100";
|
|
9
|
-
export declare const isAccountDelegatedToAddress: (provider: ethers.Provider, account: string, authority: string) => Promise<boolean>;
|
package/dist/utils/web3.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isAccountDelegatedToAddress = exports.ACCOUNT_CODE_PREFIX = exports.serializeEip7702 = exports.getSignedTransaction = exports.getAuthorizationList = exports.encodeRLPAuthorizationEntryUnsigned = void 0;
|
|
4
|
-
const ethers_1 = require("ethers");
|
|
5
|
-
const formatNumber = (_value) => {
|
|
6
|
-
const value = typeof _value === "bigint" ? _value : BigInt(_value);
|
|
7
|
-
// Convert bigint to hex string, then to bytes for RLP encoding
|
|
8
|
-
const hexValue = ethers_1.ethers.toBeHex(value);
|
|
9
|
-
return ethers_1.ethers.getBytes(hexValue);
|
|
10
|
-
};
|
|
11
|
-
const encodeRLPAuthorizationEntryUnsigned = (chainId, address, nonce) => {
|
|
12
|
-
// MAGIC = "0x05" defined in ERC-7702
|
|
13
|
-
return ethers_1.ethers.concat([
|
|
14
|
-
"0x05",
|
|
15
|
-
ethers_1.ethers.encodeRlp([formatNumber(chainId), address, formatNumber(nonce)]),
|
|
16
|
-
]);
|
|
17
|
-
};
|
|
18
|
-
exports.encodeRLPAuthorizationEntryUnsigned = encodeRLPAuthorizationEntryUnsigned;
|
|
19
|
-
const getAuthorizationList = async (chainId, nonce, authorizer, signer) => {
|
|
20
|
-
const dataToSign = (0, exports.encodeRLPAuthorizationEntryUnsigned)(chainId, authorizer, nonce);
|
|
21
|
-
const authHash = ethers_1.ethers.keccak256(dataToSign);
|
|
22
|
-
// TODO: should be signDigest
|
|
23
|
-
const sig = await signer.signMessage(authHash);
|
|
24
|
-
// In ethers v6, splitSignature is removed, we need to parse manually
|
|
25
|
-
const sigBytes = ethers_1.ethers.getBytes(sig);
|
|
26
|
-
const r = ethers_1.ethers.hexlify(sigBytes.slice(0, 32));
|
|
27
|
-
const s = ethers_1.ethers.hexlify(sigBytes.slice(32, 64));
|
|
28
|
-
const v = sigBytes[64];
|
|
29
|
-
const yParity = v - 27;
|
|
30
|
-
return [
|
|
31
|
-
{
|
|
32
|
-
chainId: chainId,
|
|
33
|
-
address: authorizer,
|
|
34
|
-
nonce: nonce,
|
|
35
|
-
yParity: yParity,
|
|
36
|
-
r: r,
|
|
37
|
-
s: s,
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
};
|
|
41
|
-
exports.getAuthorizationList = getAuthorizationList;
|
|
42
|
-
const getSignedTransaction = async (provider, relayer, authorizationList, to = ethers_1.ethers.ZeroAddress, value = 0, data = "0x", nonce) => {
|
|
43
|
-
const relayerAddress = ethers_1.ethers.computeAddress(relayer.publicKey);
|
|
44
|
-
const relayerNonce = nonce || (await provider.getTransactionCount(relayerAddress));
|
|
45
|
-
const valueBigInt = typeof value === "bigint" ? value : BigInt(value);
|
|
46
|
-
const tx = {
|
|
47
|
-
from: relayerAddress,
|
|
48
|
-
nonce: relayerNonce,
|
|
49
|
-
gasLimit: 21000000,
|
|
50
|
-
gasPrice: 3100,
|
|
51
|
-
data: data,
|
|
52
|
-
to: to,
|
|
53
|
-
value: valueBigInt,
|
|
54
|
-
chainId: (await provider.getNetwork()).chainId,
|
|
55
|
-
type: 4,
|
|
56
|
-
maxFeePerGas: 30000,
|
|
57
|
-
maxPriorityFeePerGas: 30000,
|
|
58
|
-
accessList: [],
|
|
59
|
-
authorizationList: authorizationList,
|
|
60
|
-
};
|
|
61
|
-
const encodedTx = (0, exports.serializeEip7702)(tx, null);
|
|
62
|
-
const txHashToSign = ethers_1.ethers.keccak256(encodedTx);
|
|
63
|
-
const signature = relayer.sign(txHashToSign);
|
|
64
|
-
return (0, exports.serializeEip7702)(tx, signature);
|
|
65
|
-
};
|
|
66
|
-
exports.getSignedTransaction = getSignedTransaction;
|
|
67
|
-
const serializeEip7702 = (tx, _sig) => {
|
|
68
|
-
const fields = [
|
|
69
|
-
formatNumber(tx.chainId),
|
|
70
|
-
formatNumber(tx.nonce),
|
|
71
|
-
formatNumber(tx.maxPriorityFeePerGas || 0),
|
|
72
|
-
formatNumber(tx.maxFeePerGas || 0),
|
|
73
|
-
formatNumber(tx.gasLimit),
|
|
74
|
-
tx.to,
|
|
75
|
-
formatNumber(tx.value),
|
|
76
|
-
tx.data,
|
|
77
|
-
formatAccessList(tx.accessList || []),
|
|
78
|
-
formatAuthorizationList(tx.authorizationList || []),
|
|
79
|
-
];
|
|
80
|
-
if (_sig) {
|
|
81
|
-
// In ethers v6, Signature object has r, s, v properties
|
|
82
|
-
const yParity = _sig.v - 27;
|
|
83
|
-
fields.push(formatNumber(yParity));
|
|
84
|
-
fields.push(ethers_1.ethers.getBytes(_sig.r));
|
|
85
|
-
fields.push(ethers_1.ethers.getBytes(_sig.s));
|
|
86
|
-
}
|
|
87
|
-
return ethers_1.ethers.concat(["0x04", ethers_1.ethers.encodeRlp(fields)]);
|
|
88
|
-
};
|
|
89
|
-
exports.serializeEip7702 = serializeEip7702;
|
|
90
|
-
const formatAccessList = (value) => {
|
|
91
|
-
return ethers_1.ethers
|
|
92
|
-
.accessListify(value)
|
|
93
|
-
.map((set) => [set.address, set.storageKeys]);
|
|
94
|
-
};
|
|
95
|
-
const formatAuthorizationList = (value) => {
|
|
96
|
-
return value.map((set) => formatAuthorizationEntry(set));
|
|
97
|
-
};
|
|
98
|
-
const formatAuthorizationEntry = (set) => {
|
|
99
|
-
return [
|
|
100
|
-
formatNumber(set.chainId),
|
|
101
|
-
set.address,
|
|
102
|
-
formatNumber(set.nonce),
|
|
103
|
-
formatNumber(set.yParity),
|
|
104
|
-
ethers_1.ethers.getBytes(set.r),
|
|
105
|
-
ethers_1.ethers.getBytes(set.s),
|
|
106
|
-
];
|
|
107
|
-
};
|
|
108
|
-
exports.ACCOUNT_CODE_PREFIX = "0xef0100";
|
|
109
|
-
const isAccountDelegatedToAddress = async (provider, account, authority) => {
|
|
110
|
-
const codeAtEOA = await provider.getCode(account);
|
|
111
|
-
return (codeAtEOA.length === 48 &&
|
|
112
|
-
codeAtEOA.startsWith(exports.ACCOUNT_CODE_PREFIX) &&
|
|
113
|
-
ethers_1.ethers.getAddress("0x" + codeAtEOA.slice(8)) === authority);
|
|
114
|
-
};
|
|
115
|
-
exports.isAccountDelegatedToAddress = isAccountDelegatedToAddress;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: "[\n {\n \"type\": \"function\",\n \"name\": \"addIntentWithSignatureAndExecute\",\n \"inputs\": [\n { \"name\": \"user\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"dispatcher\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"params\", \"type\": \"bytes\", \"internalType\": \"bytes\" },\n { \"name\": \"signature\", \"type\": \"bytes\", \"internalType\": \"bytes\" },\n {\n \"name\": \"executions\",\n \"type\": \"tuple[]\",\n \"internalType\": \"struct Execution[]\",\n \"components\": [\n { \"name\": \"target\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"value\", \"type\": \"uint256\", \"internalType\": \"uint256\" },\n { \"name\": \"callData\", \"type\": \"bytes\", \"internalType\": \"bytes\" }\n ]\n },\n {\n \"name\": \"callType\",\n \"type\": \"uint8\",\n \"internalType\": \"enum Enum.Operation\"\n },\n {\n \"name\": \"intermediaryApprovals\",\n \"type\": \"tuple[]\",\n \"internalType\": \"struct IntentRegistry.Approval[]\",\n \"components\": [\n {\n \"name\": \"tokenAddress\",\n \"type\": \"address\",\n \"internalType\": \"address\"\n },\n {\n \"name\": \"spenderAddress\",\n \"type\": \"address\",\n \"internalType\": \"address\"\n },\n { \"name\": \"amount\", \"type\": \"uint256\", \"internalType\": \"uint256\" },\n { \"name\": \"chainId\", \"type\": \"uint256\", \"internalType\": \"uint256\" }\n ]\n }\n ],\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\"\n },\n {\n \"type\": \"function\",\n \"name\": \"approvalsMapping\",\n \"inputs\": [\n { \"name\": \"\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"\", \"type\": \"uint256\", \"internalType\": \"uint256\" },\n { \"name\": \"\", \"type\": \"address\", \"internalType\": \"address\" }\n ],\n \"outputs\": [{ \"name\": \"\", \"type\": \"bool\", \"internalType\": \"bool\" }],\n \"stateMutability\": \"view\"\n },\n {\n \"type\": \"function\",\n \"name\": \"executeEscrowTransfer\",\n \"inputs\": [\n { \"name\": \"user\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"intentIndex\", \"type\": \"uint256\", \"internalType\": \"uint256\" }\n ],\n \"outputs\": [{ \"name\": \"success\", \"type\": \"bool\", \"internalType\": \"bool\" }],\n \"stateMutability\": \"nonpayable\"\n },\n {\n \"type\": \"function\",\n \"name\": \"executeIntent\",\n \"inputs\": [\n { \"name\": \"user\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"_nonce\", \"type\": \"uint256\", \"internalType\": \"uint256\" },\n { \"name\": \"dispatcher\", \"type\": \"address\", \"internalType\": \"address\" },\n {\n \"name\": \"executions\",\n \"type\": \"tuple[]\",\n \"internalType\": \"struct Execution[]\",\n \"components\": [\n { \"name\": \"target\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"value\", \"type\": \"uint256\", \"internalType\": \"uint256\" },\n { \"name\": \"callData\", \"type\": \"bytes\", \"internalType\": \"bytes\" }\n ]\n },\n {\n \"name\": \"callType\",\n \"type\": \"uint8\",\n \"internalType\": \"enum Enum.Operation\"\n },\n {\n \"name\": \"intermediaryApprovals\",\n \"type\": \"tuple[]\",\n \"internalType\": \"struct IntentRegistry.Approval[]\",\n \"components\": [\n {\n \"name\": \"tokenAddress\",\n \"type\": \"address\",\n \"internalType\": \"address\"\n },\n {\n \"name\": \"spenderAddress\",\n \"type\": \"address\",\n \"internalType\": \"address\"\n },\n { \"name\": \"amount\", \"type\": \"uint256\", \"internalType\": \"uint256\" },\n { \"name\": \"chainId\", \"type\": \"uint256\", \"internalType\": \"uint256\" }\n ]\n }\n ],\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\"\n },\n {\n \"type\": \"function\",\n \"name\": \"intentRegistry\",\n \"inputs\": [],\n \"outputs\": [{ \"name\": \"\", \"type\": \"address\", \"internalType\": \"address\" }],\n \"stateMutability\": \"view\"\n },\n {\n \"type\": \"function\",\n \"name\": \"isInitialized\",\n \"inputs\": [{ \"name\": \"\", \"type\": \"address\", \"internalType\": \"address\" }],\n \"outputs\": [{ \"name\": \"\", \"type\": \"bool\", \"internalType\": \"bool\" }],\n \"stateMutability\": \"view\"\n },\n {\n \"type\": \"function\",\n \"name\": \"isModuleType\",\n \"inputs\": [\n { \"name\": \"typeID\", \"type\": \"uint256\", \"internalType\": \"uint256\" }\n ],\n \"outputs\": [{ \"name\": \"\", \"type\": \"bool\", \"internalType\": \"bool\" }],\n \"stateMutability\": \"pure\"\n },\n {\n \"type\": \"function\",\n \"name\": \"onInstall\",\n \"inputs\": [{ \"name\": \"data\", \"type\": \"bytes\", \"internalType\": \"bytes\" }],\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\"\n },\n {\n \"type\": \"function\",\n \"name\": \"onUninstall\",\n \"inputs\": [{ \"name\": \"data\", \"type\": \"bytes\", \"internalType\": \"bytes\" }],\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\"\n },\n {\n \"type\": \"function\",\n \"name\": \"setIntentRegistry\",\n \"inputs\": [\n {\n \"name\": \"_intentRegistry\",\n \"type\": \"address\",\n \"internalType\": \"address\"\n }\n ],\n \"outputs\": [],\n \"stateMutability\": \"nonpayable\"\n },\n {\n \"type\": \"function\",\n \"name\": \"userApprovalsMapping\",\n \"inputs\": [\n { \"name\": \"\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"\", \"type\": \"uint256\", \"internalType\": \"uint256\" },\n { \"name\": \"\", \"type\": \"address\", \"internalType\": \"address\" }\n ],\n \"outputs\": [{ \"name\": \"\", \"type\": \"bool\", \"internalType\": \"bool\" }],\n \"stateMutability\": \"view\"\n },\n {\n \"type\": \"function\",\n \"name\": \"verifySignature\",\n \"inputs\": [\n { \"name\": \"sender\", \"type\": \"address\", \"internalType\": \"address\" },\n { \"name\": \"data\", \"type\": \"bytes\", \"internalType\": \"bytes\" },\n { \"name\": \"signature\", \"type\": \"bytes\", \"internalType\": \"bytes\" }\n ],\n \"outputs\": [],\n \"stateMutability\": \"view\"\n },\n {\n \"type\": \"event\",\n \"name\": \"TaskCompleted\",\n \"inputs\": [\n {\n \"name\": \"user\",\n \"type\": \"address\",\n \"indexed\": true,\n \"internalType\": \"address\"\n },\n {\n \"name\": \"intentIndex\",\n \"type\": \"uint256\",\n \"indexed\": false,\n \"internalType\": \"uint256\"\n },\n {\n \"name\": \"solver\",\n \"type\": \"address\",\n \"indexed\": false,\n \"internalType\": \"address\"\n }\n ],\n \"anonymous\": false\n },\n {\n \"type\": \"error\",\n \"name\": \"AlreadyInitialized\",\n \"inputs\": [\n { \"name\": \"smartAccount\", \"type\": \"address\", \"internalType\": \"address\" }\n ]\n },\n { \"type\": \"error\", \"name\": \"BalanceDecreasedAfterExecution\", \"inputs\": [] },\n { \"type\": \"error\", \"name\": \"DeadlinePassed\", \"inputs\": [] },\n { \"type\": \"error\", \"name\": \"NotAllowedToExecuteIntent\", \"inputs\": [] },\n { \"type\": \"error\", \"name\": \"NotAllowedToUseToken\", \"inputs\": [] },\n {\n \"type\": \"error\",\n \"name\": \"NotInitialized\",\n \"inputs\": [\n { \"name\": \"smartAccount\", \"type\": \"address\", \"internalType\": \"address\" }\n ]\n },\n { \"type\": \"error\", \"name\": \"TaskCompleted\", \"inputs\": [] }\n]\n";
|
|
2
|
-
export default _default;
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = `[
|
|
4
|
-
{
|
|
5
|
-
"type": "function",
|
|
6
|
-
"name": "addIntentWithSignatureAndExecute",
|
|
7
|
-
"inputs": [
|
|
8
|
-
{ "name": "user", "type": "address", "internalType": "address" },
|
|
9
|
-
{ "name": "dispatcher", "type": "address", "internalType": "address" },
|
|
10
|
-
{ "name": "params", "type": "bytes", "internalType": "bytes" },
|
|
11
|
-
{ "name": "signature", "type": "bytes", "internalType": "bytes" },
|
|
12
|
-
{
|
|
13
|
-
"name": "executions",
|
|
14
|
-
"type": "tuple[]",
|
|
15
|
-
"internalType": "struct Execution[]",
|
|
16
|
-
"components": [
|
|
17
|
-
{ "name": "target", "type": "address", "internalType": "address" },
|
|
18
|
-
{ "name": "value", "type": "uint256", "internalType": "uint256" },
|
|
19
|
-
{ "name": "callData", "type": "bytes", "internalType": "bytes" }
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"name": "callType",
|
|
24
|
-
"type": "uint8",
|
|
25
|
-
"internalType": "enum Enum.Operation"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"name": "intermediaryApprovals",
|
|
29
|
-
"type": "tuple[]",
|
|
30
|
-
"internalType": "struct IntentRegistry.Approval[]",
|
|
31
|
-
"components": [
|
|
32
|
-
{
|
|
33
|
-
"name": "tokenAddress",
|
|
34
|
-
"type": "address",
|
|
35
|
-
"internalType": "address"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"name": "spenderAddress",
|
|
39
|
-
"type": "address",
|
|
40
|
-
"internalType": "address"
|
|
41
|
-
},
|
|
42
|
-
{ "name": "amount", "type": "uint256", "internalType": "uint256" },
|
|
43
|
-
{ "name": "chainId", "type": "uint256", "internalType": "uint256" }
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"outputs": [],
|
|
48
|
-
"stateMutability": "nonpayable"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "function",
|
|
52
|
-
"name": "approvalsMapping",
|
|
53
|
-
"inputs": [
|
|
54
|
-
{ "name": "", "type": "address", "internalType": "address" },
|
|
55
|
-
{ "name": "", "type": "uint256", "internalType": "uint256" },
|
|
56
|
-
{ "name": "", "type": "address", "internalType": "address" }
|
|
57
|
-
],
|
|
58
|
-
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
|
|
59
|
-
"stateMutability": "view"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"type": "function",
|
|
63
|
-
"name": "executeEscrowTransfer",
|
|
64
|
-
"inputs": [
|
|
65
|
-
{ "name": "user", "type": "address", "internalType": "address" },
|
|
66
|
-
{ "name": "intentIndex", "type": "uint256", "internalType": "uint256" }
|
|
67
|
-
],
|
|
68
|
-
"outputs": [{ "name": "success", "type": "bool", "internalType": "bool" }],
|
|
69
|
-
"stateMutability": "nonpayable"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"type": "function",
|
|
73
|
-
"name": "executeIntent",
|
|
74
|
-
"inputs": [
|
|
75
|
-
{ "name": "user", "type": "address", "internalType": "address" },
|
|
76
|
-
{ "name": "_nonce", "type": "uint256", "internalType": "uint256" },
|
|
77
|
-
{ "name": "dispatcher", "type": "address", "internalType": "address" },
|
|
78
|
-
{
|
|
79
|
-
"name": "executions",
|
|
80
|
-
"type": "tuple[]",
|
|
81
|
-
"internalType": "struct Execution[]",
|
|
82
|
-
"components": [
|
|
83
|
-
{ "name": "target", "type": "address", "internalType": "address" },
|
|
84
|
-
{ "name": "value", "type": "uint256", "internalType": "uint256" },
|
|
85
|
-
{ "name": "callData", "type": "bytes", "internalType": "bytes" }
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"name": "callType",
|
|
90
|
-
"type": "uint8",
|
|
91
|
-
"internalType": "enum Enum.Operation"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"name": "intermediaryApprovals",
|
|
95
|
-
"type": "tuple[]",
|
|
96
|
-
"internalType": "struct IntentRegistry.Approval[]",
|
|
97
|
-
"components": [
|
|
98
|
-
{
|
|
99
|
-
"name": "tokenAddress",
|
|
100
|
-
"type": "address",
|
|
101
|
-
"internalType": "address"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"name": "spenderAddress",
|
|
105
|
-
"type": "address",
|
|
106
|
-
"internalType": "address"
|
|
107
|
-
},
|
|
108
|
-
{ "name": "amount", "type": "uint256", "internalType": "uint256" },
|
|
109
|
-
{ "name": "chainId", "type": "uint256", "internalType": "uint256" }
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
"outputs": [],
|
|
114
|
-
"stateMutability": "nonpayable"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
"type": "function",
|
|
118
|
-
"name": "intentRegistry",
|
|
119
|
-
"inputs": [],
|
|
120
|
-
"outputs": [{ "name": "", "type": "address", "internalType": "address" }],
|
|
121
|
-
"stateMutability": "view"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"type": "function",
|
|
125
|
-
"name": "isInitialized",
|
|
126
|
-
"inputs": [{ "name": "", "type": "address", "internalType": "address" }],
|
|
127
|
-
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
|
|
128
|
-
"stateMutability": "view"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"type": "function",
|
|
132
|
-
"name": "isModuleType",
|
|
133
|
-
"inputs": [
|
|
134
|
-
{ "name": "typeID", "type": "uint256", "internalType": "uint256" }
|
|
135
|
-
],
|
|
136
|
-
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
|
|
137
|
-
"stateMutability": "pure"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
"type": "function",
|
|
141
|
-
"name": "onInstall",
|
|
142
|
-
"inputs": [{ "name": "data", "type": "bytes", "internalType": "bytes" }],
|
|
143
|
-
"outputs": [],
|
|
144
|
-
"stateMutability": "nonpayable"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"type": "function",
|
|
148
|
-
"name": "onUninstall",
|
|
149
|
-
"inputs": [{ "name": "data", "type": "bytes", "internalType": "bytes" }],
|
|
150
|
-
"outputs": [],
|
|
151
|
-
"stateMutability": "nonpayable"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"type": "function",
|
|
155
|
-
"name": "setIntentRegistry",
|
|
156
|
-
"inputs": [
|
|
157
|
-
{
|
|
158
|
-
"name": "_intentRegistry",
|
|
159
|
-
"type": "address",
|
|
160
|
-
"internalType": "address"
|
|
161
|
-
}
|
|
162
|
-
],
|
|
163
|
-
"outputs": [],
|
|
164
|
-
"stateMutability": "nonpayable"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"type": "function",
|
|
168
|
-
"name": "userApprovalsMapping",
|
|
169
|
-
"inputs": [
|
|
170
|
-
{ "name": "", "type": "address", "internalType": "address" },
|
|
171
|
-
{ "name": "", "type": "uint256", "internalType": "uint256" },
|
|
172
|
-
{ "name": "", "type": "address", "internalType": "address" }
|
|
173
|
-
],
|
|
174
|
-
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
|
|
175
|
-
"stateMutability": "view"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"type": "function",
|
|
179
|
-
"name": "verifySignature",
|
|
180
|
-
"inputs": [
|
|
181
|
-
{ "name": "sender", "type": "address", "internalType": "address" },
|
|
182
|
-
{ "name": "data", "type": "bytes", "internalType": "bytes" },
|
|
183
|
-
{ "name": "signature", "type": "bytes", "internalType": "bytes" }
|
|
184
|
-
],
|
|
185
|
-
"outputs": [],
|
|
186
|
-
"stateMutability": "view"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"type": "event",
|
|
190
|
-
"name": "TaskCompleted",
|
|
191
|
-
"inputs": [
|
|
192
|
-
{
|
|
193
|
-
"name": "user",
|
|
194
|
-
"type": "address",
|
|
195
|
-
"indexed": true,
|
|
196
|
-
"internalType": "address"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
"name": "intentIndex",
|
|
200
|
-
"type": "uint256",
|
|
201
|
-
"indexed": false,
|
|
202
|
-
"internalType": "uint256"
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
"name": "solver",
|
|
206
|
-
"type": "address",
|
|
207
|
-
"indexed": false,
|
|
208
|
-
"internalType": "address"
|
|
209
|
-
}
|
|
210
|
-
],
|
|
211
|
-
"anonymous": false
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
"type": "error",
|
|
215
|
-
"name": "AlreadyInitialized",
|
|
216
|
-
"inputs": [
|
|
217
|
-
{ "name": "smartAccount", "type": "address", "internalType": "address" }
|
|
218
|
-
]
|
|
219
|
-
},
|
|
220
|
-
{ "type": "error", "name": "BalanceDecreasedAfterExecution", "inputs": [] },
|
|
221
|
-
{ "type": "error", "name": "DeadlinePassed", "inputs": [] },
|
|
222
|
-
{ "type": "error", "name": "NotAllowedToExecuteIntent", "inputs": [] },
|
|
223
|
-
{ "type": "error", "name": "NotAllowedToUseToken", "inputs": [] },
|
|
224
|
-
{
|
|
225
|
-
"type": "error",
|
|
226
|
-
"name": "NotInitialized",
|
|
227
|
-
"inputs": [
|
|
228
|
-
{ "name": "smartAccount", "type": "address", "internalType": "address" }
|
|
229
|
-
]
|
|
230
|
-
},
|
|
231
|
-
{ "type": "error", "name": "TaskCompleted", "inputs": [] }
|
|
232
|
-
]
|
|
233
|
-
`;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: "[\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"name\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"string\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_spender\",\n \"type\": \"address\"\n },\n {\n \"name\": \"_value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"approve\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"totalSupply\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_from\",\n \"type\": \"address\"\n },\n {\n \"name\": \"_to\",\n \"type\": \"address\"\n },\n {\n \"name\": \"_value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"transferFrom\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"decimals\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint8\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"balanceOf\",\n \"outputs\": [\n {\n \"name\": \"balance\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"symbol\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"string\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_to\",\n \"type\": \"address\"\n },\n {\n \"name\": \"_value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"transfer\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_owner\",\n \"type\": \"address\"\n },\n {\n \"name\": \"_spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"allowance\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"payable\": true,\n \"stateMutability\": \"payable\",\n \"type\": \"fallback\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": true,\n \"name\": \"spender\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Approval\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"from\",\n \"type\": \"address\"\n },\n {\n \"indexed\": true,\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Transfer\",\n \"type\": \"event\"\n }\n]";
|
|
2
|
-
export default _default;
|