Questions tagged [near-sdk-as]

5 questions
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
1
vote
1 answer

I am getting error - Element type must be nullable if array is holey while running the contract

{ "error": "wasm execution failed with error: FunctionCallError(HostError(GuestPanic { panic_msg: "Element type must be nullable if array is holey, filename: \"~lib/array.ts\" line: 103 col: 40" }))", "logs": [], "block_height":…
Deepu Kr
  • 23
  • 4
1
vote
1 answer

Is it possible to iterate over persistantMaps by near-sdk-as like in other programming languages?

I am storing key value using PersistentMap of near-sdk-as and Now I want to iterate over all the keys and values, is it possible ? PS: The PersistentMap interface given in near-docs contains only get , set and other basic methods.
Deepu Kr
  • 23
  • 4
0
votes
2 answers

How can I make sure my RNG numbers are unique?

I'm trying to select 2 random items out of a list using the RNG class. The problem is occasionally I get the same 2 numbers and I'd like them to be unique. I tried using a while loop to get another number if the it's the same as the last one but…
Christopher Thompson
  • 3,293
  • 1
  • 10
  • 16
-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…