@ton-api/client
Advanced tools
Comparing version 0.1.1 to 0.2.0-beta.0
{ | ||
"name": "@ton-api/client", | ||
"version": "0.1.1", | ||
"version": "0.2.0-beta.0", | ||
"description": "Autogenerated SDK for tonapi.io", | ||
@@ -35,9 +35,9 @@ "keywords": [ | ||
"generate": "npm run clean && npx tsx ./src/generate.ts && npm run test && npx tsc", | ||
"prepublishOnly": "npm run generate && npm run check-git-status", | ||
"patch": "npm run generate && git diff --quiet || (npm version patch && npm run generate)", | ||
"prepublishOnly": "npm run generate && git diff --quiet || (echo 'Error: Uncommitted changes detected.' && exit 1)", | ||
"test": "jest --runInBand", | ||
"clean": "rimraf ./dist", | ||
"check-git-status": "bash -c '[ -z \"$(git status --porcelain)\" ] || (echo \"Error: Uncommitted changes detected.\" && exit 1)'" | ||
"clean": "rimraf ./dist" | ||
}, | ||
"devDependencies": { | ||
"@ton/core": "^0.56.0", | ||
"@ton/core": "^0.59.0", | ||
"@types/jest": "^29.5.12", | ||
@@ -58,3 +58,3 @@ "@types/json-bigint": "^1.0.4", | ||
"peerDependencies": { | ||
"@ton/core": ">=0.56.0" | ||
"@ton/core": ">=0.59.0" | ||
}, | ||
@@ -61,0 +61,0 @@ "dependencies": { |
@@ -14,3 +14,3 @@ # @ton-api/client | ||
Additionally, we offer [`@ton-api/ton-adapter`](https://www.npmjs.com/package/@ton-api/ton-adapter), a companion package that allows users of `@ton/ton` to leverage the functionality of `@ton-api/client` while maintaining their existing code structure. | ||
Additionally, [`@ton-api/ton-adapter`](https://www.npmjs.com/package/@ton-api/ton-adapter) enables users to work with contracts written for `@ton/ton` through `@ton-api/client`, ensuring seamless integration while maintaining their existing code structure. | ||
@@ -41,7 +41,7 @@ ## Prerequisites | ||
```javascript | ||
import { TonApiClient, Api } from '@ton-api/client'; | ||
import { TonApiClient } from '@ton-api/client'; | ||
import { Address } from '@ton/core'; | ||
// Configure the client | ||
const http = new TonApiClient({ | ||
// Initialize the TonApi | ||
const ta = new TonApiClient({ | ||
baseUrl: 'https://tonapi.io', | ||
@@ -51,10 +51,7 @@ apiKey: 'YOUR_API_KEY' | ||
// Initialize the API | ||
const api = new Api(http); | ||
// Use the API | ||
async function fetchAccountEvents() { | ||
const address = Address.parse('YOUR_ADDRESS_HERE'); | ||
const events = await api.accounts.getAccountEvents(address, { limit: 50 }) | ||
const events = await ta.accounts.getAccountEvents(address, { limit: 50 }) | ||
console.log('Account events:', events) | ||
@@ -77,3 +74,3 @@ } | ||
api.nft.getNftCollection(collectionAddress) | ||
ta.nft.getNftCollection(collectionAddress) | ||
.then(collection => console.log('NFT Collection:', collection)) | ||
@@ -88,3 +85,3 @@ .catch(error => console.error('Error fetching NFT collection:', error)); | ||
api.jettons.getJettonInfo(jettonAddress) | ||
ta.jettons.getJettonInfo(jettonAddress) | ||
.then(jetton => console.log('Jetton Info:', jetton)) | ||
@@ -91,0 +88,0 @@ .catch(error => console.error('Error fetching jetton info:', error)); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
325761
9265
89