Orderly SDKs / Modules / @orderly.network/core

Module: @orderly.network/core

Table of contents

Namespaces

Classes

Interfaces

Type Aliases

Functions

Type Aliases

ConfigKey

Ƭ ConfigKey: "apiBaseUrl" | "klineDataUrl" | "privateWsUrl" | "publicWsUrl" | "operatorUrl" | "domain" | "brokerId" | "networkId" | "env" | "PROD_URL" | "markets"

Defined in

packages/core/src/configStore/configStore.ts:1


MessageFactor

Ƭ MessageFactor: Object

Type declaration

NameType
data?any
method"GET" | "POST" | "PUT" | "DELETE"
urlstring

Defined in

packages/core/src/signer.ts:7


SignedMessagePayload

Ƭ SignedMessagePayload: Object

Type declaration

NameType
orderly-account-id?string
orderly-keystring
orderly-signaturestring
orderly-timestampstring

Defined in

packages/core/src/signer.ts:15


WalletAdapterOptions

Ƭ WalletAdapterOptions: Object

Type declaration

NameType
addressstring
chain{ id: number }
chain.idnumber
providerany

Defined in

packages/core/src/wallet/adapter.ts:75


getWalletAdapterFunc

Ƭ getWalletAdapterFunc: (options: WalletAdapterOptions) => WalletAdapter

Type declaration

▸ (options): WalletAdapter

Parameters
NameType
optionsWalletAdapterOptions
Returns

WalletAdapter

Defined in

packages/core/src/wallet/adapter.ts:81

Functions

generateAddOrderlyKeyMessage

generateAddOrderlyKeyMessage(inputs): readonly [{ brokerId: string ; chainId: number ; expiration: number ; orderlyKey: string = publicKey; scope: string = “read,trading”; timestamp: number }, { domain: { chainId: number ; name: string = “Orderly”; verifyingContract: string ; version: string = “1” } ; message: { brokerId: string ; chainId: number ; expiration: number ; orderlyKey: string = publicKey; scope: string = “read,trading”; timestamp: number } ; primaryType: "Registration" | "EIP712Domain" | "Withdraw" | "AddOrderlyKey" | "SettlePnl" ; types: { EIP712Domain: readonly [{ name: "name" = “name”; type: "string" = “string” }, { name: "version" = “version”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "verifyingContract" = “verifyingContract”; type: "address" = “address” }] = definedTypes.EIP712Domain } = typeDefinition }]

generate addOrderlyKey data and to be signed message structure

Parameters

NameType
inputsObject
inputs.brokerIdstring
inputs.chainIdnumber
inputs.expiration?number
inputs.primaryType"Registration" | "EIP712Domain" | "Withdraw" | "AddOrderlyKey" | "SettlePnl"
inputs.publicKeystring
inputs.timestamp?number

Returns

readonly [{ brokerId: string ; chainId: number ; expiration: number ; orderlyKey: string = publicKey; scope: string = “read,trading”; timestamp: number }, { domain: { chainId: number ; name: string = “Orderly”; verifyingContract: string ; version: string = “1” } ; message: { brokerId: string ; chainId: number ; expiration: number ; orderlyKey: string = publicKey; scope: string = “read,trading”; timestamp: number } ; primaryType: "Registration" | "EIP712Domain" | "Withdraw" | "AddOrderlyKey" | "SettlePnl" ; types: { EIP712Domain: readonly [{ name: "name" = “name”; type: "string" = “string” }, { name: "version" = “version”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "verifyingContract" = “verifyingContract”; type: "address" = “address” }] = definedTypes.EIP712Domain } = typeDefinition }]

Defined in

packages/core/src/helper.ts:82


generateRegisterAccountMessage

