@triadxyz/poseidons-protocol 0.1.4 → 0.1.6

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.
@@ -34,11 +34,13 @@ export default class Chest {
34
34
  * Place a bid on a chest
35
35
  * @param id - The id of the chest
36
36
  * @param coins - The coins to bid
37
+ * @param refer - The refer of the user
37
38
  * @returns The transaction signature or versioned transaction
38
39
  */
39
- placeChestBid({ id, coins }: {
40
+ placeChestBid({ id, coins, refer }: {
40
41
  id: number;
41
42
  coins: number;
43
+ refer: PublicKey;
42
44
  }): Promise<string | import("@solana/web3.js").VersionedTransaction>;
43
45
  /**
44
46
  * Add chest winners
@@ -71,9 +71,10 @@ class Chest {
71
71
  * Place a bid on a chest
72
72
  * @param id - The id of the chest
73
73
  * @param coins - The coins to bid
74
+ * @param refer - The refer of the user
74
75
  * @returns The transaction signature or versioned transaction
75
76
  */
76
- placeChestBid({ id, coins }) {
77
+ placeChestBid({ id, coins, refer }) {
77
78
  return __awaiter(this, void 0, void 0, function* () {
78
79
  const instructions = [
79
80
  yield this.program.methods
@@ -83,6 +84,7 @@ class Chest {
83
84
  })
84
85
  .accounts({
85
86
  signer: this.program.provider.publicKey,
87
+ refer: (0, pda_1.getUserPDA)(refer),
86
88
  user: (0, pda_1.getUserPDA)(this.program.provider.publicKey)
87
89
  })
88
90
  .instruction()
@@ -662,6 +662,10 @@
662
662
  "name": "user",
663
663
  "writable": true
664
664
  },
665
+ {
666
+ "name": "refer",
667
+ "writable": true
668
+ },
665
669
  {
666
670
  "name": "mint",
667
671
  "writable": true,
@@ -825,6 +829,11 @@
825
829
  "code": 6004,
826
830
  "name": "InvalidAmount",
827
831
  "msg": "Invalid amount"
832
+ },
833
+ {
834
+ "code": 6005,
835
+ "name": "InvalidRefer",
836
+ "msg": "Invalid refer"
828
837
  }
829
838
  ],
830
839
  "types": [
@@ -895,6 +895,10 @@ export type PoseidonsProtocol = {
895
895
  name: 'user';
896
896
  writable: true;
897
897
  },
898
+ {
899
+ name: 'refer';
900
+ writable: true;
901
+ },
898
902
  {
899
903
  name: 'mint';
900
904
  writable: true;
@@ -1116,6 +1120,11 @@ export type PoseidonsProtocol = {
1116
1120
  code: 6004;
1117
1121
  name: 'invalidAmount';
1118
1122
  msg: 'Invalid amount';
1123
+ },
1124
+ {
1125
+ code: 6005;
1126
+ name: 'invalidRefer';
1127
+ msg: 'Invalid refer';
1119
1128
  }
1120
1129
  ];
1121
1130
  types: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/poseidons-protocol",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",