@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 +1 -1
- package/dist/trade.js +1 -1
- package/dist/utils/pda/trade.d.ts +1 -0
- package/dist/utils/pda/trade.js +5 -1
- package/package.json +1 -1
package/dist/trade.d.ts
CHANGED
package/dist/trade.js
CHANGED
|
@@ -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;
|
package/dist/utils/pda/trade.js
CHANGED
|
@@ -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
|
};
|