Documentation
¶
Index ¶
- Constants
- func AccountVerCheck()
- func AddOrUpdateAccount(accJsonStr string) error
- func AsyncAccSyncing()
- func AsyncAuthSyncing()
- func AuthCodeTimerPause()
- func AuthCodeTimerResume()
- func AuthCodeTimerStop()
- func AuthVerCheck()
- func ChangePassword(old, new string) error
- func CloseWallet()
- func CompleteRemoveWallet()
- func Decode(ciphertext []byte, privateKey *ecdsa.PrivateKey) ([]byte, error)
- func Encode(data []byte, publicKey *ecdsa.PublicKey) ([]byte, error)
- func GenerateMnemonic() ([]byte, error)
- func GenerateWallet(mnemonic, password string) error
- func InitLocalData()
- func InitSDK(exi AppI, url, token string, logLevel int8) error
- func InitWalletPath(dbPath string) bool
- func KeyExpireTime() int
- func LocalCachedAuth() []byte
- func LocalCachedData() []byte
- func NewManualAuth(issuer, account, secret string) error
- func NewScanAuth(url string) error
- func OpenWallet(password string) error
- func RemoveAccount(uuid string) error
- func RemoveAuth(key string) error
- func SaveExpireTime(clockTime int) error
- func ShowMnemonic(password string) (string, error)
- func WalletAddress() string
- func WalletClock()
- func WalletIsOpen() bool
- type API
- type Account
- type AccountManager
- type AppI
- type AuthManager
- type AuthScheduler
- type TOTPConfig
- type WalletManager
Constants ¶
View Source
const ( CTimeInSeconds = 30 HardenedOffset = 0x80000000 // 用于生成硬化路径 DefaultClockTimeInMinutes = 1 AuthCodeTimer = 800 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func AccountVerCheck ¶
func AccountVerCheck()
func AddOrUpdateAccount ¶
AddOrUpdateAccount 添加或者账号并保存
func AsyncAccSyncing ¶
func AsyncAccSyncing()
func AsyncAuthSyncing ¶
func AsyncAuthSyncing()
func AuthCodeTimerPause ¶
func AuthCodeTimerPause()
func AuthCodeTimerResume ¶
func AuthCodeTimerResume()
func AuthCodeTimerStop ¶
func AuthCodeTimerStop()
func AuthVerCheck ¶
func AuthVerCheck()
func ChangePassword ¶
func CloseWallet ¶
func CloseWallet()
func CompleteRemoveWallet ¶
func CompleteRemoveWallet()
func GenerateMnemonic ¶
func GenerateWallet ¶
GenerateWallet 根据助记词生成以太坊HD钱包
func InitLocalData ¶
func InitLocalData()
func InitWalletPath ¶
func LocalCachedAuth ¶
func LocalCachedAuth() []byte
func NewManualAuth ¶
func NewScanAuth ¶
func RemoveAuth ¶
func SaveExpireTime ¶
func ShowMnemonic ¶
func WalletAddress ¶
func WalletAddress() string
func WalletIsOpen ¶
func WalletIsOpen() bool
Types ¶
type Account ¶
type Account struct { ID uuid.UUID `json:"id"` Platform string `json:"platform"` Username string `json:"username"` Password string `json:"password"` LastUpdated int64 `json:"lastUpdated"` // 修改为 Unix 时间戳 }
Account 结构体,与 Swift 的 Account 对应
type AccountManager ¶
type AccountManager struct { Accounts map[string]*Account `json:"accounts"` LocalVersion int64 `json:"local_version"` SrvVersion int64 `json:"srv_version"` // contains filtered or unexported fields }
func (*AccountManager) UpdateLatestVersion ¶
func (am *AccountManager) UpdateLatestVersion(srvVer int64)
type AuthManager ¶
type AuthManager struct { Auth map[string]*TOTPConfig `json:"auth"` LocalVersion int64 `json:"local_version"` SrvVersion int64 `json:"srv_version"` // contains filtered or unexported fields }
func (*AuthManager) UpdateLatestVersion ¶
func (am *AuthManager) UpdateLatestVersion(srvVer int64)
type AuthScheduler ¶
type AuthScheduler struct {
// contains filtered or unexported fields
}
type TOTPConfig ¶
type TOTPConfig struct { Type string `json:"type"` Issuer string `json:"issuer"` Account string `json:"account"` Secret string `json:"secret"` Algorithm string `json:"algorithm"` Digits int `json:"digits"` Period int `json:"period"` }
TOTPConfig 存储TOTP配置信息
type WalletManager ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.