质押资金池建立好后,以下是一些常用的查询和操作命令:
1.查询用户 User1 在资金池里的总金额
near view my_validator get_account_total_balance '{"account_id": "user1"}'
2.查询用户 User1 在资金池里质押的金额
near view my_validator get_account_staked_balance '{"account_id": "user1"}'
3.查询用户 User1 在资金池里未质押的金额
near view my_validator get_account_unstaked_balance '{"account_id": "user1"}'
4.查询用户 user1 是否立即提币
near view my_validator is_account_unstaked_balance_available '{"account_id": "user1"}'
5.查询整个资金池质押的币数
near view my_validator get_total_staked_balance '{}'
6.查询质押资金池的拥有者
near view my_validator get_owner_id '{}'
如果想取出质押资金池的币,先取消质押:
near call my_validator unstake'{"amount": "100000000000000000000000000"}'--accountId user1
然后3 个 epoch 之后,再提币:
near call my_validator withdraw'{"amount": "100000000000000000000000000"}'--accountId user1