@talismn/balances-react 0.0.0-pr640-20230322042757 → 0.0.0-pr640-20230323000926
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/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
# @talismn/balances-react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-pr640-
|
|
3
|
+
## 0.0.0-pr640-20230323000926
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- a6969098: refactor: tweaks to trigger less balance subscription resets
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- Updated dependencies [
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
- Updated dependencies [
|
|
17
|
-
- Updated dependencies [
|
|
18
|
-
- Updated dependencies [
|
|
19
|
-
- @talismn/chain-connector@0.0.0-pr640-
|
|
20
|
-
- @talismn/connection-meta@0.0.0-pr640-
|
|
21
|
-
- @talismn/balances@0.0.0-pr640-
|
|
22
|
-
- @talismn/token-rates@0.0.0-pr640-
|
|
23
|
-
- @talismn/chaindata-provider-extension@0.0.0-pr640-
|
|
24
|
-
- @talismn/chaindata-provider@0.0.0-pr640-
|
|
25
|
-
- @talismn/chain-connector-evm@0.0.0-pr640-
|
|
11
|
+
- 3068bd60: feat: stale balances and exponential rpc backoff
|
|
12
|
+
- 6643a4e4: fix: tokenRates in @talismn/balances-react
|
|
13
|
+
- 6643a4e4: fix: ported useDbCache related perf fixes to @talismn/balances-react
|
|
14
|
+
- Updated dependencies [3068bd60]
|
|
15
|
+
- Updated dependencies [6643a4e4]
|
|
16
|
+
- Updated dependencies [79f6ccf6]
|
|
17
|
+
- Updated dependencies [6643a4e4]
|
|
18
|
+
- Updated dependencies [c24dc1fb]
|
|
19
|
+
- @talismn/chain-connector@0.0.0-pr640-20230323000926
|
|
20
|
+
- @talismn/connection-meta@0.0.0-pr640-20230323000926
|
|
21
|
+
- @talismn/balances@0.0.0-pr640-20230323000926
|
|
22
|
+
- @talismn/token-rates@0.0.0-pr640-20230323000926
|
|
23
|
+
- @talismn/chaindata-provider-extension@0.0.0-pr640-20230323000926
|
|
24
|
+
- @talismn/chaindata-provider@0.0.0-pr640-20230323000926
|
|
25
|
+
- @talismn/chain-connector-evm@0.0.0-pr640-20230323000926
|
|
26
26
|
|
|
27
27
|
## 0.3.3
|
|
28
28
|
|
|
@@ -200,7 +200,7 @@ const [DbCacheProvider, useDbCache] = provideContext(useDbCacheProvider);
|
|
|
200
200
|
|
|
201
201
|
var packageJson = {
|
|
202
202
|
name: "@talismn/balances-react",
|
|
203
|
-
version: "0.0.0-pr640-
|
|
203
|
+
version: "0.0.0-pr640-20230323000926",
|
|
204
204
|
author: "Talisman",
|
|
205
205
|
homepage: "https://talisman.xyz",
|
|
206
206
|
license: "UNLICENSED",
|
|
@@ -315,20 +315,6 @@ const useSharedSubscription = (key, subscribe) => {
|
|
|
315
315
|
}, [key, subscribe]);
|
|
316
316
|
};
|
|
317
317
|
|
|
318
|
-
function useTokens(withTestnets) {
|
|
319
|
-
// keep db data up to date
|
|
320
|
-
useDbCacheSubscription("tokens");
|
|
321
|
-
const {
|
|
322
|
-
tokensWithTestnetsMap,
|
|
323
|
-
tokensWithoutTestnetsMap
|
|
324
|
-
} = useDbCache();
|
|
325
|
-
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
326
|
-
}
|
|
327
|
-
function useToken(tokenId, withTestnets) {
|
|
328
|
-
const tokens = useTokens(withTestnets);
|
|
329
|
-
return tokenId ? tokens[tokenId] : undefined;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
318
|
/**
|
|
333
319
|
* Creates a subscription function that can be used to subscribe to a multicast observable created from an upstream source.
|
|
334
320
|
*
|
|
@@ -406,7 +392,7 @@ function useDbCacheTokenRatesSubscription() {
|
|
|
406
392
|
const {
|
|
407
393
|
withTestnets
|
|
408
394
|
} = useWithTestnets();
|
|
409
|
-
const tokens = useTokens(withTestnets);
|
|
395
|
+
const tokens = useTokens$1(withTestnets);
|
|
410
396
|
const subscriptionKey = react.useMemo(
|
|
411
397
|
// not super sexy but we need key to change based on this stuff
|
|
412
398
|
() => {
|
|
@@ -433,7 +419,7 @@ function useDbCacheBalancesSubscription() {
|
|
|
433
419
|
const chaindataProvider = useChaindata();
|
|
434
420
|
const chainConnectors = useChainConnectors();
|
|
435
421
|
const [allAddresses] = useAllAddresses();
|
|
436
|
-
const tokens = useTokens(withTestnets);
|
|
422
|
+
const tokens = useTokens$1(withTestnets);
|
|
437
423
|
const subscriptionKey = react.useMemo(
|
|
438
424
|
// not super sexy but we need key to change based on this stuff
|
|
439
425
|
() => {
|
|
@@ -448,6 +434,15 @@ function useDbCacheBalancesSubscription() {
|
|
|
448
434
|
}, [allAddresses, balanceModules, tokens]);
|
|
449
435
|
useSharedSubscription(subscriptionKey, subscription);
|
|
450
436
|
}
|
|
437
|
+
|
|
438
|
+
// subscriptionless version of useTokens, prevents circular dependency
|
|
439
|
+
const useTokens$1 = withTestnets => {
|
|
440
|
+
const {
|
|
441
|
+
tokensWithTestnetsMap,
|
|
442
|
+
tokensWithoutTestnetsMap
|
|
443
|
+
} = useDbCache();
|
|
444
|
+
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
445
|
+
};
|
|
451
446
|
const subscribeChainDataHydrate = (provider, type) => {
|
|
452
447
|
const chaindata = provider;
|
|
453
448
|
const delay = 300_000; // 300_000ms = 300s = 5 minutes
|
|
@@ -612,6 +607,20 @@ function useTokenRate(tokenId) {
|
|
|
612
607
|
return tokenId ? tokenRates[tokenId] : undefined;
|
|
613
608
|
}
|
|
614
609
|
|
|
610
|
+
function useTokens(withTestnets) {
|
|
611
|
+
// keep db data up to date
|
|
612
|
+
useDbCacheSubscription("tokens");
|
|
613
|
+
const {
|
|
614
|
+
tokensWithTestnetsMap,
|
|
615
|
+
tokensWithoutTestnetsMap
|
|
616
|
+
} = useDbCache();
|
|
617
|
+
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
618
|
+
}
|
|
619
|
+
function useToken(tokenId, withTestnets) {
|
|
620
|
+
const tokens = useTokens(withTestnets);
|
|
621
|
+
return tokenId ? tokens[tokenId] : undefined;
|
|
622
|
+
}
|
|
623
|
+
|
|
615
624
|
const useBalancesHydrate = () => {
|
|
616
625
|
const {
|
|
617
626
|
withTestnets
|
|
@@ -200,7 +200,7 @@ const [DbCacheProvider, useDbCache] = provideContext(useDbCacheProvider);
|
|
|
200
200
|
|
|
201
201
|
var packageJson = {
|
|
202
202
|
name: "@talismn/balances-react",
|
|
203
|
-
version: "0.0.0-pr640-
|
|
203
|
+
version: "0.0.0-pr640-20230323000926",
|
|
204
204
|
author: "Talisman",
|
|
205
205
|
homepage: "https://talisman.xyz",
|
|
206
206
|
license: "UNLICENSED",
|
|
@@ -315,20 +315,6 @@ const useSharedSubscription = (key, subscribe) => {
|
|
|
315
315
|
}, [key, subscribe]);
|
|
316
316
|
};
|
|
317
317
|
|
|
318
|
-
function useTokens(withTestnets) {
|
|
319
|
-
// keep db data up to date
|
|
320
|
-
useDbCacheSubscription("tokens");
|
|
321
|
-
const {
|
|
322
|
-
tokensWithTestnetsMap,
|
|
323
|
-
tokensWithoutTestnetsMap
|
|
324
|
-
} = useDbCache();
|
|
325
|
-
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
326
|
-
}
|
|
327
|
-
function useToken(tokenId, withTestnets) {
|
|
328
|
-
const tokens = useTokens(withTestnets);
|
|
329
|
-
return tokenId ? tokens[tokenId] : undefined;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
318
|
/**
|
|
333
319
|
* Creates a subscription function that can be used to subscribe to a multicast observable created from an upstream source.
|
|
334
320
|
*
|
|
@@ -406,7 +392,7 @@ function useDbCacheTokenRatesSubscription() {
|
|
|
406
392
|
const {
|
|
407
393
|
withTestnets
|
|
408
394
|
} = useWithTestnets();
|
|
409
|
-
const tokens = useTokens(withTestnets);
|
|
395
|
+
const tokens = useTokens$1(withTestnets);
|
|
410
396
|
const subscriptionKey = react.useMemo(
|
|
411
397
|
// not super sexy but we need key to change based on this stuff
|
|
412
398
|
() => {
|
|
@@ -433,7 +419,7 @@ function useDbCacheBalancesSubscription() {
|
|
|
433
419
|
const chaindataProvider = useChaindata();
|
|
434
420
|
const chainConnectors = useChainConnectors();
|
|
435
421
|
const [allAddresses] = useAllAddresses();
|
|
436
|
-
const tokens = useTokens(withTestnets);
|
|
422
|
+
const tokens = useTokens$1(withTestnets);
|
|
437
423
|
const subscriptionKey = react.useMemo(
|
|
438
424
|
// not super sexy but we need key to change based on this stuff
|
|
439
425
|
() => {
|
|
@@ -448,6 +434,15 @@ function useDbCacheBalancesSubscription() {
|
|
|
448
434
|
}, [allAddresses, balanceModules, tokens]);
|
|
449
435
|
useSharedSubscription(subscriptionKey, subscription);
|
|
450
436
|
}
|
|
437
|
+
|
|
438
|
+
// subscriptionless version of useTokens, prevents circular dependency
|
|
439
|
+
const useTokens$1 = withTestnets => {
|
|
440
|
+
const {
|
|
441
|
+
tokensWithTestnetsMap,
|
|
442
|
+
tokensWithoutTestnetsMap
|
|
443
|
+
} = useDbCache();
|
|
444
|
+
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
445
|
+
};
|
|
451
446
|
const subscribeChainDataHydrate = (provider, type) => {
|
|
452
447
|
const chaindata = provider;
|
|
453
448
|
const delay = 300_000; // 300_000ms = 300s = 5 minutes
|
|
@@ -612,6 +607,20 @@ function useTokenRate(tokenId) {
|
|
|
612
607
|
return tokenId ? tokenRates[tokenId] : undefined;
|
|
613
608
|
}
|
|
614
609
|
|
|
610
|
+
function useTokens(withTestnets) {
|
|
611
|
+
// keep db data up to date
|
|
612
|
+
useDbCacheSubscription("tokens");
|
|
613
|
+
const {
|
|
614
|
+
tokensWithTestnetsMap,
|
|
615
|
+
tokensWithoutTestnetsMap
|
|
616
|
+
} = useDbCache();
|
|
617
|
+
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
618
|
+
}
|
|
619
|
+
function useToken(tokenId, withTestnets) {
|
|
620
|
+
const tokens = useTokens(withTestnets);
|
|
621
|
+
return tokenId ? tokens[tokenId] : undefined;
|
|
622
|
+
}
|
|
623
|
+
|
|
615
624
|
const useBalancesHydrate = () => {
|
|
616
625
|
const {
|
|
617
626
|
withTestnets
|
|
@@ -191,7 +191,7 @@ const [DbCacheProvider, useDbCache] = provideContext(useDbCacheProvider);
|
|
|
191
191
|
|
|
192
192
|
var packageJson = {
|
|
193
193
|
name: "@talismn/balances-react",
|
|
194
|
-
version: "0.0.0-pr640-
|
|
194
|
+
version: "0.0.0-pr640-20230323000926",
|
|
195
195
|
author: "Talisman",
|
|
196
196
|
homepage: "https://talisman.xyz",
|
|
197
197
|
license: "UNLICENSED",
|
|
@@ -306,20 +306,6 @@ const useSharedSubscription = (key, subscribe) => {
|
|
|
306
306
|
}, [key, subscribe]);
|
|
307
307
|
};
|
|
308
308
|
|
|
309
|
-
function useTokens(withTestnets) {
|
|
310
|
-
// keep db data up to date
|
|
311
|
-
useDbCacheSubscription("tokens");
|
|
312
|
-
const {
|
|
313
|
-
tokensWithTestnetsMap,
|
|
314
|
-
tokensWithoutTestnetsMap
|
|
315
|
-
} = useDbCache();
|
|
316
|
-
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
317
|
-
}
|
|
318
|
-
function useToken(tokenId, withTestnets) {
|
|
319
|
-
const tokens = useTokens(withTestnets);
|
|
320
|
-
return tokenId ? tokens[tokenId] : undefined;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
309
|
/**
|
|
324
310
|
* Creates a subscription function that can be used to subscribe to a multicast observable created from an upstream source.
|
|
325
311
|
*
|
|
@@ -397,7 +383,7 @@ function useDbCacheTokenRatesSubscription() {
|
|
|
397
383
|
const {
|
|
398
384
|
withTestnets
|
|
399
385
|
} = useWithTestnets();
|
|
400
|
-
const tokens = useTokens(withTestnets);
|
|
386
|
+
const tokens = useTokens$1(withTestnets);
|
|
401
387
|
const subscriptionKey = useMemo(
|
|
402
388
|
// not super sexy but we need key to change based on this stuff
|
|
403
389
|
() => {
|
|
@@ -424,7 +410,7 @@ function useDbCacheBalancesSubscription() {
|
|
|
424
410
|
const chaindataProvider = useChaindata();
|
|
425
411
|
const chainConnectors = useChainConnectors();
|
|
426
412
|
const [allAddresses] = useAllAddresses();
|
|
427
|
-
const tokens = useTokens(withTestnets);
|
|
413
|
+
const tokens = useTokens$1(withTestnets);
|
|
428
414
|
const subscriptionKey = useMemo(
|
|
429
415
|
// not super sexy but we need key to change based on this stuff
|
|
430
416
|
() => {
|
|
@@ -439,6 +425,15 @@ function useDbCacheBalancesSubscription() {
|
|
|
439
425
|
}, [allAddresses, balanceModules, tokens]);
|
|
440
426
|
useSharedSubscription(subscriptionKey, subscription);
|
|
441
427
|
}
|
|
428
|
+
|
|
429
|
+
// subscriptionless version of useTokens, prevents circular dependency
|
|
430
|
+
const useTokens$1 = withTestnets => {
|
|
431
|
+
const {
|
|
432
|
+
tokensWithTestnetsMap,
|
|
433
|
+
tokensWithoutTestnetsMap
|
|
434
|
+
} = useDbCache();
|
|
435
|
+
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
436
|
+
};
|
|
442
437
|
const subscribeChainDataHydrate = (provider, type) => {
|
|
443
438
|
const chaindata = provider;
|
|
444
439
|
const delay = 300_000; // 300_000ms = 300s = 5 minutes
|
|
@@ -603,6 +598,20 @@ function useTokenRate(tokenId) {
|
|
|
603
598
|
return tokenId ? tokenRates[tokenId] : undefined;
|
|
604
599
|
}
|
|
605
600
|
|
|
601
|
+
function useTokens(withTestnets) {
|
|
602
|
+
// keep db data up to date
|
|
603
|
+
useDbCacheSubscription("tokens");
|
|
604
|
+
const {
|
|
605
|
+
tokensWithTestnetsMap,
|
|
606
|
+
tokensWithoutTestnetsMap
|
|
607
|
+
} = useDbCache();
|
|
608
|
+
return withTestnets ? tokensWithTestnetsMap : tokensWithoutTestnetsMap;
|
|
609
|
+
}
|
|
610
|
+
function useToken(tokenId, withTestnets) {
|
|
611
|
+
const tokens = useTokens(withTestnets);
|
|
612
|
+
return tokenId ? tokens[tokenId] : undefined;
|
|
613
|
+
}
|
|
614
|
+
|
|
606
615
|
const useBalancesHydrate = () => {
|
|
607
616
|
const {
|
|
608
617
|
withTestnets
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@talismn/balances-react",
|
|
3
|
-
"version": "0.0.0-pr640-
|
|
3
|
+
"version": "0.0.0-pr640-20230323000926",
|
|
4
4
|
"author": "Talisman",
|
|
5
5
|
"homepage": "https://talisman.xyz",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"clean": "rm -rf dist && rm -rf .turbo rm -rf node_modules"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@talismn/balances": "^0.0.0-pr640-
|
|
30
|
-
"@talismn/chain-connector": "^0.0.0-pr640-
|
|
31
|
-
"@talismn/chain-connector-evm": "^0.0.0-pr640-
|
|
32
|
-
"@talismn/chaindata-provider": "^0.0.0-pr640-
|
|
33
|
-
"@talismn/chaindata-provider-extension": "^0.0.0-pr640-
|
|
34
|
-
"@talismn/connection-meta": "^0.0.0-pr640-
|
|
35
|
-
"@talismn/token-rates": "^0.0.0-pr640-
|
|
29
|
+
"@talismn/balances": "^0.0.0-pr640-20230323000926",
|
|
30
|
+
"@talismn/chain-connector": "^0.0.0-pr640-20230323000926",
|
|
31
|
+
"@talismn/chain-connector-evm": "^0.0.0-pr640-20230323000926",
|
|
32
|
+
"@talismn/chaindata-provider": "^0.0.0-pr640-20230323000926",
|
|
33
|
+
"@talismn/chaindata-provider-extension": "^0.0.0-pr640-20230323000926",
|
|
34
|
+
"@talismn/connection-meta": "^0.0.0-pr640-20230323000926",
|
|
35
|
+
"@talismn/token-rates": "^0.0.0-pr640-20230323000926",
|
|
36
36
|
"anylogger": "^1.0.11",
|
|
37
37
|
"blueimp-md5": "2.19.0",
|
|
38
38
|
"dexie": "^3.2.3",
|