Orderly network core
Orderly SDKs / Modules / @orderly.network/core
Module: @orderly.network/core
Table of contents
Namespaces
Classes
- Account
- BaseKeyStore
- BaseOrderlyKeyPair
- BaseSigner
- DefaultConfigStore
- EtherAdapter
- EventEmitter
- LocalStorageStore
- MockKeyStore
- SimpleDI
Interfaces
Type Aliases
Functions
- generateAddOrderlyKeyMessage
- generateRegisterAccountMessage
- generateSettleMessage
- getDefaultSigner
- getMockSigner
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
Name | Type |
---|---|
data? | any |
method | "GET" | "POST" | "PUT" | "DELETE" |
url | string |
Defined in
SignedMessagePayload
Ƭ SignedMessagePayload: Object
Type declaration
Name | Type |
---|---|
orderly-account-id? | string |
orderly-key | string |
orderly-signature | string |
orderly-timestamp | string |
Defined in
packages/core/src/signer.ts:15
WalletAdapterOptions
Ƭ WalletAdapterOptions: Object
Type declaration
Name | Type |
---|---|
address | string |
chain | { id : number } |
chain.id | number |
provider | any |
Defined in
packages/core/src/wallet/adapter.ts:75
getWalletAdapterFunc
Ƭ getWalletAdapterFunc: (options
: WalletAdapterOptions
) => WalletAdapter
Type declaration
▸ (options
): WalletAdapter
Parameters
Name | Type |
---|---|
options | WalletAdapterOptions |
Returns
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
Name | Type |
---|---|
inputs | Object |
inputs.brokerId | string |
inputs.chainId | number |
inputs.expiration? | number |
inputs.primaryType | "Registration" | "EIP712Domain" | "Withdraw" | "AddOrderlyKey" | "SettlePnl" |
inputs.publicKey | string |
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
Name | Type |
---|---|
inputs | Object |
inputs.brokerId | string |
inputs.chainId | number |
inputs.registrationNonce | number |
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
Name | Type |
---|---|
inputs | Object |
inputs.brokerId | string |
inputs.chainId | number |
inputs.domain | SignatureDomain |
inputs.settlePnlNonce | string |
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
Defined in
packages/core/src/helper.ts:15
getMockSigner
▸ getMockSigner(secretKey?
): BaseSigner
Parameters
Name | Type |
---|---|
secretKey? | string |