NEAR Protocol - a sharded, developer-friendly, proof-of-stake public blockchain
Questions tagged [near]
94 questions
1
vote
2 answers
How to see logging when running integration tests in Rust (using NEAR Workspaces-rs in particular)
I'm using https://github.com/near/workspaces-rs/ and have lines in my functions like log!("Removed {} from {}", &key, &recipient);
(using use near_sdk::{env, log};)
But those log messages don't appear in the terminal when I run my integration…

Ryan
- 22,332
- 31
- 176
- 357
1
vote
2 answers
Is there a way to query for the account balances of a NEAR account over time or other advanced datasets?
What services or APIs are available to do advanced queries of account state on NEAR Protocol? The most basic is a time series of account balances for a specific account over time, eg:
# for account foo.near
20220731 1.234
20220730 1.567
...
I…

Erik Trautman
- 5,883
- 2
- 27
- 35
1
vote
2 answers
In a Rust test, how can I check the state (account balance) of an account using NEAR protocol?
In a Rust test, how can I check the state (account balance) of an account?
E.g. I have this helper function:
fn set_context(account_index: usize, is_view: bool, deposit: Amount) {
let context = VMContextBuilder::new()
…

Ryan
- 22,332
- 31
- 176
- 357
1
vote
1 answer
How do I use 'create_account_and_claim'
I've had some success creating accounts using create_account with the JSON RPC.
I've read from the co-founder of NEAR that we can create accounts and generate links for those accounts to be claimed.
The documentation doesn't mention it, I guess…

G087
- 23
- 3
1
vote
1 answer
Error: Sender xxx.testnet does not have enough balance 9.99991607015 for operation costing 100.0000861846776875
I am currently doing a course on NEAR on a site called dacade.org
In the tutorial, after creating a top level account on the NEAR testnet, I create a sub account.
$ near create-account contract.xxx.testnet --masterAccount xxx.testnet
When I do…

ysaito
- 41
- 5
1
vote
1 answer
How to query NEAR node block height by near-cli?
How to query NEAR node block height by near-cli?
I didn't find it on https://docs.near.org/docs/tools/near-cli

Jonkrua wu
- 11
- 1
1
vote
0 answers
Command `yarn jest` failed
I'm learning Near with 'Guide to Cross-contract Calls'.
(https://docs.near.org/docs/tutorials/contracts/cross-contract-calls)
In step 1, I got an error in a new command prompt when I typed yarn jest.
How can I figure it out?

Shift_that
- 183
- 1
- 5
1
vote
1 answer
as-pect.config.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module"
When I test with as-pect I get an error in CRUD dApp with NEAR. The whole error I get is as follows;
yarn test
[Error] There was a problem loading [/Users/malibilgin/Documents/Web3/order-management-with-near/contract/as-pect.config.js].
Error…

malibil
- 163
- 2
- 13
1
vote
0 answers
Race condition possibility in asynchronous NEAR cross contract calls
Let's say:
I have two smart contracts X and Y. The cross-contract (XSS) flow is Alice -> X -> Y.
Y transfers some tokens to X. The XSS to Y does not return how many tokens were transferred, so X needs to check its balance using ft_balance_of().
The…

secretshardul
- 1,635
- 19
- 31
1
vote
0 answers
NFT Listing for Sale on NEAR Marketplace
On the basis of this NFT example https://github.com/near-examples/nft-tutorial/, I have created two contracts, lets say:
dd-token-v1.testnet - NFT Token Contract (Will allow anyone to mint NFTs)
dd-marketplace-v2.testnet - NFT Marketplace…
1
vote
2 answers
NEAR Protocol CompilationError
Hello Guys I got a CompilationError at Near (@ Macbook M1 Chip Terminal) I called the helloWorld function but I got that error. Does anyone have an idea why? Thanks in advance for help :)
near call dev-1649760447277-15731695561522 helloWorld…

KadirGocebe
- 13
- 4
1
vote
0 answers
NEAR cli v3.2 asks for 3 confirmations for each ledger public key
Every time I generate a command on the CLI which requires ledger, it asks for access to the public key on the device three times before proceeding. The transaction itself is successful (or fails) independently of this. Why?
(details removed)
$ near…

Erik Trautman
- 5,883
- 2
- 27
- 35
1
vote
1 answer
Smart contract panicked: The account faucet.xx.testnet is not registered
I have a faucet token contract named "faucet.xxx.testnet" and there is a minting method where I would mint some tokens to my near wallet "m2.testnet" account and do a call back at the same time in the contract.
However, after calling to the minting…

MDD
- 61
- 1
- 4
1
vote
0 answers
How I can deserialize in borsh UnorderedMap? Near
How I can deserialize in borsh UnorderedMap?
Now my schema is
const schema = new Map([
[
Record,
{
kind: "struct",
fields: [
["x2", { kind: 'map', key: 'string', value: 'u128'}],
],
},
],
]);
Rust…

Peter Volnov
- 21
- 3
1
vote
0 answers
On-chain poof for staking rewards payout
I am trying to find out how the rewards are sent to the validators account/delegation contract. Where is that information stored and how can it be retrieved from the RPC nodes?

simibac
- 7,672
- 3
- 36
- 48