@funkit/api-base 0.0.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.
Files changed (134) hide show
  1. package/.eslintignore +5 -0
  2. package/README.md +1 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.js +21 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/src/consts/api.d.ts +1 -0
  7. package/dist/src/consts/api.js +12 -0
  8. package/dist/src/consts/api.js.map +1 -0
  9. package/dist/src/consts/index.d.ts +3 -0
  10. package/dist/src/consts/index.js +20 -0
  11. package/dist/src/consts/index.js.map +1 -0
  12. package/dist/src/consts/request.d.ts +13 -0
  13. package/dist/src/consts/request.js +3 -0
  14. package/dist/src/consts/request.js.map +1 -0
  15. package/dist/src/consts/retry.d.ts +4 -0
  16. package/dist/src/consts/retry.js +19 -0
  17. package/dist/src/consts/retry.js.map +1 -0
  18. package/dist/src/errors/BaseError.d.ts +9 -0
  19. package/dist/src/errors/BaseError.js +24 -0
  20. package/dist/src/errors/BaseError.js.map +1 -0
  21. package/dist/src/errors/ClientError.d.ts +22 -0
  22. package/dist/src/errors/ClientError.js +76 -0
  23. package/dist/src/errors/ClientError.js.map +1 -0
  24. package/dist/src/errors/ServerError.d.ts +7 -0
  25. package/dist/src/errors/ServerError.js +18 -0
  26. package/dist/src/errors/ServerError.js.map +1 -0
  27. package/dist/src/errors/errors.json +626 -0
  28. package/dist/src/errors/index.d.ts +4 -0
  29. package/dist/src/errors/index.js +21 -0
  30. package/dist/src/errors/index.js.map +1 -0
  31. package/dist/src/errors/types.d.ts +60 -0
  32. package/dist/src/errors/types.js +51 -0
  33. package/dist/src/errors/types.js.map +1 -0
  34. package/dist/src/services/assets/endpoints.d.ts +50 -0
  35. package/dist/src/services/assets/endpoints.js +95 -0
  36. package/dist/src/services/assets/endpoints.js.map +1 -0
  37. package/dist/src/services/assets/index.d.ts +2 -0
  38. package/dist/src/services/assets/index.js +19 -0
  39. package/dist/src/services/assets/index.js.map +1 -0
  40. package/dist/src/services/assets/types.d.ts +65 -0
  41. package/dist/src/services/assets/types.js +3 -0
  42. package/dist/src/services/assets/types.js.map +1 -0
  43. package/dist/src/services/checkout/endpoints.d.ts +55 -0
  44. package/dist/src/services/checkout/endpoints.js +169 -0
  45. package/dist/src/services/checkout/endpoints.js.map +1 -0
  46. package/dist/src/services/checkout/index.d.ts +2 -0
  47. package/dist/src/services/checkout/index.js +19 -0
  48. package/dist/src/services/checkout/index.js.map +1 -0
  49. package/dist/src/services/checkout/types.d.ts +106 -0
  50. package/dist/src/services/checkout/types.js +21 -0
  51. package/dist/src/services/checkout/types.js.map +1 -0
  52. package/dist/src/services/index.d.ts +4 -0
  53. package/dist/src/services/index.js +21 -0
  54. package/dist/src/services/index.js.map +1 -0
  55. package/dist/src/services/mesh/endpoints.d.ts +45 -0
  56. package/dist/src/services/mesh/endpoints.js +129 -0
  57. package/dist/src/services/mesh/endpoints.js.map +1 -0
  58. package/dist/src/services/mesh/index.d.ts +2 -0
  59. package/dist/src/services/mesh/index.js +19 -0
  60. package/dist/src/services/mesh/index.js.map +1 -0
  61. package/dist/src/services/mesh/types.d.ts +56 -0
  62. package/dist/src/services/mesh/types.js +3 -0
  63. package/dist/src/services/mesh/types.js.map +1 -0
  64. package/dist/src/services/moonpay/endpoints.d.ts +3 -0
  65. package/dist/src/services/moonpay/endpoints.js +43 -0
  66. package/dist/src/services/moonpay/endpoints.js.map +1 -0
  67. package/dist/src/services/moonpay/index.d.ts +2 -0
  68. package/dist/src/services/moonpay/index.js +19 -0
  69. package/dist/src/services/moonpay/index.js.map +1 -0
  70. package/dist/src/services/moonpay/types.d.ts +14 -0
  71. package/dist/src/services/moonpay/types.js +3 -0
  72. package/dist/src/services/moonpay/types.js.map +1 -0
  73. package/dist/src/utils/checkout.d.ts +2 -0
  74. package/dist/src/utils/checkout.js +20 -0
  75. package/dist/src/utils/checkout.js.map +1 -0
  76. package/dist/src/utils/error.d.ts +1 -0
  77. package/dist/src/utils/error.js +13 -0
  78. package/dist/src/utils/error.js.map +1 -0
  79. package/dist/src/utils/index.d.ts +3 -0
  80. package/dist/src/utils/index.js +20 -0
  81. package/dist/src/utils/index.js.map +1 -0
  82. package/dist/src/utils/request.d.ts +7 -0
  83. package/dist/src/utils/request.js +128 -0
  84. package/dist/src/utils/request.js.map +1 -0
  85. package/dist/test/services/assets.test.d.ts +1 -0
  86. package/dist/test/services/assets.test.js +37 -0
  87. package/dist/test/services/assets.test.js.map +1 -0
  88. package/dist/test/services/checkout.test.d.ts +1 -0
  89. package/dist/test/services/checkout.test.js +42 -0
  90. package/dist/test/services/checkout.test.js.map +1 -0
  91. package/dist/test/services/mesh.test.d.ts +1 -0
  92. package/dist/test/services/mesh.test.js +12 -0
  93. package/dist/test/services/mesh.test.js.map +1 -0
  94. package/dist/test/services/moonpay.test.d.ts +1 -0
  95. package/dist/test/services/moonpay.test.js +25 -0
  96. package/dist/test/services/moonpay.test.js.map +1 -0
  97. package/dist/test/setup.d.ts +0 -0
  98. package/dist/test/setup.js +10 -0
  99. package/dist/test/setup.js.map +1 -0
  100. package/index.ts +4 -0
  101. package/package.json +37 -0
  102. package/src/consts/api.ts +9 -0
  103. package/src/consts/index.ts +3 -0
  104. package/src/consts/request.ts +16 -0
  105. package/src/consts/retry.ts +21 -0
  106. package/src/errors/BaseError.ts +28 -0
  107. package/src/errors/ClientError.ts +175 -0
  108. package/src/errors/ServerError.ts +43 -0
  109. package/src/errors/errors.json +626 -0
  110. package/src/errors/index.ts +4 -0
  111. package/src/errors/types.ts +64 -0
  112. package/src/services/assets/endpoints.ts +131 -0
  113. package/src/services/assets/index.ts +2 -0
  114. package/src/services/assets/types.ts +80 -0
  115. package/src/services/checkout/endpoints.ts +233 -0
  116. package/src/services/checkout/index.ts +2 -0
  117. package/src/services/checkout/types.ts +130 -0
  118. package/src/services/index.ts +4 -0
  119. package/src/services/mesh/endpoints.ts +164 -0
  120. package/src/services/mesh/index.ts +2 -0
  121. package/src/services/mesh/types.ts +63 -0
  122. package/src/services/moonpay/endpoints.ts +62 -0
  123. package/src/services/moonpay/index.ts +2 -0
  124. package/src/services/moonpay/types.ts +15 -0
  125. package/src/utils/checkout.ts +17 -0
  126. package/src/utils/error.ts +15 -0
  127. package/src/utils/index.ts +3 -0
  128. package/src/utils/request.ts +198 -0
  129. package/test/services/assets.test.ts +41 -0
  130. package/test/services/checkout.test.ts +53 -0
  131. package/test/services/mesh.test.ts +10 -0
  132. package/test/services/moonpay.test.ts +24 -0
  133. package/test/setup.ts +9 -0
  134. package/tsconfig.json +33 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/errors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,gDAA6B;AAC7B,gDAA6B;AAC7B,0CAAuB"}
