@funkit/connect 12.23.0 → 12.24.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/clients/{chunk-HEOTAER5.js → chunk-ENWRWMKF.js} +1 -1
- package/dist/clients/{chunk-IDYAC2RY.js → chunk-QYUAS6KD.js} +1 -1
- package/dist/clients/polymarket/createPolymarketDepositConfig.js +2 -2
- package/dist/clients/polymarket/index.js +2 -2
- package/dist/clients/polymarket/polymarket.d.ts +2 -2
- package/dist/clients/polymarket/polymarket.js +1 -1
- package/dist/hooks/useCheckoutDirectExecution.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +45 -26
- package/dist/providers/FunkitCheckoutContext/index.d.ts +2 -2
- package/dist/wallets/Wallet.d.ts +16 -1
- package/dist/wallets/walletConnectors/index.js +46 -46
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @funkit/connect
|
|
2
2
|
|
|
3
|
+
## 12.24.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 11ac106: Pass the withdrawal destination to `sendTransactions` so integrators can check the batch before it signs. Web only: connect-core, React Native and Swift hosts do not receive the destination yet.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- dc610f3: Convert's receive token screen aligns the token search with the top of the chain list and tightens the chain list's spacing.
|
|
12
|
+
- 1a664eb: HyperCore spot USDC now resolves to 8 decimals in checkout without a Relay lookup.
|
|
13
|
+
- Updated dependencies [3cff271]
|
|
14
|
+
- Updated dependencies [4f1e04f]
|
|
15
|
+
- Updated dependencies [070d06e]
|
|
16
|
+
- Updated dependencies [ee2c78e]
|
|
17
|
+
- Updated dependencies [cc6e74f]
|
|
18
|
+
- Updated dependencies [32acfe8]
|
|
19
|
+
- Updated dependencies [547fb50]
|
|
20
|
+
- Updated dependencies [8f24cbe]
|
|
21
|
+
- Updated dependencies [92b7b3f]
|
|
22
|
+
- Updated dependencies [c74af5f]
|
|
23
|
+
- @funkit/connect-core@14.0.1
|
|
24
|
+
|
|
3
25
|
## 12.23.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
|
@@ -120,7 +120,7 @@ function buildWalletUnwrapWithdrawalConfig(config) {
|
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
sendTransaction: async (_chainId, transaction) => callerSendTransactions([transaction]),
|
|
123
|
-
sendTransactions: async (_chainId, txs) => callerSendTransactions(txs),
|
|
123
|
+
sendTransactions: async (_chainId, txs, signContext) => callerSendTransactions(txs, signContext),
|
|
124
124
|
confirmTransaction: confirmTransaction ?? (async (txHash) => publicClient.waitForTransactionReceipt({ hash: txHash }))
|
|
125
125
|
};
|
|
126
126
|
const preWithdrawalAction = async ({
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createPolymarketDepositConfig,
|
|
4
4
|
createPredictionsGenerateActionParams
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-QYUAS6KD.js";
|
|
6
6
|
import {
|
|
7
7
|
POLYMARKET_PERPS_ROUTING_ID,
|
|
8
8
|
POLYMARKET_PREDICTIONS_ROUTING_ID
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-ENWRWMKF.js";
|
|
10
10
|
import "../chunk-TKEBGMVW.js";
|
|
11
11
|
import "../chunk-B67ESBGC.js";
|
|
12
12
|
export {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createPolymarketDepositConfig,
|
|
4
4
|
createPredictionsGenerateActionParams
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-QYUAS6KD.js";
|
|
6
6
|
import {
|
|
7
7
|
AMOUNT_PLACEHOLDER,
|
|
8
8
|
COLLATERAL_ONRAMP_ABI,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
VAULT_DEPOSITOR_POLYGON,
|
|
16
16
|
createPerpsGenerateActionParams,
|
|
17
17
|
createPolymarketWithdrawalConfig
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-ENWRWMKF.js";
|
|
19
19
|
import "../chunk-TKEBGMVW.js";
|
|
20
20
|
import "../chunk-B67ESBGC.js";
|
|
21
21
|
export {
|
|
@@ -19,7 +19,7 @@ import { type Address, type PublicClient, type TransactionReceipt } from 'viem';
|
|
|
19
19
|
import { POLYGON_USDCE, PUSD_TOKEN } from '../../consts/polymarket';
|
|
20
20
|
import type { AllowedRecipient } from '../../domains/withdrawalAllowlist';
|
|
21
21
|
import type { CustomWithdrawalConfig, FunkitCheckoutActionParams, WalletWithdrawalConfig } from '../../providers/FunkitCheckoutContext/types';
|
|
22
|
-
import type { WithdrawalTransaction } from '../../wallets/Wallet';
|
|
22
|
+
import type { WithdrawalSignContext, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
23
23
|
export { POLYGON_USDCE, PUSD_TOKEN };
|
|
24
24
|
export interface PolymarketWithdrawalCallbackConfig {
|
|
25
25
|
userId: string;
|
|
@@ -60,7 +60,7 @@ export interface PolymarketWithdrawalCallbackConfig {
|
|
|
60
60
|
* broadcast them atomically in a single user signature and return a tx hash
|
|
61
61
|
* that {@link WithdrawalClient.confirmTransaction} can wait on.
|
|
62
62
|
*/
|
|
63
|
-
export type PolymarketSendTransactions = (txs: WithdrawalTransaction[]) => Promise<string>;
|
|
63
|
+
export type PolymarketSendTransactions = (txs: WithdrawalTransaction[], signContext?: WithdrawalSignContext) => Promise<string>;
|
|
64
64
|
export interface PolymarketWalletUnwrapWithdrawalConfig {
|
|
65
65
|
/** Polymarket proxy that holds pUSD and signs the batched tx. */
|
|
66
66
|
proxyAddress: Address;
|
|
@@ -4,7 +4,7 @@ import type { CheckoutQuoteResponse } from '@funkit/utils';
|
|
|
4
4
|
import type { Address, Hex } from 'viem';
|
|
5
5
|
import type { FunkitCheckoutQuoteResult } from '../domains/quote';
|
|
6
6
|
import type { FunkitActiveCheckoutItem, FunkitCheckoutActionParams } from '../providers/FunkitCheckoutContext';
|
|
7
|
-
import { type WithdrawalClient, type WithdrawalTransaction } from '../wallets/Wallet';
|
|
7
|
+
import { type WithdrawalClient, type WithdrawalSignContext, type WithdrawalTransaction } from '../wallets/Wallet';
|
|
8
8
|
interface DirectExecutionQuoteRequestParamsBase {
|
|
9
9
|
actionParams: FunkitCheckoutActionParams[];
|
|
10
10
|
bridgeOverride?: 'across' | 'relay';
|
|
@@ -47,6 +47,7 @@ interface DirectExecutionStartParams {
|
|
|
47
47
|
* atomic batch via `withdrawalClient.sendTransactions`.
|
|
48
48
|
*/
|
|
49
49
|
preWithdrawalTxs?: WithdrawalTransaction[];
|
|
50
|
+
withdrawalSignContext?: WithdrawalSignContext;
|
|
50
51
|
}
|
|
51
52
|
export interface FunkitDirectExecutionInfo {
|
|
52
53
|
isDirectExecution: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export { getDefaultWallets } from './wallets/getDefaultWallets';
|
|
|
46
46
|
export { customWallet, type CustomWalletOptions, } from './wallets/walletConnectors/customWallet/customWallet';
|
|
47
47
|
export type { WalletAdoptionConfig } from './wallets/useWalletAdoption';
|
|
48
48
|
export type { ConnectorsForWalletsParameters } from './wallets/connectorsForWallets';
|
|
49
|
-
export type { FunkitConnectWalletConnectParameters, Wallet, WalletDetailsParams, WalletList, WithdrawalClient, WithdrawalTransaction, WithdrawalTypedData, } from './wallets/Wallet';
|
|
49
|
+
export type { FunkitConnectWalletConnectParameters, Wallet, WalletDetailsParams, WalletList, WithdrawalClient, WithdrawalSignContext, WithdrawalTransaction, WithdrawalTypedData, } from './wallets/Wallet';
|
|
50
50
|
export { createConnectedWithdrawalClient } from './wallets/createConnectedWithdrawalClient';
|
|
51
51
|
export { useSolanaWithdrawalConfig, type SolanaWithdrawalConfig, } from './wallets/solanaWithdrawal';
|
|
52
52
|
export { useHypercoreWithdrawalConfig, type HypercoreSigner, type HypercoreWithdrawalOptions, } from './wallets/hypercoreWithdrawal';
|
package/dist/index.js
CHANGED
|
@@ -113,7 +113,7 @@ function setFunkitConnectVersion({ version }) {
|
|
|
113
113
|
localStorage.setItem(storageKey, version);
|
|
114
114
|
}
|
|
115
115
|
function getCurrentSdkVersion() {
|
|
116
|
-
return "12.
|
|
116
|
+
return "12.24.0";
|
|
117
117
|
}
|
|
118
118
|
function useFingerprint() {
|
|
119
119
|
const fingerprint = useCallback(() => {
|
|
@@ -6630,6 +6630,7 @@ import {
|
|
|
6630
6630
|
import {
|
|
6631
6631
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS2,
|
|
6632
6632
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO,
|
|
6633
|
+
hyperCoreChain,
|
|
6633
6634
|
lightningChain,
|
|
6634
6635
|
solanaChain,
|
|
6635
6636
|
tronChain
|
|
@@ -7032,6 +7033,7 @@ function getMaxTargetAssetAmountEstimate(sourceAssetBalance, config, quoteResult
|
|
|
7032
7033
|
0.99
|
|
7033
7034
|
);
|
|
7034
7035
|
}
|
|
7036
|
+
var HYPERCORE_SPOT_USDC_ADDRESS = "0x6d1e7cde53ba9467b783cb7c530ce054";
|
|
7035
7037
|
async function getTokenDecimals(wagmiConfig, chainId2, tokenAddress) {
|
|
7036
7038
|
try {
|
|
7037
7039
|
if (isAddress(tokenAddress) && isNativeTokenAddress(tokenAddress)) {
|
|
@@ -7069,6 +7071,9 @@ async function getTokenDecimals(wagmiConfig, chainId2, tokenAddress) {
|
|
|
7069
7071
|
if (chainId2 === tronChain.id.toString()) {
|
|
7070
7072
|
return tronChain.nativeCurrency.decimals;
|
|
7071
7073
|
}
|
|
7074
|
+
if (chainId2 === hyperCoreChain.id.toString() && tokenAddress.toLowerCase() === HYPERCORE_SPOT_USDC_ADDRESS) {
|
|
7075
|
+
return hyperCoreChain.nativeCurrency.decimals;
|
|
7076
|
+
}
|
|
7072
7077
|
if (chainId2 === lightningChain.id.toString()) {
|
|
7073
7078
|
return lightningChain.nativeCurrency.decimals;
|
|
7074
7079
|
}
|
|
@@ -10527,7 +10532,7 @@ import {
|
|
|
10527
10532
|
import {
|
|
10528
10533
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS4,
|
|
10529
10534
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO5,
|
|
10530
|
-
hyperCoreChain as
|
|
10535
|
+
hyperCoreChain as hyperCoreChain3,
|
|
10531
10536
|
hyperEvmChain as hyperEvmChain3
|
|
10532
10537
|
} from "@funkit/chains";
|
|
10533
10538
|
import { v4 as uuid2 } from "uuid";
|
|
@@ -10536,7 +10541,7 @@ import { arbitrum as arbitrum5 } from "viem/chains";
|
|
|
10536
10541
|
// src/hooks/useTokenTransfer.ts
|
|
10537
10542
|
import {
|
|
10538
10543
|
FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS as FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3,
|
|
10539
|
-
hyperCoreChain
|
|
10544
|
+
hyperCoreChain as hyperCoreChain2
|
|
10540
10545
|
} from "@funkit/chains";
|
|
10541
10546
|
import {
|
|
10542
10547
|
getMinTransferValueEur,
|
|
@@ -11095,7 +11100,8 @@ function useCheckoutDirectExecution() {
|
|
|
11095
11100
|
onTransactionConfirmed,
|
|
11096
11101
|
stepMessageSetter,
|
|
11097
11102
|
withdrawalClient,
|
|
11098
|
-
preWithdrawalTxs
|
|
11103
|
+
preWithdrawalTxs,
|
|
11104
|
+
withdrawalSignContext
|
|
11099
11105
|
}) => {
|
|
11100
11106
|
const logPrefix3 = "startRelayDirectExecution";
|
|
11101
11107
|
const relayQuote = latestQuote?.baseQuote?.metadata?.relayQuote;
|
|
@@ -11270,14 +11276,18 @@ function useCheckoutDirectExecution() {
|
|
|
11270
11276
|
"sendTransactions is not supported"
|
|
11271
11277
|
);
|
|
11272
11278
|
}
|
|
11273
|
-
return withdrawalClient.sendTransactions(
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11279
|
+
return withdrawalClient.sendTransactions(
|
|
11280
|
+
chainId2,
|
|
11281
|
+
[
|
|
11282
|
+
...consumePendingPreTxs(),
|
|
11283
|
+
...items.map((item) => ({
|
|
11284
|
+
to: item.data.to,
|
|
11285
|
+
value: item.data.value,
|
|
11286
|
+
data: item.data.data
|
|
11287
|
+
}))
|
|
11288
|
+
],
|
|
11289
|
+
withdrawalSignContext
|
|
11290
|
+
);
|
|
11281
11291
|
},
|
|
11282
11292
|
// Defensive override: when batched send is available
|
|
11283
11293
|
// we should never see relay-kit pick the single-tx
|
|
@@ -11307,10 +11317,11 @@ function useCheckoutDirectExecution() {
|
|
|
11307
11317
|
"sendTransactions is not supported"
|
|
11308
11318
|
);
|
|
11309
11319
|
}
|
|
11310
|
-
return withdrawalClient.sendTransactions(
|
|
11311
|
-
|
|
11312
|
-
tx
|
|
11313
|
-
|
|
11320
|
+
return withdrawalClient.sendTransactions(
|
|
11321
|
+
chainId2,
|
|
11322
|
+
[...consumePendingPreTxs(), tx],
|
|
11323
|
+
withdrawalSignContext
|
|
11324
|
+
);
|
|
11314
11325
|
}
|
|
11315
11326
|
} : {}
|
|
11316
11327
|
} : (
|
|
@@ -12005,6 +12016,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
12005
12016
|
actionsParams,
|
|
12006
12017
|
withdrawalClient,
|
|
12007
12018
|
preWithdrawalTxs,
|
|
12019
|
+
withdrawalSignContext,
|
|
12008
12020
|
isPaymentMethodBalance
|
|
12009
12021
|
}) => {
|
|
12010
12022
|
const checkoutItem = assertCheckoutItem(activeCheckout);
|
|
@@ -12059,7 +12071,8 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
12059
12071
|
},
|
|
12060
12072
|
stepMessageSetter,
|
|
12061
12073
|
withdrawalClient,
|
|
12062
|
-
preWithdrawalTxs
|
|
12074
|
+
preWithdrawalTxs,
|
|
12075
|
+
withdrawalSignContext
|
|
12063
12076
|
});
|
|
12064
12077
|
if (!txHash) {
|
|
12065
12078
|
const missingTxHashError = new Error(
|
|
@@ -12198,7 +12211,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
12198
12211
|
[t, activeCheckout, refreshCheckoutHistory, funkitConfig.apiKey]
|
|
12199
12212
|
);
|
|
12200
12213
|
const confirmCheckout = useEffectEvent(
|
|
12201
|
-
async (latestQuote, stepMessageSetter, withdrawalClient, preWithdrawalTxs) => {
|
|
12214
|
+
async (latestQuote, stepMessageSetter, withdrawalClient, preWithdrawalTxs, withdrawalSignContext) => {
|
|
12202
12215
|
if (!funkitConfig?.apiKey) {
|
|
12203
12216
|
const missingApiKeyError = new Error(
|
|
12204
12217
|
"Funkit Internal Error: Unable to detect funkit api key"
|
|
@@ -12257,6 +12270,7 @@ function FunkitCheckoutProvider({ children }) {
|
|
|
12257
12270
|
actionsParams,
|
|
12258
12271
|
withdrawalClient,
|
|
12259
12272
|
preWithdrawalTxs,
|
|
12273
|
+
withdrawalSignContext,
|
|
12260
12274
|
isPaymentMethodBalance: true
|
|
12261
12275
|
});
|
|
12262
12276
|
}
|
|
@@ -13071,7 +13085,7 @@ var useMaxSlippage = ({
|
|
|
13071
13085
|
return { label, value: 0 };
|
|
13072
13086
|
}
|
|
13073
13087
|
const isSourceArbitrumUsdc = selectedChainId === arbitrum4.id && sourceToken === "USDC";
|
|
13074
|
-
const isTargetHypercoreUsdcPerps = Number(targetChainId) ===
|
|
13088
|
+
const isTargetHypercoreUsdcPerps = Number(targetChainId) === hyperCoreChain2.id && targetAssetAddress === FUNKIT_CONNECT_CHECKOUT_NATIVE_CURRENCY_ADDRESS3;
|
|
13075
13089
|
if (isTargetHypercoreUsdcPerps && isSourceArbitrumUsdc) {
|
|
13076
13090
|
return { label, value: 0 };
|
|
13077
13091
|
}
|
|
@@ -13121,7 +13135,7 @@ function getPreferredNetwork(networks, targetChainId) {
|
|
|
13121
13135
|
const networkMap = Object.fromEntries(
|
|
13122
13136
|
validNetworks.map((n) => [n.chainId?.toString(), n])
|
|
13123
13137
|
);
|
|
13124
|
-
const isArbritrumOverride = [
|
|
13138
|
+
const isArbritrumOverride = [hyperCoreChain3, hyperEvmChain3].some(
|
|
13125
13139
|
({ id }) => id.toString() === targetChainId
|
|
13126
13140
|
);
|
|
13127
13141
|
if (validNetworks.length === 0) {
|
|
@@ -24360,11 +24374,11 @@ import {
|
|
|
24360
24374
|
} from "@funkit/api-base";
|
|
24361
24375
|
import {
|
|
24362
24376
|
FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO as FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9,
|
|
24363
|
-
hyperCoreChain as
|
|
24377
|
+
hyperCoreChain as hyperCoreChain4
|
|
24364
24378
|
} from "@funkit/chains";
|
|
24365
24379
|
import { ResourceNotFoundError } from "@funkit/utils";
|
|
24366
24380
|
var findBridgeSupportedChain = (chainId2) => {
|
|
24367
|
-
if (chainId2 ===
|
|
24381
|
+
if (chainId2 === hyperCoreChain4.id.toString()) {
|
|
24368
24382
|
return "arbitrum";
|
|
24369
24383
|
}
|
|
24370
24384
|
const chainName = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO9[chainId2]?.name.toLowerCase();
|
|
@@ -32314,7 +32328,11 @@ function useWithdrawal({
|
|
|
32314
32328
|
formData.quote,
|
|
32315
32329
|
setStep,
|
|
32316
32330
|
walletConfig.wallet,
|
|
32317
|
-
preTxs
|
|
32331
|
+
preTxs,
|
|
32332
|
+
{
|
|
32333
|
+
destinationAddress: formData.destinationAddress,
|
|
32334
|
+
targetChainId: formData.chainId
|
|
32335
|
+
}
|
|
32318
32336
|
);
|
|
32319
32337
|
const txHash = confirmation?.transactionSubmitted?.txHash;
|
|
32320
32338
|
withdrawalItem?.initSettings.onWithdrawalConfirmation?.(
|
|
@@ -47781,7 +47799,9 @@ function ConvertChainRail({
|
|
|
47781
47799
|
display: "flex",
|
|
47782
47800
|
flexDirection: "column",
|
|
47783
47801
|
alignItems: "center",
|
|
47784
|
-
|
|
47802
|
+
paddingTop: "10",
|
|
47803
|
+
paddingX: "12",
|
|
47804
|
+
paddingBottom: "12",
|
|
47785
47805
|
borderRadius: "connectButton",
|
|
47786
47806
|
background: "offBackground",
|
|
47787
47807
|
role: "group",
|
|
@@ -47898,7 +47918,7 @@ function ConvertSelectDestinationStep({
|
|
|
47898
47918
|
onNext({ navigateToHistoryStep: true, reverseAnimation: true });
|
|
47899
47919
|
};
|
|
47900
47920
|
const listStatus = assets.length > 0 ? "ready" : status;
|
|
47901
|
-
return /* @__PURE__ */ React250.createElement(Box, { display: "flex", gap: "
|
|
47921
|
+
return /* @__PURE__ */ React250.createElement(Box, { display: "flex", gap: "12" }, chainIds.length > 0 && /* @__PURE__ */ React250.createElement(
|
|
47902
47922
|
ConvertChainRail,
|
|
47903
47923
|
{
|
|
47904
47924
|
chainIds,
|
|
@@ -47912,7 +47932,6 @@ function ConvertSelectDestinationStep({
|
|
|
47912
47932
|
flexDirection: "column",
|
|
47913
47933
|
alignSelf: "flex-start",
|
|
47914
47934
|
gap: "12",
|
|
47915
|
-
paddingTop: "16",
|
|
47916
47935
|
style: { flex: 1, minWidth: 0, position: "sticky", top: 0 }
|
|
47917
47936
|
},
|
|
47918
47937
|
/* @__PURE__ */ React250.createElement(
|
|
@@ -4,7 +4,7 @@ import type { Address, Hex } from 'viem';
|
|
|
4
4
|
import { type ApplyDynamicRoutingPath } from '../../domains/dynamicRouting';
|
|
5
5
|
import { type PaymentMethodInfo } from '../../domains/paymentMethods';
|
|
6
6
|
import type { AssetHoldingsItem } from '../../utils/assets';
|
|
7
|
-
import type { WithdrawalClient, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
7
|
+
import type { WithdrawalClient, WithdrawalSignContext, WithdrawalTransaction } from '../../wallets/Wallet';
|
|
8
8
|
import { type FunkitCheckoutQuoteResult } from '../FunkitHistoryContext';
|
|
9
9
|
import type { DynamicTargetAssetCandidate, FunkitActiveCheckoutItem, FunkitActiveWithdrawalItem, FunkitCheckoutConfig, FunkitWithdrawalConfig, MultiSourceWithdrawalConfig, PolymarketPerpsTransferPending, SingleWithdrawalConfig, UseFunkitCheckoutProps, UseFunkitCheckoutPropsWithFullConfig } from './types';
|
|
10
10
|
export * from './types';
|
|
@@ -27,7 +27,7 @@ interface FunkitCheckoutContextInterface {
|
|
|
27
27
|
}): void;
|
|
28
28
|
updateSelectedPaymentMethodInfo(newPaymentMethodInfo: PaymentMethodInfo): void;
|
|
29
29
|
updateCustomRecipient: (recipient: Address) => void;
|
|
30
|
-
confirmCheckout(quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void, withdrawalClient?: WithdrawalClient, preWithdrawalTxs?: WithdrawalTransaction[]): Promise<CheckoutConfirmationResult>;
|
|
30
|
+
confirmCheckout(quote: FunkitCheckoutQuoteResult, stepMessageSetter: (m: string) => void, withdrawalClient?: WithdrawalClient, preWithdrawalTxs?: WithdrawalTransaction[], withdrawalSignContext?: WithdrawalSignContext): Promise<CheckoutConfirmationResult>;
|
|
31
31
|
cancelCheckout(depositAddress: Address): Promise<boolean>;
|
|
32
32
|
/**
|
|
33
33
|
* Partial-update the active checkout item. Exposed for direct-execution
|
package/dist/wallets/Wallet.d.ts
CHANGED
|
@@ -107,6 +107,17 @@ export type WithdrawalTransaction = {
|
|
|
107
107
|
data: string;
|
|
108
108
|
value: string;
|
|
109
109
|
};
|
|
110
|
+
/**
|
|
111
|
+
* Withdrawal context sent with the batch so the integrator can check what it
|
|
112
|
+
* signs. `targetChainId` is Fun's chain id: Solana and Tron destinations use
|
|
113
|
+
* Fun's own ids and their native address formats, so a host check must not
|
|
114
|
+
* assume an EVM chain id or run `isAddress` on every destination.
|
|
115
|
+
*/
|
|
116
|
+
export type WithdrawalSignContext = {
|
|
117
|
+
/** The format follows `targetChainId`: 0x hex for EVM, native for Solana and Tron. */
|
|
118
|
+
destinationAddress: string;
|
|
119
|
+
targetChainId: number;
|
|
120
|
+
};
|
|
110
121
|
/** EIP-712 payload passed to {@link WithdrawalClient.signTypedData}. */
|
|
111
122
|
export type WithdrawalTypedData = {
|
|
112
123
|
domain: TypedDataDomain;
|
|
@@ -134,8 +145,12 @@ export interface WithdrawalClient {
|
|
|
134
145
|
* Implementations using `wallet_sendCalls` should map the calls-id back to
|
|
135
146
|
* the underlying tx hash via `waitForCallsStatus` →
|
|
136
147
|
* `receipts[0].transactionHash`.
|
|
148
|
+
*
|
|
149
|
+
* `signContext` is sent with batched sends only. Gasless and
|
|
150
|
+
* single-transaction steps (`sendTransaction`, `signTypedData`,
|
|
151
|
+
* `signMessage`) omit it.
|
|
137
152
|
*/
|
|
138
|
-
sendTransactions?: (chainId: number, transactions: WithdrawalTransaction[]) => Promise<string>;
|
|
153
|
+
sendTransactions?: (chainId: number, transactions: WithdrawalTransaction[], signContext?: WithdrawalSignContext) => Promise<string>;
|
|
139
154
|
confirmTransaction: (txHash: string, chainId: number) => Promise<TransactionReceipt>;
|
|
140
155
|
address: () => string;
|
|
141
156
|
/**
|
|
@@ -2,27 +2,30 @@
|
|
|
2
2
|
import {
|
|
3
3
|
xdefiWallet
|
|
4
4
|
} from "./chunk-HXX4PRE2.js";
|
|
5
|
-
import {
|
|
6
|
-
zerionWallet
|
|
7
|
-
} from "./chunk-34B7OJNT.js";
|
|
8
5
|
import {
|
|
9
6
|
zealWallet
|
|
10
7
|
} from "./chunk-GLX5FULK.js";
|
|
11
8
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
9
|
+
zerionWallet
|
|
10
|
+
} from "./chunk-34B7OJNT.js";
|
|
11
|
+
import {
|
|
12
|
+
subWallet
|
|
13
|
+
} from "./chunk-XODA5ESL.js";
|
|
14
14
|
import {
|
|
15
15
|
tahoWallet
|
|
16
16
|
} from "./chunk-U74RFZOL.js";
|
|
17
17
|
import {
|
|
18
18
|
talismanWallet
|
|
19
19
|
} from "./chunk-IAYYWCVB.js";
|
|
20
|
-
import {
|
|
21
|
-
tokenPocketWallet
|
|
22
|
-
} from "./chunk-NXWG6FG2.js";
|
|
23
20
|
import {
|
|
24
21
|
tokenaryWallet
|
|
25
22
|
} from "./chunk-TPM5PUJD.js";
|
|
23
|
+
import {
|
|
24
|
+
trustWallet
|
|
25
|
+
} from "./chunk-SR5CZR3L.js";
|
|
26
|
+
import {
|
|
27
|
+
tokenPocketWallet
|
|
28
|
+
} from "./chunk-NXWG6FG2.js";
|
|
26
29
|
import {
|
|
27
30
|
uniswapWallet
|
|
28
31
|
} from "./chunk-UNDWHCDH.js";
|
|
@@ -30,32 +33,29 @@ import {
|
|
|
30
33
|
walletConnectWallet
|
|
31
34
|
} from "./chunk-DUX4XCDV.js";
|
|
32
35
|
import {
|
|
33
|
-
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import {
|
|
36
|
-
oneKeyWallet
|
|
37
|
-
} from "./chunk-KN32ITJ7.js";
|
|
36
|
+
phantomWallet
|
|
37
|
+
} from "./chunk-Q27YVDDH.js";
|
|
38
38
|
import {
|
|
39
39
|
rabbyWallet
|
|
40
40
|
} from "./chunk-RQ2GXOJL.js";
|
|
41
|
+
import {
|
|
42
|
+
rainbowWallet
|
|
43
|
+
} from "./chunk-ZSSSLFQF.js";
|
|
41
44
|
import {
|
|
42
45
|
ramperWallet
|
|
43
46
|
} from "./chunk-GPXIBTWN.js";
|
|
44
47
|
import {
|
|
45
|
-
|
|
46
|
-
} from "./chunk-
|
|
48
|
+
roninWallet
|
|
49
|
+
} from "./chunk-IA5432IR.js";
|
|
47
50
|
import {
|
|
48
51
|
safeWallet
|
|
49
52
|
} from "./chunk-IR3PJMVM.js";
|
|
53
|
+
import {
|
|
54
|
+
safeheronWallet
|
|
55
|
+
} from "./chunk-UN3ONVNC.js";
|
|
50
56
|
import {
|
|
51
57
|
safepalWallet
|
|
52
58
|
} from "./chunk-BBB2J3US.js";
|
|
53
|
-
import {
|
|
54
|
-
subWallet
|
|
55
|
-
} from "./chunk-XODA5ESL.js";
|
|
56
|
-
import {
|
|
57
|
-
roninWallet
|
|
58
|
-
} from "./chunk-IA5432IR.js";
|
|
59
59
|
import {
|
|
60
60
|
kresusWallet
|
|
61
61
|
} from "./chunk-V77ATGZT.js";
|
|
@@ -63,14 +63,14 @@ import {
|
|
|
63
63
|
metaMaskWallet
|
|
64
64
|
} from "./chunk-RXRYHMRI.js";
|
|
65
65
|
import {
|
|
66
|
-
|
|
67
|
-
} from "./chunk-
|
|
66
|
+
oktoWallet
|
|
67
|
+
} from "./chunk-V4M3SNPS.js";
|
|
68
68
|
import {
|
|
69
69
|
okxWallet
|
|
70
70
|
} from "./chunk-CU5J53XR.js";
|
|
71
71
|
import {
|
|
72
|
-
|
|
73
|
-
} from "./chunk-
|
|
72
|
+
mewWallet
|
|
73
|
+
} from "./chunk-DSPQXAB2.js";
|
|
74
74
|
import {
|
|
75
75
|
oneInchWallet
|
|
76
76
|
} from "./chunk-GFS2AVAH.js";
|
|
@@ -78,8 +78,8 @@ import {
|
|
|
78
78
|
omniWallet
|
|
79
79
|
} from "./chunk-2TAUCVX7.js";
|
|
80
80
|
import {
|
|
81
|
-
|
|
82
|
-
} from "./chunk-
|
|
81
|
+
oneKeyWallet
|
|
82
|
+
} from "./chunk-KN32ITJ7.js";
|
|
83
83
|
import {
|
|
84
84
|
foxWallet
|
|
85
85
|
} from "./chunk-U52QO5HF.js";
|
|
@@ -90,14 +90,14 @@ import {
|
|
|
90
90
|
frameWallet
|
|
91
91
|
} from "./chunk-B572YIAQ.js";
|
|
92
92
|
import {
|
|
93
|
-
|
|
94
|
-
} from "./chunk-
|
|
93
|
+
frontierWallet
|
|
94
|
+
} from "./chunk-IWOMSW64.js";
|
|
95
95
|
import {
|
|
96
96
|
imTokenWallet
|
|
97
97
|
} from "./chunk-YY2JA23M.js";
|
|
98
98
|
import {
|
|
99
|
-
|
|
100
|
-
} from "./chunk-
|
|
99
|
+
gateWallet
|
|
100
|
+
} from "./chunk-YRMBR6NA.js";
|
|
101
101
|
import {
|
|
102
102
|
injectedWallet
|
|
103
103
|
} from "./chunk-M75V7OL3.js";
|
|
@@ -105,8 +105,11 @@ import {
|
|
|
105
105
|
ledgerWallet
|
|
106
106
|
} from "./chunk-BL4OC2EJ.js";
|
|
107
107
|
import {
|
|
108
|
-
|
|
109
|
-
} from "./chunk-
|
|
108
|
+
bitgetWallet
|
|
109
|
+
} from "./chunk-HOCKAU5H.js";
|
|
110
|
+
import {
|
|
111
|
+
coin98Wallet
|
|
112
|
+
} from "./chunk-RFCZYLNR.js";
|
|
110
113
|
import {
|
|
111
114
|
clvWallet
|
|
112
115
|
} from "./chunk-4FHNLTR3.js";
|
|
@@ -116,9 +119,6 @@ import {
|
|
|
116
119
|
import {
|
|
117
120
|
coreWallet
|
|
118
121
|
} from "./chunk-TRZDAXCQ.js";
|
|
119
|
-
import {
|
|
120
|
-
coin98Wallet
|
|
121
|
-
} from "./chunk-RFCZYLNR.js";
|
|
122
122
|
import {
|
|
123
123
|
customWallet
|
|
124
124
|
} from "./chunk-VKM5M5UK.js";
|
|
@@ -129,27 +129,27 @@ import {
|
|
|
129
129
|
desigWallet
|
|
130
130
|
} from "./chunk-DFHP75HV.js";
|
|
131
131
|
import {
|
|
132
|
-
|
|
133
|
-
} from "./chunk-
|
|
132
|
+
bitskiWallet
|
|
133
|
+
} from "./chunk-NPITCCJE.js";
|
|
134
134
|
import {
|
|
135
|
-
|
|
136
|
-
} from "./chunk-
|
|
135
|
+
bitverseWallet
|
|
136
|
+
} from "./chunk-5AEWIKRA.js";
|
|
137
137
|
import {
|
|
138
138
|
bifrostWallet
|
|
139
139
|
} from "./chunk-ALGPGI6V.js";
|
|
140
|
-
import {
|
|
141
|
-
bitverseWallet
|
|
142
|
-
} from "./chunk-5AEWIKRA.js";
|
|
143
140
|
import {
|
|
144
141
|
bloomWallet
|
|
145
142
|
} from "./chunk-PNHDOC77.js";
|
|
143
|
+
import {
|
|
144
|
+
argentWallet
|
|
145
|
+
} from "./chunk-XSDTNMQY.js";
|
|
146
|
+
import {
|
|
147
|
+
braveWallet
|
|
148
|
+
} from "./chunk-U2XXV45G.js";
|
|
146
149
|
import {
|
|
147
150
|
bybitWallet
|
|
148
151
|
} from "./chunk-BBDNB5TQ.js";
|
|
149
152
|
import "./chunk-AALSJCUR.js";
|
|
150
|
-
import {
|
|
151
|
-
bitskiWallet
|
|
152
|
-
} from "./chunk-NPITCCJE.js";
|
|
153
153
|
import "./chunk-EYWGX5LT.js";
|
|
154
154
|
import "./chunk-B454LLKJ.js";
|
|
155
155
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.24.0",
|
|
4
4
|
"description": "Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@datadog/browser-logs": "5.22.0",
|
|
107
107
|
"@funkit/api-base": "10.2.1",
|
|
108
108
|
"@funkit/chains": "2.6.1",
|
|
109
|
-
"@funkit/connect-core": "14.0.
|
|
109
|
+
"@funkit/connect-core": "14.0.1",
|
|
110
110
|
"@funkit/fun-relay": "3.3.1",
|
|
111
111
|
"@funkit/utils": "5.1.2",
|
|
112
112
|
"@number-flow/react": "^0.5.5",
|