@funkit/core 1.0.12 → 1.0.13
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare function getMoonPayCheckout(tokenAddress: string, chainId: number, walletAddress: string, amount: string): Promise<string>;
|
|
2
1
|
export declare function getOnRampUrl(walletAddr: string, currencyCode?: string): Promise<string>;
|
|
3
2
|
export declare function getMoonpayUrlSignature(url: string, isSandbox?: boolean, apiKey?: string): Promise<string>;
|
|
4
3
|
export declare function getMoonpayBuyQuoteForCreditCard({ currencyCode, baseCurrencyCode, quoteCurrencyAmount, baseCurrencyAmount, extraFeePercentage, areFeesIncluded, apiKey, }: {
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOnRampSupportedCurrencies = exports.getOffRampUrl = exports.getMoonpayBuyQuoteForCreditCard = exports.getMoonpayUrlSignature = exports.getOnRampUrl =
|
|
3
|
+
exports.getOnRampSupportedCurrencies = exports.getOffRampUrl = exports.getMoonpayBuyQuoteForCreditCard = exports.getMoonpayUrlSignature = exports.getOnRampUrl = void 0;
|
|
4
4
|
const constants_1 = require("../common/constants");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
6
|
const ApiUtils_1 = require("../utils/ApiUtils");
|
|
7
|
-
async function getMoonPayCheckout(tokenAddress, chainId, walletAddress, amount) {
|
|
8
|
-
const params = new URLSearchParams({
|
|
9
|
-
tokenAddress,
|
|
10
|
-
chainId: chainId.toString(),
|
|
11
|
-
walletAddress,
|
|
12
|
-
tokenAmount: amount, // converted to quoteCurrencyAmount in backend
|
|
13
|
-
}).toString();
|
|
14
|
-
const json = await (0, ApiUtils_1.sendGetRequest)(constants_1.API_URL, `on-ramp/moonpay-checkout/?${params}`);
|
|
15
|
-
return json.url;
|
|
16
|
-
}
|
|
17
|
-
exports.getMoonPayCheckout = getMoonPayCheckout;
|
|
18
7
|
async function getOnRampUrl(walletAddr, currencyCode) {
|
|
19
8
|
const endpoint = `on-ramp/${walletAddr}?provider=moonpay`;
|
|
20
9
|
if (currencyCode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnOffRampApis.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAmE;AAE5D,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"OnOffRampApis.js","sourceRoot":"","sources":["../../../src/apis/OnOffRampApis.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,sCAA2D;AAC3D,gDAAmE;AAE5D,KAAK,UAAU,YAAY,CAChC,UAAkB,EAClB,YAAqB;IAErB,MAAM,QAAQ,GAAG,WAAW,UAAU,mBAAmB,CAAA;IACzD,IAAI,YAAY,EAAE,CAAC;QACjB,QAAQ,CAAC,MAAM,CAAC,iBAAiB,YAAY,EAAE,CAAC,CAAA;IAClD,CAAC;IACD,MAAM,GAAG,GAAW,CAAC,MAAM,IAAA,yBAAc,EAAC,mBAAO,EAAE,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAA;IAClE,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,6BAAoB,CAC5B,kBAAS,CAAC,kBAAkB,EAC5B,sBAAsB,EACtB,EAAE,UAAU,EAAE,EACd,oDAAoD,EACpD,sBAAsB,CACvB,CAAA;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAnBD,oCAmBC;AAEM,KAAK,UAAU,sBAAsB,CAC1C,GAAW,EACX,SAAmB,EACnB,MAAe;IAEf,MAAM,SAAS,GAAG,MAAM,IAAA,0BAAe,EACrC,mBAAO,EACP,4BAA4B,EAC5B,EAAE,GAAG,EAAE,SAAS,EAAE,EAClB,MAAM,CACP,CAAA;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MA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|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
2
|
+
"name": "@funkit/core",
|
|
3
|
+
"version": "1.0.13",
|
|
4
|
+
"description": "Funkit core SDK provides feature-rich and extensible smart wallets built on account abstraction",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"author": "https://fun.xyz/",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@aws-sdk/client-secrets-manager": "^3.315.0",
|
|
14
|
+
"@ethersproject/abi": "^5.7.0",
|
|
15
|
+
"@ethersproject/contracts": "^5.7.0",
|
|
16
|
+
"@ethersproject/providers": "^5.7.2",
|
|
17
|
+
"@lifeomic/attempt": "^3.0.3",
|
|
18
|
+
"@uniswap/sdk": "^3.0.3",
|
|
19
|
+
"@uniswap/sdk-core": "^4.2.0",
|
|
20
|
+
"@uniswap/v3-core": "1.0.1",
|
|
21
|
+
"@uniswap/v3-sdk": "^3.11.0",
|
|
22
|
+
"abitype": "^0.10.2",
|
|
23
|
+
"big.js": "^6.2.1",
|
|
24
|
+
"dotenv": "^16.0.3",
|
|
25
|
+
"ethers": "5.7.2",
|
|
26
|
+
"node-fetch": "^2.6.11",
|
|
27
|
+
"uuid": "^9.0.0",
|
|
28
|
+
"viem": "^2.9.2"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/big.js": "^6.2.2",
|
|
32
|
+
"@types/chai": "^4.3.5",
|
|
33
|
+
"@types/mocha": "^10.0.1",
|
|
34
|
+
"@types/node-fetch": "^2.6.4",
|
|
35
|
+
"@types/uuid": "^9.0.1",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
37
|
+
"@typescript-eslint/parser": "^5.59.7",
|
|
38
|
+
"chai": "^4.3.7",
|
|
39
|
+
"eslint": "^8.41.0",
|
|
40
|
+
"eslint-config-prettier": "^8.8.0",
|
|
41
|
+
"eslint-plugin-import": "^2.27.5",
|
|
42
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
43
|
+
"eslint-plugin-unused-imports": "^2.0.0",
|
|
44
|
+
"husky": "^8.0.3",
|
|
45
|
+
"mocha": "^10.2.0",
|
|
46
|
+
"prettier": "^2.8.8",
|
|
47
|
+
"ts-mocha": "^10.0.0",
|
|
48
|
+
"ts-node": "^10.9.1",
|
|
49
|
+
"typescript": "^5.4.3"
|
|
50
|
+
},
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "git+https://github.com/fun-xyz/funkit.git",
|
|
54
|
+
"directory": "packages/core"
|
|
55
|
+
},
|
|
56
|
+
"keywords": [
|
|
57
|
+
"Fun Wallet",
|
|
58
|
+
"Ethereum",
|
|
59
|
+
"Account Abstraction",
|
|
60
|
+
"SDK"
|
|
61
|
+
],
|
|
62
|
+
"files": [
|
|
63
|
+
"dist/src",
|
|
64
|
+
"dist/index.d.ts",
|
|
65
|
+
"dist/index.js",
|
|
66
|
+
"dist/index.js.map",
|
|
67
|
+
"dist/fetch-polyfill.d.ts",
|
|
68
|
+
"dist/fetch-polyfill.js",
|
|
69
|
+
"dist/fetch-polyfill.js.map"
|
|
70
|
+
],
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/fun-xyz/funkit-core/issues"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://github.com/fun-xyz/funkit-core",
|
|
75
|
+
"scripts": {
|
|
76
|
+
"build": "rm -rf dist && tsc",
|
|
77
|
+
"build:watch": "rm -rf dist && tsc -w",
|
|
78
|
+
"test": "ts-mocha --exit tests/tenderly/*.ts --exit",
|
|
79
|
+
"test-tenderly": "ts-mocha --exit tests/tenderly/*.ts",
|
|
80
|
+
"test-aws": "env ts-mocha",
|
|
81
|
+
"test-goerli": "env ts-mocha --exit tests/goerli/*.ts",
|
|
82
|
+
"local-test-tenderly": "env NODE_ENV=local ts-mocha --exit tests/tenderly/*.ts",
|
|
83
|
+
"local-test-goerli": "env NODE_ENV=local ts-mocha --exit tests/goerli/*.ts",
|
|
84
|
+
"staging-test-tenderly": "env NODE_ENV=staging ts-mocha --exit tests/tenderly/*.ts",
|
|
85
|
+
"staging-test-goerli": "env NODE_ENV=staging ts-mocha --exit tests/goerli/*.ts",
|
|
86
|
+
"staging-test-arbitrum": "env NODE_ENV=staging ts-mocha --exit tests/arbitrum/*.ts",
|
|
87
|
+
"staging-test-optimism": "env NODE_ENV=staging ts-mocha --exit tests/optimism/*.ts",
|
|
88
|
+
"staging-test-polygon": "env NODE_ENV=staging ts-mocha --exit tests/polygon/*.ts",
|
|
89
|
+
"load": "node test/loader.js",
|
|
90
|
+
"format": "prettier --write .",
|
|
91
|
+
"lint": "eslint --ext .ts,.tsx './**/*.{ts,tsx}'",
|
|
92
|
+
"lint:fix": "eslint --ext .ts,.tsx './**/*.{ts,tsx}' --fix",
|
|
93
|
+
"add-token": "ts-node tests/addToken.ts",
|
|
94
|
+
"fund-tenderly-account": "ts-node tests/scripts/fundAccount.ts"
|
|
95
|
+
}
|
|
96
|
+
}
|