@ethereum-entity-registry/sdk 0.2.2 → 0.3.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/dist/index.d.ts +3 -5
- package/dist/index.js +9 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -84,7 +84,6 @@ declare function createIndexer(chainId: SupportedChainId): Indexer;
|
|
|
84
84
|
type IdentifierState = {
|
|
85
85
|
id: `0x${string}`;
|
|
86
86
|
depositAddress: Address;
|
|
87
|
-
owner: Address | null;
|
|
88
87
|
balance: bigint | null;
|
|
89
88
|
};
|
|
90
89
|
type ChainDeployments$1 = {
|
|
@@ -161,18 +160,17 @@ declare function createRegistryMethods(wallet: WalletClient | undefined, publicC
|
|
|
161
160
|
*/
|
|
162
161
|
isAccountDeployed: (id: `0x${string}`) => Promise<boolean>;
|
|
163
162
|
/**
|
|
164
|
-
* Resolve the
|
|
165
|
-
*
|
|
163
|
+
* Resolve the deposit address and optional ERC-20 balance for an identifier.
|
|
164
|
+
* The deposit address is computed locally (no RPC). Balance requires one RPC call.
|
|
166
165
|
*
|
|
167
166
|
* @example
|
|
168
167
|
* const state = await sdk.registry.resolveIdentifier("github", "org/repo", tokenAddress)
|
|
169
168
|
* // state.depositAddress — where funders should send tokens
|
|
170
|
-
* // state.owner — null if unclaimed
|
|
171
169
|
* // state.balance — claimable token balance at the deposit address
|
|
172
170
|
*/
|
|
173
171
|
resolveIdentifier: (namespace: string, rawCanonicalString: string, token?: Address) => Promise<IdentifierState>;
|
|
174
172
|
/**
|
|
175
|
-
* Resolve any free-form identifier string to its
|
|
173
|
+
* Resolve any free-form identifier string to its deposit address and optional balance.
|
|
176
174
|
* Accepts namespace:value, URLs, and domain names.
|
|
177
175
|
*
|
|
178
176
|
* @example
|
package/dist/index.js
CHANGED
|
@@ -6756,24 +6756,15 @@ function createRegistryMethods(wallet, publicClient, deployments2) {
|
|
|
6756
6756
|
abi: registryAbi,
|
|
6757
6757
|
client: { public: publicClient }
|
|
6758
6758
|
}).read.predictAddress([id]);
|
|
6759
|
-
const
|
|
6760
|
-
address:
|
|
6761
|
-
abi:
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
registryContract.read.ownerOf([id]),
|
|
6766
|
-
token ? publicClient.readContract({
|
|
6767
|
-
address: token,
|
|
6768
|
-
abi: erc20Abi2,
|
|
6769
|
-
functionName: "balanceOf",
|
|
6770
|
-
args: [depositAddress]
|
|
6771
|
-
}) : Promise.resolve(null)
|
|
6772
|
-
]);
|
|
6759
|
+
const balance = token ? await publicClient.readContract({
|
|
6760
|
+
address: token,
|
|
6761
|
+
abi: erc20Abi2,
|
|
6762
|
+
functionName: "balanceOf",
|
|
6763
|
+
args: [depositAddress]
|
|
6764
|
+
}) : null;
|
|
6773
6765
|
return {
|
|
6774
6766
|
id,
|
|
6775
6767
|
depositAddress,
|
|
6776
|
-
owner: ownerRaw === zeroAddress ? null : ownerRaw,
|
|
6777
6768
|
balance
|
|
6778
6769
|
};
|
|
6779
6770
|
}
|
|
@@ -6907,18 +6898,17 @@ function createRegistryMethods(wallet, publicClient, deployments2) {
|
|
|
6907
6898
|
return code !== void 0 && code !== "0x";
|
|
6908
6899
|
},
|
|
6909
6900
|
/**
|
|
6910
|
-
* Resolve the
|
|
6911
|
-
*
|
|
6901
|
+
* Resolve the deposit address and optional ERC-20 balance for an identifier.
|
|
6902
|
+
* The deposit address is computed locally (no RPC). Balance requires one RPC call.
|
|
6912
6903
|
*
|
|
6913
6904
|
* @example
|
|
6914
6905
|
* const state = await sdk.registry.resolveIdentifier("github", "org/repo", tokenAddress)
|
|
6915
6906
|
* // state.depositAddress — where funders should send tokens
|
|
6916
|
-
* // state.owner — null if unclaimed
|
|
6917
6907
|
* // state.balance — claimable token balance at the deposit address
|
|
6918
6908
|
*/
|
|
6919
6909
|
resolveIdentifier: (namespace, rawCanonicalString, token) => resolveById(namespace, rawCanonicalString, token),
|
|
6920
6910
|
/**
|
|
6921
|
-
* Resolve any free-form identifier string to its
|
|
6911
|
+
* Resolve any free-form identifier string to its deposit address and optional balance.
|
|
6922
6912
|
* Accepts namespace:value, URLs, and domain names.
|
|
6923
6913
|
*
|
|
6924
6914
|
* @example
|