{"_id":"@ascendry/sdk","_rev":"3-ae3361e9dda8c94487c44c093aa84757","name":"@ascendry/sdk","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@ascendry/sdk","version":"1.0.0","keywords":["typescript","models","ascendry","api","sdk"],"author":{"name":"Rastaar Haghi"},"license":"MIT","_id":"@ascendry/sdk@1.0.0","maintainers":[{"name":"ascendry","email":"rastaar@ascendry.io"}],"dist":{"shasum":"2548f0707647d7d8a121be7b9ff87dc13d3ee103","tarball":"https://registry.npmjs.org/@ascendry/sdk/-/sdk-1.0.0.tgz","fileCount":138,"integrity":"sha512-mKR3OnXumwv/5ENjNWaoZOpMWXRJDg1zaOeRE2JldRDSNnemuUT7C5Llkn73POZKI+prpQShg9gxGOv4nHORiA==","signatures":[{"sig":"MEUCIFtuQT8ebpuPA3JOepNBwrSP87TCi0rtoSSEZYF8taSGAiEAj00dkh37A+Ofw+oaPaSgewluOMEUdXqqqvdBhGM0uC0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52369},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"c355e607b7f8c2ee63ab0a8f6ffee6f478a86c82","scripts":{"build":"tsc","clean":"rm -rf dist","format":"prettier --write 'src/**/*.{js,ts,json,md}'","prepare":"npm run clean && npm run build"},"_npmUser":{"name":"ascendry","actor":{"name":"ascendry","type":"user","email":"rastaar@ascendry.io"},"email":"rastaar@ascendry.io"},"_npmVersion":"11.1.0","description":"SDK for the Ascendry API (https://ascendry.io/)","directories":{},"_nodeVersion":"22.13.0","dependencies":{"axios":"^1.9.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.3.2","typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1751680197543_0.23006982738510406","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@ascendry/sdk","version":"1.0.1","keywords":["typescript","models","ascendry","api","sdk"],"author":{"name":"Rastaar Haghi"},"license":"MIT","_id":"@ascendry/sdk@1.0.1","maintainers":[{"name":"ascendry","email":"rastaar@ascendry.io"}],"dist":{"shasum":"958512a1267eeddbd01eaa326b9e95a7e9dc9a03","tarball":"https://registry.npmjs.org/@ascendry/sdk/-/sdk-1.0.1.tgz","fileCount":138,"integrity":"sha512-d3mNE1tCK/WbGzMWN+fx0JS64I48VIZubqJqccaNVtybZQCw6ImovnISyI8Com8RHvGJ0ViGf9kIRwyT8i+/Lg==","signatures":[{"sig":"MEUCIFZqIwvc7SnMWmor76yJUTaZOFhKa2ryvhsd0QaSU0Q6AiEAmqAil/J+JsTN4rjY+E2ufw5QbmnFedUoKJdO2kOyGxs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52418},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"11c3fcbfc35779bc4c86dd05d5089fa04704d3c2","scripts":{"build":"tsc","clean":"rm -rf dist","format":"prettier --write 'src/**/*.{js,ts,json,md}'","prepare":"npm run clean && npm run build"},"_npmUser":{"name":"ascendry","actor":{"name":"ascendry","type":"user","email":"rastaar@ascendry.io"},"email":"rastaar@ascendry.io"},"_npmVersion":"11.1.0","description":"SDK for the Ascendry API (https://ascendry.io/)","directories":{},"_nodeVersion":"22.13.0","dependencies":{"axios":"^1.9.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.3.2","typescript":"^5.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.1_1751680405315_0.4373247363922621","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@ascendry/sdk","version":"1.0.2","publishConfig":{"access":"public"},"description":"SDK for the Ascendry API (https://ascendry.io/)","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","clean":"rm -rf dist","prepare":"npm run clean && npm run build","format":"prettier --write 'src/**/*.{js,ts,json,md}'"},"keywords":["typescript","models","ascendry","api","sdk"],"author":{"name":"Rastaar Haghi"},"license":"MIT","devDependencies":{"typescript":"^5.0.0","prettier":"^3.3.2"},"dependencies":{"axios":"^1.9.0"},"_id":"@ascendry/sdk@1.0.2","gitHead":"71374b8d729f2970e7196b7fd993764871ff6b3d","_nodeVersion":"22.13.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-B4xGgwXtTbhaQZqPCUcjmOiXkicKYhmIJXFNb4wPMi+hQ8agFXHvgSBHhjX+KsmjlOyjZ1Kk5ESPJUvfi+99NQ==","shasum":"7f2c2c8167fd56044e83c5b2fd7bc2b3a580b6de","tarball":"https://registry.npmjs.org/@ascendry/sdk/-/sdk-1.0.2.tgz","fileCount":138,"unpackedSize":52429,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF0B0vcFmbMB2Ks3RYmAFLc0gaz7ypKBNGAu2vqEqpm6AiEApS2TqB7brQK+gCyv4fBmlkbplh2skkhk5diEQobQF+0="}]},"_npmUser":{"name":"ascendry","email":"rastaar@ascendry.io","actor":{"name":"ascendry","email":"rastaar@ascendry.io","type":"user"}},"directories":{},"maintainers":[{"name":"ascendry","email":"rastaar@ascendry.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.2_1751784591990_0.29024716187777844"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-05T01:49:57.460Z","modified":"2025-07-06T06:49:52.331Z","1.0.0":"2025-07-05T01:49:57.759Z","1.0.1":"2025-07-05T01:53:25.524Z","1.0.2":"2025-07-06T06:49:52.166Z"},"author":{"name":"Rastaar Haghi"},"license":"MIT","keywords":["typescript","models","ascendry","api","sdk"],"description":"SDK for the Ascendry API (https://ascendry.io/)","maintainers":[{"name":"ascendry","email":"rastaar@ascendry.io"}],"readme":"# Ascendry SDK\n\nA comprehensive TypeScript SDK for interacting with the Ascendry.io API, providing shared models, types, and a client for seamless integration.\n\n## Overview\n\nThe Ascendry SDK is a core package that provides:\n- **Shared TypeScript models** ensuring type consistency across frontend and backend applications\n- **API client** for direct interaction with the Ascendry Vault API\n- **Complete type definitions** for all API requests, responses, and domain models\n- **Transaction generation** utilities for Solana blockchain operations\n\n## Purpose\n\nThe primary goals of this package are to:\n\n- Maintain consistent data structures across the entire application stack\n- Provide a unified client for API interactions\n- Reduce duplication of type definitions and API calls\n- Ensure type safety between frontend and backend\n- Simplify API contract management\n- Enable better developer experience with shared types and utilities\n\n## Installation\n\n```bash\nnpm install @ascendry/sdk\n```\n\n## Dependencies\n\nThis package uses:\n- TypeScript ^5.0.0\n- axios ^1.9.0\n\n## Usage\n\n### API Client\n\n```typescript\nimport { AscendryClient } from '@ascendry/sdk';\n\n// Initialize the client with your API key\nconst client = new AscendryClient('your-api-key');\n\n// Get vault NFTs for a specific owner\nconst nfts = await client.getVaultNfts('owner-address', '', 10);\n\n// Get loans for an NFT\nconst loans = await client.getLoansByNftMintAddress('nft-mint-address');\n\n// Create a vendor listing\nconst listingResponse = await client.createVendorListing({\n  vendorAddress: 'vendor-address',\n  listingData: { /* listing data */ }\n});\n\n// Generate unsigned loan transaction\nconst transaction = await client.generateUnsignedLoanTransaction({\n  loanInstructionType: 'STAKE_NFT_FOR_LOAN',\n  nftMintAddress: 'nft-mint-address',\n  loanAmount: 1000000, // in lamports\n  loanDuration: 30 // days\n});\n```\n\n### Type Imports\n\n```typescript\nimport { \n  NFTData, \n  LoanInfo, \n  VendorListingData,\n  GetNftsResponse,\n  LoanInstructionRequest,\n  AssetRedemptionInstructionRequest\n} from '@ascendry/sdk';\n\n// Use the types in your components\nconst nft: NFTData = {\n  // ... NFT data\n};\n\nconst loan: LoanInfo = {\n  // ... loan information\n};\n```\n\n## Available Models\n\n### API Client Methods\n\n#### NFT Operations\n- `getVaultNfts(nftOwnerAddress?, lastEvaluatedKey, paginationSize?)` - Get NFTs by owner\n- `getVaultNftsByMint(nftMintAddress)` - Get NFT by mint address\n- `getNftHistory(nftMintAddress, lastEvaluatedKey, paginationSize?)` - Get NFT transaction history\n\n#### Loan Operations\n- `getLoans(status?, lastEvaluatedKey?, paginationSize?)` - Get loans with optional filtering\n- `getLoansByNftMintAddress(nftMintAddress)` - Get loans for specific NFT\n- `generateUnsignedLoanTransaction(loanInstructionRequest)` - Generate loan transactions\n\n#### Asset Redemption Operations\n- `getAssetRedemptionInfo(nftMintAddress)` - Get asset redemption information\n- `generateUnsignedAssetRedemptionTransaction(assetRedemptionInstructionRequest)` - Generate redemption transactions\n- `submitAssetRedemptionRequest(submitAssetRedemptionRequest)` - Submit redemption requests\n\n#### Vendor Operations\n- `getVendorInfo(vendorAddress)` - Get vendor information\n- `createVendorListing(uploadVendorListingRequest)` - Create new vendor listing\n- `getVendorListings(vendorAddress)` - Get vendor's listings\n- `getVendorListingById(listingId)` - Get specific listing by ID\n- `cancelVendorListing(cancelVendorListingRequest)` - Cancel vendor listing\n\n#### File Operations\n- `getPresignedUrl(getPresignedUrlRequest)` - Get presigned URL for file upload\n- `getPresignedUrlForViewing(fileKey)` - Get presigned URL for file viewing\n\n#### Transaction Operations\n- `submitTransactionToRpc(serializedTransaction)` - Submit signed transaction to RPC\n- `generateMemoTransaction(data)` - Generate memo transaction\n\n### API Models\n\n#### Requests\n- `AssetRedemptionInstructionRequest` - Asset redemption transaction requests\n- `BaseLoanInstructionRequest` - Base loan instruction requests\n- `CancelLoanRequest` - Cancel loan requests\n- `CancelVendorListingRequest` - Cancel vendor listing requests\n- `ClaimDelinquentNftRequest` - Claim delinquent NFT requests\n- `GetAssetRedemptionInfoRequest` - Get asset redemption info requests\n- `GetLoansRequest` - Get loans requests\n- `GetNftHistoryRequest` - Get NFT history requests\n- `GetNftsRequest` - Get NFTs requests\n- `GetPresignedUrlForViewingRequest` - Get presigned URL requests\n- `GetPresignedVendorMediaFileUrlRequest` - Get vendor media presigned URL requests\n- `GetVendorInfoRequest` - Get vendor info requests\n- `GetVendorListingByIdRequest` - Get vendor listing by ID requests\n- `GetVendorListingsRequest` - Get vendor listings requests\n- `LoanInstructionRequest` - Loan instruction requests\n- `ProvideLoanLiquidityRequest` - Provide loan liquidity requests\n- `RepayLoanRequest` - Repay loan requests\n- `StakeNftForLoanRequest` - Stake NFT for loan requests\n- `SubmitAssetRedemptionRequest` - Submit asset redemption requests\n- `UploadVendorListingRequest` - Upload vendor listing requests\n\n#### Responses\n- `AssetRedemptionTransactionResponse` - Asset redemption transaction responses\n- `CancelVendorListingResponse` - Cancel vendor listing responses\n- `GetAssetRedemptionInfoResponse` - Get asset redemption info responses\n- `GetLoansResponse` - Get loans responses\n- `GetNftHistoryResponse` - Get NFT history responses\n- `GetNftsResponse` - Get NFTs responses\n- `GetPresignedUrlForViewingResponse` - Get presigned URL responses\n- `GetPresignedVendorMediaFileUrlResponse` - Get vendor media presigned URL responses\n- `GetVendorInfoResponse` - Get vendor info responses\n- `GetVendorListingByIdResponse` - Get vendor listing by ID responses\n- `GetVendorListingsResponse` - Get vendor listings responses\n- `LoanTransactionResponse` - Loan transaction responses\n- `SubmitAssetRedemptionResponse` - Submit asset redemption responses\n- `UploadVendorListingResponse` - Upload vendor listing responses\n\n### Domain Models\n\n#### NFTs\n- `NFTData` - Complete NFT information including metadata\n- `NftMediaFile` - Media file information for NFTs\n- `NftAttribute` - NFT attribute key-value pairs\n\n#### Loans\n- `LoanInfo` - Complete loan information\n- `LoanInstructionType` - Enum for different loan instruction types (STAKE_NFT_FOR_LOAN, PROVIDE_LOAN_LIQUIDITY, REPAY_LOAN, etc.)\n\n#### Asset Redemptions\n- `AssetRedemptionFormData` - Asset redemption form data\n- `AssetRedemptionInstructionType` - Enum for asset redemption instruction types\n\n#### Listings\n- `VendorListingData` - Base vendor listing information\n- `VendorListingAttribute` - Listing attribute key-value pairs\n- `ListingStatus` - Enum for listing states (INITIATED, CANCELLED, MINTED, BURNED)\n- `CompleteVendorListing` - Extended vendor listing with additional metadata\n\n#### Events\n- `BaseNftHistoricEvent` - Base NFT historic event\n- `LoanNftHistoricEvent` - Loan-related NFT historic event\n- `NftHistoricEventCategory` - NFT historic event categories\n- `NftHistoricEventType` - NFT historic event types\n\n## API Endpoints\n\nThe SDK provides access to the following API endpoints:\n\n- **Base URL**: `https://ycz7f841lj.execute-api.us-west-2.amazonaws.com/dev/v1`\n- **Authentication**: API key required via `x-api-key` header\n- **Content-Type**: `application/json`\n\n## Development\n\n### Building the Package\n\n```bash\nnpm run build\n```\n\nThis will:\n1. Clean the previous build using `npm run clean`\n2. Compile the TypeScript files using `tsc`\n3. Generate appropriate type definitions\n\n### Development Scripts\n\n- `npm run build` - Build the package\n- `npm run clean` - Clean the dist directory\n- `npm run prepare` - Clean and build (runs automatically on npm install)\n\nWhen making changes:\n- **Major version**: Breaking changes to the API or client interface\n- **Minor version**: New features that are backward compatible\n- **Patch version**: Backward compatible bug fixes\n\n## Contributing\n\nWhen adding new models or modifying existing ones:\n\n1. Ensure the changes are backward compatible\n2. Update the documentation\n3. Add appropriate tests\n4. Follow the existing type naming conventions\n5. Consider the impact on both frontend and backend\n6. Update the API client if adding new endpoints\n\n## Best Practices\n\n1. **Type Consistency**: Always use the shared types from this package instead of creating local type definitions\n2. **API Client**: Use the `AscendryClient` for all API interactions to ensure consistency\n3. **Error Handling**: Implement proper error handling for API calls\n4. **Documentation**: Add JSDoc comments to all new types and interfaces\n5. **Validation**: Consider adding runtime validation for critical types\n6. **Versioning**: Be mindful of version compatibility when making changes\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details. ","readmeFilename":"README.md"}