@zoguxprotocol/client-js 0.2.8 → 0.2.10

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.
Files changed (77) hide show
  1. package/__native__/__ios__/v4-native-client.js +872 -15
  2. package/__native__/__ios__/v4-native-client.js.map +1 -1
  3. package/__tests__/lib/composer-bridge.test.ts +133 -0
  4. package/build/cjs/__tests__/lib/composer-bridge.test.js +88 -0
  5. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/events.js +1 -1
  6. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/params.js +1 -1
  7. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/indexer/protocol/v1/subaccount.js +1 -1
  8. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/transfer.js +1 -1
  9. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/tx.rpc.msg.js +1 -1
  10. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.js +73 -2
  11. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.rpc.msg.js +7 -1
  12. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/spot_position.js +1 -1
  13. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.js +1 -1
  14. package/build/cjs/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.rpc.msg.js +1 -1
  15. package/build/cjs/src/clients/constants.js +11 -3
  16. package/build/cjs/src/clients/faucet-client.js +2 -3
  17. package/build/cjs/src/clients/lib/registry.js +9 -1
  18. package/build/cjs/src/clients/modules/composer.js +41 -3
  19. package/build/cjs/src/clients/modules/post.js +37 -1
  20. package/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  21. package/build/esm/__tests__/lib/composer-bridge.test.d.ts +2 -0
  22. package/build/esm/__tests__/lib/composer-bridge.test.d.ts.map +1 -0
  23. package/build/esm/__tests__/lib/composer-bridge.test.js +83 -0
  24. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/events.d.ts +12 -6
  25. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/events.d.ts.map +1 -1
  26. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/events.js +1 -1
  27. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/params.d.ts +6 -4
  28. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/params.d.ts.map +1 -1
  29. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bridge/params.js +1 -1
  30. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bundle.d.ts +10 -0
  31. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/bundle.d.ts.map +1 -1
  32. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/indexer/protocol/v1/subaccount.d.ts +6 -4
  33. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/indexer/protocol/v1/subaccount.d.ts.map +1 -1
  34. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/indexer/protocol/v1/subaccount.js +1 -1
  35. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/transfer.d.ts +8 -2
  36. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/transfer.d.ts.map +1 -1
  37. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/transfer.js +1 -1
  38. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/tx.rpc.msg.d.ts +6 -2
  39. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/tx.rpc.msg.d.ts.map +1 -1
  40. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/sending/tx.rpc.msg.js +1 -1
  41. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.d.ts +28 -0
  42. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.d.ts.map +1 -1
  43. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.js +72 -1
  44. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.rpc.msg.d.ts +4 -1
  45. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.rpc.msg.d.ts.map +1 -1
  46. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/spots/tx.rpc.msg.js +8 -2
  47. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/spot_position.d.ts +6 -4
  48. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/spot_position.d.ts.map +1 -1
  49. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/spot_position.js +1 -1
  50. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.d.ts +22 -7
  51. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.d.ts.map +1 -1
  52. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.js +1 -1
  53. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.rpc.msg.d.ts +3 -2
  54. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.rpc.msg.d.ts.map +1 -1
  55. package/build/esm/node_modules/@zoguxprotocol/proto/src/codegen/zogux/subaccounts/tx.rpc.msg.js +1 -1
  56. package/build/esm/src/clients/constants.d.ts +7 -0
  57. package/build/esm/src/clients/constants.d.ts.map +1 -1
  58. package/build/esm/src/clients/constants.js +9 -1
  59. package/build/esm/src/clients/faucet-client.d.ts +1 -1
  60. package/build/esm/src/clients/faucet-client.d.ts.map +1 -1
  61. package/build/esm/src/clients/faucet-client.js +2 -3
  62. package/build/esm/src/clients/lib/registry.d.ts.map +1 -1
  63. package/build/esm/src/clients/lib/registry.js +10 -2
  64. package/build/esm/src/clients/modules/composer.d.ts +6 -1
  65. package/build/esm/src/clients/modules/composer.d.ts.map +1 -1
  66. package/build/esm/src/clients/modules/composer.js +42 -4
  67. package/build/esm/src/clients/modules/post.d.ts +10 -0
  68. package/build/esm/src/clients/modules/post.d.ts.map +1 -1
  69. package/build/esm/src/clients/modules/post.js +37 -1
  70. package/build/esm/tsconfig.esm.tsbuildinfo +1 -1
  71. package/package.json +2 -2
  72. package/src/clients/constants.ts +9 -0
  73. package/src/clients/faucet-client.ts +0 -2
  74. package/src/clients/lib/registry.ts +21 -0
  75. package/src/clients/modules/composer.ts +78 -4
  76. package/src/clients/modules/post.ts +167 -0
  77. package/tsconfig.base.json +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoguxprotocol/client-js",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "General client library for the new Zogux system (v4 decentralized)",
