Closed cinlk closed 2 years ago
You will need to provide an example of the output and the error line.
// Auto-generated via yarn polkadot-types-from-chain
, do not edit
/ eslint-disable /
import type { EthereumBlockNumber, EthereumHeader, EthereumReceiptProof, EthereumReceiptProofThing, EthereumRelayHeaderParcel, EthereumRelayProofs, KtonBalance, MMRProof, RedeemFor, RelayAuthoritySignature, RelayAuthoritySigner, RingBalance, StakingBalanceT, TsInMs } from './darwiniaInject'; import type { RelayAffirmationId } from './relayerGame'; import type { ApiTypes } from '@polkadot/api-base/types'; import type { Data } from '@polkadot/types'; import type { Bytes, Compact, Option, U256, U8aFixed, Vec, bool, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { AnyNumber, ITuple } from '@polkadot/types-codec/types'; import type { BabeEquivocationProof, NextConfigDescriptor } from '@polkadot/types/interfaces/babe'; import type { BridgedHeader, InboundRelayer, InitializationData, LaneId, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundMessageFee, OutboundPayload, Parameter, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges'; import type { MemberCount, ProposalIndex } from '@polkadot/types/interfaces/collective'; import type { AccountVote, Conviction, PropIndex, Proposal, ReferendumIndex } from '@polkadot/types/interfaces/democracy'; import type { Renouncing } from '@polkadot/types/interfaces/elections'; import type { EthereumAddress } from '@polkadot/types/interfaces/eth'; import type { Signature } from '@polkadot/types/interfaces/extrinsics'; import type { GrandpaEquivocationProof, GrandpaJustification, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa'; import type { IdentityFields, IdentityInfo, IdentityJudgement, RegistrarIndex } from '@polkadot/types/interfaces/identity'; import type { Heartbeat } from '@polkadot/types/interfaces/imOnline'; import type { ProxyType } from '@polkadot/types/interfaces/proxy'; import type { AccountId, Balance, BalanceOf, BlockNumber, BlockNumberFor, Call, CallHashOf, ChangesTrieConfiguration, H160, Hash, Header, KeyValue, LookupSource, Moment, OpaqueCall, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime'; import type { Period, Priority } from '@polkadot/types/interfaces/scheduler'; import type { Keys } from '@polkadot/types/interfaces/session'; import type { SocietyJudgement } from '@polkadot/types/interfaces/society'; import type { ElectionScore, EraIndex, RawSolution, RewardDestination, SolutionOrSnapshotSize, Supports, ValidatorPrefs } from '@polkadot/types/interfaces/staking'; import type { Key } from '@polkadot/types/interfaces/system'; import type { BountyIndex } from '@polkadot/types/interfaces/treasury'; import type { Timepoint } from '@polkadot/types/interfaces/utility'; import type { VestingInfo } from '@polkadot/types/interfaces/vesting';
declare module '@polkadot/api-base/types/submittable' {
export interface AugmentedSubmittables
enact_epoch_change
. The config will be activated one epoch after.ValidateUnsigned
), as suchtransfer
, except the origin must be root and the source account may be/
forceTransfer: AugmentedSubmittable<(source: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact\<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic
FreeBalance
and ReservedBalance
in storage. it willTotalIssuance
).frame_system::AccountNonce
).root
./
setBalance: AugmentedSubmittable<(who: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, newFree: Compact\<Balance> | AnyNumber | Uint8Array, newReserved: Compact\<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic
transfer
will set the FreeBalance
of the sender and receiver.TransferFee
.Signed
by the transactor.ensure_can_withdraw
is always called internally but has a bounded complexity.T::OnNewAccount::on_new_account
to be called.T::DustRemoval::on_unbalanced
.transfer_keep_alive
works the same way as transfer
, but has an additional/
transfer: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact\<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic
keep_alive
is true
), will not bedest
: The recipient of the transfer.keep_alive
: A boolean to determine if the transfer_all
operation should send all/
transferAll: AugmentedSubmittable<(dest: LookupSource | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic
transfer
] call, but with a check that the transfer will not kill thetransfer
] instead./
acceptCurator: AugmentedSubmittable<(bountyId: Compact\<BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic
T::ApproveOrigin
.**/
approveBounty: AugmentedSubmittable<(bountyId: Compact<\BountyIndex> | AnyNumber | Uint8Array) => SubmittableExtrinsic
This is the exact same form used eg. here -
Which version of TypeScript are you using? Could be related to https://polkadot.js.org/docs/usage/FAQ#under-typescript-i-have-ts-compilation-errors
4.6.2
This is the exact same form used eg. here -
Which version of TypeScript are you using? Could be related to https://polkadot.js.org/docs/usage/FAQ#under-typescript-i-have-ts-compilation-errors
4.6.2
Honestly have no idea as to the why in this case.
Im getting the same issues, polkadot.js/api has tons of type issues in typescript
Edit:
I replaced
import { ApiPromise } from "@polkadot/api";
with
const { ApiPromise } = require("@polkadot/api");
and it built
This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.
@scglenn @cinlk
Please try to add tsconfig flags: "allowSyntheticDefaultImports": true or "esModuleInterop": true
This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.
package version: @polkadot/api@7.13.1, @polkadot/types-codec@7.13.1,@polkadot/types@7.13.1
I am running the command "ts-node --skip-project node_modules/@polkadot/typegen/scripts/polkadot-types-from-chain.cjs --package '.' --endpoint ./packages/types/src/metadata/meta.json --output ./packages/types/src/interfaces" to generate 'augment-api-*' files. The 'augment-api-tx.ts' file has some strange errors that each of generic type 'Compact ' of 'T' dose not satisfy constraint 'INumber'.
such as
Compact<ReferendumIndex> Compact<u32> Compact<ReferendumIndex> Compact<BalanceOf> Compact<Balance>
etc