Threads
December 22nd, 2021
We have currently 12 threads for the above date.
🛠 │ dev-support
status - Unresolved
Çağatay Soyer --> ```ts
let rng = new RNG
let roll = rng1.next();
this.choosedNumber = roll;
Why do i get random numbers between 0 - 10? I was expecting to get random numbers between 1 - 10
Mouradif --> How many times did you try? It might take a few shots before you get a '0'
Çağatay Soyer --> I tried so many times 😄 and i get a "0" but i don't want to get a "0" 😄 that's the problem
bucanero --> you could generate a number between 0-9, and then add `1` to the result. So you'll get 1...10.
Çağatay Soyer --> That's basically what i did 😄 I just wonder if there is something i could use with this method but i guess there is not.
Thanks for the reply!
🛠 │ dev-support
status - Unresolved
KennyYeg --> Hi getting an error when trying to receive payment via the wallet. We are able to link the wallet on our site though
KennyYeg --> Uncaught (in promise) Error: The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key
at Object.parseRpcError (near-api-js.min.js:1031)
at near-api-js.min.js:928
at async Object.exponentialBackoff [as default] (near-api-js.min.js:1019)
at async JsonRpcProvider.sendJsonRpc (near-api-js.min.js:928)
at async near-api-js.min.js:8
at async Object.exponentialBackoff [as default] (near-api-js.min.js:1019)
at async Account.signAndSendTransactionV2 (near-api-js.min.js:8)
at async transferAmount (VM6:66)
KennyYeg --> <@!bucanero> any thoughts/help on this? Hi getting an error when trying to receive payment via the wallet. We are able to link the wallet on our site though
[7:19 AM]
Uncaught (in promise) Error: The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key
at Object.parseRpcError (near-api-js.min.js:1031)
at near-api-js.min.js:928
at async Object.exponentialBackoff [as default] (near-api-js.min.js:1019)
at async JsonRpcProvider.sendJsonRpc (near-api-js.min.js:928)
at async near-api-js.min.js:8
at async Object.exponentialBackoff [as default] (near-api-js.min.js:1019)
at async Account.signAndSendTransactionV2 (near-api-js.min.js:8)
at async transferAmount (VM6:66
bucanero --> are you building a frontend app, a smart contract, or something else?
KennyYeg --> front end - drawstring.io - we are selling NFTs
KennyYeg --> using satori claim links but having a wallet issue
KennyYeg --> its links but no payments
bucanero --> are you using near-api-js
for your frontend, or only using Satori APIs?
KennyYeg --> NEAR api
KennyYeg -->
bucanero --> well it seems that you’re trying to do an action that was not allowed by the wallet user. So at some point the wallet user allowed some access to your front-end (for example to login) but the user didn’t gave permission for other actions like sending tokens. Also I don’t think any user will allow giving a full access key to an external app.
bucanero --> giving full-access key would be like giving their wallet to your app
KennyYeg --> copy whats the alternative - apparently did this the wrong way <@!bucanero>
KennyYeg --> <@!bucanero> trying to charge a fixed amount and then send a link once confirmed near was sent to us
🛠 │ dev-support
status - Resolved
Vicious3113 --> is there a standard for auditing smart contracts that are in deploy?
Benji | NEAR --> No there is not unfortunately. Just test and test and test.
Vicious3113 --> I say it, because I am starting to study Rust, but, in the case of solidity, the contracts in deploy can be audited and see all their available functions with their internal variables, but here, I can’t see how to do that
Vicious3113 --> So to be clear, that here is not possible, right?
Benji | NEAR --> ah you’re asking if you can audit somebody else’s contract that’s been deployed?
Vicious3113 --> Yes
Vicious3113 --> Yes
Benji | NEAR --> ah - that is not currently possible unfortunately. There isn’t a way to get the original code / interfaces from compiled wasm.
Vicious3113 --> Ok, thanks
🛠 │ dev-support
status - Resolved
Hao --> Hello everyone, are there any sample about near stake pool smart contract ? I’m newby 😃) want to use code to learn.😭
khorolets --> https://github.com/near/core-contracts/tree/master/staking-pool
Hao --> nice, thanks😀
🛠 │ dev-support
status - Resolved
kula --> any dao example by near on github?
Dorian | NEAR --> We have our sputnik DAO Repo you can take a look at if you’d like
Dorian | NEAR --> As far as examples what are you looking for?
Dorian | NEAR --> https://github.com/near-daos/sputnik-dao-contract.git
🛠 │ dev-support
status - Unresolved
Alex_Goodv1n_WTV --> Folks, quick question
Does the macro #[payable] actually do something or it’s more like a comment?
Dorian | NEAR --> let me ask someone real quick. Because I know that it’s required in some cases but as far as the details go I am wondering that myself
Alex_Goodv1n_WTV --> thanks
I did a little experiment and if you don’t mark a method with payable macro you can’t attach a deposit, otherwise it will panic
so there are checks under the hood ✊
Dorian | NEAR --> Oh yes haha that’s exactly what I just got from the person I pinged haha
It prevents a check from being added that asserts that attached deposit is 0. E.i. You're allowed to attach funds when asking the function
Alex_Goodv1n_WTV --> great! then I got it right
anyway thanks for clarifying.
That’s great that you answer our questions 🙂
Dorian | NEAR --> Happy to help! 🙂 And good job on figuring it out so fast!
🛠 │ dev-support
status - Resolved
rnhttr --> Are there any tutorials for NEAR integration with the graph?
kalloc --> https://thegraph.com/docs/en/supported-networks/near ?
rnhttr --> thanks!
🛠 │ dev-support
status - Resolved
rnhttr --> Any ETA on testnet support for The Graph?
Dorian | NEAR --> It actually just launched this week!
Dorian | NEAR --> They are still writing up documentation on it
Dorian | NEAR --> But it’s live
rnhttr --> How serendipitous!
rnhttr --> Awesome, thanks.
Aaron | Vital Point AI --> created a free course on The Graph and Near - might come in handy - been building subgraphs all week 🙂 http://vitalpoint.ai/academy/the-graph-near-building-subgraphs/
Dorian | NEAR --> Hey that’s awesome Aaron! I can’t wait to check it out!
🛠 │ dev-support
status - Resolved
Mouradif --> When you delete an account and choose an account to send all of the funds, does it also send NFTs ?
Benji | NEAR --> nope - NFT owners are stored in state on the contracts.
Mouradif --> Aren’t FT holders also stored in state on the contracts?
Mouradif --> oh wait, so it doesn’t send FTs either?
Benji | NEAR --> yea - FTs aren’t transferred either
Mouradif --> ok makes sense then
Benji | NEAR --> this is important as if you delete you account and still have FTs and NFTs, someone could come and create an account with your ID and then they would have all your assets
Benji | NEAR --> if you don’t wanna lose your assets, transfer them first and then delete the account.
Mouradif --> I asked because I was thinking of a game where you unlock Badges and Achievements as NFTs but I wanted to make it non transferable because the idea is not to have people buy or sell those NFTs, but just display them on their profile as a proof that they completed some task in the game
Benji | NEAR --> you can tailor a contract to do that pretty easily
Benji | NEAR --> wouldn’t be hard at all
Benji | NEAR --> in fact we basically have one already for you LOL
Mouradif --> but I also read somewhere that it’s a bad idea to make NFTs non transferrable because people can change addresses
Benji | NEAR --> go through this tutorial and by the end, you’ll have exactly what you want: https://docs.near.org/docs/tutorials/contracts/nfts/minting
Benji | NEAR --> just don’t implement the other standards / tutorials
Benji | NEAR --> yea I mean there’s definitely consequences
Benji | NEAR --> you could also only implement the core standard
Benji | NEAR --> and not the approvals / royalty standard
Benji | NEAR --> which would mean people could transfer but not sell them
Mouradif --> oh yeah! That solves everything 😄
Mouradif --> Thanks!
Benji | NEAR --> if you want to get to that point, just get through till the end of this tutorial: https://docs.near.org/docs/tutorials/contracts/nfts/core
Benji | NEAR --> also make sure you go through all the prior ones as well
Benji | NEAR --> not just this tutorial
Mouradif --> so in the end I guess I have to learn Rust xD
Benji | NEAR --> do you just only want the contract?
Benji | NEAR --> we have that too 😛
Mouradif --> no I meant VS AssemblyScript
Benji | NEAR --> oh i see
Benji | NEAR --> yea only rust sorry!
Benji | NEAR --> (for now)
Mouradif --> but it’s cool, it’s a great excuse to learn it 🙂
Benji | NEAR --> if you want the contract, here ya go: https://github.com/near-examples/nft-tutorial/tree/4.core
(make sure ur on the 4.core
branch)
Mouradif --> maybe once I get it, I’ll re-write it in assemblyscript ^^
Benji | NEAR --> yea for sure - go through the tutorial, it’s a rlly solid tutorial that goes through a LOT
Benji | NEAR --> go team 🙂
🛠 │ dev-support
status - Resolved
vmod --> is NEAR fully decentralized or is it like ETH
joaquimley --> <@!vmod> what do you mean “like ETH”? You mean having a “core team/foundation”
vmod --> no I think ijust read something wrong
vmod --> mb