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
| Name | Type |
|---|---|
getAssetSubscription | () => ERef<IterableEachTopic<AssetDescriptor>> |
Defined in
SmartWalletContractTerms
Ƭ SmartWalletContractTerms: Object
Type declaration
| Name | Type |
|---|---|
agoricNames | ERef<NameHub> |
assetPublisher | AssetPublisher |
board | ERef<index> |
Defined in
WalletReviver
Ƭ WalletReviver: Object
Type declaration
| Name | Type |
|---|---|
ackWallet | (address: string) => isRevive |
reviveWallet | (address: string) => Promise<smartWallet> |
Defined in
isRevive
Ƭ isRevive: boolean
Defined in
start
Ƭ start: typeof prepare
Defined in
Variables
customTermsShape
• Const customTermsShape: Object
Type declaration
| Name | Type |
|---|---|
agoricNames | any |
assetPublisher | any |
board | any |
Defined in
privateArgsShape
• Const privateArgsShape: Matcher
Defined in
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
| Name | Type |
|---|---|
assetPublisher | AssetPublisher |
Returns
Object
| Name | Type |
|---|---|
get | (brand: Brand<AssetKind>) => BrandDescriptor |
has | (brand: Brand<AssetKind>) => boolean |
values | () => Iterable<BrandDescriptor> |
Defined in
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
| Name | Type |
|---|---|
zcf | ZCF<SmartWalletContractTerms> |
privateArgs | Object |
privateArgs.storageNode | ERef<StorageNode> |
privateArgs.walletBridgeManager? | ERef<ScopedBridgeManager> |
privateArgs.walletReviver? | ERef<WalletReviver> |
baggage | Baggage |
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
publishDepositFacet
▸ publishDepositFacet(address, wallet, namesByAddressAdmin): Promise<unknown>
Provide a NameHub for this address and insert depositFacet only if not already done.
Parameters
| Name | Type |
|---|---|
address | string |
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 }>> |
namesByAddressAdmin | ERef<NameAdmin> |
Returns
Promise<unknown>