Contract FungibleTokenSwitchboard
_10contract FungibleTokenSwitchboard {_10_10 StoragePath: StoragePath_10_10 PublicPath: PublicPath_10_10 ReceiverPublicPath: PublicPath_10}
The contract that allows an account to receive payments in multiple fungible
tokens using a single {FungibleToken.Receiver}
capability.
This capability should ideally be stored at the
FungibleTokenSwitchboard.ReceiverPublicPath = /public/GenericFTReceiver
but it can be stored anywhere.
Interfaces​
resource interface SwitchboardPublic
​
_10resource interface SwitchboardPublic {_10}
The interface that enforces the method to allow anyone to check on the available capabilities of a switchboard resource and also exposes the deposit methods to deposit funds on it.
Structs & Resources​
resource Switchboard
​
_10resource Switchboard {_10_10 receiverCapabilities: {Type: Capability<&{FungibleToken.Receiver}>}_10}
The resource that stores the multiple fungible token receiver capabilities, allowing the owner to add and remove them and anyone to deposit any fungible token among the available types.
Functions​
fun createSwitchboard()
​
_10func createSwitchboard(): Switchboard
Function that allows to create a new blank switchboard. A user must call this function and store the returned resource in their storage.
Events​
event VaultCapabilityAdded
​
_10event VaultCapabilityAdded(type Type, switchboardOwner Address?, capabilityOwner Address?)
The event that is emitted when a new vault capability is added to a switchboard resource.
event VaultCapabilityRemoved
​
_10event VaultCapabilityRemoved(type Type, switchboardOwner Address?, capabilityOwner Address?)
The event that is emitted when a vault capability is removed from a switchboard resource.
event NotCompletedDeposit
​
_10event NotCompletedDeposit(type Type, amount UFix64, switchboardOwner Address?)
The event that is emitted when a deposit can not be completed.