@bifrostwallet/assets 1.0.0 → 1.1.1
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/README.md +8 -15
- package/fetch-logos.js +4 -3
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bifrostwallet/assets
|
|
2
2
|
|
|
3
|
-
Curated catalog of
|
|
3
|
+
Curated catalog of data providers, validators, tokens, contracts and dapps for Bifrost Wallet.
|
|
4
4
|
|
|
5
5
|
**Adding a provider:** [CONTRIBUTING.md](CONTRIBUTING.md). Tokens, contracts, and dapps are curated by the Bifrost team.
|
|
6
6
|
|
|
@@ -9,24 +9,24 @@ Curated catalog of [FTSO](#glossary) providers, validators, tokens, contracts an
|
|
|
9
9
|
Pin one version and commit the lockfile.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install @bifrostwallet/assets
|
|
12
|
+
npm install @bifrostwallet/assets --save-exact
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
yarn add @bifrostwallet/assets
|
|
16
|
+
yarn add @bifrostwallet/assets --exact
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
`createAssets()` is the package entry. `baseURL` is optional. Omit it and logo URLs use jsDelivr for this release tag:
|
|
20
20
|
|
|
21
21
|
`https://cdn.jsdelivr.net/gh/bifrostwallet/assets@<version>/data/`
|
|
22
22
|
|
|
23
|
-
`<version>` is the package version and the git tag
|
|
23
|
+
`<version>` is the package version and the git tag. That tag is written into the package at build time. Returned `logoURL` values are absolute. A missing record is still `null`.
|
|
24
24
|
|
|
25
25
|
An exact version tag is immutable on jsDelivr. Cache headers last one year, and the file is stored permanently, so this pinned URL does not go stale ([Caching](https://www.jsdelivr.com/documentation#id-caching)). Self-host when you want a copy you control: `npx @bifrostwallet/assets@<version> fetch-logos ./logos` checks each file against the hash in that package. Pin the exact version and run it again on every bump.
|
|
26
26
|
|
|
27
27
|
Don't load logos from `raw.githubusercontent.com`. GitHub's raw file host is not a CDN: it rate-limits requests per IP and returns HTTP 429 under load. jsDelivr is built for this traffic.
|
|
28
28
|
|
|
29
|
-
```
|
|
29
|
+
```ts
|
|
30
30
|
import { createAssets } from "@bifrostwallet/assets";
|
|
31
31
|
|
|
32
32
|
const assets = createAssets();
|
|
@@ -35,7 +35,8 @@ const provider = assets.getProvider(
|
|
|
35
35
|
"0x1650d2760baee638c034200dedcbe17b050d0364",
|
|
36
36
|
);
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
// provider.logoURL is an absolute URL.
|
|
39
|
+
console.log(provider?.logoURL);
|
|
39
40
|
```
|
|
40
41
|
|
|
41
42
|
Pass `baseURL` when you host the files yourself. A trailing slash is optional. The examples further down do that.
|
|
@@ -247,7 +248,7 @@ await verifyTypedData(entry); // true
|
|
|
247
248
|
|
|
248
249
|
Fetch provider `all.json` from jsDelivr on `@main` when you are not installing the package. `logoURL` in that file is already absolute and uses the same `@main` snapshot. There is no token `all.json`. Token lists are not published that way; use `createAssets`.
|
|
249
250
|
|
|
250
|
-
`@main` is the moving catalog, not a release tag. Provider `all.json` logo URLs in this repository use that unpinned branch. Updates there can take up to 12 hours to appear because jsDelivr caches branch URLs for up to 12 hours ([Caching](https://www.jsdelivr.com/documentation#id-caching)). The npm package pins `@<version>`
|
|
251
|
+
`@main` is the moving catalog, not a release tag. Provider `all.json` logo URLs in this repository use that unpinned branch. Updates there can take up to 12 hours to appear because jsDelivr caches branch URLs for up to 12 hours ([Caching](https://www.jsdelivr.com/documentation#id-caching)). The npm package pins `@<version>` so its logos match the installed snapshot.
|
|
251
252
|
|
|
252
253
|
Compared with the package and logos you host:
|
|
253
254
|
|
|
@@ -273,11 +274,3 @@ const nodeIds = listed.flatMap((provider) => provider.validators);
|
|
|
273
274
|
// "https://cdn.jsdelivr.net/gh/bifrostwallet/assets@main/data/providers/eip155-14/0x1650d2760baee638c034200dedcbe17b050d0364/logo.webp"
|
|
274
275
|
// nodeIds starts ["NodeID-5oLazJm5PtV8JFb2GpzuCVMZdi1GxkwYP", ...]
|
|
275
276
|
```
|
|
276
|
-
|
|
277
|
-
## Glossary
|
|
278
|
-
|
|
279
|
-
| Term | Meaning |
|
|
280
|
-
| --- | --- |
|
|
281
|
-
| [FTSO](https://dev.flare.network/ftso/overview) | Flare Time Series Oracle, the price feeds a provider submits. |
|
|
282
|
-
| [FSP](https://dev.flare.network/network/fsp) | Flare Systems Protocol, which records provider rewards and participation. |
|
|
283
|
-
| [FDC](https://dev.flare.network/fdc/overview) | Flare Data Connector, the attestation service a provider runs. |
|
package/fetch-logos.js
CHANGED
|
@@ -9,7 +9,7 @@ const fs = require("node:fs");
|
|
|
9
9
|
const path = require("node:path");
|
|
10
10
|
const { fetchLogo, verifyLogoHash } = require("./verify-logo-hash.js");
|
|
11
11
|
|
|
12
|
-
const DEFAULT_LOGO_BASE_URL = "https://cdn.jsdelivr.net/gh/bifrostwallet/assets@1.
|
|
12
|
+
const DEFAULT_LOGO_BASE_URL = "https://cdn.jsdelivr.net/gh/bifrostwallet/assets@1.1.1/data/";
|
|
13
13
|
const USAGE = [
|
|
14
14
|
"Usage: fetch-logos <dir>",
|
|
15
15
|
"",
|
|
@@ -21,7 +21,7 @@ const USAGE = [
|
|
|
21
21
|
"",
|
|
22
22
|
"Upload <dir> to any static host. createAssets baseURL is optional.",
|
|
23
23
|
"Omit it to use jsDelivr at this release tag:",
|
|
24
|
-
"https://cdn.jsdelivr.net/gh/bifrostwallet/assets@1.
|
|
24
|
+
"https://cdn.jsdelivr.net/gh/bifrostwallet/assets@1.1.1/data/",
|
|
25
25
|
"Or set baseURL to the public URL where you uploaded that directory.",
|
|
26
26
|
"Example: https://assets.example.com/",
|
|
27
27
|
"Run fetch-logos again when you bump the package version.",
|
|
@@ -149,12 +149,13 @@ async function fetchLogos(options) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
async function runCli(argv, deps) {
|
|
152
|
-
const args = Array.isArray(argv) ? argv : [];
|
|
152
|
+
const args = Array.isArray(argv) ? argv.slice() : [];
|
|
153
153
|
const extra = deps || {};
|
|
154
154
|
if (args.includes("--help") || args.includes("-h")) {
|
|
155
155
|
console.info(USAGE);
|
|
156
156
|
return 0;
|
|
157
157
|
}
|
|
158
|
+
if (args[0] === "fetch-logos") args.shift();
|
|
158
159
|
if (args.length !== 1) {
|
|
159
160
|
console.error(USAGE);
|
|
160
161
|
return 1;
|
package/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export interface ProviderInfo {
|
|
|
32
32
|
managementGroup: boolean;
|
|
33
33
|
/** Optional domain linkage, refreshed nightly from websiteURL */
|
|
34
34
|
domainLinked: boolean;
|
|
35
|
-
/** Same brand
|
|
35
|
+
/** Same brand on Flare and Songbird, computed from identity address, linked domain, or name */
|
|
36
36
|
dualNetwork: boolean;
|
|
37
37
|
/** Earliest known provider activity on this network (write-once, curator-managed) */
|
|
38
38
|
firstTransaction?: {
|
package/index.js
CHANGED
|
@@ -45,7 +45,7 @@ const CONTRACT_CATEGORIES = ["dex","aggregator","bridge","lending","staking","yi
|
|
|
45
45
|
const CONTRACT_CATEGORY_LABELS = {"dex":"DEX","aggregator":"Aggregator","bridge":"Bridge","lending":"Lending","staking":"Staking","yield":"Yield","perpetuals":"Perpetuals","predictions":"Predictions","nft-marketplace":"NFT Marketplace","governance":"Governance","fassets":"FAssets","rewards":"Rewards","other":"Other"};
|
|
46
46
|
const DAPP_CATEGORIES = ["featured","dex","lending","yield","staking","bridges","marketplaces","social","games","other"];
|
|
47
47
|
const DAPP_CATEGORY_LABELS = {"featured":"Featured","dex":"DEX","lending":"Lending","yield":"Yield","staking":"Staking","bridges":"Bridges","marketplaces":"Marketplaces","social":"Social","games":"Games","other":"Other"};
|
|
48
|
-
const DEFAULT_LOGO_BASE_URL = "https://cdn.jsdelivr.net/gh/bifrostwallet/assets@1.
|
|
48
|
+
const DEFAULT_LOGO_BASE_URL = "https://cdn.jsdelivr.net/gh/bifrostwallet/assets@1.1.1/data/";
|
|
49
49
|
|
|
50
50
|
const EIP712_DOMAIN_SALT = "0xffc5336f20c2026b0f53d269def3cdffa3ca99b07e238af05f263a89517104f7";
|
|
51
51
|
const PROVIDER_LISTING_PRIMARY_TYPE = "ProviderListing";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bifrostwallet/assets",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Curated catalog of
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Curated catalog of data providers, validators, tokens, contracts and dapps for Bifrost Wallet.",
|
|
5
5
|
"repository": "https://github.com/bifrostwallet/assets.git",
|
|
6
6
|
"author": "Bifrost Software Ltd",
|
|
7
7
|
"license": "MIT",
|