{"_id":"@civic/solana-gateway-ts","_rev":"11-0a48d846bde55ba9511e34820db26283","name":"@civic/solana-gateway-ts","dist-tags":{"latest":"0.13.0"},"versions":{"0.13.0-alpha.1":{"name":"@civic/solana-gateway-ts","version":"0.13.0-alpha.1","author":{"name":"Kevin Colgan","email":"kevin@civic.com"},"license":"MIT","_id":"@civic/solana-gateway-ts@0.13.0-alpha.1","maintainers":[{"name":"lillyg","email":"lilly.guo@civic.com"},{"name":"callforsanity","email":"patrick.charrier@gmail.com"},{"name":"jp-civic","email":"jp@civic.com"},{"name":"chriteixeira","email":"chriteixeira@gmail.com"},{"name":"daneel","email":"daneel@civic.com"},{"name":"mitchcivic","email":"mitch@civic.com"},{"name":"dankelleher","email":"dankelleher@yahoo.com"},{"name":"jonthepilot","email":"jonathan@civic.com"},{"name":"civicfinance","email":"camille@civic.com"},{"name":"kevinhcolgan","email":"kevin@civic.com"},{"name":"flippiescholtz","email":"flippie@civic.com"},{"name":"tyronemichael","email":"tyronemichael@gmail.com"},{"name":"lucmir","email":"luccmir@gmail.com"}],"homepage":"https://www.civic/","dist":{"shasum":"5f03b7caf37e6706580ee3b0b5682d62d9e6a9a7","tarball":"https://registry.npmjs.org/@civic/solana-gateway-ts/-/solana-gateway-ts-0.13.0-alpha.1.tgz","fileCount":43,"integrity":"sha512-z+8kUAiirFrcLYAX/tzHPwB2O5avoMYvgGFLVY8Ewu2OKGvun6mpO2CKAOyn5sByt73hQL7CAUVwlTVp9KEMMg==","signatures":[{"sig":"MEQCIFzYNEHh8RHkqxM+ApDrVs2eK2w7qcHx93V+tEU+u+YfAiAzi4/xB0HPxW4T2y9k5l7QdC57C/t9kSTzCxXu8USXRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":230867},"main":"dist/index","types":"dist/index","scripts":{"doc":"yarn typedoc src/index.ts --readme none","lint":"eslint","test":"STAGE=${STAGE:-dev} FORCE_COLOR=1 nyc --reporter=text mocha","build":"yarn clean && yarn compile && yarn doc","clean":"rimraf -rf ./dist","compile":"tsc -p tsconfig.build.json","prepare":"yarn build","lint:fix":"yarn lint --fix"},"_npmUser":{"name":"dankelleher","email":"dankelleher@yahoo.com"},"repository":{"url":"git@github.com:civicteam/on-chain-identity-gateway.git","type":"git"},"description":"Typescript adapters for interacting with Solana gateway program","directories":{},"dependencies":{"bs58":"^5.0.0","bn.js":"^5.2.1","borsh":"^0.4.0","async-retry":"^1.3.3","@solana/web3.js":"^1.91.4"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","chai":"^4.2.0","mocha":"^10.4.0","sinon":"^17.0.1","eslint":"^9.0.0","rimraf":"^5.0.5","ts-node":"^10.9.2","typedoc":"^0.25.13","prettier":"^3.2.5","ts-mocha":"^10.0.0","fetch-mock":"^9.11.0","sinon-chai":"^3.7.0","typescript":"^5.4.5","@types/chai":"^4.3.14","chai-subset":"^1.6.0","cross-fetch":"^4.0.0","@types/mocha":"^10.0.6","@types/ramda":"^0.29.12","@types/sinon":"^17.0.3","@types/expect":"^24.3.0","chai-as-promised":"^7.1.1","@types/sinon-chai":"^3.2.12","@types/chai-subset":"^1.3.5","eslint-plugin-node":"^11.1.0","eslint-plugin-mocha":"^10.4.2","eslint-plugin-react":"^7.34.1","eslint-plugin-import":"^2.29.1","eslint-plugin-promise":"^6.1.1","eslint-config-prettier":"^9.1.0","eslint-config-standard":"^17.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-standard":"^5.0.0","@types/chai-as-promised":"^7.1.8","mocha-circleci-reporter":"^0.0.3","@typescript-eslint/parser":"^7.7.0","@typescript-eslint/eslint-plugin":"^7.7.0"},"_npmOperationalInternal":{"tmp":"tmp/solana-gateway-ts_0.13.0-alpha.1_1724692418096_0.551817091945086","host":"s3://npm-registry-packages"}},"0.13.0":{"name":"@civic/solana-gateway-ts","version":"0.13.0","author":{"name":"Kevin Colgan","email":"kevin@civic.com"},"license":"MIT","_id":"@civic/solana-gateway-ts@0.13.0","maintainers":[{"name":"lillyg","email":"lilly.guo@civic.com"},{"name":"callforsanity","email":"patrick.charrier@gmail.com"},{"name":"jp-civic","email":"jp@civic.com"},{"name":"chriteixeira","email":"chriteixeira@gmail.com"},{"name":"daneel","email":"daneel@civic.com"},{"name":"mitchcivic","email":"mitch@civic.com"},{"name":"dankelleher","email":"dankelleher@yahoo.com"},{"name":"jonthepilot","email":"jonathan@civic.com"},{"name":"civicfinance","email":"camille@civic.com"},{"name":"kevinhcolgan","email":"kevin@civic.com"},{"name":"flippiescholtz","email":"flippie@civic.com"},{"name":"tyronemichael","email":"tyronemichael@gmail.com"},{"name":"lucmir","email":"luccmir@gmail.com"}],"homepage":"https://www.civic/","dist":{"shasum":"47ec8eb504c532a82253258faeca1218c2364dbf","tarball":"https://registry.npmjs.org/@civic/solana-gateway-ts/-/solana-gateway-ts-0.13.0.tgz","fileCount":43,"integrity":"sha512-YdYwQep/4QupPJJqO/arrcYJoP7BpkxvIlNCejU0MHWnoj0Y9SpgmxUuR7YUnXJePt46Erz1tSKpOo9Kz18hyQ==","signatures":[{"sig":"MEYCIQCSUvCLyliJA9a/uzrw1g/AcvVYc1XTGOndBHf+2bz83wIhAPr4yQBI+hcYhb+bZmXiEDnRx0+nsPU7MG5IQ+EFNVpJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":230859},"main":"dist/index","types":"dist/index","scripts":{"doc":"yarn typedoc src/index.ts --readme none","lint":"eslint","test":"STAGE=${STAGE:-dev} FORCE_COLOR=1 nyc --reporter=text mocha","build":"yarn clean && yarn compile && yarn doc","clean":"rimraf -rf ./dist","compile":"tsc -p tsconfig.build.json","prepare":"yarn build","lint:fix":"yarn lint --fix"},"_npmUser":{"name":"dankelleher","email":"dankelleher@yahoo.com"},"repository":{"url":"git@github.com:civicteam/on-chain-identity-gateway.git","type":"git"},"description":"Typescript adapters for interacting with Solana gateway program","directories":{},"dependencies":{"bs58":"^5.0.0","bn.js":"^5.2.1","borsh":"^0.4.0","async-retry":"^1.3.3","@solana/web3.js":"^1.91.4"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","chai":"^4.2.0","mocha":"^10.4.0","sinon":"^17.0.1","eslint":"^9.0.0","rimraf":"^5.0.5","ts-node":"^10.9.2","typedoc":"^0.25.13","prettier":"^3.2.5","ts-mocha":"^10.0.0","fetch-mock":"^9.11.0","sinon-chai":"^3.7.0","typescript":"^5.4.5","@types/chai":"^4.3.14","chai-subset":"^1.6.0","cross-fetch":"^4.0.0","@types/mocha":"^10.0.6","@types/ramda":"^0.29.12","@types/sinon":"^17.0.3","@types/expect":"^24.3.0","chai-as-promised":"^7.1.1","@types/sinon-chai":"^3.2.12","@types/chai-subset":"^1.3.5","eslint-plugin-node":"^11.1.0","eslint-plugin-mocha":"^10.4.2","eslint-plugin-react":"^7.34.1","eslint-plugin-import":"^2.29.1","eslint-plugin-promise":"^6.1.1","eslint-config-prettier":"^9.1.0","eslint-config-standard":"^17.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-standard":"^5.0.0","@types/chai-as-promised":"^7.1.8","mocha-circleci-reporter":"^0.0.3","@typescript-eslint/parser":"^7.7.0","@typescript-eslint/eslint-plugin":"^7.7.0"},"_npmOperationalInternal":{"tmp":"tmp/solana-gateway-ts_0.13.0_1724692523355_0.905032519068272","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-08-26T17:13:37.987Z","modified":"2026-05-10T06:05:34.978Z","0.13.0-alpha.1":"2024-08-26T17:13:38.250Z","0.13.0":"2024-08-26T17:15:23.581Z"},"author":{"name":"Kevin Colgan","email":"kevin@civic.com"},"license":"MIT","homepage":"https://www.civic/","repository":{"url":"git@github.com:civicteam/on-chain-identity-gateway.git","type":"git"},"description":"Typescript adapters for interacting with Solana gateway program","maintainers":[{"email":"dankelleher@yahoo.com","name":"dankelleher"},{"email":"jonathan@civic.com","name":"jonthepilot"},{"email":"camille@civic.com","name":"civicfinance"},{"email":"kevin@civic.com","name":"kevinhcolgan"},{"email":"flippie@civic.com","name":"flippiescholtz"},{"email":"luccmir@gmail.com","name":"lucmir"},{"email":"chriteixeira@gmail.com","name":"chriteixeira"},{"email":"web@riedel-it.de","name":"rado0x54"}],"readme":"# Gateway-ts - library\n\nThis library provides a utility methods for helping \ndecentralized Apps (dApps) to make use of on-chain identity methods\nlike gateway token retrieval, lookup, and revocation.\n\n- [Gateway-ts - library](#gateway-ts---library)\n  - [Usage](#usage)\n    - [Installation](#installation)\n    - [Import](#import)\n  - [Functions](#functions)\n    - [findGatewayTokens](#findgatewaytokens)\n    - [addGatekeeper](#addgatekeeper)\n    - [getGatekeeperAccountKeyFromGatekeeperAuthority](#getgatekeeperaccountkeyfromgatekeeperauthority)\n    - [getGatewayTokenKeyForOwner](#getgatewaytokenkeyforowner)\n    - [issue](#issue)\n    - [findGatewayTokens](#findgatewaytokens-1)\n\n## Usage\n### Installation\n```\nyarn add @civic/solana-gateway-ts\n```\n### Import\n```\nimport {\n  addGatekeeper,\n  getGatekeeperAccountKeyFromGatekeeperAuthority,\n  getGatewayTokenKeyForOwner,\n  issue,\n  findGatewayTokens,\n} from \"@civic/solana-gateway-ts\";\n```\n\n## Functions\n\n### findGatewayTokens\nUtility method for finding gateway token created for a given public key. This method does the lookup against the Solana blockchain. Returns an empty array if gateway tokens doesn't exist for the given public key.\n```\nconst gatewayToken: PublicKey = await findGatewayToken(connection, owner, gatekeeperKey);\n```\nOptionally, a 'revoked' flag can be passed to allow retrieval of all, even revoked, tokens.\n\n### addGatekeeper\nCreates the instruction for adding a gatekeeper to the gatekeeper network\nUsage:\n```\nconst payer: Keypair;\nconst gatekeeperNetwork: Keypair;\nconst gatekeeperAccount: PublicKey;\nconst gatekeeperAuthority: PublicKey;\nconst transaction = new Transaction().add(\n      addGatekeeper(\n        payer.publicKey,\n        gatekeeperAccount,\n        gatekeeperAuthority,\n        gatekeeperNetwork.publicKey\n      )\n    );\n\n    await send(\n      connection,\n      transaction,\n      payer,\n      gatekeeperNetwork\n    );\n```\n\n### getGatekeeperAccountKeyFromGatekeeperAuthority\nRetrieves the gatekeeperAccount for a gatekeeper authority key, so the caller doens't need to keep a record of the gatekeeper account.\n```\nconst gatekeeperAccount =\n      await getGatekeeperAccountKeyFromGatekeeperAuthority(\n        this.gatekeeperAuthority.publicKey\n      );\n```\n\n### getGatewayTokenKeyForOwner\nDerives a gateway token key for an owner using the gateway program, additionally accepting a seed parameter\n```\nconst gatewayTokenKey = await getGatewayTokenKeyForOwner(owner);\n```\n\n### issue\nIssue a gatewayToken to an account\n```\nconst owner: PublicKey;\nconst payer: Keypair;\nconst gatekeeperNetwork: Keypair;\nconst gatekeeperAccount: PublicKey;\nconst gatekeeperAuthority: PublicKey;\n\nconst gatewayTokenKey = await getGatewayTokenKeyForOwner(owner);\nconst gatekeeperAccount =\n  await getGatekeeperAccountKeyFromGatekeeperAuthority(\n    gatekeeperAuthority.publicKey\n  );\n\nconst transaction = new Transaction().add(\n  issue(\n    seed,\n    gatewayTokenKey,\n    payer.publicKey,\n    gatekeeperAccount,\n    owner,\n    gatekeeperAuthority.publicKey,\n    gatekeeperNetwork\n  )\n);\n\nawait send(\n  connection,\n  transaction,\n  payer,\n  gatekeeperAuthority\n);\n```\n\n### findGatewayTokens\nFind gatewayTokens that have been created on a network for an account\n```\nconst owner: PublicKey;\nconst gatekeeperNetwork: Keypair;\nconst accounts = await findGatewayTokens(\n    connection,\n    owner.publicKey,\n    gatekeeperNetworkKey\n  );\n```","readmeFilename":"README.md"}