Skip to content

Commit 6f30a0f

Browse files
authored
add send tx for FET / ZETA (#113)
1 parent d56cb86 commit 6f30a0f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/services/fet.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,21 @@ export class FetService extends Service {
117117
return data;
118118
}
119119

120+
/**
121+
* Craft fetch.ai send transaction
122+
* @param pubkey wallet pubkey, this is different from the wallet address
123+
* @param to recipient address
124+
* @param amountFet how many tokens to send in FET
125+
*/
126+
async craftSendTx(pubkey: string, to: string, amountFet: number): Promise<CosmosTx> {
127+
const { data } = await api.post<CosmosTx>(`/v1/fet/transaction/send`, {
128+
pubkey: pubkey,
129+
amount_afet: this.fetToAfet(amountFet.toString()),
130+
to: to,
131+
});
132+
return data;
133+
}
134+
120135
/**
121136
* Sign transaction with given integration
122137
* @param integration custody solution to sign with

src/services/zeta.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,21 @@ export class ZetaService extends Service {
117117
return data;
118118
}
119119

120+
/**
121+
* Craft zeta send transaction
122+
* @param pubkey wallet pubkey, this is different from the wallet address
123+
* @param to recipient address
124+
* @param amountZeta how many tokens to send in ZETA
125+
*/
126+
async craftSendTx(pubkey: string, to: string, amountZeta: number): Promise<CosmosTx> {
127+
const { data } = await api.post<CosmosTx>(`/v1/zeta/transaction/send`, {
128+
pubkey: pubkey,
129+
amount_azeta: this.zetaToAZeta(amountZeta.toString()),
130+
to: to,
131+
});
132+
return data;
133+
}
134+
120135
/**
121136
* Sign transaction with given integration
122137
* @param integration custody solution to sign with

0 commit comments

Comments
 (0)