@b3dotfun/sdk 0.0.1-alpha.12 → 0.0.1-alpha.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.
@@ -11,7 +11,7 @@ export declare enum PanelView {
11
11
  LOADING = 3,
12
12
  FIAT_PAYMENT = 4
13
13
  }
14
- export declare function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet, mode, defaultActiveTab, loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps }: {
14
+ export declare function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet, mode, defaultActiveTab, loadOrder, hideTransactionHistoryButton }: {
15
15
  destinationTokenAddress?: string;
16
16
  destinationTokenChainId?: number;
17
17
  isMainnet?: boolean;
@@ -19,5 +19,4 @@ export declare function AnySpend({ destinationTokenAddress, destinationTokenChai
19
19
  defaultActiveTab?: "crypto" | "fiat";
20
20
  loadOrder?: string;
21
21
  hideTransactionHistoryButton?: boolean;
22
- recipientAddress?: string;
23
22
  }): import("react/jsx-runtime").JSX.Element;
@@ -9,8 +9,8 @@ exports.AnySpend = AnySpend;
9
9
  const jsx_runtime_1 = require("react/jsx-runtime");
10
10
  const anyspend_1 = require("../../../anyspend");
11
11
  const react_1 = require("../../../global-account/react");
12
- const cn_1 = require("../../../shared/utils/cn");
13
12
  const formatAddress_1 = require("../../../shared/utils/formatAddress");
13
+ const cn_1 = require("../../../shared/utils/cn");
14
14
  const number_1 = require("../../../shared/utils/number");
15
15
  const framer_motion_1 = require("framer-motion");
16
16
  const invariant_1 = __importDefault(require("invariant"));
@@ -36,7 +36,7 @@ var PanelView;
36
36
  PanelView[PanelView["FIAT_PAYMENT"] = 4] = "FIAT_PAYMENT";
37
37
  })(PanelView || (exports.PanelView = PanelView = {}));
38
38
  const ANYSPEND_RECIPIENTS_KEY = "anyspend_recipients";
39
- function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet = true, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps }) {
39
+ function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet = true, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton }) {
40
40
  const searchParams = (0, react_1.useSearchParamsSSR)();
41
41
  const router = (0, react_1.useRouter)();
42
42
  // Determine if we're in "buy mode" based on whether destination token props are provided
@@ -279,8 +279,8 @@ function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet
279
279
  const { address: globalAddress, wallet: globalWallet } = (0, react_1.useAccountWallet)();
280
280
  // Set default recipient address when wallet changes
281
281
  (0, react_2.useEffect)(() => {
282
- setRecipientAddress(recipientAddressFromProps || globalAddress);
283
- }, [recipientAddressFromProps, globalAddress]);
282
+ setRecipientAddress(globalAddress);
283
+ }, [globalAddress]);
284
284
  // Get anyspend price
285
285
  const activeInputAmountInWei = isSrcInputDirty
286
286
  ? (0, viem_1.parseUnits)(srcAmount.replaceAll(",", ""), selectedSrcToken.decimals).toString()
@@ -11,7 +11,7 @@ export declare enum PanelView {
11
11
  LOADING = 3,
12
12
  FIAT_PAYMENT = 4
13
13
  }
14
- export declare function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet, mode, defaultActiveTab, loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps }: {
14
+ export declare function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet, mode, defaultActiveTab, loadOrder, hideTransactionHistoryButton }: {
15
15
  destinationTokenAddress?: string;
16
16
  destinationTokenChainId?: number;
17
17
  isMainnet?: boolean;
@@ -19,5 +19,4 @@ export declare function AnySpend({ destinationTokenAddress, destinationTokenChai
19
19
  defaultActiveTab?: "crypto" | "fiat";
20
20
  loadOrder?: string;
21
21
  hideTransactionHistoryButton?: boolean;
22
- recipientAddress?: string;
23
22
  }): import("react/jsx-runtime").JSX.Element;
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { getDefaultToken, OrderType, TradeType, USDC_BASE, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote } from "../../../anyspend";
4
4
  import { Button, ShinyButton, StyleRoot, TransitionPanel, useAccountWallet, useOnchainName, useRouter, useSearchParamsSSR, useTokenData, useTokenFromUrl } from "../../../global-account/react";
5
- import { cn } from "../../../shared/utils/cn";
6
5
  import { shortenAddress } from "../../../shared/utils/formatAddress";
6
+ import { cn } from "../../../shared/utils/cn";
7
7
  import { formatDisplayNumber, formatTokenAmount } from "../../../shared/utils/number";
8
8
  import { motion } from "framer-motion";
9
9
  import invariant from "invariant";
@@ -29,7 +29,7 @@ export var PanelView;
29
29
  PanelView[PanelView["FIAT_PAYMENT"] = 4] = "FIAT_PAYMENT";
30
30
  })(PanelView || (PanelView = {}));
31
31
  const ANYSPEND_RECIPIENTS_KEY = "anyspend_recipients";
