@dydxprotocol/v4-client-js 2.5.1 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,3 @@
1
- import { TextEncoder } from 'util';
2
-
3
1
  import { toBase64 } from '@cosmjs/encoding';
4
2
  import { Order_TimeInForce } from '@dydxprotocol/v4-proto/src/codegen/dydxprotocol/clob/order';
5
3
 
@@ -28,14 +26,14 @@ async function test(): Promise<void> {
28
26
 
29
27
  // Change second wallet pubkey
30
28
  // Add an authenticator to allow wallet2 to place orders
31
- console.log("** Adding authenticator **");
29
+ console.log('** Adding authenticator **');
32
30
  // Record authenticator count before adding
33
31
  const authsBefore = await client.getAuthenticators(wallet1.address!);
34
32
  const beforeCount = authsBefore.accountAuthenticators.length;
35
33
  console.log(`Authenticators before: ${beforeCount}`);
36
34
  await addTestAuthenticator(client, subaccount1, wallet2.pubKey!.value);
37
35
 
38
- console.log("** Waiting 3 seconds for txn to be confirmed **");
36
+ console.log('** Waiting 3 seconds for txn to be confirmed **');
39
37
  await new Promise((resolve) => setTimeout(resolve, 3000));
40
38
 
41
39
  const authsAfter = await client.getAuthenticators(wallet1.address!);
@@ -54,22 +52,24 @@ async function test(): Promise<void> {
54
52
  console.log(`New authenticator ID: ${newAuthenticatorID}`);
55
53
 
56
54
  // Placing order using subaccount2 for subaccount1 succeeds
57
- console.log("** Placing order for subaccount1 with subaccount2 + authenticator, should succeed **");
55
+ console.log(
56
+ '** Placing order for subaccount1 with subaccount2 + authenticator, should succeed **',
57
+ );
58
58
  await placeOrder(client, subaccount2, subaccount1, newAuthenticatorID);
59
59
 
60
60
  // Placing order using subaccount3 for subaccount1 should fail
61
- console.log("** Placing order for subaccount1 with subaccount3 + authenticator, should fail **");
61
+ console.log('** Placing order for subaccount1 with subaccount3 + authenticator, should fail **');
62
62
  await placeOrder(client, subaccount3, subaccount1, newAuthenticatorID);
63
63
 
64
64
  // Remove authenticator
65
- console.log("** Removing authenticator **");
65
+ console.log('** Removing authenticator **');
66
66
  await removeAuthenticator(client, subaccount1, newAuthenticatorID);
67
67
 
68
- console.log("** Waiting 3 seconds for txn to be confirmed **");
68
+ console.log('** Waiting 3 seconds for txn to be confirmed **');
69
69
  await new Promise((resolve) => setTimeout(resolve, 3000));
70
-
70
+
71
71
  // Placing an order using subaccount2 will now fail
72
- console.log("** Placing order with removed authenticator should fail **");
72
+ console.log('** Placing order with removed authenticator should fail **');
73
73
  await placeOrder(client, subaccount2, subaccount1, newAuthenticatorID);
74
74
  }
75
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dydxprotocol/v4-client-js",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "General client library for the new dYdX system (v4 decentralized)",
5
5
  "main": "build/cjs/src/index.js",
6
6
  "module": "build/esm/src/index.js",
@@ -77,6 +77,7 @@
77
77
  "@semantic-release/changelog": "^6.0.3",
78
78
  "@semantic-release/npm": "^12.0.1",
79
79
  "@types/ffi-napi": "^4.0.4",
80
+ "@types/node": "^20.3.1",
80
81
  "@types/ws": "8.5.4",
81
82
  "@typescript-eslint/eslint-plugin": "v5.42.0",
82
83
  "@typescript-eslint/parser": "v5.42.0",
@@ -1,5 +1,3 @@
1
- import { TextDecoder } from 'util';
2
-
3
1
  import { EncodeObject } from '@cosmjs/proto-signing';
4
2
  import { Account, GasPrice, IndexedTx, StdFee } from '@cosmjs/stargate';
5
3
  import { Method } from '@cosmjs/tendermint-rpc';