Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: distributed metadata #1101

Merged
merged 70 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
cb6df2c
wip: fetch chaindata from github
alecdwm Sep 28, 2023
f05af1a
wip: metadata updater
alecdwm Sep 29, 2023
9543676
chore: consolidated balance modules
alecdwm Oct 1, 2023
bbce569
wip: metadata updater
alecdwm Oct 1, 2023
2966483
wip: port substrate-assets module
alecdwm Oct 1, 2023
4853e02
wip: port substrate-tokens module
alecdwm Oct 1, 2023
71b2791
wip: port substrate-equilibrium module
alecdwm Oct 1, 2023
8b3c440
wip: port substrate-psp22 module
alecdwm Oct 1, 2023
5d5bed0
wip: rm substrate-orml module and @talismn/mutate-metadata
alecdwm Oct 1, 2023
11ad765
fix: jest mocks for chaindata-provider-extension
alecdwm Oct 1, 2023
b53a045
wip: update miniMetadatas when hydrating tokens
alecdwm Oct 1, 2023
f276579
fix: remove deprecated test
alecdwm Oct 2, 2023
5d43463
fix: changesets referencing deleted packages
alecdwm Oct 2, 2023
982cbee
wip: update miniMetadatas when hydrating tokens
alecdwm Oct 12, 2023
c1e23e5
wip: missing miniMetadata in balance modules
alecdwm Oct 12, 2023
548ea46
wip: build evm tokens list in chaindata db
alecdwm Oct 12, 2023
1ac2551
fix: availableTokenLogoFilenames export
alecdwm Oct 12, 2023
c03fcc6
feat: Known EVM networks & tokens (#1126)
0xKheops Nov 3, 2023
fb0a354
Merge branch 'dev' into refactor/distributed-metadata
alecdwm Nov 3, 2023
4335636
fix: remove deleted packages from changesets
alecdwm Nov 3, 2023
dc059ad
fix: inconsistent peerDeps in packages
alecdwm Nov 6, 2023
77c1863
Merge branch 'dev' into refactor/distributed-metadata
alecdwm Nov 7, 2023
a86c4f0
feat: added button to reset chain enabled status to talisman default
alecdwm Nov 7, 2023
f57ad2b
fix: inconsistent peerDeps in packages (again)
alecdwm Nov 7, 2023
6e39409
fix: show error message when @talismn/scale is used but not initialized
alecdwm Nov 9, 2023
1581274
Merge branch 'dev' into refactor/distributed-metadata
alecdwm Nov 14, 2023
cb12549
fix: remove deleted packages from changesets
alecdwm Nov 14, 2023
843b835
fix: incorrect `EvmNativeModuleConfig.symbol` type
alecdwm Nov 14, 2023
60dd662
fix: use type `string` for `contractAddress` in `EvmErc20ModuleConfig`
alecdwm Nov 14, 2023
65df14a
fix: `ChainConnectorEvm` constructor params
alecdwm Nov 14, 2023
8be7400
fix: init chaindata
alecdwm Nov 14, 2023
eb345dc
fix: performance improvements & decoding via subshape
alecdwm Nov 19, 2023
ed1d6b2
fix: missing reset buttons on display balances toggles
alecdwm Nov 19, 2023
75a16ea
fix: pull miniMetadatas and tokens from chaindata
alecdwm Nov 19, 2023
4b1f213
fix: print sentry events to the console in development
alecdwm Nov 19, 2023
cbe1dcb
fix: crash when chaindata chain has no balancesConfig key
alecdwm Nov 19, 2023
acdd617
fix: substrate chain reset
alecdwm Nov 19, 2023
fa4b166
fix: crash on prod builds
alecdwm Nov 21, 2023
6bcc6b1
chore: update @talismn/subshape-fork
alecdwm Nov 21, 2023
7fc8430
fix: separate init data into its own vendor-background script to keep…
alecdwm Nov 22, 2023
c8a86a7
fix: further split up init data to keep all scripts below 4MB
alecdwm Nov 22, 2023
4d2d5c2
fix: background script not starting when `dependsOn` is an array
alecdwm Nov 22, 2023
8b26fab
feat: networks and tokens opt-in enhancements (#1162)
0xKheops Dec 7, 2023
0b5348f
Merge branch 'origin/dev' into refactor/distributed-metadata
alecdwm Dec 7, 2023
0ddcd82
refactor: getChainIdFromTokenId
0xKheops Dec 7, 2023
0f3e70e
Merge branch 'refactor/distributed-metadata' of github.com:TalismanSo…
0xKheops Dec 7, 2023
9b09ec2
fix: remove useless top level suspense
0xKheops Dec 7, 2023
da2837e
fix: merge regression
0xKheops Dec 7, 2023
f3704ab
refactor: atoms & suspense performance
0xKheops Dec 7, 2023
27f01a8
fix: layout shift on token & chain logos
0xKheops Dec 7, 2023
71e8e84
fix: tests
0xKheops Dec 7, 2023
e091c4a
chore: cleanup
0xKheops Dec 7, 2023
bfd6481
fix: suspense on tokenRates to prevent flickering
0xKheops Dec 7, 2023
9ec5200
feat: init balances for balancesByParams
0xKheops Dec 7, 2023
c57c4b9
feat: maintain subscription when opening dashboard
0xKheops Dec 7, 2023
626566f
fix: cleanup
0xKheops Dec 7, 2023
b9a1435
refactor: pull buy tokens config from config repo
0xKheops Dec 8, 2023
9848a41
fix: wording
0xKheops Dec 8, 2023
cc72e64
fix: no assets message
0xKheops Dec 8, 2023
38235dd
Merge branch 'dev' into refactor/distributed-metadata
0xKheops Dec 8, 2023
88a012d
fix: remove changeset for deleted pkg
0xKheops Dec 8, 2023
9cfc8e4
fix: changeset
0xKheops Dec 8, 2023
e05df98
chore: cleanup
0xKheops Dec 13, 2023
290fac5
feat: merge main atoms into one (#1187)
0xKheops Dec 13, 2023
705f4de
fix: vendor-talisman cacheGroup not including init data
alecdwm Dec 15, 2023
656be13
fix: don't import chaindata init data until it's actually used
alecdwm Dec 15, 2023
5247a4f
fix: **really** don't import chaindata init data until it's actually …
alecdwm Dec 15, 2023
85ecad7
chore: update init data
alecdwm Dec 15, 2023
0b14cae
feat: assets discovery (#1191)
0xKheops Jan 5, 2024
b4bc2d6
Merge branch 'dev' into refactor/distributed-metadata
alecdwm Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .changeset/angry-bottles-look.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@talismn/balances-substrate-native": patch
"@talismn/balances": patch
---

fix: incorrect cached/stale balances for evm accounts
1 change: 0 additions & 1 deletion .changeset/clean-cars-drive.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
"@talismn/chaindata-provider-extension": patch
"@talismn/balances-substrate-native": patch
"@talismn/balances": patch
---

Expand Down
5 changes: 0 additions & 5 deletions .changeset/healthy-goats-knock.md

This file was deleted.

3 changes: 1 addition & 2 deletions .changeset/moody-moons-teach.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
"@talismn/balances-evm-native": patch
"@talismn/balances": patch
"@talismn/chain-connector-evm": patch
"@talismn/balances-evm-erc20": patch
"@talismn/util": patch
---

Expand Down
10 changes: 0 additions & 10 deletions .changeset/neat-kiwis-look.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
---
"@talismn/balances-substrate-equilibrium": patch
"@talismn/chaindata-provider-extension": patch
"@talismn/balances-substrate-assets": patch
"@talismn/balances-substrate-native": patch
"@talismn/balances-substrate-tokens": patch
"@talismn/balances-default-modules": patch
"@talismn/balances-substrate-psp22": patch
"@talismn/balances-substrate-orml": patch
"@talismn/balances-evm-native": patch
"@talismn/chain-connector-evm": patch
"@talismn/balances-evm-erc20": patch
"@talismn/chaindata-provider": patch
"@talismn/chain-connector": patch
"@talismn/connection-meta": patch
"@talismn/mutate-metadata": patch
"@talismn/eslint-config": patch
"@talismn/on-chain-id": patch
"talisman-ui": patch
Expand Down
2 changes: 0 additions & 2 deletions .changeset/poor-coats-sip.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
"@talismn/balances-default-modules": patch
"@talismn/balances-substrate-psp22": patch
"@talismn/balances": patch
---

Expand Down
1 change: 0 additions & 1 deletion .changeset/proud-trees-kick.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
"@talismn/balances-substrate-native": patch
"@talismn/balances": patch
---

Expand Down
4 changes: 1 addition & 3 deletions .changeset/sharp-goats-run.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
"@talismn/balances-substrate-assets": patch
"@talismn/balances-substrate-native": patch
"@talismn/balances-substrate-tokens": patch
"@talismn/balances": patch
---

fix: renamed renamed Unknown -> Unit for tokens with no symbol
2 changes: 1 addition & 1 deletion .changeset/silly-ducks-bow.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"@talismn/chaindata-provider-extension": patch
"@talismn/balances-substrate-native": patch
"@talismn/balances": patch
"@talismn/chaindata-provider": patch
"@talismn/scale": patch
---
Expand Down
1 change: 0 additions & 1 deletion apps/balances-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"@polkadot/api": "^10.1.4",
"@polkadot/extension-dapp": "^0.45.3",
"@talismn/balances": "workspace:*",
"@talismn/balances-default-modules": "workspace:*",
"@talismn/balances-react": "workspace:*",
"@talismn/chaindata-provider-extension": "workspace:*",
"anylogger": "^1.0.11",
Expand Down
4 changes: 2 additions & 2 deletions apps/balances-demo/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "anylogger-loglevel"

import "./index.css"

import { balanceModules } from "@talismn/balances-default-modules"
import { defaultBalanceModules } from "@talismn/balances"
import { BalancesProvider } from "@talismn/balances-react"
import React from "react"
import ReactDOM from "react-dom/client"
Expand All @@ -14,7 +14,7 @@ const onfinalityApiKey = undefined
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<BalancesProvider
balanceModules={balanceModules}
balanceModules={defaultBalanceModules}
onfinalityApiKey={onfinalityApiKey}
// withTestnets
// enabledChains={[
Expand Down
3 changes: 1 addition & 2 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
"@substrate/txwrapper-core": "*",
"@svgr/webpack": "^6.5.1",
"@talismn/balances": "workspace:*",
"@talismn/balances-default-modules": "workspace:*",
"@talismn/chaindata-js": "^0.0.7",
"@talismn/chaindata-provider": "workspace:*",
"@talismn/icons": "workspace:*",
"@talismn/on-chain-id": "workspace:*",
"@talismn/orb": "workspace:*",
"@talismn/scale": "workspace:*",
"@talismn/subshape-fork": "^0.0.2",
"@talismn/token-rates": "workspace:*",
"@talismn/util": "workspace:*",
"@tanstack/react-query": "4.29.19",
Expand Down Expand Up @@ -130,7 +130,6 @@
"scale-codec": "^0.11.0",
"semver": "^7.5.4",
"style-loader": "3.3.3",
"subshape": "^0.14.0",
"talisman-ui": "workspace:*",
"terser-webpack-plugin": "5.3.9",
"toml": "^3.0.0",
Expand Down
8 changes: 7 additions & 1 deletion apps/extension/public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@
}
],
"background": {
"scripts": ["vendor-background.js", "background.js"],
"scripts": [
"vendor-background-init-chains.js",
"vendor-background-init-tokens.js",
"vendor-background-init-metadata.js",
"vendor-background.js",
"background.js"
],
"persistent": true
},
"web_accessible_resources": ["page.js", "dashboard.js.map"],
Expand Down
20 changes: 17 additions & 3 deletions apps/extension/src/@talisman/components/SearchInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SearchIcon } from "@talismn/icons"
import { SearchIcon, XIcon } from "@talismn/icons"
import { classNames } from "@talismn/util"
import { useDebouncedState } from "@ui/hooks/useDebouncedState"
import {
Expand All @@ -11,7 +11,7 @@ import {
useMemo,
useRef,
} from "react"
import { FormFieldInputContainerProps, FormFieldInputText } from "talisman-ui"
import { FormFieldInputContainerProps, FormFieldInputText, IconButton } from "talisman-ui"

const INPUT_CONTAINER_PROPS: FormFieldInputContainerProps = {
small: true,
Expand Down Expand Up @@ -77,13 +77,27 @@ export const SearchInput: FC<SearchInputProps> = ({
[containerClassName, small]
)

const handleClear = useCallback(() => {
if (!ref.current) return
setSearch("")
ref.current.value = ""
ref.current.blur()
}, [setSearch])

return (
<FormFieldInputText
ref={ref}
className={classNames("text-base", className)}
containerProps={containerProps}
before={<SearchIcon className="text-body-disabled shrink-0" />}
after={after}
after={
after ??
(!!search && (
<IconButton onClick={handleClear}>
<XIcon />
</IconButton>
))
}
defaultValue={initialValue}
placeholder={placeholder}
onChange={handleSearchChange}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { chainConnector } from "@core/rpcs/chain-connector"
import { chainConnectorEvm } from "@core/rpcs/chain-connector-evm"
import { chainConnectors } from "@core/rpcs/balance-modules"
import { getTypeRegistry } from "@core/util/getTypeRegistry"
import { OnChainId, OnChainIds } from "@talismn/on-chain-id"

const chainConnectors = { substrate: chainConnector, evm: chainConnectorEvm }
const chainIdPolkadot = "polkadot"

export const resolveNames = async (names: string[]): Promise<Map<string, string | null>> =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Browser from "webextension-polyfill"

import { getMessageSenderFn } from "../../../../../tests/util"

jest.mock("@talismn/chaindata-provider-extension/src/graphql")
jest.mock("@talismn/chaindata-provider-extension/src/net")
jest.setTimeout(20000)

keyring.loadAll({ store: new AccountsStore() })
Expand Down
Loading