@triadxyz/triad-protocol 1.1.0-beta → 1.1.1-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
@@ -19,6 +19,7 @@ const helpers_1 = require("./utils/helpers");
19
19
  const pda_1 = require("./utils/pda");
20
20
  const stake_1 = __importDefault(require("./stake"));
21
21
  const sendTransactionWithOptions_1 = __importDefault(require("./utils/sendTransactionWithOptions"));
22
+ const bytes_1 = require("@coral-xyz/anchor/dist/cjs/utils/bytes");
22
23
  class TriadProtocolClient {
23
24
  constructor(connection, wallet) {
24
25
  this.provider = new anchor_1.AnchorProvider(connection, wallet, {
@@ -79,8 +80,8 @@ class TriadProtocolClient {
79
80
  const users = yield this.program.account.user.all([
80
81
  {
81
82
  memcmp: {
82
- offset: 8,
83
- bytes: Buffer.from(name).toString('base64')
83
+ offset: 89 + 4,
84
+ bytes: bytes_1.bs58.encode(Buffer.from(name))
84
85
  }
85
86
  }
86
87
  ]);
@@ -160,4 +160,8 @@ const claimAllRewards = () => __awaiter(void 0, void 0, void 0, function* () {
160
160
  });
161
161
  console.log(response);
162
162
  });
163
- claimAllRewards();
163
+ const getReferral = () => __awaiter(void 0, void 0, void 0, function* () {
164
+ const response = yield triadProtocol.getReferral('dannpl');
165
+ console.log(response);
166
+ });
167
+ getReferral();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.1.0-beta",
3
+ "version": "1.1.1-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",