Actions
Chains
Chain selection
You can select your own chain by calling the selectChain(_ chain: Chain)
static method on the AppKit
object.
Get selected chain
You can get selected chain by calling the getSelectedChain()
static method on the AppKit
object.
Sign Actions
Create pairing
let uri: WalletConnectURI = try await AppKit.instance.createPairing()
Connect
try await AppKit.instance.connect(
requiredNamespaces: [String: ProposalNamespace],
optionalNamespaces: [String: ProposalNamespace]?,
sessionProperties: [String: String]?,
topic: topic // Can be existing topic or nil to create new one
)
// Or without specifying namespaces to stick with default values
try await AppKit.instance.connect(
topic: topic // Can be existing topic or nil to create new one
)
More about optional and required namespaces can be found here
Disconnect
try await AppKit.instance.disconnect(topic: topic)
Request
try await AppKit.instance.request(
params: .init(
topic: session.topic,
method: "some_method",
params: AnyCodable(payload),
chainId: Blockchain
)
)
Get List of Active Sessions
AppKit.instance.getSessions()
To get a list of active sessions, call AppKit.instance.getSessions()
which will return [Session]
.
launch connected wallet
AppKit.instance.launchCurrentWallet()
To open a wallet that your dapp is connected to
handle deep links
AppKit.instance.handleDeeplink(url)
Cleanup
AppKit.instance.cleanup(topic)
Delete all stored data such as: pairings, sessions, keys