(self, address: str, amountString: str, currency: Currency, account: dict, params={})
| 2410 | return settlement |
| 2411 | |
| 2412 | def create_withdrawal_settlement_data(self, address: str, amountString: str, currency: Currency, account: dict, params={}): |
| 2413 | now = self.milliseconds() |
| 2414 | settlementExpiration = self.safe_integer(params, 'settlementExpiration', self.parse_to_int((now + 999) / 1000) + 1209600 + 60) |
| 2415 | nonce = self.safe_integer(params, 'nonce', self.nonce()) |
| 2416 | positionId = self.safe_string_2(params, 'positionId', 'l2Vault', self.safe_string(account, 'l2Vault')) |
| 2417 | recipient = self.safe_string(params, 'recipient', address) |
| 2418 | currencyInfo = self.safe_dict(currency, 'info', {}) |
| 2419 | collateralId = self.safe_string(params, 'collateralId', self.safe_string_2(currencyInfo, 'starkexId', 'l1Id')) |
| 2420 | resolution = self.safe_integer(params, 'resolution', self.safe_value_2(currencyInfo, 'starkexResolution', 'l1Resolution')) |
| 2421 | starkKey = self.safe_string(account, 'l2Key') |
| 2422 | if (positionId is None) or (collateralId is None) or (resolution is None) or (starkKey is None): |
| 2423 | raise BadRequest(self.id + ' withdraw() requires currency starkexId/starkexResolution, account l2Vault and account l2Key') |
| 2424 | amount = self.get_extended_stark_amount(amountString, resolution) |
| 2425 | settlement = { |
| 2426 | 'recipient': recipient, |
| 2427 | 'positionId': positionId, |
| 2428 | 'collateralId': collateralId, |
| 2429 | 'amount': amount, |
| 2430 | 'expiration': { |
| 2431 | 'seconds': settlementExpiration, |
| 2432 | }, |
| 2433 | 'salt': nonce, |
| 2434 | } |
| 2435 | msgHash = self.get_extended_withdrawal_msg_hash(settlement, starkKey) |
| 2436 | sig = json.loads(self.extended_starknet_sign(msgHash, self.privateKey)) |
| 2437 | settlement['signature'] = { |
| 2438 | 'r': self.get_extended_signature_hex(sig[0]), |
| 2439 | 's': self.get_extended_signature_hex(sig[1]), |
| 2440 | } |
| 2441 | return settlement |
| 2442 | |
| 2443 | def create_transfer_settlement_data(self, amountString: str, currency: Currency, account: dict, toVault: str, toL2Key: str, params={}): |
| 2444 | now = self.milliseconds() |
no test coverage detected