@b3dotfun/sdk 0.0.20 → 0.0.21-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.
Files changed (136) hide show
  1. package/dist/cjs/anyspend/index.native.d.ts +0 -2
  2. package/dist/cjs/anyspend/index.native.js +0 -4
  3. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +3 -3
  4. package/dist/cjs/anyspend/react/components/AnySpend.js +43 -55
  5. package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +1 -1
  6. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +159 -84
  7. package/dist/cjs/anyspend/react/components/AnySpendFingerprintWrapper.d.ts +1 -1
  8. package/dist/cjs/anyspend/react/components/AnySpendFingerprintWrapper.js +2 -5
  9. package/dist/cjs/anyspend/react/components/AnySpendNFT.js +1 -1
  10. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +1 -1
  11. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.d.ts +4 -4
  12. package/dist/cjs/anyspend/react/components/common/CryptoPaymentMethod.js +50 -102
  13. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +1 -1
  14. package/dist/cjs/anyspend/react/components/common/OrderDetails.d.ts +2 -2
  15. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +7 -9
  16. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +2 -2
  17. package/dist/cjs/anyspend/react/components/common/PaymentStripeWeb2.js +1 -3
  18. package/dist/cjs/anyspend/react/components/common/RecipientSelection.d.ts +42 -0
  19. package/dist/cjs/anyspend/react/components/common/RecipientSelection.example.d.ts +7 -0
  20. package/dist/cjs/anyspend/react/components/common/RecipientSelection.example.js +27 -0
  21. package/dist/cjs/anyspend/react/components/common/RecipientSelection.js +36 -0
  22. package/dist/cjs/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
  23. package/dist/cjs/anyspend/react/components/index.d.ts +1 -0
  24. package/dist/cjs/anyspend/react/components/index.js +3 -1
  25. package/dist/cjs/anyspend/react/hooks/index.d.ts +1 -0
  26. package/dist/cjs/anyspend/react/hooks/index.js +1 -0
  27. package/dist/cjs/anyspend/react/hooks/useConnectedUserProfile.d.ts +12 -0
  28. package/dist/cjs/anyspend/react/hooks/useConnectedUserProfile.js +25 -0
  29. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +5 -5
  30. package/dist/cjs/anyspend/react/index.d.ts +1 -1
  31. package/dist/cjs/anyspend/react/index.js +1 -1
  32. package/dist/cjs/anyspend/react/providers/index.d.ts +2 -0
  33. package/dist/cjs/anyspend/react/providers/index.js +18 -0
  34. package/dist/cjs/anyspend/types/api.d.ts +35 -56
  35. package/dist/cjs/anyspend/utils/chain.d.ts +1 -1
  36. package/dist/cjs/anyspend/utils/chain.js +122 -15
  37. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +5 -1
  38. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +2 -2
  39. package/dist/cjs/global-account/react/hooks/index.d.ts +1 -1
  40. package/dist/cjs/global-account/react/hooks/useProfile.d.ts +2 -1
  41. package/dist/cjs/global-account/react/hooks/useProfile.js +9 -7
  42. package/dist/cjs/shared/constants/index.js +5 -3
  43. package/dist/cjs/shared/utils/formatUsername.d.ts +1 -1
  44. package/dist/cjs/shared/utils/formatUsername.js +3 -1
  45. package/dist/esm/anyspend/index.native.d.ts +0 -2
  46. package/dist/esm/anyspend/index.native.js +0 -4
  47. package/dist/esm/anyspend/react/components/AnySpend.d.ts +3 -3
  48. package/dist/esm/anyspend/react/components/AnySpend.js +46 -58
  49. package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +1 -1
  50. package/dist/esm/anyspend/react/components/AnySpendCustom.js +163 -88
  51. package/dist/esm/anyspend/react/components/AnySpendFingerprintWrapper.d.ts +1 -1
  52. package/dist/esm/anyspend/react/components/AnySpendFingerprintWrapper.js +2 -5
  53. package/dist/esm/anyspend/react/components/AnySpendNFT.js +1 -1
  54. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +1 -1
  55. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.d.ts +4 -4
  56. package/dist/esm/anyspend/react/components/common/CryptoPaymentMethod.js +52 -104
  57. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +1 -1
  58. package/dist/esm/anyspend/react/components/common/OrderDetails.d.ts +2 -2
  59. package/dist/esm/anyspend/react/components/common/OrderDetails.js +8 -10
  60. package/dist/esm/anyspend/react/components/common/OrderStatus.js +2 -2
  61. package/dist/esm/anyspend/react/components/common/PaymentStripeWeb2.js +1 -3
  62. package/dist/esm/anyspend/react/components/common/RecipientSelection.d.ts +42 -0
  63. package/dist/esm/anyspend/react/components/common/RecipientSelection.example.d.ts +7 -0
  64. package/dist/esm/anyspend/react/components/common/RecipientSelection.example.js +22 -0
  65. package/dist/esm/anyspend/react/components/common/RecipientSelection.js +33 -0
  66. package/dist/esm/anyspend/react/components/common/TransferCryptoDetails.js +1 -1
  67. package/dist/esm/anyspend/react/components/index.d.ts +1 -0
  68. package/dist/esm/anyspend/react/components/index.js +1 -0
  69. package/dist/esm/anyspend/react/hooks/index.d.ts +1 -0
  70. package/dist/esm/anyspend/react/hooks/index.js +1 -0
  71. package/dist/esm/anyspend/react/hooks/useConnectedUserProfile.d.ts +12 -0
  72. package/dist/esm/anyspend/react/hooks/useConnectedUserProfile.js +22 -0
  73. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +5 -5
  74. package/dist/esm/anyspend/react/index.d.ts +1 -1
  75. package/dist/esm/anyspend/react/index.js +1 -1
  76. package/dist/esm/anyspend/react/providers/index.d.ts +2 -0
  77. package/dist/esm/anyspend/react/providers/index.js +2 -0
  78. package/dist/esm/anyspend/types/api.d.ts +35 -56
  79. package/dist/esm/anyspend/utils/chain.d.ts +1 -1
  80. package/dist/esm/anyspend/utils/chain.js +122 -15
  81. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +5 -1
  82. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +2 -2
  83. package/dist/esm/global-account/react/hooks/index.d.ts +1 -1
  84. package/dist/esm/global-account/react/hooks/useProfile.d.ts +2 -1
  85. package/dist/esm/global-account/react/hooks/useProfile.js +9 -7
  86. package/dist/esm/shared/constants/index.js +5 -3
  87. package/dist/esm/shared/utils/formatUsername.d.ts +1 -1
  88. package/dist/esm/shared/utils/formatUsername.js +3 -1
  89. package/dist/styles/index.css +1 -1
  90. package/dist/types/anyspend/index.native.d.ts +0 -2
  91. package/dist/types/anyspend/react/components/AnySpend.d.ts +3 -3
  92. package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +1 -1
  93. package/dist/types/anyspend/react/components/AnySpendFingerprintWrapper.d.ts +1 -1
  94. package/dist/types/anyspend/react/components/common/CryptoPaymentMethod.d.ts +4 -4
  95. package/dist/types/anyspend/react/components/common/OrderDetails.d.ts +2 -2
  96. package/dist/types/anyspend/react/components/common/RecipientSelection.d.ts +42 -0
  97. package/dist/types/anyspend/react/components/common/RecipientSelection.example.d.ts +7 -0
  98. package/dist/types/anyspend/react/components/index.d.ts +1 -0
  99. package/dist/types/anyspend/react/hooks/index.d.ts +1 -0
  100. package/dist/types/anyspend/react/hooks/useConnectedUserProfile.d.ts +12 -0
  101. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +5 -5
  102. package/dist/types/anyspend/react/index.d.ts +1 -1
  103. package/dist/types/anyspend/react/providers/index.d.ts +2 -0
  104. package/dist/types/anyspend/types/api.d.ts +35 -56
  105. package/dist/types/anyspend/utils/chain.d.ts +1 -1
  106. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +5 -1
  107. package/dist/types/global-account/react/hooks/index.d.ts +1 -1
  108. package/dist/types/global-account/react/hooks/useProfile.d.ts +2 -1
  109. package/dist/types/shared/utils/formatUsername.d.ts +1 -1
  110. package/package.json +2 -2
  111. package/src/anyspend/index.native.ts +0 -6
  112. package/src/anyspend/react/components/AnySpend.tsx +110 -134
  113. package/src/anyspend/react/components/AnySpendCustom.tsx +488 -196
  114. package/src/anyspend/react/components/AnySpendFingerprintWrapper.tsx +4 -8
  115. package/src/anyspend/react/components/AnySpendNFT.tsx +1 -1
  116. package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +1 -1
  117. package/src/anyspend/react/components/common/CryptoPaymentMethod.tsx +76 -108
  118. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +1 -1
  119. package/src/anyspend/react/components/common/OrderDetails.tsx +12 -13
  120. package/src/anyspend/react/components/common/OrderStatus.tsx +2 -2
  121. package/src/anyspend/react/components/common/PaymentStripeWeb2.tsx +1 -3
  122. package/src/anyspend/react/components/common/RecipientSelection.example.tsx +52 -0
  123. package/src/anyspend/react/components/common/RecipientSelection.tsx +146 -0
  124. package/src/anyspend/react/components/common/TransferCryptoDetails.tsx +1 -0
  125. package/src/anyspend/react/components/index.ts +1 -0
  126. package/src/anyspend/react/hooks/index.ts +1 -0
  127. package/src/anyspend/react/hooks/useConnectedUserProfile.ts +26 -0
  128. package/src/anyspend/react/index.ts +1 -1
  129. package/src/anyspend/react/providers/index.ts +2 -0
  130. package/src/anyspend/types/api.ts +37 -58
  131. package/src/anyspend/utils/chain.ts +126 -18
  132. package/src/global-account/react/components/B3Provider/B3Provider.tsx +6 -1
  133. package/src/global-account/react/hooks/index.ts +1 -1
  134. package/src/global-account/react/hooks/useProfile.ts +10 -5
  135. package/src/shared/constants/index.ts +5 -3
  136. package/src/shared/utils/formatUsername.ts +3 -2
