- Preparing search index...
- The search index is not available
handle-sdk
Methods
cancelOrder
- cancelOrder(orderId, accountId, accountUser, nonce, signature): Promise<void>
-
Parameters
-
orderId: string
-
accountId: number
-
accountUser: string
-
nonce: string
-
signature: string
Returns Promise<void>
cancelSubscription
- cancelSubscription(subscriptionId): void
-
Returns void
clearSystemParam
- clearSystemParam(args): Promise<void>
-
Returns Promise<void>
deposit
- deposit(amount, accountId, tokenAddress, depositorAddress, signature, useGasless?, psmToken?): Promise<DepositResponse>
-
Parameters
-
amount: string
-
accountId: number
-
tokenAddress: string
-
depositorAddress: string
-
signature: string
-
Optional
useGasless: boolean
Optional
-
Optional
psmToken: string
Optional
getDepositMessage
- getDepositMessage(signerAddress, accountId): Promise<Bytes>
-
Parameters
-
signerAddress: string
-
accountId: number
Returns Promise<Bytes>
getOpenAccountMessage
- getOpenAccountMessage(signerAddress): Promise<Bytes>
-
Returns Promise<Bytes>
getOwnerMessage
- getOwnerMessage(signerAddress, accountId): Promise<Bytes>
-
Parameters
-
signerAddress: string
-
accountId: number
Returns Promise<Bytes>
getTradeMessage
- getTradeMessage(signerAddress, accountId): Promise<Bytes>
-
Parameters
-
signerAddress: string
-
accountId: number
Returns Promise<Bytes>
getWithdrawMessage
- getWithdrawMessage(signerAddress, accountId): Promise<Bytes>
-
Parameters
-
signerAddress: string
-
accountId: number
Returns Promise<Bytes>
grantAccountUserRole
- grantAccountUserRole(accountId, user, role, accountOwner, signature): Promise<GrantAccountUserRoleResponse>
-
Parameters
-
accountId: number
-
user: string
-
-
accountOwner: string
-
signature: string
openAccount
- openAccount(amount, tokenAddress, ownerAddress, signature, referralCode?, useGasless?, psmToken?): Promise<OpenAccountResponse>
-
Parameters
-
amount: string
-
tokenAddress: string
-
ownerAddress: string
-
signature: string
-
Optional
referralCode: string
Optional
-
Optional
useGasless: boolean
Optional
-
Optional
psmToken: string
Optional
placeOrder
- placeOrder(order): Promise<PlaceOrderResponse>
-
Parameters
-
order: {
accountId: number;
accountUser: string;
createdTimestampUnixMillis: number;
expiryTimestampUnixMillis: number;
id: string;
kind: (({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; })) & (undefined | ({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; }));
lpId: string;
nonce: string;
pair: Pair;
signature: string;
size: { amount: BigNumber; unit: "lpc" | "lot"; };
status: (({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; })) & (undefined | ({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; }));
}
-
accountId: number
-
accountUser: string
-
createdTimestampUnixMillis: number
-
expiryTimestampUnixMillis: number
-
id: string
-
kind: (({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; })) & (undefined | ({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; }))
-
lpId: string
-
nonce: string
-
pair: Pair
-
signature: string
-
size: { amount: BigNumber; unit: "lpc" | "lot"; }
-
status: (({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; })) & (undefined | ({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; }))
replaceOrder
- replaceOrder(cancelOrderId, cancelSignature, nonce, accountId, accountUser, newOrder): Promise<ReplaceOrderResponse>
-
Parameters
-
cancelOrderId: string
-
cancelSignature: string
-
nonce: string
-
accountId: number
-
accountUser: string
-
newOrder: {
accountId: number;
accountUser: string;
createdTimestampUnixMillis: number;
expiryTimestampUnixMillis: number;
id: string;
kind: (({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; })) & (undefined | ({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; }));
lpId: string;
nonce: string;
pair: Pair;
signature: string;
size: { amount: BigNumber; unit: "lpc" | "lot"; };
status: (({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; })) & (undefined | ({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; }));
}
-
accountId: number
-
accountUser: string
-
createdTimestampUnixMillis: number
-
expiryTimestampUnixMillis: number
-
id: string
-
kind: (({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; })) & (undefined | ({ kind: "market"; }) | ({ kind: "limit"; args: { limitPrice: BigNumber; }; }) | ({ kind: "stopMarket"; args: { triggerPrice: BigNumber; stopLoss?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: "stopLimit"; args: { triggerPrice: BigNumber; limitPrice: BigNumber; }; }) | ({ kind: "limitTrigger"; args: { triggerPrice: BigNumber; takeProfit?: { kind: "position"; } | { id: string; kind: "order"; } | null | undefined; }; }) | ({ kind: string; }))
-
lpId: string
-
nonce: string
-
pair: Pair
-
signature: string
-
size: { amount: BigNumber; unit: "lpc" | "lot"; }
-
status: (({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; })) & (undefined | ({ status: "open"; content: { status: "placed"; } | { status: "triggered"; content: { triggerPrice: BigNumber; timestampUnixMillis: number; }; }; }) | ({ status: "filled"; content: { price: BigNumber; timestampUnixMillis: number; settlementStatus: { status: "queued"; } | { status: "beforeTx"; } | { status: "indexing"; } | { status: "settled"; content: { ...; }; }; }; }) | ({ status: "cancelled"; content: { timestampUnixMillis: number; reason: string; userCancellation?: { address: string; nonce: string; signature: { v: number; r: string; s: string; }; } | null | undefined; }; }))
revokeAccountUserRole
- revokeAccountUserRole(accountId, user, role, accountOwner, signature): Promise<RevokeAccountUserRoleResponse>
-
Parameters
-
accountId: number
-
user: string
-
-
accountOwner: string
-
signature: string
setSystemParam
- setSystemParam(args): Promise<void>
-
Returns Promise<void>
subscribeToAccount
- subscribeToAccount(accountId, listener): Promise<string>
-
Returns Promise<string>
subscribeToLp
- subscribeToLp(lpId, listener): Promise<string>
-
Returns Promise<string>
trade
- trade(accountId, liquidityPoolId, size, pair, accountUser, signature): Promise<TradeResponse>
-
Parameters
-
accountId: number
-
liquidityPoolId: string
-
size: {
amount: BigNumber;
unit: "lpc" | "lot";
}
-
amount: BigNumber
-
unit: "lpc" | "lot"
-
pair: Pair
-
accountUser: string
-
signature: string
waitForConnect
- waitForConnect(): Promise<void>
-
Returns Promise<void>
withdraw
- withdraw(amount, accountId, accountUser, tokenAddress, recipientAddress, signature, psmToken?): Promise<WithdrawResponse>
-
Parameters
-
amount: string
-
accountId: number
-
accountUser: string
-
tokenAddress: string
-
recipientAddress: string
-
signature: string
-
Optional
psmToken: string
Optional