generateRegisterAccountMessage(inputs): readonly [{ brokerId: string ; chainId: number ; registrationNonce: number ; timestamp: number }, { domain: { chainId: number ; name: string = “Orderly”; verifyingContract: string ; version: string = “1” } ; message: { brokerId: string ; chainId: number ; registrationNonce: number ; timestamp: number } ; primaryType: string ; types: { EIP712Domain: readonly [{ name: "name" = “name”; type: "string" = “string” }, { name: "version" = “version”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "verifyingContract" = “verifyingContract”; type: "address" = “address” }] = definedTypes.EIP712Domain; Registration: readonly [{ name: "brokerId" = “brokerId”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "timestamp" = “timestamp”; type: "uint64" = “uint64” }, { name: "registrationNonce" = “registrationNonce”; type: "uint256" = “uint256” }] } = typeDefinition }]

generate registerAccount data and to be signed message structure

Parameters

NameType
inputsObject
inputs.brokerIdstring
inputs.chainIdnumber
inputs.registrationNoncenumber
inputs.timestamp?number

Returns

readonly [{ brokerId: string ; chainId: number ; registrationNonce: number ; timestamp: number }, { domain: { chainId: number ; name: string = “Orderly”; verifyingContract: string ; version: string = “1” } ; message: { brokerId: string ; chainId: number ; registrationNonce: number ; timestamp: number } ; primaryType: string ; types: { EIP712Domain: readonly [{ name: "name" = “name”; type: "string" = “string” }, { name: "version" = “version”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "verifyingContract" = “verifyingContract”; type: "address" = “address” }] = definedTypes.EIP712Domain; Registration: readonly [{ name: "brokerId" = “brokerId”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "timestamp" = “timestamp”; type: "uint64" = “uint64” }, { name: "registrationNonce" = “registrationNonce”; type: "uint256" = “uint256” }] } = typeDefinition }]

Defined in

packages/core/src/helper.ts:43


generateSettleMessage

generateSettleMessage(inputs): readonly [{ brokerId: string ; chainId: number = chainId; settleNonce: string = settlePnlNonce; timestamp: number = timestamp }, { domain: SignatureDomain ; message: { brokerId: string ; chainId: number = chainId; settleNonce: string = settlePnlNonce; timestamp: number = timestamp } ; primaryType: string ; types: { EIP712Domain: readonly [{ name: "name" = “name”; type: "string" = “string” }, { name: "version" = “version”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "verifyingContract" = “verifyingContract”; type: "address" = “address” }] = definedTypes.EIP712Domain; SettlePnl: readonly [{ name: "brokerId" = “brokerId”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "settleNonce" = “settleNonce”; type: "uint64" = “uint64” }, { name: "timestamp" = “timestamp”; type: "uint64" = “uint64” }] } = typeDefinition }]

generate settle data and to be signed message structure

Parameters

NameType
inputsObject
inputs.brokerIdstring
inputs.chainIdnumber
inputs.domainSignatureDomain
inputs.settlePnlNoncestring

Returns

readonly [{ brokerId: string ; chainId: number = chainId; settleNonce: string = settlePnlNonce; timestamp: number = timestamp }, { domain: SignatureDomain ; message: { brokerId: string ; chainId: number = chainId; settleNonce: string = settlePnlNonce; timestamp: number = timestamp } ; primaryType: string ; types: { EIP712Domain: readonly [{ name: "name" = “name”; type: "string" = “string” }, { name: "version" = “version”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "verifyingContract" = “verifyingContract”; type: "address" = “address” }] = definedTypes.EIP712Domain; SettlePnl: readonly [{ name: "brokerId" = “brokerId”; type: "string" = “string” }, { name: "chainId" = “chainId”; type: "uint256" = “uint256” }, { name: "settleNonce" = “settleNonce”; type: "uint64" = “uint64” }, { name: "timestamp" = “timestamp”; type: "uint64" = “uint64” }] } = typeDefinition }]

Defined in

packages/core/src/helper.ts:127


getDefaultSigner

getDefaultSigner(): BaseSigner

Returns

BaseSigner

Defined in

packages/core/src/helper.ts:15


getMockSigner

getMockSigner(secretKey?): BaseSigner

Parameters

NameType
secretKey?string

Returns

BaseSigner

Defined in

packages/core/src/helper.ts:6