@triadxyz/triad-protocol 1.8.5-beta → 1.8.7-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/trade.d.ts CHANGED
@@ -146,7 +146,7 @@ export default class Trade {
146
146
  padding: number[];
147
147
  }>;
148
148
  /**
149
- * Initialize Market
149
+ * Create Market
150
150
  * @param args.marketId - new markert id - length + 1
151
151
  * @param args.startTime - start time
152
152
  * @param args.endTime - end time
package/dist/trade.js CHANGED
@@ -108,7 +108,7 @@ class Trade {
108
108
  });
109
109
  }
110
110
  /**
111
- * Initialize Market
111
+ * Create Market
112
112
  * @param args.marketId - new markert id - length + 1
113
113
  * @param args.startTime - start time
114
114
  * @param args.endTime - end time
@@ -1,4 +1,5 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
2
  export declare const getMarketPDA: (programId: PublicKey, marketId: number) => PublicKey;
3
+ export declare const getCustomerPDA: (programId: PublicKey, customerId: number) => PublicKey;
3
4
  export declare const getUserTradePDA: (programId: PublicKey, wallet: PublicKey) => PublicKey;
4
5
  export declare const getSubUserTradePDA: (programId: PublicKey, wallet: PublicKey, nonce: number) => PublicKey;
@@ -3,13 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getSubUserTradePDA = exports.getUserTradePDA = exports.getMarketPDA = void 0;
6
+ exports.getSubUserTradePDA = exports.getUserTradePDA = exports.getCustomerPDA = exports.getMarketPDA = void 0;
7
7
  const web3_js_1 = require("@solana/web3.js");
8
8
  const bn_js_1 = __importDefault(require("bn.js"));
9
9
  const getMarketPDA = (programId, marketId) => {
10
10
  return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('market'), new bn_js_1.default(marketId).toArrayLike(Buffer, 'le', 8)], programId)[0];
11
11
  };
12
12
  exports.getMarketPDA = getMarketPDA;
13
+ const getCustomerPDA = (programId, customerId) => {
14
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('customer'), new bn_js_1.default(customerId).toArrayLike(Buffer, 'le', 8)], programId)[0];
15
+ };
16
+ exports.getCustomerPDA = getCustomerPDA;
13
17
  const getUserTradePDA = (programId, wallet) => {
14
18
  return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('user_trade'), wallet.toBuffer()], programId)[0];
15
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.8.5-beta",
3
+ "version": "1.8.7-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",