Skip to content

Commit

Permalink
bigint to string
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealMal committed Sep 11, 2024
1 parent 6e435a1 commit 9df2a9d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
},
{
Expand All @@ -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
Expand Down Expand Up @@ -118,7 +118,7 @@ Post external events
[
{
"slug": "example-slug-1",
"telegramId": 1,
"telegramId": "1",
"isDelete": true,
},
{
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion quickstart/get-participants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion quickstart/post-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
{
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -67,7 +67,7 @@ export class ApiClient {
}
}

async getParticipantByTG(telegramId: BigInt) {
async getParticipantByTG(telegramId: string) {
try {
const response = await axios.get<ExternalParticipantResponse>(
`${ApiClient.API_URL}${ApiClient.API_PARTICIPANT_TG}/${telegramId}`,
Expand Down

0 comments on commit 9df2a9d

Please sign in to comment.