Skip to content

Commit

Permalink
chore: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
devdanco committed Mar 18, 2024
1 parent 9bf2059 commit aeb9702
Show file tree
Hide file tree
Showing 17 changed files with 725 additions and 463 deletions.
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mangata-finance/sdk",
"version": "2.2.1-eth-rollup-develop.11",
"version": "2.2.1-feat-raw-update.0",
"description": "Mangata SDK",
"type": "module",
"module": "./index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/type-definitions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mangata-finance/type-definitions",
"version": "2.1.3-eth-rollup-develop.12",
"version": "2.1.3-feat-raw-update.1",
"description": "Type definitions for Mangata Finance",
"repository": {
"type": "git",
Expand Down
52 changes: 52 additions & 0 deletions packages/type-definitions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,43 @@ export const mTypes = {
symbol: "Vec<u8>"
},
TokenId: "u32",
L1Update: {
pendingDeposits: "Vec<Deposit>",
pendingCancelResultions: "Vec<CancelResolution>",
pendingWithdrawalResolutions: "Vec<WithdrawalResolution>",
pendingL2UpdatesToRemove: "Vec<L2UpdatesToRemove>",
},
Deposit: {
requestId: "RequestId",
depositRecipient: "[u8; 20]",
tokenAddress: "[u8; 20]",
amount: "U256",
blockHash: "H256"
},
RequestId: {
origin: "Origin",
id: "u128"
},
Origin: {
_enum: ['L1', 'L2']
},
CancelResolution: {
requestId: "RequestId",
l2RequestId: "u128",
cancelJustified: "bool",
blockHash: "H256"
},
WithdrawalResolution: {
requestId: "RequestId",
l2RequestId: "u128",
status: "bool",
blockHash: "H256"
},
L2UpdatesToRemove: {
requestId: "RequestId",
l2UpdatesToRemove: "Vec<u128>",
blockHash: "H256"
}
};

