@orderly.network/core 0.2.4-alpha.9 → 0.2.4-experimental.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -87,11 +87,11 @@ type SignedMessagePayload = {
87
87
  * ```ts
88
88
  * const signer = new BaseSigner(keyStore);
89
89
  * const payload = await signer.sign({
90
- * url: "https://api.orderly.io/get_account?address=0x1234567890&brokerId=woofi_dex",
90
+ * url: "https://api.orderly.io/get_account?address=0x1234567890&brokerId=orderly",
91
91
  * method: "GET",
92
92
  * data: {
93
93
  * address: "0x1234567890",
94
- * brokerId: "woofi_pro",
94
+ * brokerId: "orderly",
95
95
  * },
96
96
  * });
97
97
  * ```
@@ -113,30 +113,6 @@ declare class BaseSigner implements Signer {
113
113
  }>;
114
114
  }
115
115
 
116
- type ConfigKey = "apiBaseUrl" | "klineDataUrl" | "privateWsUrl" | "publicWsUrl" | "operatorUrl" | "swapSupportApiUrl" | "domain" | "brokerId" | "networkId" | "env" | "PROD_URL" | "markets";
117
- interface ConfigStore {
118
- get<T>(key: ConfigKey): T;
119
- getOr<T>(key: ConfigKey, defaultValue: T): T;
120
- set<T>(key: ConfigKey, value: T): void;
121
- clear(): void;
122
- }
123
- declare class MemoryConfigStore implements ConfigStore {
124
- protected map: Map<ConfigKey, any>;
125
- constructor(init?: any);
126
- protected _restore(init?: Record<ConfigKey, any>): void;
127
- get<T>(key: ConfigKey): T;
128
- getOr<T>(key: ConfigKey, defaultValue: T): T;
129
- set<T>(key: ConfigKey, value: T): void;
130
- clear(): void;
131
- }
132
- /**
133
- *
134
- */
135
- declare class BaseConfigStore extends MemoryConfigStore {
136
- private readonly configMap;
137
- constructor(configMap: Record<string, any>);
138
- }
139
-
140
116
  type SignatureDomain = {
141
117
  name: string;
142
118
  version: string;
@@ -410,9 +386,16 @@ declare function generateSettleMessage(inputs: {
410
386
  };
411
387
  }];
412
388
 
389
+ type ConfigKey = "apiBaseUrl" | "klineDataUrl" | "privateWsUrl" | "publicWsUrl" | "operatorUrl" | "domain" | "brokerId" | "networkId" | "env" | "PROD_URL" | "markets";
390
+ interface ConfigStore {
391
+ get<T>(key: ConfigKey): T;
392
+ getOr<T>(key: ConfigKey, defaultValue: T): T;
393
+ set<T>(key: ConfigKey, value: T): void;
394
+ clear(): void;
395
+ }
396
+
413
397
  /**
414
398
  * Orderly contracts information
415
- * https://wootraders.atlassian.net/wiki/spaces/ORDER/pages/343441906/Orderly+V2+Contract+Information+Board
416
399
  */
417
400
  type OrderlyContracts = {
418
401
  usdcAddress: string;
@@ -601,7 +584,9 @@ interface IWalletAdapter {
601
584
  }, options: {
602
585
  abi: any;
603
586
  }): Promise<TransactionResponse>;
587
+ getTransactionRecipect: (txHash: string) => Promise<any>;
604
588
  signTypedData: (address: string, data: any) => Promise<string>;
589
+ pollTransactionReceiptWithBackoff: (txHash: string, baseInterval?: number, maxInterval?: number, maxRetries?: number) => Promise<any>;
605
590
  getBalance: (userAddress: string) => Promise<any>;
