@b3dotfun/sdk 0.0.55 → 0.0.56-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.
@@ -1,5 +1,5 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, }: {
2
+ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, activeTab, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  beneficiaryAddress: string;
@@ -8,4 +8,5 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
8
8
  token: components["schemas"]["Token"];
9
9
  poolType: "b3" | "weth";
10
10
  onSuccess?: () => void;
11
+ activeTab?: "crypto" | "fiat";
11
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -30,8 +30,8 @@ function generateEncodedDataForStaking(amount, beneficiary, poolType) {
30
30
  }
31
31
  throw new Error("Unsupported pool type");
32
32
  }
33
- function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, }) {
34
- const header = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "relative mx-auto size-32", children: (0, jsx_runtime_1.jsx)("img", { alt: "token", className: "size-full", src: token.metadata.logoURI || "https://cdn.b3.fun/b3-coin-3d.png" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[60px] w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? (0, number_1.formatTokenAmount)(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] })] }));
33
+ function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, activeTab, }) {
34
+ const header = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[60px] w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? (0, number_1.formatTokenAmount)(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] }) }));
35
35
  // Only generate encoded data if we have a valid beneficiary address
36
36
  // This is used for the AnySpendCustom swap & stake flow
37
37
  if (!beneficiaryAddress || beneficiaryAddress === "") {
@@ -40,5 +40,5 @@ function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, st
40
40
  const encodedData = generateEncodedDataForStaking(stakeAmount, beneficiaryAddress, poolType);
41
41
  return ((0, jsx_runtime_1.jsx)(AnySpendCustom_1.AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: beneficiaryAddress, orderType: "custom", dstChainId: chains_1.base.id, dstToken: token, dstAmount: stakeAmount, contractAddress: stakingContractAddress, encodedData: encodedData, metadata: {
42
42
  action: `stake ${token.symbol}`,
43
- }, header: header, onSuccess: onSuccess, showRecipient: true }));
43
+ }, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab }));
44
44
  }
@@ -227,6 +227,8 @@ export interface AnySpendStakeUpsideProps extends BaseModalProps {
227
227
  poolType: "b3" | "weth";
228
228
  /** Token address to stake */
229
229
  token: components["schemas"]["Token"];
230
+ /** Active tab for the modal */
231
+ activeTab?: "crypto" | "fiat";
230
232
  /** Callback function called when the stake is successful */
231
233
  onSuccess?: () => void;
232
234
  }
@@ -1,5 +1,5 @@
1
1
  import { components } from "../../../anyspend/types/api";
2
- export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, }: {
2
+ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, activeTab, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  beneficiaryAddress: string;
@@ -8,4 +8,5 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
8
8
  token: components["schemas"]["Token"];
9
9
  poolType: "b3" | "weth";
10
10
  onSuccess?: () => void;
11
+ activeTab?: "crypto" | "fiat";
11
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -24,8 +24,8 @@ function generateEncodedDataForStaking(amount, beneficiary, poolType) {
24
24
  }
25
25
  throw new Error("Unsupported pool type");
26
26
  }
