> For the complete documentation index, see [llms.txt](https://bitlong.gitbook.io/api-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bitlong.gitbook.io/api-doc/fairlaunch/fairlaunch-wallet-api.md).

# FairLaunch wallet API

## 1.查询用户本人资产发行列表GetUserOwnIssuanceHistoryInfos

```go
func GetUserOwnIssuanceHistoryInfos(token string) string
```

#### 参数

* `token` 字符串

#### 返回值

JSON字符串

* `isFairLaunchIssuance` 是否是公平发射资产
* `asset_name` 资产名字
* `asset_id` 资产ID
* `reserved_total` 发行保留资产数量
* `asset_type` 资产类型（0是正常类型，即同质化代币，1是收藏品类型，即非同质化代币）
* `issuance_time` 发行时间（时间戳，单位秒）
* `state` 状态

#### 注意

当`isFairLaunchIssuance`的值为`true`时，`state`的四种状态分别对应如下

* 0=`FairLaunchStateNoPay` 未支付
* 1=`FairLaunchStatePaidPending` 支付中
* 2=`FairLaunchStatePaidNoIssue` 已支付还未发行
* 3=`FairLaunchStateIssuedPending` 发行中
* 4=`FairLaunchStateIssued` 已发行
* 5=`FairLaunchStateReservedSentPending` 保留资产发送中
* 6=`FairLaunchStateReservedSent` 保留资产已发送

当`isFairLaunchIssuance`的值为`false`时，`state`的九种状态分别对应如下

* 0=`BatchState_BATCH_STATE_UNKNOWN` 未知
* 1=`BatchState_BATCH_STATE_PENDING` 等待中
* 2=`BatchState_BATCH_STATE_FROZEN` 已冻结
* 3=`BatchState_BATCH_STATE_COMMITTED` 已提交
* 4=`BatchState_BATCH_STATE_BROADCAST` 广播
* 5=`BatchState_BATCH_STATE_CONFIRMED` 已确认
* 6=`BatchState_BATCH_STATE_FINALIZED` 已通过`finalize`提交批次
* 7=`BatchState_BATCH_STATE_SEEDLING_CANCELLED` 幼苗取消
* 8=`BatchState_BATCH_STATE_SPROUT_CANCELLED` 萌芽取消

```json
{
  "success": true,
  "error": "",
  "code": 200,
  "data": [
    {
      "isFairLaunchIssuance": false,
      "asset_name": "asMax",
      "asset_id": "205e20ae6d7f4923ab626ee24903971f8f40a5fc6db694cff545c61b2f77be41",
      "reserved_total": 0,
      "asset_type": 0,
      "issuance_time": 1716950984,
      "state": 6
    },
    {
      "isFairLaunchIssuance": false,
      "asset_name": "bob",
      "asset_id": "19dd946bc4c0f58b095eab67d7e882a86f881fb729825b887aa3fe2a32950a57",
      "reserved_total": 0,
      "asset_type": 0,
      "issuance_time": 1717038894,
      "state": 6
    },
    {
      "isFairLaunchIssuance": false,
      "asset_name": "bob",
      "asset_id": "f00f60b2d8606b2d2f1fa365c545b7ff3dd1c0695c83b4b2c030ff3e23c0be2b",
      "reserved_total": 0,
      "asset_type": 0,
      "issuance_time": 1717049664,
      "state": 6
    },
    {
      "isFairLaunchIssuance": false,
      "asset_name": "bob",
      "asset_id": "2e1d172fa9886ab64ebfaef3c78cc02f524b9eee9f165c2809c5e445e9b2c10c",
      "reserved_total": 0,
      "asset_type": 0,
      "issuance_time": 1717049932,
      "state": 6
    },
    {
      "isFairLaunchIssuance": false,
      "asset_name": "bob",
      "asset_id": "273970f5643391c7fc0785375b3a44c8fbcd91facdb40a97228f11ddbb20e713",
      "reserved_total": 0,
      "asset_type": 0,
      "issuance_time": 1717051124,
      "state": 6
    },
    {
      "isFairLaunchIssuance": false,
      "asset_name": "bob",
      "asset_id": "be8c416f6f0e7265c0d1f7517795c52828f1faa1e0851a9b7b53fb7db7e18a85",
      "reserved_total": 0,
      "asset_type": 0,
      "issuance_time": 1717051434,
      "state": 6
    },
    {
      "isFairLaunchIssuance": false,
      "asset_name": "bob",
      "asset_id": "312cc82261b510060ca829a449a2a79b994b369df8ec7351cb920d00aef16893",
      "reserved_total": 0,
      "asset_type": 0,
      "issuance_time": 1717123067,
      "state": 6
    }
  ]
}
```

## 2.查询资产发行费用GetIssuanceTransactionFee

```go
func GetIssuanceTransactionFee(token string, feeRate int) string
```

#### 参数

* `token` 字符串

**\[2024-8-1 14:19:09]**&#x53C2;数增加feeRate

* `feeRate` 费率(单位:Sat/Kw，SatPerKw)

#### 返回值

JSON字符串

* `data` 费用（单位聪）

```json
{
  "success": true,
  "error": "",
  "code": 200,
  "data": 172380
}
```

## 3.查询资产铸造费用GetMintTransactionFee

```go
func GetMintTransactionFee(token string, feeRate int) string
```

#### 参数

* `token` 字符串

**\[2024-8-1 14:19:09]**&#x53C2;数增加feeRate，删除id和number

* `feeRate` 费率(单位:Sat/Kw，SatPerKw)
* ~~`id` 资产的公平发射信息ID（数字短ID）~~
* ~~`number` 铸造份数~~

#### 返回值

JSON字符串

* `data` 费用（单位聪）

```json
{
  "success": true,
  "error": "",
  "code": 200,
  "data": 206720
}
```

## 4.取回公平发射保留资产

*取代之前的在历史记录界面执行的方式*

```go
func AutoMintReserved(token string, deviceId string) string
```

#### 参数

`token` <mark style="color:orange;">string</mark> 登录token

`deviceId`<mark style="color:orange;">string</mark> 设备ID

#### 响应

```json
{"success":true,"error":"","code":200,"data":["13a7143bd63767f07c09446511fac7cd72a45ba87659511c2e39f0973245fea0:0"]}
```
