Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - abit

Pages: 1 2 3 4 [5] 6 7 8 9 10 11 12 ... 309
61
中文 (Chinese) / 主网新版本 6.0.1
« on: December 16, 2021, 06:22:42 pm »
主网新版 6.0.1 已发布: https://github.com/bitshares/bitshares-core/releases/tag/6.0.1

修复了一个 ElasticSearch 插件问题。用该插件的节点需要升级,其他节点不用升级。


注: 6.0 相关功能介绍和 cli wallet 命令行钱包教程在 test-6.0.2 帖子里: https://bitsharestalk.org/index.php?topic=33335.msg346810#msg346810

62
General Discussion / Re: Committee funding UI and Mobile development
« on: December 16, 2021, 10:36:19 am »
Update: the committee will fund maintenance of the python libs too.

More info (in Chinese): https://bitsharestalk.org/index.php?topic=33480.0

Update (2022-11-25): due to insufficient funds, funding will be suspended after this month.

63
中文 (Chinese) / Re: 后 6.0 相关开发工作
« on: December 16, 2021, 10:34:33 am »
更新一下,已经谈好 Stefan 和 Xeroc 组团负责 python 库和部分 ui 维护工作,每月2000u,从1月份开始,先做做看。如果实际工作量太大的话后面可能要加钱(短期或者长期),后面再谈。

说实话我是不太喜欢用封装太深的库的,很多时候设计不好,封了不好用,甚至不如不封。
比较复杂的、定制化的功能肯定是自己写代码更方便,也更符合自己习惯,写的难看一点也无妨,追求的是简单高效,能用就好。
公用的库,要考虑的东西就比较多,范用性,可维护性,兼容,性能,安全,代码规范,文档,流程,等等。相对来说,就有很多额外工作量。
资源有限,又想少花钱,又想多做事,必然有所取舍。

64
中文 (Chinese) / 测试网新版本 test-6.0.3
« on: December 15, 2021, 06:17:04 pm »
测试网新版 test-6.0.3 已发布: https://github.com/bitshares/bitshares-core/releases/tag/test-6.0.3

修复了一个 ElasticSearch 插件问题。用该插件的节点需要升级,其他节点不用升级。


注: 6.0 相关功能介绍和 cli wallet 命令行钱包教程在 test-6.0.2 帖子里: https://bitsharestalk.org/index.php?topic=33335.msg346810#msg346810

65
中文 (Chinese) / Re: 后 6.0 相关开发工作
« on: December 15, 2021, 05:46:40 pm »
支持开展相关的开发工作,Python库也需要开发维护
看样子 xeroc 可以做 Python 库的维护。
@lebin : Python 库具体有哪些要维护的东西,你有个清单吗
python-bitshares库:
  • 封装一次创建批量订单并返回orders_id接口
  • 获取资金池交易对价格
  • 6.0新增的闪电贷接口
  • 6.0新增的P2P借贷接口
(以上封装的接口要有同步,异步(asyncio)版)
目前暂时想到的是这些
我感觉这些算新功能开发了,不是维护。
其中,池价格有现成的代码吧?批量订单功能应该也是现成的,我看到 dexbot 里用了。

66
中文 (Chinese) / Re: 后 6.0 相关开发工作
« on: December 14, 2021, 05:42:43 pm »
支持开展相关的开发工作,Python库也需要开发维护
看样子 xeroc 可以做 Python 库的维护。
@lebin : Python 库具体有哪些要维护的东西,你有个清单吗

67
中文 (Chinese) / Re: 后 6.0 相关开发工作
« on: December 10, 2021, 02:31:59 pm »
这个应该每月按设计的工作量计费吧?

https://www.bitshares.foundation/reports 下线了,很多早期数据也找不到了,有点可惜
https://web.archive.org/bitshares.foundation

68
The committee will fund development, starting with the reference UI (bitshares-ui) and the mobile app (bitshares-mobile-app).

More info (in Chinese): https://bitsharestalk.org/index.php?topic=33480.0

Update (2021-12-16): the committee will fund maintenance of the python libs too.

