Skip to content

Commit

Permalink
feat(indexer): add tipCharacter and tipCharacterForNote to newbie
Browse files Browse the repository at this point in the history
  • Loading branch information
Songkeys committed May 15, 2023
1 parent ce91b24 commit 3bac620
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/indexer/subapis/newbie.ts
@@ -1,5 +1,6 @@
import { type Address } from 'viem'
import {
type Numberish,
type CharacterMetadata,

Check failure on line 4 in src/indexer/subapis/newbie.ts

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 18.x)

Member 'CharacterMetadata' of the import declaration should be sorted alphabetically
type EmailUserEntity,
type LinkItemNote,
Expand Down Expand Up @@ -277,6 +278,44 @@ export class NewbieIndexer {
)
}

tipCharacter({
characterId,
amount,
}: {
characterId: Numberish
/** amount to tip. (CSB in wei) */
amount: Numberish
}) {
return this.base.fetch<{ transactionHash: string; data: boolean }>(
`/newbie/contract/tips`,
{
method: 'POST',
data: { characterId, amount },
token: this.token,
},
)
}

tipCharacterForNote({
characterId,
noteId,
amount,
}: {
characterId: Numberish
noteId: Numberish
/** amount to tip. (CSB in wei) */
amount: Numberish
}) {
return this.base.fetch<{ transactionHash: string; data: boolean }>(
`/newbie/contract/tips`,
{
method: 'POST',
data: { characterId, noteId, amount },
token: this.token,
},
)
}

/**
* Get proofs for withdraw to call `withdraw` contract method on client
*/
Expand Down

0 comments on commit 3bac620

Please sign in to comment.