Address & XPUB
Get the address of
CoinType
and BIP44 Key Path using getAddress()
function.- coinType: coin type
- addressPath: key path to get address
- result: (Bool)
true
if successful,false
if error occurred - address: address
- pubkey: public key value(pubkey exists only when the coinType is
.TEZOS
,.XTZ_FA
,.TEZOS_TESTNET
and.XTZ_FA_TESTNET
)
Example(bitcoin)
// key path of the account
let keyPath = "m/44'/0'/0'/0/0/"
DcentMgr.getAddress(coinType: .BITCOIN, addressPath: keyPath) { (result, address, pubkey) in
if result {
///
print("success")
print("address >> " + address)
}
else {
print("fail")
}
}
Get a xpub key of BIP44 Key Path or BIP32 master key using
requestExtractPublicKey()
function.- KeyPath: key path to extract public key
- result: (Bool)
true
if successful,false
if error occurred - publickey: extract public key
Example
// Hardened key path
let keyPath = "m/44'/0'"
DcentMgr.requestExtractPublicKey( KeyPath: keyPath) { (result, publickey) in
if result {
///
print("success")
print("public key >> " + publickey)
}
else {
print("fail")
}
}
Last modified 2mo ago