@triadxyz/triad-protocol 0.2.5-beta → 0.2.6-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.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="bn.js" />
2
1
  import { AnchorProvider, Program, Wallet } from '@coral-xyz/anchor';
3
2
  import { Connection, PublicKey } from '@solana/web3.js';
4
3
  import { TriadProtocol } from './types/triad_protocol';
@@ -32,18 +31,7 @@ export default class TriadProtocolClient {
32
31
  * Get Refferal
33
32
  * @param name - User name
34
33
  */
35
- getRefferal: (name: string) => Promise<"" | import("@coral-xyz/anchor").ProgramAccount<{
36
- ts: import("bn.js");
37
- authority: PublicKey;
38
- bump: number;
39
- referral: PublicKey;
40
- referred: import("bn.js");
41
- name: string;
42
- swaps: number;
43
- swapsMade: number;
44
- staked: import("bn.js");
45
- padding: number[];
46
- }>>;
34
+ getRefferal: (name: string) => Promise<PublicKey | "">;
47
35
  getUserPositions: (userWallet: PublicKey) => Promise<{}[]>;
48
36
  /**
49
37
  * Create User
package/dist/index.js CHANGED
@@ -58,7 +58,8 @@ class TriadProtocolClient {
58
58
  this.getRefferal = (name) => __awaiter(this, void 0, void 0, function* () {
59
59
  try {
60
60
  const response = yield this.program.account.user.all();
61
- return response.find((item) => item.account.name === name);
61
+ const data = response.find((item) => item.account.name === name);
62
+ return data.publicKey;
62
63
  }
63
64
  catch (_b) {
64
65
  return '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "0.2.5-beta",
3
+ "version": "0.2.6-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",