UNPKG

@ngraveio/bc-ur-multi-layer-sync

Version:

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

52 lines (51 loc) 2.25 kB
/// <reference types="node" /> import { DataItem, RegistryItem, CryptoAccount, CryptoMultiAccounts } from '@keystonehq/bc-ur-registry'; import { CryptoDetailedAccount } from './CryptoDetailedAccount'; import { CryptoCoinIdentity } from '@ngraveio/bc-ur-registry-crypto-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(crypto-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 = CryptoDetailedAccount[]; type accounts_exp = detailed_accounts | CryptoAccount | CryptoMultiAccounts; export declare class CryptoSyncCoin extends RegistryItem { private coin_id; private accounts; private masterFingerprint?; getRegistryType: () => import("@keystonehq/bc-ur-registry").RegistryType; constructor(coin_id: CryptoCoinIdentity, accounts: accounts_exp, master_fingerprint?: Buffer); static checkInputs: (accounts: accounts_exp, masterFingerprint?: Buffer) => void; getCoinId: () => CryptoCoinIdentity; getAccounts: () => accounts_exp; getCryptoAccount: () => CryptoAccount | undefined; getCryptoMultiAccounts: () => CryptoMultiAccounts | undefined; getDetailedAccounts: () => CryptoDetailedAccount[] | undefined; getMasterFingerprint: () => Buffer | undefined; toDataItem: () => DataItem; static fromDataItem: (dataItem: DataItem) => CryptoSyncCoin; static fromCBOR: (_cborPayload: Buffer) => CryptoSyncCoin; } export {};