🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@polkadot/api

Package Overview
Dependencies
Maintainers
2
Versions
3326
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/api - npm Package Compare versions

Comparing version
16.2.2
to
16.3.1
+1
-1
cjs/packageInfo.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.packageInfo = void 0;
exports.packageInfo = { name: '@polkadot/api', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '16.2.2' };
exports.packageInfo = { name: '@polkadot/api', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '16.3.1' };

@@ -51,2 +51,3 @@ "use strict";

const ExtrinsicBase = api.registry.createClass('Extrinsic');
const extrinsicInfoMap = new WeakMap();
class Submittable extends ExtrinsicBase {

@@ -106,13 +107,24 @@ #ignoreStatusCb;

const isSubscription = api.hasSubscriptions && (this.#ignoreStatusCb || !!statusCb);
const updatedInfo = extrinsicInfoMap.get(this);
extrinsicInfoMap.delete(this);
// eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
return decorateMethod(isSubscription
? this.#observeSubscribe
: this.#observeSend)(statusCb);
? () => this.#observeSubscribe(updatedInfo)
: () => this.#observeSend(updatedInfo))(statusCb);
}
/**
* @description Signs a transaction, returning `this` to allow chaining. E.g.: `signAsync(...).send()`. Like `.signAndSend` this will retrieve the nonce and blockHash to send the tx with.
*/
*/
signAsync(account, partialOptions) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
return decorateMethod(() => this.#observeSign(account, partialOptions).pipe((0, rxjs_1.map)(() => this)))();
return decorateMethod(() => this.#observeSign(account, partialOptions).pipe((0, rxjs_1.map)((info) => {
// If we got a full signed transaction from the signer, attach it
if (info.signedTransaction) {
const extrinsic = new Submittable(api.registry, info.signedTransaction);
extrinsicInfoMap.set(this, info);
return extrinsic;
}
// Fallback if signer didn’t return signedTransaction
return this;
})))();
}

@@ -119,0 +131,0 @@ // signAndSend implementation for all 3 cases above

@@ -21,3 +21,3 @@ {

"type": "module",
"version": "16.2.2",
"version": "16.3.1",
"main": "./cjs/index.js",

@@ -595,16 +595,16 @@ "module": "./index.js",

"dependencies": {
"@polkadot/api-augment": "16.2.2",
"@polkadot/api-base": "16.2.2",
"@polkadot/api-derive": "16.2.2",
"@polkadot/keyring": "^13.5.2",
"@polkadot/rpc-augment": "16.2.2",
"@polkadot/rpc-core": "16.2.2",
"@polkadot/rpc-provider": "16.2.2",
"@polkadot/types": "16.2.2",
"@polkadot/types-augment": "16.2.2",
"@polkadot/types-codec": "16.2.2",
"@polkadot/types-create": "16.2.2",
"@polkadot/types-known": "16.2.2",
"@polkadot/util": "^13.5.2",
"@polkadot/util-crypto": "^13.5.2",
"@polkadot/api-augment": "16.3.1",
"@polkadot/api-base": "16.3.1",
"@polkadot/api-derive": "16.3.1",
"@polkadot/keyring": "^13.5.3",
"@polkadot/rpc-augment": "16.3.1",
"@polkadot/rpc-core": "16.3.1",
"@polkadot/rpc-provider": "16.3.1",
"@polkadot/types": "16.3.1",
"@polkadot/types-augment": "16.3.1",
"@polkadot/types-codec": "16.3.1",
"@polkadot/types-create": "16.3.1",
"@polkadot/types-known": "16.3.1",
"@polkadot/util": "^13.5.3",
"@polkadot/util-crypto": "^13.5.3",
"eventemitter3": "^5.0.1",

@@ -611,0 +611,0 @@ "rxjs": "^7.8.1",

@@ -1,1 +0,1 @@

export const packageInfo = { name: '@polkadot/api', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '16.2.2' };
export const packageInfo = { name: '@polkadot/api', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '16.3.1' };

@@ -48,2 +48,3 @@ import { catchError, first, map, mergeMap, of, switchMap, tap } from 'rxjs';

const ExtrinsicBase = api.registry.createClass('Extrinsic');
const extrinsicInfoMap = new WeakMap();
class Submittable extends ExtrinsicBase {

@@ -103,13 +104,24 @@ #ignoreStatusCb;

const isSubscription = api.hasSubscriptions && (this.#ignoreStatusCb || !!statusCb);
const updatedInfo = extrinsicInfoMap.get(this);
extrinsicInfoMap.delete(this);
// eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
return decorateMethod(isSubscription
? this.#observeSubscribe
: this.#observeSend)(statusCb);
? () => this.#observeSubscribe(updatedInfo)
: () => this.#observeSend(updatedInfo))(statusCb);
}
/**
* @description Signs a transaction, returning `this` to allow chaining. E.g.: `signAsync(...).send()`. Like `.signAndSend` this will retrieve the nonce and blockHash to send the tx with.
*/
*/
signAsync(account, partialOptions) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return,@typescript-eslint/no-unsafe-call
return decorateMethod(() => this.#observeSign(account, partialOptions).pipe(map(() => this)))();
return decorateMethod(() => this.#observeSign(account, partialOptions).pipe(map((info) => {
// If we got a full signed transaction from the signer, attach it
if (info.signedTransaction) {
const extrinsic = new Submittable(api.registry, info.signedTransaction);
extrinsicInfoMap.set(this, info);
return extrinsic;
}
// Fallback if signer didn’t return signedTransaction
return this;
})))();
}

@@ -116,0 +128,0 @@ // signAndSend implementation for all 3 cases above

Sorry, the diff of this file is too big to display