UNPKG

@ngraveio/ur-sync

Version:

Provides BC-UR types for syncing multiple coins and accounts from cold wallets to watch only wallets.

51 lines (50 loc) 1.82 kB
import { DetailedAccount } from './DetailedAccount'; import { CoinIdentity } from '@ngraveio/ur-coin-identity'; /** CDDL * * ; Associate a coin identity to its accounts * * detailed_accounts = [+ #6.1402(crypto-detailed-account)] * * ; The accounts are preferrably listed using #6.1402(crypto-detailed-account) * : to share the maximum of information related to the accounts * * accounts_exp = detailed_accounts / #6.311(crypto-account) / #6.1103(crypto-multi-account) * * ; The accounts can also be listed using #6.311(crypto-account) * ; or #6.1103(crypto-multi-account), keeping fully compatibility with these types. * ; The information contained in #6.311(crypto-account) and #6.1103(crypto-multi-account) * ; are however limited compared to #6.1402(crypto-detailed-account). * * coin = { * coin-id: #6.1401(coin-identity), * accounts: accounts_exp, * ? master-fingerprint: uint32, ; Master fingerprint (fingerprint for the master public key as per BIP32) * } * * coin-id = 1 * accounts = 2 * master-fingerprint = 3 * */ type detailed_accounts = DetailedAccount[]; type accounts_exp = detailed_accounts; interface IPortfolioCoinInput { coinId: CoinIdentity; accounts: accounts_exp; masterFingerprint?: number; } declare const PortfolioCoin_base: import("@ngraveio/bc-ur").RegistryItemClass<import("@ngraveio/bc-ur").RegistryItemBase>; export declare class PortfolioCoin extends PortfolioCoin_base { data: IPortfolioCoinInput; constructor(data: IPortfolioCoinInput); verifyInput(input: IPortfolioCoinInput): { valid: boolean; reasons?: Error[]; }; getCoinId: () => CoinIdentity; getAccounts: () => detailed_accounts; getDetailedAccounts: () => detailed_accounts; getMasterFingerprint: () => number | undefined; } export {};