/
wallet_info.py
36 lines (28 loc) · 1.07 KB
/
wallet_info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from __future__ import annotations
from dataclasses import dataclass
from typing import List
from chia.util.ints import uint8, uint32
from chia.util.streamable import Streamable, streamable
@streamable
@dataclass(frozen=True)
class WalletInfo(Streamable):
"""
This object represents the wallet data as it is stored in DB.
ID: Main wallet (Standard) is stored at index 1, every wallet created after done has auto incremented id.
Name: can be a user provided or default generated name. (can be modified)
Type: is specified during wallet creation and should never be changed.
Data: this filed is intended to be used for storing any wallet specific information required for it.
(RL wallet stores origin_id, admin/user pubkey, rate limit, etc.)
This data should be json encoded string.
"""
id: uint32
name: str
type: uint8 # WalletType(type)
data: str
@streamable
@dataclass(frozen=True)
class WalletInfoBackup(Streamable):
"""
Used for transforming list of WalletInfo objects into bytes.
"""
wallet_list: List[WalletInfo]