{"id":18389728,"url":"https://github.com/danielwpz/near-rest-server","last_synced_at":"2025-04-07T02:34:42.653Z","repository":{"id":45979166,"uuid":"414883293","full_name":"danielwpz/near-rest-server","owner":"danielwpz","description":"RESTful web server which helps to interact with NEAR blockchain","archived":false,"fork":false,"pushed_at":"2023-02-16T12:48:24.000Z","size":184,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T11:45:02.393Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielwpz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-08T07:09:59.000Z","updated_at":"2022-06-15T02:52:56.000Z","dependencies_parsed_at":"2024-11-06T01:59:07.787Z","dependency_job_id":"7ae5af05-d169-4e5a-9210-e8fec2a40f26","html_url":"https://github.com/danielwpz/near-rest-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fnear-rest-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fnear-rest-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fnear-rest-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielwpz%2Fnear-rest-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielwpz","download_url":"https://codeload.github.com/danielwpz/near-rest-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247583551,"owners_count":20962057,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:44:16.709Z","updated_at":"2025-04-07T02:34:37.622Z","avatar_url":"https://github.com/danielwpz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# near-rest-server\n\n\u003e Based on Ts.ED framework    \n\u003e See [Ts.ED](https://tsed.io) project for more information.\n\n## Build setup\n\n\u003e **Important!** Ts.ED requires Node \u003e= 10, Express \u003e= 4 and TypeScript \u003e= 3.\n\n```batch\n# install dependencies\n$ npm install\n\n# serve\n$ npm run start\n\n# build for production \n# NOTE: currently smart contract panic messages won't be returned in prod mode\n$ npm run build\n$ npm run start:prod\n```\n\n## NEAR Accounts\nCurrently all transactions are signed by accounts from local unencrypted JSON key store (by default `~/.near-credentials`) just like near-cli.         \nYou can config the path for keystore folder in `config.keyStorePath`\n\n## APIs\n\n### - General Contracts\n\n- Call contract method\n  - method: `POST`\n  - URL: `/:network_id/contract/:contract_id/:method_name`\n    - `network_id`: `mainnet` or `testnet`\n    - `contract_id`: Contract ID(address) e.g. `my-nft.testnet`\n    - `method_name`: Method name e.g. `nft_transfer`\n  - Body parameters:\n    - `account_id`: Caller account id. (Account private key will be read from local keyStore folder.)\n    - `args`: Method arguments\n    - `gas`: Gas amount (e.g. `300 Tgas`, `1 Ggas`), see [near-units](https://github.com/near/units-js)\n    - `deposit`: Attached NEAR deposit (e.g. `10N`, `1yN`), see [near-units](https://github.com/near/units-js)\n\n- View contract method\n  - method: `GET`\n  - URL: `/:network_id/contract/:contract_id/:method_name`\n    - `network_id`: `mainnet` or `testnet`\n    - `contract_id`: Contract ID(address) e.g. `my-nft.testnet`\n    - `method_name`: Method name e.g. `nft_transfer`\n  - parameters:\n    - view args can be provided through either JSON body or url query.\n    - If body is provided, url query will be ignored.\n\n### - NEP Contracts\n\n#### NEP171\n- `GET` `/:network_id/nep171/:contract_id/nft_token`\n  - Get one NFT\n  - Query Params\n    - `token_id`: token id\n\n- `POST` `/:network_id/nep171/:contract_id/nft_transfer`\n  - Transfer an NFT\n  - Body Params\n    - `*account_id`: calling account id\n    - `*deposit`: deposit, MUST be `1yN`\n    - `args`\n      - `*receiver_id`: receiver id\n      - `*token_id`: token id\n      - `approval_id`: approval id\n      - `memo`: memo string\n\n## Contribute\n\n### NEP Standards\nTo add new endpoints for any NEP standards. You can take `neps/nep171.ts` as an example.      \n1. Create a new file named by NEP standard (e.g. `nep141.ts`) in neps folder.      \n2. Export a dictionary of NEP type, which should describe the standard name, view methods and change methods.    \n3. For each view/change method, define its name and call arguments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwpz%2Fnear-rest-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielwpz%2Fnear-rest-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielwpz%2Fnear-rest-server/lists"}