@triadxyz/triad-protocol 2.6.4-beta → 2.6.6-beta

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/dist/index.js CHANGED
@@ -810,7 +810,7 @@ class TriadProtocolClient {
810
810
  const sortedOrders = orders.sort((a, b) => Number(a.price) - Number(b.price));
811
811
  const tokenProgram = (0, helpers_1.getTokenProgram)(mint);
812
812
  for (const order of sortedOrders) {
813
- if (remainingUSDC.lte(new bn_js_1.default(0)))
813
+ if (remainingUSDC.lt(new bn_js_1.default(1000000)))
814
814
  break;
815
815
  if (order.authority === this.program.provider.publicKey.toBase58()) {
816
816
  continue;
@@ -827,13 +827,11 @@ class TriadProtocolClient {
827
827
  .div(new bn_js_1.default(1000000));
828
828
  adjustedPrice = orderPrice.add(fee);
829
829
  }
830
- console.log('remainingUSDC', remainingUSDC.toString());
831
830
  const maxSharesForPrice = remainingUSDC
832
831
  .mul(new bn_js_1.default(Math.pow(10, this.decimals)))
833
832
  .div(adjustedPrice);
834
833
  const sharesToBuy = bn_js_1.default.min(maxSharesForPrice, availableShares);
835
- console.log('sharesToBuy', sharesToBuy.toString());
836
- if (sharesToBuy.lte(new bn_js_1.default(0)))
834
+ if (sharesToBuy.lt(new bn_js_1.default(1000000)))
837
835
  continue;
838
836
  const usdcAmount = sharesToBuy
839
837
  .mul(adjustedPrice)
@@ -862,7 +860,6 @@ class TriadProtocolClient {
862
860
  if (userTradeIxs.length > 0) {
863
861
  ixs.unshift(...userTradeIxs);
864
862
  }
865
- console.log('ixs', ixs.length);
866
863
  if (ixs.length === 0) {
867
864
  throw new Error('No matching orders found to fill the requested amount');
868
865
  }
@@ -236,6 +236,7 @@ export type Refer = {
236
236
  authority: string;
237
237
  feeBps: number;
238
238
  feeClaimed: number;
239
+ usersReferred: number;
239
240
  };
240
241
  export type Customer = {
241
242
  id: number;
@@ -231,7 +231,8 @@ const formatRefer = (account) => {
231
231
  id: account.id.toNumber(),
232
232
  authority: account.authority.toString(),
233
233
  feeBps: account.feeBps,
234
- feeClaimed: account.feeClaimed.toNumber()
234
+ feeClaimed: account.feeClaimed.toNumber(),
235
+ usersReferred: account.usersReferred.toNumber()
235
236
  };
236
237
  };
237
238
  exports.formatRefer = formatRefer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "2.6.4-beta",
3
+ "version": "2.6.6-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",