-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stéphane Prohaszka <[email protected]>
- Loading branch information
1 parent
159c82e
commit 2798f33
Showing
5 changed files
with
39 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
import { Transaction as StellarSdkTransaction } from "@stellar/stellar-sdk"; | ||
|
||
// https://developers.stellar.org/docs/learn/encyclopedia/network-configuration/network-passphrases | ||
// Mainnet | ||
const NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015"; | ||
// Testnet | ||
// const NETWORK_PASSPHRASE = "Test SDF Network ; September 2015"; | ||
import { Networks, Transaction as StellarSdkTransaction } from "@stellar/stellar-sdk"; | ||
|
||
export function combine(transaction: string, signature: string, publicKey: string): string { | ||
const unsignedTx = new StellarSdkTransaction(transaction, NETWORK_PASSPHRASE); | ||
const unsignedTx = new StellarSdkTransaction(transaction, Networks.PUBLIC); | ||
unsignedTx.addSignature(publicKey, signature); | ||
return unsignedTx.toXDR(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { fetchBaseFee } from "../network"; | ||
|
||
export async function estimateFees(): Promise<bigint> { | ||
const fees = await fetchBaseFee(); | ||
return BigInt(fees.recommendedFee); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export { broadcast } from "./broadcast"; | ||
export { combine } from "./combine"; | ||
export { craftTransaction } from "./craftTransaction"; | ||
// export { estimateFees } from "./estimateFees"; | ||
export { estimateFees } from "./estimateFees"; | ||
export { getBalance } from "./getBalance"; | ||
export { lastBlock } from "./lastBlock"; | ||
export { listOperations } from "./listOperations"; |