@niftykit/diamond 0.2.9 → 0.2.15

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.
@@ -190,6 +190,28 @@ var Diamond = /** @class */ (function () {
190
190
  });
191
191
  });
192
192
  };
193
+ Diamond.getMintLinkByPublicKey = function (collectionId, publicKey, isDev, unique) {
194
+ return __awaiter(this, void 0, void 0, function () {
195
+ var baseUrl, url, resp, message;
196
+ return __generator(this, function (_a) {
197
+ switch (_a.label) {
198
+ case 0:
199
+ baseUrl = isDev ? endpoint_1.API_ENDPOINT_DEV : endpoint_1.API_ENDPOINT;
200
+ url = "".concat(baseUrl, "/onboarding/mintLinks/public/").concat(publicKey, "/").concat(collectionId, "?unique=").concat(unique);
201
+ return [4 /*yield*/, axios_1.default.get(url, {
202
+ validateStatus: function (status) { return status < 500; },
203
+ })];
204
+ case 1:
205
+ resp = _a.sent();
206
+ if (resp.status >= 400) {
207
+ message = resp.data.message;
208
+ throw new Error(message);
209
+ }
210
+ return [2 /*return*/, resp.data];
211
+ }
212
+ });
213
+ });
214
+ };
193
215
  return Diamond;
194
216
  }());
195
217
  exports.default = Diamond;
@@ -185,6 +185,28 @@ var Diamond = /** @class */ (function () {
185
185
  });
186
186
  });
187
187
  };
188
+ Diamond.getMintLinkByPublicKey = function (collectionId, publicKey, isDev, unique) {
189
+ return __awaiter(this, void 0, void 0, function () {
190
+ var baseUrl, url, resp, message;
191
+ return __generator(this, function (_a) {
192
+ switch (_a.label) {
193
+ case 0:
194
+ baseUrl = isDev ? API_ENDPOINT_DEV : API_ENDPOINT;
195
+ url = "".concat(baseUrl, "/onboarding/mintLinks/public/").concat(publicKey, "/").concat(collectionId, "?unique=").concat(unique);
196
+ return [4 /*yield*/, axios.get(url, {
197
+ validateStatus: function (status) { return status < 500; },
198
+ })];
199
+ case 1:
200
+ resp = _a.sent();
201
+ if (resp.status >= 400) {
202
+ message = resp.data.message;
203
+ throw new Error(message);
204
+ }
205
+ return [2 /*return*/, resp.data];
206
+ }
207
+ });
208
+ });
209
+ };
188
210
  return Diamond;
189
211
  }());
190
212
  export default Diamond;
@@ -1,6 +1,6 @@
1
1
  import { Provider } from '@ethersproject/providers';
2
2
  import { Signer } from 'ethers';
3
- import { CollectionApiResponse, VerifyApiResponse } from './types';
3
+ import { CollectionApiResponse, MintLinkApiResponse, VerifyApiResponse } from './types';
4
4
  import { BaseFacet } from './typechain-types/contracts/diamond';
5
5
  import { DropFacet } from './typechain-types/contracts/apps/drop';
6
6
  import { EditionFacet } from './typechain-types/contracts/apps/edition';
@@ -29,4 +29,5 @@ export default class Diamond {
29
29
  static verifyWallet(collectionId: string, wallet: string, isDev?: boolean): Promise<VerifyApiResponse>;
30
30
  static verifyWalletForEdition(collectionId: string, wallet: string, editionId: number, isDev?: boolean): Promise<VerifyApiResponse>;
31
31
  static getCollectionData(collectionId: string, isDev?: boolean): Promise<CollectionApiResponse>;
32
+ static getMintLinkByPublicKey(collectionId: string, publicKey: string, isDev?: boolean, unique?: boolean): Promise<MintLinkApiResponse>;
32
33
  }
@@ -12,6 +12,11 @@ export type CollectionApiResponse = {
12
12
  networkName: string;
13
13
  apps: App[];
14
14
  };
15
+ export type MintLinkApiResponse = {
16
+ id: string;
17
+ collectionId: string;
18
+ public: string;
19
+ };
15
20
  export type VerifyApiResponse = {
16
21
  proof: string[];
17
22
  allowed: number;