-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* started implementing dynamic gas pricing * finished refactoring sdk * refactored sdk config * added new sdk config structure to core and kysor * refactored fee metrics * fixed sdk options * implemented fees in cosmostation * fixed linting errors
- Loading branch information
1 parent
b34f246
commit 67c5d46
Showing
30 changed files
with
441 additions
and
494 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
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
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,43 +1,48 @@ | ||
import { OfflineAminoSigner } from "@cosmjs/amino/build/signer"; | ||
import { OfflineSigner, Registry } from "@cosmjs/proto-signing"; | ||
import { GasPrice, SigningStargateClient } from "@cosmjs/stargate"; | ||
import { SDKConfig } from "../constants"; | ||
|
||
import { IConfig } from "../constants"; | ||
import * as KyveRegistryTx from "../registry/tx.registry"; | ||
import KyveClient from "./rpc-client/client"; | ||
import KyveWebClient from "./rpc-client/web.client"; | ||
|
||
export async function getSigningKyveClient( | ||
config: SDKConfig, | ||
config: IConfig, | ||
signer: OfflineSigner, | ||
aminoSigner: OfflineAminoSigner | null, | ||
walletName?: undefined, | ||
defaultTypes?: undefined | ||
): Promise<KyveClient>; | ||
|
||
export async function getSigningKyveClient( | ||
config: SDKConfig, | ||
config: IConfig, | ||
signer: OfflineSigner, | ||
aminoSigner: OfflineAminoSigner | null, | ||
walletName?: string, | ||
defaultTypes?: undefined | ||
): Promise<KyveWebClient>; | ||
|
||
export async function getSigningKyveClient( | ||
config: SDKConfig, | ||
config: IConfig, | ||
signer: OfflineSigner, | ||
aminoSigner: OfflineAminoSigner | null, | ||
walletName?: string | ||
): Promise<KyveWebClient | KyveClient> { | ||
const registry = new Registry([...KyveRegistryTx.registry]); | ||
const gasPrice = GasPrice.fromString("0tkyve"); | ||
const gasPrice = GasPrice.fromString(`${config.gasPrice}${config.coinDenom}`); | ||
|
||
const client: SigningStargateClient = | ||
await SigningStargateClient.connectWithSigner(config.rpc, signer, { | ||
registry, | ||
gasPrice, | ||
}); | ||
|
||
const [account] = await signer.getAccounts(); | ||
if (typeof walletName === "string") | ||
|
||
if (typeof walletName === "string") { | ||
return new KyveWebClient(client, account, config, aminoSigner, walletName); | ||
} | ||
|
||
return new KyveClient(client, account, config, aminoSigner); | ||
} |
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
Oops, something went wrong.