agentwallet-sdk 2.5.0 → 3.0.0
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 +218 -0
- package/dist/bridge/client.d.ts +17 -49
- package/dist/bridge/client.d.ts.map +1 -1
- package/dist/bridge/client.js +94 -124
- package/dist/bridge/client.js.map +1 -1
- package/dist/bridge/index.d.ts +4 -2
- package/dist/bridge/index.d.ts.map +1 -1
- package/dist/bridge/index.js +8 -2
- package/dist/bridge/index.js.map +1 -1
- package/dist/bridge/types.d.ts +100 -19
- package/dist/bridge/types.d.ts.map +1 -1
- package/dist/bridge/types.js +167 -18
- package/dist/bridge/types.js.map +1 -1
- package/dist/bridge/unified.d.ts +101 -0
- package/dist/bridge/unified.d.ts.map +1 -0
- package/dist/bridge/unified.js +284 -0
- package/dist/bridge/unified.js.map +1 -0
- package/dist/chains.d.ts +25 -0
- package/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +33 -0
- package/dist/chains.js.map +1 -1
- package/dist/index.d.ts +13 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/solana/bridge.d.ts +144 -0
- package/dist/solana/bridge.d.ts.map +1 -0
- package/dist/solana/bridge.js +352 -0
- package/dist/solana/bridge.js.map +1 -0
- package/dist/solana/index.d.ts +8 -0
- package/dist/solana/index.d.ts.map +1 -0
- package/dist/solana/index.js +6 -0
- package/dist/solana/index.js.map +1 -0
- package/dist/solana/swap.d.ts +85 -0
- package/dist/solana/swap.d.ts.map +1 -0
- package/dist/solana/swap.js +173 -0
- package/dist/solana/swap.js.map +1 -0
- package/dist/solana/types.d.ts +126 -0
- package/dist/solana/types.d.ts.map +1 -0
- package/dist/solana/types.js +10 -0
- package/dist/solana/types.js.map +1 -0
- package/dist/solana/wallet.d.ts +83 -0
- package/dist/solana/wallet.d.ts.map +1 -0
- package/dist/solana/wallet.js +164 -0
- package/dist/solana/wallet.js.map +1 -0
- package/dist/solana/x402.d.ts +69 -0
- package/dist/solana/x402.d.ts.map +1 -0
- package/dist/solana/x402.js +154 -0
- package/dist/solana/x402.js.map +1 -0
- package/dist/x402/index.d.ts +1 -1
- package/dist/x402/index.d.ts.map +1 -1
- package/dist/x402/index.js +1 -1
- package/dist/x402/index.js.map +1 -1
- package/dist/x402/types.d.ts +4 -2
- package/dist/x402/types.d.ts.map +1 -1
- package/dist/x402/types.js +12 -1
- package/dist/x402/types.js.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -196,6 +196,8 @@ for (const entry of history) {
|
|
|
196
196
|
|
|
197
197
|
## Supported Chains
|
|
198
198
|
|
|
199
|
+
### Wallet / Execution Chains
|
|
200
|
+
|
|
199
201
|
| Chain | Status | Best For |
|
|
200
202
|
|-------|--------|----------|
|
|
201
203
|
| **Base** | ✅ Primary | Low gas, USDC native |
|
|
@@ -204,6 +206,108 @@ for (const entry of history) {
|
|
|
204
206
|
| **Arbitrum** | ✅ | DeFi agents |
|
|
205
207
|
| **Polygon** | ✅ | Micropayments |
|
|
206
208
|
|
|
209
|
+
### CCTP V2 Bridge — 17 Chains (v3.1.0)
|
|
210
|
+
|
|
211
|
+
Bridge USDC between any two supported chains via Circle's Cross-Chain Transfer Protocol V2. **0.1% platform fee.** Uses the same non-custodial, agent-native architecture.
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { UnifiedBridge } from 'agentwallet-sdk';
|
|
215
|
+
|
|
216
|
+
const bridge = new UnifiedBridge({ evmSigner, solanaWallet });
|
|
217
|
+
|
|
218
|
+
// Bridge 1 USDC from Solana to Base (~20s fast transfer)
|
|
219
|
+
const result = await bridge.bridge({
|
|
220
|
+
amount: 1_000_000n, // 1 USDC (6 decimals)
|
|
221
|
+
sourceChain: 'solana',
|
|
222
|
+
destinationChain: 'base',
|
|
223
|
+
destinationAddress: '0x...',
|
|
224
|
+
});
|
|
225
|
+
console.log('Minted on Base:', result.mintTxHash);
|
|
226
|
+
|
|
227
|
+
// Bridge from Polygon to Arbitrum
|
|
228
|
+
const result2 = await bridge.bridge({
|
|
229
|
+
amount: 5_000_000n, // 5 USDC
|
|
230
|
+
sourceChain: 'polygon',
|
|
231
|
+
destinationChain: 'arbitrum',
|
|
232
|
+
destinationAddress: '0x...',
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// Get a fee quote
|
|
236
|
+
const quote = bridge.getQuote({
|
|
237
|
+
amount: 1_000_000n,
|
|
238
|
+
sourceChain: 'base',
|
|
239
|
+
destinationChain: 'sonic',
|
|
240
|
+
});
|
|
241
|
+
console.log(`Fee: ${quote.platformFee} USDC (0.1%)`);
|
|
242
|
+
console.log(`Est. time: ${quote.estimatedTimeSeconds}s`);
|
|
243
|
+
console.log(`Output: ${quote.outputAmount} USDC`);
|
|
244
|
+
|
|
245
|
+
// All 17 chains
|
|
246
|
+
console.log(bridge.getSupportedChains());
|
|
247
|
+
// ['ethereum','avalanche','optimism','arbitrum','base','polygon',
|
|
248
|
+
// 'unichain','linea','codex','sonic','worldchain','sei','xdc',
|
|
249
|
+
// 'hyperevm','ink','plume','solana']
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### Supported Bridge Chains
|
|
253
|
+
|
|
254
|
+
| Chain | CCTP Domain | Chain ID | Fast Transfer |
|
|
255
|
+
|-------|-------------|----------|---------------|
|
|
256
|
+
| Ethereum | 0 | 1 | ✅ ~20s |
|
|
257
|
+
| Avalanche | 1 | 43114 | ⏱ ~15min |
|
|
258
|
+
| OP Mainnet | 2 | 10 | ✅ ~20s |
|
|
259
|
+
| Arbitrum | 3 | 42161 | ✅ ~20s |
|
|
260
|
+
| **Solana** | 5 | — | ✅ ~20s |
|
|
261
|
+
| Base | 6 | 8453 | ✅ ~20s |
|
|
262
|
+
| Polygon PoS | 7 | 137 | ⏱ ~15min |
|
|
263
|
+
| Unichain | 10 | 130 | ✅ ~20s |
|
|
264
|
+
| Linea | 11 | 59144 | ✅ ~20s |
|
|
265
|
+
| Codex | 12 | 812 | ✅ ~20s |
|
|
266
|
+
| Sonic | 13 | 146 | ⏱ ~15min |
|
|
267
|
+
| World Chain | 14 | 480 | ✅ ~20s |
|
|
268
|
+
| Sei | 16 | 1329 | ⏱ ~15min |
|
|
269
|
+
| XDC | 18 | 50 | ⏱ ~15min |
|
|
270
|
+
| HyperEVM | 19 | 999 | ⏱ ~15min |
|
|
271
|
+
| Ink | 21 | 57073 | ✅ ~20s |
|
|
272
|
+
| Plume | 22 | 98866 | ✅ ~20s |
|
|
273
|
+
|
|
274
|
+
Contract addresses verified from Circle's official docs:
|
|
275
|
+
- **TokenMessengerV2**: `0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d` (all EVM chains)
|
|
276
|
+
- **MessageTransmitterV2**: `0x81D40F21F12A8F0E3252Bccb954D722d4c464B64` (all EVM chains)
|
|
277
|
+
|
|
278
|
+
#### EVM-Only Bridge (BridgeModule)
|
|
279
|
+
|
|
280
|
+
For EVM→EVM routes you can use `BridgeModule` directly (no Solana dependency):
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
import { BridgeModule } from 'agentwallet-sdk';
|
|
284
|
+
|
|
285
|
+
const bridge = new BridgeModule(walletClient, 'base');
|
|
286
|
+
const result = await bridge.bridge(1_000_000n, 'polygon');
|
|
287
|
+
console.log('Minted on Polygon:', result.mintTxHash);
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
#### Solana-Side Operations (SolanaCCTPBridge)
|
|
291
|
+
|
|
292
|
+
```typescript
|
|
293
|
+
import { SolanaCCTPBridge } from 'agentwallet-sdk';
|
|
294
|
+
import { Connection, Keypair } from '@solana/web3.js';
|
|
295
|
+
|
|
296
|
+
const solanaBridge = new SolanaCCTPBridge({
|
|
297
|
+
connection: new Connection('https://api.mainnet-beta.solana.com'),
|
|
298
|
+
payer: keypair,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// Burn USDC on Solana → receive on Base
|
|
302
|
+
const burnResult = await solanaBridge.depositForBurn({
|
|
303
|
+
amount: 1_000_000n,
|
|
304
|
+
destinationChain: 'base',
|
|
305
|
+
destinationAddress: '0x...',
|
|
306
|
+
});
|
|
307
|
+
const attestation = await solanaBridge.waitForAttestation(burnResult.messageHash);
|
|
308
|
+
// ... then call receiveMessage on Base
|
|
309
|
+
```
|
|
310
|
+
|
|
207
311
|
## x402 Protocol Support
|
|
208
312
|
|
|
209
313
|
Agent Wallet natively supports the [x402 protocol](https://x402.org) — the open standard for HTTP 402 machine payments. Your agent can automatically pay any x402-enabled API (Stripe, Coinbase, etc.) using USDC on Base, while respecting on-chain spend limits.
|
|
@@ -393,6 +497,120 @@ const file = parseDataURI(uri);
|
|
|
393
497
|
|
|
394
498
|
All limits enforced on-chain. No off-chain dependencies. Fully auditable.
|
|
395
499
|
|
|
500
|
+
## Solana Support (v3.0.0)
|
|
501
|
+
|
|
502
|
+
Solana is now a first-class chain in the SDK. Unlike EVM chains, Solana uses Ed25519 keys, SPL tokens, and Jupiter for swaps — all fully supported.
|
|
503
|
+
|
|
504
|
+
### Install
|
|
505
|
+
|
|
506
|
+
```bash
|
|
507
|
+
npm install agentwallet-sdk @solana/web3.js @solana/spl-token
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### SolanaWallet — Non-Custodial Agent Wallet
|
|
511
|
+
|
|
512
|
+
```typescript
|
|
513
|
+
import { SolanaWallet, SOLANA_USDC_MINT } from 'agentwallet-sdk';
|
|
514
|
+
|
|
515
|
+
// Generate a fresh keypair (ephemeral agent wallet)
|
|
516
|
+
const wallet = SolanaWallet.generate('https://api.mainnet-beta.solana.com');
|
|
517
|
+
|
|
518
|
+
// Or load from existing base58 private key
|
|
519
|
+
const wallet2 = SolanaWallet.fromBase58(process.env.SOLANA_PRIVATE_KEY!, 'https://api.mainnet-beta.solana.com');
|
|
520
|
+
|
|
521
|
+
// Get address (base58 public key)
|
|
522
|
+
console.log(wallet.getAddress());
|
|
523
|
+
|
|
524
|
+
// Check SOL balance (in lamports)
|
|
525
|
+
const lamports = await wallet.getBalance();
|
|
526
|
+
console.log(`${Number(lamports) / 1e9} SOL`);
|
|
527
|
+
|
|
528
|
+
// Check USDC balance (6 decimals)
|
|
529
|
+
const usdc = await wallet.getBalance(SOLANA_USDC_MINT);
|
|
530
|
+
console.log(`${Number(usdc) / 1e6} USDC`);
|
|
531
|
+
|
|
532
|
+
// Transfer SOL
|
|
533
|
+
const sig = await wallet.transfer({
|
|
534
|
+
recipient: 'RecipientPubkey...',
|
|
535
|
+
amount: 500_000_000n, // 0.5 SOL in lamports
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
// Transfer USDC
|
|
539
|
+
const sig2 = await wallet.transfer({
|
|
540
|
+
recipient: 'RecipientPubkey...',
|
|
541
|
+
amount: 5_000_000n, // 5 USDC (6 decimals)
|
|
542
|
+
mint: SOLANA_USDC_MINT,
|
|
543
|
+
});
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### JupiterSwapClient — DEX Aggregator (Solana's Uniswap)
|
|
547
|
+
|
|
548
|
+
```typescript
|
|
549
|
+
import { SolanaWallet, JupiterSwapClient, SOLANA_USDC_MINT, SOL_NATIVE_MINT } from 'agentwallet-sdk';
|
|
550
|
+
|
|
551
|
+
const wallet = SolanaWallet.fromBase58(process.env.SOLANA_KEY!, 'https://api.mainnet-beta.solana.com');
|
|
552
|
+
const jupiter = new JupiterSwapClient({ wallet });
|
|
553
|
+
|
|
554
|
+
// Get a quote: SOL → USDC
|
|
555
|
+
const quote = await jupiter.getQuote(SOL_NATIVE_MINT, SOLANA_USDC_MINT, 1_000_000_000n);
|
|
556
|
+
console.log(`1 SOL ≈ ${Number(quote.outAmount) / 1e6} USDC`);
|
|
557
|
+
|
|
558
|
+
// Execute swap (0.875% platform fee, 0.5% default slippage)
|
|
559
|
+
const result = await jupiter.swapSolToUsdc(500_000_000n); // 0.5 SOL
|
|
560
|
+
console.log(`Swapped → tx: ${result.txSignature}`);
|
|
561
|
+
|
|
562
|
+
// Reverse: USDC → SOL
|
|
563
|
+
const result2 = await jupiter.swapUsdcToSol(100_000_000n); // 100 USDC
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### SolanaX402Client — x402 Payments on Solana
|
|
567
|
+
|
|
568
|
+
```typescript
|
|
569
|
+
import { SolanaWallet, SolanaX402Client } from 'agentwallet-sdk';
|
|
570
|
+
|
|
571
|
+
const wallet = SolanaWallet.fromBase58(process.env.SOLANA_KEY!, 'https://api.mainnet-beta.solana.com');
|
|
572
|
+
const x402 = new SolanaX402Client(wallet);
|
|
573
|
+
|
|
574
|
+
// Check if this client can handle a network
|
|
575
|
+
x402.canHandle('solana:mainnet'); // true
|
|
576
|
+
x402.canHandle('base:8453'); // false
|
|
577
|
+
|
|
578
|
+
// Validate payment requirements before paying
|
|
579
|
+
const requirements = {
|
|
580
|
+
scheme: 'exact',
|
|
581
|
+
network: 'solana:mainnet' as const,
|
|
582
|
+
asset: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC
|
|
583
|
+
amount: '1000000', // 1 USDC
|
|
584
|
+
payTo: 'RecipientPubkey...',
|
|
585
|
+
maxTimeoutSeconds: 300,
|
|
586
|
+
extra: {},
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
const { valid, reason } = x402.validateRequirements(requirements, { maxAmount: 5_000_000n });
|
|
590
|
+
if (!valid) throw new Error(reason);
|
|
591
|
+
|
|
592
|
+
// Build signed proof (without broadcasting)
|
|
593
|
+
const proof = await x402.buildPaymentProof(requirements);
|
|
594
|
+
// proof.signedTransaction — base64 signed tx for x402 header
|
|
595
|
+
|
|
596
|
+
// Or pay directly (sign + broadcast)
|
|
597
|
+
const paidProof = await x402.pay(requirements);
|
|
598
|
+
console.log(`Paid! tx: ${paidProof.txSignature}`);
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
### Solana Chain Config
|
|
602
|
+
|
|
603
|
+
```typescript
|
|
604
|
+
import { SOLANA_CONFIG, getSolanaConfig } from 'agentwallet-sdk';
|
|
605
|
+
|
|
606
|
+
const mainnet = getSolanaConfig('solana');
|
|
607
|
+
// { cluster: 'mainnet-beta', rpcUrl: '...', usdcMint: 'EPjFWdd5...', x402Network: 'solana:mainnet' }
|
|
608
|
+
|
|
609
|
+
const devnet = getSolanaConfig('solana-devnet');
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
---
|
|
613
|
+
|
|
396
614
|
## License
|
|
397
615
|
|
|
398
616
|
MIT
|
package/dist/bridge/client.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { type Hash, type Hex, type WalletClient } from 'viem';
|
|
2
2
|
import type { BridgeChain, BridgeOptions, BurnResult, BridgeResult } from './types.js';
|
|
3
|
-
import { CCTP_DOMAIN_IDS, BRIDGE_CHAIN_IDS, USDC_CONTRACT, TOKEN_MESSENGER_V2, MESSAGE_TRANSMITTER_V2, FINALITY_THRESHOLD } from './types.js';
|
|
3
|
+
import { CCTP_DOMAIN_IDS, BRIDGE_CHAIN_IDS, BRIDGE_RPC_URLS, USDC_CONTRACT, TOKEN_MESSENGER_V2, MESSAGE_TRANSMITTER_V2, FINALITY_THRESHOLD } from './types.js';
|
|
4
4
|
/**
|
|
5
|
-
* BridgeModule — CCTP V2 cross-chain USDC bridge.
|
|
5
|
+
* BridgeModule — CCTP V2 cross-chain USDC bridge (16 EVM chains).
|
|
6
|
+
*
|
|
7
|
+
* For EVM↔Solana bridges, use UnifiedBridge instead.
|
|
6
8
|
*
|
|
7
9
|
* Usage:
|
|
8
10
|
* ```ts
|
|
9
|
-
* const bridge = new BridgeModule(walletClient, 'base'
|
|
10
|
-
* const result = await bridge.bridge(1_000_000n, '
|
|
11
|
-
* console.log('Minted on
|
|
11
|
+
* const bridge = new BridgeModule(walletClient, 'base');
|
|
12
|
+
* const result = await bridge.bridge(1_000_000n, 'polygon');
|
|
13
|
+
* console.log('Minted on Polygon:', result.mintTxHash);
|
|
12
14
|
* ```
|
|
13
15
|
*/
|
|
14
16
|
export declare class BridgeModule {
|
|
@@ -20,87 +22,53 @@ export declare class BridgeModule {
|
|
|
20
22
|
rpcUrl?: string;
|
|
21
23
|
});
|
|
22
24
|
/**
|
|
23
|
-
* Bridge USDC from the source chain to the destination
|
|
25
|
+
* Bridge USDC from the source chain to any of the 16 supported EVM destination chains.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* Full CCTP V2 flow: approve → burn → attest → mint.
|
|
28
|
+
* Platform fee: 0.1% of amount (collected on source chain).
|
|
27
29
|
*
|
|
28
30
|
* @param amount - Amount in USDC base units (6 decimals). e.g. 1_000_000n = 1 USDC
|
|
29
|
-
* @param toChain - Destination chain
|
|
31
|
+
* @param toChain - Destination EVM chain
|
|
30
32
|
* @param options - Optional overrides (finality, fees, destination address)
|
|
31
|
-
*
|
|
32
|
-
* @throws BridgeError with actionable message if anything fails
|
|
33
33
|
*/
|
|
34
34
|
bridge(amount: bigint, toChain: BridgeChain, options?: BridgeOptions): Promise<BridgeResult>;
|
|
35
35
|
/**
|
|
36
36
|
* Step 1 of 3: Burn USDC on the source chain.
|
|
37
|
-
* Returns
|
|
38
|
-
* Use this for manual/split-phase bridging.
|
|
37
|
+
* Returns burn result for manual/split-phase bridging.
|
|
39
38
|
*/
|
|
40
39
|
burn(amount: bigint, toChain: BridgeChain, options?: BridgeOptions): Promise<BurnResult>;
|
|
41
40
|
/**
|
|
42
41
|
* Step 2 of 3: Poll Circle IRIS API for attestation.
|
|
43
|
-
* Returns the attestation bytes once Circle confirms the message.
|
|
44
42
|
*/
|
|
45
43
|
waitForAttestation(messageHash: Hex, apiUrl?: string): Promise<Hex>;
|
|
46
44
|
/**
|
|
47
45
|
* Step 3 of 3: Mint USDC on the destination chain using the attestation.
|
|
48
46
|
*/
|
|
49
47
|
mint(messageBytes: Hex, attestation: Hex, toChain: BridgeChain, destinationRpcUrl?: string): Promise<Hash>;
|
|
50
|
-
/**
|
|
51
|
-
* Fetch the current USDC balance on the source chain for the signer's address.
|
|
52
|
-
*/
|
|
48
|
+
/** Get USDC balance on the source chain */
|
|
53
49
|
getUsdcBalance(): Promise<bigint>;
|
|
54
|
-
/**
|
|
55
|
-
* Fetch the current USDC allowance for the TokenMessengerV2 on source chain.
|
|
56
|
-
*/
|
|
50
|
+
/** Get USDC allowance for the TokenMessengerV2 on source chain */
|
|
57
51
|
getUsdcAllowance(): Promise<bigint>;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
* Skips if existing allowance is sufficient.
|
|
61
|
-
*/
|
|
52
|
+
/** Get the source chain name */
|
|
53
|
+
getFromChain(): BridgeChain;
|
|
62
54
|
private approveUsdc;
|
|
63
|
-
/**
|
|
64
|
-
* Call TokenMessengerV2.depositForBurn and extract MessageSent data.
|
|
65
|
-
*/
|
|
66
55
|
private depositForBurn;
|
|
67
56
|
/**
|
|
68
57
|
* Extract the CCTP MessageSent event from a transaction receipt.
|
|
69
|
-
* The MessageTransmitter emits this event during depositForBurn.
|
|
70
58
|
*/
|
|
71
59
|
private extractMessageSent;
|
|
72
|
-
/**
|
|
73
|
-
* Poll the Circle IRIS API until the attestation is ready.
|
|
74
|
-
* Fast finality: ~12 seconds. Full finality: ~15 minutes on Ethereum.
|
|
75
|
-
*/
|
|
76
60
|
private pollForAttestation;
|
|
77
|
-
/**
|
|
78
|
-
* Call MessageTransmitterV2.receiveMessage on the destination chain to mint USDC.
|
|
79
|
-
*/
|
|
80
61
|
private receiveMessage;
|
|
81
62
|
private validateBridgeParams;
|
|
82
63
|
private sleep;
|
|
83
64
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Structured bridge error with actionable messages and error codes.
|
|
86
|
-
*/
|
|
87
65
|
export declare class BridgeError extends Error {
|
|
88
66
|
readonly code: string;
|
|
89
67
|
constructor(code: string, message: string);
|
|
90
68
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Create a BridgeModule from an existing AgentWallet object.
|
|
93
|
-
* Convenience wrapper for wallet.bridge() integration.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```ts
|
|
97
|
-
* const bridge = createBridge(wallet.walletClient, 'base', { rpcUrl: BASE_RPC });
|
|
98
|
-
* const result = await bridge.bridge(5_000_000n, 'optimism');
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
69
|
export declare function createBridge(walletClient: WalletClient, fromChain?: BridgeChain, options?: {
|
|
102
70
|
rpcUrl?: string;
|
|
103
71
|
}): BridgeModule;
|
|
104
72
|
export type { BridgeChain, BridgeOptions, BurnResult, BridgeResult };
|
|
105
|
-
export { CCTP_DOMAIN_IDS, BRIDGE_CHAIN_IDS, USDC_CONTRACT, TOKEN_MESSENGER_V2, MESSAGE_TRANSMITTER_V2, FINALITY_THRESHOLD, };
|
|
73
|
+
export { CCTP_DOMAIN_IDS, BRIDGE_CHAIN_IDS, USDC_CONTRACT, TOKEN_MESSENGER_V2, MESSAGE_TRANSMITTER_V2, BRIDGE_RPC_URLS, FINALITY_THRESHOLD, };
|
|
106
74
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/bridge/client.ts"],"names":[],"mappings":"AAYA,OAAO,EASL,KAAK,IAAI,EACT,KAAK,GAAG,EAER,KAAK,YAAY,EAElB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/bridge/client.ts"],"names":[],"mappings":"AAYA,OAAO,EASL,KAAK,IAAI,EACT,KAAK,GAAG,EAER,KAAK,YAAY,EAElB,MAAM,MAAM,CAAC;AAYd,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,YAAY,EAEb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAKnB,MAAM,YAAY,CAAC;AAqCpB;;;;;;;;;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