Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | 69x 42x 42x 22x | import type { Asset, Cardano, EpochInfo, EraSummary, HandleResolution, NetworkInfoProvider, Serialization } from '@cardano-sdk/core'; import type { BalanceTracker, DelegationTracker, TransactionsTracker, UtxoTracker } from './services'; import type { Cip30DataSignature } from '@cardano-sdk/dapp-connector'; import type { Ed25519PublicKeyHex } from '@cardano-sdk/crypto'; import type { GroupedAddress, MessageSender, SignTransactionContext, WitnessedTx, cip8 } from '@cardano-sdk/key-management'; import type { HexBlob, Shutdown } from '@cardano-sdk/util'; import type { InitializeTxProps, InitializeTxResult, TxBuilder, TxContext } from '@cardano-sdk/tx-construction'; import type { Observable } from 'rxjs'; import type { PubStakeKeyAndStatus } from './services/PublicStakeKeysTracker'; export type Assets = Map<Cardano.AssetId, Asset.AssetInfo>; export type SignDataProps = Omit<cip8.Cip30SignDataRequest, 'knownAddresses'>; export interface SyncStatus extends Shutdown { /** * Emits: * - `true` while waiting for any provider request to resolve * - `false` while there are no provider requests waiting to resolve */ isAnyRequestPending$: Observable<boolean>; /** * Emits after wallet makes at least one request with each relevant provider method: * - `false` on load * - `true` when all provider requests resolve * - `false` when some provider request(s) do not resolve for some time (determined by specific wallet implementation) */ isUpToDate$: Observable<boolean>; /** * Emits after wallet makes at least one request with each relevant provider method: * - `false` on load * - `true` while there are no provider requests waiting to resolve * - `false` while waiting for any provider request to resolve */ isSettled$: Observable<boolean>; } /** * If tx is the transaction CBOR, the auxiliary data, witness and isValid properties are ignored. * If tx is `Cardano.TxBodyWithHash`, the transaction is reconstructed from along with the other * provided properties. */ export type FinalizeTxProps = Omit<TxContext, 'signingContext'> & { tx: Cardano.TxBodyWithHash | Serialization.TxCBOR; bodyCbor?: HexBlob; signingContext?: Partial<SignTransactionContext>; }; export type AddSignaturesProps = { tx: Serialization.TxCBOR; sender?: MessageSender; }; export type HandleInfo = HandleResolution & Asset.AssetInfo; export interface ScriptAddress { networkId: Cardano.NetworkId; address: Cardano.PaymentAddress; rewardAccount: Cardano.RewardAccount; scripts: { payment: Cardano.NativeScript; stake: Cardano.NativeScript; }; } export type WalletAddress = GroupedAddress | ScriptAddress; export const isScriptAddress = (address: WalletAddress): address is ScriptAddress => 'scripts' in address; export const isKeyHashAddress = (address: WalletAddress): address is GroupedAddress => !isScriptAddress(address); export const isTxBodyWithHash = (tx: Serialization.TxCBOR | Cardano.TxBodyWithHash): tx is Cardano.TxBodyWithHash => typeof tx === 'object' && 'hash' in tx && 'body' in tx; export interface ObservableWallet { readonly balance: BalanceTracker; readonly delegation: DelegationTracker; readonly utxo: UtxoTracker; readonly transactions: TransactionsTracker; readonly tip$: Observable<Cardano.Tip>; readonly genesisParameters$: Observable<Cardano.CompactGenesis>; readonly eraSummaries$: Observable<EraSummary[]>; readonly currentEpoch$: Observable<EpochInfo>; readonly protocolParameters$: Observable<Cardano.ProtocolParameters>; readonly addresses$: Observable<WalletAddress[]>; readonly publicStakeKeys$: Observable<PubStakeKeyAndStatus[]>; readonly handles$: Observable<HandleInfo[]>; readonly governance: { /** true this wallet is registered as drep */ readonly isRegisteredAsDRep$: Observable<boolean>; /** Returns the wallet account's public DRep Key or undefined if the wallet doesn't control any DRep key */ getPubDRepKey(): Promise<Ed25519PublicKeyHex | undefined>; }; /** All owned and historical assets */ readonly assetInfo$: Observable<Assets>; /** * This is the catch all Observable for fatal errors emitted by the Wallet. * Once errors are emitted, probably the only available recovery action is to * shutdown the Wallet and to create a new one. */ readonly fatalError$: Observable<unknown>; readonly syncStatus: SyncStatus; getName(): Promise<string>; /** * @deprecated Use `createTxBuilder()` instead. * @throws InputSelectionError */ initializeTx(props: InitializeTxProps): Promise<InitializeTxResult>; /** @deprecated Use `createTxBuilder()` instead. */ finalizeTx(props: FinalizeTxProps): Promise<Cardano.Tx>; /** * @throws Cip30DataSignError */ signData(props: SignDataProps): Promise<Cip30DataSignature>; /** * @throws CardanoNodeErrors.TxSubmissionError */ submitTx(tx: Cardano.Tx | Serialization.TxCBOR | WitnessedTx): Promise<Cardano.TransactionId>; /** Create a TxBuilder from this wallet */ createTxBuilder(): TxBuilder; /** * Discover addresses that might have been created by other applications. * This is run automatically when the wallet is first created. * * @returns Promise that resolves when discovery is complete, with an updated array of wallet addresses */ discoverAddresses(): Promise<WalletAddress[]>; /** * Get the next unused address for the wallet. * * @returns Promise that resolves with the next unused addresses. Return an empty array if there * are no available unused addresses (I.E Single address wallets such as script wallets which already used up their only address). */ getNextUnusedAddress(): Promise<WalletAddress[]>; /** Updates the transaction witness set with signatures from this wallet. */ addSignatures(props: AddSignaturesProps): Promise<Serialization.TxCBOR>; shutdown(): void; } export type WalletNetworkInfoProvider = Pick< NetworkInfoProvider, 'protocolParameters' | 'ledgerTip' | 'genesisParameters' | 'eraSummaries' >; |