@zoguxprotocol/client-js 0.2.7 → 0.2.8
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/__native__/__ios__/v4-native-client.js +12 -12
- package/__native__/__ios__/v4-native-client.js.map +1 -1
- package/__tests__/lib/composer-spot-perp.test.ts +4 -2
- package/build/cjs/__tests__/lib/composer-spot-perp.test.js +5 -3
- package/build/cjs/src/clients/modules/composer.js +6 -11
- package/build/cjs/src/clients/modules/post.js +6 -1
- package/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/build/esm/__tests__/lib/composer-spot-perp.test.js +5 -3
- package/build/esm/src/clients/modules/composer.d.ts.map +1 -1
- package/build/esm/src/clients/modules/composer.js +6 -11
- package/build/esm/src/clients/modules/post.d.ts +5 -0
- package/build/esm/src/clients/modules/post.d.ts.map +1 -1
- package/build/esm/src/clients/modules/post.js +6 -1
- package/build/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/clients/modules/composer.ts +5 -10
- package/src/clients/modules/post.ts +5 -0
package/package.json
CHANGED
|
@@ -353,7 +353,6 @@ export class Composer {
|
|
|
353
353
|
): EncodeObject {
|
|
354
354
|
const senderSubaccountId: SubaccountId = { owner: senderAddress, number: senderSubaccountNumber };
|
|
355
355
|
const recipientSubaccountId: SubaccountId = { owner: recipientOwner, number: recipientSubaccountNumber };
|
|
356
|
-
const quantumsBigInt = typeof quantums === 'bigint' ? quantums : BigInt(quantums.toString());
|
|
357
356
|
return {
|
|
358
357
|
typeUrl: TYPE_URL_MSG_TRANSFER_SPOT_TO_PERP,
|
|
359
358
|
value: {
|
|
@@ -361,7 +360,7 @@ export class Composer {
|
|
|
361
360
|
senderSubaccountId,
|
|
362
361
|
recipientSubaccountId,
|
|
363
362
|
assetId,
|
|
364
|
-
quantums
|
|
363
|
+
quantums,
|
|
365
364
|
},
|
|
366
365
|
};
|
|
367
366
|
}
|
|
@@ -376,7 +375,6 @@ export class Composer {
|
|
|
376
375
|
): EncodeObject {
|
|
377
376
|
const senderSubaccountId: SubaccountId = { owner: senderAddress, number: senderSubaccountNumber };
|
|
378
377
|
const recipientSubaccountId: SubaccountId = { owner: recipientOwner, number: recipientSubaccountNumber };
|
|
379
|
-
const quantumsBigInt = typeof quantums === 'bigint' ? quantums : BigInt(quantums.toString());
|
|
380
378
|
return {
|
|
381
379
|
typeUrl: TYPE_URL_MSG_TRANSFER_PERP_TO_SPOT,
|
|
382
380
|
value: {
|
|
@@ -384,7 +382,7 @@ export class Composer {
|
|
|
384
382
|
senderSubaccountId,
|
|
385
383
|
recipientSubaccountId,
|
|
386
384
|
assetId,
|
|
387
|
-
quantums
|
|
385
|
+
quantums,
|
|
388
386
|
},
|
|
389
387
|
};
|
|
390
388
|
}
|
|
@@ -399,8 +397,7 @@ export class Composer {
|
|
|
399
397
|
): EncodeObject {
|
|
400
398
|
const senderSubaccountId: SubaccountId = { owner: senderAddress, number: senderSubaccountNumber };
|
|
401
399
|
const recipientSubaccountId: SubaccountId = { owner: recipientOwner, number: recipientSubaccountNumber };
|
|
402
|
-
|
|
403
|
-
return { typeUrl: TYPE_URL_MSG_CREATE_TRANSFER_SPOT, value: { sender: senderAddress, senderSubaccountId, recipientSubaccountId, assetId, quantums: quantumsBigInt } };
|
|
400
|
+
return { typeUrl: TYPE_URL_MSG_CREATE_TRANSFER_SPOT, value: { sender: senderAddress, senderSubaccountId, recipientSubaccountId, assetId, quantums } };
|
|
404
401
|
}
|
|
405
402
|
|
|
406
403
|
public composeMsgDepositToSpot(
|
|
@@ -410,8 +407,7 @@ export class Composer {
|
|
|
410
407
|
quantums: Long,
|
|
411
408
|
): EncodeObject {
|
|
412
409
|
const recipient: SubaccountId = { owner: address, number: subaccountNumber };
|
|
413
|
-
|
|
414
|
-
return { typeUrl: TYPE_URL_MSG_DEPOSIT_TO_SPOT, value: { sender: address, recipient, assetId, quantums: quantumsBigInt } };
|
|
410
|
+
return { typeUrl: TYPE_URL_MSG_DEPOSIT_TO_SPOT, value: { sender: address, recipient, assetId, quantums } };
|
|
415
411
|
}
|
|
416
412
|
|
|
417
413
|
public composeMsgWithdrawFromSpot(
|
|
@@ -422,8 +418,7 @@ export class Composer {
|
|
|
422
418
|
recipient: string = address,
|
|
423
419
|
): EncodeObject {
|
|
424
420
|
const sender: SubaccountId = { owner: address, number: subaccountNumber };
|
|
425
|
-
|
|
426
|
-
return { typeUrl: TYPE_URL_MSG_WITHDRAW_FROM_SPOT, value: { sender, recipient, assetId, quantums: quantumsBigInt } };
|
|
421
|
+
return { typeUrl: TYPE_URL_MSG_WITHDRAW_FROM_SPOT, value: { sender, recipient, assetId, quantums } };
|
|
427
422
|
}
|
|
428
423
|
|
|
429
424
|
// ------------ x/bank ------------
|
|
@@ -43,6 +43,11 @@ import {
|
|
|
43
43
|
protobuf.util.Long = Long;
|
|
44
44
|
protobuf.configure();
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Post signs and broadcasts transactions. All messages are built via this.composer;
|
|
48
|
+
* when adding a new message type, follow: constants (TYPE_URL) → lib/registry.ts →
|
|
49
|
+
* composer.composeMsg* → Post method that calls composer and passes to send().
|
|
50
|
+
*/
|
|
46
51
|
export class Post {
|
|
47
52
|
public readonly composer: Composer;
|
|
48
53
|
private readonly registry: Registry;
|