-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #822 from EdgeApp/matthew/thorchain-engine
(Thorchain) Replace rpc tx_search with midgard transaction query
- Loading branch information
Showing
8 changed files
with
456 additions
and
178 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { | ||
EdgeCurrencyEngine, | ||
EdgeCurrencyEngineOptions, | ||
EdgeWalletInfo | ||
} from 'edge-core-js/types' | ||
|
||
import { PluginEnvironment } from '../common/innerPlugin' | ||
import { CosmosTools } from './CosmosTools' | ||
import { asSafeCosmosWalletInfo, CosmosNetworkInfo } from './cosmosTypes' | ||
import { CosmosEngine } from './engine/CosmosEngine' | ||
import { ThorchainEngine } from './engine/ThorchainEngine' | ||
import { isThorchainEnvironment, ThorchainNetworkInfo } from './thorchainTypes' | ||
|
||
export { CosmosEngine } from './engine/CosmosEngine' | ||
export { ThorchainEngine } from './engine/ThorchainEngine' | ||
|
||
export async function makeCurrencyEngine( | ||
env: PluginEnvironment<CosmosNetworkInfo | ThorchainNetworkInfo>, | ||
tools: CosmosTools, | ||
walletInfo: EdgeWalletInfo, | ||
opts: EdgeCurrencyEngineOptions | ||
): Promise<EdgeCurrencyEngine> { | ||
const safeWalletInfo = asSafeCosmosWalletInfo(walletInfo) | ||
console.debug('isThorchainEnvironment', isThorchainEnvironment(env)) | ||
const engine = isThorchainEnvironment(env) | ||
? new ThorchainEngine(env, tools, safeWalletInfo, opts) | ||
: new CosmosEngine(env, tools, safeWalletInfo, opts) | ||
|
||
await engine.loadEngine() | ||
|
||
return engine | ||
} |
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.