question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add EXPERIMENTAL_changes functionality

See original GitHub issue

Is your feature request related to a problem? Please describe. Many partners and members from the community want to use events. We currently send them here: https://docs.near.org/docs/api/rpc-experimental#example-of-data-changes While you can send such a response directly the RPC, near-api-js does not allow such a command to happen (as far as I’m aware) because we don’t have the interface.

It seems you cannot use .sendJsonRpc until we map the parameters to the RPC request. Until we do this, folks will have to use a JavaScript fetch or axios call.

Describe the solution you’d like I believe we need to have an interface for EXPERIMENTAL_changes in: /src/providers/provider.ts that matches the RPC request struct (https://github.com/nearprotocol/nearcore/blob/master/core/primitives/src/rpc.rs)

pub struct RpcStateChangesRequest {
    #[serde(flatten)]
    pub block_id_or_finality: BlockIdOrFinality,
    #[serde(flatten)]
    pub state_changes_request: StateChangesRequestView,
}
}

Describe alternatives you’ve considered Using fetch will work, but then they aren’t using this library.

Lastly, we should revisit if this is truly “experimental” anymore.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
vgrichinacommented, Aug 19, 2020

sendJsonRpc is just a wrapper so you can pass the object you want to query with in there and it should work. Interface just makes it look nicer.

I don’t know how to do this

just pass plain JS object with necessary fields, taking into account serde annotations like https://serde.rs/attr-flatten.html

so in this case smth like:


await provider.sendJsonRpc('EXPERIMENTAL_changes', { block_id: 1234567, changes_type: 'account_changes', account_ids: ['account1', 'account2'] });
0reactions
mehtaphysicalcommented, Apr 21, 2021

Fixed in #534

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to test Overwatch's Experimental Mode changes in ...
The way to do this is simple. First, go to the game browser and select “create game.” Next, select your preset – in...
Read more >
Experimental practice range - Overwatch Forums
Go into pre-settings and choose “practice range” · Then go into the lobby options, then scroll down and enable (or allow) experimental changes...
Read more >
Enable experimental features in Power Automate
Experimental features provide you early access to functionalities and updates in Power Automate before they are available worldwide.
Read more >
Experimental Features Toggle in Minecraft Bedrock Edition
Provides capabilities for creators to validate their worlds and add-ons in Minecraft through a series of contained tests. Molang Features, New container for ......
Read more >
Test experimental features in Chrome - Google Support
Turn features on or off · Open Chrome. · Next to the address bar, select Experiments . · Next to the feature's name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found