on 355856b help sign in
bridge/src/lib/utils/proxy.ts
18 lines 511 B history raw
1import { Ownership } from '@urbit/roller-api';
3// TODO: test when all proxies are configured to the same address
4export const getProxy = (
5 owner: Ownership,
6 address: string
7): string | undefined =>
8 owner.owner?.address === address
9 ? 'own'
10 : owner.managementProxy?.address === address
11 ? 'manage'
12 : owner.spawnProxy?.address === address
13 ? 'spawn'
14 : owner.votingProxy?.address === address
15 ? 'vote'
16 : owner.transferProxy?.address === address
17 ? 'transfer'
18 : undefined;