1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import type { BytesLike } from "../utils/index.js";
|
8 | import type { AbstractProvider, AbstractProviderPlugin } from "./abstract-provider.js";
|
9 | import type { Provider } from "./provider.js";
|
10 |
|
11 |
|
12 |
|
13 | export type AvatarLinkageType = "name" | "avatar" | "!avatar" | "url" | "data" | "ipfs" | "erc721" | "erc1155" | "!erc721-caip" | "!erc1155-caip" | "!owner" | "owner" | "!balance" | "balance" | "metadata-url-base" | "metadata-url-expanded" | "metadata-url" | "!metadata-url" | "!metadata" | "metadata" | "!imageUrl" | "imageUrl-ipfs" | "imageUrl" | "!imageUrl-ipfs";
|
14 |
|
15 |
|
16 |
|
17 | export interface AvatarLinkage {
|
18 | |
19 |
|
20 |
|
21 | type: AvatarLinkageType;
|
22 | |
23 |
|
24 |
|
25 | value: string;
|
26 | }
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export interface AvatarResult {
|
36 | |
37 |
|
38 |
|
39 |
|
40 | linkage: Array<AvatarLinkage>;
|
41 | |
42 |
|
43 |
|
44 |
|
45 |
|
46 | url: null | string;
|
47 | }
|
48 |
|
49 |
|
50 |
|
51 | export declare abstract class MulticoinProviderPlugin implements AbstractProviderPlugin {
|
52 | |
53 |
|
54 |
|
55 | readonly name: string;
|
56 | |
57 |
|
58 |
|
59 | constructor(name: string);
|
60 | connect(proivder: Provider): MulticoinProviderPlugin;
|
61 | /**
|
62 | * Returns ``true`` if %%coinType%% is supported by this plugin.
|
63 | */
|
64 | supportsCoinType(coinType: number): boolean;
|
65 | /**
|
66 | * Resolves to the encoded %%address%% for %%coinType%%.
|
67 | */
|
68 | encodeAddress(coinType: number, address: string): Promise<string>;
|
69 | /**
|
70 | * Resolves to the decoded %%data%% for %%coinType%%.
|
71 | */
|
72 | decodeAddress(coinType: number, data: BytesLike): Promise<string>;
|
73 | }
|
74 | /**
|
75 | * A **BasicMulticoinProviderPlugin** provides service for common
|
76 | * coin types, which do not require additional libraries to encode or
|
77 | * decode.
|
78 | */
|
79 | export declare class BasicMulticoinProviderPlugin extends MulticoinProviderPlugin {
|
80 | |
81 |
|
82 |
|
83 | constructor();
|
84 | }
|
85 | /**
|
86 | * A connected object to a resolved ENS name resolver, which can be
|
87 | * used to query additional details.
|
88 | */
|
89 | export declare class EnsResolver {
|
90 | #private;
|
91 | |
92 |
|
93 |
|
94 | provider: AbstractProvider;
|
95 | |
96 |
|
97 |
|
98 | address: string;
|
99 | |
100 |
|
101 |
|
102 | name: string;
|
103 | constructor(provider: AbstractProvider, address: string, name: string);
|
104 | /**
|
105 | * Resolves to true if the resolver supports wildcard resolution.
|
106 | */
|
107 | supportsWildcard(): Promise<boolean>;
|
108 | /**
|
109 | * Resolves to the address for %%coinType%% or null if the
|
110 | * provided %%coinType%% has not been configured.
|
111 | */
|
112 | getAddress(coinType?: number): Promise<null | string>;
|
113 | /**
|
114 | * Resolves to the EIP-634 text record for %%key%%, or ``null``
|
115 | * if unconfigured.
|
116 | */
|
117 | getText(key: string): Promise<null | string>;
|
118 | /**
|
119 | * Rsolves to the content-hash or ``null`` if unconfigured.
|
120 | */
|
121 | getContentHash(): Promise<null | string>;
|
122 | /**
|
123 | * Resolves to the avatar url or ``null`` if the avatar is either
|
124 | * unconfigured or incorrectly configured (e.g. references an NFT
|
125 | * not owned by the address).
|
126 | *
|
127 | * If diagnosing issues with configurations, the [[_getAvatar]]
|
128 | * method may be useful.
|
129 | */
|
130 | getAvatar(): Promise<null | string>;
|
131 | /**
|
132 | * When resolving an avatar, there are many steps involved, such
|
133 | * fetching metadata and possibly validating ownership of an
|
134 | * NFT.
|
135 | *
|
136 | * This method can be used to examine each step and the value it
|
137 | * was working from.
|
138 | */
|
139 | _getAvatar(): Promise<AvatarResult>;
|
140 | static getEnsAddress(provider: Provider): Promise<string>;
|
141 | /**
|
142 | * Resolve to the ENS resolver for %%name%% using %%provider%% or
|
143 | * ``null`` if unconfigured.
|
144 | */
|
145 | static fromName(provider: AbstractProvider, name: string): Promise<null | EnsResolver>;
|
146 | }
|
147 | //# sourceMappingURL=ens-resolver.d.ts.map |
\ | No newline at end of file |