Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@near-js/providers

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@near-js/providers - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

10

lib/json-rpc-provider.d.ts

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

import { AccessKeyWithPublicKey, BlockId, BlockReference, BlockResult, BlockChangeResult, ChangeResult, ChunkId, ChunkResult, EpochValidatorInfo, FinalExecutionOutcome, GasPrice, LightClientProof, LightClientProofRequest, NearProtocolConfig, NodeStatusResult, QueryResponseKind } from '@near-js/types';
import { AccessKeyWithPublicKey, BlockId, BlockReference, BlockResult, BlockChangeResult, ChangeResult, ChunkId, ChunkResult, EpochValidatorInfo, FinalExecutionOutcome, GasPrice, LightClientProof, LightClientProofRequest, NextLightClientBlockRequest, NextLightClientBlockResponse, NearProtocolConfig, NodeStatusResult, QueryResponseKind } from '@near-js/types';
import { SignedTransaction } from '@near-js/transactions';

@@ -102,2 +102,10 @@ import { Provider } from './provider';

/**
* Returns the next light client block as far in the future as possible from the last known hash
* to still be able to validate from that hash. This will either return the last block of the
* next epoch, or the last final known block.
*
* @see [https://github.com/near/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-block](https://github.com/near/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-block)
*/
nextLightClientBlock(request: NextLightClientBlockRequest): Promise<NextLightClientBlockResponse>;
/**
* Gets access key changes for a given array of accountIds

@@ -104,0 +112,0 @@ * See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#view-access-key-changes-all)

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

const types_1 = require("@near-js/types");
const transactions_1 = require("@near-js/transactions");
const borsh_1 = require("borsh");

@@ -76,3 +77,3 @@ const exponential_backoff_1 = require("./exponential-backoff");

return __awaiter(this, void 0, void 0, function* () {
const bytes = signedTransaction.encode();
const bytes = (0, transactions_1.encodeTransaction)(signedTransaction);
return this.sendJsonRpc('broadcast_tx_commit', [Buffer.from(bytes).toString('base64')]);

@@ -89,3 +90,3 @@ });

return __awaiter(this, void 0, void 0, function* () {
const bytes = signedTransaction.encode();
const bytes = (0, transactions_1.encodeTransaction)(signedTransaction);
return this.sendJsonRpc('broadcast_tx_async', [Buffer.from(bytes).toString('base64')]);

@@ -230,2 +231,14 @@ });

/**
* Returns the next light client block as far in the future as possible from the last known hash
* to still be able to validate from that hash. This will either return the last block of the
* next epoch, or the last final known block.
*
* @see [https://github.com/near/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-block](https://github.com/near/NEPs/blob/master/specs/ChainSpec/LightClient.md#light-client-block)
*/
nextLightClientBlock(request) {
return __awaiter(this, void 0, void 0, function* () {
return yield this.sendJsonRpc('next_light_client_block', request);
});
}
/**
* Gets access key changes for a given array of accountIds

@@ -232,0 +245,0 @@ * See [docs for more info](https://docs.near.org/docs/develop/front-end/rpc#view-access-key-changes-all)

5

lib/provider.d.ts

@@ -6,3 +6,3 @@ /**

import { SignedTransaction } from '@near-js/transactions';
import { AccessKeyWithPublicKey, BlockChangeResult, BlockId, BlockReference, BlockResult, ChangeResult, ChunkId, ChunkResult, FinalExecutionOutcome, GasPrice, LightClientProof, LightClientProofRequest, NearProtocolConfig, NodeStatusResult, QueryResponseKind, RpcQueryRequest, EpochValidatorInfo } from '@near-js/types';
import { AccessKeyWithPublicKey, BlockChangeResult, BlockId, BlockReference, BlockResult, ChangeResult, ChunkId, ChunkResult, FinalExecutionOutcome, GasPrice, LightClientProof, LightClientProofRequest, NextLightClientBlockRequest, NextLightClientBlockResponse, NearProtocolConfig, NodeStatusResult, QueryResponseKind, RpcQueryRequest, EpochValidatorInfo } from '@near-js/types';
/** @hidden */

@@ -20,5 +20,6 @@ export declare abstract class Provider {

abstract chunk(chunkId: ChunkId): Promise<ChunkResult>;
abstract validators(blockId: BlockId): Promise<EpochValidatorInfo>;
abstract validators(blockId: BlockId | null): Promise<EpochValidatorInfo>;
abstract experimental_protocolConfig(blockReference: BlockReference): Promise<NearProtocolConfig>;
abstract lightClientProof(request: LightClientProofRequest): Promise<LightClientProof>;
abstract nextLightClientBlock(request: NextLightClientBlockRequest): Promise<NextLightClientBlockResponse>;
abstract gasPrice(blockId: BlockId): Promise<GasPrice>;

@@ -25,0 +26,0 @@ abstract accessKeyChanges(accountIdArray: string[], BlockQuery: BlockId | BlockReference): Promise<ChangeResult>;

{
"name": "@near-js/providers",
"version": "0.0.2",
"version": "0.0.3",
"description": "Library of implementations for interfacing with the NEAR blockchain",

@@ -13,5 +13,5 @@ "main": "lib/index.js",

"http-errors": "^1.7.2",
"@near-js/transactions": "0.0.2",
"@near-js/types": "0.0.2",
"@near-js/utils": "0.0.2"
"@near-js/transactions": "0.1.0",
"@near-js/types": "0.0.3",
"@near-js/utils": "0.0.3"
},

@@ -18,0 +18,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc