@xyo-network/crypto-nft-collection-witness-plugin 5.2.4 → 5.3.2

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.
Files changed (124) hide show
  1. package/package.json +28 -28
  2. package/src/Witness.ts +4 -4
  3. package/src/lib/contractHasFunctions.ts +1 -1
  4. package/src/lib/getNftCollectionNfts.ts +4 -4
  5. package/dist/browser/Plugin.d.ts +0 -4
  6. package/dist/browser/Plugin.d.ts.map +0 -1
  7. package/dist/browser/Witness.d.ts +0 -11
  8. package/dist/browser/Witness.d.ts.map +0 -1
  9. package/dist/browser/index.d.ts +0 -4
  10. package/dist/browser/index.d.ts.map +0 -1
  11. package/dist/browser/index.mjs +0 -287
  12. package/dist/browser/index.mjs.map +0 -1
  13. package/dist/browser/lib/collectionMetrics/getNftCollectionMetrics.d.ts +0 -4
  14. package/dist/browser/lib/collectionMetrics/getNftCollectionMetrics.d.ts.map +0 -1
  15. package/dist/browser/lib/collectionMetrics/index.d.ts +0 -2
  16. package/dist/browser/lib/collectionMetrics/index.d.ts.map +0 -1
  17. package/dist/browser/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.d.ts +0 -3
  18. package/dist/browser/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.d.ts.map +0 -1
  19. package/dist/browser/lib/collectionMetrics/lib/calculatePropertyDistribution.d.ts +0 -3
  20. package/dist/browser/lib/collectionMetrics/lib/calculatePropertyDistribution.d.ts.map +0 -1
  21. package/dist/browser/lib/collectionMetrics/lib/distribution.d.ts +0 -6
  22. package/dist/browser/lib/collectionMetrics/lib/distribution.d.ts.map +0 -1
  23. package/dist/browser/lib/collectionMetrics/lib/index.d.ts +0 -4
  24. package/dist/browser/lib/collectionMetrics/lib/index.d.ts.map +0 -1
  25. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromOutcomes.d.ts +0 -8
  26. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromOutcomes.d.ts.map +0 -1
  27. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.d.ts +0 -9
  28. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.d.ts.map +0 -1
  29. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/binomial/index.d.ts +0 -3
  30. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/binomial/index.d.ts.map +0 -1
  31. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/index.d.ts +0 -2
  32. package/dist/browser/lib/collectionMetrics/lib/probabilityDistributions/index.d.ts.map +0 -1
  33. package/dist/browser/lib/contractHasFunctions.d.ts +0 -3
  34. package/dist/browser/lib/contractHasFunctions.d.ts.map +0 -1
  35. package/dist/browser/lib/getNftCollectionNfts.d.ts +0 -19
  36. package/dist/browser/lib/getNftCollectionNfts.d.ts.map +0 -1
  37. package/dist/browser/lib/index.d.ts +0 -5
  38. package/dist/browser/lib/index.d.ts.map +0 -1
  39. package/dist/browser/lib/nonEvaluableContractAddresses.d.ts +0 -6
  40. package/dist/browser/lib/nonEvaluableContractAddresses.d.ts.map +0 -1
  41. package/dist/browser/lib/tokenTypes.d.ts +0 -6
  42. package/dist/browser/lib/tokenTypes.d.ts.map +0 -1
  43. package/dist/browser/lib/tryCall.d.ts +0 -2
  44. package/dist/browser/lib/tryCall.d.ts.map +0 -1
  45. package/dist/neutral/Plugin.d.ts +0 -4
  46. package/dist/neutral/Plugin.d.ts.map +0 -1
  47. package/dist/neutral/Witness.d.ts +0 -11
  48. package/dist/neutral/Witness.d.ts.map +0 -1
  49. package/dist/neutral/index.d.ts +0 -4
  50. package/dist/neutral/index.d.ts.map +0 -1
  51. package/dist/neutral/index.mjs +0 -287
  52. package/dist/neutral/index.mjs.map +0 -1
  53. package/dist/neutral/lib/collectionMetrics/getNftCollectionMetrics.d.ts +0 -4
  54. package/dist/neutral/lib/collectionMetrics/getNftCollectionMetrics.d.ts.map +0 -1
  55. package/dist/neutral/lib/collectionMetrics/index.d.ts +0 -2
  56. package/dist/neutral/lib/collectionMetrics/index.d.ts.map +0 -1
  57. package/dist/neutral/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.d.ts +0 -3
  58. package/dist/neutral/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.d.ts.map +0 -1
  59. package/dist/neutral/lib/collectionMetrics/lib/calculatePropertyDistribution.d.ts +0 -3
  60. package/dist/neutral/lib/collectionMetrics/lib/calculatePropertyDistribution.d.ts.map +0 -1
  61. package/dist/neutral/lib/collectionMetrics/lib/distribution.d.ts +0 -6
  62. package/dist/neutral/lib/collectionMetrics/lib/distribution.d.ts.map +0 -1
  63. package/dist/neutral/lib/collectionMetrics/lib/index.d.ts +0 -4
  64. package/dist/neutral/lib/collectionMetrics/lib/index.d.ts.map +0 -1
  65. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromOutcomes.d.ts +0 -8
  66. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromOutcomes.d.ts.map +0 -1
  67. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.d.ts +0 -9
  68. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.d.ts.map +0 -1
  69. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/binomial/index.d.ts +0 -3
  70. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/binomial/index.d.ts.map +0 -1
  71. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/index.d.ts +0 -2
  72. package/dist/neutral/lib/collectionMetrics/lib/probabilityDistributions/index.d.ts.map +0 -1
  73. package/dist/neutral/lib/contractHasFunctions.d.ts +0 -3
  74. package/dist/neutral/lib/contractHasFunctions.d.ts.map +0 -1
  75. package/dist/neutral/lib/getNftCollectionNfts.d.ts +0 -19
  76. package/dist/neutral/lib/getNftCollectionNfts.d.ts.map +0 -1
  77. package/dist/neutral/lib/index.d.ts +0 -5
  78. package/dist/neutral/lib/index.d.ts.map +0 -1
  79. package/dist/neutral/lib/nonEvaluableContractAddresses.d.ts +0 -6
  80. package/dist/neutral/lib/nonEvaluableContractAddresses.d.ts.map +0 -1
  81. package/dist/neutral/lib/tokenTypes.d.ts +0 -6
  82. package/dist/neutral/lib/tokenTypes.d.ts.map +0 -1
  83. package/dist/neutral/lib/tryCall.d.ts +0 -2
  84. package/dist/neutral/lib/tryCall.d.ts.map +0 -1
  85. package/dist/node/Plugin.d.ts +0 -4
  86. package/dist/node/Plugin.d.ts.map +0 -1
  87. package/dist/node/Witness.d.ts +0 -11
  88. package/dist/node/Witness.d.ts.map +0 -1
  89. package/dist/node/index.d.ts +0 -4
  90. package/dist/node/index.d.ts.map +0 -1
  91. package/dist/node/index.mjs +0 -287
  92. package/dist/node/index.mjs.map +0 -1
  93. package/dist/node/lib/collectionMetrics/getNftCollectionMetrics.d.ts +0 -4
  94. package/dist/node/lib/collectionMetrics/getNftCollectionMetrics.d.ts.map +0 -1
  95. package/dist/node/lib/collectionMetrics/index.d.ts +0 -2
  96. package/dist/node/lib/collectionMetrics/index.d.ts.map +0 -1
  97. package/dist/node/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.d.ts +0 -3
  98. package/dist/node/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.d.ts.map +0 -1
  99. package/dist/node/lib/collectionMetrics/lib/calculatePropertyDistribution.d.ts +0 -3
  100. package/dist/node/lib/collectionMetrics/lib/calculatePropertyDistribution.d.ts.map +0 -1
  101. package/dist/node/lib/collectionMetrics/lib/distribution.d.ts +0 -6
  102. package/dist/node/lib/collectionMetrics/lib/distribution.d.ts.map +0 -1
  103. package/dist/node/lib/collectionMetrics/lib/index.d.ts +0 -4
  104. package/dist/node/lib/collectionMetrics/lib/index.d.ts.map +0 -1
  105. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromOutcomes.d.ts +0 -8
  106. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromOutcomes.d.ts.map +0 -1
  107. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.d.ts +0 -9
  108. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.d.ts.map +0 -1
  109. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/binomial/index.d.ts +0 -3
  110. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/binomial/index.d.ts.map +0 -1
  111. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/index.d.ts +0 -2
  112. package/dist/node/lib/collectionMetrics/lib/probabilityDistributions/index.d.ts.map +0 -1
  113. package/dist/node/lib/contractHasFunctions.d.ts +0 -3
  114. package/dist/node/lib/contractHasFunctions.d.ts.map +0 -1
  115. package/dist/node/lib/getNftCollectionNfts.d.ts +0 -19
  116. package/dist/node/lib/getNftCollectionNfts.d.ts.map +0 -1
  117. package/dist/node/lib/index.d.ts +0 -5
  118. package/dist/node/lib/index.d.ts.map +0 -1
  119. package/dist/node/lib/nonEvaluableContractAddresses.d.ts +0 -6
  120. package/dist/node/lib/nonEvaluableContractAddresses.d.ts.map +0 -1
  121. package/dist/node/lib/tokenTypes.d.ts +0 -6
  122. package/dist/node/lib/tokenTypes.d.ts.map +0 -1
  123. package/dist/node/lib/tryCall.d.ts +0 -2
  124. package/dist/node/lib/tryCall.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/crypto-nft-collection-witness-plugin",
