@tapforce/pod-bridge-sdk 2.1.1 → 2.2.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/README.md +19 -19
- package/dist/clients/action/pod-to-source-chain-client.d.ts +24 -18
- package/dist/clients/action/pod-to-source-chain-client.js +22 -20
- package/dist/clients/tracker/pod-tracker.service.d.ts +5 -10
- package/dist/clients/tracker/pod-tracker.service.js +13 -24
- package/dist/libs/abi/bridge.abi.d.ts +3 -3
- package/dist/libs/abi/bridge.abi.js +6 -6
- package/dist/libs/types/pod-bridge.types.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ TypeScript SDK for bridging tokens between POD and EVM chains (e.g., ETH Mainnet
|
|
|
6
6
|
|
|
7
7
|
```
|
|
8
8
|
ETH -> Pod: Deposit on ETH, AUTO-CLAIM on Pod (no claim TX needed)
|
|
9
|
-
Pod -> ETH:
|
|
9
|
+
Pod -> ETH: Withdraw on Pod, claim on ETH with proof from pod_getBridgeClaimProof RPC
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
**Key points:**
|
|
@@ -120,7 +120,7 @@ const receipt = await tx.wait();
|
|
|
120
120
|
|
|
121
121
|
### Pod -> ETH (Claim with proof)
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
Withdrawals on Pod require claiming on ETH with a proof from `pod_getBridgeClaimProof`.
|
|
124
124
|
|
|
125
125
|
```typescript
|
|
126
126
|
import {
|
|
@@ -131,17 +131,18 @@ import {
|
|
|
131
131
|
|
|
132
132
|
const client = new PodToSourceChainActionClient(actionConfig);
|
|
133
133
|
|
|
134
|
-
// Step 1:
|
|
135
|
-
const
|
|
134
|
+
// Step 1: Withdraw on Pod (specify target chain ID)
|
|
135
|
+
const withdrawTx = client.withdraw({
|
|
136
136
|
token: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', // Native token on Pod
|
|
137
|
-
amount: ethers.parseUnits('1', 6), //
|
|
137
|
+
amount: ethers.parseUnits('1', 6), // Target chain units (1 USDC = 1e6)
|
|
138
138
|
destinationWalletAddress: '0x...',
|
|
139
|
+
chainId: 1, // Target chain ID (e.g. 1 for ETH mainnet)
|
|
139
140
|
from: '0x...',
|
|
140
141
|
});
|
|
141
142
|
|
|
142
143
|
// Pod requires EIP-1559 gas params (all zeros for free transactions)
|
|
143
144
|
const tx = await podSigner.sendTransaction({
|
|
144
|
-
...
|
|
145
|
+
...withdrawTx,
|
|
145
146
|
maxFeePerGas: 0n,
|
|
146
147
|
maxPriorityFeePerGas: 0n,
|
|
147
148
|
gasLimit: 0n,
|
|
@@ -153,7 +154,7 @@ const { proof, auxTxSuffix } = await getBridgeClaimProof(podProvider, tx.hash);
|
|
|
153
154
|
// Step 3: Claim on ETH
|
|
154
155
|
const claimData: ClaimProofData = {
|
|
155
156
|
ethTokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC on ETH
|
|
156
|
-
amount: ethers.parseUnits('1', 6), // Must match
|
|
157
|
+
amount: ethers.parseUnits('1', 6), // Must match withdrawn amount
|
|
157
158
|
to: '0x...',
|
|
158
159
|
proof,
|
|
159
160
|
auxTxSuffix,
|
|
@@ -211,17 +212,15 @@ deposit(args: {
|
|
|
211
212
|
|
|
212
213
|
### PodToSourceChainActionClient
|
|
213
214
|
|
|
214
|
-
For Pod -> ETH
|
|
215
|
+
For Pod -> ETH withdrawals and claims.
|
|
215
216
|
|
|
216
217
|
```typescript
|
|
217
|
-
//
|
|
218
|
-
|
|
218
|
+
// Withdraw tokens on Pod
|
|
219
|
+
withdraw(args: {
|
|
219
220
|
token: string; // Use 0xEeee...EEeE for native token
|
|
220
|
-
amount: string | bigint; //
|
|
221
|
+
amount: string | bigint; // Target chain units (e.g. 1e6 for USDC)
|
|
221
222
|
destinationWalletAddress: string;
|
|
222
|
-
|
|
223
|
-
reserveBalance?: string | bigint; // Amount to reserve when using callContract (default: 0)
|
|
224
|
-
permit?: string; // Optional permit bytes (default: '0x')
|
|
223
|
+
chainId: number | bigint; // Target chain ID for claiming
|
|
225
224
|
from?: string;
|
|
226
225
|
}): UnsignedTransaction
|
|
227
226
|
|
|
@@ -282,8 +281,9 @@ interface BridgeRequest {
|
|
|
282
281
|
destination: string;
|
|
283
282
|
token: string;
|
|
284
283
|
amount: string;
|
|
285
|
-
callContract?: string; // Contract called after deposit (address(0) for simple bridge)
|
|
286
|
-
reserveBalance?: string; // Amount reserved when using callContract ('0' for simple bridge)
|
|
284
|
+
callContract?: string; // Contract called after deposit (address(0) for simple bridge) — ETH only
|
|
285
|
+
reserveBalance?: string; // Amount reserved when using callContract ('0' for simple bridge) — ETH only
|
|
286
|
+
targetChainId?: number; // Target chain ID for claiming (Pod→ETH direction)
|
|
287
287
|
chainId: number;
|
|
288
288
|
blockNumber: number;
|
|
289
289
|
timestamp: number; // Unix timestamp (seconds)
|
|
@@ -305,7 +305,7 @@ interface BridgeRequest {
|
|
|
305
305
|
|
|
306
306
|
## Events
|
|
307
307
|
|
|
308
|
-
The bridge contracts emit different events per chain
|
|
308
|
+
The bridge contracts emit different events per chain:
|
|
309
309
|
|
|
310
310
|
```solidity
|
|
311
311
|
// ETH (Source Chain)
|
|
@@ -313,7 +313,7 @@ event Deposit(uint256 indexed id, address indexed from, address indexed to, addr
|
|
|
313
313
|
event Claim(bytes32 indexed txHash, address token, address mirrorToken, uint256 amount, address indexed to);
|
|
314
314
|
|
|
315
315
|
// Pod
|
|
316
|
-
event
|
|
316
|
+
event Withdraw(bytes32 indexed id, address indexed from, address indexed to, address token, uint256 amount, uint256 chainId);
|
|
317
317
|
```
|
|
318
318
|
|
|
319
319
|
## ABIs
|
|
@@ -321,7 +321,7 @@ event Deposit(bytes32 indexed id, address indexed from, address indexed to, addr
|
|
|
321
321
|
The SDK exports separate ABIs for each chain:
|
|
322
322
|
|
|
323
323
|
- `SOURCE_CHAIN_BRIDGE_ABI` - ETH bridge (6-param deposit with callContract/reserveBalance/permit, claim with proof)
|
|
324
|
-
- `POD_BRIDGE_ABI` - Pod bridge (
|
|
324
|
+
- `POD_BRIDGE_ABI` - Pod bridge (withdraw with chainId, Withdraw events with bytes32 id)
|
|
325
325
|
- `BRIDGE_ABI` - Alias for `SOURCE_CHAIN_BRIDGE_ABI`
|
|
326
326
|
|
|
327
327
|
## Pod-specific Notes
|
|
@@ -2,13 +2,13 @@ import { UnsignedTransaction, ClaimProofData, PodBridgeActionsClientConfig } fro
|
|
|
2
2
|
/**
|
|
3
3
|
* PodToSourceChainActionClient - Handles Pod -> ETH bridging
|
|
4
4
|
*
|
|
5
|
-
* - User
|
|
6
|
-
* - Call pod_getBridgeClaimProof(
|
|
5
|
+
* - User withdraws tokens on Pod (specifying target chainId)
|
|
6
|
+
* - Call pod_getBridgeClaimProof(withdrawTxHash) to get proof
|
|
7
7
|
* - User claims on ETH with proof + auxTxSuffix
|
|
8
8
|
*
|
|
9
9
|
* Important notes:
|
|
10
|
-
* - Token addresses on Pod and ETH are different (
|
|
11
|
-
* -
|
|
10
|
+
* - Token addresses on Pod and ETH are different (withdraw AAAA on Pod, claim BBBB on ETH)
|
|
11
|
+
* - Amount is in target chain units (e.g. parseUnits('1', 6) for USDC with 6 decimals)
|
|
12
12
|
* - Pod system contract handles balance internally - do NOT set tx value
|
|
13
13
|
*/
|
|
14
14
|
export declare class PodToSourceChainActionClient {
|
|
@@ -17,32 +17,38 @@ export declare class PodToSourceChainActionClient {
|
|
|
17
17
|
private readonly sourceChainIface;
|
|
18
18
|
constructor(config: PodBridgeActionsClientConfig);
|
|
19
19
|
/**
|
|
20
|
-
* Create unsigned transaction for
|
|
20
|
+
* Create unsigned transaction for withdrawing tokens from Pod to ETH
|
|
21
21
|
*
|
|
22
|
-
* After
|
|
23
|
-
* - Call pod_getBridgeClaimProof(
|
|
22
|
+
* After withdraw:
|
|
23
|
+
* - Call pod_getBridgeClaimProof(withdrawTxHash) on Pod RPC
|
|
24
24
|
* - Call claim() on ETH with the proof
|
|
25
25
|
*
|
|
26
26
|
* Note: Pod system contract handles balance deduction internally.
|
|
27
|
-
* Do NOT set transaction value - even for native token (0xEeee...EEeE)
|
|
28
|
-
*
|
|
27
|
+
* Do NOT set transaction value - even for native token (0xEeee...EEeE) withdrawals.
|
|
28
|
+
* Amount is in target chain units (e.g. 1e6 for 1 USDC with 6 decimals).
|
|
29
29
|
*
|
|
30
|
-
* @param args.token Token address on Pod to
|
|
31
|
-
* @param args.amount Amount to
|
|
30
|
+
* @param args.token Token address on Pod to withdraw (use 0xEeee...EEeE for native)
|
|
31
|
+
* @param args.amount Amount to withdraw (in target chain decimals)
|
|
32
32
|
* @param args.destinationWalletAddress Recipient address on ETH
|
|
33
|
-
* @param args.
|
|
34
|
-
* @param args.reserveBalance Optional: amount to keep as reserve when using callContract (default: 0)
|
|
35
|
-
* @param args.permit Optional permit bytes (default '0x')
|
|
33
|
+
* @param args.chainId Target chain ID where the claim will happen
|
|
36
34
|
* @param args.from Optional sender address
|
|
37
|
-
* @returns Unsigned transaction template with encoded
|
|
35
|
+
* @returns Unsigned transaction template with encoded withdraw call
|
|
36
|
+
*/
|
|
37
|
+
withdraw(args: {
|
|
38
|
+
token: string;
|
|
39
|
+
amount: string | bigint;
|
|
40
|
+
destinationWalletAddress: string;
|
|
41
|
+
chainId: number | bigint;
|
|
42
|
+
from?: string;
|
|
43
|
+
}): UnsignedTransaction;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use withdraw() instead. deposit() on Pod has been renamed to withdraw().
|
|
38
46
|
*/
|
|
39
47
|
deposit(args: {
|
|
40
48
|
token: string;
|
|
41
49
|
amount: string | bigint;
|
|
42
50
|
destinationWalletAddress: string;
|
|
43
|
-
|
|
44
|
-
reserveBalance?: string | bigint;
|
|
45
|
-
permit?: string;
|
|
51
|
+
chainId: number | bigint;
|
|
46
52
|
from?: string;
|
|
47
53
|
}): UnsignedTransaction;
|
|
48
54
|
/**
|
|
@@ -6,13 +6,13 @@ const bridge_abi_1 = require("../../libs/abi/bridge.abi");
|
|
|
6
6
|
/**
|
|
7
7
|
* PodToSourceChainActionClient - Handles Pod -> ETH bridging
|
|
8
8
|
*
|
|
9
|
-
* - User
|
|
10
|
-
* - Call pod_getBridgeClaimProof(
|
|
9
|
+
* - User withdraws tokens on Pod (specifying target chainId)
|
|
10
|
+
* - Call pod_getBridgeClaimProof(withdrawTxHash) to get proof
|
|
11
11
|
* - User claims on ETH with proof + auxTxSuffix
|
|
12
12
|
*
|
|
13
13
|
* Important notes:
|
|
14
|
-
* - Token addresses on Pod and ETH are different (
|
|
15
|
-
* -
|
|
14
|
+
* - Token addresses on Pod and ETH are different (withdraw AAAA on Pod, claim BBBB on ETH)
|
|
15
|
+
* - Amount is in target chain units (e.g. parseUnits('1', 6) for USDC with 6 decimals)
|
|
16
16
|
* - Pod system contract handles balance internally - do NOT set tx value
|
|
17
17
|
*/
|
|
18
18
|
class PodToSourceChainActionClient {
|
|
@@ -22,33 +22,29 @@ class PodToSourceChainActionClient {
|
|
|
22
22
|
this.sourceChainIface = new ethers_1.Interface(bridge_abi_1.SOURCE_CHAIN_BRIDGE_ABI);
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* Create unsigned transaction for
|
|
25
|
+
* Create unsigned transaction for withdrawing tokens from Pod to ETH
|
|
26
26
|
*
|
|
27
|
-
* After
|
|
28
|
-
* - Call pod_getBridgeClaimProof(
|
|
27
|
+
* After withdraw:
|
|
28
|
+
* - Call pod_getBridgeClaimProof(withdrawTxHash) on Pod RPC
|
|
29
29
|
* - Call claim() on ETH with the proof
|
|
30
30
|
*
|
|
31
31
|
* Note: Pod system contract handles balance deduction internally.
|
|
32
|
-
* Do NOT set transaction value - even for native token (0xEeee...EEeE)
|
|
33
|
-
*
|
|
32
|
+
* Do NOT set transaction value - even for native token (0xEeee...EEeE) withdrawals.
|
|
33
|
+
* Amount is in target chain units (e.g. 1e6 for 1 USDC with 6 decimals).
|
|
34
34
|
*
|
|
35
|
-
* @param args.token Token address on Pod to
|
|
36
|
-
* @param args.amount Amount to
|
|
35
|
+
* @param args.token Token address on Pod to withdraw (use 0xEeee...EEeE for native)
|
|
36
|
+
* @param args.amount Amount to withdraw (in target chain decimals)
|
|
37
37
|
* @param args.destinationWalletAddress Recipient address on ETH
|
|
38
|
-
* @param args.
|
|
39
|
-
* @param args.reserveBalance Optional: amount to keep as reserve when using callContract (default: 0)
|
|
40
|
-
* @param args.permit Optional permit bytes (default '0x')
|
|
38
|
+
* @param args.chainId Target chain ID where the claim will happen
|
|
41
39
|
* @param args.from Optional sender address
|
|
42
|
-
* @returns Unsigned transaction template with encoded
|
|
40
|
+
* @returns Unsigned transaction template with encoded withdraw call
|
|
43
41
|
*/
|
|
44
|
-
|
|
45
|
-
const data = this.podIface.encodeFunctionData('
|
|
42
|
+
withdraw(args) {
|
|
43
|
+
const data = this.podIface.encodeFunctionData('withdraw', [
|
|
46
44
|
args.token,
|
|
47
45
|
args.amount,
|
|
48
46
|
args.destinationWalletAddress,
|
|
49
|
-
args.
|
|
50
|
-
args.reserveBalance ?? 0,
|
|
51
|
-
args.permit ?? '0x',
|
|
47
|
+
args.chainId,
|
|
52
48
|
]);
|
|
53
49
|
return {
|
|
54
50
|
to: this.config.pod.contractAddress,
|
|
@@ -57,6 +53,12 @@ class PodToSourceChainActionClient {
|
|
|
57
53
|
from: args?.from
|
|
58
54
|
};
|
|
59
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use withdraw() instead. deposit() on Pod has been renamed to withdraw().
|
|
58
|
+
*/
|
|
59
|
+
deposit(args) {
|
|
60
|
+
return this.withdraw(args);
|
|
61
|
+
}
|
|
60
62
|
/**
|
|
61
63
|
* Create unsigned transaction for claiming tokens on ETH (source chain)
|
|
62
64
|
*
|
|
@@ -3,7 +3,7 @@ import { BridgeRequest, PodBridgeChainConfig } from '../../libs/types/pod-bridge
|
|
|
3
3
|
* PodTrackerService - Handles tracking on the POD Chain
|
|
4
4
|
*
|
|
5
5
|
* Responsibilities:
|
|
6
|
-
* - Fetch
|
|
6
|
+
* - Fetch withdrawals made on POD (Pod -> ETH direction)
|
|
7
7
|
*
|
|
8
8
|
* Note: POD returns logs with blockNumber: null which ethers.js can't parse.
|
|
9
9
|
* We use raw eth_getLogs RPC calls and parse logs manually.
|
|
@@ -12,26 +12,21 @@ export declare class PodTrackerService {
|
|
|
12
12
|
private readonly config;
|
|
13
13
|
private readonly provider;
|
|
14
14
|
private readonly iface;
|
|
15
|
-
/** Interface with uint256 id variant — Pod system contract may emit either bytes32 or uint256 id */
|
|
16
|
-
private readonly ifaceUint256Id;
|
|
17
15
|
private chainId;
|
|
18
16
|
constructor(config: PodBridgeChainConfig);
|
|
19
17
|
private initChainId;
|
|
20
18
|
ensureChainId(): Promise<void>;
|
|
21
19
|
/**
|
|
22
|
-
* Get
|
|
20
|
+
* Get withdrawals sent by an address on POD
|
|
23
21
|
*/
|
|
24
22
|
getDepositsSentBy(address: string): Promise<BridgeRequest[]>;
|
|
25
23
|
/**
|
|
26
|
-
* Get
|
|
24
|
+
* Get withdrawals received by an address on POD
|
|
27
25
|
*/
|
|
28
26
|
getDepositsReceivedBy(address: string): Promise<BridgeRequest[]>;
|
|
29
27
|
/**
|
|
30
|
-
* Fetch
|
|
28
|
+
* Fetch withdrawals from POD using raw eth_getLogs RPC.
|
|
31
29
|
* Pod returns logs with blockNumber: null, so we can't use ethers queryFilter.
|
|
32
|
-
*
|
|
33
|
-
* Queries both bytes32 and uint256 id event topics since Pod system contract
|
|
34
|
-
* may emit either variant.
|
|
35
30
|
*/
|
|
36
|
-
private
|
|
31
|
+
private getWithdrawals;
|
|
37
32
|
}
|
|
@@ -8,7 +8,7 @@ const bridge_abi_1 = require("../../libs/abi/bridge.abi");
|
|
|
8
8
|
* PodTrackerService - Handles tracking on the POD Chain
|
|
9
9
|
*
|
|
10
10
|
* Responsibilities:
|
|
11
|
-
* - Fetch
|
|
11
|
+
* - Fetch withdrawals made on POD (Pod -> ETH direction)
|
|
12
12
|
*
|
|
13
13
|
* Note: POD returns logs with blockNumber: null which ethers.js can't parse.
|
|
14
14
|
* We use raw eth_getLogs RPC calls and parse logs manually.
|
|
@@ -19,7 +19,6 @@ class PodTrackerService {
|
|
|
19
19
|
this.chainId = null;
|
|
20
20
|
this.provider = config.provider;
|
|
21
21
|
this.iface = new ethers_1.Interface(bridge_abi_1.POD_BRIDGE_ABI);
|
|
22
|
-
this.ifaceUint256Id = new ethers_1.Interface(bridge_abi_1.SOURCE_CHAIN_BRIDGE_ABI);
|
|
23
22
|
this.initChainId();
|
|
24
23
|
}
|
|
25
24
|
async initChainId() {
|
|
@@ -37,36 +36,30 @@ class PodTrackerService {
|
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
40
|
-
* Get
|
|
39
|
+
* Get withdrawals sent by an address on POD
|
|
41
40
|
*/
|
|
42
41
|
async getDepositsSentBy(address) {
|
|
43
|
-
// Filter by 'from' (second indexed param):
|
|
42
|
+
// Filter by 'from' (second indexed param): Withdraw(id, from, to, token, amount, chainId)
|
|
44
43
|
const fromTopic = ethers_1.ethers.zeroPadValue(address, 32);
|
|
45
|
-
return this.
|
|
44
|
+
return this.getWithdrawals([null, fromTopic, null]);
|
|
46
45
|
}
|
|
47
46
|
/**
|
|
48
|
-
* Get
|
|
47
|
+
* Get withdrawals received by an address on POD
|
|
49
48
|
*/
|
|
50
49
|
async getDepositsReceivedBy(address) {
|
|
51
|
-
// Filter by 'to' (third indexed param):
|
|
50
|
+
// Filter by 'to' (third indexed param): Withdraw(id, from, to, token, amount, chainId)
|
|
52
51
|
const toTopic = ethers_1.ethers.zeroPadValue(address, 32);
|
|
53
|
-
return this.
|
|
52
|
+
return this.getWithdrawals([null, null, toTopic]);
|
|
54
53
|
}
|
|
55
54
|
/**
|
|
56
|
-
* Fetch
|
|
55
|
+
* Fetch withdrawals from POD using raw eth_getLogs RPC.
|
|
57
56
|
* Pod returns logs with blockNumber: null, so we can't use ethers queryFilter.
|
|
58
|
-
*
|
|
59
|
-
* Queries both bytes32 and uint256 id event topics since Pod system contract
|
|
60
|
-
* may emit either variant.
|
|
61
57
|
*/
|
|
62
|
-
async
|
|
58
|
+
async getWithdrawals(topicFilters) {
|
|
63
59
|
const deposits = [];
|
|
64
|
-
|
|
65
|
-
const bytes32IdTopic = this.iface.getEvent('Deposit').topicHash;
|
|
66
|
-
const uint256IdTopic = this.ifaceUint256Id.getEvent('Deposit').topicHash;
|
|
67
|
-
// Use array in first topic position for OR matching (standard EVM eth_getLogs)
|
|
60
|
+
const withdrawTopic = this.iface.getEvent('Withdraw').topicHash;
|
|
68
61
|
const topics = [
|
|
69
|
-
|
|
62
|
+
withdrawTopic,
|
|
70
63
|
...topicFilters,
|
|
71
64
|
];
|
|
72
65
|
// Use raw RPC to avoid ethers.js blockNumber validation
|
|
@@ -84,10 +77,7 @@ class PodTrackerService {
|
|
|
84
77
|
for (let i = 0; i < rawLogs.length; i++) {
|
|
85
78
|
const log = rawLogs[i];
|
|
86
79
|
const receipt = receipts[i];
|
|
87
|
-
|
|
88
|
-
const isUint256Id = log.topics[0] === uint256IdTopic;
|
|
89
|
-
const parseIface = isUint256Id ? this.ifaceUint256Id : this.iface;
|
|
90
|
-
const parsed = parseIface.parseLog({
|
|
80
|
+
const parsed = this.iface.parseLog({
|
|
91
81
|
topics: log.topics,
|
|
92
82
|
data: log.data
|
|
93
83
|
});
|
|
@@ -103,8 +93,7 @@ class PodTrackerService {
|
|
|
103
93
|
destination: parsed.args.to,
|
|
104
94
|
token: parsed.args.token,
|
|
105
95
|
amount: parsed.args.amount.toString(),
|
|
106
|
-
|
|
107
|
-
reserveBalance: parsed.args.reserveBalance.toString(),
|
|
96
|
+
targetChainId: Number(parsed.args.chainId),
|
|
108
97
|
chainId: this.chainId,
|
|
109
98
|
blockNumber: timestamp,
|
|
110
99
|
timestamp,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ABI for Bridge contract on Source Chain (ETH/Mainnet)
|
|
3
3
|
*
|
|
4
4
|
* ETH -> Pod: deposit on ETH (6-param with callContract, reserveBalance, permit), auto-claim on Pod
|
|
5
|
-
* Pod -> ETH:
|
|
5
|
+
* Pod -> ETH: withdraw on Pod, claim on ETH with proof from pod_getBridgeClaimProof RPC
|
|
6
6
|
*
|
|
7
7
|
* New deposit params (callContract, reserveBalance) enable depositing to CLOB orderbook in one TX.
|
|
8
8
|
* For simple bridge deposits: callContract=address(0), reserveBalance=0.
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
export declare const SOURCE_CHAIN_BRIDGE_ABI: string[];
|
|
11
11
|
/**
|
|
12
12
|
* ABI for Bridge system contract on Pod chain.
|
|
13
|
-
* Pod uses bytes32 indexed id in
|
|
14
|
-
*
|
|
13
|
+
* Pod uses bytes32 indexed id in Withdraw events.
|
|
14
|
+
* withdraw(token, amount, to, chainId) — chainId is the target chain for claiming.
|
|
15
15
|
*/
|
|
16
16
|
export declare const POD_BRIDGE_ABI: string[];
|
|
17
17
|
export declare const BRIDGE_ABI: string[];
|
|
@@ -5,7 +5,7 @@ exports.BRIDGE_ABI = exports.POD_BRIDGE_ABI = exports.SOURCE_CHAIN_BRIDGE_ABI =
|
|
|
5
5
|
* ABI for Bridge contract on Source Chain (ETH/Mainnet)
|
|
6
6
|
*
|
|
7
7
|
* ETH -> Pod: deposit on ETH (6-param with callContract, reserveBalance, permit), auto-claim on Pod
|
|
8
|
-
* Pod -> ETH:
|
|
8
|
+
* Pod -> ETH: withdraw on Pod, claim on ETH with proof from pod_getBridgeClaimProof RPC
|
|
9
9
|
*
|
|
10
10
|
* New deposit params (callContract, reserveBalance) enable depositing to CLOB orderbook in one TX.
|
|
11
11
|
* For simple bridge deposits: callContract=address(0), reserveBalance=0.
|
|
@@ -25,14 +25,14 @@ exports.SOURCE_CHAIN_BRIDGE_ABI = [
|
|
|
25
25
|
];
|
|
26
26
|
/**
|
|
27
27
|
* ABI for Bridge system contract on Pod chain.
|
|
28
|
-
* Pod uses bytes32 indexed id in
|
|
29
|
-
*
|
|
28
|
+
* Pod uses bytes32 indexed id in Withdraw events.
|
|
29
|
+
* withdraw(token, amount, to, chainId) — chainId is the target chain for claiming.
|
|
30
30
|
*/
|
|
31
31
|
exports.POD_BRIDGE_ABI = [
|
|
32
32
|
// Events
|
|
33
|
-
"event
|
|
34
|
-
//
|
|
35
|
-
"function
|
|
33
|
+
"event Withdraw(bytes32 indexed id, address indexed from, address indexed to, address token, uint256 amount, uint256 chainId)",
|
|
34
|
+
// Withdraw function (4-param: token, amount, to, chainId)
|
|
35
|
+
"function withdraw(address token, uint256 amount, address to, uint256 chainId) returns (bytes32)",
|
|
36
36
|
];
|
|
37
37
|
// Backward compatibility alias
|
|
38
38
|
exports.BRIDGE_ABI = exports.SOURCE_CHAIN_BRIDGE_ABI;
|