2020-03-19 11:26:51 +03:00
|
|
|
from dataclasses import dataclass
|
2020-07-03 19:12:31 +03:00
|
|
|
from typing import List
|
2021-03-10 05:27:27 +03:00
|
|
|
|
2021-04-04 06:55:26 +03:00
|
|
|
from chia.util.ints import uint8, uint32
|
|
|
|
from chia.util.streamable import Streamable, streamable
|
2020-03-19 11:26:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
|
|
@streamable
|
|
|
|
class WalletInfo(Streamable):
|
|
|
|
"""
|
2020-04-09 22:17:32 +03:00
|
|
|
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.
|
2020-03-19 11:26:51 +03:00
|
|
|
"""
|
|
|
|
|
2020-04-07 12:17:44 +03:00
|
|
|
id: uint32
|
2020-03-19 11:26:51 +03:00
|
|
|
name: str
|
2020-07-15 20:55:36 +03:00
|
|
|
type: uint8 # WalletType(type)
|
2020-03-19 11:26:51 +03:00
|
|
|
data: str
|
2020-07-03 19:12:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
|
|
@streamable
|
|
|
|
class WalletInfoBackup(Streamable):
|
|
|
|
"""
|
|
|
|
Used for transforming list of WalletInfo objects into bytes.
|
|
|
|
"""
|
|
|
|
|
|
|
|
wallet_list: List[WalletInfo]
|