Skip to content

API documentation of Agoric SDK / Exports / @agoric/smart-wallet / walletFactory

Module: walletFactory ​

Table of contents ​

Type Aliases ​

Variables ​

Functions ​

Type Aliases ​

AssetPublisher ​

Ƭ AssetPublisher: Object

Type declaration ​

NameType
getAssetSubscription() => ERef<IterableEachTopic<AssetDescriptor>>

Defined in ​

walletFactory.js:129


SmartWalletContractTerms ​

Ƭ SmartWalletContractTerms: Object

Type declaration ​

NameType
agoricNamesERef<NameHub>
assetPublisherAssetPublisher
boardERef<index>

Defined in ​

walletFactory.js:122


WalletReviver ​

Ƭ WalletReviver: Object

Type declaration ​

NameType
ackWallet(address: string) => isRevive
reviveWallet(address: string) => Promise<smartWallet>

Defined in ​

walletFactory.js:135


isRevive ​

Ƭ isRevive: boolean

Defined in ​

walletFactory.js:131


start ​

Ƭ start: typeof prepare

Defined in ​

walletFactory.js:343

Variables ​

customTermsShape ​

• Const customTermsShape: Object

Type declaration ​

NameType
agoricNamesany
assetPublisherany
boardany

Defined in ​

walletFactory.js:22


privateArgsShape ​

• Const privateArgsShape: Matcher

Defined in ​

walletFactory.js:28

Functions ​

makeAssetRegistry ​

▸ makeAssetRegistry(assetPublisher): Object

Make a registry for use by the wallet instances.

This doesn't need to persist durably because the assetPublisher has a "pinned" topic and call to getAssetSubscription gets a fresh stream of all the assets that it knows of.

Parameters ​

NameType
assetPublisherAssetPublisher

Returns ​

Object

NameType
get(brand: Brand<AssetKind>) => BrandDescriptor
has(brand: Brand<AssetKind>) => boolean
values() => Iterable<BrandDescriptor>

Defined in ​

walletFactory.js:70


prepare ​

▸ prepare(zcf, privateArgs, baggage): Promise<{ creatorFacet: Guarded<{ provideSmartWallet: (address: string, bank: ERef<Bank>, namesByAddressAdmin: ERef<NameAdmin>) => Promise<[wallet: Object & GetInterfaceGuard<Object> & RemotableBrand<Object, Object & GetInterfaceGuard<Object>>, isNew: boolean]> }> }>

Parameters ​

NameType
zcfZCF<SmartWalletContractTerms>
privateArgsObject
privateArgs.storageNodeERef<StorageNode>
privateArgs.walletBridgeManager?ERef<ScopedBridgeManager>
privateArgs.walletReviver?ERef<WalletReviver>
baggageBaggage

Returns ​

Promise<{ creatorFacet: Guarded<{ provideSmartWallet: (address: string, bank: ERef<Bank>, namesByAddressAdmin: ERef<NameAdmin>) => Promise<[wallet: Object & GetInterfaceGuard<Object> & RemotableBrand<Object, Object & GetInterfaceGuard<Object>>, isNew: boolean]> }> }>

Defined in ​

walletFactory.js:150


publishDepositFacet ​

▸ publishDepositFacet(address, wallet, namesByAddressAdmin): Promise<unknown>

Provide a NameHub for this address and insert depositFacet only if not already done.

Parameters ​