27
- export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, }) {
28
- const header = () => (_jsxs(_Fragment, { children: [_jsx("div", { className: "relative mx-auto size-32", children: _jsx("img", { alt: "token", className: "size-full", src: token.metadata.logoURI || "https://cdn.b3.fun/b3-coin-3d.png" }) }), _jsxs("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [_jsx("div", { className: "h-[60px] w-full" }), _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? formatTokenAmount(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] })] }));
27
+ export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, activeTab, }) {
28
+ const header = () => (_jsx(_Fragment, { children: _jsxs("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [_jsx("div", { className: "h-[60px] w-full" }), _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: ["Swap & Stake ", stakeAmount ? formatTokenAmount(BigInt(stakeAmount), token.decimals) : "", " ", token.symbol] }) })] }) }));
29
29
  // Only generate encoded data if we have a valid beneficiary address
30
30
  // This is used for the AnySpendCustom swap & stake flow
31
31
  if (!beneficiaryAddress || beneficiaryAddress === "") {
@@ -34,5 +34,5 @@ export function AnySpendStakeUpside({ loadOrder, mode = "modal", beneficiaryAddr
34
34
  const encodedData = generateEncodedDataForStaking(stakeAmount, beneficiaryAddress, poolType);
35
35
  return (_jsx(AnySpendCustom, { loadOrder: loadOrder, mode: mode, recipientAddress: beneficiaryAddress, orderType: "custom", dstChainId: base.id, dstToken: token, dstAmount: stakeAmount, contractAddress: stakingContractAddress, encodedData: encodedData, metadata: {
36
36
  action: `stake ${token.symbol}`,
37
- }, header: header, onSuccess: onSuccess, showRecipient: true }));
37
+ }, header: header, onSuccess: onSuccess, showRecipient: true, activeTab: activeTab }));
38
38
  }
@@ -227,6 +227,8 @@ export interface AnySpendStakeUpsideProps extends BaseModalProps {
227
227
  poolType: "b3" | "weth";
228
228
  /** Token address to stake */
229
229
  token: components["schemas"]["Token"];
230
+ /** Active tab for the modal */
231
+ activeTab?: "crypto" | "fiat";
230
232
  /** Callback function called when the stake is successful */
231
233
  onSuccess?: () => void;
232
234
  }
@@ -1,5 +1,5 @@
1
1
  import { components } from "@b3dotfun/sdk/anyspend/types/api";
2
- export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, }: {
2
+ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddress, stakeAmount, stakingContractAddress, token, poolType, onSuccess, activeTab, }: {
3
3
  loadOrder?: string;
4
4
  mode?: "modal" | "page";
5
5
  beneficiaryAddress: string;
@@ -8,4 +8,5 @@ export declare function AnySpendStakeUpside({ loadOrder, mode, beneficiaryAddres
8
8
  token: components["schemas"]["Token"];
9
9
  poolType: "b3" | "weth";
10
10
  onSuccess?: () => void;
11
+ activeTab?: "crypto" | "fiat";
11
12
  }): import("react/jsx-runtime").JSX.Element;
@@ -227,6 +227,8 @@ export interface AnySpendStakeUpsideProps extends BaseModalProps {
227
227
  poolType: "b3" | "weth";
228
228
  /** Token address to stake */
229
229
  token: components["schemas"]["Token"];
230
+ /** Active tab for the modal */
231
+ activeTab?: "crypto" | "fiat";
230
232
  /** Callback function called when the stake is successful */
231
233
  onSuccess?: () => void;
232
234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.55",
3
+ "version": "0.0.56-alpha.0",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -295,8 +295,8 @@
295
295
  "@radix-ui/react-slot": "1.1.2",
296
296
  "@radix-ui/react-tabs": "1.1.3",
297
297
  "@radix-ui/react-tooltip": "1.1.8",
298
- "@relayprotocol/relay-kit-ui": "5.0.3",
299
- "@relayprotocol/relay-sdk": "3.0.0",
298
+ "@relayprotocol/relay-kit-ui": "5.0.6",
299
+ "@relayprotocol/relay-sdk": "3.0.1",
300
300
  "@solana/spl-token": "^0.4.13",
301
301
  "@solana/web3.js": "^1.98.2",
302
302
  "@stripe/react-stripe-js": "^3.7.0",
@@ -34,6 +34,7 @@ export function AnySpendStakeUpside({
34
34
  token,
35
35
  poolType,
36
36
  onSuccess,
37
+ activeTab,
37
38
  }: {
38
39
  loadOrder?: string;
39
40
  mode?: "modal" | "page";
@@ -43,12 +44,10 @@ export function AnySpendStakeUpside({
43
44
  token: components["schemas"]["Token"];
44
45
  poolType: "b3" | "weth";
45
46
  onSuccess?: () => void;
47
+ activeTab?: "crypto" | "fiat";
46
48
  }) {
47
49
  const header = () => (
48
50
  <>
49
- <div className="relative mx-auto size-32">
50
- <img alt="token" className="size-full" src={token.metadata.logoURI || "https://cdn.b3.fun/b3-coin-3d.png"} />
51
- </div>
52
51
  <div className="from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t">
53
52
  <div className="h-[60px] w-full" />
54
53
  <div className="mb-1 flex w-full flex-col items-center gap-2 p-5">
@@ -91,6 +90,7 @@ export function AnySpendStakeUpside({
91
90
  header={header}
92
91
  onSuccess={onSuccess}
93
92
  showRecipient={true}
93
+ activeTab={activeTab}
94
94
  />
95
95
  );
96
96
  }
@@ -240,6 +240,8 @@ export interface AnySpendStakeUpsideProps extends BaseModalProps {
240
240
  poolType: "b3" | "weth";
241
241
  /** Token address to stake */
242
242
  token: components["schemas"]["Token"];
243
+ /** Active tab for the modal */
244
+ activeTab?: "crypto" | "fiat";
243
245
  /** Callback function called when the stake is successful */
244
246
  onSuccess?: () => void;
245
247
  }