Threads
January 14th, 2022
We have currently 38 threads for the above date.
🛠 │ dev-support
status - Resolved
Parachute --> How Near determine the transaction sequence?by gas fee or what
frol --> https://nomicon.io/ChainSpec/Transactions.html#transaction-ordering
🛠 │ dev-support
status - Unresolved
Amac --> Hmm, maybe open an issue out on the near standards and suggest a standard market place interface. Tbh I don’t think that there are any standards for market places on other platforms, would be pretty neat to see what kind of conversations that Sparks.
https://github.com/near/NEPs/tree/master/specs/Standards
Benji | NEAR --> yea everything is still very very new. Feel free to start a discussion 🙂
Amac --> I do have a question, I was looking to implementat a multi token contract like erc1155 and see that there isn’t any equivalent nep, so thought i could write a proxy contract that adheres to nep141. Is there a way for that proxy contract to leverage view functions??
Amac --> My limited testing is that the cross contract calls all require a function call vs view.
🛠 │ dev-support
status - Resolved
ikehakinyemi.near --> This prompt on the terminal:
This account already has a deployed contract [ EGAADymwE33cs3kUP1n4vNbXYrBM2WdqeQp28eunAMi4 ]. Do you want to proceed? (y/n) y
Does it delete the previously deployed smart contract on the testnet account and deploy the new one I’m trying to upload? Or what?
ikehakinyemi.near --> Made changes to the smart contract, and wants to deploy the changes but it looks more like I’m deleting the recently deployed contract to deploy the new updated one. Is this the normal process? Or is there a way to just update the deployed smart contract with my recent changes than utterly deleting it?
camchis --> you have to deploy a new contract
ikehakinyemi.near --> Deleting the old one entirely?
ikehakinyemi.near --> Alright.
ikehakinyemi.near --> Got my first error after deploying:
Scheduling a call: chukwuka.testnet.increment()
Doing account.functionCall()
Receipt: A4dHZ4Q4YCYghE9W4CVdNsDfuqit3rtFGjx5u3vAVNpp
Failure [chukwuka.testnet]: Error: {"index":0,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidData, error: \"Not all bytes read\" }', /Users/ikehakinyemi/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-3.1.0/src/environment/env.rs:786:46"}}
ServerTransactionError: {"index":0,"kind":{"ExecutionError":"Smart contract panicked: panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidData, error: \"Not all bytes read\" }', /Users/ikehakinyemi/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-3.1.0/src/environment/env.rs:786:46"}}
at Object.parseResultError (/Users/ikehakinyemi/.nvm/versions/node/v14.18.1/lib/node_modules/near-cli/node_modules/near-api-js/lib/utils/rpc_errors.js:31:29)
at Account.signAndSendTransactionV2 (/Users/ikehakinyemi/.nvm/versions/node/v14.18.1/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:160:36)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async scheduleFunctionCall (/Users/ikehakinyemi/.nvm/versions/node/v14.18.1/lib/node_modules/near-cli/commands/call.js:57:38)
at async Object.handler
ikehakinyemi.near --> ```
(/Users/ikehakinyemi/.nvm/versions/node/v14.18.1/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
type: ‘FunctionCallError’,
context: undefined,
index: 0,
kind: {
ExecutionError: Smart contract panicked: panicked at 'Cannot deserialize the contract state.: Custom { kind: InvalidData, error: "Not all bytes read" }', /Users/ikehakinyemi/.cargo/registry/src/github.com-1ecc6299db9ec823/near-sdk-3.1.0/src/environment/env.rs:786:46
},
transaction_outcome: {
proof: [ [Object], [Object] ],
block_hash: ‘DZFUdoJB5vrwVcDPZjfadz4egytAvqWnGXWLVPpZeVkZ’,
id: ‘DoWHof38NGV2QM5igE3GvmV8ngPTPC4pyui1uHi969rr’,
outcome: {
logs: [],
receipt_ids: [Array],
gas_burnt: 2427945595274,
tokens_burnt: ‘242794559527400000000’,
executor_id: ‘chukwuka.testnet’,
status: [Object],
metadata: [Object]
}
}
}
Here's my rust file: https://github.com/IkehAkinyemi/rust-smart-contract-1/blob/main/src/lib.rs
or would there be a first command I need to run, like an initialization command, before running my public functions?
ikehakinyemi.near --> Can I deploy a rust smart contract to a testnet account and redeploy another smart contract to that the same account?
ikehakinyemi.near --> Is this possible?
camchis --> if you want to make changes
nrmmyth --> Each account (contract) has 2 things you need to worry about: Code and State.
- 'near deploy' will just update the code but
- if you wish to have a fresh deploy with new state you should do: 'near delete', 'near create-account' and then 'near deploy' to recreate the account first
Zero-to-Hero tutorial will explain the fundamentals about this: https://www.near-sdk.io/zero-to-hero/basics/overview
🛠 │ dev-support
status - Unresolved
xyq --> Where should I run this command
omniscientsquid --> In your active terminal
xyq --> cmd?
omniscientsquid --> Yes. It exports a global variable NEAR_ENV so that other processes can refer to it.
xyq --> If the test network is switched to the main network,What code should I use
xyq --> The ‘export’ entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program
xyq --> I use export NEAR_ENV=mainnet
xyq --> It’s invalid
omniscientsquid --> Are you windows or unix?
xyq --> windows
omniscientsquid --> Im not a windows user, but a quick google for replacement of export returned…
in PowerShell
$env:OPENAI_LOGDIR="path/to/tensorboard/data"
in cmd
set OPENAI_LOGDIR=path/to/tensorboard/data
xyq -->
xyq --> Still can’t connect to mainnet
xyq --> in windows,How to change the test network to the main network on near cli
xyq --> anyome know?
bucanero --> for Windows you probably need to use:
set NEAR_ENV=mainnet
🛠 │ dev-support
status - Unresolved
mhassanist --> hi everyone, how to update an entry in persistent vector?
https://stackoverflow.com/questions/70708921/updating-an-entry-in-persistentvector-not-working-near-protocol
🛠 │ dev-support
status - Resolved
Jay Rank --> Can anyone please help me with what error am I facing and how to resolve it? I am trying to mint an NFT on testnet using PRE-DEPLOYED CONTRACT under ZERO TO HERO
documentation section
near call example-nft.testnet nft_mint '{"token_id": "firsttryonnear", "receiver_id": "rankjay.testnet", "token_metadata": "https://rank.png"}' --accountId rankjay.testnet --deposit 0.1
Jay Rank --> The supported image
nrmmyth --> It’s probably Windows and quotes. I think you need to escape " as \" but not sure.
Jay Rank --> can you give me an example sir? about how to use this escape character?
nrmmyth --> https://stackoverflow.com/questions/28648473/windows-curl-with-json-data-on-the-command-line
🛠 │ dev-support
status - Unresolved
Hatzz --> why are batch jsonrpc requests replying to me that it is an invalid rpc json?
Hatzz --> is near not conforming to the rpc spec?
zcstarr --> here’s a thing I haven’t really paid to much attention to, but how does one access logs emitted from the smart contract from the RPC endpoints/js sdk . It’s unclear how i’d retrieve that data that’s associated with the contract https://gov.near.org/t/standard-convention-for-structured-logging-or-events/3809/3 . There’s another one about moving to binary events under the hood but it’s unclear how to read events
Hatzz --> I have this issue aswell and its really frustrating. Another thing is that you cant do batch transactions so crawling the chain is really hard
Hatzz --> I wish i could just get events for a block or chunk
Dorian | NEAR --> oh like transaction information?
Hatzz --> I’m thinking of the events that are defined in the nft standard, there is no easy way to fetch them using the rpc endpooints
Hatzz --> https://stackoverflow.com/questions/70729985/are-batch-json-rpc-requests-not-supported-with-near <:shy_duck:828015327832309790>
Hatzz --> Thanks for the answer, was this a design choice?
Hatzz --> or is there a technical limitation?
Benji | NEAR --> you cannot do batch RPC calls, this is correct.
Benji | NEAR --> it was a design choice to not clog the network
Hatzz --> <:sadge:829794645550432266> this limits things a lot and really forces you to run the indexer program which is not cheap
Hatzz --> also this should be clearly communicated in either the response or documentation i believe
Benji | NEAR --> cc <@!bucanero> let’s add this to docs
Hatzz --> do you believe batch requests will ever be supported? it can lower latency and ux instead of sending a billion seperate calls
Benji | NEAR --> no, I don’t think they will
Hatzz --> might also clog the network less since you don’t have to go through the http things every time
zcstarr --> I think without indexing there isn’t a clean way to get logs from the chain yet
🛠 │ dev-support
status - Resolved
Jack Robson --> getting Server error: The node reached its limits
after setting up kurtosis-localnet. Is this a limitation because I’m on m1?
bucanero --> Regarding Kurtosis, I think <@!mieubrisse> could answer your questions
mieubrisse --> Hey <@!Jack Robson> just sent you some steps in <#912467453479616542> !
🛠 │ dev-support
status - Resolved
Jack Robson --> i’m trying to write some tests for my code, testing against testnet
however the transaction fees and gas fees are different every test run
has anybody got any tips on how to keep these factors consistent?
Jack Robson --> hm… now I say it out loud , maybe I can track these fees in real time and factor that into my test
🛠 │ dev-support
status - Unresolved
bgnsta --> Hi,
After adding my Ledger to my Near Wallet, I was asked if I wanted to delete old keys. This made sense to me, as what is the point of adding my ledger if other keys still work. However, after deleting these keys I lost access to my OCT validator. “Error: Cannot find matching key for transaction sent to xxxxxx.factory.bridge.near”
🛠 │ dev-support
status - Unresolved
omniscientsquid --> Can anybody help me with a formatting issue? I am trying to complete the zero to hero nft examples. On the last section for market place I am trying to call nft_approve, but struggling to get it to accept my ‘msg’ argument that goes through to the nft_callbacks.nft_on_approve. If I enclose the message as a string with " " around keys it won’t process msg as a complete string, and without it cannot parse the msg string as json as the keys aren’t accepted as strings.
This is my bash command:
near call NFT nft_approve '{"token_id": "approval-token", "account_id": "'MARKET’", “msg” : “{sale_conditions: {price: 5}}” }’ --accountId $SELLER --deposit 0.2
And the error is
'Not valid SaleArgs: Error(“key must be a string”
How do I declare the message in the right format?
🛠 │ dev-support
status - Unresolved
Andrew Sokolov --> hey guys,
I completely new to near protocol and trying to write my first app.
Is it ok to use standard rand library for Rust to generate random numbers inside near contract:
use rand::prelude::*;
let num = rand::thread_rng().gen_range(1, 100);
bucanero --> No, I think you can't use the rand library from Rust. Blockchains are very restricted regarding these functions.
Andrew Sokolov --> ok, are there any suggestions about what I can use to generate random number in Rust for Near contact ?
bucanero --> Recently we were talking about this topic, and a user pointed to this video: https://youtu.be/mr6GdB7CHPg?t=545
I think that the proposed solution in the video uses a Chainlink oracle, but I haven't tested it so I can't really say
🛠 │ dev-support
status - Unresolved
Dragonyx --> hey guys, new here, would like to ask, M62xcRnxbb3vMQ/l9GD9bcxyrpDFS3F79ul4SPLODOGJeT97TP3DXO8xD+X0YP1tzHKukMVLcXv26XhI8s4M4Yl5P3tM/cNcALzhxxjwD3RHUKnTCfxiCsIGLASqwmTEGPti1GD5Eqr/BgAAAERpS0t2OYCy5g4AAAAArwgAAAAAAAABgce/YQAAAACaAgAAAAAAAP0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==
is this encoded with borsh ?
bucanero --> that’s base64 encoding.
Dragonyx --> ye but can’t decode it to readable chars
bucanero --> base64 encodes binary data into a subset of ASCII characters
Dragonyx --> how would you suggest doing to decode it ?
bucanero --> where does that base64 message comes from?
Dragonyx --> this string should give info either in binary or json form
Dragonyx --> it’s from solana apis
Dragonyx --> using Json rcp 2.0
bucanero --> I don’t really know about Solana APIs or how they encode stuff
Dragonyx --> asked some time ago in their server and a guy said it’s done with borsh on rust
bucanero --> they’re probably serializing some objects first, then using base64…
Dragonyx --> would make sense
bucanero --> you could try decoding base64, and then feed the binary data using a borsh decoder .
bucanero --> But probably Solana devs could provide a better answer.
Dragonyx --> okk might try that, you know by any chance if the borsh py package contains also a decoder ? or i must have it done on an external language
bucanero --> I assume any decent library should have both, enconder and decoder
🛠 │ dev-support
status - Unresolved
zcstarr --> <@!austinabell> or someone familiar with the 4.x.x sdk there seems to be a shift in the serialization for AccountId, in the past ValidAccountId serialized to just string, but it seems like AccountId now serializes to { Account : string} in the {“near-sdk-rs”: 4.0.0-pre5} has there been a shift in the way AccountId is serialized ?
🛠 │ dev-support
status - Unresolved
nrmmyth --> How do you burn tokens and currency in NEAR? In ETH you send them to 0x0000000000000000000000000000000000000000. Is there a NEAR equivalent of this?
🛠 │ dev-support
status - Resolved
bucanero --> <@!xyq> you were asking about how to call methods from a deployed smart contract, right?
here’s an example, this tutorial shows how to call methods on an NFT contract: https://docs.near.org/docs/tutorials/contracts/nfts/predeployed-contract
xyq --> thanks
🛠 │ dev-support
status - Unresolved
monkey_nui --> i need your help admin
monkey_nui --> how to recovery my acc, i lost 12 secrects key word
bucanero --> could you check with <#🤝 │ community-support> ? unless you had a recovery setup, your account might be lost.
monkey_nui --> i have private key , is it ok?
🛠 │ dev-support
status - Unresolved
hrust16 --> Hi
hrust16 --> Failure [xxxx.near]: Error: The account xxxx.near wouldn’t have enough balance to cover storage, required to have 2937818518636002900000000 yoctoNEAR more
I get this error when I try to deploy a contract. Do you have to pay around 3 near whenever you deploy the contract or just the first time?
🛠 │ dev-support
status - Resolved
spiritbro1 --> is there a way to list method in near contract?
nrmmyth --> Try this Telegram bot https://t.me/nearwasmbot
spiritbro1 --> wow cool thanks my man
🛠 │ dev-support
status - Unresolved
Icarium --> hey, guys. i posted this on stack overflow. any thoughts?
🛠 │ dev-support
status - Unresolved
meatcurtains --> Anyone else having trouble running the Counter example for AssemblyScript? I’ve generated a dev account for it and have it running, but when I try to increment the counter, I receive this message: “Uncaught (in promise) Error: Wrong AccessKey used for transaction: transaction is sent to receiver_id=dev-1642177286636-53525054872652, but is signed with function call access key that restricted to only use with receiver_id=dev-1642172741971-92913292030130. Either change receiver_id in your transaction or switch to use a FullAccessKey.”
Dorian | NEAR --> oh neat, a few Qs. Are you using gitpod or did you clone the repo?
I want to tsee if I can reproduce this error
meatcurtains --> I got it to work using Gitpod, but haven’t been able to get it to work locally
Dorian | NEAR --> what steps did you take to produce the error.
you clone the repo
then you ran a dev deploy then what happened?
🛠 │ dev-support
status - Unresolved
ros --> How do you sign a message in Near ? (Like an easy way) So I can prove to someone else I have control of an account
Dorian | NEAR --> mm depends on how deep into it you want to get.
like you can manually set up a transaction to sign.
like in this tutorial shown here https://docs.near.org/docs/tutorials/create-transactions
ros --> So like in send-tokens-easy.js , could I just send a zero amount, just to prove I control the account?
ros --> Or is zero not allowed?
Dorian | NEAR --> I guess you can haha. But you’ll still pay a small amount for a transaction fee
Dorian | NEAR --> https://explorer.testnet.near.org/transactions/JBmXhJNPZ1DX64humgYZ3Quziab6UrP85GAV5Cresxty
Benji | NEAR --> You don’t need to put it on chain. You can use your keys to sign a message offline
Benji | NEAR --> Native crypto libraries will allow this functionality
Dorian | NEAR --> oh you can? which libraries?
Benji | NEAR --> for example: https://www.geeksforgeeks.org/node-js-crypto-sign-function/
ros --> crypto.sign(algorithm, data, key)
What is the algorithm for near?
ros --> I’m guessing js-sha256
Benji | NEAR --> AFAIK we’re using sha256
ros --> If anyone else doing this… here is the other part
https://www.geeksforgeeks.org/node-js-crypto-verify-function/
🛠 │ dev-support
status - Unresolved
netpoe --> Hi fellow NEAR devs
Any NEAR Rust contract examples that use DateTime
, chrono
or similar to compare time?
I’m looking to compare if a date is lower or greater than now
What’s the ideal way of handling time in NEAR contracts?
Dorian | NEAR --> I’m actually not too sure. Pinged one of our more experienced rust devs to assist you
Dorian | NEAR --> Mmm not sure tbh. We can try real quick
🛠 │ dev-support
status - Unresolved
nrmmyth --> How do you burn tokens and currency in NEAR? In ETH you send them to 0x0000000000000000000000000000000000000000. Is there a NEAR equivalent of this?
🛠 │ dev-support
status - Unresolved
aishat --> Hello please I asked a question on slack overflow and here’s the link https://stackoverflow.com/questions/70710400/issues-adding-near-tokens-in-assemblyscript-smart-contract-using-u128-add-func
I would appreciate if anyone can help lookthrough, thank you
🛠 │ dev-support
status - Unresolved
slawomir.pr --> hello… need a quick help
slawomir.pr --> 1. how to get all calls to a contract?
Dorian | NEAR --> heyoo
slawomir.pr --> for 1 i mean account X is calling method Y on contract Z, i’d like to get all such transaction hashes on given contract
slawomir.pr --> basically want to iterate over all minted NFTs
Dorian | NEAR --> Oh I see. Like within the contract or with the use of an indexer?
slawomir.pr --> can be using contract methods
slawomir.pr --> https://github.com/near-examples/NFT/blob/master/nft/src/lib.rs
slawomir.pr --> zerotohero has this
near view example-nft.testnet nft_tokens_for_owner
slawomir.pr --> but the contract code doesn’t contain nft_tokens_for_owner methods, so i assume im looking at the wrong contract?
slawomir.pr --> basically asking because it’d probably take me like 2 days to figure out what’s best 😉 So whatever you think will work can be contract or indexer
slawomir.pr --> checking the contract code… not sure if im correct but probably the only way is going block-by-block and analyzing transactions targeting given contract or its storage, seems correct?
Dorian | NEAR --> Oh I was referring to this https://github.com/near-examples/nft-tutorial.git
Dorian | NEAR --> did you want to hop into office hours? Maybe we can talk about it there?
slawomir.pr --> sure would be cool
Dorian | NEAR --> https://discord.gg/f9hFFBeg
Dorian | NEAR --> are you still there? sorry for the wait
slawomir.pr --> ah sorry had to go out i think i know more or less now
🛠 │ dev-support
status - Unresolved
Vitcos --> Hi, I’m making a smart contract using near-sdk-rs
and I’m wondering what’s the best approach for time measurements inside contracts. I was looking at epoch height
and block timestamp
, but I’m not sure which one should I use.
15 seconds rule
from Ethereum apply here?🛠 │ dev-support
status - Unresolved
buddhaha --> Hi, I’m looking to develop a smart contract for my NFT collection to launch on near. Are there any good tutorials or such that I should look into before I start bothering ya’ll here? 😄
joaquimley --> https://github.com/near-examples/NFT
Benji | NEAR --> Here
Benji | NEAR --> https://docs.near.org/docs/tutorials/contracts/nfts/introduction
buddhaha --> Thanks 🙂 I’ve been looking through this a bit. I was wondering if you know how to avoid doing per-token metadata. I’m a newbie, but I feel like errors could easily occur if I would provide metadata from the frontend due to synchronization.
Would it be a viable strategy to create a hashmap or such that holds metadata per token prior to mint?
joaquimley --> I didn’t fully understand your question but I would recommend you to Google a little more and read the available documentation as it might give you more insight on how you should build for your use case.
A good rule of thumb is not allowing the client (frontend) be free to do what it wants with the state/data, have your contract code be as defensive/rule enforcer as possible and hold your core/business logic there vs it being exploitable from the client(s).
buddhaha --> Yeah, the latter point was what I was aiming at 😄 Sorry for my horrible writing lol
buddhaha --> I’m reading through the zero to hero documentation now, which seems like it may answer my question, hehe
buddhaha --> Thanks <@!joaquimley>
🛠 │ dev-support
status - Unresolved
meowdy --> Hey everybody <a:pepewave:888209357009997834> new here coming from a js/solidity background. Was wondering which language has more fleshed out documentation and which are projects using more: AssemblyScript or Rust? Trying to decide which to learn, thank you
Josh | NEAR --> Rust is the winner here IMO. Larger community, more documentation, and more mature language than AS. Check out near-sdk.io for documentation on our Rust SDK.
Josh | NEAR --> http://near-sdk.io
meowdy --> Awesome, I appreciate the info!
Josh | NEAR --> Here is also a video created by <@!Mike Purvis | NEAR> that goes through an intro to Rust: https://www.youtube.com/watch?v=eVmVMrwZW0g
Josh | NEAR --> Also, if you are looking to learn more about how to build on NEAR… take advantage of our free education courses:
https://www.near.university/
meowdy --> Oh sick these are exactly what I was looking for thanks so much!!
🛠 │ dev-support
status - Unresolved
farghaly --> How to start a node with a pre-defined node key ?
Josh | NEAR --> Checkout our node docs:
https://docs.near.org/docs/develop/node/intro/keys
Josh | NEAR --> There is also a validator bootcamp here if you are looking to learn more: https://bootcamp.openshards.io/
🛠 │ dev-support
status - Unresolved
hrust16 --> I get error
hrust16 --> wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))
hrust16 --> after calling near view $MARKETPLACE_CONTRACT_ID get_sales_by_owner_id ‘{“account_id”: “hrust16.near”, “from_index”: “0”, “limit”: 10}’
hrust16 --> why is this? get_sales_by_owner_id method in deployed within the contract
Dorian | NEAR --> can you attach a snippet of how the function is defined in the contract code?
hrust16 --> //returns paginated sale objects for a given account. (result is a vector of sales)
pub fn get_sales_by_owner_id(
&self,
account_id: AccountId,
from_index: Option
limit: Option
) -> Vec
//get the set of token IDs for sale for the given account ID
let by_owner_id = self.by_owner_id.get(&account_id);
//if there was some set, we set the sales variable equal to that set. If there wasn’t, sales is set to an empty vector
let sales = if let Some(by_owner_id) = by_owner_id {
by_owner_id
} else {
return vec![];
};
//we'll convert the UnorderedSet into a vector of strings
let keys = sales.as_vector();
//where to start pagination - if we have a from_index, we'll use that - otherwise start from 0 index
let start = u128::from(from_index.unwrap_or(U128(0)));
//iterate through the keys vector
keys.iter()
//skip to the index we specified in the start variable
.skip(start as usize)
//take the first "limit" elements in the vector. If we didn't specify a limit, use 0
.take(limit.unwrap_or(0) as usize)
//we'll map the token IDs which are strings into Sale objects
.map(|token_id| self.sales.get(&token_id).unwrap())
//since we turned the keys into an iterator, we need to turn it back into a vector to return
.collect()
}
hrust16 --> entire error looks like this.
hrust16 --> An error occured
Error: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound)).
{
“error”: “wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))”,
“logs”: [],
“block_height”: 57416540,
“block_hash”: “8Mg5HDNZGdQpPATAxLHoiTG21nzseZvacBHkA1vZKwVm”
}
at JsonRpcProvider.query (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Account.viewFunction (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24)
at async exports.callViewFunction (/usr/local/lib/node_modules/near-cli/index.js:94:48)
at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9)
TypedError: Querying [object Object] failed: wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound)).
{
“error”: “wasm execution failed with error: FunctionCallError(MethodResolveError(MethodNotFound))”,
“logs”: [],
“block_height”: 57416540,
“block_hash”: “8Mg5HDNZGdQpPATAxLHoiTG21nzseZvacBHkA1vZKwVm”
}
at JsonRpcProvider.query (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/providers/json-rpc-provider.js:123:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Account.viewFunction (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:366:24)
at async exports.callViewFunction (/usr/local/lib/node_modules/near-cli/index.js:94:48)
at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
type: ‘UntypedError’,
context: undefined
}
Dorian | NEAR --> So you built the contract,
and deployed it,
and even from the cli it’s not working?
hrust16 --> yes, that is correct
Dorian | NEAR --> hm want to hop into the office hours chat for a sec?
hrust16 --> sure
Benji | NEAR --> what’s the account ID where the contract is deployed to
hrust16 --> hrust16.near
Benji | NEAR --> I can almost guarantee you deployed the wrong wasm
Benji | NEAR --> I’m guessing u deployed the NFT contract wasm by accident
Benji | NEAR --> yup u deployed the wrong wasm
Benji | NEAR -->
Benji | NEAR --> cc <@!Dorian | NEAR> ^
🛠 │ dev-support
status - Unresolved
MajinSensei --> anyone here knows if there is a dev site for paras? thanks
MajinSensei --> found it https://testnet.paras.id/
🛠 │ dev-support
status - Unresolved
slawomir.pr --> hey just an impression and out of curiosity… is Near based on Solana and if yes how much codebase is shared more or less?
Benji | NEAR --> nope we’re built from the ground up.
joaquimley --> No, completely different actually