@funkit/connect 11.0.0 → 11.1.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 +19 -0
- package/dist/clients/{chunk-JD2J5K6S.js → chunk-2QYQNTOI.js} +153 -18
- package/dist/clients/chunk-63XTVHO3.js +19 -0
- package/dist/clients/{chunk-6CYZKITE.js → chunk-6T6URLBM.js} +1 -1
- package/dist/clients/chunk-A44M6EAG.js +160 -0
- package/dist/clients/chunk-A6OXZWCN.js +40 -0
- package/dist/clients/{chunk-LT4EWLDA.js → chunk-BPDLF2R6.js} +1 -0
- package/dist/clients/{chunk-2FSEE3AW.js → chunk-C53FRCUM.js} +2 -89
- package/dist/clients/{chunk-6PIIYPQK.js → chunk-EJKHMZW3.js} +4 -327
- package/dist/clients/chunk-FAYBQQNB.js +15 -0
- package/dist/clients/chunk-NAVU6W7V.js +89 -0
- package/dist/clients/{chunk-BNMZM23Q.js → chunk-OJZNF6EM.js} +2 -2
- package/dist/clients/chunk-PENJ5JGH.js +331 -0
- package/dist/clients/{chunk-C4SHJFOV.js → chunk-QIMCURVA.js} +9 -9
- package/dist/clients/{chunk-YFHTV7DT.js → chunk-SH3MHRHX.js} +1 -1
- package/dist/clients/chunk-SO756ELD.js +35 -0
- package/dist/clients/{chunk-MGQLVTSH.js → chunk-SYFHMTUO.js} +27 -21
- package/dist/clients/chunk-WVM4ZJD2.js +61 -0
- package/dist/clients/{chunk-L2KSNS7H.js → chunk-WZRW6WUM.js} +1 -1
- package/dist/clients/chunk-YMGRBJAS.js +302 -0
- package/dist/clients/chunk-YZSO4EMO.js +44 -0
- package/dist/clients/{chunk-2YWQL3AO.js → chunk-Z7HTQFEO.js} +26 -3
- package/dist/clients/fanatics.js +2 -1
- package/dist/clients/internal/nado/encoding.d.ts +5 -2
- package/dist/clients/internal/nado/encoding.js +1 -1
- package/dist/clients/internal/nado/errors.d.ts +14 -1
- package/dist/clients/internal/nado/errors.js +7 -3
- package/dist/clients/internal/nado/fetch.js +2 -2
- package/dist/clients/internal/nado/gateway.d.ts +19 -20
- package/dist/clients/internal/nado/gateway.js +3 -5
- package/dist/clients/internal/nado/hooks.d.ts +8 -2
- package/dist/clients/internal/nado/hooks.js +9 -9
- package/dist/clients/internal/nado/indexer.js +3 -3
- package/dist/clients/internal/nado/typedData.js +4 -37
- package/dist/clients/internal/nado/withdrawalCallback.d.ts +20 -0
- package/dist/clients/internal/nado/withdrawalCallback.js +20 -0
- package/dist/clients/internal/nado/withdrawalConfig.d.ts +8 -3
- package/dist/clients/internal/nado/withdrawalConfig.js +7 -3
- package/dist/clients/internal/nado/withdrawalErrors.d.ts +14 -0
- package/dist/clients/internal/nado/withdrawalErrors.js +11 -0
- package/dist/clients/internal/nado/withdrawalForm.d.ts +6 -7
- package/dist/clients/internal/nado/withdrawalForm.js +75 -96
- package/dist/clients/internal/nado/withdrawalStatus.d.ts +41 -0
- package/dist/clients/internal/nado/withdrawalStatus.js +231 -0
- package/dist/clients/internal/nado/withdrawalTypes.d.ts +21 -7
- package/dist/clients/lighter.css +18 -18
- package/dist/clients/lighter.js +7 -4
- package/dist/clients/mallard.js +4 -3
- package/dist/clients/nado.d.ts +67 -0
- package/dist/clients/nado.js +73 -0
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.css +60 -60
- package/dist/clients/polymarket/PolymarketDepositAccountDropdown.js +9 -6
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +3 -2
- package/dist/clients/polymarket/index.css +60 -60
- package/dist/clients/polymarket/index.js +9 -6
- package/dist/clients/polymarket/polymarket.js +2 -1
- package/dist/consts/customers.d.ts +1 -1
- package/dist/hooks/track/analytics/events.d.ts +57 -0
- package/dist/hooks/track/analytics/mappers.d.ts +6 -0
- package/dist/hooks/track/analytics/useDepositAnalytics.d.ts +20 -0
- package/dist/hooks/track/useTrack.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3044 -2602
- package/dist/modals/WithdrawalModal/NadoWithdrawalSuccess.d.ts +20 -0
- package/dist/providers/FunkitCheckoutContext/types.d.ts +0 -1
- package/dist/providers/GeneralWalletProvider.d.ts +1 -0
- package/dist/wallets/walletConnectors/index.js +41 -41
- package/package.json +3 -3
- package/dist/clients/chunk-SFDEST63.js +0 -18
- package/dist/clients/chunk-ZCCLJW6F.js +0 -99
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nado: "withdrawal requested" screen, tracked through to delivery.
|
|
3
|
+
*
|
|
4
|
+
* Nado's sequencer settles off Fun's rails, so the screen lands on `pending` off
|
|
5
|
+
* Nado's own accepted response and the user stays here for the rest — only the
|
|
6
|
+
* copy moves as the funds clear.
|
|
7
|
+
* (Mirrors LighterSecureWithdrawalSuccess; both collapse into one shell in the
|
|
8
|
+
* planned withdrawal refactor.)
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { Address } from 'viem';
|
|
12
|
+
export declare function NadoWithdrawalSuccess({ onClose, onNewWithdrawal, amount, tokenSymbol, depositAddress, }: {
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
onNewWithdrawal: () => void;
|
|
15
|
+
/** Amount debited from the Nado subaccount, in token units. */
|
|
16
|
+
amount: string;
|
|
17
|
+
tokenSymbol: string;
|
|
18
|
+
/** UDA the sequencer sends to; absent leaves the screen on `pending`. */
|
|
19
|
+
depositAddress: Address | undefined;
|
|
20
|
+
}): React.JSX.Element;
|
|
@@ -344,7 +344,6 @@ export type WithdrawalCustomerData = LighterWithdrawalCustomerData | NadoWithdra
|
|
|
344
344
|
* `customerConfig` counterpart to {@link WithdrawalCustomerData}.
|
|
345
345
|
*/
|
|
346
346
|
export type WithdrawalCustomerConfig = NadoWithdrawalCustomerConfig;
|
|
347
|
-
export type { NadoWithdrawalCustomerConfig, NadoWithdrawalCustomerData };
|
|
348
347
|
/**
|
|
349
348
|
* Flow-specific descriptor for the selected source token, discriminated by
|
|
350
349
|
* `type`. Needed where {@link TokenInfo} alone can't name the balance:
|
|
@@ -5,9 +5,6 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
zerionWallet
|
|
7
7
|
} from "./chunk-SWFF3TWJ.js";
|
|
8
|
-
import {
|
|
9
|
-
tahoWallet
|
|
10
|
-
} from "./chunk-7ZYCBDQ4.js";
|
|
11
8
|
import {
|
|
12
9
|
talismanWallet
|
|
13
10
|
} from "./chunk-4DCO3TGL.js";
|
|
@@ -17,6 +14,9 @@ import {
|
|
|
17
14
|
import {
|
|
18
15
|
tokenaryWallet
|
|
19
16
|
} from "./chunk-VH3THHJY.js";
|
|
17
|
+
import {
|
|
18
|
+
oneKeyWallet
|
|
19
|
+
} from "./chunk-WVT6BBJH.js";
|
|
20
20
|
import {
|
|
21
21
|
trustWallet
|
|
22
22
|
} from "./chunk-KCRO2AGO.js";
|
|
@@ -29,21 +29,15 @@ import {
|
|
|
29
29
|
import {
|
|
30
30
|
xdefiWallet
|
|
31
31
|
} from "./chunk-JN5I3DNC.js";
|
|
32
|
-
import {
|
|
33
|
-
rabbyWallet
|
|
34
|
-
} from "./chunk-RB66PKPA.js";
|
|
35
|
-
import {
|
|
36
|
-
rainbowWallet
|
|
37
|
-
} from "./chunk-W2LCLDPX.js";
|
|
38
|
-
import {
|
|
39
|
-
ramperWallet
|
|
40
|
-
} from "./chunk-OQB55QXP.js";
|
|
41
32
|
import {
|
|
42
33
|
roninWallet
|
|
43
34
|
} from "./chunk-YQFGVZGR.js";
|
|
44
35
|
import {
|
|
45
36
|
safeWallet
|
|
46
37
|
} from "./chunk-RCY66YHF.js";
|
|
38
|
+
import {
|
|
39
|
+
okxWallet
|
|
40
|
+
} from "./chunk-KI5Y2BBF.js";
|
|
47
41
|
import {
|
|
48
42
|
safeheronWallet
|
|
49
43
|
} from "./chunk-76S7R2ND.js";
|
|
@@ -57,14 +51,11 @@ import {
|
|
|
57
51
|
metaMaskWallet
|
|
58
52
|
} from "./chunk-YO2K4MBH.js";
|
|
59
53
|
import {
|
|
60
|
-
|
|
61
|
-
} from "./chunk-
|
|
54
|
+
tahoWallet
|
|
55
|
+
} from "./chunk-7ZYCBDQ4.js";
|
|
62
56
|
import {
|
|
63
57
|
oktoWallet
|
|
64
58
|
} from "./chunk-YWOVAU6O.js";
|
|
65
|
-
import {
|
|
66
|
-
okxWallet
|
|
67
|
-
} from "./chunk-KI5Y2BBF.js";
|
|
68
59
|
import {
|
|
69
60
|
omniWallet
|
|
70
61
|
} from "./chunk-2CX7LX4J.js";
|
|
@@ -72,14 +63,20 @@ import {
|
|
|
72
63
|
oneInchWallet
|
|
73
64
|
} from "./chunk-QG6ZHI7B.js";
|
|
74
65
|
import {
|
|
75
|
-
|
|
76
|
-
} from "./chunk-
|
|
66
|
+
ledgerWallet
|
|
67
|
+
} from "./chunk-RPV27V2Y.js";
|
|
77
68
|
import {
|
|
78
69
|
phantomWallet
|
|
79
70
|
} from "./chunk-QY53O7WG.js";
|
|
80
71
|
import {
|
|
81
|
-
|
|
82
|
-
} from "./chunk-
|
|
72
|
+
rabbyWallet
|
|
73
|
+
} from "./chunk-RB66PKPA.js";
|
|
74
|
+
import {
|
|
75
|
+
rainbowWallet
|
|
76
|
+
} from "./chunk-W2LCLDPX.js";
|
|
77
|
+
import {
|
|
78
|
+
ramperWallet
|
|
79
|
+
} from "./chunk-OQB55QXP.js";
|
|
83
80
|
import {
|
|
84
81
|
foxWallet
|
|
85
82
|
} from "./chunk-GUQM4QSL.js";
|
|
@@ -89,64 +86,67 @@ import {
|
|
|
89
86
|
import {
|
|
90
87
|
gateWallet
|
|
91
88
|
} from "./chunk-JPN6TWIT.js";
|
|
89
|
+
import {
|
|
90
|
+
frontierWallet
|
|
91
|
+
} from "./chunk-AVDUNQUW.js";
|
|
92
92
|
import {
|
|
93
93
|
imTokenWallet
|
|
94
94
|
} from "./chunk-WNAGGFMG.js";
|
|
95
|
-
import {
|
|
96
|
-
injectedWallet
|
|
97
|
-
} from "./chunk-T6LGKC3F.js";
|
|
98
95
|
import {
|
|
99
96
|
kresusWallet
|
|
100
97
|
} from "./chunk-RICTB3FA.js";
|
|
101
98
|
import {
|
|
102
|
-
|
|
103
|
-
} from "./chunk-
|
|
99
|
+
mewWallet
|
|
100
|
+
} from "./chunk-MQM45ADF.js";
|
|
101
|
+
import {
|
|
102
|
+
injectedWallet
|
|
103
|
+
} from "./chunk-T6LGKC3F.js";
|
|
104
|
+
import {
|
|
105
|
+
bloomWallet
|
|
106
|
+
} from "./chunk-PJ7Y57EH.js";
|
|
104
107
|
import {
|
|
105
108
|
clvWallet
|
|
106
109
|
} from "./chunk-OEEGYENV.js";
|
|
107
110
|
import {
|
|
108
111
|
coin98Wallet
|
|
109
112
|
} from "./chunk-WAHGI5L7.js";
|
|
110
|
-
import {
|
|
111
|
-
bybitWallet
|
|
112
|
-
} from "./chunk-OX37G4YT.js";
|
|
113
113
|
import {
|
|
114
114
|
coinbaseWallet
|
|
115
115
|
} from "./chunk-2DLDAZRH.js";
|
|
116
116
|
import {
|
|
117
117
|
coreWallet
|
|
118
118
|
} from "./chunk-4NV5BYRP.js";
|
|
119
|
-
import {
|
|
120
|
-
desigWallet
|
|
121
|
-
} from "./chunk-FW3WZETT.js";
|
|
122
119
|
import {
|
|
123
120
|
dawnWallet
|
|
124
121
|
} from "./chunk-G2PHTVL6.js";
|
|
122
|
+
import {
|
|
123
|
+
desigWallet
|
|
124
|
+
} from "./chunk-FW3WZETT.js";
|
|
125
125
|
import {
|
|
126
126
|
enkryptWallet
|
|
127
127
|
} from "./chunk-HBQK5RD5.js";
|
|
128
|
-
import {
|
|
129
|
-
argentWallet
|
|
130
|
-
} from "./chunk-NTMBEOR2.js";
|
|
131
128
|
import {
|
|
132
129
|
bifrostWallet
|
|
133
130
|
} from "./chunk-IULPZP2Q.js";
|
|
134
131
|
import {
|
|
135
|
-
|
|
136
|
-
} from "./chunk-
|
|
132
|
+
argentWallet
|
|
133
|
+
} from "./chunk-NTMBEOR2.js";
|
|
137
134
|
import {
|
|
138
135
|
bitskiWallet
|
|
139
136
|
} from "./chunk-7HRFUZFX.js";
|
|
137
|
+
import {
|
|
138
|
+
bitgetWallet
|
|
139
|
+
} from "./chunk-TKB2OY6G.js";
|
|
140
140
|
import {
|
|
141
141
|
bitverseWallet
|
|
142
142
|
} from "./chunk-NSK6A7TI.js";
|
|
143
|
-
import {
|
|
144
|
-
bloomWallet
|
|
145
|
-
} from "./chunk-PJ7Y57EH.js";
|
|
146
|
-
import "./chunk-N4IJLYFY.js";
|
|
147
143
|
import {
|
|
148
144
|
braveWallet
|
|
149
145
|
} from "./chunk-DS73TZ6O.js";
|
|
146
|
+
import {
|
|
147
|
+
bybitWallet
|
|
148
|
+
} from "./chunk-OX37G4YT.js";
|
|
149
|
+
import "./chunk-N4IJLYFY.js";
|
|
150
150
|
import "./chunk-OLZ7626J.js";
|
|
151
151
|
import "./chunk-IGKXZBTA.js";
|
|
152
152
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"uuid": "^11.1.1",
|
|
110
110
|
"@funkit/api-base": "6.0.0",
|
|
111
111
|
"@funkit/chains": "2.2.0",
|
|
112
|
-
"@funkit/connect-core": "2.4.
|
|
113
|
-
"@funkit/fun-relay": "2.
|
|
112
|
+
"@funkit/connect-core": "2.4.1",
|
|
113
|
+
"@funkit/fun-relay": "2.10.0",
|
|
114
114
|
"@funkit/utils": "4.0.0"
|
|
115
115
|
},
|
|
116
116
|
"repository": {
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
// src/utils/withdrawal.ts
|
|
4
|
-
import { isEVMAddressEquivalent, isTokenEquivalent } from "@funkit/utils";
|
|
5
|
-
import * as dnum from "dnum";
|
|
6
|
-
import { parseUnits } from "viem";
|
|
7
|
-
function isCustomWithdrawalConfig(config) {
|
|
8
|
-
return "withdrawCallback" in config;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// src/clients/internal/nado/withdrawalConfig.ts
|
|
12
|
-
function isNadoWithdrawalConfig(config) {
|
|
13
|
-
return !!config && isCustomWithdrawalConfig(config) && config.customerConfig?.customerName === "nado";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
isNadoWithdrawalConfig
|
|
18
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
NADO_GATEWAY_URL
|
|
4
|
-
} from "./chunk-II5CZTBC.js";
|
|
5
|
-
import {
|
|
6
|
-
nadoFetch
|
|
7
|
-
} from "./chunk-L2KSNS7H.js";
|
|
8
|
-
import {
|
|
9
|
-
NadoGatewayError,
|
|
10
|
-
createNadoGatewayError,
|
|
11
|
-
isNadoTransportError
|
|
12
|
-
} from "./chunk-2YWQL3AO.js";
|
|
13
|
-
|
|
14
|
-
// src/clients/internal/nado/gateway.ts
|
|
15
|
-
function parseNadoGatewayResponse(response) {
|
|
16
|
-
if (response.status !== "success") {
|
|
17
|
-
throw createNadoGatewayError(response, "Nado gateway request failed");
|
|
18
|
-
}
|
|
19
|
-
return response.data;
|
|
20
|
-
}
|
|
21
|
-
async function nadoQuery(params, signal) {
|
|
22
|
-
const response = await nadoFetch({
|
|
23
|
-
uri: `${NADO_GATEWAY_URL}/query?${new URLSearchParams(params)}`,
|
|
24
|
-
method: "GET",
|
|
25
|
-
signal
|
|
26
|
-
});
|
|
27
|
-
const data = parseNadoGatewayResponse(response);
|
|
28
|
-
if (data === void 0) {
|
|
29
|
-
throw new NadoGatewayError("Nado returned success without data", {
|
|
30
|
-
kind: "api"
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
async function getNadoMaxWithdrawable(params, signal) {
|
|
36
|
-
const data = await nadoQuery(
|
|
37
|
-
{
|
|
38
|
-
type: "max_withdrawable",
|
|
39
|
-
product_id: params.productId.toString(),
|
|
40
|
-
sender: params.sender,
|
|
41
|
-
spot_leverage: params.spotLeverage ? "true" : "false"
|
|
42
|
-
},
|
|
43
|
-
signal
|
|
44
|
-
);
|
|
45
|
-
return data.max_withdrawable;
|
|
46
|
-
}
|
|
47
|
-
async function getNadoTxNonce(address) {
|
|
48
|
-
const query = () => nadoQuery({ type: "nonces", address });
|
|
49
|
-
let data;
|
|
50
|
-
try {
|
|
51
|
-
data = await query();
|
|
52
|
-
} catch (error) {
|
|
53
|
-
if (!isNadoTransportError(error)) {
|
|
54
|
-
throw error;
|
|
55
|
-
}
|
|
56
|
-
data = await query();
|
|
57
|
-
}
|
|
58
|
-
return BigInt(data.tx_nonce);
|
|
59
|
-
}
|
|
60
|
-
async function getNadoFeeRates(sender, signal) {
|
|
61
|
-
return nadoQuery({ type: "fee_rates", sender }, signal);
|
|
62
|
-
}
|
|
63
|
-
async function getNadoSubaccountInfo(subaccount, signal) {
|
|
64
|
-
return nadoQuery(
|
|
65
|
-
{ type: "subaccount_info", subaccount },
|
|
66
|
-
signal
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
async function executeNadoWithdrawCollateralV2(params) {
|
|
70
|
-
const response = await nadoFetch({
|
|
71
|
-
uri: `${NADO_GATEWAY_URL}/execute`,
|
|
72
|
-
method: "POST",
|
|
73
|
-
body: {
|
|
74
|
-
// spot_leverage sits INSIDE the execute object (sibling of tx/signature),
|
|
75
|
-
// matching @nadohq's EngineBaseClient — top-level is silently ignored.
|
|
76
|
-
withdraw_collateral_v2: {
|
|
77
|
-
tx: {
|
|
78
|
-
sender: params.sender,
|
|
79
|
-
productId: params.productId,
|
|
80
|
-
amount: params.amount.toString(),
|
|
81
|
-
nonce: params.nonce.toString(),
|
|
82
|
-
sendTo: params.sendTo,
|
|
83
|
-
appendix: "0"
|
|
84
|
-
},
|
|
85
|
-
signature: params.signature,
|
|
86
|
-
spot_leverage: params.spotLeverage
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
parseNadoGatewayResponse(response);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export {
|
|
94
|
-
getNadoMaxWithdrawable,
|
|
95
|
-
getNadoTxNonce,
|
|
96
|
-
getNadoFeeRates,
|
|
97
|
-
getNadoSubaccountInfo,
|
|
98
|
-
executeNadoWithdrawCollateralV2
|
|
99
|
-
};
|