@@ -51,10 +51,6 @@ export interface paths {
51
51
  metadata: {
52
52
  /** @description Token logo URI */
53
53
  logoURI: string;
54
- /** @description Whether token is verified */
55
- verified: boolean;
56
- /** @description Whether token is native to chain */
57
- isNative: boolean;
58
54
  };
59
55
  }[];
60
56
  /** @example 200 */
@@ -430,12 +426,8 @@ export interface paths {
430
426
  * "createdAt": 1752505817654
431
427
  * } */
432
428
  relayTx: components["schemas"]["RelayTx"] | null;
433
- /** @example null */
434
429
  executeTx: components["schemas"]["ExecuteTx"] | null;
435
- /**
436
- * @description Refund transactions if order failed
437
- * @example null
438
- */
430
+ /** @description Refund transactions if order failed */
439
431
  refundTxs: components["schemas"]["RefundTx"][] | null;
440
432
  };
441
433
  /** @example 200 */
@@ -643,8 +635,6 @@ export interface paths {
643
635
  metadata?: {
644
636
  /** @example https://assets.relay.link/icons/1/light.png */
645
637
  logoURI?: string;
646
- /** @example true */
647
- verified?: boolean;
648
638
  };
649
639
  };
650
640
  /**
@@ -684,8 +674,6 @@ export interface paths {
684
674
  metadata?: {
685
675
  /** @example https://coin-images.coingecko.com/coins/images/6319/large/usdc.png?1696506694 */
