@talismn/on-chain-id 0.1.29 → 0.2.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/README.md +2 -13
- package/dist/declarations/src/index.d.ts +3 -1
- package/dist/declarations/src/util/addressesToNames.d.ts +2 -1
- package/dist/declarations/src/util/isPotentialAzns.d.ts +1 -1
- package/dist/declarations/src/util/isPotentialEns.d.ts +1 -1
- package/dist/declarations/src/util/namesToAddresses.d.ts +1 -0
- package/dist/declarations/src/util/types.d.ts +12 -8
- package/dist/talismn-on-chain-id.cjs.dev.js +23 -1430
- package/dist/talismn-on-chain-id.cjs.prod.js +23 -1430
- package/dist/talismn-on-chain-id.esm.js +22 -1429
- package/package.json +4 -14
- package/dist/declarations/src/util/aznsRouter.d.ts +0 -10
package/README.md
CHANGED
|
@@ -6,19 +6,8 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@talismn/on-chain-id)
|
|
7
7
|
[](https://www.npmjs.com/package/@talismn/on-chain-id)
|
|
8
8
|
|
|
9
|
-
**@talismn/on-chain-id** is used to query on-chain identifiers for account addresses in Ethereum and
|
|
9
|
+
**@talismn/on-chain-id** is used to query on-chain identifiers for account addresses in Ethereum, and more upcoming providers.
|
|
10
10
|
|
|
11
11
|
In the case of Ethereum, it is also possible to go the other way (i.e. use the ENS identifier to look up an account address).
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
1. Share open RPC connections with other wallet/dapp features, and
|
|
16
|
-
2. Manage chain state queries in a scalable (multi-chain) manner<sup>[1]</sup>.
|
|
17
|
-
|
|
18
|
-
<sup>[1] - At the moment this package downloads the entire chain metdata for one state query (`Identity::identityOf`).
|
|
19
|
-
We have plans to improve the `@talismn/mutate-metadata` package in order to accomodate for arbitrary state queries in a decentralized manner.
|
|
20
|
-
These improvements will enable `@talismn/on-chain-id` to scale.</sup>
|
|
21
|
-
|
|
22
|
-
For Ethereum identities (ENS), this package uses the `@talismn/chain-connector-evm` package in order to establish an `ethers.js` provider to the Ethereum mainnet.
|
|
23
|
-
|
|
24
|
-
The ENS domain resolution is handled internally by `ethers.js`, the purpose of `@talismn/on-chain-id` is just to colocate the Ethereum and Polkadot lookups into one API.
|
|
13
|
+
The ENS domain resolution is handled internally by `viem`, the purpose of `@talismn/on-chain-id` is just to colocate the Ethereum and upcoming providers lookups into one API.
|
|
@@ -9,8 +9,10 @@ export declare class OnChainId {
|
|
|
9
9
|
constructor(config: OptionalConfig);
|
|
10
10
|
resolveNames: (...args: DropFirst<Parameters<typeof resolveNames>>) => Promise<import("./util/types").ResolvedNames>;
|
|
11
11
|
resolveEnsNames: (...args: DropFirst<Parameters<typeof resolveEnsNames>>) => Promise<import("./util/types").ResolvedNames>;
|
|
12
|
+
/** @deprecated */
|
|
12
13
|
resolveAznsNames: (...args: DropFirst<Parameters<typeof resolveAznsNames>>) => Promise<import("./util/types").ResolvedNames>;
|
|
13
14
|
lookupAddresses: (...args: DropFirst<Parameters<typeof lookupAddresses>>) => Promise<import("./util/types").OnChainIds>;
|
|
14
|
-
|
|
15
|
+
/** @deprecated */
|
|
15
16
|
lookupEnsAddresses: (...args: DropFirst<Parameters<typeof lookupEnsAddresses>>) => Promise<import("./util/types").OnChainIds>;
|
|
17
|
+
lookupAznsAddresses: (...args: DropFirst<Parameters<typeof lookupAznsAddresses>>) => Promise<import("./util/types").OnChainIds>;
|
|
16
18
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Config, OnChainIds } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Looks up the on-chain identifiers for some addresses.
|
|
4
|
-
* Supports ENS
|
|
4
|
+
* Supports ENS.
|
|
5
5
|
*/
|
|
6
6
|
export declare const lookupAddresses: (config: Config, addresses: string[]) => Promise<OnChainIds>;
|
|
7
7
|
/**
|
|
8
8
|
* Looks up the on-chain AZNS domains for some addresses.
|
|
9
|
+
* @deprecated
|
|
9
10
|
*/
|
|
10
11
|
export declare const lookupAznsAddresses: (config: Config, addresses: string[]) => Promise<OnChainIds>;
|
|
11
12
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** @deprecated */
|
|
2
2
|
export declare const isPotentialAzns: (name?: string) => boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** dot separated string e.g. `ens.eth` or `hello.lol
|
|
1
|
+
/** dot separated string e.g. `ens.eth` or `hello.lol` */
|
|
2
2
|
export declare const isPotentialEns: (name?: string) => boolean;
|
|
@@ -2,6 +2,7 @@ import { Config, ResolvedNames } from "./types";
|
|
|
2
2
|
export declare const resolveNames: (config: Config, names: string[]) => Promise<ResolvedNames>;
|
|
3
3
|
/**
|
|
4
4
|
* Looks up the addresses for some azns (azero.id) domains.
|
|
5
|
+
* @deprecated
|
|
5
6
|
*/
|
|
6
7
|
export declare const resolveAznsNames: (config: Config, names: string[]) => Promise<ResolvedNames>;
|
|
7
8
|
/**
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { IChainConnectorDot, IChainConnectorEth, IChainConnectorSol } from "@talismn/chain-connectors";
|
|
2
|
+
export type ChainConnectors = {
|
|
3
|
+
substrate?: IChainConnectorDot;
|
|
4
|
+
evm?: IChainConnectorEth;
|
|
5
|
+
solana?: IChainConnectorSol;
|
|
6
|
+
};
|
|
4
7
|
/** A map of addresses to their on-chain ids. */
|
|
5
8
|
export type OnChainIds = Map<string, string | null>;
|
|
6
9
|
/** A map of lookup names to their resolved addresses. */
|
|
@@ -11,14 +14,15 @@ export type NsLookupType = "ens" | "azns";
|
|
|
11
14
|
* Used as the first parameter to all `namesToAddresses`/`addressesToNames` functions.
|
|
12
15
|
*/
|
|
13
16
|
export type Config = {
|
|
14
|
-
registryAlephZero: TypeRegistry;
|
|
15
17
|
chainConnectors: ChainConnectors;
|
|
16
|
-
/** Used for azns lookups */
|
|
17
|
-
chainIdAlephZero: string;
|
|
18
|
-
/** Used for azns lookups */
|
|
19
|
-
aznsSupportedChainIdAlephZero: `${SupportedChainId}`;
|
|
20
18
|
/** Used for ens lookups */
|
|
21
19
|
networkIdEthereum: string;
|
|
20
|
+
/** @deprecated */
|
|
21
|
+
registryAlephZero?: unknown;
|
|
22
|
+
/** @deprecated */
|
|
23
|
+
chainIdAlephZero?: string;
|
|
24
|
+
/** @deprecated */
|
|
25
|
+
aznsSupportedChainIdAlephZero?: string;
|
|
22
26
|
};
|
|
23
27
|
export type OptionalConfigParams = "chainIdAlephZero" | "aznsSupportedChainIdAlephZero" | "networkIdEthereum";
|
|
24
28
|
export type OptionalConfig = Omit<Config, OptionalConfigParams> & Partial<Pick<Config, OptionalConfigParams>>;
|