Forkast Developer Docs
...
Order
Place Single Order
2 min
places a single limit order (buy/sell) after validating wallet + key, signing the order, and submitting it import { forkastsdk, network, orderresponse } from "@forkastgg/client"; const sdk = new forkastsdk(network mainnet, "your api key"); const accountservice = sdk getaccountservice(); const orderservice = sdk getorderservice(); const { accesstoken } = await accountservice loginwithprivatekey( "your private key" ); const order orderresponse = await orderservice placesingleorder( "token id", 0, // side 0 = buy, 1 = sell 0 45, // price 10, // amount { wallet "0xyourwallet", proxy wallet "0xyourproxywallet", private key "0xyourprivatekey", }, accesstoken ); parameters field type required description tokenid string yes address of the token account account yes wallet address, proxy wallet and private key price number yes price at which to place the order ( 0 < price < 1 ) amount number yes number of shares ( amount > 1) side number yes the side of the order ( 0 = buy, 1 = sell) accesstoken string yes access token received from login response minimum order value is 0 5, ensure price à amount âĨ 0 5 make sure docid 1dly5pdzkxyajcw2al8rk step is completed before placing the order