Docs Category: 714

Implementing the login button

Login with NEARAdd the login functionality Plan We’re going to add a login button that uses near-api-js to login with NEAR. Below is the workflow of logging in: User clicks the login button near-api-js creates a private key in the browser A redirect to NEAR Wallet occurs, passing the public key. NEAR Wallet (often) has …

Implementing the login button Read More »

Adding a new puzzle now that we’re using a collection that can contain multiple crossword puzzles

Login with NEARAdding a puzzle We’re going to make a new puzzle, which means we need to provide the smart contract with a set of clues and info about the answers. Of course, we’ll not be sending the answers to the smart contract, otherwise everyone could see. We will, however, send details about each clue, …

Adding a new puzzle now that we’re using a collection that can contain multiple crossword puzzles Read More »

Covering access keys and login

Login with NEARLogging in with NEAR Previously… In the previous chapter we simply displayed whether the crossword puzzle was solved or not, by checking the solution hash against the user’s answers. Updates to transfer prize money In this chapter, our smart contract will send 5 Ⓝ to the first person who solves the puzzle. For …

Covering access keys and login Read More »

How to think about structs and enums when writing a Rust smart contract on NEAR

Login with NEARStructs and enums Overview Structs If you’re not familiar with Rust, it may be confusing that there are no classes or inheritance like other programming languages. We’ll be exploring how to use structs, which are someone similar to classes, but perhaps simpler. Remember that there will be only one struct that gets the …

How to think about structs and enums when writing a Rust smart contract on NEAR Read More »

There are several Actions an account can do, including sending the winner of the crossword puzzle NEAR using the Transfer Action

Login with NEARActions (including sending NEAR) We’re going to introduce a new Action: Transfer. In this chapter, we’d like the first person to solve the crossword puzzle to earn some prize money, sent in NEAR. Art by qiqi04.near We’ve already used Actions in the previous chapter, when we deployed and initialized the contract, which used …

There are several Actions an account can do, including sending the winner of the crossword puzzle NEAR using the Transfer Action Read More »

Scroll to Top