@dydxprotocol/v4-client-js 1.1.12 → 1.1.14
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/.eslintrc.js +3 -5
- package/.prettierignore +3 -0
- package/.prettierrc.json +6 -0
- package/.telescope.json +2 -4
- package/.vscode/launch.json +10 -10
- package/README.md +3 -1
- package/__native__/__ios__/v4-native-client.js +2648 -806
- package/__tests__/helpers/constants.ts +10 -8
- package/__tests__/lib/helpers.test.ts +22 -23
- package/__tests__/lib/util.test.ts +2 -8
- package/__tests__/lib/validation.test.ts +23 -26
- package/__tests__/modules/client/Transfers.test.ts +4 -19
- package/__tests__/modules/client/ValidatorPostEndpoints.test.ts +2 -5
- package/__tests__/modules/client/constants.ts +4 -2
- package/__tests__/modules/onboarding.test.ts +9 -7
- package/build/__tests__/helpers/constants.js +7 -7
- package/build/__tests__/lib/helpers.test.js +2 -6
- package/build/__tests__/lib/util.test.js +1 -1
- package/build/__tests__/lib/validation.test.js +3 -11
- package/build/__tests__/modules/client/Transfers.test.js +1 -1
- package/build/__tests__/modules/client/ValidatorPostEndpoints.test.js +2 -2
- package/build/__tests__/modules/client/constants.js +1 -1
- package/build/__tests__/modules/onboarding.test.js +2 -3
- package/build/examples/account_endpoints.js +4 -3
- package/build/examples/composite_example.js +5 -4
- package/build/examples/constants.js +1 -1
- package/build/examples/faucet_endpoint.js +4 -3
- package/build/examples/long_term_order_cancel_example.js +4 -3
- package/build/examples/markets_endpoints.js +4 -3
- package/build/examples/native_examples.js +4 -3
- package/build/examples/noble_example.js +1 -1
- package/build/examples/optimal_node.js +4 -12
- package/build/examples/short_term_order_cancel_example.js +4 -3
- package/build/examples/short_term_order_composite_example.js +4 -3
- package/build/examples/test.js +5 -4
- package/build/examples/transfer_example_deposit.js +4 -3
- package/build/examples/transfer_example_send.js +1 -1
- package/build/examples/transfer_example_subaccount_transfer.js +4 -3
- package/build/examples/transfer_example_withdraw.js +4 -3
- package/build/examples/transfer_example_withdraw_other.js +1 -1
- package/build/examples/utility_endpoints.js +4 -3
- package/build/examples/validator_get_example.js +15 -9
- package/build/examples/validator_post_example.js +4 -3
- package/build/examples/wallet_address.js +5 -4
- package/build/examples/websocket_example.js +1 -1
- package/build/src/clients/composite-client.d.ts +225 -224
- package/build/src/clients/composite-client.js +242 -237
- package/build/src/clients/constants.d.ts +3 -0
- package/build/src/clients/constants.js +6 -2
- package/build/src/clients/faucet-client.d.ts +4 -4
- package/build/src/clients/faucet-client.js +5 -5
- package/build/src/clients/helpers/chain-helpers.js +1 -1
- package/build/src/clients/helpers/request-helpers.js +5 -4
- package/build/src/clients/indexer-client.js +1 -1
- package/build/src/clients/lib/axios/axiosRequest.js +1 -1
- package/build/src/clients/lib/axios/errors.js +1 -1
- package/build/src/clients/lib/cctpProto.d.ts +2 -2
- package/build/src/clients/lib/cctpProto.js +287 -237
- package/build/src/clients/lib/errors.js +1 -1
- package/build/src/clients/modules/account.js +1 -1
- package/build/src/clients/modules/composer.d.ts +4 -0
- package/build/src/clients/modules/composer.js +39 -3
- package/build/src/clients/modules/get.d.ts +10 -3
- package/build/src/clients/modules/get.js +41 -54
- package/build/src/clients/modules/local-wallet.js +1 -1
- package/build/src/clients/modules/post.d.ts +3 -0
- package/build/src/clients/modules/post.js +34 -18
- package/build/src/clients/modules/proto-includes.d.ts +1 -0
- package/build/src/clients/modules/proto-includes.js +3 -2
- package/build/src/clients/modules/rest.js +1 -1
- package/build/src/clients/modules/signer.js +1 -1
- package/build/src/clients/modules/tendermintClient.d.ts +5 -5
- package/build/src/clients/modules/tendermintClient.js +6 -6
- package/build/src/clients/native.js +4 -7
- package/build/src/clients/noble-client.js +1 -1
- package/build/src/clients/socket-client.js +1 -1
- package/build/src/clients/subaccount.js +1 -1
- package/build/src/clients/types.d.ts +1 -1
- package/build/src/clients/types.js +1 -1
- package/build/src/clients/validator-client.d.ts +12 -12
- package/build/src/clients/validator-client.js +13 -13
- package/build/src/lib/errors.js +1 -1
- package/build/src/lib/onboarding.js +1 -1
- package/build/src/lib/utils.js +3 -3
- package/build/src/lib/validation.js +5 -4
- package/build/src/network_optimizer.js +10 -11
- package/build/src/types.d.ts +1 -1
- package/build/src/types.js +1 -1
- package/examples/account_endpoints.ts +5 -4
- package/examples/composite_example.ts +12 -7
- package/examples/constants.ts +10 -4
- package/examples/faucet_endpoint.ts +5 -4
- package/examples/human_readable_orders.json +85 -85
- package/examples/human_readable_short_term_orders.json +41 -41
- package/examples/long_term_order_cancel_example.ts +11 -6
- package/examples/markets_endpoints.ts +5 -4
- package/examples/native_examples.ts +8 -7
- package/examples/noble_example.ts +11 -23
- package/examples/optimal_node.ts +4 -14
- package/examples/raw_orders.json +128 -128
- package/examples/short_term_order_cancel_example.ts +7 -8
- package/examples/short_term_order_composite_example.ts +7 -8
- package/examples/test.ts +12 -7
- package/examples/transfer_example_deposit.ts +6 -9
- package/examples/transfer_example_send.ts +2 -10
- package/examples/transfer_example_subaccount_transfer.ts +6 -11
- package/examples/transfer_example_withdraw.ts +6 -9
- package/examples/transfer_example_withdraw_other.ts +1 -5
- package/examples/utility_endpoints.ts +5 -4
- package/examples/validator_get_example.ts +19 -10
- package/examples/validator_post_example.ts +7 -9
- package/examples/wallet_address.ts +6 -5
- package/examples/websocket_example.ts +5 -1
- package/package.json +4 -1
- package/src/clients/composite-client.ts +279 -330
- package/src/clients/constants.ts +38 -26
- package/src/clients/faucet-client.ts +5 -8
- package/src/clients/helpers/chain-helpers.ts +10 -6
- package/src/clients/helpers/request-helpers.ts +6 -5
- package/src/clients/indexer-client.ts +34 -34
- package/src/clients/lib/axios/axiosRequest.ts +4 -7
- package/src/clients/lib/axios/errors.ts +16 -21
- package/src/clients/lib/cctpProto.ts +655 -387
- package/src/clients/lib/errors.ts +8 -17
- package/src/clients/modules/account.ts +4 -12
- package/src/clients/modules/composer.ts +61 -20
- package/src/clients/modules/get.ts +71 -89
- package/src/clients/modules/local-wallet.ts +41 -56
- package/src/clients/modules/post.ts +664 -634
- package/src/clients/modules/proto-includes.ts +1 -0
- package/src/clients/modules/rest.ts +23 -26
- package/src/clients/modules/signer.ts +8 -22
- package/src/clients/modules/tendermintClient.ts +13 -36
- package/src/clients/native.ts +73 -139
- package/src/clients/noble-client.ts +1 -5
- package/src/clients/socket-client.ts +216 -216
- package/src/clients/subaccount.ts +16 -16
- package/src/clients/types.ts +14 -10
- package/src/clients/validator-client.ts +14 -16
- package/src/codegen/helpers.ts +149 -150
- package/src/codegen/index.ts +4 -5
- package/src/lib/errors.ts +3 -9
- package/src/lib/onboarding.ts +7 -2
- package/src/lib/utils.ts +5 -12
- package/src/lib/validation.ts +21 -19
- package/src/network_optimizer.ts +78 -65
- package/src/types.ts +5 -6
- package/tasks.json +15 -15
- package/tsconfig.eslint.json +1 -4
- package/tsconfig.json +2 -6
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { EncodeObject } from '@cosmjs/proto-signing';
|
|
2
|
+
import { Account, GasPrice, IndexedTx, StdFee } from '@cosmjs/stargate';
|
|
3
|
+
import { Method } from '@cosmjs/tendermint-rpc';
|
|
2
4
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
5
|
+
BroadcastTxAsyncResponse,
|
|
6
|
+
BroadcastTxSyncResponse,
|
|
7
|
+
} from '@cosmjs/tendermint-rpc/build/tendermint37';
|
|
8
|
+
import {
|
|
9
|
+
Order_ConditionType,
|
|
10
|
+
Order_TimeInForce,
|
|
11
|
+
} from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/order';
|
|
7
12
|
import { parseUnits } from 'ethers';
|
|
8
13
|
import Long from 'long';
|
|
9
14
|
import protobuf from 'protobufjs';
|
|
@@ -35,6 +40,7 @@ import { UserError } from './lib/errors';
|
|
|
35
40
|
import { generateRegistry } from './lib/registry';
|
|
36
41
|
import LocalWallet from './modules/local-wallet';
|
|
37
42
|
import { SubaccountInfo } from './subaccount';
|
|
43
|
+
import { BroadcastMode } from './types';
|
|
38
44
|
import { ValidatorClient } from './validator-client';
|
|
39
45
|
|
|
40
46
|
// Required for encoding and decoding queries that are of type Long.
|
|
@@ -64,15 +70,9 @@ export class CompositeClient {
|
|
|
64
70
|
return client;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
private constructor(
|
|
68
|
-
network: Network,
|
|
69
|
-
apiTimeout?: number,
|
|
70
|
-
) {
|
|
73
|
+
private constructor(network: Network, apiTimeout?: number) {
|
|
71
74
|
this.network = network;
|
|
72
|
-
this._indexerClient = new IndexerClient(
|
|
73
|
-
network.indexerConfig,
|
|
74
|
-
apiTimeout,
|
|
75
|
-
);
|
|
75
|
+
this._indexerClient = new IndexerClient(network.indexerConfig, apiTimeout);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
private async initialize(): Promise<void> {
|
|
@@ -104,13 +104,13 @@ export class CompositeClient {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
* @description Sign a list of messages with a wallet.
|
|
108
|
+
* the calling function is responsible for creating the messages.
|
|
109
|
+
*
|
|
110
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
111
|
+
* at any point.
|
|
112
|
+
* @returns The Signature.
|
|
113
|
+
*/
|
|
114
114
|
async sign(
|
|
115
115
|
wallet: LocalWallet,
|
|
116
116
|
messaging: () => Promise<EncodeObject[]>,
|
|
@@ -119,30 +119,24 @@ export class CompositeClient {
|
|
|
119
119
|
memo?: string,
|
|
120
120
|
account?: () => Promise<Account>,
|
|
121
121
|
): Promise<Uint8Array> {
|
|
122
|
-
return this.validatorClient.post.sign(
|
|
123
|
-
wallet,
|
|
124
|
-
messaging,
|
|
125
|
-
zeroFee,
|
|
126
|
-
gasPrice,
|
|
127
|
-
memo,
|
|
128
|
-
account,
|
|
129
|
-
);
|
|
122
|
+
return this.validatorClient.post.sign(wallet, messaging, zeroFee, gasPrice, memo, account);
|
|
130
123
|
}
|
|
131
124
|
|
|
132
125
|
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
* @description Send a list of messages with a wallet.
|
|
127
|
+
* the calling function is responsible for creating the messages.
|
|
128
|
+
*
|
|
129
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
130
|
+
* at any point.
|
|
131
|
+
* @returns The Transaction Hash.
|
|
132
|
+
*/
|
|
140
133
|
async send(
|
|
141
134
|
wallet: LocalWallet,
|
|
142
135
|
messaging: () => Promise<EncodeObject[]>,
|
|
143
136
|
zeroFee: boolean,
|
|
144
137
|
gasPrice?: GasPrice,
|
|
145
138
|
memo?: string,
|
|
139
|
+
broadcastMode?: BroadcastMode,
|
|
146
140
|
account?: () => Promise<Account>,
|
|
147
141
|
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
148
142
|
return this.validatorClient.post.send(
|
|
@@ -151,20 +145,20 @@ export class CompositeClient {
|
|
|
151
145
|
zeroFee,
|
|
152
146
|
gasPrice,
|
|
153
147
|
memo,
|
|
154
|
-
|
|
148
|
+
broadcastMode,
|
|
155
149
|
account,
|
|
156
150
|
);
|
|
157
151
|
}
|
|
158
152
|
|
|
159
153
|
/**
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
* @description Send a signed transaction.
|
|
155
|
+
*
|
|
156
|
+
* @param signedTransaction The signed transaction to send.
|
|
157
|
+
*
|
|
158
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
159
|
+
* at any point.
|
|
160
|
+
* @returns The Transaction Hash.
|
|
161
|
+
*/
|
|
168
162
|
async sendSignedTransaction(
|
|
169
163
|
signedTransaction: Uint8Array,
|
|
170
164
|
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
@@ -172,18 +166,18 @@ export class CompositeClient {
|
|
|
172
166
|
}
|
|
173
167
|
|
|
174
168
|
/**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
169
|
+
* @description Simulate a list of messages with a wallet.
|
|
170
|
+
* the calling function is responsible for creating the messages.
|
|
171
|
+
*
|
|
172
|
+
* To send multiple messages with gas estimate:
|
|
173
|
+
* 1. Client is responsible for creating the messages.
|
|
174
|
+
* 2. Call simulate() to get the gas estimate.
|
|
175
|
+
* 3. Call send() to send the messages.
|
|
176
|
+
*
|
|
177
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
178
|
+
* at any point.
|
|
179
|
+
* @returns The gas estimate.
|
|
180
|
+
*/
|
|
187
181
|
async simulate(
|
|
188
182
|
wallet: LocalWallet,
|
|
189
183
|
messaging: () => Promise<EncodeObject[]>,
|
|
@@ -191,22 +185,16 @@ export class CompositeClient {
|
|
|
191
185
|
memo?: string,
|
|
192
186
|
account?: () => Promise<Account>,
|
|
193
187
|
): Promise<StdFee> {
|
|
194
|
-
return this.validatorClient.post.simulate(
|
|
195
|
-
wallet,
|
|
196
|
-
messaging,
|
|
197
|
-
gasPrice,
|
|
198
|
-
memo,
|
|
199
|
-
account,
|
|
200
|
-
);
|
|
188
|
+
return this.validatorClient.post.simulate(wallet, messaging, gasPrice, memo, account);
|
|
201
189
|
}
|
|
202
190
|
|
|
203
191
|
/**
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
192
|
+
* @description Calculate the goodTilBlock value for a SHORT_TERM order
|
|
193
|
+
*
|
|
194
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
195
|
+
* at any point.
|
|
196
|
+
* @returns The goodTilBlock value
|
|
197
|
+
*/
|
|
210
198
|
|
|
211
199
|
private async calculateGoodTilBlock(
|
|
212
200
|
orderFlags: OrderFlags,
|
|
@@ -217,7 +205,7 @@ export class CompositeClient {
|
|
|
217
205
|
if (goodTilBlock !== undefined && goodTilBlock !== 0) {
|
|
218
206
|
return Promise.resolve(goodTilBlock);
|
|
219
207
|
} else {
|
|
220
|
-
const height = currentHeight ?? await this.validatorClient.get.latestBlockHeight();
|
|
208
|
+
const height = currentHeight ?? (await this.validatorClient.get.latestBlockHeight());
|
|
221
209
|
return height + SHORT_BLOCK_FORWARD;
|
|
222
210
|
}
|
|
223
211
|
} else {
|
|
@@ -247,15 +235,15 @@ export class CompositeClient {
|
|
|
247
235
|
}
|
|
248
236
|
|
|
249
237
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
238
|
+
* @description Calculate the goodTilBlockTime value for a LONG_TERM order
|
|
239
|
+
* the calling function is responsible for creating the messages.
|
|
240
|
+
*
|
|
241
|
+
* @param goodTilTimeInSeconds The goodTilTimeInSeconds of the order to place.
|
|
242
|
+
*
|
|
243
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
244
|
+
* at any point.
|
|
245
|
+
* @returns The goodTilBlockTime value
|
|
246
|
+
*/
|
|
259
247
|
private calculateGoodTilBlockTime(goodTilTimeInSeconds: number): number {
|
|
260
248
|
const now = new Date();
|
|
261
249
|
const millisecondsPerSecond = 1000;
|
|
@@ -309,10 +297,12 @@ export class CompositeClient {
|
|
|
309
297
|
timeInForce,
|
|
310
298
|
reduceOnly,
|
|
311
299
|
);
|
|
312
|
-
msg
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
300
|
+
msg
|
|
301
|
+
.then((it) => resolve([it]))
|
|
302
|
+
.catch((err) => {
|
|
303
|
+
console.log(err);
|
|
304
|
+
reject(err);
|
|
305
|
+
});
|
|
316
306
|
});
|
|
317
307
|
const account: Promise<Account> = this.validatorClient.post.account(
|
|
318
308
|
subaccount.address,
|
|
@@ -324,41 +314,42 @@ export class CompositeClient {
|
|
|
324
314
|
true,
|
|
325
315
|
undefined,
|
|
326
316
|
memo,
|
|
317
|
+
undefined,
|
|
327
318
|
() => account,
|
|
328
319
|
);
|
|
329
320
|
}
|
|
330
321
|
|
|
331
322
|
/**
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
323
|
+
* @description Place an order with human readable input.
|
|
324
|
+
*
|
|
325
|
+
* Only MARKET and LIMIT types are supported right now
|
|
326
|
+
* Use human readable form of input, including price and size
|
|
327
|
+
* The quantum and subticks are calculated and submitted
|
|
328
|
+
*
|
|
329
|
+
* @param subaccount The subaccount to place the order on.
|
|
330
|
+
* @param marketId The market to place the order on.
|
|
331
|
+
* @param type The type of order to place.
|
|
332
|
+
* @param side The side of the order to place.
|
|
333
|
+
* @param price The price of the order to place.
|
|
334
|
+
* @param size The size of the order to place.
|
|
335
|
+
* @param clientId The client id of the order to place.
|
|
336
|
+
* @param timeInForce The time in force of the order to place.
|
|
337
|
+
* @param goodTilTimeInSeconds The goodTilTimeInSeconds of the order to place.
|
|
338
|
+
* @param execution The execution of the order to place.
|
|
339
|
+
* @param postOnly The postOnly of the order to place.
|
|
340
|
+
* @param reduceOnly The reduceOnly of the order to place.
|
|
341
|
+
* @param triggerPrice The trigger price of conditional orders.
|
|
342
|
+
* @param marketInfo optional market information for calculating quantums and subticks.
|
|
343
|
+
* This can be constructed from Indexer API. If set to null, additional round
|
|
344
|
+
* trip to Indexer API will be made.
|
|
345
|
+
* @param currentHeight Current block height. This can be obtained from ValidatorClient.
|
|
346
|
+
* If set to null, additional round trip to ValidatorClient will be made.
|
|
347
|
+
*
|
|
348
|
+
*
|
|
349
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
350
|
+
* at any point.
|
|
351
|
+
* @returns The transaction hash.
|
|
352
|
+
*/
|
|
362
353
|
async placeOrder(
|
|
363
354
|
subaccount: SubaccountInfo,
|
|
364
355
|
marketId: string,
|
|
@@ -385,7 +376,6 @@ export class CompositeClient {
|
|
|
385
376
|
type,
|
|
386
377
|
side,
|
|
387
378
|
price,
|
|
388
|
-
// trigger_price: number, // not used for MARKET and LIMIT
|
|
389
379
|
size,
|
|
390
380
|
clientId,
|
|
391
381
|
timeInForce,
|
|
@@ -398,9 +388,11 @@ export class CompositeClient {
|
|
|
398
388
|
currentHeight,
|
|
399
389
|
goodTilBlock,
|
|
400
390
|
);
|
|
401
|
-
msg
|
|
402
|
-
|
|
403
|
-
|
|
391
|
+
msg
|
|
392
|
+
.then((it) => resolve([it]))
|
|
393
|
+
.catch((err) => {
|
|
394
|
+
console.log(err);
|
|
395
|
+
});
|
|
404
396
|
});
|
|
405
397
|
const orderFlags = calculateOrderFlags(type, timeInForce);
|
|
406
398
|
const account: Promise<Account> = this.validatorClient.post.account(
|
|
@@ -413,35 +405,36 @@ export class CompositeClient {
|
|
|
413
405
|
true,
|
|
414
406
|
undefined,
|
|
415
407
|
memo,
|
|
408
|
+
undefined,
|
|
416
409
|
() => account,
|
|
417
410
|
);
|
|
418
411
|
}
|
|
419
412
|
|
|
420
413
|
/**
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
414
|
+
* @description Calculate and create the place order message
|
|
415
|
+
*
|
|
416
|
+
* Only MARKET and LIMIT types are supported right now
|
|
417
|
+
* Use human readable form of input, including price and size
|
|
418
|
+
* The quantum and subticks are calculated and submitted
|
|
419
|
+
*
|
|
420
|
+
* @param subaccount The subaccount to place the order under
|
|
421
|
+
* @param marketId The market to place the order on
|
|
422
|
+
* @param type The type of order to place
|
|
423
|
+
* @param side The side of the order to place
|
|
424
|
+
* @param price The price of the order to place
|
|
425
|
+
* @param size The size of the order to place
|
|
426
|
+
* @param clientId The client id of the order to place
|
|
427
|
+
* @param timeInForce The time in force of the order to place
|
|
428
|
+
* @param goodTilTimeInSeconds The goodTilTimeInSeconds of the order to place
|
|
429
|
+
* @param execution The execution of the order to place
|
|
430
|
+
* @param postOnly The postOnly of the order to place
|
|
431
|
+
* @param reduceOnly The reduceOnly of the order to place
|
|
432
|
+
*
|
|
433
|
+
*
|
|
434
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
435
|
+
* at any point.
|
|
436
|
+
* @returns The message to be passed into the protocol
|
|
437
|
+
*/
|
|
445
438
|
private async placeOrderMessage(
|
|
446
439
|
subaccount: SubaccountInfo,
|
|
447
440
|
marketId: string,
|
|
@@ -466,8 +459,7 @@ export class CompositeClient {
|
|
|
466
459
|
const result = await Promise.all([
|
|
467
460
|
this.calculateGoodTilBlock(orderFlags, currentHeight, goodTilBlock),
|
|
468
461
|
this.retrieveMarketInfo(marketId, marketInfo),
|
|
469
|
-
]
|
|
470
|
-
);
|
|
462
|
+
]);
|
|
471
463
|
const desiredGoodTilBlock = result[0];
|
|
472
464
|
const clobPairId = result[1].clobPairId;
|
|
473
465
|
const atomicResolution = result[1].atomicResolution;
|
|
@@ -475,11 +467,7 @@ export class CompositeClient {
|
|
|
475
467
|
const quantumConversionExponent = result[1].quantumConversionExponent;
|
|
476
468
|
const subticksPerTick = result[1].subticksPerTick;
|
|
477
469
|
const orderSide = calculateSide(side);
|
|
478
|
-
const quantums = calculateQuantums(
|
|
479
|
-
size,
|
|
480
|
-
atomicResolution,
|
|
481
|
-
stepBaseQuantums,
|
|
482
|
-
);
|
|
470
|
+
const quantums = calculateQuantums(size, atomicResolution, stepBaseQuantums);
|
|
483
471
|
const subticks = calculateSubticks(
|
|
484
472
|
price,
|
|
485
473
|
atomicResolution,
|
|
@@ -502,7 +490,8 @@ export class CompositeClient {
|
|
|
502
490
|
atomicResolution,
|
|
503
491
|
quantumConversionExponent,
|
|
504
492
|
subticksPerTick,
|
|
505
|
-
triggerPrice
|
|
493
|
+
triggerPrice,
|
|
494
|
+
);
|
|
506
495
|
return this.validatorClient.post.composer.composeMsgPlaceOrder(
|
|
507
496
|
subaccount.address,
|
|
508
497
|
subaccount.subaccountNumber,
|
|
@@ -544,26 +533,26 @@ export class CompositeClient {
|
|
|
544
533
|
}
|
|
545
534
|
|
|
546
535
|
/**
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
536
|
+
* @description Calculate and create the short term place order message
|
|
537
|
+
*
|
|
538
|
+
* Use human readable form of input, including price and size
|
|
539
|
+
* The quantum and subticks are calculated and submitted
|
|
540
|
+
*
|
|
541
|
+
* @param subaccount The subaccount to place the order under
|
|
542
|
+
* @param marketId The market to place the order on
|
|
543
|
+
* @param side The side of the order to place
|
|
544
|
+
* @param price The price of the order to place
|
|
545
|
+
* @param size The size of the order to place
|
|
546
|
+
* @param clientId The client id of the order to place
|
|
547
|
+
* @param timeInForce The time in force of the order to place
|
|
548
|
+
* @param goodTilBlock The goodTilBlock of the order to place
|
|
549
|
+
* @param reduceOnly The reduceOnly of the order to place
|
|
550
|
+
*
|
|
551
|
+
*
|
|
552
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
553
|
+
* at any point.
|
|
554
|
+
* @returns The message to be passed into the protocol
|
|
555
|
+
*/
|
|
567
556
|
private async placeShortTermOrderMessage(
|
|
568
557
|
subaccount: SubaccountInfo,
|
|
569
558
|
marketId: string,
|
|
@@ -585,11 +574,7 @@ export class CompositeClient {
|
|
|
585
574
|
const quantumConversionExponent = market.quantumConversionExponent;
|
|
586
575
|
const subticksPerTick = market.subticksPerTick;
|
|
587
576
|
const orderSide = calculateSide(side);
|
|
588
|
-
const quantums = calculateQuantums(
|
|
589
|
-
size,
|
|
590
|
-
atomicResolution,
|
|
591
|
-
stepBaseQuantums,
|
|
592
|
-
);
|
|
577
|
+
const quantums = calculateQuantums(size, atomicResolution, stepBaseQuantums);
|
|
593
578
|
const subticks = calculateSubticks(
|
|
594
579
|
price,
|
|
595
580
|
atomicResolution,
|
|
@@ -617,19 +602,19 @@ export class CompositeClient {
|
|
|
617
602
|
}
|
|
618
603
|
|
|
619
604
|
/**
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
605
|
+
* @description Cancel an order with order information from web socket or REST.
|
|
606
|
+
*
|
|
607
|
+
* @param subaccount The subaccount to cancel the order from
|
|
608
|
+
* @param clientId The client id of the order to cancel
|
|
609
|
+
* @param orderFlags The order flags of the order to cancel
|
|
610
|
+
* @param clobPairId The clob pair id of the order to cancel
|
|
611
|
+
* @param goodTilBlock The goodTilBlock of the order to cancel
|
|
612
|
+
* @param goodTilBlockTime The goodTilBlockTime of the order to cancel
|
|
613
|
+
*
|
|
614
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
615
|
+
* at any point.
|
|
616
|
+
* @returns The transaction hash.
|
|
617
|
+
*/
|
|
633
618
|
async cancelRawOrder(
|
|
634
619
|
subaccount: SubaccountInfo,
|
|
635
620
|
clientId: number,
|
|
@@ -649,19 +634,19 @@ export class CompositeClient {
|
|
|
649
634
|
}
|
|
650
635
|
|
|
651
636
|
/**
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
637
|
+
* @description Cancel an order with human readable input.
|
|
638
|
+
*
|
|
639
|
+
* @param subaccount The subaccount to cancel the order from
|
|
640
|
+
* @param clientId The client id of the order to cancel
|
|
641
|
+
* @param orderFlags The order flags of the order to cancel
|
|
642
|
+
* @param marketId The market to cancel the order on
|
|
643
|
+
* @param goodTilBlock The goodTilBlock of the order to cancel
|
|
644
|
+
* @param goodTilBlockTime The goodTilBlockTime of the order to cancel
|
|
645
|
+
*
|
|
646
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
647
|
+
* at any point.
|
|
648
|
+
* @returns The transaction hash.
|
|
649
|
+
*/
|
|
665
650
|
async cancelOrder(
|
|
666
651
|
subaccount: SubaccountInfo,
|
|
667
652
|
clientId: number,
|
|
@@ -670,7 +655,6 @@ export class CompositeClient {
|
|
|
670
655
|
goodTilBlock?: number,
|
|
671
656
|
goodTilTimeInSeconds?: number,
|
|
672
657
|
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
673
|
-
|
|
674
658
|
const marketsResponse = await this.indexerClient.markets.getPerpetualMarkets(marketId);
|
|
675
659
|
const market = marketsResponse.markets[marketId];
|
|
676
660
|
const clobPairId = market.clobPairId;
|
|
@@ -687,7 +671,7 @@ export class CompositeClient {
|
|
|
687
671
|
if (goodTilBlock !== 0) {
|
|
688
672
|
throw new Error(
|
|
689
673
|
'goodTilBlock should be zero since LONG_TERM or CONDITIONAL orders ' +
|
|
690
|
-
|
|
674
|
+
'use goodTilTimeInSeconds instead of goodTilBlock.',
|
|
691
675
|
);
|
|
692
676
|
}
|
|
693
677
|
goodTilBlockTime = this.calculateGoodTilBlockTime(goodTilTimeInSeconds);
|
|
@@ -696,7 +680,9 @@ export class CompositeClient {
|
|
|
696
680
|
throw new Error('goodTilBlock must be non-zero for SHORT_TERM orders');
|
|
697
681
|
}
|
|
698
682
|
if (goodTilTimeInSeconds !== undefined && goodTilTimeInSeconds !== 0) {
|
|
699
|
-
throw new Error(
|
|
683
|
+
throw new Error(
|
|
684
|
+
'goodTilTimeInSeconds should be zero since SHORT_TERM orders use goodTilBlock instead of goodTilTimeInSeconds.',
|
|
685
|
+
);
|
|
700
686
|
}
|
|
701
687
|
}
|
|
702
688
|
|
|
@@ -711,23 +697,24 @@ export class CompositeClient {
|
|
|
711
697
|
}
|
|
712
698
|
|
|
713
699
|
/**
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
700
|
+
* @description Transfer from a subaccount to another subaccount
|
|
701
|
+
*
|
|
702
|
+
* @param subaccount The subaccount to transfer from
|
|
703
|
+
* @param recipientAddress The recipient address
|
|
704
|
+
* @param recipientSubaccountNumber The recipient subaccount number
|
|
705
|
+
* @param amount The amount to transfer
|
|
706
|
+
*
|
|
707
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
708
|
+
* at any point.
|
|
709
|
+
* @returns The transaction hash.
|
|
710
|
+
*/
|
|
725
711
|
async transferToSubaccount(
|
|
726
712
|
subaccount: SubaccountInfo,
|
|
727
713
|
recipientAddress: string,
|
|
728
714
|
recipientSubaccountNumber: number,
|
|
729
715
|
amount: string,
|
|
730
716
|
memo?: string,
|
|
717
|
+
broadcastMode?: BroadcastMode,
|
|
731
718
|
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
732
719
|
const msgs: Promise<EncodeObject[]> = new Promise((resolve) => {
|
|
733
720
|
const msg = this.transferToSubaccountMessage(
|
|
@@ -744,22 +731,23 @@ export class CompositeClient {
|
|
|
744
731
|
false,
|
|
745
732
|
undefined,
|
|
746
733
|
memo,
|
|
734
|
+
broadcastMode ?? Method.BroadcastTxCommit,
|
|
747
735
|
);
|
|
748
736
|
}
|
|
749
737
|
|
|
750
738
|
/**
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
739
|
+
* @description Create message to transfer from a subaccount to another subaccount
|
|
740
|
+
*
|
|
741
|
+
* @param subaccount The subaccount to transfer from
|
|
742
|
+
* @param recipientAddress The recipient address
|
|
743
|
+
* @param recipientSubaccountNumber The recipient subaccount number
|
|
744
|
+
* @param amount The amount to transfer
|
|
745
|
+
*
|
|
746
|
+
*
|
|
747
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
748
|
+
* at any point.
|
|
749
|
+
* @returns The message
|
|
750
|
+
*/
|
|
763
751
|
transferToSubaccountMessage(
|
|
764
752
|
subaccount: SubaccountInfo,
|
|
765
753
|
recipientAddress: string,
|
|
@@ -789,49 +777,38 @@ export class CompositeClient {
|
|
|
789
777
|
}
|
|
790
778
|
|
|
791
779
|
/**
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
780
|
+
* @description Deposit from wallet to subaccount
|
|
781
|
+
*
|
|
782
|
+
* @param subaccount The subaccount to deposit to
|
|
783
|
+
* @param amount The amount to deposit
|
|
784
|
+
*
|
|
785
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
786
|
+
* at any point.
|
|
787
|
+
* @returns The transaction hash.
|
|
788
|
+
*/
|
|
801
789
|
async depositToSubaccount(
|
|
802
790
|
subaccount: SubaccountInfo,
|
|
803
791
|
amount: string,
|
|
804
792
|
memo?: string,
|
|
805
793
|
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
806
794
|
const msgs: Promise<EncodeObject[]> = new Promise((resolve) => {
|
|
807
|
-
const msg = this.depositToSubaccountMessage(
|
|
808
|
-
subaccount,
|
|
809
|
-
amount,
|
|
810
|
-
);
|
|
795
|
+
const msg = this.depositToSubaccountMessage(subaccount, amount);
|
|
811
796
|
resolve([msg]);
|
|
812
797
|
});
|
|
813
|
-
return this.validatorClient.post.send(subaccount.wallet,
|
|
814
|
-
() => msgs,
|
|
815
|
-
false,
|
|
816
|
-
undefined,
|
|
817
|
-
memo,
|
|
818
|
-
);
|
|
798
|
+
return this.validatorClient.post.send(subaccount.wallet, () => msgs, false, undefined, memo);
|
|
819
799
|
}
|
|
820
800
|
|
|
821
801
|
/**
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
depositToSubaccountMessage(
|
|
832
|
-
subaccount: SubaccountInfo,
|
|
833
|
-
amount: string,
|
|
834
|
-
): EncodeObject {
|
|
802
|
+
* @description Create message to deposit from wallet to subaccount
|
|
803
|
+
*
|
|
804
|
+
* @param subaccount The subaccount to deposit to
|
|
805
|
+
* @param amount The amount to deposit
|
|
806
|
+
*
|
|
807
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
808
|
+
* at any point.
|
|
809
|
+
* @returns The message
|
|
810
|
+
*/
|
|
811
|
+
depositToSubaccountMessage(subaccount: SubaccountInfo, amount: string): EncodeObject {
|
|
835
812
|
const validatorClient = this._validatorClient;
|
|
836
813
|
if (validatorClient === undefined) {
|
|
837
814
|
throw new Error('validatorClient not set');
|
|
@@ -853,16 +830,16 @@ export class CompositeClient {
|
|
|
853
830
|
}
|
|
854
831
|
|
|
855
832
|
/**
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
833
|
+
* @description Withdraw from subaccount to wallet
|
|
834
|
+
*
|
|
835
|
+
* @param subaccount The subaccount to withdraw from
|
|
836
|
+
* @param amount The amount to withdraw
|
|
837
|
+
* @param recipient The recipient address, default to subaccount address
|
|
838
|
+
*
|
|
839
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
840
|
+
* at any point.
|
|
841
|
+
* @returns The transaction hash
|
|
842
|
+
*/
|
|
866
843
|
async withdrawFromSubaccount(
|
|
867
844
|
subaccount: SubaccountInfo,
|
|
868
845
|
amount: string,
|
|
@@ -870,34 +847,24 @@ export class CompositeClient {
|
|
|
870
847
|
memo?: string,
|
|
871
848
|
): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
|
|
872
849
|
const msgs: Promise<EncodeObject[]> = new Promise((resolve) => {
|
|
873
|
-
const msg = this.withdrawFromSubaccountMessage(
|
|
874
|
-
subaccount,
|
|
875
|
-
amount,
|
|
876
|
-
recipient,
|
|
877
|
-
);
|
|
850
|
+
const msg = this.withdrawFromSubaccountMessage(subaccount, amount, recipient);
|
|
878
851
|
resolve([msg]);
|
|
879
852
|
});
|
|
880
|
-
return this.send(
|
|
881
|
-
subaccount.wallet,
|
|
882
|
-
() => msgs,
|
|
883
|
-
false,
|
|
884
|
-
undefined,
|
|
885
|
-
memo,
|
|
886
|
-
);
|
|
853
|
+
return this.send(subaccount.wallet, () => msgs, false, undefined, memo);
|
|
887
854
|
}
|
|
888
855
|
|
|
889
856
|
/**
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
857
|
+
* @description Create message to withdraw from subaccount to wallet
|
|
858
|
+
* with human readable input.
|
|
859
|
+
*
|
|
860
|
+
* @param subaccount The subaccount to withdraw from
|
|
861
|
+
* @param amount The amount to withdraw
|
|
862
|
+
* @param recipient The recipient address
|
|
863
|
+
*
|
|
864
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
865
|
+
* at any point.
|
|
866
|
+
* @returns The message
|
|
867
|
+
*/
|
|
901
868
|
withdrawFromSubaccountMessage(
|
|
902
869
|
subaccount: SubaccountInfo,
|
|
903
870
|
amount: string,
|
|
@@ -925,30 +892,24 @@ export class CompositeClient {
|
|
|
925
892
|
}
|
|
926
893
|
|
|
927
894
|
/**
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
sendTokenMessage(
|
|
940
|
-
wallet: LocalWallet,
|
|
941
|
-
amount: string,
|
|
942
|
-
recipient: string,
|
|
943
|
-
): EncodeObject {
|
|
895
|
+
* @description Create message to send chain token from subaccount to wallet
|
|
896
|
+
* with human readable input.
|
|
897
|
+
*
|
|
898
|
+
* @param subaccount The subaccount to withdraw from
|
|
899
|
+
* @param amount The amount to withdraw
|
|
900
|
+
* @param recipient The recipient address
|
|
901
|
+
*
|
|
902
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
903
|
+
* at any point.
|
|
904
|
+
* @returns The message
|
|
905
|
+
*/
|
|
906
|
+
sendTokenMessage(wallet: LocalWallet, amount: string, recipient: string): EncodeObject {
|
|
944
907
|
const address = wallet.address;
|
|
945
908
|
if (address === undefined) {
|
|
946
909
|
throw new UserError('wallet address is not set. Call connectWallet() first');
|
|
947
910
|
}
|
|
948
|
-
const {
|
|
949
|
-
|
|
950
|
-
CHAINTOKEN_DECIMALS: chainTokenDecimals,
|
|
951
|
-
} = this._validatorClient?.config.denoms || {};
|
|
911
|
+
const { CHAINTOKEN_DENOM: chainTokenDenom, CHAINTOKEN_DECIMALS: chainTokenDecimals } =
|
|
912
|
+
this._validatorClient?.config.denoms || {};
|
|
952
913
|
|
|
953
914
|
if (chainTokenDenom === undefined || chainTokenDecimals === undefined) {
|
|
954
915
|
throw new Error('Chain token denom not set in validator config');
|
|
@@ -995,15 +956,13 @@ export class CompositeClient {
|
|
|
995
956
|
postOnly,
|
|
996
957
|
reduceOnly,
|
|
997
958
|
);
|
|
998
|
-
msg
|
|
999
|
-
|
|
1000
|
-
|
|
959
|
+
msg
|
|
960
|
+
.then((it) => resolve([it]))
|
|
961
|
+
.catch((err) => {
|
|
962
|
+
console.log(err);
|
|
963
|
+
});
|
|
1001
964
|
});
|
|
1002
|
-
const signature = await this.sign(
|
|
1003
|
-
wallet,
|
|
1004
|
-
() => msgs,
|
|
1005
|
-
true,
|
|
1006
|
-
);
|
|
965
|
+
const signature = await this.sign(wallet, () => msgs, true);
|
|
1007
966
|
|
|
1008
967
|
return Buffer.from(signature).toString('base64');
|
|
1009
968
|
}
|
|
@@ -1028,11 +987,7 @@ export class CompositeClient {
|
|
|
1028
987
|
);
|
|
1029
988
|
resolve([msg]);
|
|
1030
989
|
});
|
|
1031
|
-
const signature = await this.sign(
|
|
1032
|
-
subaccount.wallet,
|
|
1033
|
-
() => msgs,
|
|
1034
|
-
true,
|
|
1035
|
-
);
|
|
990
|
+
const signature = await this.sign(subaccount.wallet, () => msgs, true);
|
|
1036
991
|
|
|
1037
992
|
return Buffer.from(signature).toString('base64');
|
|
1038
993
|
}
|
|
@@ -1130,12 +1085,6 @@ export class CompositeClient {
|
|
|
1130
1085
|
resolve([submitProposal]);
|
|
1131
1086
|
});
|
|
1132
1087
|
|
|
1133
|
-
return this.send(
|
|
1134
|
-
wallet,
|
|
1135
|
-
() => msg,
|
|
1136
|
-
false,
|
|
1137
|
-
undefined,
|
|
1138
|
-
memo,
|
|
1139
|
-
);
|
|
1088
|
+
return this.send(wallet, () => msg, false, undefined, memo);
|
|
1140
1089
|
}
|
|
1141
1090
|
}
|