Textile
@interface Textile : NSObject
Provides top level access to the Textile API
-
Create a new Textile wallet
Declaration
Objective-C
+ (nonnull NSString *)newWallet:(NSInteger)wordCount error:(NSError *_Nullable *_Nullable)error;
Swift
class func newWallet(_ wordCount: Int, error: NSErrorPointer) -> String
Parameters
wordCount
The number of words the wallet recovery phrase should contain
error
A reference to an error pointer that will be set in the case of an error
Return Value
The new wallet recovery phrase
-
Resolve a wallet account
Declaration
Objective-C
+ (id)walletAccountAt:(nonnull NSString *)phrase index:(NSInteger)index password:(nonnull NSString *)password error:(NSError *_Nullable *_Nullable)error;
Swift
class func walletAccount(at phrase: String, index: Int, password: String) throws -> Any
Parameters
phrase
The wallet recovery phrase
index
The index of the account to resolve
password
The wallet password or nil if there is no password
error
A reference to an error pointer that will be set in the case of an error
Return Value
The wallet account
-
Check if Textile is already initialized
Declaration
Objective-C
+ (BOOL)isInitialized:(nonnull NSString *)repoPath;
Swift
class func isInitialized(_ repoPath: String) -> Bool
Parameters
repoPath
The path to the Textile repo
Return Value
A boolean value indicating if Textile is initialized or not
-
Initialize the shared Textile instance with an existing account seed
Declaration
Objective-C
+ (BOOL)initialize:(nonnull NSString *)repoPath seed:(nonnull NSString *)seed debug:(BOOL)debug logToDisk:(BOOL)logToDisk error:(NSError *_Nullable *_Nullable)error;
Swift
class func initialize(_ repoPath: String, seed: String, debug: Bool, logToDisk: Bool) throws
Parameters
repoPath
The path to the Textile repo
seed
The account seed
debug
Sets the log level to debug or not
logToDisk
Whether or not to write Textile logs to disk
error
A reference to an error pointer that will be set in the case of an error
Return Value
A boolean value indicating if Textile was initialized successfully
-
Initialize the shared Textile instance, creating a new wallet
Declaration
Objective-C
+ (nonnull NSString *) initializeCreatingNewWalletAndAccount:(nonnull NSString *)repoPath debug:(BOOL)debug logToDisk:(BOOL)logToDisk error:(NSError *_Nullable *_Nullable)error;
Swift
class func initializeCreatingNewWalletAndAccount(_ repoPath: String, debug: Bool, logToDisk: Bool, error: NSErrorPointer) -> String
Parameters
repoPath
The path to the Textile repo
debug
Sets the log level to debug or not
logToDisk
Whether or not to write Textile logs to disk
error
A reference to an error pointer that will be set in the case of an error
Return Value
The wallet recovery phrase or nil if there was an error
-
After initialization is complete, launch Textile
Declaration
Objective-C
+ (BOOL)launch:(nonnull NSString *)repoPath debug:(BOOL)debug error:(NSError *_Nullable *_Nullable)error;
Swift
class func launch(_ repoPath: String, debug: Bool) throws
Parameters
repoPath
The path to the Textile repo
debug
Sets the log level to debug or not
error
A reference to an error pointer that will be set in the case of an error
Return Value
A boolean value indicating if Textile was launched successfully
-
The shared Textile instance, should be used for all Textile API access
Declaration
Objective-C
+ (nonnull Textile *)instance;
Swift
class func instance() -> Textile
-
Undocumented
Declaration
Objective-C
@property (nonatomic, strong, nullable) MobileMobile *node
Swift
var node: UnsafeMutablePointer<Int32>? { get set }
-
The delegate object that can be set to receive callbacks about different Textile events
Declaration
Objective-C
@property (readwrite, strong, nonatomic, nullable) id<TextileDelegate> delegate;
Swift
var delegate: TextileDelegate? { get set }
-
Provides access to Textile account related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) AccountApi *_Nonnull account;
Swift
var account: AccountApi { get }
-
Provides access to Textile comments related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) CommentsApi *_Nonnull comments;
Swift
var comments: CommentsApi { get }
-
Provides access to Textile contacts related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) ContactsApi *_Nonnull contacts;
Swift
var contacts: ContactsApi { get }
-
Provides access to Textile ignores related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) IgnoresApi *_Nonnull ignores;
Swift
var ignores: IgnoresApi { get }
-
Provides access to Textile invites related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) InvitesApi *_Nonnull invites;
Swift
var invites: InvitesApi { get }
-
Provides access to Textile messages related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) MessagesApi *_Nonnull messages;
Swift
var messages: MessagesApi { get }
-
Provides access to Textile notifications related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) NotificationsApi *_Nonnull notifications;
Swift
var notifications: NotificationsApi { get }
-
Provides access to Textile profile related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) ProfileApi *_Nonnull profile;
Swift
var profile: ProfileApi { get }
-
Provides access to Textile schemas related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) SchemasApi *_Nonnull schemas;
Swift
var schemas: SchemasApi { get }
-
Provides access to Textile threads related APIs
Declaration
Objective-C
@property (readonly, strong, nonatomic) ThreadsApi *_Nonnull threads;
Swift
var threads: ThreadsApi { get }
-
Undocumented
Declaration
Objective-C
@property (nonatomic, copy, nullable) void (^backgroundCompletionHandler
Swift
var backgroundCompletionHandler: (() -> Void)? { get set }
-
Declaration
Objective-C
- (nonnull NSString *)version;
Swift
func version() -> String
Return Value
The version of the Textile node running locally
-
Declaration
Objective-C
- (nonnull NSString *)gitSummary;
Swift
func gitSummary() -> String
Return Value
The git summary of the Textile node running locally
-
Get a summary of the local Textile node and it’s data
Declaration
Objective-C
- (id)summary:(NSError *_Nullable *_Nullable)error;
Swift
func summary() throws -> Any
Parameters
error
A reference to an error pointer that will be set in the case of an error
Return Value
A summary of the Textile node running locally
-
Start the Textile node
Declaration
Objective-C
- (BOOL)start:(NSError *_Nullable *_Nullable)error;
Swift
func start() throws
Parameters
error
A reference to an error pointer that will be set in the case of an error
Return Value
A boolean indicating if the node was started successfully
-
Stop the Textile node
Declaration
Objective-C
- (void)stopWithCompletion:(nullable void (^)(BOOL, NSError *_Nullable))completion;
Swift
func stop(completion: ((Bool, Error?) -> Void)? = nil)
Parameters
completion
A block that gets called after the node is done stopping
-
Reset the local Textile node instance so it can be re-initialized
Declaration
Objective-C
- (void)destroyWithCompletion:(nullable void (^)(BOOL, NSError *_Nullable))completion;
Swift
func destroy(completion: ((Bool, Error?) -> Void)? = nil)
Parameters
completion
A block that gets called after the Textile instance is reset