5
5
  "main": "build/cjs/src/index.js",
6
6
  "module": "build/esm/src/index.js",
@@ -55,7 +55,7 @@
55
55
  "@osmonauts/lcd": "^0.6.0",
56
56
  "@scure/bip32": "^1.1.5",
57
57
  "@scure/bip39": "^1.1.1",
58
- "@zoguxprotocol/proto": "0.1.7",
58
+ "@zoguxprotocol/proto": "0.1.8",
59
59
  "axios": "1.1.3",
60
60
  "bech32": "^1.1.4",
61
61
  "bignumber.js": "^9.1.1",
@@ -110,6 +110,15 @@ export const TYPE_URL_MSG_WITHDRAW_FROM_SPOT = '/zogux.sending.MsgWithdrawFromSp
110
110
  // x/affiliates
111
111
  export const TYPE_URL_MSG_REGISTER_AFFILIATE = '/zogux.affiliates.MsgRegisterAffiliate';
112
112
 
113
+ // x/bridge
114
+ export const TYPE_URL_MSG_REQUEST_WITHDRAWAL = '/zogux.bridge.MsgRequestWithdrawal';
115
+ export const TYPE_URL_MSG_SUBMIT_WITHDRAWAL_SIGNATURE = '/zogux.bridge.MsgSubmitWithdrawalSignature';
116
+ export const TYPE_URL_MSG_MARK_WITHDRAWAL_SUBMITTED = '/zogux.bridge.MsgMarkWithdrawalSubmitted';
117
+ export const TYPE_URL_MSG_CONFIRM_WITHDRAWAL = '/zogux.bridge.MsgConfirmWithdrawal';
118
+ /** @deprecated Use MsgConfirmWithdrawal instead. */
119
+ export const TYPE_URL_MSG_COMPLETE_WITHDRAWAL = '/zogux.bridge.MsgCompleteWithdrawal';
120
+ export const TYPE_URL_MSG_CANCEL_WITHDRAWAL = '/zogux.bridge.MsgCancelWithdrawal';
121
+
113
122
  // x/vault
114
123
  export const TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT = '/zogux.vault.MsgDepositToMegavault';
115
124
  export const TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT = '/zogux.vault.MsgWithdrawFromMegavault';
