@requestnetwork/payment-detection 0.35.1-next.1795 → 0.35.1-next.1796
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/any/any-to-erc20-proxy.d.ts +5 -7
- package/dist/any/any-to-erc20-proxy.d.ts.map +1 -1
- package/dist/any/any-to-erc20-proxy.js +19 -8
- package/dist/any/any-to-erc20-proxy.js.map +1 -1
- package/dist/any/any-to-eth-proxy.d.ts +6 -11
- package/dist/any/any-to-eth-proxy.d.ts.map +1 -1
- package/dist/any/any-to-eth-proxy.js +22 -15
- package/dist/any/any-to-eth-proxy.js.map +1 -1
- package/dist/any-to-any-detector.d.ts +0 -1
- package/dist/any-to-any-detector.d.ts.map +1 -1
- package/dist/any-to-any-detector.js +1 -2
- package/dist/any-to-any-detector.js.map +1 -1
- package/dist/erc20/fee-proxy-contract.d.ts +6 -8
- package/dist/erc20/fee-proxy-contract.d.ts.map +1 -1
- package/dist/erc20/fee-proxy-contract.js +19 -13
- package/dist/erc20/fee-proxy-contract.js.map +1 -1
- package/dist/erc20/proxy-contract.d.ts +5 -5
- package/dist/erc20/proxy-contract.d.ts.map +1 -1
- package/dist/erc20/proxy-contract.js +16 -9
- package/dist/erc20/proxy-contract.js.map +1 -1
- package/dist/erc777/superfluid-detector.d.ts +3 -4
- package/dist/erc777/superfluid-detector.d.ts.map +1 -1
- package/dist/erc777/superfluid-detector.js +2 -2
- package/dist/erc777/superfluid-detector.js.map +1 -1
- package/dist/eth/fee-proxy-detector.d.ts +6 -6
- package/dist/eth/fee-proxy-detector.d.ts.map +1 -1
- package/dist/eth/fee-proxy-detector.js +17 -10
- package/dist/eth/fee-proxy-detector.js.map +1 -1
- package/dist/eth/input-data.d.ts +6 -7
- package/dist/eth/input-data.d.ts.map +1 -1
- package/dist/eth/input-data.js +18 -11
- package/dist/eth/input-data.js.map +1 -1
- package/dist/fee-reference-based-detector.d.ts +2 -1
- package/dist/fee-reference-based-detector.d.ts.map +1 -1
- package/dist/fee-reference-based-detector.js +2 -2
- package/dist/fee-reference-based-detector.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/near/near-detector.d.ts +3 -4
- package/dist/near/near-detector.d.ts.map +1 -1
- package/dist/near/near-detector.js +2 -2
- package/dist/near/near-detector.js.map +1 -1
- package/dist/near/retrievers/near-conversion-info-retriever.d.ts +1 -1
- package/dist/near/retrievers/near-conversion-info-retriever.d.ts.map +1 -1
- package/dist/near/retrievers/near-info-retriever.d.ts +0 -1
- package/dist/near/retrievers/near-info-retriever.d.ts.map +1 -1
- package/dist/near/retrievers/near-info-retriever.js +3 -4
- package/dist/near/retrievers/near-info-retriever.js.map +1 -1
- package/dist/payment-network-factory.d.ts +4 -8
- package/dist/payment-network-factory.d.ts.map +1 -1
- package/dist/payment-network-factory.js +15 -1
- package/dist/payment-network-factory.js.map +1 -1
- package/dist/reference-based-detector.d.ts +4 -1
- package/dist/reference-based-detector.d.ts.map +1 -1
- package/dist/reference-based-detector.js +3 -1
- package/dist/reference-based-detector.js.map +1 -1
- package/dist/thegraph/__mocks__/client.d.ts +16 -0
- package/dist/thegraph/__mocks__/client.d.ts.map +1 -0
- package/dist/thegraph/__mocks__/client.js +15 -0
- package/dist/thegraph/__mocks__/client.js.map +1 -0
- package/dist/thegraph/client.d.ts +36 -0
- package/dist/thegraph/client.d.ts.map +1 -0
- package/dist/thegraph/client.js +12 -0
- package/dist/thegraph/client.js.map +1 -0
- package/dist/thegraph/generated/graphql.d.ts +12 -50
- package/dist/thegraph/generated/graphql.d.ts.map +1 -1
- package/dist/thegraph/generated/graphql.js +67 -152
- package/dist/thegraph/generated/graphql.js.map +1 -1
- package/dist/thegraph/index.d.ts +2 -15
- package/dist/thegraph/index.d.ts.map +1 -1
- package/dist/thegraph/index.js +3 -27
- package/dist/thegraph/index.js.map +1 -1
- package/dist/thegraph/info-retriever.d.ts +30 -0
- package/dist/thegraph/info-retriever.d.ts.map +1 -0
- package/dist/thegraph/info-retriever.js +89 -0
- package/dist/thegraph/info-retriever.js.map +1 -0
- package/dist/types.d.ts +18 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +5 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +17 -1
- package/dist/utils.js.map +1 -1
- package/package.json +9 -7
- package/dist/any/retrievers/thegraph.d.ts +0 -38
- package/dist/any/retrievers/thegraph.d.ts.map +0 -1
- package/dist/any/retrievers/thegraph.js +0 -91
- package/dist/any/retrievers/thegraph.js.map +0 -1
- package/dist/erc20/thegraph-info-retriever.d.ts +0 -26
- package/dist/erc20/thegraph-info-retriever.d.ts.map +0 -1
- package/dist/erc20/thegraph-info-retriever.js +0 -77
- package/dist/erc20/thegraph-info-retriever.js.map +0 -1
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICurrencyManager } from '@requestnetwork/currency';
|
|
1
|
+
import { ExtensionTypes, PaymentTypes, RequestLogicTypes } from '@requestnetwork/types';
|
|
3
2
|
import { ERC20FeeProxyPaymentDetectorBase } from '../erc20/fee-proxy-contract';
|
|
3
|
+
import { PaymentNetworkOptions, ReferenceBasedDetectorOptions } from '../types';
|
|
4
4
|
/**
|
|
5
5
|
* Handle payment networks with conversion proxy contract extension
|
|
6
6
|
*/
|
|
7
7
|
export declare class AnyToERC20PaymentDetector extends ERC20FeeProxyPaymentDetectorBase<ExtensionTypes.PnAnyToErc20.IAnyToERC20, PaymentTypes.IERC20FeePaymentEventParameters> {
|
|
8
|
+
private readonly getSubgraphClient;
|
|
8
9
|
/**
|
|
9
10
|
* @param extension The advanced logic payment network extensions
|
|
10
11
|
*/
|
|
11
|
-
constructor({ advancedLogic, currencyManager, }:
|
|
12
|
-
advancedLogic: AdvancedLogicTypes.IAdvancedLogic;
|
|
13
|
-
currencyManager: ICurrencyManager;
|
|
14
|
-
});
|
|
12
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }: ReferenceBasedDetectorOptions & Pick<PaymentNetworkOptions, 'getSubgraphClient'>);
|
|
15
13
|
/**
|
|
16
14
|
* Creates the extensions data for the creation of this extension.
|
|
17
15
|
* Will set a salt if none is already given
|
|
@@ -31,7 +29,7 @@ export declare class AnyToERC20PaymentDetector extends ERC20FeeProxyPaymentDetec
|
|
|
31
29
|
* @param paymentNetwork Payment network state
|
|
32
30
|
* @returns The balance and events
|
|
33
31
|
*/
|
|
34
|
-
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES,
|
|
32
|
+
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES, toAddress: string | undefined, paymentReference: string, requestCurrency: RequestLogicTypes.ICurrency, paymentChain: string, paymentNetwork: ExtensionTypes.IState<ExtensionTypes.PnAnyToErc20.ICreationParameters>): Promise<PaymentTypes.AllNetworkEvents<PaymentTypes.IERC20FeePaymentEventParameters>>;
|
|
35
33
|
protected getPaymentChain(request: RequestLogicTypes.IRequest): string;
|
|
36
34
|
static getDeploymentInformation: import("../utils").GetDeploymentInformation<false>;
|
|
37
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-to-erc20-proxy.d.ts","sourceRoot":"","sources":["../../src/any/any-to-erc20-proxy.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"any-to-erc20-proxy.d.ts","sourceRoot":"","sources":["../../src/any/any-to-erc20-proxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAI/E,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAMhF;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,gCAAgC,CAC7E,cAAc,CAAC,YAAY,CAAC,WAAW,EACvC,YAAY,CAAC,+BAA+B,CAC7C;IACC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6C;IAE/E;;OAEG;gBAEgB,EACjB,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,EAAE,6BAA6B,GAAG,IAAI,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;IASnF;;;;;;OAMG;IACU,+BAA+B,CAC1C,gCAAgC,EAAE,YAAY,CAAC,6BAA6B,GAC3E,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;IAiBlC;;;;;;;;;;OAUG;cACa,aAAa,CAC3B,SAAS,EAAE,YAAY,CAAC,YAAY,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,iBAAiB,CAAC,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,CAAC,mBAAmB,CAAC,GACrF,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC;IAkDvF,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,GAAG,MAAM;IAQtE,OAAc,wBAAwB,qDAGpC;CACH"}
|
|
@@ -7,8 +7,7 @@ const types_1 = require("@requestnetwork/types");
|
|
|
7
7
|
const utils_1 = require("@requestnetwork/utils");
|
|
8
8
|
const fee_proxy_contract_1 = require("../erc20/fee-proxy-contract");
|
|
9
9
|
const any_to_erc20_proxy_1 = require("./retrievers/any-to-erc20-proxy");
|
|
10
|
-
const thegraph_1 = require("
|
|
11
|
-
const thegraph_2 = require("../thegraph");
|
|
10
|
+
const thegraph_1 = require("../thegraph");
|
|
12
11
|
const utils_2 = require("../utils");
|
|
13
12
|
const PROXY_CONTRACT_ADDRESS_MAP = {
|
|
14
13
|
['0.1.0']: '0.1.0',
|
|
@@ -20,8 +19,9 @@ class AnyToERC20PaymentDetector extends fee_proxy_contract_1.ERC20FeeProxyPaymen
|
|
|
20
19
|
/**
|
|
21
20
|
* @param extension The advanced logic payment network extensions
|
|
22
21
|
*/
|
|
23
|
-
constructor({ advancedLogic, currencyManager, }) {
|
|
22
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }) {
|
|
24
23
|
super(types_1.PaymentTypes.PAYMENT_NETWORK_ID.ANY_TO_ERC20_PROXY, advancedLogic.extensions.anyToErc20Proxy, currencyManager);
|
|
24
|
+
this.getSubgraphClient = getSubgraphClient;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Creates the extensions data for the creation of this extension.
|
|
@@ -57,9 +57,9 @@ class AnyToERC20PaymentDetector extends fee_proxy_contract_1.ERC20FeeProxyPaymen
|
|
|
57
57
|
* @param paymentNetwork Payment network state
|
|
58
58
|
* @returns The balance and events
|
|
59
59
|
*/
|
|
60
|
-
extractEvents(eventName,
|
|
60
|
+
extractEvents(eventName, toAddress, paymentReference, requestCurrency, paymentChain, paymentNetwork) {
|
|
61
61
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
62
|
-
if (!
|
|
62
|
+
if (!toAddress) {
|
|
63
63
|
return {
|
|
64
64
|
paymentEvents: [],
|
|
65
65
|
};
|
|
@@ -68,9 +68,20 @@ class AnyToERC20PaymentDetector extends fee_proxy_contract_1.ERC20FeeProxyPaymen
|
|
|
68
68
|
const { address: conversionProxyContractAddress, creationBlockNumber: conversionProxyCreationBlockNumber, } = AnyToERC20PaymentDetector.getDeploymentInformation(paymentChain, paymentNetwork.version);
|
|
69
69
|
const conversionProxyAbi = smart_contracts_1.erc20ConversionProxy.getContractAbi(paymentNetwork.version);
|
|
70
70
|
const currency = yield this.getCurrency(requestCurrency);
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const subgraphClient = this.getSubgraphClient(paymentChain);
|
|
72
|
+
if (subgraphClient) {
|
|
73
|
+
const infoRetriever = new thegraph_1.TheGraphInfoRetriever(subgraphClient, this.currencyManager);
|
|
74
|
+
return yield infoRetriever.getTransferEvents({
|
|
75
|
+
paymentReference,
|
|
76
|
+
contractAddress: conversionProxyContractAddress,
|
|
77
|
+
toAddress,
|
|
78
|
+
eventName,
|
|
79
|
+
paymentChain,
|
|
80
|
+
acceptedTokens,
|
|
81
|
+
maxRateTimespan,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const infoRetriever = new any_to_erc20_proxy_1.AnyToErc20InfoRetriever(currency, paymentReference, conversionProxyContractAddress, conversionProxyCreationBlockNumber, conversionProxyAbi, toAddress, eventName, paymentChain, acceptedTokens, maxRateTimespan);
|
|
74
85
|
const paymentEvents = (yield infoRetriever.getTransferEvents());
|
|
75
86
|
return {
|
|
76
87
|
paymentEvents,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-to-erc20-proxy.js","sourceRoot":"","sources":["../../src/any/any-to-erc20-proxy.ts"],"names":[],"mappings":";;;;AAAA,qEAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"any-to-erc20-proxy.js","sourceRoot":"","sources":["../../src/any/any-to-erc20-proxy.ts"],"names":[],"mappings":";;;;AAAA,qEAAuE;AACvE,iDAAwF;AACxF,iDAA0C;AAC1C,oEAA+E;AAC/E,wEAA0E;AAC1E,0CAAoD;AACpD,oCAAwD;AAGxD,MAAM,0BAA0B,GAAG;IACjC,CAAC,OAAO,CAAC,EAAE,OAAO;CACnB,CAAC;AAEF;;GAEG;AACH,MAAa,yBAA0B,SAAQ,qDAG9C;IAGC;;OAEG;IAEH,YAAmB,EACjB,aAAa,EACb,eAAe,EACf,iBAAiB,GACgE;QACjF,KAAK,CACH,oBAAY,CAAC,kBAAkB,CAAC,kBAAkB,EAClD,aAAa,CAAC,UAAU,CAAC,eAAe,EACxC,eAAe,CAChB,CAAC;QACF,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED;;;;;;OAMG;IACU,+BAA+B,CAC1C,gCAA4E;;YAE5E,oCAAo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cAAc,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;gBACtF,OAAO,MAAM,aAAa,CAAC,iBAAiB,CAAC;oBAC3C,gBAAgB;oBAChB,eAAe,EAAE,8BAA8B;oBAC/C,SAAS;oBACT,SAAS;oBACT,YAAY;oBACZ,cAAc;oBACd,eAAe;iBAChB,CAAC,CAAC;aACJ;YAED,MAAM,aAAa,GAAG,IAAI,4CAAuB,CAC/C,QAAQ,EACR,gBAAgB,EAChB,8BAA8B,EAC9B,kCAAkC,EAClC,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,YAAY,EACZ,cAAc,EACd,eAAe,CAChB,CAAC;YACF,MAAM,aAAa,GACjB,CAAC,MAAM,aAAa,CAAC,iBAAiB,EAAE,CAAsF,CAAC;YACjI,OAAO;gBACL,aAAa;aACd,CAAC;QACJ,CAAC;KAAA;IAES,eAAe,CAAC,OAAmC;QAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;QACjE,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,KAAK,CAAC,sBAAsB,IAAI,CAAC,gBAAgB,kCAAkC,CAAC,CAAC;SAC5F;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;;AA3HH,8DAiIC;AAJe,kDAAwB,GAAG,IAAA,oCAA4B,EACnE,sCAAoB,EACpB,0BAA0B,CAC3B,CAAC"}
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICurrencyManager } from '@requestnetwork/currency';
|
|
1
|
+
import { ExtensionTypes, PaymentTypes, RequestLogicTypes } from '@requestnetwork/types';
|
|
3
2
|
import { AnyToAnyDetector } from '../any-to-any-detector';
|
|
4
|
-
import {
|
|
3
|
+
import { PaymentNetworkOptions, ReferenceBasedDetectorOptions } from '../types';
|
|
5
4
|
/**
|
|
6
5
|
* Handle payment networks with ETH input data extension
|
|
7
6
|
*/
|
|
8
7
|
export declare class AnyToEthFeeProxyPaymentDetector extends AnyToAnyDetector<ExtensionTypes.PnAnyToEth.IAnyToEth, PaymentTypes.IETHPaymentEventParameters> {
|
|
9
|
-
private
|
|
8
|
+
private readonly getSubgraphClient;
|
|
10
9
|
/**
|
|
11
10
|
* @param extension The advanced logic payment network extensions
|
|
12
11
|
*/
|
|
13
|
-
constructor({ advancedLogic, currencyManager,
|
|
14
|
-
advancedLogic: AdvancedLogicTypes.IAdvancedLogic;
|
|
15
|
-
currencyManager: ICurrencyManager;
|
|
16
|
-
useTheGraph?: typeof networkSupportsTheGraph;
|
|
17
|
-
});
|
|
12
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }: ReferenceBasedDetectorOptions & Pick<PaymentNetworkOptions, 'getSubgraphClient'>);
|
|
18
13
|
/**
|
|
19
14
|
* Extracts payment events of an address matching an address and a payment reference
|
|
20
15
|
*
|
|
21
|
-
* @param
|
|
16
|
+
* @param toAddress Address to check
|
|
22
17
|
* @param eventName Indicate if it is an address for payment or refund
|
|
23
18
|
* @param requestCurrency The request currency
|
|
24
19
|
* @param paymentReference The reference to identify the payment
|
|
25
20
|
* @param paymentNetwork the payment network
|
|
26
21
|
* @returns The balance
|
|
27
22
|
*/
|
|
28
|
-
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES,
|
|
23
|
+
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES, toAddress: string | undefined, paymentReference: string, requestCurrency: RequestLogicTypes.ICurrency, paymentChain: string, paymentNetwork: ExtensionTypes.IState<ExtensionTypes.PnAnyToEth.ICreationParameters>): Promise<PaymentTypes.AllNetworkEvents<PaymentTypes.IETHPaymentEventParameters>>;
|
|
29
24
|
/**
|
|
30
25
|
* Get the network of the payment
|
|
31
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-to-eth-proxy.d.ts","sourceRoot":"","sources":["../../src/any/any-to-eth-proxy.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"any-to-eth-proxy.d.ts","sourceRoot":"","sources":["../../src/any/any-to-eth-proxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAKxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAYhF;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,gBAAgB,CACnE,cAAc,CAAC,UAAU,CAAC,SAAS,EACnC,YAAY,CAAC,0BAA0B,CACxC;IACC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6C;IAC/E;;OAEG;gBACgB,EACjB,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,EAAE,6BAA6B,GAAG,IAAI,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;IASnF;;;;;;;;;OASG;cACa,aAAa,CAC3B,SAAS,EAAE,YAAY,CAAC,YAAY,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,iBAAiB,CAAC,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,mBAAmB,CAAC,GACnF,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAC;IAkDlF;;;;;;OAMG;IACH,SAAS,CAAC,eAAe,CAAC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,GAAG,MAAM;IAWtE,OAAc,wBAAwB,qDAGpC;CACH"}
|
|
@@ -9,7 +9,6 @@ const any_to_eth_proxy_1 = require("./retrievers/any-to-eth-proxy");
|
|
|
9
9
|
const any_to_any_detector_1 = require("../any-to-any-detector");
|
|
10
10
|
const utils_1 = require("../utils");
|
|
11
11
|
const thegraph_1 = require("../thegraph");
|
|
12
|
-
const thegraph_2 = require("./retrievers/thegraph");
|
|
13
12
|
const PROXY_CONTRACT_ADDRESS_MAP = {
|
|
14
13
|
['0.1.0']: '0.1.0',
|
|
15
14
|
['0.2.0']: '0.2.0',
|
|
@@ -21,43 +20,51 @@ class AnyToEthFeeProxyPaymentDetector extends any_to_any_detector_1.AnyToAnyDete
|
|
|
21
20
|
/**
|
|
22
21
|
* @param extension The advanced logic payment network extensions
|
|
23
22
|
*/
|
|
24
|
-
constructor({ advancedLogic, currencyManager,
|
|
23
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }) {
|
|
25
24
|
super(types_1.PaymentTypes.PAYMENT_NETWORK_ID.ANY_TO_ETH_PROXY, advancedLogic.extensions.anyToEthProxy, currencyManager);
|
|
26
|
-
this.
|
|
25
|
+
this.getSubgraphClient = getSubgraphClient;
|
|
27
26
|
}
|
|
28
27
|
/**
|
|
29
28
|
* Extracts payment events of an address matching an address and a payment reference
|
|
30
29
|
*
|
|
31
|
-
* @param
|
|
30
|
+
* @param toAddress Address to check
|
|
32
31
|
* @param eventName Indicate if it is an address for payment or refund
|
|
33
32
|
* @param requestCurrency The request currency
|
|
34
33
|
* @param paymentReference The reference to identify the payment
|
|
35
34
|
* @param paymentNetwork the payment network
|
|
36
35
|
* @returns The balance
|
|
37
36
|
*/
|
|
38
|
-
extractEvents(eventName,
|
|
37
|
+
extractEvents(eventName, toAddress, paymentReference, requestCurrency, paymentChain, paymentNetwork) {
|
|
39
38
|
var _a, _b;
|
|
40
39
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
41
|
-
if (!
|
|
40
|
+
if (!toAddress) {
|
|
42
41
|
return {
|
|
43
42
|
paymentEvents: [],
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
const contractInfo = AnyToEthFeeProxyPaymentDetector.getDeploymentInformation(paymentChain, paymentNetwork.version);
|
|
47
|
-
const abi = SmartContracts.ethConversionArtifact.getContractAbi(contractInfo.contractVersion);
|
|
48
46
|
const currency = this.currencyManager.fromStorageCurrency(requestCurrency);
|
|
49
47
|
if (!currency) {
|
|
50
48
|
throw new currency_1.UnsupportedCurrencyError(requestCurrency.value);
|
|
51
49
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
const subgraphClient = this.getSubgraphClient(paymentChain);
|
|
51
|
+
if (subgraphClient) {
|
|
52
|
+
const infoRetriever = new thegraph_1.TheGraphInfoRetriever(subgraphClient, this.currencyManager);
|
|
53
|
+
return yield infoRetriever.getTransferEvents({
|
|
54
|
+
paymentReference,
|
|
55
|
+
contractAddress: contractInfo.address,
|
|
56
|
+
toAddress,
|
|
57
|
+
eventName,
|
|
58
|
+
paymentChain,
|
|
59
|
+
maxRateTimespan: (_a = paymentNetwork.values) === null || _a === void 0 ? void 0 : _a.maxRateTimespan,
|
|
60
|
+
});
|
|
60
61
|
}
|
|
62
|
+
const abi = SmartContracts.ethConversionArtifact.getContractAbi(contractInfo.contractVersion);
|
|
63
|
+
const infoRetriever = new any_to_eth_proxy_1.AnyToEthInfoRetriever(currency, paymentReference, contractInfo.address, contractInfo.creationBlockNumber, abi, toAddress, eventName, paymentChain, undefined, (_b = paymentNetwork.values) === null || _b === void 0 ? void 0 : _b.maxRateTimespan);
|
|
64
|
+
const paymentEvents = yield infoRetriever.getTransferEvents();
|
|
65
|
+
return {
|
|
66
|
+
paymentEvents,
|
|
67
|
+
};
|
|
61
68
|
});
|
|
62
69
|
}
|
|
63
70
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-to-eth-proxy.js","sourceRoot":"","sources":["../../src/any/any-to-eth-proxy.ts"],"names":[],"mappings":";;;;AAAA,kEAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"any-to-eth-proxy.js","sourceRoot":"","sources":["../../src/any/any-to-eth-proxy.ts"],"names":[],"mappings":";;;;AAAA,kEAAkE;AA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AAY,CAAC,OAAO;oBACrC,SAAS;oBACT,SAAS;oBACT,YAAY;oBACZ,eAAe,EAAE,MAAA,cAAc,CAAC,MAAM,0CAAE,eAAe;iBACxD,CAAC,CAAC;aACJ;YAED,MAAM,GAAG,GAAG,cAAc,CAAC,qBAAqB,CAAC,cAAc,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;YAE9F,MAAM,aAAa,GAAG,IAAI,wCAAqB,CAC7C,QAAQ,EACR,gBAAgB,EAChB,YAAY,CAAC,OAAO,EACpB,YAAY,CAAC,mBAAmB,EAChC,GAAG,EACH,SAAS,EACT,SAAS,EACT,YAAY,EACZ,SAAS,EACT,MAAA,cAAc,CAAC,MAAM,0CAAE,eAAe,CACvC,CAAC;YACF,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,iBAAiB,EAAE,CAAC;YAC9D,OAAO;gBACL,aAAa;aACd,CAAC;;KACH;IAED;;;;;;OAMG;IACO,eAAe,CAAC,OAAmC;QAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;QACjE,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,KAAK,CAAC,sBAAsB,IAAI,CAAC,gBAAgB,kCAAkC,CAAC,CAAC;SAC5F;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;;AArGH,0EA8GC;AAPC;;GAEG;AACW,wDAAwB,GAAG,IAAA,oCAA4B,EACnE,cAAc,CAAC,qBAAqB,EACpC,0BAA0B,CAC3B,CAAC"}
|
|
@@ -5,7 +5,6 @@ import { ICurrencyManager } from '@requestnetwork/currency';
|
|
|
5
5
|
* Abstract class to extend to get the payment balance of conversion requests
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class AnyToAnyDetector<TExtension extends ExtensionTypes.PnFeeReferenceBased.IFeeReferenceBased, TPaymentEventParameters> extends FeeReferenceBasedDetector<TExtension, TPaymentEventParameters> {
|
|
8
|
-
protected currencyManager: ICurrencyManager;
|
|
9
8
|
/**
|
|
10
9
|
* @param extension The advanced logic payment network extension, with conversion
|
|
11
10
|
* @param extensionType Example : PaymentTypes.PAYMENT_NETWORK_ID.ANY_TO_ETH_PROXY
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-to-any-detector.d.ts","sourceRoot":"","sources":["../src/any-to-any-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;GAEG;AACH,8BAAsB,gBAAgB,CACpC,UAAU,SAAS,cAAc,CAAC,mBAAmB,CAAC,kBAAkB,EACxE,uBAAuB,CACvB,SAAQ,yBAAyB,CAAC,UAAU,EAAE,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"any-to-any-detector.d.ts","sourceRoot":"","sources":["../src/any-to-any-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;GAEG;AACH,8BAAsB,gBAAgB,CACpC,UAAU,SAAS,cAAc,CAAC,mBAAmB,CAAC,kBAAkB,EACxE,uBAAuB,CACvB,SAAQ,yBAAyB,CAAC,UAAU,EAAE,uBAAuB,CAAC;IACtE;;;OAGG;gBAED,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,EACjD,SAAS,EAAE,UAAU,EACrB,eAAe,EAAE,gBAAgB;IAKnC;;;;;;OAMG;IACU,+BAA+B,CAC1C,gCAAgC,EAAE,cAAc,CAAC,oBAAoB,CAAC,mBAAmB,GACxF,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC;CAenC"}
|
|
@@ -13,8 +13,7 @@ class AnyToAnyDetector extends fee_reference_based_detector_1.FeeReferenceBasedD
|
|
|
13
13
|
* @param extensionType Example : PaymentTypes.PAYMENT_NETWORK_ID.ANY_TO_ETH_PROXY
|
|
14
14
|
*/
|
|
15
15
|
constructor(paymentNetworkId, extension, currencyManager) {
|
|
16
|
-
super(paymentNetworkId, extension);
|
|
17
|
-
this.currencyManager = currencyManager;
|
|
16
|
+
super(paymentNetworkId, extension, currencyManager);
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* Creates the extensions data for the creation of this extension.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-to-any-detector.js","sourceRoot":"","sources":["../src/any-to-any-detector.ts"],"names":[],"mappings":";;;;AACA,iDAA0C;AAC1C,iFAA2E;AAI3E;;GAEG;AACH,MAAsB,gBAGpB,SAAQ,wDAA8D;IACtE;;;OAGG;IACH,YACE,gBAAiD,EACjD,SAAqB,
|
|
1
|
+
{"version":3,"file":"any-to-any-detector.js","sourceRoot":"","sources":["../src/any-to-any-detector.ts"],"names":[],"mappings":";;;;AACA,iDAA0C;AAC1C,iFAA2E;AAI3E;;GAEG;AACH,MAAsB,gBAGpB,SAAQ,wDAA8D;IACtE;;;OAGG;IACH,YACE,gBAAiD,EACjD,SAAqB,EACrB,eAAiC;QAEjC,KAAK,CAAC,gBAAgB,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;OAMG;IACU,+BAA+B,CAC1C,gCAAyF;;YAEzF,oCAAoC;YACpC,gCAAgC,CAAC,IAAI;gBACnC,gCAAgC,CAAC,IAAI,IAAI,CAAC,MAAM,eAAK,CAAC,MAAM,CAAC,oBAAoB,EAAE,CAAC,CAAC;YAEvF,OAAO,IAAI,CAAC,SAAS,CAAC,oBAAoB,iBACxC,UAAU,EAAE,gCAAgC,CAAC,UAAU,EACvD,SAAS,EAAE,gCAAgC,CAAC,SAAS,EACrD,cAAc,EAAE,gCAAgC,CAAC,cAAc,EAC/D,aAAa,EAAE,gCAAgC,CAAC,aAAa,EAC7D,OAAO,EAAE,gCAAgC,CAAC,OAAO,EACjD,eAAe,EAAE,gCAAgC,CAAC,eAAe,IAC9D,gCAAgC,EACnC,CAAC;QACL,CAAC;KAAA;CACF;AAxCD,4CAwCC"}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtensionTypes, PaymentTypes, RequestLogicTypes } from '@requestnetwork/types';
|
|
2
2
|
import { CurrencyDefinition, ICurrencyManager } from '@requestnetwork/currency';
|
|
3
3
|
import { FeeReferenceBasedDetector } from '../fee-reference-based-detector';
|
|
4
|
+
import { PaymentNetworkOptions, ReferenceBasedDetectorOptions } from '../types';
|
|
4
5
|
/**
|
|
5
6
|
* Handle payment networks with ERC20 fee proxy contract extension, or derived
|
|
6
7
|
*/
|
|
7
8
|
export declare abstract class ERC20FeeProxyPaymentDetectorBase<TExtension extends ExtensionTypes.PnFeeReferenceBased.IFeeReferenceBased, TPaymentEventParameters extends PaymentTypes.IERC20FeePaymentEventParameters> extends FeeReferenceBasedDetector<TExtension, TPaymentEventParameters> {
|
|
8
|
-
protected _currencyManager: ICurrencyManager;
|
|
9
9
|
/**
|
|
10
10
|
* @param extension The advanced logic payment network extensions
|
|
11
11
|
*/
|
|
12
|
-
constructor(paymentNetworkId: PaymentTypes.PAYMENT_NETWORK_ID, extension: TExtension,
|
|
12
|
+
constructor(paymentNetworkId: PaymentTypes.PAYMENT_NETWORK_ID, extension: TExtension, currencyManager: ICurrencyManager);
|
|
13
13
|
protected getCurrency(storageCurrency: RequestLogicTypes.ICurrency): Promise<CurrencyDefinition>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Handle payment networks with ERC20 fee proxy contract extension
|
|
17
17
|
*/
|
|
18
18
|
export declare class ERC20FeeProxyPaymentDetector extends ERC20FeeProxyPaymentDetectorBase<ExtensionTypes.PnFeeReferenceBased.IFeeReferenceBased, PaymentTypes.IERC20FeePaymentEventParameters> {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
currencyManager: ICurrencyManager;
|
|
22
|
-
});
|
|
19
|
+
private readonly getSubgraphClient;
|
|
20
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }: ReferenceBasedDetectorOptions & Pick<PaymentNetworkOptions, 'getSubgraphClient'>);
|
|
23
21
|
/**
|
|
24
22
|
* Extracts the payment events of a request
|
|
25
23
|
*/
|
|
26
|
-
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES,
|
|
24
|
+
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES, toAddress: string | undefined, paymentReference: string, requestCurrency: RequestLogicTypes.ICurrency, paymentChain: string, paymentNetwork: ExtensionTypes.IState<ExtensionTypes.PnFeeReferenceBased.ICreationParameters>): Promise<PaymentTypes.AllNetworkEvents<PaymentTypes.IERC20FeePaymentEventParameters>>;
|
|
27
25
|
static getDeploymentInformation: import("../utils").GetDeploymentInformation<false>;
|
|
28
26
|
}
|
|
29
27
|
//# sourceMappingURL=fee-proxy-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fee-proxy-contract.d.ts","sourceRoot":"","sources":["../../src/erc20/fee-proxy-contract.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"fee-proxy-contract.d.ts","sourceRoot":"","sources":["../../src/erc20/fee-proxy-contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIhF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAG5E,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAOhF;;GAEG;AAEH,8BAAsB,gCAAgC,CACpD,UAAU,SAAS,cAAc,CAAC,mBAAmB,CAAC,kBAAkB,EACxE,uBAAuB,SAAS,YAAY,CAAC,+BAA+B,CAC5E,SAAQ,yBAAyB,CAAC,UAAU,EAAE,uBAAuB,CAAC;IACtE;;OAEG;gBAED,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,EACjD,SAAS,EAAE,UAAU,EACrB,eAAe,EAAE,gBAAgB;cAKnB,WAAW,CACzB,eAAe,EAAE,iBAAiB,CAAC,SAAS,GAC3C,OAAO,CAAC,kBAAkB,CAAC;CAkB/B;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,gCAAgC,CAChF,cAAc,CAAC,mBAAmB,CAAC,kBAAkB,EACrD,YAAY,CAAC,+BAA+B,CAC7C;IACC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6C;gBACnE,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,EAAE,6BAA6B,GAAG,IAAI,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;IASnF;;OAEG;cACa,aAAa,CAC3B,SAAS,EAAE,YAAY,CAAC,YAAY,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,iBAAiB,CAAC,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,GAC5F,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC;IAwCvF,OAAc,wBAAwB,qDAGpC;CACH"}
|
|
@@ -5,11 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const smart_contracts_1 = require("@requestnetwork/smart-contracts");
|
|
6
6
|
const types_1 = require("@requestnetwork/types");
|
|
7
7
|
const proxy_info_retriever_1 = require("./proxy-info-retriever");
|
|
8
|
-
const thegraph_1 = require("../thegraph");
|
|
9
|
-
const thegraph_info_retriever_1 = require("./thegraph-info-retriever");
|
|
10
8
|
const currency_1 = require("./currency");
|
|
11
9
|
const fee_reference_based_detector_1 = require("../fee-reference-based-detector");
|
|
12
10
|
const utils_1 = require("../utils");
|
|
11
|
+
const thegraph_1 = require("../thegraph");
|
|
13
12
|
const PROXY_CONTRACT_ADDRESS_MAP = {
|
|
14
13
|
['0.1.0']: '0.1.0',
|
|
15
14
|
['0.2.0']: '0.2.0',
|
|
@@ -21,13 +20,12 @@ class ERC20FeeProxyPaymentDetectorBase extends fee_reference_based_detector_1.Fe
|
|
|
21
20
|
/**
|
|
22
21
|
* @param extension The advanced logic payment network extensions
|
|
23
22
|
*/
|
|
24
|
-
constructor(paymentNetworkId, extension,
|
|
25
|
-
super(paymentNetworkId, extension);
|
|
26
|
-
this._currencyManager = _currencyManager;
|
|
23
|
+
constructor(paymentNetworkId, extension, currencyManager) {
|
|
24
|
+
super(paymentNetworkId, extension, currencyManager);
|
|
27
25
|
}
|
|
28
26
|
getCurrency(storageCurrency) {
|
|
29
27
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
30
|
-
const currency = this.
|
|
28
|
+
const currency = this.currencyManager.fromStorageCurrency(storageCurrency);
|
|
31
29
|
if (currency) {
|
|
32
30
|
return currency;
|
|
33
31
|
}
|
|
@@ -47,26 +45,34 @@ exports.ERC20FeeProxyPaymentDetectorBase = ERC20FeeProxyPaymentDetectorBase;
|
|
|
47
45
|
* Handle payment networks with ERC20 fee proxy contract extension
|
|
48
46
|
*/
|
|
49
47
|
class ERC20FeeProxyPaymentDetector extends ERC20FeeProxyPaymentDetectorBase {
|
|
50
|
-
constructor({ advancedLogic, currencyManager, }) {
|
|
48
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }) {
|
|
51
49
|
super(types_1.PaymentTypes.PAYMENT_NETWORK_ID.ERC20_FEE_PROXY_CONTRACT, advancedLogic.extensions.feeProxyContractErc20, currencyManager);
|
|
50
|
+
this.getSubgraphClient = getSubgraphClient;
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
54
53
|
* Extracts the payment events of a request
|
|
55
54
|
*/
|
|
56
|
-
extractEvents(eventName,
|
|
55
|
+
extractEvents(eventName, toAddress, paymentReference, requestCurrency, paymentChain, paymentNetwork) {
|
|
57
56
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
58
|
-
if (!
|
|
57
|
+
if (!toAddress) {
|
|
59
58
|
return Promise.resolve({
|
|
60
59
|
paymentEvents: [],
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
const { address: proxyContractAddress, creationBlockNumber: proxyCreationBlockNumber } = ERC20FeeProxyPaymentDetector.getDeploymentInformation(paymentChain, paymentNetwork.version);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const subgraphClient = this.getSubgraphClient(paymentChain);
|
|
64
|
+
if (subgraphClient) {
|
|
65
|
+
const graphInfoRetriever = new thegraph_1.TheGraphInfoRetriever(subgraphClient, this.currencyManager);
|
|
66
|
+
return graphInfoRetriever.getTransferEvents({
|
|
67
|
+
eventName,
|
|
68
|
+
paymentReference,
|
|
69
|
+
toAddress,
|
|
70
|
+
contractAddress: proxyContractAddress,
|
|
71
|
+
paymentChain,
|
|
72
|
+
});
|
|
67
73
|
}
|
|
68
74
|
else {
|
|
69
|
-
const proxyInfoRetriever = new proxy_info_retriever_1.default(paymentReference, proxyContractAddress, proxyCreationBlockNumber, requestCurrency.value,
|
|
75
|
+
const proxyInfoRetriever = new proxy_info_retriever_1.default(paymentReference, proxyContractAddress, proxyCreationBlockNumber, requestCurrency.value, toAddress, eventName, paymentChain);
|
|
70
76
|
const paymentEvents = yield proxyInfoRetriever.getTransferEvents();
|
|
71
77
|
return {
|
|
72
78
|
paymentEvents,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fee-proxy-contract.js","sourceRoot":"","sources":["../../src/erc20/fee-proxy-contract.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,
|
|
1
|
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
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtensionTypes, PaymentTypes, RequestLogicTypes } from '@requestnetwork/types';
|
|
2
2
|
import { ReferenceBasedDetector } from '../reference-based-detector';
|
|
3
|
+
import { PaymentNetworkOptions, ReferenceBasedDetectorOptions } from '../types';
|
|
3
4
|
/**
|
|
4
5
|
* Handle payment networks with ERC20 proxy contract extension
|
|
5
6
|
*/
|
|
6
7
|
export declare class ERC20ProxyPaymentDetector extends ReferenceBasedDetector<ExtensionTypes.PnReferenceBased.IReferenceBased, PaymentTypes.IERC20PaymentEventParameters> {
|
|
8
|
+
private readonly getSubgraphClient;
|
|
7
9
|
/**
|
|
8
10
|
* @param extension The advanced logic payment network extensions
|
|
9
11
|
*/
|
|
10
|
-
constructor({ advancedLogic }:
|
|
11
|
-
advancedLogic: AdvancedLogicTypes.IAdvancedLogic;
|
|
12
|
-
});
|
|
12
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }: ReferenceBasedDetectorOptions & Pick<PaymentNetworkOptions, 'getSubgraphClient'>);
|
|
13
13
|
/**
|
|
14
14
|
* Extracts the balance and events of an address
|
|
15
15
|
*
|
|
@@ -20,7 +20,7 @@ export declare class ERC20ProxyPaymentDetector extends ReferenceBasedDetector<Ex
|
|
|
20
20
|
* @param tokenContractAddress the address of the token contract
|
|
21
21
|
* @returns The balance and events
|
|
22
22
|
*/
|
|
23
|
-
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES,
|
|
23
|
+
protected extractEvents(eventName: PaymentTypes.EVENTS_NAMES, toAddress: string | undefined, paymentReference: string, requestCurrency: RequestLogicTypes.ICurrency, paymentChain: string, paymentNetwork: ExtensionTypes.IState<ExtensionTypes.PnReferenceBased.ICreationParameters>): Promise<PaymentTypes.AllNetworkEvents<PaymentTypes.IERC20PaymentEventParameters>>;
|
|
24
24
|
static getDeploymentInformation: import("../utils").GetDeploymentInformation<false>;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=proxy-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-contract.d.ts","sourceRoot":"","sources":["../../src/erc20/proxy-contract.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"proxy-contract.d.ts","sourceRoot":"","sources":["../../src/erc20/proxy-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAKxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAMhF;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,sBAAsB,CACnE,cAAc,CAAC,gBAAgB,CAAC,eAAe,EAC/C,YAAY,CAAC,4BAA4B,CAC1C;IACC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6C;IAE/E;;OAEG;gBACgB,EACjB,aAAa,EACb,eAAe,EACf,iBAAiB,GAClB,EAAE,6BAA6B,GAAG,IAAI,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;IASnF;;;;;;;;;OASG;cACa,aAAa,CAC3B,SAAS,EAAE,YAAY,CAAC,YAAY,EACpC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,iBAAiB,CAAC,SAAS,EAC5C,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,GACzF,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,YAAY,CAAC,4BAA4B,CAAC,CAAC;IAyCpF,OAAc,wBAAwB,qDAGpC;CACH"}
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const types_1 = require("@requestnetwork/types");
|
|
6
6
|
const smart_contracts_1 = require("@requestnetwork/smart-contracts");
|
|
7
7
|
const proxy_info_retriever_1 = require("./proxy-info-retriever");
|
|
8
|
-
const thegraph_info_retriever_1 = require("./thegraph-info-retriever");
|
|
9
8
|
const thegraph_1 = require("../thegraph");
|
|
10
9
|
const utils_1 = require("../utils");
|
|
11
10
|
const reference_based_detector_1 = require("../reference-based-detector");
|
|
@@ -19,8 +18,9 @@ class ERC20ProxyPaymentDetector extends reference_based_detector_1.ReferenceBase
|
|
|
19
18
|
/**
|
|
20
19
|
* @param extension The advanced logic payment network extensions
|
|
21
20
|
*/
|
|
22
|
-
constructor({ advancedLogic }) {
|
|
23
|
-
super(types_1.PaymentTypes.PAYMENT_NETWORK_ID.ERC20_PROXY_CONTRACT, advancedLogic.extensions.proxyContractErc20);
|
|
21
|
+
constructor({ advancedLogic, currencyManager, getSubgraphClient, }) {
|
|
22
|
+
super(types_1.PaymentTypes.PAYMENT_NETWORK_ID.ERC20_PROXY_CONTRACT, advancedLogic.extensions.proxyContractErc20, currencyManager);
|
|
23
|
+
this.getSubgraphClient = getSubgraphClient;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Extracts the balance and events of an address
|
|
@@ -32,20 +32,27 @@ class ERC20ProxyPaymentDetector extends reference_based_detector_1.ReferenceBase
|
|
|
32
32
|
* @param tokenContractAddress the address of the token contract
|
|
33
33
|
* @returns The balance and events
|
|
34
34
|
*/
|
|
35
|
-
extractEvents(eventName,
|
|
35
|
+
extractEvents(eventName, toAddress, paymentReference, requestCurrency, paymentChain, paymentNetwork) {
|
|
36
36
|
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
37
|
-
if (!
|
|
37
|
+
if (!toAddress) {
|
|
38
38
|
return {
|
|
39
39
|
paymentEvents: [],
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
const { address: proxyContractAddress, creationBlockNumber: proxyCreationBlockNumber } = ERC20ProxyPaymentDetector.getDeploymentInformation(paymentChain, paymentNetwork.version);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const subgraphClient = this.getSubgraphClient(paymentChain);
|
|
44
|
+
if (subgraphClient) {
|
|
45
|
+
const graphInfoRetriever = new thegraph_1.TheGraphInfoRetriever(subgraphClient, this.currencyManager);
|
|
46
|
+
return graphInfoRetriever.getTransferEvents({
|
|
47
|
+
paymentReference,
|
|
48
|
+
toAddress,
|
|
49
|
+
eventName,
|
|
50
|
+
contractAddress: proxyContractAddress,
|
|
51
|
+
paymentChain,
|
|
52
|
+
});
|
|
46
53
|
}
|
|
47
54
|
else {
|
|
48
|
-
const proxyInfoRetriever = new proxy_info_retriever_1.default(paymentReference, proxyContractAddress, proxyCreationBlockNumber, requestCurrency.value,
|
|
55
|
+
const proxyInfoRetriever = new proxy_info_retriever_1.default(paymentReference, proxyContractAddress, proxyCreationBlockNumber, requestCurrency.value, toAddress, eventName, paymentChain);
|
|
49
56
|
const paymentEvents = yield proxyInfoRetriever.getTransferEvents();
|
|
50
57
|
return {
|
|
51
58
|
paymentEvents,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy-contract.js","sourceRoot":"","sources":["../../src/erc20/proxy-contract.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"proxy-contract.js","sourceRoot":"","sources":["../../src/erc20/proxy-contract.ts"],"names":[],"mappings":";;;;AAAA,iDAAwF;AACxF,qEAAqE;AACrE,iEAAwD;AACxD,0CAAoD;AACpD,oCAAwD;AACxD,0EAAqE;AAGrE,MAAM,0BAA0B,GAAG;IACjC,CAAC,OAAO,CAAC,EAAE,OAAO;CACnB,CAAC;AAEF;;GAEG;AACH,MAAa,yBAA0B,SAAQ,iDAG9C;IAGC;;OAEG;IACH,YAAmB,EACjB,aAAa,EACb,eAAe,EACf,iBAAiB,GACgE;QACjF,KAAK,CACH,oBAAY,CAAC,kBAAkB,CAAC,oBAAoB,EACpD,aAAa,CAAC,UAAU,CAAC,kBAAkB,EAC3C,eAAe,CA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ypes } from '@requestnetwork/types';
|
|
2
2
|
import { ReferenceBasedDetector } from '../reference-based-detector';
|
|
3
|
+
import { ReferenceBasedDetectorOptions } from '../types';
|
|
3
4
|
/**
|
|
4
5
|
* Handle payment networks with ERC777 Superfluid streaming extension
|
|
5
6
|
*/
|
|
@@ -7,9 +8,7 @@ export declare class SuperFluidPaymentDetector extends ReferenceBasedDetector<Ex
|
|
|
7
8
|
/**
|
|
8
9
|
* @param extension The advanced logic payment network extensions
|
|
9
10
|
*/
|
|
10
|
-
constructor({ advancedLogic }:
|
|
11
|
-
advancedLogic: AdvancedLogicTypes.IAdvancedLogic;
|
|
12
|
-
});
|
|
11
|
+
constructor({ advancedLogic, currencyManager }: ReferenceBasedDetectorOptions);
|
|
13
12
|
protected isSubsequentRequest(request: RequestLogicTypes.IRequest): boolean;
|
|
14
13
|
/**
|
|
15
14
|
* This returns the specific values we store for the ERC777 extensions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superfluid-detector.d.ts","sourceRoot":"","sources":["../../src/erc777/superfluid-detector.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"superfluid-detector.d.ts","sourceRoot":"","sources":["../../src/erc777/superfluid-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AACzD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,sBAAsB,CACnE,cAAc,CAAC,gBAAgB,CAAC,eAAe,EAC/C,YAAY,CAAC,6BAA6B,CAC3C;IACC;;OAEG;gBACgB,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,6BAA6B;IAQpF,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,GAAG,OAAO;IAI3E;;;OAGG;IACH,SAAS,CAAC,mBAAmB,CAC3B,OAAO,EAAE,iBAAiB,CAAC,QAAQ,GAClC,cAAc,CAAC,sBAAsB,CAAC,oCAAoC;IAI7E;;;;;;;;;OASG;IACU,UAAU,CACrB,OAAO,EAAE,iBAAiB,CAAC,QAAQ,GAClC,OAAO,CACR,YAAY,CAAC,kBAAkB,CAC7B,YAAY,CAAC,6BAA6B,GAAG,YAAY,CAAC,kCAAkC,CAC7F,CACF;IAwBD;;;;;;;;;OASG;cACa,aAAa,CAC3B,SAAS,EAAE,YAAY,CAAC,YAAY,EACpC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,iBAAiB,CAAC,SAAS,EAC5C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;IAoBrF;;;;;;;;OAQG;IACH,SAAS,CAAC,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,GAAG,MAAM;CAS3E"}
|
|
@@ -14,8 +14,8 @@ class SuperFluidPaymentDetector extends reference_based_detector_1.ReferenceBase
|
|
|
14
14
|
/**
|
|
15
15
|
* @param extension The advanced logic payment network extensions
|
|
16
16
|
*/
|
|
17
|
-
constructor({ advancedLogic }) {
|
|
18
|
-
super(types_1.PaymentTypes.PAYMENT_NETWORK_ID.ERC777_STREAM, advancedLogic.extensions.erc777Stream);
|
|
17
|
+
constructor({ advancedLogic, currencyManager }) {
|
|
18
|
+
super(types_1.PaymentTypes.PAYMENT_NETWORK_ID.ERC777_STREAM, advancedLogic.extensions.erc777Stream, currencyManager);
|
|
19
19
|
}
|
|
20
20
|
isSubsequentRequest(request) {
|
|
21
21
|
return !!request.extensions[this.paymentNetworkId].values.originalRequestId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superfluid-detector.js","sourceRoot":"","sources":["../../src/erc777/superfluid-detector.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"superfluid-detector.js","sourceRoot":"","sources":["../../src/erc777/superfluid-detector.ts"],"names":[],"mappings":";;;;AAAA,iDAAwF;AACxF,iEAAiE;AACjE,0EAAqE;AACrE,kFAAyE;AACzE,mCAAmC;AAEnC;;GAEG;AACH,MAAa,yBAA0B,SAAQ,iDAG9C;IACC;;OAEG;IACH,YAAmB,EAAE,aAAa,EAAE,eAAe,EAAiC;QAClF,KAAK,CACH,oBAAY,CAAC,kBAAkB,CAAC,aAAa,EAC7C,aAAa,CAAC,UAAU,CAAC,YAAY,EACrC,eAAe,CAChB,CAAC;IACJ,CAAC;IAES,mBAAmB,CAAC,OAAmC;QAC/D,OAAO,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC;IAC9E,CAAC;IAED;;;OAGG;IACO,mBAAmB,CAC3B,OAAmC;QAEnC,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC;IAC1D,CAAC;IAED;;;;;;;;;OASG;IACU,UAAU,CACrB,OAAmC;;;;;YAMnC,MAAM,YAAY,GAAG,MAAM,OAAM,UAAU,YAAC,OAAO,CAAC,CAAC;YACrD,IAAI,YAAY,CAAC,KAAK,EAAE;gBACtB,OAAO,YAAY,CAAC;aACrB;YACD,IAAI,YAAY,CAAC,OAAO,EAAE;gBACxB,MAAM,MAAM,GAAG,kBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjC,MAAM,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC;gBACjF,2FAA2F;gBAC3F,MAAM,gBAAgB,GAAG,kBAAS,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,CAC/D,kBAAS,CAAC,IAAI,C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