@b3dotfun/sdk 0.1.5 → 0.1.6-test.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.
@@ -39,9 +39,9 @@ export interface AnySpendCollectorClubPurchaseProps {
39
39
  */
40
40
  spenderAddress?: string;
41
41
  /**
42
- * Collector Club Shop contract address (defaults to Base mainnet shop)
42
+ * Use staging contract address instead of production
43
43
  */
44
- ccShopAddress?: string;
44
+ isStaging?: boolean;
45
45
  /**
46
46
  * Success callback
47
47
  */
@@ -70,4 +70,4 @@ export interface AnySpendCollectorClubPurchaseProps {
70
70
  */
71
71
  forceFiatPayment?: boolean;
72
72
  }
73
- export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, ccShopAddress, spenderAddress, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, isStaging, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
@@ -33,8 +33,9 @@ const number_1 = require("../../../shared/utils/number");
33
33
  const react_1 = require("react");
34
34
  const viem_1 = require("viem");
35
35
  const AnySpendCustom_1 = require("./AnySpendCustom");
36
- // Default Collector Club Shop contract on Base
37
- const DEFAULT_CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
36
+ // Collector Club Shop contract addresses on Base
37
+ const CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
38
+ const CC_SHOP_ADDRESS_STAGING = "0x8b751143342ac41eB965E55430e3F7Adf6BE01fA";
38
39
  const BASE_CHAIN_ID = 8453;
39
40
  // ABI for buyPacksFor function only
40
41
  const BUY_PACKS_FOR_ABI = {
@@ -48,7 +49,8 @@ const BUY_PACKS_FOR_ABI = {
48
49
  stateMutability: "nonpayable",
49
50
  type: "function",
50
51
  };
51
- function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = constants_1.USDC_BASE, recipientAddress, ccShopAddress = DEFAULT_CC_SHOP_ADDRESS, spenderAddress, onSuccess, header, showRecipient = true, vendingMachineId, packType, forceFiatPayment, }) {
52
+ function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = constants_1.USDC_BASE, recipientAddress, spenderAddress, isStaging = false, onSuccess, header, showRecipient = true, vendingMachineId, packType, forceFiatPayment, }) {
53
+ const ccShopAddress = isStaging ? CC_SHOP_ADDRESS_STAGING : CC_SHOP_ADDRESS;
52
54
  // Calculate total amount needed (pricePerPack * packAmount)
53
55
  const totalAmount = (0, react_1.useMemo)(() => {
54
56
  try {
@@ -131,6 +131,8 @@ export interface AnySpendModalProps extends BaseModalProps {
131
131
  hideHeader?: boolean;
132
132
  /** When true, disables URL parameter management for swap configuration */
133
133
  disableUrlParamManagement?: boolean;
134
+ /** Staging environment support */
135
+ isStaging?: boolean;
134
136
  }
135
137
  /**
136
138
  * Props for the AnySpend NFT modal
@@ -39,9 +39,9 @@ export interface AnySpendCollectorClubPurchaseProps {
39
39
  */
40
40
  spenderAddress?: string;
41
41
  /**
42
- * Collector Club Shop contract address (defaults to Base mainnet shop)
42
+ * Use staging contract address instead of production
43
43
  */
44
- ccShopAddress?: string;
44
+ isStaging?: boolean;
45
45
  /**
46
46
  * Success callback
47
47
  */
@@ -70,4 +70,4 @@ export interface AnySpendCollectorClubPurchaseProps {
70
70
  */
71
71
  forceFiatPayment?: boolean;
72
72
  }
73
- export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, ccShopAddress, spenderAddress, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, isStaging, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
@@ -30,8 +30,9 @@ import { formatUnits } from "../../../shared/utils/number.js";
30
30
  import { useMemo } from "react";
31
31
  import { encodeFunctionData } from "viem";
32
32
  import { AnySpendCustom } from "./AnySpendCustom.js";
33
- // Default Collector Club Shop contract on Base
34
- const DEFAULT_CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
33
+ // Collector Club Shop contract addresses on Base
34
+ const CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
35
+ const CC_SHOP_ADDRESS_STAGING = "0x8b751143342ac41eB965E55430e3F7Adf6BE01fA";
35
36
  const BASE_CHAIN_ID = 8453;
36
37
  // ABI for buyPacksFor function only
37
38
  const BUY_PACKS_FOR_ABI = {
@@ -45,7 +46,8 @@ const BUY_PACKS_FOR_ABI = {
45
46
  stateMutability: "nonpayable",
46
47
  type: "function",
47
48
  };
48
- export function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = USDC_BASE, recipientAddress, ccShopAddress = DEFAULT_CC_SHOP_ADDRESS, spenderAddress, onSuccess, header, showRecipient = true, vendingMachineId, packType, forceFiatPayment, }) {
49
+ export function AnySpendCollectorClubPurchase({ loadOrder, mode = "modal", activeTab = "crypto", packId, packAmount, pricePerPack, paymentToken = USDC_BASE, recipientAddress, spenderAddress, isStaging = false, onSuccess, header, showRecipient = true, vendingMachineId, packType, forceFiatPayment, }) {
50
+ const ccShopAddress = isStaging ? CC_SHOP_ADDRESS_STAGING : CC_SHOP_ADDRESS;
49
51
  // Calculate total amount needed (pricePerPack * packAmount)
50
52
  const totalAmount = useMemo(() => {
51
53
  try {
@@ -131,6 +131,8 @@ export interface AnySpendModalProps extends BaseModalProps {
131
131
  hideHeader?: boolean;
132
132
  /** When true, disables URL parameter management for swap configuration */
133
133
  disableUrlParamManagement?: boolean;
134
+ /** Staging environment support */
135
+ isStaging?: boolean;
134
136
  }
135
137
  /**
136
138
  * Props for the AnySpend NFT modal
@@ -39,9 +39,9 @@ export interface AnySpendCollectorClubPurchaseProps {
39
39
  */
40
40
  spenderAddress?: string;
41
41
  /**
42
- * Collector Club Shop contract address (defaults to Base mainnet shop)
42
+ * Use staging contract address instead of production
43
43
  */
44
- ccShopAddress?: string;
44
+ isStaging?: boolean;
45
45
  /**
46
46
  * Success callback
47
47
  */
@@ -70,4 +70,4 @@ export interface AnySpendCollectorClubPurchaseProps {
70
70
  */
71
71
  forceFiatPayment?: boolean;
72
72
  }
73
- export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, ccShopAddress, spenderAddress, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
73
+ export declare function AnySpendCollectorClubPurchase({ loadOrder, mode, activeTab, packId, packAmount, pricePerPack, paymentToken, recipientAddress, spenderAddress, isStaging, onSuccess, header, showRecipient, vendingMachineId, packType, forceFiatPayment, }: AnySpendCollectorClubPurchaseProps): import("react/jsx-runtime").JSX.Element;
@@ -131,6 +131,8 @@ export interface AnySpendModalProps extends BaseModalProps {
131
131
  hideHeader?: boolean;
132
132
  /** When true, disables URL parameter management for swap configuration */
133
133
  disableUrlParamManagement?: boolean;
134
+ /** Staging environment support */
135
+ isStaging?: boolean;
134
136
  }
135
137
  /**
136
138
  * Props for the AnySpend NFT modal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.1.5",
3
+ "version": "0.1.6-test.0",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -32,8 +32,9 @@ import React, { useMemo } from "react";
32
32
  import { encodeFunctionData } from "viem";
33
33
  import { AnySpendCustom } from "./AnySpendCustom";
34
34
 
35
- // Default Collector Club Shop contract on Base
36
- const DEFAULT_CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
35
+ // Collector Club Shop contract addresses on Base
36
+ const CC_SHOP_ADDRESS = "0x47366E64E4917dd4DdC04Fb9DC507c1dD2b87294";
37
+ const CC_SHOP_ADDRESS_STAGING = "0x8b751143342ac41eB965E55430e3F7Adf6BE01fA";
37
38
  const BASE_CHAIN_ID = 8453;
38
39
 
39
40
  // ABI for buyPacksFor function only
@@ -87,9 +88,9 @@ export interface AnySpendCollectorClubPurchaseProps {
87
88
  */
88
89
  spenderAddress?: string;
89
90
  /**
90
- * Collector Club Shop contract address (defaults to Base mainnet shop)
91
+ * Use staging contract address instead of production
91
92
  */
92
- ccShopAddress?: string;
93
+ isStaging?: boolean;
93
94
  /**
94
95
  * Success callback
95
96
  */
@@ -128,8 +129,8 @@ export function AnySpendCollectorClubPurchase({
128
129
  pricePerPack,
129
130
  paymentToken = USDC_BASE,
130
131
  recipientAddress,
131
- ccShopAddress = DEFAULT_CC_SHOP_ADDRESS,
132
132
  spenderAddress,
133
+ isStaging = false,
133
134
  onSuccess,
134
135
  header,
135
136
  showRecipient = true,
@@ -137,6 +138,8 @@ export function AnySpendCollectorClubPurchase({
137
138
  packType,
138
139
  forceFiatPayment,
139
140
  }: AnySpendCollectorClubPurchaseProps) {
141
+ const ccShopAddress = isStaging ? CC_SHOP_ADDRESS_STAGING : CC_SHOP_ADDRESS;
142
+
140
143
  // Calculate total amount needed (pricePerPack * packAmount)
141
144
  const totalAmount = useMemo(() => {
142
145
  try {
@@ -137,6 +137,8 @@ export interface AnySpendModalProps extends BaseModalProps {
137
137
  hideHeader?: boolean;
138
138
  /** When true, disables URL parameter management for swap configuration */
139
139
  disableUrlParamManagement?: boolean;
140
+ /** Staging environment support */
141
+ isStaging?: boolean;
140
142
  }
141
143
 
142
144
  /**