@ethereum-entity-registry/sdk 0.2.1 → 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 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 full state of an identifier: owner, deposit address, and
165
- * ERC-20 balance all in a single parallel batch of RPC calls.
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 on-chain state.
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
@@ -2155,7 +2155,7 @@ var deployments_default = {
2155
2155
  },
2156
2156
  "84532": {
2157
2157
  IdentityAccount: {
2158
- address: "0xB7E7c564Bf3d4742140bc48484F83A8019E857B4",
2158
+ address: "0xC488d223B6FfdeE8855D3Ba7b4994175b4d5cFd0",
2159
2159
  abi: [
2160
2160
  {
2161
2161
  inputs: [],
@@ -2250,7 +2250,7 @@ var deployments_default = {
2250
2250
  name: "registry",
2251
2251
  outputs: [
2252
2252
  {
2253
- internalType: "contract ICanonicalRegistry",
2253
+ internalType: "contract IEntityRegistry",
2254
2254
  name: "",
2255
2255
  type: "address"
2256
2256
  }
@@ -2263,10 +2263,10 @@ var deployments_default = {
2263
2263
  type: "receive"
2264
2264
  }
2265
2265
  ],
2266
- startBlock: 38736655
2266
+ startBlock: 38771786
2267
2267
  },
2268
2268
  TokenDAI: {
2269
- address: "0xfa7D7ffb095d8cCe55B64498A1fdD871B1006Bb7",
2269
+ address: "0x7EE901005B26b7e3700af367F763AA9090485Ba7",
2270
2270
  abi: [
2271
2271
  {
2272
2272
  inputs: [
@@ -2616,10 +2616,10 @@ var deployments_default = {
2616
2616
  type: "function"
2617
2617
  }
2618
2618
  ],
2619
- startBlock: 38736655
2619
+ startBlock: 38771789
2620
2620
  },
2621
2621
  TokenUSDC: {
2622
- address: "0x13F06A8b6db91946B8d00B7f4346CEF406828dbB",
2622
+ address: "0x56c530092b2dBb007b896db514B14F029604E424",
2623
2623
  abi: [
2624
2624
  {
2625
2625
  inputs: [
@@ -2969,10 +2969,10 @@ var deployments_default = {
2969
2969
  type: "function"
2970
2970
  }
2971
2971
  ],
2972
- startBlock: 38736655
2972
+ startBlock: 38771791
2973
2973
  },
2974
2974
  TokenWETH: {
2975
- address: "0xbbb07fd26BbcececE81B05741C2c43f9372B3023",
2975
+ address: "0x1CE46e82E835dd4F1c519Bf09951887Ee6de0957",
2976
2976
  abi: [
2977
2977
  {
2978
2978
  inputs: [
@@ -3322,10 +3322,10 @@ var deployments_default = {
3322
3322
  type: "function"
3323
3323
  }
3324
3324
  ],
3325
- startBlock: 38736656
3325
+ startBlock: 38771792
3326
3326
  },
3327
- CanonicalRegistry: {
3328
- address: "0x94878f6Beae2EE5DfedA27442F201244f07a265E",
3327
+ EntityRegistry: {
3328
+ address: "0x081a5907ab0A77fCc84cf217B62730b9341Ee687",
3329
3329
  abi: [
3330
3330
  {
3331
3331
  inputs: [
@@ -3834,10 +3834,10 @@ var deployments_default = {
3834
3834
  type: "function"
3835
3835
  }
3836
3836
  ],
3837
- startBlock: 38736661
3837
+ startBlock: 38771797
3838
3838
  },
3839
3839
  DnsVerifier: {
3840
- address: "0x8B4f058fd0de52b2AAEA1F52D2fe3684c14A05A0",
3840
+ address: "0xD1AF4F708289FB114eaF3a880e94B185618b4144",
3841
3841
  abi: [
3842
3842
  {
3843
3843
  inputs: [
@@ -4062,10 +4062,10 @@ var deployments_default = {
4062
4062
  type: "function"
4063
4063
  }
4064
4064
  ],
4065
- startBlock: 38736666
4065
+ startBlock: 38771803
4066
4066
  },
4067
4067
  GitHubVerifier: {
4068
- address: "0x22222E257aD4Cd8897Ab338036322B1f6bd334D5",
4068
+ address: "0xefaa6Be4FD67fBF0F471258A93E112570CB09F7F",
4069
4069
  abi: [
4070
4070
  {
4071
4071
  inputs: [
@@ -4290,7 +4290,7 @@ var deployments_default = {
4290
4290
  type: "function"
4291
4291
  }
4292
4292
  ],
4293
- startBlock: 38736666
4293
+ startBlock: 38771831
4294
4294
  }
4295
4295
  },
4296
4296
  "11155111": {
@@ -6443,14 +6443,14 @@ var config = {
6443
6443
  indexer: "http://localhost:42069/graphql"
6444
6444
  },
6445
6445
  [sepolia.id]: {
6446
- registry: deployments["11155111"]?.EntityRegistry?.address,
6446
+ registry: (deployments["11155111"]?.EntityRegistry ?? deployments["11155111"]?.CanonicalRegistry)?.address,
6447
6447
  indexer: "https://canonical-registry-production.up.railway.app/graphql"
6448
6448
  },
6449
6449
  [base.id]: {
6450
6450
  indexer: "http://localhost:42069/graphql"
6451
6451
  },
6452
6452
  [baseSepolia.id]: {
6453
- registry: deployments["84532"]?.CanonicalRegistry?.address,
6453
+ registry: deployments["84532"]?.EntityRegistry?.address,
6454
6454
  indexer: "http://localhost:42069/graphql"
6455
6455
  },
6456
6456
  [hardhat.id]: {
@@ -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 registryContract = getContract({
6760
- address: registryAddress,
6761
- abi: registryAbi,
6762
- client: { public: publicClient }
6763
- });
6764
- const [ownerRaw, balance] = await Promise.all([
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 full state of an identifier: owner, deposit address, and
6911
- * ERC-20 balance all in a single parallel batch of RPC calls.
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 on-chain state.
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethereum-entity-registry/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK and React hooks for the Ethereum Entity Registry",
6
6
  "repository": {
@@ -9,18 +9,18 @@
9
9
  "directory": "packages/sdk"
10
10
  },
11
11
  "homepage": "https://github.com/carlbarrdahl/ethereum-canonical-registry#readme",
12
- "keywords": [
13
- "ethereum",
14
- "registry",
15
- "identity",
16
- "github",
17
- "dns",
18
- "viem",
19
- "wagmi"
20
- ],
12
+ "keywords": ["ethereum", "registry", "identity", "github", "dns", "viem", "wagmi"],
21
13
  "files": [
22
14
  "dist"
23
15
  ],
16
+ "scripts": {
17
+ "build": "rm -rf dist && tsup src/index.ts --format esm --dts --external @urql/core",
18
+ "dev": "tsup src/index.ts --watch --format esm --dts --external @urql/core",
19
+ "check-types": "tsc --noEmit",
20
+ "prepublishOnly": "bun run build",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest"
23
+ },
24
24
  "exports": {
25
25
  ".": {
26
26
  "types": "./dist/index.d.ts",
@@ -44,17 +44,10 @@
44
44
  "wagmi": ">=2.0.0"
45
45
  },
46
46
  "devDependencies": {
47
+ "@ethereum-entity-registry/contracts": "workspace:*",
47
48
  "@types/react": "^19.2.13",
48
49
  "@types/react-dom": "^19.2.3",
49
50
  "tsup": "^8.5.1",
50
- "vitest": "^4.0.18",
51
- "@ethereum-entity-registry/contracts": "1.0.0"
52
- },
53
- "scripts": {
54
- "build": "rm -rf dist && tsup src/index.ts --format esm --dts --external @urql/core",
55
- "dev": "tsup src/index.ts --watch --format esm --dts --external @urql/core",
56
- "check-types": "tsc --noEmit",
57
- "test": "vitest run",
58
- "test:watch": "vitest"
51
+ "vitest": "^4.0.18"
59
52
  }
60
- }
53
+ }