beam
beam copied to clipboard
Make a restriction for the "offer_expires" parameter
Feature title restriction for the "offer_expires" parameter
Describe the current situation we have if you enter a large value, the offer is not published, we get an error "Offer lifetime exceeded"
Describe the solution you'd like The GUI Atomic Swaps supports 5 offer lifetime timeframes: 30min, 1 hour, 2 hours, 6 hours, 12 hours. So the CLI command should also only accept those timeframes.
If a bigger value than accepted is returned, reply with list of accepted timeframes.
Additional context
I make a request to create an offer by specifying 10000000 in offer_expires parameter
{ "jsonrpc": "2.0", "id": 127, "method": "swap_create_offer", "params": { "send_amount": 702511, "send_currency": "btc", "receive_amount": 20000000, "receive_currency": "beam", "fee_rate": 100000, "offer_expires": 10000000, "comment": "API" } }
Make a request for publication ofeer , I get an error - "Offer lifetime exceeded"
https://github.com/BeamMW/beam/wiki/Beam-wallet-protocol-SWAP-API-(BETA)#swap_create_offer