export const mRpc = {
Expand Down Expand Up @@ -310,6 +347,21 @@ export const mRpc = {
}
],
type: "bool"
},
update_eth_raw: {
description: "",
params: [
{
name: "payload",
type: "Vec<u8>"
},
{
name: 'at',
type: 'Hash',
isOptional: true
}
],
type: "Option<L1Update>"
}
},
metamask: {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/metadata.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mangata-finance/types",
"version": "2.2.3-eth-rollup-develop.18",
"version": "2.2.3-feat-raw-update.0",
"description": "Polkadot.js type definitions for Mangata Network",
"author": "Mangata Finance <solutions@mangata.finance>",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@ declare module '@polkadot/api-base/types/errors' {
L1AssetCreationFailed: AugmentedError<ApiType>;
L1AssetNotFound: AugmentedError<ApiType>;
MathOverflow: AugmentedError<ApiType>;
MultipleUpdatesInSingleBlock: AugmentedError<ApiType>;
NotEnoughAssets: AugmentedError<ApiType>;
OperationFailed: AugmentedError<ApiType>;
ReadRightsExhausted: AugmentedError<ApiType>;
Expand Down
7 changes: 5 additions & 2 deletions packages/types/src/interfaces/augment-api-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import '@polkadot/api-base/types/events';

import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types';
import type { Null, Option, Result, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Null, Option, Result, Struct, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H256, Perbill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportTokensMiscBalanceStatus, OrmlTraitsAssetRegistryAssetMetadata, PalletIssuanceIssuanceInfo, PalletIssuanceTgeInfo, ParachainStakingCandidateBondRequest, ParachainStakingDelegationRequest, ParachainStakingDelegatorAdded, ParachainStakingPayoutRounds, RollupRuntimeRuntimeConfigConfigPalletProxyProxyType, SpConsensusGrandpaAppPublic, SpRuntimeDispatchError, SpRuntimeModuleError } from '@polkadot/types/lookup';
Expand Down Expand Up @@ -445,7 +445,10 @@ declare module '@polkadot/api-base/types/events' {
[key: string]: AugmentedEvent<ApiType>;
};
rolldown: {
PendingRequestStored: AugmentedEvent<ApiType, [ITuple<[AccountId32, u128, U256, U256, H256]>]>;
L1ReadStored: AugmentedEvent<ApiType, [ITuple<[AccountId32, u128, {
readonly start: u128;
readonly end: u128;
} & Struct, H256]>]>;
/**
* Generic event
**/
Expand Down
15 changes: 8 additions & 7 deletions packages/types/src/interfaces/augment-api-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { Data } from '@polkadot/types';
import type { BTreeMap, Bytes, Null, Option, U256, Vec, bool, u128, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, Perbill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, MangataTypesAssetsL1Asset, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlTraitsAssetRegistryAssetMetadata, PalletBootstrapBootstrapPhase, PalletCollectiveMangataVotes, PalletCrowdloanRewardsRewardInfo, PalletFeeLockAccountFeeLockDataInfo, PalletFeeLockFeeLockMetadataInfo, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletIssuanceIssuanceInfo, PalletMaintenanceMaintenanceStatusInfo, PalletMultipurposeLiquidityRelockStatusInfo, PalletMultipurposeLiquidityReserveStatusInfo, PalletProofOfStakePromotedPools, PalletProofOfStakeRewardInfo, PalletProofOfStakeSchedule, PalletProofOfStakeScheduleRewardsCalculatorActivatedLiquidityPerSchedule, PalletProofOfStakeScheduleRewardsCalculatorScheduleRewards, PalletProofOfStakeSchedulesList, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRolldownMessagesL1Update, PalletRolldownPendingUpdate, PalletRolldownSequencerRights, PalletTransactionPaymentMangataReleases, PalletTreasuryProposal, PalletVestingMangataReleases, PalletVestingMangataVestingInfo, ParachainStakingAggregatorMetadataType, ParachainStakingBond, ParachainStakingCollatorCandidate, ParachainStakingCollatorSnapshot, ParachainStakingDelegator, ParachainStakingRoundCollatorRewardInfoType, ParachainStakingRoundInfo, ParachainStakingSetOrderedSetBond, RollupRuntimeSessionKeys, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpRuntimeDigest, StagingXcmV3MultiLocation } from '@polkadot/types/lookup';
import type { FrameSupportDispatchPerDispatchClassWeight, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, MangataTypesAssetsL1Asset, OrmlTokensAccountData, OrmlTokensBalanceLock, OrmlTokensReserveData, OrmlTraitsAssetRegistryAssetMetadata, PalletBootstrapBootstrapPhase, PalletCollectiveMangataVotes, PalletCrowdloanRewardsRewardInfo, PalletFeeLockAccountFeeLockDataInfo, PalletFeeLockFeeLockMetadataInfo, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletIssuanceIssuanceInfo, PalletMaintenanceMaintenanceStatusInfo, PalletMultipurposeLiquidityRelockStatusInfo, PalletMultipurposeLiquidityReserveStatusInfo, PalletProofOfStakePromotedPools, PalletProofOfStakeRewardInfo, PalletProofOfStakeSchedule, PalletProofOfStakeScheduleRewardsCalculatorActivatedLiquidityPerSchedule, PalletProofOfStakeScheduleRewardsCalculatorScheduleRewards, PalletProofOfStakeSchedulesList, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRolldownMessagesL1, PalletRolldownMessagesL1Update, PalletRolldownMessagesRequestId, PalletRolldownPendingUpdate, PalletRolldownSequencerRights, PalletTransactionPaymentMangataReleases, PalletTreasuryProposal, PalletVestingMangataReleases, PalletVestingMangataVestingInfo, ParachainStakingAggregatorMetadataType, ParachainStakingBond, ParachainStakingCollatorCandidate, ParachainStakingCollatorSnapshot, ParachainStakingDelegator, ParachainStakingRoundCollatorRewardInfoType, ParachainStakingRoundInfo, ParachainStakingSetOrderedSetBond, RollupRuntimeSessionKeys, SpConsensusAuraSr25519AppSr25519Public, SpCoreCryptoKeyTypeId, SpRuntimeDigest, StagingXcmV3MultiLocation } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';

export type __AugmentedQuery<ApiType extends ApiTypes> = AugmentedQuery<ApiType, () => unknown>;
Expand Down Expand Up @@ -428,12 +428,13 @@ declare module '@polkadot/api-base/types/storage' {
[key: string]: QueryableStorageEntry<ApiType>;
};
rolldown: {
l2OriginUpdatesCounter: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
lastProcessedRequestOnL2: AugmentedQuery<ApiType, () => Observable<U256>, []> & QueryableStorageEntry<ApiType, []>;
pendingRequests: AugmentedQuery<ApiType, (arg: U256 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[AccountId32, PalletRolldownMessagesL1Update]>>>, [U256]> & QueryableStorageEntry<ApiType, [U256]>;
pendingUpdates: AugmentedQuery<ApiType, (arg: U256 | AnyNumber | Uint8Array) => Observable<Option<PalletRolldownPendingUpdate>>, [U256]> & QueryableStorageEntry<ApiType, [U256]>;
requestToExecute: AugmentedQuery<ApiType, (arg: u128 | AnyNumber | Uint8Array) => Observable<ITuple<[u128, PalletRolldownMessagesL1Update]>>, [u128]> & QueryableStorageEntry<ApiType, [u128]>;
requestToExecuteCnt: AugmentedQuery<ApiType, () => Observable<Option<u128>>, []> & QueryableStorageEntry<ApiType, []>;
l2OriginRequestId: AugmentedQuery<ApiType, (arg: PalletRolldownMessagesL1 | 'Ethereum' | number | Uint8Array) => Observable<u128>, [PalletRolldownMessagesL1]> & QueryableStorageEntry<ApiType, [PalletRolldownMessagesL1]>;
lastProcessedRequestOnL2: AugmentedQuery<ApiType, (arg: PalletRolldownMessagesL1 | 'Ethereum' | number | Uint8Array) => Observable<u128>, [PalletRolldownMessagesL1]> & QueryableStorageEntry<ApiType, [PalletRolldownMessagesL1]>;
pendingRequests: AugmentedQuery<ApiType, (arg1: u128 | AnyNumber | Uint8Array, arg2: PalletRolldownMessagesL1 | 'Ethereum' | number | Uint8Array) => Observable<Option<ITuple<[AccountId32, PalletRolldownMessagesL1Update]>>>, [u128, PalletRolldownMessagesL1]> & QueryableStorageEntry<ApiType, [u128, PalletRolldownMessagesL1]>;
pendingUpdates: AugmentedQuery<ApiType, (arg1: PalletRolldownMessagesL1 | 'Ethereum' | number | Uint8Array, arg2: PalletRolldownMessagesRequestId | { origin?: any; id?: any } | string | Uint8Array) => Observable<Option<PalletRolldownPendingUpdate>>, [PalletRolldownMessagesL1, PalletRolldownMessagesRequestId]> & QueryableStorageEntry<ApiType, [PalletRolldownMessagesL1, PalletRolldownMessagesRequestId]>;
requestToExecute: AugmentedQuery<ApiType, (arg: u128 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[PalletRolldownMessagesL1, PalletRolldownMessagesL1Update]>>>, [u128]> & QueryableStorageEntry<ApiType, [u128]>;
requestToExecuteCnt: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
requestToExecuteLast: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
sequencerCount: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
sequencerRights: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletRolldownSequencerRights>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
Expand Down
12 changes: 8 additions & 4 deletions packages/types/src/interfaces/augment-api-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
// this is required to allow for ambient/previous definitions
import '@polkadot/rpc-core/types/jsonrpc';

import type { RpcAssetMetadata, TokenId } from '@mangata-finance/types/interfaces/default';
import type { L1Update, RpcAssetMetadata, TokenId } from '@mangata-finance/types/interfaces/default';
import type { AugmentedRpc } from '@polkadot/rpc-core/types';
import type { Metadata, StorageKey } from '@polkadot/types';
import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, f64, u128, u32, u64 } from '@polkadot/types-codec';
import type { AnyNumber, Codec, ITuple } from '@polkadot/types-codec/types';
import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy';
import type { BeefyVersionedFinalityProof } from '@polkadot/types/interfaces/beefy';
import type { BlockHash } from '@polkadot/types/interfaces/chain';
import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
Expand Down Expand Up @@ -81,9 +81,9 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
**/
getFinalizedHead: AugmentedRpc<() => Observable<H256>>;
/**
* Returns the block most recently finalized by BEEFY, alongside side its justification.
* Returns the block most recently finalized by BEEFY, alongside its justification.
**/
subscribeJustifications: AugmentedRpc<() => Observable<BeefySignedCommitment>>;
subscribeJustifications: AugmentedRpc<() => Observable<BeefyVersionedFinalityProof>>;
};
chain: {
/**
Expand Down Expand Up @@ -455,6 +455,10 @@ declare module '@polkadot/rpc-core/types/jsonrpc' {
*
**/
pending_updates_hash: AugmentedRpc<(at?: Hash | string | Uint8Array) => Observable<H256>>;
/**
*
**/
update_eth_raw: AugmentedRpc<(payload: Bytes | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable<Option<L1Update>>>;
/**
*
**/
Expand Down
10 changes: 5 additions & 5 deletions packages/types/src/interfaces/augment-api-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import '@polkadot/api-base/types/submittable';

import type { ApiTypes, AugmentedSubmittable, SubmittableExtrinsic, SubmittableExtrinsicFunction } from '@polkadot/api-base/types';
import type { Data } from '@polkadot/types';
import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Bytes, Compact, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, IMethod, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, MultiAddress, Perbill, Permill } from '@polkadot/types/interfaces/runtime';
import type { MangataTypesAssetsCustomMetadata, MangataTypesAssetsL1Asset, MangataTypesMultipurposeLiquidityActivateKind, MangataTypesMultipurposeLiquidityBondKind, OrmlTraitsAssetRegistryAssetMetadata, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletIssuanceTgeInfo, PalletProofOfStakeThirdPartyActivationKind, PalletRolldownMessagesL1Update, PalletVestingMangataVestingInfo, ParachainStakingMetadataUpdateAction, ParachainStakingPairedOrLiquidityToken, RollupRuntimeOriginCaller, RollupRuntimeRuntimeConfigConfigPalletProxyProxyType, RollupRuntimeSessionKeys, SpConsensusGrandpaEquivocationProof, SpCoreVoid, SpRuntimeMultiSignature, SpWeightsWeightV2Weight, StagingXcmVersionedMultiLocation } from '@polkadot/types/lookup';
Expand Down Expand Up @@ -524,19 +524,19 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* See [`Pallet::cancel_requests_from_l1`].
**/
cancelRequestsFromL1: AugmentedSubmittable<(requestsToCancel: U256 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [U256]>;
cancelRequestsFromL1: AugmentedSubmittable<(requestsToCancel: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
/**
* See [`Pallet::force_cancel_requests_from_l1`].
**/
forceCancelRequestsFromL1: AugmentedSubmittable<(requestsToCancel: U256 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [U256]>;
forceCancelRequestsFromL1: AugmentedSubmittable<(requestsToCancel: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
/**
* See [`Pallet::force_update_l2_from_l1`].
**/
forceUpdateL2FromL1: AugmentedSubmittable<(update: PalletRolldownMessagesL1Update | { lastProccessedRequestOnL1?: any; lastAcceptedRequestOnL1?: any; offset?: any; order?: any; pendingDeposits?: any; pendingCancelResultions?: any; pendingL2UpdatesToRemove?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletRolldownMessagesL1Update]>;
forceUpdateL2FromL1: AugmentedSubmittable<(update: PalletRolldownMessagesL1Update | { pendingDeposits?: any; pendingCancelResultions?: any; pendingWithdrawalResolutions?: any; pendingL2UpdatesToRemove?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletRolldownMessagesL1Update]>;
/**
* See [`Pallet::update_l2_from_l1`].
**/
updateL2FromL1: AugmentedSubmittable<(requests: PalletRolldownMessagesL1Update | { lastProccessedRequestOnL1?: any; lastAcceptedRequestOnL1?: any; offset?: any; order?: any; pendingDeposits?: any; pendingCancelResultions?: any; pendingL2UpdatesToRemove?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletRolldownMessagesL1Update]>;
updateL2FromL1: AugmentedSubmittable<(requests: PalletRolldownMessagesL1Update | { pendingDeposits?: any; pendingCancelResultions?: any; pendingWithdrawalResolutions?: any; pendingL2UpdatesToRemove?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletRolldownMessagesL1Update]>;
/**
* See [`Pallet::withdraw`].
**/
Expand Down
Loading

0 comments on commit aeb9702

Please sign in to comment.