@triadxyz/triad-protocol 1.2.6-beta → 1.2.7-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
@@ -78,5 +78,5 @@ export default class TriadProtocolClient {
78
78
  collectionSymbol: string;
79
79
  supply: number;
80
80
  }, options?: RpcOptions): Promise<string>;
81
- mintTicket({ collectionSymbol, number, discount, isBoosted, rarity, verifier, nftMint }: MintTicketArgs, options?: RpcOptions): Promise<string>;
81
+ mintTicket({ discount, isBoosted, rarity, verifier, nftMint }: MintTicketArgs, options?: RpcOptions): Promise<string>;
82
82
  }
package/dist/index.js CHANGED
@@ -170,13 +170,15 @@ class TriadProtocolClient {
170
170
  return (0, sendVersionedTransaction_1.default)(this.provider, [ix], options, keyPair);
171
171
  });
172
172
  }
173
- mintTicket({ collectionSymbol, number, discount, isBoosted, rarity, verifier, nftMint }, options) {
173
+ mintTicket({ discount, isBoosted, rarity, verifier, nftMint }, options) {
174
174
  return __awaiter(this, void 0, void 0, function* () {
175
175
  const asset = web3_js_1.Keypair.generate();
176
176
  const userNftAta = (0, pda_1.getTokenATA)(this.provider.wallet.publicKey, nftMint);
177
+ const collectionSymbol = 'PTCKT';
178
+ const [collection] = yield this.program.account.collection.all();
177
179
  const ix = yield this.program.methods
178
180
  .mintTicket({
179
- number: new anchor_1.BN(number),
181
+ number: new anchor_1.BN(collection.account.minted),
180
182
  collectionSymbol,
181
183
  discount: new anchor_1.BN(discount),
182
184
  isBoosted,
@@ -358,15 +358,11 @@ const collectFees = () => __awaiter(void 0, void 0, void 0, function* () {
358
358
  const mintTicket = () => __awaiter(void 0, void 0, void 0, function* () {
359
359
  console.log(wallet.publicKey.toBase58());
360
360
  const response = yield triadProtocol.mintTicket({
361
- number: 0,
362
- collectionSymbol: 'PTCKT',
363
361
  discount: 0,
364
362
  isBoosted: false,
365
363
  rarity: { uncommon: {} },
366
- verifier: '43bkRb3xj4Vv77Y76TjQuNiPGUsnun4tFSMYXY2Y2K5LfRT79YDpHhc7jruWmDGdygUBPXYQQZntCQz6V6cRGz8F',
367
- nftMint: new web3_js_1.PublicKey('A5dk1WqN9qcq1ZaWEh1UaMJR3SQeAsMirEEnLWbpp6fu')
368
- }, {
369
- skipPreflight: true
364
+ verifier: '',
365
+ nftMint: new web3_js_1.PublicKey('')
370
366
  });
371
367
  console.log(response);
372
368
  });
@@ -9,8 +9,6 @@ export type CreateUserArgs = {
9
9
  referral?: PublicKey;
10
10
  };
11
11
  export type MintTicketArgs = {
12
- collectionSymbol: string;
13
- number: number;
14
12
  discount: number;
15
13
  isBoosted: boolean;
16
14
  rarity: {
@@ -19,6 +17,12 @@ export type MintTicketArgs = {
19
17
  uncommon: {};
20
18
  } | {
21
19
  rare: {};
20
+ } | {
21
+ legendary: {};
22
+ } | {
23
+ epic: {};
24
+ } | {
25
+ mythic: {};
22
26
  };
23
27
  verifier: string;
24
28
  nftMint: PublicKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "1.2.6-beta",
3
+ "version": "1.2.7-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",