Skip to content

Commit

Permalink
Merge branch 'develop' into preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Anh Nguyen committed Aug 21, 2023
2 parents 761965d + d3c8d21 commit 2562e8e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 21 deletions.
22 changes: 18 additions & 4 deletions src/adapters/mochi-pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,18 +251,32 @@ class MochiPay extends Fetcher {
)
}

async approveTransferRequest({ requestCode }: { requestCode: string }) {
// [@anhnh] TODO: hard code appId for now, need a patch
async approveTransferRequest({
requestCode,
appId = "1",
}: {
requestCode: string
appId?: string
}) {
return await this.jsonFetch(
`${MOCHI_PAY_API_BASE_URL}/mochi-wallet/requests/${requestCode}/approved`,
`${MOCHI_PAY_API_BASE_URL}/applications/${appId}/requests/${requestCode}/approved`,
{
method: "POST",
}
)
}

async rejectTransferRequest({ requestCode }: { requestCode: string }) {
// [@anhnh] TODO: hard code appId for now, need a patch
async rejectTransferRequest({
requestCode,
appId = "1",
}: {
requestCode: string
appId?: string
}) {
return await this.jsonFetch(
`${MOCHI_PAY_API_BASE_URL}/mochi-wallet/requests/${requestCode}/rejected`,
`${MOCHI_PAY_API_BASE_URL}/applications/${appId}/requests/${requestCode}/rejected`,
{
method: "POST",
}
Expand Down
25 changes: 8 additions & 17 deletions src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,6 @@ export interface ModelOffchainTipBotToken {
updated_at?: string;
}

export interface ModelProductBotCommand {
code?: string;
created_at?: string;
description?: string;
discord_command?: string;
id?: number;
scope?: number;
telegram_command?: string;
updated_at?: string;
}

export interface ModelProductMetadataEmojis {
code?: string;
discord_id?: string;
Expand Down Expand Up @@ -794,7 +783,6 @@ export interface RequestTransferV2Request {
recipients?: string[];
sender?: string;
token?: string;
transfer_type?: "transfer" | "airdrop";
}

export interface RequestUnlinkBinance {
Expand Down Expand Up @@ -1914,6 +1902,10 @@ export interface ResponseNftWatchlistSuggestResponse {

export interface ResponseOffchainTipBotTransferToken {
amount_each?: number;
/**
* SenderID string `json:"sender_id"`
* Recipients string `json:"recipient_id"`
*/
id?: string;
total_amount?: number;
tx_id?: number;
Expand All @@ -1939,10 +1931,6 @@ export interface ResponsePaginationResponse {
total?: number;
}

export interface ResponseProductBotCommand {
data?: ModelProductBotCommand[];
}

export interface ResponseProfileAirdropCampaignResponse {
data?: ModelProfileAirdropCampaign;
}
Expand Down Expand Up @@ -2114,7 +2102,10 @@ export interface ResponseTopUser {

export interface ResponseTransferTokenV2Data {
amount_each?: number;
external_id?: string;
/**
* SenderID string `json:"sender_id"`
* Recipients string `json:"recipient_id"`
*/
id?: string;
total_amount?: number;
tx_id?: number;
Expand Down

0 comments on commit 2562e8e

Please sign in to comment.