@primuslabs/fund-js-sdk 0.1.8 → 0.1.9
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.js +0 -9
- package/dist/index.mjs +0 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1364,7 +1364,6 @@ var Erc721Contract_default = Erc721Contract;
|
|
|
1364
1364
|
// src/classes/Fund.ts
|
|
1365
1365
|
var { parseUnits, formatUnits } = import_ethers2.ethers.utils;
|
|
1366
1366
|
var Fund = class {
|
|
1367
|
-
_attestLoading;
|
|
1368
1367
|
zkTlsSdk;
|
|
1369
1368
|
fundContract;
|
|
1370
1369
|
provider;
|
|
@@ -1372,7 +1371,6 @@ var Fund = class {
|
|
|
1372
1371
|
chainId;
|
|
1373
1372
|
_dataSourceTemplateMap = DATASOURCETEMPLATESMAP;
|
|
1374
1373
|
constructor() {
|
|
1375
|
-
this._attestLoading = false;
|
|
1376
1374
|
}
|
|
1377
1375
|
getZkTlsSdk() {
|
|
1378
1376
|
return this.zkTlsSdk;
|
|
@@ -1616,11 +1614,7 @@ var Fund = class {
|
|
|
1616
1614
|
async attest(attestParams, genAppSignature, backUrl) {
|
|
1617
1615
|
return new Promise(async (resolve, reject) => {
|
|
1618
1616
|
console.log("this.zkTlsSdk", this.zkTlsSdk);
|
|
1619
|
-
if (this._attestLoading) {
|
|
1620
|
-
return reject(`Under proof!`);
|
|
1621
|
-
}
|
|
1622
1617
|
const { socialPlatform, userIdentifier, address } = attestParams;
|
|
1623
|
-
this._attestLoading = true;
|
|
1624
1618
|
const { id: templateId, field } = this._dataSourceTemplateMap[socialPlatform];
|
|
1625
1619
|
const attRequest = this.zkTlsSdk.generateRequestParams(
|
|
1626
1620
|
templateId,
|
|
@@ -1642,7 +1636,6 @@ var Fund = class {
|
|
|
1642
1636
|
const signParams = attRequest.toJsonString();
|
|
1643
1637
|
const signature = await genAppSignature(signParams);
|
|
1644
1638
|
if (!signature) {
|
|
1645
|
-
this._attestLoading = false;
|
|
1646
1639
|
return reject(`appSignature is empty!`);
|
|
1647
1640
|
}
|
|
1648
1641
|
try {
|
|
@@ -1655,10 +1648,8 @@ var Fund = class {
|
|
|
1655
1648
|
const attestation = await this.zkTlsSdk.startAttestation(
|
|
1656
1649
|
JSON.stringify(formatAttestParams)
|
|
1657
1650
|
);
|
|
1658
|
-
this._attestLoading = false;
|
|
1659
1651
|
return resolve(attestation);
|
|
1660
1652
|
} catch (error) {
|
|
1661
|
-
this._attestLoading = false;
|
|
1662
1653
|
return reject(error);
|
|
1663
1654
|
}
|
|
1664
1655
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1340,7 +1340,6 @@ var Erc721Contract_default = Erc721Contract;
|
|
|
1340
1340
|
// src/classes/Fund.ts
|
|
1341
1341
|
var { parseUnits, formatUnits } = ethers2.utils;
|
|
1342
1342
|
var Fund = class {
|
|
1343
|
-
_attestLoading;
|
|
1344
1343
|
zkTlsSdk;
|
|
1345
1344
|
fundContract;
|
|
1346
1345
|
provider;
|
|
@@ -1348,7 +1347,6 @@ var Fund = class {
|
|
|
1348
1347
|
chainId;
|
|
1349
1348
|
_dataSourceTemplateMap = DATASOURCETEMPLATESMAP;
|
|
1350
1349
|
constructor() {
|
|
1351
|
-
this._attestLoading = false;
|
|
1352
1350
|
}
|
|
1353
1351
|
getZkTlsSdk() {
|
|
1354
1352
|
return this.zkTlsSdk;
|
|
@@ -1592,11 +1590,7 @@ var Fund = class {
|
|
|
1592
1590
|
async attest(attestParams, genAppSignature, backUrl) {
|
|
1593
1591
|
return new Promise(async (resolve, reject) => {
|
|
1594
1592
|
console.log("this.zkTlsSdk", this.zkTlsSdk);
|
|
1595
|
-
if (this._attestLoading) {
|
|
1596
|
-
return reject(`Under proof!`);
|
|
1597
|
-
}
|
|
1598
1593
|
const { socialPlatform, userIdentifier, address } = attestParams;
|
|
1599
|
-
this._attestLoading = true;
|
|
1600
1594
|
const { id: templateId, field } = this._dataSourceTemplateMap[socialPlatform];
|
|
1601
1595
|
const attRequest = this.zkTlsSdk.generateRequestParams(
|
|
1602
1596
|
templateId,
|
|
@@ -1618,7 +1612,6 @@ var Fund = class {
|
|
|
1618
1612
|
const signParams = attRequest.toJsonString();
|
|
1619
1613
|
const signature = await genAppSignature(signParams);
|
|
1620
1614
|
if (!signature) {
|
|
1621
|
-
this._attestLoading = false;
|
|
1622
1615
|
return reject(`appSignature is empty!`);
|
|
1623
1616
|
}
|
|
1624
1617
|
try {
|
|
@@ -1631,10 +1624,8 @@ var Fund = class {
|
|
|
1631
1624
|
const attestation = await this.zkTlsSdk.startAttestation(
|
|
1632
1625
|
JSON.stringify(formatAttestParams)
|
|
1633
1626
|
);
|
|
1634
|
-
this._attestLoading = false;
|
|
1635
1627
|
return resolve(attestation);
|
|
1636
1628
|
} catch (error) {
|
|
1637
|
-
this._attestLoading = false;
|
|
1638
1629
|
return reject(error);
|
|
1639
1630
|
}
|
|
1640
1631
|
});
|