@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.
- package/dist/browser/Config.d.cts +7 -0
- package/dist/browser/Config.d.cts.map +1 -0
- package/dist/browser/Plugin.d.cts +57 -0
- package/dist/browser/Plugin.d.cts.map +1 -0
- package/dist/browser/Plugin.js +4 -52
- package/dist/browser/Plugin.js.map +1 -1
- package/dist/browser/Witness.d.cts +14 -0
- package/dist/browser/Witness.d.cts.map +1 -0
- package/dist/browser/Witness.js +4 -26
- package/dist/browser/Witness.js.map +1 -1
- package/dist/browser/index.d.cts +7 -0
- package/dist/browser/index.d.cts.map +1 -0
- package/dist/browser/index.js +5 -66
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/lib/getTransactionsForAddress.d.cts +4 -0
- package/dist/browser/lib/getTransactionsForAddress.d.cts.map +1 -0
- package/dist/browser/lib/getTransactionsForAddress.js +1 -2
- package/dist/browser/lib/getTransactionsForAddress.js.map +1 -1
- package/dist/browser/lib/index.d.cts +2 -0
- package/dist/browser/lib/index.d.cts.map +1 -0
- package/dist/browser/lib/index.js +1 -22
- package/dist/browser/lib/index.js.map +1 -1
- package/dist/docs.json +22697 -0
- package/dist/node/Config.d.cts +7 -0
- package/dist/node/Config.d.cts.map +1 -0
- package/dist/node/Config.js +2 -0
- package/dist/node/Config.js.map +1 -1
- package/dist/node/Plugin.d.cts +57 -0
- package/dist/node/Plugin.d.cts.map +1 -0
- package/dist/node/Plugin.js +51 -5
- package/dist/node/Plugin.js.map +1 -1
- package/dist/node/Plugin.mjs +52 -4
- package/dist/node/Plugin.mjs.map +1 -1
- package/dist/node/Witness.d.cts +14 -0
- package/dist/node/Witness.d.cts.map +1 -0
- package/dist/node/Witness.js +28 -5
- package/dist/node/Witness.js.map +1 -1
- package/dist/node/Witness.mjs +26 -4
- package/dist/node/Witness.mjs.map +1 -1
- package/dist/node/index.d.cts +7 -0
- package/dist/node/index.d.cts.map +1 -0
- package/dist/node/index.js +70 -11
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +66 -5
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/lib/getTransactionsForAddress.d.cts +4 -0
- package/dist/node/lib/getTransactionsForAddress.d.cts.map +1 -0
- package/dist/node/lib/getTransactionsForAddress.js +8 -6
- package/dist/node/lib/getTransactionsForAddress.js.map +1 -1
- package/dist/node/lib/getTransactionsForAddress.mjs +7 -6
- package/dist/node/lib/getTransactionsForAddress.mjs.map +1 -1
- package/dist/node/lib/index.d.cts +2 -0
- package/dist/node/lib/index.d.cts.map +1 -0
- package/dist/node/lib/index.js +30 -3
- package/dist/node/lib/index.js.map +1 -1
- package/dist/node/lib/index.mjs +22 -1
- package/dist/node/lib/index.mjs.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AddressTransactionHistoryWitnessConfigSchema } from '@xyo-network/crypto-address-transaction-history-payload-plugin';
|
|
2
|
+
import { WitnessConfig } from '@xyo-network/witness';
|
|
3
|
+
export type AddressTransactionHistoryWitnessConfig = WitnessConfig<{
|
|
4
|
+
address?: string;
|
|
5
|
+
schema: AddressTransactionHistoryWitnessConfigSchema;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4CAA4C,EAAE,MAAM,gEAAgE,CAAA;AAC7H,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,MAAM,sCAAsC,GAAG,aAAa,CAAC;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,4CAA4C,CAAA;CACrD,CAAC,CAAA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { AddressTransactionHistoryWitness } from './Witness';
|
|
2
|
+
export declare const AddressTransactionHistoryPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<AddressTransactionHistoryWitness<import("@xyo-network/core").BaseParamsFields & {
|
|
3
|
+
account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
|
|
4
|
+
config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
5
|
+
accountDerivationPath?: string | undefined;
|
|
6
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
7
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
8
|
+
readonly name?: string | undefined;
|
|
9
|
+
readonly paging?: Record<string, {
|
|
10
|
+
size?: number | undefined;
|
|
11
|
+
}> | undefined;
|
|
12
|
+
readonly security?: {
|
|
13
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
14
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
15
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly sign?: boolean | undefined;
|
|
18
|
+
readonly storeQueries?: boolean | undefined;
|
|
19
|
+
readonly timestamp?: boolean | undefined;
|
|
20
|
+
} & Omit<import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<{
|
|
21
|
+
accountDerivationPath?: string | undefined;
|
|
22
|
+
readonly archivist?: import("@xyo-network/module-model").ArchivistModuleConfig | undefined;
|
|
23
|
+
readonly labels?: import("@xyo-network/module-model").Labels | undefined;
|
|
24
|
+
readonly name?: string | undefined;
|
|
25
|
+
readonly paging?: Record<string, {
|
|
26
|
+
size?: number | undefined;
|
|
27
|
+
}> | undefined;
|
|
28
|
+
readonly security?: {
|
|
29
|
+
readonly allowAnonymous?: boolean | undefined;
|
|
30
|
+
readonly allowed?: Record<string, (string | import("@xyo-network/module-model").CosigningAddressSet)[]> | undefined;
|
|
31
|
+
readonly disallowed?: Record<string, string[]> | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
readonly sign?: boolean | undefined;
|
|
34
|
+
readonly storeQueries?: boolean | undefined;
|
|
35
|
+
readonly timestamp?: boolean | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
archivist?: string | undefined;
|
|
38
|
+
schema: "network.xyo.crypto.address.transaction.witness.config";
|
|
39
|
+
targetSet?: (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/payload-model").PayloadSet & {
|
|
40
|
+
schema: "network.xyo.payload.set";
|
|
41
|
+
}) | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
address?: string | undefined;
|
|
44
|
+
schema: "network.xyo.crypto.address.transaction.witness.config";
|
|
45
|
+
}, "schema"> & {
|
|
46
|
+
schema: "network.xyo.crypto.address.transaction.witness.config";
|
|
47
|
+
}, "schema"> & {
|
|
48
|
+
schema: string;
|
|
49
|
+
}, "schema"> & {
|
|
50
|
+
schema: string;
|
|
51
|
+
};
|
|
52
|
+
ephemeralQueryAccountEnabled?: boolean | undefined;
|
|
53
|
+
wallet?: import("@xyo-network/wallet-model").WalletInstance | undefined;
|
|
54
|
+
} & {
|
|
55
|
+
provider?: import("@ethersproject/providers").EtherscanProvider | undefined;
|
|
56
|
+
}>>;
|
|
57
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gCAAgC,EAAE,MAAM,WAAW,CAAA;AAE5D,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GASzC,CAAA"}
|
package/dist/browser/Plugin.js
CHANGED
|
@@ -1,57 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import { AddressTransactionHistorySchema as AddressTransactionHistorySchema2 } from "@xyo-network/crypto-address-transaction-history-payload-plugin";
|
|
1
|
+
import { AddressTransactionHistorySchema } from "@xyo-network/crypto-address-transaction-history-payload-plugin";
|
|
3
2
|
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
4
3
|
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
AddressTransactionHistorySchema,
|
|
10
|
-
AddressTransactionHistoryWitnessConfigSchema
|
|
11
|
-
} from "@xyo-network/crypto-address-transaction-history-payload-plugin";
|
|
12
|
-
import { AbstractWitness } from "@xyo-network/witness";
|
|
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?.toString();
|
|
26
|
-
const gasPrice = rawGasPrice?.toString();
|
|
27
|
-
const maxFeePerGas = rawMaxFeePerGas?.toString();
|
|
28
|
-
const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
|
|
29
|
-
const value = 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 },
|
|
4
|
+
import { AddressTransactionHistoryWitness } from "./Witness";
|
|
5
|
+
const AddressTransactionHistoryPlugin = () => createPayloadSetWitnessPlugin(
|
|
6
|
+
{ required: { [AddressTransactionHistorySchema]: 1 }, schema: PayloadSetSchema },
|
|
55
7
|
{
|
|
56
8
|
witness: async (params) => {
|
|
57
9
|
const result = await AddressTransactionHistoryWitness.create(params);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Plugin.ts"
|
|
1
|
+
{"version":3,"sources":["../../src/Plugin.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"],"mappings":"AAAA,SAAS,uCAAuC;AAChD,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAE9C,SAAS,wCAAwC;AAE1C,MAAM,kCAAkC,MAC7C;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,+BAA+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":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EtherscanProvider } from '@ethersproject/providers';
|
|
2
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
+
import { Payload } from '@xyo-network/payload-model';
|
|
4
|
+
import { AbstractWitness, WitnessParams } from '@xyo-network/witness';
|
|
5
|
+
import { AddressTransactionHistoryWitnessConfig } from './Config';
|
|
6
|
+
export type AddressTransactionHistoryWitnessParams = WitnessParams<AnyConfigSchema<AddressTransactionHistoryWitnessConfig>, {
|
|
7
|
+
provider?: EtherscanProvider;
|
|
8
|
+
}>;
|
|
9
|
+
export declare class AddressTransactionHistoryWitness<TParams extends AddressTransactionHistoryWitnessParams = AddressTransactionHistoryWitnessParams> extends AbstractWitness<TParams> {
|
|
10
|
+
static configSchemas: "network.xyo.crypto.address.transaction.witness.config"[];
|
|
11
|
+
protected get provider(): EtherscanProvider;
|
|
12
|
+
protected observeHandler(): Promise<Payload[]>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAOjE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAErE,OAAO,EAAE,sCAAsC,EAAE,MAAM,UAAU,CAAA;AAGjE,MAAM,MAAM,sCAAsC,GAAG,aAAa,CAChE,eAAe,CAAC,sCAAsC,CAAC,EACvD;IACE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CACF,CAAA;AAID,qBAAa,gCAAgC,CAC3C,OAAO,SAAS,sCAAsC,GAAG,sCAAsC,CAC/F,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,OAAgB,aAAa,4DAAiD;IAE9E,SAAS,KAAK,QAAQ,sBAErB;cAEwB,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAS9D"}
|
package/dist/browser/Witness.js
CHANGED
|
@@ -1,34 +1,12 @@
|
|
|
1
|
-
// src/Witness.ts
|
|
2
1
|
import { assertEx } from "@xylabs/assert";
|
|
3
2
|
import {
|
|
4
3
|
AddressTransactionHistorySchema,
|
|
5
4
|
AddressTransactionHistoryWitnessConfigSchema
|
|
6
5
|
} from "@xyo-network/crypto-address-transaction-history-payload-plugin";
|
|
7
6
|
import { AbstractWitness } from "@xyo-network/witness";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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 {
|
|
7
|
+
import { getTransactionsForAddress } from "./lib";
|
|
8
|
+
const schema = AddressTransactionHistorySchema;
|
|
9
|
+
class AddressTransactionHistoryWitness extends AbstractWitness {
|
|
32
10
|
static configSchemas = [AddressTransactionHistoryWitnessConfigSchema];
|
|
33
11
|
get provider() {
|
|
34
12
|
return assertEx(this.params.provider, "Provider Required");
|
|
@@ -42,7 +20,7 @@ var AddressTransactionHistoryWitness = class extends AbstractWitness {
|
|
|
42
20
|
});
|
|
43
21
|
return payloads;
|
|
44
22
|
}
|
|
45
|
-
}
|
|
23
|
+
}
|
|
46
24
|
export {
|
|
47
25
|
AddressTransactionHistoryWitness
|
|
48
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Witness.ts"
|
|
1
|
+
{"version":3,"sources":["../../src/Witness.ts"],"sourcesContent":["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"],"mappings":"AACA,SAAS,gBAAgB;AACzB;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,uBAAsC;AAG/C,SAAS,iCAAiC;AAS1C,MAAM,SAAS;AAER,MAAM,yCAEH,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":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AddressTransactionHistoryPlugin } from './Plugin';
|
|
2
|
+
export * from './Config';
|
|
3
|
+
export * from './lib';
|
|
4
|
+
export * from './Witness';
|
|
5
|
+
export { AddressTransactionHistoryPlugin };
|
|
6
|
+
export default AddressTransactionHistoryPlugin;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAA;AAE1D,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,+BAA+B,EAAE,CAAA;AAG1C,eAAe,+BAA+B,CAAA"}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,71 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// src/Witness.ts
|
|
7
|
-
import { assertEx } from "@xylabs/assert";
|
|
8
|
-
import {
|
|
9
|
-
AddressTransactionHistorySchema,
|
|
10
|
-
AddressTransactionHistoryWitnessConfigSchema
|
|
11
|
-
} from "@xyo-network/crypto-address-transaction-history-payload-plugin";
|
|
12
|
-
import { AbstractWitness } from "@xyo-network/witness";
|
|
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?.toString();
|
|
26
|
-
const gasPrice = rawGasPrice?.toString();
|
|
27
|
-
const maxFeePerGas = rawMaxFeePerGas?.toString();
|
|
28
|
-
const maxPriorityFeePerGas = rawMaxPriorityFeePerGas?.toString();
|
|
29
|
-
const value = 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
|
-
|
|
63
|
-
// src/index.ts
|
|
1
|
+
import { AddressTransactionHistoryPlugin } from "./Plugin";
|
|
2
|
+
export * from "./Config";
|
|
3
|
+
export * from "./lib";
|
|
4
|
+
export * from "./Witness";
|
|
64
5
|
var src_default = AddressTransactionHistoryPlugin;
|
|
65
6
|
export {
|
|
66
7
|
AddressTransactionHistoryPlugin,
|
|
67
|
-
|
|
68
|
-
src_default as default,
|
|
69
|
-
getTransactionsForAddress
|
|
8
|
+
src_default as default
|
|
70
9
|
};
|
|
71
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
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":[]}
|
|
@@ -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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var getTransactionsForAddress = async (publicAddress, provider) => {
|
|
1
|
+
const getTransactionsForAddress = async (publicAddress, provider) => {
|
|
3
2
|
const history = await provider.getHistory(publicAddress);
|
|
4
3
|
return history.map((transaction) => {
|
|
5
4
|
const {
|
|
@@ -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":"
|
|
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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA"}
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
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
|
-
};
|
|
1
|
+
export * from "./getTransactionsForAddress";
|
|
23
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './getTransactionsForAddress'\n"],"mappings":"AAAA,cAAc;","names":[]}
|