diff --git a/Gemfile.lock b/Gemfile.lock index 1ee3c0c..a95c9ed 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - domeapi (0.0.2) + domeapi (0.0.3) dry-cli dry-configurable dry-container @@ -212,7 +212,7 @@ CHECKSUMS declarative (0.0.20) sha256=8021dd6cb17ab2b61233c56903d3f5a259c5cf43c80ff332d447d395b17d9ff9 disposable (0.6.3) sha256=7f2a3fb251bff6cd83f25b164043d4ec3531209b51b066ed476a9df9c2d384cc docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e - domeapi (0.0.2) + domeapi (0.0.3) dry-cli (1.3.0) sha256=984a715f9d7f8d9bf87b6530acdd4321dcf747636bfeb3ea7fd1b81bc0226e84 dry-configurable (1.3.0) sha256=882d862858567fc1210d2549d4c090f34370fc1bb7c5c1933de3fe792e18afa8 dry-container (0.11.0) sha256=23be9381644d47343f3bf13b082b4255994ada0bfd88e0737eaaadc99d035229 diff --git a/Readme.adoc b/Readme.adoc index 2077216..bb14edb 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -47,6 +47,8 @@ Access Polymarket endpoints via the `polymarket` namespace. ==== Markets +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-markets) + List markets with optional filtering: [source,ruby] @@ -55,14 +57,7 @@ List markets with optional filtering: markets = client.polymarket.markets.list # List markets with custom filter -filter = Rubyists::Domeapi::Polymarket::MarketFilter.new( - Rubyists::Domeapi::Polymarket::MarketFilter::Properties.new( - limit: 10, - offset: 0, - status: 'open' - ) -) -markets = client.polymarket.markets.list(filter) +markets = client.polymarket.markets.list(limit: 10, offset: 0, status: 'open') ---- Get market price: @@ -72,50 +67,104 @@ Get market price: price = client.polymarket.markets.price(token_id: 'token_id') ---- +==== Candlesticks + +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-candlesticks) + Get candlesticks: [source,ruby] ---- -filter = Rubyists::Domeapi::Polymarket::Candlesticks::Filter.new( - Rubyists::Domeapi::Polymarket::Candlesticks::Filter::Properties.new( - condition_id: 'condition_id', - start_time: 1625097600, - end_time: 1625184000, - interval: 60 - ) +candlesticks = client.polymarket.candlesticks.list( + condition_id: 'condition_id', + start_time: 1625097600, + end_time: 1625184000, + interval: 60 ) -candlesticks = client.polymarket.candlesticks.list(filter) ---- ==== Trade History +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-trade-history) + Get trade history: [source,ruby] ---- -filter = Rubyists::Domeapi::Polymarket::TradeHistory::Filter.new( - Rubyists::Domeapi::Polymarket::TradeHistory::Filter::Properties.new( - market_slug: 'market_slug', - limit: 10 - ) +trades = client.polymarket.trade_history.list( + market_slug: 'market_slug', + limit: 10 ) -trades = client.polymarket.trade_history.list(filter) ---- ==== Orderbook +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-orderbook-history) + Get orderbook history: [source,ruby] ---- -filter = Rubyists::Domeapi::Polymarket::Orderbook::Filter.new( - Rubyists::Domeapi::Polymarket::Orderbook::Filter::Properties.new( - token_id: 'token_id', - start_time: 1625097600000, - end_time: 1625184000000 - ) +snapshots = client.polymarket.orderbook.list( + token_id: 'token_id', + start_time: 1625097600000, + end_time: 1625184000000 +) +---- + +==== Activity + +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-activity) + +Get activity: + +[source,ruby] +---- +activity = client.polymarket.activity.list( + user: '0x...', + limit: 10 +) +---- + +==== Market Price + +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-market-price) + +Get market price history: + +[source,ruby] +---- +prices = client.polymarket.market_price.list( + token_id: 'token_id', + at_time: 1625097600 +) +---- + +==== Wallet + +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-wallet) + +Get wallet information: + +[source,ruby] +---- +wallet = client.polymarket.wallet.list( + eoa: '0x...' +) +---- + +==== Wallet Profit and Loss + +[API Reference](https://docs.domeapi.io/api-reference/endpoint/get-wallet-pnl) + +Get wallet profit and loss: + +[source,ruby] +---- +pnl = client.polymarket.wallet_profit_and_loss.list( + wallet_address: '0x...', + granularity: 'day' ) -snapshots = client.polymarket.orderbook.list(filter) ---- == Development