Skip to content

Commit

Permalink
feat(indexer): add tipCharacter and tipCharacterForNote to newbie (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: 三咲智子 Kevin Deng <[email protected]>
  • Loading branch information
Songkeys and sxzz committed May 15, 2023
1 parent 364bc0b commit 2ffbfff
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/indexer/subapis/newbie.ts
Expand Up @@ -6,6 +6,7 @@ import {
type LinkItemType,
type NoteEntity,
type NoteMetadata,
type Numberish,
} from '../../types'
import { type BaseIndexer } from './base'

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 2ffbfff

Please sign in to comment.