4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
|
return $result
}
# Node Wallet Functions
proc ::nano::wallet::decode_backup {password walletJSON} {
array set walletArray [::json::json2dict $walletJSON]
set wallet(version) [expr 0x$walletArray(0000000000000000000000000000000000000000000000000000000000000000)]
set wallet(salt) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000001)]
set wallet(key) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000002)]
set wallet(check) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000003)]
set wallet(rep) [::nano::address::fromPublicKey $walletArray(0000000000000000000000000000000000000000000000000000000000000004)]
set wallet(seed) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000005)]
set wallet(index) [expr 0x$walletArray(0000000000000000000000000000000000000000000000000000000000000006)]
if {$wallet(version) != 4} {
return -code error "Unsupported wallet backup version ($version)"
}
set walletKeyIV [string range $wallet(salt) 0 15]
set seedIV [string range $wallet(salt) 16 end]
|
|
|
|
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
|
return $result
}
# Node Wallet Functions
proc ::nano::wallet::decode_backup {password walletJSON} {
array set walletArray [::json::json2dict $walletJSON]
set wallet(version) [format %lli 0x$walletArray(0000000000000000000000000000000000000000000000000000000000000000)]
set wallet(salt) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000001)]
set wallet(key) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000002)]
set wallet(check) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000003)]
set wallet(rep) [::nano::address::fromPublicKey $walletArray(0000000000000000000000000000000000000000000000000000000000000004)]
set wallet(seed) [binary decode hex $walletArray(0000000000000000000000000000000000000000000000000000000000000005)]
set wallet(index) [format %lli 0x$walletArray(0000000000000000000000000000000000000000000000000000000000000006)]
if {$wallet(version) != 4} {
return -code error "Unsupported wallet backup version ($version)"
}
set walletKeyIV [string range $wallet(salt) 0 15]
set seedIV [string range $wallet(salt) 16 end]
|