Address & XPUB
Get Address
Get the address of CoinType and BIP44 Key Path using getAddress() function.
Parameters
coinType: coin type
addressPath: key path to get address
Returns
result: (Bool)
trueif successful,falseif error occurredaddress: address
pubkey: public key value(pubkey exists only when the coinType is
.TEZOS,.XTZ_FA,.TEZOS_TESTNETand.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 XPUB
Get a xpub key of BIP44 Key Path or BIP32 master key using requestExtractPublicKey() function.
Parameters
KeyPath: key path to extract public key
Returns
result: (Bool)
trueif successful,falseif error occurredpublickey: 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 updated
Was this helpful?