{"_id":"@beluswap/sdk","_rev":"4-68b91dcc49b9a45f8a7c4b3c35629f80","name":"@beluswap/sdk","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@beluswap/sdk","version":"0.1.0","keywords":["belugaswap","stellar","soroban","dex","amm","concentrated-liquidity","sdk","typescript"],"author":{"name":"BelugaSwap Team"},"license":"Apache-2.0","_id":"@beluswap/sdk@0.1.0","maintainers":[{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"}],"homepage":"https://github.com/Beluga-Swap/sdk#readme","bugs":{"url":"https://github.com/Beluga-Swap/sdk/issues"},"dist":{"shasum":"eafd011008cfcc83e086aa8c89b0e7fb18e65fea","tarball":"https://registry.npmjs.org/@beluswap/sdk/-/sdk-0.1.0.tgz","fileCount":9,"integrity":"sha512-smzP1o46FDuRKhFFfMhQemTaMzeGp8mX7CavL/7ZeSTTtJ3Vy6qScCZmUNQ8EnYxMnr+NfYARd0mptQMhB5ikQ==","signatures":[{"sig":"MEQCIFPyeoEs8VG19AR8M181LrGxbaNKK/S/VyjMyX3AichHAiAEdSmmAFUPQXOvVmagPlGK2aH3NlVS7HjOEnShXbvgcw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32195},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"bb9b20508eb3a9b0b105071a3c4db2e01eac309b","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rm -rf dist","format":"prettier --write \"src/**/*.ts\"","prepublish":"npm run clean && npm run build","build:watch":"tsc --watch"},"_npmUser":{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"},"repository":{"url":"git+https://github.com/Beluga-Swap/sdk.git","type":"git"},"_npmVersion":"11.7.0","description":"BelugaSwap TypeScript SDK with human-friendly inputs","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@stellar/stellar-sdk":"^12.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1768643127738_0.6556092392521158","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@beluswap/sdk","version":"0.1.1","keywords":["belugaswap","stellar","soroban","dex","amm","concentrated-liquidity","sdk","typescript"],"author":{"name":"BelugaSwap Team"},"license":"Apache-2.0","_id":"@beluswap/sdk@0.1.1","maintainers":[{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"}],"homepage":"https://github.com/Beluga-Swap/sdk#readme","bugs":{"url":"https://github.com/Beluga-Swap/sdk/issues"},"dist":{"shasum":"0ba709043b1fcd08c4dab415d65e75fd410b19fb","tarball":"https://registry.npmjs.org/@beluswap/sdk/-/sdk-0.1.1.tgz","fileCount":9,"integrity":"sha512-Yuy644OD7Qj8fiwraytvVU3PDFM9NR7Veh05xTUWSOHTw0dPDe7H7sES0jhNH72O2cfEmN9IsXXyU2QHvAGerg==","signatures":[{"sig":"MEUCIQCEMb/lPzuQHUR5IFiwxomp3sTRhsXZEDpSvPIXWhJeGwIgIjgpUOmBHxSeoSTK1UyhalwJvWb6gKRgna9e+YIAzq0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32199},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"7eefeabd294ae74eb3dbc111e29a9222fe92ab08","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rm -rf dist","format":"prettier --write \"src/**/*.ts\"","prepublish":"npm run clean && npm run build","build:watch":"tsc --watch"},"_npmUser":{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"},"repository":{"url":"git+https://github.com/Beluga-Swap/sdk.git","type":"git"},"_npmVersion":"11.7.0","description":"BelugaSwap TypeScript SDK with human-friendly inputs","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@stellar/stellar-sdk":"^12.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1768643908558_0.3076440429073466","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@beluswap/sdk","version":"0.1.2","keywords":["belugaswap","stellar","soroban","dex","amm","concentrated-liquidity","sdk","typescript"],"author":{"name":"BelugaSwap Team"},"license":"Apache-2.0","_id":"@beluswap/sdk@0.1.2","maintainers":[{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"}],"homepage":"https://github.com/Beluga-Swap/sdk#readme","bugs":{"url":"https://github.com/Beluga-Swap/sdk/issues"},"dist":{"shasum":"b2585ac2ac4fcc64b0cafb3a3fc100a86e09312d","tarball":"https://registry.npmjs.org/@beluswap/sdk/-/sdk-0.1.2.tgz","fileCount":37,"integrity":"sha512-BOfd9mye9M861mPEbCqbknOPRW3bukyCt7W1OANLDE8nb1+Bj8xkvNjbL6Z49IFdpfmUHeUB9xhtNyhTdLR5Ig==","signatures":[{"sig":"MEUCIQC2WyC3lnpg5wlilBFeSvFx4apC9xRikqTZosWOm3D+6gIgBxoKSYc7OQXjmPioQnDXg20pf7wwYl6iLoFewSVC7Qo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84141},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"5bd0cf55cc533adae1335aea0a2297202b54d40d","scripts":{"lint":"eslint src --ext .ts","test":"jest","build":"tsc","clean":"rm -rf dist","format":"prettier --write \"src/**/*.ts\"","prepublish":"npm run clean && npm run build","build:watch":"tsc --watch"},"_npmUser":{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"},"repository":{"url":"git+https://github.com/Beluga-Swap/sdk.git","type":"git"},"_npmVersion":"11.7.0","description":"BelugaSwap TypeScript SDK with human-friendly inputs","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@stellar/stellar-sdk":"^12.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0","prettier":"^3.0.0","typescript":"^5.0.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.2_1768651631260_0.6290158946805664","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@beluswap/sdk","version":"0.1.3","description":"BelugaSwap TypeScript SDK with human-friendly inputs","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","build:watch":"tsc --watch","clean":"rm -rf dist","prepublish":"npm run clean && npm run build","test":"jest","lint":"eslint src --ext .ts","format":"prettier --write \"src/**/*.ts\""},"keywords":["belugaswap","stellar","soroban","dex","amm","concentrated-liquidity","sdk","typescript"],"author":{"name":"BelugaSwap Team"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/Beluga-Swap/sdk.git"},"bugs":{"url":"https://github.com/Beluga-Swap/sdk/issues"},"homepage":"https://github.com/Beluga-Swap/sdk#readme","dependencies":{"@stellar/stellar-sdk":"^12.0.0"},"devDependencies":{"@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","jest":"^29.0.0","prettier":"^3.0.0","typescript":"^5.0.0"},"engines":{"node":">=18.0.0"},"gitHead":"d7efdd76c4223e2917a1fe896b7d4ceb591da693","_id":"@beluswap/sdk@0.1.3","_nodeVersion":"22.19.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-gXgvbrJRBJyARZgevZPBUa6CmAyPIBbKbEUmuNGESpseN9Y0sZ43ouwjjfY0z4wsFZmWfs3794CGfDGTi33X1A==","shasum":"6fc470a8702c2249fb3ae16c635d52c4b5572bec","tarball":"https://registry.npmjs.org/@beluswap/sdk/-/sdk-0.1.3.tgz","fileCount":37,"unpackedSize":85726,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEZRti1WOTyE+D/zCQVt6VvpdgXe1p5zcw2v2M3EGoJTAiEAgEfWJIlv3d2j9f1tvP++QMLBTxwau1LCT9E8X2WoefI="}]},"_npmUser":{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"},"directories":{},"maintainers":[{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.3_1768653116890_0.7892018897072184"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-17T09:45:27.608Z","modified":"2026-01-17T12:31:57.210Z","0.1.0":"2026-01-17T09:45:27.879Z","0.1.1":"2026-01-17T09:58:28.705Z","0.1.2":"2026-01-17T12:07:11.426Z","0.1.3":"2026-01-17T12:31:57.104Z"},"bugs":{"url":"https://github.com/Beluga-Swap/sdk/issues"},"author":{"name":"BelugaSwap Team"},"license":"Apache-2.0","homepage":"https://github.com/Beluga-Swap/sdk#readme","keywords":["belugaswap","stellar","soroban","dex","amm","concentrated-liquidity","sdk","typescript"],"repository":{"type":"git","url":"git+https://github.com/Beluga-Swap/sdk.git"},"description":"BelugaSwap TypeScript SDK with human-friendly inputs","maintainers":[{"name":"bsetyawan","email":"setyawanbayu355@gmail.com"}],"readme":"# BeluSwap SDK\n\nHuman-friendly TypeScript SDK for BeluSwap concentrated liquidity AMM on Stellar.\n\n## Why BeluSwap SDK?\n\n**No more manual conversions!** Use normal numbers instead of:\n- ❌ Converting amounts to stroops (7 decimals)\n- ❌ Calculating sqrt_price_x64 in Q64.64 format\n- ❌ Converting prices to ticks\n- ❌ Aligning ticks to spacing\n- ❌ Converting days to ledgers\n- ❌ Converting percentages to basis points\n\n✅ **Just use human-readable inputs!**\n\n## Installation\n\n```bash\nnpm install @beluswap/sdk\n```\n\n## Quick Start\n\n```typescript\nimport BeluSwapSDK from '@beluswap/sdk';\n\n// Initialize SDK\nconst sdk = new BeluSwapSDK({\n  factoryAddress: 'CFACTORY...',\n  network: 'testnet', // or 'mainnet'\n});\n\n// Create pool with NORMAL numbers!\nconst pool = await sdk.factory.createPool({\n  creator: 'GCREATOR...',\n  tokenA: 'CDUSDC...',\n  tokenB: 'CDXLM...',\n  feeTier: 'VOLATILE',           // Not 30 bps!\n  creatorFeePercent: 1,          // 1%, not 100 bps!\n  initialPrice: 1.0,             // Normal price!\n  amount0: 100,                  // 100 tokens, not stroops!\n  amount1: 100,\n  priceRangeLower: 0.95,         // Normal price range!\n  priceRangeUpper: 1.05,\n  lockDurationDays: 7,           // Days, not ledgers!\n});\n\nconsole.log(pool.summary);\n// {\n//   pair: \"CDUSDC.../CDXLM...\",\n//   fee: \"0.3%\",\n//   initialPrice: 1,\n//   priceRange: \"0.95 - 1.05\",\n//   amounts: \"100 + 100\",\n//   lockDuration: \"7 days\"\n// }\n```\n\n## Features\n\n### ✅ Human-Friendly Inputs\n- Normal prices (1.0, 2.5) instead of sqrt_price_x64\n- Normal amounts (100, 500) instead of stroops\n- Percentages (1% slippage) instead of basis points\n- Days for lock duration instead of ledgers\n- Fee tier names ('VOLATILE') instead of numbers\n\n### ✅ Complete Integration\n- **Factory SDK**: Create pools\n- **Pool SDK**: Add/remove liquidity, swap, collect fees\n- **Automatic Conversions**: All technical formats handled\n\n### ✅ Type-Safe\n- Full TypeScript support\n- Autocomplete for all parameters\n- Compile-time error checking\n\n## Usage Examples\n\n### 1. Initialize SDK\n\n```typescript\nimport BeluSwapSDK from '@beluswap/sdk';\n\n// Option A: Use predefined network\nconst sdk = new BeluSwapSDK({\n  factoryAddress: 'CFACTORY...',\n  network: 'testnet', // or 'mainnet'\n});\n\n// Option B: Custom network\nconst sdk = new BeluSwapSDK({\n  factoryAddress: 'CFACTORY...',\n  rpcUrl: 'https://your-rpc-url',\n  networkPassphrase: 'Your Network ; Passphrase',\n});\n```\n\n### 2. Add Liquidity\n\n```typescript\n// Connect to pool\nconst pool = await sdk.getAndConnectPool({\n  tokenA: 'CDUSDC...',\n  tokenB: 'CDXLM...',\n  feeTier: 'VOLATILE',\n});\n\n// Add liquidity with normal numbers!\nconst addLiq = await pool.addLiquidity({\n  owner: 'GOWNER...',\n  amount0: 50,                   // 50 tokens!\n  amount1: 50,\n  priceRangeLower: 0.95,         // Normal prices!\n  priceRangeUpper: 1.05,\n  feeTier: 'VOLATILE',\n});\n\nconsole.log(addLiq.summary);\n// { priceRange: \"0.9500 - 1.0500\", amounts: \"50 + 50\" }\n```\n\n### 3. Execute Swap\n\n```typescript\nconst swap = await pool.swap({\n  sender: 'GTRADER...',\n  tokenIn: 'USDC',\n  amountIn: 10,                  // Normal amount!\n  slippagePercent: 1,            // 1%, not 100 bps!\n  priceLimit: 0.95,              // Optional\n});\n\nconsole.log(swap.summary);\n// {\n//   swapping: \"10 USDC\",\n//   estimatedOutput: \"~9.9700\",\n//   minimumOutput: \"9.9003\",\n//   slippage: \"1%\"\n// }\n```\n\n### 4. Check Position\n\n```typescript\nconst position = await pool.getPosition({\n  owner: 'GOWNER...',\n  priceRangeLower: 0.95,\n  priceRangeUpper: 1.05,\n  feeTier: 'VOLATILE',\n});\n\nconsole.log(position);\n// {\n//   amount0: 100,        // Human-readable!\n//   amount1: 100,\n//   feesOwed0: 0.5,\n//   feesOwed1: 0.5\n// }\n```\n\n## API Reference\n\n### BeluSwapSDK\n\nMain SDK class.\n\n#### Constructor\n\n```typescript\nnew BeluSwapSDK(config: {\n  factoryAddress: string;\n  poolAddress?: string;\n  network?: 'testnet' | 'mainnet';\n  rpcUrl?: string;\n  networkPassphrase?: string;\n})\n```\n\n#### Properties\n\n- `factory: BelugaFactorySDK` - Factory operations\n- `pool?: BelugaPoolSDK` - Pool operations (if connected)\n\n#### Methods\n\n- `connectPool(address: string): BelugaPoolSDK` - Connect to specific pool\n- `getAndConnectPool(params): Promise<BelugaPoolSDK>` - Get and connect pool\n\n---\n\n### BelugaFactorySDK\n\nFactory operations for pool creation.\n\n#### Methods\n\n##### `createPool(params): Promise<CreatePoolResult>`\n\nCreate a new pool.\n\n**Parameters:**\n- `creator: string` - Creator address\n- `tokenA: string` - Token A address\n- `tokenB: string` - Token B address\n- `feeTier: 'STABLE' | 'VOLATILE' | 'EXOTIC'` - Fee tier\n- `creatorFeePercent: number` - Creator fee (0.1-10%)\n- `initialPrice: number` - Initial price\n- `amount0: number` - Initial token0 amount\n- `amount1: number` - Initial token1 amount\n- `priceRangeLower: number` - Lower price bound\n- `priceRangeUpper: number` - Upper price bound\n- `lockDurationDays?: number` - Lock duration in days\n- `permanent?: boolean` - Permanent lock?\n\n**Returns:** Object with `summary`, `contractParams`, and `technical` details.\n\n##### `getPool(params): Promise<string | null>`\n\nGet pool address.\n\n##### `poolExists(params): Promise<boolean>`\n\nCheck if pool exists.\n\n---\n\n### BelugaPoolSDK\n\nPool operations for liquidity and swaps.\n\n#### Methods\n\n##### `addLiquidity(params): Promise<AddLiquidityResult>`\n\nAdd liquidity to pool.\n\n##### `removeLiquidity(params)`\n\nRemove liquidity from pool.\n\n##### `swap(params): Promise<SwapResult>`\n\nExecute a swap.\n\n##### `previewSwap(params): Promise<PreviewSwapResult>`\n\nPreview swap output (read-only, no gas).\n\n##### `getPosition(params): Promise<PositionInfo>`\n\nGet position information.\n\n##### `collectFees(params)`\n\nCollect accumulated fees.\n\n##### `getPoolState(): Promise<PoolState>`\n\nGet current pool state.\n\n---\n\n## Fee Tiers\n\nThree predefined fee tiers:\n\n| Tier | Fee | Tick Spacing | Use Case |\n|------|-----|--------------|----------|\n| STABLE | 0.05% | 10 | Stablecoin pairs |\n| VOLATILE | 0.30% | 60 | Normal volatile pairs |\n| EXOTIC | 1.00% | 200 | Exotic/meme tokens |\n\n## Examples\n\nSee [examples/](examples/) directory for complete examples:\n- `create-pool.ts` - Create a new pool\n- `add-liquidity.ts` - Add liquidity to pool\n- `swap.ts` - Execute swaps\n- `monitor-position.ts` - Monitor position value\n\n\n## License\n\nApache 2.0\n\n## Support\n\n- GitHub Issues: [github.com/Beluga-Swap/sdk/issues](https://github.com/Beluga-Swap/sdk/issues)\n- Discord: [discord.gg/belugaswap](https://discord.gg/belugaswap)\n- Email: support@beluswap.io\n","readmeFilename":"README.md"}