@dydxprotocol/v4-client-js 1.1.13 → 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 +2640 -797
- 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 +222 -222
- package/build/src/clients/composite-client.js +234 -228
- 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 +272 -329
- 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
|
@@ -29,54 +29,54 @@ export declare class CompositeClient {
|
|
|
29
29
|
get selectedGasDenom(): SelectedGasDenom | undefined;
|
|
30
30
|
setSelectedGasDenom(gasDenom: SelectedGasDenom): void;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
* @description Sign a list of messages with a wallet.
|
|
33
|
+
* the calling function is responsible for creating the messages.
|
|
34
|
+
*
|
|
35
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
36
|
+
* at any point.
|
|
37
|
+
* @returns The Signature.
|
|
38
|
+
*/
|
|
39
39
|
sign(wallet: LocalWallet, messaging: () => Promise<EncodeObject[]>, zeroFee: boolean, gasPrice?: GasPrice, memo?: string, account?: () => Promise<Account>): Promise<Uint8Array>;
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
* @description Send a list of messages with a wallet.
|
|
42
|
+
* the calling function is responsible for creating the messages.
|
|
43
|
+
*
|
|
44
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
45
|
+
* at any point.
|
|
46
|
+
* @returns The Transaction Hash.
|
|
47
|
+
*/
|
|
48
48
|
send(wallet: LocalWallet, messaging: () => Promise<EncodeObject[]>, zeroFee: boolean, gasPrice?: GasPrice, memo?: string, broadcastMode?: BroadcastMode, account?: () => Promise<Account>): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
49
49
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
* @description Send a signed transaction.
|
|
51
|
+
*
|
|
52
|
+
* @param signedTransaction The signed transaction to send.
|
|
53
|
+
*
|
|
54
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
55
|
+
* at any point.
|
|
56
|
+
* @returns The Transaction Hash.
|
|
57
|
+
*/
|
|
58
58
|
sendSignedTransaction(signedTransaction: Uint8Array): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
* @description Simulate a list of messages with a wallet.
|
|
61
|
+
* the calling function is responsible for creating the messages.
|
|
62
|
+
*
|
|
63
|
+
* To send multiple messages with gas estimate:
|
|
64
|
+
* 1. Client is responsible for creating the messages.
|
|
65
|
+
* 2. Call simulate() to get the gas estimate.
|
|
66
|
+
* 3. Call send() to send the messages.
|
|
67
|
+
*
|
|
68
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
69
|
+
* at any point.
|
|
70
|
+
* @returns The gas estimate.
|
|
71
|
+
*/
|
|
72
72
|
simulate(wallet: LocalWallet, messaging: () => Promise<EncodeObject[]>, gasPrice?: GasPrice, memo?: string, account?: () => Promise<Account>): Promise<StdFee>;
|
|
73
73
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
* @description Calculate the goodTilBlock value for a SHORT_TERM order
|
|
75
|
+
*
|
|
76
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
77
|
+
* at any point.
|
|
78
|
+
* @returns The goodTilBlock value
|
|
79
|
+
*/
|
|
80
80
|
private calculateGoodTilBlock;
|
|
81
81
|
/**
|
|
82
82
|
* @description Validate the goodTilBlock value for a SHORT_TERM order
|
|
@@ -89,15 +89,15 @@ export declare class CompositeClient {
|
|
|
89
89
|
*/
|
|
90
90
|
private validateGoodTilBlock;
|
|
91
91
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
* @description Calculate the goodTilBlockTime value for a LONG_TERM order
|
|
93
|
+
* the calling function is responsible for creating the messages.
|
|
94
|
+
*
|
|
95
|
+
* @param goodTilTimeInSeconds The goodTilTimeInSeconds of the order to place.
|
|
96
|
+
*
|
|
97
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
98
|
+
* at any point.
|
|
99
|
+
* @returns The goodTilBlockTime value
|
|
100
|
+
*/
|
|
101
101
|
private calculateGoodTilBlockTime;
|
|
102
102
|
/**
|
|
103
103
|
* @description Place a short term order with human readable input.
|
|
@@ -122,202 +122,202 @@ export declare class CompositeClient {
|
|
|
122
122
|
*/
|
|
123
123
|
placeShortTermOrder(subaccount: SubaccountInfo, marketId: string, side: OrderSide, price: number, size: number, clientId: number, goodTilBlock: number, timeInForce: Order_TimeInForce, reduceOnly: boolean, memo?: string): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
124
124
|
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
125
|
+
* @description Place an order with human readable input.
|
|
126
|
+
*
|
|
127
|
+
* Only MARKET and LIMIT types are supported right now
|
|
128
|
+
* Use human readable form of input, including price and size
|
|
129
|
+
* The quantum and subticks are calculated and submitted
|
|
130
|
+
*
|
|
131
|
+
* @param subaccount The subaccount to place the order on.
|
|
132
|
+
* @param marketId The market to place the order on.
|
|
133
|
+
* @param type The type of order to place.
|
|
134
|
+
* @param side The side of the order to place.
|
|
135
|
+
* @param price The price of the order to place.
|
|
136
|
+
* @param size The size of the order to place.
|
|
137
|
+
* @param clientId The client id of the order to place.
|
|
138
|
+
* @param timeInForce The time in force of the order to place.
|
|
139
|
+
* @param goodTilTimeInSeconds The goodTilTimeInSeconds of the order to place.
|
|
140
|
+
* @param execution The execution of the order to place.
|
|
141
|
+
* @param postOnly The postOnly of the order to place.
|
|
142
|
+
* @param reduceOnly The reduceOnly of the order to place.
|
|
143
|
+
* @param triggerPrice The trigger price of conditional orders.
|
|
144
|
+
* @param marketInfo optional market information for calculating quantums and subticks.
|
|
145
|
+
* This can be constructed from Indexer API. If set to null, additional round
|
|
146
|
+
* trip to Indexer API will be made.
|
|
147
|
+
* @param currentHeight Current block height. This can be obtained from ValidatorClient.
|
|
148
|
+
* If set to null, additional round trip to ValidatorClient will be made.
|
|
149
|
+
*
|
|
150
|
+
*
|
|
151
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
152
|
+
* at any point.
|
|
153
|
+
* @returns The transaction hash.
|
|
154
|
+
*/
|
|
155
155
|
placeOrder(subaccount: SubaccountInfo, marketId: string, type: OrderType, side: OrderSide, price: number, size: number, clientId: number, timeInForce?: OrderTimeInForce, goodTilTimeInSeconds?: number, execution?: OrderExecution, postOnly?: boolean, reduceOnly?: boolean, triggerPrice?: number, marketInfo?: MarketInfo, currentHeight?: number, goodTilBlock?: number, memo?: string): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
156
156
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
157
|
+
* @description Calculate and create the place order message
|
|
158
|
+
*
|
|
159
|
+
* Only MARKET and LIMIT types are supported right now
|
|
160
|
+
* Use human readable form of input, including price and size
|
|
161
|
+
* The quantum and subticks are calculated and submitted
|
|
162
|
+
*
|
|
163
|
+
* @param subaccount The subaccount to place the order under
|
|
164
|
+
* @param marketId The market to place the order on
|
|
165
|
+
* @param type The type of order to place
|
|
166
|
+
* @param side The side of the order to place
|
|
167
|
+
* @param price The price of the order to place
|
|
168
|
+
* @param size The size of the order to place
|
|
169
|
+
* @param clientId The client id of the order to place
|
|
170
|
+
* @param timeInForce The time in force of the order to place
|
|
171
|
+
* @param goodTilTimeInSeconds The goodTilTimeInSeconds of the order to place
|
|
172
|
+
* @param execution The execution of the order to place
|
|
173
|
+
* @param postOnly The postOnly of the order to place
|
|
174
|
+
* @param reduceOnly The reduceOnly of the order to place
|
|
175
|
+
*
|
|
176
|
+
*
|
|
177
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
178
|
+
* at any point.
|
|
179
|
+
* @returns The message to be passed into the protocol
|
|
180
|
+
*/
|
|
181
181
|
private placeOrderMessage;
|
|
182
182
|
private retrieveMarketInfo;
|
|
183
183
|
/**
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
184
|
+
* @description Calculate and create the short term place order message
|
|
185
|
+
*
|
|
186
|
+
* Use human readable form of input, including price and size
|
|
187
|
+
* The quantum and subticks are calculated and submitted
|
|
188
|
+
*
|
|
189
|
+
* @param subaccount The subaccount to place the order under
|
|
190
|
+
* @param marketId The market to place the order on
|
|
191
|
+
* @param side The side of the order to place
|
|
192
|
+
* @param price The price of the order to place
|
|
193
|
+
* @param size The size of the order to place
|
|
194
|
+
* @param clientId The client id of the order to place
|
|
195
|
+
* @param timeInForce The time in force of the order to place
|
|
196
|
+
* @param goodTilBlock The goodTilBlock of the order to place
|
|
197
|
+
* @param reduceOnly The reduceOnly of the order to place
|
|
198
|
+
*
|
|
199
|
+
*
|
|
200
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
201
|
+
* at any point.
|
|
202
|
+
* @returns The message to be passed into the protocol
|
|
203
|
+
*/
|
|
204
204
|
private placeShortTermOrderMessage;
|
|
205
205
|
/**
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
206
|
+
* @description Cancel an order with order information from web socket or REST.
|
|
207
|
+
*
|
|
208
|
+
* @param subaccount The subaccount to cancel the order from
|
|
209
|
+
* @param clientId The client id of the order to cancel
|
|
210
|
+
* @param orderFlags The order flags of the order to cancel
|
|
211
|
+
* @param clobPairId The clob pair id of the order to cancel
|
|
212
|
+
* @param goodTilBlock The goodTilBlock of the order to cancel
|
|
213
|
+
* @param goodTilBlockTime The goodTilBlockTime of the order to cancel
|
|
214
|
+
*
|
|
215
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
216
|
+
* at any point.
|
|
217
|
+
* @returns The transaction hash.
|
|
218
|
+
*/
|
|
219
219
|
cancelRawOrder(subaccount: SubaccountInfo, clientId: number, orderFlags: OrderFlags, clobPairId: number, goodTilBlock?: number, goodTilBlockTime?: number): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
220
220
|
/**
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
221
|
+
* @description Cancel an order with human readable input.
|
|
222
|
+
*
|
|
223
|
+
* @param subaccount The subaccount to cancel the order from
|
|
224
|
+
* @param clientId The client id of the order to cancel
|
|
225
|
+
* @param orderFlags The order flags of the order to cancel
|
|
226
|
+
* @param marketId The market to cancel the order on
|
|
227
|
+
* @param goodTilBlock The goodTilBlock of the order to cancel
|
|
228
|
+
* @param goodTilBlockTime The goodTilBlockTime of the order to cancel
|
|
229
|
+
*
|
|
230
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
231
|
+
* at any point.
|
|
232
|
+
* @returns The transaction hash.
|
|
233
|
+
*/
|
|
234
234
|
cancelOrder(subaccount: SubaccountInfo, clientId: number, orderFlags: OrderFlags, marketId: string, goodTilBlock?: number, goodTilTimeInSeconds?: number): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
235
235
|
/**
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
236
|
+
* @description Transfer from a subaccount to another subaccount
|
|
237
|
+
*
|
|
238
|
+
* @param subaccount The subaccount to transfer from
|
|
239
|
+
* @param recipientAddress The recipient address
|
|
240
|
+
* @param recipientSubaccountNumber The recipient subaccount number
|
|
241
|
+
* @param amount The amount to transfer
|
|
242
|
+
*
|
|
243
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
244
|
+
* at any point.
|
|
245
|
+
* @returns The transaction hash.
|
|
246
|
+
*/
|
|
247
247
|
transferToSubaccount(subaccount: SubaccountInfo, recipientAddress: string, recipientSubaccountNumber: number, amount: string, memo?: string, broadcastMode?: BroadcastMode): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
248
248
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
249
|
+
* @description Create message to transfer from a subaccount to another subaccount
|
|
250
|
+
*
|
|
251
|
+
* @param subaccount The subaccount to transfer from
|
|
252
|
+
* @param recipientAddress The recipient address
|
|
253
|
+
* @param recipientSubaccountNumber The recipient subaccount number
|
|
254
|
+
* @param amount The amount to transfer
|
|
255
|
+
*
|
|
256
|
+
*
|
|
257
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
258
|
+
* at any point.
|
|
259
|
+
* @returns The message
|
|
260
|
+
*/
|
|
261
261
|
transferToSubaccountMessage(subaccount: SubaccountInfo, recipientAddress: string, recipientSubaccountNumber: number, amount: string): EncodeObject;
|
|
262
262
|
/**
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
263
|
+
* @description Deposit from wallet to subaccount
|
|
264
|
+
*
|
|
265
|
+
* @param subaccount The subaccount to deposit to
|
|
266
|
+
* @param amount The amount to deposit
|
|
267
|
+
*
|
|
268
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
269
|
+
* at any point.
|
|
270
|
+
* @returns The transaction hash.
|
|
271
|
+
*/
|
|
272
272
|
depositToSubaccount(subaccount: SubaccountInfo, amount: string, memo?: string): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
273
273
|
/**
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
274
|
+
* @description Create message to deposit from wallet to subaccount
|
|
275
|
+
*
|
|
276
|
+
* @param subaccount The subaccount to deposit to
|
|
277
|
+
* @param amount The amount to deposit
|
|
278
|
+
*
|
|
279
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
280
|
+
* at any point.
|
|
281
|
+
* @returns The message
|
|
282
|
+
*/
|
|
283
283
|
depositToSubaccountMessage(subaccount: SubaccountInfo, amount: string): EncodeObject;
|
|
284
284
|
/**
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
285
|
+
* @description Withdraw from subaccount to wallet
|
|
286
|
+
*
|
|
287
|
+
* @param subaccount The subaccount to withdraw from
|
|
288
|
+
* @param amount The amount to withdraw
|
|
289
|
+
* @param recipient The recipient address, default to subaccount address
|
|
290
|
+
*
|
|
291
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
292
|
+
* at any point.
|
|
293
|
+
* @returns The transaction hash
|
|
294
|
+
*/
|
|
295
295
|
withdrawFromSubaccount(subaccount: SubaccountInfo, amount: string, recipient?: string, memo?: string): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx>;
|
|
296
296
|
/**
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
297
|
+
* @description Create message to withdraw from subaccount to wallet
|
|
298
|
+
* with human readable input.
|
|
299
|
+
*
|
|
300
|
+
* @param subaccount The subaccount to withdraw from
|
|
301
|
+
* @param amount The amount to withdraw
|
|
302
|
+
* @param recipient The recipient address
|
|
303
|
+
*
|
|
304
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
305
|
+
* at any point.
|
|
306
|
+
* @returns The message
|
|
307
|
+
*/
|
|
308
308
|
withdrawFromSubaccountMessage(subaccount: SubaccountInfo, amount: string, recipient?: string): EncodeObject;
|
|
309
309
|
/**
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
310
|
+
* @description Create message to send chain token from subaccount to wallet
|
|
311
|
+
* with human readable input.
|
|
312
|
+
*
|
|
313
|
+
* @param subaccount The subaccount to withdraw from
|
|
314
|
+
* @param amount The amount to withdraw
|
|
315
|
+
* @param recipient The recipient address
|
|
316
|
+
*
|
|
317
|
+
* @throws UnexpectedClientError if a malformed response is returned with no GRPC error
|
|
318
|
+
* at any point.
|
|
319
|
+
* @returns The message
|
|
320
|
+
*/
|
|
321
321
|
sendTokenMessage(wallet: LocalWallet, amount: string, recipient: string): EncodeObject;
|
|
322
322
|
signPlaceOrder(subaccount: SubaccountInfo, marketId: string, type: OrderType, side: OrderSide, price: number, size: number, clientId: number, timeInForce: OrderTimeInForce, goodTilTimeInSeconds: number, execution: OrderExecution, postOnly: boolean, reduceOnly: boolean): Promise<string>;
|
|
323
323
|
signCancelOrder(subaccount: SubaccountInfo, clientId: number, orderFlags: OrderFlags, clobPairId: number, goodTilBlock: number, goodTilBlockTime: number): Promise<string>;
|