@b3dotfun/sdk 0.0.1-alpha.6 → 0.0.1-alpha.8

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.
@@ -267,6 +267,9 @@ function getPaymentUrl(address, amount, currency) {
267
267
  return `ethereum:${address}`;
268
268
  }
269
269
  function getExplorerTxUrl(chainId, txHash) {
270
+ if (chainId === chains_1.b3.id) {
271
+ return "https://explorer.b3.fun/b3/tx/" + txHash;
272
+ }
270
273
  if (exports.EVM_CHAINS[chainId]) {
271
274
  return exports.EVM_CHAINS[chainId].viem.blockExplorers?.default.url + "/tx/" + txHash;
272
275
  }
@@ -1,3 +1,5 @@
1
- export * from "./components";
2
- export * from "./hooks";
3
- export * from "./stores";
1
+ export { B3Provider } from "./components/B3Provider.native";
2
+ export { useB3 } from "./components/B3Provider.native";
3
+ export { useAuthentication } from "./hooks/useAuthentication";
4
+ export { useSiwe } from "./hooks/useSiwe";
5
+ export { useAccountWallet } from "./hooks/useAccountWallet";
@@ -1,19 +1,17 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
2
+ // export * from "./components";
3
+ // export * from "./hooks";
4
+ // export * from "./stores";
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./components"), exports);
18
- __exportStar(require("./hooks"), exports);
19
- __exportStar(require("./stores"), exports);
6
+ exports.useAccountWallet = exports.useSiwe = exports.useAuthentication = exports.useB3 = exports.B3Provider = void 0;
7
+ // We only export the components and hooks that are needed for the native app
8
+ var B3Provider_native_1 = require("./components/B3Provider.native");
9
+ Object.defineProperty(exports, "B3Provider", { enumerable: true, get: function () { return B3Provider_native_1.B3Provider; } });
10
+ var B3Provider_native_2 = require("./components/B3Provider.native");
11
+ Object.defineProperty(exports, "useB3", { enumerable: true, get: function () { return B3Provider_native_2.useB3; } });
12
+ var useAuthentication_1 = require("./hooks/useAuthentication");
13
+ Object.defineProperty(exports, "useAuthentication", { enumerable: true, get: function () { return useAuthentication_1.useAuthentication; } });
14
+ var useSiwe_1 = require("./hooks/useSiwe");
15
+ Object.defineProperty(exports, "useSiwe", { enumerable: true, get: function () { return useSiwe_1.useSiwe; } });
16
+ var useAccountWallet_1 = require("./hooks/useAccountWallet");
17
+ Object.defineProperty(exports, "useAccountWallet", { enumerable: true, get: function () { return useAccountWallet_1.useAccountWallet; } });
@@ -6,6 +6,7 @@ exports.getExplorerUrl = getExplorerUrl;
6
6
  exports.getAddressExplorerUrl = getAddressExplorerUrl;
7
7
  exports.getTokenExplorerUrl = getTokenExplorerUrl;
8
8
  const supported_1 = require("../../shared/constants/chains/supported");
9
+ const chains_1 = require("viem/chains");
9
10
  const baseChainBaseUrl = "https://basescan.org";
10
11
  function getChainById(id) {
11
12
  return Object.values(supported_1.supportedChains).find(chain => chain.id === id);
@@ -15,6 +16,9 @@ function chainIdToName(id) {
15
16
  return name === "Base Mainnet" ? "Base" : name === "The Open Network" ? "Open Network" : name;
16
17
  }
17
18
  function getExplorerUrl(chain, txHash) {
19
+ if (chain.id === chains_1.b3.id) {
20
+ return "https://explorer.b3.fun/b3/tx/" + txHash;
21
+ }
18
22
  let baseUrl = chain.blockExplorers?.default.url;
19
23
  if (chain.id === 8453) {
20
24
  baseUrl = baseChainBaseUrl;
@@ -244,6 +244,9 @@ export function getPaymentUrl(address, amount, currency) {
244
244
  return `ethereum:${address}`;
245
245
  }
246
246
  export function getExplorerTxUrl(chainId, txHash) {
247
+ if (chainId === b3.id) {
248
+ return "https://explorer.b3.fun/b3/tx/" + txHash;
249
+ }
247
250
  if (EVM_CHAINS[chainId]) {
248
251
  return EVM_CHAINS[chainId].viem.blockExplorers?.default.url + "/tx/" + txHash;
249
252
  }
@@ -1,3 +1,5 @@
1
- export * from "./components";
2
- export * from "./hooks";
3
- export * from "./stores";
1
+ export { B3Provider } from "./components/B3Provider.native";
2
+ export { useB3 } from "./components/B3Provider.native";
3
+ export { useAuthentication } from "./hooks/useAuthentication";
4
+ export { useSiwe } from "./hooks/useSiwe";
5
+ export { useAccountWallet } from "./hooks/useAccountWallet";
@@ -1,3 +1,9 @@
1
- export * from "./components";
2
- export * from "./hooks";
3
- export * from "./stores";
1
+ // export * from "./components";
2
+ // export * from "./hooks";
3
+ // export * from "./stores";
4
+ // We only export the components and hooks that are needed for the native app
5
+ export { B3Provider } from "./components/B3Provider.native";
6
+ export { useB3 } from "./components/B3Provider.native";
7
+ export { useAuthentication } from "./hooks/useAuthentication";
8
+ export { useSiwe } from "./hooks/useSiwe";
9
+ export { useAccountWallet } from "./hooks/useAccountWallet";
@@ -1,4 +1,5 @@
1
1
  import { supportedChains } from "../../shared/constants/chains/supported";
2
+ import { b3 } from "viem/chains";
2
3
  const baseChainBaseUrl = "https://basescan.org";
3
4
  export function getChainById(id) {
4
5
  return Object.values(supportedChains).find(chain => chain.id === id);
@@ -8,6 +9,9 @@ export function chainIdToName(id) {
8
9
  return name === "Base Mainnet" ? "Base" : name === "The Open Network" ? "Open Network" : name;
9
10
  }
10
11
  export function getExplorerUrl(chain, txHash) {
12
+ if (chain.id === b3.id) {
13
+ return "https://explorer.b3.fun/b3/tx/" + txHash;
14
+ }
11
15
  let baseUrl = chain.blockExplorers?.default.url;
12
16
  if (chain.id === 8453) {
13
17
  baseUrl = baseChainBaseUrl;
@@ -1,3 +1,5 @@
1
- export * from "./components";
2
- export * from "./hooks";
3
- export * from "./stores";
1
+ export { B3Provider } from "./components/B3Provider.native";
2
+ export { useB3 } from "./components/B3Provider.native";
3
+ export { useAuthentication } from "./hooks/useAuthentication";
4
+ export { useSiwe } from "./hooks/useSiwe";
5
+ export { useAccountWallet } from "./hooks/useAccountWallet";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.1-alpha.6",
3
+ "version": "0.0.1-alpha.8",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -222,7 +222,6 @@
222
222
  "@feathersjs/feathers": "5.0.33",
223
223
  "@feathersjs/socketio-client": "5.0.33",
224
224
  "@feathersjs/typebox": "5.0.33",
225
- "@privy-io/react-auth": "2.8.0",
226
225
  "@types/big.js": "^6.2.2",
227
226
  "@types/invariant": "2.2.37",
228
227
  "@types/js-cookie": "3.0.6",
@@ -255,7 +254,7 @@
255
254
  }
256
255
  },
257
256
  "peerDependencies": {
258
- "@privy-io/react-auth": "*",
257
+ "@privy-io/react-auth": "^2.8.0",
259
258
  "@react-three/postprocessing": "2.16.6",
260
259
  "@readyplayerme/visage": "6.10.0",
261
260
  "@tanstack/react-query": "5.55.0",
@@ -311,6 +311,9 @@ export function getPaymentUrl(address: string, amount: bigint, currency: string)
311
311
  }
312
312
 
313
313
  export function getExplorerTxUrl(chainId: number, txHash: string) {
314
+ if (chainId === b3.id) {
315
+ return "https://explorer.b3.fun/b3/tx/" + txHash;
316
+ }
314
317
  if (EVM_CHAINS[chainId]) {
315
318
  return EVM_CHAINS[chainId].viem.blockExplorers?.default.url + "/tx/" + txHash;
316
319
  }
@@ -1,3 +1,12 @@
1
- export * from "./components";
2
- export * from "./hooks";
3
- export * from "./stores";
1
+ // export * from "./components";
2
+ // export * from "./hooks";
3
+ // export * from "./stores";
4
+
5
+ // We only export the components and hooks that are needed for the native app
6
+
7
+ export { B3Provider } from "./components/B3Provider.native";
8
+
9
+ export { useB3 } from "./components/B3Provider.native";
10
+ export { useAuthentication } from "./hooks/useAuthentication";
11
+ export { useSiwe } from "./hooks/useSiwe";
12
+ export { useAccountWallet } from "./hooks/useAccountWallet";
@@ -1,5 +1,5 @@
1
1
  import { supportedChains } from "@b3dotfun/sdk/shared/constants/chains/supported";
2
- import { Chain } from "viem/chains";
2
+ import { b3, Chain } from "viem/chains";
3
3
 
4
4
  const baseChainBaseUrl = "https://basescan.org";
5
5
 
@@ -13,6 +13,9 @@ export function chainIdToName(id: number) {
13
13
  }
14
14
 
15
15
  export function getExplorerUrl(chain: Chain, txHash: string): string {
16
+ if (chain.id === b3.id) {
17
+ return "https://explorer.b3.fun/b3/tx/" + txHash;
18
+ }
16
19
  let baseUrl = chain.blockExplorers?.default.url;
17
20
  if (chain.id === 8453) {
18
21
  baseUrl = baseChainBaseUrl;