emblem-vault-sdk 2.9.0 → 2.9.1
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/.claude/settings.local.json +11 -0
- package/dist/bundle.js +55832 -49285
- package/dist/curated/metadata.json +1 -1
- package/dist/derive.js +17 -7
- package/dist/index.js +68 -58
- package/dist/utils.js +19 -19
- package/docs/bundle.js +55832 -49285
- package/package.json +1 -1
- package/src/curated/metadata.json +1 -1
- package/types/derive.d.ts +0 -1
- package/utils/emblem-site-metadata.json +1 -1
- package/utils/sdk-metadata.json +1 -1
|
@@ -668143,7 +668143,7 @@
|
|
|
668143
668143
|
"price": 1040.9323103174047,
|
|
668144
668144
|
"lastPrice": 1314.8618656640904
|
|
668145
668145
|
},
|
|
668146
|
-
"video": "https://arweave.net/Fb7BMNWJQwNCrRxdw_dbMC01t6iSVUytBtg5LziOOlI/2o51ir_video.mp4
|
|
668146
|
+
"video": "https://arweave.net/Fb7BMNWJQwNCrRxdw_dbMC01t6iSVUytBtg5LziOOlI/2o51ir_video.mp4",
|
|
668147
668147
|
"projectProtocol": "Counterparty"
|
|
668148
668148
|
},
|
|
668149
668149
|
"DGAPEPE": {
|
package/dist/derive.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
package/dist/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,7 +45,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
35
45
|
const bignumber_1 = require("@ethersproject/bignumber");
|
|
36
46
|
const utils_1 = require("./utils");
|
|
37
47
|
const derive_1 = require("./derive");
|
|
38
|
-
const SDK_VERSION = '2.9.
|
|
48
|
+
const SDK_VERSION = '2.9.1';
|
|
39
49
|
class EmblemVaultSDK {
|
|
40
50
|
constructor(apiKey, baseUrl, v3Url, sigUrl) {
|
|
41
51
|
this.apiKey = apiKey;
|
|
@@ -80,8 +90,8 @@ class EmblemVaultSDK {
|
|
|
80
90
|
}
|
|
81
91
|
// ** Curated **
|
|
82
92
|
//
|
|
83
|
-
fetchCuratedContracts(
|
|
84
|
-
return __awaiter(this,
|
|
93
|
+
fetchCuratedContracts() {
|
|
94
|
+
return __awaiter(this, arguments, void 0, function* (hideUnMintable = false, overrideFunc = false) {
|
|
85
95
|
let url = `${this.baseUrl}/curated`;
|
|
86
96
|
// Fetch using URL or override function
|
|
87
97
|
let data = typeof overrideFunc === 'function' ? yield overrideFunc() : yield (0, utils_1.fetchData)(url, this.apiKey);
|
|
@@ -103,15 +113,15 @@ class EmblemVaultSDK {
|
|
|
103
113
|
return data;
|
|
104
114
|
});
|
|
105
115
|
}
|
|
106
|
-
fetchCuratedContractByName(
|
|
107
|
-
return __awaiter(this,
|
|
116
|
+
fetchCuratedContractByName(name_1) {
|
|
117
|
+
return __awaiter(this, arguments, void 0, function* (name, contracts = false) {
|
|
108
118
|
!contracts ? contracts = yield this.fetchCuratedContracts() : null;
|
|
109
119
|
let contract = contracts.find((contract) => contract.name === name);
|
|
110
120
|
return contract || null;
|
|
111
121
|
});
|
|
112
122
|
}
|
|
113
|
-
createCuratedVault(
|
|
114
|
-
return __awaiter(this,
|
|
123
|
+
createCuratedVault(template_1) {
|
|
124
|
+
return __awaiter(this, arguments, void 0, function* (template, callback = null) {
|
|
115
125
|
(0, utils_1.templateGuard)(template);
|
|
116
126
|
template.chainId == 1 ? delete template.targetContract[5] : delete template.targetContract[1];
|
|
117
127
|
let url = `${this.baseUrl}/create-curated`;
|
|
@@ -125,8 +135,8 @@ class EmblemVaultSDK {
|
|
|
125
135
|
return vaultCreationResponse.data;
|
|
126
136
|
});
|
|
127
137
|
}
|
|
128
|
-
refreshOwnershipForTokenId(
|
|
129
|
-
return __awaiter(this,
|
|
138
|
+
refreshOwnershipForTokenId(tokenId_1) {
|
|
139
|
+
return __awaiter(this, arguments, void 0, function* (tokenId, callback = null) {
|
|
130
140
|
(0, utils_1.genericGuard)(tokenId, "string", "tokenId");
|
|
131
141
|
let url = `${this.baseUrl}/refreshBalanceForTokenId`;
|
|
132
142
|
let response = yield (0, utils_1.fetchData)(url, this.apiKey, 'POST', { tokenId });
|
|
@@ -136,8 +146,8 @@ class EmblemVaultSDK {
|
|
|
136
146
|
return response;
|
|
137
147
|
});
|
|
138
148
|
}
|
|
139
|
-
refreshOwnershipForAccount(
|
|
140
|
-
return __awaiter(this,
|
|
149
|
+
refreshOwnershipForAccount(account_1) {
|
|
150
|
+
return __awaiter(this, arguments, void 0, function* (account, callback = null) {
|
|
141
151
|
(0, utils_1.genericGuard)(account, "string", "account");
|
|
142
152
|
let url = `${this.baseUrl}/refreshBalanceForAccount`;
|
|
143
153
|
let response = yield (0, utils_1.fetchData)(url, this.apiKey, 'POST', { account });
|
|
@@ -147,8 +157,8 @@ class EmblemVaultSDK {
|
|
|
147
157
|
return response;
|
|
148
158
|
});
|
|
149
159
|
}
|
|
150
|
-
fetchMetadata(
|
|
151
|
-
return __awaiter(this,
|
|
160
|
+
fetchMetadata(tokenId_1) {
|
|
161
|
+
return __awaiter(this, arguments, void 0, function* (tokenId, callback = null) {
|
|
152
162
|
(0, utils_1.genericGuard)(tokenId, "string", "tokenId");
|
|
153
163
|
if (callback) {
|
|
154
164
|
callback('getting Metadata');
|
|
@@ -161,8 +171,8 @@ class EmblemVaultSDK {
|
|
|
161
171
|
return metadata;
|
|
162
172
|
});
|
|
163
173
|
}
|
|
164
|
-
refreshBalance(
|
|
165
|
-
return __awaiter(this,
|
|
174
|
+
refreshBalance(tokenId_1) {
|
|
175
|
+
return __awaiter(this, arguments, void 0, function* (tokenId, callback = null) {
|
|
166
176
|
(0, utils_1.genericGuard)(tokenId, "string", "tokenId");
|
|
167
177
|
if (callback) {
|
|
168
178
|
callback('refreshing Balance');
|
|
@@ -184,8 +194,8 @@ class EmblemVaultSDK {
|
|
|
184
194
|
return vaults;
|
|
185
195
|
});
|
|
186
196
|
}
|
|
187
|
-
generateJumpReport(
|
|
188
|
-
return __awaiter(this,
|
|
197
|
+
generateJumpReport(address_1) {
|
|
198
|
+
return __awaiter(this, arguments, void 0, function* (address, hideUnMintable = false) {
|
|
189
199
|
let vaultType = "unclaimed";
|
|
190
200
|
let curated = yield this.fetchCuratedContracts();
|
|
191
201
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -223,8 +233,8 @@ class EmblemVaultSDK {
|
|
|
223
233
|
}));
|
|
224
234
|
});
|
|
225
235
|
}
|
|
226
|
-
generateMintReport(
|
|
227
|
-
return __awaiter(this,
|
|
236
|
+
generateMintReport(address_1) {
|
|
237
|
+
return __awaiter(this, arguments, void 0, function* (address, hideUnMintable = false) {
|
|
228
238
|
let vaults = yield this.fetchVaultsOfType("created", address);
|
|
229
239
|
let curated = yield this.fetchCuratedContracts();
|
|
230
240
|
let map = {};
|
|
@@ -255,8 +265,8 @@ class EmblemVaultSDK {
|
|
|
255
265
|
}));
|
|
256
266
|
});
|
|
257
267
|
}
|
|
258
|
-
generateMigrateReport(
|
|
259
|
-
return __awaiter(this,
|
|
268
|
+
generateMigrateReport(address_1) {
|
|
269
|
+
return __awaiter(this, arguments, void 0, function* (address, hideUnMintable = false) {
|
|
260
270
|
let vaultType = "unclaimed";
|
|
261
271
|
let curated = yield this.fetchCuratedContracts();
|
|
262
272
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -322,8 +332,8 @@ class EmblemVaultSDK {
|
|
|
322
332
|
}
|
|
323
333
|
});
|
|
324
334
|
}
|
|
325
|
-
performMintChain(
|
|
326
|
-
return __awaiter(this,
|
|
335
|
+
performMintChain(web3_1, tokenId_1, collectionName_1) {
|
|
336
|
+
return __awaiter(this, arguments, void 0, function* (web3, tokenId, collectionName, callback = null) {
|
|
327
337
|
let collection = yield this.fetchCuratedContractByName(collectionName);
|
|
328
338
|
let mintRequestSig = yield this.requestLocalMintSignature(web3, tokenId, callback);
|
|
329
339
|
let remoteMintSig = yield this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
|
|
@@ -333,16 +343,16 @@ class EmblemVaultSDK {
|
|
|
333
343
|
return { mintResponse };
|
|
334
344
|
});
|
|
335
345
|
}
|
|
336
|
-
performClaimChain(
|
|
337
|
-
return __awaiter(this,
|
|
346
|
+
performClaimChain(web3_1, tokenId_1, serialNumber_1) {
|
|
347
|
+
return __awaiter(this, arguments, void 0, function* (web3, tokenId, serialNumber, callback = null) {
|
|
338
348
|
let sig = yield this.requestLocalClaimSignature(web3, tokenId, serialNumber, callback);
|
|
339
349
|
let jwt = yield this.requestRemoteClaimToken(web3, tokenId, sig, callback);
|
|
340
350
|
let dkeys = yield this.requestRemoteKey(tokenId, jwt, callback);
|
|
341
351
|
return yield this.decryptVaultKeys(tokenId, dkeys, callback);
|
|
342
352
|
});
|
|
343
353
|
}
|
|
344
|
-
requestLocalMintSignature(
|
|
345
|
-
return __awaiter(this,
|
|
354
|
+
requestLocalMintSignature(web3_1, tokenId_1) {
|
|
355
|
+
return __awaiter(this, arguments, void 0, function* (web3, tokenId, callback = null) {
|
|
346
356
|
if (callback) {
|
|
347
357
|
callback('requesting User Mint Signature');
|
|
348
358
|
}
|
|
@@ -355,8 +365,8 @@ class EmblemVaultSDK {
|
|
|
355
365
|
return signature;
|
|
356
366
|
});
|
|
357
367
|
}
|
|
358
|
-
requestLocalClaimSignature(
|
|
359
|
-
return __awaiter(this,
|
|
368
|
+
requestLocalClaimSignature(web3_1, tokenId_1, serialNumber_1) {
|
|
369
|
+
return __awaiter(this, arguments, void 0, function* (web3, tokenId, serialNumber, callback = null) {
|
|
360
370
|
if (callback) {
|
|
361
371
|
callback('requesting User Claim Signature');
|
|
362
372
|
}
|
|
@@ -369,8 +379,8 @@ class EmblemVaultSDK {
|
|
|
369
379
|
return signature;
|
|
370
380
|
});
|
|
371
381
|
}
|
|
372
|
-
requestRemoteMintSignature(
|
|
373
|
-
return __awaiter(this,
|
|
382
|
+
requestRemoteMintSignature(web3_1, tokenId_1, signature_1) {
|
|
383
|
+
return __awaiter(this, arguments, void 0, function* (web3, tokenId, signature, callback = null) {
|
|
374
384
|
if (callback) {
|
|
375
385
|
callback('requesting Remote Mint signature');
|
|
376
386
|
}
|
|
@@ -386,8 +396,8 @@ class EmblemVaultSDK {
|
|
|
386
396
|
return remoteMintResponse;
|
|
387
397
|
});
|
|
388
398
|
}
|
|
389
|
-
requestRemoteClaimToken(
|
|
390
|
-
return __awaiter(this,
|
|
399
|
+
requestRemoteClaimToken(web3_1, tokenId_1, signature_1) {
|
|
400
|
+
return __awaiter(this, arguments, void 0, function* (web3, tokenId, signature, callback = null) {
|
|
391
401
|
if (callback) {
|
|
392
402
|
callback('requesting Remote Claim token');
|
|
393
403
|
}
|
|
@@ -400,8 +410,8 @@ class EmblemVaultSDK {
|
|
|
400
410
|
return remoteClaimResponse;
|
|
401
411
|
});
|
|
402
412
|
}
|
|
403
|
-
requestRemoteKey(
|
|
404
|
-
return __awaiter(this,
|
|
413
|
+
requestRemoteKey(tokenId_1, jwt_1) {
|
|
414
|
+
return __awaiter(this, arguments, void 0, function* (tokenId, jwt, callback = null) {
|
|
405
415
|
if (callback) {
|
|
406
416
|
callback('requesting Remote Key');
|
|
407
417
|
}
|
|
@@ -412,8 +422,8 @@ class EmblemVaultSDK {
|
|
|
412
422
|
return dkeys;
|
|
413
423
|
});
|
|
414
424
|
}
|
|
415
|
-
decryptVaultKeys(
|
|
416
|
-
return __awaiter(this,
|
|
425
|
+
decryptVaultKeys(tokenId_1, dkeys_1) {
|
|
426
|
+
return __awaiter(this, arguments, void 0, function* (tokenId, dkeys, callback = null) {
|
|
417
427
|
if (callback) {
|
|
418
428
|
callback('decrypting Vault Keys');
|
|
419
429
|
}
|
|
@@ -425,8 +435,8 @@ class EmblemVaultSDK {
|
|
|
425
435
|
return ukeys;
|
|
426
436
|
});
|
|
427
437
|
}
|
|
428
|
-
getQuote(
|
|
429
|
-
return __awaiter(this,
|
|
438
|
+
getQuote(web3_1, amount_1) {
|
|
439
|
+
return __awaiter(this, arguments, void 0, function* (web3, amount, callback = null) {
|
|
430
440
|
if (callback) {
|
|
431
441
|
callback('requesting Quote');
|
|
432
442
|
}
|
|
@@ -439,8 +449,8 @@ class EmblemVaultSDK {
|
|
|
439
449
|
return quote;
|
|
440
450
|
});
|
|
441
451
|
}
|
|
442
|
-
performMint(
|
|
443
|
-
return __awaiter(this,
|
|
452
|
+
performMint(web3_1, quote_1, remoteMintSig_1) {
|
|
453
|
+
return __awaiter(this, arguments, void 0, function* (web3, quote, remoteMintSig, callback = null) {
|
|
444
454
|
// async performMint(web3, quote, remoteMintSig, callback = null) {
|
|
445
455
|
if (callback) {
|
|
446
456
|
callback('performing Mint');
|
|
@@ -477,8 +487,8 @@ class EmblemVaultSDK {
|
|
|
477
487
|
return mintResponse;
|
|
478
488
|
});
|
|
479
489
|
}
|
|
480
|
-
performBurn(
|
|
481
|
-
return __awaiter(this,
|
|
490
|
+
performBurn(web3_1, tokenId_1) {
|
|
491
|
+
return __awaiter(this, arguments, void 0, function* (web3, tokenId, callback = null) {
|
|
482
492
|
let metadata = yield this.fetchMetadata(tokenId);
|
|
483
493
|
let targetContract = yield this.fetchCuratedContractByName(metadata.targetContract.name);
|
|
484
494
|
if (callback) {
|
|
@@ -539,20 +549,20 @@ class EmblemVaultSDK {
|
|
|
539
549
|
}));
|
|
540
550
|
});
|
|
541
551
|
}
|
|
542
|
-
checkLiveliness(
|
|
543
|
-
return __awaiter(this,
|
|
552
|
+
checkLiveliness(tokenId_1) {
|
|
553
|
+
return __awaiter(this, arguments, void 0, function* (tokenId, chainId = 1) {
|
|
544
554
|
let url = `${this.baseUrl}/liveliness-curated/`;
|
|
545
555
|
return yield (0, utils_1.fetchData)(url, this.apiKey, 'POST', { tokenId: tokenId }, { chainid: chainId, "Content-Type": "application/json" });
|
|
546
556
|
});
|
|
547
557
|
}
|
|
548
|
-
checkLivelinessBulk(
|
|
549
|
-
return __awaiter(this,
|
|
558
|
+
checkLivelinessBulk(tokenIds_1) {
|
|
559
|
+
return __awaiter(this, arguments, void 0, function* (tokenIds, chainId = 1) {
|
|
550
560
|
const chunkSize = 20;
|
|
551
561
|
let results = [];
|
|
552
562
|
let url = `${this.baseUrl}/batch_liveliness/`;
|
|
553
563
|
let apiKey = this.apiKey;
|
|
554
|
-
function processChunks(
|
|
555
|
-
return __awaiter(this,
|
|
564
|
+
function processChunks() {
|
|
565
|
+
return __awaiter(this, arguments, void 0, function* (i = 0, delay = 1000) {
|
|
556
566
|
if (i < tokenIds.length) {
|
|
557
567
|
let chunk = tokenIds.slice(i, i + chunkSize);
|
|
558
568
|
try {
|
|
@@ -572,8 +582,8 @@ class EmblemVaultSDK {
|
|
|
572
582
|
});
|
|
573
583
|
}
|
|
574
584
|
// BTC
|
|
575
|
-
sweepVaultUsingPhrase(
|
|
576
|
-
return __awaiter(this,
|
|
585
|
+
sweepVaultUsingPhrase(phrase_1) {
|
|
586
|
+
return __awaiter(this, arguments, void 0, function* (phrase, satsPerByte = 20, broadcast = false) {
|
|
577
587
|
const { paymentAddress, paymentPublicKey, ordinalsAddress } = yield (0, utils_1.getSatsConnectAddress)();
|
|
578
588
|
// change this to mainnet
|
|
579
589
|
if (window.bitcoin) {
|
package/dist/utils.js
CHANGED
|
@@ -12,7 +12,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.COIN_TO_NETWORK = exports.fetchData = exports.metadataAllProjects = exports.metadataObj2Arr = exports.evaluateFacts = exports.pad = exports.NFT_DATA = void 0;
|
|
16
|
+
exports.generateAttributeTemplate = generateAttributeTemplate;
|
|
17
|
+
exports.generateImageTemplate = generateImageTemplate;
|
|
18
|
+
exports.generateTemplate = generateTemplate;
|
|
19
|
+
exports.templateGuard = templateGuard;
|
|
20
|
+
exports.genericGuard = genericGuard;
|
|
21
|
+
exports.getQuoteContractObject = getQuoteContractObject;
|
|
22
|
+
exports.getHandlerContract = getHandlerContract;
|
|
23
|
+
exports.getLegacyContract = getLegacyContract;
|
|
24
|
+
exports.checkContentType = checkContentType;
|
|
25
|
+
exports.getTorusKeys = getTorusKeys;
|
|
26
|
+
exports.decryptKeys = decryptKeys;
|
|
27
|
+
exports.getSatsConnectAddress = getSatsConnectAddress;
|
|
28
|
+
exports.signPSBT = signPSBT;
|
|
16
29
|
const crypto_js_1 = __importDefault(require("crypto-js"));
|
|
17
30
|
const metadata_json_1 = __importDefault(require("./curated/metadata.json"));
|
|
18
31
|
const darkfarms_metadata_json_1 = __importDefault(require("./curated/darkfarms-metadata.json"));
|
|
@@ -68,7 +81,7 @@ const metadataAllProjects = (projects) => projects.reduce((unique, item) => {
|
|
|
68
81
|
return unique;
|
|
69
82
|
}, []);
|
|
70
83
|
exports.metadataAllProjects = metadataAllProjects;
|
|
71
|
-
const fetchData = (url, apiKey, method = 'GET', body = null, headers = null)
|
|
84
|
+
const fetchData = (url_1, apiKey_1, ...args_1) => __awaiter(void 0, [url_1, apiKey_1, ...args_1], void 0, function* (url, apiKey, method = 'GET', body = null, headers = null) {
|
|
72
85
|
const options = {
|
|
73
86
|
method: method,
|
|
74
87
|
headers: headers ? Object.assign(Object.assign({}, headers), { 'x-api-key': apiKey }) : { 'x-api-key': apiKey },
|
|
@@ -260,7 +273,6 @@ function generateAttributeTemplate(record) {
|
|
|
260
273
|
}
|
|
261
274
|
return template;
|
|
262
275
|
}
|
|
263
|
-
exports.generateAttributeTemplate = generateAttributeTemplate;
|
|
264
276
|
function generateImageTemplate(record) {
|
|
265
277
|
let template = {};
|
|
266
278
|
if (record.imageHandler) {
|
|
@@ -282,7 +294,6 @@ function generateImageTemplate(record) {
|
|
|
282
294
|
}
|
|
283
295
|
return template;
|
|
284
296
|
}
|
|
285
|
-
exports.generateImageTemplate = generateImageTemplate;
|
|
286
297
|
/**
|
|
287
298
|
* generateTemplate defines rules and utilitites for a given curated
|
|
288
299
|
* collection. This is used by callers, like emblem.finance website
|
|
@@ -627,7 +638,6 @@ function generateTemplate(record) {
|
|
|
627
638
|
});
|
|
628
639
|
return template;
|
|
629
640
|
}
|
|
630
|
-
exports.generateTemplate = generateTemplate;
|
|
631
641
|
function templateGuard(input) {
|
|
632
642
|
if (!input)
|
|
633
643
|
throw new Error(`No template provided`);
|
|
@@ -662,14 +672,12 @@ function templateGuard(input) {
|
|
|
662
672
|
}
|
|
663
673
|
}
|
|
664
674
|
}
|
|
665
|
-
exports.templateGuard = templateGuard;
|
|
666
675
|
function genericGuard(input, type, key) {
|
|
667
676
|
if (!input)
|
|
668
677
|
throw new Error(`No ${key} provided`);
|
|
669
678
|
if (typeof input !== type)
|
|
670
679
|
throw new Error(`Invalid ${key} provided`);
|
|
671
680
|
}
|
|
672
|
-
exports.genericGuard = genericGuard;
|
|
673
681
|
function getQuoteContractObject(web3) {
|
|
674
682
|
return __awaiter(this, void 0, void 0, function* () {
|
|
675
683
|
let contractAddress = '0xE5dec92911c78069d727a67C85936EDDbc9B02Cf';
|
|
@@ -677,7 +685,6 @@ function getQuoteContractObject(web3) {
|
|
|
677
685
|
return quoteContract;
|
|
678
686
|
});
|
|
679
687
|
}
|
|
680
|
-
exports.getQuoteContractObject = getQuoteContractObject;
|
|
681
688
|
function getHandlerContract(web3) {
|
|
682
689
|
return __awaiter(this, void 0, void 0, function* () {
|
|
683
690
|
let contractAddress = '0x23859b51117dbFBcdEf5b757028B18d7759a4460';
|
|
@@ -685,7 +692,6 @@ function getHandlerContract(web3) {
|
|
|
685
692
|
return handlerContract;
|
|
686
693
|
});
|
|
687
694
|
}
|
|
688
|
-
exports.getHandlerContract = getHandlerContract;
|
|
689
695
|
function getLegacyContract(web3) {
|
|
690
696
|
return __awaiter(this, void 0, void 0, function* () {
|
|
691
697
|
let contractAddress = '0x82c7a8f707110f5fbb16184a5933e9f78a34c6ab';
|
|
@@ -693,7 +699,6 @@ function getLegacyContract(web3) {
|
|
|
693
699
|
return handlerContract;
|
|
694
700
|
});
|
|
695
701
|
}
|
|
696
|
-
exports.getLegacyContract = getLegacyContract;
|
|
697
702
|
function checkContentType(url) {
|
|
698
703
|
return new Promise((resolve, reject) => {
|
|
699
704
|
let returnVal = { valid: false };
|
|
@@ -743,7 +748,6 @@ function checkContentType(url) {
|
|
|
743
748
|
});
|
|
744
749
|
});
|
|
745
750
|
}
|
|
746
|
-
exports.checkContentType = checkContentType;
|
|
747
751
|
// export function checkContentType(url: string) {
|
|
748
752
|
// return new Promise((resolve, reject) => {
|
|
749
753
|
// // Making a HTTP HEAD request to get only the headers
|
|
@@ -858,8 +862,8 @@ const mimeToExtensionMap = {
|
|
|
858
862
|
"video/vnd.dlna.mpeg-tts": ".ts"
|
|
859
863
|
// Add more mappings if needed
|
|
860
864
|
};
|
|
861
|
-
function getTorusKeys(
|
|
862
|
-
return __awaiter(this,
|
|
865
|
+
function getTorusKeys(verifierId_1, idToken_1) {
|
|
866
|
+
return __awaiter(this, arguments, void 0, function* (verifierId, idToken, cb = null) {
|
|
863
867
|
const FetchNodeDetails = require("@toruslabs/fetch-node-details").default;
|
|
864
868
|
const TorusUtils = require("@toruslabs/torus.js").default;
|
|
865
869
|
const fetchNodeDetails = new FetchNodeDetails();
|
|
@@ -869,7 +873,6 @@ function getTorusKeys(verifierId, idToken, cb = null) {
|
|
|
869
873
|
return { privateKey: privKey };
|
|
870
874
|
});
|
|
871
875
|
}
|
|
872
|
-
exports.getTorusKeys = getTorusKeys;
|
|
873
876
|
function decryptKeys(vaultCiphertextV2, keys, addresses) {
|
|
874
877
|
return __awaiter(this, void 0, void 0, function* () {
|
|
875
878
|
try {
|
|
@@ -887,7 +890,6 @@ function decryptKeys(vaultCiphertextV2, keys, addresses) {
|
|
|
887
890
|
}
|
|
888
891
|
});
|
|
889
892
|
}
|
|
890
|
-
exports.decryptKeys = decryptKeys;
|
|
891
893
|
function getSatsConnectAddress() {
|
|
892
894
|
return __awaiter(this, void 0, void 0, function* () {
|
|
893
895
|
return new Promise((resolve, reject) => {
|
|
@@ -918,9 +920,8 @@ function getSatsConnectAddress() {
|
|
|
918
920
|
});
|
|
919
921
|
});
|
|
920
922
|
}
|
|
921
|
-
|
|
922
|
-
function
|
|
923
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
923
|
+
function signPSBT(psbtBase64_1, paymentAddress_1, indexes_1) {
|
|
924
|
+
return __awaiter(this, arguments, void 0, function* (psbtBase64, paymentAddress, indexes, broadcast = false) {
|
|
924
925
|
return new Promise((resolve, reject) => {
|
|
925
926
|
(0, sats_connect_1.signTransaction)({
|
|
926
927
|
payload: {
|
|
@@ -951,4 +952,3 @@ function signPSBT(psbtBase64, paymentAddress, indexes, broadcast = false) {
|
|
|
951
952
|
});
|
|
952
953
|
});
|
|
953
954
|
}
|
|
954
|
-
exports.signPSBT = signPSBT;
|