dev
md 22 lines 889 Bytes
Rendered Raw
1 # cw_core
2
3 Core abstractions and shared types for Cake Wallet modules.
4
5 ## Highlights
6
7 - Wallet primitives: `WalletBase`, `WalletService`, `WalletInfo`, `WalletAddresses`.
8 - Transaction primitives: `TransactionInfo`, `TransactionHistoryBase`, directions/priorities.
9 - Currency models: `CryptoCurrency`, `Erc20Token`, SPL/TRON token types.
10 - Persistence helpers: Hive adapters, path helpers (`pathForWallet`), encrypted storage utils.
11 - Node representation (`Node`) and sync status types.
12
13 ## Usage
14
15 Extend `WalletBase` for a new chain and provide a `WalletService` implementation to create/open/restore wallets.
16
17 ```dart
18 class MyChainWallet extends WalletBase<MyBalance, MyHistory, MyTxInfo> { /* ... */ }
19 class MyChainWalletService extends WalletService<New, FromSeed, FromKeys, FromHardware> { /* ... */ }
20 ```
21
22 See the chain modules (e.g., `cw_bitcoin`, `cw_evm`) for complete examples.