@xyo-network/crypto-address-transaction-history-plugin 2.75.15 → 2.75.16

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 (42) hide show
  1. package/dist/docs.json +33 -33
  2. package/package.json +12 -12
  3. package/dist/browser/Config.cjs +0 -19
  4. package/dist/browser/Config.cjs.map +0 -1
  5. package/dist/browser/Config.js +0 -1
  6. package/dist/browser/Config.js.map +0 -1
  7. package/dist/browser/Plugin.cjs +0 -83
  8. package/dist/browser/Plugin.cjs.map +0 -1
  9. package/dist/browser/Plugin.js +0 -65
  10. package/dist/browser/Plugin.js.map +0 -1
  11. package/dist/browser/Witness.cjs +0 -67
  12. package/dist/browser/Witness.cjs.map +0 -1
  13. package/dist/browser/Witness.js +0 -49
  14. package/dist/browser/Witness.js.map +0 -1
  15. package/dist/browser/lib/getTransactionsForAddress.cjs +0 -44
  16. package/dist/browser/lib/getTransactionsForAddress.cjs.map +0 -1
  17. package/dist/browser/lib/getTransactionsForAddress.js +0 -23
  18. package/dist/browser/lib/getTransactionsForAddress.js.map +0 -1
  19. package/dist/browser/lib/index.cjs +0 -46
  20. package/dist/browser/lib/index.cjs.map +0 -1
  21. package/dist/browser/lib/index.js +0 -23
  22. package/dist/browser/lib/index.js.map +0 -1
  23. package/dist/node/Config.js +0 -19
  24. package/dist/node/Config.js.map +0 -1
  25. package/dist/node/Config.mjs +0 -1
  26. package/dist/node/Config.mjs.map +0 -1
  27. package/dist/node/Plugin.js +0 -87
  28. package/dist/node/Plugin.js.map +0 -1
  29. package/dist/node/Plugin.mjs +0 -65
  30. package/dist/node/Plugin.mjs.map +0 -1
  31. package/dist/node/Witness.js +0 -71
  32. package/dist/node/Witness.js.map +0 -1
  33. package/dist/node/Witness.mjs +0 -49
  34. package/dist/node/Witness.mjs.map +0 -1
  35. package/dist/node/lib/getTransactionsForAddress.js +0 -48
  36. package/dist/node/lib/getTransactionsForAddress.js.map +0 -1
  37. package/dist/node/lib/getTransactionsForAddress.mjs +0 -23
  38. package/dist/node/lib/getTransactionsForAddress.mjs.map +0 -1
  39. package/dist/node/lib/index.js +0 -50
  40. package/dist/node/lib/index.js.map +0 -1
  41. package/dist/node/lib/index.mjs +0 -23
  42. package/dist/node/lib/index.mjs.map +0 -1
