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 authored and sxzz committed May 15, 2023
1 parent 364bc0b commit 04f3a7a
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,
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 04f3a7a

Please sign in to comment.