3
- "version": "5.2.4",
3
+ "version": "5.3.2",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -35,36 +35,36 @@
35
35
  "!**/*.spec.*",
36
36
  "!**/*.test.*"
37
37
  ],
38
- "dependencies": {
39
- "@xylabs/assert": "~5.0.49",
40
- "@xylabs/axios": "~5.0.49",
41
- "@xylabs/eth-address": "~5.0.49",
42
- "@xylabs/exists": "~5.0.49",
43
- "@xylabs/hex": "~5.0.49",
44
- "@xyo-network/crypto-nft-collection-payload-plugin": "~5.2.4",
45
- "@xyo-network/crypto-nft-payload-plugin": "~5.2.4",
46
- "@xyo-network/erc1822-witness": "~5.2.4",
47
- "@xyo-network/erc1967-witness": "~5.2.4",
48
- "@xyo-network/open-zeppelin-typechain": "~4.0.11",
49
- "@xyo-network/payload-builder": "~5.2.14",
50
- "@xyo-network/payload-model": "~5.2.14",
51
- "@xyo-network/payloadset-plugin": "~5.2.14",
52
- "@xyo-network/witness-blockchain-abstract": "~5.2.14",
53
- "@xyo-network/witness-evm-abstract": "~5.2.14",
54
- "axios": "^1.13.2",
55
- "ethers": "^6.16.0"
56
- },
57
38
  "devDependencies": {
58
- "@types/node": "~24.10.1",
59
- "@xylabs/ts-scripts-yarn3": "~7.2.8",
60
- "@xylabs/tsconfig": "~7.2.8",
61
- "@xylabs/vitest-extended": "~5.0.49",
62
- "@xyo-network/account": "~5.2.14",
63
- "@xyo-network/account-model": "~5.2.14",
39
+ "@types/node": "~25.2.3",
40
+ "@xylabs/sdk-js": "^5.0.90",
41
+ "@xylabs/ts-scripts-yarn3": "~7.5.10",
42
+ "@xylabs/tsconfig": "~7.5.10",
43
+ "@xylabs/vitest-extended": "~5.0.90",
44
+ "@xyo-network/account-model": "~5.3.5",
45
+ "@xyo-network/crypto-nft-collection-payload-plugin": "~5.3.2",
46
+ "@xyo-network/crypto-nft-payload-plugin": "~5.3.2",
47
+ "@xyo-network/erc1822-witness": "~5.3.2",
48
+ "@xyo-network/erc1967-witness": "~5.3.2",
49
+ "@xyo-network/open-zeppelin-typechain": "~4.1.1",
50
+ "@xyo-network/payload-model": "~5.3.5",
51
+ "@xyo-network/payloadset-plugin": "~5.3.5",
52
+ "@xyo-network/sdk-js": "~5.3.5",
53
+ "@xyo-network/witness-blockchain-abstract": "~5.3.5",
54
+ "@xyo-network/witness-evm-abstract": "~5.3.5",
55
+ "axios": "^1.13.5",
56
+ "ethers": "^6.16.0",
64
57
  "typescript": "~5.9.3",
65
- "vitest": "~4.0.15"
58
+ "vitest": "~4.1.2",
59
+ "zod": "^4.3.6"
60
+ },
61
+ "peerDependencies": {
62
+ "@xylabs/sdk-js": "^5",
63
+ "axios": "^1.13.5",
64
+ "ethers": "^6.16.0",
65
+ "zod": "^4"
66
66
  },
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  }
70
- }
70
+ }
package/src/Witness.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { assertEx } from '@xylabs/assert'
2
- import { EthAddressWrapper } from '@xylabs/eth-address'
3
- import { asEthAddress } from '@xylabs/hex'
1
+ import {
2
+ asEthAddress, assertEx, EthAddressWrapper,
3
+ } from '@xylabs/sdk-js'
4
4
  import type {
5
5
  NftCollectionInfo,
6
6
  NftCollectionWitnessConfig,
@@ -12,8 +12,8 @@ import {
12
12
  NftCollectionWitnessConfigSchema,
13
13
  } from '@xyo-network/crypto-nft-collection-payload-plugin'
14
14
  import { ERC721Enumerable__factory } from '@xyo-network/open-zeppelin-typechain'
15
- import { PayloadBuilder } from '@xyo-network/payload-builder'
16
15
  import type { Schema, WithSources } from '@xyo-network/payload-model'
16
+ import { PayloadBuilder } from '@xyo-network/sdk-js'
17
17
  import type { EvmWitnessParams } from '@xyo-network/witness-evm-abstract'
18
18
  import { AbstractEvmWitness } from '@xyo-network/witness-evm-abstract'
19
19
 
@@ -1,4 +1,4 @@
1
- import { assertEx } from '@xylabs/assert'
1
+ import { assertEx } from '@xylabs/sdk-js'
2
2
  import type { Interface, Provider } from 'ethers'
3
3
 
4
4
  export const contractHasFunctions = async (provider: Provider, address: string, contractInterface: Interface, functionNames: string[]) => {
@@ -1,7 +1,7 @@
1
- import { axiosJsonConfig } from '@xylabs/axios'
2
- import { exists } from '@xylabs/exists'
3
- import type { EthAddress } from '@xylabs/hex'
4
- import { isHexZero } from '@xylabs/hex'
1
+ import type { EthAddress } from '@xylabs/sdk-js'
2
+ import {
3
+ axiosJsonConfig, exists, isHexZero,
4
+ } from '@xylabs/sdk-js'
5
5
  import type {
6
6
  NftInfo, NftMetadata, TokenType,
7
7
  } from '@xyo-network/crypto-nft-payload-plugin'
@@ -1,4 +0,0 @@
1
- import type { PayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin';
2
- import { CryptoNftCollectionWitness } from './Witness.ts';
3
- export declare const CryptoNftCollectionWitnessPlugin: () => PayloadSetWitnessPlugin<CryptoNftCollectionWitness>;
4
- //# sourceMappingURL=Plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AAG7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAA;AAEzD,eAAO,MAAM,gCAAgC,QAAO,uBAAuB,CAAC,0BAA0B,CASnG,CAAA"}
@@ -1,11 +0,0 @@
1
- import type { NftCollectionInfo, NftCollectionWitnessConfig, NftCollectionWitnessQuery } from '@xyo-network/crypto-nft-collection-payload-plugin';
2
- import type { Schema } from '@xyo-network/payload-model';
3
- import type { EvmWitnessParams } from '@xyo-network/witness-evm-abstract';
4
- import { AbstractEvmWitness } from '@xyo-network/witness-evm-abstract';
5
- export type CryptoNftCollectionWitnessParams = EvmWitnessParams<NftCollectionWitnessConfig>;
6
- export declare class CryptoNftCollectionWitness<TParams extends CryptoNftCollectionWitnessParams = CryptoNftCollectionWitnessParams> extends AbstractEvmWitness<TParams, NftCollectionWitnessQuery, NftCollectionInfo> {
7
- static readonly configSchemas: Schema[];
8
- static readonly defaultConfigSchema: Schema;
9
- protected observeHandler(payloads?: NftCollectionWitnessQuery[]): Promise<NftCollectionInfo[]>;
10
- }
11
- //# sourceMappingURL=Witness.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,mDAAmD,CAAA;AAQ1D,OAAO,KAAK,EAAE,MAAM,EAAe,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAMtE,MAAM,MAAM,gCAAgC,GAAG,gBAAgB,CAAC,0BAA0B,CAAC,CAAA;AAoB3F,qBAAa,0BAA0B,CACrC,OAAO,SAAS,gCAAgC,GAAG,gCAAgC,CACnF,SAAQ,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,CAAC;IACjF,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA6D;IAC7G,gBAAyB,mBAAmB,EAAE,MAAM,CAAmC;cAE9D,cAAc,CAAC,QAAQ,CAAC,EAAE,yBAAyB,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAkD9G"}
@@ -1,4 +0,0 @@
1
- export * from './lib/index.ts';
2
- export { CryptoNftCollectionWitnessPlugin, CryptoNftCollectionWitnessPlugin as default } from './Plugin.ts';
3
- export * from './Witness.ts';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AAC3G,cAAc,cAAc,CAAA"}
@@ -1,287 +0,0 @@
1
- // src/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.ts
2
- var calculateAllPropertiesDistribution = (array) => {
3
- const distribution = {};
4
- for (const item of array) {
5
- for (const property in item) {
6
- if (Object.prototype.hasOwnProperty.call(item, property)) {
7
- const value = item[property];
8
- if (value !== void 0 && value !== null) {
9
- const valueString = value.toString();
10
- if (!distribution[property]) {
11
- distribution[property] = { [valueString]: 1 };
12
- } else if (distribution[property][valueString]) {
13
- ;
14
- distribution[property][valueString] += 1;
15
- } else {
16
- ;
17
- distribution[property][valueString] = 1;
18
- }
19
- }
20
- }
21
- }
22
- }
23
- return distribution;
24
- };
25
-
26
- // src/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.ts
27
- var calculateBinomialParamsFromProbability = (n, p) => {
28
- const mean = n * p;
29
- const variance = n * p * (1 - p);
30
- const stdDev = Math.sqrt(variance);
31
- return {
32
- mean,
33
- p,
34
- stdDev,
35
- variance
36
- };
37
- };
38
-
39
- // src/lib/collectionMetrics/getNftCollectionMetrics.ts
40
- var getNftCollectionMetrics = (nfts) => {
41
- const traits = nfts.map((nft) => nft?.metadata?.attributes).filter((v) => v !== void 0).map((attributes2) => {
42
- return Object.fromEntries(attributes2.map((attribute) => [attribute.trait_type, attribute.value]));
43
- });
44
- const distribution = calculateAllPropertiesDistribution(traits);
45
- const n = nfts.length;
46
- const attributes = Object.fromEntries(
47
- Object.entries(distribution).filter((v) => v[1] !== void 0).map(([trait, entries]) => {
48
- const traitCount = Object.values(entries).reduce((prev, curr) => prev + curr, 0);
49
- const { p } = calculateBinomialParamsFromProbability(nfts.length, traitCount / n);
50
- const values = Object.fromEntries(
51
- Object.entries(entries).map(([value, traitValueCount]) => {
52
- const { p: p2 } = calculateBinomialParamsFromProbability(n, traitValueCount / n);
53
- const metrics = { binomial: { p: p2 }, count: traitValueCount };
54
- return [value, metrics];
55
- })
56
- );
57
- return [trait, { metrics: { binomial: { p }, count: traitCount }, values }];
58
- })
59
- );
60
- return { metadata: { attributes } };
61
- };
62
-
63
- // src/lib/contractHasFunctions.ts
64
- import { assertEx } from "@xylabs/assert";
65
- var contractHasFunctions = async (provider, address, contractInterface, functionNames) => {
66
- try {
67
- const bytecode = await provider.getCode(address, "latest");
68
- for (const functionName of functionNames) {
69
- const selector = assertEx(contractInterface.getFunction(functionName)?.selector, () => "Function not found on interface");
70
- return bytecode.includes(selector.slice(2));
71
- }
72
- return false;
73
- } catch (ex) {
74
- const error = ex;
75
- console.log(error);
76
- return false;
77
- }
78
- };
79
-
80
- // src/lib/getNftCollectionNfts.ts
81
- import { axiosJsonConfig } from "@xylabs/axios";
82
- import { exists } from "@xylabs/exists";
83
- import { isHexZero } from "@xylabs/hex";
84
- import { NftSchema, toTokenType } from "@xyo-network/crypto-nft-payload-plugin";
85
- import { getErc1822SlotStatus } from "@xyo-network/erc1822-witness";
86
- import { getErc1967SlotStatus } from "@xyo-network/erc1967-witness";
87
- import {
88
- ERC721Enumerable__factory,
89
- ERC721URIStorage__factory,
90
- ERC1155Supply__factory
91
- } from "@xyo-network/open-zeppelin-typechain";
92
- import { checkIpfsUrl } from "@xyo-network/witness-blockchain-abstract";
93
- import { Axios } from "axios";
94
-
95
- // src/lib/tokenTypes.ts
96
- import { ERC721__factory, ERC1155URIStorage__factory } from "@xyo-network/open-zeppelin-typechain";
97
- var isErc1155 = async (provider, address) => {
98
- return await contractHasFunctions(provider, address, ERC1155URIStorage__factory.createInterface(), ["uri"]);
99
- };
100
- var isErc721 = async (provider, address) => {
101
- return await contractHasFunctions(provider, address, ERC721__factory.createInterface(), ["name", "symbol", "tokenURI"]);
102
- };
103
- var tokenTypes = async (provider, address) => {
104
- const [erc721, erc1155] = await Promise.all([isErc721(provider, address), isErc1155(provider, address)]);
105
- const result = [];
106
- if (erc721) {
107
- result.push("ERC721");
108
- }
109
- if (erc1155) {
110
- result.push("ERC1155");
111
- }
112
- return result;
113
- };
114
-
115
- // src/lib/tryCall.ts
116
- var tryCall = async (func, name) => {
117
- try {
118
- return await func();
119
- } catch (ex) {
120
- if (name) {
121
- const error = ex;
122
- console.log(`tryCall failed [${name}]: ${error.message}`);
123
- }
124
- return void 0;
125
- }
126
- };
127
-
128
- // src/lib/getNftCollectionNfts.ts
129
- var ipfsGateway = "5d7b6582.beta.decentralnetworkservices.com";
130
- function range(size, startAt = 0) {
131
- return [...Array(size).keys()].map((i) => i + startAt);
132
- }
133
- var getNftCollectionNfts = async (contractAddress, provider, types, maxNfts = 100) => {
134
- try {
135
- const block = await provider.getBlockNumber();
136
- const erc1967Status = await getErc1967SlotStatus(provider, contractAddress, block);
137
- const erc1822Status = await getErc1822SlotStatus(provider, contractAddress, block);
138
- const implementation = !erc1967Status.slots.implementation || isHexZero(erc1967Status.slots.implementation) ? erc1822Status.implementation : erc1967Status.implementation;
139
- const axios = new Axios(axiosJsonConfig({ timeout: 2e3 }));
140
- const enumerable = ERC721Enumerable__factory.connect(implementation, provider);
141
- const storage = ERC721URIStorage__factory.connect(implementation, provider);
142
- const supply1155 = ERC1155Supply__factory.connect(implementation, provider);
143
- const finalTypes = types ?? await tokenTypes(provider, implementation);
144
- const maxNftsArray = range(maxNfts);
145
- const result = (await Promise.all(
146
- maxNftsArray.map(async (_value, i) => {
147
- const tokenId = await tryCall(async () => await enumerable.tokenByIndex(i, { blockTag: block })) ?? BigInt(i);
148
- if (tokenId !== void 0) {
149
- const supply = finalTypes.includes(toTokenType("ERC1155")) ? await tryCall(async () => await supply1155["totalSupply(uint256)"](tokenId)) ?? "0x01" : "0x01";
150
- const metadataUri = await tryCall(async () => await storage.tokenURI(tokenId, { blockTag: block }));
151
- const checkedMetaDataUri = metadataUri ? checkIpfsUrl(metadataUri, ipfsGateway) : void 0;
152
- let metadata;
153
- if (checkedMetaDataUri !== void 0) {
154
- try {
155
- metadata = (await axios.get(checkedMetaDataUri)).data;
156
- } catch (ex) {
157
- const error = ex;
158
- console.error(`Get Metadata failed: ${error.message}`);
159
- }
160
- }
161
- const info = {
162
- address: contractAddress,
163
- chainId: Number((await provider.getNetwork()).chainId),
164
- metadata,
165
- metadataUri,
166
- schema: NftSchema,
167
- supply: `0x${supply.toString(16)}`,
168
- tokenId: `0x${tokenId.toString(16)}`,
169
- type: finalTypes.at(0),
170
- types: finalTypes
171
- };
172
- if (implementation !== contractAddress) {
173
- info.implementation = implementation;
174
- }
175
- return info;
176
- }
177
- })
178
- )).filter(exists);
179
- return result;
180
- } catch (ex) {
181
- const error = ex;
182
- console.error(`getNftCollectionNfts failed: [${error.name}] ${error.message}`);
183
- console.log(error.stack);
184
- return [];
185
- }
186
- };
187
-
188
- // src/Plugin.ts
189
- import { NftSchema as NftSchema2 } from "@xyo-network/crypto-nft-payload-plugin";
190
- import { PayloadSetSchema } from "@xyo-network/payload-model";
191
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
192
-
193
- // src/Witness.ts
194
- import { assertEx as assertEx2 } from "@xylabs/assert";
195
- import { EthAddressWrapper } from "@xylabs/eth-address";
196
- import { asEthAddress } from "@xylabs/hex";
197
- import {
198
- isNftCollectionWitnessQuery,
199
- NftCollectionSchema,
200
- NftCollectionWitnessConfigSchema
201
- } from "@xyo-network/crypto-nft-collection-payload-plugin";
202
- import { ERC721Enumerable__factory as ERC721Enumerable__factory2 } from "@xyo-network/open-zeppelin-typechain";
203
- import { PayloadBuilder } from "@xyo-network/payload-builder";
204
- import { AbstractEvmWitness } from "@xyo-network/witness-evm-abstract";
205
- var defaultMaxNfts = 100;
206
- var NoOp = Promise.resolve();
207
- function resolvedValue(settled, assert) {
208
- if (assert && settled.status === "rejected") {
209
- throw settled.reason;
210
- }
211
- return settled.status === "fulfilled" ? settled.value : void 0;
212
- }
213
- var CryptoNftCollectionWitness = class extends AbstractEvmWitness {
214
- static configSchemas = [...super.configSchemas, NftCollectionWitnessConfigSchema];
215
- static defaultConfigSchema = NftCollectionWitnessConfigSchema;
216
- async observeHandler(payloads) {
217
- await this.started("throw");
218
- await this.getProviders();
219
- const queries = payloads?.filter(isNftCollectionWitnessQuery) ?? [];
220
- const observations = await Promise.all(
221
- queries.map(async (query) => {
222
- const chainId = assertEx2(query?.chainId || this.config.chainId, () => "params.chainId is required");
223
- const provider = await this.getProvider(true, true);
224
- const address = asEthAddress(assertEx2(
225
- EthAddressWrapper.parse(assertEx2(query?.address || this.config.address, () => "params.address is required")),
226
- () => "Failed to parse params.address"
227
- ).toString(), true);
228
- const erc721Enumerable = ERC721Enumerable__factory2.connect(address, provider);
229
- const maxNfts = query?.maxNfts || defaultMaxNfts;
230
- const [name, symbol, total, typesSettled, archivistSettled] = await Promise.allSettled([
231
- erc721Enumerable.name(),
232
- erc721Enumerable.symbol(),
233
- erc721Enumerable.totalSupply(),
234
- tokenTypes(provider, address),
235
- this.archivistInstance()
236
- ]);
237
- const types = resolvedValue(typesSettled, true);
238
- const nfts = await getNftCollectionNfts(address, provider, types, maxNfts);
239
- const metrics = getNftCollectionMetrics(nfts);
240
- const archivist = resolvedValue(archivistSettled);
241
- const [$sources] = await Promise.all([
242
- // Hash all the payloads
243
- Promise.all(nfts.map((nft) => PayloadBuilder.dataHash(nft))),
244
- // Insert them into the archivist if we have one
245
- archivist ? archivist.insert(nfts) : NoOp
246
- ]);
247
- const payload = {
248
- address,
249
- chainId,
250
- metrics,
251
- name: resolvedValue(name, true),
252
- schema: NftCollectionSchema,
253
- $sources,
254
- symbol: resolvedValue(symbol, true),
255
- total: Number(resolvedValue(total, true)),
256
- type: types.at(0),
257
- types
258
- };
259
- return payload;
260
- })
261
- );
262
- return observations.flat();
263
- }
264
- };
265
-
266
- // src/Plugin.ts
267
- var CryptoNftCollectionWitnessPlugin = () => createPayloadSetWitnessPlugin(
268
- { required: { [NftSchema2]: 1 }, schema: PayloadSetSchema },
269
- {
270
- witness: async (params) => {
271
- const result = await CryptoNftCollectionWitness.create(params);
272
- return result;
273
- }
274
- }
275
- );
276
- export {
277
- CryptoNftCollectionWitness,
278
- CryptoNftCollectionWitnessPlugin,
279
- contractHasFunctions,
280
- CryptoNftCollectionWitnessPlugin as default,
281
- getNftCollectionMetrics,
282
- getNftCollectionNfts,
283
- isErc1155,
284
- isErc721,
285
- tokenTypes
286
- };
287
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.ts","../../src/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.ts","../../src/lib/collectionMetrics/getNftCollectionMetrics.ts","../../src/lib/contractHasFunctions.ts","../../src/lib/getNftCollectionNfts.ts","../../src/lib/tokenTypes.ts","../../src/lib/tryCall.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import type { Distribution } from './distribution.ts'\n\nexport const calculateAllPropertiesDistribution = <T>(array: T[]): Distribution<T> => {\n const distribution: Distribution<T> = {}\n\n for (const item of array) {\n for (const property in item) {\n if (Object.prototype.hasOwnProperty.call(item, property)) {\n const value = item[property as keyof T]\n if (value !== undefined && value !== null) {\n const valueString = value.toString()\n if (!distribution[property]) {\n distribution[property] = { [valueString]: 1 }\n } else if (distribution[property]![valueString]) {\n ;(distribution[property] as Record<string, number>)[valueString] += 1\n } else {\n ;(distribution[property] as Record<string, number>)[valueString] = 1\n }\n }\n }\n }\n }\n\n return distribution\n}\n","import type { BinomialDistributionParameters } from '@xyo-network/crypto-nft-collection-payload-plugin'\n\n/**\n * Calculates the parameters of a binomial distribution given the number of trials and success probability\n * @param n Number of trials\n * @param p Success probability\n * @returns The binomial distribution parameters\n */\nexport const calculateBinomialParamsFromProbability = (n: number, p: number): BinomialDistributionParameters => {\n // Mean (µ)\n const mean = n * p\n\n // Variance (σ^2)\n const variance = n * p * (1 - p)\n\n // Standard Deviation (σ)\n const stdDev = Math.sqrt(variance)\n\n return {\n mean, p, stdDev, variance,\n }\n}\n","import type { NftCollectionMetrics, NftTraitMetrics } from '@xyo-network/crypto-nft-collection-payload-plugin'\nimport type { NftInfoFields, OpenSeaNftAttribute } from '@xyo-network/crypto-nft-payload-plugin'\n\nimport { calculateAllPropertiesDistribution, calculateBinomialParamsFromProbability } from './lib/index.ts'\n\ntype TraitDistributionEntry = [string, { [key: string]: number }]\n\nexport const getNftCollectionMetrics = (nfts: NftInfoFields[]): NftCollectionMetrics => {\n const traits = nfts\n .map(nft => nft?.metadata?.attributes as OpenSeaNftAttribute[] | undefined)\n .filter((v): v is OpenSeaNftAttribute[] => v !== undefined)\n .map((attributes) => {\n return Object.fromEntries(attributes.map(attribute => [attribute.trait_type, attribute.value]))\n })\n const distribution = calculateAllPropertiesDistribution(traits)\n const n = nfts.length\n const attributes = Object.fromEntries(\n Object.entries(distribution)\n .filter((v): v is TraitDistributionEntry => v[1] !== undefined)\n .map(([trait, entries]) => {\n const traitCount = Object.values(entries).reduce((prev, curr) => prev + curr, 0)\n const { p } = calculateBinomialParamsFromProbability(nfts.length, traitCount / n)\n const values = Object.fromEntries(\n Object.entries(entries).map(([value, traitValueCount]) => {\n const { p } = calculateBinomialParamsFromProbability(n, traitValueCount / n)\n const metrics: NftTraitMetrics = { binomial: { p }, count: traitValueCount }\n return [value, metrics]\n }),\n )\n return [trait, { metrics: { binomial: { p }, count: traitCount }, values }]\n }),\n )\n return { metadata: { attributes } }\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { Interface, Provider } from 'ethers'\n\nexport const contractHasFunctions = async (provider: Provider, address: string, contractInterface: Interface, functionNames: string[]) => {\n try {\n const bytecode = await provider.getCode(address, 'latest')\n for (const functionName of functionNames) {\n const selector = assertEx(contractInterface.getFunction(functionName)?.selector, () => 'Function not found on interface')\n return (bytecode.includes(selector.slice(2)))\n }\n return false\n } catch (ex) {\n const error = ex as Error\n console.log(error)\n return false\n }\n}\n","import { axiosJsonConfig } from '@xylabs/axios'\nimport { exists } from '@xylabs/exists'\nimport type { EthAddress } from '@xylabs/hex'\nimport { isHexZero } from '@xylabs/hex'\nimport type {\n NftInfo, NftMetadata, TokenType,\n} from '@xyo-network/crypto-nft-payload-plugin'\nimport { NftSchema, toTokenType } from '@xyo-network/crypto-nft-payload-plugin'\nimport { getErc1822SlotStatus } from '@xyo-network/erc1822-witness'\nimport { getErc1967SlotStatus } from '@xyo-network/erc1967-witness'\nimport {\n ERC721Enumerable__factory, ERC721URIStorage__factory, ERC1155Supply__factory,\n} from '@xyo-network/open-zeppelin-typechain'\nimport { checkIpfsUrl } from '@xyo-network/witness-blockchain-abstract'\nimport { Axios } from 'axios'\nimport type { Provider } from 'ethers'\n\nimport { tokenTypes } from './tokenTypes.ts'\nimport { tryCall } from './tryCall.ts'\n\nconst ipfsGateway = '5d7b6582.beta.decentralnetworkservices.com'\n\nfunction range(size: number, startAt: number = 0): ReadonlyArray<number> {\n return [...Array(size).keys()].map(i => i + startAt)\n}\n\nexport const getNftCollectionNfts = async (\n /**\n * The address of the NFT contract to search for\n */\n contractAddress: EthAddress,\n /**\n * The chain ID (1 = Ethereum Mainnet, 4 = Rinkeby, etc.) of the chain to search for NFTs on\n */\n provider: Provider,\n types?: TokenType[],\n /**\n * The maximum number of NFTs to return. Configurable to prevent\n * large wallets from exhausting Infura API credits. Ideally a\n * multiple of 100 as that appears to be the default page size.\n */\n maxNfts = 100,\n): Promise<NftInfo[]> => {\n try {\n const block = await provider.getBlockNumber()\n\n // Check if ERC-1967 Upgradeable\n const erc1967Status = await getErc1967SlotStatus(provider, contractAddress, block)\n\n // Check if ERC-1822 Upgradeable\n const erc1822Status = await getErc1822SlotStatus(provider, contractAddress, block)\n\n const implementation\n = !erc1967Status.slots.implementation || isHexZero(erc1967Status.slots.implementation)\n ? erc1822Status.implementation\n : erc1967Status.implementation\n\n const axios = new Axios(axiosJsonConfig({ timeout: 2000 }))\n const enumerable = ERC721Enumerable__factory.connect(implementation, provider)\n const storage = ERC721URIStorage__factory.connect(implementation, provider)\n const supply1155 = ERC1155Supply__factory.connect(implementation, provider)\n const finalTypes = types ?? (await tokenTypes(provider, implementation))\n\n const maxNftsArray = range(maxNfts)\n\n const result: NftInfo[] = (\n await Promise.all(\n maxNftsArray.map(async (_value, i) => {\n const tokenId = (await tryCall(async () => await enumerable.tokenByIndex(i, { blockTag: block }))) ?? BigInt(i)\n if (tokenId !== undefined) {\n const supply\n = finalTypes.includes(toTokenType('ERC1155'))\n ? ((await tryCall(async () => await supply1155['totalSupply(uint256)'](tokenId))) ?? '0x01')\n : '0x01'\n const metadataUri = await tryCall(async () => await storage.tokenURI(tokenId, { blockTag: block }))\n const checkedMetaDataUri = metadataUri ? checkIpfsUrl(metadataUri, ipfsGateway) : undefined\n let metadata: NftMetadata | undefined\n if (checkedMetaDataUri !== undefined) {\n try {\n metadata = (await axios.get(checkedMetaDataUri)).data\n } catch (ex) {\n const error = ex as Error\n console.error(`Get Metadata failed: ${error.message}`)\n }\n }\n\n const info: NftInfo = {\n address: contractAddress,\n chainId: Number((await provider.getNetwork()).chainId),\n metadata,\n metadataUri,\n schema: NftSchema,\n supply: `0x${supply.toString(16)}`,\n tokenId: `0x${tokenId.toString(16)}`,\n type: finalTypes.at(0),\n types: finalTypes,\n }\n if (implementation !== contractAddress) {\n info.implementation = implementation\n }\n return info\n }\n }),\n )\n ).filter(exists)\n return result\n } catch (ex) {\n const error = ex as Error\n console.error(`getNftCollectionNfts failed: [${error.name}] ${error.message}`)\n console.log(error.stack)\n return []\n }\n}\n","import type { TokenType } from '@xyo-network/crypto-nft-payload-plugin'\nimport { ERC721__factory, ERC1155URIStorage__factory } from '@xyo-network/open-zeppelin-typechain'\nimport type { Provider } from 'ethers'\n\nimport { contractHasFunctions } from './contractHasFunctions.ts'\n\nexport const isErc1155 = async (provider: Provider, address: string) => {\n return await contractHasFunctions(provider, address, ERC1155URIStorage__factory.createInterface(), ['uri'])\n}\n\nexport const isErc721 = async (provider: Provider, address: string) => {\n return await contractHasFunctions(provider, address, ERC721__factory.createInterface(), ['name', 'symbol', 'tokenURI'])\n}\n\nexport const tokenTypes = async (provider: Provider, address: string) => {\n const [erc721, erc1155] = await Promise.all([isErc721(provider, address), isErc1155(provider, address)])\n const result: TokenType[] = []\n if (erc721) {\n result.push('ERC721')\n }\n if (erc1155) {\n result.push('ERC1155')\n }\n return result\n}\n","export const tryCall = async <T>(func: () => Promise<T>, name?: string): Promise<T | undefined> => {\n try {\n return await func()\n } catch (ex) {\n if (name) {\n const error = ex as Error\n console.log(`tryCall failed [${name}]: ${error.message}`)\n }\n return undefined\n }\n}\n","import { NftSchema } from '@xyo-network/crypto-nft-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport type { PayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { CryptoNftCollectionWitness } from './Witness.ts'\n\nexport const CryptoNftCollectionWitnessPlugin = (): PayloadSetWitnessPlugin<CryptoNftCollectionWitness> =>\n createPayloadSetWitnessPlugin<CryptoNftCollectionWitness>(\n { required: { [NftSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await CryptoNftCollectionWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { EthAddressWrapper } from '@xylabs/eth-address'\nimport { asEthAddress } from '@xylabs/hex'\nimport type {\n NftCollectionInfo,\n NftCollectionWitnessConfig,\n NftCollectionWitnessQuery,\n} from '@xyo-network/crypto-nft-collection-payload-plugin'\nimport {\n isNftCollectionWitnessQuery,\n NftCollectionSchema,\n NftCollectionWitnessConfigSchema,\n} from '@xyo-network/crypto-nft-collection-payload-plugin'\nimport { ERC721Enumerable__factory } from '@xyo-network/open-zeppelin-typechain'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Schema, WithSources } from '@xyo-network/payload-model'\nimport type { EvmWitnessParams } from '@xyo-network/witness-evm-abstract'\nimport { AbstractEvmWitness } from '@xyo-network/witness-evm-abstract'\n\nimport {\n getNftCollectionMetrics, getNftCollectionNfts, tokenTypes,\n} from './lib/index.ts'\n\nexport type CryptoNftCollectionWitnessParams = EvmWitnessParams<NftCollectionWitnessConfig>\n\nconst defaultMaxNfts = 100\n\n/**\n * A \"no operation\" Promise to be used\n * when no action is desired but a Promise\n * is required to be returned\n */\nconst NoOp = Promise.resolve()\n\nfunction resolvedValue<T>(settled: PromiseSettledResult<T>, assert: true): T\nfunction resolvedValue<T>(settled: PromiseSettledResult<T>, assert?: false): T | undefined\nfunction resolvedValue<T>(settled: PromiseSettledResult<T>, assert?: boolean) {\n if (assert && settled.status === 'rejected') {\n throw settled.reason\n }\n return settled.status === 'fulfilled' ? settled.value : undefined\n}\n\nexport class CryptoNftCollectionWitness<\n TParams extends CryptoNftCollectionWitnessParams = CryptoNftCollectionWitnessParams,\n> extends AbstractEvmWitness<TParams, NftCollectionWitnessQuery, NftCollectionInfo> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, NftCollectionWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = NftCollectionWitnessConfigSchema\n\n protected override async observeHandler(payloads?: NftCollectionWitnessQuery[]): Promise<NftCollectionInfo[]> {\n await this.started('throw')\n await this.getProviders() // make sure cache clears\n const queries = payloads?.filter(isNftCollectionWitnessQuery) ?? []\n const observations = await Promise.all(\n queries.map<Promise<NftCollectionInfo>>(async (query) => {\n const chainId = assertEx(query?.chainId || this.config.chainId, () => 'params.chainId is required')\n const provider = await this.getProvider(true, true)\n const address = asEthAddress(assertEx(\n EthAddressWrapper.parse(assertEx(query?.address || this.config.address, () => 'params.address is required')),\n () => 'Failed to parse params.address',\n ).toString(), true)\n\n const erc721Enumerable = ERC721Enumerable__factory.connect(address, provider)\n\n const maxNfts = query?.maxNfts || defaultMaxNfts\n const [name, symbol, total, typesSettled, archivistSettled] = await Promise.allSettled([\n erc721Enumerable.name(),\n erc721Enumerable.symbol(),\n erc721Enumerable.totalSupply(),\n tokenTypes(provider, address),\n this.archivistInstance(),\n ])\n const types = resolvedValue(typesSettled, true)\n const nfts = await getNftCollectionNfts(address, provider, types, maxNfts)\n const metrics = getNftCollectionMetrics(nfts)\n const archivist = resolvedValue(archivistSettled)\n const [$sources] = await Promise.all([\n // Hash all the payloads\n Promise.all(nfts.map(nft => PayloadBuilder.dataHash(nft))),\n // Insert them into the archivist if we have one\n archivist ? archivist.insert(nfts) : NoOp,\n ])\n const payload: WithSources<NftCollectionInfo> = {\n address,\n chainId,\n metrics,\n name: resolvedValue(name, true),\n schema: NftCollectionSchema,\n $sources,\n symbol: resolvedValue(symbol, true),\n total: Number(resolvedValue(total, true)),\n type: types.at(0),\n types,\n }\n return payload\n }),\n )\n return observations.flat()\n }\n}\n"],"mappings":";AAEO,IAAM,qCAAqC,CAAI,UAAgC;AACpF,QAAM,eAAgC,CAAC;AAEvC,aAAW,QAAQ,OAAO;AACxB,eAAW,YAAY,MAAM;AAC3B,UAAI,OAAO,UAAU,eAAe,KAAK,MAAM,QAAQ,GAAG;AACxD,cAAM,QAAQ,KAAK,QAAmB;AACtC,YAAI,UAAU,UAAa,UAAU,MAAM;AACzC,gBAAM,cAAc,MAAM,SAAS;AACnC,cAAI,CAAC,aAAa,QAAQ,GAAG;AAC3B,yBAAa,QAAQ,IAAI,EAAE,CAAC,WAAW,GAAG,EAAE;AAAA,UAC9C,WAAW,aAAa,QAAQ,EAAG,WAAW,GAAG;AAC/C;AAAC,YAAC,aAAa,QAAQ,EAA6B,WAAW,KAAK;AAAA,UACtE,OAAO;AACL;AAAC,YAAC,aAAa,QAAQ,EAA6B,WAAW,IAAI;AAAA,UACrE;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;;;AChBO,IAAM,yCAAyC,CAAC,GAAW,MAA8C;AAE9G,QAAM,OAAO,IAAI;AAGjB,QAAM,WAAW,IAAI,KAAK,IAAI;AAG9B,QAAM,SAAS,KAAK,KAAK,QAAQ;AAEjC,SAAO;AAAA,IACL;AAAA,IAAM;AAAA,IAAG;AAAA,IAAQ;AAAA,EACnB;AACF;;;ACdO,IAAM,0BAA0B,CAAC,SAAgD;AACtF,QAAM,SAAS,KACZ,IAAI,SAAO,KAAK,UAAU,UAA+C,EACzE,OAAO,CAAC,MAAkC,MAAM,MAAS,EACzD,IAAI,C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CAAC;AAAA;AAAA,UAEzD,YAAY,UAAU,OAAO,IAAI,IAAI;AAAA,QACvC,CAAC;AACD,cAAM,UAA0C;AAAA,UAC9C;AAAA,UACA;AAAA,UACA;AAAA,UACA,MAAM,cAAc,MAAM,IAAI;AAAA,UAC9B,QAAQ;AAAA,UACR;AAAA,UACA,QAAQ,cAAc,QAAQ,IAAI;AAAA,UAClC,OAAO,OAAO,cAAc,OAAO,IAAI,CAAC;AAAA,UACxC,MAAM,MAAM,GAAG,CAAC;AAAA,UAChB;AAAA,QACF;AACA,eAAO;AAAA,MACT,CAAC;AAAA,IACH;AACA,WAAO,aAAa,KAAK;AAAA,EAC3B;AACF;;;AD5FO,IAAM,mCAAmC,MAC9C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,UAAS,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACzD;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,2BAA2B,OAAO,MAAM;AAC7D,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["attributes","p","NftSchema","assertEx","ERC721Enumerable__factory","assertEx","ERC721Enumerable__factory","NftSchema"]}
@@ -1,4 +0,0 @@
1
- import type { NftCollectionMetrics } from '@xyo-network/crypto-nft-collection-payload-plugin';
2
- import type { NftInfoFields } from '@xyo-network/crypto-nft-payload-plugin';
3
- export declare const getNftCollectionMetrics: (nfts: NftInfoFields[]) => NftCollectionMetrics;
4
- //# sourceMappingURL=getNftCollectionMetrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNftCollectionMetrics.d.ts","sourceRoot":"","sources":["../../../../src/lib/collectionMetrics/getNftCollectionMetrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAmB,MAAM,mDAAmD,CAAA;AAC9G,OAAO,KAAK,EAAE,aAAa,EAAuB,MAAM,wCAAwC,CAAA;AAMhG,eAAO,MAAM,uBAAuB,GAAI,MAAM,aAAa,EAAE,KAAG,oBA0B/D,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './getNftCollectionMetrics.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/collectionMetrics/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Distribution } from './distribution.ts';
2
- export declare const calculateAllPropertiesDistribution: <T>(array: T[]) => Distribution<T>;
3
- //# sourceMappingURL=calculateAllPropertiesDistribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateAllPropertiesDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/lib/collectionMetrics/lib/calculateAllPropertiesDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,kCAAkC,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,KAAG,YAAY,CAAC,CAAC,CAsBhF,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Distribution } from './distribution.ts';
2
- export declare const calculatePropertyDistribution: <T>(array: T[], property: keyof T) => Distribution<T>;
3
- //# sourceMappingURL=calculatePropertyDistribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculatePropertyDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/lib/collectionMetrics/lib/calculatePropertyDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,6BAA6B,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,UAAU,MAAM,CAAC,KAAG,YAAY,CAAC,CAAC,CAgB9F,CAAA"}
@@ -1,6 +0,0 @@
1
- export type Distribution<T> = {
2
- [K in keyof T]?: {
3
- [value: string]: number;
4
- };
5
- };
6
- //# sourceMappingURL=distribution.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"distribution.d.ts","sourceRoot":"","sources":["../../../../../src/lib/collectionMetrics/lib/distribution.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE;QAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;CAC7C,CAAA"}
@@ -1,4 +0,0 @@
1
- export * from './calculateAllPropertiesDistribution.ts';
2
- export * from './distribution.ts';
3
- export * from './probabilityDistributions/index.ts';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/collectionMetrics/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAA;AACvD,cAAc,mBAAmB,CAAA;AACjC,cAAc,qCAAqC,CAAA"}
@@ -1,8 +0,0 @@
1
- import type { BinomialDistributionParameters } from '@xyo-network/crypto-nft-collection-payload-plugin';
2
- /**
3
- * Calculates the parameters of a binomial distribution given a list of outcomes
4
- * @param outcomes List of outcomes, where 1 is a success and 0 is a failure
5
- * @returns The mean, standard deviation, and variance of the binomial distribution
6
- */
7
- export declare const calculateBinomialParamsFromOutcomes: (outcomes: number[]) => BinomialDistributionParameters;
8
- //# sourceMappingURL=calculateBinomialParamsFromOutcomes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateBinomialParamsFromOutcomes.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromOutcomes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAEvG;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,GAAI,UAAU,MAAM,EAAE,KAAG,8BAcxE,CAAA"}
@@ -1,9 +0,0 @@
1
- import type { BinomialDistributionParameters } from '@xyo-network/crypto-nft-collection-payload-plugin';
2
- /**
3
- * Calculates the parameters of a binomial distribution given the number of trials and success probability
4
- * @param n Number of trials
5
- * @param p Success probability
6
- * @returns The binomial distribution parameters
7
- */
8
- export declare const calculateBinomialParamsFromProbability: (n: number, p: number) => BinomialDistributionParameters;
9
- //# sourceMappingURL=calculateBinomialParamsFromProbability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateBinomialParamsFromProbability.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/collectionMetrics/lib/probabilityDistributions/binomial/calculateBinomialParamsFromProbability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mDAAmD,CAAA;AAEvG;;;;;GAKG;AACH,eAAO,MAAM,sCAAsC,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,8BAa7E,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './calculateBinomialParamsFromOutcomes.ts';
2
- export * from './calculateBinomialParamsFromProbability.ts';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/collectionMetrics/lib/probabilityDistributions/binomial/index.ts"],"names":[],"mappings":"AAAA,cAAc,0CAA0C,CAAA;AACxD,cAAc,6CAA6C,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from './binomial/index.ts';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/collectionMetrics/lib/probabilityDistributions/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
@@ -1,3 +0,0 @@
1
- import type { Interface, Provider } from 'ethers';
2
- export declare const contractHasFunctions: (provider: Provider, address: string, contractInterface: Interface, functionNames: string[]) => Promise<boolean>;
3
- //# sourceMappingURL=contractHasFunctions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contractHasFunctions.d.ts","sourceRoot":"","sources":["../../../src/lib/contractHasFunctions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEjD,eAAO,MAAM,oBAAoB,GAAU,UAAU,QAAQ,EAAE,SAAS,MAAM,EAAE,mBAAmB,SAAS,EAAE,eAAe,MAAM,EAAE,qBAapI,CAAA"}
@@ -1,19 +0,0 @@
1
- import type { EthAddress } from '@xylabs/hex';
2
- import type { NftInfo, TokenType } from '@xyo-network/crypto-nft-payload-plugin';
3
- import type { Provider } from 'ethers';
4
- export declare const getNftCollectionNfts: (
5
- /**
6
- * The address of the NFT contract to search for
7
- */
8
- contractAddress: EthAddress,
9
- /**
10
- * The chain ID (1 = Ethereum Mainnet, 4 = Rinkeby, etc.) of the chain to search for NFTs on
11
- */
12
- provider: Provider, types?: TokenType[],
13
- /**
14
- * The maximum number of NFTs to return. Configurable to prevent
15
- * large wallets from exhausting Infura API credits. Ideally a
16
- * multiple of 100 as that appears to be the default page size.
17
- */
18
- maxNfts?: number) => Promise<NftInfo[]>;
19
- //# sourceMappingURL=getNftCollectionNfts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getNftCollectionNfts.d.ts","sourceRoot":"","sources":["../../../src/lib/getNftCollectionNfts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EACV,OAAO,EAAe,SAAS,EAChC,MAAM,wCAAwC,CAAA;AAS/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAWtC,eAAO,MAAM,oBAAoB;AAC/B;;GAEG;AACH,iBAAiB,UAAU;AAC3B;;GAEG;AACH,UAAU,QAAQ,EAClB,QAAQ,SAAS,EAAE;AACnB;;;;GAIG;AACH,gBAAa,KACZ,OAAO,CAAC,OAAO,EAAE,CAsEnB,CAAA"}