686
676
  logoURI?: string;
687
- /** @example true */
688
- verified?: boolean;
689
677
  };
690
678
  };
691
679
  /**
@@ -1026,7 +1014,7 @@ export interface components {
1026
1014
  expectedDstAmount: string;
1027
1015
  /**
1028
1016
  * @description Actual received amount (null for new orders)
1029
- * @example null
1017
+ * @example 990000
1030
1018
  */
1031
1019
  actualDstAmount: string | null;
1032
1020
  };
@@ -1062,7 +1050,7 @@ export interface components {
1062
1050
  contractAddress: string;
1063
1051
  /**
1064
1052
  * @description Token ID (for ERC1155, null for ERC721)
1065
- * @example null
1053
+ * @example 1
1066
1054
  */
1067
1055
  tokenId: number | null;
1068
1056
  /**
@@ -1179,10 +1167,7 @@ export interface components {
1179
1167
  * @enum {string}
1180
1168
  */
1181
1169
  status: "scanning_deposit_transaction" | "waiting_stripe_payment" | "expired" | "sending_token_from_vault" | "relay" | "executed" | "refunding" | "refunded" | "failure";
1182
- /**
1183
- * @description Error details if order failed
1184
- * @example null
1185
- */
1170
+ /** @description Error details if order failed */
1186
1171
  errorDetails: string | null;
1187
1172
  /**
1188
1173
  * @description Creation timestamp
@@ -1199,17 +1184,11 @@ export interface components {
1199
1184
  * @example 0xb34facb90a200251318e8841c05102366f2158cf
1200
1185
  */
1201
1186
  creatorAddress: string | null;
1202
- /**
1203
- * @description Optional partner identifier
1204
- * @example null
1205
- */
1187
+ /** @description Optional partner identifier */
1206
1188
  partnerId: string | null;
1207
1189
  /** @description Onramp configuration if used */
1208
1190
  onrampMetadata: components["schemas"]["OnrampMetadata"] | null;
1209
- /**
1210
- * @description Quick purchase URL if available
1211
- * @example null
1212
- */
1191
+ /** @description Quick purchase URL if available */
1213
1192
  oneClickBuyUrl: string | null;
1214
1193
  /**
1215
1194
  * @description Stripe payment intent ID if using Stripe
@@ -1628,34 +1607,6 @@ export interface components {
1628
1607
  */
1629
1608
  createdAt: number;
1630
1609
  };
