{"_id":"@blinkbitcoin/mavapay-client","_rev":"3-52949aae6b1c6dd485d7df1086262395","name":"@blinkbitcoin/mavapay-client","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.2":{"name":"@blinkbitcoin/mavapay-client","version":"0.0.2","license":"MIT","_id":"@blinkbitcoin/mavapay-client@0.0.2","maintainers":[{"name":"k9ert","email":"kneunert@gmail.com"},{"name":"blinkadmin","email":"a@blinkbtc.com"}],"homepage":"https://github.com/blinkbitcoin/mavapay-client#readme","bugs":{"url":"https://github.com/blinkbitcoin/mavapay-client/issues"},"dist":{"shasum":"090b86e6eae6b9126b76615f220bcad73bae6231","tarball":"https://registry.npmjs.org/@blinkbitcoin/mavapay-client/-/mavapay-client-0.0.2.tgz","fileCount":93,"integrity":"sha512-JKYOb9VwTXlblrhjOeKurUsWMWK169DNnUpLfLxVvBvuxRmanNub2RIQoWFLKzk9D1cDrcD3Y7nsB/ICFnyR7g==","signatures":[{"sig":"MEUCICtUl0wi850/5jquVn2yt2HZuwpGQj5Ul/B78wxxXHiPAiEA4i3UXQNUme4VLVCbkU5a3IhchaitZQ5P+IXQyBlsXyk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61217},"main":"dist/index.js","_from":"file:blinkbitcoin-mavapay-client-0.0.2.tgz","types":"./dist/index.d.ts","scripts":{"test":"jest","build":"tsup","coverage":"jest --runInBand --coverage","tsc:check":"tsc --pretty --noEmit --skipLibCheck","code:check":"pnpm tsc:check && pnpm eslint:check && pnpm prettier:check","eslint:fix":"eslint . --fix","eslint:check":"eslint .","prettier:fix":"prettier --write .","prettier:check":"prettier --check ."},"_npmUser":{"name":"k9ert","email":"kneunert@gmail.com"},"_resolved":"/private/var/folders/8c/97y79x613jv55rzs9hrngp500000gn/T/nix-shell.9iEoDs/79206fd61cce71f3f5469c5b21191929/blinkbitcoin-mavapay-client-0.0.2.tgz","_integrity":"sha512-JKYOb9VwTXlblrhjOeKurUsWMWK169DNnUpLfLxVvBvuxRmanNub2RIQoWFLKzk9D1cDrcD3Y7nsB/ICFnyR7g==","repository":{"url":"git+https://github.com/blinkbitcoin/mavapay-client.git","type":"git"},"_npmVersion":"10.9.2","description":"TypeScript client library for **Mavapay Money API**. This library can be used in front-end applications such as web and mobile wallets to transfer Bitcoin to Nigeria.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"packageManager":"pnpm@8.7.6","devDependencies":{"jest":"^29.7.0","tsup":"^8.4.0","eslint":"^9.23.0","globals":"^16.0.0","ts-jest":"^29.2.6","prettier":"^3.5.3","typescript":"^5.8.2","@types/jest":"^29.5.14","@types/node":"^22.13.13","@eslint/compat":"^1.2.7","eslint-plugin-import":"^2.31.0","eslint-config-prettier":"^10.1.1","eslint-plugin-prettier":"^5.2.5","@typescript-eslint/parser":"^8.28.0","@typescript-eslint/eslint-plugin":"^8.28.0"},"_npmOperationalInternal":{"tmp":"tmp/mavapay-client_0.0.2_1744039809098_0.5454873570263827","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@blinkbitcoin/mavapay-client","version":"0.0.3","license":"MIT","_id":"@blinkbitcoin/mavapay-client@0.0.3","maintainers":[{"name":"k9ert","email":"kneunert@gmail.com"},{"name":"blinkadmin","email":"a@blinkbtc.com"}],"homepage":"https://github.com/blinkbitcoin/mavapay-client#readme","bugs":{"url":"https://github.com/blinkbitcoin/mavapay-client/issues"},"dist":{"shasum":"06b4c439ac3d09d7d39abcef5e559dff301894ea","tarball":"https://registry.npmjs.org/@blinkbitcoin/mavapay-client/-/mavapay-client-0.0.3.tgz","fileCount":93,"integrity":"sha512-Vthmwng8f3A6sy6xuiB83hQgwHBaANbhG+vzEqMh95Sp8cpwSS2nam8/M6QJfdeBZYwpZH1P0EVJqFyM6c7//w==","signatures":[{"sig":"MEUCIGnBWA6Nn3KHgTtpceG5TOK1W6McQ/tdDBgXX2+pGxMFAiEA9GFOcJu5HTkEiLYPJcbnkw8+tjyN8CgEFeVU8R1NXCk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61521},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"16ec76043e3152a57306f2d65e27bd80b3cb5e97","scripts":{"test":"jest","build":"tsup","coverage":"jest --runInBand --coverage","tsc:check":"tsc --pretty --noEmit --skipLibCheck","code:check":"pnpm tsc:check && pnpm eslint:check && pnpm prettier:check","eslint:fix":"eslint . --fix","eslint:check":"eslint .","prettier:fix":"prettier --write .","prettier:check":"prettier --check ."},"_npmUser":{"name":"blinkadmin","email":"a@blinkbtc.com"},"repository":{"url":"git+https://github.com/blinkbitcoin/mavapay-client.git","type":"git"},"_npmVersion":"10.9.2","description":"TypeScript client library for **Mavapay Money API**. This library can be used in front-end applications such as web and mobile wallets to transfer Bitcoin to Nigeria.","directories":{},"_nodeVersion":"23.10.0","_hasShrinkwrap":false,"packageManager":"pnpm@8.7.6","devDependencies":{"jest":"^29.7.0","tsup":"^8.4.0","eslint":"^9.23.0","globals":"^16.0.0","ts-jest":"^29.2.6","prettier":"^3.5.3","typescript":"^5.8.2","@types/jest":"^29.5.14","@types/node":"^22.13.13","@eslint/compat":"^1.2.7","eslint-plugin-import":"^2.31.0","eslint-config-prettier":"^10.1.1","eslint-plugin-prettier":"^5.2.5","@typescript-eslint/parser":"^8.28.0","@typescript-eslint/eslint-plugin":"^8.28.0"},"_npmOperationalInternal":{"tmp":"tmp/mavapay-client_0.0.3_1744103166342_0.07933072588949841","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-04-07T15:30:09.005Z","modified":"2026-06-24T17:23:36.817Z","0.0.2":"2025-04-07T15:30:09.320Z","0.0.3":"2025-04-08T09:06:06.522Z"},"bugs":{"url":"https://github.com/blinkbitcoin/mavapay-client/issues"},"license":"MIT","homepage":"https://github.com/blinkbitcoin/mavapay-client#readme","repository":{"url":"git+https://github.com/blinkbitcoin/mavapay-client.git","type":"git"},"description":"TypeScript client library for **Mavapay Money API**. This library can be used in front-end applications such as web and mobile wallets to transfer Bitcoin to Nigeria.","maintainers":[{"email":"jp@blinkbtc.com","name":"jp_blinkbtc_com"},{"email":"kneunert@gmail.com","name":"k9ert"},{"email":"a@blinkbtc.com","name":"blinkadmin"}],"readme":"# Mavapay-client\n\nTypeScript client library for **Mavapay Money API**. This library can be used in front-end applications such as web and mobile wallets to transfer Bitcoin to Nigeria.\n\n## Installation\n\nYou can install the package using yarn, npm or pnpm:\n\n### using yarn:\n\n```bash\nyarn add @blinkbitcoin/mavapay-client\n```\n\n### using npm:\n\n```bash\nnpm install @blinkbitcoin/mavapay-client\n```\n\n### using pnpm:\n\n```bash\npnpm add @blinkbitcoin/mavapay-client\n```\n\n## Usage\n\n### Authentication\n\nBefore calling any API, you need to configure authentication:\n\n```ts\nimport { mavapayClient } from \"@blinkbitcoin/mavapay-client\"\n\nmavapayClient.configureAuth({\n  network: \"signet\", // Can be \"mainnet\" | \"signet\" | \"regtest\"\n  apiKey: \"<YOUR_MAVAPAY_API_KEY>\",\n})\n```\n\n### getBanksByCountry\n\nRetrieve a list of banks available for a given country:\n\n```ts\nimport { mavapayClient } from \"@blinkbitcoin/mavapay-client\"\n\nmavapayClient.configureAuth({\n  network: \"signet\",\n  apiKey: \"<YOUR_MAVAPAY_API_KEY>\",\n})\n\nasync function fetchBanks() {\n  try {\n    const banks = await mavapayClient.getBanksByCountry(\"NG\") // \"NG\" = Nigeria\n\n    if (\"type\" in banks) {\n      console.error(\"Error retrieving banks:\", banks.message)\n      return\n    }\n\n    console.log(\"Banks retrieved:\", banks) // Returns an array of bank objects\n  } catch (error) {\n    console.error(\"Unexpected error:\", error)\n  }\n}\n\nfetchBanks()\n```\n\n### getQuote\n\nRetrieve a quote to send Bitcoin to a bank account:\n\n```ts\nimport { mavapayClient } from \"@blinkbitcoin/mavapay-client\"\n\nmavapayClient.configureAuth({\n  network: \"signet\",\n  apiKey: \"<YOUR_MAVAPAY_API_KEY>\",\n})\n\nasync function fetchQuote() {\n  try {\n    const quote = await mavapayClient.getQuote({\n      amount: 300000,\n      sourceCurrency: \"BTCSAT\",\n      targetCurrency: \"NGNKOBO\",\n      paymentMethod: \"LIGHTNING\",\n      paymentCurrency: \"NGNKOBO\",\n      autopayout: true,\n      beneficiary: {\n        bankAccountNumber: \"0123456789\",\n        bankAccountName: \"olaolu olajide\",\n        bankCode: \"090267\",\n        bankName: \"GTBANK PLC\",\n      },\n    })\n\n    if (\"type\" in quote) {\n      console.error(\"Error retrieving quote:\", quote.message)\n      return\n    }\n\n    console.log(\"Quote:\", quote) // Return the Lightning payment details\n  } catch (error) {\n    console.error(\"Unexpected error:\", error)\n  }\n}\n\nfetchQuote()\n```\n\n## Currency Types\n\n- `NGNKOBO`: Nigerian Naira in Kobo\n- `ZARCENT`: South African Rand in Cents\n\n## Type Definitions\n\n```ts\ntype Network = \"mainnet\" | \"signet\" | \"regtest\"\n\ntype AuthConfig = {\n  apiKey: string\n  network: Network\n}\n```\n\n## Local Development\n\n### 1. Run the Mavapay Client Locally\n\nTo run and build the Mavapay Client locally, follow these steps:\n\n#### Prerequisites\n\n- Install `nix` with flakes enabled\n- Install `direnv` and configure it for your shell\n\nAll commands must be executed within the `nix` environment.\n\n#### Install Dependencies\n\n```bash\nnix develop -c pnpm install\n```\n\n#### Build\n\nBuild production (distribution) files in the `dist/` folder:\n\n```bash\nnix develop -c pnpm build\n```\n\n#### Test\n\nRun tests using Jest:\n\n```bash\nnix develop -c pnpm test\n```\n\n---\n\n### 2. Link the Library into Another Project\n\nTo test this library locally in a different project, you can use `npm link` or `yarn link`.\n\n> Although the project uses `pnpm` internally, it can be consumed by other projects using `npm` or `yarn`.\n\n#### Step 1: Build and Link the Library\n\nIn the root of the `mavapay-client` project:\n\n#### Install Dependencies\n\n```bash\nnix develop -c pnpm install\n```\n\n#### Build\n\nBuild project (distribution) files in the `dist/` folder:\n\n```bash\nnix develop -c pnpm build\n```\n\nCreates a global symbolic link to the library so it can be used locally in other projects during development.\n\n```bash\nnpm link\n# or\nyarn link\n```\n\n#### Step 2: Link it in your test project\n\nIn your test project folder:\n\n```bash\nnpm link @blinkbitcoin/mavapay-client\n# or\nyarn link @blinkbitcoin/mavapay-client\n```\n\nNow you can import and use the library like this:\n\n```ts\nimport { mavapayClient } from \"@blinkbitcoin/mavapay-client\"\n```\n\n#### Step 3: Rebuild on Changes\n\nEvery time you change the library, run:\n\n```bash\nnix develop -c pnpm build\n```\n\nYour test project will automatically use the updated build.\n\n#### Step 4: Unlink (when done)\n\nIn your test project:\n\n```bash\nnpm unlink @blinkbitcoin/mavapay-client\n# or\nyarn unlink @blinkbitcoin/mavapay-client\n```\n\nIn the library folder:\n\n```bash\nnpm unlink\n# or\nyarn unlink\n```\n\nSee [npm link](https://docs.npmjs.com/cli/v6/commands/npm-link) or [yarn link](https://yarnpkg.com/cli/link) for more.\n\n## References\n\nThis library was developed based on:\n\n- [Mavapay API Documentation](https://docs.mavapay.co/api-reference) – Official RESTful API reference for Mavapay (used to send Bitcoin to Nigeria and other countries).\n","readmeFilename":"README.md"}