@armory-sh/client-ethers 0.2.0 → 0.2.1
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/index.d.ts +1 -1
- package/dist/index.js +14 -32
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PaymentRequirements, CAIP2ChainId, CAIPAssetId, CustomToken } from '@armory-sh/base';
|
|
2
|
-
export { Address, BalanceOfParams, CAIP2ChainId, CAIPAssetId, EIP712_TYPES, ERC20_ABI, Extensions, NETWORKS, NetworkConfig, PayToV2, PaymentPayload, PaymentPayloadV1, PaymentPayloadV2, PaymentRequirements, PaymentRequirementsV1, PaymentRequirementsV2, SettlementResponse, SettlementResponseV1, SettlementResponseV2, Signature, TransferWithAuthorizationParams, V1_HEADERS, V2_HEADERS, createEIP712Domain, createTransferWithAuthorization, decodePayment,
|
|
2
|
+
export { Address, BalanceOfParams, CAIP2ChainId, CAIPAssetId, EIP712_TYPES, ERC20_ABI, Extensions, NETWORKS, NetworkConfig, PayToV2, PaymentPayload, PaymentPayloadV1, PaymentPayloadV2, PaymentRequirements, PaymentRequirementsV1, PaymentRequirementsV2, SettlementResponse, SettlementResponseV1, SettlementResponseV2, Signature, TransferWithAuthorizationParams, V1_HEADERS, V2_HEADERS, createEIP712Domain, createTransferWithAuthorization, decodePayment, decodePaymentV1, decodePaymentV2, decodeSettlementLegacy, decodeSettlementV1, decodeSettlementV2, detectPaymentVersion, encodePaymentV1, encodePaymentV2, encodeSettlementV1, encodeSettlementV2, getMainnets, getNetworkByChainId, getNetworkConfig, getPaymentHeaderName, getPaymentRequiredHeaderName, getPaymentResponseHeaderName, getPaymentVersion, getRequirementsVersion, getSettlementVersion, getTestnets, getTxHash, isAddress, isCAIP2ChainId, isCAIPAssetId, isPaymentV1, isPaymentV2, isSettlementSuccessful, isSettlementV1, isSettlementV2, isV1, isV2, validateTransferWithAuthorization } from '@armory-sh/base';
|
|
3
3
|
import { Signer, Provider } from 'ethers';
|
|
4
4
|
export { Signer } from 'ethers';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -1,38 +1,23 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import {
|
|
3
3
|
V1_HEADERS as V1_HEADERS2,
|
|
4
|
-
encodePaymentPayload,
|
|
5
|
-
decodePaymentPayload,
|
|
6
|
-
encodeSettlementResponse,
|
|
7
|
-
decodeSettlementResponse
|
|
8
|
-
} from "@armory-sh/base";
|
|
9
|
-
import {
|
|
10
4
|
V2_HEADERS as V2_HEADERS2,
|
|
11
|
-
isCAIP2ChainId,
|
|
12
|
-
isCAIPAssetId,
|
|
13
|
-
isAddress
|
|
14
|
-
} from "@armory-sh/base";
|
|
15
|
-
import {
|
|
16
5
|
isV1,
|
|
17
6
|
isV2,
|
|
18
|
-
|
|
7
|
+
getPaymentVersion,
|
|
19
8
|
getRequirementsVersion,
|
|
20
9
|
getSettlementVersion,
|
|
21
10
|
getPaymentHeaderName,
|
|
22
11
|
getPaymentResponseHeaderName,
|
|
23
12
|
getPaymentRequiredHeaderName,
|
|
24
13
|
isSettlementSuccessful,
|
|
25
|
-
getTxHash
|
|
26
|
-
} from "@armory-sh/base";
|
|
27
|
-
import {
|
|
14
|
+
getTxHash,
|
|
28
15
|
NETWORKS,
|
|
29
16
|
getNetworkConfig,
|
|
30
17
|
getNetworkByChainId as getNetworkByChainId2,
|
|
31
18
|
getMainnets,
|
|
32
|
-
getTestnets
|
|
33
|
-
|
|
34
|
-
import { ERC20_ABI } from "@armory-sh/base";
|
|
35
|
-
import {
|
|
19
|
+
getTestnets,
|
|
20
|
+
ERC20_ABI,
|
|
36
21
|
encodePaymentV1 as encodePaymentV12,
|
|
37
22
|
decodePaymentV1,
|
|
38
23
|
encodeSettlementV1,
|
|
@@ -43,17 +28,18 @@ import {
|
|
|
43
28
|
decodeSettlementV2,
|
|
44
29
|
detectPaymentVersion,
|
|
45
30
|
decodePayment,
|
|
46
|
-
|
|
31
|
+
decodeSettlementLegacy as decodeSettlementLegacy2,
|
|
47
32
|
isPaymentV1,
|
|
48
33
|
isPaymentV2,
|
|
49
34
|
isSettlementV1,
|
|
50
|
-
isSettlementV2
|
|
51
|
-
} from "@armory-sh/base";
|
|
52
|
-
import {
|
|
35
|
+
isSettlementV2,
|
|
53
36
|
EIP712_TYPES,
|
|
54
37
|
createEIP712Domain as createEIP712Domain2,
|
|
55
38
|
createTransferWithAuthorization,
|
|
56
|
-
validateTransferWithAuthorization
|
|
39
|
+
validateTransferWithAuthorization,
|
|
40
|
+
isCAIP2ChainId,
|
|
41
|
+
isCAIPAssetId,
|
|
42
|
+
isAddress
|
|
57
43
|
} from "@armory-sh/base";
|
|
58
44
|
|
|
59
45
|
// src/protocol.ts
|
|
@@ -249,7 +235,7 @@ async function parsePaymentRequirements(response) {
|
|
|
249
235
|
|
|
250
236
|
// src/transport.ts
|
|
251
237
|
import {
|
|
252
|
-
|
|
238
|
+
decodeSettlementLegacy
|
|
253
239
|
} from "@armory-sh/base";
|
|
254
240
|
var defaultConfig = {
|
|
255
241
|
baseURL: "",
|
|
@@ -299,7 +285,7 @@ var handlePaymentRequired = async (state, response) => {
|
|
|
299
285
|
},
|
|
300
286
|
state.config.timeout
|
|
301
287
|
);
|
|
302
|
-
return { success: true, settlement:
|
|
288
|
+
return { success: true, settlement: decodeSettlementLegacy(paymentResponse.headers) };
|
|
303
289
|
} catch (error) {
|
|
304
290
|
return { success: false, error: error instanceof Error ? error : new Error(String(error)) };
|
|
305
291
|
}
|
|
@@ -371,19 +357,15 @@ export {
|
|
|
371
357
|
createTransferWithAuthorization,
|
|
372
358
|
createX402Transport,
|
|
373
359
|
decodePayment,
|
|
374
|
-
decodePaymentPayload,
|
|
375
360
|
decodePaymentV1,
|
|
376
361
|
decodePaymentV2,
|
|
377
|
-
|
|
378
|
-
decodeSettlementResponse,
|
|
362
|
+
decodeSettlementLegacy2 as decodeSettlementLegacy,
|
|
379
363
|
decodeSettlementV1,
|
|
380
364
|
decodeSettlementV2,
|
|
381
365
|
detectPaymentVersion,
|
|
382
366
|
detectProtocolVersion,
|
|
383
|
-
encodePaymentPayload,
|
|
384
367
|
encodePaymentV12 as encodePaymentV1,
|
|
385
368
|
encodePaymentV22 as encodePaymentV2,
|
|
386
|
-
encodeSettlementResponse,
|
|
387
369
|
encodeSettlementV1,
|
|
388
370
|
encodeSettlementV2,
|
|
389
371
|
getMainnets,
|
|
@@ -392,7 +374,7 @@ export {
|
|
|
392
374
|
getPaymentHeaderName,
|
|
393
375
|
getPaymentRequiredHeaderName,
|
|
394
376
|
getPaymentResponseHeaderName,
|
|
395
|
-
|
|
377
|
+
getPaymentVersion,
|
|
396
378
|
getRequirementsVersion,
|
|
397
379
|
getSettlementVersion,
|
|
398
380
|
getTestnets,
|