From 7df7863b268b8fbc8a46ef06f216e1c56259270c Mon Sep 17 00:00:00 2001 From: Arno Simon Date: Thu, 1 Aug 2024 11:58:52 +0200 Subject: [PATCH] add send tx for FET / ZETA --- src/services/fet.ts | 15 +++++++++++++++ src/services/zeta.ts | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/services/fet.ts b/src/services/fet.ts index 19d306e..fb15363 100644 --- a/src/services/fet.ts +++ b/src/services/fet.ts @@ -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 { + const { data } = await api.post(`/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 diff --git a/src/services/zeta.ts b/src/services/zeta.ts index 8e827e3..b4f62fa 100644 --- a/src/services/zeta.ts +++ b/src/services/zeta.ts @@ -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 { + const { data } = await api.post(`/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