Skip to content

Commit 2002c6f

Browse files
feat(wallet): createWalletUtil's chainHistoryProvider parameter is now optional
1 parent 0a89939 commit 2002c6f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/wallet/src/services/WalletUtil.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface WalletOutputValidatorContext {
2626
}
2727

2828
export type WalletUtilContext = WalletOutputValidatorContext &
29-
InputResolverContext & { chainHistoryProvider: ChainHistoryProvider };
29+
InputResolverContext & { chainHistoryProvider?: ChainHistoryProvider };
3030

3131
export const createInputResolver = ({ utxo, transactions }: InputResolverContext): Cardano.InputResolver => ({
3232
async resolveInput(input: Cardano.TxIn, options?: Cardano.ResolveOptions) {
@@ -131,7 +131,9 @@ export const combineInputResolvers = (...resolvers: Cardano.InputResolver[]): Ca
131131
*/
132132
export const createWalletUtil = (context: WalletUtilContext) => ({
133133
...createOutputValidator({ protocolParameters: () => firstValueFrom(context.protocolParameters$) }),
134-
...combineInputResolvers(createInputResolver(context), createBackendInputResolver(context.chainHistoryProvider))
134+
...(context.chainHistoryProvider
135+
? combineInputResolvers(createInputResolver(context), createBackendInputResolver(context.chainHistoryProvider))
136+
: createInputResolver(context))
135137
});
136138

137139
export type WalletUtil = ReturnType<typeof createWalletUtil>;

packages/wallet/src/types.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { GroupedAddress, MessageSender, SignTransactionContext, WitnessedTx, cip
1414
import { InitializeTxProps, InitializeTxResult, TxBuilder, TxContext } from '@cardano-sdk/tx-construction';
1515
import { Observable } from 'rxjs';
1616
import { PubStakeKeyAndStatus } from './services/PublicStakeKeysTracker';
17-
import { Shutdown } from '@cardano-sdk/util';
17+
import { HexBlob, Shutdown } from "@cardano-sdk/util";
1818

1919
export type Assets = Map<Cardano.AssetId, Asset.AssetInfo>;
2020

@@ -45,6 +45,7 @@ export interface SyncStatus extends Shutdown {
4545

4646
export type FinalizeTxProps = Omit<TxContext, 'signingContext'> & {
4747
tx: Cardano.TxBodyWithHash;
48+
bodyCbor?: HexBlob;
4849
signingContext?: Partial<SignTransactionContext>;
4950
};
5051

0 commit comments

Comments
 (0)