From 9df2a9d618ad42aa2b50c185e596de4a4f1abcf0 Mon Sep 17 00:00:00 2001 From: therealmal <44868259+TheRealMal@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:04:20 +0300 Subject: [PATCH] bigint to string --- README.md | 8 ++++---- package-lock.json | 4 ++-- package.json | 2 +- quickstart/get-participants.ts | 2 +- quickstart/post-event.ts | 2 +- src/index.ts | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7628ac3..e51031f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ async function main() { 'API_KEY', ) - const participantByTG = await client.getParticipantByTG(BigInt(1)) + const participantByTG = await client.getParticipantByTG('1') const participantByWallet = await client.getParticipantByWallet("EQAt_V50zZzQW7hjFtqaj20ZPnN7fp4F5X_cKQWxkt_DMEl9") console.log(participantByTG.data, participantByWallet.data) @@ -52,7 +52,7 @@ async function main() { const events: ExternalEvent[] = [ { slug: 'test-1', // Event slug - telegramId: BigInt(1), // Telegram ID to identify user or wallet address + telegramId: '1', // Telegram ID to identify user or wallet address isDelete: true, // If task should be deleted }, { @@ -72,7 +72,7 @@ cURL example curl -X POST https://api.joincommunity.xyz/external/events \ -H "api-key: API_KEY" \ -H "Content-Type: application/json" \ --d '[{"slug":"some-unique-slug","telegramId":1,"isDelete":true}]' +-d '[{"slug":"some-unique-slug","telegramId":"1","isDelete":true}]' ``` ## API @@ -118,7 +118,7 @@ Post external events [ { "slug": "example-slug-1", - "telegramId": 1, + "telegramId": "1", "isDelete": true, }, { diff --git a/package-lock.json b/package-lock.json index c5eb933..f54a83e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "community-bot-api", - "version": "1.0.7", + "version": "1.0.8", "lockfileVersion": 3, "requires": true, "packages": { @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "axios": "^1.7.7", - "community-bot-api": "^1.0.7" + "community-bot-api": "^1.0.8" }, "devDependencies": { "@types/node": "^22.5.4", diff --git a/package.json b/package.json index 1fc684f..b8353c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "community-bot-api", - "version": "1.0.7", + "version": "1.0.8", "description": "This SDK provides simple interface for interacting with Community external API. It enables developers to seamlessly integrate service's features into their applications, allowing easy communication with API, participants retrieval and external events posting.", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/quickstart/get-participants.ts b/quickstart/get-participants.ts index e52407b..a3e57e7 100644 --- a/quickstart/get-participants.ts +++ b/quickstart/get-participants.ts @@ -5,7 +5,7 @@ async function main() { 'API_KEY', ) - const participantByTG = await client.getParticipantByTG(BigInt(1)) + const participantByTG = await client.getParticipantByTG('1') const participantByWallet = await client.getParticipantByWallet("EQAt_V50zZzQW7hjFtqaj20ZPnN7fp4F5X_cKQWxkt_DMEl9") console.log(participantByTG.data, participantByWallet.data) diff --git a/quickstart/post-event.ts b/quickstart/post-event.ts index 77aeaa2..c09c8fa 100644 --- a/quickstart/post-event.ts +++ b/quickstart/post-event.ts @@ -8,7 +8,7 @@ async function main() { const events: ExternalEvent[] = [ { slug: 'test-1', // Event slug - telegramId: BigInt(1), // Telegram ID to identify user or wallet address + telegramId: '1', // Telegram ID to identify user or wallet address isDelete: true, // If task should be deleted }, { diff --git a/src/index.ts b/src/index.ts index b11f1a9..affc299 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import axios from 'axios' export interface ExternalEvent { slug: string, // Event slug - telegramId?: BigInt, // Telegram ID to identify user or wallet address + telegramId?: string, // Telegram ID to identify user or wallet address walletAddress?: string, // e.g: EQAt_V50zZzQW7hjFtqaj20ZPnN7fp4F5X_cKQWxkt_DMEl9 isDelete?: boolean // If task should be deleted } @@ -67,7 +67,7 @@ export class ApiClient { } } - async getParticipantByTG(telegramId: BigInt) { + async getParticipantByTG(telegramId: string) { try { const response = await axios.get( `${ApiClient.API_URL}${ApiClient.API_PARTICIPANT_TG}/${telegramId}`,