Skip to content

Commit 5e381b8

Browse files
authored
Merge pull request #77 from haofengjiang/main
mpc release satoshis
2 parents 2ad8111 + 6cd78ee commit 5e381b8

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

cobo_custody/client/mpc_client.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ def generate_addresses(self, chain_code: str, count: int) -> ApiResponse:
120120
}
121121
return self.request("POST", "/v1/custody/mpc/generate_addresses/", params)
122122

123+
def generate_address_memo(self, chain_code: str, address: str, count: int) -> ApiResponse:
124+
params = {
125+
"chain_code": chain_code,
126+
"address": address,
127+
"count": count,
128+
}
129+
return self.request("POST", "/v1/custody/mpc/generate_address_memo/", params)
130+
123131
def update_address_description(self, coin: str, address: str, description: str) -> ApiResponse:
124132
params = {
125133
"coin": coin,
@@ -168,7 +176,7 @@ def create_transaction(self, coin: str, request_id: str, amount: str, from_addr:
168176
gas_price: int = None, gas_limit: int = None, operation: int = None,
169177
extra_parameters: str = None, max_fee: int = None,
170178
max_priority_fee: int = None, fee_amount: int = None, remark: str = None,
171-
auto_fuel: int = 0) -> ApiResponse:
179+
auto_fuel: int = 0, memo: str = "") -> ApiResponse:
172180
params = {
173181
"coin": coin,
174182
"request_id": request_id,
@@ -186,6 +194,7 @@ def create_transaction(self, coin: str, request_id: str, amount: str, from_addr:
186194
"fee_amount": fee_amount,
187195
"remark": remark,
188196
"auto_fuel": auto_fuel,
197+
"memo": memo,
189198
}
190199
return self.request("POST", "/v1/custody/mpc/create_transaction/", params)
191200

@@ -289,3 +298,15 @@ def get_max_send_amount(self, coin: str, fee_rate: float, to_address: str, from_
289298
if from_address:
290299
params["from_address"] = from_address
291300
return self.request("GET", "/v1/custody/mpc/get_max_send_amount/", params)
301+
302+
def lock_spendable(self, coin: str, tx_hash: str, vout_n: int):
303+
params = {"coin": coin, "tx_hash": tx_hash, "vout_n": vout_n}
304+
return self.request("POST", "/v1/custody/mpc/lock_spendable/", params)
305+
306+
def unlock_spendable(self, coin: str, tx_hash: str, vout_n: int):
307+
params = {"coin": coin, "tx_hash": tx_hash, "vout_n": vout_n}
308+
return self.request("POST", "/v1/custody/mpc/unlock_spendable/", params)
309+
310+
def get_rare_satoshis(self, coin: str, tx_hash: str, vout_n: int):
311+
params = {"coin": coin, "tx_hash": tx_hash, "vout_n": vout_n}
312+
return self.request("GET", "/v1/custody/mpc/get_rare_satoshis/", params)

0 commit comments

Comments
 (0)