|
@@ -18,29 +18,29 @@ import {
|
|
|
import { Hash } from "@polkadot/types/interfaces";
|
|
|
|
|
|
export const uploadingBlocked = (api: ApiPromise): Promise<boolean> =>
|
|
|
- api.query.storage.uploadingBlocked() as Promise<boolean>;
|
|
|
+ api.query.storage.uploadingBlocked() as any;
|
|
|
|
|
|
export const getBlacklist = (api: ApiPromise): Promise<Cid[]> =>
|
|
|
- api.query.storage.blacklist();
|
|
|
+ api.query.storage.blacklist() as any;
|
|
|
|
|
|
export const getBlacklistSize = (api: ApiPromise): Promise<number> =>
|
|
|
- api.query.storage.currentBlacklistSize();
|
|
|
+ api.query.storage.currentBlacklistSize() as any;
|
|
|
|
|
|
export const maxStorageBucketsPerBag = (api: ApiPromise): Promise<number> =>
|
|
|
- api.query.storage.storageBucketsPerBagLimit();
|
|
|
+ api.query.storage.storageBucketsPerBagLimit() as any;
|
|
|
|
|
|
export const maxDistributionBucketsPerBag = (
|
|
|
api: ApiPromise
|
|
|
-): Promise<number> => api.query.storage.distributionBucketsPerBagLimit();
|
|
|
+): Promise<number> => api.query.storage.distributionBucketsPerBagLimit() as any;
|
|
|
|
|
|
export const maxStorageBucketObjects = (api: ApiPromise): Promise<number> =>
|
|
|
- api.query.storage.voucherMaxObjectsNumberLimit();
|
|
|
+ api.query.storage.voucherMaxObjectsNumberLimit() as any;
|
|
|
|
|
|
export const maxStorageBucketSize = (api: ApiPromise): Promise<number> =>
|
|
|
- api.query.storage.voucherMaxObjectsSizeLimit();
|
|
|
+ api.query.storage.voucherMaxObjectsSizeLimit() as any;
|
|
|
|
|
|
-export const feePerMegabyte = (api: ApiPromise): Promise<Bag> =>
|
|
|
- api.query.storage.dataObjectPerMegabyteFee();
|
|
|
+export const feePerMegabyte = (api: ApiPromise): Promise<number> =>
|
|
|
+ api.query.storage.dataObjectPerMegabyteFee() as any;
|
|
|
|
|
|
export const getDynamicBagPolicy = (
|
|
|
api: ApiPromise,
|
|
@@ -49,7 +49,7 @@ export const getDynamicBagPolicy = (
|
|
|
DynamicBagCreationPolicy | Map<DynamicBagType, DynamicBagCreationPolicy>
|
|
|
> =>
|
|
|
type
|
|
|
- ? api.query.storage.dynamicBagCreationPolicies(type)
|
|
|
+ ? (api.query.storage.dynamicBagCreationPolicies(type) as any)
|
|
|
: api.query.storage.dynamicBagCreationPolicies.entries();
|
|
|
|
|
|
export const getNextDataObject = (api: ApiPromise): Promise<DataObjectId> =>
|
|
@@ -69,23 +69,23 @@ export const getNextDistributionFamily = (
|
|
|
export const getBag = (
|
|
|
api: ApiPromise,
|
|
|
bagId: BagId | { Static: any } | { Dynamic: any } | string | number
|
|
|
-): Promise<Bag> => api.query.storage.bags(bagId);
|
|
|
+): Promise<Bag> => api.query.storage.bags(bagId) as any;
|
|
|
|
|
|
export const getBags = async (api: ApiPromise): Promise<Map<BagId, Bag>> =>
|
|
|
- api.query.storage.bags.entries();
|
|
|
+ api.query.storage.bags.entries() as any;
|
|
|
|
|
|
export const getObject = (
|
|
|
api: ApiPromise,
|
|
|
bagId: BagId | { Static: any } | { Dynamic: any } | string | number,
|
|
|
objectId: DataObjectId | number
|
|
|
): Promise<Map<DataObjectId, DataObject>> =>
|
|
|
- api.query.storage.dataObjectsById(bagId, objectId);
|
|
|
+ api.query.storage.dataObjectsById(bagId, objectId) as any;
|
|
|
|
|
|
export const getBagObjects = (
|
|
|
api: ApiPromise,
|
|
|
bagId: BagId | { Static: any } | { Dynamic: any } | string | number
|
|
|
): Promise<Map<[BagId, DataObjectId], DataObject>> =>
|
|
|
- api.query.storage.dataObjectsById.entries(bagId);
|
|
|
+ api.query.storage.dataObjectsById.entries(bagId) as any;
|
|
|
|
|
|
// storage
|
|
|
export const getStorageBucket = (
|
|
@@ -100,19 +100,17 @@ export const getStorageBucket = (
|
|
|
export const getStorageBuckets = (
|
|
|
api: ApiPromise
|
|
|
): Promise<Map<StorageBucketId, StorageBucket>> =>
|
|
|
- api.query.storage.storageBucketById.entries();
|
|
|
+ api.query.storage.storageBucketById.entries() as any;
|
|
|
|
|
|
// distribution
|
|
|
export const getDistributionFamilyNumber = (api: ApiPromise): Promise<number> =>
|
|
|
- api.query.storage.distributionBucketFamilyNumber();
|
|
|
+ api.query.storage.distributionBucketFamilyNumber() as any;
|
|
|
|
|
|
export const getDistributionFamilyBuckets = (
|
|
|
api: ApiPromise,
|
|
|
familyId: DistributionBucketFamilyId | number
|
|
|
): Promise<Map<DistributionBucketIndex, DistributionBucket>> =>
|
|
|
- api.query.storage.distributionBucketByFamilyIdById.entries(
|
|
|
- familyId
|
|
|
- ) as Promise<Map<DistributionBucketIndex, DistributionBucket>>;
|
|
|
+ api.query.storage.distributionBucketByFamilyIdById.entries(familyId) as any;
|
|
|
|
|
|
export const getDistributionFamilyBucket = (
|
|
|
api: ApiPromise,
|
|
@@ -127,7 +125,7 @@ export const getDistributionFamilyBucket = (
|
|
|
export const getDistributionFamilies = (
|
|
|
api: ApiPromise
|
|
|
): Promise<Map<DistributionBucketFamilyId, DistributionBucketFamily>> =>
|
|
|
- api.query.storage.distributionBucketFamilyById.entries();
|
|
|
+ api.query.storage.distributionBucketFamilyById.entries() as any;
|
|
|
|
|
|
export const getDistributionFamily = async (
|
|
|
api: ApiPromise,
|