@xyo-network/crypto-address-transaction-history-plugin 2.75.0 → 2.75.3

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 (58) hide show
  1. package/dist/browser/Config.d.cts +7 -0
  2. package/dist/browser/Config.d.cts.map +1 -0
  3. package/dist/browser/Plugin.d.cts +57 -0
  4. package/dist/browser/Plugin.d.cts.map +1 -0
  5. package/dist/browser/Plugin.js +4 -52
  6. package/dist/browser/Plugin.js.map +1 -1
  7. package/dist/browser/Witness.d.cts +14 -0
  8. package/dist/browser/Witness.d.cts.map +1 -0
  9. package/dist/browser/Witness.js +4 -26
  10. package/dist/browser/Witness.js.map +1 -1
  11. package/dist/browser/index.d.cts +7 -0
  12. package/dist/browser/index.d.cts.map +1 -0
  13. package/dist/browser/index.js +5 -66
  14. package/dist/browser/index.js.map +1 -1
  15. package/dist/browser/lib/getTransactionsForAddress.d.cts +4 -0
  16. package/dist/browser/lib/getTransactionsForAddress.d.cts.map +1 -0
  17. package/dist/browser/lib/getTransactionsForAddress.js +1 -2
  18. package/dist/browser/lib/getTransactionsForAddress.js.map +1 -1
  19. package/dist/browser/lib/index.d.cts +2 -0
  20. package/dist/browser/lib/index.d.cts.map +1 -0
  21. package/dist/browser/lib/index.js +1 -22
  22. package/dist/browser/lib/index.js.map +1 -1
  23. package/dist/docs.json +22697 -0
  24. package/dist/node/Config.d.cts +7 -0
  25. package/dist/node/Config.d.cts.map +1 -0
  26. package/dist/node/Config.js +2 -0
  27. package/dist/node/Config.js.map +1 -1
  28. package/dist/node/Plugin.d.cts +57 -0
  29. package/dist/node/Plugin.d.cts.map +1 -0
  30. package/dist/node/Plugin.js +51 -5
  31. package/dist/node/Plugin.js.map +1 -1
  32. package/dist/node/Plugin.mjs +52 -4
  33. package/dist/node/Plugin.mjs.map +1 -1
  34. package/dist/node/Witness.d.cts +14 -0
  35. package/dist/node/Witness.d.cts.map +1 -0
  36. package/dist/node/Witness.js +28 -5
  37. package/dist/node/Witness.js.map +1 -1
  38. package/dist/node/Witness.mjs +26 -4
  39. package/dist/node/Witness.mjs.map +1 -1
  40. package/dist/node/index.d.cts +7 -0
  41. package/dist/node/index.d.cts.map +1 -0
  42. package/dist/node/index.js +70 -11
  43. package/dist/node/index.js.map +1 -1
  44. package/dist/node/index.mjs +66 -5
  45. package/dist/node/index.mjs.map +1 -1
  46. package/dist/node/lib/getTransactionsForAddress.d.cts +4 -0
  47. package/dist/node/lib/getTransactionsForAddress.d.cts.map +1 -0
  48. package/dist/node/lib/getTransactionsForAddress.js +8 -6
  49. package/dist/node/lib/getTransactionsForAddress.js.map +1 -1
  50. package/dist/node/lib/getTransactionsForAddress.mjs +7 -6
  51. package/dist/node/lib/getTransactionsForAddress.mjs.map +1 -1
  52. package/dist/node/lib/index.d.cts +2 -0
  53. package/dist/node/lib/index.d.cts.map +1 -0
  54. package/dist/node/lib/index.js +30 -3
  55. package/dist/node/lib/index.js.map +1 -1
  56. package/dist/node/lib/index.mjs +22 -1
  57. package/dist/node/lib/index.mjs.map +1 -1
  58. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import { AddressTransactionHistoryPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './lib'\nexport * from './Witness'\n\nexport { AddressTransactionHistoryPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default AddressTransactionHistoryPlugin\n"],"mappings":"AAAA,SAAS,uCAAuC;AAEhD,cAAc;AACd,cAAc;AACd,cAAc;AAKd,IAAO,cAAQ;","names":[]}
1
+ {"version":3,"sources":["../../src/Plugin.ts","../../src/Witness.ts","../../src/lib/getTransactionsForAddress.ts","../../src/index.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 {\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 { AbstractWitness, WitnessParams } from '@xyo-network/witness'\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","import { AddressTransactionHistoryPlugin } from './Plugin'\n\nexport * from './Config'\nexport * from './lib'\nexport * from './Witness'\n\nexport { AddressTransactionHistoryPlugin }\n\n// eslint-disable-next-line import/no-default-export\nexport default AddressTransactionHistoryPlugin\n"],"mappings":";AAAA,SAAS,mCAAAA,wCAAuC;AAChD,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;;;ACD9C,SAAS,gBAAgB;AACzB;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,uBAAsC;;;ACNxC,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;;;ADRA,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;;;ADnCO,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;;;AGNF,IAAO,cAAQ;","names":["AddressTransactionHistorySchema","AddressTransactionHistorySchema"]}
@@ -0,0 +1,4 @@
1
+ import type { EtherscanProvider } from '@ethersproject/providers';
2
+ import { Transaction } from '@xyo-network/crypto-address-transaction-history-payload-plugin';
3
+ export declare const getTransactionsForAddress: (publicAddress: string, provider: EtherscanProvider) => Promise<Transaction[]>;
4
+ //# sourceMappingURL=getTransactionsForAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTransactionsForAddress.d.ts","sourceRoot":"","sources":["../../../src/lib/getTransactionsForAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gEAAgE,CAAA;AAE5F,eAAO,MAAM,yBAAyB,kBAIrB,MAAM,YAIX,iBAAiB,KAC1B,QAAQ,WAAW,EAAE,CAiBvB,CAAA"}
@@ -16,12 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/getTransactionsForAddress.ts
19
21
  var getTransactionsForAddress_exports = {};
20
22
  __export(getTransactionsForAddress_exports, {
21
23
  getTransactionsForAddress: () => getTransactionsForAddress
22
24
  });
23
25
  module.exports = __toCommonJS(getTransactionsForAddress_exports);
24
- const getTransactionsForAddress = async (publicAddress, provider) => {
26
+ var getTransactionsForAddress = async (publicAddress, provider) => {
25
27
  const history = await provider.getHistory(publicAddress);
26
28
  return history.map((transaction) => {
27
29
  const {
@@ -31,11 +33,11 @@ const getTransactionsForAddress = async (publicAddress, provider) => {
31
33
  maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
32
34
  value: rawValue
33
35
  } = transaction;
34
- const gasLimit = rawGasLimit?.toString();
35
- const gasPrice = rawGasPrice?.toString();
36
- const maxFeePerGas = rawMaxFeePerGas?.toString();
37
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
38
- const value = rawValue?.toString();
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();
39
41
  return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
40
42
  });
41
43
  };
@@ -1 +1 @@
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,MAAM,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
+ {"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":[]}
@@ -1,4 +1,5 @@
1
- const getTransactionsForAddress = async (publicAddress, provider) => {
1
+ // src/lib/getTransactionsForAddress.ts
2
+ var getTransactionsForAddress = async (publicAddress, provider) => {
2
3
  const history = await provider.getHistory(publicAddress);
3
4
  return history.map((transaction) => {
4
5
  const {
@@ -8,11 +9,11 @@ const getTransactionsForAddress = async (publicAddress, provider) => {
8
9
  maxPriorityFeePerGas: rawMaxPriorityFeePerGas,
9
10
  value: rawValue
10
11
  } = transaction;
11
- const gasLimit = rawGasLimit?.toString();
12
- const gasPrice = rawGasPrice?.toString();
13
- const maxFeePerGas = rawMaxFeePerGas?.toString();
14
- const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
15
- const value = rawValue?.toString();
12
+ const gasLimit = rawGasLimit == null ? void 0 : rawGasLimit.toString();
13
+ const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
14
+ const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
15
+ const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
16
+ const value = rawValue == null ? void 0 : rawValue.toString();
16
17
  return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
17
18
  });
18
19
  };
@@ -1 +1 @@
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,MAAM,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
+ {"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,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":[]}
@@ -0,0 +1,2 @@
1
+ export * from './getTransactionsForAddress';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
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
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -11,13 +15,36 @@ var __copyProps = (to, from, except, desc) => {
11
15
  }
12
16
  return to;
13
17
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/index.ts
16
21
  var lib_exports = {};
22
+ __export(lib_exports, {
23
+ getTransactionsForAddress: () => getTransactionsForAddress
24
+ });
17
25
  module.exports = __toCommonJS(lib_exports);
18
- __reExport(lib_exports, require("./getTransactionsForAddress"), module.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 == null ? void 0 : rawGasLimit.toString();
39
+ const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
40
+ const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
41
+ const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
42
+ const value = rawValue == null ? void 0 : rawValue.toString();
43
+ return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
44
+ });
45
+ };
19
46
  // Annotate the CommonJS export names for ESM import in node:
20
47
  0 && (module.exports = {
21
- ...require("./getTransactionsForAddress")
48
+ getTransactionsForAddress
22
49
  });
23
50
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './getTransactionsForAddress'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,wCAAd;","names":[]}
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,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":[]}
@@ -1,2 +1,23 @@
1
- export * from "./getTransactionsForAddress";
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 == null ? void 0 : rawGasLimit.toString();
13
+ const gasPrice = rawGasPrice == null ? void 0 : rawGasPrice.toString();
14
+ const maxFeePerGas = rawMaxFeePerGas == null ? void 0 : rawMaxFeePerGas.toString();
15
+ const maxPriorityFeePerGas = rawMaxPriorityFeePerGas == null ? void 0 : rawMaxPriorityFeePerGas.toString();
16
+ const value = rawValue == null ? void 0 : rawValue.toString();
17
+ return { ...transaction, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, value };
18
+ });
19
+ };
20
+ export {
21
+ getTransactionsForAddress
22
+ };
2
23
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './getTransactionsForAddress'\n"],"mappings":"AAAA,cAAc;","names":[]}
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,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":[]}
package/package.json CHANGED
@@ -11,17 +11,17 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@ethersproject/providers": "^5.7.2",
14
- "@xylabs/assert": "^2.11.22",
15
- "@xyo-network/crypto-address-transaction-history-payload-plugin": "~2.75.0",
16
- "@xyo-network/module-model": "~2.75.0",
17
- "@xyo-network/payload-model": "~2.75.0",
18
- "@xyo-network/payloadset-plugin": "~2.75.0",
19
- "@xyo-network/witness": "~2.75.0"
14
+ "@xylabs/assert": "^2.12.10",
15
+ "@xyo-network/crypto-address-transaction-history-payload-plugin": "~2.75.3",
16
+ "@xyo-network/module-model": "~2.75.3",
17
+ "@xyo-network/payload-model": "~2.75.3",
18
+ "@xyo-network/payloadset-plugin": "~2.75.3",
19
+ "@xyo-network/witness": "~2.75.3"
20
20
  },
21
21
  "devDependencies": {
22
- "@xylabs/jest-helpers": "^2.11.22",
23
- "@xylabs/ts-scripts-yarn3": "^3.0.70",
24
- "@xylabs/tsconfig": "^3.0.70",
22
+ "@xylabs/jest-helpers": "^2.12.10",
23
+ "@xylabs/ts-scripts-yarn3": "^3.0.77",
24
+ "@xylabs/tsconfig": "^3.0.77",
25
25
  "ethers": "^5.7.2",
26
26
  "jest": "^29.7.0",
27
27
  "typescript": "^5.2.2"
@@ -33,7 +33,7 @@
33
33
  ".": {
34
34
  "browser": {
35
35
  "require": {
36
- "types": "./dist/browser/index.d.ts",
36
+ "types": "./dist/browser/index.d.cts",
37
37
  "default": "./dist/browser/index.cjs"
38
38
  },
39
39
  "import": {
@@ -69,5 +69,5 @@
69
69
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
70
70
  },
71
71
  "sideEffects": false,
72
- "version": "2.75.0"
72
+ "version": "2.75.3"
73
73
  }