---
# System prepended metadata

title: 'Encode Club NEAR Bootcamp 6 - DAY 6 [24/01/2022]'
tags: [bootcamp transcripts]

---

# Encode Club NEAR Bootcamp 6 - DAY 6 [24/01/2022]
---
## [DAY 6 Recording](https://youtu.be/sFTW5b1N3jw)
---
# Questions:
---

## learning Javascript and Assemblyscript which one is better? 

Actually Javascript is a programming language and React is a toolkit that use to get things done which requires javascript like it call as web development framework. But assemblyscript is its own language it complies to web assembly in that case its different from other programming languages were you just write and run immediately there is a compilation step were you use a piece of software to create a smaller compact instruction to the byte code that deployed ot run on a wsam compatible virtual machine.

if you want to get familar with the syntax of javascript and assemblyscript there's difference in learning curve of assemblyscript. on upcoming days javascript is coming as a contract development environment like sdk so you can write a contract development smart contract using javascript so its a best investment of your time.

---

## Why export is used before every function even as class?
From my knowledge is like you writing a smart contract and deploying it to the wasm virtual machine that is running on the NEAR. So how do you call the function on this code from outside so they need to pop from the virtual machine. so the function that export in assemblyscript gets mapped to an external interface in the wasm bytecode that some function available externally so the virtual machine that you are running sees this things and make them accessible from the outside world. The export is making the function to cal outside world in to smart contract. Its the same thing when you implement the struct and interface for a struct in rust and make your function public.
Its basically allowing the assemblyscript pushes the function out in its interface so that can be discover from the outside world.

---

## compiling Rust contract?
The process of compiling is bring all those files in to single(binary).eg: Some complicate contract they breakup the entry point the lib.rs the rust project.
In assembly scrpit project there is index.ts were many other files are being imported and compiled and turn into single binary that gets deployed as the contract.
Its like structuring the files to maintain.Its like implementing the part of several different files to logically group with your own documentation and when you compiled the lib.rs linking all these files and brings it all into a single interface of the contract.

---

## What happen while login NEAR wallet when local storage stored in url?
Lets say take NEAR university you can able to see login icon when click that what happen is the near-api-js which is there let to connect to NEAR network make a new key(temporary/pending) and put key in local storage. Then it creates the trasaction saying when this transaction is signed it will add this key to the account. so it sends you to the wallet with this transaction in the url then near wallet ask to allow for the application access to apporve it this signs the transaction to add this key to your account as a function called access key.

--The wallet to perform it uses full access key to adds the fuction called access key, then it redirects back to the application to say the key in valid and near-api-js edits the key pending to ready
then you uses it to make a funciton call against the contract.

---



###### tags: `bootcamp transcripts`
