{"_id":"@airswap/market","_rev":"5-6b73da764be91d7ace29dfece70ac861","name":"@airswap/market","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@airswap/market","version":"0.1.0","description":"Manages a list of intents to trade a specific token pair in the Swap Protocol","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/airswap/airswap-protocols.git"},"scripts":{"clean":"rm -rf ./build","compile":"truffle compile","coverage":"solidity-coverage","truffle":"truffle --network development","test":"truffle test"},"devDependencies":{"@airswap/order-utils":"0.1.0","@airswap/test-utils":"0.1.0","@airswap/tokens":"0.1.0","truffle":"^5.0.24","bignumber.js":"^9.0.0"},"dependencies":{"openzeppelin-solidity":"^v2.2","solidity-coverage":"^0.6.3"},"bugs":{"url":"https://github.com/airswap/airswap-protocols/issues"},"homepage":"https://github.com/airswap/airswap-protocols#readme","_id":"@airswap/market@0.1.0","_nodeVersion":"10.16.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-TYIfEkOGo/2J7OnrvvCsLs3FokYlVxwhwv3oEAzblq/PlBmf7V9z0NKi8DKPsy83yXhAVhAW5Aen6pnr5baY1Q==","shasum":"1bdc785b8ce2190141bc2a0e1e9076c3a20688c8","tarball":"https://registry.npmjs.org/@airswap/market/-/market-0.1.0.tgz","fileCount":10,"unpackedSize":42754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdTbh6CRA9TVsSAnZWagAAtOYP/1ffiaT1gBT2KabG85ho\nY/dK9jXM9BWlo9RWCvl1WxVLGGbhOIGJNKgcTLDDsYcwTQavaZCFvOaGclGl\nIihqYxRkgoqoy57HZa6H4NuMyPD4HWSB6jTMNSrDWFkNczyUoSXW/azbehZB\ni+Y2/Xy/P82PfBZ/Fktdi2e/0yBEr1RVWLUTcZwhFt4fak39K0OMK4CMfFYC\nVirl0lawcSHZGd2oATavlGg7AvftkPA/n7hOZcWW1uooiDuF5dERumoJbNnX\nt3xDpW1js6grW8PxJgqGf1u7aUSghhIZXe4hJxdVYflT8bnOuAycWSx28Zbk\nrdfDRMV25jE7PTXE2J9RcauDF9/chBEQ47o0AcAhbsIdyUNEOvhpiEjIokWU\nziukJFGp8xqlL9MW7Qov51sYb/Mp7L0ipSljUyCcomNLy1lUE3z0aPRyENe/\nAprg4b5mYugi6kFjJYR74m0P4HxR0bgWMyxNLnvQxnBoXYCXbh9u86hQaodu\n4nqi6lw19XZbgGBL6dtfRvsgY5m3LSrDTcGAuicRtUsiEHVjEVWVVxsKA5XO\naUji5W/tC9i2w1+64AmRb6OeC9jmvpl4+Ti0fdWO2bAV5WpRfLJEfr8EW1kd\nDD30U08yrHMg+c6WUoQopiGWBK0ubD5TJzdolm+0kxsmBzZ6EaE74oaYntVS\nA16O\r\n=d755\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtg4xF7BuEV1RqH+/Wx+e/4UA9l3O00btZ0tnPiEdqyAIgDXblek2IAgm4xRcQxY3TF34Uo8idFus92EZSBrUgKOM="}]},"maintainers":[{"name":"airswap","email":"opensource@airswap.io"}],"_npmUser":{"name":"airswap","email":"opensource@airswap.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/market_0.1.0_1565374586060_0.526237950577527"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated in favor of @airswap/index"},"0.2.0":{"name":"@airswap/market","version":"0.2.0","description":"Manages a list of intents to trade a specific token pair in the Swap Protocol","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/airswap/airswap-protocols.git"},"scripts":{"clean":"rm -rf ./build","compile":"truffle compile","coverage":"solidity-coverage","truffle":"truffle --network development","test":"truffle test"},"devDependencies":{"@airswap/order-utils":"0.3.0","@airswap/test-utils":"0.1.0","@airswap/tokens":"0.1.0","truffle":"^5.0.24","bignumber.js":"^9.0.0"},"dependencies":{"openzeppelin-solidity":"^v2.2","solidity-coverage":"^0.6.3"},"bugs":{"url":"https://github.com/airswap/airswap-protocols/issues"},"homepage":"https://github.com/airswap/airswap-protocols#readme","_id":"@airswap/market@0.2.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Hh/pYIKOehMwcTA0NprfB6fI1ETuCwvQxuGsM7xJnpH2wn/tWCRQFi7N6ekJPe5QDtjXCq9eQh//a0ZZMqPJhw==","shasum":"0a0a4b177f7bb902a4012c471b05c5d176272783","tarball":"https://registry.npmjs.org/@airswap/market/-/market-0.2.0.tgz","fileCount":10,"unpackedSize":29851,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZ+fkCRA9TVsSAnZWagAA2w8P+wf3QioKgVBd879x+VsZ\ndrRbmExxyUBAxb9igeJfk3D0FKpHTVvwFqOhhJmOp3FOMmVRLmv3l7fwryY2\nuOmwn4XVR04Qxx6uSfm2RHn92BJo0q97D3dd2ZFK4m9aRHR0hUWULSzvnJnS\nphWK48RNsCVOLemVR+uu38cyOcO3uzdyNo4V2LJzEAZ7uRAuNMP+q9PbIxHs\np2WGDfKHmJwVquYnR2i1rDT0nOOUhTJkEM6CCdykyGADrTyTo15UMHMNyzp8\nYxES5Y87ZIs0IbU6TBkTwCbpURXIZD6B/aaUPgklpPeNYwehgNuyc6uDFUSZ\nAFIUcpekhjH3izBs57k9eOtRk3ENox4+jHE5Ld/D6fiH4X6ob2i8oOGBdplc\n2vEzYRhG+8C23M07CVGLcnQNQsGZlOglgjlnGxmyxbU3DbFEcUjzDGqoYPTf\nlBokEmPh2tMq5jWT0ZMIcRoB944o9C6RrLvhlye72jylh3Jxx/NBB5n2mmwG\nKJjVY61LMr7YwYjmLfBGe/98dUApcxxCOhlRY+jBZCrDmfKDkID+2M8DzhFm\nwk2mwKAm8F5XrtY3A/MajBQulRNClft0qENT5SpDq2CxNNyRwBy02kME8VEd\nEuOX5D3Vy/XcstZDK+dI808eNcGQoScz1AOq/hbh0iDon3fUvSilX4eTVNFi\nVkNm\r\n=iuTt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD20dyslbkADrBxcxD4nX0ZTYSf9kb0xcGxjyrZG0VMQgIhAISXG4or2ibhEWytprauKdml8X/d42ofqrJEye/U5621"}]},"maintainers":[{"name":"airswap","email":"opensource@airswap.io"}],"_npmUser":{"name":"airswap","email":"opensource@airswap.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/market_0.2.0_1567090659890_0.6182640080337647"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated in favor of @airswap/index"}},"time":{"created":"2019-08-09T18:16:26.059Z","0.1.0":"2019-08-09T18:16:26.181Z","modified":"2022-04-04T12:23:20.938Z","0.2.0":"2019-08-29T14:57:40.030Z"},"maintainers":[{"email":"npm@npmjs.com","name":"npm"}],"description":"Manages a list of intents to trade a specific token pair in the Swap Protocol","homepage":"https://github.com/airswap/airswap-protocols#readme","repository":{"type":"git","url":"git+https://github.com/airswap/airswap-protocols.git"},"bugs":{"url":"https://github.com/airswap/airswap-protocols/issues"},"license":"Apache-2.0","readme":"# Market\n\n**:warning: This package is under active development. Do not use in production.**\n\n[AirSwap](https://www.airswap.io/) is a peer-to-peer trading network for Ethereum tokens. This package contains source code and tests for a `Market` that represents a list of intents to trade.\n\n[![Discord](https://img.shields.io/discord/590643190281928738.svg)](https://discord.gg/ecQbV7H)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## Features\n\n### Sorting\n\nIntents are sorted by their amount, with the largest amount at the beginning of the list. Currently the staking amount is indicated by an Indexer that owns the Market.\n\n## Definitions\n\n| Term    | Definition                                                              |\n| :------ | :---------------------------------------------------------------------- |\n| Intent  | An interest in trading a specific token pair without price information. |\n| Market  | A list of intents to trade for a token pair.                            |\n| Locator | How a peer can be reached to communicate pricing.                       |\n\n## Intent Struct\n\nAn \"intent to trade\" is represented by the following `Intent` struct.\n\n```\nstruct Intent {\n  address staker;\n  uint256 amount;\n  address locator;\n}\n```\n\n## Constructor\n\nCreate a new `Market` contract. Usually called within the context of an `Indexer` contract.\n\n```Solidity\nconstructor(\n  address _makerToken,\n  address _takerToken\n) public\n```\n\n### Params\n\n| Name          | Type      | Description                                              |\n| :------------ | :-------- | :------------------------------------------------------- |\n| `_makerToken` | `address` | Address of the token that the Maker is intended to send. |\n| `_takerToken` | `address` | Address of the token that the Taker is intended to send. |\n\n## Set an Intent\n\nSet an intent to trade in the Market.\n\n```Solidity\nfunction setIntent(\n  address _staker,\n  uint256 _amount,\n  address _locator\n) external onlyOwner\n```\n\n### Params\n\n| Name       | Type      | Description                                            |\n| :--------- | :-------- | :----------------------------------------------------- |\n| `_staker`  | `address` | Address of the account that has staked for the intent. |\n| `_amount`  | `uint256` | Amount of token that the account has staked.           |\n| `_locator` | `address` | Locator for the peer.                                  |\n\n## Unset an Intent\n\nUnset an intent to trade in the Market.\n\n```Solidity\nfunction unsetIntent(\n  address _staker\n) public onlyOwner returns (bool)\n```\n\n### Params\n\n| Name      | Type      | Description                                          |\n| :-------- | :-------- | :--------------------------------------------------- |\n| `_staker` | `address` | Address of the account that will unstake its intent. |\n\n## Get an Intent\n\nGets the intent for a given staker address.\n\n```Solidity\nfunction getIntent(\n  address _staker\n) public view returns (Intent memory)\n```\n\n### Params\n\n| Name      | Type      | Description                               |\n| :-------- | :-------- | :---------------------------------------- |\n| `_staker` | `address` | Address of the account to fetch an intent |\n\n## Has an Intent\n\nDetermines whether the Market has an intent for a staker address.\n\n```Solidity\nfunction hasIntent(\n  address _staker\n) internal view returns (bool)\n```\n\n### Params\n\n| Name      | Type      | Description                               |\n| :-------- | :-------- | :---------------------------------------- |\n| `_staker` | `address` | Address of the account to check an intent |\n\n## Fetch Intents\n\nFetch up to a number of intents from the list.\n\n```Solidity\nfunction fetchIntents(\n  uint256 _count\n) public view returns (address[] memory result)\n```\n\n### Params\n\n| Name     | Type      | Description                 |\n| :------- | :-------- | :-------------------------- |\n| `_count` | `uint256` | Number of intents to fetch. |\n\n## Find an Intent (By Value)\n\nFind an intent by value in the list.\n\n```Solidity\nfunction findPosition(\n  uint256 amount\n) internal view returns (Intent memory)\n```\n\n### Params\n\n| Name     | Type      | Description                 |\n| :------- | :-------- | :-------------------------- |\n| `_count` | `uint256` | Number of intents to fetch. |\n\n## Insert an Intent\n\nInsert an intent before an existing intent in the list.\n\n```Solidity\nfunction insertIntent(\n  Intent memory _newIntent,\n  Intent memory _nextIntent\n) internal returns (bool)\n```\n\n### Params\n\n| Name          | Type     | Description                       |\n| :------------ | :------- | :-------------------------------- |\n| `_newIntent`  | `Intent` | Intent to insert.                 |\n| `_nextIntent` | `Intent` | Existing intent to insert before. |\n\n## Link Two Intents\n\nLink two intents in the list.\n\n```Solidity\nfunction link(\n  Intent memory _left,\n  Intent memory _right\n) internal\n```\n\n### Params\n\n| Name     | Type     | Description                                    |\n| :------- | :------- | :--------------------------------------------- |\n| `_left`  | `Intent` | The intent to link to the left (Higher value). |\n| `_right` | `Intent` | The intent to link to the right (Lower value). |\n","readmeFilename":"README.md"}