1631
- StripeWeb2Support: {
1632
- /**
1633
- * @example false
1634
- * @constant
1635
- */
1636
- isSupport: false;
1637
- } | {
1638
- /**
1639
- * @example true
1640
- * @constant
1641
- */
1642
- isSupport: true;
1643
- /**
1644
- * @description Total payment amount formatted in USD
1645
- * @example 10.00
1646
- */
1647
- formattedTotalUsd: string;
1648
- /**
1649
- * @description Onramp amount formatted in USD
1650
- * @example 9.50
1651
- */
1652
- formattedOnrampUsd: string;
1653
- /**
1654
- * @description Stripe fee formatted in USD
1655
- * @example 0.50
1656
- */
1657
- formattedFeeUsd: string;
1658
- };
1659
1610
  /** @description NFT contract details */
1660
1611
  NftContract: {
1661
1612
  /**
@@ -1696,7 +1647,7 @@ export interface components {
1696
1647
  description: string;
1697
1648
  /**
1698
1649
  * @description Token ID (null for ERC721, specific ID for ERC1155)
1699
- * @example null
1650
+ * @example 1
1700
1651
  */
1701
1652
  tokenId: number | null;
1702
1653
  /**
@@ -1706,6 +1657,34 @@ export interface components {
1706
1657
  */
1707
1658
  type: "erc721" | "erc1155";
1708
1659
  };
1660
+ StripeWeb2Support: {
1661
+ /**
1662
+ * @example false
1663
+ * @constant
1664
+ */
1665
+ isSupport: false;
1666
+ } | {
1667
+ /**
1668
+ * @example true
1669
+ * @constant
1670
+ */
1671
+ isSupport: true;
1672
+ /**
1673
+ * @description Total payment amount formatted in USD
1674
+ * @example 10.00
1675
+ */
1676
+ formattedTotalUsd: string;
1677
+ /**
1678
+ * @description Onramp amount formatted in USD
1679
+ * @example 9.50
1680
+ */
1681
+ formattedOnrampUsd: string;
1682
+ /**
1683
+ * @description Stripe fee formatted in USD
1684
+ * @example 0.50
1685
+ */
1686
+ formattedFeeUsd: string;
1687
+ };
1709
1688
  };
1710
1689
  responses: never;
1711
1690
  parameters: never;
