Skip to content

Commit

Permalink
add send tx for FET / ZETA
Browse files Browse the repository at this point in the history
  • Loading branch information
nooxx committed Aug 1, 2024
1 parent 9840226 commit 7df7863
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/services/fet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ export class FetService extends Service {
return data;
}

/**
* Craft fetch.ai send transaction
* @param pubkey wallet pubkey, this is different from the wallet address
* @param to recipient address
* @param amountFet how many tokens to send in FET
*/
async craftSendTx(pubkey: string, to: string, amountFet: number): Promise<CosmosTx> {
const { data } = await api.post<CosmosTx>(`/v1/fet/transaction/send`, {
pubkey: pubkey,
amount_afet: this.fetToAfet(amountFet.toString()),
to: to,
});
return data;
}

/**
* Sign transaction with given integration
* @param integration custody solution to sign with
Expand Down
15 changes: 15 additions & 0 deletions src/services/zeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ export class ZetaService extends Service {
return data;
}

/**
* Craft zeta send transaction
* @param pubkey wallet pubkey, this is different from the wallet address
* @param to recipient address
* @param amountZeta how many tokens to send in ZETA
*/
async craftSendTx(pubkey: string, to: string, amountZeta: number): Promise<CosmosTx> {
const { data } = await api.post<CosmosTx>(`/v1/zeta/transaction/send`, {
pubkey: pubkey,
amount_azeta: this.zetaToAZeta(amountZeta.toString()),
to: to,
});
return data;
}

/**
* Sign transaction with given integration
* @param integration custody solution to sign with
Expand Down

0 comments on commit 7df7863

Please sign in to comment.