@triadxyz/poseidons-protocol 0.0.2 → 0.0.3

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
@@ -32,17 +32,6 @@ export default class PoseidonsProtocolClient {
32
32
  * @returns The transaction signature or versioned transaction
33
33
  */
34
34
  addPoseidonVaultRewards(amount: number): Promise<string | import("@solana/web3.js").VersionedTransaction>;
35
- /**
36
- * Create Poseidon
37
- * @param nfts.mint - The mint of the nft to create
38
- * @param nfts.power - The power of the nft to create
39
- * @returns The transaction signature or versioned transaction
40
- */
41
- createPoseidon(nfts: {
42
- mint: PublicKey;
43
- power: number;
44
- number: number;
45
- }[]): Promise<string | import("@solana/web3.js").VersionedTransaction>;
46
35
  /**
47
36
  * Add Poseidon power
48
37
  * @param mint - The mint of the Poseidon
@@ -55,4 +44,11 @@ export default class PoseidonsProtocolClient {
55
44
  * @returns The transaction signature or versioned transaction
56
45
  */
57
46
  claimPoseidonRewards(mint: PublicKey): Promise<string | import("@solana/web3.js").VersionedTransaction>;
47
+ /**
48
+ * Add Poseidon rewards
49
+ * @param mint - The mint of the Poseidon
50
+ * @param amount - The amount of rewards to add
51
+ * @returns The transaction signature or versioned transaction
52
+ */
53
+ addPoseidonRewards(mint: PublicKey, amount: number): Promise<string | import("@solana/web3.js").VersionedTransaction>;
58
54
  }
package/dist/index.js CHANGED
@@ -95,30 +95,6 @@ class PoseidonsProtocolClient {
95
95
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
96
96
  });
97
97
  }
98
- /**
99
- * Create Poseidon
100
- * @param nfts.mint - The mint of the nft to create
101
- * @param nfts.power - The power of the nft to create
102
- * @returns The transaction signature or versioned transaction
103
- */
104
- createPoseidon(nfts) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- const ixs = [];
107
- for (const nft of nfts) {
108
- ixs.push(yield this.program.methods
109
- .createPoseidon({
110
- power: new anchor_1.BN(nft.power),
111
- number: nft.number
112
- })
113
- .accounts({
114
- signer: this.program.provider.publicKey,
115
- poseidonAsset: nft.mint
116
- })
117
- .instruction());
118
- }
119
- return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
120
- });
121
- }
122
98
  /**
123
99
  * Add Poseidon power
124
100
  * @param mint - The mint of the Poseidon
@@ -158,5 +134,25 @@ class PoseidonsProtocolClient {
158
134
  return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
159
135
  });
160
136
  }
137
+ /**
138
+ * Add Poseidon rewards
139
+ * @param mint - The mint of the Poseidon
140
+ * @param amount - The amount of rewards to add
141
+ * @returns The transaction signature or versioned transaction
142
+ */
143
+ addPoseidonRewards(mint, amount) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ const ixs = [
146
+ yield this.program.methods
147
+ .addPoseidonRewards(new anchor_1.BN(amount * Math.pow(10, 6)))
148
+ .accounts({
149
+ signer: this.program.provider.publicKey,
150
+ poseidon: (0, pda_1.getPoseidonPDA)(mint)
151
+ })
152
+ .instruction()
153
+ ];
154
+ return (0, sendVersionedTransaction_1.default)(this.program, ixs, this.rpcOptions);
155
+ });
156
+ }
161
157
  }
162
158
  exports.default = PoseidonsProtocolClient;
@@ -360,55 +360,6 @@
360
360
  }
361
361
  ],
362
362
  "args": []
363
- },
364
- {
365
- "name": "create_poseidon",
366
- "discriminator": [59, 147, 154, 129, 146, 108, 228, 133],
367
- "accounts": [
368
- {
369
- "name": "signer",
370
- "writable": true,
371
- "signer": true
372
- },
373
- {
374
- "name": "poseidon",
375
- "writable": true,
376
- "pda": {
377
- "seeds": [
378
- {
379
- "kind": "const",
380
- "value": [112, 111, 115, 101, 105, 100, 111, 110]
381
- },
382
- {
383
- "kind": "account",
384
- "path": "poseidon_asset"
385
- }
386
- ]
387
- }
388
- },
389
- {
390
- "name": "poseidon_asset",
391
- "writable": true
392
- },
393
- {
394
- "name": "metaplex_program",
395
- "address": "CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d"
396
- },
397
- {
398
- "name": "system_program",
399
- "address": "11111111111111111111111111111111"
400
- }
401
- ],
402
- "args": [
403
- {
404
- "name": "args",
405
- "type": {
406
- "defined": {
407
- "name": "CreatePoseidonArgs"
408
- }
409
- }
410
- }
411
- ]
412
363
  }
413
364
  ],
414
365
  "accounts": [
@@ -525,22 +476,6 @@
525
476
  ]
526
477
  }
527
478
  },
528
- {
529
- "name": "CreatePoseidonArgs",
530
- "type": {
531
- "kind": "struct",
532
- "fields": [
533
- {
534
- "name": "power",
535
- "type": "u64"
536
- },
537
- {
538
- "name": "number",
539
- "type": "u16"
540
- }
541
- ]
542
- }
543
- },
544
479
  {
545
480
  "name": "Key",
546
481
  "type": {
@@ -535,55 +535,6 @@ export type PoseidonsProtocol = {
535
535
  }
536
536
  ];
537
537
  args: [];
538
- },
539
- {
540
- name: 'createPoseidon';
541
- discriminator: [59, 147, 154, 129, 146, 108, 228, 133];
542
- accounts: [
543
- {
544
- name: 'signer';
545
- writable: true;
546
- signer: true;
547
- },
548
- {
549
- name: 'poseidon';
550
- writable: true;
551
- pda: {
552
- seeds: [
553
- {
554
- kind: 'const';
555
- value: [112, 111, 115, 101, 105, 100, 111, 110];
556
- },
557
- {
558
- kind: 'account';
559
- path: 'poseidonAsset';
560
- }
561
- ];
562
- };
563
- },
564
- {
565
- name: 'poseidonAsset';
566
- writable: true;
567
- },
568
- {
569
- name: 'metaplexProgram';
570
- address: 'CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d';
571
- },
572
- {
573
- name: 'systemProgram';
574
- address: '11111111111111111111111111111111';
575
- }
576
- ];
577
- args: [
578
- {
579
- name: 'args';
580
- type: {
581
- defined: {
582
- name: 'createPoseidonArgs';
583
- };
584
- };
585
- }
586
- ];
587
538
  }
588
539
  ];
589
540
  accounts: [
@@ -700,22 +651,6 @@ export type PoseidonsProtocol = {
700
651
  ];
701
652
  };
702
653
  },
703
- {
704
- name: 'createPoseidonArgs';
705
- type: {
706
- kind: 'struct';
707
- fields: [
708
- {
709
- name: 'power';
710
- type: 'u64';
711
- },
712
- {
713
- name: 'number';
714
- type: 'u16';
715
- }
716
- ];
717
- };
718
- },
719
654
  {
720
655
  name: 'key';
721
656
  type: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/poseidons-protocol",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",