Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
jmoreira-valory committed Nov 22, 2024
1 parent ea8381f commit 741787d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
11 changes: 8 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ Returns a list of available wallets

### `GET /api/enriched/wallet`

Returns a list of available wallets with enriched information. It executes on-chain requests to populate the list of owners of each safe, and provides the attributes `all_chains_same_safe_address`, `all_safe_backup_owners_match` and `single_backup_owner_per_safe`.
Returns a list of available wallets with enriched information. It executes on-chain requests to populate the list of owners of each safe, and provides the attributes

- `consistent_backup_owner`: This flag is `true` when all safes across the chains have exactly the same set of backup owner addresses. It ensures that ownership is identical across all safes, regardless of the number of owners.
- `consistent_backup_owner_count`: This flag is `true` when all safes have the same number of owners, and that number is either 0 (no owners) or 1 (exactly one owner). It checks for uniformity in the count of owners and restricts the count to these two cases.
- `consistent_safe_address`: This flag is `true` when all chains have the same safe address. It ensures there is a single safe address consistently used across all chains.

<details>
<summary>Response</summary>
Expand All @@ -209,8 +213,9 @@ Returns a list of available wallets with enriched information. It executes on-ch
[
{
"address":"0xFafd5cb31a611C5e5aa65ea8c6226EB4328175E7",
"all_chains_same_safe_address":true,
"all_safe_backup_owners_match":false,
"consistent_backup_owner": false,
"consistent_backup_owner_count": false,
"consistent_safe_address": true,
"ledger_type":"ethereum",
"safe_chains":[
"gnosis",
Expand Down
8 changes: 4 additions & 4 deletions operate/wallet/master.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,11 @@ def enriched_json(self) -> t.Dict:
}
owner_sets.add(frozenset(owners))

wallet_json["all_chains_same_safe_address"] = len(set(self.safes.values())) == 1
wallet_json["all_safe_backup_owners_match"] = len(owner_sets) == 1
wallet_json["single_backup_owner_per_safe"] = all(
wallet_json["consistent_safe_address"] = len(set(self.safes.values())) == 1
wallet_json["consistent_backup_owner"] = len(owner_sets) == 1
wallet_json["consistent_backup_owner_count"] = all(
len(owner) == 1 for owner in owner_sets
)
) or all(len(owner) == 0 for owner in owner_sets)
return wallet_json

@classmethod
Expand Down

0 comments on commit 741787d

Please sign in to comment.