32
- export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet = true, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps }) {
32
+ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet = true, mode = "modal", defaultActiveTab = "crypto", loadOrder, hideTransactionHistoryButton }) {
33
33
  const searchParams = useSearchParamsSSR();
34
34
  const router = useRouter();
35
35
  // Determine if we're in "buy mode" based on whether destination token props are provided
@@ -272,8 +272,8 @@ export function AnySpend({ destinationTokenAddress, destinationTokenChainId, isM
272
272
  const { address: globalAddress, wallet: globalWallet } = useAccountWallet();
273
273
  // Set default recipient address when wallet changes
274
274
  useEffect(() => {
275
- setRecipientAddress(recipientAddressFromProps || globalAddress);
276
- }, [recipientAddressFromProps, globalAddress]);
275
+ setRecipientAddress(globalAddress);
276
+ }, [globalAddress]);
277
277
  // Get anyspend price
278
278
  const activeInputAmountInWei = isSrcInputDirty
279
279
  ? parseUnits(srcAmount.replaceAll(",", ""), selectedSrcToken.decimals).toString()
@@ -11,7 +11,7 @@ export declare enum PanelView {
11
11
  LOADING = 3,
12
12
  FIAT_PAYMENT = 4
13
13
  }
14
- export declare function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet, mode, defaultActiveTab, loadOrder, hideTransactionHistoryButton, recipientAddress: recipientAddressFromProps }: {
14
+ export declare function AnySpend({ destinationTokenAddress, destinationTokenChainId, isMainnet, mode, defaultActiveTab, loadOrder, hideTransactionHistoryButton }: {
15
15
  destinationTokenAddress?: string;
16
16
  destinationTokenChainId?: number;
17
17
  isMainnet?: boolean;
@@ -19,5 +19,4 @@ export declare function AnySpend({ destinationTokenAddress, destinationTokenChai
19
19
  defaultActiveTab?: "crypto" | "fiat";
20
20
  loadOrder?: string;
21
21
  hideTransactionHistoryButton?: boolean;
22
- recipientAddress?: string;
23
22
  }): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.1-alpha.12",
3
+ "version": "0.0.1-alpha.13",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -170,7 +170,7 @@
170
170
  "dependencies": {
171
171
  "@amplitude/analytics-browser": "2.14.0",
172
172
  "@b3dotfun/b3-api": "0.0.21",
173
- "@b3dotfun/basement-api": "0.0.10",
173
+ "@b3dotfun/basement-api": "0.0.11",
174
174
  "@chakra-ui/react": "2.10.7",
175
175
  "@feathersjs/authentication-client": "5.0.33",
176
176
  "@feathersjs/feathers": "5.0.33",
@@ -15,6 +15,7 @@ import {
15
15
  ShinyButton,
16
16
  StyleRoot,
17
17
  TransitionPanel,
18
+ useAccountAssets,
18
19
  useAccountWallet,
19
20
  useOnchainName,
20
21
  useRouter,
@@ -22,8 +23,8 @@ import {
22
23
  useTokenData,
23
24
  useTokenFromUrl
24
25
  } from "@b3dotfun/sdk/global-account/react";
25
- import { cn } from "@b3dotfun/sdk/shared/utils/cn";
26
26
  import { shortenAddress } from "@b3dotfun/sdk/shared/utils/formatAddress";
27
+ import { cn } from "@b3dotfun/sdk/shared/utils/cn";
27
28
  import { formatDisplayNumber, formatTokenAmount } from "@b3dotfun/sdk/shared/utils/number";
28
29
  import { motion } from "framer-motion";
29
30
  import invariant from "invariant";
@@ -65,8 +66,7 @@ export function AnySpend({
65
66
  mode = "modal",
66
67
  defaultActiveTab = "crypto",
67
68
  loadOrder,
68
- hideTransactionHistoryButton,
69
- recipientAddress: recipientAddressFromProps
69
+ hideTransactionHistoryButton
70
70
  }: {
71
71
  destinationTokenAddress?: string;
72
72
  destinationTokenChainId?: number;
@@ -75,7 +75,6 @@ export function AnySpend({
75
75
  defaultActiveTab?: "crypto" | "fiat";
76
76
  loadOrder?: string;
77
77
  hideTransactionHistoryButton?: boolean;
78
- recipientAddress?: string;
79
78
  }) {
80
79
  const searchParams = useSearchParamsSSR();
81
80
  const router = useRouter();
@@ -375,8 +374,8 @@ export function AnySpend({
375
374
 
376
375
  // Set default recipient address when wallet changes
377
376
  useEffect(() => {
378
- setRecipientAddress(recipientAddressFromProps || globalAddress);
379
- }, [recipientAddressFromProps, globalAddress]);
377
+ setRecipientAddress(globalAddress);
378
+ }, [globalAddress]);
380
379
 
381
380
  // Get anyspend price
382
381
  const activeInputAmountInWei = isSrcInputDirty