@@ -10,7 +10,6 @@ export class FaucetClient extends RestClient {
10
10
  public async fill(
11
11
  address: string,
12
12
  subaccountNumber: number,
13
- amount: number,
14
13
  headers?: {},
15
14
  ): Promise<Response> {
16
15
  const uri = '/faucet/tokens';
@@ -21,7 +20,6 @@ export class FaucetClient extends RestClient {
21
20
  {
22
21
  address,
23
22
  subaccountNumber,
24
- amount,
25
23
  },
26
24
  headers,
27
25
  );
@@ -2,6 +2,14 @@ import { GeneratedType, Registry } from '@cosmjs/proto-signing';
2
2
  import { defaultRegistryTypes } from '@cosmjs/stargate';
3
3
  import { MsgAddAuthenticator, MsgRemoveAuthenticator } from '@zoguxprotocol/proto/src/codegen/zogux/accountplus/tx';
4
4
  import { MsgRegisterAffiliate } from '@zoguxprotocol/proto/src/codegen/zogux/affiliates/tx';
5
+ import {
6
+ MsgRequestWithdrawal,
7
+ MsgSubmitWithdrawalSignature,
8
+ MsgMarkWithdrawalSubmitted,
9
+ MsgConfirmWithdrawal,
10
+ MsgCompleteWithdrawal,
11
+ MsgCancelWithdrawal,
12
+ } from '@zoguxprotocol/proto/src/codegen/zogux/bridge/tss';
5
13
  import {
6
14
  MsgPlaceOrder,
7
15
  MsgCancelOrder,
@@ -50,6 +58,12 @@ import {
50
58
  TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS,
51
59
  TYPE_URL_MSG_ADD_AUTHENTICATOR,
52
60
  TYPE_URL_MSG_REMOVE_AUTHENTICATOR,
61
+ TYPE_URL_MSG_REQUEST_WITHDRAWAL,
62
+ TYPE_URL_MSG_SUBMIT_WITHDRAWAL_SIGNATURE,
63
+ TYPE_URL_MSG_MARK_WITHDRAWAL_SUBMITTED,
64
+ TYPE_URL_MSG_CONFIRM_WITHDRAWAL,
65
+ TYPE_URL_MSG_COMPLETE_WITHDRAWAL,
66
+ TYPE_URL_MSG_CANCEL_WITHDRAWAL,
53
67
  } from '../constants';
54
68
  import { MsgCreateTransfer } from '../types';
55
69
 
@@ -92,6 +106,13 @@ export function generateRegistry(): Registry {
92
106
  // affiliates
93
107
  [TYPE_URL_MSG_REGISTER_AFFILIATE, MsgRegisterAffiliate as GeneratedType],
94
108
 
109
+ // bridge (withdrawal)
110
+ [TYPE_URL_MSG_REQUEST_WITHDRAWAL, MsgRequestWithdrawal as GeneratedType],
111
+ [TYPE_URL_MSG_SUBMIT_WITHDRAWAL_SIGNATURE, MsgSubmitWithdrawalSignature as GeneratedType],
112
+ [TYPE_URL_MSG_MARK_WITHDRAWAL_SUBMITTED, MsgMarkWithdrawalSubmitted as GeneratedType],
113
+ [TYPE_URL_MSG_CONFIRM_WITHDRAWAL, MsgConfirmWithdrawal as GeneratedType],
114
+ [TYPE_URL_MSG_COMPLETE_WITHDRAWAL, MsgCompleteWithdrawal as GeneratedType],
115
+ [TYPE_URL_MSG_CANCEL_WITHDRAWAL, MsgCancelWithdrawal as GeneratedType],
95
116
 
96
117
  // authentication
97
118
  [TYPE_URL_MSG_ADD_AUTHENTICATOR, MsgAddAuthenticator as GeneratedType],
@@ -24,6 +24,7 @@ import {
24
24
  MsgDepositToMegavault,
25
25
  MsgWithdrawFromMegavault,
26
26
  } from '@zoguxprotocol/proto/src/codegen/zogux/vault/tx';
27
+ import { fromBase64, toBase64 } from '@cosmjs/encoding';
27
28
  import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx';
28
29
  import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin';
29
30
  import { Any } from 'cosmjs-types/google/protobuf/any';
@@ -55,6 +56,11 @@ import {
55
56
  TYPE_URL_MSG_WITHDRAW_DELEGATOR_REWARD,
56
57
  TYPE_URL_BATCH_CANCEL,
57
58
  TYPE_URL_MSG_REGISTER_AFFILIATE,
59
+ TYPE_URL_MSG_REQUEST_WITHDRAWAL,
60
+ TYPE_URL_MSG_SUBMIT_WITHDRAWAL_SIGNATURE,
61
+ TYPE_URL_MSG_MARK_WITHDRAWAL_SUBMITTED,
62
+ TYPE_URL_MSG_CONFIRM_WITHDRAWAL,
63
+ TYPE_URL_MSG_CANCEL_WITHDRAWAL,
58
64
  TYPE_URL_MSG_DEPOSIT_TO_MEGAVAULT,
59
65
  TYPE_URL_MSG_WITHDRAW_FROM_MEGAVAULT,
60
66
  TYPE_URL_MSG_CREATE_MARKET_PERMISSIONLESS,
@@ -62,6 +68,7 @@ import {
62
68
  TYPE_URL_MSG_REMOVE_AUTHENTICATOR,
63
69
  AuthenticatorType,
64
70
  } from '../constants';
71
+ import { bigIntToBytes } from '../../lib/helpers';
65
72
  import { DenomConfig, ITwapParameters, IBuilderCodeParameters } from '../types';
66
73
  import {
67
74
  OrderId,
@@ -421,6 +428,69 @@ export class Composer {
421
428
  return { typeUrl: TYPE_URL_MSG_WITHDRAW_FROM_SPOT, value: { sender, recipient, assetId, quantums } };
422
429
  }
423
430
 
431
+ // ------------ x/bridge ------------
432
+ public composeMsgRequestWithdrawal(
433
+ fromAddress: string,
434
+ toAddress: string,
435
+ amount: string,
436
+ chainId: number | Long,
437
+ denom: string,
438
+ nonce: number | Long,
439
+ ): EncodeObject {
440
+ const chainIdLong = typeof chainId === 'number' ? Long.fromNumber(chainId) : chainId;
441
+ const nonceLong = typeof nonce === 'number' ? Long.fromNumber(nonce) : nonce;
442
+ return {
443
+ typeUrl: TYPE_URL_MSG_REQUEST_WITHDRAWAL,
444
+ value: { fromAddress, toAddress, amount, chainId: chainIdLong, denom, nonce: nonceLong },
445
+ };
446
+ }
447
+
448
+ public composeMsgSubmitWithdrawalSignature(
449
+ validator: string,
450
+ withdrawalId: string,
451
+ signature: Uint8Array | string,
452
+ ): EncodeObject {
453
+ const signatureBytes =
454
+ typeof signature === 'string' ? fromBase64(signature) : signature;
455
+ return {
456
+ typeUrl: TYPE_URL_MSG_SUBMIT_WITHDRAWAL_SIGNATURE,
457
+ value: { validator, withdrawalId, signature: signatureBytes },
458
+ };
459
+ }
460
+
461
+ public composeMsgMarkWithdrawalSubmitted(
462
+ signer: string,
463
+ withdrawalId: string,
464
+ evmTxHash: string,
465
+ ): EncodeObject {
466
+ return {
467
+ typeUrl: TYPE_URL_MSG_MARK_WITHDRAWAL_SUBMITTED,
468
+ value: { signer, withdrawalId, evmTxHash },
469
+ };
470
+ }
471
+
472
+ public composeMsgConfirmWithdrawal(
473
+ signer: string,
474
+ withdrawalId: string,
475
+ evmTxHash: string,
476
+ ): EncodeObject {
477
+ return {
478
+ typeUrl: TYPE_URL_MSG_CONFIRM_WITHDRAWAL,
479
+ value: { signer, withdrawalId, evmTxHash },
480
+ };
481
+ }
482
+
483
+ public composeMsgCancelWithdrawal(
484
+ authority: string,
485
+ withdrawalId: string,
486
+ reason: string,
487
+ ): EncodeObject {
488
+ return {
489
+ typeUrl: TYPE_URL_MSG_CANCEL_WITHDRAWAL,
490
+ value: { authority, withdrawalId, reason },
491
+ };
492
+ }
493
+
424
494
  // ------------ x/bank ------------
425
495
  public composeMsgSendToken(
426
496
  address: string,
@@ -576,17 +646,21 @@ export class Composer {
576
646
  public composeMsgWithdrawFromMegavault(
577
647
  address: string,
578
648
  subaccountNumber: number,
579
- shares: Uint8Array,
580
- minQuoteQuantums: Uint8Array,
649
+ shares: string | Uint8Array,
650
+ minQuoteQuantums: string | Uint8Array,
581
651
  ): EncodeObject {
582
652
  const subaccountId: SubaccountId = {
583
653
  owner: address,
584
654
  number: subaccountNumber,
585
655
  };
586
656
 
657
+ const sharesBytes = typeof shares === 'string' ? bigIntToBytes(BigInt(shares)) : shares;
658
+ const minQuoteQuantumsBytes =
659
+ typeof minQuoteQuantums === 'string' ? bigIntToBytes(BigInt(minQuoteQuantums)) : minQuoteQuantums;
660
+
587
661
  const msg: MsgWithdrawFromMegavault = {
588
- minQuoteQuantums,
589
- shares: { numShares: shares },
662
+ minQuoteQuantums: minQuoteQuantumsBytes,
663
+ shares: { numShares: sharesBytes },
590
664
  subaccountId,
591
665
  };
592
666
 
@@ -1070,6 +1070,173 @@ export class Post {
1070
1070
  return this.composer.composeMsgWithdrawFromMegavault(...args);
1071
1071
  }
1072
1072
 
1073
+ // ------------ x/bridge ------------
1074
+ requestWithdrawalMsg(
1075
+ fromAddress: string,
1076
+ toAddress: string,
1077
+ amount: string,
1078
+ chainId: number,
1079
+ denom: string,
1080
+ nonce: number,
1081
+ ): EncodeObject {
1082
+ return this.composer.composeMsgRequestWithdrawal(
1083
+ fromAddress,
1084
+ toAddress,
1085
+ amount,
1086
+ chainId,
1087
+ denom,
1088
+ nonce,
1089
+ );
1090
+ }
1091
+
1092
+ async requestWithdrawal(
1093
+ subaccount: SubaccountInfo,
1094
+ fromAddress: string,
1095
+ toAddress: string,
1096
+ amount: string,
1097
+ chainId: number,
1098
+ denom: string,
1099
+ nonce: number,
1100
+ broadcastMode?: BroadcastMode,
1101
+ ): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
1102
+ const msg = this.requestWithdrawalMsg(
1103
+ fromAddress,
1104
+ toAddress,
1105
+ amount,
1106
+ chainId,
1107
+ denom,
1108
+ nonce,
1109
+ );
1110
+ return this.send(
1111
+ subaccount,
1112
+ () => Promise.resolve([msg]),
1113
+ false,
1114
+ undefined,
1115
+ undefined,
1116
+ broadcastMode,
1117
+ );
1118
+ }
1119
+
1120
+ submitWithdrawalSignatureMsg(
1121
+ validator: string,
1122
+ withdrawalId: string,
1123
+ signature: Uint8Array | string,
1124
+ ): EncodeObject {
1125
+ return this.composer.composeMsgSubmitWithdrawalSignature(
1126
+ validator,
1127
+ withdrawalId,
1128
+ signature,
1129
+ );
1130
+ }
1131
+
1132
+ async submitWithdrawalSignature(
1133
+ subaccount: SubaccountInfo,
1134
+ validator: string,
1135
+ withdrawalId: string,
1136
+ signature: Uint8Array | string,
1137
+ broadcastMode?: BroadcastMode,
1138
+ ): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
1139
+ const msg = this.submitWithdrawalSignatureMsg(validator, withdrawalId, signature);
1140
+ return this.send(
1141
+ subaccount,
1142
+ () => Promise.resolve([msg]),
1143
+ false,
1144
+ undefined,
1145
+ undefined,
1146
+ broadcastMode,
1147
+ );
1148
+ }
1149
+
1150
+ markWithdrawalSubmittedMsg(
1151
+ signer: string,
1152
+ withdrawalId: string,
1153
+ evmTxHash: string,
1154
+ ): EncodeObject {
1155
+ return this.composer.composeMsgMarkWithdrawalSubmitted(
1156
+ signer,
1157
+ withdrawalId,
1158
+ evmTxHash,
1159
+ );
1160
+ }
1161
+
1162
+ async markWithdrawalSubmitted(
1163
+ subaccount: SubaccountInfo,
1164
+ signer: string,
1165
+ withdrawalId: string,
1166
+ evmTxHash: string,
1167
+ broadcastMode?: BroadcastMode,
1168
+ ): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
1169
+ const msg = this.markWithdrawalSubmittedMsg(signer, withdrawalId, evmTxHash);
1170
+ return this.send(
1171
+ subaccount,
1172
+ () => Promise.resolve([msg]),
1173
+ false,
1174
+ undefined,
1175
+ undefined,
1176
+ broadcastMode,
1177
+ );
1178
+ }
1179
+
1180
+ confirmWithdrawalMsg(
1181
+ signer: string,
1182
+ withdrawalId: string,
1183
+ evmTxHash: string,
1184
+ ): EncodeObject {
1185
+ return this.composer.composeMsgConfirmWithdrawal(
1186
+ signer,
1187
+ withdrawalId,
1188
+ evmTxHash,
1189
+ );
1190
+ }
1191
+
1192
+ async confirmWithdrawal(
1193
+ subaccount: SubaccountInfo,
1194
+ signer: string,
1195
+ withdrawalId: string,
1196
+ evmTxHash: string,
1197
+ broadcastMode?: BroadcastMode,
1198
+ ): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
1199
+ const msg = this.confirmWithdrawalMsg(signer, withdrawalId, evmTxHash);
1200
+ return this.send(
1201
+ subaccount,
1202
+ () => Promise.resolve([msg]),
1203
+ false,
1204
+ undefined,
1205
+ undefined,
1206
+ broadcastMode,
1207
+ );
1208
+ }
1209
+
1210
+ cancelWithdrawalMsg(
1211
+ authority: string,
1212
+ withdrawalId: string,
1213
+ reason: string,
1214
+ ): EncodeObject {
1215
+ return this.composer.composeMsgCancelWithdrawal(
1216
+ authority,
1217
+ withdrawalId,
1218
+ reason,
1219
+ );
1220
+ }
1221
+
1222
+ async cancelWithdrawal(
1223
+ subaccount: SubaccountInfo,
1224
+ authority: string,
1225
+ withdrawalId: string,
1226
+ reason: string,
1227
+ broadcastMode?: BroadcastMode,
1228
+ ): Promise<BroadcastTxAsyncResponse | BroadcastTxSyncResponse | IndexedTx> {
1229
+ const msg = this.cancelWithdrawalMsg(authority, withdrawalId, reason);
1230
+ return this.send(
1231
+ subaccount,
1232
+ () => Promise.resolve([msg]),
1233
+ false,
1234
+ undefined,
1235
+ undefined,
1236
+ broadcastMode,
1237
+ );
1238
+ }
1239
+
1073
1240
  async registerAffiliate(
1074
1241
  subaccount: SubaccountInfo,
1075
1242
  affiliate: string,
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "extends": "./node_modules/@dydxprotocol/node-service-base-dev/tsconfig.json",
3
- "exclude": ["src/codegen/**/*.ts", "__native__/*.js", "__native__/__ios__/*.js"],
3
+ "exclude": [
4
+ "src/codegen/**/*.ts",
5
+ "__native__/*.js",
6
+ "__native__/__ios__/*.js"
7
+ ],
4
8
  "include": [
5
9
  "__tests__",
6
10
  "examples",
@@ -10,6 +14,7 @@
10
14
  ],
11
15
  "compilerOptions": {
12
16
  "noFallthroughCasesInSwitch": false,
13
- "target": "ES2019"
17
+ "target": "ES2019",
18
+ "skipLibCheck": true
14
19
  }
15
20
  }