Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add send tx for FET / ZETA #113

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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