githubEdit

πŸ’‘Configuration

How to configure the intents sdk

In order to create new intents and send it to the auctioneer network where a network of solvers will try to give the best quote for your cross-chain swap, we need to create a blockchain client for your specific chain.

Set up EVM Chains (Arbitrum, Optimism, Base)

For EVM-compatible chains, we use the EVMSDK class to create a client that can interact with Ethereum-based blockchains for sending orders as source chain.

Configuration for Local Accounts (e.g. private key/mnemonic wallets.)

Local accounts are cryptocurrency wallets controlled through private keys or seed phrases. This configuration is typically employed in server-side applications or situations that need automatic transaction signing and wallet operations.

import { ChainID, EVMSDK } from "@shogun-network/intents-sdk";

// Create EVM client for Arbitrum
const evmClient = new EVMSDK({
  chainId: ChainID.Arbitrum, // Supported: Arbitrum, Optimism, Base
  privateKey: '0x1234567890abcdef...', // Your private key with 0x prefix
  rpcProviderUrl: 'https://arb1.arbitrum.io/rpc' // Optional: custom RPC endpoint
});

Configuration for wallet providers (e.g. Browser Extension Wallets, WalletConnect, etc.).

Wallet providers like browser extensions (MetaMask, Coinbase Wallet) and WalletConnect offer secure, user-friendly wallet integration. Users maintain control of their private keys while benefiting from familiar interfaces and enhanced security through established authentication mechanisms.

For EVM chains, we use Permit2 with EIP-712 to enable gasless token approvals and standardized signing. This approach reduces transaction costs and provides a consistent user experience across different wallets.

const order = Order.create({ ... })

// Creates EIP-712 typed data for signing with wallet.
const { orderTypedData, nonce } = getEvmOrderTypedData(order);

// Front-end should then call auctioneer with the provided signature...

Set up Solana

For Solana blockchain, we use the SolanaSDK class to create a client that can interact with the Solana network for sending orders as source chain.

Configuration for Local Accounts (e.g. private key/mnemonic wallets.)

Configuration for wallet providers (e.g. Browser Extension Wallets, Phantom, etc.).

We provide the order key pair and the set of instructions to be signed by the wallet provider.

Set up Sui

For the Sui blockchain, we use the SuiSDK class to create a client that communicates with the Sui network.

Configuration for Local Accounts (e.g. private key/mnemonic wallets.)

Configuration for wallet providers (e.g. Browser Extension Wallets, Phantom, etc.).

We provide a function in order to get the transaction builder that should be executed onchain later

Last updated