@1sat/react 0.0.3 → 0.0.5
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/index.js +14 -12
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
// src/index.ts
|
|
2
4
|
export * from "@1sat/connect";
|
|
3
5
|
|
|
@@ -13,7 +15,7 @@ import {
|
|
|
13
15
|
useMemo,
|
|
14
16
|
useState
|
|
15
17
|
} from "react";
|
|
16
|
-
import {
|
|
18
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
19
|
"use client";
|
|
18
20
|
var OneSatContext = createContext(null);
|
|
19
21
|
function OneSatProvider({
|
|
@@ -106,10 +108,10 @@ function OneSatProvider({
|
|
|
106
108
|
disconnect,
|
|
107
109
|
error
|
|
108
110
|
]);
|
|
109
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ jsx(OneSatContext.Provider, {
|
|
110
112
|
value,
|
|
111
113
|
children
|
|
112
|
-
}
|
|
114
|
+
});
|
|
113
115
|
}
|
|
114
116
|
function useOneSatContext() {
|
|
115
117
|
const context = useContext(OneSatContext);
|
|
@@ -325,7 +327,7 @@ function useCancelListing() {
|
|
|
325
327
|
return { cancelListing, isLoading, error };
|
|
326
328
|
}
|
|
327
329
|
// src/ConnectButton.tsx
|
|
328
|
-
import {
|
|
330
|
+
import { jsx as jsx2, Fragment } from "react/jsx-runtime";
|
|
329
331
|
"use client";
|
|
330
332
|
function truncateAddress(address) {
|
|
331
333
|
if (address.length <= 12)
|
|
@@ -368,7 +370,7 @@ function ConnectButton({
|
|
|
368
370
|
}
|
|
369
371
|
};
|
|
370
372
|
if (children) {
|
|
371
|
-
return /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ jsx2(Fragment, {
|
|
372
374
|
children: children({
|
|
373
375
|
isConnected,
|
|
374
376
|
isConnecting,
|
|
@@ -376,34 +378,34 @@ function ConnectButton({
|
|
|
376
378
|
connect,
|
|
377
379
|
disconnect
|
|
378
380
|
})
|
|
379
|
-
}
|
|
381
|
+
});
|
|
380
382
|
}
|
|
381
383
|
if (isConnecting) {
|
|
382
|
-
return /* @__PURE__ */
|
|
384
|
+
return /* @__PURE__ */ jsx2("button", {
|
|
383
385
|
className,
|
|
384
386
|
style,
|
|
385
387
|
disabled: true,
|
|
386
388
|
type: "button",
|
|
387
389
|
children: connectingLabel
|
|
388
|
-
}
|
|
390
|
+
});
|
|
389
391
|
}
|
|
390
392
|
if (isConnected) {
|
|
391
393
|
const label = typeof connectedLabel === "function" ? connectedLabel(paymentAddress ?? "") : connectedLabel ?? truncateAddress(paymentAddress ?? "");
|
|
392
|
-
return /* @__PURE__ */
|
|
394
|
+
return /* @__PURE__ */ jsx2("button", {
|
|
393
395
|
className,
|
|
394
396
|
style,
|
|
395
397
|
onClick: disconnectOnClick ? disconnect : undefined,
|
|
396
398
|
type: "button",
|
|
397
399
|
children: label
|
|
398
|
-
}
|
|
400
|
+
});
|
|
399
401
|
}
|
|
400
|
-
return /* @__PURE__ */
|
|
402
|
+
return /* @__PURE__ */ jsx2("button", {
|
|
401
403
|
className,
|
|
402
404
|
style,
|
|
403
405
|
onClick: connect,
|
|
404
406
|
type: "button",
|
|
405
407
|
children: connectLabel
|
|
406
|
-
}
|
|
408
|
+
});
|
|
407
409
|
}
|
|
408
410
|
export {
|
|
409
411
|
useUtxos,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "React hooks and components for 1Sat wallet integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": ["dist"],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "bun build
|
|
16
|
+
"build": "bun run build.ts && tsc --emitDeclarationOnly",
|
|
17
17
|
"dev": "tsc --watch"
|
|
18
18
|
},
|
|
19
19
|
"keywords": ["1sat", "bsv", "ordinals", "wallet", "sdk", "react", "hooks"],
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@1sat/connect": "^0.0.
|
|
22
|
+
"@1sat/connect": "^0.0.8"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^18.0.0 || ^19.0.0"
|