TorusWallet

public class TorusWallet : RegularWallet

A Tezos Wallet used for signing transactions before sending to the Tezos network. This object holds the public and private key used to create the contained Tezos address. You should NOT store a copy of this class in a singleton or gloabl variable of any kind. it should be created as needed and nil’d when not. In order to help developers achieve this, use the WalletCacheService to store/retreive an encrypted copy of the wallet on disk, and recreate the Wallet.

This wallet is a subclass of LinearWallet created by using the Torus network to generate wallets from social media accounts. This class is equivalent to a LinearWallet producing a TZ2 address via secp256k1, without the use of a mnemonic, and instead including the social profile of the user.

Properties

  • The type of service used to generate the provide key

    Declaration

    Swift

    public let authProvider: TorusAuthProvider
  • The raw social media username displayed on the users account. In the case of Twitter, it will not be prefix with an @

    Declaration

    Swift

    public let socialUsername: String?
  • The unique id the social media platform has assigned to the users account. Used for querying account details

    Declaration

    Swift

    public let socialUserId: String?
  • A URL to the users profile picture on the given social meida platform

    Declaration

    Swift

    public let socialProfilePictureURL: URL?

Init

  • Create an instace of the wallet from the data provided by the Torus network, using TorusAuthService

    Declaration

    Swift

    public init?(authProvider: TorusAuthProvider, username: String?, userId: String?, profilePicture: String?, torusPrivateKey: String)

    Parameters

    authProvider

    The supported provider used to create the private key

    username

    Optional, the users social profile username

    userId

    Optional, the users social profile unique id

    profilePicture

    Optional, the users social profile display image

    torusPrivateKey

    The hex encoded private key from the Torus network

Codable

  • Encodable encode func

    Declaration

    Swift

    public override func encode(to encoder: Encoder) throws