> For the complete documentation index, see [llms.txt](https://help.tokenpocket.pro/developer-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.tokenpocket.pro/developer-en/wallet/eos-miniwallet-sdk/ios.md).

# iOS

### Introduction

GitHub: [***TP iOS SDK***](https://github.com/TP-Lab/Mobile-SDK/tree/master/iOS%20SDK)

*MiniWallet* only supports the EOS network. Via MiniWallet, user can do some special  actions without pulling up TokenPocket. This way can provide a better user experience.

### Initialization

**Initialize in** *`AppDelegate.m`* , **in method** *`-application:didFinishLaunchingWithOptions:`*

```
[TPApi registerAppID:@"tpsdk"];
[TPApi setSeed:@"xxxx" error:nil];
[TPApi setBlockChain:TPBlockChainTypeEOSMainNet nodeUrl:@"http://eosinfo.mytokenpocket.vip" plugNodeUrl:@"http://eosinfo.mytokenpocket.vip"];
```

### Auth

```
TPAuthObj *auth = [TPAuthObj new];
auth.dappName = @"xxx";
auth.dappIcon = @"https:.../xx.png";
auth.account = "xxxx";
auth.perm = "xxxx";
auth.selectAll = NO;
auth.actions = [linkActions];
[TPApi sendObj:auth resultHandle:^(TPReqType type,NSError *error) {
    // ...        
}];


/// Response ↓
TPRespObj.data
{
    ...,
    "ref" : "TokenPocket",
    "publickey" : "EOS5AvWThdghtNngWP4UcNi9DL6kF7Mnv2ccO",
    "sign" : "SIG_K1_JyCJtV9vqwxtyEt68UhUibkg1CmRjxtG6zkZwE...",
    "timestamp" : "1554266633",
}
```

### PushTransaction

* Build the data and replace the *`permission`* field value in the field *`action`* in action with the *`perm`* field passed by calling *`auth`*.&#x20;
* Call *`TPApi perm:(NSString *)perm isLinkActions:(NSArray<TPLinkAction *> *)actions account:(NSString *)account completion:(void (^)(BOOL permExisted,BOOL linked,NSError *error))completion`* check action binding fixed state.&#x20;
* If the second step binds successfully, call *`Auth`* directly.&#x20;
* If the binding fails in the second step, the developer needs to replace the *`permission`* field with *`active`* or *`owner`* in order to pull up the wallet to perform the operation.

### Method

#### **Modify the** *`seed`*

```
+ (void)resetSeed:(NSString *)seed newSeed:(NSString *)newSeed error:(NSError **)error;
```

#### Get the information *of* authorized account

```
+ (NSArray<NSString *> *)getAccounts;
```

#### Check if permission exists

```
+ (void)isPermExist:(NSString *)perm account:(NSString *)account completion:(void (^)(BOOL exist,NSError *error))completion;
```

#### Check if the permission **has been** linked to the *`action`*

```
+ (void)perm:(NSString *)perm isLinkActions:(NSArray<TPLinkAction *> *)actions account:(NSString *)account completion:(void (^)(BOOL permExisted,BOOL linked,NSError *error))completion;
```

#### Clear local authorization

```
+ (BOOL)clearAuth:(NSString *)account;
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.tokenpocket.pro/developer-en/wallet/eos-miniwallet-sdk/ios.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
