@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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetSyncedBlock = exports.GetPaymentsAndEscrowState = exports.
|
|
3
|
+
exports.GetSyncedBlock = exports.GetPaymentsAndEscrowState = exports.GetLastSyncedBlock = exports.EscrowEventResult = exports.PaymentEventResult = exports.getSdk = exports.GetSyncedBlockDocument = exports.GetPaymentsAndEscrowStateDocument = exports.GetLastSyncedBlockDocument = exports.EscrowEventResultFragmentDoc = exports.PaymentEventResultFragmentDoc = exports._SubgraphErrorPolicy_ = exports.Payment_OrderBy = exports.OrderDirection = exports.EventName = exports.Escrow_OrderBy = exports.EscrowState = exports.EscrowEvent_OrderBy = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
var EscrowEvent_OrderBy;
|
|
6
6
|
(function (EscrowEvent_OrderBy) {
|
|
@@ -82,43 +82,35 @@ var _SubgraphErrorPolicy_;
|
|
|
82
82
|
/** If the subgraph has indexing errors, data will be omitted. The default. */
|
|
83
83
|
_SubgraphErrorPolicy_["Deny"] = "deny";
|
|
84
84
|
})(_SubgraphErrorPolicy_ = exports._SubgraphErrorPolicy_ || (exports._SubgraphErrorPolicy_ = {}));
|
|
85
|
-
exports.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
maxRateTimespan
|
|
104
|
-
gasUsed
|
|
105
|
-
gasPrice
|
|
106
|
-
}
|
|
85
|
+
exports.PaymentEventResultFragmentDoc = (0, graphql_tag_1.default) `
|
|
86
|
+
fragment PaymentEventResult on Payment {
|
|
87
|
+
amount
|
|
88
|
+
block
|
|
89
|
+
txHash
|
|
90
|
+
feeAmount
|
|
91
|
+
feeAddress
|
|
92
|
+
from
|
|
93
|
+
gasUsed
|
|
94
|
+
gasPrice
|
|
95
|
+
timestamp
|
|
96
|
+
contractAddress
|
|
97
|
+
to
|
|
98
|
+
tokenAddress
|
|
99
|
+
currency
|
|
100
|
+
amountInCrypto
|
|
101
|
+
feeAmountInCrypto
|
|
102
|
+
maxRateTimespan
|
|
107
103
|
}
|
|
108
104
|
`;
|
|
109
|
-
exports.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
eventName
|
|
119
|
-
from
|
|
120
|
-
timestamp
|
|
121
|
-
}
|
|
105
|
+
exports.EscrowEventResultFragmentDoc = (0, graphql_tag_1.default) `
|
|
106
|
+
fragment EscrowEventResult on EscrowEvent {
|
|
107
|
+
txHash
|
|
108
|
+
eventName
|
|
109
|
+
from
|
|
110
|
+
timestamp
|
|
111
|
+
block
|
|
112
|
+
gasUsed
|
|
113
|
+
gasPrice
|
|
122
114
|
}
|
|
123
115
|
`;
|
|
124
116
|
exports.GetLastSyncedBlockDocument = (0, graphql_tag_1.default) `
|
|
@@ -131,55 +123,25 @@ exports.GetLastSyncedBlockDocument = (0, graphql_tag_1.default) `
|
|
|
131
123
|
}
|
|
132
124
|
}
|
|
133
125
|
`;
|
|
134
|
-
exports.GetPaymentsDocument = (0, graphql_tag_1.default) `
|
|
135
|
-
query GetPayments($contractAddress: Bytes!, $reference: Bytes!, $tokenAddress: Bytes, $to: Bytes!) {
|
|
136
|
-
payments(
|
|
137
|
-
where: {contractAddress: $contractAddress, reference: $reference, tokenAddress: $tokenAddress, to: $to}
|
|
138
|
-
orderBy: timestamp
|
|
139
|
-
orderDirection: asc
|
|
140
|
-
) {
|
|
141
|
-
amount
|
|
142
|
-
block
|
|
143
|
-
txHash
|
|
144
|
-
feeAmount
|
|
145
|
-
feeAddress
|
|
146
|
-
from
|
|
147
|
-
timestamp
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
`;
|
|
151
126
|
exports.GetPaymentsAndEscrowStateDocument = (0, graphql_tag_1.default) `
|
|
152
|
-
query GetPaymentsAndEscrowState($
|
|
127
|
+
query GetPaymentsAndEscrowState($reference: Bytes!, $to: Bytes!) {
|
|
153
128
|
payments(
|
|
154
|
-
where: {
|
|
129
|
+
where: {reference: $reference, to: $to}
|
|
155
130
|
orderBy: timestamp
|
|
156
131
|
orderDirection: asc
|
|
157
132
|
) {
|
|
158
|
-
|
|
159
|
-
block
|
|
160
|
-
txHash
|
|
161
|
-
feeAmount
|
|
162
|
-
feeAddress
|
|
163
|
-
from
|
|
164
|
-
gasUsed
|
|
165
|
-
gasPrice
|
|
166
|
-
timestamp
|
|
133
|
+
...PaymentEventResult
|
|
167
134
|
}
|
|
168
135
|
escrowEvents(
|
|
169
136
|
where: {reference: $reference}
|
|
170
137
|
orderBy: timestamp
|
|
171
138
|
orderDirection: asc
|
|
172
139
|
) {
|
|
173
|
-
|
|
174
|
-
eventName
|
|
175
|
-
from
|
|
176
|
-
timestamp
|
|
177
|
-
block
|
|
178
|
-
gasUsed
|
|
179
|
-
gasPrice
|
|
140
|
+
...EscrowEventResult
|
|
180
141
|
}
|
|
181
142
|
}
|
|
182
|
-
|
|
143
|
+
${exports.PaymentEventResultFragmentDoc}
|
|
144
|
+
${exports.EscrowEventResultFragmentDoc}`;
|
|
183
145
|
exports.GetSyncedBlockDocument = (0, graphql_tag_1.default) `
|
|
184
146
|
query GetSyncedBlock($blockHash: Bytes!) {
|
|
185
147
|
_meta(block: {hash: $blockHash}) {
|
|
@@ -193,18 +155,9 @@ exports.GetSyncedBlockDocument = (0, graphql_tag_1.default) `
|
|
|
193
155
|
const defaultWrapper = (action, _operationName) => action();
|
|
194
156
|
function getSdk(client, withWrapper = defaultWrapper) {
|
|
195
157
|
return {
|
|
196
|
-
GetConversionPayments(variables, requestHeaders) {
|
|
197
|
-
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetConversionPaymentsDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetConversionPayments');
|
|
198
|
-
},
|
|
199
|
-
GetEscrowEvents(variables, requestHeaders) {
|
|
200
|
-
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetEscrowEventsDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetEscrowEvents');
|
|
201
|
-
},
|
|
202
158
|
GetLastSyncedBlock(variables, requestHeaders) {
|
|
203
159
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetLastSyncedBlockDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetLastSyncedBlock');
|
|
204
160
|
},
|
|
205
|
-
GetPayments(variables, requestHeaders) {
|
|
206
|
-
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetPaymentsDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetPayments');
|
|
207
|
-
},
|
|
208
161
|
GetPaymentsAndEscrowState(variables, requestHeaders) {
|
|
209
162
|
return withWrapper((wrappedRequestHeaders) => client.request(exports.GetPaymentsAndEscrowStateDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetPaymentsAndEscrowState');
|
|
210
163
|
},
|
|
@@ -214,43 +167,35 @@ function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
214
167
|
};
|
|
215
168
|
}
|
|
216
169
|
exports.getSdk = getSdk;
|
|
217
|
-
exports.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
maxRateTimespan
|
|
236
|
-
gasUsed
|
|
237
|
-
gasPrice
|
|
238
|
-
}
|
|
170
|
+
exports.PaymentEventResult = (0, graphql_tag_1.default) `
|
|
171
|
+
fragment PaymentEventResult on Payment {
|
|
172
|
+
amount
|
|
173
|
+
block
|
|
174
|
+
txHash
|
|
175
|
+
feeAmount
|
|
176
|
+
feeAddress
|
|
177
|
+
from
|
|
178
|
+
gasUsed
|
|
179
|
+
gasPrice
|
|
180
|
+
timestamp
|
|
181
|
+
contractAddress
|
|
182
|
+
to
|
|
183
|
+
tokenAddress
|
|
184
|
+
currency
|
|
185
|
+
amountInCrypto
|
|
186
|
+
feeAmountInCrypto
|
|
187
|
+
maxRateTimespan
|
|
239
188
|
}
|
|
240
189
|
`;
|
|
241
|
-
exports.
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
eventName
|
|
251
|
-
from
|
|
252
|
-
timestamp
|
|
253
|
-
}
|
|
190
|
+
exports.EscrowEventResult = (0, graphql_tag_1.default) `
|
|
191
|
+
fragment EscrowEventResult on EscrowEvent {
|
|
192
|
+
txHash
|
|
193
|
+
eventName
|
|
194
|
+
from
|
|
195
|
+
timestamp
|
|
196
|
+
block
|
|
197
|
+
gasUsed
|
|
198
|
+
gasPrice
|
|
254
199
|
}
|
|
255
200
|
`;
|
|
256
201
|
exports.GetLastSyncedBlock = (0, graphql_tag_1.default) `
|
|
@@ -263,55 +208,25 @@ exports.GetLastSyncedBlock = (0, graphql_tag_1.default) `
|
|
|
263
208
|
}
|
|
264
209
|
}
|
|
265
210
|
`;
|
|
266
|
-
exports.GetPayments = (0, graphql_tag_1.default) `
|
|
267
|
-
query GetPayments($contractAddress: Bytes!, $reference: Bytes!, $tokenAddress: Bytes, $to: Bytes!) {
|
|
268
|
-
payments(
|
|
269
|
-
where: {contractAddress: $contractAddress, reference: $reference, tokenAddress: $tokenAddress, to: $to}
|
|
270
|
-
orderBy: timestamp
|
|
271
|
-
orderDirection: asc
|
|
272
|
-
) {
|
|
273
|
-
amount
|
|
274
|
-
block
|
|
275
|
-
txHash
|
|
276
|
-
feeAmount
|
|
277
|
-
feeAddress
|
|
278
|
-
from
|
|
279
|
-
timestamp
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
`;
|
|
283
211
|
exports.GetPaymentsAndEscrowState = (0, graphql_tag_1.default) `
|
|
284
|
-
query GetPaymentsAndEscrowState($
|
|
212
|
+
query GetPaymentsAndEscrowState($reference: Bytes!, $to: Bytes!) {
|
|
285
213
|
payments(
|
|
286
|
-
where: {
|
|
214
|
+
where: {reference: $reference, to: $to}
|
|
287
215
|
orderBy: timestamp
|
|
288
216
|
orderDirection: asc
|
|
289
217
|
) {
|
|
290
|
-
|
|
291
|
-
block
|
|
292
|
-
txHash
|
|
293
|
-
feeAmount
|
|
294
|
-
feeAddress
|
|
295
|
-
from
|
|
296
|
-
gasUsed
|
|
297
|
-
gasPrice
|
|
298
|
-
timestamp
|
|
218
|
+
...PaymentEventResult
|
|
299
219
|
}
|
|
300
220
|
escrowEvents(
|
|
301
221
|
where: {reference: $reference}
|
|
302
222
|
orderBy: timestamp
|
|
303
223
|
orderDirection: asc
|
|
304
224
|
) {
|
|
305
|
-
|
|
306
|
-
eventName
|
|
307
|
-
from
|
|
308
|
-
timestamp
|
|
309
|
-
block
|
|
310
|
-
gasUsed
|
|
311
|
-
gasPrice
|
|
225
|
+
...EscrowEventResult
|
|
312
226
|
}
|
|
313
227
|
}
|
|
314
|
-
|
|
228
|
+
${exports.PaymentEventResult}
|
|
229
|
+
${exports.EscrowEventResult}`;
|
|
315
230
|
exports.GetSyncedBlock = (0, graphql_tag_1.default) `
|
|
316
231
|
query GetSyncedBlock($blockHash: Bytes!) {
|
|
317
232
|
_meta(block: {hash: $blockHash}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/thegraph/generated/graphql.ts"],"names":[],"mappings":";;;AAEA,6CAA8B;AAyK9B,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,gCAAS,CAAA;IACT,0DAAmC,CAAA;IACnC,8CAAuB,CAAA;IACvB,wCAAiB,CAAA;IACjB,sCAAe,CAAA;IACf,8CAAuB,CAAA;IACvB,wCAAiB,CAAA;IACjB,8CAAuB,CAAA;IACvB,oCAAa,CAAA;IACb,0CAAmB,CAAA;IACnB,4CAAqB,CAAA;AACvB,CAAC,EAZW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAY9B;AAED,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,wCAAyB,CAAA;IACzB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AA8FD,IAAY,cAeX;AAfD,WAAY,cAAc;IACxB,2BAAS,CAAA;IACT,qDAAmC,CAAA;IACnC,6DAA2C,CAAA;IAC3C,yCAAuB,CAAA;IACvB,iDAA+B,CAAA;IAC/B,yDAAuC,CAAA;IACvC,6CAA2B,CAAA;IAC3B,+CAA6B,CAAA;IAC7B,mCAAiB,CAAA;IACjB,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,+BAAa,CAAA;IACb,2BAAS,CAAA;IACT,mCAAiB,CAAA;AACnB,CAAC,EAfW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAezB;AAED,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,sCAAyB,CAAA;IACzB,sCAAyB,CAAA;IACzB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,0CAA6B,CAAA;AAC/B,CAAC,EANW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAMpB;AAED,kEAAkE;AAClE,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,6BAAW,CAAA;IACX,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB;AA6JD,IAAY,eAmBX;AAnBD,WAAY,eAAe;IACzB,4BAAS,CAAA;IACT,sDAAmC,CAAA;IACnC,gDAA6B,CAAA;IAC7B,4BAAS,CAAA;IACT,gCAAa,CAAA;IACb,0CAAuB,CAAA;IACvB,kCAAe,CAAA;IACf,0CAAuB,CAAA;IACvB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;IACjB,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,oDAAiC,CAAA;IACjC,0DAAuC,CAAA;IACvC,sDAAmC,CAAA;AACrC,CAAC,EAnBW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAmB1B;AA0KD,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B,qEAAqE;IACrE,wCAAe,CAAA;IACf,8EAA8E;IAC9E,sCAAa,CAAA;AACf,CAAC,EALW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAKhC;
|
|
1
|
+
{"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/thegraph/generated/graphql.ts"],"names":[],"mappings":";;;AAEA,6CAA8B;AAyK9B,IA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E,CAAC,MAAM,CAAC,OAAO,CAA0B,kCAA0B,EAAE,SAAS,kCAAM,cAAc,GAAK,qBAAqB,EAAE,EAAE,oBAAoB,CAAC,CAAC;QACrM,CAAC;QACD,yBAAyB,CAAC,SAAkD,EAAE,cAA2C;YACvH,OAAO,WAAW,CAAC,CAAC,qBAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAiC,yCAAiC,EAAE,SAAS,kCAAM,cAAc,GAAK,qBAAqB,EAAE,EAAE,2BAA2B,CAAC,CAAC;QAC1N,CAAC;QACD,cAAc,CAAC,SAAuC,EAAE,cAA2C;YACjG,OAAO,WAAW,CAAC,CAAC,qBAAqB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAsB,8BAAsB,EAAE,SAAS,kCAAM,cAAc,GAAK,qBAAqB,EAAE,EAAE,gBAAgB,CAAC,CAAC;QACzL,CAAC;KACF,CAAC;AACJ,CAAC;AAZD,wBAYC;AAEY,QAAA,kBAAkB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;;;KAmBhC,CAAC;AACO,QAAA,iBAAiB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;KAU/B,CAAC;AACO,QAAA,kBAAkB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;KAShC,CAAC;AACO,QAAA,yBAAyB,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;MAiBtC,0BAAkB;EACtB,yBAAiB,EAAE,CAAC;AACT,QAAA,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;KAS5B,CAAC"}
|
package/dist/thegraph/index.d.ts
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A GraphQL client to query Request's subgraph.
|
|
5
|
-
*
|
|
6
|
-
* @type TGraphClientVariant: null if no variant, 'near' if native token payments detection on Near
|
|
7
|
-
*/
|
|
8
|
-
export declare type TheGraphClient<TGraphClientVariant extends 'near' | null = null> = TGraphClientVariant extends 'near' ? ReturnType<typeof getSdkNear> : ReturnType<typeof getSdk>;
|
|
9
|
-
export declare type TheGraphClientOptions = {
|
|
10
|
-
baseUrl?: string;
|
|
11
|
-
timeout?: number;
|
|
12
|
-
};
|
|
13
|
-
export declare const getTheGraphClient: (network: string, options?: TheGraphClientOptions | undefined) => TheGraphClient;
|
|
14
|
-
export declare const getTheGraphNearClient: (network: 'near' | 'near-testnet' | 'private', options?: TheGraphClientOptions | undefined) => TheGraphClient<'near'>;
|
|
15
|
-
export declare const networkSupportsTheGraph: (network: string) => boolean;
|
|
1
|
+
export * from './client';
|
|
2
|
+
export * from './info-retriever';
|
|
16
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/thegraph/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/thegraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
|
package/dist/thegraph/index.js
CHANGED
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const graphql_near_1 = require("./generated/graphql-near");
|
|
7
|
-
const BASE_URL = `https://api.thegraph.com`;
|
|
8
|
-
const getTheGraphClient = (network, options) => {
|
|
9
|
-
const baseUrl = (options === null || options === void 0 ? void 0 : options.baseUrl) || network === 'private' ? 'http://localhost:8000' : BASE_URL;
|
|
10
|
-
// Note: it is also possible to use the IPFS hash of the subgraph
|
|
11
|
-
// eg. /subgraphs/id/QmcCaSkefrmhe4xQj6Y6BBbHiFkbrn6UGDEBUWER7nt399
|
|
12
|
-
// which is a better security but would require an update of the
|
|
13
|
-
// library each time the subgraph is updated, which isn't ideal
|
|
14
|
-
// for early testing.
|
|
15
|
-
const url = `${baseUrl}/subgraphs/name/requestnetwork/request-payments-${network}`;
|
|
16
|
-
return (0, graphql_1.getSdk)(new graphql_request_1.GraphQLClient(url, options));
|
|
17
|
-
};
|
|
18
|
-
exports.getTheGraphClient = getTheGraphClient;
|
|
19
|
-
const getTheGraphNearClient = (network, options) => {
|
|
20
|
-
const baseUrl = (options === null || options === void 0 ? void 0 : options.baseUrl) || network === 'private' ? 'http://localhost:8000' : BASE_URL;
|
|
21
|
-
// Note: cf. getTheGraphClient for baseUrl
|
|
22
|
-
const url = `${baseUrl}/subgraphs/name/requestnetwork/request-payments-${network}`;
|
|
23
|
-
return (0, graphql_near_1.getSdk)(new graphql_request_1.GraphQLClient(url, options));
|
|
24
|
-
};
|
|
25
|
-
exports.getTheGraphNearClient = getTheGraphNearClient;
|
|
26
|
-
const networkSupportsTheGraph = (network) => {
|
|
27
|
-
return network !== 'private';
|
|
28
|
-
};
|
|
29
|
-
exports.networkSupportsTheGraph = networkSupportsTheGraph;
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
(0, tslib_1.__exportStar)(require("./client"), exports);
|
|
5
|
+
(0, tslib_1.__exportStar)(require("./info-retriever"), exports);
|
|
30
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/thegraph/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/thegraph/index.ts"],"names":[],"mappings":";;;AAAA,wDAAyB;AACzB,gEAAiC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PaymentTypes } from '@requestnetwork/types';
|
|
2
|
+
import { ICurrencyManager } from '@requestnetwork/currency';
|
|
3
|
+
import type { TheGraphClient } from '.';
|
|
4
|
+
declare type TransferEventsParams = {
|
|
5
|
+
/** The reference to identify the payment*/
|
|
6
|
+
paymentReference: string;
|
|
7
|
+
/** The recipient of the transfer */
|
|
8
|
+
toAddress: string;
|
|
9
|
+
/** The address of the payment proxy */
|
|
10
|
+
contractAddress: string;
|
|
11
|
+
/** The chain to check for payment */
|
|
12
|
+
paymentChain: string;
|
|
13
|
+
/** Indicates if it is an address for payment or refund */
|
|
14
|
+
eventName: PaymentTypes.EVENTS_NAMES;
|
|
15
|
+
/** The list of ERC20 tokens addresses accepted for payments and refunds */
|
|
16
|
+
acceptedTokens?: string[];
|
|
17
|
+
/** The the maximum span between the time the rate was fetched and the payment */
|
|
18
|
+
maxRateTimespan?: number;
|
|
19
|
+
};
|
|
20
|
+
export declare class TheGraphInfoRetriever {
|
|
21
|
+
private readonly client;
|
|
22
|
+
private readonly currencyManager;
|
|
23
|
+
constructor(client: TheGraphClient, currencyManager: ICurrencyManager);
|
|
24
|
+
getTransferEvents(params: TransferEventsParams): Promise<PaymentTypes.AllNetworkEvents<PaymentTypes.IERC20FeePaymentEventParameters>>;
|
|
25
|
+
private filterPaymentEvents;
|
|
26
|
+
private mapPaymentEvents;
|
|
27
|
+
private mapEscrowEvents;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=info-retriever.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-retriever.d.ts","sourceRoot":"","sources":["../../src/thegraph/info-retriever.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAIxC,aAAK,oBAAoB,GAAG;IAC1B,2CAA2C;IAC3C,gBAAgB,EAAE,MAAM,CAAC;IACzB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,SAAS,EAAE,YAAY,CAAC,YAAY,CAAC;IACrC,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,qBAAa,qBAAqB;IAE9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBADf,MAAM,EAAE,cAAc,EACtB,eAAe,EAAE,gBAAgB;IAGvC,iBAAiB,CAC5B,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC;IAiBvF,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,gBAAgB;IA4CxB,OAAO,CAAC,eAAe;CAexB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TheGraphInfoRetriever = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const types_1 = require("@requestnetwork/types");
|
|
6
|
+
const ethers_1 = require("ethers");
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
class TheGraphInfoRetriever {
|
|
10
|
+
constructor(client, currencyManager) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
this.currencyManager = currencyManager;
|
|
13
|
+
}
|
|
14
|
+
getTransferEvents(params) {
|
|
15
|
+
var _a;
|
|
16
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
17
|
+
const { payments, escrowEvents } = yield this.client.GetPaymentsAndEscrowState({
|
|
18
|
+
reference: ethers_1.utils.keccak256(`0x${params.paymentReference}`),
|
|
19
|
+
to: params.toAddress,
|
|
20
|
+
});
|
|
21
|
+
params.contractAddress = (0, utils_1.formatAddress)(params.contractAddress, 'contractAddress');
|
|
22
|
+
params.acceptedTokens =
|
|
23
|
+
((_a = params.acceptedTokens) === null || _a === void 0 ? void 0 : _a.map((tok) => (0, utils_1.formatAddress)(tok, 'acceptedTokens'))) || [];
|
|
24
|
+
return {
|
|
25
|
+
paymentEvents: payments
|
|
26
|
+
.filter((payment) => this.filterPaymentEvents(payment, params))
|
|
27
|
+
.map((payment) => this.mapPaymentEvents(payment, params)),
|
|
28
|
+
escrowEvents: escrowEvents.map((escrow) => this.mapEscrowEvents(escrow, params)),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
filterPaymentEvents(payment, params) {
|
|
33
|
+
var _a;
|
|
34
|
+
// Check contract address matches expected
|
|
35
|
+
if ((0, utils_1.formatAddress)(payment.contractAddress) !== params.contractAddress) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
// Check paid token tokens matches expected (conversion only)
|
|
39
|
+
if (payment.tokenAddress &&
|
|
40
|
+
!((_a = params.acceptedTokens) === null || _a === void 0 ? void 0 : _a.includes((0, utils_1.formatAddress)(payment.tokenAddress, 'tokenAddress')))) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
// Check payment was done within expected delays (conversion only)
|
|
44
|
+
if (payment.maxRateTimespan !== undefined &&
|
|
45
|
+
payment.maxRateTimespan !== null &&
|
|
46
|
+
params.maxRateTimespan !== undefined &&
|
|
47
|
+
payment.maxRateTimespan < params.maxRateTimespan) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
mapPaymentEvents(payment, params) {
|
|
53
|
+
let amount = payment.amount;
|
|
54
|
+
let feeAmount = payment.feeAmount;
|
|
55
|
+
if (payment.currency) {
|
|
56
|
+
// account for the possibility the searched currency is of type ISO4217 and has no network
|
|
57
|
+
const ccy = this.currencyManager.fromHash(payment.currency, params.paymentChain) ||
|
|
58
|
+
this.currencyManager.fromHash(payment.currency);
|
|
59
|
+
if (!ccy) {
|
|
60
|
+
throw new Error(`Currency with hash ${payment.currency} is unknown`);
|
|
61
|
+
}
|
|
62
|
+
amount = (0, utils_1.unpadAmountFromChainlink)(amount, ccy).toString();
|
|
63
|
+
feeAmount = (0, utils_1.unpadAmountFromChainlink)(feeAmount, ccy).toString();
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
amount,
|
|
67
|
+
name: params.eventName,
|
|
68
|
+
timestamp: payment.timestamp,
|
|
69
|
+
parameters: Object.assign(Object.assign({ feeAmount, block: payment.block, to: (0, utils_1.formatAddress)(payment.to, 'to') }, (0, lodash_1.mapValues)((0, lodash_1.pick)(payment, 'txHash', 'gasUsed', 'gasPrice', 'amountInCrypto', 'feeAmountInCrypto', 'maxRateTimespan'), String)), (0, lodash_1.mapValues)((0, lodash_1.pick)(payment, 'from', 'feeAddress', 'tokenAddress'), (str, key) => str ? (0, utils_1.formatAddress)(str, key) : undefined)),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
mapEscrowEvents(escrow, params) {
|
|
73
|
+
return {
|
|
74
|
+
name: types_1.PaymentTypes.EVENTS_NAMES.ESCROW,
|
|
75
|
+
timestamp: escrow.timestamp,
|
|
76
|
+
parameters: {
|
|
77
|
+
to: params.toAddress,
|
|
78
|
+
from: escrow.from,
|
|
79
|
+
txHash: escrow.txHash,
|
|
80
|
+
block: escrow.block,
|
|
81
|
+
eventName: escrow.eventName,
|
|
82
|
+
gasUsed: escrow.gasUsed,
|
|
83
|
+
gasPrice: escrow.gasPrice,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.TheGraphInfoRetriever = TheGraphInfoRetriever;
|
|
89
|
+
//# sourceMappingURL=info-retriever.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-retriever.js","sourceRoot":"","sources":["../../src/thegraph/info-retriever.ts"],"names":[],"mappings":";;;;AAAA,iDAAqD;AAErD,mCAA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AAE,OAAO,CAAC,SAAS;YAC5B,UAAU,gCACR,SAAS,EACT,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,EAAE,EAAE,IAAA,qBAAa,EAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,IAChC,IAAA,kBAAS,EACV,IAAA,aAAI,EACF,OAAO,EACP,QAAQ,EACR,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,CAClB,EACD,MAAM,CACP,GAEE,IAAA,kBAAS,EAAC,IAAA,aAAI,EAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAC7E,GAAG,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAC1C,CACF;SACF,CAAC;IACJ,CAAC;IAEO,eAAe,CAAC,MAAiC,EAAE,MAA4B;QACrF,OAAO;YACL,IAAI,EAAE,oBAAY,CAAC,YAAY,CAAC,MAAM;YACtC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE;gBACV,EAAE,EAAE,MAAM,CAAC,SAAS;gBACpB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B;SACF,CAAC;IACJ,CAAC;CACF;AA5GD,sDA4GC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { PaymentTypes } from '@requestnetwork/types';
|
|
1
|
+
import type { AdvancedLogicTypes, PaymentTypes } from '@requestnetwork/types';
|
|
2
|
+
import type { ICurrencyManager } from '@requestnetwork/currency';
|
|
3
|
+
import type { providers } from 'ethers';
|
|
4
|
+
import type { TheGraphClient } from './thegraph';
|
|
2
5
|
/** Generic info retriever interface */
|
|
3
6
|
export interface IPaymentRetriever<TPaymentNetworkEvent extends PaymentTypes.IPaymentNetworkEvent<unknown, TEventNames>, TEventNames = PaymentTypes.EVENTS_NAMES> {
|
|
4
7
|
getTransferEvents(): Promise<TPaymentNetworkEvent[]>;
|
|
@@ -22,4 +25,18 @@ export interface ISupportedPaymentNetworkByNetwork {
|
|
|
22
25
|
export interface ISupportedPaymentNetworkByCurrency {
|
|
23
26
|
[currency: string]: ISupportedPaymentNetworkByNetwork;
|
|
24
27
|
}
|
|
28
|
+
export declare type PaymentNetworkOptions = {
|
|
29
|
+
/** override default bitcoin detection provider */
|
|
30
|
+
bitcoinDetectionProvider?: PaymentTypes.IBitcoinDetectionProvider;
|
|
31
|
+
/** the explorer API (eg Etherscan) api keys, for PNs that rely on it. Record by network name */
|
|
32
|
+
explorerApiKeys: Record<string, string>;
|
|
33
|
+
/** override the default Subgraph for payment detection (EVM, Near) */
|
|
34
|
+
getSubgraphClient: (network: string) => TheGraphClient | undefined;
|
|
35
|
+
/** override the default RPC provider (EVM) */
|
|
36
|
+
getRpcProvider: (network: string) => providers.Provider;
|
|
37
|
+
};
|
|
38
|
+
export declare type ReferenceBasedDetectorOptions = {
|
|
39
|
+
advancedLogic: AdvancedLogicTypes.IAdvancedLogic;
|
|
40
|
+
currencyManager: ICurrencyManager;
|
|
41
|
+
};
|
|
25
42
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE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E,iGAAiG;IACjG,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,sEAAsE;IACtE,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,cAAc,GAAG,SAAS,CAAC;IACnE,8CAA8C;IAC9C,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,CAAC,QAAQ,CAAC;CACzD,CAAC;AAEF,oBAAY,6BAA6B,GAAG;IAC1C,aAAa,EAAE,kBAAkB,CAAC,cAAc,CAAC;IACjD,eAAe,EAAE,gBAAgB,CAAC;CACnC,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -30,4 +30,9 @@ export declare const calculateEscrowState: (escrowEvents: PaymentTypes.EscrowNet
|
|
|
30
30
|
export declare function getPaymentNetworkExtension(request: Pick<RequestLogicTypes.IRequest, 'extensions'>): ExtensionTypes.IState | undefined;
|
|
31
31
|
/** Gets a payment (or refund) reference for any type of Request */
|
|
32
32
|
export declare function getPaymentReference(request: Pick<RequestLogicTypes.IRequest, 'extensions' | 'requestId'>, event?: PaymentTypes.EVENTS_NAMES): string | undefined;
|
|
33
|
+
/** Alias to ethers.utils.getAddress that adds the key to error message, and supports nullish values */
|
|
34
|
+
export declare const formatAddress: {
|
|
35
|
+
(address: string | null | undefined, key?: string, allowsUndefined?: false): string;
|
|
36
|
+
(address: string | null | undefined, key?: string, allowsUndefined?: true): string | undefined;
|
|
37
|
+
};
|
|
33
38
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,YAAY,EAA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B,CACxC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,CAAC,GACtD,cAAc,CAAC,MAAM,GAAG,SAAS,CAInC;AAgBD,mEAAmE;AACnE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,WAAW,CAAC,EACrE,KAAK,GAAE,YAAY,CAAC,YAAgD,GACnE,MAAM,GAAG,SAAS,CAapB;AAED,uGAAuG;AACvG,eAAO,MAAM,aAAa,EAAE;IAC1B,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACpF,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;CAahG,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPaymentReference = exports.getPaymentNetworkExtension = exports.calculateEscrowState = exports.hashReference = exports.makeGetDeploymentInformation = exports.unpadAmountFromChainlink = exports.padAmountForChainlink = exports.parseLogArgs = void 0;
|
|
3
|
+
exports.formatAddress = exports.getPaymentReference = exports.getPaymentNetworkExtension = exports.calculateEscrowState = exports.hashReference = exports.makeGetDeploymentInformation = exports.unpadAmountFromChainlink = exports.padAmountForChainlink = exports.parseLogArgs = void 0;
|
|
4
4
|
const types_1 = require("@requestnetwork/types");
|
|
5
5
|
const ethers_1 = require("ethers");
|
|
6
6
|
const utils_1 = require("ethers/lib/utils");
|
|
@@ -126,4 +126,20 @@ function getPaymentReference(request, event = types_1.PaymentTypes.EVENTS_NAMES.
|
|
|
126
126
|
return payment_reference_calculator_1.default.calculate(requestId, salt, info);
|
|
127
127
|
}
|
|
128
128
|
exports.getPaymentReference = getPaymentReference;
|
|
129
|
+
/** Alias to ethers.utils.getAddress that adds the key to error message, and supports nullish values */
|
|
130
|
+
const formatAddress = (address, key, allowsUndefined = false) => {
|
|
131
|
+
if (!address && allowsUndefined)
|
|
132
|
+
return undefined;
|
|
133
|
+
try {
|
|
134
|
+
return (0, utils_1.getAddress)(address || '');
|
|
135
|
+
}
|
|
136
|
+
catch (e) {
|
|
137
|
+
ethers_1.logger.throwError('invalid address', ethers_1.errors.INVALID_ARGUMENT, {
|
|
138
|
+
argument: 'address',
|
|
139
|
+
value: address,
|
|
140
|
+
key,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
exports.formatAddress = formatAddress;
|
|
129
145
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACA,iDAAwF;AACxF,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACA,iDAAwF;AACxF,mCAA2E;AAC3E,4CAAyE;AAEzE,mDAA2E;AAC3E,iFAAwE;AAExE;;GAEG;AACI,MAAM,YAAY,GAAG,CAAI,EAAE,IAAI,EAAE,aAAa,EAAkB,EAAK,EAAE;IAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AALW,QAAA,YAAY,gBAKvB;AAEF;;GAEG;AACI,MAAM,qBAAqB,GAAG,CACnC,MAAoB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