@triadxyz/poseidons-protocol 0.1.6 → 0.1.7

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/utils/pda.js CHANGED
@@ -4,6 +4,7 @@ exports.getChestPDA = exports.getUserPDA = exports.getPoseidonPDA = exports.getP
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  const spl_token_1 = require("@solana/spl-token");
6
6
  const constants_1 = require("./constants");
7
+ const anchor_1 = require("@coral-xyz/anchor");
7
8
  const getTokenATA = (address, Mint, program = spl_token_1.TOKEN_2022_PROGRAM_ID) => {
8
9
  return web3_js_1.PublicKey.findProgramAddressSync([address.toBytes(), program.toBytes(), Mint.toBytes()], new web3_js_1.PublicKey(spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID))[0];
9
10
  };
@@ -21,6 +22,6 @@ const getUserPDA = (authority) => {
21
22
  };
22
23
  exports.getUserPDA = getUserPDA;
23
24
  const getChestPDA = (id) => {
24
- return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('chest'), Buffer.from(id.toString())], constants_1.POSEIDON_VAULT_PROGRAM_ID)[0];
25
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('chest'), new anchor_1.BN(id).toArrayLike(Buffer, 'le', 8)], constants_1.POSEIDON_VAULT_PROGRAM_ID)[0];
25
26
  };
26
27
  exports.getChestPDA = getChestPDA;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/poseidons-protocol",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",