@funkit/api-base 0.0.2 → 0.0.3
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/CHANGELOG.md +6 -0
- package/dist/src/consts/api.d.ts +1 -0
- package/dist/src/consts/api.js +2 -1
- package/dist/src/consts/api.js.map +1 -1
- package/dist/src/services/assets/types.d.ts +10 -5
- package/dist/src/services/checkout/endpoints.js +2 -1
- package/dist/src/services/checkout/endpoints.js.map +1 -1
- package/dist/src/services/faucet/endpoints.d.ts +2 -0
- package/dist/src/services/faucet/endpoints.js +13 -0
- package/dist/src/services/faucet/endpoints.js.map +1 -0
- package/dist/src/services/faucet/index.d.ts +2 -0
- package/dist/src/services/faucet/index.js +19 -0
- package/dist/src/services/faucet/index.js.map +1 -0
- package/dist/src/services/faucet/types.d.ts +6 -0
- package/dist/src/services/faucet/types.js +3 -0
- package/dist/src/services/faucet/types.js.map +1 -0
- package/dist/src/services/index.d.ts +3 -0
- package/dist/src/services/index.js +3 -0
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/mesh/endpoints.d.ts +2 -2
- package/dist/src/services/mesh/endpoints.js.map +1 -1
- package/dist/src/services/mesh/types.d.ts +31 -4
- package/dist/src/services/mesh/types.js +20 -0
- package/dist/src/services/mesh/types.js.map +1 -1
- package/dist/src/services/moonpay/endpoints.d.ts +9 -1
- package/dist/src/services/moonpay/endpoints.js +41 -1
- package/dist/src/services/moonpay/endpoints.js.map +1 -1
- package/dist/src/services/moonpay/types.d.ts +33 -0
- package/dist/src/services/support/endpoints.d.ts +2 -0
- package/dist/src/services/support/endpoints.js +21 -0
- package/dist/src/services/support/endpoints.js.map +1 -0
- package/dist/src/services/support/index.d.ts +2 -0
- package/dist/src/services/support/index.js +19 -0
- package/dist/src/services/support/index.js.map +1 -0
- package/dist/src/services/support/types.d.ts +6 -0
- package/dist/src/services/support/types.js +3 -0
- package/dist/src/services/support/types.js.map +1 -0
- package/dist/src/services/turnkey/endpoints.d.ts +3 -0
- package/dist/src/services/turnkey/endpoints.js +27 -0
- package/dist/src/services/turnkey/endpoints.js.map +1 -0
- package/dist/src/services/turnkey/index.d.ts +2 -0
- package/dist/src/services/turnkey/index.js +19 -0
- package/dist/src/services/turnkey/index.js.map +1 -0
- package/dist/src/services/turnkey/types.d.ts +12 -0
- package/dist/src/services/turnkey/types.js +3 -0
- package/dist/src/services/turnkey/types.js.map +1 -0
- package/dist/src/utils/checkout.d.ts +1 -0
- package/dist/src/utils/checkout.js +4 -3
- package/dist/src/utils/checkout.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/src/consts/api.d.ts
CHANGED
package/dist/src/consts/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.API_BASE_URL = void 0;
|
|
3
|
+
exports.FUN_FAUCET_URL = exports.API_BASE_URL = void 0;
|
|
4
4
|
exports.API_BASE_URL = process.env.NODE_ENV === 'staging'
|
|
5
5
|
? 'https://api.fun.xyz/staging/v1'
|
|
6
6
|
: process.env.NODE_ENV === 'testing'
|
|
@@ -9,4 +9,5 @@ exports.API_BASE_URL = process.env.NODE_ENV === 'staging'
|
|
|
9
9
|
? 'http://127.0.0.1:3000'
|
|
10
10
|
: // Production
|
|
11
11
|
'https://api.fun.xyz/v1';
|
|
12
|
+
exports.FUN_FAUCET_URL = 'https://api.fun.xyz/demo-faucet';
|
|
12
13
|
//# sourceMappingURL=api.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/consts/api.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GACvB,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;IAChC,CAAC,CAAC,gCAAgC;IAClC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;QACpC,CAAC,CAAC,gCAAgC;QAClC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,OAAO;YAClC,CAAC,CAAC,uBAAuB;YACzB,CAAC,CAAC,aAAa;gBACb,wBAAwB,CAAA"}
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/consts/api.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GACvB,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;IAChC,CAAC,CAAC,gCAAgC;IAClC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS;QACpC,CAAC,CAAC,gCAAgC;QAClC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,OAAO;YAClC,CAAC,CAAC,uBAAuB;YACzB,CAAC,CAAC,aAAa;gBACb,wBAAwB,CAAA;AAEjB,QAAA,cAAc,GAAG,iCAAiC,CAAA"}
|
|
@@ -14,7 +14,7 @@ export interface GetAllWalletTokensRequest {
|
|
|
14
14
|
onlyVerifiedTokens: boolean;
|
|
15
15
|
apiKey: string;
|
|
16
16
|
}
|
|
17
|
-
interface AssetBalanceInfo {
|
|
17
|
+
export interface AssetBalanceInfo {
|
|
18
18
|
chainId: string;
|
|
19
19
|
contractAddress: string;
|
|
20
20
|
decimals: number;
|
|
@@ -25,7 +25,7 @@ interface AssetBalanceInfo {
|
|
|
25
25
|
tokenBalance: string;
|
|
26
26
|
totalUsdValue: number | null;
|
|
27
27
|
}
|
|
28
|
-
interface ChainAssetBalanceInfo {
|
|
28
|
+
export interface ChainAssetBalanceInfo {
|
|
29
29
|
[tokenAddress: string]: AssetBalanceInfo;
|
|
30
30
|
}
|
|
31
31
|
export interface GetAllWalletTokensResponse {
|
|
@@ -42,20 +42,25 @@ export interface GetAllWalletNFTsRequest {
|
|
|
42
42
|
walletAddress: string;
|
|
43
43
|
apiKey: string;
|
|
44
44
|
}
|
|
45
|
-
interface ChainNFTInfo {
|
|
45
|
+
export interface ChainNFTInfo {
|
|
46
46
|
address: string;
|
|
47
47
|
token_id: string;
|
|
48
48
|
floor_price: string;
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
50
|
+
export interface ChainToNFTMapInfo {
|
|
51
51
|
[chainId: string]: ChainNFTInfo[];
|
|
52
52
|
}
|
|
53
|
+
export interface GetAllWalletNFTsResponse {
|
|
54
|
+
nfts: ChainToNFTMapInfo;
|
|
55
|
+
}
|
|
53
56
|
export interface GetAllWalletNFTsByChainIdRequest {
|
|
54
57
|
chainId: string;
|
|
55
58
|
walletAddress: string;
|
|
56
59
|
apiKey: string;
|
|
57
60
|
}
|
|
58
|
-
export
|
|
61
|
+
export interface GetAllWalletNFTsByChainIdResponse {
|
|
62
|
+
nfts: ChainNFTInfo[];
|
|
63
|
+
}
|
|
59
64
|
export interface GetWalletLidoWithdrawalsByChainId {
|
|
60
65
|
chainId: string;
|
|
61
66
|
walletAddress: string;
|
|
@@ -38,6 +38,7 @@ async function getCheckoutQuote({ fromChainId, fromTokenAddress, fromTokenDecima
|
|
|
38
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
39
|
checkoutExpirationTimestampSeconds: (0, utils_1.roundToNearestBottomTenth)(Math.round((Date.now() + expirationTimestampMs) / 1000)).toString(),
|
|
40
40
|
sponsorInitialTransferGasLimit,
|
|
41
|
+
// @deprecated Not in use
|
|
41
42
|
refuel: needsRefuel.toString(),
|
|
42
43
|
};
|
|
43
44
|
const searchParams = new URLSearchParams(queryParams);
|
|
@@ -155,7 +156,7 @@ async function getPaymasterDataForCheckoutSponsoredTransfer({ depositAddress, tr
|
|
|
155
156
|
userOp: transferUserOp,
|
|
156
157
|
};
|
|
157
158
|
const res = await (0, utils_1.sendPostRequest)({
|
|
158
|
-
uri: `${consts_1.API_BASE_URL}/checkout/
|
|
159
|
+
uri: `${consts_1.API_BASE_URL}/checkout/sponsor-transfer`,
|
|
159
160
|
body,
|
|
160
161
|
apiKey,
|
|
161
162
|
});
|
|
@@ -1 +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,WAAW,CAAC,QAAQ,EAAE;SACL,CAAA;QAE3B,MAAM,YAAY,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAA;QACrD,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAA,sBAAc,EAAC;YACrC,GAAG,EAAE,GAAG,qBAAY,mBAAmB,YAAY,EA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,IAAI,GAAG;QACX,cAAc;QACd,MAAM,EAAE,cAAc;KACiB,CAAA;IACzC,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAe,EAAC;QAChC,GAAG,EAAE,GAAG,qBAAY,4BAA4B;QAChD,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,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetFromFaucet = void 0;
|
|
4
|
+
const consts_1 = require("../../consts");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
async function getAssetFromFaucet({ token, chain, walletAddress, apiKey, }) {
|
|
7
|
+
return await (0, utils_1.sendGetRequest)({
|
|
8
|
+
uri: `${consts_1.FUN_FAUCET_URL}/get-faucet?token=${token}&testnet=${chain}&addr=${walletAddress}`,
|
|
9
|
+
apiKey,
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.getAssetFromFaucet = getAssetFromFaucet;
|
|
13
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/faucet/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA6C;AAC7C,uCAA4C;AAGrC,KAAK,UAAU,kBAAkB,CAAC,EACvC,KAAK,EACL,KAAK,EACL,aAAa,EACb,MAAM,GACoB;IAC1B,OAAO,MAAM,IAAA,sBAAc,EAAC;QAC1B,GAAG,EAAE,GAAG,uBAAc,qBAAqB,KAAK,YAAY,KAAK,SAAS,aAAa,EAAE;QACzF,MAAM;KACP,CAAC,CAAA;AACJ,CAAC;AAVD,gDAUC"}
|
|
@@ -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/faucet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/faucet/types.ts"],"names":[],"mappings":""}
|
|
@@ -16,6 +16,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./assets"), exports);
|
|
18
18
|
__exportStar(require("./checkout"), exports);
|
|
19
|
+
__exportStar(require("./faucet"), exports);
|
|
19
20
|
__exportStar(require("./mesh"), exports);
|
|
20
21
|
__exportStar(require("./moonpay"), exports);
|
|
22
|
+
__exportStar(require("./support"), exports);
|
|
23
|
+
__exportStar(require("./turnkey"), exports);
|
|
21
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,6CAA0B;AAC1B,yCAAsB;AACtB,4CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,6CAA0B;AAC1B,2CAAwB;AACxB,yCAAsB;AACtB,4CAAyB;AACzB,4CAAyB;AACzB,4CAAyB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GetCryptocurrencyHoldingsRequest, GetLinkTokenRequest, GetLinkTokenResponse, GetTransferIntegrationsRequest, GetTransferIntegrationsResponse, MeshExecuteTransferRequest, MeshExecuteTransferResponse, PreviewTransferRequest } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* @param authToken The authentication token to send the asset from.
|
|
4
4
|
* @param type The type of the integration to send the asset from.
|
|
@@ -42,4 +42,4 @@ export declare function meshPreviewTransfer({ fromAuthToken, fromType, toAuthTok
|
|
|
42
42
|
* @param mfaCode Multi-factor auth code that should be provided if the status of the transfer was MfaRequired.
|
|
43
43
|
* @returns https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute
|
|
44
44
|
*/
|
|
45
|
-
export declare function meshExecuteTransfer({ fromAuthToken, fromType, previewId, mfaCode, apiKey, }:
|
|
45
|
+
export declare function meshExecuteTransfer({ fromAuthToken, fromType, previewId, mfaCode, apiKey, }: MeshExecuteTransferRequest): Promise<MeshExecuteTransferResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/mesh/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uCAA6D;
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/mesh/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uCAA6D;AAY7D;;;;GAIG;AACI,KAAK,UAAU,6BAA6B,CAAC,EAClD,SAAS,EACT,IAAI,EACJ,MAAM,GAC2B;IACjC,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAe,EAAC;QAChC,GAAG,EAAE,GAAG,qBAAY,oBAAoB;QACxC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;QACzB,MAAM;KACP,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC;AAXD,sEAWC;AAED;;GAEG;AACI,KAAK,UAAU,2BAA2B,CAAC,EAChD,MAAM,GACyB;IAC/B,MAAM,GAAG,GAAG,MAAM,IAAA,sBAAc,EAAC;QAC/B,GAAG,EAAE,GAAG,qBAAY,sCAAsC;QAC1D,MAAM;KACP,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC;AARD,kEAQC;AAED;;;;;;;;;GASG;AACI,KAAK,UAAU,gBAAgB,CAAC,EACrC,MAAM,EACN,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,MAAM,GACc;IACpB,IAAI,IAAI,GAAQ,EAAE,MAAM,EAAE,CAAA;IAC1B,IAAI,aAAa,EAAE,CAAC;QAClB,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa,EAAE,CAAA;IACnC,CAAC;IACD,IAAI,wBAAwB,EAAE,CAAC;QAC7B,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,wBAAwB,EAAE,CAAA;IAC9C,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QACpB,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,eAAe,EAAE,CAAA;IACrC,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAe,EAAC;QACh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C;QAChC,GAAG,EAAE,GAAG,qBAAY,iCAAiC;QACrD,IAAI;QACJ,MAAM;QACN,YAAY,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;KACjC,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC;AA9CD,kDA8CC;AACD;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB,CAAC,EACxC,aAAa,EACb,QAAQ,EACR,SAAS,EACT,OAAO,EACP,MAAM,GACqB;IAC3B,IAAI,IAAI,GAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;IACtD,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAA;IAC7B,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAe,EAAC;QAChC,GAAG,EAAE,GAAG,qBAAY,iCAAiC;QACrD,IAAI;QACJ,MAAM;KACP,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC;AAjBD,kDAiBC"}
|
|
@@ -6,7 +6,7 @@ export interface GetCryptocurrencyHoldingsRequest {
|
|
|
6
6
|
export interface GetTransferIntegrationsRequest {
|
|
7
7
|
apiKey: string;
|
|
8
8
|
}
|
|
9
|
-
interface IntegrationNetworkInfo {
|
|
9
|
+
export interface IntegrationNetworkInfo {
|
|
10
10
|
chainId: string;
|
|
11
11
|
id: string;
|
|
12
12
|
logoUrl: string;
|
|
@@ -14,7 +14,7 @@ interface IntegrationNetworkInfo {
|
|
|
14
14
|
nativeSymbol: string;
|
|
15
15
|
supportedTokens: string[];
|
|
16
16
|
}
|
|
17
|
-
interface TransferIntegration {
|
|
17
|
+
export interface TransferIntegration {
|
|
18
18
|
networks: IntegrationNetworkInfo[];
|
|
19
19
|
supportsIncomingTransfers: boolean;
|
|
20
20
|
supportsOutgoingTransfers: boolean;
|
|
@@ -46,11 +46,38 @@ export interface PreviewTransferRequest {
|
|
|
46
46
|
amountInFiat?: string | null;
|
|
47
47
|
fiatCurrency?: string | null;
|
|
48
48
|
}
|
|
49
|
-
export interface
|
|
49
|
+
export interface MeshExecuteTransferRequest {
|
|
50
50
|
apiKey: string;
|
|
51
51
|
fromAuthToken: string;
|
|
52
52
|
fromType: string;
|
|
53
53
|
previewId: string;
|
|
54
54
|
mfaCode?: string | null;
|
|
55
55
|
}
|
|
56
|
-
export {
|
|
56
|
+
export declare enum MeshExecuteTransferStatus {
|
|
57
|
+
succeeded = "succeeded",
|
|
58
|
+
failed = "failed",
|
|
59
|
+
mfaRequired = "mfaRequired",
|
|
60
|
+
emailConfirmationRequired = "emailConfirmationRequired",
|
|
61
|
+
deviceConfirmationRequired = "deviceConfirmationRequired",
|
|
62
|
+
mfaFailed = "mfaFailed",
|
|
63
|
+
addressWhitelistRequired = "addressWhitelistRequired",
|
|
64
|
+
secondMfaRequired = "secondMfaRequired"
|
|
65
|
+
}
|
|
66
|
+
export declare enum MeshExecuteTransferMfaType {
|
|
67
|
+
unspecified = "unspecified",
|
|
68
|
+
phone = "phone",
|
|
69
|
+
email = "email",
|
|
70
|
+
otp = "otp"
|
|
71
|
+
}
|
|
72
|
+
export interface MeshExecuteTransferContent {
|
|
73
|
+
status: MeshExecuteTransferStatus;
|
|
74
|
+
mfaType: MeshExecuteTransferMfaType;
|
|
75
|
+
errorMessage: string | null;
|
|
76
|
+
executeTransferResult: object | null;
|
|
77
|
+
}
|
|
78
|
+
export interface MeshExecuteTransferResponse {
|
|
79
|
+
status: MeshExecuteTransferStatus;
|
|
80
|
+
mfaType: MeshExecuteTransferMfaType;
|
|
81
|
+
errorMessage: string | null;
|
|
82
|
+
executeTransferResult: object | null;
|
|
83
|
+
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeshExecuteTransferMfaType = exports.MeshExecuteTransferStatus = void 0;
|
|
4
|
+
// Reference: https://docs.meshconnect.com/reference/post_api-v1-transfers-managed-execute
|
|
5
|
+
var MeshExecuteTransferStatus;
|
|
6
|
+
(function (MeshExecuteTransferStatus) {
|
|
7
|
+
MeshExecuteTransferStatus["succeeded"] = "succeeded";
|
|
8
|
+
MeshExecuteTransferStatus["failed"] = "failed";
|
|
9
|
+
MeshExecuteTransferStatus["mfaRequired"] = "mfaRequired";
|
|
10
|
+
MeshExecuteTransferStatus["emailConfirmationRequired"] = "emailConfirmationRequired";
|
|
11
|
+
MeshExecuteTransferStatus["deviceConfirmationRequired"] = "deviceConfirmationRequired";
|
|
12
|
+
MeshExecuteTransferStatus["mfaFailed"] = "mfaFailed";
|
|
13
|
+
MeshExecuteTransferStatus["addressWhitelistRequired"] = "addressWhitelistRequired";
|
|
14
|
+
MeshExecuteTransferStatus["secondMfaRequired"] = "secondMfaRequired";
|
|
15
|
+
})(MeshExecuteTransferStatus || (exports.MeshExecuteTransferStatus = MeshExecuteTransferStatus = {}));
|
|
16
|
+
var MeshExecuteTransferMfaType;
|
|
17
|
+
(function (MeshExecuteTransferMfaType) {
|
|
18
|
+
MeshExecuteTransferMfaType["unspecified"] = "unspecified";
|
|
19
|
+
MeshExecuteTransferMfaType["phone"] = "phone";
|
|
20
|
+
MeshExecuteTransferMfaType["email"] = "email";
|
|
21
|
+
MeshExecuteTransferMfaType["otp"] = "otp";
|
|
22
|
+
})(MeshExecuteTransferMfaType || (exports.MeshExecuteTransferMfaType = MeshExecuteTransferMfaType = {}));
|
|
3
23
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/mesh/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/mesh/types.ts"],"names":[],"mappings":";;;AAgEA,0FAA0F;AAC1F,IAAY,yBASX;AATD,WAAY,yBAAyB;IACnC,oDAAuB,CAAA;IACvB,8CAAiB,CAAA;IACjB,wDAA2B,CAAA;IAC3B,oFAAuD,CAAA;IACvD,sFAAyD,CAAA;IACzD,oDAAuB,CAAA;IACvB,kFAAqD,CAAA;IACrD,oEAAuC,CAAA;AACzC,CAAC,EATW,yBAAyB,yCAAzB,yBAAyB,QASpC;AAED,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,yDAA2B,CAAA;IAC3B,6CAAe,CAAA;IACf,6CAAe,CAAA;IACf,yCAAW,CAAA;AACb,CAAC,EALW,0BAA0B,0CAA1B,0BAA0B,QAKrC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { GetMoonpayBuyQuoteForCreditCardRequest, GetMoonpayUrlSignatureRequest } from './types';
|
|
1
|
+
import { GetMoonpayBuyQuoteForCreditCardRequest, GetMoonpayOffRampUrlRequest, GetMoonpayOnRampUrlRequest, GetMoonpayUrlSignatureRequest, MoonpayCurrency } from './types';
|
|
2
2
|
export declare function getMoonpayUrlSignature({ url, isSandbox, apiKey, }: GetMoonpayUrlSignatureRequest): Promise<string>;
|
|
3
3
|
export declare function getMoonpayBuyQuoteForCreditCard({ currencyCode, baseCurrencyCode, quoteCurrencyAmount, baseCurrencyAmount, extraFeePercentage, areFeesIncluded, apiKey, }: GetMoonpayBuyQuoteForCreditCardRequest): Promise<any>;
|
|
4
|
+
/**=======================
|
|
5
|
+
* POTENTIAL DEPRECATION
|
|
6
|
+
*=======================*/
|
|
7
|
+
export declare function getMoonpayOnRampUrl({ apiKey, walletAddr, currencyCode, }: GetMoonpayOnRampUrlRequest): Promise<string>;
|
|
8
|
+
export declare function getMoonpayOffRampUrl({ walletAddr, apiKey, }: GetMoonpayOffRampUrlRequest): Promise<string>;
|
|
9
|
+
export declare function getMoonpayOnRampSupportedCurrencies({ apiKey, }: {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
}): Promise<MoonpayCurrency[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMoonpayBuyQuoteForCreditCard = exports.getMoonpayUrlSignature = void 0;
|
|
3
|
+
exports.getMoonpayOnRampSupportedCurrencies = exports.getMoonpayOffRampUrl = exports.getMoonpayOnRampUrl = exports.getMoonpayBuyQuoteForCreditCard = exports.getMoonpayUrlSignature = void 0;
|
|
4
4
|
const consts_1 = require("../../consts");
|
|
5
5
|
const errors_1 = require("../../errors");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
@@ -40,4 +40,44 @@ async function getMoonpayBuyQuoteForCreditCard({ currencyCode, baseCurrencyCode,
|
|
|
40
40
|
return res;
|
|
41
41
|
}
|
|
42
42
|
exports.getMoonpayBuyQuoteForCreditCard = getMoonpayBuyQuoteForCreditCard;
|
|
43
|
+
/**=======================
|
|
44
|
+
* POTENTIAL DEPRECATION
|
|
45
|
+
*=======================*/
|
|
46
|
+
async function getMoonpayOnRampUrl({ apiKey, walletAddr, currencyCode, }) {
|
|
47
|
+
const endpoint = `on-ramp/${walletAddr}?provider=moonpay`;
|
|
48
|
+
if (currencyCode) {
|
|
49
|
+
endpoint.concat(`¤cyCode=${currencyCode}`);
|
|
50
|
+
}
|
|
51
|
+
const url = (await (0, utils_1.sendGetRequest)({
|
|
52
|
+
uri: `${consts_1.API_BASE_URL}/${endpoint}`,
|
|
53
|
+
apiKey,
|
|
54
|
+
}))?.url;
|
|
55
|
+
if (!url) {
|
|
56
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No onramp url found.', { walletAddr }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
57
|
+
}
|
|
58
|
+
return url;
|
|
59
|
+
}
|
|
60
|
+
exports.getMoonpayOnRampUrl = getMoonpayOnRampUrl;
|
|
61
|
+
async function getMoonpayOffRampUrl({ walletAddr, apiKey, }) {
|
|
62
|
+
const url = (await (0, utils_1.sendGetRequest)({
|
|
63
|
+
uri: `${consts_1.API_BASE_URL}/off-ramp/${walletAddr}?provider=moonpay`,
|
|
64
|
+
apiKey,
|
|
65
|
+
}))?.url;
|
|
66
|
+
if (!url) {
|
|
67
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No offramp url found.', { walletAddr }, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
68
|
+
}
|
|
69
|
+
return url;
|
|
70
|
+
}
|
|
71
|
+
exports.getMoonpayOffRampUrl = getMoonpayOffRampUrl;
|
|
72
|
+
async function getMoonpayOnRampSupportedCurrencies({ apiKey, }) {
|
|
73
|
+
const currencies = await (0, utils_1.sendGetRequest)({
|
|
74
|
+
uri: `${consts_1.API_BASE_URL}/on-ramp/moonpay-currencies`,
|
|
75
|
+
apiKey,
|
|
76
|
+
});
|
|
77
|
+
if (!currencies || !currencies.length) {
|
|
78
|
+
throw new errors_1.InternalFailureError(errors_1.ErrorCode.UnknownServerError, 'No supported currencies found.', {}, 'This is an internal error, please contact support.', 'https://docs.fun.xyz');
|
|
79
|
+
}
|
|
80
|
+
return currencies;
|
|
81
|
+
}
|
|
82
|
+
exports.getMoonpayOnRampSupportedCurrencies = getMoonpayOnRampSupportedCurrencies;
|
|
43
83
|
//# sourceMappingURL=endpoints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/moonpay/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,yCAA8D;AAC9D,uCAA6D;
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/moonpay/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,yCAA8D;AAC9D,uCAA6D;AAStD,KAAK,UAAU,sBAAsB,CAAC,EAC3C,GAAG,EACH,SAAS,EACT,MAAM,GACwB;IAC9B,MAAM,SAAS,GAAG,MAAM,IAAA,uBAAe,EAAC;QACtC,GAAG,EAAE,GAAG,qBAAY,6BAA6B;QACjD,IAAI,EAAE,EAAE,GAAG,EAAE,SAA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,CAAC,CAAA;IACF,IAAI,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,gCAAgC,EAChC,EAAE,EACF,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAnBD,kFAmBC"}
|
|
@@ -12,3 +12,36 @@ export interface GetMoonpayBuyQuoteForCreditCardRequest {
|
|
|
12
12
|
extraFeePercentage?: number;
|
|
13
13
|
areFeesIncluded?: boolean;
|
|
14
14
|
}
|
|
15
|
+
export interface GetMoonpayOnRampUrlRequest {
|
|
16
|
+
apiKey: string;
|
|
17
|
+
walletAddr: string;
|
|
18
|
+
currencyCode?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetMoonpayOffRampUrlRequest {
|
|
21
|
+
apiKey: string;
|
|
22
|
+
walletAddr: string;
|
|
23
|
+
}
|
|
24
|
+
export interface MoonpayCurrency {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
code: string;
|
|
28
|
+
createdAt?: string;
|
|
29
|
+
updatedAt?: string;
|
|
30
|
+
type?: string;
|
|
31
|
+
precision?: number;
|
|
32
|
+
addressRegex?: string;
|
|
33
|
+
testnetAddressRegex?: string;
|
|
34
|
+
maxAmount?: number;
|
|
35
|
+
maxBuyAmount?: number;
|
|
36
|
+
maxSellAmount?: number;
|
|
37
|
+
minAmount?: number;
|
|
38
|
+
minBuyAmount?: number;
|
|
39
|
+
minSellAmount?: number;
|
|
40
|
+
supportsAddressTag?: boolean;
|
|
41
|
+
addressTagRegex?: string;
|
|
42
|
+
supportsTestMode?: boolean;
|
|
43
|
+
isSuspended?: boolean;
|
|
44
|
+
isSupportedInUS?: boolean;
|
|
45
|
+
isSellSupported?: boolean;
|
|
46
|
+
notAllowedUSStates?: string[];
|
|
47
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSupportMessage = void 0;
|
|
4
|
+
const consts_1 = require("../../consts");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
async function sendSupportMessage({ title, description, userEmail, apiKey, }) {
|
|
7
|
+
try {
|
|
8
|
+
await (0, utils_1.sendPostRequest)({
|
|
9
|
+
uri: `${consts_1.API_BASE_URL}/support/send-message`,
|
|
10
|
+
body: { title, description, userEmail },
|
|
11
|
+
apiKey,
|
|
12
|
+
retryOptions: { maxAttempts: 1 },
|
|
13
|
+
});
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.sendSupportMessage = sendSupportMessage;
|
|
21
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/support/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uCAA6C;AAGtC,KAAK,UAAU,kBAAkB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,SAAS,EACT,MAAM,GACoB;IAC1B,IAAI,CAAC;QACH,MAAM,IAAA,uBAAe,EAAC;YACpB,GAAG,EAAE,GAAG,qBAAY,uBAAuB;YAC3C,IAAI,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE;YACvC,MAAM;YACN,YAAY,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE;SACjC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAjBD,gDAiBC"}
|
|
@@ -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/support/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/support/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CreateTurnkeyPrivateKeyRequest, CreateTurnkeyPrivateKeyResponse, CreateTurnkeySubOrgRequest } from './types';
|
|
2
|
+
export declare function createTurnkeySubOrg({ createSubOrgRequest, apiKey, }: CreateTurnkeySubOrgRequest): Promise<string>;
|
|
3
|
+
export declare function createTurnkeyPrivateKey({ signedRequest, apiKey, }: CreateTurnkeyPrivateKeyRequest): Promise<CreateTurnkeyPrivateKeyResponse>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTurnkeyPrivateKey = exports.createTurnkeySubOrg = void 0;
|
|
4
|
+
const consts_1 = require("../../consts");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
async function createTurnkeySubOrg({ createSubOrgRequest, apiKey, }) {
|
|
7
|
+
const res = await (0, utils_1.sendPostRequest)({
|
|
8
|
+
uri: `${consts_1.API_BASE_URL}/turnkey/sub-org`,
|
|
9
|
+
body: createSubOrgRequest,
|
|
10
|
+
apiKey,
|
|
11
|
+
});
|
|
12
|
+
return res;
|
|
13
|
+
}
|
|
14
|
+
exports.createTurnkeySubOrg = createTurnkeySubOrg;
|
|
15
|
+
async function createTurnkeyPrivateKey({ signedRequest, apiKey, }) {
|
|
16
|
+
const res = await (0, utils_1.sendPostRequest)({
|
|
17
|
+
uri: `${consts_1.API_BASE_URL}/turnkey/private-key`,
|
|
18
|
+
body: signedRequest,
|
|
19
|
+
apiKey,
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
id: res.id,
|
|
23
|
+
address: res.address,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.createTurnkeyPrivateKey = createTurnkeyPrivateKey;
|
|
27
|
+
//# sourceMappingURL=endpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../../../src/services/turnkey/endpoints.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uCAA6C;AAOtC,KAAK,UAAU,mBAAmB,CAAC,EACxC,mBAAmB,EACnB,MAAM,GACqB;IAC3B,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAe,EAAC;QAChC,GAAG,EAAE,GAAG,qBAAY,kBAAkB;QACtC,IAAI,EAAE,mBAAmB;QACzB,MAAM;KACP,CAAC,CAAA;IACF,OAAO,GAAG,CAAA;AACZ,CAAC;AAVD,kDAUC;AAEM,KAAK,UAAU,uBAAuB,CAAC,EAC5C,aAAa,EACb,MAAM,GACyB;IAC/B,MAAM,GAAG,GAAG,MAAM,IAAA,uBAAe,EAAC;QAChC,GAAG,EAAE,GAAG,qBAAY,sBAAsB;QAC1C,IAAI,EAAE,aAAa;QACnB,MAAM;KACP,CAAC,CAAA;IACF,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,OAAO,EAAE,GAAG,CAAC,OAAO;KACrB,CAAA;AACH,CAAC;AAbD,0DAaC"}
|
|
@@ -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/turnkey/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface CreateTurnkeySubOrgRequest {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
createSubOrgRequest: object;
|
|
4
|
+
}
|
|
5
|
+
export interface CreateTurnkeyPrivateKeyRequest {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
signedRequest: object;
|
|
8
|
+
}
|
|
9
|
+
export interface CreateTurnkeyPrivateKeyResponse {
|
|
10
|
+
id: string;
|
|
11
|
+
address: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/services/turnkey/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.roundToNearestBottomTenth = exports.generateRandomCheckoutSalt = void 0;
|
|
3
|
+
exports.roundToNearestBottomTenth = exports.generateRandomCheckoutSalt = exports.randomBytes = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
|
-
|
|
5
|
+
function randomBytes(length) {
|
|
6
6
|
const bytes = new Uint8Array(length);
|
|
7
7
|
for (let i = 0; i < length; i++) {
|
|
8
8
|
bytes[i] = Math.floor(Math.random() * 256);
|
|
9
9
|
}
|
|
10
10
|
return (0, viem_1.toHex)(bytes);
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
|
+
exports.randomBytes = randomBytes;
|
|
12
13
|
function generateRandomCheckoutSalt() {
|
|
13
14
|
return BigInt(randomBytes(32));
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../src/utils/checkout.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../src/utils/checkout.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAE5B,SAAgB,WAAW,CAAC,MAAc;IACxC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAA;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAA;IAC5C,CAAC;IACD,OAAO,IAAA,YAAK,EAAC,KAAK,CAAC,CAAA;AACrB,CAAC;AAND,kCAMC;AAED,SAAgB,0BAA0B;IACxC,OAAO,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAA;AAChC,CAAC;AAFD,gEAEC;AAED,SAAgB,yBAAyB,CAAC,CAAS;IACjD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAA;AAChC,CAAC;AAFD,8DAEC"}
|