NEAR Protocol - a sharded, developer-friendly, proof-of-stake public blockchain
Questions tagged [nearprotocol]
636 questions
-1
votes
1 answer
Simulation test of public method taking integers arguments fails with errorcode "WasmUnknownError"
The problem occurs when using the command "near-vm" to execute a simulation test of an assemblyscript smart contract method that takes inputs of type numbers like i32, u32, i64, u64. The following error is returned…

Jimmy Nsenga
- 156
- 2
- 7
-1
votes
1 answer
near-sdk-as u256 is not implemented yet?
I'm trying to implement a NEP141 Token with the assemblyscript sdk.
When I use the u256 variables from the near-sdk-as, I receive the following compilation error:
ERROR TS2322: Type '~lib/as-bignum/integer/u256/u256' is not assignable to type…

Doc_failure
- 94
- 1
- 8
-1
votes
1 answer
TypeError: Cannot read properties of undefined (reading 'format')
I am building a web app on NEAR Protocol using React and AssemblyScript (for smart contracts), which send NEAR to any Near wallet. I am constantly getting an error:-
Money.jsx:35 Uncaught (in promise) TypeError: Cannot read properties of undefined…

Moksh Singh Dangi
- 65
- 4
-1
votes
1 answer
How can I mint multiple NFT copies based on NEP-171 standard?
i'm actualy minting tokens like this:
self.tokens.mint(token_id.clone(),account.clone(),Some(token_metadata.clone())
this are the params that i use to minting new tokens:
'{"token_id":next_tokenid_counter,"account": "'dokxo.testnet'", …
-1
votes
1 answer
How can I verify if a near address is valid in smart contract?
Alice.near provided Bob.near as input to a smart contract for some operation. How can the smart contract verify that bob.near is a valid near address that exists before performing requested the operation, without sending any token?

skd
- 1
- 2
-1
votes
1 answer
How are fees denominated on Aurora network?
Are fees denominated in NEAR or is there an ETH token equivalent for fees that RPC operators would then collect in return for sending the wrapped transaction (thereby spending NEAR)?

Aliaksei Papou
- 57
- 5
-1
votes
1 answer
How do you call a payable method from the js client?
Imagine you got a smart contract method that expects a deposit attached to a method call, something like this rust method:
#[payable]
pub fn spend(&mu self, age: u8){
assert!(env::attached_deposit() > 0,
"Insufficient…

reza
- 90
- 1
- 14
-1
votes
1 answer
One to many relationship in NEAR protocol using rust
I am trying to use one to many relationships using near_sdk Map and Vector.
use near_sdk::collections::Map;
use near_sdk::collections::Vector;
#[near_bindgen]
#[derive(Default, BorshDeserialize, BorshSerialize)]
pub struct ProfileDetails {
…

Amiya Behera
- 2,210
- 19
- 32
-2
votes
1 answer
how to use U256 in near smart contract in rust language
I am trying to use U256 in rust smart contract for near protocol with a library called ethnum. But it always give errors like:
the trait `JsonSchema` is not implemented for `U256`
│ |
│ = help: the following other types implement trait…
-2
votes
2 answers
How to Best Setup an Escrow Wallet/Account in NEAR Protocol?
Objective: We are building a dual flow system on NEAR. The flow is something like:
Client -> Escrow Wallet -----true---> Beneficiary
Client -> Escrow Wallet -----false--> Client
I was just wondering if there is a standard procedure for this. Because…

Harsh Nambiar
- 9
- 2
-2
votes
2 answers
Decode Base64VecU8 to Vec and merge with another Vec
I'm attempting to merge a JSON string as Vec with the result of decoding a Base64VecU8 value:
pub fn decode_and_merge(&mut self, args: Base64VecU8) {
// This unwraps correctly
let args_des: Vec =…

Gus
- 6,545
- 4
- 36
- 39
-2
votes
1 answer
How can I make an atomic transfer of funds to multiple recipients on NEAR, using the Rust SDK?
I have a funds-distribution contract in Rust. It has a single payable API method that takes a vector of NEAR Account IDs (payees), and attempts to split the payment evenly between that list of recipients. The essential subroutine is this:
fn…

Mykle Hansen
- 552
- 3
- 11
-2
votes
1 answer
NEAR Protocol - What happens when Rust contract method args are declared as (&mut self, ...) vs. (&self, ...)?
Recently I copy pasted a bunch of method signatures and attempted to create a view method for a NEAR smart contract:
pub fn get_credits(&mut self, account_id: AccountId) -> u128 {
self.credits.get(&account_id).unwrap_or(0)
}
When calling this…

mattdlockyer
- 6,984
- 4
- 40
- 44
-3
votes
1 answer
Now i found the problem and i dont know to correct 'Incorrect syntax near '('.'
Else
conn2.Open()
Dim cmd3 As New SqlCommand("update Pr_masterItem
(item_id, item_name, inventory, subtitutes_exist, assembly_bom, satuan, cost_is_adjusted, harga_beli, harga_jual) values
(@item_id,…

Ari's
- 1
- 3
-3
votes
1 answer
How to pass an argument of type Option from a client to a function in Rust?
I have a smart contract written in Rust. In it there's a function which accepts an Option as one of it argumments.
How can I pass that argument from a client-side? Namely, from a JS, Python or any other language. Or even via Curl. For there's…

duman
- 11
- 2