NameType
addressstring
wallet{ getCurrentSubscriber: () => Subscriber<CurrentWalletRecord> ; getDepositFacet: () => Guarded<{ receive: (payment: Payment<AssetKind>) => Promise<Amount<AssetKind>> }> ; getOffersFacet: () => Guarded<{ executeOffer: (offerSpec: OfferSpec) => Promise<void> ; tryExitOffer: (offerId: OfferId) => Promise<void> }> ; getPublicTopics: () => { current: { description: string = 'Current state of wallet'; storagePath: Promise<string> ; subscriber: Subscriber<CurrentWalletRecord> = currentRecorderKit.subscriber } ; updates: { description: string = 'Changes to wallet'; storagePath: Promise<string> ; subscriber: Subscriber<UpdateRecord> = updateRecorderKit.subscriber } } ; getUpdatesSubscriber: () => Subscriber<UpdateRecord> ; handleBridgeAction: (actionCapData: CapData<null | string>, canSpend?: boolean) => Promise<void> ; repairWalletForIncarnation2: (key: any) => void } & GetInterfaceGuard<{ getCurrentSubscriber: () => Subscriber<CurrentWalletRecord> ; getDepositFacet: () => Guarded<{ receive: (payment: Payment<AssetKind>) => Promise<Amount<AssetKind>> }> ; getOffersFacet: () => Guarded<{ executeOffer: (offerSpec: OfferSpec) => Promise<void> ; tryExitOffer: (offerId: OfferId) => Promise<void> }> ; getPublicTopics: () => { current: { description: string = 'Current state of wallet'; storagePath: Promise<string> ; subscriber: Subscriber<CurrentWalletRecord> = currentRecorderKit.subscriber } ; updates: { description: string = 'Changes to wallet'; storagePath: Promise<string> ; subscriber: Subscriber<UpdateRecord> = updateRecorderKit.subscriber } } ; getUpdatesSubscriber: () => Subscriber<UpdateRecord> ; handleBridgeAction: (actionCapData: CapData<null | string>, canSpend?: boolean) => Promise<void> ; repairWalletForIncarnation2: (key: any) => void }> & RemotableBrand<{}, { getCurrentSubscriber: () => Subscriber<CurrentWalletRecord> ; getDepositFacet: () => Guarded<{ receive: (payment: Payment<AssetKind>) => Promise<Amount<AssetKind>> }> ; getOffersFacet: () => Guarded<{ executeOffer: (offerSpec: OfferSpec) => Promise<void> ; tryExitOffer: (offerId: OfferId) => Promise<void> }> ; getPublicTopics: () => { current: { description: string = 'Current state of wallet'; storagePath: Promise<string> ; subscriber: Subscriber<CurrentWalletRecord> = currentRecorderKit.subscriber } ; updates: { description: string = 'Changes to wallet'; storagePath: Promise<string> ; subscriber: Subscriber<UpdateRecord> = updateRecorderKit.subscriber } } ; getUpdatesSubscriber: () => Subscriber<UpdateRecord> ; handleBridgeAction: (actionCapData: CapData<null | string>, canSpend?: boolean) => Promise<void> ; repairWalletForIncarnation2: (key: any) => void } & GetInterfaceGuard<{ getCurrentSubscriber: () => Subscriber<CurrentWalletRecord> ; getDepositFacet: () => Guarded<{ receive: (payment: Payment<AssetKind>) => Promise<Amount<AssetKind>> }> ; getOffersFacet: () => Guarded<{ executeOffer: (offerSpec: OfferSpec) => Promise<void> ; tryExitOffer: (offerId: OfferId) => Promise<void> }> ; getPublicTopics: () => { current: { description: string = 'Current state of wallet'; storagePath: Promise<string> ; subscriber: Subscriber<CurrentWalletRecord> = currentRecorderKit.subscriber } ; updates: { description: string = 'Changes to wallet'; storagePath: Promise<string> ; subscriber: Subscriber<UpdateRecord> = updateRecorderKit.subscriber } } ; getUpdatesSubscriber: () => Subscriber<UpdateRecord> ; handleBridgeAction: (actionCapData: CapData<null | string>, canSpend?: boolean) => Promise<void> ; repairWalletForIncarnation2: (key: any) => void }>>
namesByAddressAdminERef<NameAdmin>

Returns ​

Promise<unknown>

Defined in ​

walletFactory.js:46