Skip to content

Commit

Permalink
Merge branch 'main' into feat/elfa-ai
Browse files Browse the repository at this point in the history
  • Loading branch information
AdwitM committed Feb 8, 2025
2 parents bbac6d4 + 5f8a249 commit 861dd92
Show file tree
Hide file tree
Showing 34 changed files with 1,850 additions and 19 deletions.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Anyone - whether an SF-based AI researcher or a crypto-native builder - can brin
- Register/resolve Alldomains
- Perpetuals Trading with Adrena Protocol
- Drift Vaults, Perps, Lending and Borrowing
- Cross-chain bridging via deBridge DLN

- **Solana Blinks**
- Lending by Lulo (Best APR for USDC)
Expand Down Expand Up @@ -557,6 +558,58 @@ const signature = await agent.swap(
```

### Cross-Chain Bridge via deBridge

The Solana Agent Kit supports cross-chain token transfers using deBridge's DLN protocol. Here's how to use it:

1. Check supported chains:
```typescript
const chains = await agent.getDebridgeSupportedChains();
console.log("Available chains:", chains);
// Example output: { chains: [{ chainId: "1", chainName: "Ethereum" }, { chainId: "7565164", chainName: "Solana" }] }
```

2. Get available tokens (optional):
```typescript
const tokens = await agent.getDebridgeTokensInfo("1", "USDC"); // Search for USDC on Ethereum
console.log("Available tokens:", tokens);
// Shows tokens matching 'USDC' on the specified chain
```

3. Create bridge order (SOL -> ETH):
```typescript
const orderInput = {
srcChainId: "7565164", // Solana
srcChainTokenIn: "11111111111111111111111111111111", // Native SOL
srcChainTokenInAmount: "1000000000", // 1 SOL (9 decimals)
dstChainId: "1", // Ethereum
dstChainTokenOut: "0x0000000000000000000000000000000000000000", // ETH
dstChainTokenOutRecipient: "0x23C279e58ddF1018C3B9D0C224534fA2a83fb1d2" // ETH recipient
};
const order = await agent.createDebridgeOrder(orderInput);
console.log("Order created:", order);
// Contains transaction data and estimated amounts
```

4. Execute the bridge order:
```typescript
const signature = await agent.executeDebridgeOrder(order.tx.data);
console.log("Bridge transaction sent:", signature);
```

5. Check bridge status:
```typescript
const status = await agent.checkDebridgeTransactionStatus(signature);
console.log("Bridge status:", status);
// Shows current status: Created, Fulfilled, etc.
```

Note: When bridging between chains:
- To Solana: Use base58 addresses for recipients and token mints
- From Solana: Use EVM addresses for recipients and ERC-20 format for tokens
- Always verify addresses and amounts before executing bridge transactions

## Examples

### LangGraph Multi-Agent System
Expand Down
2 changes: 1 addition & 1 deletion guides/test_it_out.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The project includes a test script located at `test/index.ts`. To execute the te

1. **Launch the Agent**
```bash
pnpm start
pnpm test:vercel-ai
```

2. **Select Your Mode**
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@bonfida/spl-name-service": "^3.0.7",
"@cks-systems/manifest-sdk": "0.1.59",
"@coral-xyz/anchor": "0.29",
"@drift-labs/sdk": "2.108.0-beta.4",
"@drift-labs/vaults-sdk": "^0.3.2",
"@drift-labs/sdk": "2.109.0-beta.11",
"@drift-labs/vaults-sdk": "^0.3.29",
"@langchain/core": "^0.3.26",
"@langchain/groq": "^0.1.2",
"@langchain/langgraph": "^0.2.36",
Expand All @@ -53,6 +53,8 @@
"@metaplex-foundation/mpl-toolbox": "^0.9.4",
"@metaplex-foundation/umi": "^0.9.2",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
"@metaplex-foundation/umi-options": "^1.0.0",
"@metaplex-foundation/umi-uploader-irys": "^1.0.0",
"@metaplex-foundation/umi-web3js-adapters": "^0.9.2",
"@meteora-ag/alpha-vault": "^1.1.7",
"@meteora-ag/dlmm": "^1.3.0",
Expand All @@ -63,6 +65,7 @@
"@pythnetwork/hermes-client": "^1.3.0",
"@raydium-io/raydium-sdk-v2": "0.1.95-alpha",
"@solana/spl-token": "^0.4.9",
"@solana/spl-token-metadata": "^0.1.6",
"@solana/web3.js": "^1.98.0",
"@solutiofi/sdk": "^1.0.2",
"@sqds/multisig": "^2.1.3",
Expand Down
Loading

0 comments on commit 861dd92

Please sign in to comment.