69
The committee will fund development, starting with the reference UI (bitshares-ui) and the mobile app (bitshares-mobile-app).

More info (in Chinese): https://bitsharestalk.org/index.php?topic=33480.0

70
中文 (Chinese) / 后 6.0 相关开发工作
« on: December 07, 2021, 08:38:32 pm »
没时间详细展开,简要说一下。

模式:用理事会账户收入来支持开发。

手机 APP ,由 btspp 小夏负责维护和继续开发, 100U 每小时 * 每月 40 小时 = 每月 4000U ,从 2021 年 11 月开始算, 12 月底第一次支付。

桌面版/网页版 UI 和 JS 库,由 Necklace 负责维护和开发, 100U 每小时 * 每月 50 小时 = 每月 5000U ,从 2021 年 12 月开始算, 12 月底第一次支付。另外 Stefan 也有意参与,还在谈。

如果因工作量大/任务紧急需要加人或者加时间,另谈。

CORE 、 Python 库等其他开发待定。

2021-12-16
更新一下,已经谈好 Stefan 和 Xeroc 组团负责 python 库和部分 ui 维护工作,每月2000u,从1月份开始,先做做看。如果实际工作量太大的话后面可能要加钱(短期或者长期),后面再谈。

71
General Discussion / BitShares Core 6.0.0 Release (codename "Mekong")
« on: November 30, 2021, 06:19:58 pm »
The [BitShares](https://bitshares.org) Core software has been updated to the [6.0.0 Protocol Release](https://github.com/bitshares/bitshares-core/milestone/34?closed=1). The codename of the 6.x releases is *"Mekong"*. The Core software is used to build the validation nodes that perform consensus of all transactions on the BitShares blockchain. This release includes additions, improvements and _changes to the consensus protocol_.

The scheduled protocol upgrade time is **`Tuesday, January 11, 2022 14:00:00 UTC` (`2022-01-11T14:00:00Z`)**.

More info https://github.com/bitshares/bitshares-core/releases/tag/6.0.0

Binaries download links and the SHA256 checksum:
|[Microsoft Windows](https://github.com/bitshares/bitshares-core/releases/download/6.0.0/bitshares-core-6.0.0-win64-bin.zip)|`b721383133d56fd2a6469a2aac73c92f7fe518f48a2d6a2484d1dd9dcf6c5527`|
|[Mac](https://github.com/bitshares/bitshares-core/releases/download/6.0.0/bitshares-core-6.0.0-macos64-bin.tar.bz2)|`c5c2ee313233aa06c42ea08f9dd747261dec61399ff1011b9f93b3553a84b868`|
|[Linux](https://github.com/bitshares/bitshares-core/releases/download/6.0.0/bitshares-core-6.0.0-linux-amd64-bin.tar.bz2)|`042740d4e816b80d909d8c82acbefb3ddd20e5b833cace2cfd1816be090eaac1`|

72
BitShares 主网 6.0.0 版本已发布,代号“湄公河”。

协议激活时间 北京时间2022年1月11日晚上10点整。

Release Notes 见 https://github.com/bitshares/bitshares-core/releases/tag/6.0.0

部分内容:
6.0功能预览之一:无抵押借贷(闪电贷) https://bitsharestalk.org/index.php?topic=33069.msg345503#msg345503
6.0功能预览之二:P2P质押借贷(无爆仓) https://bitsharestalk.org/index.php?topic=33074.msg345530#msg345530
6.0功能预览之三:强清吃爆仓单按爆仓算、不需等24小时 / 黑天鹅收费 https://bitsharestalk.org/index.php?topic=33121.msg345656#msg345656
6.0功能预览之四:多种黑天鹅处置方式 https://bitsharestalk.org/index.php?topic=33200.msg346115#msg346115

请所有节点及时部署新版本。

cli_wallet 命令行教程参见 https://bitsharestalk.org/index.php?topic=33335.msg346810#msg346810

重钱包下载链接
|Platform|SHA256 Checksum|
|-|-|
|[Microsoft Windows](https://github.com/bitshares/bitshares-core/releases/download/6.0.0/bitshares-core-6.0.0-win64-bin.zip)|`b721383133d56fd2a6469a2aac73c92f7fe518f48a2d6a2484d1dd9dcf6c5527`|
|[Mac](https://github.com/bitshares/bitshares-core/releases/download/6.0.0/bitshares-core-6.0.0-macos64-bin.tar.bz2)|`c5c2ee313233aa06c42ea08f9dd747261dec61399ff1011b9f93b3553a84b868`|
|[Linux](https://github.com/bitshares/bitshares-core/releases/download/6.0.0/bitshares-core-6.0.0-linux-amd64-bin.tar.bz2)|`042740d4e816b80d909d8c82acbefb3ddd20e5b833cace2cfd1816be090eaac1`|

73
主贴补充两个场景:p2p借新还旧、创建资产+提取费池

74
General Discussion / Re: Testnet release test-6.0.0
« on: November 08, 2021, 08:41:06 pm »

75
P2P质押借贷相关操作 ( cli_wallet 命令 和 API )

基本概念:
* P2P质押借贷的资金池是个人池,与 AMM 池不同,与挂单比较类似。
* 每个账号可以建多个池,每个池内资产可相同也可不同。

1. 创建贷款要约(建池)

op name: credit_offer_create_operation
op code: 69

参数
Code: [Select]
fee                     手续费,测试网默认手续费 1 TEST 基本手续费 + 交易大小费每 KB 加 1 BTS  (类似转账 MEMO 费)
owner_account           账号,格式 1.2.x
asset_type              资产类型(币种),格式 1.3.x
balance                 金额,整数表示,单位是聪
fee_rate                借款费率,整数表示,单位是百万分之一
max_duration_seconds    借款时长,单位是秒
min_deal_amount         最低借款金额(每笔),单位是聪
enabled                 是否立即激活,可为 true 或者 false
auto_disable_time       自动下架时间,格式如 "2021-11-30T0:00:00"
acceptable_collateral   接受的抵押物列表及各抵押物折算价,二维数组格式
acceptable_borrowers    接受的借款人列表及各人最大借款额度,列表为空表示无限制,二维数组格式

注:
* 创建要约时,资金从账户余额锁定到要约中
* 抵押物列表为二维数组格式,可支持多种抵押资产, [[资产类型1,价格1],[资产类型2,价格2],...]
* 借款人列表(白名单)为二维数组格式,可为每人定义不同额度, [[账号1,额度1],[账号2,额度2],...]
* 由于上述两个列表可能很大,所以操作设置了KB费
* 如果借款人超过约定借款时长还没有还款,抵押资产自动全额划转给贷款人,借款人无需再还款
* 只能从已激活的池(要约)借款。“自动下架时间”表示到这个时间后,池(要约)自动变更为“未激活”状态。
* 贷款人应该根据市场行情及时调整抵押物折算价、借款时长、自动下架时间等参数(使用修改操作,另述)。
* 自动下架时间,是为了应对有时贷款人来不及调整参数的保守设置。

比如:

abit-test 新建P2P贷款要约,初始注资金额 1000 TEST,费率 万分之一,最长借款时长1天(86400秒),每笔最低借款20 TEST,立即激活,自动下架时间 2021年11月30号0点整,接受抵押物清单 [ CONTEST.BTC, CONTEST.USD1] , 价格分别为 100 TEST : 0.04 CONTEST.BTC, 1 TEST : 3 CONTEST.USD ,接受借款人清单 [ committee-account 额度 50 TEST, init0 额度 80 TEST ]。

注:由于有KB费存在,无法预估手续费,故采用交易构建器( transaction builder )来构造交易

begin_builder_transaction
(假设返回值为 0 )
add_operation_to_builder_transaction 0 [69,{"owner_account": "1.2.3833", "asset_type": "1.3.0", "balance": "100000000", "fee_rate": 100, "max_duration_seconds":86400, "min_deal_amount":2000000, "enabled":true, "auto_disable_time":"2021-11-30T0:00:00", "acceptable_collateral":[["1.3.1515",{"base":{"asset_id":"1.3.0","amount":10000000},"quote":{"asset_id":"1.3.1515","amount":4000000}}],["1.3.1516",{"base":{"asset_id":"1.3.0","amount":100000},"quote":{"asset_id":"1.3.1516","amount":3000}}]], "acceptable_borrowers":[["1.2.0", 5000000],["1.2.6",8000000]] }]
set_fees_on_builder_transaction 0 1.3.0
sign_builder_transaction 0 true

其中,
* TEST 资产精度是5位小数, 1000 TEST 等于 100000000 聪,所以金额 balance 填 100000000
* 万分之一 等于 百万分之100,所以费率 fee_rate 填 100
* CONTEST.BTC 的 id 是 1.3.1515 ,精度8位小数; CONTEST.USD1 的 id 是 1.3.1516 ,精度3位小数
* committee-account 是 1.2.0 , init0 是 1.2.6

1.1 检查操作结果

可以用 get_account_history 命令查看帐户操作历史,比如
Code: [Select]
get_account_history abit-test 10

结果示例
Quote
51517585 2021-11-08T18:21:12 credit_offer_create_operation abit-test   (Fee: 1.10156 TEST)   result: 1.21.0

格式为:块号 时间 操作 帐号 手续费 结果

上述结果 1.21.0 即贷款要约 ID ,可以通过 get_object 命令查看
Code: [Select]
>>> get_object 1.21.0
[{
    "id": "1.21.0",
    "owner_account": "1.2.3833",
    "asset_type": "1.3.0",
    "total_balance": 100000000,
    "current_balance": 100000000,
    "fee_rate": 100,
    "max_duration_seconds": 86400,
    "min_deal_amount": 2000000,
    "enabled": true,
    "auto_disable_time": "2021-11-30T00:00:00",
    "acceptable_collateral": [[
        "1.3.1515",{
          "base": {
            "amount": 10000000,
            "asset_id": "1.3.0"
          },
          "quote": {
            "amount": 4000000,
            "asset_id": "1.3.1515"
          }
        }
      ],[
        "1.3.1516",{
          "base": {
            "amount": 100000,
            "asset_id": "1.3.0"
          },
          "quote": {
            "amount": 3000,
            "asset_id": "1.3.1516"
          }
        }
      ]
    ],
    "acceptable_borrowers": [[
        "1.2.0",
        5000000
      ],[
        "1.2.6",
        8000000
      ]
    ]
  }
]

结果与创建交易内容相同。
* "total_balance" 要约总金额
* "current_balance": 要约的当前可用金额


2. 撤回贷款要约(删池)

op name: credit_offer_delete_operation
op code: 70

参数
Code: [Select]
fee                     手续费,测试网默认手续费 0 ,也就是免费
owner_account           账号,格式 1.2.x
offer_id                要约 ID ,格式 1.21.x

注:
* 只有要约发起人才可以撤回要约,撤回后要约锁定资金返回账户余额
* 如果要约已被接受,尚未还清或者过期清算,则不可撤回

比如:

abit-test 删除 1.21.0

sign_transaction { "operations": [[70,{ "fee": { "amount": 0, "asset_id": "1.3.0" }, "owner_account": "1.2.3833", "offer_id": "1.21.0"}]] } true

2.1 检查操作结果

可以用 get_account_history 命令查看帐户操作历史,比如
Code: [Select]
get_account_history abit-test 10

结果示例
Quote
51517968 2021-11-08T18:40:48 credit_offer_delete_operation abit-test   (Fee: 0 TEST)   result: 1000 TEST

格式为:块号 时间 操作 帐号 手续费 结果

结果里 1000 TEST ,表示返回 1000 TEST 到账户余额


3. 修改贷款要约

op name: credit_offer_update_operation
op code: 71

参数
Code: [Select]
fee                     手续费,测试网默认手续费 1 TEST 基本手续费 + 交易大小费每 KB 加 1 BTS  (类似转账 MEMO 费)
owner_account           账号,格式 1.2.x
offer_id                要约 ID ,格式 1.21.x
delta_amount            变化金额,可选(不填表示不变),标准金额格式(数量+币种),数量为正为增资,为负为撤资
fee_rate                新的借款费率,可选(不填表示不变),整数表示,单位是百万分之一
max_duration_seconds    新的借款时长,可选(不填表示不变),单位是秒
min_deal_amount         新的最低借款金额(每笔),可选(不填表示不变),单位是聪
enabled                 是否激活,可选(不填表示不变),可为 true 或者 false
auto_disable_time       新的自动下架时间,可选(不填表示不变),格式如 "2021-11-30T0:00:00"
acceptable_collateral   新的接受的抵押物列表及各抵押物折算价,可选(不填表示不变),二维数组格式
acceptable_borrowers    新的接受的借款人列表及各人最大借款额度,可选(不填表示不变),二维数组格式

比如:

abit-test 修改要约 1.21.1,注资20 TEST,借款时长调整为5分钟(300秒),借款人增加 xbt ,借款额度 60 TEST ,其他不变

注:由于有KB费存在,无法预估手续费,故采用交易构建器( transaction builder )来构造交易

begin_builder_transaction
(假设返回值为 0 )
add_operation_to_builder_transaction 0 [71,{ "owner_account": "1.2.3833", "offer_id": "1.21.1", "delta_amount": {"asset_id":"1.3.0","amount":"2000000"}, "max_duration_seconds":300, "acceptable_borrowers":[["1.2.0", 5000000],["1.2.6",8000000],["1.2.25530",6000000]]}]
set_fees_on_builder_transaction 0 1.3.0
sign_builder_transaction 0 true

其中,
* TEST 资产精度是5位小数, 20 TEST 等于 2000000 聪,所以金额 delta_amount 填 2000000
* xbt 账号id是 1.2.25530

3.1 检查操作结果

可以用 get_account_history 命令查看帐户操作历史,比如
Code: [Select]
get_account_history abit-test 10

结果示例
Quote
51518361 2021-11-08T19:01:12 credit_offer_update_operation abit-test   (Fee: 1.06250 TEST)

格式为:块号 时间 操作 帐号 手续费

表示操作成功

通过 get_object 命令查看数据
Code: [Select]
>>> get_object 1.21.1
[{
    "id": "1.21.1",
    "owner_account": "1.2.3833",
    "asset_type": "1.3.0",
    "total_balance": 102000000,
    "current_balance": 102000000,
    "fee_rate": 100,
    "max_duration_seconds": 300,
    "min_deal_amount": 2000000,
    "enabled": true,
    "auto_disable_time": "2021-11-30T00:00:00",
    "acceptable_collateral": [[
        "1.3.1515",{
          "base": {
            "amount": 10000000,
            "asset_id": "1.3.0"
          },
          "quote": {
            "amount": 4000000,
            "asset_id": "1.3.1515"
          }
        }
      ],[
        "1.3.1516",{
          "base": {
            "amount": 100000,
            "asset_id": "1.3.0"
          },
          "quote": {
            "amount": 3000,
            "asset_id": "1.3.1516"
          }
        }
      ]
    ],
    "acceptable_borrowers": [[
        "1.2.0",
        5000000
      ],[
        "1.2.6",
        8000000
      ],[
        "1.2.25530",
        6000000
      ]
    ]
  }
]

可见要约已修改成功。


4. 接受贷款要约(借款)

op name: credit_offer_accept_operation
op code: 72

参数
Code: [Select]
fee                   手续费,测试网默认手续费 1 TEST
borrower              借款人,格式 1.2.x
offer_id              要约 ID ,格式 1.21.x
borrow_amount         借款金额,标准金额格式(数量+币种)
collateral            抵押品,标准金额格式(数量+币种)
max_fee_rate          可接收的最高费率,单位是百万分之一
min_duration_seconds  可接受的最低借款时长,单位是秒

注:
* 借款时需指定“可接收的最高费率”和“可接受的最低借款时长”,可防止贷款人在要约被接受前突然修改贷款要约参数,降低借款人风险
* 借款成功后,会生成一个借款合约,之后如果贷款要约修改,不影响已存在的借款合约

比如:

xbt 接受要约 1.21.1 ,借款 30 TEST ,抵押品 0.012 CONTEST.BTC ,可接受最高费率 百万分之2,可接受最短借款时长 300秒。

sign_transaction { "operations": [[72, {"fee": { "amount": 100000, "asset_id": "1.3.0" },"borrower":"1.2.25530","offer_id":"1.21.1","borrow_amount":{"asset_id":"1.3.0","amount":3000000}, "collateral":{"asset_id":"1.3.1515","amount":"1200000"}, "max_fee_rate":200, "min_duration_seconds":300}]]} true

其中,
* xbt 账号id是 1.2.25530
* TEST 资产精度是5位小数, 30 TEST 等于 3000000 聪,所以借款金额填 3000000
* CONTEST.BTC id是1.3.1515,精度8位小数

4.1 检查操作结果

可以用 get_account_history 命令查看帐户操作历史,比如
Code: [Select]
get_account_history abit-test 10
get_account_history xbt 10

结果示例
Quote
51518802 2021-11-08T19:23:51 credit_offer_accept_operation xbt   (Fee: 1 TEST)   result: {"impacted_accounts":["1.2.3833"],"new_objects":["1.22.0"]}

格式为:块号 时间 操作 帐号 手续费 操作结果

操作结果中,
* impacted_accounts 里是贷款人
* new_objects 里是借款合约id

通过 get_object 命令查看贷款要约数据

Code: [Select]
>>> get_object 1.21.1                                                                                                                                         
[{
    "id": "1.21.1",
    "owner_account": "1.2.3833",
    "asset_type": "1.3.0",
    "total_balance": 102000000,
    "current_balance": 99000000,
    ...

可见 贷款合约的当前余额降低

通过 get_object 命令查看 借款合约数据

Code: [Select]
>>> get_object 1.22.0                                                                                                                                         [{
    "id": "1.22.0",
    "borrower": "1.2.25530",
    "offer_id": "1.21.1",
    "offer_owner": "1.2.3833",
    "debt_asset": "1.3.0",
    "debt_amount": 3000000,
    "collateral_asset": "1.3.1515",
    "collateral_amount": 1200000,
    "fee_rate": 100,
    "latest_repay_time": "2021-11-08T19:28:51"
  }
]

其中,
* id 是借款合约 id
* borrower 借款人账号
* offer_id 贷款要约id
* offer_owner 贷款人账号
* debt_asset 借款资产类型(币种)
* debt_amount 借款金额,单位是聪
* collateral_asset 抵押品资产类型(币种)
* collateral_amount 抵押品金额,单位是聪
* fee_rate 费率,单位百万分之一
* last_repay_time 还款期限

另可通过 list_account_balances 命令查看账户余额变化。


5. 还款

op name: credit_deal_repay_operation
op code: 73

参数
Code: [Select]
fee                   手续费,测试网默认手续费 1 TEST
account              还款人,格式 1.2.x
deal_id               借款合约 ID ,格式 1.22.x
repay_amount         还款金额,标准金额格式(数量+币种)
credit_fee            支付借款费用,标准金额格式(数量+币种)

注:
* 只有借款人才可还款
* 费用为额外支付,必须不低于借款合约里约定的费率
* 可部分还款,部分还款时按比例退回部分抵押品
* 全额还款则退回全部抵押品

比如:

xbt 为借款合约 1.22.2 还款 10 TEST,费用 0.001 TEST 。

sign_transaction { "operations": [[73, {"fee": { "amount": 100000, "asset_id": "1.3.0" },"account":"1.2.25530","deal_id":"1.22.2","repay_amount":{"asset_id":"1.3.0","amount":1000000}, "credit_fee":{"asset_id":"1.3.0","amount":"100"}}]]} true

其中,
* xbt 账号id是 1.2.25530
* TEST 资产精度是5位小数,所以还款金额 10 TEST 填 1000000 , 费用 0.001 TEST 填 100

5.1 检查操作结果

可以用 get_account_history 命令查看帐户操作历史,比如
Code: [Select]
get_account_history abit-test 10
get_account_history xbt 10

结果示例
Quote
51520181 2021-11-08T20:34:54 credit_deal_repay_operation xbt   (Fee: 1 TEST)   result: {"impacted_accounts":["1.2.3833"],"updated_objects":["1.21.1"],"removed_objects":["1.22.3"],"received":[{"amount":1200000,"asset_id":"1.3.1515"}]}
51519428 2021-11-08T19:56:12 credit_deal_repay_operation xbt   (Fee: 1 TEST)   result: {"impacted_accounts":["1.2.3833"],"updated_objects":["1.21.1","1.22.2"],"received":[{"amount":400000,"asset_id":"1.3.1515"}]}

格式为:块号 时间 操作 帐号 手续费 操作结果

操作结果中,
* impacted_accounts 里是贷款人
* 如果部分还款, updated_objects 里是贷款要约id和借款合约id,如果全额还款,借款合约id在 removed_objects 里
* received 是返还的抵押品数量

通过 get_object 命令查看贷款要约数据 和 借款合约数据,可见相应余额变化。此处略。

另可通过 list_account_balances 命令查看账户余额变化。


6. 逾期

如果逾期未还款,抵押品自动全额划转给贷款人,借款人无需再还款。借款合约自动解除。
双方账户历史中都会记录一笔类型为 credit_deal_expired_operation 的虚拟操作, op code = 74 。

可以用 get_account_history 命令查看帐户历史,比如
Code: [Select]
get_account_history abit-test 10
get_account_history xbt 10

结果示例
Code: [Select]
51519008 2021-11-08T19:34:27 credit_deal_expired_operation xbt   (Fee: 0 TEST)

cli_wallet 中目前无法快速查看该操作详情。通过其他方式找到该条目 id 后,可查到其具体内容为
Code: [Select]
>>> get_object 1.11.84564441
[{
    "id": "1.11.84564441",
    "op": [
      74,{
        "fee": {
          "amount": 0,
          "asset_id": "1.3.0"
        },
        "deal_id": "1.22.1",
        "offer_id": "1.21.1",
        "offer_owner": "1.2.3833",
        "borrower": "1.2.25530",
        "unpaid_amount": {
          "amount": 3000000,
          "asset_id": "1.3.0"
        },
        "collateral": {
          "amount": 1200000,
          "asset_id": "1.3.1515"
        },
        "fee_rate": 100
      }
    ],
    "result": [
      0,{}
    ],
    "block_num": 51519008,
    "trx_in_block": 5,
    "op_in_trx": 0,
    "virtual_op": 0
  }
]

其中,
* "deal_id" 借款合约 id
* "offer_id" 贷款要约 id
* "offer_owner" 贷款人
* "borrower" 借款人
* "unpaid_amount" 逾期金额及币种
* "collateral" 被抵扣的抵押品金额及币种
* "fee_rate" 借款合约约定费率


7. 批量查询 API

查贷款要约
* 查所有贷款要约   list_credit_offers( limit, start_id )
* 按贷款人查贷款要约   get_credit_offers_by_owner( account_name_or_id, limit, start_id )
* 按资产类型查贷款要约   get_credit_offers_by_asset( asset_symbol_or_id, limit, start_id )

查借款合约
* 查所有借款合约   list_credit_deals( limit, start_id )
* 按贷款要约查借款合约   get_credit_deals_by_offer_id( offer_id, limit, start_id )
* 按贷款人查借款合约   get_credit_deals_by_offer_owner( account_name_or_id, limit, start_id )
* 按借款人查借款合约   get_credit_deals_by_offer_borrower( account_name_or_id, limit, start_id )
* 按资产类型查借款合约   get_credit_deals_by_debt_asset( asset_symbol_or_id, limit, start_id )
* 按抵押品类型查借款合约   get_credit_deals_by_collateral_asset( asset_symbol_or_id, limit, start_id )

Pages: 1 2 3 4 [5] 6 7 8 9 10 11 12 ... 309