@@ -0,0 +1,60 @@
1
+ export type ErrorData = {
2
+ location: string;
3
+ error?: {
4
+ txDetails?: ErrorTransactionDetails;
5
+ reasonData?: {
6
+ title: string;
7
+ reasons: string[];
8
+ };
9
+ };
10
+ };
11
+ export type ErrorTransactionDetails = {
12
+ method: string;
13
+ params: any[];
14
+ contractAddress?: string;
15
+ chainId?: number | string;
16
+ };
17
+ export declare enum ErrorBaseType {
18
+ ClientError = "ClientError",
19
+ ServerError = "ServerError"
20
+ }
21
+ export declare enum ErrorType {
22
+ InvalidParameter = "InvalidParameter",
23
+ InternalServerFailure = "InternalServerFailure",
24
+ ResourceNotFound = "ResourceNotFound",
25
+ InvalidAction = "InvalidAction",
26
+ ThrottlingError = "ThrottlingError",
27
+ AccessDeniedError = "AccessDeniedError",
28
+ UserOpFailureError = "UserOpFailureError"
29
+ }
30
+ export declare enum ErrorCode {
31
+ MissingParameter = "MissingParameter",
32
+ InvalidParameter = "InvalidParameter",
33
+ InvalidThreshold = "InvalidThreshold",
34
+ InvalidChainIdentifier = "InvalidChainIdentifier",
35
+ InvalidNFTIdentifier = "InvalidNFTIdentifier",
36
+ InsufficientSignatures = "InsufficientSignatures",
37
+ InvalidParameterCombination = "InvalidParameterCombination",
38
+ CheckPointHintsNotFound = "CheckPointHintsNotFound",
39
+ GroupNotFound = "GroupNotFound",
40
+ TokenNotFound = "TokenNotFound",
41
+ AddressNotFound = "AddressNotFound",
42
+ UserAlreadyExists = "UserAlreadyExists",
43
+ UserNotFound = "UserNotFound",
44
+ ChainNotSupported = "ChainNotSupported",
45
+ ServerMissingData = "ServerMissingData",
46
+ ServerFailure = "ServerFailure",
47
+ ServerTimeout = "ServerTimeout",
48
+ UnknownServerError = "UnknownServerError",
49
+ ServerConnectionError = "ServerConnectionError",
50
+ UserOpFailureError = "UserOpFailureError",
51
+ Unauthorized = "Unauthorized",
52
+ RequestLimitExceeded = "RequestLimitExceeded",
53
+ WalletPrefundError = "PrefundError",
54
+ GasSponsorFundError = "GasSponsorFundError",
55
+ FunWalletErrorCode = "FunWalletErrorCode",
56
+ BridgeRouteNotFound = "BridgeRouteNotFound",
57
+ BridgeAllowanceDataNotFound = "BridgeAllowanceDataNotFound",
58
+ BridgeApproveTxDataNotFound = "BridgeApproveTxDataNotFound",
59
+ CheckoutInitDepositAddrNotFound = "CheckoutInitDepositAddrNotFound"
60
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorCode = exports.ErrorType = exports.ErrorBaseType = void 0;
4
+ var ErrorBaseType;
5
+ (function (ErrorBaseType) {
6
+ ErrorBaseType["ClientError"] = "ClientError";
7
+ ErrorBaseType["ServerError"] = "ServerError";
8
+ })(ErrorBaseType || (exports.ErrorBaseType = ErrorBaseType = {}));
9
+ var ErrorType;
10
+ (function (ErrorType) {
11
+ ErrorType["InvalidParameter"] = "InvalidParameter";
12
+ ErrorType["InternalServerFailure"] = "InternalServerFailure";
13
+ ErrorType["ResourceNotFound"] = "ResourceNotFound";
14
+ ErrorType["InvalidAction"] = "InvalidAction";
15
+ ErrorType["ThrottlingError"] = "ThrottlingError";
16
+ ErrorType["AccessDeniedError"] = "AccessDeniedError";
17
+ ErrorType["UserOpFailureError"] = "UserOpFailureError";
18
+ })(ErrorType || (exports.ErrorType = ErrorType = {}));
19
+ var ErrorCode;
20
+ (function (ErrorCode) {
21
+ ErrorCode["MissingParameter"] = "MissingParameter";
22
+ ErrorCode["InvalidParameter"] = "InvalidParameter";
23
+ ErrorCode["InvalidThreshold"] = "InvalidThreshold";
24
+ ErrorCode["InvalidChainIdentifier"] = "InvalidChainIdentifier";
25
+ ErrorCode["InvalidNFTIdentifier"] = "InvalidNFTIdentifier";
26
+ ErrorCode["InsufficientSignatures"] = "InsufficientSignatures";
27
+ ErrorCode["InvalidParameterCombination"] = "InvalidParameterCombination";
28
+ ErrorCode["CheckPointHintsNotFound"] = "CheckPointHintsNotFound";
29
+ ErrorCode["GroupNotFound"] = "GroupNotFound";
30
+ ErrorCode["TokenNotFound"] = "TokenNotFound";
31
+ ErrorCode["AddressNotFound"] = "AddressNotFound";
32
+ ErrorCode["UserAlreadyExists"] = "UserAlreadyExists";
33
+ ErrorCode["UserNotFound"] = "UserNotFound";
34
+ ErrorCode["ChainNotSupported"] = "ChainNotSupported";
35
+ ErrorCode["ServerMissingData"] = "ServerMissingData";
36
+ ErrorCode["ServerFailure"] = "ServerFailure";
37
+ ErrorCode["ServerTimeout"] = "ServerTimeout";
38
+ ErrorCode["UnknownServerError"] = "UnknownServerError";
39
+ ErrorCode["ServerConnectionError"] = "ServerConnectionError";
40
+ ErrorCode["UserOpFailureError"] = "UserOpFailureError";
41
+ ErrorCode["Unauthorized"] = "Unauthorized";
42
+ ErrorCode["RequestLimitExceeded"] = "RequestLimitExceeded";
43
+ ErrorCode["WalletPrefundError"] = "PrefundError";
44
+ ErrorCode["GasSponsorFundError"] = "GasSponsorFundError";
45
+ ErrorCode["FunWalletErrorCode"] = "FunWalletErrorCode";
46
+ ErrorCode["BridgeRouteNotFound"] = "BridgeRouteNotFound";
47
+ ErrorCode["BridgeAllowanceDataNotFound"] = "BridgeAllowanceDataNotFound";
48
+ ErrorCode["BridgeApproveTxDataNotFound"] = "BridgeApproveTxDataNotFound";
49
+ ErrorCode["CheckoutInitDepositAddrNotFound"] = "CheckoutInitDepositAddrNotFound";
50
+ })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
51
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/errors/types.ts"],"names":[],"mappings":";;;AAkBA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;AAC7B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,kDAAqC,CAAA;IACrC,4DAA+C,CAAA;IAC/C,kDAAqC,CAAA;IACrC,4CAA+B,CAAA;IAC/B,gDAAmC,CAAA;IACnC,oDAAuC,CAAA;IACvC,sDAAyC,CAAA;AAC3C,CAAC,EARW,SAAS,yBAAT,SAAS,QAQpB;AAED,IAAY,SA8BX;AA9BD,WAAY,SAAS;IACnB,kDAAqC,CAAA;IACrC,kDAAqC,CAAA;IACrC,kDAAqC,CAAA;IACrC,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,8DAAiD,CAAA;IACjD,wEAA2D,CAAA;IAC3D,gEAAmD,CAAA;IACnD,4CAA+B,CAAA;IAC/B,4CAA+B,CAAA;IAC/B,gDAAmC,CAAA;IACnC,oDAAuC,CAAA;IACvC,0CAA6B,CAAA;IAC7B,oDAAuC,CAAA;IACvC,oDAAuC,CAAA;IACvC,4CAA+B,CAAA;IAC/B,4CAA+B,CAAA;IAC/B,sDAAyC,CAAA;IACzC,4DAA+C,CAAA;IAC/C,sDAAyC,CAAA;IACzC,0CAA6B,CAAA;IAC7B,0DAA6C,CAAA;IAC7C,gDAAmC,CAAA;IACnC,wDAA2C,CAAA;IAC3C,sDAAyC,CAAA;IACzC,wDAA2C,CAAA;IAC3C,wEAA2D,CAAA;IAC3D,wEAA2D,CAAA;IAC3D,gFAAmE,CAAA;AACrE,CAAC,EA9BW,SAAS,yBAAT,SAAS,QA8BpB"}
@@ -0,0 +1,50 @@
1
+ import { GetAllWalletNFTsByChainIdRequest, GetAllWalletNFTsByChainIdResponse, GetAllWalletNFTsRequest, GetAllWalletNFTsResponse, GetAllWalletTokensByChainIdRequest, GetAllWalletTokensByChainIdResponse, GetAllWalletTokensRequest, GetAllWalletTokensResponse, GetAssetPriceInfoRequest, GetAssetPriceInfoResponse, GetWalletLidoWithdrawalsByChainId, GetWalletLidoWithdrawalsByChainIdResponse } from './types';
2
+ /**===========================================================
3
+ * REFERENCE CORE FILE: /packages/core/src/apis/AssetApis.ts
4
+ * TODO: Remove this comment once migration is complete
5
+ *===========================================================*/
6
+ /**
7
+ * Gets the estimated dollar unit price of a tokenAddress for checkout
8
+ * @param chainId https://chainlist.org/ e.g. "1" for ethereum
9
+ * @param assetTokenAddress tokenAddress of the asset on the given chain
10
+ * @param apiKey
11
+ */
12
+ export declare function getAssetPriceInfo({ chainId, assetTokenAddress, apiKey, }: GetAssetPriceInfoRequest): Promise<GetAssetPriceInfoResponse>;
13
+ /**
14
+ * Get all tokens for a given wallet address
15
+ * @param walletAddress
16
+ * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)
17
+ * @param apiKey
18
+ */
19
+ export declare function getAllWalletTokens({ walletAddress, onlyVerifiedTokens, apiKey, }: GetAllWalletTokensRequest): Promise<GetAllWalletTokensResponse>;
20
+ /**
21
+ * Get all tokens for a given wallet address on a specific chain
22
+ * @param chainId https://chainlist.org/
23
+ * @param walletAddress
24
+ * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)
25
+ * @param apiKey
26
+ */
27
+ export declare function getAllWalletTokensByChainId({ chainId, walletAddress, onlyVerifiedTokens, apiKey, }: GetAllWalletTokensByChainIdRequest): Promise<GetAllWalletTokensByChainIdResponse>;
28
+ /**=======================
29
+ * POTENTIAL DEPRECATION
30
+ *=======================*/
31
+ /**
32
+ * Get all the NFTs owned by a wallet
33
+ * @param walletAddress
34
+ * @param apiKey
35
+ */
36
+ export declare function getAllWalletNFTs({ walletAddress, apiKey, }: GetAllWalletNFTsRequest): Promise<GetAllWalletNFTsResponse>;
37
+ /**
38
+ * Get all the NFTs owned by a wallet on a specific chain
39
+ * @param chainId From https://chainlist.org/
40
+ * @param walletAddress Address of holder
41
+ * @param apiKey
42
+ */
43
+ export declare function getAllWalletNFTsByChainId({ chainId, walletAddress, apiKey, }: GetAllWalletNFTsByChainIdRequest): Promise<GetAllWalletNFTsByChainIdResponse>;
44
+ /**
45
+ * Get all lido withdrawal request ids for a wallet address on a specific chain
46
+ * @param {string} chainId https://chainlist.org/ ie "1" for ethereum
47
+ * @param {string} holderAddr Address of holder
48
+ * @returns [readyToWithdrawRequestIds, notReadyToWithdrawRequestIds]
49
+ */
50
+ export declare function getWalletLidoWithdrawalsByChainId({ chainId, walletAddress, apiKey, }: GetWalletLidoWithdrawalsByChainId): Promise<GetWalletLidoWithdrawalsByChainIdResponse>;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWalletLidoWithdrawalsByChainId = exports.getAllWalletNFTsByChainId = exports.getAllWalletNFTs = exports.getAllWalletTokensByChainId = exports.getAllWalletTokens = exports.getAssetPriceInfo = void 0;
4
+ const consts_1 = require("../../consts");
5
+ const utils_1 = require("../../utils");
6
+ /**===========================================================
7
+ * REFERENCE CORE FILE: /packages/core/src/apis/AssetApis.ts
8
+ * TODO: Remove this comment once migration is complete
9
+ *===========================================================*/
10
+ /**
11
+ * Gets the estimated dollar unit price of a tokenAddress for checkout
12
+ * @param chainId https://chainlist.org/ e.g. "1" for ethereum
13
+ * @param assetTokenAddress tokenAddress of the asset on the given chain
14
+ * @param apiKey
15
+ */
16
+ async function getAssetPriceInfo({ chainId, assetTokenAddress, apiKey, }) {
17
+ const priceInfo = await (0, utils_1.sendGetRequest)({
18
+ uri: `${consts_1.API_BASE_URL}/asset/erc20/price/${chainId}/${assetTokenAddress}`,
19
+ apiKey,
20
+ retryOptions: { maxAttempts: 2 },
21
+ });
22
+ return priceInfo;
23
+ }
24
+ exports.getAssetPriceInfo = getAssetPriceInfo;
25
+ /**
26
+ * Get all tokens for a given wallet address
27
+ * @param walletAddress
28
+ * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)
29
+ * @param apiKey
30
+ */
31
+ async function getAllWalletTokens({ walletAddress, onlyVerifiedTokens, apiKey, }) {
32
+ return await (0, utils_1.sendGetRequest)({
33
+ uri: `${consts_1.API_BASE_URL}/assets/erc20s/${walletAddress}?onlyVerifiedTokens=${onlyVerifiedTokens}`,
34
+ apiKey,
35
+ retryOptions: { maxAttempts: 2 },
36
+ });
37
+ }
38
+ exports.getAllWalletTokens = getAllWalletTokens;
39
+ /**
40
+ * Get all tokens for a given wallet address on a specific chain
41
+ * @param chainId https://chainlist.org/
42
+ * @param walletAddress
43
+ * @param onlyVerifiedTokens If true, only return alchemy tokens that are verified(filters spam)
44
+ * @param apiKey
45
+ */
46
+ async function getAllWalletTokensByChainId({ chainId, walletAddress, onlyVerifiedTokens, apiKey, }) {
47
+ return await (0, utils_1.sendGetRequest)({
48
+ uri: `${consts_1.API_BASE_URL}/assets/erc20s/${walletAddress}/${chainId}?onlyVerifiedTokens=${onlyVerifiedTokens}`,
49
+ apiKey,
50
+ retryOptions: { maxAttempts: 2 },
51
+ });
52
+ }
53
+ exports.getAllWalletTokensByChainId = getAllWalletTokensByChainId;
54
+ /**=======================
55
+ * POTENTIAL DEPRECATION
56
+ *=======================*/
57
+ /**
58
+ * Get all the NFTs owned by a wallet
59
+ * @param walletAddress
60
+ * @param apiKey
61
+ */
62
+ async function getAllWalletNFTs({ walletAddress, apiKey, }) {
63
+ return await (0, utils_1.sendGetRequest)({
64
+ uri: `${consts_1.API_BASE_URL}/assets/nfts/${walletAddress}`,
65
+ apiKey,
66
+ });
67
+ }
68
+ exports.getAllWalletNFTs = getAllWalletNFTs;
69
+ /**
70
+ * Get all the NFTs owned by a wallet on a specific chain
71
+ * @param chainId From https://chainlist.org/
72
+ * @param walletAddress Address of holder
73
+ * @param apiKey
74
+ */
75
+ async function getAllWalletNFTsByChainId({ chainId, walletAddress, apiKey, }) {
76
+ return await (0, utils_1.sendGetRequest)({
77
+ uri: `${consts_1.API_BASE_URL}/assets/nfts/${walletAddress}/${chainId}`,
78
+ apiKey,
79
+ });
80
+ }
81
+ exports.getAllWalletNFTsByChainId = getAllWalletNFTsByChainId;
82
+ /**
83
+ * Get all lido withdrawal request ids for a wallet address on a specific chain
84
+ * @param {string} chainId https://chainlist.org/ ie "1" for ethereum
85
+ * @param {string} holderAddr Address of holder
86
+ * @returns [readyToWithdrawRequestIds, notReadyToWithdrawRequestIds]
87
+ */
88
+ async function getWalletLidoWithdrawalsByChainId({ chainId, walletAddress, apiKey, }) {
89
+ return await (0, utils_1.sendGetRequest)({
90
+ uri: `${consts_1.API_BASE_URL}/assets/lido-withdrawals/${walletAddress}/${chainId}`,
91
+ apiKey,
92
+ });
93
+ }
94
+ exports.getWalletLidoWithdrawalsByChainId = getWalletLidoWithdrawalsByChainId;
95
+ //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/assets/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uCAA4C;AAgB5C;;;+DAG+D;AAE/D;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CAAC,EACtC,OAAO,EACP,iBAAiB,EACjB,MAAM,GACmB;IACzB,MAAM,SAAS,GAAG,MAAM,IAAA,sBAAc,EAAC;QACrC,GAAG,EAAE,GAAG,qBAAY,sBAAsB,OAAO,IAAI,iBAAiB,EAAE;QACxE,MAAM;QACN,YAAY,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;KACjC,CAAC,CAAA;IACF,OAAO,SAA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,OAAO,MAAM,IAAA,sBAAc,EAAC;QAC1B,GAAG,EAAE,GAAG,qBAAY,4BAA4B,aAAa,IAAI,OAAO,EAAE;QAC1E,MAAM;KACP,CAAC,CAAA;AACJ,CAAC;AATD,8EASC"}
@@ -0,0 +1,2 @@
1
+ export * from './endpoints';
2
+ export * from './types';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./endpoints"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/assets/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}
@@ -0,0 +1,65 @@
1
+ export interface GetAssetPriceInfoRequest {
2
+ chainId: string;
3
+ assetTokenAddress: string;
4
+ apiKey: string;
5
+ }
6
+ interface AssetPriceInfo {
7
+ unitPrice: number;
8
+ amount: number;
9
+ total: number;
10
+ }
11
+ export type GetAssetPriceInfoResponse = AssetPriceInfo;
12
+ export interface GetAllWalletTokensRequest {
13
+ walletAddress: string;
14
+ onlyVerifiedTokens: boolean;
15
+ apiKey: string;
16
+ }
17
+ interface AssetBalanceInfo {
18
+ chainId: string;
19
+ contractAddress: string;
20
+ decimals: number;
21
+ logo: string;
22
+ name: string;
23
+ price: number | null;
24
+ symbol: string;
25
+ tokenBalance: string;
26
+ totalUsdValue: number | null;
27
+ }
28
+ interface ChainAssetBalanceInfo {
29
+ [tokenAddress: string]: AssetBalanceInfo;
30
+ }
31
+ export interface GetAllWalletTokensResponse {
32
+ [chainId: number]: ChainAssetBalanceInfo;
33
+ }
34
+ export interface GetAllWalletTokensByChainIdRequest {
35
+ chainId: string;
36
+ walletAddress: string;
37
+ onlyVerifiedTokens: boolean;
38
+ apiKey: string;
39
+ }
40
+ export type GetAllWalletTokensByChainIdResponse = ChainAssetBalanceInfo;
41
+ export interface GetAllWalletNFTsRequest {
42
+ walletAddress: string;
43
+ apiKey: string;
44
+ }
45
+ interface ChainNFTInfo {
46
+ address: string;
47
+ token_id: string;
48
+ floor_price: string;
49
+ }
50
+ export interface GetAllWalletNFTsResponse {
51
+ [chainId: string]: ChainNFTInfo[];
52
+ }
53
+ export interface GetAllWalletNFTsByChainIdRequest {
54
+ chainId: string;
55
+ walletAddress: string;
56
+ apiKey: string;
57
+ }
58
+ export type GetAllWalletNFTsByChainIdResponse = ChainNFTInfo[];
59
+ export interface GetWalletLidoWithdrawalsByChainId {
60
+ chainId: string;
61
+ walletAddress: string;
62
+ apiKey: string;
63
+ }
64
+ export type GetWalletLidoWithdrawalsByChainIdResponse = [number[], number[]];
65
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/assets/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import { Address } from 'viem';
2
+ import { CheckoutHistoryItem, CheckoutInitParams, CheckoutQuoteParams, CheckoutQuoteResponse, CheckoutTransferSponsorshipParams, CheckoutTransferSponsorshipResponse } from './types';
3
+ /**
4
+ * Gets a checkout quote (estimation).
5
+ * @param fromChainId The ID of the chain where funds will be provided from.
6
+ * @param fromTokenAddress The asset to fund the checkout. This must be either a chain native token or an ERC-20, on the fromChainId.
7
+ * @param fromTokenDecimals The number of decimals for the fromTokenAddress.
8
+ * @param toChainId The ID of the chain where the checkout operation is to be performed.
9
+ * @param toTokenAddress The wanted asset for the checkout operation. This must be either a chain native token or an ERC-20, on the target chain.
10
+ * @param toTokenAmount The amount of wanted asset for the checkout operation in base units.
11
+ * @param toTokenDecimals The number of decimals for the toTokenAddress.
12
+ * @param expirationTimestampMs The amount of time (duration) from now before the checkout operation expires.
13
+ * @param apiKey A valid fun api key.
14
+ * @return {Promise<CheckoutCoreQuoteResponse>} The formatted quote object
15
+ */
16
+ export declare function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, apiKey, }: CheckoutQuoteParams): Promise<CheckoutQuoteResponse>;
17
+ /**
18
+ * Initializes a checkout
19
+ * @param userOp The checkout UserOp, signed.
20
+ * @param quoteId The quoteId specific to the checkout.
21
+ * @param apiKey A valid fun api key.
22
+ * @return {Address} The generated deposit address
23
+ */
24
+ export declare function initializeCheckout({ userOp, quoteId, sourceOfFund, apiKey, clientMetadata, }: CheckoutInitParams): Promise<Address>;
25
+ /**
26
+ * Gets a checkout given a depositAddress
27
+ * @param depositAddress A unique deposit address associated with a backend checkout item.
28
+ * @param apiKey A valid fun api key.
29
+ * @returns The checkout object if exists. Otherwise, null.
30
+ */
31
+ export declare function getCheckoutByDepositAddress({ depositAddress, apiKey, }: {
32
+ depositAddress: Address;
33
+ apiKey: string;
34
+ }): Promise<CheckoutHistoryItem | null>;
35
+ /**
36
+ * Gets all checkouts associated with a funWallet
37
+ * @param funWalletAddress A funWallet address.
38
+ * @param apiKey A valid fun api key.
39
+ * @returns A list of checkout objects if exists. Otherwise, an empty array.
40
+ */
41
+ export declare function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKey, }: {
42
+ funWalletAddress: Address;
43
+ apiKey: string;
44
+ }): Promise<CheckoutHistoryItem[]>;
45
+ /**
46
+ * Gets all checkouts associated with a recipient address
47
+ * @param recipientAddress A wallet address.
48
+ * @param apiKey A valid fun api key.
49
+ * @returns A list of checkout objects if exists. Otherwise, an empty array.
50
+ */
51
+ export declare function getCheckoutsByRecipientAddress({ recipientAddress, apiKey, }: {
52
+ recipientAddress: Address;
53
+ apiKey: string;
54
+ }): Promise<CheckoutHistoryItem[]>;
55
+ export declare function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, apiKey, }: CheckoutTransferSponsorshipParams): Promise<CheckoutTransferSponsorshipResponse>;
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getPaymasterDataForCheckoutSponsoredTransfer = exports.getCheckoutsByRecipientAddress = exports.getCheckoutsByFunWalletAddress = exports.getCheckoutByDepositAddress = exports.initializeCheckout = exports.getCheckoutQuote = void 0;
7
+ const big_js_1 = __importDefault(require("big.js"));
8
+ const consts_1 = require("../../consts");
9
+ const errors_1 = require("../../errors");
10
+ const utils_1 = require("../../utils");
11
+ /**
12
+ * Gets a checkout quote (estimation).
13
+ * @param fromChainId The ID of the chain where funds will be provided from.
14
+ * @param fromTokenAddress The asset to fund the checkout. This must be either a chain native token or an ERC-20, on the fromChainId.
15
+ * @param fromTokenDecimals The number of decimals for the fromTokenAddress.
16
+ * @param toChainId The ID of the chain where the checkout operation is to be performed.
17
+ * @param toTokenAddress The wanted asset for the checkout operation. This must be either a chain native token or an ERC-20, on the target chain.
18
+ * @param toTokenAmount The amount of wanted asset for the checkout operation in base units.
19
+ * @param toTokenDecimals The number of decimals for the toTokenAddress.
20
+ * @param expirationTimestampMs The amount of time (duration) from now before the checkout operation expires.
21
+ * @param apiKey A valid fun api key.
22
+ * @return {Promise<CheckoutCoreQuoteResponse>} The formatted quote object
23
+ */
24
+ async function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecimals, toChainId, toTokenAddress, toTokenDecimals, toTokenAmount, expirationTimestampMs, sponsorInitialTransferGasLimit, recipientAddr, needsRefuel, apiKey, }) {
25
+ try {
26
+ const toMultipler = 10 ** toTokenDecimals;
27
+ const toAmountBaseUnitBI = BigInt(Math.floor(toTokenAmount * toMultipler));
28
+ const queryParams = {
29
+ fromChainId,
30
+ fromTokenAddress,
31
+ toChainId,
32
+ toTokenAddress,
33
+ toAmountBaseUnit: toAmountBaseUnitBI.toString(),
34
+ // Only pass in recipientAddr if specified
35
+ ...(recipientAddr ? { recipientAddr } : {}),
36
+ // Rounding nearest tenth second (instead of seconds) to better support backend quote caching feature
37
+ // Reference: https://vintage-heaven-3cd.notion.site/API-Gateway-Caching-and-Pre-Warming-System-Draft-ee7909d9b85f43c793ce7bd2607bec02?pvs=4
38
+ // Note: Rounding *down* instead of a regular round to safeguard against edge case of timing passing frontend range validation but failing backend range validation
39
+ checkoutExpirationTimestampSeconds: (0, utils_1.roundToNearestBottomTenth)(Math.round((Date.now() + expirationTimestampMs) / 1000)).toString(),
40
+ sponsorInitialTransferGasLimit,
41
+ refuel: needsRefuel.toString(),
42
+ };
43
+ const searchParams = new URLSearchParams(queryParams);
44
+ const quoteRes = (await (0, utils_1.sendGetRequest)({
45
+ uri: `${consts_1.API_BASE_URL}/checkout/quote?${searchParams}`,
46
+ apiKey,
47
+ }));
48
+ const fromMultipler = 10 ** fromTokenDecimals;
49
+ // Format the response for frontend usage
50
+ return {
51
+ quoteId: quoteRes.quoteId,
52
+ fromTokenAddress: quoteRes.fromTokenAddress,
53
+ estFeesUsd: quoteRes.estFeesUsd,
54
+ estSubtotalUsd: quoteRes.estSubtotalUsd,
55
+ estTotalUsd: quoteRes.estTotalUsd,
56
+ estCheckoutTimeMs: quoteRes.estCheckoutTimeMs,
57
+ estTotalFromAmountBaseUnit: quoteRes.estTotalFromAmountBaseUnit,
58
+ estSubtotalFromAmountBaseUnit: quoteRes.estSubtotalFromAmountBaseUnit,
59
+ estFeesFromAmountBaseUnit: quoteRes.estFeesFromAmountBaseUnit,
60
+ // Added fields
61
+ estFeesFromAmount: new big_js_1.default(quoteRes.estFeesFromAmountBaseUnit)
62
+ .div(fromMultipler)
63
+ .toString(),
64
+ estSubtotalFromAmount: new big_js_1.default(quoteRes.estSubtotalFromAmountBaseUnit)
65
+ .div(fromMultipler)
66
+ .toString(),
67
+ estTotalFromAmount: new big_js_1.default(quoteRes.estTotalFromAmountBaseUnit)
68
+ .div(fromMultipler)
69
+ .toString(),
70
+ };
71
+ }
72
+ catch (err) {
73
+ throw new Error(`An error occured trying to generate a checkout quote: ${err.message}`);
74
+ }
75
+ }
76
+ exports.getCheckoutQuote = getCheckoutQuote;
77
+ /**
78
+ * Initializes a checkout
79
+ * @param userOp The checkout UserOp, signed.
80
+ * @param quoteId The quoteId specific to the checkout.
81
+ * @param apiKey A valid fun api key.
82
+ * @return {Address} The generated deposit address
83
+ */
84
+ async function initializeCheckout({ userOp, quoteId, sourceOfFund, apiKey, clientMetadata, }) {
85
+ const body = {
86
+ ...(userOp ? { userOp } : {}),
87
+ quoteId,
88
+ sourceOfFund,
89
+ salt: (0, utils_1.generateRandomCheckoutSalt)(),
90
+ clientMetadata,
91
+ };
92
+ const res = await (0, utils_1.sendPostRequest)({
93
+ uri: `${consts_1.API_BASE_URL}/checkout`,
94
+ body,
95
+ apiKey,
96
+ });
97
+ if (!res?.depositAddr) {
98
+ throw new errors_1.ResourceNotFoundError(errors_1.ErrorCode.CheckoutInitDepositAddrNotFound, 'Unable to initialize checkout', body, '', 'https://docs.fun.xyz');
99
+ }
100
+ return res.depositAddr;
101
+ }
102
+ exports.initializeCheckout = initializeCheckout;
103
+ /**
104
+ * Gets a checkout given a depositAddress
105
+ * @param depositAddress A unique deposit address associated with a backend checkout item.
106
+ * @param apiKey A valid fun api key.
107
+ * @returns The checkout object if exists. Otherwise, null.
108
+ */
109
+ async function getCheckoutByDepositAddress({ depositAddress, apiKey, }) {
110
+ try {
111
+ return await (0, utils_1.sendGetRequest)({
112
+ uri: `${consts_1.API_BASE_URL}/checkout/${depositAddress}`,
113
+ apiKey,
114
+ });
115
+ }
116
+ catch (err) {
117
+ if (err instanceof errors_1.ResourceNotFoundError) {
118
+ return null;
119
+ }
120
+ throw err;
121
+ }
122
+ }
123
+ exports.getCheckoutByDepositAddress = getCheckoutByDepositAddress;
124
+ /**
125
+ * Gets all checkouts associated with a funWallet
126
+ * @param funWalletAddress A funWallet address.
127
+ * @param apiKey A valid fun api key.
128
+ * @returns A list of checkout objects if exists. Otherwise, an empty array.
129
+ */
130
+ async function getCheckoutsByFunWalletAddress({ funWalletAddress, apiKey, }) {
131
+ const res = await (0, utils_1.sendGetRequest)({
132
+ uri: `${consts_1.API_BASE_URL}/checkout/fun-wallet/${funWalletAddress}`,
133
+ apiKey,
134
+ });
135
+ return res || [];
136
+ }
137
+ exports.getCheckoutsByFunWalletAddress = getCheckoutsByFunWalletAddress;
138
+ /**
139
+ * Gets all checkouts associated with a recipient address
140
+ * @param recipientAddress A wallet address.
141
+ * @param apiKey A valid fun api key.
142
+ * @returns A list of checkout objects if exists. Otherwise, an empty array.
143
+ */
144
+ async function getCheckoutsByRecipientAddress({ recipientAddress, apiKey, }) {
145
+ const res = await (0, utils_1.sendGetRequest)({
146
+ uri: `${consts_1.API_BASE_URL}/checkout/recipient/${recipientAddress}`,
147
+ apiKey,
148
+ });
149
+ return res || [];
150
+ }
151
+ exports.getCheckoutsByRecipientAddress = getCheckoutsByRecipientAddress;
152
+ async function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, transferUserOp, apiKey, }) {
153
+ const body = {
154
+ depositAddress,
155
+ userOp: transferUserOp,
156
+ };
157
+ const res = await (0, utils_1.sendPostRequest)({
158
+ uri: `${consts_1.API_BASE_URL}/checkout/sponsorship`,
159
+ body,
160
+ apiKey,
161
+ });
162
+ if (!res) {
163
+ // TODO: Better error handling
164
+ throw new Error('Unable to get sponsorship information');
165
+ }
166
+ return res;
167
+ }
168
+ exports.getPaymasterDataForCheckoutSponsoredTransfer = getPaymasterDataForCheckoutSponsoredTransfer;
169
+ //# sourceMappingURL=endpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/checkout/endpoints.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAwB;AAGxB,yCAA2C;AAC3C,yCAA+D;AAC/D,uCAKoB;AAepB;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,gBAAgB,CAAC,EACrC,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,8BAA8B,EAC9B,aAAa,EACb,WAAW,EACX,MAAM,GACc;IACpB,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,EAAE,IAAI,eAAe,CAAA;QACzC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,WAAW,CAAC,CAAC,CAAA;QAC1E,MAAM,WAAW,GAAG;YAClB,WAAW;YACX,gBAAgB;YAChB,SAAS;YACT,cAAc;YACd,gBAAgB,EAAE,kBAAkB,CAAC,QAAQ,EAAE;YAC/C,0CAA0C;YAC1C,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,qGAAqG;YACrG,4IAA4I;YAC5I,mKAAmK;YACnK,kCAAkC,EAAE,IAAA,iCAAyB,EAC3D,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,qBAAqB,CAAC,GAAG,IAAI,CAAC,CACxD,CAAC,QAAQ,EAAE;YACZ,8BAA8B;YAC9B,MAAM,EAAE,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AAE;QAC9D,MAAM;KACP,CAAC,CAAA;IACF,OAAO,GAAG,IAAI,EAAE,CAAA;AAClB,CAAC;AAZD,wEAYC;AAED;;;;;GAKG;AACI,KAAK,UAAU,8BAA8B,CAAC,EACnD,gBAAgB,EAChB,MAAM,GAIP;IACC,MAAM,GAAG,GAAG,MAAM,IAAA,sBAAc,EAAC;QAC/B,GAAG,EAAE,GAAG,qBAAY,uBAAuB,gBAAgB,EAAE;QAC7D,MAAM;KACP,CAAC,CAAA;IACF,OAAO,GAAG,IAAI,EAAE,CAAA;AAClB,CAAC;AAZD,wEAYC;AAEM,KAAK,UAAU,4CAA4C,CAAC,EACjE,cAAc,EACd,cAAc,EACd,MAAM,GAC4B;IAClC,MAAM,IAAI,GAAG;QACX,cAAc;QACd,MAAM,EAAE,cAAc;KACiB,CAAA;IACzC,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAe,EAAC;QAChC,GAAG,EAAE,GAAG,qBAAY,uBAAuB;QAC3C,IAAI;QACJ,MAAM;KACP,CAAC,CAAA;IACF,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,8BAA8B;QAC9B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAA;IAC1D,CAAC;IACD,OAAO,GAA0C,CAAA;AACnD,CAAC;AAnBD,oGAmBC"}
@@ -0,0 +1,2 @@
1
+ export * from './endpoints';
2
+ export * from './types';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./endpoints"), exports);
18
+ __exportStar(require("./types"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/services/checkout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}