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:1MessageFactor
Ƭ MessageFactor:Object
Type declaration
Defined in
packages/core/src/signer.ts:7SignedMessagePayload
Ƭ SignedMessagePayload:Object
Type declaration
Defined in
packages/core/src/signer.ts:15WalletAdapterOptions
Ƭ WalletAdapterOptions:Object
Type declaration
Defined in
packages/core/src/wallet/adapter.ts:75getWalletAdapterFunc
Ƭ getWalletAdapterFunc: (options: WalletAdapterOptions) => WalletAdapter
Type declaration
▸ (options): WalletAdapter
Parameters
Returns
WalletAdapter
Defined in
packages/core/src/wallet/adapter.ts:81Functions
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
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:82generateRegisterAccountMessage
▸ 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
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:43generateSettleMessage
▸ 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
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:127getDefaultSigner
▸ getDefaultSigner():BaseSigner
Returns
BaseSigner
Defined in
packages/core/src/helper.ts:15getMockSigner
▸ getMockSigner(secretKey?): BaseSigner
Parameters
Returns
BaseSigner