Compare commits

...
8 Commits
Author SHA1 Message Date
github-actions[bot] b0acdbd96c [CI Skip] release/stable 12.0.1
skip-checks: true
2024-06-25 02:56:04 +00:00
Tarik Gul af3d20ebe1 12.0.1 (#5916) 2024-06-25 05:48:37 +03:00
github-actions[bot] 5897fb7e3b [CI Skip] bump/beta 11.3.2-2-x
skip-checks: true
2024-06-25 02:11:14 +00:00
Tarik Gul bdafcd9e97 Sanitize eras for _stakerRewards (#5912)
* Sanitize eras for _stakerRewards

* Small nits
2024-06-25 05:03:43 +03:00
github-actions[bot] 095710349a [CI Skip] bump/beta 11.3.2-1-x
skip-checks: true
2024-06-24 23:08:00 +00:00
Tarik Gul 586f02f831 Add signedTransaction to SignerResult for injected Signers in signAndSend (#5914)
* Start work on payload feature

* Change naming and type

* Add validation and whitelisting

* Update comments

* Fix some properties and commetns

* Switch logic over to signedTransaction

* Add mode to output of extrinsic signature

* Add validation

* Update comments

* Update comments

* Reduce validation

* Update internal docs

* Make comments clearer

* comments

* one more inline doc :)

* Fix nasty little bug for signAsync, and when signedTransaction is not used

* remove uncessecary ?

* Add undefined typing
2024-06-24 19:00:28 -04:00
github-actions[bot] 5ca873b501 [CI Skip] bump/beta 11.3.2-0-x
skip-checks: true
2024-06-24 21:49:35 +00:00
Alberto Nicolas Penayo 058a3ac640 added use of accountNonceApi (#5915) 2024-06-24 18:41:55 -03:00
41 changed files with 302 additions and 201 deletions
+15
View File
@@ -1,5 +1,20 @@
# CHANGELOG
## 12.0.1 June 24, 2024
**Important Changes**:
- Addition of an optional `signedTransaction` field to the [`SignerResult`](https://github.com/polkadot-js/api/blob/586f02f8310529f16e4047fd94e31bc6c6573366/packages/types/src/types/extrinsic.ts#L138-L158) response for injected signers. This only applies to the `signPayload` method exposed in the [`Signer`](https://github.com/polkadot-js/api/blob/586f02f8310529f16e4047fd94e31bc6c6573366/packages/types/src/types/extrinsic.ts#L160-L175) interface for polkadot-js. As the name suggests the field expects a signed transaction (extrinsic) when inputted. When its present, the api will not add the signature to the payload, but instead broadcast the inputted signed transaction. This means the signer may modify the payload it's given. The only part of the payload that may not be modified is the call data. This is verified on the api, and will throw an error if it does not match the initial payloads call data.
- This is very useful for signers that want to adjust the `mode` and `metadataHash` field for the `CheckMetadataHash` signed extension.
- Note that this is not your traditional breaking change since it more-so acts as an addition, but since this is a high magnitude change it is going to be considered a MAJOR bump.
- For more info please review the following PR [(#5914)](https://github.com/polkadot-js/api/pull/5914)
Changes:
- Replace `system_accountNextIndex` with runtime api call `accountNonceApi` for `api.derive.tx.signingInfo`
- Sanitize `eras` for `api.derive.staking._stakerRewards`
## 11.3.1 June 17, 2024
Changes:
+2 -2
View File
@@ -1,6 +1,6 @@
3512 Jaco Bump deps (#5785)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
61 Tarik Gul 11.3.1 (#5909)
64 Tarik Gul 12.0.1 (#5916)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
@@ -10,11 +10,11 @@
11 Ian He HttpProvider support clone() (#3949)
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
6 Andreea Eftene Update check for contract instantiation (#5699)
5 Alberto Nicolas Penayo added use of accountNonceApi (#5915)
5 Chevdor Fix metadata package link (#3458)
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
5 Julien Eluard General WsProvider extensibility improvements (#5467)
5 Matias Volpe Bump @substrate/connect to 0.8.10 (#5863)
4 Alberto Nicolas Penayo fix: add support for `AuraUnincludedSegmentApi` (#5891)
4 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
4 Alex Wang fix issue that creates duplicate providers (#983)
4 Alexander Popiak Add asset id in signing (#4009)
+3 -3
View File
@@ -14,10 +14,10 @@
},
"sideEffects": false,
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"versions": {
"git": "11.3.1",
"npm": "11.3.1"
"git": "12.0.1",
"npm": "12.0.1"
},
"workspaces": [
"packages/*"
+6 -6
View File
@@ -18,14 +18,14 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-base": "11.3.1",
"@polkadot/rpc-augment": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/types-augment": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/api-base": "12.0.1",
"@polkadot/rpc-augment": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-augment": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '12.0.1' };
+3 -3
View File
@@ -18,11 +18,11 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/rpc-core": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/util": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '12.0.1' };
@@ -68,6 +68,16 @@ export interface SubmittableExtrinsic<ApiType extends ApiTypes, R extends ISubmi
signAsync (account: AddressOrPair, _options?: Partial<SignerOptions>): PromiseOrObs<ApiType, this>;
/**
* @description Sign and broadcast the constructued transaction.
*
* Note for injected signers:
* As of v12.0.1 and up the `SignerResult` return type for `signPayload` allows for the `signedTransaction` field.
* This allows the signer to input a signed transaction that will be directly broadcasted. This
* bypasses the api adding the signature to the payload. The api will ensure that the Call Data is not changed before it broadcasts the
* transaction. This allows for the signer to modify the payload to add things like `mode`, and `metadataHash` for
* signedExtensions such as `CheckMetadataHash`.
*/
signAndSend (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittableResultResult<ApiType, R>;
signAndSend (account: AddressOrPair, statusCb: Callback<R>): SubmittableResultSubscription<ApiType>;
+8 -8
View File
@@ -18,22 +18,22 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "11.3.1",
"@polkadot/api-augment": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/types-create": "11.3.1",
"@polkadot/api": "12.0.1",
"@polkadot/api-augment": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/types-create": "12.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api-augment": "11.3.1",
"@polkadot/api-augment": "12.0.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/types-support": "11.3.1"
"@polkadot/types-support": "12.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '12.0.1' };
+12 -12
View File
@@ -18,25 +18,25 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api": "11.3.1",
"@polkadot/api-augment": "11.3.1",
"@polkadot/api-base": "11.3.1",
"@polkadot/rpc-core": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/api": "12.0.1",
"@polkadot/api-augment": "12.0.1",
"@polkadot/api-base": "12.0.1",
"@polkadot/rpc-core": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api": "11.3.1",
"@polkadot/api-augment": "11.3.1",
"@polkadot/rpc-augment": "11.3.1",
"@polkadot/rpc-provider": "11.3.1",
"@polkadot/types-support": "11.3.1"
"@polkadot/api": "12.0.1",
"@polkadot/api-augment": "12.0.1",
"@polkadot/rpc-augment": "12.0.1",
"@polkadot/rpc-provider": "12.0.1",
"@polkadot/types-support": "12.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '12.0.1' };
@@ -168,11 +168,15 @@ export function _stakerRewardsEras (instanceId: string, api: DeriveApi): (eras:
}
export function _stakerRewards (instanceId: string, api: DeriveApi): (accountIds: (Uint8Array | string)[], eras: EraIndex[], withActive?: boolean) => Observable<DeriveStakerReward[][]> {
return memo(instanceId, (accountIds: (Uint8Array | string)[], eras: EraIndex[], withActive = false): Observable<DeriveStakerReward[][]> =>
combineLatest([
return memo(instanceId, (accountIds: (Uint8Array | string)[], eras: EraIndex[], withActive = false): Observable<DeriveStakerReward[][]> => {
// Ensures that when number or string types are passed in they are sanitized
// Ref: https://github.com/polkadot-js/api/issues/5910
const sanitizedEras: EraIndex[] = eras.map((e) => typeof e === 'number' || typeof e === 'string' ? api.registry.createType('u32', e) : e);
return combineLatest([
api.derive.staking.queryMulti(accountIds, { withClaimedRewardsEras: true, withLedger: true }),
api.derive.staking._stakerExposures(accountIds, eras, withActive),
api.derive.staking._stakerRewardsEras(eras, withActive)
api.derive.staking._stakerExposures(accountIds, sanitizedEras, withActive),
api.derive.staking._stakerRewardsEras(sanitizedEras, withActive)
]).pipe(
switchMap(([queries, exposures, erasResult]): Observable<DeriveStakerReward[][]> => {
const allRewards = queries.map(({ claimedRewardsEras, stakingLedger, stashId }, index): DeriveStakerReward[] =>
@@ -208,7 +212,8 @@ export function _stakerRewards (instanceId: string, api: DeriveApi): (accountIds
)
);
})
)
);
}
);
}
+7 -3
View File
@@ -29,9 +29,13 @@ function latestNonce (api: DeriveApi, address: string): Observable<Index> {
}
function nextNonce (api: DeriveApi, address: string): Observable<Index> {
return api.rpc.system?.accountNextIndex
? api.rpc.system.accountNextIndex(address)
: latestNonce(api, address);
if (api.call.accountNonceApi) {
return api.call.accountNonceApi.accountNonce(address);
} else {
return api.rpc.system?.accountNextIndex
? api.rpc.system.accountNextIndex(address)
: latestNonce(api, address);
}
}
function signingHeader (api: DeriveApi): Observable<Header> {
+14 -14
View File
@@ -18,21 +18,21 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/api-augment": "11.3.1",
"@polkadot/api-base": "11.3.1",
"@polkadot/api-derive": "11.3.1",
"@polkadot/api-augment": "12.0.1",
"@polkadot/api-base": "12.0.1",
"@polkadot/api-derive": "12.0.1",
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-augment": "11.3.1",
"@polkadot/rpc-core": "11.3.1",
"@polkadot/rpc-provider": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/types-augment": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/types-create": "11.3.1",
"@polkadot/types-known": "11.3.1",
"@polkadot/rpc-augment": "12.0.1",
"@polkadot/rpc-core": "12.0.1",
"@polkadot/rpc-provider": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-augment": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/types-create": "12.0.1",
"@polkadot/types-known": "12.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"eventemitter3": "^5.0.1",
@@ -40,7 +40,7 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api-augment": "11.3.1",
"@polkadot/types-support": "11.3.1"
"@polkadot/api-augment": "12.0.1",
"@polkadot/types-support": "12.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '12.0.1' };
+50 -8
View File
@@ -7,6 +7,7 @@ import type { Observable } from 'rxjs';
import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces';
import type { Callback, Codec, CodecClass, ISubmittableResult, SignatureOptions } from '@polkadot/types/types';
import type { Registry } from '@polkadot/types-codec/types';
import type { HexString } from '@polkadot/util/types';
import type { ApiBase } from '../base/index.js';
import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types/index.js';
import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, SubmittableExtrinsic, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription } from './types.js';
@@ -28,6 +29,12 @@ interface SubmittableOptions<ApiType extends ApiTypes> {
interface UpdateInfo {
options: SignatureOptions;
updateId: number;
signedTransaction: HexString | Uint8Array | null;
}
interface SignerInfo {
id: number;
signedTransaction?: HexString | Uint8Array;
}
function makeEraOptions (api: ApiInterfaceRx, registry: Registry, partialOptions: Partial<SignerOptions>, { header, mortalLength, nonce }: { header: Header | null; mortalLength: number; nonce: Index }): SignatureOptions {
@@ -246,14 +253,21 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
mergeMap(async (signingInfo): Promise<UpdateInfo> => {
const eraOptions = makeEraOptions(api, this.registry, options, signingInfo);
let updateId = -1;
let signedTx = null;
if (isKeyringPair(account)) {
this.sign(account, eraOptions);
} else {
updateId = await this.#signViaSigner(address, eraOptions, signingInfo.header);
const result = await this.#signViaSigner(address, eraOptions, signingInfo.header);
updateId = result.id;
if (result.signedTransaction) {
signedTx = result.signedTransaction;
}
}
return { options: eraOptions, updateId };
return { options: eraOptions, signedTransaction: signedTx, updateId };
})
);
};
@@ -288,18 +302,18 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
);
};
#observeSend = (info: UpdateInfo): Observable<Hash> => {
return api.rpc.author.submitExtrinsic(this).pipe(
#observeSend = (info?: UpdateInfo): Observable<Hash> => {
return api.rpc.author.submitExtrinsic(info?.signedTransaction || this).pipe(
tap((hash): void => {
this.#updateSigner(hash, info);
})
);
};
#observeSubscribe = (info: UpdateInfo): Observable<ISubmittableResult> => {
#observeSubscribe = (info?: UpdateInfo): Observable<ISubmittableResult> => {
const txHash = this.hash;
return api.rpc.author.submitAndWatchExtrinsic(this).pipe(
return api.rpc.author.submitAndWatchExtrinsic(info?.signedTransaction || this).pipe(
switchMap((status): Observable<ISubmittableResult> =>
this.#observeStatus(txHash, status)
),
@@ -309,7 +323,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
);
};
#signViaSigner = async (address: Address | string | Uint8Array, options: SignatureOptions, header: Header | null): Promise<number> => {
#signViaSigner = async (address: Address | string | Uint8Array, options: SignatureOptions, header: Header | null): Promise<SignerInfo> => {
const signer = options.signer || api.signer;
if (!signer) {
@@ -325,6 +339,20 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
if (isFunction(signer.signPayload)) {
result = await signer.signPayload(payload.toPayload());
// When the signedTransaction is included by the signer, we no longer add
// the signature to the parent class, but instead broadcast the signed transaction directly.
if (result.signedTransaction) {
const ext = this.registry.createTypeUnsafe<Extrinsic>('Extrinsic', [result.signedTransaction]);
if (!ext.isSigned) {
throw new Error(`When using the signedTransaction field, the transaction must be signed. Recieved isSigned: ${ext.isSigned}`);
}
this.#validateSignedTransaction(payload, ext);
return { id: result.id, signedTransaction: result.signedTransaction };
}
} else if (isFunction(signer.signRaw)) {
result = await signer.signRaw(payload.toRaw());
} else {
@@ -336,7 +364,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
// payload data is not modified from our inputs, but the signer
super.addSignature(address, result.signature, payload.toPayload());
return result.id;
return { id: result.id };
};
#updateSigner = (status: Hash | ISubmittableResult, info?: UpdateInfo): void => {
@@ -349,6 +377,20 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, blockHas
}
}
};
/**
* When a signer includes `signedTransaction` within the SignerResult this will validate
* specific fields within the signed extrinsic against the original payload that was passed
* to the signer.
*/
#validateSignedTransaction = (signerPayload: SignerPayload, signedExt: Extrinsic): void => {
const payload = signerPayload.toPayload();
const errMsg = (field: string) => `signAndSend: ${field} does not match the original payload`;
if (payload.method !== signedExt.method.toHex()) {
throw new Error(errMsg('call data'));
}
};
}
return Submittable;
+4 -4
View File
@@ -18,12 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-core": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/rpc-core": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '12.0.1' };
+5 -5
View File
@@ -18,18 +18,18 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/rpc-augment": "11.3.1",
"@polkadot/rpc-provider": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/rpc-augment": "12.0.1",
"@polkadot/rpc-provider": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/util": "^12.6.2",
"rxjs": "^7.8.1",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/rpc-augment": "11.3.1"
"@polkadot/rpc-augment": "12.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '12.0.1' };
+3 -3
View File
@@ -18,12 +18,12 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/types": "11.3.1",
"@polkadot/types-support": "11.3.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-support": "12.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/x-fetch": "^12.6.2",
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '12.0.1' };
+10 -10
View File
@@ -18,7 +18,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"bin": {
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.mjs",
@@ -28,15 +28,15 @@
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.mjs"
},
"dependencies": {
"@polkadot/api": "11.3.1",
"@polkadot/api-augment": "11.3.1",
"@polkadot/rpc-augment": "11.3.1",
"@polkadot/rpc-provider": "11.3.1",
"@polkadot/types": "11.3.1",
"@polkadot/types-augment": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/types-create": "11.3.1",
"@polkadot/types-support": "11.3.1",
"@polkadot/api": "12.0.1",
"@polkadot/api-augment": "12.0.1",
"@polkadot/rpc-augment": "12.0.1",
"@polkadot/rpc-provider": "12.0.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-augment": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/types-create": "12.0.1",
"@polkadot/types-support": "12.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"@polkadot/x-ws": "^12.6.2",
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '12.0.1' };
+3 -3
View File
@@ -18,11 +18,11 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/types": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '12.0.1' };
+4 -4
View File
@@ -18,7 +18,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^12.6.2",
@@ -26,9 +26,9 @@
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/types": "11.3.1",
"@polkadot/types-augment": "11.3.1",
"@polkadot/types-support": "11.3.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-augment": "12.0.1",
"@polkadot/types-support": "12.0.1",
"@polkadot/util-crypto": "^12.6.2"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/types-codec', path: 'auto', type: 'auto', version: '12.0.1' };
+3 -3
View File
@@ -18,14 +18,14 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/types-codec": "11.3.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/types": "11.3.1"
"@polkadot/types": "12.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/types-create', path: 'auto', type: 'auto', version: '12.0.1' };
+5 -5
View File
@@ -18,17 +18,17 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/networks": "^12.6.2",
"@polkadot/types": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/types-create": "11.3.1",
"@polkadot/types": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/types-create": "12.0.1",
"@polkadot/util": "^12.6.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@polkadot/api": "11.3.1"
"@polkadot/api": "12.0.1"
}
}
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/types-known', path: 'auto', type: 'auto', version: '12.0.1' };
+1 -1
View File
@@ -18,7 +18,7 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/util": "^12.6.2",
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/types-support', path: 'auto', type: 'auto', version: '12.0.1' };
+5 -5
View File
@@ -18,13 +18,13 @@
"./packageDetect.cjs"
],
"type": "module",
"version": "11.3.1",
"version": "12.0.1",
"main": "index.js",
"dependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/types-augment": "11.3.1",
"@polkadot/types-codec": "11.3.1",
"@polkadot/types-create": "11.3.1",
"@polkadot/types-augment": "12.0.1",
"@polkadot/types-codec": "12.0.1",
"@polkadot/types-create": "12.0.1",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2",
"rxjs": "^7.8.1",
@@ -32,6 +32,6 @@
},
"devDependencies": {
"@polkadot/keyring": "^12.6.2",
"@polkadot/types-support": "11.3.1"
"@polkadot/types-support": "12.0.1"
}
}
@@ -206,6 +206,13 @@ abstract class ExtrinsicBase<A extends AnyTuple> extends AbstractBase<ExtrinsicV
return this.inner.signature.metadataHash;
}
/**
* @description Forward compat
*/
public get mode (): INumber {
return this.inner.signature.mode;
}
/**
* @description Returns the raw transaction version (not flagged with signing information)
*/
@@ -334,6 +341,7 @@ export class GenericExtrinsic<A extends AnyTuple = AnyTuple> extends ExtrinsicBa
assetId: this.assetId ? this.assetId.toHuman(isExpanded, disableAscii) : null,
era: this.era.toHuman(isExpanded, disableAscii),
metadataHash: this.metadataHash ? this.metadataHash.toHex() : null,
mode: this.mode.toHuman(),
nonce: this.nonce.toHuman(isExpanded, disableAscii),
signature: this.signature.toHex(),
signer: this.signer.toHuman(isExpanded, disableAscii),
@@ -126,6 +126,13 @@ export class GenericExtrinsicSignatureV4 extends Struct implements IExtrinsicSig
return this.getT('assetId');
}
/**
* @description the [[u32]] mode
*/
public get mode (): INumber {
return this.getT('mode');
}
/**
* @description The [[Hash]] for the metadata
*/
+1 -1
View File
@@ -3,4 +3,4 @@
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '11.3.1' };
export const packageInfo = { name: '@polkadot/types', path: 'auto', type: 'auto', version: '12.0.1' };
+10
View File
@@ -145,6 +145,16 @@ export interface SignerResult {
* @description The resulting signature in hex
*/
signature: HexString;
/**
* @description The payload constructed by the signer. This allows the
* inputted signed transaction to bypass `signAndSend` from adding the signature to the payload,
* and instead broadcasting the transaction directly. There is a small validation layer. Please refer
* to the implementation for more information. If the inputted signed transaction is not actually signed, it will fail with an error.
*
* NOTE: This is only implemented for `signPayload`.
*/
signedTransaction?: HexString | Uint8Array;
}
export interface Signer {
+79 -79
View File
@@ -444,26 +444,26 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/api-augment@npm:11.3.1, @polkadot/api-augment@workspace:packages/api-augment":
"@polkadot/api-augment@npm:12.0.1, @polkadot/api-augment@workspace:packages/api-augment":
version: 0.0.0-use.local
resolution: "@polkadot/api-augment@workspace:packages/api-augment"
dependencies:
"@polkadot/api-base": "npm:11.3.1"
"@polkadot/rpc-augment": "npm:11.3.1"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-augment": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/api-base": "npm:12.0.1"
"@polkadot/rpc-augment": "npm:12.0.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-augment": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/api-base@npm:11.3.1, @polkadot/api-base@workspace:packages/api-base":
"@polkadot/api-base@npm:12.0.1, @polkadot/api-base@workspace:packages/api-base":
version: 0.0.0-use.local
resolution: "@polkadot/api-base@workspace:packages/api-base"
dependencies:
"@polkadot/rpc-core": "npm:11.3.1"
"@polkadot/types": "npm:11.3.1"
"@polkadot/rpc-core": "npm:12.0.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.6.2"
@@ -474,13 +474,13 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/api-contract@workspace:packages/api-contract"
dependencies:
"@polkadot/api": "npm:11.3.1"
"@polkadot/api-augment": "npm:11.3.1"
"@polkadot/api": "npm:12.0.1"
"@polkadot/api-augment": "npm:12.0.1"
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types-create": "npm:11.3.1"
"@polkadot/types-support": "npm:11.3.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/types-create": "npm:12.0.1"
"@polkadot/types-support": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
@@ -488,19 +488,19 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/api-derive@npm:11.3.1, @polkadot/api-derive@workspace:packages/api-derive":
"@polkadot/api-derive@npm:12.0.1, @polkadot/api-derive@workspace:packages/api-derive":
version: 0.0.0-use.local
resolution: "@polkadot/api-derive@workspace:packages/api-derive"
dependencies:
"@polkadot/api": "npm:11.3.1"
"@polkadot/api-augment": "npm:11.3.1"
"@polkadot/api-base": "npm:11.3.1"
"@polkadot/rpc-augment": "npm:11.3.1"
"@polkadot/rpc-core": "npm:11.3.1"
"@polkadot/rpc-provider": "npm:11.3.1"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types-support": "npm:11.3.1"
"@polkadot/api": "npm:12.0.1"
"@polkadot/api-augment": "npm:12.0.1"
"@polkadot/api-base": "npm:12.0.1"
"@polkadot/rpc-augment": "npm:12.0.1"
"@polkadot/rpc-core": "npm:12.0.1"
"@polkadot/rpc-provider": "npm:12.0.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/types-support": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
@@ -508,23 +508,23 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/api@npm:11.3.1, @polkadot/api@workspace:packages/api":
"@polkadot/api@npm:12.0.1, @polkadot/api@workspace:packages/api":
version: 0.0.0-use.local
resolution: "@polkadot/api@workspace:packages/api"
dependencies:
"@polkadot/api-augment": "npm:11.3.1"
"@polkadot/api-base": "npm:11.3.1"
"@polkadot/api-derive": "npm:11.3.1"
"@polkadot/api-augment": "npm:12.0.1"
"@polkadot/api-base": "npm:12.0.1"
"@polkadot/api-derive": "npm:12.0.1"
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/rpc-augment": "npm:11.3.1"
"@polkadot/rpc-core": "npm:11.3.1"
"@polkadot/rpc-provider": "npm:11.3.1"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-augment": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types-create": "npm:11.3.1"
"@polkadot/types-known": "npm:11.3.1"
"@polkadot/types-support": "npm:11.3.1"
"@polkadot/rpc-augment": "npm:12.0.1"
"@polkadot/rpc-core": "npm:12.0.1"
"@polkadot/rpc-provider": "npm:12.0.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-augment": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/types-create": "npm:12.0.1"
"@polkadot/types-known": "npm:12.0.1"
"@polkadot/types-support": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
eventemitter3: "npm:^5.0.1"
@@ -654,39 +654,39 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/rpc-augment@npm:11.3.1, @polkadot/rpc-augment@workspace:packages/rpc-augment":
"@polkadot/rpc-augment@npm:12.0.1, @polkadot/rpc-augment@workspace:packages/rpc-augment":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-augment@workspace:packages/rpc-augment"
dependencies:
"@polkadot/rpc-core": "npm:11.3.1"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/rpc-core": "npm:12.0.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/rpc-core@npm:11.3.1, @polkadot/rpc-core@workspace:packages/rpc-core":
"@polkadot/rpc-core@npm:12.0.1, @polkadot/rpc-core@workspace:packages/rpc-core":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-core@workspace:packages/rpc-core"
dependencies:
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/rpc-augment": "npm:11.3.1"
"@polkadot/rpc-provider": "npm:11.3.1"
"@polkadot/types": "npm:11.3.1"
"@polkadot/rpc-augment": "npm:12.0.1"
"@polkadot/rpc-provider": "npm:12.0.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
rxjs: "npm:^7.8.1"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/rpc-provider@npm:11.3.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
"@polkadot/rpc-provider@npm:12.0.1, @polkadot/rpc-provider@workspace:packages/rpc-provider":
version: 0.0.0-use.local
resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider"
dependencies:
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-support": "npm:11.3.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-support": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
"@polkadot/x-fetch": "npm:^12.6.2"
@@ -707,15 +707,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/typegen@workspace:packages/typegen"
dependencies:
"@polkadot/api": "npm:11.3.1"
"@polkadot/api-augment": "npm:11.3.1"
"@polkadot/rpc-augment": "npm:11.3.1"
"@polkadot/rpc-provider": "npm:11.3.1"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-augment": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types-create": "npm:11.3.1"
"@polkadot/types-support": "npm:11.3.1"
"@polkadot/api": "npm:12.0.1"
"@polkadot/api-augment": "npm:12.0.1"
"@polkadot/rpc-augment": "npm:12.0.1"
"@polkadot/rpc-provider": "npm:12.0.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-augment": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/types-create": "npm:12.0.1"
"@polkadot/types-support": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
"@polkadot/x-ws": "npm:^12.6.2"
@@ -732,24 +732,24 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-augment@npm:11.3.1, @polkadot/types-augment@workspace:packages/types-augment":
"@polkadot/types-augment@npm:12.0.1, @polkadot/types-augment@workspace:packages/types-augment":
version: 0.0.0-use.local
resolution: "@polkadot/types-augment@workspace:packages/types-augment"
dependencies:
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/types-codec@npm:11.3.1, @polkadot/types-codec@workspace:packages/types-codec":
"@polkadot/types-codec@npm:12.0.1, @polkadot/types-codec@workspace:packages/types-codec":
version: 0.0.0-use.local
resolution: "@polkadot/types-codec@workspace:packages/types-codec"
dependencies:
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-augment": "npm:11.3.1"
"@polkadot/types-support": "npm:11.3.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-augment": "npm:12.0.1"
"@polkadot/types-support": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
"@polkadot/x-bigint": "npm:^12.6.2"
@@ -757,32 +757,32 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-create@npm:11.3.1, @polkadot/types-create@workspace:packages/types-create":
"@polkadot/types-create@npm:12.0.1, @polkadot/types-create@workspace:packages/types-create":
version: 0.0.0-use.local
resolution: "@polkadot/types-create@workspace:packages/types-create"
dependencies:
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/types-known@npm:11.3.1, @polkadot/types-known@workspace:packages/types-known":
"@polkadot/types-known@npm:12.0.1, @polkadot/types-known@workspace:packages/types-known":
version: 0.0.0-use.local
resolution: "@polkadot/types-known@workspace:packages/types-known"
dependencies:
"@polkadot/api": "npm:11.3.1"
"@polkadot/api": "npm:12.0.1"
"@polkadot/networks": "npm:^12.6.2"
"@polkadot/types": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types-create": "npm:11.3.1"
"@polkadot/types": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/types-create": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
tslib: "npm:^2.6.2"
languageName: unknown
linkType: soft
"@polkadot/types-support@npm:11.3.1, @polkadot/types-support@workspace:packages/types-support":
"@polkadot/types-support@npm:12.0.1, @polkadot/types-support@workspace:packages/types-support":
version: 0.0.0-use.local
resolution: "@polkadot/types-support@workspace:packages/types-support"
dependencies:
@@ -791,15 +791,15 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types@npm:11.3.1, @polkadot/types@workspace:packages/types":
"@polkadot/types@npm:12.0.1, @polkadot/types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@polkadot/types@workspace:packages/types"
dependencies:
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/types-augment": "npm:11.3.1"
"@polkadot/types-codec": "npm:11.3.1"
"@polkadot/types-create": "npm:11.3.1"
"@polkadot/types-support": "npm:11.3.1"
"@polkadot/types-augment": "npm:12.0.1"
"@polkadot/types-codec": "npm:12.0.1"
"@polkadot/types-create": "npm:12.0.1"
"@polkadot/types-support": "npm:12.0.1"
"@polkadot/util": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
rxjs: "npm:^7.8.1"