Skip to content

Commit 71b4e6d

Browse files
authored
Feat: get_metadata_by_public_addresses (#134)
* Feat: Add a new get_metadata_by_public_addresses method to the User * Bump version to 2.3.0
1 parent 5756ad1 commit 71b4e6d

5 files changed

Lines changed: 28 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ repos:
1313
- id: detect-private-key
1414
- id: requirements-txt-fixer
1515
- repo: https://github.com/codespell-project/codespell
16-
rev: v2.4.1
16+
rev: v2.4.2
1717
hooks:
1818
- id: codespell
1919
exclude: ^locale/
2020
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.15.0
21+
rev: v0.15.10
2222
hooks:
2323
- id: ruff-check
2424
args: [--fix]

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## `2.3.0` - 2026-04-14
2+
3+
#### 🚀 New Features
4+
5+
- **Added `get_metadata_by_public_addresses` to User resource**
6+
- Enables retrieving metadata for a batch of users in a single request, avoiding rate limiting issues when exporting large numbers of users
7+
- Accepts a list of Ethereum public addresses and returns metadata for each user
8+
- Errors for individual addresses (not found, unauthorized, malformed) are returned per-entry without failing the whole request
9+
10+
---
11+
112
## `2.2.1` - 2026-02-10
213

314
#### 🐛 Bug Fixes

magic_admin/resources/user.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
class User(ResourceComponent):
77
v1_user_info = "/v1/admin/user"
8+
v1_users_info = "/v1/admin/users"
89
v1_user_logout = "/v1/admin/user/logout"
910
v2_user_info = "/v2/admin/user"
1011

@@ -41,6 +42,18 @@ def get_metadata_by_public_address(self, public_address):
4142
construct_issuer_with_public_address(public_address),
4243
)
4344

45+
def get_metadata_by_public_addresses(self, public_addresses):
46+
return self.request(
47+
"post",
48+
self.v1_users_info,
49+
data={
50+
"issuers": [
51+
construct_issuer_with_public_address(addr)
52+
for addr in public_addresses
53+
],
54+
},
55+
)
56+
4457
def get_metadata_by_token(self, did_token):
4558
return self.get_metadata_by_issuer(self.Token.get_issuer(did_token))
4659

magic_admin/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "2.2.1"
1+
VERSION = "2.3.0"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "magic-admin"
7-
version = "2.2.1"
7+
version = "2.3.0"
88
description = "Magic Python Library"
99
readme = "README.md"
1010
authors = [

0 commit comments

Comments
 (0)