@triadxyz/triad-protocol 4.0.3 → 4.0.4

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/predictor.js CHANGED
@@ -18,6 +18,7 @@ const constants_1 = require("./utils/constants");
18
18
  const pda_1 = require("./utils/pda");
19
19
  const sendVersionedTransaction_1 = __importDefault(require("./utils/sendVersionedTransaction"));
20
20
  const helpers_1 = require("./utils/helpers");
21
+ const spl_token_1 = require("@solana/spl-token");
21
22
  class Predictor {
22
23
  constructor(program, rpcOptions) {
23
24
  this.program = program;
@@ -33,7 +34,7 @@ class Predictor {
33
34
  const predictorPDA = (0, pda_1.getPredictorPDA)(this.program.programId, authority, customerId);
34
35
  try {
35
36
  const predictor = yield this.program.account.predictor.fetch(predictorPDA);
36
- const balance = yield this.program.provider.connection.getTokenAccountBalance((0, pda_1.getTokenATA)(authority, constants_1.UNIT_MINT, this.program.programId));
37
+ const balance = yield this.program.provider.connection.getTokenAccountBalance((0, pda_1.getTokenATA)(predictorPDA, constants_1.UNIT_MINT, spl_token_1.TOKEN_PROGRAM_ID));
37
38
  return (0, helpers_1.formatPredictor)(predictor, predictorPDA, new bn_js_1.default(balance.value.amount));
38
39
  }
39
40
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",