@orderly.network/core 0.1.27 → 0.1.28
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 +20 -28
- package/dist/index.d.ts +20 -28
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
export { default as EventEmitter } from 'eventemitter3';
|
|
3
|
-
import { API, AccountStatusEnum } from '@orderly.network/types';
|
|
4
3
|
import { parseUnits, TransactionResponse, ethers } from 'ethers';
|
|
4
|
+
import { AccountStatusEnum } from '@orderly.network/types';
|
|
5
5
|
|
|
6
6
|
interface OrderlyKeyPair {
|
|
7
7
|
getPublicKey(): Promise<string>;
|
|
@@ -149,15 +149,11 @@ declare function parseAccountId(userAddress: string, brokerId: string): string;
|
|
|
149
149
|
declare function parseTokenHash(tokenSymbol: string): string;
|
|
150
150
|
declare function calculateStringHash(input: string): string;
|
|
151
151
|
declare function formatByUnits(amount: string, unit?: number | "ether" | "gwei"): string;
|
|
152
|
-
declare function isHex(value: string): boolean;
|
|
153
|
-
declare function isHexString(value: string): boolean;
|
|
154
152
|
|
|
155
153
|
type utils_SignatureDomain = SignatureDomain;
|
|
156
154
|
declare const utils_base64url: typeof base64url;
|
|
157
155
|
declare const utils_calculateStringHash: typeof calculateStringHash;
|
|
158
156
|
declare const utils_formatByUnits: typeof formatByUnits;
|
|
159
|
-
declare const utils_isHex: typeof isHex;
|
|
160
|
-
declare const utils_isHexString: typeof isHexString;
|
|
161
157
|
declare const utils_parseAccountId: typeof parseAccountId;
|
|
162
158
|
declare const utils_parseBrokerHash: typeof parseBrokerHash;
|
|
163
159
|
declare const utils_parseTokenHash: typeof parseTokenHash;
|
|
@@ -168,8 +164,6 @@ declare namespace utils {
|
|
|
168
164
|
utils_base64url as base64url,
|
|
169
165
|
utils_calculateStringHash as calculateStringHash,
|
|
170
166
|
utils_formatByUnits as formatByUnits,
|
|
171
|
-
utils_isHex as isHex,
|
|
172
|
-
utils_isHexString as isHexString,
|
|
173
167
|
utils_parseAccountId as parseAccountId,
|
|
174
168
|
utils_parseBrokerHash as parseBrokerHash,
|
|
175
169
|
utils_parseTokenHash as parseTokenHash,
|
|
@@ -271,6 +265,21 @@ declare class BaseContract implements IContract {
|
|
|
271
265
|
type: string;
|
|
272
266
|
stateMutability?: undefined;
|
|
273
267
|
outputs?: undefined;
|
|
268
|
+
} | {
|
|
269
|
+
inputs: {
|
|
270
|
+
internalType: string;
|
|
271
|
+
name: string;
|
|
272
|
+
type: string;
|
|
273
|
+
}[];
|
|
274
|
+
name: string;
|
|
275
|
+
outputs: {
|
|
276
|
+
internalType: string;
|
|
277
|
+
name: string;
|
|
278
|
+
type: string;
|
|
279
|
+
}[];
|
|
280
|
+
stateMutability: string;
|
|
281
|
+
type: string;
|
|
282
|
+
anonymous?: undefined;
|
|
274
283
|
} | {
|
|
275
284
|
inputs: ({
|
|
276
285
|
internalType: string;
|
|
@@ -288,11 +297,7 @@ declare class BaseContract implements IContract {
|
|
|
288
297
|
type: string;
|
|
289
298
|
})[];
|
|
290
299
|
name: string;
|
|
291
|
-
outputs:
|
|
292
|
-
internalType: string;
|
|
293
|
-
name: string;
|
|
294
|
-
type: string;
|
|
295
|
-
}[];
|
|
300
|
+
outputs: never[];
|
|
296
301
|
stateMutability: string;
|
|
297
302
|
type: string;
|
|
298
303
|
anonymous?: undefined;
|
|
@@ -372,9 +377,6 @@ interface IWalletAdapter {
|
|
|
372
377
|
call(address: string, method: string, params: any, options: {
|
|
373
378
|
abi: any;
|
|
374
379
|
}): Promise<any>;
|
|
375
|
-
callOnChain(chain: API.NetworkInfos, address: string, method: string, params: any, options: {
|
|
376
|
-
abi: any;
|
|
377
|
-
}): Promise<any>;
|
|
378
380
|
on(eventName: any, listener: any): void;
|
|
379
381
|
off(eventName: any, listener: any): void;
|
|
380
382
|
}
|
|
@@ -382,7 +384,7 @@ declare type WalletAdapterOptions = {
|
|
|
382
384
|
provider: any;
|
|
383
385
|
address: string;
|
|
384
386
|
chain: {
|
|
385
|
-
id:
|
|
387
|
+
id: string;
|
|
386
388
|
};
|
|
387
389
|
};
|
|
388
390
|
declare type getWalletAdapterFunc = (options: WalletAdapterOptions) => IWalletAdapter;
|
|
@@ -414,14 +416,7 @@ declare class Assets {
|
|
|
414
416
|
address: string;
|
|
415
417
|
}): Promise<any>;
|
|
416
418
|
private _approve;
|
|
417
|
-
|
|
418
|
-
accountId: string | undefined;
|
|
419
|
-
brokerHash: string;
|
|
420
|
-
tokenHash: string;
|
|
421
|
-
tokenAmount: string;
|
|
422
|
-
};
|
|
423
|
-
getDepositFee(amount: string, chain: API.NetworkInfos): Promise<any>;
|
|
424
|
-
deposit(amount: string, fee?: bigint): Promise<ethers.TransactionResponse>;
|
|
419
|
+
deposit(amount: string): Promise<ethers.TransactionResponse>;
|
|
425
420
|
private _simpleFetch;
|
|
426
421
|
get usdcAddress(): string;
|
|
427
422
|
}
|
|
@@ -469,7 +464,7 @@ declare class Account {
|
|
|
469
464
|
setAddress(address: string, wallet?: {
|
|
470
465
|
provider: any;
|
|
471
466
|
chain: {
|
|
472
|
-
id: string
|
|
467
|
+
id: string;
|
|
473
468
|
};
|
|
474
469
|
wallet?: {
|
|
475
470
|
name: string;
|
|
@@ -527,9 +522,6 @@ declare class EtherAdapter implements IWalletAdapter {
|
|
|
527
522
|
call(address: string, method: string, params: any[], options: {
|
|
528
523
|
abi: any;
|
|
529
524
|
}): Promise<any>;
|
|
530
|
-
callOnChain(chain: API.NetworkInfos, address: string, method: string, params: any[], options: {
|
|
531
|
-
abi: any;
|
|
532
|
-
}): Promise<any>;
|
|
533
525
|
get chainId(): number;
|
|
534
526
|
get addresses(): string;
|
|
535
527
|
send(method: string, params: Array<any> | Record<string, any>): Promise<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
2
|
export { default as EventEmitter } from 'eventemitter3';
|
|
3
|
-
import { API, AccountStatusEnum } from '@orderly.network/types';
|
|
4
3
|
import { parseUnits, TransactionResponse, ethers } from 'ethers';
|
|
4
|
+
import { AccountStatusEnum } from '@orderly.network/types';
|
|
5
5
|
|
|
6
6
|
interface OrderlyKeyPair {
|
|
7
7
|
getPublicKey(): Promise<string>;
|
|
@@ -149,15 +149,11 @@ declare function parseAccountId(userAddress: string, brokerId: string): string;
|
|
|
149
149
|
declare function parseTokenHash(tokenSymbol: string): string;
|
|
150
150
|
declare function calculateStringHash(input: string): string;
|
|
151
151
|
declare function formatByUnits(amount: string, unit?: number | "ether" | "gwei"): string;
|
|
152
|
-
declare function isHex(value: string): boolean;
|
|
153
|
-
declare function isHexString(value: string): boolean;
|
|
154
152
|
|
|
155
153
|
type utils_SignatureDomain = SignatureDomain;
|
|
156
154
|
declare const utils_base64url: typeof base64url;
|
|
157
155
|
declare const utils_calculateStringHash: typeof calculateStringHash;
|
|
158
156
|
declare const utils_formatByUnits: typeof formatByUnits;
|
|
159
|
-
declare const utils_isHex: typeof isHex;
|
|
160
|
-
declare const utils_isHexString: typeof isHexString;
|
|
161
157
|
declare const utils_parseAccountId: typeof parseAccountId;
|
|
162
158
|
declare const utils_parseBrokerHash: typeof parseBrokerHash;
|
|
163
159
|
declare const utils_parseTokenHash: typeof parseTokenHash;
|
|
@@ -168,8 +164,6 @@ declare namespace utils {
|
|
|
168
164
|
utils_base64url as base64url,
|
|
169
165
|
utils_calculateStringHash as calculateStringHash,
|
|
170
166
|
utils_formatByUnits as formatByUnits,
|
|
171
|
-
utils_isHex as isHex,
|
|
172
|
-
utils_isHexString as isHexString,
|
|
173
167
|
utils_parseAccountId as parseAccountId,
|
|
174
168
|
utils_parseBrokerHash as parseBrokerHash,
|
|
175
169
|
utils_parseTokenHash as parseTokenHash,
|
|
@@ -271,6 +265,21 @@ declare class BaseContract implements IContract {
|
|
|
271
265
|
type: string;
|
|
272
266
|
stateMutability?: undefined;
|
|
273
267
|
outputs?: undefined;
|
|
268
|
+
} | {
|
|
269
|
+
inputs: {
|
|
270
|
+
internalType: string;
|
|
271
|
+
name: string;
|
|
272
|
+
type: string;
|
|
273
|
+
}[];
|
|
274
|
+
name: string;
|
|
275
|
+
outputs: {
|
|
276
|
+
internalType: string;
|
|
277
|
+
name: string;
|
|
278
|
+
type: string;
|
|
279
|
+
}[];
|
|
280
|
+
stateMutability: string;
|
|
281
|
+
type: string;
|
|
282
|
+
anonymous?: undefined;
|
|
274
283
|
} | {
|
|
275
284
|
inputs: ({
|
|
276
285
|
internalType: string;
|
|
@@ -288,11 +297,7 @@ declare class BaseContract implements IContract {
|
|
|
288
297
|
type: string;
|
|
289
298
|
})[];
|
|
290
299
|
name: string;
|
|
291
|
-
outputs:
|
|
292
|
-
internalType: string;
|
|
293
|
-
name: string;
|
|
294
|
-
type: string;
|
|
295
|
-
}[];
|
|
300
|
+
outputs: never[];
|
|
296
301
|
stateMutability: string;
|
|
297
302
|
type: string;
|
|
298
303
|
anonymous?: undefined;
|
|
@@ -372,9 +377,6 @@ interface IWalletAdapter {
|
|
|
372
377
|
call(address: string, method: string, params: any, options: {
|
|
373
378
|
abi: any;
|
|
374
379
|
}): Promise<any>;
|
|
375
|
-
callOnChain(chain: API.NetworkInfos, address: string, method: string, params: any, options: {
|
|
376
|
-
abi: any;
|
|
377
|
-
}): Promise<any>;
|
|
378
380
|
on(eventName: any, listener: any): void;
|
|
379
381
|
off(eventName: any, listener: any): void;
|
|
380
382
|
}
|
|
@@ -382,7 +384,7 @@ declare type WalletAdapterOptions = {
|
|
|
382
384
|
provider: any;
|
|
383
385
|
address: string;
|
|
384
386
|
chain: {
|
|
385
|
-
id:
|
|
387
|
+
id: string;
|
|
386
388
|
};
|
|
387
389
|
};
|
|
388
390
|
declare type getWalletAdapterFunc = (options: WalletAdapterOptions) => IWalletAdapter;
|
|
@@ -414,14 +416,7 @@ declare class Assets {
|
|
|
414
416
|
address: string;
|
|
415
417
|
}): Promise<any>;
|
|
416
418
|
private _approve;
|
|
417
|
-
|
|
418
|
-
accountId: string | undefined;
|
|
419
|
-
brokerHash: string;
|
|
420
|
-
tokenHash: string;
|
|
421
|
-
tokenAmount: string;
|
|
422
|
-
};
|
|
423
|
-
getDepositFee(amount: string, chain: API.NetworkInfos): Promise<any>;
|
|
424
|
-
deposit(amount: string, fee?: bigint): Promise<ethers.TransactionResponse>;
|
|
419
|
+
deposit(amount: string): Promise<ethers.TransactionResponse>;
|
|
425
420
|
private _simpleFetch;
|
|
426
421
|
get usdcAddress(): string;
|
|
427
422
|
}
|
|
@@ -469,7 +464,7 @@ declare class Account {
|
|
|
469
464
|
setAddress(address: string, wallet?: {
|
|
470
465
|
provider: any;
|
|
471
466
|
chain: {
|
|
472
|
-
id: string
|
|
467
|
+
id: string;
|
|
473
468
|
};
|
|
474
469
|
wallet?: {
|
|
475
470
|
name: string;
|
|
@@ -527,9 +522,6 @@ declare class EtherAdapter implements IWalletAdapter {
|
|
|
527
522
|
call(address: string, method: string, params: any[], options: {
|
|
528
523
|
abi: any;
|
|
529
524
|
}): Promise<any>;
|
|
530
|
-
callOnChain(chain: API.NetworkInfos, address: string, method: string, params: any[], options: {
|
|
531
|
-
abi: any;
|
|
532
|
-
}): Promise<any>;
|
|
533
525
|
get chainId(): number;
|
|
534
526
|
get addresses(): string;
|
|
535
527
|
send(method: string, params: Array<any> | Record<string, any>): Promise<any>;
|