@dydxprotocol/v4-client-js 1.21.2 → 1.22.0
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/CHANGELOG.md +3 -5
- package/__native__/__ios__/v4-native-client.js +2194 -670
- package/build/src/clients/modules/post.js +2 -2
- package/build/src/clients/native.d.ts +1 -0
- package/build/src/clients/native.js +20 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/clients/modules/post.ts +1 -1
- package/src/clients/native.ts +16 -0
package/package.json
CHANGED
|
@@ -128,7 +128,7 @@ export class Post {
|
|
|
128
128
|
): Promise<StdFee> {
|
|
129
129
|
let msgs: EncodeObject[];
|
|
130
130
|
// protocol expects timestamp nonce in UTC milliseconds, which is the unit returned by Date.now()
|
|
131
|
-
let sequence = Date.now();
|
|
131
|
+
let sequence = Date.now() + this.timestampNonceOffsetMs;
|
|
132
132
|
|
|
133
133
|
if (this.useTimestampNonce) {
|
|
134
134
|
msgs = await messaging();
|
package/src/clients/native.ts
CHANGED
|
@@ -265,6 +265,22 @@ export async function getPerpetualMarkets(): Promise<string> {
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
export async function isWalletConnected(): Promise<string> {
|
|
269
|
+
try {
|
|
270
|
+
const client = globalThis.client;
|
|
271
|
+
if (client === undefined) {
|
|
272
|
+
throw new UserError('client is not connected. Call connectClient() first');
|
|
273
|
+
}
|
|
274
|
+
const wallet = globalThis.wallet;
|
|
275
|
+
if (wallet === undefined) {
|
|
276
|
+
throw new UserError('wallet is not set. Call connectWallet() first');
|
|
277
|
+
}
|
|
278
|
+
return await encodeJson( { "result": true } );
|
|
279
|
+
} catch (e) {
|
|
280
|
+
return wrappedError(e);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
268
284
|
export async function placeOrder(payload: string): Promise<string> {
|
|
269
285
|
try {
|
|
270
286
|
const client = globalThis.client;
|