Orderly network core.utils
Orderly SDKs / Modules / @orderly.network/core / utils
Namespace: utils
@orderly.network/core.utils
Table of contents
Type Aliases
Functions
- base64url
- calculateStringHash
- formatByUnits
- getGlobalObject
- getTimestamp
- isHex
- isHexString
- parseAccountId
- parseBrokerHash
- parseTokenHash
- parseUnits
Type Aliases
SignatureDomain
Ƭ SignatureDomain: Object
Type declaration
Name | Type |
---|---|
chainId | number |
name | string |
verifyingContract | string |
version | string |
Defined in
Functions
base64url
▸ base64url(aStr
): string
Parameters
Name | Type |
---|---|
aStr | string |
Returns
string
Defined in
calculateStringHash
▸ calculateStringHash(input
): string
Parameters
Name | Type |
---|---|
input | string |
Returns
string
Defined in
formatByUnits
▸ formatByUnits(amount
, unit?
): string
Parameters
Name | Type | Default value |
---|---|---|
amount | string | undefined |
unit | number | "ether" | "gwei" | "ether" |
Returns
string
Defined in
getGlobalObject
▸ getGlobalObject(): typeof globalThis
Returns
typeof globalThis
Defined in
getTimestamp
▸ getTimestamp(): number
Returns
number
Defined in
isHex
▸ isHex(value
): boolean
Parameters
Name | Type |
---|---|
value | string |
Returns
boolean
Defined in
isHexString
▸ isHexString(value
): boolean
Parameters
Name | Type |
---|---|
value | string |
Returns
boolean
Defined in
parseAccountId
▸ parseAccountId(userAddress
, brokerId
): string
Parameters
Name | Type |
---|---|
userAddress | string |
brokerId | string |
Returns
string
Defined in
parseBrokerHash
▸ parseBrokerHash(brokerId
): string
Parameters
Name | Type |
---|---|
brokerId | string |
Returns
string
Defined in
parseTokenHash
▸ parseTokenHash(tokenSymbol
): string
Parameters
Name | Type |
---|---|
tokenSymbol | string |
Returns
string
Defined in
parseUnits
▸ parseUnits(value
, unit?
): bigint
Converts the //decimal string// %%value%% to a BigInt, assuming
%%unit%% decimal places. The %%unit%% may the number of decimal places
or the name of a unit (e.g. "gwei"
for 9 decimal places).
Parameters
Name | Type |
---|---|
value | string |
unit? | string | Numeric |
Returns
bigint
Defined in
node_modules/.pnpm/ethers@6.12.1/node_modules/ethers/lib.commonjs/utils/units.d.ts:14