@@ -1,49 +0,0 @@
1
- // src/Witness.ts
2
- import { assertEx } from "@xylabs/assert";
3
- import { AbstractWitness } from "@xyo-network/abstract-witness";
4
- import {
5
- AddressTransactionHistorySchema,
6
- AddressTransactionHistoryWitnessConfigSchema
7
- } from "@xyo-network/crypto-address-transaction-history-payload-plugin";
8
-
9
- // src/lib/getTransactionsForAddress.ts
10
- var getTransactionsForAddress = async (publicAddress, provider) => {
11
- const history = await provider.getHistory(publicAddress);
12
- return history.map((transaction) => {
13
- const {
14
- gasLimit: rawGasLimit,
15
- gasPrice: rawGasPrice,
16
- maxFeePerGas: rawMaxFeePerGas,
17
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
18
- value: rawValue
19
- } = transaction;
20
- const gasLimit = rawGasLimit?.toString();
21
- const gasPrice = rawGasPrice?.toString();
22
- const maxFeePerGas = rawMaxFeePerGas?.toString();
23
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
24
- const value = rawValue?.toString();
25
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
26
- });
27
- };
28
-
29
- // src/Witness.ts
30
- var schema = AddressTransactionHistorySchema;
31
- var AddressTransactionHistoryWitness = class extends AbstractWitness {
32
- static configSchemas = [AddressTransactionHistoryWitnessConfigSchema];
33
- get provider() {
34
- return assertEx(this.params.provider, "Provider Required");
35
- }
36
- async observeHandler() {
37
- await this.started("throw");
38
- const address = assertEx(this.config.address, "params.address is required");
39
- const transactions = await getTransactionsForAddress(address, this.provider);
40
- const payloads = transactions.map((transaction) => {
41
- return { ...transaction, schema };
42
- });
43
- return payloads;
44
- }
45
- };
46
- export {
47
- AddressTransactionHistoryWitness
48
- };
49
- //# sourceMappingURL=Witness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Witness.ts","../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import type { EtherscanProvider } from '@ethersproject/providers'\nimport { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n AddressTransactionHistoryPayload,\n AddressTransactionHistorySchema,\n AddressTransactionHistoryWitnessConfigSchema,\n} from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { AddressTransactionHistoryWitnessConfig } from './Config'\nimport { getTransactionsForAddress } from './lib'\n\nexport type AddressTransactionHistoryWitnessParams = WitnessParams<\n AnyConfigSchema<AddressTransactionHistoryWitnessConfig>,\n {\n provider?: EtherscanProvider\n }\n>\n\nconst schema = AddressTransactionHistorySchema\n\nexport class AddressTransactionHistoryWitness<\n TParams extends AddressTransactionHistoryWitnessParams = AddressTransactionHistoryWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [AddressTransactionHistoryWitnessConfigSchema]\n\n protected get provider() {\n return assertEx(this.params.provider, 'Provider Required')\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n await this.started('throw')\n const address = assertEx(this.config.address, 'params.address is required')\n const transactions = await getTransactionsForAddress(address, this.provider)\n const payloads = transactions.map<AddressTransactionHistoryPayload>((transaction) => {\n return { ...transaction, schema }\n })\n return payloads\n }\n}\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";AACA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC;AAAA,EAEE;AAAA,EACA;AAAA,OACK;;;ACJA,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,eAAe,iBAAiB,SAAS;AAC/C,UAAM,uBAAuB,yBAAyB,SAAS;AAC/D,UAAM,QAAQ,UAAU,SAAS;AACjC,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;;;ADPA,IAAM,SAAS;AAER,IAAM,mCAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,4CAA4C;AAAA,EAE7E,IAAc,WAAW;AACvB,WAAO,SAAS,KAAK,OAAO,UAAU,mBAAmB;AAAA,EAC3D;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,UAAU,SAAS,KAAK,OAAO,SAAS,4BAA4B;AAC1E,UAAM,eAAe,MAAM,0BAA0B,SAAS,KAAK,QAAQ;AAC3E,UAAM,WAAW,aAAa,IAAsC,CAAC,gBAAgB;AACnF,aAAO,EAAE,GAAG,aAAa,OAAO;AAAA,IAClC,CAAC;AACD,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/lib/getTransactionsForAddress.ts
21
- var getTransactionsForAddress_exports = {};
22
- __export(getTransactionsForAddress_exports, {
23
- getTransactionsForAddress: () => getTransactionsForAddress
24
- });
25
- module.exports = __toCommonJS(getTransactionsForAddress_exports);
26
- var getTransactionsForAddress = async (publicAddress, provider) => {
27
- const history = await provider.getHistory(publicAddress);
28
- return history.map((transaction) => {
29
- const {
30
- gasLimit: rawGasLimit,
31
- gasPrice: rawGasPrice,
32
- maxFeePerGas: rawMaxFeePerGas,
33
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
34
- value: rawValue
35
- } = transaction;
36
- const gasLimit = rawGasLimit?.toString();
37
- const gasPrice = rawGasPrice?.toString();
38
- const maxFeePerGas = rawMaxFeePerGas?.toString();
39
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
40
- const value = rawValue?.toString();
41
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
42
- });
43
- };
44
- //# sourceMappingURL=getTransactionsForAddress.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,eAAe,iBAAiB,SAAS;AAC/C,UAAM,uBAAuB,yBAAyB,SAAS;AAC/D,UAAM,QAAQ,UAAU,SAAS;AACjC,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;","names":[]}
@@ -1,23 +0,0 @@
1
- // src/lib/getTransactionsForAddress.ts
2
- var getTransactionsForAddress = async (publicAddress, provider) => {
3
- const history = await provider.getHistory(publicAddress);
4
- return history.map((transaction) => {
5
- const {
6
- gasLimit: rawGasLimit,
7
- gasPrice: rawGasPrice,
8
- maxFeePerGas: rawMaxFeePerGas,
9
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
10
- value: rawValue
11
- } = transaction;
12
- const gasLimit = rawGasLimit?.toString();
13
- const gasPrice = rawGasPrice?.toString();
14
- const maxFeePerGas = rawMaxFeePerGas?.toString();
15
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
16
- const value = rawValue?.toString();
17
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
18
- });
19
- };
20
- export {
21
- getTransactionsForAddress
22
- };
23
- //# sourceMappingURL=getTransactionsForAddress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";AAGO,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,eAAe,iBAAiB,SAAS;AAC/C,UAAM,uBAAuB,yBAAyB,SAAS;AAC/D,UAAM,QAAQ,UAAU,SAAS;AACjC,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;","names":[]}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/lib/index.ts
21
- var lib_exports = {};
22
- __export(lib_exports, {
23
- getTransactionsForAddress: () => getTransactionsForAddress
24
- });
25
- module.exports = __toCommonJS(lib_exports);
26
-
27
- // src/lib/getTransactionsForAddress.ts
28
- var getTransactionsForAddress = async (publicAddress, provider) => {
29
- const history = await provider.getHistory(publicAddress);
30
- return history.map((transaction) => {
31
- const {
32
- gasLimit: rawGasLimit,
33
- gasPrice: rawGasPrice,
34
- maxFeePerGas: rawMaxFeePerGas,
35
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
36
- value: rawValue
37
- } = transaction;
38
- const gasLimit = rawGasLimit?.toString();
39
- const gasPrice = rawGasPrice?.toString();
40
- const maxFeePerGas = rawMaxFeePerGas?.toString();
41
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
42
- const value = rawValue?.toString();
43
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
44
- });
45
- };
46
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/index.ts","../../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["export * from './getTransactionsForAddress'\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,eAAe,iBAAiB,SAAS;AAC/C,UAAM,uBAAuB,yBAAyB,SAAS;AAC/D,UAAM,QAAQ,UAAU,SAAS;AACjC,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;","names":[]}
@@ -1,23 +0,0 @@
1
- // src/lib/getTransactionsForAddress.ts
2
- var getTransactionsForAddress = async (publicAddress, provider) => {
3
- const history = await provider.getHistory(publicAddress);
4
- return history.map((transaction) => {
5
- const {
6
- gasLimit: rawGasLimit,
7
- gasPrice: rawGasPrice,
8
- maxFeePerGas: rawMaxFeePerGas,
9
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
10
- value: rawValue
11
- } = transaction;
12
- const gasLimit = rawGasLimit?.toString();
13
- const gasPrice = rawGasPrice?.toString();
14
- const maxFeePerGas = rawMaxFeePerGas?.toString();
15
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
16
- const value = rawValue?.toString();
17
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
18
- });
19
- };
20
- export {
21
- getTransactionsForAddress
22
- };
23
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";AAGO,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,WAAW,aAAa,SAAS;AACvC,UAAM,eAAe,iBAAiB,SAAS;AAC/C,UAAM,uBAAuB,yBAAyB,SAAS;AAC/D,UAAM,QAAQ,UAAU,SAAS;AACjC,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;","names":[]}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/Config.ts
17
- var Config_exports = {};
18
- module.exports = __toCommonJS(Config_exports);
19
- //# sourceMappingURL=Config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Config.ts"],"sourcesContent":["import { AddressTransactionHistoryWitnessConfigSchema } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { WitnessConfig } from '@xyo-network/witness-model'\n\nexport type AddressTransactionHistoryWitnessConfig = WitnessConfig<{\n address?: string\n schema: AddressTransactionHistoryWitnessConfigSchema\n}>\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=Config.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/Plugin.ts
21
- var Plugin_exports = {};
22
- __export(Plugin_exports, {
23
- AddressTransactionHistoryPlugin: () => AddressTransactionHistoryPlugin
24
- });
25
- module.exports = __toCommonJS(Plugin_exports);
26
- var import_crypto_address_transaction_history_payload_plugin2 = require("@xyo-network/crypto-address-transaction-history-payload-plugin");
27
- var import_payload_model = require("@xyo-network/payload-model");
28
- var import_payloadset_plugin = require("@xyo-network/payloadset-plugin");
29
-
30
- // src/Witness.ts
31
- var import_assert = require("@xylabs/assert");
32
- var import_abstract_witness = require("@xyo-network/abstract-witness");
33
- var import_crypto_address_transaction_history_payload_plugin = require("@xyo-network/crypto-address-transaction-history-payload-plugin");
34
-
35
- // src/lib/getTransactionsForAddress.ts
36
- var getTransactionsForAddress = async (publicAddress, provider) => {
37
- const history = await provider.getHistory(publicAddress);
38
- return history.map((transaction) => {
39
- const {
40
- gasLimit: rawGasLimit,
41
- gasPrice: rawGasPrice,
42
- maxFeePerGas: rawMaxFeePerGas,
43
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
44
- value: rawValue
45
- } = transaction;
46
- const gasLimit = rawGasLimit == null ? void 0 : rawGasLimit.toString();
47
- const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
48
- const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
49
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
50
- const value = rawValue == null ? void 0 : rawValue.toString();
51
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
52
- });
53
- };
54
-
55
- // src/Witness.ts
56
- var schema = import_crypto_address_transaction_history_payload_plugin.AddressTransactionHistorySchema;
57
- var AddressTransactionHistoryWitness = class extends import_abstract_witness.AbstractWitness {
58
- static configSchemas = [import_crypto_address_transaction_history_payload_plugin.AddressTransactionHistoryWitnessConfigSchema];
59
- get provider() {
60
- return (0, import_assert.assertEx)(this.params.provider, "Provider Required");
61
- }
62
- async observeHandler() {
63
- await this.started("throw");
64
- const address = (0, import_assert.assertEx)(this.config.address, "params.address is required");
65
- const transactions = await getTransactionsForAddress(address, this.provider);
66
- const payloads = transactions.map((transaction) => {
67
- return { ...transaction, schema };
68
- });
69
- return payloads;
70
- }
71
- };
72
-
73
- // src/Plugin.ts
74
- var AddressTransactionHistoryPlugin = () => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)(
75
- { required: { [import_crypto_address_transaction_history_payload_plugin2.AddressTransactionHistorySchema]: 1 }, schema: import_payload_model.PayloadSetSchema },
76
- {
77
- witness: async (params) => {
78
- const result = await AddressTransactionHistoryWitness.create(params);
79
- return result;
80
- }
81
- }
82
- );
83
- // Annotate the CommonJS export names for ESM import in node:
84
- 0 && (module.exports = {
85
- AddressTransactionHistoryPlugin
86
- });
87
- //# sourceMappingURL=Plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import { AddressTransactionHistorySchema } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { AddressTransactionHistoryWitness } from './Witness'\n\nexport const AddressTransactionHistoryPlugin = () =>\n createPayloadSetWitnessPlugin<AddressTransactionHistoryWitness>(\n { required: { [AddressTransactionHistorySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await AddressTransactionHistoryWitness.create(params)\n return result\n },\n },\n )\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n AddressTransactionHistoryPayload,\n AddressTransactionHistorySchema,\n AddressTransactionHistoryWitnessConfigSchema,\n} from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { AddressTransactionHistoryWitnessConfig } from './Config'\nimport { getTransactionsForAddress } from './lib'\n\nexport type AddressTransactionHistoryWitnessParams = WitnessParams<\n AnyConfigSchema<AddressTransactionHistoryWitnessConfig>,\n {\n provider?: EtherscanProvider\n }\n>\n\nconst schema = AddressTransactionHistorySchema\n\nexport class AddressTransactionHistoryWitness<\n TParams extends AddressTransactionHistoryWitnessParams = AddressTransactionHistoryWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [AddressTransactionHistoryWitnessConfigSchema]\n\n protected get provider() {\n return assertEx(this.params.provider, 'Provider Required')\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n await this.started('throw')\n const address = assertEx(this.config.address, 'params.address is required')\n const transactions = await getTransactionsForAddress(address, this.provider)\n const payloads = transactions.map<AddressTransactionHistoryPayload>((transaction) => {\n return { ...transaction, schema }\n })\n return payloads\n }\n}\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,4DAAgD;AAChD,2BAAiC;AACjC,+BAA8C;;;ACD9C,oBAAyB;AACzB,8BAAgC;AAChC,+DAIO;;;ACJA,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,2CAAa;AAC9B,UAAM,WAAW,2CAAa;AAC9B,UAAM,eAAe,mDAAiB;AACtC,UAAM,uBAAuB,mEAAyB;AACtD,UAAM,QAAQ,qCAAU;AACxB,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;;;ADPA,IAAM,SAAS;AAER,IAAM,mCAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qGAA4C;AAAA,EAE7E,IAAc,WAAW;AACvB,eAAO,wBAAS,KAAK,OAAO,UAAU,mBAAmB;AAAA,EAC3D;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,cAAU,wBAAS,KAAK,OAAO,SAAS,4BAA4B;AAC1E,UAAM,eAAe,MAAM,0BAA0B,SAAS,KAAK,QAAQ;AAC3E,UAAM,WAAW,aAAa,IAAsC,CAAC,gBAAgB;AACnF,aAAO,EAAE,GAAG,aAAa,OAAO;AAAA,IAClC,CAAC;AACD,WAAO;AAAA,EACT;AACF;;;ADpCO,IAAM,kCAAkC,UAC7C;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,yFAA+B,GAAG,EAAE,GAAG,QAAQ,sCAAiB;AAAA,EAC/E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,iCAAiC,OAAO,MAAM;AACnE,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["import_crypto_address_transaction_history_payload_plugin"]}
@@ -1,65 +0,0 @@
1
- // src/Plugin.ts
2
- import { AddressTransactionHistorySchema as AddressTransactionHistorySchema2 } from "@xyo-network/crypto-address-transaction-history-payload-plugin";
3
- import { PayloadSetSchema } from "@xyo-network/payload-model";
4
- import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
5
-
6
- // src/Witness.ts
7
- import { assertEx } from "@xylabs/assert";
8
- import { AbstractWitness } from "@xyo-network/abstract-witness";
9
- import {
10
- AddressTransactionHistorySchema,
11
- AddressTransactionHistoryWitnessConfigSchema
12
- } from "@xyo-network/crypto-address-transaction-history-payload-plugin";
13
-
14
- // src/lib/getTransactionsForAddress.ts
15
- var getTransactionsForAddress = async (publicAddress, provider) => {
16
- const history = await provider.getHistory(publicAddress);
17
- return history.map((transaction) => {
18
- const {
19
- gasLimit: rawGasLimit,
20
- gasPrice: rawGasPrice,
21
- maxFeePerGas: rawMaxFeePerGas,
22
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
23
- value: rawValue
24
- } = transaction;
25
- const gasLimit = rawGasLimit == null ? void 0 : rawGasLimit.toString();
26
- const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
27
- const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
28
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
29
- const value = rawValue == null ? void 0 : rawValue.toString();
30
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
31
- });
32
- };
33
-
34
- // src/Witness.ts
35
- var schema = AddressTransactionHistorySchema;
36
- var AddressTransactionHistoryWitness = class extends AbstractWitness {
37
- static configSchemas = [AddressTransactionHistoryWitnessConfigSchema];
38
- get provider() {
39
- return assertEx(this.params.provider, "Provider Required");
40
- }
41
- async observeHandler() {
42
- await this.started("throw");
43
- const address = assertEx(this.config.address, "params.address is required");
44
- const transactions = await getTransactionsForAddress(address, this.provider);
45
- const payloads = transactions.map((transaction) => {
46
- return { ...transaction, schema };
47
- });
48
- return payloads;
49
- }
50
- };
51
-
52
- // src/Plugin.ts
53
- var AddressTransactionHistoryPlugin = () => createPayloadSetWitnessPlugin(
54
- { required: { [AddressTransactionHistorySchema2]: 1 }, schema: PayloadSetSchema },
55
- {
56
- witness: async (params) => {
57
- const result = await AddressTransactionHistoryWitness.create(params);
58
- return result;
59
- }
60
- }
61
- );
62
- export {
63
- AddressTransactionHistoryPlugin
64
- };
65
- //# sourceMappingURL=Plugin.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import { AddressTransactionHistorySchema } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\nimport { AddressTransactionHistoryWitness } from './Witness'\n\nexport const AddressTransactionHistoryPlugin = () =>\n createPayloadSetWitnessPlugin<AddressTransactionHistoryWitness>(\n { required: { [AddressTransactionHistorySchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await AddressTransactionHistoryWitness.create(params)\n return result\n },\n },\n )\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n AddressTransactionHistoryPayload,\n AddressTransactionHistorySchema,\n AddressTransactionHistoryWitnessConfigSchema,\n} from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { AddressTransactionHistoryWitnessConfig } from './Config'\nimport { getTransactionsForAddress } from './lib'\n\nexport type AddressTransactionHistoryWitnessParams = WitnessParams<\n AnyConfigSchema<AddressTransactionHistoryWitnessConfig>,\n {\n provider?: EtherscanProvider\n }\n>\n\nconst schema = AddressTransactionHistorySchema\n\nexport class AddressTransactionHistoryWitness<\n TParams extends AddressTransactionHistoryWitnessParams = AddressTransactionHistoryWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [AddressTransactionHistoryWitnessConfigSchema]\n\n protected get provider() {\n return assertEx(this.params.provider, 'Provider Required')\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n await this.started('throw')\n const address = assertEx(this.config.address, 'params.address is required')\n const transactions = await getTransactionsForAddress(address, this.provider)\n const payloads = transactions.map<AddressTransactionHistoryPayload>((transaction) => {\n return { ...transaction, schema }\n })\n return payloads\n }\n}\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";AAAA,SAAS,mCAAAA,wCAAuC;AAChD,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACD9C,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC;AAAA,EAEE;AAAA,EACA;AAAA,OACK;;;ACJA,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,2CAAa;AAC9B,UAAM,WAAW,2CAAa;AAC9B,UAAM,eAAe,mDAAiB;AACtC,UAAM,uBAAuB,mEAAyB;AACtD,UAAM,QAAQ,qCAAU;AACxB,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;;;ADPA,IAAM,SAAS;AAER,IAAM,mCAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,4CAA4C;AAAA,EAE7E,IAAc,WAAW;AACvB,WAAO,SAAS,KAAK,OAAO,UAAU,mBAAmB;AAAA,EAC3D;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,UAAU,SAAS,KAAK,OAAO,SAAS,4BAA4B;AAC1E,UAAM,eAAe,MAAM,0BAA0B,SAAS,KAAK,QAAQ;AAC3E,UAAM,WAAW,aAAa,IAAsC,CAAC,gBAAgB;AACnF,aAAO,EAAE,GAAG,aAAa,OAAO;AAAA,IAClC,CAAC;AACD,WAAO;AAAA,EACT;AACF;;;ADpCO,IAAM,kCAAkC,MAC7C;AAAA,EACE,EAAE,UAAU,EAAE,CAACC,gCAA+B,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EAC/E;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,iCAAiC,OAAO,MAAM;AACnE,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["AddressTransactionHistorySchema","AddressTransactionHistorySchema"]}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/Witness.ts
21
- var Witness_exports = {};
22
- __export(Witness_exports, {
23
- AddressTransactionHistoryWitness: () => AddressTransactionHistoryWitness
24
- });
25
- module.exports = __toCommonJS(Witness_exports);
26
- var import_assert = require("@xylabs/assert");
27
- var import_abstract_witness = require("@xyo-network/abstract-witness");
28
- var import_crypto_address_transaction_history_payload_plugin = require("@xyo-network/crypto-address-transaction-history-payload-plugin");
29
-
30
- // src/lib/getTransactionsForAddress.ts
31
- var getTransactionsForAddress = async (publicAddress, provider) => {
32
- const history = await provider.getHistory(publicAddress);
33
- return history.map((transaction) => {
34
- const {
35
- gasLimit: rawGasLimit,
36
- gasPrice: rawGasPrice,
37
- maxFeePerGas: rawMaxFeePerGas,
38
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
39
- value: rawValue
40
- } = transaction;
41
- const gasLimit = rawGasLimit == null ? void 0 : rawGasLimit.toString();
42
- const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
43
- const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
44
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
45
- const value = rawValue == null ? void 0 : rawValue.toString();
46
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
47
- });
48
- };
49
-
50
- // src/Witness.ts
51
- var schema = import_crypto_address_transaction_history_payload_plugin.AddressTransactionHistorySchema;
52
- var AddressTransactionHistoryWitness = class extends import_abstract_witness.AbstractWitness {
53
- static configSchemas = [import_crypto_address_transaction_history_payload_plugin.AddressTransactionHistoryWitnessConfigSchema];
54
- get provider() {
55
- return (0, import_assert.assertEx)(this.params.provider, "Provider Required");
56
- }
57
- async observeHandler() {
58
- await this.started("throw");
59
- const address = (0, import_assert.assertEx)(this.config.address, "params.address is required");
60
- const transactions = await getTransactionsForAddress(address, this.provider);
61
- const payloads = transactions.map((transaction) => {
62
- return { ...transaction, schema };
63
- });
64
- return payloads;
65
- }
66
- };
67
- // Annotate the CommonJS export names for ESM import in node:
68
- 0 && (module.exports = {
69
- AddressTransactionHistoryWitness
70
- });
71
- //# sourceMappingURL=Witness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Witness.ts","../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import type { EtherscanProvider } from '@ethersproject/providers'\nimport { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n AddressTransactionHistoryPayload,\n AddressTransactionHistorySchema,\n AddressTransactionHistoryWitnessConfigSchema,\n} from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { AddressTransactionHistoryWitnessConfig } from './Config'\nimport { getTransactionsForAddress } from './lib'\n\nexport type AddressTransactionHistoryWitnessParams = WitnessParams<\n AnyConfigSchema<AddressTransactionHistoryWitnessConfig>,\n {\n provider?: EtherscanProvider\n }\n>\n\nconst schema = AddressTransactionHistorySchema\n\nexport class AddressTransactionHistoryWitness<\n TParams extends AddressTransactionHistoryWitnessParams = AddressTransactionHistoryWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [AddressTransactionHistoryWitnessConfigSchema]\n\n protected get provider() {\n return assertEx(this.params.provider, 'Provider Required')\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n await this.started('throw')\n const address = assertEx(this.config.address, 'params.address is required')\n const transactions = await getTransactionsForAddress(address, this.provider)\n const payloads = transactions.map<AddressTransactionHistoryPayload>((transaction) => {\n return { ...transaction, schema }\n })\n return payloads\n }\n}\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAyB;AACzB,8BAAgC;AAChC,+DAIO;;;ACJA,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,2CAAa;AAC9B,UAAM,WAAW,2CAAa;AAC9B,UAAM,eAAe,mDAAiB;AACtC,UAAM,uBAAuB,mEAAyB;AACtD,UAAM,QAAQ,qCAAU;AACxB,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;;;ADPA,IAAM,SAAS;AAER,IAAM,mCAAN,cAEG,wCAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,qGAA4C;AAAA,EAE7E,IAAc,WAAW;AACvB,eAAO,wBAAS,KAAK,OAAO,UAAU,mBAAmB;AAAA,EAC3D;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,cAAU,wBAAS,KAAK,OAAO,SAAS,4BAA4B;AAC1E,UAAM,eAAe,MAAM,0BAA0B,SAAS,KAAK,QAAQ;AAC3E,UAAM,WAAW,aAAa,IAAsC,CAAC,gBAAgB;AACnF,aAAO,EAAE,GAAG,aAAa,OAAO;AAAA,IAClC,CAAC;AACD,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -1,49 +0,0 @@
1
- // src/Witness.ts
2
- import { assertEx } from "@xylabs/assert";
3
- import { AbstractWitness } from "@xyo-network/abstract-witness";
4
- import {
5
- AddressTransactionHistorySchema,
6
- AddressTransactionHistoryWitnessConfigSchema
7
- } from "@xyo-network/crypto-address-transaction-history-payload-plugin";
8
-
9
- // src/lib/getTransactionsForAddress.ts
10
- var getTransactionsForAddress = async (publicAddress, provider) => {
11
- const history = await provider.getHistory(publicAddress);
12
- return history.map((transaction) => {
13
- const {
14
- gasLimit: rawGasLimit,
15
- gasPrice: rawGasPrice,
16
- maxFeePerGas: rawMaxFeePerGas,
17
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
18
- value: rawValue
19
- } = transaction;
20
- const gasLimit = rawGasLimit == null ? void 0 : rawGasLimit.toString();
21
- const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
22
- const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
23
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
24
- const value = rawValue == null ? void 0 : rawValue.toString();
25
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
26
- });
27
- };
28
-
29
- // src/Witness.ts
30
- var schema = AddressTransactionHistorySchema;
31
- var AddressTransactionHistoryWitness = class extends AbstractWitness {
32
- static configSchemas = [AddressTransactionHistoryWitnessConfigSchema];
33
- get provider() {
34
- return assertEx(this.params.provider, "Provider Required");
35
- }
36
- async observeHandler() {
37
- await this.started("throw");
38
- const address = assertEx(this.config.address, "params.address is required");
39
- const transactions = await getTransactionsForAddress(address, this.provider);
40
- const payloads = transactions.map((transaction) => {
41
- return { ...transaction, schema };
42
- });
43
- return payloads;
44
- }
45
- };
46
- export {
47
- AddressTransactionHistoryWitness
48
- };
49
- //# sourceMappingURL=Witness.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Witness.ts","../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import type { EtherscanProvider } from '@ethersproject/providers'\nimport { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n AddressTransactionHistoryPayload,\n AddressTransactionHistorySchema,\n AddressTransactionHistoryWitnessConfigSchema,\n} from '@xyo-network/crypto-address-transaction-history-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\n\nimport { AddressTransactionHistoryWitnessConfig } from './Config'\nimport { getTransactionsForAddress } from './lib'\n\nexport type AddressTransactionHistoryWitnessParams = WitnessParams<\n AnyConfigSchema<AddressTransactionHistoryWitnessConfig>,\n {\n provider?: EtherscanProvider\n }\n>\n\nconst schema = AddressTransactionHistorySchema\n\nexport class AddressTransactionHistoryWitness<\n TParams extends AddressTransactionHistoryWitnessParams = AddressTransactionHistoryWitnessParams,\n> extends AbstractWitness<TParams> {\n static override configSchemas = [AddressTransactionHistoryWitnessConfigSchema]\n\n protected get provider() {\n return assertEx(this.params.provider, 'Provider Required')\n }\n\n protected override async observeHandler(): Promise<Payload[]> {\n await this.started('throw')\n const address = assertEx(this.config.address, 'params.address is required')\n const transactions = await getTransactionsForAddress(address, this.provider)\n const payloads = transactions.map<AddressTransactionHistoryPayload>((transaction) => {\n return { ...transaction, schema }\n })\n return payloads\n }\n}\n","import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";AACA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAChC;AAAA,EAEE;AAAA,EACA;AAAA,OACK;;;ACJA,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,2CAAa;AAC9B,UAAM,WAAW,2CAAa;AAC9B,UAAM,eAAe,mDAAiB;AACtC,UAAM,uBAAuB,mEAAyB;AACtD,UAAM,QAAQ,qCAAU;AACxB,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;;;ADPA,IAAM,SAAS;AAER,IAAM,mCAAN,cAEG,gBAAyB;AAAA,EACjC,OAAgB,gBAAgB,CAAC,4CAA4C;AAAA,EAE7E,IAAc,WAAW;AACvB,WAAO,SAAS,KAAK,OAAO,UAAU,mBAAmB;AAAA,EAC3D;AAAA,EAEA,MAAyB,iBAAqC;AAC5D,UAAM,KAAK,QAAQ,OAAO;AAC1B,UAAM,UAAU,SAAS,KAAK,OAAO,SAAS,4BAA4B;AAC1E,UAAM,eAAe,MAAM,0BAA0B,SAAS,KAAK,QAAQ;AAC3E,UAAM,WAAW,aAAa,IAAsC,CAAC,gBAAgB;AACnF,aAAO,EAAE,GAAG,aAAa,OAAO;AAAA,IAClC,CAAC;AACD,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/lib/getTransactionsForAddress.ts
21
- var getTransactionsForAddress_exports = {};
22
- __export(getTransactionsForAddress_exports, {
23
- getTransactionsForAddress: () => getTransactionsForAddress
24
- });
25
- module.exports = __toCommonJS(getTransactionsForAddress_exports);
26
- var getTransactionsForAddress = async (publicAddress, provider) => {
27
- const history = await provider.getHistory(publicAddress);
28
- return history.map((transaction) => {
29
- const {
30
- gasLimit: rawGasLimit,
31
- gasPrice: rawGasPrice,
32
- maxFeePerGas: rawMaxFeePerGas,
33
- maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
34
- value: rawValue
35
- } = transaction;
36
- const gasLimit = rawGasLimit == null ? void 0 : rawGasLimit.toString();
37
- const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
38
- const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
39
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
40
- const value = rawValue == null ? void 0 : rawValue.toString();
41
- return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
42
- });
43
- };
44
- // Annotate the CommonJS export names for ESM import in node:
45
- 0 && (module.exports = {
46
- getTransactionsForAddress
47
- });
48
- //# sourceMappingURL=getTransactionsForAddress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/lib/getTransactionsForAddress.ts"],"sourcesContent":["import type { EtherscanProvider } from '@ethersproject/providers'\nimport { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin'\n\nexport const getTransactionsForAddress = async (\n /**\n * The address of the wallet to search for NFTs\n */\n publicAddress: string,\n /**\n * The ethers provider to use to search\n */\n provider: EtherscanProvider,\n): Promise<Transaction[]> => {\n const history = await provider.getHistory(publicAddress)\n return history.map<Transaction>((transaction) => {\n const {\n gasLimit: rawGasLimit,\n gasPrice: rawGasPrice,\n maxFeePerGas: rawMaxFeePerGas,\n maxPriorityFeePerGas: rawMaxPriorityFeePerGas,\n value: rawValue,\n } = transaction\n const gasLimit = rawGasLimit?.toString()\n const gasPrice = rawGasPrice?.toString()\n const maxFeePerGas = rawMaxFeePerGas?.toString()\n const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString()\n const value = rawValue?.toString()\n return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value }\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,IAAM,4BAA4B,OAIvC,eAIA,aAC2B;AAC3B,QAAM,UAAU,MAAM,SAAS,WAAW,aAAa;AACvD,SAAO,QAAQ,IAAiB,CAAC,gBAAgB;AAC/C,UAAM;AAAA,MACJ,UAAU;AAAA,MACV,UAAU;AAAA,MACV,cAAc;AAAA,MACd,sBAAsB;AAAA,MACtB,OAAO;AAAA,IACT,IAAI;AACJ,UAAM,WAAW,2CAAa;AAC9B,UAAM,WAAW,2CAAa;AAC9B,UAAM,eAAe,mDAAiB;AACtC,UAAM,uBAAuB,mEAAyB;AACtD,UAAM,QAAQ,qCAAU;AACxB,WAAO,EAAE,GAAG,aAAa,UAAU,UAAU,cAAc,sBAAsB,MAAM;AAAA,EACzF,CAAC;AACH;","names":[]}