@requestnetwork/payment-detection 0.36.1-next.1862 → 0.36.1-next.1864
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.js +2 -2
- package/dist/any/any-to-eth-proxy.js +1 -1
- package/dist/any/retrievers/any-to-any-proxy.js +2 -2
- package/dist/any-to-any-detector.js +1 -1
- package/dist/btc/address-based.js +2 -2
- package/dist/btc/default-bitcoin-detection-provider.js +1 -1
- package/dist/btc/default-providers/blockchain-info.js +3 -3
- package/dist/btc/default-providers/blockchain-info.js.map +1 -1
- package/dist/btc/default-providers/blockcypher-com.js +2 -2
- package/dist/btc/default-providers/blockcypher-com.js.map +1 -1
- package/dist/btc/default-providers/blockstream-info.js +3 -3
- package/dist/btc/default-providers/blockstream-info.js.map +1 -1
- package/dist/btc/default-providers/chain-so.js +2 -2
- package/dist/btc/default-providers/chain-so.js.map +1 -1
- package/dist/declarative.js +2 -2
- package/dist/erc20/address-based-info-retriever.js +2 -2
- package/dist/erc20/address-based.js +3 -3
- package/dist/erc20/currency.js +1 -1
- package/dist/erc20/escrow-info-retriever.js +5 -5
- package/dist/erc20/fee-proxy-contract.js +2 -2
- package/dist/erc20/index.d.ts +1 -0
- package/dist/erc20/index.d.ts.map +1 -1
- package/dist/erc20/index.js +3 -1
- package/dist/erc20/index.js.map +1 -1
- package/dist/erc20/proxy-contract.js +1 -1
- package/dist/erc20/proxy-info-retriever.d.ts +3 -1
- package/dist/erc20/proxy-info-retriever.d.ts.map +1 -1
- package/dist/erc20/proxy-info-retriever.js +7 -5
- package/dist/erc20/proxy-info-retriever.js.map +1 -1
- package/dist/erc20/transferable-receivable.d.ts +26 -0
- package/dist/erc20/transferable-receivable.d.ts.map +1 -0
- package/dist/erc20/transferable-receivable.js +72 -0
- package/dist/erc20/transferable-receivable.js.map +1 -0
- package/dist/erc777/superfluid-detector.js +2 -2
- package/dist/erc777/superfluid-retriever.js +3 -3
- package/dist/eth/fee-proxy-detector.js +1 -1
- package/dist/eth/info-retriever.js +1 -1
- package/dist/eth/input-data.js +1 -1
- package/dist/eth/proxy-info-retriever.js +2 -2
- package/dist/fee-reference-based-detector.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/near/near-conversion-detector.js +1 -1
- package/dist/near/near-detector.js +1 -1
- package/dist/near/retrievers/near-conversion-info-retriever.js +1 -1
- package/dist/near/retrievers/near-info-retriever.js +1 -1
- package/dist/payment-detector-base.js +1 -1
- package/dist/payment-network-factory.d.ts.map +1 -1
- package/dist/payment-network-factory.js +1 -0
- package/dist/payment-network-factory.js.map +1 -1
- package/dist/reference-based-detector.js +2 -2
- package/dist/thegraph/__mocks__/client.d.ts +3 -0
- package/dist/thegraph/__mocks__/client.d.ts.map +1 -1
- package/dist/thegraph/__mocks__/client.js +1 -0
- package/dist/thegraph/__mocks__/client.js.map +1 -1
- package/dist/thegraph/client.d.ts +7 -4
- package/dist/thegraph/client.d.ts.map +1 -1
- package/dist/thegraph/generated/graphql-near.d.ts +38 -38
- package/dist/thegraph/generated/graphql-near.d.ts.map +1 -1
- package/dist/thegraph/generated/graphql-superfluid.d.ts +369 -369
- package/dist/thegraph/generated/graphql-superfluid.d.ts.map +1 -1
- package/dist/thegraph/generated/graphql.d.ts +59 -45
- package/dist/thegraph/generated/graphql.d.ts.map +1 -1
- package/dist/thegraph/generated/graphql.js +42 -1
- package/dist/thegraph/generated/graphql.js.map +1 -1
- package/dist/thegraph/index.js +2 -2
- package/dist/thegraph/index.js.map +1 -1
- package/dist/thegraph/info-retriever.d.ts +2 -1
- package/dist/thegraph/info-retriever.d.ts.map +1 -1
- package/dist/thegraph/info-retriever.js +18 -1
- package/dist/thegraph/info-retriever.js.map +1 -1
- package/dist/thegraph/superfluid.d.ts +3 -3
- package/dist/thegraph/superfluid.d.ts.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -41,7 +41,7 @@ class SuperFluidPaymentDetector extends reference_based_detector_1.ReferenceBase
|
|
|
41
41
|
const _super = Object.create(null, {
|
|
42
42
|
getBalance: { get: () => super.getBalance }
|
|
43
43
|
});
|
|
44
|
-
return
|
|
44
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
const totalBalance = yield _super.getBalance.call(this, request);
|
|
46
46
|
if (totalBalance.error) {
|
|
47
47
|
return totalBalance;
|
|
@@ -74,7 +74,7 @@ class SuperFluidPaymentDetector extends reference_based_detector_1.ReferenceBase
|
|
|
74
74
|
* @returns List of payment events
|
|
75
75
|
*/
|
|
76
76
|
extractEvents(eventName, address, paymentReference, requestCurrency, paymentChain) {
|
|
77
|
-
return
|
|
77
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
78
78
|
if (!address) {
|
|
79
79
|
return {
|
|
80
80
|
paymentEvents: [],
|
|
@@ -35,7 +35,7 @@ class SuperFluidInfoRetriever {
|
|
|
35
35
|
* @returns List of streaming events
|
|
36
36
|
*/
|
|
37
37
|
getStreamingEvents() {
|
|
38
|
-
return
|
|
38
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
39
|
const variables = this.getGraphVariables();
|
|
40
40
|
const { flow, untagged } = yield this.client.GetSuperFluidEvents(variables);
|
|
41
41
|
return flow.concat(untagged).sort((a, b) => a.timestamp - b.timestamp);
|
|
@@ -46,7 +46,7 @@ class SuperFluidInfoRetriever {
|
|
|
46
46
|
* @returns List of one off payment events
|
|
47
47
|
*/
|
|
48
48
|
getOneOffPaymentEvents() {
|
|
49
|
-
return
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
const variables = this.getGraphVariables();
|
|
51
51
|
const { payment } = yield this.client.GetSuperFluidEvents(variables);
|
|
52
52
|
return payment.sort((a, b) => a.timestamp - b.timestamp);
|
|
@@ -59,7 +59,7 @@ class SuperFluidInfoRetriever {
|
|
|
59
59
|
* to compute balance from amounts in ERC20 style transactions
|
|
60
60
|
*/
|
|
61
61
|
getTransferEvents() {
|
|
62
|
-
return
|
|
62
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
const streamEvents = yield this.getStreamingEvents();
|
|
64
64
|
const oneOffPaymentEvents = yield this.getOneOffPaymentEvents();
|
|
65
65
|
const paymentEvents = [];
|
|
@@ -35,7 +35,7 @@ class EthFeeProxyPaymentDetector extends fee_reference_based_detector_1.FeeRefer
|
|
|
35
35
|
* @returns The balance
|
|
36
36
|
*/
|
|
37
37
|
extractEvents(eventName, toAddress, paymentReference, _requestCurrency, paymentChain, paymentNetwork) {
|
|
38
|
-
return
|
|
38
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
39
39
|
if (!toAddress) {
|
|
40
40
|
return {
|
|
41
41
|
paymentEvents: [],
|
|
@@ -22,7 +22,7 @@ class EthInputDataInfoRetriever {
|
|
|
22
22
|
this.explorerApiKey = explorerApiKey;
|
|
23
23
|
}
|
|
24
24
|
getTransferEvents() {
|
|
25
|
-
return
|
|
25
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
if (this.network === 'private') {
|
|
27
27
|
throw new Error('ETH input data info-retriever works with etherscan and cannot work on a local network');
|
|
28
28
|
}
|
package/dist/eth/input-data.js
CHANGED
|
@@ -38,7 +38,7 @@ class EthInputDataPaymentDetector extends reference_based_detector_1.ReferenceBa
|
|
|
38
38
|
* @returns The balance
|
|
39
39
|
*/
|
|
40
40
|
extractEvents(eventName, toAddress, paymentReference, _requestCurrency, paymentChain, paymentNetwork) {
|
|
41
|
-
return
|
|
41
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
if (!toAddress) {
|
|
43
43
|
return {
|
|
44
44
|
paymentEvents: [],
|
|
@@ -38,7 +38,7 @@ class EthProxyInfoRetriever {
|
|
|
38
38
|
* Retrieves transfer events for the current contract, address and network.
|
|
39
39
|
*/
|
|
40
40
|
getTransferEvents() {
|
|
41
|
-
return
|
|
41
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
// Create a filter to find all the Transfer logs for the toAddress
|
|
43
43
|
const filter = this.contractProxy.filters.TransferWithReference(null, null, '0x' + this.paymentReference);
|
|
44
44
|
filter.fromBlock = this.proxyCreationBlockNumber;
|
|
@@ -67,7 +67,7 @@ class EthProxyInfoRetriever {
|
|
|
67
67
|
// Keeps only the log with the right token and the right destination address
|
|
68
68
|
.filter(({ parsedLog }) => parsedLog.to.toLowerCase() === this.toAddress.toLowerCase())
|
|
69
69
|
// Creates the balance events
|
|
70
|
-
.map(({ parsedLog, blockNumber, transactionHash }) =>
|
|
70
|
+
.map(({ parsedLog, blockNumber, transactionHash }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
71
71
|
var _a;
|
|
72
72
|
return ({
|
|
73
73
|
amount: parsedLog.amount.toString(),
|
|
@@ -24,7 +24,7 @@ class FeeReferenceBasedDetector extends reference_based_detector_1.ReferenceBase
|
|
|
24
24
|
* @returns The extensionData object
|
|
25
25
|
*/
|
|
26
26
|
createExtensionsDataForCreation(paymentNetworkCreationParameters) {
|
|
27
|
-
return
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
// If no salt is given, generate one
|
|
29
29
|
paymentNetworkCreationParameters.salt =
|
|
30
30
|
paymentNetworkCreationParameters.salt || (yield (0, utils_1.generate8randomBytes)());
|
|
@@ -47,7 +47,7 @@ class FeeReferenceBasedDetector extends reference_based_detector_1.ReferenceBase
|
|
|
47
47
|
const _super = Object.create(null, {
|
|
48
48
|
getBalance: { get: () => super.getBalance }
|
|
49
49
|
});
|
|
50
|
-
return
|
|
50
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
51
51
|
const balance = yield _super.getBalance.call(this, request);
|
|
52
52
|
if (balance.error) {
|
|
53
53
|
return balance;
|
|
@@ -59,7 +59,7 @@ class FeeReferenceBasedDetector extends reference_based_detector_1.ReferenceBase
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
getFeeBalance(request, balance) {
|
|
62
|
-
return
|
|
62
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
const { feeAddress } = this.getPaymentExtension(request).values;
|
|
64
64
|
this.checkRequiredParameter(feeAddress, 'feeAddress');
|
|
65
65
|
const feeBalance = this.computeFeeBalance(balance.events, feeAddress).toString();
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { SuperFluidPaymentDetector } from './erc777/superfluid-detector';
|
|
|
14
14
|
import { EscrowERC20InfoRetriever } from './erc20/escrow-info-retriever';
|
|
15
15
|
import { SuperFluidInfoRetriever } from './erc777/superfluid-retriever';
|
|
16
16
|
import { PaymentNetworkOptions } from './types';
|
|
17
|
+
import { ERC20TransferableReceivablePaymentDetector } from './erc20';
|
|
17
18
|
export type { TheGraphClient } from './thegraph';
|
|
18
|
-
export { PaymentNetworkFactory, PaymentNetworkOptions, PaymentReferenceCalculator, BtcPaymentNetwork, DeclarativePaymentDetector, Erc20PaymentNetwork, EthInputDataPaymentDetector, EthFeeProxyPaymentDetector, AnyToERC20PaymentDetector, AnyToEthFeeProxyPaymentDetector, FeeReferenceBasedDetector, SuperFluidPaymentDetector, NearNativeTokenPaymentDetector, NearConversionNativeTokenPaymentDetector, EscrowERC20InfoRetriever, SuperFluidInfoRetriever, setProviderFactory, initPaymentDetectionApiKeys, getDefaultProvider, getTheGraphClient, getTheGraphNearClient, parseLogArgs, padAmountForChainlink, unpadAmountFromChainlink, calculateEscrowState, getPaymentNetworkExtension, getPaymentReference, formatAddress, };
|
|
19
|
+
export { PaymentNetworkFactory, PaymentNetworkOptions, PaymentReferenceCalculator, BtcPaymentNetwork, DeclarativePaymentDetector, Erc20PaymentNetwork, ERC20TransferableReceivablePaymentDetector, EthInputDataPaymentDetector, EthFeeProxyPaymentDetector, AnyToERC20PaymentDetector, AnyToEthFeeProxyPaymentDetector, FeeReferenceBasedDetector, SuperFluidPaymentDetector, NearNativeTokenPaymentDetector, NearConversionNativeTokenPaymentDetector, EscrowERC20InfoRetriever, SuperFluidInfoRetriever, setProviderFactory, initPaymentDetectionApiKeys, getDefaultProvider, getTheGraphClient, getTheGraphNearClient, parseLogArgs, padAmountForChainlink, unpadAmountFromChainlink, calculateEscrowState, getPaymentNetworkExtension, getPaymentReference, formatAddress, };
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,0BAA0B,MAAM,gCAAgC,CAAC;AACxE,OAAO,KAAK,iBAAiB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,mBAAmB,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,OAAO,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,wBAAwB,EACzB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,wCAAwC,EAAE,8BAA8B,EAAE,MAAM,QAAQ,CAAC;AAClG,OAAO,EAAE,yBAA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,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,0CAA0C,EAAE,MAAM,SAAS,CAAC;AAErE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,0CAA0C,EAC1C,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAC9B,wCAAwC,EACxC,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,GACd,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatAddress = exports.getPaymentReference = exports.getPaymentNetworkExtension = exports.calculateEscrowState = exports.unpadAmountFromChainlink = exports.padAmountForChainlink = exports.parseLogArgs = exports.getTheGraphNearClient = exports.getTheGraphClient = exports.getDefaultProvider = exports.initPaymentDetectionApiKeys = exports.setProviderFactory = exports.SuperFluidInfoRetriever = exports.EscrowERC20InfoRetriever = exports.NearConversionNativeTokenPaymentDetector = exports.NearNativeTokenPaymentDetector = exports.SuperFluidPaymentDetector = exports.FeeReferenceBasedDetector = exports.AnyToEthFeeProxyPaymentDetector = exports.AnyToERC20PaymentDetector = exports.EthFeeProxyPaymentDetector = exports.EthInputDataPaymentDetector = exports.Erc20PaymentNetwork = exports.DeclarativePaymentDetector = exports.BtcPaymentNetwork = exports.PaymentReferenceCalculator = exports.PaymentNetworkFactory = void 0;
|
|
3
|
+
exports.formatAddress = exports.getPaymentReference = exports.getPaymentNetworkExtension = exports.calculateEscrowState = exports.unpadAmountFromChainlink = exports.padAmountForChainlink = exports.parseLogArgs = exports.getTheGraphNearClient = exports.getTheGraphClient = exports.getDefaultProvider = exports.initPaymentDetectionApiKeys = exports.setProviderFactory = exports.SuperFluidInfoRetriever = exports.EscrowERC20InfoRetriever = exports.NearConversionNativeTokenPaymentDetector = exports.NearNativeTokenPaymentDetector = exports.SuperFluidPaymentDetector = exports.FeeReferenceBasedDetector = exports.AnyToEthFeeProxyPaymentDetector = exports.AnyToERC20PaymentDetector = exports.EthFeeProxyPaymentDetector = exports.EthInputDataPaymentDetector = exports.ERC20TransferableReceivablePaymentDetector = exports.Erc20PaymentNetwork = exports.DeclarativePaymentDetector = exports.BtcPaymentNetwork = exports.PaymentReferenceCalculator = exports.PaymentNetworkFactory = void 0;
|
|
4
4
|
const utils_1 = require("@requestnetwork/utils");
|
|
5
5
|
Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return utils_1.getDefaultProvider; } });
|
|
6
6
|
Object.defineProperty(exports, "initPaymentDetectionApiKeys", { enumerable: true, get: function () { return utils_1.initPaymentDetectionApiKeys; } });
|
|
@@ -43,4 +43,6 @@ const escrow_info_retriever_1 = require("./erc20/escrow-info-retriever");
|
|
|
43
43
|
Object.defineProperty(exports, "EscrowERC20InfoRetriever", { enumerable: true, get: function () { return escrow_info_retriever_1.EscrowERC20InfoRetriever; } });
|
|
44
44
|
const superfluid_retriever_1 = require("./erc777/superfluid-retriever");
|
|
45
45
|
Object.defineProperty(exports, "SuperFluidInfoRetriever", { enumerable: true, get: function () { return superfluid_retriever_1.SuperFluidInfoRetriever; } });
|
|
46
|
+
const erc20_1 = require("./erc20");
|
|
47
|
+
Object.defineProperty(exports, "ERC20TransferableReceivablePaymentDetector", { enumerable: true, get: function () { return erc20_1.ERC20TransferableReceivablePaymentDetector; } });
|
|
46
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAI+B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAI+B;AAgD7B,mGAnDA,0BAAkB,OAmDA;AADlB,4GAjDA,mCAA2B,OAiDA;AAD3B,mGA/CA,0BAAkB,OA+CA;AA7CpB,uEAAkE;AA4BhE,sGA5BO,+CAAqB,OA4BP;AA3BvB,iFAAwE;AA6BtE,qCA7BK,sCAA0B,CA6BL;AA5B5B,2CAA2C;AA6BzC,8CAAiB;AA5BnB,+CAA2D;AA6BzD,2GA7BO,wCAA0B,OA6BP;AA5B5B,+CAA+C;AA6B7C,kDAAmB;AA5BrB,+BAAmF;AAgCjF,0GAhCO,+BAAyB,OAgCP;AACzB,gHAjCkC,qCAA+B,OAiClC;AAhCjC,+BAAgF;AA8B9E,2GA9BO,gCAA0B,OA8BP;AAD1B,4GA7BmC,iCAA2B,OA6BnC;AA5B7B,yCAAsE;AAyCpE,kGAzCO,4BAAiB,OAyCP;AACjB,sGA1C0B,gCAAqB,OA0C1B;AAzCvB,mCAQiB;AAqCf,qGA5CA,4BAAoB,OA4CA;AAGpB,8FA9CA,qBAAa,OA8CA;AAFb,2GA3CA,kCAA0B,OA2CA;AAC1B,oGA3CA,2BAAmB,OA2CA;AAJnB,sGAtCA,6BAAqB,OAsCA;AADrB,6FApCA,oBAAY,OAoCA;AAEZ,yGArCA,gCAAwB,OAqCA;AAnC1B,iCAAkG;AAyBhG,yHAzBO,+CAAwC,OAyBP;AADxC,+GAxBiD,qCAA8B,OAwBjD;AAvBhC,iFAA2E;AAqBzE,0GArBO,wDAAyB,OAqBP;AApB3B,sEAAyE;AAqBvE,0GArBO,+CAAyB,OAqBP;AApB3B,yEAAyE;AAuBvE,yGAvBO,gDAAwB,OAuBP;AAtB1B,wEAAwE;AAuBtE,wGAvBO,8CAAuB,OAuBP;AArBzB,mCAAqE;AAWnE,2HAXO,kDAA0C,OAWP"}
|
|
@@ -28,7 +28,7 @@ class NearConversionNativeTokenPaymentDetector extends any_to_native_detector_1.
|
|
|
28
28
|
* @returns The balance with events
|
|
29
29
|
*/
|
|
30
30
|
extractEvents(eventName, address, paymentReference, requestCurrency, paymentChain, paymentNetwork) {
|
|
31
|
-
return
|
|
31
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
if (!address) {
|
|
33
33
|
return {
|
|
34
34
|
paymentEvents: [],
|
|
@@ -27,7 +27,7 @@ class NearNativeTokenPaymentDetector extends native_token_detector_1.NativeToken
|
|
|
27
27
|
* @returns The balance with events
|
|
28
28
|
*/
|
|
29
29
|
extractEvents(eventName, address, paymentReference, _requestCurrency, paymentChain, paymentNetwork) {
|
|
30
|
-
return
|
|
30
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
31
31
|
if (!address) {
|
|
32
32
|
return {
|
|
33
33
|
paymentEvents: [],
|
|
@@ -24,7 +24,7 @@ class NearConversionInfoRetriever extends near_info_retriever_1.NearInfoRetrieve
|
|
|
24
24
|
this.maxRateTimespan = maxRateTimespan;
|
|
25
25
|
}
|
|
26
26
|
getTransferEvents() {
|
|
27
|
-
return
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
const payments = yield this.client.GetNearConversionPayments({
|
|
29
29
|
reference: this.paymentReference,
|
|
30
30
|
to: this.toAddress,
|
|
@@ -26,7 +26,7 @@ class NearInfoRetriever {
|
|
|
26
26
|
this.client = (0, thegraph_1.getTheGraphNearClient)(`https://api.thegraph.com/subgraphs/name/requestnetwork/request-payments-${network}`);
|
|
27
27
|
}
|
|
28
28
|
getTransferEvents() {
|
|
29
|
-
return
|
|
29
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
const payments = yield this.client.GetNearPayments({
|
|
31
31
|
reference: this.paymentReference,
|
|
32
32
|
to: this.toAddress,
|
|
@@ -17,7 +17,7 @@ class PaymentDetectorBase {
|
|
|
17
17
|
* @returns the balance and the payment/refund events
|
|
18
18
|
*/
|
|
19
19
|
getBalance(request) {
|
|
20
|
-
return
|
|
20
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
try {
|
|
22
22
|
const allNetworkEvents = yield this.getEvents(request);
|
|
23
23
|
const rawPaymentEvents = allNetworkEvents.paymentEvents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-network-factory.d.ts","sourceRoot":"","sources":["../src/payment-network-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAIL,qBAAqB,EACtB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"payment-network-factory.d.ts","sourceRoot":"","sources":["../src/payment-network-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAIL,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAgEjB,+FAA+F;AAC/F,qBAAa,qBAAqB;IAS9B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IATlC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D;;;;;OAKG;gBAEgB,aAAa,EAAE,kBAAkB,CAAC,cAAc,EAChD,eAAe,EAAE,gBAAgB,EAClD,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAK1C,OAAO,CAAC,YAAY;IAepB;;;;;;;;OAQG;IACI,oBAAoB,CACzB,gBAAgB,EAAE,cAAc,CAAC,kBAAkB,EACnD,YAAY,EAAE,iBAAiB,CAAC,QAAQ,EACxC,YAAY,CAAC,EAAE,MAAM,EACrB,qBAAqB,CAAC,EAAE,MAAM,GAC7B,YAAY,CAAC,eAAe;IAqC/B;;;;;;OAMG;IACI,4BAA4B,CACjC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,GAClC,YAAY,CAAC,eAAe,GAAG,IAAI;CAgBvC"}
|
|
@@ -33,6 +33,7 @@ const supportedPaymentNetwork = {
|
|
|
33
33
|
[PN_ID.ERC20_ADDRESS_BASED]: erc20_1.ERC20AddressBasedPaymentDetector,
|
|
34
34
|
[PN_ID.ERC20_PROXY_CONTRACT]: erc20_1.ERC20ProxyPaymentDetector,
|
|
35
35
|
[PN_ID.ERC20_FEE_PROXY_CONTRACT]: erc20_1.ERC20FeeProxyPaymentDetector,
|
|
36
|
+
[PN_ID.ERC20_TRANSFERABLE_RECEIVABLE]: erc20_1.ERC20TransferableReceivablePaymentDetector,
|
|
36
37
|
},
|
|
37
38
|
},
|
|
38
39
|
ETH: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-network-factory.js","sourceRoot":"","sources":["../src/payment-network-factory.ts"],"names":[],"mappings":";;;AAAA,iDAK+B;AAQ/B,+BAAuF;AACvF,+CAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"payment-network-factory.js","sourceRoot":"","sources":["../src/payment-network-factory.ts"],"names":[],"mappings":";;;AAAA,iDAK+B;AAQ/B,+BAAuF;AACvF,+CAA2D;AAC3D,mCAKiB;AACjB,sEAAyE;AACzE,+BAAgF;AAChF,+BAAmF;AACnF,iCAAkG;AAClG,mCAAqD;AACrD,yCAA+C;AAC/C,mCAA4C;AAE5C,MAAM,KAAK,GAAG,sBAAc,CAAC,kBAAkB,CAAC;AAEhD,wDAAwD;AACxD,MAAM,uBAAuB,GAAuC;IAClE,GAAG,EAAE;QACH,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AAO,EACf,CAAC;QAEH,IAAI,QAAQ,CAAC,SAAS,IAAI,0BAA0B,IAAI,aAAa,EAAE;YACrE,uFAAuF;YACtF,aAAuC,CAAC,wBAAwB,CAC/D,OAAO,EACP,qBAAqB,IAAI,QAAQ,CAAC,SAAS,CAAC,cAAc,CAC3D,CAAC;SACH;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;OAMG;IACI,4BAA4B,CACjC,OAAmC;;QAEnC,MAAM,EAAE,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,EAAE,EAAE;YACP,OAAO,IAAI,CAAC;SACb;QAED,MAAM,cAAc,GAAG,MAAA,MAAA,EAAE,CAAC,MAAM,0CAAE,OAAO,mCAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;QAEtE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,oBAAoB,CAC9B,EAAkD,EAClD,OAAO,CAAC,QAAQ,CAAC,IAAI,EACrB,cAAc,EACd,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA3GD,sDA2GC"}
|
|
@@ -30,7 +30,7 @@ class ReferenceBasedDetector extends declarative_1.DeclarativePaymentDetectorBas
|
|
|
30
30
|
* @returns The extensionData object
|
|
31
31
|
*/
|
|
32
32
|
createExtensionsDataForCreation(paymentNetworkCreationParameters) {
|
|
33
|
-
return
|
|
33
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
// If no salt is given, generate one
|
|
35
35
|
paymentNetworkCreationParameters.salt =
|
|
36
36
|
paymentNetworkCreationParameters.salt || (yield (0, utils_1.generate8randomBytes)());
|
|
@@ -60,7 +60,7 @@ class ReferenceBasedDetector extends declarative_1.DeclarativePaymentDetectorBas
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
getEvents(request) {
|
|
63
|
-
return
|
|
63
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
64
64
|
const paymentExtension = this.getPaymentExtension(request);
|
|
65
65
|
const paymentChain = this.getPaymentChain(request);
|
|
66
66
|
this.checkRequiredParameter(paymentExtension.values.salt, 'salt');
|
|
@@ -8,6 +8,9 @@ export declare const getTheGraphClient: () => {
|
|
|
8
8
|
reference: any;
|
|
9
9
|
to: any;
|
|
10
10
|
}>, requestHeaders?: (Record<string, string> | import("graphql-request/dist/types.dom").Headers | string[][]) | undefined): Promise<import("../generated/graphql").GetPaymentsAndEscrowStateQuery>;
|
|
11
|
+
GetPaymentsAndEscrowStateForReceivables(variables: import("../generated/graphql").Exact<{
|
|
12
|
+
reference: any;
|
|
13
|
+
}>, requestHeaders?: (Record<string, string> | import("graphql-request/dist/types.dom").Headers | string[][]) | undefined): Promise<import("../generated/graphql").GetPaymentsAndEscrowStateForReceivablesQuery>;
|
|
11
14
|
GetSyncedBlock(variables: import("../generated/graphql").Exact<{
|
|
12
15
|
blockHash: any;
|
|
13
16
|
}>, requestHeaders?: (Record<string, string> | import("graphql-request/dist/types.dom").Headers | string[][]) | undefined): Promise<import("../generated/graphql").GetSyncedBlockQuery>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/thegraph/__mocks__/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,eAAO,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/thegraph/__mocks__/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,eAAO,MAAM,cAAc,EAAE,cAK5B,CAAC;AACF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;CAAuB,CAAC;AAEtD,eAAO,MAAM,qBAAqB,aAEjC,CAAC"}
|
|
@@ -4,6 +4,7 @@ exports.getTheGraphNearClient = exports.getTheGraphClient = exports.theGraphClie
|
|
|
4
4
|
exports.theGraphClient = {
|
|
5
5
|
GetLastSyncedBlock: jest.fn(),
|
|
6
6
|
GetPaymentsAndEscrowState: jest.fn(),
|
|
7
|
+
GetPaymentsAndEscrowStateForReceivables: jest.fn(),
|
|
7
8
|
GetSyncedBlock: jest.fn(),
|
|
8
9
|
};
|
|
9
10
|
const getTheGraphClient = () => exports.theGraphClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/thegraph/__mocks__/client.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAmB;IAC5C,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE;IAC7B,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE;IACpC,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;CAC1B,CAAC;AACK,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,sBAAc,CAAC;AAAzC,QAAA,iBAAiB,qBAAwB;AAE/C,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC"}
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/thegraph/__mocks__/client.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAmB;IAC5C,kBAAkB,EAAE,IAAI,CAAC,EAAE,EAAE;IAC7B,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE;IACpC,uCAAuC,EAAE,IAAI,CAAC,EAAE,EAAE;IAClD,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;CAC1B,CAAC;AACK,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,sBAAc,CAAC;AAAzC,QAAA,iBAAiB,qBAAwB;AAE/C,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC"}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @type TGraphClientVariant: null if no variant, 'near' if native token payments detection on Near
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type TheGraphClient<TGraphClientVariant extends 'near' | null = null> = TGraphClientVariant extends 'near' ? ReturnType<typeof getTheGraphNearClient> : ReturnType<typeof getTheGraphClient>;
|
|
7
|
+
export type TheGraphClientOptions = {
|
|
8
8
|
timeout?: number;
|
|
9
9
|
};
|
|
10
|
-
export declare const getTheGraphClient: (url: string, options?: TheGraphClientOptions
|
|
10
|
+
export declare const getTheGraphClient: (url: string, options?: TheGraphClientOptions) => {
|
|
11
11
|
GetLastSyncedBlock(variables?: import("./generated/graphql").Exact<{
|
|
12
12
|
[key: string]: never;
|
|
13
13
|
}> | undefined, requestHeaders?: (Record<string, string> | import("graphql-request/dist/types.dom").Headers | string[][]) | undefined): Promise<import("./generated/graphql").GetLastSyncedBlockQuery>;
|
|
@@ -15,11 +15,14 @@ export declare const getTheGraphClient: (url: string, options?: TheGraphClientOp
|
|
|
15
15
|
reference: any;
|
|
16
16
|
to: any;
|
|
17
17
|
}>, requestHeaders?: (Record<string, string> | import("graphql-request/dist/types.dom").Headers | string[][]) | undefined): Promise<import("./generated/graphql").GetPaymentsAndEscrowStateQuery>;
|
|
18
|
+
GetPaymentsAndEscrowStateForReceivables(variables: import("./generated/graphql").Exact<{
|
|
19
|
+
reference: any;
|
|
20
|
+
}>, requestHeaders?: (Record<string, string> | import("graphql-request/dist/types.dom").Headers | string[][]) | undefined): Promise<import("./generated/graphql").GetPaymentsAndEscrowStateForReceivablesQuery>;
|
|
18
21
|
GetSyncedBlock(variables: import("./generated/graphql").Exact<{
|
|
19
22
|
blockHash: any;
|
|
20
23
|
}>, requestHeaders?: (Record<string, string> | import("graphql-request/dist/types.dom").Headers | string[][]) | undefined): Promise<import("./generated/graphql").GetSyncedBlockQuery>;
|
|
21
24
|
};
|
|
22
|
-
export declare const getTheGraphNearClient: (url: string, options?: TheGraphClientOptions
|
|
25
|
+
export declare const getTheGraphNearClient: (url: string, options?: TheGraphClientOptions) => {
|
|
23
26
|
GetNearConversionPayments(variables: import("./generated/graphql-near").Exact<{
|
|
24
27
|
reference: string;
|
|
25
28
|
to: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/thegraph/client.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/thegraph/client.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,mBAAmB,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IACzE,mBAAmB,SAAS,MAAM,GAC9B,UAAU,CAAC,OAAO,qBAAqB,CAAC,GACxC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAS,MAAM,YAAY,qBAAqB;;;;;;;;;;;;;;CACrC,CAAC;AAE1C,eAAO,MAAM,qBAAqB,QAAS,MAAM,YAAY,qBAAqB;;;;;;;;;;;;;CACrC,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { GraphQLClient } from 'graphql-request';
|
|
2
2
|
import * as Dom from 'graphql-request/dist/types.dom';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type Maybe<T> = T | null;
|
|
4
|
+
export type Exact<T extends {
|
|
5
5
|
[key: string]: unknown;
|
|
6
6
|
}> = {
|
|
7
7
|
[K in keyof T]: T[K];
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
10
10
|
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
13
13
|
[SubKey in K]: Maybe<T[SubKey]>;
|
|
14
14
|
};
|
|
15
15
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
16
|
-
export
|
|
16
|
+
export type Scalars = {
|
|
17
17
|
ID: string;
|
|
18
18
|
String: string;
|
|
19
19
|
Boolean: boolean;
|
|
@@ -23,15 +23,15 @@ export declare type Scalars = {
|
|
|
23
23
|
BigInt: any;
|
|
24
24
|
Bytes: any;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export type BlockChangedFilter = {
|
|
27
27
|
number_gte: Scalars['Int'];
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type Block_Height = {
|
|
30
30
|
hash?: Maybe<Scalars['Bytes']>;
|
|
31
31
|
number?: Maybe<Scalars['Int']>;
|
|
32
32
|
number_gte?: Maybe<Scalars['Int']>;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
34
|
+
export type Escrow = {
|
|
35
35
|
__typename?: 'Escrow';
|
|
36
36
|
id: Scalars['ID'];
|
|
37
37
|
contractAddress: Scalars['Bytes'];
|
|
@@ -48,14 +48,14 @@ export declare type Escrow = {
|
|
|
48
48
|
to?: Maybe<Scalars['Bytes']>;
|
|
49
49
|
events?: Maybe<Array<EscrowEvent>>;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export type EscrowEventsArgs = {
|
|
52
52
|
skip?: Maybe<Scalars['Int']>;
|
|
53
53
|
first?: Maybe<Scalars['Int']>;
|
|
54
54
|
orderBy?: Maybe<EscrowEvent_OrderBy>;
|
|
55
55
|
orderDirection?: Maybe<OrderDirection>;
|
|
56
56
|
where?: Maybe<EscrowEvent_Filter>;
|
|
57
57
|
};
|
|
58
|
-
export
|
|
58
|
+
export type EscrowEvent = {
|
|
59
59
|
__typename?: 'EscrowEvent';
|
|
60
60
|
id: Scalars['ID'];
|
|
61
61
|
contractAddress: Scalars['Bytes'];
|
|
@@ -69,7 +69,7 @@ export declare type EscrowEvent = {
|
|
|
69
69
|
gasUsed: Scalars['BigInt'];
|
|
70
70
|
gasPrice: Scalars['BigInt'];
|
|
71
71
|
};
|
|
72
|
-
export
|
|
72
|
+
export type EscrowEvent_Filter = {
|
|
73
73
|
id?: Maybe<Scalars['ID']>;
|
|
74
74
|
id_not?: Maybe<Scalars['ID']>;
|
|
75
75
|
id_gt?: Maybe<Scalars['ID']>;
|
|
@@ -199,7 +199,7 @@ export declare enum EscrowState {
|
|
|
199
199
|
Emergency = "emergency",
|
|
200
200
|
Frozen = "frozen"
|
|
201
201
|
}
|
|
202
|
-
export
|
|
202
|
+
export type Escrow_Filter = {
|
|
203
203
|
id?: Maybe<Scalars['ID']>;
|
|
204
204
|
id_not?: Maybe<Scalars['ID']>;
|
|
205
205
|
id_gt?: Maybe<Scalars['ID']>;
|
|
@@ -348,7 +348,7 @@ export declare enum OrderDirection {
|
|
|
348
348
|
Asc = "asc",
|
|
349
349
|
Desc = "desc"
|
|
350
350
|
}
|
|
351
|
-
export
|
|
351
|
+
export type Payment = {
|
|
352
352
|
__typename?: 'Payment';
|
|
353
353
|
id: Scalars['ID'];
|
|
354
354
|
contractAddress: Scalars['String'];
|
|
@@ -370,7 +370,7 @@ export declare type Payment = {
|
|
|
370
370
|
feeAmountInCrypto?: Maybe<Scalars['BigDecimal']>;
|
|
371
371
|
maxRateTimespan?: Maybe<Scalars['Int']>;
|
|
372
372
|
};
|
|
373
|
-
export
|
|
373
|
+
export type Payment_Filter = {
|
|
374
374
|
id?: Maybe<Scalars['ID']>;
|
|
375
375
|
id_not?: Maybe<Scalars['ID']>;
|
|
376
376
|
id_gt?: Maybe<Scalars['ID']>;
|
|
@@ -647,7 +647,7 @@ export declare enum Payment_OrderBy {
|
|
|
647
647
|
FeeAmountInCrypto = "feeAmountInCrypto",
|
|
648
648
|
MaxRateTimespan = "maxRateTimespan"
|
|
649
649
|
}
|
|
650
|
-
export
|
|
650
|
+
export type Query = {
|
|
651
651
|
__typename?: 'Query';
|
|
652
652
|
payment?: Maybe<Payment>;
|
|
653
653
|
payments: Array<Payment>;
|
|
@@ -658,12 +658,12 @@ export declare type Query = {
|
|
|
658
658
|
/** Access to subgraph metadata */
|
|
659
659
|
_meta?: Maybe<_Meta_>;
|
|
660
660
|
};
|
|
661
|
-
export
|
|
661
|
+
export type QueryPaymentArgs = {
|
|
662
662
|
id: Scalars['ID'];
|
|
663
663
|
block?: Maybe<Block_Height>;
|
|
664
664
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
665
665
|
};
|
|
666
|
-
export
|
|
666
|
+
export type QueryPaymentsArgs = {
|
|
667
667
|
skip?: Maybe<Scalars['Int']>;
|
|
668
668
|
first?: Maybe<Scalars['Int']>;
|
|
669
669
|
orderBy?: Maybe<Payment_OrderBy>;
|
|
@@ -672,12 +672,12 @@ export declare type QueryPaymentsArgs = {
|
|
|
672
672
|
block?: Maybe<Block_Height>;
|
|
673
673
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
674
674
|
};
|
|
675
|
-
export
|
|
675
|
+
export type QueryEscrowArgs = {
|
|
676
676
|
id: Scalars['ID'];
|
|
677
677
|
block?: Maybe<Block_Height>;
|
|
678
678
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
679
679
|
};
|
|
680
|
-
export
|
|
680
|
+
export type QueryEscrowsArgs = {
|
|
681
681
|
skip?: Maybe<Scalars['Int']>;
|
|
682
682
|
first?: Maybe<Scalars['Int']>;
|
|
683
683
|
orderBy?: Maybe<Escrow_OrderBy>;
|
|
@@ -686,12 +686,12 @@ export declare type QueryEscrowsArgs = {
|
|
|
686
686
|
block?: Maybe<Block_Height>;
|
|
687
687
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
688
688
|
};
|
|
689
|
-
export
|
|
689
|
+
export type QueryEscrowEventArgs = {
|
|
690
690
|
id: Scalars['ID'];
|
|
691
691
|
block?: Maybe<Block_Height>;
|
|
692
692
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
693
693
|
};
|
|
694
|
-
export
|
|
694
|
+
export type QueryEscrowEventsArgs = {
|
|
695
695
|
skip?: Maybe<Scalars['Int']>;
|
|
696
696
|
first?: Maybe<Scalars['Int']>;
|
|
697
697
|
orderBy?: Maybe<EscrowEvent_OrderBy>;
|
|
@@ -700,10 +700,10 @@ export declare type QueryEscrowEventsArgs = {
|
|
|
700
700
|
block?: Maybe<Block_Height>;
|
|
701
701
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
702
702
|
};
|
|
703
|
-
export
|
|
703
|
+
export type Query_MetaArgs = {
|
|
704
704
|
block?: Maybe<Block_Height>;
|
|
705
705
|
};
|
|
706
|
-
export
|
|
706
|
+
export type Subscription = {
|
|
707
707
|
__typename?: 'Subscription';
|
|
708
708
|
payment?: Maybe<Payment>;
|
|
709
709
|
payments: Array<Payment>;
|
|
@@ -714,12 +714,12 @@ export declare type Subscription = {
|
|
|
714
714
|
/** Access to subgraph metadata */
|
|
715
715
|
_meta?: Maybe<_Meta_>;
|
|
716
716
|
};
|
|
717
|
-
export
|
|
717
|
+
export type SubscriptionPaymentArgs = {
|
|
718
718
|
id: Scalars['ID'];
|
|
719
719
|
block?: Maybe<Block_Height>;
|
|
720
720
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
721
721
|
};
|
|
722
|
-
export
|
|
722
|
+
export type SubscriptionPaymentsArgs = {
|
|
723
723
|
skip?: Maybe<Scalars['Int']>;
|
|
724
724
|
first?: Maybe<Scalars['Int']>;
|
|
725
725
|
orderBy?: Maybe<Payment_OrderBy>;
|
|
@@ -728,12 +728,12 @@ export declare type SubscriptionPaymentsArgs = {
|
|
|
728
728
|
block?: Maybe<Block_Height>;
|
|
729
729
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
730
730
|
};
|
|
731
|
-
export
|
|
731
|
+
export type SubscriptionEscrowArgs = {
|
|
732
732
|
id: Scalars['ID'];
|
|
733
733
|
block?: Maybe<Block_Height>;
|
|
734
734
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
735
735
|
};
|
|
736
|
-
export
|
|
736
|
+
export type SubscriptionEscrowsArgs = {
|
|
737
737
|
skip?: Maybe<Scalars['Int']>;
|
|
738
738
|
first?: Maybe<Scalars['Int']>;
|
|
739
739
|
orderBy?: Maybe<Escrow_OrderBy>;
|
|
@@ -742,12 +742,12 @@ export declare type SubscriptionEscrowsArgs = {
|
|
|
742
742
|
block?: Maybe<Block_Height>;
|
|
743
743
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
744
744
|
};
|
|
745
|
-
export
|
|
745
|
+
export type SubscriptionEscrowEventArgs = {
|
|
746
746
|
id: Scalars['ID'];
|
|
747
747
|
block?: Maybe<Block_Height>;
|
|
748
748
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
749
749
|
};
|
|
750
|
-
export
|
|
750
|
+
export type SubscriptionEscrowEventsArgs = {
|
|
751
751
|
skip?: Maybe<Scalars['Int']>;
|
|
752
752
|
first?: Maybe<Scalars['Int']>;
|
|
753
753
|
orderBy?: Maybe<EscrowEvent_OrderBy>;
|
|
@@ -756,10 +756,10 @@ export declare type SubscriptionEscrowEventsArgs = {
|
|
|
756
756
|
block?: Maybe<Block_Height>;
|
|
757
757
|
subgraphError?: _SubgraphErrorPolicy_;
|
|
758
758
|
};
|
|
759
|
-
export
|
|
759
|
+
export type Subscription_MetaArgs = {
|
|
760
760
|
block?: Maybe<Block_Height>;
|
|
761
761
|
};
|
|
762
|
-
export
|
|
762
|
+
export type _Block_ = {
|
|
763
763
|
__typename?: '_Block_';
|
|
764
764
|
/** The hash of the block */
|
|
765
765
|
hash?: Maybe<Scalars['Bytes']>;
|
|
@@ -769,7 +769,7 @@ export declare type _Block_ = {
|
|
|
769
769
|
timestamp?: Maybe<Scalars['Int']>;
|
|
770
770
|
};
|
|
771
771
|
/** The type for the top-level _meta field */
|
|
772
|
-
export
|
|
772
|
+
export type _Meta_ = {
|
|
773
773
|
__typename?: '_Meta_';
|
|
774
774
|
/**
|
|
775
775
|
* Information about a specific subgraph block. The hash of the block
|
|
@@ -789,26 +789,26 @@ export declare enum _SubgraphErrorPolicy_ {
|
|
|
789
789
|
/** If the subgraph has indexing errors, data will be omitted. The default. */
|
|
790
790
|
Deny = "deny"
|
|
791
791
|
}
|
|
792
|
-
export
|
|
792
|
+
export type GetNearConversionPaymentsQueryVariables = Exact<{
|
|
793
793
|
reference: Scalars['String'];
|
|
794
794
|
to: Scalars['String'];
|
|
795
795
|
currency: Scalars['String'];
|
|
796
796
|
maxRateTimespan: Scalars['Int'];
|
|
797
797
|
contractAddress: Scalars['String'];
|
|
798
798
|
}>;
|
|
799
|
-
export
|
|
799
|
+
export type GetNearConversionPaymentsQuery = ({
|
|
800
800
|
__typename?: 'Query';
|
|
801
801
|
} & {
|
|
802
802
|
payments: Array<({
|
|
803
803
|
__typename?: 'Payment';
|
|
804
804
|
} & Pick<Payment, 'amount' | 'block' | 'receiptId' | 'feeAmount' | 'feeAddress' | 'from' | 'timestamp' | 'currency' | 'maxRateTimespan' | 'amountInCrypto' | 'feeAmountInCrypto'>)>;
|
|
805
805
|
});
|
|
806
|
-
export
|
|
806
|
+
export type GetNearPaymentsQueryVariables = Exact<{
|
|
807
807
|
reference: Scalars['String'];
|
|
808
808
|
to: Scalars['String'];
|
|
809
809
|
contractAddress: Scalars['String'];
|
|
810
810
|
}>;
|
|
811
|
-
export
|
|
811
|
+
export type GetNearPaymentsQuery = ({
|
|
812
812
|
__typename?: 'Query';
|
|
813
813
|
} & {
|
|
814
814
|
payments: Array<({
|
|
@@ -817,12 +817,12 @@ export declare type GetNearPaymentsQuery = ({
|
|
|
817
817
|
});
|
|
818
818
|
export declare const GetNearConversionPaymentsDocument: import("graphql/language/ast").DocumentNode;
|
|
819
819
|
export declare const GetNearPaymentsDocument: import("graphql/language/ast").DocumentNode;
|
|
820
|
-
export
|
|
820
|
+
export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string) => Promise<T>;
|
|
821
821
|
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
822
822
|
GetNearConversionPayments(variables: GetNearConversionPaymentsQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GetNearConversionPaymentsQuery>;
|
|
823
823
|
GetNearPayments(variables: GetNearPaymentsQueryVariables, requestHeaders?: Dom.RequestInit["headers"]): Promise<GetNearPaymentsQuery>;
|
|
824
824
|
};
|
|
825
|
-
export
|
|
825
|
+
export type Sdk = ReturnType<typeof getSdk>;
|
|
826
826
|
export declare const GetNearConversionPayments: import("graphql/language/ast").DocumentNode;
|
|
827
827
|
export declare const GetNearPayments: import("graphql/language/ast").DocumentNode;
|
|
828
828
|
//# sourceMappingURL=graphql-near.d.ts.map
|