606
591
  call(address: string, method: string, params: any, options: {
607
592
  abi: any;
@@ -778,6 +763,8 @@ declare class EtherAdapter implements IWalletAdapter {
778
763
  }, options: {
779
764
  abi: any;
780
765
  }): Promise<ethers.TransactionResponse>;
766
+ getTransactionRecipect(txHash: string): Promise<void>;
767
+ pollTransactionReceiptWithBackoff(txHash: string, baseInterval?: number, maxInterval?: number, maxRetries?: number): Promise<ethers.TransactionReceipt>;
781
768
  private estimateGas;
782
769
  signTypedData(address: string, data: any): Promise<any>;
783
770
  verify(data: {
@@ -790,4 +777,4 @@ declare class EtherAdapter implements IWalletAdapter {
790
777
  getContract(address: string, abi: any): ethers.Contract;
791
778
  }
792
779
 
793
- export { Account, AccountState, BaseConfigStore, BaseContract as BaseContractManager, BaseKeyStore, BaseOrderlyKeyPair, BaseSigner, ConfigKey, ConfigStore, DefaultConfigStore, EtherAdapter, IContract, LocalStorageStore, MemoryConfigStore, MessageFactor, MockKeyStore, OrderlyKeyPair, OrderlyKeyStore, SignedMessagePayload, Signer, SimpleDI, IWalletAdapter as WalletAdapter, WalletAdapterOptions, generateAddOrderlyKeyMessage, generateRegisterAccountMessage, generateSettleMessage, getDefaultSigner, getMockSigner, getWalletAdapterFunc, utils };
780
+ export { Account, AccountState, BaseContract as BaseContractManager, BaseKeyStore, BaseOrderlyKeyPair, BaseSigner, ConfigKey, ConfigStore, DefaultConfigStore, EtherAdapter, IContract, LocalStorageStore, MessageFactor, MockKeyStore, OrderlyKeyPair, OrderlyKeyStore, SignedMessagePayload, Signer, SimpleDI, IWalletAdapter as WalletAdapter, WalletAdapterOptions, generateAddOrderlyKeyMessage, generateRegisterAccountMessage, generateSettleMessage, getDefaultSigner, getMockSigner, getWalletAdapterFunc, utils };
package/dist/index.d.ts CHANGED
@@ -87,11 +87,11 @@ type SignedMessagePayload = {
87
87
  * ```ts
88
88
  * const signer = new BaseSigner(keyStore);
89
89
  * const payload = await signer.sign({
90
- * url: "https://api.orderly.io/get_account?address=0x1234567890&brokerId=woofi_dex",
90
+ * url: "https://api.orderly.io/get_account?address=0x1234567890&brokerId=orderly",
91
91
  * method: "GET",
92
92
  * data: {
93
93
  * address: "0x1234567890",
94
- * brokerId: "woofi_pro",
94
+ * brokerId: "orderly",
95
95
  * },
96
96
  * });
97
97
  * ```
@@ -113,30 +113,6 @@ declare class BaseSigner implements Signer {
113
113
  }>;
114
114
  }
115
115
 
116
- type ConfigKey = "apiBaseUrl" | "klineDataUrl" | "privateWsUrl" | "publicWsUrl" | "operatorUrl" | "swapSupportApiUrl" | "domain" | "brokerId" | "networkId" | "env" | "PROD_URL" | "markets";
117
- interface ConfigStore {
118
- get<T>(key: ConfigKey): T;
119
- getOr<T>(key: ConfigKey, defaultValue: T): T;
120
- set<T>(key: ConfigKey, value: T): void;
121
- clear(): void;
122
- }
123
- declare class MemoryConfigStore implements ConfigStore {
124
- protected map: Map<ConfigKey, any>;
125
- constructor(init?: any);
126
- protected _restore(init?: Record<ConfigKey, any>): void;
127
- get<T>(key: ConfigKey): T;
128
- getOr<T>(key: ConfigKey, defaultValue: T): T;
129
- set<T>(key: ConfigKey, value: T): void;
130
- clear(): void;
131
- }
132
- /**
133
- *
134
- */
135
- declare class BaseConfigStore extends MemoryConfigStore {
136
- private readonly configMap;
137
- constructor(configMap: Record<string, any>);
138
- }
139
-
140
116
  type SignatureDomain = {
141
117
  name: string;
142
118
  version: string;
@@ -410,9 +386,16 @@ declare function generateSettleMessage(inputs: {
410
386
  };
411
387
  }];
412
388
 
389
+ type ConfigKey = "apiBaseUrl" | "klineDataUrl" | "privateWsUrl" | "publicWsUrl" | "operatorUrl" | "domain" | "brokerId" | "networkId" | "env" | "PROD_URL" | "markets";
390
+ interface ConfigStore {
391
+ get<T>(key: ConfigKey): T;
392
+ getOr<T>(key: ConfigKey, defaultValue: T): T;
393
+ set<T>(key: ConfigKey, value: T): void;
394
+ clear(): void;
395
+ }
396
+
413
397
  /**
414
398
  * Orderly contracts information
415
- * https://wootraders.atlassian.net/wiki/spaces/ORDER/pages/343441906/Orderly+V2+Contract+Information+Board
416
399
  */
417
400
  type OrderlyContracts = {
418
401
  usdcAddress: string;
@@ -601,7 +584,9 @@ interface IWalletAdapter {
601
584
  }, options: {
602
585
  abi: any;
603
586
  }): Promise<TransactionResponse>;
587
+ getTransactionRecipect: (txHash: string) => Promise<any>;
604
588
  signTypedData: (address: string, data: any) => Promise<string>;
589
+ pollTransactionReceiptWithBackoff: (txHash: string, baseInterval?: number, maxInterval?: number, maxRetries?: number) => Promise<any>;
605
590
  getBalance: (userAddress: string) => Promise<any>;
606
591
  call(address: string, method: string, params: any, options: {
607
592
  abi: any;
@@ -778,6 +763,8 @@ declare class EtherAdapter implements IWalletAdapter {
778
763
  }, options: {
779
764
  abi: any;
780
765
  }): Promise<ethers.TransactionResponse>;
766
+ getTransactionRecipect(txHash: string): Promise<void>;
767
+ pollTransactionReceiptWithBackoff(txHash: string, baseInterval?: number, maxInterval?: number, maxRetries?: number): Promise<ethers.TransactionReceipt>;
781
768
  private estimateGas;
782
769
  signTypedData(address: string, data: any): Promise<any>;
783
770
  verify(data: {
@@ -790,4 +777,4 @@ declare class EtherAdapter implements IWalletAdapter {
790
777
  getContract(address: string, abi: any): ethers.Contract;
791
778
  }
792
779
 
793
- export { Account, AccountState, BaseConfigStore, BaseContract as BaseContractManager, BaseKeyStore, BaseOrderlyKeyPair, BaseSigner, ConfigKey, ConfigStore, DefaultConfigStore, EtherAdapter, IContract, LocalStorageStore, MemoryConfigStore, MessageFactor, MockKeyStore, OrderlyKeyPair, OrderlyKeyStore, SignedMessagePayload, Signer, SimpleDI, IWalletAdapter as WalletAdapter, WalletAdapterOptions, generateAddOrderlyKeyMessage, generateRegisterAccountMessage, generateSettleMessage, getDefaultSigner, getMockSigner, getWalletAdapterFunc, utils };
780
+ export { Account, AccountState, BaseContract as BaseContractManager, BaseKeyStore, BaseOrderlyKeyPair, BaseSigner, ConfigKey, ConfigStore, DefaultConfigStore, EtherAdapter, IContract, LocalStorageStore, MessageFactor, MockKeyStore, OrderlyKeyPair, OrderlyKeyStore, SignedMessagePayload, Signer, SimpleDI, IWalletAdapter as WalletAdapter, WalletAdapterOptions, generateAddOrderlyKeyMessage, generateRegisterAccountMessage, generateSettleMessage, getDefaultSigner, getMockSigner, getWalletAdapterFunc, utils };