Skip to content

Commit

Permalink
add quai-qi conversion to provider
Browse files Browse the repository at this point in the history
wip

wip

working get quai-ci rates at latest and historical block

only have methods in abstract

wip

remove switch from _perform

wip

q capitalization

build

clean up

build

npm i && build
  • Loading branch information
robertlincecum authored and Denis2626 committed Mar 14, 2024
1 parent b6e0de6 commit 61b90dd
Show file tree
Hide file tree
Showing 17 changed files with 202 additions and 8 deletions.
12 changes: 12 additions & 0 deletions lib.commonjs/providers/abstract-provider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ export type PerformActionRequest = {
} | {
method: "getTransactionResult";
hash: string;
} | {
method: "getQiRateAtBlock";
blockTag: BlockTag;
amt: number;
} | {
method: "getQuaiRateAtBlock";
blockTag: BlockTag;
amt: number;
};
/**
* Options for configuring some internal aspects of an [[AbstractProvider]].
Expand Down Expand Up @@ -258,6 +266,10 @@ export declare class AbstractProvider implements Provider {
* [[Network]] if necessary.
*/
constructor(_network?: "any" | Networkish, options?: AbstractProviderOptions);
getLatestQuaiRate(amt?: number): Promise<bigint>;
getQuaiRateAtBlock(blockTag: BlockTag, amt?: number): Promise<bigint>;
getLatestQiRate(amt?: number): Promise<bigint>;
getQiRateAtBlock(blockTag: BlockTag, amt?: number): Promise<bigint>;
get pollingInterval(): number;
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
Expand Down
2 changes: 1 addition & 1 deletion lib.commonjs/providers/abstract-provider.d.ts.map

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions lib.commonjs/providers/abstract-provider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib.commonjs/providers/abstract-provider.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib.commonjs/providers/provider-jsonrpc.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions lib.commonjs/providers/provider-jsonrpc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib.commonjs/providers/provider-jsonrpc.js.map

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions lib.esm/providers/abstract-provider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ export type PerformActionRequest = {
method: "getRunningLocations";
} | {
method: "getProtocolTrieExpansionCount";
} | {
method: "getQiRateAtBlock";
blockTag: BlockTag;
amt: number;
} | {
method: "getQuaiRateAtBlock";
blockTag: BlockTag;
amt: number;
};
/**
* Options for configuring some internal aspects of an [[AbstractProvider]].
Expand Down Expand Up @@ -262,6 +270,10 @@ export declare class AbstractProvider implements Provider {
* [[Network]] if necessary.
*/
constructor(_network?: "any" | Networkish, options?: AbstractProviderOptions);
getLatestQuaiRate(amt?: number): Promise<bigint>;
getQuaiRateAtBlock(blockTag: BlockTag, amt?: number): Promise<bigint>;
getLatestQiRate(amt?: number): Promise<bigint>;
getQiRateAtBlock(blockTag: BlockTag, amt?: number): Promise<bigint>;
get pollingInterval(): number;
/**
* Returns ``this``, to allow an **AbstractProvider** to implement
Expand Down
Loading

0 comments on commit 61b90dd

Please sign in to comment.