@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zoguxprotocol/client-js",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
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",
@@ -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: quantumsBigInt,
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: quantumsBigInt,
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
- const quantumsBigInt = typeof quantums === 'bigint' ? quantums : BigInt(quantums.toString());
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
- const quantumsBigInt = typeof quantums === 'bigint' ? quantums : BigInt(quantums.toString());
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
- const quantumsBigInt = typeof quantums === 'bigint' ? quantums : BigInt(quantums.toString());
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;