@b3dotfun/sdk 0.0.49-alpha.9 → 0.0.50-alpha.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/dist/cjs/anyspend/react/components/common/OrderToken.js +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmountFiat.js +1 -1
- package/dist/cjs/anyspend/react/components/common/OrderTokenAmountNew.js +1 -1
- package/dist/cjs/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -12
- package/dist/cjs/anyspend/types/api.d.ts +14 -2
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
- package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +1 -1
- package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +2 -2
- package/dist/cjs/global-account/react/hooks/useAuthentication.js +11 -0
- package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +7663 -1
- package/dist/cjs/global-account/react/hooks/useFirstEOA.js +21 -1
- package/dist/esm/anyspend/react/components/common/OrderToken.js +1 -1
- package/dist/esm/anyspend/react/components/common/OrderTokenAmount.js +1 -1
- package/dist/esm/anyspend/react/components/common/OrderTokenAmountFiat.js +1 -1
- package/dist/esm/anyspend/react/components/common/OrderTokenAmountNew.js +1 -1
- package/dist/esm/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -12
- package/dist/esm/anyspend/types/api.d.ts +14 -2
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
- package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +1 -1
- package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +2 -2
- package/dist/esm/global-account/react/hooks/useAuthentication.js +11 -0
- package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +7663 -1
- package/dist/esm/global-account/react/hooks/useFirstEOA.js +22 -2
- package/dist/types/anyspend/react/hooks/useAnyspendOrderHistory.d.ts +24 -12
- package/dist/types/anyspend/types/api.d.ts +14 -2
- package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +1 -1
- package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +7663 -1
- package/package.json +4 -4
- package/src/anyspend/react/components/common/OrderToken.tsx +1 -1
- package/src/anyspend/react/components/common/OrderTokenAmount.tsx +1 -1
- package/src/anyspend/react/components/common/OrderTokenAmountFiat.tsx +1 -1
- package/src/anyspend/react/components/common/OrderTokenAmountNew.tsx +1 -1
- package/src/anyspend/types/api.ts +14 -2
- package/src/global-account/react/components/B3Provider/B3Provider.tsx +1 -1
- package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +2 -2
- package/src/global-account/react/hooks/useAuthentication.ts +13 -1
- package/src/global-account/react/hooks/useFirstEOA.tsx +20 -2
|
@@ -8,7 +8,7 @@ const react_1 = require("../../../../global-account/react");
|
|
|
8
8
|
const utils_1 = require("../../../../shared/utils");
|
|
9
9
|
const number_1 = require("../../../../shared/utils/number");
|
|
10
10
|
const simplehash_1 = require("../../../../shared/utils/simplehash");
|
|
11
|
-
const relay_kit_ui_1 = require("@
|
|
11
|
+
const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
|
|
12
12
|
const lucide_react_1 = require("lucide-react");
|
|
13
13
|
const react_2 = require("react");
|
|
14
14
|
const ChainTokenIcon_1 = require("./ChainTokenIcon");
|
|
@@ -9,7 +9,7 @@ const react_number_format_1 = require("react-number-format");
|
|
|
9
9
|
const anyspend_1 = require("../../../../anyspend");
|
|
10
10
|
const react_2 = require("../../../../global-account/react");
|
|
11
11
|
const utils_1 = require("../../../../shared/utils");
|
|
12
|
-
const relay_kit_ui_1 = require("@
|
|
12
|
+
const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
|
|
13
13
|
const ChainTokenIcon_1 = require("./ChainTokenIcon");
|
|
14
14
|
function OrderTokenAmount({ disabled, inputValue, onChangeInput, context, address, chainId, setChainId, token, setToken, hideTokenSelect = false, canEditAmount = true, className, innerClassName, amountClassName, tokenSelectClassName, onTokenSelect, }) {
|
|
15
15
|
// Track previous token to detect changes
|
|
@@ -8,7 +8,7 @@ const react_1 = require("react");
|
|
|
8
8
|
const react_number_format_1 = require("react-number-format");
|
|
9
9
|
const anyspend_1 = require("../../../../anyspend");
|
|
10
10
|
const utils_1 = require("../../../../shared/utils");
|
|
11
|
-
const relay_kit_ui_1 = require("@
|
|
11
|
+
const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
|
|
12
12
|
const ChainTokenIcon_1 = require("./ChainTokenIcon");
|
|
13
13
|
function OrderTokenAmountFiat({ disabled, inputValue, onChangeInput, context, address, chainId, setChainId, token, setToken, className, }) {
|
|
14
14
|
// Track previous token to detect changes
|
|
@@ -9,7 +9,7 @@ const react_number_format_1 = require("react-number-format");
|
|
|
9
9
|
const anyspend_1 = require("../../../../anyspend");
|
|
10
10
|
const react_2 = require("../../../../global-account/react");
|
|
11
11
|
const utils_1 = require("../../../../shared/utils");
|
|
12
|
-
const relay_kit_ui_1 = require("@
|
|
12
|
+
const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
|
|
13
13
|
const ChainTokenIcon_1 = require("./ChainTokenIcon");
|
|
14
14
|
function OrderTokenAmountFiat({ disabled, inputValue, onChangeInput, context, address, chainId, setChainId, token, setToken, hideTokenSelect = false, canEditAmount = true, className, showAsReceiveAmount = false, }) {
|
|
15
15
|
// Track previous token to detect changes
|
|
@@ -20,7 +20,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
20
20
|
oneClickBuyUrl: string | null;
|
|
21
21
|
stripePaymentIntentId: string | null;
|
|
22
22
|
settlement: {
|
|
23
|
-
actualDstAmount
|
|
23
|
+
actualDstAmount?: string;
|
|
24
|
+
relay?: Record<string, never>;
|
|
24
25
|
} | null;
|
|
25
26
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
26
27
|
} & {
|
|
@@ -48,7 +49,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
48
49
|
oneClickBuyUrl: string | null;
|
|
49
50
|
stripePaymentIntentId: string | null;
|
|
50
51
|
settlement: {
|
|
51
|
-
actualDstAmount
|
|
52
|
+
actualDstAmount?: string;
|
|
53
|
+
relay?: Record<string, never>;
|
|
52
54
|
} | null;
|
|
53
55
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
54
56
|
} & {
|
|
@@ -76,7 +78,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
76
78
|
oneClickBuyUrl: string | null;
|
|
77
79
|
stripePaymentIntentId: string | null;
|
|
78
80
|
settlement: {
|
|
79
|
-
actualDstAmount
|
|
81
|
+
actualDstAmount?: string;
|
|
82
|
+
relay?: Record<string, never>;
|
|
80
83
|
} | null;
|
|
81
84
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
82
85
|
} & {
|
|
@@ -104,7 +107,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
104
107
|
oneClickBuyUrl: string | null;
|
|
105
108
|
stripePaymentIntentId: string | null;
|
|
106
109
|
settlement: {
|
|
107
|
-
actualDstAmount
|
|
110
|
+
actualDstAmount?: string;
|
|
111
|
+
relay?: Record<string, never>;
|
|
108
112
|
} | null;
|
|
109
113
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
110
114
|
} & {
|
|
@@ -132,7 +136,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
132
136
|
oneClickBuyUrl: string | null;
|
|
133
137
|
stripePaymentIntentId: string | null;
|
|
134
138
|
settlement: {
|
|
135
|
-
actualDstAmount
|
|
139
|
+
actualDstAmount?: string;
|
|
140
|
+
relay?: Record<string, never>;
|
|
136
141
|
} | null;
|
|
137
142
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
138
143
|
} & {
|
|
@@ -160,7 +165,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
160
165
|
oneClickBuyUrl: string | null;
|
|
161
166
|
stripePaymentIntentId: string | null;
|
|
162
167
|
settlement: {
|
|
163
|
-
actualDstAmount
|
|
168
|
+
actualDstAmount?: string;
|
|
169
|
+
relay?: Record<string, never>;
|
|
164
170
|
} | null;
|
|
165
171
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
166
172
|
} & {
|
|
@@ -191,7 +197,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
191
197
|
oneClickBuyUrl: string | null;
|
|
192
198
|
stripePaymentIntentId: string | null;
|
|
193
199
|
settlement: {
|
|
194
|
-
actualDstAmount
|
|
200
|
+
actualDstAmount?: string;
|
|
201
|
+
relay?: Record<string, never>;
|
|
195
202
|
} | null;
|
|
196
203
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
197
204
|
} & {
|
|
@@ -219,7 +226,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
219
226
|
oneClickBuyUrl: string | null;
|
|
220
227
|
stripePaymentIntentId: string | null;
|
|
221
228
|
settlement: {
|
|
222
|
-
actualDstAmount
|
|
229
|
+
actualDstAmount?: string;
|
|
230
|
+
relay?: Record<string, never>;
|
|
223
231
|
} | null;
|
|
224
232
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
225
233
|
} & {
|
|
@@ -247,7 +255,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
247
255
|
oneClickBuyUrl: string | null;
|
|
248
256
|
stripePaymentIntentId: string | null;
|
|
249
257
|
settlement: {
|
|
250
|
-
actualDstAmount
|
|
258
|
+
actualDstAmount?: string;
|
|
259
|
+
relay?: Record<string, never>;
|
|
251
260
|
} | null;
|
|
252
261
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
253
262
|
} & {
|
|
@@ -275,7 +284,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
275
284
|
oneClickBuyUrl: string | null;
|
|
276
285
|
stripePaymentIntentId: string | null;
|
|
277
286
|
settlement: {
|
|
278
|
-
actualDstAmount
|
|
287
|
+
actualDstAmount?: string;
|
|
288
|
+
relay?: Record<string, never>;
|
|
279
289
|
} | null;
|
|
280
290
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
281
291
|
} & {
|
|
@@ -303,7 +313,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
303
313
|
oneClickBuyUrl: string | null;
|
|
304
314
|
stripePaymentIntentId: string | null;
|
|
305
315
|
settlement: {
|
|
306
|
-
actualDstAmount
|
|
316
|
+
actualDstAmount?: string;
|
|
317
|
+
relay?: Record<string, never>;
|
|
307
318
|
} | null;
|
|
308
319
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
309
320
|
} & {
|
|
@@ -331,7 +342,8 @@ export declare function useAnyspendOrderHistory(creatorAddress: string | undefin
|
|
|
331
342
|
oneClickBuyUrl: string | null;
|
|
332
343
|
stripePaymentIntentId: string | null;
|
|
333
344
|
settlement: {
|
|
334
|
-
actualDstAmount
|
|
345
|
+
actualDstAmount?: string;
|
|
346
|
+
relay?: Record<string, never>;
|
|
335
347
|
} | null;
|
|
336
348
|
fee?: Omit<import("../..").components["schemas"]["Fee"], "type"> | null;
|
|
337
349
|
} & {
|
|
@@ -1317,10 +1317,22 @@ export interface components {
|
|
|
1317
1317
|
/** @description Settlement information for executed orders */
|
|
1318
1318
|
settlement: {
|
|
1319
1319
|
/**
|
|
1320
|
-
* @description Actual received amount after execution
|
|
1320
|
+
* @description Actual received amount after execution (only for swap/hypeduel orders). Optional - only present for swap/hypeduel orders.
|
|
1321
1321
|
* @example 990000
|
|
1322
1322
|
*/
|
|
1323
|
-
actualDstAmount
|
|
1323
|
+
actualDstAmount?: string;
|
|
1324
|
+
/**
|
|
1325
|
+
* @description Complete relay API response data. Contains transaction details, state changes, fees, and execution status. Optional - can be backfilled by querying Relay API /requests/v2 endpoint.
|
|
1326
|
+
* @example {
|
|
1327
|
+
* "status": "success",
|
|
1328
|
+
* "metadata": {
|
|
1329
|
+
* "currencyOut": {
|
|
1330
|
+
* "amount": "990000"
|
|
1331
|
+
* }
|
|
1332
|
+
* }
|
|
1333
|
+
* }
|
|
1334
|
+
*/
|
|
1335
|
+
relay?: Record<string, never>;
|
|
1324
1336
|
} | null;
|
|
1325
1337
|
/** @description Fee structure for the order including Stripe and AnySpend fees */
|
|
1326
1338
|
fee?: Omit<components["schemas"]["Fee"], "type"> | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PermissionsConfig } from "../../../../global-account/types/permissions";
|
|
2
|
-
import "@
|
|
2
|
+
import "@relayprotocol/relay-kit-ui/styles.css";
|
|
3
3
|
import { Account } from "thirdweb/wallets";
|
|
4
4
|
import { ClientType } from "../../../client-manager";
|
|
5
5
|
import { B3ContextType } from "./types";
|
|
@@ -7,7 +7,7 @@ const react_1 = require("../../../../global-account/react");
|
|
|
7
7
|
const useWagmiConfig_1 = require("../../../../global-account/react/hooks/useWagmiConfig");
|
|
8
8
|
const analytics_1 = require("../../../../global-account/utils/analytics");
|
|
9
9
|
const debug_1 = require("../../../../shared/utils/debug");
|
|
10
|
-
require("@
|
|
10
|
+
require("@relayprotocol/relay-kit-ui/styles.css");
|
|
11
11
|
const react_query_1 = require("@tanstack/react-query");
|
|
12
12
|
const react_2 = require("react");
|
|
13
13
|
const sonner_1 = require("sonner");
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RelayKitProviderWrapper = RelayKitProviderWrapper;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const relay_kit_ui_1 = require("@
|
|
6
|
-
const relay_sdk_1 = require("@
|
|
5
|
+
const relay_kit_ui_1 = require("@relayprotocol/relay-kit-ui");
|
|
6
|
+
const relay_sdk_1 = require("@relayprotocol/relay-sdk");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
function RelayKitProviderWrapper({ children, simDuneApiKey, }) {
|
|
9
9
|
const [relayChains, setRelayChains] = (0, react_1.useState)([]);
|
|
@@ -41,6 +41,17 @@ function useAuthentication(partnerId) {
|
|
|
41
41
|
const activeWagmiAccount = (0, wagmi_1.useAccount)();
|
|
42
42
|
const { switchAccount } = (0, wagmi_1.useSwitchAccount)();
|
|
43
43
|
debug("@@activeWagmiAccount", activeWagmiAccount);
|
|
44
|
+
// Check localStorage version and clear if not found or mismatched
|
|
45
|
+
(0, react_2.useEffect)(() => {
|
|
46
|
+
if (typeof localStorage !== "undefined") {
|
|
47
|
+
const version = localStorage.getItem("version");
|
|
48
|
+
if (version !== "1") {
|
|
49
|
+
debug("@@localStorage:clearing due to version mismatch", { version });
|
|
50
|
+
localStorage.clear();
|
|
51
|
+
localStorage.setItem("version", "1");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}, []);
|
|
44
55
|
const wallet = (0, wallets_1.ecosystemWallet)(constants_1.ecosystemWalletId, {
|
|
45
56
|
partnerId: partnerId,
|
|
46
57
|
});
|