@b3dotfun/sdk 0.0.55 → 0.0.56-alpha.1
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/AnySpendStakeUpside.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeUpside.js +3 -3
- package/dist/cjs/anyspend/types/api.d.ts +3 -4
- package/dist/cjs/global-account/react/stores/useModalStore.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
- package/dist/esm/anyspend/react/components/AnySpendStakeUpside.js +3 -3
- package/dist/esm/anyspend/types/api.d.ts +3 -4
- package/dist/esm/global-account/react/stores/useModalStore.d.ts +2 -0
- package/dist/types/anyspend/react/components/AnySpendStakeUpside.d.ts +2 -1
- package/dist/types/anyspend/types/api.d.ts +3 -4
- package/dist/types/global-account/react/stores/useModalStore.d.ts +2 -0
- package/package.json +3 -3
- package/src/anyspend/react/components/AnySpendStakeUpside.tsx +3 -3
- package/src/anyspend/types/api.ts +3 -4
- package/src/global-account/react/stores/useModalStore.ts +2 -0
|
@@ -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.
|
|
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
|
}
|
|
@@ -78,7 +78,6 @@ export interface paths {
|
|
|
78
78
|
/**
|
|
79
79
|
* Get Coinbase onramp options
|
|
80
80
|
* @description Retrieves available Coinbase onramp configuration options.
|
|
81
|
-
*
|
|
82
81
|
*/
|
|
83
82
|
get: {
|
|
84
83
|
parameters: {
|
|
@@ -288,12 +287,12 @@ export interface paths {
|
|
|
288
287
|
*/
|
|
289
288
|
get: {
|
|
290
289
|
parameters: {
|
|
291
|
-
query
|
|
290
|
+
query: {
|
|
292
291
|
/**
|
|
293
|
-
* @description
|
|
292
|
+
* @description Address of the order creator
|
|
294
293
|
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
295
294
|
*/
|
|
296
|
-
creatorAddress
|
|
295
|
+
creatorAddress: string;
|
|
297
296
|
/**
|
|
298
297
|
* @description Maximum number of orders to return
|
|
299
298
|
* @example 20
|
|
@@ -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 = () => (
|
|
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
|
}
|
|
@@ -78,7 +78,6 @@ export interface paths {
|
|
|
78
78
|
/**
|
|
79
79
|
* Get Coinbase onramp options
|
|
80
80
|
* @description Retrieves available Coinbase onramp configuration options.
|
|
81
|
-
*
|
|
82
81
|
*/
|
|
83
82
|
get: {
|
|
84
83
|
parameters: {
|
|
@@ -288,12 +287,12 @@ export interface paths {
|
|
|
288
287
|
*/
|
|
289
288
|
get: {
|
|
290
289
|
parameters: {
|
|
291
|
-
query
|
|
290
|
+
query: {
|
|
292
291
|
/**
|
|
293
|
-
* @description
|
|
292
|
+
* @description Address of the order creator
|
|
294
293
|
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
295
294
|
*/
|
|
296
|
-
creatorAddress
|
|
295
|
+
creatorAddress: string;
|
|
297
296
|
/**
|
|
298
297
|
* @description Maximum number of orders to return
|
|
299
298
|
* @example 20
|
|
@@ -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;
|
|
@@ -78,7 +78,6 @@ export interface paths {
|
|
|
78
78
|
/**
|
|
79
79
|
* Get Coinbase onramp options
|
|
80
80
|
* @description Retrieves available Coinbase onramp configuration options.
|
|
81
|
-
*
|
|
82
81
|
*/
|
|
83
82
|
get: {
|
|
84
83
|
parameters: {
|
|
@@ -288,12 +287,12 @@ export interface paths {
|
|
|
288
287
|
*/
|
|
289
288
|
get: {
|
|
290
289
|
parameters: {
|
|
291
|
-
query
|
|
290
|
+
query: {
|
|
292
291
|
/**
|
|
293
|
-
* @description
|
|
292
|
+
* @description Address of the order creator
|
|
294
293
|
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
295
294
|
*/
|
|
296
|
-
creatorAddress
|
|
295
|
+
creatorAddress: string;
|
|
297
296
|
/**
|
|
298
297
|
* @description Maximum number of orders to return
|
|
299
298
|
* @example 20
|
|
@@ -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.
|
|
3
|
+
"version": "0.0.56-alpha.1",
|
|
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.
|
|
299
|
-
"@relayprotocol/relay-sdk": "3.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
|
}
|
|
@@ -79,7 +79,6 @@ export interface paths {
|
|
|
79
79
|
/**
|
|
80
80
|
* Get Coinbase onramp options
|
|
81
81
|
* @description Retrieves available Coinbase onramp configuration options.
|
|
82
|
-
*
|
|
83
82
|
*/
|
|
84
83
|
get: {
|
|
85
84
|
parameters: {
|
|
@@ -289,12 +288,12 @@ export interface paths {
|
|
|
289
288
|
*/
|
|
290
289
|
get: {
|
|
291
290
|
parameters: {
|
|
292
|
-
query
|
|
291
|
+
query: {
|
|
293
292
|
/**
|
|
294
|
-
* @description
|
|
293
|
+
* @description Address of the order creator
|
|
295
294
|
* @example 0x58241893EF1f86C9fBd8109Cd44Ea961fDb474e1
|
|
296
295
|
*/
|
|
297
|
-
creatorAddress
|
|
296
|
+
creatorAddress: string;
|
|
298
297
|
/**
|
|
299
298
|
* @description Maximum number of orders to return
|
|
300
299
|
* @example 20
|
|
@@ -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
|
}
|