Skip to content

Commit f41bd77

Browse files
committed
Bid Collateral Operation
1 parent 54dcfbf commit f41bd77

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

bitshares/bitshares.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,3 +1612,32 @@ def account_whitelist(
16121612
"new_listing": l,
16131613
})
16141614
return self.finalizeOp(op, account, "active", **kwargs)
1615+
1616+
def bid_collateral(
1617+
self,
1618+
additional_collateral,
1619+
debt_covered,
1620+
account=None,
1621+
**kwargs
1622+
):
1623+
if not account:
1624+
if "default_account" in self.config:
1625+
account = self.config["default_account"]
1626+
if not account:
1627+
raise ValueError("You need to provide an account")
1628+
account = Account(account, blockchain_instance=self)
1629+
1630+
if not isinstance(additional_collateral, (Amount)):
1631+
raise ValueError('additional_collateral must be of type Amount')
1632+
1633+
if not isinstance(debt_covered, (Amount)):
1634+
raise ValueError('debt_covered must be of type Amount')
1635+
1636+
op = operations.Bid_collateral(**{
1637+
"fee": {"amount": 0, "asset_id": "1.3.0"},
1638+
"bidder": account["id"],
1639+
"additional_collateral": additional_collateral.json(),
1640+
"debt_covered": debt_covered.json(),
1641+
"extensions": []
1642+
})
1643+
return self.finalizeOp(op, account, "active", **kwargs)

0 commit comments

Comments
 (0)