Questions tagged [near]

NEAR Protocol - a sharded, developer-friendly, proof-of-stake public blockchain

94 questions
5
votes
1 answer

Near Protocol FunctionCallError(MethodResolveError(MethodNotFound))

I'm new in blockchain, smart contract and near protocol. I'm trying to learn from https://near.academy/ . There's a sample contract on testnet : museum.testnet. I'm using windows and i installed wsl2. I can login with near login command. But after…
4
votes
0 answers

How to get basic info of near wallet from near api?

I am trying to get the basic info shown in the near wallet using near API. I want to fetch the info regarding stake and staking reward, basically all the info like:- I am able to get the stacked near amount but not getting Reward earned, Pending…
Mohit Chandel
  • 1,838
  • 10
  • 31
4
votes
1 answer

NEAR Protocol Smart Contract Instantiation Error

I am trying to deploy the smart contract for a NEAR Protocol DAO. I am facing a problem during the Instantiation of the contract. I am passing this data to create a DAO but it is not working - Link to the above transaction -…
3
votes
1 answer

How to link a WASM binary inside near-sdk Rust code that targets WASM

I have a WASM function that I want to use in my near-sdk Rust project that targets WASM. How can I call this function inside my Rust code?
eduardogbg
  • 553
  • 4
  • 18
3
votes
2 answers

How can I fix "Error happened while deserializing the module" error?

Git repo clone link: https://github.com/oserk/NearProtocol-Student-Award.git Note: You will get the same error when you follow the steps in the "readme" file. Error name: Error happened while deserializing the module Error screenshot:…
oserk
  • 31
  • 3
3
votes
1 answer

ExecutionError:Smart contract panicked:panicked at Cannot deserialize the contract state.:Custom kind:InvalidInput,error:"Unexpected length of input"

#[derive(BorshSerialize, BorshDeserialize)] pub struct NotesDs { pub own: Vec, pub shared: UnorderedMap>, } impl NotesDs{ pub fn new() -> Self { assert!(env::state_read::().is_none(), "Already…
Megha Agarwal
  • 81
  • 1
  • 7
3
votes
1 answer

NEAR transaction without receipt but with receipt_outcome

When querying archival node for transactions with EXPERIMENTAL_tx_status method, some transactions have no receipts while having receipts_outcome. How is that possible, and how is that transaction different from others? If I understand correctly,…
Adam R
  • 61
  • 5
3
votes
1 answer

How to serialize enum in borsh-js

Trying to serialize an object in Rust and deserialize it in JS We got 000100000031 hash, after serialization this: pub enum Service { Stackoverflow, Twitter, Telegram, } pub struct ServiceId { pub service: Service, pub id:…
kiskesis
  • 171
  • 1
  • 1
  • 9
2
votes
0 answers

How to pre-compute the receipt_id/is the receipt_id pre-computed based on the transaction/transaction hash?

I'm trying to link some receipts to the transactions it came from. I don't see a way from the docs to query a receipt and get the transaction it's associated with (there is only an RPC endpoint for transaction->receipt…
0xtu
  • 21
  • 2
2
votes
0 answers

near-sdk-rs view account keys

I want to obtain in my smart contract the list of keys for a specific user. On RPC, I would do it like this: curl --location --request POST 'https://rpc.mainnet.near.org/' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc":…
tituszban
  • 4,797
  • 2
  • 19
  • 30
2
votes
0 answers

How to solve the error found invalid character; only `#` is allowed in raw string delimitation? (Rust)

I'm new to Rust and Near Protocol. During training I faced the following problem: If you follow the example log!( r#"EVENT_JSON:{"standard": "nepXXX", "version": "1.0.0", "event": "YYY", "data": {"token_id": "{}"}}"#, token_id ); of…
2
votes
0 answers

Near Pagoda Trying to connect to https://rpc.testnet.near.org/ but getting CORS

folks, trying to connect to Pagoda via near-api-js const CONTRACT_NAME = process.env.CONTRACT_NAME || 'mycontract.testnet' const API_KEY = '06cffba5-e0c5-bla-bla-blablabla'; const keyStore = new keyStores.BrowserLocalStorageKeyStore(); My config…
kiskesis
  • 171
  • 1
  • 1
  • 9
2
votes
1 answer

NEAR Locking Funds into smart contract

i'm quite struggling understanding how we can deposit and withdraw funds from smart contract on NEAR blockchain. I'm currently using near-sdk-as with AssemblyScript. According to documentation I do have…
Retr0
  • 21
  • 1
2
votes
1 answer

How can I view all data stored by a NEAR account?

I know from https://github.com/near/near-cli#overview that I can call near state to view general details of an account, like this: NEAR_ENV=mainnet near state root.near Account root.near { amount: '517981340092537993206924239', …
Ryan
  • 22,332
  • 31
  • 176
  • 357
2
votes
3 answers

How to remove Smart Contract in NEAR Protocol?

I am new to blockchain and Near Protocol. I have created 2 smart contracts on Near Protocol. The first one was successfully done but when I try to deploy the second one, I have deployed it but when I try to call a method ('increment' in this case)…
oldner
  • 115
  • 2
  • 12
1
2 3 4 5 6 7