@funkit/connect 9.10.0 → 9.11.0
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 +22 -0
- package/dist/__generated__/default_feature_gates.d.ts +1 -0
- package/dist/clients/polymarket.js +74 -27
- package/dist/clients/rolly.d.ts +42 -0
- package/dist/clients/rolly.js +91 -0
- package/dist/components/FunSelectBrokerage/FunSelectBrokerage.d.ts +5 -4
- package/dist/consts/bluvo.d.ts +27 -0
- package/dist/domains/swapped.d.ts +1 -1
- package/dist/hooks/queries/useSwappedExchanges.d.ts +14 -0
- package/dist/hooks/useExchangeOptions.d.ts +10 -0
- package/dist/hooks/useTokenTransfer.d.ts +2 -1
- package/dist/index.js +2662 -2343
- package/dist/modals/CheckoutModal/Brokerage/SelectBrokerage.d.ts +1 -1
- package/dist/modals/CheckoutModal/InputAmount/useMeld.d.ts +1 -1
- package/dist/utils/openExternalFlowPopup.d.ts +21 -0
- package/dist/wallets/walletConnectors/bifrostWallet/bifrostWallet.js +2 -2
- package/dist/wallets/walletConnectors/bitgetWallet/bitgetWallet.js +2 -2
- package/dist/wallets/walletConnectors/bybitWallet/bybitWallet.js +2 -2
- package/dist/wallets/walletConnectors/clvWallet/clvWallet.js +2 -2
- package/dist/wallets/walletConnectors/coin98Wallet/coin98Wallet.js +2 -2
- package/dist/wallets/walletConnectors/coreWallet/coreWallet.js +2 -2
- package/dist/wallets/walletConnectors/foxWallet/foxWallet.js +2 -2
- package/dist/wallets/walletConnectors/frontierWallet/frontierWallet.js +2 -2
- package/dist/wallets/walletConnectors/gateWallet/gateWallet.js +2 -2
- package/dist/wallets/walletConnectors/index.js +43 -43
- package/dist/wallets/walletConnectors/metaMaskWallet/metaMaskWallet.js +2 -2
- package/dist/wallets/walletConnectors/okxWallet/okxWallet.js +2 -2
- package/dist/wallets/walletConnectors/rainbowWallet/rainbowWallet.js +2 -2
- package/dist/wallets/walletConnectors/roninWallet/roninWallet.js +2 -2
- package/dist/wallets/walletConnectors/safepalWallet/safepalWallet.js +2 -2
- package/dist/wallets/walletConnectors/subWallet/subWallet.js +2 -2
- package/dist/wallets/walletConnectors/tokenPocketWallet/tokenPocketWallet.js +2 -2
- package/dist/wallets/walletConnectors/trustWallet/trustWallet.js +2 -2
- package/dist/wallets/walletConnectors/zerionWallet/zerionWallet.js +2 -2
- package/package.json +5 -5
- package/dist/wallets/walletConnectors/{chunk-VMMROPXK.js → chunk-34HACM5U.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-3ZJN3PXP.js → chunk-5TN5Z2WY.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OD6B2ISG.js → chunk-6DRCY52E.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IRHK6SOW.js → chunk-7V33VJAL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZJJWGKB6.js → chunk-APHCF4DT.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-7IEUTLHY.js → chunk-DEFRRPXB.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-OSOB6QYX.js → chunk-FG2LDVXL.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-ZL6XCMV5.js → chunk-HRDPUW3V.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-UYW6MV74.js → chunk-HXWUH73P.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-UFYNHHDU.js → chunk-KWX2SYU2.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-AZYMJ4C6.js → chunk-LCIPVVH5.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-FWM4KTOV.js → chunk-T4ROGPMF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-J3PJOMO7.js → chunk-UDTBQV4Q.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-55VS2NKG.js → chunk-V6UOWTEZ.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-LEAZMT5Y.js → chunk-VJZWNQOF.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-RZQ4B4Z7.js → chunk-XVBSJCW5.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-IMNI4AGV.js → chunk-YIEASHLS.js} +3 -3
- package/dist/wallets/walletConnectors/{chunk-YGMU5VWD.js → chunk-ZPSPK6LH.js} +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 9.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6a74690: feat: automatically block token addresses as a withdrawal recipient
|
|
8
|
+
- 1c776f1: feat(connect): add Rolly deposit actions factory via VaultDepositor
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- cae480a: aave theme implementation
|
|
13
|
+
- b74cffc: Rename Lighter "Secure" withdrawal label to "Native Bridge"
|
|
14
|
+
- da69de2: chore: extend wagmi peer range to <=3.6.1
|
|
15
|
+
- 77723e0: feat: add withdrawal empty selection feature gate
|
|
16
|
+
- de42d91: Add Bybit as a brokerage option, routed through Swapped Connect via the
|
|
17
|
+
existing `/fops` endpoint with a new `CRYPTO_TO_CRYPTO` rail config.
|
|
18
|
+
- 1a67f88: revert: lighter decimal token decimal check
|
|
19
|
+
- Updated dependencies [cae480a]
|
|
20
|
+
- Updated dependencies [ad83ea0]
|
|
21
|
+
- Updated dependencies [de42d91]
|
|
22
|
+
- Updated dependencies [81e367b]
|
|
23
|
+
- @funkit/api-base@4.2.1
|
|
24
|
+
|
|
3
25
|
## 9.10.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
readonly 'compliance-review-blocker': false;
|
|
3
3
|
readonly 'enable-across-wallet-flow': false;
|
|
4
|
+
readonly 'enable-empty-withdrawal-selection': false;
|
|
4
5
|
readonly 'enable-permit-toggle': false;
|
|
5
6
|
readonly 'enable-swapped-exchanges': false;
|
|
6
7
|
readonly 'exact-in': false;
|
|
@@ -14,8 +14,11 @@ import { polygon } from "viem/chains";
|
|
|
14
14
|
import { exhaustiveCheck, formatAddress } from "@funkit/utils";
|
|
15
15
|
|
|
16
16
|
// src/consts/bluvo.tsx
|
|
17
|
-
import {
|
|
18
|
-
|
|
17
|
+
import {
|
|
18
|
+
ETHEREAL_API_KEY,
|
|
19
|
+
FormOfPaymentType
|
|
20
|
+
} from "@funkit/api-base";
|
|
21
|
+
import React7 from "react";
|
|
19
22
|
|
|
20
23
|
// src/components/Icons/BinanceIcon.tsx
|
|
21
24
|
import React from "react";
|
|
@@ -47,10 +50,51 @@ var BinanceIcon = ({ size = 24 }) => {
|
|
|
47
50
|
);
|
|
48
51
|
};
|
|
49
52
|
|
|
50
|
-
// src/components/Icons/
|
|
53
|
+
// src/components/Icons/BybitIcon.tsx
|
|
51
54
|
import React2 from "react";
|
|
52
|
-
var
|
|
55
|
+
var BybitIcon = ({ size = 24 }) => {
|
|
53
56
|
return /* @__PURE__ */ React2.createElement(
|
|
57
|
+
"svg",
|
|
58
|
+
{
|
|
59
|
+
width: size,
|
|
60
|
+
height: size,
|
|
61
|
+
viewBox: "0 0 20 20",
|
|
62
|
+
fill: "none",
|
|
63
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
64
|
+
},
|
|
65
|
+
/* @__PURE__ */ React2.createElement("rect", { width: "20", height: "20", rx: "4", fill: "#0B0E11" }),
|
|
66
|
+
/* @__PURE__ */ React2.createElement("g", { transform: "translate(2 6.78) scale(0.184)" }, /* @__PURE__ */ React2.createElement("path", { d: "M62.0083 25.3572V3H66.5022V25.3572H62.0083Z", fill: "#F7A600" }), /* @__PURE__ */ React2.createElement(
|
|
67
|
+
"path",
|
|
68
|
+
{
|
|
69
|
+
d: "M9.63407 31.9983H0V9.64111H9.24666C13.7406 9.64111 16.3591 12.0903 16.3591 15.9214C16.3591 18.4013 14.6774 20.0039 13.5134 20.5375C14.9028 21.1652 16.6813 22.5779 16.6813 25.5624C16.6813 29.7373 13.7406 31.9983 9.63407 31.9983ZM8.89096 13.5355H4.4939V18.6852H8.89096C10.7981 18.6852 11.8652 17.6488 11.8652 16.1095C11.8652 14.5719 10.7981 13.5355 8.89096 13.5355ZM9.18151 22.6104H4.4939V28.1056H9.18151C11.2189 28.1056 12.1874 26.8503 12.1874 25.3418C12.1874 23.835 11.2171 22.6104 9.18151 22.6104Z",
|
|
70
|
+
fill: "white"
|
|
71
|
+
}
|
|
72
|
+
), /* @__PURE__ */ React2.createElement(
|
|
73
|
+
"path",
|
|
74
|
+
{
|
|
75
|
+
d: "M30.3882 22.8293V31.9983H25.926V22.8293L19.0073 9.64111H23.8886L28.1888 18.6527L32.4239 9.64111H37.3052L30.3882 22.8293Z",
|
|
76
|
+
fill: "white"
|
|
77
|
+
}
|
|
78
|
+
), /* @__PURE__ */ React2.createElement(
|
|
79
|
+
"path",
|
|
80
|
+
{
|
|
81
|
+
d: "M50.0457 31.9983H40.4116V9.64111H49.6583C54.1522 9.64111 56.7707 12.0903 56.7707 15.9214C56.7707 18.4013 55.089 20.0039 53.925 20.5375C55.3144 21.1652 57.093 22.5779 57.093 25.5624C57.093 29.7373 54.1522 31.9983 50.0457 31.9983ZM49.3026 13.5355H44.9055V18.6852H49.3026C51.2097 18.6852 52.2768 17.6488 52.2768 16.1095C52.2768 14.5719 51.2097 13.5355 49.3026 13.5355ZM49.5931 22.6104H44.9055V28.1056H49.5931C51.6305 28.1056 52.599 26.8503 52.599 25.3418C52.599 23.835 51.6305 22.6104 49.5931 22.6104Z",
|
|
82
|
+
fill: "white"
|
|
83
|
+
}
|
|
84
|
+
), /* @__PURE__ */ React2.createElement(
|
|
85
|
+
"path",
|
|
86
|
+
{
|
|
87
|
+
d: "M80.986 13.5355V32H76.4921V13.5355H70.4785V9.64111H86.9996V13.5355H80.986Z",
|
|
88
|
+
fill: "white"
|
|
89
|
+
}
|
|
90
|
+
))
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// src/components/Icons/CoinbaseIcon.tsx
|
|
95
|
+
import React3 from "react";
|
|
96
|
+
var CoinbaseIcon = ({ size = 24 }) => {
|
|
97
|
+
return /* @__PURE__ */ React3.createElement(
|
|
54
98
|
"svg",
|
|
55
99
|
{
|
|
56
100
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -59,8 +103,8 @@ var CoinbaseIcon = ({ size = 24 }) => {
|
|
|
59
103
|
viewBox: "0 0 20 20",
|
|
60
104
|
fill: "none"
|
|
61
105
|
},
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ React3.createElement("rect", { width: "20", height: "20", rx: "4", fill: "#2C5FF6" }),
|
|
107
|
+
/* @__PURE__ */ React3.createElement(
|
|
64
108
|
"path",
|
|
65
109
|
{
|
|
66
110
|
d: "M9.99 13.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5c1.76 0 3.22 1.305 3.46 3h3.52A7.005 7.005 0 0 0 9.99 3c-3.86 0-7 3.14-7 7s3.14 7 7 7c3.69 0 6.725-2.87 6.98-6.5h-3.52c-.24 1.695-1.7 3-3.46 3Z",
|
|
@@ -71,9 +115,9 @@ var CoinbaseIcon = ({ size = 24 }) => {
|
|
|
71
115
|
};
|
|
72
116
|
|
|
73
117
|
// src/components/Icons/GateIoIcon.tsx
|
|
74
|
-
import
|
|
118
|
+
import React4 from "react";
|
|
75
119
|
var GateIoIcon = ({ size = 24 }) => {
|
|
76
|
-
return /* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ React4.createElement(
|
|
77
121
|
"svg",
|
|
78
122
|
{
|
|
79
123
|
width: size,
|
|
@@ -82,8 +126,8 @@ var GateIoIcon = ({ size = 24 }) => {
|
|
|
82
126
|
fill: "none",
|
|
83
127
|
xmlns: "http://www.w3.org/2000/svg"
|
|
84
128
|
},
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ React4.createElement("rect", { width: "25", height: "25", rx: "5.357", fill: "#fff" }),
|
|
130
|
+
/* @__PURE__ */ React4.createElement("g", { clipPath: "url(#a)" }, /* @__PURE__ */ React4.createElement(
|
|
87
131
|
"mask",
|
|
88
132
|
{
|
|
89
133
|
id: "b",
|
|
@@ -94,8 +138,8 @@ var GateIoIcon = ({ size = 24 }) => {
|
|
|
94
138
|
height: "15",
|
|
95
139
|
style: { maskType: "luminance" }
|
|
96
140
|
},
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
), /* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ React4.createElement("path", { d: "M5 5h15v15H5V5Z", fill: "#fff" })
|
|
142
|
+
), /* @__PURE__ */ React4.createElement("g", { mask: "url(#b)" }, /* @__PURE__ */ React4.createElement(
|
|
99
143
|
"path",
|
|
100
144
|
{
|
|
101
145
|
fillRule: "evenodd",
|
|
@@ -103,7 +147,7 @@ var GateIoIcon = ({ size = 24 }) => {
|
|
|
103
147
|
d: "M12.5 16.625a4.125 4.125 0 0 1 0-8.25V5a7.5 7.5 0 1 0 7.5 7.5h-3.375a4.125 4.125 0 0 1-4.125 4.125Z",
|
|
104
148
|
fill: "#2354E6"
|
|
105
149
|
}
|
|
106
|
-
)), /* @__PURE__ */
|
|
150
|
+
)), /* @__PURE__ */ React4.createElement(
|
|
107
151
|
"path",
|
|
108
152
|
{
|
|
109
153
|
fillRule: "evenodd",
|
|
@@ -112,14 +156,14 @@ var GateIoIcon = ({ size = 24 }) => {
|
|
|
112
156
|
fill: "#17E6A1"
|
|
113
157
|
}
|
|
114
158
|
)),
|
|
115
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ React4.createElement("defs", null, /* @__PURE__ */ React4.createElement("clipPath", { id: "a" }, /* @__PURE__ */ React4.createElement("path", { fill: "#fff", transform: "translate(5 5)", d: "M0 0h15v15H0z" })))
|
|
116
160
|
);
|
|
117
161
|
};
|
|
118
162
|
|
|
119
163
|
// src/components/Icons/GeminiIcon.tsx
|
|
120
|
-
import
|
|
164
|
+
import React5 from "react";
|
|
121
165
|
var GeminiIcon = ({ size = 24 }) => {
|
|
122
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ React5.createElement(
|
|
123
167
|
"svg",
|
|
124
168
|
{
|
|
125
169
|
width: size,
|
|
@@ -128,14 +172,14 @@ var GeminiIcon = ({ size = 24 }) => {
|
|
|
128
172
|
fill: "none",
|
|
129
173
|
xmlns: "http://www.w3.org/2000/svg"
|
|
130
174
|
},
|
|
131
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ React5.createElement(
|
|
132
176
|
"path",
|
|
133
177
|
{
|
|
134
178
|
d: "M16 0H4a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V4a4 4 0 0 0-4-4",
|
|
135
179
|
fill: "#58C8E6"
|
|
136
180
|
}
|
|
137
181
|
),
|
|
138
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ React5.createElement(
|
|
139
183
|
"path",
|
|
140
184
|
{
|
|
141
185
|
d: "M15.025 7.686H8.661a3.21 3.21 0 0 1 3.182-2.746 3.21 3.21 0 0 1 3.182 2.746m-3.653.94v2.746H8.626V8.626zm-.035 3.686a3.21 3.21 0 0 1-3.182 2.746 3.21 3.21 0 0 1-3.183-2.746zm-6.365-.94A3.23 3.23 0 0 1 7.686 8.66v2.71zm10.053-2.746a3.23 3.23 0 0 1-2.711 2.71v-2.71zM11.843 4C9.734 4 7.937 5.624 7.712 7.712A4.18 4.18 0 0 0 4 11.843 4.16 4.16 0 0 0 8.157 16c2.109 0 3.909-1.624 4.131-3.712C14.376 12.063 16 10.266 16 8.157A4.16 4.16 0 0 0 11.843 4",
|
|
@@ -146,9 +190,9 @@ var GeminiIcon = ({ size = 24 }) => {
|
|
|
146
190
|
};
|
|
147
191
|
|
|
148
192
|
// src/components/Icons/KrakenIcon.tsx
|
|
149
|
-
import
|
|
193
|
+
import React6 from "react";
|
|
150
194
|
var KrakenIcon = ({ size = 24 }) => {
|
|
151
|
-
return /* @__PURE__ */
|
|
195
|
+
return /* @__PURE__ */ React6.createElement(
|
|
152
196
|
"svg",
|
|
153
197
|
{
|
|
154
198
|
width: size,
|
|
@@ -157,14 +201,14 @@ var KrakenIcon = ({ size = 24 }) => {
|
|
|
157
201
|
fill: "none",
|
|
158
202
|
xmlns: "http://www.w3.org/2000/svg"
|
|
159
203
|
},
|
|
160
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ React6.createElement(
|
|
161
205
|
"path",
|
|
162
206
|
{
|
|
163
207
|
d: "M16 0H4a4 4 0 0 0-4 4v12a4 4 0 0 0 4 4h12a4 4 0 0 0 4-4V4a4 4 0 0 0-4-4",
|
|
164
208
|
fill: "#5741D9"
|
|
165
209
|
}
|
|
166
210
|
),
|
|
167
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ React6.createElement(
|
|
168
212
|
"path",
|
|
169
213
|
{
|
|
170
214
|
d: "M4 11.78v-.67a6.4 6.4 0 0 1 .83-3.26 6 6 0 0 1 2.64-2.3A6 6 0 0 1 9.89 5q1.84-.02 3.4.96a5.6 5.6 0 0 1 2.64 4.18q.1.9.07 1.82l-.01.98q0 .22-.05.43c-.15.54-.8.8-1.27.49a.8.8 0 0 1-.35-.57l-.04-.48v-1.98q0-.4-.26-.68a.83.83 0 0 0-1.17-.04 1 1 0 0 0-.32.65v.28l-.01 2.19c0 .41-.33.73-.76.76a1 1 0 0 1-.56-.17.8.8 0 0 1-.3-.48l-.03-.33v-2.2a1 1 0 0 0-.26-.65.84.84 0 0 0-1.25.02 1 1 0 0 0-.24.64V13q0 .28-.1.54a1 1 0 0 1-.32.34.8.8 0 0 1-1.17-.4 1 1 0 0 1-.07-.38V11q.01-.24-.05-.47a.9.9 0 0 0-.72-.62c-.37-.06-.65.11-.85.4q-.14.22-.14.46v2q.02.3-.04.59a.84.84 0 0 1-.87.63.9.9 0 0 1-.74-.63A1 1 0 0 1 4 13z",
|
|
@@ -180,29 +224,32 @@ var BLUVO_MIN_DEPOSIT_BY_CUSTOMER = {
|
|
|
180
224
|
};
|
|
181
225
|
var BLUVO_EXCHANGES = {
|
|
182
226
|
coinbase: {
|
|
183
|
-
icon: (size) => /* @__PURE__ */
|
|
227
|
+
icon: (size) => /* @__PURE__ */ React7.createElement(CoinbaseIcon, { size }),
|
|
184
228
|
name: "Coinbase"
|
|
185
229
|
},
|
|
186
230
|
binance: {
|
|
187
|
-
icon: (size) => /* @__PURE__ */
|
|
231
|
+
icon: (size) => /* @__PURE__ */ React7.createElement(BinanceIcon, { size }),
|
|
188
232
|
name: "Binance"
|
|
189
233
|
},
|
|
190
234
|
gemini: {
|
|
191
|
-
icon: (size) => /* @__PURE__ */
|
|
235
|
+
icon: (size) => /* @__PURE__ */ React7.createElement(GeminiIcon, { size }),
|
|
192
236
|
name: "Gemini"
|
|
193
237
|
},
|
|
194
238
|
kraken: {
|
|
195
|
-
icon: (size) => /* @__PURE__ */
|
|
239
|
+
icon: (size) => /* @__PURE__ */ React7.createElement(KrakenIcon, { size }),
|
|
196
240
|
name: "Kraken"
|
|
197
241
|
},
|
|
198
242
|
gate: {
|
|
199
|
-
icon: (size) => /* @__PURE__ */
|
|
243
|
+
icon: (size) => /* @__PURE__ */ React7.createElement(GateIoIcon, { size }),
|
|
200
244
|
name: "Gate"
|
|
201
245
|
}
|
|
202
246
|
};
|
|
203
247
|
function getExchangeName(brokerType) {
|
|
204
248
|
return BLUVO_EXCHANGES[brokerType].name;
|
|
205
249
|
}
|
|
250
|
+
var FOP_COMPONENT_ICONS = {
|
|
251
|
+
[FormOfPaymentType.BYBIT]: (size) => /* @__PURE__ */ React7.createElement(BybitIcon, { size })
|
|
252
|
+
};
|
|
206
253
|
|
|
207
254
|
// src/domains/paymentMethods.ts
|
|
208
255
|
function createPaymentMethodInfo(params) {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rolly deposit via VaultDepositor.
|
|
3
|
+
*
|
|
4
|
+
* Deposit flow wraps Rolly's `depositToken()` call inside the VaultDepositor
|
|
5
|
+
* proxy so it composes with EXACT_INPUT quoting:
|
|
6
|
+
* 1. approve(USDT, VAULT_DEPOSITOR[mainnet], MAX)
|
|
7
|
+
* 2. VAULT_DEPOSITOR[mainnet].deposit(USDT, ROLLY_VAULT,
|
|
8
|
+
* depositToken(recipient, AMOUNT_PLACEHOLDER), 0)
|
|
9
|
+
* VaultDepositor pulls the msg.sender's full USDT balance at exec time and
|
|
10
|
+
* substitutes AMOUNT_PLACEHOLDER with the actual amount before calling
|
|
11
|
+
* Rolly.depositToken, so the arrival amount doesn't need to be known at quote
|
|
12
|
+
* time.
|
|
13
|
+
*/
|
|
14
|
+
import { type Address } from 'viem';
|
|
15
|
+
import type { FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext/types';
|
|
16
|
+
/** Rolly rollup deposit contract on Ethereum mainnet (UUPS proxy). */
|
|
17
|
+
export declare const ROLLY_VAULT_ADDRESS: `0x${string}`;
|
|
18
|
+
/** Ethereum mainnet USDT — Rolly's source deposit token. */
|
|
19
|
+
export declare const MAINNET_USDT: `0x${string}`;
|
|
20
|
+
/** VaultDepositor on Ethereum mainnet — same address used by other VaultDepositor flows. */
|
|
21
|
+
export declare const VAULT_DEPOSITOR_MAINNET: `0x${string}`;
|
|
22
|
+
/** Sentinel value the VaultDepositor replaces with the actual deposit amount at exec time. */
|
|
23
|
+
export declare const AMOUNT_PLACEHOLDER = 115792089237316195423570985008687907853269984665640564039457584007912570601199n;
|
|
24
|
+
export interface RollyDepositActionsConfig {
|
|
25
|
+
/** Address credited on the Rolly rollup (typically the connected wallet). */
|
|
26
|
+
recipientAddress: Address | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds the `generateActionsParams` callback for a Rolly deposit routed
|
|
30
|
+
* through VaultDepositor.
|
|
31
|
+
*
|
|
32
|
+
* Usage:
|
|
33
|
+
* ```ts
|
|
34
|
+
* const checkoutConfig: FunkitCheckoutConfig = {
|
|
35
|
+
* // ...
|
|
36
|
+
* generateActionsParams: createRollyDepositActions({
|
|
37
|
+
* recipientAddress: walletAddress,
|
|
38
|
+
* }),
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function createRollyDepositActions(config: RollyDepositActionsConfig): () => Promise<FunkitCheckoutActionParams[]>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/clients/rolly.tsx
|
|
4
|
+
import {
|
|
5
|
+
encodeFunctionData,
|
|
6
|
+
erc20Abi,
|
|
7
|
+
getAddress,
|
|
8
|
+
maxUint256
|
|
9
|
+
} from "viem";
|
|
10
|
+
var ROLLY_VAULT_ADDRESS = getAddress(
|
|
11
|
+
"0x6e6B003F801c4532350858431d893B04317734C4"
|
|
12
|
+
);
|
|
13
|
+
var MAINNET_USDT = getAddress(
|
|
14
|
+
"0xdAC17F958D2ee523a2206206994597C13D831ec7"
|
|
15
|
+
);
|
|
16
|
+
var VAULT_DEPOSITOR_MAINNET = getAddress(
|
|
17
|
+
"0x64Aa32cd125FB32F4286d2bAC3a7346edFffEe2A"
|
|
18
|
+
);
|
|
19
|
+
var AMOUNT_PLACEHOLDER = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffdeadbeefn;
|
|
20
|
+
var ROLLY_VAULT_ABI = [
|
|
21
|
+
{
|
|
22
|
+
name: "depositToken",
|
|
23
|
+
type: "function",
|
|
24
|
+
stateMutability: "nonpayable",
|
|
25
|
+
inputs: [
|
|
26
|
+
{ name: "to", type: "address" },
|
|
27
|
+
{ name: "amount", type: "uint256" }
|
|
28
|
+
],
|
|
29
|
+
outputs: []
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
var VAULT_DEPOSITOR_ABI = [
|
|
33
|
+
{
|
|
34
|
+
name: "deposit",
|
|
35
|
+
type: "function",
|
|
36
|
+
stateMutability: "nonpayable",
|
|
37
|
+
inputs: [
|
|
38
|
+
{ name: "token", type: "address" },
|
|
39
|
+
{ name: "vault", type: "address" },
|
|
40
|
+
{ name: "callData", type: "bytes" },
|
|
41
|
+
{ name: "minAmountOut", type: "uint256" }
|
|
42
|
+
],
|
|
43
|
+
outputs: [{ name: "returnData", type: "bytes" }]
|
|
44
|
+
}
|
|
45
|
+
];
|
|
46
|
+
function createRollyDepositActions(config) {
|
|
47
|
+
const { recipientAddress } = config;
|
|
48
|
+
return async () => {
|
|
49
|
+
if (!recipientAddress) {
|
|
50
|
+
throw new Error(
|
|
51
|
+
"Please connect your wallet before starting a Rolly deposit"
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
const depositCalldata = encodeFunctionData({
|
|
55
|
+
abi: ROLLY_VAULT_ABI,
|
|
56
|
+
functionName: "depositToken",
|
|
57
|
+
args: [recipientAddress, AMOUNT_PLACEHOLDER]
|
|
58
|
+
});
|
|
59
|
+
return [
|
|
60
|
+
// Step 1: Reset USDT approval
|
|
61
|
+
{
|
|
62
|
+
contractAbi: erc20Abi,
|
|
63
|
+
contractAddress: MAINNET_USDT,
|
|
64
|
+
functionName: "approve",
|
|
65
|
+
functionArgs: [VAULT_DEPOSITOR_MAINNET, 0n]
|
|
66
|
+
},
|
|
67
|
+
// Step 2: Approve USDT to VaultDepositor (infinite)
|
|
68
|
+
{
|
|
69
|
+
contractAbi: erc20Abi,
|
|
70
|
+
contractAddress: MAINNET_USDT,
|
|
71
|
+
functionName: "approve",
|
|
72
|
+
functionArgs: [VAULT_DEPOSITOR_MAINNET, maxUint256]
|
|
73
|
+
},
|
|
74
|
+
// Step 3: VaultDepositor pulls USDT, swaps placeholder, forwards to
|
|
75
|
+
// Rolly.depositToken → credits recipient on the rollup
|
|
76
|
+
{
|
|
77
|
+
contractAbi: VAULT_DEPOSITOR_ABI,
|
|
78
|
+
contractAddress: VAULT_DEPOSITOR_MAINNET,
|
|
79
|
+
functionName: "deposit",
|
|
80
|
+
functionArgs: [MAINNET_USDT, ROLLY_VAULT_ADDRESS, depositCalldata, 0n]
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
AMOUNT_PLACEHOLDER,
|
|
87
|
+
MAINNET_USDT,
|
|
88
|
+
ROLLY_VAULT_ADDRESS,
|
|
89
|
+
VAULT_DEPOSITOR_MAINNET,
|
|
90
|
+
createRollyDepositActions
|
|
91
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type BrokerageOption } from '../../consts/bluvo';
|
|
3
3
|
interface FunSelectBrokerageProps {
|
|
4
4
|
isDisabled?: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
options: ReadonlyArray<BrokerageOption>;
|
|
6
|
+
onSelect: (option: BrokerageOption) => void;
|
|
7
|
+
selectedKey: string | undefined;
|
|
7
8
|
}
|
|
8
|
-
export declare function FunSelectBrokerage({ isDisabled, onSelect,
|
|
9
|
+
export declare function FunSelectBrokerage({ isDisabled, options, onSelect, selectedKey, }: FunSelectBrokerageProps): React.JSX.Element;
|
|
9
10
|
export {};
|
package/dist/consts/bluvo.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UseBluvoFlowHook } from '@bluvo/react';
|
|
2
|
+
import { type GenericFormOfPayment } from '@funkit/api-base';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
export type BluvoQuote = UseBluvoFlowHook['quote'];
|
|
4
5
|
export type BluvoWithdrawableBalance = UseBluvoFlowHook['walletBalances'];
|
|
@@ -44,3 +45,29 @@ export declare const SUPPORTED_EXCHANGES: readonly [{
|
|
|
44
45
|
export declare const BLUVO_EXCHANGES: Readonly<Record<BluvoExchangeType, BluvoExchangeInfo>>;
|
|
45
46
|
export declare function getExchangeIcon(brokerType: BluvoExchangeType, size: number): React.JSX.Element | null;
|
|
46
47
|
export declare function getExchangeName(brokerType: BluvoExchangeType): string;
|
|
48
|
+
export declare enum BrokerageKind {
|
|
49
|
+
BLUVO = "bluvo",
|
|
50
|
+
SWAPPED = "swapped"
|
|
51
|
+
}
|
|
52
|
+
export type BrokerageOption = {
|
|
53
|
+
name: string;
|
|
54
|
+
icon: React.ReactNode;
|
|
55
|
+
status: BluvoExchangeStatus;
|
|
56
|
+
hasActiveConnection: boolean;
|
|
57
|
+
} & ({
|
|
58
|
+
kind: BrokerageKind.BLUVO;
|
|
59
|
+
exchange: BluvoExchangeType;
|
|
60
|
+
} | {
|
|
61
|
+
kind: BrokerageKind.SWAPPED;
|
|
62
|
+
fop: GenericFormOfPayment;
|
|
63
|
+
});
|
|
64
|
+
export interface BluvoExchangeOptionInput {
|
|
65
|
+
exchange: BluvoExchangeType;
|
|
66
|
+
exchangeName: string;
|
|
67
|
+
exchangeIcon: React.ReactNode;
|
|
68
|
+
status: BluvoExchangeStatus;
|
|
69
|
+
hasActiveConnection: boolean;
|
|
70
|
+
}
|
|
71
|
+
export declare function bluvoExchangeToBrokerageOption(option: BluvoExchangeOptionInput): BrokerageOption;
|
|
72
|
+
export declare function fopToBrokerageOption(fop: GenericFormOfPayment, iconSize: number): BrokerageOption;
|
|
73
|
+
export declare function brokerageOptionKey(option: BrokerageOption): string;
|
|
@@ -4,7 +4,7 @@ export declare const FOPS_STALE_TIME: number;
|
|
|
4
4
|
* Validates FOPs by checking icon URL, embedded flow URL, and payment group.
|
|
5
5
|
* Deduplicates generic FOPs whose fopType already appears in saved FOPs.
|
|
6
6
|
*/
|
|
7
|
-
export declare function validateFops(res: GetFopsResponse, logTag: 'useFops' | 'useWithdrawFops'): GetFopsResponse;
|
|
7
|
+
export declare function validateFops(res: GetFopsResponse, logTag: 'useFops' | 'useWithdrawFops' | 'useSwappedExchanges'): GetFopsResponse;
|
|
8
8
|
/**
|
|
9
9
|
* Sorts fops by a priority order list (array of fopType strings, index = priority).
|
|
10
10
|
* Fops not in the list are sorted by max checkout limit descending.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches Swapped exchange options by calling /fops with a CRYPTO_TO_CRYPTO
|
|
3
|
+
* rail config. The rail config is what causes the backend to return exchange
|
|
4
|
+
* FOPs (e.g. Bybit); however, this hook does not guard against the backend
|
|
5
|
+
* returning non-Swapped or non-exchange FOPs in the future — callers should
|
|
6
|
+
* be aware that the response may evolve as the BE adds rail types.
|
|
7
|
+
*
|
|
8
|
+
* Gated by the `enable-swapped-exchanges` Statsig feature gate — when off,
|
|
9
|
+
* the query is disabled and the response is empty.
|
|
10
|
+
*/
|
|
11
|
+
export declare const useSwappedExchanges: () => import("@tanstack/react-query").UseQueryResult<{
|
|
12
|
+
genericFormsOfPayments: import("@funkit/api-base").GenericFormOfPayment[];
|
|
13
|
+
savedFormsOfPayments: never[];
|
|
14
|
+
}, Error>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type BrokerageOption } from '../consts/bluvo';
|
|
2
|
+
/**
|
|
3
|
+
* Unified brokerage list combining static Bluvo exchanges and dynamic
|
|
4
|
+
* Swapped Connect FOPs (CRYPTO_TO_CRYPTO). Used by SelectBrokerage and the
|
|
5
|
+
* payment-method preview row. Live entries come first; ComingSoon (and
|
|
6
|
+
* FOPs that came back without an embeddedFlowUrl) follow.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useExchangeOptions({ iconSize, }: {
|
|
9
|
+
iconSize: number;
|
|
10
|
+
}): BrokerageOption[];
|
|
@@ -28,5 +28,6 @@ interface UseTokenTransferResult {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const useTokenTransfer: (selectedChainId: number | undefined, selectedToken: string | undefined, chainIds?: number[]) => UseTokenTransferResult;
|
|
30
30
|
export declare function getMinTransferValueForChain(chainId: number, limits: MinTransferConfig): number;
|
|
31
|
-
export declare const
|
|
31
|
+
export declare const useMinTransferValueUsd: (selectedChainId: number | undefined) => number;
|
|
32
|
+
export declare const useMinTransferValueEur: (selectedChainId: number | undefined) => number;
|
|
32
33
|
export {};
|