-
Notifications
You must be signed in to change notification settings - Fork 6
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 #259 from rainlanguage/2024-02-15-fork-latest-bloc…
…k-on-launch 2024 02 15 fork latest block on launch
- Loading branch information
Showing
7 changed files
with
76 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
import { get } from 'svelte/store'; | ||
import { rpcUrl, chainId } from '$lib/stores/settings'; | ||
import { rpcUrl } from '$lib/stores/settings'; | ||
import { invoke } from '@tauri-apps/api'; | ||
|
||
export async function setChainIdFromRpc() { | ||
if(!get(rpcUrl).isValid) return; | ||
|
||
const val: number = await invoke('get_chainid', {rpcUrl: get(rpcUrl).value}); | ||
chainId.set(val); | ||
} | ||
export const getChainIdFromRpc = async (): Promise<number> => invoke('get_chainid', {rpcUrl: get(rpcUrl).value}); |
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,5 @@ | ||
import { get } from 'svelte/store'; | ||
import { rpcUrl } from '$lib/stores/settings'; | ||
import { invoke } from '@tauri-apps/api'; | ||
|
||
export const getForkBlockNumberFromRpc = async (): Promise<number> => invoke('get_block_number', {rpcUrl: get(rpcUrl).value}); |