@near-js/providers
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -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) |
@@ -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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40246
749
+ Added@near-js/crypto@0.0.3(transitive)
+ Added@near-js/keystores@0.0.3(transitive)
+ Added@near-js/signers@0.0.3(transitive)
+ Added@near-js/transactions@0.1.0(transitive)
+ Added@near-js/types@0.0.3(transitive)
+ Added@near-js/utils@0.0.3(transitive)
- Removed@near-js/crypto@0.0.2(transitive)
- Removed@near-js/keystores@0.0.2(transitive)
- Removed@near-js/signers@0.0.2(transitive)
- Removed@near-js/transactions@0.0.2(transitive)
- Removed@near-js/types@0.0.2(transitive)
- Removed@near-js/utils@0.0.2(transitive)
Updated@near-js/transactions@0.1.0
Updated@near-js/types@0.0.3
Updated@near-js/utils@0.0.3