{"id":13651551,"url":"https://github.com/greymass/anchor-link","last_synced_at":"2026-01-12T02:39:08.962Z","repository":{"id":36947793,"uuid":"224947435","full_name":"greymass/anchor-link","owner":"greymass","description":"Persistent, fast and secure signature provider for EOSIO chains built on top of EOSIO Signing Requests (EEP-7)","archived":false,"fork":false,"pushed_at":"2024-04-10T05:47:04.000Z","size":2071,"stargazers_count":54,"open_issues_count":8,"forks_count":22,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-12T17:05:10.934Z","etag":null,"topics":["anchor-link","eos","eosio","eosio-signing-request"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greymass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-11-30T02:12:59.000Z","updated_at":"2025-02-14T16:36:22.000Z","dependencies_parsed_at":"2024-06-18T15:21:55.359Z","dependency_job_id":"ba7b2285-5404-4be0-9e97-042e71f385ca","html_url":"https://github.com/greymass/anchor-link","commit_stats":{"total_commits":221,"total_committers":4,"mean_commits":55.25,"dds":0.3393665158371041,"last_synced_commit":"62c6e7775e3a637e1acfd95544902d174b698a7f"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greymass%2Fanchor-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greymass%2Fanchor-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greymass%2Fanchor-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greymass%2Fanchor-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greymass","download_url":"https://codeload.github.com/greymass/anchor-link/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249745731,"owners_count":21319581,"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":["anchor-link","eos","eosio","eosio-signing-request"],"created_at":"2024-08-02T02:00:50.444Z","updated_at":"2026-01-12T02:39:08.950Z","avatar_url":"https://github.com/greymass.png","language":"TypeScript","funding_links":[],"categories":["Developers"],"sub_categories":["Libraries and Frameworks"],"readme":"# Anchor Link [![Package Version](https://img.shields.io/npm/v/anchor-link.svg?style=flat-square)](https://www.npmjs.com/package/anchor-link) ![License](https://img.shields.io/npm/l/anchor-link.svg?style=flat-square)\n\nPersistent, fast and secure signature provider for EOSIO chains built on top of [EOSIO Signing Requests (EEP-7)](https://github.com/greymass/eosio-signing-request)\n\nKey features:\n\n-   Persistent account sessions\n-   End-to-end encryption (E2EE)\n-   Account-based identity proofs\n-   Cross-device signing\n-   Network resource management\n-   Open standard\n\nResources:\n\n-   [API Documentation](https://greymass.github.io/anchor-link)\n-   [Protocol Specification](./protocol.md)\n-   [Developer Chat (Telegram)](https://t.me/anchor_link)\n\nGuides:\n\n-   [Integrating an app with Anchor using anchor-link](https://forums.eoscommunity.org/t/integrating-an-app-with-anchor-using-anchor-link/165)\n\nExamples:\n\n-   [Simple Examples](./examples)\n-   [VueJS Demo Application](https://github.com/greymass/anchor-link-demo)\n-   [ReactJS Demo Application](https://github.com/greymass/anchor-link-demo-multipass)\n\n## Installation\n\nThe `anchor-link` package is distributed both as a module on [npm](https://www.npmjs.com/package/anchor-link) and a standalone bundle on [unpkg](http://unpkg.com/anchor-link).\n\n### Browser using a bundler (recommended)\n\nInstall Anchor Link and a [transport](#transports):\n\n```\nyarn add anchor-link anchor-link-browser-transport\n# or\nnpm install --save anchor-link anchor-link-browser-transport\n```\n\nImport them into your project:\n\n```js\nimport AnchorLink from 'anchor-link'\nimport AnchorLinkBrowserTransport from 'anchor-link-browser-transport'\n```\n\n### Browser using a pre-built bundle\n\nInclude the scripts in your `\u003chead\u003e` tag.\n\n```html\n\u003cscript src=\"https://unpkg.com/anchor-link@3\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/anchor-link-browser-transport@3\"\u003e\u003c/script\u003e\n```\n\n`AnchorLink` and `AnchorLinkBrowserTransport` are now available in the global scope of your document.\n\n### Using node.js\n\nUsing node.js\n\n```\nyarn add anchor-link anchor-link-console-transport\n# or\nnpm install --save anchor-link anchor-link-console-transport\n```\n\nImport them into your project:\n\n```js\nconst AnchorLink = require('anchor-link')\nconst AnchorLinkConsoleTransport = require('anchor-link-console-transport')\n```\n\n## Usage\n\nFirst you need to instantiate your transport and the link.\n\n```ts\nconst transport = new AnchorLinkBrowserTransport()\nconst link = new AnchorLink({\n    transport,\n    chains: [\n        {\n            chainId: 'aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906',\n            nodeUrl: 'https://eos.greymass.com',\n        },\n    ],\n})\n```\n\nNow you have a link instance that can be used in the browser to login and/or transact. See [options](https://greymass.github.io/anchor-link/interfaces/LinkOptions.html) for a full list of available options. Also refer to the [anchor-link-browser-transport](https://github.com/greymass/anchor-link-browser-transport/tree/master#basic-usage) README for a list of available options within the transport.\n\n### Create a user session\n\nTo create a persistent session where you can push multiple transaction to a users wallet you need to call the [login](https://greymass.github.io/anchor-link/classes/Link.html#login) method on your link instance and pass your application name.\n\n```ts\n// Perform the login, which returns the users identity\nconst identity = await link.login('mydapp')\n\n// Save the session within your application for future use\nconst {session} = identity\nconsole.log(`Logged in as ${session.auth}`)\n```\n\n### Perform a transaction with a user session\n\nUsing the session you have persisted within your applications state from the user login, you can now send transactions through the session to the users wallet using the [transact](https://greymass.github.io/anchor-link/classes/Link.html#transact) method.\n\n```ts\nconst action = {\n    account: 'eosio',\n    name: 'voteproducer',\n    authorization: [session.auth],\n    data: {\n        voter: session.auth.actor,\n        proxy: 'greymassvote',\n        producers: [],\n    },\n}\n\nsession.transact({action}).then(({transaction}) =\u003e {\n    console.log(`Transaction broadcast! Id: ${transaction.id}`)\n})\n```\n\n### Restoring a session\n\nIf a user has previously logged in to your application, you can restore that previous session by calling the [restoreSession](https://greymass.github.io/anchor-link/classes/Link.html#restoresession) method on your link instance.\n\n```ts\nlink.restoreSession('mydapp').then((session) =\u003e {\n    console.log(`Session for ${session.auth} restored`)\n    const action = {\n        account: 'eosio',\n        name: 'voteproducer',\n        authorization: [session.auth],\n        data: {\n            voter: session.auth.actor,\n            proxy: 'greymassvote',\n            producers: [],\n        },\n    }\n    session.transact({action}).then(({transaction}) =\u003e {\n        console.log(`Transaction broadcast! Id: ${transaction.id}`)\n    })\n})\n```\n\n### Additional Methods\n\nA full list of all methods can be found in the [Link class documentation](https://greymass.github.io/anchor-link/classes/Link.html).\n\n-   List all available sessions: [listSessions](https://greymass.github.io/anchor-link/classes/Link.html#listsessions)\n-   Removing a session: [removeSession](https://greymass.github.io/anchor-link/classes/Link.html#removesession)\n\n### One-shot transact\n\nTo sign action(s) or a transaction using the link without logging in you can call the [transact](https://greymass.github.io/anchor-link/classes/Link.html#transact) method on your link instance.\n\n```ts\nconst action = {\n    account: 'eosio',\n    name: 'voteproducer',\n    authorization: [\n        {\n            actor: '............1', // ............1 will be resolved to the signing accounts name\n            permission: '............2', // ............2 will be resolved to the signing accounts authority (e.g. 'active')\n        },\n    ],\n    data: {\n        voter: '............1', // same as above, resolved to the signers account name\n        proxy: 'greymassvote',\n        producers: [],\n    },\n}\nlink.transact({action}).then(({signer, transaction}) =\u003e {\n    console.log(\n        `Success! Transaction signed by ${signer} and bradcast with transaction id: ${transaction.id}`\n    )\n})\n```\n\nYou can find more examples in the [examples directory](./examples) at the root of this repository and don't forget to look at the [API documentation](https://greymass.github.io/anchor-link/classes/Link.html).\n\n## Transports\n\nTransports in Anchor Link are responsible for getting signature requests to the users wallet when establishing a session or when using anchor link without logging in.\n\nAvailable transports:\n\n| Package                                                                                    | Description                                                                        |\n| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |\n| [anchor-link-browser-transport](https://github.com/greymass/anchor-link-browser-transport) | Browser overlay that generates QR codes or triggers local URI handler if available |\n| [anchor-link-console-transport](https://github.com/greymass/anchor-link-console-transport) | Transport that prints ASCII QR codes and esr:// links to the JavaScript console    |\n\nSee the [`LinkTransport` documentation](https://greymass.github.io/anchor-link/interfaces/LinkTransport.html) for details on how to implement custom transports.\n\n## Protocol\n\nThe Anchor Link protocol uses EEP-7 identity requests to establish a channel to compatible wallets using an untrusted HTTP POST to WebSocket forwarder (see [buoy node.js](https://github.com/greymass/buoy-nodejs)).\n\nA session key and unique channel URL is generated by the client which is attached to the identity request and sent to the wallet (see [transports](#transports)). The wallet signs the identity proof and sends it back along with its own channel URL and session key. Subsequent signature requests can now be encrypted to a shared secret derived from the two keys and pushed directly to the wallet channel.\n\n[📘 Protocol specification](./protocol.md)\n\n## Developing\n\nYou need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.\n\nClone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.\n\n---\n\nMade with ☕️ \u0026 ❤️ by [Greymass](https://greymass.com), if you find this useful please consider [supporting us](https://greymass.com/support-us).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreymass%2Fanchor-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreymass%2Fanchor-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreymass%2Fanchor-link/lists"}