@elizaos/plugin-wallet 2.0.0-beta.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/LICENSE +21 -0
- package/README.md +64 -0
- package/auto-enable.ts +76 -0
- package/dist/LpManagementService-BWrQ5-cO.mjs +353 -0
- package/dist/MockLpService-D_Apn4Fd.mjs +99 -0
- package/dist/aerodrome-CfnESC32.mjs +890 -0
- package/dist/chunk-hT5z_Zn9.mjs +35 -0
- package/dist/index.d.mts +34727 -0
- package/dist/index.mjs +21590 -0
- package/dist/lib/server-wallet-trade.d.mts +34 -0
- package/dist/lib/server-wallet-trade.mjs +306 -0
- package/dist/meteora-BPX39hZo.mjs +22640 -0
- package/dist/orca-Bybp1HXO.mjs +249 -0
- package/dist/pancakeswp-CkEXlXti.mjs +604 -0
- package/dist/plugin-ZO_MTyd0.mjs +529 -0
- package/dist/raydium-rfaM9yEf.mjs +539 -0
- package/dist/sdk/index.d.mts +32492 -0
- package/dist/sdk/index.mjs +6415 -0
- package/dist/types-D5252NZk.mjs +487 -0
- package/dist/uniswap-CReXgXVN.mjs +573 -0
- package/dist/wallet-action.d.mts +6 -0
- package/dist/wallet-action.mjs +820 -0
- package/package.json +152 -0
- package/src/actions/failure-codes.ts +79 -0
- package/src/actions/index.ts +1 -0
- package/src/analytics/birdeye/actions/wallet-search-address.ts +9 -0
- package/src/analytics/birdeye/birdeye-task.ts +175 -0
- package/src/analytics/birdeye/birdeye.ts +813 -0
- package/src/analytics/birdeye/constants.ts +74 -0
- package/src/analytics/birdeye/providers/agent-portfolio-provider.ts +18 -0
- package/src/analytics/birdeye/providers/market.ts +227 -0
- package/src/analytics/birdeye/providers/portfolio-factory.test.ts +138 -0
- package/src/analytics/birdeye/providers/portfolio-factory.ts +252 -0
- package/src/analytics/birdeye/providers/trending.ts +365 -0
- package/src/analytics/birdeye/providers/wallet.ts +14 -0
- package/src/analytics/birdeye/search-category.test.ts +207 -0
- package/src/analytics/birdeye/search-category.ts +506 -0
- package/src/analytics/birdeye/service.ts +992 -0
- package/src/analytics/birdeye/tasks/birdeye.ts +232 -0
- package/src/analytics/birdeye/types/api/common.ts +305 -0
- package/src/analytics/birdeye/types/api/defi.ts +220 -0
- package/src/analytics/birdeye/types/api/pair.ts +200 -0
- package/src/analytics/birdeye/types/api/search.ts +86 -0
- package/src/analytics/birdeye/types/api/token.ts +635 -0
- package/src/analytics/birdeye/types/api/trader.ts +76 -0
- package/src/analytics/birdeye/types/api/wallet.ts +181 -0
- package/src/analytics/birdeye/types/shared.ts +106 -0
- package/src/analytics/birdeye/utils.ts +700 -0
- package/src/analytics/dexscreener/errors.ts +28 -0
- package/src/analytics/dexscreener/index.ts +3 -0
- package/src/analytics/dexscreener/search-category.test.ts +49 -0
- package/src/analytics/dexscreener/search-category.ts +42 -0
- package/src/analytics/dexscreener/service.ts +595 -0
- package/src/analytics/dexscreener/types.ts +128 -0
- package/src/analytics/lpinfo/index.d.ts +7 -0
- package/src/analytics/lpinfo/index.ts +52 -0
- package/src/analytics/lpinfo/kamino/README.md +102 -0
- package/src/analytics/lpinfo/kamino/index.ts +24 -0
- package/src/analytics/lpinfo/kamino/providers/kaminoLiquidityProvider.ts +422 -0
- package/src/analytics/lpinfo/kamino/providers/kaminoPoolProvider.ts +365 -0
- package/src/analytics/lpinfo/kamino/providers/kaminoProvider.ts +496 -0
- package/src/analytics/lpinfo/kamino/services/kaminoLiquidityService.ts +1123 -0
- package/src/analytics/lpinfo/kamino/services/kaminoService.ts +758 -0
- package/src/analytics/lpinfo/steer/README.md +169 -0
- package/src/analytics/lpinfo/steer/index.ts +23 -0
- package/src/analytics/lpinfo/steer/providers/steerLiquidityProvider.ts +544 -0
- package/src/analytics/lpinfo/steer/services/steerLiquidityService.ts +1690 -0
- package/src/analytics/lpinfo/steer/steer-display-types.ts +99 -0
- package/src/analytics/news/index.ts +52 -0
- package/src/analytics/news/interfaces/types.ts +222 -0
- package/src/analytics/news/providers/defiNewsProvider.ts +734 -0
- package/src/analytics/news/services/newsDataService.ts +332 -0
- package/src/analytics/news/utils/formatters.ts +151 -0
- package/src/analytics/token-info/action.ts +240 -0
- package/src/analytics/token-info/index.ts +3 -0
- package/src/analytics/token-info/params.ts +215 -0
- package/src/analytics/token-info/providers.ts +681 -0
- package/src/analytics/token-info/service.ts +168 -0
- package/src/analytics/token-info/types.ts +74 -0
- package/src/audit/audit-log.ts +45 -0
- package/src/browser-shim/build-shim.ts +123 -0
- package/src/browser-shim/index.ts +5 -0
- package/src/browser-shim/shim.template.js +563 -0
- package/src/chains/evm/.github/workflows/npm-deploy.yml +112 -0
- package/src/chains/evm/LICENSE +21 -0
- package/src/chains/evm/README.md +106 -0
- package/src/chains/evm/actions/helpers.ts +147 -0
- package/src/chains/evm/actions/swap.ts +839 -0
- package/src/chains/evm/actions/transfer.ts +254 -0
- package/src/chains/evm/biome.json +61 -0
- package/src/chains/evm/bridge-router.ts +660 -0
- package/src/chains/evm/build.ts +89 -0
- package/src/chains/evm/chain-handler.ts +416 -0
- package/src/chains/evm/constants.ts +23 -0
- package/src/chains/evm/contracts/artifacts/OZGovernor.json +1707 -0
- package/src/chains/evm/contracts/artifacts/TimelockController.json +1007 -0
- package/src/chains/evm/contracts/artifacts/VoteToken.json +895 -0
- package/src/chains/evm/dex/aerodrome/index.ts +34 -0
- package/src/chains/evm/dex/aerodrome/services/AerodromeLpService.ts +558 -0
- package/src/chains/evm/dex/aerodrome/types.ts +318 -0
- package/src/chains/evm/dex/pancakeswp/index.ts +35 -0
- package/src/chains/evm/dex/pancakeswp/services/PancakeSwapV3LpService.ts +743 -0
- package/src/chains/evm/dex/pancakeswp/types.ts +65 -0
- package/src/chains/evm/dex/uniswap/index.ts +35 -0
- package/src/chains/evm/dex/uniswap/services/UniswapV3LpService.ts +759 -0
- package/src/chains/evm/dex/uniswap/types.ts +390 -0
- package/src/chains/evm/generated/specs/spec-helpers.ts +73 -0
- package/src/chains/evm/generated/specs/specs.ts +151 -0
- package/src/chains/evm/gov-router.ts +250 -0
- package/src/chains/evm/index.browser.ts +16 -0
- package/src/chains/evm/index.ts +31 -0
- package/src/chains/evm/prompts.ts +193 -0
- package/src/chains/evm/providers/get-balance.ts +123 -0
- package/src/chains/evm/providers/wallet.ts +715 -0
- package/src/chains/evm/routes/sign.ts +333 -0
- package/src/chains/evm/rpc-providers.ts +410 -0
- package/src/chains/evm/service.ts +140 -0
- package/src/chains/evm/templates/index.ts +10 -0
- package/src/chains/evm/types/index.ts +432 -0
- package/src/chains/evm/vitest.config.ts +18 -0
- package/src/chains/registry.ts +668 -0
- package/src/chains/solana/README.md +367 -0
- package/src/chains/wallet-action.ts +533 -0
- package/src/chains/wallet-router.test.ts +296 -0
- package/src/contracts.ts +65 -0
- package/src/core-augmentation.ts +10 -0
- package/src/index.ts +71 -0
- package/src/lib/server-wallet-trade.ts +192 -0
- package/src/lib/wallet-export-guard.ts +330 -0
- package/src/lp/actions/liquidity.ts +827 -0
- package/src/lp/e2e/real-token-tests.ts +428 -0
- package/src/lp/e2e/scenarios.ts +470 -0
- package/src/lp/e2e/test-utils.ts +145 -0
- package/src/lp/lp-manager-entry.ts +303 -0
- package/src/lp/services/ConcentratedLiquidityService.ts +120 -0
- package/src/lp/services/DexInteractionService.ts +226 -0
- package/src/lp/services/LpManagementService.test.ts +148 -0
- package/src/lp/services/LpManagementService.ts +632 -0
- package/src/lp/services/UserLpProfileService.ts +163 -0
- package/src/lp/services/VaultService.ts +153 -0
- package/src/lp/services/YieldOptimizationService.ts +344 -0
- package/src/lp/services/__tests__/MockLpService.ts +146 -0
- package/src/lp/tasks/LpAutoRebalanceTask.ts +117 -0
- package/src/lp/tasks/__tests__/LpAutoRebalanceTask.test.ts +370 -0
- package/src/lp/types.ts +582 -0
- package/src/lp/utils/solanaClient.ts +143 -0
- package/src/plugin.ts +125 -0
- package/src/policy/policy.ts +19 -0
- package/src/providers/canonical-provider.ts +27 -0
- package/src/providers/unified-wallet-provider.ts +79 -0
- package/src/register-routes.ts +11 -0
- package/src/routes/plugin.ts +47 -0
- package/src/routes/wallet-market-overview-route.ts +869 -0
- package/src/sdk/abi.ts +258 -0
- package/src/sdk/bridge/abis.ts +126 -0
- package/src/sdk/bridge/client.ts +518 -0
- package/src/sdk/bridge/index.ts +56 -0
- package/src/sdk/bridge/solana.ts +604 -0
- package/src/sdk/bridge/types.ts +202 -0
- package/src/sdk/convenience.ts +347 -0
- package/src/sdk/escrow/MutualStakeEscrow.ts +480 -0
- package/src/sdk/escrow/types.ts +64 -0
- package/src/sdk/escrow/verifiers.ts +73 -0
- package/src/sdk/identity/erc8004.ts +692 -0
- package/src/sdk/identity/reputation.ts +449 -0
- package/src/sdk/identity/uaid.ts +497 -0
- package/src/sdk/identity/validation.ts +372 -0
- package/src/sdk/index.ts +763 -0
- package/src/sdk/policy/SpendingPolicy.ts +260 -0
- package/src/sdk/policy/UptoBillingPolicy.ts +320 -0
- package/src/sdk/router/PaymentRouter.ts +215 -0
- package/src/sdk/router/index.ts +8 -0
- package/src/sdk/swap/SwapModule.ts +310 -0
- package/src/sdk/swap/abi.ts +117 -0
- package/src/sdk/swap/index.ts +34 -0
- package/src/sdk/swap/types.ts +135 -0
- package/src/sdk/tokens/decimals.ts +140 -0
- package/src/sdk/tokens/registry.ts +911 -0
- package/src/sdk/tokens/solana.ts +419 -0
- package/src/sdk/tokens/transfers.ts +327 -0
- package/src/sdk/types.ts +158 -0
- package/src/sdk/wallet-core.ts +115 -0
- package/src/sdk/x402/budget.ts +168 -0
- package/src/sdk/x402/chains/abstract/index.ts +280 -0
- package/src/sdk/x402/client.ts +320 -0
- package/src/sdk/x402/index.ts +46 -0
- package/src/sdk/x402/middleware.ts +92 -0
- package/src/sdk/x402/multi-asset.ts +144 -0
- package/src/sdk/x402/types.ts +156 -0
- package/src/services/wallet-backend-service.ts +328 -0
- package/src/types/wallet-router.ts +227 -0
- package/src/utils/intent-trajectory.ts +106 -0
- package/src/wallet/backend.ts +62 -0
- package/src/wallet/errors.ts +49 -0
- package/src/wallet/index.ts +27 -0
- package/src/wallet/local-eoa-backend.ts +201 -0
- package/src/wallet/pending.ts +60 -0
- package/src/wallet/select-backend.ts +47 -0
- package/src/wallet/steward-backend.ts +161 -0
- package/src/wallet-action.ts +1 -0
package/src/sdk/abi.ts
ADDED
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
export const AgentAccountV2Abi = [
|
|
2
|
+
// ─── Owner Functions ───
|
|
3
|
+
{
|
|
4
|
+
name: "setSpendPolicy",
|
|
5
|
+
type: "function",
|
|
6
|
+
stateMutability: "nonpayable",
|
|
7
|
+
inputs: [
|
|
8
|
+
{ name: "token", type: "address" },
|
|
9
|
+
{ name: "perTxLimit", type: "uint256" },
|
|
10
|
+
{ name: "periodLimit", type: "uint256" },
|
|
11
|
+
{ name: "periodLength", type: "uint256" },
|
|
12
|
+
],
|
|
13
|
+
outputs: [],
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "setOperator",
|
|
17
|
+
type: "function",
|
|
18
|
+
stateMutability: "nonpayable",
|
|
19
|
+
inputs: [
|
|
20
|
+
{ name: "operator", type: "address" },
|
|
21
|
+
{ name: "authorized", type: "bool" },
|
|
22
|
+
],
|
|
23
|
+
outputs: [],
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "execute",
|
|
27
|
+
type: "function",
|
|
28
|
+
stateMutability: "payable",
|
|
29
|
+
inputs: [
|
|
30
|
+
{ name: "to", type: "address" },
|
|
31
|
+
{ name: "value", type: "uint256" },
|
|
32
|
+
{ name: "data", type: "bytes" },
|
|
33
|
+
],
|
|
34
|
+
outputs: [{ name: "", type: "bytes" }],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "approvePending",
|
|
38
|
+
type: "function",
|
|
39
|
+
stateMutability: "nonpayable",
|
|
40
|
+
inputs: [{ name: "txId", type: "uint256" }],
|
|
41
|
+
outputs: [],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "cancelPending",
|
|
45
|
+
type: "function",
|
|
46
|
+
stateMutability: "nonpayable",
|
|
47
|
+
inputs: [{ name: "txId", type: "uint256" }],
|
|
48
|
+
outputs: [],
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// ─── Agent Functions ───
|
|
52
|
+
{
|
|
53
|
+
name: "agentExecute",
|
|
54
|
+
type: "function",
|
|
55
|
+
stateMutability: "payable",
|
|
56
|
+
inputs: [
|
|
57
|
+
{ name: "to", type: "address" },
|
|
58
|
+
{ name: "value", type: "uint256" },
|
|
59
|
+
{ name: "data", type: "bytes" },
|
|
60
|
+
],
|
|
61
|
+
outputs: [{ name: "", type: "bytes" }],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "agentTransferToken",
|
|
65
|
+
type: "function",
|
|
66
|
+
stateMutability: "nonpayable",
|
|
67
|
+
inputs: [
|
|
68
|
+
{ name: "token", type: "address" },
|
|
69
|
+
{ name: "to", type: "address" },
|
|
70
|
+
{ name: "amount", type: "uint256" },
|
|
71
|
+
],
|
|
72
|
+
outputs: [],
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
// ─── View Functions ───
|
|
76
|
+
{
|
|
77
|
+
name: "remainingBudget",
|
|
78
|
+
type: "function",
|
|
79
|
+
stateMutability: "view",
|
|
80
|
+
inputs: [{ name: "token", type: "address" }],
|
|
81
|
+
outputs: [
|
|
82
|
+
{ name: "perTx", type: "uint256" },
|
|
83
|
+
{ name: "inPeriod", type: "uint256" },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "getPending",
|
|
88
|
+
type: "function",
|
|
89
|
+
stateMutability: "view",
|
|
90
|
+
inputs: [{ name: "txId", type: "uint256" }],
|
|
91
|
+
outputs: [
|
|
92
|
+
{ name: "to", type: "address" },
|
|
93
|
+
{ name: "value", type: "uint256" },
|
|
94
|
+
{ name: "token", type: "address" },
|
|
95
|
+
{ name: "amount", type: "uint256" },
|
|
96
|
+
{ name: "createdAt", type: "uint256" },
|
|
97
|
+
{ name: "executed", type: "bool" },
|
|
98
|
+
{ name: "cancelled", type: "bool" },
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "spendPolicies",
|
|
103
|
+
type: "function",
|
|
104
|
+
stateMutability: "view",
|
|
105
|
+
inputs: [{ name: "token", type: "address" }],
|
|
106
|
+
outputs: [
|
|
107
|
+
{ name: "perTxLimit", type: "uint256" },
|
|
108
|
+
{ name: "periodLimit", type: "uint256" },
|
|
109
|
+
{ name: "periodLength", type: "uint256" },
|
|
110
|
+
{ name: "periodSpent", type: "uint256" },
|
|
111
|
+
{ name: "periodStart", type: "uint256" },
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "operators",
|
|
116
|
+
type: "function",
|
|
117
|
+
stateMutability: "view",
|
|
118
|
+
inputs: [{ name: "operator", type: "address" }],
|
|
119
|
+
outputs: [{ name: "", type: "bool" }],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: "pendingNonce",
|
|
123
|
+
type: "function",
|
|
124
|
+
stateMutability: "view",
|
|
125
|
+
inputs: [],
|
|
126
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "nonce",
|
|
130
|
+
type: "function",
|
|
131
|
+
stateMutability: "view",
|
|
132
|
+
inputs: [],
|
|
133
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
134
|
+
},
|
|
135
|
+
// [MAX-ADDED] ABI entries for wallet health check & activity history
|
|
136
|
+
{
|
|
137
|
+
name: "tokenContract",
|
|
138
|
+
type: "function",
|
|
139
|
+
stateMutability: "view",
|
|
140
|
+
inputs: [],
|
|
141
|
+
outputs: [{ name: "", type: "address" }],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "tokenId",
|
|
145
|
+
type: "function",
|
|
146
|
+
stateMutability: "view",
|
|
147
|
+
inputs: [],
|
|
148
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "operatorEpoch",
|
|
152
|
+
type: "function",
|
|
153
|
+
stateMutability: "view",
|
|
154
|
+
inputs: [],
|
|
155
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "isOperatorActive",
|
|
159
|
+
type: "function",
|
|
160
|
+
stateMutability: "view",
|
|
161
|
+
inputs: [{ name: "operator", type: "address" }],
|
|
162
|
+
outputs: [{ name: "", type: "bool" }],
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
// ─── Events ───
|
|
166
|
+
{
|
|
167
|
+
name: "TransactionExecuted",
|
|
168
|
+
type: "event",
|
|
169
|
+
inputs: [
|
|
170
|
+
{ name: "target", type: "address", indexed: true },
|
|
171
|
+
{ name: "value", type: "uint256", indexed: false },
|
|
172
|
+
{ name: "data", type: "bytes", indexed: false },
|
|
173
|
+
{ name: "executor", type: "address", indexed: true },
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "SpendPolicyUpdated",
|
|
178
|
+
type: "event",
|
|
179
|
+
inputs: [
|
|
180
|
+
{ name: "token", type: "address", indexed: true },
|
|
181
|
+
{ name: "perTxLimit", type: "uint256", indexed: false },
|
|
182
|
+
{ name: "periodLimit", type: "uint256", indexed: false },
|
|
183
|
+
{ name: "periodLength", type: "uint256", indexed: false },
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "OperatorUpdated",
|
|
188
|
+
type: "event",
|
|
189
|
+
inputs: [
|
|
190
|
+
{ name: "operator", type: "address", indexed: true },
|
|
191
|
+
{ name: "authorized", type: "bool", indexed: false },
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "TransactionQueued",
|
|
196
|
+
type: "event",
|
|
197
|
+
inputs: [
|
|
198
|
+
{ name: "txId", type: "uint256", indexed: true },
|
|
199
|
+
{ name: "to", type: "address", indexed: true },
|
|
200
|
+
{ name: "value", type: "uint256", indexed: false },
|
|
201
|
+
{ name: "token", type: "address", indexed: false },
|
|
202
|
+
{ name: "amount", type: "uint256", indexed: false },
|
|
203
|
+
],
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: "TransactionApproved",
|
|
207
|
+
type: "event",
|
|
208
|
+
inputs: [{ name: "txId", type: "uint256", indexed: true }],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "TransactionCancelled",
|
|
212
|
+
type: "event",
|
|
213
|
+
inputs: [{ name: "txId", type: "uint256", indexed: true }],
|
|
214
|
+
},
|
|
215
|
+
] as const;
|
|
216
|
+
|
|
217
|
+
export const AgentAccountFactoryV2Abi = [
|
|
218
|
+
{
|
|
219
|
+
name: "createAccount",
|
|
220
|
+
type: "function",
|
|
221
|
+
stateMutability: "nonpayable",
|
|
222
|
+
inputs: [
|
|
223
|
+
{ name: "tokenContract", type: "address" },
|
|
224
|
+
{ name: "tokenId", type: "uint256" },
|
|
225
|
+
],
|
|
226
|
+
outputs: [{ name: "wallet", type: "address" }],
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "getAddress",
|
|
230
|
+
type: "function",
|
|
231
|
+
stateMutability: "view",
|
|
232
|
+
inputs: [
|
|
233
|
+
{ name: "tokenContract", type: "address" },
|
|
234
|
+
{ name: "tokenId", type: "uint256" },
|
|
235
|
+
],
|
|
236
|
+
outputs: [{ name: "", type: "address" }],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "wallets",
|
|
240
|
+
type: "function",
|
|
241
|
+
stateMutability: "view",
|
|
242
|
+
inputs: [
|
|
243
|
+
{ name: "tokenContract", type: "address" },
|
|
244
|
+
{ name: "tokenId", type: "uint256" },
|
|
245
|
+
],
|
|
246
|
+
outputs: [{ name: "", type: "address" }],
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "WalletCreated",
|
|
250
|
+
type: "event",
|
|
251
|
+
inputs: [
|
|
252
|
+
{ name: "wallet", type: "address", indexed: true },
|
|
253
|
+
{ name: "tokenContract", type: "address", indexed: true },
|
|
254
|
+
{ name: "tokenId", type: "uint256", indexed: true },
|
|
255
|
+
{ name: "deployer", type: "address", indexed: false },
|
|
256
|
+
],
|
|
257
|
+
},
|
|
258
|
+
] as const;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// [MAX-ADDED] CCTP V2 Contract ABIs — Circle Cross-Chain Transfer Protocol V2
|
|
2
|
+
// Sources: https://developers.circle.com/stablecoins/cctp-protocol-contract
|
|
3
|
+
/**
|
|
4
|
+
* CCTP V2 TokenMessengerV2 ABI (source chain)
|
|
5
|
+
* Key function: depositForBurn — burns USDC and emits a MessageSent event
|
|
6
|
+
*/
|
|
7
|
+
export const TokenMessengerV2Abi = [
|
|
8
|
+
{
|
|
9
|
+
name: "depositForBurn",
|
|
10
|
+
type: "function",
|
|
11
|
+
stateMutability: "nonpayable",
|
|
12
|
+
inputs: [
|
|
13
|
+
{ name: "amount", type: "uint256" },
|
|
14
|
+
{ name: "destinationDomain", type: "uint32" },
|
|
15
|
+
{ name: "mintRecipient", type: "bytes32" },
|
|
16
|
+
{ name: "burnToken", type: "address" },
|
|
17
|
+
{ name: "destinationCaller", type: "bytes32" },
|
|
18
|
+
{ name: "maxFee", type: "uint256" },
|
|
19
|
+
{ name: "minFinalityThreshold", type: "uint32" },
|
|
20
|
+
],
|
|
21
|
+
outputs: [{ name: "nonce", type: "uint64" }],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "depositForBurnWithHook",
|
|
25
|
+
type: "function",
|
|
26
|
+
stateMutability: "nonpayable",
|
|
27
|
+
inputs: [
|
|
28
|
+
{ name: "amount", type: "uint256" },
|
|
29
|
+
{ name: "destinationDomain", type: "uint32" },
|
|
30
|
+
{ name: "mintRecipient", type: "bytes32" },
|
|
31
|
+
{ name: "burnToken", type: "address" },
|
|
32
|
+
{ name: "destinationCaller", type: "bytes32" },
|
|
33
|
+
{ name: "maxFee", type: "uint256" },
|
|
34
|
+
{ name: "minFinalityThreshold", type: "uint32" },
|
|
35
|
+
{ name: "hookData", type: "bytes" },
|
|
36
|
+
],
|
|
37
|
+
outputs: [{ name: "nonce", type: "uint64" }],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "localMessageTransmitter",
|
|
41
|
+
type: "function",
|
|
42
|
+
stateMutability: "view",
|
|
43
|
+
inputs: [],
|
|
44
|
+
outputs: [{ name: "", type: "address" }],
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "localDomain",
|
|
48
|
+
type: "function",
|
|
49
|
+
stateMutability: "view",
|
|
50
|
+
inputs: [],
|
|
51
|
+
outputs: [{ name: "", type: "uint32" }],
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* CCTP V2 MessageTransmitterV2 ABI (destination chain)
|
|
56
|
+
* Key function: receiveMessage — mints USDC using attested message
|
|
57
|
+
*/
|
|
58
|
+
export const MessageTransmitterV2Abi = [
|
|
59
|
+
{
|
|
60
|
+
name: "receiveMessage",
|
|
61
|
+
type: "function",
|
|
62
|
+
stateMutability: "nonpayable",
|
|
63
|
+
inputs: [
|
|
64
|
+
{ name: "message", type: "bytes" },
|
|
65
|
+
{ name: "attestation", type: "bytes" },
|
|
66
|
+
],
|
|
67
|
+
outputs: [{ name: "success", type: "bool" }],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "usedNonces",
|
|
71
|
+
type: "function",
|
|
72
|
+
stateMutability: "view",
|
|
73
|
+
inputs: [{ name: "", type: "bytes32" }],
|
|
74
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "localDomain",
|
|
78
|
+
type: "function",
|
|
79
|
+
stateMutability: "view",
|
|
80
|
+
inputs: [],
|
|
81
|
+
outputs: [{ name: "", type: "uint32" }],
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
/**
|
|
85
|
+
* Minimal ERC20 ABI — approve + allowance + balanceOf
|
|
86
|
+
*/
|
|
87
|
+
export const ERC20BridgeAbi = [
|
|
88
|
+
{
|
|
89
|
+
name: "approve",
|
|
90
|
+
type: "function",
|
|
91
|
+
stateMutability: "nonpayable",
|
|
92
|
+
inputs: [
|
|
93
|
+
{ name: "spender", type: "address" },
|
|
94
|
+
{ name: "amount", type: "uint256" },
|
|
95
|
+
],
|
|
96
|
+
outputs: [{ name: "", type: "bool" }],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "allowance",
|
|
100
|
+
type: "function",
|
|
101
|
+
stateMutability: "view",
|
|
102
|
+
inputs: [
|
|
103
|
+
{ name: "owner", type: "address" },
|
|
104
|
+
{ name: "spender", type: "address" },
|
|
105
|
+
],
|
|
106
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "balanceOf",
|
|
110
|
+
type: "function",
|
|
111
|
+
stateMutability: "view",
|
|
112
|
+
inputs: [{ name: "account", type: "address" }],
|
|
113
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
114
|
+
},
|
|
115
|
+
];
|
|
116
|
+
/**
|
|
117
|
+
* MessageTransmitter MessageSent event ABI — emitted during depositForBurn
|
|
118
|
+
* Used to extract the CCTP message bytes and hash for attestation polling.
|
|
119
|
+
*/
|
|
120
|
+
export const MessageSentEventAbi = [
|
|
121
|
+
{
|
|
122
|
+
name: "MessageSent",
|
|
123
|
+
type: "event",
|
|
124
|
+
inputs: [{ name: "message", type: "bytes", indexed: false }],
|
|
125
|
+
},
|
|
126
|
+
];
|