Skip to main content

Contract FungibleTokenSwitchboard


_10
contract 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


_10
resource 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.

More...


Structs & Resources

resource Switchboard


_10
resource 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.

More...


Functions

fun createSwitchboard()


_10
func 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


_10
event 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


_10
event VaultCapabilityRemoved(type Type, switchboardOwner Address?, capabilityOwner Address?)

The event that is emitted when a vault capability is removed from a switchboard resource.


event NotCompletedDeposit


_10
event NotCompletedDeposit(type Type, amount UFix64, switchboardOwner Address?)

The event that is emitted when a deposit can not be completed.