{"bugs":{"url":"https://github.com/BitskiCo/bitski-js/issues"},"dist":{"shasum":"ff5e02d1d23309223856abc2a64eecb461145164","tarball":"https://registry.npmjs.org/bitski-provider/-/bitski-provider-2.0.0-beta.2.tgz","fileCount":153,"integrity":"sha512-y+MZxVlnklMyVj32PiUnxIEJCoFXFYuRFmM0k2pJmCnf2RtCzFnPZ6nj4ZI7ACKKvjM1xJNH0BHt6iDotu2Ufg==","signatures":[{"sig":"MEYCIQCa/FOvye0v1IlcXStzavB+ESD2roLInHifMK7r5PuySwIhAPKLB04pwf7DXqED4WrBw7FKLUcuTfkSWTcJWie9sM+g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":345889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoeRxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMmA//fFbViSJSg+/Mzs8TqZ3/Cd/leOV4A69S4xn6gytiner+XPnI\r\nPkd54JASM3LIR0DIWm/hqVZwBYJWDVvepUPY/k16jhvWcOyMIdczPHRbhE6h\r\n2ho7pXdTj7e7+3Ct2oGuXTXsDSnpbgNrxr6qjT+xWnqAFhEK+I4bkAGpY46g\r\nizueLL6dNDAqlAZDCWTFDyuyDlSBl/J5NUetx+JSwtzOCYd8W+YiGRHAyg/d\r\nXDO7MDnoNNqpxEgCSwnN0/iSzeYQQ4CS2iyek7qzF5+XB2VhQPUmqaYt6nSL\r\nu/swxNGT/wTfts2FkxqKUySnTj4M4gxNMkt3rdLIrwThqUicnKlHfv4dNNye\r\nmW4aDvG8H/tZigM8TI4MZmoXxKR7dtTWJ10KKz1Qegwad52SFEdiQ7JELgRW\r\nDuUvSe+uaE+cEJyRASxe5yPN2XCqew378MCzUN8NrIAxYAiNO4wj1skQAs4f\r\nmwpfQ4dClCxEagoxtFGbh/ZpUAL08oCcAAPNIKpowoLk/6cJLg2oMqrdawmQ\r\nmWyxyj4OYbtHqi2y0aOgNaQ6D3+7iF4LIUDdzEymL65VUgdLGoezoFe51FjK\r\nvyrZqAJB/ZBO03SEnrY8CkadG8vfTcdTTtxP5xkf8c+e1zE8fDomQNzvWeEE\r\nHmpooytBjeiC1VIp5v6VolW+hhqyINe8kn8=\r\n=ik0Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"bitski-provider","types":"lib/index.d.ts","module":"dist/index.js","readme":"# Bitski Provider\n\n[![npm](https://img.shields.io/npm/v/bitski-provider.svg)](https://www.npmjs.com/package/bitski-provider)\n\n> Note: This package is for advanced users, as it lacks authentication/authorization logic. If you are looking for the simplest way to integrate Bitski into your application, checkout the [full Bitski SDK](https://github.com/BitskiCo/bitski-js).\n\nThis package includes the Bitski Web3 provider. The provider is strongly typed\nusing [eth-provider-types](https://github.com/BitskiCo/bitski-js/tree/main/packages/eth-provider-types),\nand can be used with any Web3 library that supports the standard provider interface.\nProvider's require an Oauth `clientId` to be passed in, which can be created in\nthe [Bitski developer portal](https://developer.bitski.com/).\n\n```ts\nimport { createBitskiProvider } from 'bitski-provider';\n\nconst provider = createBitskiProvider({\n  clientId: 'your-client-id',\n});\n```\n\nIn addition the following options can be passed:\n\n```ts\ninterface BitskiProviderConfig {\n  // Oauth clientId for the app, required\n  clientId: string;\n\n  // A custom fetch function. This can be useful when integrating with server\n  // side javascript frameworks, or when testing.\n  fetch?: typeof fetch;\n\n  // Additional headers which should be included with RPC requests made by the\n  // provider.\n  additionalHeaders?: Record<string, string>;\n\n  // The polling interval for subscriptions, in milliseconds. Defaults to 1000.\n  pollingInterval?: number;\n\n  // Whether or not the provider should cache responses from the API.\n  // Defaults to true.\n  disableCaching?: boolean;\n\n  // Whether or not the provider should validate requests to the API.\n  // Defaults to true.\n  disableValidation?: boolean;\n\n  // Additional parameters added to the context of a sign request, e.g. the origin\n  // that is attempting to sign\n  additionalSigningContext?: Record<string, string>;\n\n  // The API base URL for RPC and other API requests. Defaults to\n  // https://api.bitski.com\n  apiBaseUrl?: string;\n\n  // The base URL for Bitski's signer UI, used for signing transactions.\n  // Defaults to https://signer.bitski.com\n  signerBaseUrl: string;\n\n  // The signer callback if the redirect flow is being used for signer.\n  transactionCallbackUrl?: string;\n\n  // A storage mechanism for storing provider state, such as current chain and\n  // custom chain details.\n  store?: BitskiProviderStore;\n\n  // A signing function, see below for more details\n  sign?: SignFn;\n\n  // A function that provides the current user, if one exists\n  getUser?(): Promise<User | undefined>;\n\n  // A function that provides the current access token, if one exists\n  getAccessToken?(): Promise<string>;\n\n  // A function that clears the current access token, if one exists\n  clearAccessToken?(): Promise<void>;\n}\n```\n\n## Sign Function\n\nThere are multiple ways to sign transactions with Bitski. The default is to use\nthe Browser Signer function. This signer will open a popup window to the Bitski\nsigner UI, and where users can see details about the transaction and confirm it\nor deny it. The result is then sent back to the original window and returned\nas the result of the request.\n\nThe other option that is available is to use the RPC signer.\n\n```ts\nimport { createBitskiProvider, createRpcSigner } from 'bitski-provider';\n\nconst provider = createBitskiProvider({\n  clientId: 'your-client-id',\n  signFn: createRpcSigner(),\n});\n```\n\nThe RPC signer will send the transaction to the Bitski API and will not ask the\nuser for confirmation. This flow requires a special access token and is\ntypically used for programmatic wallets, not user wallets. If you want to use\nthis flow, please contact us for more details and support.\n\n## Installation\n\n```\nnpm install bitski-provider\n```\n\n## Usage\n\n```javascript\nimport { BitskiEngine } from 'bitski-provider';\n\nconst provider = new BitskiEngine();\nprovider.start();\n```\n","gitHead":"7b9f0b01dd8a36a4294f27740ce264ecd95af35c","license":"MIT","scripts":{"lint":"eslint . --cache","test":"jest","build":"tsc -p tsconfig.main.json && tsc -p tsconfig.module.json && node ./scripts/insert-package-version.mjs","prettier":"prettier --config .prettierrc '{src,tests}/**/*.ts' --write"},"_npmUser":{"name":"imthinhvu","email":"thinh.vu@hey.com"},"homepage":"https://github.com/BitskiCo/bitski-js#readme","browserify":{"transform":[["babelify",{"plugins":["@babel/plugin-transform-runtime"],"presets":["@babel/preset-env"]}]]},"repository":{"url":"git+https://github.com/BitskiCo/bitski-js.git","type":"git"},"_npmVersion":"8.19.2","description":"Core Bitski provider","directories":{},"maintainers":[{"name":"tdreyno91","email":"me@tdreyno.com"},{"name":"imthinhvu","email":"thinh.vu@hey.com"},{"name":"pzuraq","email":"opensource@pzuraq.com"},{"name":"jatescher","email":"jatescher@gmail.com"},{"name":"pat2man","email":"pat2man@gmail.com"},{"name":"joshpyles","email":"josh@outtherelabs.com"}],"_nodeVersion":"18.12.1","dependencies":{"uuid":"9.0.0","bn.js":"^4.11.8","decoders":"^2.0.1","eth-rpc-errors":"^4.0.3","json-rpc-error":"^2.0.0","json-rpc-engine":"^6.1.0","eth-block-tracker":"^5.0.0","eth-provider-types":"^0.1.0-beta.1","eth-json-rpc-filters":"^5.0.0","eth-json-rpc-middleware":"^9.0.1","@metamask/safe-event-emitter":"2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"27.2.0","ts-jest":"^27.0.5","babelify":"^10.0.0","@babel/core":"^7.6.4","@types/jest":"^27.5.2","jest-fetch-mock":"^3.0.3","@babel/preset-env":"^7.6.3","@testing-library/dom":"^8.19.0","@babel/plugin-transform-runtime":"^7.6.2"},"_npmOperationalInternal":{"tmp":"tmp/bitski-provider_2.0.0-beta.2_1671554161338_0.7161253500499427","host":"s3://npm-registry-packages"},"_id":"bitski-provider@2.0.0-beta.2","version":"2.0.0-beta.2"}