beam icon indicating copy to clipboard operation
beam copied to clipboard

Make a restriction for the "offer_expires" parameter

Open Roberrtt opened this issue 2 years ago • 0 comments

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"

grafik https://github.com/BeamMW/beam/wiki/Beam-wallet-protocol-SWAP-API-(BETA)#swap_create_offer

Roberrtt avatar Dec 02 '21 12:12 Roberrtt