@txnlab/use-wallet-solid 4.0.0 → 4.1.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.
- package/dist/dev.cjs +25 -20
- package/dist/dev.js +25 -20
- package/dist/dev.jsx +13 -4
- package/dist/index.cjs +25 -20
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +25 -20
- package/dist/index.jsx +13 -4
- package/package.json +9 -9
package/dist/dev.cjs
CHANGED
|
@@ -8,11 +8,11 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
8
8
|
|
|
9
9
|
var algosdk__default = /*#__PURE__*/_interopDefault(algosdk);
|
|
10
10
|
|
|
11
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
11
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
|
|
12
12
|
var sharedConfig = {
|
|
13
|
-
context:
|
|
14
|
-
registry:
|
|
15
|
-
effects:
|
|
13
|
+
context: void 0,
|
|
14
|
+
registry: void 0,
|
|
15
|
+
effects: void 0,
|
|
16
16
|
done: false,
|
|
17
17
|
getContextId() {
|
|
18
18
|
return getContextId(this.context.count);
|
|
@@ -35,6 +35,7 @@ function nextHydrateContext() {
|
|
|
35
35
|
count: 0
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
var IS_DEV = false;
|
|
38
39
|
var equalFn = (a, b) => a === b;
|
|
39
40
|
var signalOptions = {
|
|
40
41
|
equals: equalFn
|
|
@@ -44,11 +45,7 @@ var runEffects = runQueue;
|
|
|
44
45
|
var STALE = 1;
|
|
45
46
|
var PENDING = 2;
|
|
46
47
|
var UNOWNED = {
|
|
47
|
-
|
|
48
|
-
cleanups: null,
|
|
49
|
-
context: null,
|
|
50
|
-
owner: null
|
|
51
|
-
};
|
|
48
|
+
};
|
|
52
49
|
var Owner = null;
|
|
53
50
|
var Transition = null;
|
|
54
51
|
var Scheduler = null;
|
|
@@ -63,7 +60,7 @@ function createSignal(value, options) {
|
|
|
63
60
|
value,
|
|
64
61
|
observers: null,
|
|
65
62
|
observerSlots: null,
|
|
66
|
-
comparator: options.equals ||
|
|
63
|
+
comparator: options.equals || void 0
|
|
67
64
|
};
|
|
68
65
|
const setter = (value2) => {
|
|
69
66
|
if (typeof value2 === "function") {
|
|
@@ -91,7 +88,7 @@ function createMemo(fn, value, options) {
|
|
|
91
88
|
const c = createComputation(fn, value, true, 0);
|
|
92
89
|
c.observers = null;
|
|
93
90
|
c.observerSlots = null;
|
|
94
|
-
c.comparator = options.equals ||
|
|
91
|
+
c.comparator = options.equals || void 0;
|
|
95
92
|
if (Scheduler && Transition && Transition.running) {
|
|
96
93
|
c.tState = STALE;
|
|
97
94
|
Updates.push(c);
|
|
@@ -143,7 +140,7 @@ function startTransition(fn) {
|
|
|
143
140
|
}
|
|
144
141
|
runUpdates(fn);
|
|
145
142
|
Listener = Owner = null;
|
|
146
|
-
return t ? t.done :
|
|
143
|
+
return t ? t.done : void 0;
|
|
147
144
|
});
|
|
148
145
|
}
|
|
149
146
|
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
@@ -157,7 +154,7 @@ function createContext(defaultValue, options) {
|
|
|
157
154
|
}
|
|
158
155
|
function useContext(context) {
|
|
159
156
|
let value;
|
|
160
|
-
return Owner && Owner.context && (value = Owner.context[context.id]) !==
|
|
157
|
+
return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
|
|
161
158
|
}
|
|
162
159
|
function children(fn) {
|
|
163
160
|
const children2 = createMemo(fn);
|
|
@@ -227,7 +224,7 @@ function writeSignal(node, value, isComp) {
|
|
|
227
224
|
}
|
|
228
225
|
if (Updates.length > 1e6) {
|
|
229
226
|
Updates = [];
|
|
230
|
-
if (
|
|
227
|
+
if (IS_DEV) ;
|
|
231
228
|
throw new Error();
|
|
232
229
|
}
|
|
233
230
|
});
|
|
@@ -266,7 +263,7 @@ function runComputation(node, value, time) {
|
|
|
266
263
|
if (Transition && Transition.running) {
|
|
267
264
|
node.tState = STALE;
|
|
268
265
|
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
269
|
-
node.tOwned =
|
|
266
|
+
node.tOwned = void 0;
|
|
270
267
|
} else {
|
|
271
268
|
node.state = STALE;
|
|
272
269
|
node.owned && node.owned.forEach(cleanNode);
|
|
@@ -318,7 +315,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
318
315
|
}
|
|
319
316
|
}
|
|
320
317
|
if (ExternalSourceConfig && c.fn) {
|
|
321
|
-
const [track, trigger] = createSignal(
|
|
318
|
+
const [track, trigger] = createSignal(void 0, {
|
|
322
319
|
equals: false
|
|
323
320
|
});
|
|
324
321
|
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
@@ -583,7 +580,7 @@ function createProvider(id, options) {
|
|
|
583
580
|
};
|
|
584
581
|
return children(() => props.children);
|
|
585
582
|
}),
|
|
586
|
-
|
|
583
|
+
void 0
|
|
587
584
|
);
|
|
588
585
|
return res;
|
|
589
586
|
};
|
|
@@ -602,7 +599,7 @@ function createComponent(Comp, props) {
|
|
|
602
599
|
return untrack(() => Comp(props || {}));
|
|
603
600
|
}
|
|
604
601
|
|
|
605
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
602
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
|
|
606
603
|
var booleans = [
|
|
607
604
|
"allowfullscreen",
|
|
608
605
|
"async",
|
|
@@ -776,6 +773,13 @@ exports.useWallet = () => {
|
|
|
776
773
|
}
|
|
777
774
|
return wallet.transactionSigner(txnGroup, indexesToSign);
|
|
778
775
|
};
|
|
776
|
+
const signData = (data, metadata) => {
|
|
777
|
+
const wallet = activeWallet();
|
|
778
|
+
if (!wallet) {
|
|
779
|
+
throw new Error("No active wallet");
|
|
780
|
+
}
|
|
781
|
+
return wallet.signData(data, metadata);
|
|
782
|
+
};
|
|
779
783
|
return {
|
|
780
784
|
wallets: manager().wallets,
|
|
781
785
|
isReady,
|
|
@@ -787,11 +791,12 @@ exports.useWallet = () => {
|
|
|
787
791
|
activeAccount,
|
|
788
792
|
activeAddress,
|
|
789
793
|
activeWalletId,
|
|
790
|
-
walletStore,
|
|
791
794
|
isWalletActive,
|
|
792
795
|
isWalletConnected,
|
|
796
|
+
signData,
|
|
793
797
|
signTransactions,
|
|
794
|
-
transactionSigner
|
|
798
|
+
transactionSigner,
|
|
799
|
+
walletStore
|
|
795
800
|
};
|
|
796
801
|
};
|
|
797
802
|
|
package/dist/dev.js
CHANGED
|
@@ -2,11 +2,11 @@ import { useStore } from '@tanstack/solid-store';
|
|
|
2
2
|
import algosdk from 'algosdk';
|
|
3
3
|
export * from '@txnlab/use-wallet';
|
|
4
4
|
|
|
5
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
5
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
|
|
6
6
|
var sharedConfig = {
|
|
7
|
-
context:
|
|
8
|
-
registry:
|
|
9
|
-
effects:
|
|
7
|
+
context: void 0,
|
|
8
|
+
registry: void 0,
|
|
9
|
+
effects: void 0,
|
|
10
10
|
done: false,
|
|
11
11
|
getContextId() {
|
|
12
12
|
return getContextId(this.context.count);
|
|
@@ -29,6 +29,7 @@ function nextHydrateContext() {
|
|
|
29
29
|
count: 0
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
var IS_DEV = false;
|
|
32
33
|
var equalFn = (a, b) => a === b;
|
|
33
34
|
var signalOptions = {
|
|
34
35
|
equals: equalFn
|
|
@@ -38,11 +39,7 @@ var runEffects = runQueue;
|
|
|
38
39
|
var STALE = 1;
|
|
39
40
|
var PENDING = 2;
|
|
40
41
|
var UNOWNED = {
|
|
41
|
-
|
|
42
|
-
cleanups: null,
|
|
43
|
-
context: null,
|
|
44
|
-
owner: null
|
|
45
|
-
};
|
|
42
|
+
};
|
|
46
43
|
var Owner = null;
|
|
47
44
|
var Transition = null;
|
|
48
45
|
var Scheduler = null;
|
|
@@ -57,7 +54,7 @@ function createSignal(value, options) {
|
|
|
57
54
|
value,
|
|
58
55
|
observers: null,
|
|
59
56
|
observerSlots: null,
|
|
60
|
-
comparator: options.equals ||
|
|
57
|
+
comparator: options.equals || void 0
|
|
61
58
|
};
|
|
62
59
|
const setter = (value2) => {
|
|
63
60
|
if (typeof value2 === "function") {
|
|
@@ -85,7 +82,7 @@ function createMemo(fn, value, options) {
|
|
|
85
82
|
const c = createComputation(fn, value, true, 0);
|
|
86
83
|
c.observers = null;
|
|
87
84
|
c.observerSlots = null;
|
|
88
|
-
c.comparator = options.equals ||
|
|
85
|
+
c.comparator = options.equals || void 0;
|
|
89
86
|
if (Scheduler && Transition && Transition.running) {
|
|
90
87
|
c.tState = STALE;
|
|
91
88
|
Updates.push(c);
|
|
@@ -137,7 +134,7 @@ function startTransition(fn) {
|
|
|
137
134
|
}
|
|
138
135
|
runUpdates(fn);
|
|
139
136
|
Listener = Owner = null;
|
|
140
|
-
return t ? t.done :
|
|
137
|
+
return t ? t.done : void 0;
|
|
141
138
|
});
|
|
142
139
|
}
|
|
143
140
|
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
@@ -151,7 +148,7 @@ function createContext(defaultValue, options) {
|
|
|
151
148
|
}
|
|
152
149
|
function useContext(context) {
|
|
153
150
|
let value;
|
|
154
|
-
return Owner && Owner.context && (value = Owner.context[context.id]) !==
|
|
151
|
+
return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
|
|
155
152
|
}
|
|
156
153
|
function children(fn) {
|
|
157
154
|
const children2 = createMemo(fn);
|
|
@@ -221,7 +218,7 @@ function writeSignal(node, value, isComp) {
|
|
|
221
218
|
}
|
|
222
219
|
if (Updates.length > 1e6) {
|
|
223
220
|
Updates = [];
|
|
224
|
-
if (
|
|
221
|
+
if (IS_DEV) ;
|
|
225
222
|
throw new Error();
|
|
226
223
|
}
|
|
227
224
|
});
|
|
@@ -260,7 +257,7 @@ function runComputation(node, value, time) {
|
|
|
260
257
|
if (Transition && Transition.running) {
|
|
261
258
|
node.tState = STALE;
|
|
262
259
|
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
263
|
-
node.tOwned =
|
|
260
|
+
node.tOwned = void 0;
|
|
264
261
|
} else {
|
|
265
262
|
node.state = STALE;
|
|
266
263
|
node.owned && node.owned.forEach(cleanNode);
|
|
@@ -312,7 +309,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
312
309
|
}
|
|
313
310
|
}
|
|
314
311
|
if (ExternalSourceConfig && c.fn) {
|
|
315
|
-
const [track, trigger] = createSignal(
|
|
312
|
+
const [track, trigger] = createSignal(void 0, {
|
|
316
313
|
equals: false
|
|
317
314
|
});
|
|
318
315
|
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
@@ -577,7 +574,7 @@ function createProvider(id, options) {
|
|
|
577
574
|
};
|
|
578
575
|
return children(() => props.children);
|
|
579
576
|
}),
|
|
580
|
-
|
|
577
|
+
void 0
|
|
581
578
|
);
|
|
582
579
|
return res;
|
|
583
580
|
};
|
|
@@ -596,7 +593,7 @@ function createComponent(Comp, props) {
|
|
|
596
593
|
return untrack(() => Comp(props || {}));
|
|
597
594
|
}
|
|
598
595
|
|
|
599
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
596
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
|
|
600
597
|
var booleans = [
|
|
601
598
|
"allowfullscreen",
|
|
602
599
|
"async",
|
|
@@ -770,6 +767,13 @@ var useWallet = () => {
|
|
|
770
767
|
}
|
|
771
768
|
return wallet.transactionSigner(txnGroup, indexesToSign);
|
|
772
769
|
};
|
|
770
|
+
const signData = (data, metadata) => {
|
|
771
|
+
const wallet = activeWallet();
|
|
772
|
+
if (!wallet) {
|
|
773
|
+
throw new Error("No active wallet");
|
|
774
|
+
}
|
|
775
|
+
return wallet.signData(data, metadata);
|
|
776
|
+
};
|
|
773
777
|
return {
|
|
774
778
|
wallets: manager().wallets,
|
|
775
779
|
isReady,
|
|
@@ -781,11 +785,12 @@ var useWallet = () => {
|
|
|
781
785
|
activeAccount,
|
|
782
786
|
activeAddress,
|
|
783
787
|
activeWalletId,
|
|
784
|
-
walletStore,
|
|
785
788
|
isWalletActive,
|
|
786
789
|
isWalletConnected,
|
|
790
|
+
signData,
|
|
787
791
|
signTransactions,
|
|
788
|
-
transactionSigner
|
|
792
|
+
transactionSigner,
|
|
793
|
+
walletStore
|
|
789
794
|
};
|
|
790
795
|
};
|
|
791
796
|
|
package/dist/dev.jsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useStore } from "@tanstack/solid-store";
|
|
3
3
|
import algosdk from "algosdk";
|
|
4
4
|
|
|
5
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
5
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
|
|
6
6
|
var sharedConfig = {
|
|
7
7
|
context: void 0,
|
|
8
8
|
registry: void 0,
|
|
@@ -22,6 +22,7 @@ function getContextId(count) {
|
|
|
22
22
|
function setHydrateContext(context) {
|
|
23
23
|
sharedConfig.context = context;
|
|
24
24
|
}
|
|
25
|
+
var IS_DEV = false;
|
|
25
26
|
var equalFn = (a, b) => a === b;
|
|
26
27
|
var $PROXY = Symbol("solid-proxy");
|
|
27
28
|
var $TRACK = Symbol("solid-track");
|
|
@@ -217,7 +218,7 @@ function writeSignal(node, value, isComp) {
|
|
|
217
218
|
}
|
|
218
219
|
if (Updates.length > 1e6) {
|
|
219
220
|
Updates = [];
|
|
220
|
-
if (
|
|
221
|
+
if (IS_DEV) ;
|
|
221
222
|
throw new Error();
|
|
222
223
|
}
|
|
223
224
|
}, false);
|
|
@@ -692,6 +693,13 @@ var useWallet = () => {
|
|
|
692
693
|
}
|
|
693
694
|
return wallet.transactionSigner(txnGroup, indexesToSign);
|
|
694
695
|
};
|
|
696
|
+
const signData = (data, metadata) => {
|
|
697
|
+
const wallet = activeWallet();
|
|
698
|
+
if (!wallet) {
|
|
699
|
+
throw new Error("No active wallet");
|
|
700
|
+
}
|
|
701
|
+
return wallet.signData(data, metadata);
|
|
702
|
+
};
|
|
695
703
|
return {
|
|
696
704
|
wallets: manager().wallets,
|
|
697
705
|
isReady,
|
|
@@ -703,11 +711,12 @@ var useWallet = () => {
|
|
|
703
711
|
activeAccount,
|
|
704
712
|
activeAddress,
|
|
705
713
|
activeWalletId,
|
|
706
|
-
walletStore,
|
|
707
714
|
isWalletActive,
|
|
708
715
|
isWalletConnected,
|
|
716
|
+
signData,
|
|
709
717
|
signTransactions,
|
|
710
|
-
transactionSigner
|
|
718
|
+
transactionSigner,
|
|
719
|
+
walletStore
|
|
711
720
|
};
|
|
712
721
|
};
|
|
713
722
|
export {
|
package/dist/index.cjs
CHANGED
|
@@ -8,11 +8,11 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
8
8
|
|
|
9
9
|
var algosdk__default = /*#__PURE__*/_interopDefault(algosdk);
|
|
10
10
|
|
|
11
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
11
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
|
|
12
12
|
var sharedConfig = {
|
|
13
|
-
context:
|
|
14
|
-
registry:
|
|
15
|
-
effects:
|
|
13
|
+
context: void 0,
|
|
14
|
+
registry: void 0,
|
|
15
|
+
effects: void 0,
|
|
16
16
|
done: false,
|
|
17
17
|
getContextId() {
|
|
18
18
|
return getContextId(this.context.count);
|
|
@@ -35,6 +35,7 @@ function nextHydrateContext() {
|
|
|
35
35
|
count: 0
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
+
var IS_DEV = false;
|
|
38
39
|
var equalFn = (a, b) => a === b;
|
|
39
40
|
var signalOptions = {
|
|
40
41
|
equals: equalFn
|
|
@@ -44,11 +45,7 @@ var runEffects = runQueue;
|
|
|
44
45
|
var STALE = 1;
|
|
45
46
|
var PENDING = 2;
|
|
46
47
|
var UNOWNED = {
|
|
47
|
-
|
|
48
|
-
cleanups: null,
|
|
49
|
-
context: null,
|
|
50
|
-
owner: null
|
|
51
|
-
};
|
|
48
|
+
};
|
|
52
49
|
var Owner = null;
|
|
53
50
|
var Transition = null;
|
|
54
51
|
var Scheduler = null;
|
|
@@ -63,7 +60,7 @@ function createSignal(value, options) {
|
|
|
63
60
|
value,
|
|
64
61
|
observers: null,
|
|
65
62
|
observerSlots: null,
|
|
66
|
-
comparator: options.equals ||
|
|
63
|
+
comparator: options.equals || void 0
|
|
67
64
|
};
|
|
68
65
|
const setter = (value2) => {
|
|
69
66
|
if (typeof value2 === "function") {
|
|
@@ -91,7 +88,7 @@ function createMemo(fn, value, options) {
|
|
|
91
88
|
const c = createComputation(fn, value, true, 0);
|
|
92
89
|
c.observers = null;
|
|
93
90
|
c.observerSlots = null;
|
|
94
|
-
c.comparator = options.equals ||
|
|
91
|
+
c.comparator = options.equals || void 0;
|
|
95
92
|
if (Scheduler && Transition && Transition.running) {
|
|
96
93
|
c.tState = STALE;
|
|
97
94
|
Updates.push(c);
|
|
@@ -143,7 +140,7 @@ function startTransition(fn) {
|
|
|
143
140
|
}
|
|
144
141
|
runUpdates(fn);
|
|
145
142
|
Listener = Owner = null;
|
|
146
|
-
return t ? t.done :
|
|
143
|
+
return t ? t.done : void 0;
|
|
147
144
|
});
|
|
148
145
|
}
|
|
149
146
|
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
@@ -157,7 +154,7 @@ function createContext(defaultValue, options) {
|
|
|
157
154
|
}
|
|
158
155
|
function useContext(context) {
|
|
159
156
|
let value;
|
|
160
|
-
return Owner && Owner.context && (value = Owner.context[context.id]) !==
|
|
157
|
+
return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
|
|
161
158
|
}
|
|
162
159
|
function children(fn) {
|
|
163
160
|
const children2 = createMemo(fn);
|
|
@@ -227,7 +224,7 @@ function writeSignal(node, value, isComp) {
|
|
|
227
224
|
}
|
|
228
225
|
if (Updates.length > 1e6) {
|
|
229
226
|
Updates = [];
|
|
230
|
-
if (
|
|
227
|
+
if (IS_DEV) ;
|
|
231
228
|
throw new Error();
|
|
232
229
|
}
|
|
233
230
|
});
|
|
@@ -266,7 +263,7 @@ function runComputation(node, value, time) {
|
|
|
266
263
|
if (Transition && Transition.running) {
|
|
267
264
|
node.tState = STALE;
|
|
268
265
|
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
269
|
-
node.tOwned =
|
|
266
|
+
node.tOwned = void 0;
|
|
270
267
|
} else {
|
|
271
268
|
node.state = STALE;
|
|
272
269
|
node.owned && node.owned.forEach(cleanNode);
|
|
@@ -318,7 +315,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
318
315
|
}
|
|
319
316
|
}
|
|
320
317
|
if (ExternalSourceConfig && c.fn) {
|
|
321
|
-
const [track, trigger] = createSignal(
|
|
318
|
+
const [track, trigger] = createSignal(void 0, {
|
|
322
319
|
equals: false
|
|
323
320
|
});
|
|
324
321
|
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
@@ -583,7 +580,7 @@ function createProvider(id, options) {
|
|
|
583
580
|
};
|
|
584
581
|
return children(() => props.children);
|
|
585
582
|
}),
|
|
586
|
-
|
|
583
|
+
void 0
|
|
587
584
|
);
|
|
588
585
|
return res;
|
|
589
586
|
};
|
|
@@ -602,7 +599,7 @@ function createComponent(Comp, props) {
|
|
|
602
599
|
return untrack(() => Comp(props || {}));
|
|
603
600
|
}
|
|
604
601
|
|
|
605
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
602
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
|
|
606
603
|
var booleans = [
|
|
607
604
|
"allowfullscreen",
|
|
608
605
|
"async",
|
|
@@ -771,6 +768,13 @@ exports.useWallet = () => {
|
|
|
771
768
|
}
|
|
772
769
|
return wallet.transactionSigner(txnGroup, indexesToSign);
|
|
773
770
|
};
|
|
771
|
+
const signData = (data, metadata) => {
|
|
772
|
+
const wallet = activeWallet();
|
|
773
|
+
if (!wallet) {
|
|
774
|
+
throw new Error("No active wallet");
|
|
775
|
+
}
|
|
776
|
+
return wallet.signData(data, metadata);
|
|
777
|
+
};
|
|
774
778
|
return {
|
|
775
779
|
wallets: manager().wallets,
|
|
776
780
|
isReady,
|
|
@@ -782,11 +786,12 @@ exports.useWallet = () => {
|
|
|
782
786
|
activeAccount,
|
|
783
787
|
activeAddress,
|
|
784
788
|
activeWalletId,
|
|
785
|
-
walletStore,
|
|
786
789
|
isWalletActive,
|
|
787
790
|
isWalletConnected,
|
|
791
|
+
signData,
|
|
788
792
|
signTransactions,
|
|
789
|
-
transactionSigner
|
|
793
|
+
transactionSigner,
|
|
794
|
+
walletStore
|
|
790
795
|
};
|
|
791
796
|
};
|
|
792
797
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _txnlab_use_wallet from '@txnlab/use-wallet';
|
|
2
|
-
import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId } from '@txnlab/use-wallet';
|
|
2
|
+
import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId, SignMetadata, SignDataResponse } from '@txnlab/use-wallet';
|
|
3
3
|
export * from '@txnlab/use-wallet';
|
|
4
4
|
import * as solid_js from 'solid-js';
|
|
5
5
|
import { JSX } from 'solid-js';
|
|
@@ -30,11 +30,12 @@ declare const useWallet: () => {
|
|
|
30
30
|
activeAccount: () => _txnlab_use_wallet.WalletAccount | null;
|
|
31
31
|
activeAddress: () => string | null;
|
|
32
32
|
activeWalletId: solid_js.Accessor<WalletId | null>;
|
|
33
|
-
walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
|
|
34
33
|
isWalletActive: (walletId: WalletId) => boolean;
|
|
35
34
|
isWalletConnected: (walletId: WalletId) => boolean;
|
|
35
|
+
signData: (data: string, metadata: SignMetadata) => Promise<SignDataResponse>;
|
|
36
36
|
signTransactions: <T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
|
|
37
37
|
transactionSigner: (txnGroup: algosdk.Transaction[], indexesToSign: number[]) => Promise<Uint8Array[]>;
|
|
38
|
+
walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export { WalletProvider, useNetwork, useWallet, useWalletManager };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _txnlab_use_wallet from '@txnlab/use-wallet';
|
|
2
|
-
import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId } from '@txnlab/use-wallet';
|
|
2
|
+
import { WalletManager, NetworkId, AlgodConfig, WalletState, WalletId, SignMetadata, SignDataResponse } from '@txnlab/use-wallet';
|
|
3
3
|
export * from '@txnlab/use-wallet';
|
|
4
4
|
import * as solid_js from 'solid-js';
|
|
5
5
|
import { JSX } from 'solid-js';
|
|
@@ -30,11 +30,12 @@ declare const useWallet: () => {
|
|
|
30
30
|
activeAccount: () => _txnlab_use_wallet.WalletAccount | null;
|
|
31
31
|
activeAddress: () => string | null;
|
|
32
32
|
activeWalletId: solid_js.Accessor<WalletId | null>;
|
|
33
|
-
walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
|
|
34
33
|
isWalletActive: (walletId: WalletId) => boolean;
|
|
35
34
|
isWalletConnected: (walletId: WalletId) => boolean;
|
|
35
|
+
signData: (data: string, metadata: SignMetadata) => Promise<SignDataResponse>;
|
|
36
36
|
signTransactions: <T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
|
|
37
37
|
transactionSigner: (txnGroup: algosdk.Transaction[], indexesToSign: number[]) => Promise<Uint8Array[]>;
|
|
38
|
+
walletStore: solid_js.Accessor<Partial<Record<WalletId, WalletState>>>;
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export { WalletProvider, useNetwork, useWallet, useWalletManager };
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { useStore } from '@tanstack/solid-store';
|
|
|
2
2
|
import algosdk from 'algosdk';
|
|
3
3
|
export * from '@txnlab/use-wallet';
|
|
4
4
|
|
|
5
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
5
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
|
|
6
6
|
var sharedConfig = {
|
|
7
|
-
context:
|
|
8
|
-
registry:
|
|
9
|
-
effects:
|
|
7
|
+
context: void 0,
|
|
8
|
+
registry: void 0,
|
|
9
|
+
effects: void 0,
|
|
10
10
|
done: false,
|
|
11
11
|
getContextId() {
|
|
12
12
|
return getContextId(this.context.count);
|
|
@@ -29,6 +29,7 @@ function nextHydrateContext() {
|
|
|
29
29
|
count: 0
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
var IS_DEV = false;
|
|
32
33
|
var equalFn = (a, b) => a === b;
|
|
33
34
|
var signalOptions = {
|
|
34
35
|
equals: equalFn
|
|
@@ -38,11 +39,7 @@ var runEffects = runQueue;
|
|
|
38
39
|
var STALE = 1;
|
|
39
40
|
var PENDING = 2;
|
|
40
41
|
var UNOWNED = {
|
|
41
|
-
|
|
42
|
-
cleanups: null,
|
|
43
|
-
context: null,
|
|
44
|
-
owner: null
|
|
45
|
-
};
|
|
42
|
+
};
|
|
46
43
|
var Owner = null;
|
|
47
44
|
var Transition = null;
|
|
48
45
|
var Scheduler = null;
|
|
@@ -57,7 +54,7 @@ function createSignal(value, options) {
|
|
|
57
54
|
value,
|
|
58
55
|
observers: null,
|
|
59
56
|
observerSlots: null,
|
|
60
|
-
comparator: options.equals ||
|
|
57
|
+
comparator: options.equals || void 0
|
|
61
58
|
};
|
|
62
59
|
const setter = (value2) => {
|
|
63
60
|
if (typeof value2 === "function") {
|
|
@@ -85,7 +82,7 @@ function createMemo(fn, value, options) {
|
|
|
85
82
|
const c = createComputation(fn, value, true, 0);
|
|
86
83
|
c.observers = null;
|
|
87
84
|
c.observerSlots = null;
|
|
88
|
-
c.comparator = options.equals ||
|
|
85
|
+
c.comparator = options.equals || void 0;
|
|
89
86
|
if (Scheduler && Transition && Transition.running) {
|
|
90
87
|
c.tState = STALE;
|
|
91
88
|
Updates.push(c);
|
|
@@ -137,7 +134,7 @@ function startTransition(fn) {
|
|
|
137
134
|
}
|
|
138
135
|
runUpdates(fn);
|
|
139
136
|
Listener = Owner = null;
|
|
140
|
-
return t ? t.done :
|
|
137
|
+
return t ? t.done : void 0;
|
|
141
138
|
});
|
|
142
139
|
}
|
|
143
140
|
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
@@ -151,7 +148,7 @@ function createContext(defaultValue, options) {
|
|
|
151
148
|
}
|
|
152
149
|
function useContext(context) {
|
|
153
150
|
let value;
|
|
154
|
-
return Owner && Owner.context && (value = Owner.context[context.id]) !==
|
|
151
|
+
return Owner && Owner.context && (value = Owner.context[context.id]) !== void 0 ? value : context.defaultValue;
|
|
155
152
|
}
|
|
156
153
|
function children(fn) {
|
|
157
154
|
const children2 = createMemo(fn);
|
|
@@ -221,7 +218,7 @@ function writeSignal(node, value, isComp) {
|
|
|
221
218
|
}
|
|
222
219
|
if (Updates.length > 1e6) {
|
|
223
220
|
Updates = [];
|
|
224
|
-
if (
|
|
221
|
+
if (IS_DEV) ;
|
|
225
222
|
throw new Error();
|
|
226
223
|
}
|
|
227
224
|
});
|
|
@@ -260,7 +257,7 @@ function runComputation(node, value, time) {
|
|
|
260
257
|
if (Transition && Transition.running) {
|
|
261
258
|
node.tState = STALE;
|
|
262
259
|
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
263
|
-
node.tOwned =
|
|
260
|
+
node.tOwned = void 0;
|
|
264
261
|
} else {
|
|
265
262
|
node.state = STALE;
|
|
266
263
|
node.owned && node.owned.forEach(cleanNode);
|
|
@@ -312,7 +309,7 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
312
309
|
}
|
|
313
310
|
}
|
|
314
311
|
if (ExternalSourceConfig && c.fn) {
|
|
315
|
-
const [track, trigger] = createSignal(
|
|
312
|
+
const [track, trigger] = createSignal(void 0, {
|
|
316
313
|
equals: false
|
|
317
314
|
});
|
|
318
315
|
const ordinary = ExternalSourceConfig.factory(c.fn, trigger);
|
|
@@ -577,7 +574,7 @@ function createProvider(id, options) {
|
|
|
577
574
|
};
|
|
578
575
|
return children(() => props.children);
|
|
579
576
|
}),
|
|
580
|
-
|
|
577
|
+
void 0
|
|
581
578
|
);
|
|
582
579
|
return res;
|
|
583
580
|
};
|
|
@@ -596,7 +593,7 @@ function createComponent(Comp, props) {
|
|
|
596
593
|
return untrack(() => Comp(props || {}));
|
|
597
594
|
}
|
|
598
595
|
|
|
599
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
596
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js
|
|
600
597
|
var booleans = [
|
|
601
598
|
"allowfullscreen",
|
|
602
599
|
"async",
|
|
@@ -765,6 +762,13 @@ var useWallet = () => {
|
|
|
765
762
|
}
|
|
766
763
|
return wallet.transactionSigner(txnGroup, indexesToSign);
|
|
767
764
|
};
|
|
765
|
+
const signData = (data, metadata) => {
|
|
766
|
+
const wallet = activeWallet();
|
|
767
|
+
if (!wallet) {
|
|
768
|
+
throw new Error("No active wallet");
|
|
769
|
+
}
|
|
770
|
+
return wallet.signData(data, metadata);
|
|
771
|
+
};
|
|
768
772
|
return {
|
|
769
773
|
wallets: manager().wallets,
|
|
770
774
|
isReady,
|
|
@@ -776,11 +780,12 @@ var useWallet = () => {
|
|
|
776
780
|
activeAccount,
|
|
777
781
|
activeAddress,
|
|
778
782
|
activeWalletId,
|
|
779
|
-
walletStore,
|
|
780
783
|
isWalletActive,
|
|
781
784
|
isWalletConnected,
|
|
785
|
+
signData,
|
|
782
786
|
signTransactions,
|
|
783
|
-
transactionSigner
|
|
787
|
+
transactionSigner,
|
|
788
|
+
walletStore
|
|
784
789
|
};
|
|
785
790
|
};
|
|
786
791
|
|
package/dist/index.jsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useStore } from "@tanstack/solid-store";
|
|
3
3
|
import algosdk from "algosdk";
|
|
4
4
|
|
|
5
|
-
// ../../node_modules/.pnpm/solid-js@1.9.
|
|
5
|
+
// ../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js
|
|
6
6
|
var sharedConfig = {
|
|
7
7
|
context: void 0,
|
|
8
8
|
registry: void 0,
|
|
@@ -22,6 +22,7 @@ function getContextId(count) {
|
|
|
22
22
|
function setHydrateContext(context) {
|
|
23
23
|
sharedConfig.context = context;
|
|
24
24
|
}
|
|
25
|
+
var IS_DEV = false;
|
|
25
26
|
var equalFn = (a, b) => a === b;
|
|
26
27
|
var $PROXY = Symbol("solid-proxy");
|
|
27
28
|
var $TRACK = Symbol("solid-track");
|
|
@@ -217,7 +218,7 @@ function writeSignal(node, value, isComp) {
|
|
|
217
218
|
}
|
|
218
219
|
if (Updates.length > 1e6) {
|
|
219
220
|
Updates = [];
|
|
220
|
-
if (
|
|
221
|
+
if (IS_DEV) ;
|
|
221
222
|
throw new Error();
|
|
222
223
|
}
|
|
223
224
|
}, false);
|
|
@@ -687,6 +688,13 @@ var useWallet = () => {
|
|
|
687
688
|
}
|
|
688
689
|
return wallet.transactionSigner(txnGroup, indexesToSign);
|
|
689
690
|
};
|
|
691
|
+
const signData = (data, metadata) => {
|
|
692
|
+
const wallet = activeWallet();
|
|
693
|
+
if (!wallet) {
|
|
694
|
+
throw new Error("No active wallet");
|
|
695
|
+
}
|
|
696
|
+
return wallet.signData(data, metadata);
|
|
697
|
+
};
|
|
690
698
|
return {
|
|
691
699
|
wallets: manager().wallets,
|
|
692
700
|
isReady,
|
|
@@ -698,11 +706,12 @@ var useWallet = () => {
|
|
|
698
706
|
activeAccount,
|
|
699
707
|
activeAddress,
|
|
700
708
|
activeWalletId,
|
|
701
|
-
walletStore,
|
|
702
709
|
isWalletActive,
|
|
703
710
|
isWalletConnected,
|
|
711
|
+
signData,
|
|
704
712
|
signTransactions,
|
|
705
|
-
transactionSigner
|
|
713
|
+
transactionSigner,
|
|
714
|
+
walletStore
|
|
706
715
|
};
|
|
707
716
|
};
|
|
708
717
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@txnlab/use-wallet-solid",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Solid.js library for integrating Algorand wallets into decentralized applications",
|
|
5
5
|
"author": "Doug Richar <drichar@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -54,25 +54,25 @@
|
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@tanstack/solid-store": "0.7.0",
|
|
57
|
-
"@txnlab/use-wallet": "4.
|
|
57
|
+
"@txnlab/use-wallet": "4.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@solidjs/testing-library": "0.8.10",
|
|
61
|
-
"algosdk": "3.
|
|
62
|
-
"solid-js": "1.9.
|
|
63
|
-
"tsup": "8.
|
|
61
|
+
"algosdk": "3.2.0",
|
|
62
|
+
"solid-js": "1.9.5",
|
|
63
|
+
"tsup": "8.4.0",
|
|
64
64
|
"tsup-preset-solid": "2.2.0",
|
|
65
|
-
"typescript": "5.
|
|
65
|
+
"typescript": "5.8.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@blockshake/defly-connect": "^1.2.1",
|
|
69
69
|
"@magic-ext/algorand": "^23.20.0",
|
|
70
70
|
"@perawallet/connect": "^1.4.1",
|
|
71
71
|
"@walletconnect/modal": "^2.7.0",
|
|
72
|
-
"@walletconnect/sign-client": "^2.
|
|
72
|
+
"@walletconnect/sign-client": "^2.19.2",
|
|
73
73
|
"algosdk": "^3.0.0",
|
|
74
|
-
"lute-connect": "^1.
|
|
75
|
-
"magic-sdk": "^28.21.
|
|
74
|
+
"lute-connect": "^1.6.1",
|
|
75
|
+
"magic-sdk": "^28.21.1"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|
|
78
78
|
"@blockshake/defly-connect": {
|