📂Create an order
Explains how to create an order for the SDK
You can create an order directly using the Order.create()
static method. This is useful when you want to create an order object without immediately preparing it for submission or further manipulation.
import { Order, ChainID } from "@shogun-network/intents-sdk";
const order = await Order.create({
user: "0x1234567890123456789012345678901234567890", // Signer wallet address
sourceChainId: ChainID.Arbitrum,
sourceTokenAddress: '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9', // USDT on Arbitrum
sourceTokenAmount: BigInt(10_000_000), // 10 USDT (6 decimals)
destinationChainId: ChainID.Solana,
destinationTokenAddress: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // USDT on Solana
destinationTokenMinAmount: BigInt(9_500_000), // 9.5 USDT minimum
destinationAddress: '3Kiz4oBXpR9YuPNsVfvE5XnNzgwjrM9m2CbRzyyEVkpQ', // Solana wallet
minStablecoinAmount: BigInt(9_800_000), // Protocol minimum
deadline: Math.floor(Date.now() / 1000) + 3600, // 1 hour from now
});
Parameter Details
sourceChainId
SupportedChain
Blockchain where tokens are swapped from
ChainID.Arbitrum
sourceTokenAddress
string
Contract address of source token
0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9
sourceTokenAmount
bigint
Amount with decimals included
BigInt(10_000_000)
(10 USDT)
destinationChainId
SupportedChain
Blockchain where tokens are received
ChainID.Solana
destinationTokenAddress
string
Contract address of destination token
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'
destinationAddress
string
Your receiving wallet address
CL2U2DAyeu6fSiZkUC7U9z1AixAKLPBNs9qRMu9cuWgM
deadline
number
Order expiration (Unix timestamp)
Math.floor(Date.now() / 1000) + 3600
user
string
Signer wallet address
0x1234567890123456789012345678901234567890
Optional Parameters
extraTransfers
ExtraTransfer[]
Additional token transfer (e.g. native tokens on destination chain)
minStablecoinAmount
bigint
Protocol minimum for internal swaps
destinationTokenMinAmount
bigint
Minimum acceptable receive amount in destination chain
Last updated