-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f76795
commit c28950e
Showing
9 changed files
with
52 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import { AnyApi } from "@acala-network/sdk-core"; | ||
import { Storage } from "@acala-network/sdk/utils/storage"; | ||
import { AcalaPrimitivesCurrencyCurrencyId } from "@polkadot/types/lookup"; | ||
import { AnyApi } from '@acala-network/sdk-core'; | ||
import { Storage } from '@acala-network/sdk/utils/storage'; | ||
import { AcalaPrimitivesCurrencyCurrencyId } from '@polkadot/types/lookup'; | ||
import { Option, Vec, StorageKey } from '@polkadot/types'; | ||
|
||
export function createStorages (api: AnyApi) { | ||
export function createStorages(api: AnyApi) { | ||
return { | ||
globalFeeSwapPathes: () => { | ||
return Storage.create<[StorageKey<[AcalaPrimitivesCurrencyCurrencyId]>, Option<Vec<AcalaPrimitivesCurrencyCurrencyId>>][]>({ | ||
return Storage.create< | ||
[StorageKey<[AcalaPrimitivesCurrencyCurrencyId]>, Option<Vec<AcalaPrimitivesCurrencyCurrencyId>>][] | ||
>({ | ||
api: api, | ||
path: 'query.transactionPayment.globalFeeSwapPath.entries', | ||
params: [] | ||
}) | ||
}); | ||
} | ||
} | ||
}; | ||
} | ||
|
||
export type Storages = ReturnType<typeof createStorages>; | ||
export type Storages = ReturnType<typeof createStorages>; |
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,9 +1,9 @@ | ||
import { Observable, isObservable, firstValueFrom } from 'rxjs'; | ||
|
||
export function toPromise <T extends unknown>(run: Promise<T> | Observable<T>): Promise<T> { | ||
export function toPromise<T>(run: Promise<T> | Observable<T>): Promise<T> { | ||
if (isObservable(run)) { | ||
return firstValueFrom(run); | ||
} | ||
|
||
return run; | ||
} | ||
} |
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