bitbadgesjs-sdk 0.5.2 → 0.5.4
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/cjs/api-indexer/BitBadgesApi.d.ts +2 -5
- package/dist/cjs/api-indexer/BitBadgesApi.d.ts.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesApi.js +304 -459
- package/dist/cjs/api-indexer/BitBadgesApi.js.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesUserInfo.d.ts +4 -8
- package/dist/cjs/api-indexer/BitBadgesUserInfo.d.ts.map +1 -1
- package/dist/cjs/api-indexer/BitBadgesUserInfo.js +4 -16
- package/dist/cjs/api-indexer/BitBadgesUserInfo.js.map +1 -1
- package/dist/cjs/api-indexer/docs/docs.d.ts +7 -33
- package/dist/cjs/api-indexer/docs/docs.d.ts.map +1 -1
- package/dist/cjs/api-indexer/docs/docs.js +5 -30
- package/dist/cjs/api-indexer/docs/docs.js.map +1 -1
- package/dist/cjs/api-indexer/docs/interfaces.d.ts +0 -3
- package/dist/cjs/api-indexer/docs/interfaces.d.ts.map +1 -1
- package/dist/cjs/api-indexer/requests/requests.d.ts +22 -58
- package/dist/cjs/api-indexer/requests/requests.d.ts.map +1 -1
- package/dist/cjs/api-indexer/requests/requests.js +12 -21
- package/dist/cjs/api-indexer/requests/requests.js.map +1 -1
- package/dist/cjs/api-indexer/requests/routes.d.ts +0 -2
- package/dist/cjs/api-indexer/requests/routes.d.ts.map +1 -1
- package/dist/cjs/api-indexer/requests/routes.js +0 -2
- package/dist/cjs/api-indexer/requests/routes.js.map +1 -1
- package/dist/cjs/core/attestations.d.ts +17 -3
- package/dist/cjs/core/attestations.d.ts.map +1 -1
- package/dist/cjs/core/attestations.js +10 -12
- package/dist/cjs/core/attestations.js.map +1 -1
- package/dist/cjs/core/secrets.d.ts +14 -34
- package/dist/cjs/core/secrets.d.ts.map +1 -1
- package/dist/cjs/core/secrets.js +17 -28
- package/dist/cjs/core/secrets.js.map +1 -1
- package/dist/cjs/interfaces/badges/core.d.ts +8 -30
- package/dist/cjs/interfaces/badges/core.d.ts.map +1 -1
- package/dist/esm/api-indexer/BitBadgesApi.d.ts +2 -5
- package/dist/esm/api-indexer/BitBadgesApi.d.ts.map +1 -1
- package/dist/esm/api-indexer/BitBadgesApi.js +305 -460
- package/dist/esm/api-indexer/BitBadgesApi.js.map +1 -1
- package/dist/esm/api-indexer/BitBadgesUserInfo.d.ts +4 -8
- package/dist/esm/api-indexer/BitBadgesUserInfo.d.ts.map +1 -1
- package/dist/esm/api-indexer/BitBadgesUserInfo.js +5 -18
- package/dist/esm/api-indexer/BitBadgesUserInfo.js.map +1 -1
- package/dist/esm/api-indexer/docs/docs.d.ts +7 -33
- package/dist/esm/api-indexer/docs/docs.d.ts.map +1 -1
- package/dist/esm/api-indexer/docs/docs.js +8 -45
- package/dist/esm/api-indexer/docs/docs.js.map +1 -1
- package/dist/esm/api-indexer/docs/interfaces.d.ts +0 -3
- package/dist/esm/api-indexer/docs/interfaces.d.ts.map +1 -1
- package/dist/esm/api-indexer/requests/requests.d.ts +22 -58
- package/dist/esm/api-indexer/requests/requests.d.ts.map +1 -1
- package/dist/esm/api-indexer/requests/requests.js +12 -18
- package/dist/esm/api-indexer/requests/requests.js.map +1 -1
- package/dist/esm/api-indexer/requests/routes.d.ts +0 -2
- package/dist/esm/api-indexer/requests/routes.d.ts.map +1 -1
- package/dist/esm/api-indexer/requests/routes.js +0 -2
- package/dist/esm/api-indexer/requests/routes.js.map +1 -1
- package/dist/esm/core/attestations.d.ts +17 -3
- package/dist/esm/core/attestations.d.ts.map +1 -1
- package/dist/esm/core/attestations.js +11 -13
- package/dist/esm/core/attestations.js.map +1 -1
- package/dist/esm/core/secrets.d.ts +14 -34
- package/dist/esm/core/secrets.d.ts.map +1 -1
- package/dist/esm/core/secrets.js +23 -42
- package/dist/esm/core/secrets.js.map +1 -1
- package/dist/esm/interfaces/badges/core.d.ts +8 -30
- package/dist/esm/interfaces/badges/core.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1167,7 +1167,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
async getBrowseCollections(payload) {
|
|
1169
1169
|
try {
|
|
1170
|
-
const validateRes = (() => { const $io0 = input => ("addressLists" === input.type || "badges" === input.type || "
|
|
1170
|
+
const validateRes = (() => { const $io0 = input => ("addressLists" === input.type || "badges" === input.type || "attestations" === input.type || "collections" === input.type || "maps" === input.type || "claims" === input.type || "activity" === input.type) && (undefined === input.filters || "object" === typeof input.filters && null !== input.filters && false === Array.isArray(input.filters) && $io1(input.filters)); const $io1 = input => (undefined === input.category || "string" === typeof input.category) && (undefined === input.sortBy || "string" === typeof input.sortBy) && (undefined === input.timeFrame || "string" === typeof input.timeFrame) && (undefined === input.searchTerm || "string" === typeof input.searchTerm); const $vo0 = (input, _path, _exceptionable = true) => ["addressLists" === input.type || "badges" === input.type || "attestations" === input.type || "collections" === input.type || "maps" === input.type || "claims" === input.type || "activity" === input.type || $report(_exceptionable, {
|
|
1171
1171
|
path: _path + ".type",
|
|
1172
1172
|
expected: "(\"activity\" | \"addressLists\" | \"attestations\" | \"badges\" | \"claims\" | \"collections\" | \"maps\")",
|
|
1173
1173
|
value: input.type
|
|
@@ -1562,7 +1562,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
async createSIWBBRequest(payload) {
|
|
1564
1564
|
try {
|
|
1565
|
-
const validateRes = (() => { const $io0 = input => "string" === typeof input.response_type && (Array.isArray(input.scopes) && input.scopes.every(elem => "object" === typeof elem && null !== elem && $io1(elem))) && (undefined === input.name || "string" === typeof input.name) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.image || "string" === typeof input.image) && (undefined === input.attestationsPresentations || Array.isArray(input.attestationsPresentations) && input.attestationsPresentations.every(elem => "object" === typeof elem && null !== elem && $io3(elem))) && "string" === typeof input.client_id && (undefined === input.otherSignIns || Array.isArray(input.otherSignIns) && input.otherSignIns.every(elem => "discord" === elem || "github" === elem || "google" === elem || "twitter" === elem)) && (undefined === input.redirect_uri || "string" === typeof input.redirect_uri) && (undefined === input.state || "string" === typeof input.state); const $io1 = input => "string" === typeof input.scopeName && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && $io2(input.options)); const $io2 = input => true; const $io3 = input =>
|
|
1565
|
+
const validateRes = (() => { const $io0 = input => "string" === typeof input.response_type && (Array.isArray(input.scopes) && input.scopes.every(elem => "object" === typeof elem && null !== elem && $io1(elem))) && (undefined === input.name || "string" === typeof input.name) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.image || "string" === typeof input.image) && (undefined === input.attestationsPresentations || Array.isArray(input.attestationsPresentations) && input.attestationsPresentations.every(elem => "object" === typeof elem && null !== elem && $io3(elem))) && "string" === typeof input.client_id && (undefined === input.otherSignIns || Array.isArray(input.otherSignIns) && input.otherSignIns.every(elem => "discord" === elem || "github" === elem || "google" === elem || "twitter" === elem)) && (undefined === input.redirect_uri || "string" === typeof input.redirect_uri) && (undefined === input.state || "string" === typeof input.state); const $io1 = input => "string" === typeof input.scopeName && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && $io2(input.options)); const $io2 = input => true; const $io3 = input => Array.isArray(input.updateHistory) && input.updateHistory.every(elem => "object" === typeof elem && null !== elem && $io4(elem)) && "string" === typeof input._docId && (undefined === input._id || "string" === typeof input._id) && ("plaintext" === input.messageFormat || "json" === input.messageFormat) && "string" === typeof input.createdBy && ("string" === typeof input.createdAt || "number" === typeof input.createdAt || "bigint" === typeof input.createdAt) && (Array.isArray(input.entropies) && input.entropies.every(elem => "string" === typeof elem)) && (undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility) && ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance && $io5(input.proofOfIssuance)) && "string" === typeof input.attestationId && "string" === typeof input.inviteCode && "string" === typeof input.scheme && (undefined === input.originalProvider || "string" === typeof input.originalProvider) && (Array.isArray(input.messages) && input.messages.every(elem => "string" === typeof elem)) && ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof && $io6(input.dataIntegrityProof)) && "string" === typeof input.name && "string" === typeof input.image && "string" === typeof input.description && (Array.isArray(input.holders) && input.holders.every(elem => "string" === typeof elem)) && (Array.isArray(input.anchors) && input.anchors.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io7(elem))); const $io4 = input => "string" === typeof input.txHash && ("string" === typeof input.block || "number" === typeof input.block || "bigint" === typeof input.block) && ("string" === typeof input.blockTimestamp || "number" === typeof input.blockTimestamp || "bigint" === typeof input.blockTimestamp) && ("string" === typeof input.timestamp || "number" === typeof input.timestamp || "bigint" === typeof input.timestamp); const $io5 = input => "string" === typeof input.message && "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io6 = input => "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey) && (undefined === input.isDerived || "boolean" === typeof input.isDerived); const $io7 = input => (undefined === input.txHash || "string" === typeof input.txHash) && (undefined === input.message || "string" === typeof input.message); const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.response_type || $report(_exceptionable, {
|
|
1566
1566
|
path: _path + ".response_type",
|
|
1567
1567
|
expected: "string",
|
|
1568
1568
|
value: input.response_type
|
|
@@ -1570,12 +1570,12 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1570
1570
|
path: _path + ".scopes",
|
|
1571
1571
|
expected: "Array<OAuthScopeDetails>",
|
|
1572
1572
|
value: input.scopes
|
|
1573
|
-
})) && input.scopes.map((elem,
|
|
1574
|
-
path: _path + ".scopes[" +
|
|
1573
|
+
})) && input.scopes.map((elem, _index9) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
1574
|
+
path: _path + ".scopes[" + _index9 + "]",
|
|
1575
1575
|
expected: "OAuthScopeDetails",
|
|
1576
1576
|
value: elem
|
|
1577
|
-
})) && $vo1(elem, _path + ".scopes[" +
|
|
1578
|
-
path: _path + ".scopes[" +
|
|
1577
|
+
})) && $vo1(elem, _path + ".scopes[" + _index9 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
1578
|
+
path: _path + ".scopes[" + _index9 + "]",
|
|
1579
1579
|
expected: "OAuthScopeDetails",
|
|
1580
1580
|
value: elem
|
|
1581
1581
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -1598,12 +1598,12 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1598
1598
|
path: _path + ".attestationsPresentations",
|
|
1599
1599
|
expected: "(Array<iAttestationsProof<NumberType>> | undefined)",
|
|
1600
1600
|
value: input.attestationsPresentations
|
|
1601
|
-
})) && input.attestationsPresentations.map((elem,
|
|
1602
|
-
path: _path + ".attestationsPresentations[" +
|
|
1601
|
+
})) && input.attestationsPresentations.map((elem, _index10) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
1602
|
+
path: _path + ".attestationsPresentations[" + _index10 + "]",
|
|
1603
1603
|
expected: "iAttestationsProof<NumberType>",
|
|
1604
1604
|
value: elem
|
|
1605
|
-
})) && $vo3(elem, _path + ".attestationsPresentations[" +
|
|
1606
|
-
path: _path + ".attestationsPresentations[" +
|
|
1605
|
+
})) && $vo3(elem, _path + ".attestationsPresentations[" + _index10 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
1606
|
+
path: _path + ".attestationsPresentations[" + _index10 + "]",
|
|
1607
1607
|
expected: "iAttestationsProof<NumberType>",
|
|
1608
1608
|
value: elem
|
|
1609
1609
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -1618,8 +1618,8 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1618
1618
|
path: _path + ".otherSignIns",
|
|
1619
1619
|
expected: "(Array<\"discord\" | \"github\" | \"google\" | \"twitter\"> | undefined)",
|
|
1620
1620
|
value: input.otherSignIns
|
|
1621
|
-
})) && input.otherSignIns.map((elem,
|
|
1622
|
-
path: _path + ".otherSignIns[" +
|
|
1621
|
+
})) && input.otherSignIns.map((elem, _index11) => "discord" === elem || "github" === elem || "google" === elem || "twitter" === elem || $report(_exceptionable, {
|
|
1622
|
+
path: _path + ".otherSignIns[" + _index11 + "]",
|
|
1623
1623
|
expected: "(\"discord\" | \"github\" | \"google\" | \"twitter\")",
|
|
1624
1624
|
value: elem
|
|
1625
1625
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -1646,21 +1646,9 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1646
1646
|
path: _path + ".options",
|
|
1647
1647
|
expected: "(object | undefined)",
|
|
1648
1648
|
value: input.options
|
|
1649
|
-
})].every(flag => flag); const $vo2 = (input, _path, _exceptionable = true) => true; const $vo3 = (input, _path, _exceptionable = true) => [
|
|
1650
|
-
path: _path + ".entropies",
|
|
1651
|
-
expected: "(Array<string> | undefined)",
|
|
1652
|
-
value: input.entropies
|
|
1653
|
-
})) && input.entropies.map((elem, _index11) => "string" === typeof elem || $report(_exceptionable, {
|
|
1654
|
-
path: _path + ".entropies[" + _index11 + "]",
|
|
1655
|
-
expected: "string",
|
|
1656
|
-
value: elem
|
|
1657
|
-
})).every(flag => flag) || $report(_exceptionable, {
|
|
1658
|
-
path: _path + ".entropies",
|
|
1659
|
-
expected: "(Array<string> | undefined)",
|
|
1660
|
-
value: input.entropies
|
|
1661
|
-
}), undefined === input.updateHistory || (Array.isArray(input.updateHistory) || $report(_exceptionable, {
|
|
1649
|
+
})].every(flag => flag); const $vo2 = (input, _path, _exceptionable = true) => true; const $vo3 = (input, _path, _exceptionable = true) => [(Array.isArray(input.updateHistory) || $report(_exceptionable, {
|
|
1662
1650
|
path: _path + ".updateHistory",
|
|
1663
|
-
expected: "
|
|
1651
|
+
expected: "Array<iUpdateHistory<NumberType>>",
|
|
1664
1652
|
value: input.updateHistory
|
|
1665
1653
|
})) && input.updateHistory.map((elem, _index12) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
1666
1654
|
path: _path + ".updateHistory[" + _index12 + "]",
|
|
@@ -1672,8 +1660,16 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1672
1660
|
value: elem
|
|
1673
1661
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
1674
1662
|
path: _path + ".updateHistory",
|
|
1675
|
-
expected: "
|
|
1663
|
+
expected: "Array<iUpdateHistory<NumberType>>",
|
|
1676
1664
|
value: input.updateHistory
|
|
1665
|
+
}), "string" === typeof input._docId || $report(_exceptionable, {
|
|
1666
|
+
path: _path + "._docId",
|
|
1667
|
+
expected: "string",
|
|
1668
|
+
value: input._docId
|
|
1669
|
+
}), undefined === input._id || "string" === typeof input._id || $report(_exceptionable, {
|
|
1670
|
+
path: _path + "._id",
|
|
1671
|
+
expected: "(string | undefined)",
|
|
1672
|
+
value: input._id
|
|
1677
1673
|
}), "plaintext" === input.messageFormat || "json" === input.messageFormat || $report(_exceptionable, {
|
|
1678
1674
|
path: _path + ".messageFormat",
|
|
1679
1675
|
expected: "(\"json\" | \"plaintext\")",
|
|
@@ -1686,6 +1682,22 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1686
1682
|
path: _path + ".createdAt",
|
|
1687
1683
|
expected: "(bigint | number | string)",
|
|
1688
1684
|
value: input.createdAt
|
|
1685
|
+
}), (Array.isArray(input.entropies) || $report(_exceptionable, {
|
|
1686
|
+
path: _path + ".entropies",
|
|
1687
|
+
expected: "Array<string>",
|
|
1688
|
+
value: input.entropies
|
|
1689
|
+
})) && input.entropies.map((elem, _index13) => "string" === typeof elem || $report(_exceptionable, {
|
|
1690
|
+
path: _path + ".entropies[" + _index13 + "]",
|
|
1691
|
+
expected: "string",
|
|
1692
|
+
value: elem
|
|
1693
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
1694
|
+
path: _path + ".entropies",
|
|
1695
|
+
expected: "Array<string>",
|
|
1696
|
+
value: input.entropies
|
|
1697
|
+
}), undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility || $report(_exceptionable, {
|
|
1698
|
+
path: _path + ".publicVisibility",
|
|
1699
|
+
expected: "(boolean | undefined)",
|
|
1700
|
+
value: input.publicVisibility
|
|
1689
1701
|
}), ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance || $report(_exceptionable, {
|
|
1690
1702
|
path: _path + ".proofOfIssuance",
|
|
1691
1703
|
expected: "__type",
|
|
@@ -1694,22 +1706,34 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1694
1706
|
path: _path + ".proofOfIssuance",
|
|
1695
1707
|
expected: "__type",
|
|
1696
1708
|
value: input.proofOfIssuance
|
|
1697
|
-
}), "
|
|
1709
|
+
}), "string" === typeof input.attestationId || $report(_exceptionable, {
|
|
1710
|
+
path: _path + ".attestationId",
|
|
1711
|
+
expected: "string",
|
|
1712
|
+
value: input.attestationId
|
|
1713
|
+
}), "string" === typeof input.inviteCode || $report(_exceptionable, {
|
|
1714
|
+
path: _path + ".inviteCode",
|
|
1715
|
+
expected: "string",
|
|
1716
|
+
value: input.inviteCode
|
|
1717
|
+
}), "string" === typeof input.scheme || $report(_exceptionable, {
|
|
1698
1718
|
path: _path + ".scheme",
|
|
1699
|
-
expected: "
|
|
1719
|
+
expected: "string",
|
|
1700
1720
|
value: input.scheme
|
|
1701
|
-
}),
|
|
1702
|
-
path: _path + ".
|
|
1721
|
+
}), undefined === input.originalProvider || "string" === typeof input.originalProvider || $report(_exceptionable, {
|
|
1722
|
+
path: _path + ".originalProvider",
|
|
1723
|
+
expected: "(string | undefined)",
|
|
1724
|
+
value: input.originalProvider
|
|
1725
|
+
}), (Array.isArray(input.messages) || $report(_exceptionable, {
|
|
1726
|
+
path: _path + ".messages",
|
|
1703
1727
|
expected: "Array<string>",
|
|
1704
|
-
value: input.
|
|
1705
|
-
})) && input.
|
|
1706
|
-
path: _path + ".
|
|
1728
|
+
value: input.messages
|
|
1729
|
+
})) && input.messages.map((elem, _index14) => "string" === typeof elem || $report(_exceptionable, {
|
|
1730
|
+
path: _path + ".messages[" + _index14 + "]",
|
|
1707
1731
|
expected: "string",
|
|
1708
1732
|
value: elem
|
|
1709
1733
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
1710
|
-
path: _path + ".
|
|
1734
|
+
path: _path + ".messages",
|
|
1711
1735
|
expected: "Array<string>",
|
|
1712
|
-
value: input.
|
|
1736
|
+
value: input.messages
|
|
1713
1737
|
}), ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof || $report(_exceptionable, {
|
|
1714
1738
|
path: _path + ".dataIntegrityProof",
|
|
1715
1739
|
expected: "__type.o1",
|
|
@@ -1730,21 +1754,33 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1730
1754
|
path: _path + ".description",
|
|
1731
1755
|
expected: "string",
|
|
1732
1756
|
value: input.description
|
|
1733
|
-
}),
|
|
1757
|
+
}), (Array.isArray(input.holders) || $report(_exceptionable, {
|
|
1758
|
+
path: _path + ".holders",
|
|
1759
|
+
expected: "Array<string>",
|
|
1760
|
+
value: input.holders
|
|
1761
|
+
})) && input.holders.map((elem, _index15) => "string" === typeof elem || $report(_exceptionable, {
|
|
1762
|
+
path: _path + ".holders[" + _index15 + "]",
|
|
1763
|
+
expected: "string",
|
|
1764
|
+
value: elem
|
|
1765
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
1766
|
+
path: _path + ".holders",
|
|
1767
|
+
expected: "Array<string>",
|
|
1768
|
+
value: input.holders
|
|
1769
|
+
}), (Array.isArray(input.anchors) || $report(_exceptionable, {
|
|
1734
1770
|
path: _path + ".anchors",
|
|
1735
|
-
expected: "
|
|
1771
|
+
expected: "Array<__type>",
|
|
1736
1772
|
value: input.anchors
|
|
1737
|
-
})) && input.anchors.map((elem,
|
|
1738
|
-
path: _path + ".anchors[" +
|
|
1773
|
+
})) && input.anchors.map((elem, _index16) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $report(_exceptionable, {
|
|
1774
|
+
path: _path + ".anchors[" + _index16 + "]",
|
|
1739
1775
|
expected: "__type.o2",
|
|
1740
1776
|
value: elem
|
|
1741
|
-
})) && $vo7(elem, _path + ".anchors[" +
|
|
1742
|
-
path: _path + ".anchors[" +
|
|
1777
|
+
})) && $vo7(elem, _path + ".anchors[" + _index16 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
1778
|
+
path: _path + ".anchors[" + _index16 + "]",
|
|
1743
1779
|
expected: "__type.o2",
|
|
1744
1780
|
value: elem
|
|
1745
1781
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
1746
1782
|
path: _path + ".anchors",
|
|
1747
|
-
expected: "
|
|
1783
|
+
expected: "Array<__type>",
|
|
1748
1784
|
value: input.anchors
|
|
1749
1785
|
})].every(flag => flag); const $vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.txHash || $report(_exceptionable, {
|
|
1750
1786
|
path: _path + ".txHash",
|
|
@@ -1790,6 +1826,10 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1790
1826
|
path: _path + ".publicKey",
|
|
1791
1827
|
expected: "(string | undefined)",
|
|
1792
1828
|
value: input.publicKey
|
|
1829
|
+
}), undefined === input.isDerived || "boolean" === typeof input.isDerived || $report(_exceptionable, {
|
|
1830
|
+
path: _path + ".isDerived",
|
|
1831
|
+
expected: "(boolean | undefined)",
|
|
1832
|
+
value: input.isDerived
|
|
1793
1833
|
})].every(flag => flag); const $vo7 = (input, _path, _exceptionable = true) => [undefined === input.txHash || "string" === typeof input.txHash || $report(_exceptionable, {
|
|
1794
1834
|
path: _path + ".txHash",
|
|
1795
1835
|
expected: "(string | undefined)",
|
|
@@ -1923,7 +1963,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1923
1963
|
}
|
|
1924
1964
|
async verifySIWBBRequest(payload) {
|
|
1925
1965
|
try {
|
|
1926
|
-
const validateRes = (() => { const $io0 = input => (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && $io1(input.options)) && (undefined === input.attestationsPresentations || Array.isArray(input.attestationsPresentations) && input.attestationsPresentations.every(elem => "object" === typeof elem && null !== elem && $io10(elem))) && "string" === typeof input.message && "string" === typeof input.signature && (undefined === input.altSigner || "string" === typeof input.altSigner) && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io1 = input => (undefined === input.expectedChallengeParams || "object" === typeof input.expectedChallengeParams && null !== input.expectedChallengeParams && false === Array.isArray(input.expectedChallengeParams) && $io2(input.expectedChallengeParams)) && (undefined === input.beforeVerification || true) && (undefined === input.balancesSnapshot || "object" === typeof input.balancesSnapshot && null !== input.balancesSnapshot && false === Array.isArray(input.balancesSnapshot) && $io9(input.balancesSnapshot)) && (undefined === input.verificationTimeOverride || "number" === typeof input.verificationTimeOverride) && (undefined === input.skipTimestampVerification || "boolean" === typeof input.skipTimestampVerification) && (undefined === input.skipAssetVerification || "boolean" === typeof input.skipAssetVerification) && (undefined === input.earliestIssuedAt || "string" === typeof input.earliestIssuedAt) && (undefined === input.issuedAtTimeWindowMs || "number" === typeof input.issuedAtTimeWindowMs) && (undefined === input.skipSignatureVerification || "boolean" === typeof input.skipSignatureVerification); const $io2 = input => (undefined === input.domain || "string" === typeof input.domain) && (undefined === input.statement || "string" === typeof input.statement) && (undefined === input.address || "string" === typeof input.address) && (undefined === input.uri || "string" === typeof input.uri) && (undefined === input.nonce || "string" === typeof input.nonce) && (undefined === input.version || "string" === typeof input.version) && (undefined === input.chainId || "string" === typeof input.chainId) && (undefined === input.issuedAt || "string" === typeof input.issuedAt) && (undefined === input.expirationDate || "string" === typeof input.expirationDate) && (undefined === input.notBefore || "string" === typeof input.notBefore) && (undefined === input.resources || Array.isArray(input.resources) && input.resources.every(elem => "string" === typeof elem)) && (undefined === input.assetOwnershipRequirements || "object" === typeof input.assetOwnershipRequirements && null !== input.assetOwnershipRequirements && $iu0(input.assetOwnershipRequirements)); const $io3 = input => Array.isArray(input.$and) && input.$and.every(elem => "object" === typeof elem && null !== elem && $iu0(elem)); const $io4 = input => Array.isArray(input.$or) && input.$or.every(elem => "object" === typeof elem && null !== elem && $iu0(elem)); const $io5 = input => Array.isArray(input.assets) && input.assets.every(elem => "object" === typeof elem && null !== elem && $io6(elem)) && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && $io8(input.options)); const $io6 = input => "string" === typeof input.chain && ("string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId) && (Array.isArray(input.assetIds) && input.assetIds.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && $io7(elem)))) && (Array.isArray(input.ownershipTimes) && input.ownershipTimes.every(elem => "object" === typeof elem && null !== elem && $io7(elem))) && ("object" === typeof input.mustOwnAmounts && null !== input.mustOwnAmounts && $io7(input.mustOwnAmounts)) && (undefined === input.additionalCriteria || "string" === typeof input.additionalCriteria); const $io7 = input => ("string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start) && ("string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end); const $io8 = input => undefined === input.numMatchesForVerification || "string" === typeof input.numMatchesForVerification || "number" === typeof input.numMatchesForVerification || "bigint" === typeof input.numMatchesForVerification; const $io9 = input => true; const $io10 = input =>
|
|
1966
|
+
const validateRes = (() => { const $io0 = input => (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && $io1(input.options)) && (undefined === input.attestationsPresentations || Array.isArray(input.attestationsPresentations) && input.attestationsPresentations.every(elem => "object" === typeof elem && null !== elem && $io10(elem))) && "string" === typeof input.message && "string" === typeof input.signature && (undefined === input.altSigner || "string" === typeof input.altSigner) && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io1 = input => (undefined === input.expectedChallengeParams || "object" === typeof input.expectedChallengeParams && null !== input.expectedChallengeParams && false === Array.isArray(input.expectedChallengeParams) && $io2(input.expectedChallengeParams)) && (undefined === input.beforeVerification || true) && (undefined === input.balancesSnapshot || "object" === typeof input.balancesSnapshot && null !== input.balancesSnapshot && false === Array.isArray(input.balancesSnapshot) && $io9(input.balancesSnapshot)) && (undefined === input.verificationTimeOverride || "number" === typeof input.verificationTimeOverride) && (undefined === input.skipTimestampVerification || "boolean" === typeof input.skipTimestampVerification) && (undefined === input.skipAssetVerification || "boolean" === typeof input.skipAssetVerification) && (undefined === input.earliestIssuedAt || "string" === typeof input.earliestIssuedAt) && (undefined === input.issuedAtTimeWindowMs || "number" === typeof input.issuedAtTimeWindowMs) && (undefined === input.skipSignatureVerification || "boolean" === typeof input.skipSignatureVerification); const $io2 = input => (undefined === input.domain || "string" === typeof input.domain) && (undefined === input.statement || "string" === typeof input.statement) && (undefined === input.address || "string" === typeof input.address) && (undefined === input.uri || "string" === typeof input.uri) && (undefined === input.nonce || "string" === typeof input.nonce) && (undefined === input.version || "string" === typeof input.version) && (undefined === input.chainId || "string" === typeof input.chainId) && (undefined === input.issuedAt || "string" === typeof input.issuedAt) && (undefined === input.expirationDate || "string" === typeof input.expirationDate) && (undefined === input.notBefore || "string" === typeof input.notBefore) && (undefined === input.resources || Array.isArray(input.resources) && input.resources.every(elem => "string" === typeof elem)) && (undefined === input.assetOwnershipRequirements || "object" === typeof input.assetOwnershipRequirements && null !== input.assetOwnershipRequirements && $iu0(input.assetOwnershipRequirements)); const $io3 = input => Array.isArray(input.$and) && input.$and.every(elem => "object" === typeof elem && null !== elem && $iu0(elem)); const $io4 = input => Array.isArray(input.$or) && input.$or.every(elem => "object" === typeof elem && null !== elem && $iu0(elem)); const $io5 = input => Array.isArray(input.assets) && input.assets.every(elem => "object" === typeof elem && null !== elem && $io6(elem)) && (undefined === input.options || "object" === typeof input.options && null !== input.options && false === Array.isArray(input.options) && $io8(input.options)); const $io6 = input => "string" === typeof input.chain && ("string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId) && (Array.isArray(input.assetIds) && input.assetIds.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && $io7(elem)))) && (Array.isArray(input.ownershipTimes) && input.ownershipTimes.every(elem => "object" === typeof elem && null !== elem && $io7(elem))) && ("object" === typeof input.mustOwnAmounts && null !== input.mustOwnAmounts && $io7(input.mustOwnAmounts)) && (undefined === input.additionalCriteria || "string" === typeof input.additionalCriteria); const $io7 = input => ("string" === typeof input.start || "number" === typeof input.start || "bigint" === typeof input.start) && ("string" === typeof input.end || "number" === typeof input.end || "bigint" === typeof input.end); const $io8 = input => undefined === input.numMatchesForVerification || "string" === typeof input.numMatchesForVerification || "number" === typeof input.numMatchesForVerification || "bigint" === typeof input.numMatchesForVerification; const $io9 = input => true; const $io10 = input => Array.isArray(input.updateHistory) && input.updateHistory.every(elem => "object" === typeof elem && null !== elem && $io11(elem)) && "string" === typeof input._docId && (undefined === input._id || "string" === typeof input._id) && ("plaintext" === input.messageFormat || "json" === input.messageFormat) && "string" === typeof input.createdBy && ("string" === typeof input.createdAt || "number" === typeof input.createdAt || "bigint" === typeof input.createdAt) && (Array.isArray(input.entropies) && input.entropies.every(elem => "string" === typeof elem)) && (undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility) && ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance && $io12(input.proofOfIssuance)) && "string" === typeof input.attestationId && "string" === typeof input.inviteCode && "string" === typeof input.scheme && (undefined === input.originalProvider || "string" === typeof input.originalProvider) && (Array.isArray(input.messages) && input.messages.every(elem => "string" === typeof elem)) && ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof && $io13(input.dataIntegrityProof)) && "string" === typeof input.name && "string" === typeof input.image && "string" === typeof input.description && (Array.isArray(input.holders) && input.holders.every(elem => "string" === typeof elem)) && (Array.isArray(input.anchors) && input.anchors.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io14(elem))); const $io11 = input => "string" === typeof input.txHash && ("string" === typeof input.block || "number" === typeof input.block || "bigint" === typeof input.block) && ("string" === typeof input.blockTimestamp || "number" === typeof input.blockTimestamp || "bigint" === typeof input.blockTimestamp) && ("string" === typeof input.timestamp || "number" === typeof input.timestamp || "bigint" === typeof input.timestamp); const $io12 = input => "string" === typeof input.message && "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io13 = input => "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey) && (undefined === input.isDerived || "boolean" === typeof input.isDerived); const $io14 = input => (undefined === input.txHash || "string" === typeof input.txHash) && (undefined === input.message || "string" === typeof input.message); const $iu0 = input => (() => {
|
|
1927
1967
|
if (undefined !== input.$and)
|
|
1928
1968
|
return $io3(input);
|
|
1929
1969
|
else if (undefined !== input.$or)
|
|
@@ -1944,12 +1984,12 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
1944
1984
|
path: _path + ".attestationsPresentations",
|
|
1945
1985
|
expected: "(Array<iAttestationsProof<NumberType>> | undefined)",
|
|
1946
1986
|
value: input.attestationsPresentations
|
|
1947
|
-
})) && input.attestationsPresentations.map((elem,
|
|
1948
|
-
path: _path + ".attestationsPresentations[" +
|
|
1987
|
+
})) && input.attestationsPresentations.map((elem, _index13) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
1988
|
+
path: _path + ".attestationsPresentations[" + _index13 + "]",
|
|
1949
1989
|
expected: "iAttestationsProof<NumberType>",
|
|
1950
1990
|
value: elem
|
|
1951
|
-
})) && $vo10(elem, _path + ".attestationsPresentations[" +
|
|
1952
|
-
path: _path + ".attestationsPresentations[" +
|
|
1991
|
+
})) && $vo10(elem, _path + ".attestationsPresentations[" + _index13 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
1992
|
+
path: _path + ".attestationsPresentations[" + _index13 + "]",
|
|
1953
1993
|
expected: "iAttestationsProof<NumberType>",
|
|
1954
1994
|
value: elem
|
|
1955
1995
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -2060,8 +2100,8 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2060
2100
|
path: _path + ".resources",
|
|
2061
2101
|
expected: "(Array<string> | undefined)",
|
|
2062
2102
|
value: input.resources
|
|
2063
|
-
})) && input.resources.map((elem,
|
|
2064
|
-
path: _path + ".resources[" +
|
|
2103
|
+
})) && input.resources.map((elem, _index14) => "string" === typeof elem || $report(_exceptionable, {
|
|
2104
|
+
path: _path + ".resources[" + _index14 + "]",
|
|
2065
2105
|
expected: "string",
|
|
2066
2106
|
value: elem
|
|
2067
2107
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -2080,12 +2120,12 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2080
2120
|
path: _path + ".$and",
|
|
2081
2121
|
expected: "Array<AssetConditionGroup<NumberType>>",
|
|
2082
2122
|
value: input.$and
|
|
2083
|
-
})) && input.$and.map((elem,
|
|
2084
|
-
path: _path + ".$and[" +
|
|
2123
|
+
})) && input.$and.map((elem, _index15) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
2124
|
+
path: _path + ".$and[" + _index15 + "]",
|
|
2085
2125
|
expected: "(AndGroup<NumberType> | OrGroup<NumberType> | OwnershipRequirements<NumberType>)",
|
|
2086
2126
|
value: elem
|
|
2087
|
-
})) && $vu0(elem, _path + ".$and[" +
|
|
2088
|
-
path: _path + ".$and[" +
|
|
2127
|
+
})) && $vu0(elem, _path + ".$and[" + _index15 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
2128
|
+
path: _path + ".$and[" + _index15 + "]",
|
|
2089
2129
|
expected: "(AndGroup<NumberType> | OrGroup<NumberType> | OwnershipRequirements<NumberType>)",
|
|
2090
2130
|
value: elem
|
|
2091
2131
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -2096,12 +2136,12 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2096
2136
|
path: _path + ".$or",
|
|
2097
2137
|
expected: "Array<AssetConditionGroup<NumberType>>",
|
|
2098
2138
|
value: input.$or
|
|
2099
|
-
})) && input.$or.map((elem,
|
|
2100
|
-
path: _path + ".$or[" +
|
|
2139
|
+
})) && input.$or.map((elem, _index16) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
2140
|
+
path: _path + ".$or[" + _index16 + "]",
|
|
2101
2141
|
expected: "(AndGroup<NumberType> | OrGroup<NumberType> | OwnershipRequirements<NumberType>)",
|
|
2102
2142
|
value: elem
|
|
2103
|
-
})) && $vu0(elem, _path + ".$or[" +
|
|
2104
|
-
path: _path + ".$or[" +
|
|
2143
|
+
})) && $vu0(elem, _path + ".$or[" + _index16 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
2144
|
+
path: _path + ".$or[" + _index16 + "]",
|
|
2105
2145
|
expected: "(AndGroup<NumberType> | OrGroup<NumberType> | OwnershipRequirements<NumberType>)",
|
|
2106
2146
|
value: elem
|
|
2107
2147
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -2112,12 +2152,12 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2112
2152
|
path: _path + ".assets",
|
|
2113
2153
|
expected: "Array<AssetDetails<NumberType>>",
|
|
2114
2154
|
value: input.assets
|
|
2115
|
-
})) && input.assets.map((elem,
|
|
2116
|
-
path: _path + ".assets[" +
|
|
2155
|
+
})) && input.assets.map((elem, _index17) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
2156
|
+
path: _path + ".assets[" + _index17 + "]",
|
|
2117
2157
|
expected: "AssetDetails<NumberType>",
|
|
2118
2158
|
value: elem
|
|
2119
|
-
})) && $vo6(elem, _path + ".assets[" +
|
|
2120
|
-
path: _path + ".assets[" +
|
|
2159
|
+
})) && $vo6(elem, _path + ".assets[" + _index17 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
2160
|
+
path: _path + ".assets[" + _index17 + "]",
|
|
2121
2161
|
expected: "AssetDetails<NumberType>",
|
|
2122
2162
|
value: elem
|
|
2123
2163
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -2144,20 +2184,20 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2144
2184
|
path: _path + ".assetIds",
|
|
2145
2185
|
expected: "Array<string | UintRange<NumberType>>",
|
|
2146
2186
|
value: input.assetIds
|
|
2147
|
-
})) && input.assetIds.map((elem,
|
|
2148
|
-
path: _path + ".assetIds[" +
|
|
2187
|
+
})) && input.assetIds.map((elem, _index18) => (null !== elem || $report(_exceptionable, {
|
|
2188
|
+
path: _path + ".assetIds[" + _index18 + "]",
|
|
2149
2189
|
expected: "(UintRange<NumberType> | string)",
|
|
2150
2190
|
value: elem
|
|
2151
2191
|
})) && (undefined !== elem || $report(_exceptionable, {
|
|
2152
|
-
path: _path + ".assetIds[" +
|
|
2192
|
+
path: _path + ".assetIds[" + _index18 + "]",
|
|
2153
2193
|
expected: "(UintRange<NumberType> | string)",
|
|
2154
2194
|
value: elem
|
|
2155
2195
|
})) && ("string" === typeof elem || ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
2156
|
-
path: _path + ".assetIds[" +
|
|
2196
|
+
path: _path + ".assetIds[" + _index18 + "]",
|
|
2157
2197
|
expected: "(UintRange<NumberType> | string)",
|
|
2158
2198
|
value: elem
|
|
2159
|
-
})) && $vo7(elem, _path + ".assetIds[" +
|
|
2160
|
-
path: _path + ".assetIds[" +
|
|
2199
|
+
})) && $vo7(elem, _path + ".assetIds[" + _index18 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
2200
|
+
path: _path + ".assetIds[" + _index18 + "]",
|
|
2161
2201
|
expected: "(UintRange<NumberType> | string)",
|
|
2162
2202
|
value: elem
|
|
2163
2203
|
}))).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -2168,12 +2208,12 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2168
2208
|
path: _path + ".ownershipTimes",
|
|
2169
2209
|
expected: "Array<UintRange<NumberType>>",
|
|
2170
2210
|
value: input.ownershipTimes
|
|
2171
|
-
})) && input.ownershipTimes.map((elem,
|
|
2172
|
-
path: _path + ".ownershipTimes[" +
|
|
2211
|
+
})) && input.ownershipTimes.map((elem, _index19) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
2212
|
+
path: _path + ".ownershipTimes[" + _index19 + "]",
|
|
2173
2213
|
expected: "UintRange<NumberType>",
|
|
2174
2214
|
value: elem
|
|
2175
|
-
})) && $vo7(elem, _path + ".ownershipTimes[" +
|
|
2176
|
-
path: _path + ".ownershipTimes[" +
|
|
2215
|
+
})) && $vo7(elem, _path + ".ownershipTimes[" + _index19 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
2216
|
+
path: _path + ".ownershipTimes[" + _index19 + "]",
|
|
2177
2217
|
expected: "UintRange<NumberType>",
|
|
2178
2218
|
value: elem
|
|
2179
2219
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
@@ -2204,21 +2244,9 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2204
2244
|
path: _path + ".numMatchesForVerification",
|
|
2205
2245
|
expected: "(bigint | number | string | undefined)",
|
|
2206
2246
|
value: input.numMatchesForVerification
|
|
2207
|
-
})].every(flag => flag); const $vo9 = (input, _path, _exceptionable = true) => true; const $vo10 = (input, _path, _exceptionable = true) => [
|
|
2208
|
-
path: _path + ".entropies",
|
|
2209
|
-
expected: "(Array<string> | undefined)",
|
|
2210
|
-
value: input.entropies
|
|
2211
|
-
})) && input.entropies.map((elem, _index19) => "string" === typeof elem || $report(_exceptionable, {
|
|
2212
|
-
path: _path + ".entropies[" + _index19 + "]",
|
|
2213
|
-
expected: "string",
|
|
2214
|
-
value: elem
|
|
2215
|
-
})).every(flag => flag) || $report(_exceptionable, {
|
|
2216
|
-
path: _path + ".entropies",
|
|
2217
|
-
expected: "(Array<string> | undefined)",
|
|
2218
|
-
value: input.entropies
|
|
2219
|
-
}), undefined === input.updateHistory || (Array.isArray(input.updateHistory) || $report(_exceptionable, {
|
|
2247
|
+
})].every(flag => flag); const $vo9 = (input, _path, _exceptionable = true) => true; const $vo10 = (input, _path, _exceptionable = true) => [(Array.isArray(input.updateHistory) || $report(_exceptionable, {
|
|
2220
2248
|
path: _path + ".updateHistory",
|
|
2221
|
-
expected: "
|
|
2249
|
+
expected: "Array<iUpdateHistory<NumberType>>",
|
|
2222
2250
|
value: input.updateHistory
|
|
2223
2251
|
})) && input.updateHistory.map((elem, _index20) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
2224
2252
|
path: _path + ".updateHistory[" + _index20 + "]",
|
|
@@ -2230,8 +2258,16 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2230
2258
|
value: elem
|
|
2231
2259
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
2232
2260
|
path: _path + ".updateHistory",
|
|
2233
|
-
expected: "
|
|
2261
|
+
expected: "Array<iUpdateHistory<NumberType>>",
|
|
2234
2262
|
value: input.updateHistory
|
|
2263
|
+
}), "string" === typeof input._docId || $report(_exceptionable, {
|
|
2264
|
+
path: _path + "._docId",
|
|
2265
|
+
expected: "string",
|
|
2266
|
+
value: input._docId
|
|
2267
|
+
}), undefined === input._id || "string" === typeof input._id || $report(_exceptionable, {
|
|
2268
|
+
path: _path + "._id",
|
|
2269
|
+
expected: "(string | undefined)",
|
|
2270
|
+
value: input._id
|
|
2235
2271
|
}), "plaintext" === input.messageFormat || "json" === input.messageFormat || $report(_exceptionable, {
|
|
2236
2272
|
path: _path + ".messageFormat",
|
|
2237
2273
|
expected: "(\"json\" | \"plaintext\")",
|
|
@@ -2244,6 +2280,22 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2244
2280
|
path: _path + ".createdAt",
|
|
2245
2281
|
expected: "(bigint | number | string)",
|
|
2246
2282
|
value: input.createdAt
|
|
2283
|
+
}), (Array.isArray(input.entropies) || $report(_exceptionable, {
|
|
2284
|
+
path: _path + ".entropies",
|
|
2285
|
+
expected: "Array<string>",
|
|
2286
|
+
value: input.entropies
|
|
2287
|
+
})) && input.entropies.map((elem, _index21) => "string" === typeof elem || $report(_exceptionable, {
|
|
2288
|
+
path: _path + ".entropies[" + _index21 + "]",
|
|
2289
|
+
expected: "string",
|
|
2290
|
+
value: elem
|
|
2291
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
2292
|
+
path: _path + ".entropies",
|
|
2293
|
+
expected: "Array<string>",
|
|
2294
|
+
value: input.entropies
|
|
2295
|
+
}), undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility || $report(_exceptionable, {
|
|
2296
|
+
path: _path + ".publicVisibility",
|
|
2297
|
+
expected: "(boolean | undefined)",
|
|
2298
|
+
value: input.publicVisibility
|
|
2247
2299
|
}), ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance || $report(_exceptionable, {
|
|
2248
2300
|
path: _path + ".proofOfIssuance",
|
|
2249
2301
|
expected: "__type.o1",
|
|
@@ -2252,22 +2304,34 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2252
2304
|
path: _path + ".proofOfIssuance",
|
|
2253
2305
|
expected: "__type.o1",
|
|
2254
2306
|
value: input.proofOfIssuance
|
|
2255
|
-
}), "
|
|
2307
|
+
}), "string" === typeof input.attestationId || $report(_exceptionable, {
|
|
2308
|
+
path: _path + ".attestationId",
|
|
2309
|
+
expected: "string",
|
|
2310
|
+
value: input.attestationId
|
|
2311
|
+
}), "string" === typeof input.inviteCode || $report(_exceptionable, {
|
|
2312
|
+
path: _path + ".inviteCode",
|
|
2313
|
+
expected: "string",
|
|
2314
|
+
value: input.inviteCode
|
|
2315
|
+
}), "string" === typeof input.scheme || $report(_exceptionable, {
|
|
2256
2316
|
path: _path + ".scheme",
|
|
2257
|
-
expected: "
|
|
2317
|
+
expected: "string",
|
|
2258
2318
|
value: input.scheme
|
|
2259
|
-
}),
|
|
2260
|
-
path: _path + ".
|
|
2319
|
+
}), undefined === input.originalProvider || "string" === typeof input.originalProvider || $report(_exceptionable, {
|
|
2320
|
+
path: _path + ".originalProvider",
|
|
2321
|
+
expected: "(string | undefined)",
|
|
2322
|
+
value: input.originalProvider
|
|
2323
|
+
}), (Array.isArray(input.messages) || $report(_exceptionable, {
|
|
2324
|
+
path: _path + ".messages",
|
|
2261
2325
|
expected: "Array<string>",
|
|
2262
|
-
value: input.
|
|
2263
|
-
})) && input.
|
|
2264
|
-
path: _path + ".
|
|
2326
|
+
value: input.messages
|
|
2327
|
+
})) && input.messages.map((elem, _index22) => "string" === typeof elem || $report(_exceptionable, {
|
|
2328
|
+
path: _path + ".messages[" + _index22 + "]",
|
|
2265
2329
|
expected: "string",
|
|
2266
2330
|
value: elem
|
|
2267
2331
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
2268
|
-
path: _path + ".
|
|
2332
|
+
path: _path + ".messages",
|
|
2269
2333
|
expected: "Array<string>",
|
|
2270
|
-
value: input.
|
|
2334
|
+
value: input.messages
|
|
2271
2335
|
}), ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof || $report(_exceptionable, {
|
|
2272
2336
|
path: _path + ".dataIntegrityProof",
|
|
2273
2337
|
expected: "__type.o2",
|
|
@@ -2288,21 +2352,33 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2288
2352
|
path: _path + ".description",
|
|
2289
2353
|
expected: "string",
|
|
2290
2354
|
value: input.description
|
|
2291
|
-
}),
|
|
2355
|
+
}), (Array.isArray(input.holders) || $report(_exceptionable, {
|
|
2356
|
+
path: _path + ".holders",
|
|
2357
|
+
expected: "Array<string>",
|
|
2358
|
+
value: input.holders
|
|
2359
|
+
})) && input.holders.map((elem, _index23) => "string" === typeof elem || $report(_exceptionable, {
|
|
2360
|
+
path: _path + ".holders[" + _index23 + "]",
|
|
2361
|
+
expected: "string",
|
|
2362
|
+
value: elem
|
|
2363
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
2364
|
+
path: _path + ".holders",
|
|
2365
|
+
expected: "Array<string>",
|
|
2366
|
+
value: input.holders
|
|
2367
|
+
}), (Array.isArray(input.anchors) || $report(_exceptionable, {
|
|
2292
2368
|
path: _path + ".anchors",
|
|
2293
|
-
expected: "
|
|
2369
|
+
expected: "Array<__type>",
|
|
2294
2370
|
value: input.anchors
|
|
2295
|
-
})) && input.anchors.map((elem,
|
|
2296
|
-
path: _path + ".anchors[" +
|
|
2371
|
+
})) && input.anchors.map((elem, _index24) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $report(_exceptionable, {
|
|
2372
|
+
path: _path + ".anchors[" + _index24 + "]",
|
|
2297
2373
|
expected: "__type.o3",
|
|
2298
2374
|
value: elem
|
|
2299
|
-
})) && $vo14(elem, _path + ".anchors[" +
|
|
2300
|
-
path: _path + ".anchors[" +
|
|
2375
|
+
})) && $vo14(elem, _path + ".anchors[" + _index24 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
2376
|
+
path: _path + ".anchors[" + _index24 + "]",
|
|
2301
2377
|
expected: "__type.o3",
|
|
2302
2378
|
value: elem
|
|
2303
2379
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
2304
2380
|
path: _path + ".anchors",
|
|
2305
|
-
expected: "
|
|
2381
|
+
expected: "Array<__type>",
|
|
2306
2382
|
value: input.anchors
|
|
2307
2383
|
})].every(flag => flag); const $vo11 = (input, _path, _exceptionable = true) => ["string" === typeof input.txHash || $report(_exceptionable, {
|
|
2308
2384
|
path: _path + ".txHash",
|
|
@@ -2348,6 +2424,10 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2348
2424
|
path: _path + ".publicKey",
|
|
2349
2425
|
expected: "(string | undefined)",
|
|
2350
2426
|
value: input.publicKey
|
|
2427
|
+
}), undefined === input.isDerived || "boolean" === typeof input.isDerived || $report(_exceptionable, {
|
|
2428
|
+
path: _path + ".isDerived",
|
|
2429
|
+
expected: "(boolean | undefined)",
|
|
2430
|
+
value: input.isDerived
|
|
2351
2431
|
})].every(flag => flag); const $vo14 = (input, _path, _exceptionable = true) => [undefined === input.txHash || "string" === typeof input.txHash || $report(_exceptionable, {
|
|
2352
2432
|
path: _path + ".txHash",
|
|
2353
2433
|
expected: "(string | undefined)",
|
|
@@ -2963,27 +3043,35 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
2963
3043
|
return Promise.reject(error);
|
|
2964
3044
|
}
|
|
2965
3045
|
}
|
|
2966
|
-
async
|
|
3046
|
+
async getAttestations(payload) {
|
|
2967
3047
|
try {
|
|
2968
|
-
const validateRes = (() => { const $io0 = input => (undefined === input.inviteCode || "string" === typeof input.inviteCode) && (undefined === input.
|
|
3048
|
+
const validateRes = (() => { const $io0 = input => (undefined === input.inviteCode || "string" === typeof input.inviteCode) && (undefined === input.attestationIds || Array.isArray(input.attestationIds) && input.attestationIds.every(elem => "string" === typeof elem)); const $vo0 = (input, _path, _exceptionable = true) => [undefined === input.inviteCode || "string" === typeof input.inviteCode || $report(_exceptionable, {
|
|
2969
3049
|
path: _path + ".inviteCode",
|
|
2970
3050
|
expected: "(string | undefined)",
|
|
2971
3051
|
value: input.inviteCode
|
|
2972
|
-
}), undefined === input.
|
|
2973
|
-
path: _path + ".
|
|
2974
|
-
expected: "(string | undefined)",
|
|
2975
|
-
value: input.
|
|
3052
|
+
}), undefined === input.attestationIds || (Array.isArray(input.attestationIds) || $report(_exceptionable, {
|
|
3053
|
+
path: _path + ".attestationIds",
|
|
3054
|
+
expected: "(Array<string> | undefined)",
|
|
3055
|
+
value: input.attestationIds
|
|
3056
|
+
})) && input.attestationIds.map((elem, _index2) => "string" === typeof elem || $report(_exceptionable, {
|
|
3057
|
+
path: _path + ".attestationIds[" + _index2 + "]",
|
|
3058
|
+
expected: "string",
|
|
3059
|
+
value: elem
|
|
3060
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
3061
|
+
path: _path + ".attestationIds",
|
|
3062
|
+
expected: "(Array<string> | undefined)",
|
|
3063
|
+
value: input.attestationIds
|
|
2976
3064
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let errors; let $report; return input => {
|
|
2977
3065
|
if (false === __is(input)) {
|
|
2978
3066
|
errors = [];
|
|
2979
3067
|
$report = typia_1.default.validate.report(errors);
|
|
2980
3068
|
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || $report(true, {
|
|
2981
3069
|
path: _path + "",
|
|
2982
|
-
expected: "
|
|
3070
|
+
expected: "GetAttestationsPayload",
|
|
2983
3071
|
value: input
|
|
2984
3072
|
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
2985
3073
|
path: _path + "",
|
|
2986
|
-
expected: "
|
|
3074
|
+
expected: "GetAttestationsPayload",
|
|
2987
3075
|
value: input
|
|
2988
3076
|
}))(input, "$input", true);
|
|
2989
3077
|
const success = 0 === errors.length;
|
|
@@ -3003,7 +3091,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3003
3091
|
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
3004
3092
|
}
|
|
3005
3093
|
const response = await this.axios.post(`${this.BACKEND_URL}${routes_js_1.BitBadgesApiRoutes.GetAttestationsRoute()}`, payload);
|
|
3006
|
-
return new requests_js_1.
|
|
3094
|
+
return new requests_js_1.GetAttestationsSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
3007
3095
|
}
|
|
3008
3096
|
catch (error) {
|
|
3009
3097
|
await this.handleApiError(error);
|
|
@@ -3012,59 +3100,87 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3012
3100
|
}
|
|
3013
3101
|
async createAttestation(payload) {
|
|
3014
3102
|
try {
|
|
3015
|
-
const validateRes = (() => { const $io0 = input => "object" === typeof
|
|
3016
|
-
path: _path + ".
|
|
3103
|
+
const validateRes = (() => { const $io0 = input => (undefined === input.anchors || Array.isArray(input.anchors) && input.anchors.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io1(elem))) && "string" === typeof input.name && (Array.isArray(input.messages) && input.messages.every(elem => "string" === typeof elem)) && "string" === typeof input.description && "string" === typeof input.image && (undefined === input.originalProvider || "string" === typeof input.originalProvider) && ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance && $io2(input.proofOfIssuance)) && ("plaintext" === input.messageFormat || "json" === input.messageFormat) && "string" === typeof input.scheme && ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof && $io3(input.dataIntegrityProof)) && (undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility); const $io1 = input => (undefined === input.txHash || "string" === typeof input.txHash) && (undefined === input.message || "string" === typeof input.message); const $io2 = input => "string" === typeof input.message && "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io3 = input => "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey) && (undefined === input.isDerived || "boolean" === typeof input.isDerived); const $vo0 = (input, _path, _exceptionable = true) => [undefined === input.anchors || (Array.isArray(input.anchors) || $report(_exceptionable, {
|
|
3104
|
+
path: _path + ".anchors",
|
|
3105
|
+
expected: "(Array<__type> | undefined)",
|
|
3106
|
+
value: input.anchors
|
|
3107
|
+
})) && input.anchors.map((elem, _index3) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $report(_exceptionable, {
|
|
3108
|
+
path: _path + ".anchors[" + _index3 + "]",
|
|
3109
|
+
expected: "__type",
|
|
3110
|
+
value: elem
|
|
3111
|
+
})) && $vo1(elem, _path + ".anchors[" + _index3 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
3112
|
+
path: _path + ".anchors[" + _index3 + "]",
|
|
3017
3113
|
expected: "__type",
|
|
3114
|
+
value: elem
|
|
3115
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
3116
|
+
path: _path + ".anchors",
|
|
3117
|
+
expected: "(Array<__type> | undefined)",
|
|
3118
|
+
value: input.anchors
|
|
3119
|
+
}), "string" === typeof input.name || $report(_exceptionable, {
|
|
3120
|
+
path: _path + ".name",
|
|
3121
|
+
expected: "string",
|
|
3122
|
+
value: input.name
|
|
3123
|
+
}), (Array.isArray(input.messages) || $report(_exceptionable, {
|
|
3124
|
+
path: _path + ".messages",
|
|
3125
|
+
expected: "Array<string>",
|
|
3126
|
+
value: input.messages
|
|
3127
|
+
})) && input.messages.map((elem, _index4) => "string" === typeof elem || $report(_exceptionable, {
|
|
3128
|
+
path: _path + ".messages[" + _index4 + "]",
|
|
3129
|
+
expected: "string",
|
|
3130
|
+
value: elem
|
|
3131
|
+
})).every(flag => flag) || $report(_exceptionable, {
|
|
3132
|
+
path: _path + ".messages",
|
|
3133
|
+
expected: "Array<string>",
|
|
3134
|
+
value: input.messages
|
|
3135
|
+
}), "string" === typeof input.description || $report(_exceptionable, {
|
|
3136
|
+
path: _path + ".description",
|
|
3137
|
+
expected: "string",
|
|
3138
|
+
value: input.description
|
|
3139
|
+
}), "string" === typeof input.image || $report(_exceptionable, {
|
|
3140
|
+
path: _path + ".image",
|
|
3141
|
+
expected: "string",
|
|
3142
|
+
value: input.image
|
|
3143
|
+
}), undefined === input.originalProvider || "string" === typeof input.originalProvider || $report(_exceptionable, {
|
|
3144
|
+
path: _path + ".originalProvider",
|
|
3145
|
+
expected: "(string | undefined)",
|
|
3146
|
+
value: input.originalProvider
|
|
3147
|
+
}), ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance || $report(_exceptionable, {
|
|
3148
|
+
path: _path + ".proofOfIssuance",
|
|
3149
|
+
expected: "__type.o1",
|
|
3018
3150
|
value: input.proofOfIssuance
|
|
3019
|
-
})) && $
|
|
3151
|
+
})) && $vo2(input.proofOfIssuance, _path + ".proofOfIssuance", true && _exceptionable) || $report(_exceptionable, {
|
|
3020
3152
|
path: _path + ".proofOfIssuance",
|
|
3021
|
-
expected: "__type",
|
|
3153
|
+
expected: "__type.o1",
|
|
3022
3154
|
value: input.proofOfIssuance
|
|
3023
3155
|
}), "plaintext" === input.messageFormat || "json" === input.messageFormat || $report(_exceptionable, {
|
|
3024
3156
|
path: _path + ".messageFormat",
|
|
3025
3157
|
expected: "(\"json\" | \"plaintext\")",
|
|
3026
3158
|
value: input.messageFormat
|
|
3027
|
-
}), "
|
|
3159
|
+
}), "string" === typeof input.scheme || $report(_exceptionable, {
|
|
3028
3160
|
path: _path + ".scheme",
|
|
3029
|
-
expected: "(\"bbs\" | \"standard\")",
|
|
3030
|
-
value: input.scheme
|
|
3031
|
-
}), "string" === typeof input.type || $report(_exceptionable, {
|
|
3032
|
-
path: _path + ".type",
|
|
3033
3161
|
expected: "string",
|
|
3034
|
-
value: input.
|
|
3035
|
-
}), (Array.isArray(input.attestationMessages) || $report(_exceptionable, {
|
|
3036
|
-
path: _path + ".attestationMessages",
|
|
3037
|
-
expected: "Array<string>",
|
|
3038
|
-
value: input.attestationMessages
|
|
3039
|
-
})) && input.attestationMessages.map((elem, _index2) => "string" === typeof elem || $report(_exceptionable, {
|
|
3040
|
-
path: _path + ".attestationMessages[" + _index2 + "]",
|
|
3041
|
-
expected: "string",
|
|
3042
|
-
value: elem
|
|
3043
|
-
})).every(flag => flag) || $report(_exceptionable, {
|
|
3044
|
-
path: _path + ".attestationMessages",
|
|
3045
|
-
expected: "Array<string>",
|
|
3046
|
-
value: input.attestationMessages
|
|
3162
|
+
value: input.scheme
|
|
3047
3163
|
}), ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof || $report(_exceptionable, {
|
|
3048
3164
|
path: _path + ".dataIntegrityProof",
|
|
3049
|
-
expected: "__type.
|
|
3165
|
+
expected: "__type.o2",
|
|
3050
3166
|
value: input.dataIntegrityProof
|
|
3051
|
-
})) && $
|
|
3167
|
+
})) && $vo3(input.dataIntegrityProof, _path + ".dataIntegrityProof", true && _exceptionable) || $report(_exceptionable, {
|
|
3052
3168
|
path: _path + ".dataIntegrityProof",
|
|
3053
|
-
expected: "__type.
|
|
3169
|
+
expected: "__type.o2",
|
|
3054
3170
|
value: input.dataIntegrityProof
|
|
3055
|
-
}), "
|
|
3056
|
-
path: _path + ".
|
|
3057
|
-
expected: "
|
|
3058
|
-
value: input.
|
|
3059
|
-
}), "string" === typeof input.
|
|
3060
|
-
path: _path + ".
|
|
3061
|
-
expected: "string",
|
|
3062
|
-
value: input.
|
|
3063
|
-
}), "string" === typeof input.
|
|
3064
|
-
path: _path + ".
|
|
3065
|
-
expected: "string",
|
|
3066
|
-
value: input.
|
|
3067
|
-
})].every(flag => flag); const $
|
|
3171
|
+
}), undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility || $report(_exceptionable, {
|
|
3172
|
+
path: _path + ".publicVisibility",
|
|
3173
|
+
expected: "(boolean | undefined)",
|
|
3174
|
+
value: input.publicVisibility
|
|
3175
|
+
})].every(flag => flag); const $vo1 = (input, _path, _exceptionable = true) => [undefined === input.txHash || "string" === typeof input.txHash || $report(_exceptionable, {
|
|
3176
|
+
path: _path + ".txHash",
|
|
3177
|
+
expected: "(string | undefined)",
|
|
3178
|
+
value: input.txHash
|
|
3179
|
+
}), undefined === input.message || "string" === typeof input.message || $report(_exceptionable, {
|
|
3180
|
+
path: _path + ".message",
|
|
3181
|
+
expected: "(string | undefined)",
|
|
3182
|
+
value: input.message
|
|
3183
|
+
})].every(flag => flag); const $vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.message || $report(_exceptionable, {
|
|
3068
3184
|
path: _path + ".message",
|
|
3069
3185
|
expected: "string",
|
|
3070
3186
|
value: input.message
|
|
@@ -3080,7 +3196,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3080
3196
|
path: _path + ".publicKey",
|
|
3081
3197
|
expected: "(string | undefined)",
|
|
3082
3198
|
value: input.publicKey
|
|
3083
|
-
})].every(flag => flag); const $
|
|
3199
|
+
})].every(flag => flag); const $vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.signature || $report(_exceptionable, {
|
|
3084
3200
|
path: _path + ".signature",
|
|
3085
3201
|
expected: "string",
|
|
3086
3202
|
value: input.signature
|
|
@@ -3092,6 +3208,10 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3092
3208
|
path: _path + ".publicKey",
|
|
3093
3209
|
expected: "(string | undefined)",
|
|
3094
3210
|
value: input.publicKey
|
|
3211
|
+
}), undefined === input.isDerived || "boolean" === typeof input.isDerived || $report(_exceptionable, {
|
|
3212
|
+
path: _path + ".isDerived",
|
|
3213
|
+
expected: "(boolean | undefined)",
|
|
3214
|
+
value: input.isDerived
|
|
3095
3215
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && $io0(input); let errors; let $report; return input => {
|
|
3096
3216
|
if (false === __is(input)) {
|
|
3097
3217
|
errors = [];
|
|
@@ -3176,7 +3296,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3176
3296
|
}
|
|
3177
3297
|
async updateAttestation(payload) {
|
|
3178
3298
|
try {
|
|
3179
|
-
const validateRes = (() => { const $io0 = input => (undefined === input.attestationId || "string" === typeof input.attestationId) && (undefined === input.inviteCode || "string" === typeof input.inviteCode) && (undefined === input.rotateInviteCode || "boolean" === typeof input.rotateInviteCode) && (undefined === input.holdersToSet || Array.isArray(input.holdersToSet) && input.holdersToSet.every(elem => "object" === typeof elem && null !== elem && $io1(elem))) && (undefined === input.anchorsToAdd || Array.isArray(input.anchorsToAdd) && input.anchorsToAdd.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io2(elem))) && (undefined === input.proofOfIssuance || "object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance && $io3(input.proofOfIssuance)) && (undefined === input.messageFormat || "plaintext" === input.messageFormat || "json" === input.messageFormat) && (undefined === input.scheme || "
|
|
3299
|
+
const validateRes = (() => { const $io0 = input => (undefined === input.attestationId || "string" === typeof input.attestationId) && (undefined === input.inviteCode || "string" === typeof input.inviteCode) && (undefined === input.rotateInviteCode || "boolean" === typeof input.rotateInviteCode) && (undefined === input.holdersToSet || Array.isArray(input.holdersToSet) && input.holdersToSet.every(elem => "object" === typeof elem && null !== elem && $io1(elem))) && (undefined === input.anchorsToAdd || Array.isArray(input.anchorsToAdd) && input.anchorsToAdd.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io2(elem))) && (undefined === input.proofOfIssuance || "object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance && $io3(input.proofOfIssuance)) && (undefined === input.messageFormat || "plaintext" === input.messageFormat || "json" === input.messageFormat) && (undefined === input.scheme || "string" === typeof input.scheme) && (undefined === input.originalProvider || "string" === typeof input.originalProvider) && (undefined === input.messages || Array.isArray(input.messages) && input.messages.every(elem => "string" === typeof elem)) && (undefined === input.dataIntegrityProof || "object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof && $io4(input.dataIntegrityProof)) && (undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility) && (undefined === input.name || "string" === typeof input.name) && (undefined === input.image || "string" === typeof input.image) && (undefined === input.description || "string" === typeof input.description); const $io1 = input => "string" === typeof input.bitbadgesAddress && (undefined === input["delete"] || "boolean" === typeof input["delete"]); const $io2 = input => (undefined === input.txHash || "string" === typeof input.txHash) && (undefined === input.message || "string" === typeof input.message); const $io3 = input => "string" === typeof input.message && "string" === typeof input.signer && "string" === typeof input.signature && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io4 = input => "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey) && (undefined === input.derivedProof || "boolean" === typeof input.derivedProof); const $vo0 = (input, _path, _exceptionable = true) => [undefined === input.attestationId || "string" === typeof input.attestationId || $report(_exceptionable, {
|
|
3180
3300
|
path: _path + ".attestationId",
|
|
3181
3301
|
expected: "(string | undefined)",
|
|
3182
3302
|
value: input.attestationId
|
|
@@ -3232,26 +3352,26 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3232
3352
|
path: _path + ".messageFormat",
|
|
3233
3353
|
expected: "(\"json\" | \"plaintext\" | undefined)",
|
|
3234
3354
|
value: input.messageFormat
|
|
3235
|
-
}), undefined === input.scheme || "
|
|
3355
|
+
}), undefined === input.scheme || "string" === typeof input.scheme || $report(_exceptionable, {
|
|
3236
3356
|
path: _path + ".scheme",
|
|
3237
|
-
expected: "(
|
|
3357
|
+
expected: "(string | undefined)",
|
|
3238
3358
|
value: input.scheme
|
|
3239
|
-
}), undefined === input.
|
|
3240
|
-
path: _path + ".
|
|
3359
|
+
}), undefined === input.originalProvider || "string" === typeof input.originalProvider || $report(_exceptionable, {
|
|
3360
|
+
path: _path + ".originalProvider",
|
|
3241
3361
|
expected: "(string | undefined)",
|
|
3242
|
-
value: input.
|
|
3243
|
-
}), undefined === input.
|
|
3244
|
-
path: _path + ".
|
|
3362
|
+
value: input.originalProvider
|
|
3363
|
+
}), undefined === input.messages || (Array.isArray(input.messages) || $report(_exceptionable, {
|
|
3364
|
+
path: _path + ".messages",
|
|
3245
3365
|
expected: "(Array<string> | undefined)",
|
|
3246
|
-
value: input.
|
|
3247
|
-
})) && input.
|
|
3248
|
-
path: _path + ".
|
|
3366
|
+
value: input.messages
|
|
3367
|
+
})) && input.messages.map((elem, _index6) => "string" === typeof elem || $report(_exceptionable, {
|
|
3368
|
+
path: _path + ".messages[" + _index6 + "]",
|
|
3249
3369
|
expected: "string",
|
|
3250
3370
|
value: elem
|
|
3251
3371
|
})).every(flag => flag) || $report(_exceptionable, {
|
|
3252
|
-
path: _path + ".
|
|
3372
|
+
path: _path + ".messages",
|
|
3253
3373
|
expected: "(Array<string> | undefined)",
|
|
3254
|
-
value: input.
|
|
3374
|
+
value: input.messages
|
|
3255
3375
|
}), undefined === input.dataIntegrityProof || ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof || $report(_exceptionable, {
|
|
3256
3376
|
path: _path + ".dataIntegrityProof",
|
|
3257
3377
|
expected: "(__type.o3 | undefined)",
|
|
@@ -3260,6 +3380,10 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3260
3380
|
path: _path + ".dataIntegrityProof",
|
|
3261
3381
|
expected: "(__type.o3 | undefined)",
|
|
3262
3382
|
value: input.dataIntegrityProof
|
|
3383
|
+
}), undefined === input.publicVisibility || "boolean" === typeof input.publicVisibility || $report(_exceptionable, {
|
|
3384
|
+
path: _path + ".publicVisibility",
|
|
3385
|
+
expected: "(boolean | undefined)",
|
|
3386
|
+
value: input.publicVisibility
|
|
3263
3387
|
}), undefined === input.name || "string" === typeof input.name || $report(_exceptionable, {
|
|
3264
3388
|
path: _path + ".name",
|
|
3265
3389
|
expected: "(string | undefined)",
|
|
@@ -3316,6 +3440,10 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3316
3440
|
path: _path + ".publicKey",
|
|
3317
3441
|
expected: "(string | undefined)",
|
|
3318
3442
|
value: input.publicKey
|
|
3443
|
+
}), undefined === input.derivedProof || "boolean" === typeof input.derivedProof || $report(_exceptionable, {
|
|
3444
|
+
path: _path + ".derivedProof",
|
|
3445
|
+
expected: "(boolean | undefined)",
|
|
3446
|
+
value: input.derivedProof
|
|
3319
3447
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let errors; let $report; return input => {
|
|
3320
3448
|
if (false === __is(input)) {
|
|
3321
3449
|
errors = [];
|
|
@@ -3355,7 +3483,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3355
3483
|
}
|
|
3356
3484
|
async createClaims(payload) {
|
|
3357
3485
|
try {
|
|
3358
|
-
const validateRes = (() => { const $join = typia_1.default.validate.join; const $io0 = input => Array.isArray(input.claims) && input.claims.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) && (undefined === input.testClaims || "boolean" === typeof input.testClaims) && (undefined === input.siwbbClaim || "boolean" === typeof input.siwbbClaim); const $io1 = input => (undefined === input.
|
|
3486
|
+
const validateRes = (() => { const $join = typia_1.default.validate.join; const $io0 = input => Array.isArray(input.claims) && input.claims.every(elem => "object" === typeof elem && null !== elem && $io1(elem)) && (undefined === input.testClaims || "boolean" === typeof input.testClaims) && (undefined === input.siwbbClaim || "boolean" === typeof input.siwbbClaim); const $io1 = input => (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && $io2(input.metadata)) && (undefined === input.collectionId || "string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId) && (undefined === input.lastUpdated || "string" === typeof input.lastUpdated || "number" === typeof input.lastUpdated || "bigint" === typeof input.lastUpdated) && (undefined === input.listId || "string" === typeof input.listId) && (undefined === input.createdBy || "string" === typeof input.createdBy) && (undefined === input.categories || Array.isArray(input.categories) && input.categories.every(elem => "string" === typeof elem)) && "string" === typeof input.claimId && (undefined === input.seedCode || "string" === typeof input.seedCode) && (undefined === input.siwbbClaim || "boolean" === typeof input.siwbbClaim) && (undefined === input.trackerDetails || "object" === typeof input.trackerDetails && null !== input.trackerDetails && $io7(input.trackerDetails)) && (undefined === input.balancesToSet || "object" === typeof input.balancesToSet && null !== input.balancesToSet && $io8(input.balancesToSet)) && (undefined === input.rewards || Array.isArray(input.rewards) && input.rewards.every(elem => "object" === typeof elem && null !== elem && $io14(elem))) && (undefined === input.estimatedCost || "string" === typeof input.estimatedCost) && (undefined === input.showInSearchResults || "boolean" === typeof input.showInSearchResults) && (undefined === input.estimatedTime || "string" === typeof input.estimatedTime) && (undefined === input.manualDistribution || "boolean" === typeof input.manualDistribution) && (undefined === input.approach || "string" === typeof input.approach) && (undefined === input.assignMethod || "string" === typeof input.assignMethod) && (undefined === input.satisfyMethod || "object" === typeof input.satisfyMethod && null !== input.satisfyMethod && $io18(input.satisfyMethod)) && (undefined === input.cid || "string" === typeof input.cid) && (Array.isArray(input.plugins) && input.plugins.every(elem => "object" === typeof elem && null !== elem && $io20(elem))); const $io2 = input => "string" === typeof input.name && "string" === typeof input.description && "string" === typeof input.image && (undefined === input.bannerImage || "string" === typeof input.bannerImage) && (undefined === input.video || "string" === typeof input.video) && (undefined === input.category || "string" === typeof input.category) && (undefined === input.externalUrl || "string" === typeof input.externalUrl) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (undefined === input.socials || "object" === typeof input.socials && null !== input.socials && false === Array.isArray(input.socials) && $io3(input.socials)) && (undefined === input.offChainTransferabilityInfo || "object" === typeof input.offChainTransferabilityInfo && null !== input.offChainTransferabilityInfo && $io4(input.offChainTransferabilityInfo)) && (undefined === input.attributes || Array.isArray(input.attributes) && input.attributes.every(elem => "object" === typeof elem && null !== elem && $io5(elem))) && (undefined === input.utility || Array.isArray(input.utility) && input.utility.every(elem => "object" === typeof elem && null !== elem && $io6(elem))) && (undefined === input.fetchedAtBlock || "string" === typeof input.fetchedAtBlock || "number" === typeof input.fetchedAtBlock || "bigint" === typeof input.fetchedAtBlock) && (undefined === input.fetchedAt || "string" === typeof input.fetchedAt || "number" === typeof input.fetchedAt || "bigint" === typeof input.fetchedAt) && (undefined === input._isUpdating || "boolean" === typeof input._isUpdating); const $io3 = input => Object.keys(input).every(key => {
|
|
3359
3487
|
const value = input[key];
|
|
3360
3488
|
if (undefined === value)
|
|
3361
3489
|
return true;
|
|
@@ -3394,11 +3522,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3394
3522
|
path: _path + ".siwbbClaim",
|
|
3395
3523
|
expected: "(boolean | undefined)",
|
|
3396
3524
|
value: input.siwbbClaim
|
|
3397
|
-
})].every(flag => flag); const $vo1 = (input, _path, _exceptionable = true) => [undefined === input.
|
|
3398
|
-
path: _path + ".collectionId",
|
|
3399
|
-
expected: "(bigint | number | string | undefined)",
|
|
3400
|
-
value: input.collectionId
|
|
3401
|
-
}), undefined === input.metadata || ("object" === typeof input.metadata && null !== input.metadata || $report(_exceptionable, {
|
|
3525
|
+
})].every(flag => flag); const $vo1 = (input, _path, _exceptionable = true) => [undefined === input.metadata || ("object" === typeof input.metadata && null !== input.metadata || $report(_exceptionable, {
|
|
3402
3526
|
path: _path + ".metadata",
|
|
3403
3527
|
expected: "(iMetadata<NumberType> | undefined)",
|
|
3404
3528
|
value: input.metadata
|
|
@@ -3406,6 +3530,10 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
3406
3530
|
path: _path + ".metadata",
|
|
3407
3531
|
expected: "(iMetadata<NumberType> | undefined)",
|
|
3408
3532
|
value: input.metadata
|
|
3533
|
+
}), undefined === input.collectionId || "string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId || $report(_exceptionable, {
|
|
3534
|
+
path: _path + ".collectionId",
|
|
3535
|
+
expected: "(bigint | number | string | undefined)",
|
|
3536
|
+
value: input.collectionId
|
|
3409
3537
|
}), undefined === input.lastUpdated || "string" === typeof input.lastUpdated || "number" === typeof input.lastUpdated || "bigint" === typeof input.lastUpdated || $report(_exceptionable, {
|
|
3410
3538
|
path: _path + ".lastUpdated",
|
|
3411
3539
|
expected: "(bigint | number | string | undefined)",
|
|
@@ -4093,7 +4221,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
4093
4221
|
}
|
|
4094
4222
|
async updateClaims(payload) {
|
|
4095
4223
|
try {
|
|
4096
|
-
const validateRes = (() => { const $join = typia_1.default.validate.join; const $io0 = input => Array.isArray(input.claims) && input.claims.every(elem => "object" === typeof elem && null !== elem && $io1(elem)); const $io1 = input => (undefined === input.
|
|
4224
|
+
const validateRes = (() => { const $join = typia_1.default.validate.join; const $io0 = input => Array.isArray(input.claims) && input.claims.every(elem => "object" === typeof elem && null !== elem && $io1(elem)); const $io1 = input => (undefined === input.metadata || "object" === typeof input.metadata && null !== input.metadata && $io2(input.metadata)) && (undefined === input.collectionId || "string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId) && (undefined === input.lastUpdated || "string" === typeof input.lastUpdated || "number" === typeof input.lastUpdated || "bigint" === typeof input.lastUpdated) && (undefined === input.listId || "string" === typeof input.listId) && (undefined === input.createdBy || "string" === typeof input.createdBy) && (undefined === input.categories || Array.isArray(input.categories) && input.categories.every(elem => "string" === typeof elem)) && "string" === typeof input.claimId && (undefined === input.siwbbClaim || "boolean" === typeof input.siwbbClaim) && (undefined === input.trackerDetails || "object" === typeof input.trackerDetails && null !== input.trackerDetails && $io7(input.trackerDetails)) && (undefined === input.balancesToSet || "object" === typeof input.balancesToSet && null !== input.balancesToSet && $io8(input.balancesToSet)) && (Array.isArray(input.plugins) && input.plugins.every(elem => "object" === typeof elem && null !== elem && $io14(elem))) && (undefined === input.rewards || Array.isArray(input.rewards) && input.rewards.every(elem => "object" === typeof elem && null !== elem && $io17(elem))) && (undefined === input.estimatedCost || "string" === typeof input.estimatedCost) && (undefined === input.showInSearchResults || "boolean" === typeof input.showInSearchResults) && (undefined === input.estimatedTime || "string" === typeof input.estimatedTime) && (undefined === input.manualDistribution || "boolean" === typeof input.manualDistribution) && (undefined === input.approach || "string" === typeof input.approach) && (undefined === input.assignMethod || "string" === typeof input.assignMethod) && (undefined === input.satisfyMethod || "object" === typeof input.satisfyMethod && null !== input.satisfyMethod && $io21(input.satisfyMethod)); const $io2 = input => "string" === typeof input.name && "string" === typeof input.description && "string" === typeof input.image && (undefined === input.bannerImage || "string" === typeof input.bannerImage) && (undefined === input.video || "string" === typeof input.video) && (undefined === input.category || "string" === typeof input.category) && (undefined === input.externalUrl || "string" === typeof input.externalUrl) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "string" === typeof elem)) && (undefined === input.socials || "object" === typeof input.socials && null !== input.socials && false === Array.isArray(input.socials) && $io3(input.socials)) && (undefined === input.offChainTransferabilityInfo || "object" === typeof input.offChainTransferabilityInfo && null !== input.offChainTransferabilityInfo && $io4(input.offChainTransferabilityInfo)) && (undefined === input.attributes || Array.isArray(input.attributes) && input.attributes.every(elem => "object" === typeof elem && null !== elem && $io5(elem))) && (undefined === input.utility || Array.isArray(input.utility) && input.utility.every(elem => "object" === typeof elem && null !== elem && $io6(elem))) && (undefined === input.fetchedAtBlock || "string" === typeof input.fetchedAtBlock || "number" === typeof input.fetchedAtBlock || "bigint" === typeof input.fetchedAtBlock) && (undefined === input.fetchedAt || "string" === typeof input.fetchedAt || "number" === typeof input.fetchedAt || "bigint" === typeof input.fetchedAt) && (undefined === input._isUpdating || "boolean" === typeof input._isUpdating); const $io3 = input => Object.keys(input).every(key => {
|
|
4097
4225
|
const value = input[key];
|
|
4098
4226
|
if (undefined === value)
|
|
4099
4227
|
return true;
|
|
@@ -4124,11 +4252,7 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
4124
4252
|
path: _path + ".claims",
|
|
4125
4253
|
expected: "Array<Omit<iClaimDetails<NumberType>, \"version\" | \"_includesPrivateParams\" | \"seedCode\">>",
|
|
4126
4254
|
value: input.claims
|
|
4127
|
-
})].every(flag => flag); const $vo1 = (input, _path, _exceptionable = true) => [undefined === input.
|
|
4128
|
-
path: _path + ".collectionId",
|
|
4129
|
-
expected: "(bigint | number | string | undefined)",
|
|
4130
|
-
value: input.collectionId
|
|
4131
|
-
}), undefined === input.metadata || ("object" === typeof input.metadata && null !== input.metadata || $report(_exceptionable, {
|
|
4255
|
+
})].every(flag => flag); const $vo1 = (input, _path, _exceptionable = true) => [undefined === input.metadata || ("object" === typeof input.metadata && null !== input.metadata || $report(_exceptionable, {
|
|
4132
4256
|
path: _path + ".metadata",
|
|
4133
4257
|
expected: "(iMetadata<NumberType> | undefined)",
|
|
4134
4258
|
value: input.metadata
|
|
@@ -4136,6 +4260,10 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
4136
4260
|
path: _path + ".metadata",
|
|
4137
4261
|
expected: "(iMetadata<NumberType> | undefined)",
|
|
4138
4262
|
value: input.metadata
|
|
4263
|
+
}), undefined === input.collectionId || "string" === typeof input.collectionId || "number" === typeof input.collectionId || "bigint" === typeof input.collectionId || $report(_exceptionable, {
|
|
4264
|
+
path: _path + ".collectionId",
|
|
4265
|
+
expected: "(bigint | number | string | undefined)",
|
|
4266
|
+
value: input.collectionId
|
|
4139
4267
|
}), undefined === input.lastUpdated || "string" === typeof input.lastUpdated || "number" === typeof input.lastUpdated || "bigint" === typeof input.lastUpdated || $report(_exceptionable, {
|
|
4140
4268
|
path: _path + ".lastUpdated",
|
|
4141
4269
|
expected: "(bigint | number | string | undefined)",
|
|
@@ -5288,289 +5416,6 @@ class BitBadgesAPI extends base_js_1.BaseBitBadgesApi {
|
|
|
5288
5416
|
return Promise.reject(error);
|
|
5289
5417
|
}
|
|
5290
5418
|
}
|
|
5291
|
-
async getAttestationProof(payload) {
|
|
5292
|
-
try {
|
|
5293
|
-
const validateRes = (() => { const $io0 = input => "string" === typeof input.id; const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.id || $report(_exceptionable, {
|
|
5294
|
-
path: _path + ".id",
|
|
5295
|
-
expected: "string",
|
|
5296
|
-
value: input.id
|
|
5297
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && $io0(input); let errors; let $report; return input => {
|
|
5298
|
-
if (false === __is(input)) {
|
|
5299
|
-
errors = [];
|
|
5300
|
-
$report = typia_1.default.validate.report(errors);
|
|
5301
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $report(true, {
|
|
5302
|
-
path: _path + "",
|
|
5303
|
-
expected: "GetAttestationProofPayload",
|
|
5304
|
-
value: input
|
|
5305
|
-
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
5306
|
-
path: _path + "",
|
|
5307
|
-
expected: "GetAttestationProofPayload",
|
|
5308
|
-
value: input
|
|
5309
|
-
}))(input, "$input", true);
|
|
5310
|
-
const success = 0 === errors.length;
|
|
5311
|
-
return {
|
|
5312
|
-
success,
|
|
5313
|
-
errors,
|
|
5314
|
-
data: success ? input : undefined
|
|
5315
|
-
};
|
|
5316
|
-
}
|
|
5317
|
-
return {
|
|
5318
|
-
success: true,
|
|
5319
|
-
errors: [],
|
|
5320
|
-
data: input
|
|
5321
|
-
};
|
|
5322
|
-
}; })()(payload ?? {});
|
|
5323
|
-
if (!validateRes.success) {
|
|
5324
|
-
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
5325
|
-
}
|
|
5326
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_js_1.BitBadgesApiRoutes.GetAttestationProofsRoute()}`, payload);
|
|
5327
|
-
return new requests_js_1.GetAttestationProofSuccessResponse(response.data).convert(this.ConvertFunction);
|
|
5328
|
-
}
|
|
5329
|
-
catch (error) {
|
|
5330
|
-
await this.handleApiError(error);
|
|
5331
|
-
return Promise.reject(error);
|
|
5332
|
-
}
|
|
5333
|
-
}
|
|
5334
|
-
async createAttestationProof(payload) {
|
|
5335
|
-
try {
|
|
5336
|
-
const validateRes = (() => { const $io0 = input => "boolean" === typeof input.displayOnProfile && (undefined === input.entropies || Array.isArray(input.entropies) && input.entropies.every(elem => "string" === typeof elem)) && (undefined === input.updateHistory || Array.isArray(input.updateHistory) && input.updateHistory.every(elem => "object" === typeof elem && null !== elem && $io1(elem))) && ("plaintext" === input.messageFormat || "json" === input.messageFormat) && "string" === typeof input.createdBy && ("string" === typeof input.createdAt || "number" === typeof input.createdAt || "bigint" === typeof input.createdAt) && ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance && $io2(input.proofOfIssuance)) && ("bbs" === input.scheme || "standard" === input.scheme) && (Array.isArray(input.attestationMessages) && input.attestationMessages.every(elem => "string" === typeof elem)) && ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof && $io3(input.dataIntegrityProof)) && "string" === typeof input.name && "string" === typeof input.image && "string" === typeof input.description && (undefined === input.anchors || Array.isArray(input.anchors) && input.anchors.every(elem => "object" === typeof elem && null !== elem && false === Array.isArray(elem) && $io4(elem))); const $io1 = input => "string" === typeof input.txHash && ("string" === typeof input.block || "number" === typeof input.block || "bigint" === typeof input.block) && ("string" === typeof input.blockTimestamp || "number" === typeof input.blockTimestamp || "bigint" === typeof input.blockTimestamp) && ("string" === typeof input.timestamp || "number" === typeof input.timestamp || "bigint" === typeof input.timestamp); const $io2 = input => "string" === typeof input.message && "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io3 = input => "string" === typeof input.signature && "string" === typeof input.signer && (undefined === input.publicKey || "string" === typeof input.publicKey); const $io4 = input => (undefined === input.txHash || "string" === typeof input.txHash) && (undefined === input.message || "string" === typeof input.message); const $vo0 = (input, _path, _exceptionable = true) => ["boolean" === typeof input.displayOnProfile || $report(_exceptionable, {
|
|
5337
|
-
path: _path + ".displayOnProfile",
|
|
5338
|
-
expected: "boolean",
|
|
5339
|
-
value: input.displayOnProfile
|
|
5340
|
-
}), undefined === input.entropies || (Array.isArray(input.entropies) || $report(_exceptionable, {
|
|
5341
|
-
path: _path + ".entropies",
|
|
5342
|
-
expected: "(Array<string> | undefined)",
|
|
5343
|
-
value: input.entropies
|
|
5344
|
-
})) && input.entropies.map((elem, _index5) => "string" === typeof elem || $report(_exceptionable, {
|
|
5345
|
-
path: _path + ".entropies[" + _index5 + "]",
|
|
5346
|
-
expected: "string",
|
|
5347
|
-
value: elem
|
|
5348
|
-
})).every(flag => flag) || $report(_exceptionable, {
|
|
5349
|
-
path: _path + ".entropies",
|
|
5350
|
-
expected: "(Array<string> | undefined)",
|
|
5351
|
-
value: input.entropies
|
|
5352
|
-
}), undefined === input.updateHistory || (Array.isArray(input.updateHistory) || $report(_exceptionable, {
|
|
5353
|
-
path: _path + ".updateHistory",
|
|
5354
|
-
expected: "(Array<iUpdateHistory<NumberType>> | undefined)",
|
|
5355
|
-
value: input.updateHistory
|
|
5356
|
-
})) && input.updateHistory.map((elem, _index6) => ("object" === typeof elem && null !== elem || $report(_exceptionable, {
|
|
5357
|
-
path: _path + ".updateHistory[" + _index6 + "]",
|
|
5358
|
-
expected: "iUpdateHistory<NumberType>",
|
|
5359
|
-
value: elem
|
|
5360
|
-
})) && $vo1(elem, _path + ".updateHistory[" + _index6 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
5361
|
-
path: _path + ".updateHistory[" + _index6 + "]",
|
|
5362
|
-
expected: "iUpdateHistory<NumberType>",
|
|
5363
|
-
value: elem
|
|
5364
|
-
})).every(flag => flag) || $report(_exceptionable, {
|
|
5365
|
-
path: _path + ".updateHistory",
|
|
5366
|
-
expected: "(Array<iUpdateHistory<NumberType>> | undefined)",
|
|
5367
|
-
value: input.updateHistory
|
|
5368
|
-
}), "plaintext" === input.messageFormat || "json" === input.messageFormat || $report(_exceptionable, {
|
|
5369
|
-
path: _path + ".messageFormat",
|
|
5370
|
-
expected: "(\"json\" | \"plaintext\")",
|
|
5371
|
-
value: input.messageFormat
|
|
5372
|
-
}), "string" === typeof input.createdBy || $report(_exceptionable, {
|
|
5373
|
-
path: _path + ".createdBy",
|
|
5374
|
-
expected: "string",
|
|
5375
|
-
value: input.createdBy
|
|
5376
|
-
}), "string" === typeof input.createdAt || "number" === typeof input.createdAt || "bigint" === typeof input.createdAt || $report(_exceptionable, {
|
|
5377
|
-
path: _path + ".createdAt",
|
|
5378
|
-
expected: "(bigint | number | string)",
|
|
5379
|
-
value: input.createdAt
|
|
5380
|
-
}), ("object" === typeof input.proofOfIssuance && null !== input.proofOfIssuance || $report(_exceptionable, {
|
|
5381
|
-
path: _path + ".proofOfIssuance",
|
|
5382
|
-
expected: "__type",
|
|
5383
|
-
value: input.proofOfIssuance
|
|
5384
|
-
})) && $vo2(input.proofOfIssuance, _path + ".proofOfIssuance", true && _exceptionable) || $report(_exceptionable, {
|
|
5385
|
-
path: _path + ".proofOfIssuance",
|
|
5386
|
-
expected: "__type",
|
|
5387
|
-
value: input.proofOfIssuance
|
|
5388
|
-
}), "bbs" === input.scheme || "standard" === input.scheme || $report(_exceptionable, {
|
|
5389
|
-
path: _path + ".scheme",
|
|
5390
|
-
expected: "(\"bbs\" | \"standard\")",
|
|
5391
|
-
value: input.scheme
|
|
5392
|
-
}), (Array.isArray(input.attestationMessages) || $report(_exceptionable, {
|
|
5393
|
-
path: _path + ".attestationMessages",
|
|
5394
|
-
expected: "Array<string>",
|
|
5395
|
-
value: input.attestationMessages
|
|
5396
|
-
})) && input.attestationMessages.map((elem, _index7) => "string" === typeof elem || $report(_exceptionable, {
|
|
5397
|
-
path: _path + ".attestationMessages[" + _index7 + "]",
|
|
5398
|
-
expected: "string",
|
|
5399
|
-
value: elem
|
|
5400
|
-
})).every(flag => flag) || $report(_exceptionable, {
|
|
5401
|
-
path: _path + ".attestationMessages",
|
|
5402
|
-
expected: "Array<string>",
|
|
5403
|
-
value: input.attestationMessages
|
|
5404
|
-
}), ("object" === typeof input.dataIntegrityProof && null !== input.dataIntegrityProof || $report(_exceptionable, {
|
|
5405
|
-
path: _path + ".dataIntegrityProof",
|
|
5406
|
-
expected: "__type.o1",
|
|
5407
|
-
value: input.dataIntegrityProof
|
|
5408
|
-
})) && $vo3(input.dataIntegrityProof, _path + ".dataIntegrityProof", true && _exceptionable) || $report(_exceptionable, {
|
|
5409
|
-
path: _path + ".dataIntegrityProof",
|
|
5410
|
-
expected: "__type.o1",
|
|
5411
|
-
value: input.dataIntegrityProof
|
|
5412
|
-
}), "string" === typeof input.name || $report(_exceptionable, {
|
|
5413
|
-
path: _path + ".name",
|
|
5414
|
-
expected: "string",
|
|
5415
|
-
value: input.name
|
|
5416
|
-
}), "string" === typeof input.image || $report(_exceptionable, {
|
|
5417
|
-
path: _path + ".image",
|
|
5418
|
-
expected: "string",
|
|
5419
|
-
value: input.image
|
|
5420
|
-
}), "string" === typeof input.description || $report(_exceptionable, {
|
|
5421
|
-
path: _path + ".description",
|
|
5422
|
-
expected: "string",
|
|
5423
|
-
value: input.description
|
|
5424
|
-
}), undefined === input.anchors || (Array.isArray(input.anchors) || $report(_exceptionable, {
|
|
5425
|
-
path: _path + ".anchors",
|
|
5426
|
-
expected: "(Array<__type> | undefined)",
|
|
5427
|
-
value: input.anchors
|
|
5428
|
-
})) && input.anchors.map((elem, _index8) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || $report(_exceptionable, {
|
|
5429
|
-
path: _path + ".anchors[" + _index8 + "]",
|
|
5430
|
-
expected: "__type.o2",
|
|
5431
|
-
value: elem
|
|
5432
|
-
})) && $vo4(elem, _path + ".anchors[" + _index8 + "]", true && _exceptionable) || $report(_exceptionable, {
|
|
5433
|
-
path: _path + ".anchors[" + _index8 + "]",
|
|
5434
|
-
expected: "__type.o2",
|
|
5435
|
-
value: elem
|
|
5436
|
-
})).every(flag => flag) || $report(_exceptionable, {
|
|
5437
|
-
path: _path + ".anchors",
|
|
5438
|
-
expected: "(Array<__type> | undefined)",
|
|
5439
|
-
value: input.anchors
|
|
5440
|
-
})].every(flag => flag); const $vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.txHash || $report(_exceptionable, {
|
|
5441
|
-
path: _path + ".txHash",
|
|
5442
|
-
expected: "string",
|
|
5443
|
-
value: input.txHash
|
|
5444
|
-
}), "string" === typeof input.block || "number" === typeof input.block || "bigint" === typeof input.block || $report(_exceptionable, {
|
|
5445
|
-
path: _path + ".block",
|
|
5446
|
-
expected: "(bigint | number | string)",
|
|
5447
|
-
value: input.block
|
|
5448
|
-
}), "string" === typeof input.blockTimestamp || "number" === typeof input.blockTimestamp || "bigint" === typeof input.blockTimestamp || $report(_exceptionable, {
|
|
5449
|
-
path: _path + ".blockTimestamp",
|
|
5450
|
-
expected: "(bigint | number | string)",
|
|
5451
|
-
value: input.blockTimestamp
|
|
5452
|
-
}), "string" === typeof input.timestamp || "number" === typeof input.timestamp || "bigint" === typeof input.timestamp || $report(_exceptionable, {
|
|
5453
|
-
path: _path + ".timestamp",
|
|
5454
|
-
expected: "(bigint | number | string)",
|
|
5455
|
-
value: input.timestamp
|
|
5456
|
-
})].every(flag => flag); const $vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.message || $report(_exceptionable, {
|
|
5457
|
-
path: _path + ".message",
|
|
5458
|
-
expected: "string",
|
|
5459
|
-
value: input.message
|
|
5460
|
-
}), "string" === typeof input.signature || $report(_exceptionable, {
|
|
5461
|
-
path: _path + ".signature",
|
|
5462
|
-
expected: "string",
|
|
5463
|
-
value: input.signature
|
|
5464
|
-
}), "string" === typeof input.signer || $report(_exceptionable, {
|
|
5465
|
-
path: _path + ".signer",
|
|
5466
|
-
expected: "string",
|
|
5467
|
-
value: input.signer
|
|
5468
|
-
}), undefined === input.publicKey || "string" === typeof input.publicKey || $report(_exceptionable, {
|
|
5469
|
-
path: _path + ".publicKey",
|
|
5470
|
-
expected: "(string | undefined)",
|
|
5471
|
-
value: input.publicKey
|
|
5472
|
-
})].every(flag => flag); const $vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.signature || $report(_exceptionable, {
|
|
5473
|
-
path: _path + ".signature",
|
|
5474
|
-
expected: "string",
|
|
5475
|
-
value: input.signature
|
|
5476
|
-
}), "string" === typeof input.signer || $report(_exceptionable, {
|
|
5477
|
-
path: _path + ".signer",
|
|
5478
|
-
expected: "string",
|
|
5479
|
-
value: input.signer
|
|
5480
|
-
}), undefined === input.publicKey || "string" === typeof input.publicKey || $report(_exceptionable, {
|
|
5481
|
-
path: _path + ".publicKey",
|
|
5482
|
-
expected: "(string | undefined)",
|
|
5483
|
-
value: input.publicKey
|
|
5484
|
-
})].every(flag => flag); const $vo4 = (input, _path, _exceptionable = true) => [undefined === input.txHash || "string" === typeof input.txHash || $report(_exceptionable, {
|
|
5485
|
-
path: _path + ".txHash",
|
|
5486
|
-
expected: "(string | undefined)",
|
|
5487
|
-
value: input.txHash
|
|
5488
|
-
}), undefined === input.message || "string" === typeof input.message || $report(_exceptionable, {
|
|
5489
|
-
path: _path + ".message",
|
|
5490
|
-
expected: "(string | undefined)",
|
|
5491
|
-
value: input.message
|
|
5492
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && $io0(input); let errors; let $report; return input => {
|
|
5493
|
-
if (false === __is(input)) {
|
|
5494
|
-
errors = [];
|
|
5495
|
-
$report = typia_1.default.validate.report(errors);
|
|
5496
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $report(true, {
|
|
5497
|
-
path: _path + "",
|
|
5498
|
-
expected: "CreateAttestationProofPayload",
|
|
5499
|
-
value: input
|
|
5500
|
-
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
5501
|
-
path: _path + "",
|
|
5502
|
-
expected: "CreateAttestationProofPayload",
|
|
5503
|
-
value: input
|
|
5504
|
-
}))(input, "$input", true);
|
|
5505
|
-
const success = 0 === errors.length;
|
|
5506
|
-
return {
|
|
5507
|
-
success,
|
|
5508
|
-
errors,
|
|
5509
|
-
data: success ? input : undefined
|
|
5510
|
-
};
|
|
5511
|
-
}
|
|
5512
|
-
return {
|
|
5513
|
-
success: true,
|
|
5514
|
-
errors: [],
|
|
5515
|
-
data: input
|
|
5516
|
-
};
|
|
5517
|
-
}; })()(payload ?? {});
|
|
5518
|
-
if (!validateRes.success) {
|
|
5519
|
-
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
5520
|
-
}
|
|
5521
|
-
const response = await this.axios.post(`${this.BACKEND_URL}${routes_js_1.BitBadgesApiRoutes.CRUDAttestationProofRoute()}`, payload);
|
|
5522
|
-
return new requests_js_1.CreateAttestationProofSuccessResponse(response.data);
|
|
5523
|
-
}
|
|
5524
|
-
catch (error) {
|
|
5525
|
-
await this.handleApiError(error);
|
|
5526
|
-
return Promise.reject(error);
|
|
5527
|
-
}
|
|
5528
|
-
}
|
|
5529
|
-
async deleteAttestationProof(payload) {
|
|
5530
|
-
try {
|
|
5531
|
-
const validateRes = (() => { const $io0 = input => "string" === typeof input.id; const $vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.id || $report(_exceptionable, {
|
|
5532
|
-
path: _path + ".id",
|
|
5533
|
-
expected: "string",
|
|
5534
|
-
value: input.id
|
|
5535
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && $io0(input); let errors; let $report; return input => {
|
|
5536
|
-
if (false === __is(input)) {
|
|
5537
|
-
errors = [];
|
|
5538
|
-
$report = typia_1.default.validate.report(errors);
|
|
5539
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || $report(true, {
|
|
5540
|
-
path: _path + "",
|
|
5541
|
-
expected: "DeleteAttestationProofPayload",
|
|
5542
|
-
value: input
|
|
5543
|
-
})) && $vo0(input, _path + "", true) || $report(true, {
|
|
5544
|
-
path: _path + "",
|
|
5545
|
-
expected: "DeleteAttestationProofPayload",
|
|
5546
|
-
value: input
|
|
5547
|
-
}))(input, "$input", true);
|
|
5548
|
-
const success = 0 === errors.length;
|
|
5549
|
-
return {
|
|
5550
|
-
success,
|
|
5551
|
-
errors,
|
|
5552
|
-
data: success ? input : undefined
|
|
5553
|
-
};
|
|
5554
|
-
}
|
|
5555
|
-
return {
|
|
5556
|
-
success: true,
|
|
5557
|
-
errors: [],
|
|
5558
|
-
data: input
|
|
5559
|
-
};
|
|
5560
|
-
}; })()(payload ?? {});
|
|
5561
|
-
if (!validateRes.success) {
|
|
5562
|
-
throw new Error('Invalid payload: ' + JSON.stringify(validateRes.errors));
|
|
5563
|
-
}
|
|
5564
|
-
const response = await this.axios.delete(`${this.BACKEND_URL}${routes_js_1.BitBadgesApiRoutes.CRUDAttestationProofRoute()}`, {
|
|
5565
|
-
data: payload
|
|
5566
|
-
});
|
|
5567
|
-
return new requests_js_1.DeleteAttestationProofSuccessResponse(response.data);
|
|
5568
|
-
}
|
|
5569
|
-
catch (error) {
|
|
5570
|
-
await this.handleApiError(error);
|
|
5571
|
-
return Promise.reject(error);
|
|
5572
|
-
}
|
|
5573
|
-
}
|
|
5574
5419
|
async getGatedContentForClaim(claimId) {
|
|
5575
5420
|
try {
|
|
5576
5421
|
const validateRes = (() => { const $io0 = input => true; const $vo0 = (input, _path, _exceptionable = true) => true; const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && $io0(input); let errors; let $report; return input => {
|