@@ -18,7 +18,7 @@ export declare function isMainnet(chainId: number): boolean;
18
18
  export declare function isTestnet(chainId: number): boolean;
19
19
  export declare function getDefaultToken(chainId: number): components["schemas"]["Token"];
20
20
  export declare function getChainName(chainId: number): string;
21
- export declare function getPaymentUrl(address: string, amount: bigint, currency: string, chainId: number): string;
21
+ export declare function getPaymentUrl(address: string, amount: bigint, currency: string, chainId: number, decimals?: number): string;
22
22
  export declare function getExplorerTxUrl(chainId: number, txHash: string): string;
23
23
  export declare function getExplorerAddressUrl(chainId: number, address: string): string;
24
24
  export declare function getMulticall3Address(chainId: number): string;
@@ -6,7 +6,7 @@ export declare const wagmiConfig: import("wagmi").Config<readonly [import("viem"
6
6
  /**
7
7
  * Main B3Provider component
8
8
  */
9
- export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, }: {
9
+ export declare function B3Provider({ isMainnetAnySpend, theme, children, accountOverride, environment, automaticallySetFirstEoa, simDuneApiKey, toaster, }: {
10
10
  isMainnetAnySpend?: boolean;
11
11
  theme: "light" | "dark";
12
12
  children: React.ReactNode;
@@ -14,6 +14,10 @@ export declare function B3Provider({ isMainnetAnySpend, theme, children, account
14
14
  environment: B3ContextType["environment"];
15
15
  automaticallySetFirstEoa?: boolean;
16
16
  simDuneApiKey?: string;
17
+ toaster?: {
18
+ position?: "top-center" | "top-right" | "bottom-center" | "bottom-right";
19
+ style?: React.CSSProperties;
20
+ };
17
21
  }): import("react/jsx-runtime").JSX.Element;
18
22
  /**
19
23
  * Inner provider component that provides the actual B3Context
@@ -18,7 +18,7 @@ export { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect";
18
18
  export { useMediaQuery } from "./useMediaQuery";
19
19
  export { useNativeBalance, useNativeBalanceFromRPC } from "./useNativeBalance";
20
20
  export { useOneBalance } from "./useOneBalance";
21
- export { useProfile, useProfilePreference, type Profile, type CombinedProfile, type PreferenceRequestBody, } from "./useProfile";
21
+ export { useProfile, useProfilePreference, type CombinedProfile, type PreferenceRequestBody, type Profile, } from "./useProfile";
22
22
  export { useQueryB3 } from "./useQueryB3";
23
23
  export { useQueryBSMNT } from "./useQueryBSMNT";
24
24
  export { useRemoveSessionKey } from "./useRemoveSessionKey";
@@ -28,9 +28,10 @@ export interface DisplayNameRequestBody {
28
28
  signer: string;
29
29
  timestamp: number;
30
30
  }
31
- export declare function useProfile({ address, name, fresh, }: {
31
+ export declare function useProfile({ address, name, b3GlobalId, fresh, }: {
32
32
  address?: string;
33
33
  name?: string;
34
+ b3GlobalId?: string;
34
35
  fresh?: boolean;
35
36
  }, options?: {
36
37
  enabled?: boolean;
@@ -1 +1 @@
1
- export declare function formatUsername(username: string): string;
1
+ export declare function formatUsername(username?: string): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.20",
3
+ "version": "0.0.21-alpha.0",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -191,7 +191,7 @@
191
191
  ],
192
192
  "dependencies": {
193
193
  "@amplitude/analytics-browser": "2.14.0",
194
- "@b3dotfun/b3-api": "0.0.30",
194
+ "@b3dotfun/b3-api": "0.0.38",
195
195
  "@b3dotfun/basement-api": "0.0.11",
196
196
  "@b3dotfun/bondkit": "^0.1.17",
197
197
  "@chakra-ui/react": "2.10.7",
@@ -1,9 +1,3 @@
1
- // Export all hooks
2
- export * from "./react/hooks";
3
-
4
- // Providers
5
- export * from "./react/providers/AnyspendProvider";
6
-
7
1
  // Types
8
2
  export * from "./types/api";
9
3