jcarbonnell/preTrainingNEAR huggingface dataset:
The continued evolution of the NEAR Foundation
NEAR FOUNDATION
September 21, 2023
The NEAR Foundation’s vision is one of an Open Web, where users have true ownership of their data and assets, and are empowered to participate in value creation, ownership and governance opportunities in permissionless systems. The ultimate goal is to enable billions of users to participate in an Open Web. 

To help achieve this, the NEAR Foundation strategy has been two-fold – one of top-down to attract prominent Web2 organizations into Web3, the other of bottoms-up to empower the ecosystem through the fostering of grassroots community – all of this being powered by the Blockchain Operating System and NEAR Protocol. The primary goal has been to grow users (MAU) so that more people can experience what Web3 can bring to them. Great progress has been made, with over 2.6m Monthly Active Users on NEAR protocol driven by this strategy, with NEAR protocol now as one of the top 5 most active blockchains driven by innovative partnerships such as Cosmose AI.

Over recent months, there have been discussions between NEAR Foundation leadership and the NEAR Foundation Council (NFC) on the strategic direction of the Foundation and the best way the Foundation can continue in its evolution to support the NEAR ecosystem in achieving this broader vision.

As part of this, Marieke Flament has elected to move into a council-only position to support the continued evolution of the Foundation. Chris Donovan, General Counsel of the Foundation, will step up as CEO and will work closely with the NFC and the broader ecosystem on the Foundation’s evolution plans. Chris has been with the Foundation for over a year since joining from Outlier Ventures and brings a wealth of experience in web3. In addition to her role on the NFC, Marieke will also stay on as a strategic advisor to Chris until the end of the year. There are no changes to the current strategy of the Foundation.

In a statement, Mona El Isa, Chairperson of the NFC remarked: “Marieke has been pivotal in all the incredible progress the NEAR ecosystem has made over the last two years, bringing NEAR to be one of the most active ecosystems in web3 and progressing the journey of the ecosystem towards decentralization. Amidst many critical industry and world events, Marieke has set the NEAR Foundation and the NEAR ecosystem on a solid pathway. I am excited to welcome Chris into his new role – I could think of no one better placed to continue the Foundation’s mission and wish him all the success.”
```js
const ammContract = "v2.ref-finance.near";
const result = Near.call(
  ammContract,
  "swap",
  {
    actions: [
      {
        pool_id: 79,
        token_in: "token.v2.ref-finance.near",
        token_out: "wrap.near",
        amount_in: "100000000000000000",
        min_amount_out: "1",
      },
    ],
  },
  300000000000000,
  1
);
```

<details>
<summary>Example response</summary>

```json
"5019606679394603179450"
```
</details>
Near Partners with BORA, Web3 GameFi Platform of Kakao Games
NEAR FOUNDATION
March 6, 2023
Near is excited to announce a new strategic partnership with BORA, a Web3  gaming subsidiary of METABORA. Near and BORA will support each other in spreading local brand awareness, invest in research and collaboration on cross-chain, host events, and generate Web3 opportunities in Korea. 

An affiliate of Kakao Games and its parent company BORANETWORK, BORA is focused on game development and blockchain-based gaming ecosystems. Its mobile gaming titles include Friends Popcorn, Friends Town, and Friends Shot. 

“We are thrilled to be working with Near and welcome their expertise, knowledge and network as we aim to transform the world of Web3 gaming,” said Vincent Lim, a CBO of BORA. “Together with Near we will not only explore cross-promotion opportunities, but also seek future collaborations on IP-based game development that will lead to mass adoption and give us the competitive edge we need to position ourselves as leading players in the web3 gaming space.”

Since the launch of Near’s Korean Hub in November of 2022, BORA has been steadily building up awareness throughout South Korea, while focusing on Web3  innovation, business development, education, and talent. The hub is led by entrepreneurs Scott Lee and Ben Kang — both influential figures within South Korea’s growing blockchain community.

“One of the big ambitions of the hub  is  to tap into the country’s active gaming community, and to  bring  amazing projects and creators to the Near ecosystem.” said Robbie Lim, GM, Partners & International at Near. “ The partnership with BORA is our first major win – and a big step forward for NEAR as it accelerates its ambition to become the go to layer 1 for the Web3 gaming community.”
Customer acquisition platform helps crypto companies grow
COMMUNITY
April 17, 2020
Depending on who you ask, the drop-off rate of blockchain applications is somewhere between 95% and 97%. This means that no more than five users actually succeed with onboarding for every 100 that try. In addition, web2 users today barely see any value in blockchain applications, which they often describe as “toy applications.” 

Currently, the market of blockchain applications is extremely tiny, with somewhere between 10,000 and 12,000 developers in the mix. As a result, there are only a couple hundred projects, very few of which have any traction. 

Talented entrepreneurs and developers expect robust developer tooling, seamless onboarding for their users, and numerous opportunities to monetize their applications and businesses over time. Such an infrastructure is almost non-existent on a protocol-level today. As such, there is an opportunity for developers to build applications that solve these challenges. 

What if you could encode digital assets into URLs and QR codes? Not only this, what if you could send this URL to your friend who doesn’t even have a digital wallet?

Introducing Linkdrop
Linkdrop helps crypto-native organizations (e.g., protocols, decentralized applications, and wallets) manage their marketing campaigns by providing tools that help them target their potential customers. URLs and QR codes allow them to create a seamless experience for end-users, including the first-time crypto users. With this approach, users don’t have to deal with complex wallet creation processes, and crypto-native organizations enjoy significantly improved conversion rates during the onboarding stage. 

In addition, Linkdrop creates opportunities for companies to tap into their users’ networks by allowing them to invite their friends through referral links. 

Not only can you address the crypto-acquiring process with Linkdrop, you can also enable wallet creation and sign in with Google via Linkdrop’s wallet widget. 

With Linkdrop, companies can manage their link campaigns, distribute them, and run analytics in one place. This allows you to measure the impact of your Linkdrop campaigns and use meaningful user analytics to optimize your next one. 


Why Blockchain:

Linkdrop started with the blockchain market as an entry point in other markets. From Linkdrop’s perspective, gaming and internet companies integrating blockchain-based marketing will be the first outside of crypto to adopt Linkdrop solutions. Once blockchain becomes the dominant technology for transferring value, traditional companies will start acquiring users with blockchain-based marketing campaigns.

Further Reading
Linkdrop’s blog

Relevant Industries
Wallets (e.g., Gnosis Safe, Coinbase Wallet, and Trust Wallet are customers), blockchain applications (e.g., Decentraland, Snark.art, and Pool Together), protocols (e.g., Binance, Flow, and NEAR).
```js
import { Wallet } from './near-wallet';

const KEYPOM_CONTRACT_ADDRESS = "v2.keypom.near";
const FT_CONTRACT_ADDRESS = "ft.primitives.near";
const DROP_AMOUNT = "10000000000000000000000";

const wallet = new Wallet({ createAccessKeyFor: KEYPOM_CONTRACT_ADDRESS }); 

await wallet.callMethod({
  method: "create_drop",
  contractId: KEYPOM_CONTRACT_ADDRESS,
  args: {
    public_keys: state.publicKeys,
    deposit_per_use: DROP_AMOUNT,
    ftData: {
      contractId: FT_CONTRACT_ADDRESS,
      senderId: accountId, // TODO How to get account id
      // This balance per use is balance of human readable FTs per use. 
      amount: "1"
      // Alternatively, you could use absoluteAmount, which is dependant on the decimals value of the FT
      // ex. if decimals of an ft = 8, then 1 FT token would be absoluteAmount = 100000000
    },
  },
  deposit: "23000000000000000000000" // state.publicKeys.length * dropAmount + 3000000000000000000000,
  gas: "100000000000000",
});
```

_The `Wallet` object comes from our [quickstart template](https://github.com/near-examples/hello-near-examples/blob/main/frontend/near-wallet.js)_
# Refunds

When execution of a receipt fails or there is some unused amount of prepaid gas left after a function call, the Runtime generates refund receipts.

The are 2 types of refunds:
- Refunds for the failed receipt for attached deposits. Let's call them **deposit refunds**.
- Refunds for the unused gas and fees. Let's call them **gas refunds**.

Refund receipts are identified by having `predecessor_id == "system"`. They are also special because they don't cost any gas to generate or execute. As a result, they also do not contribute to the block gas limit.

If the execution of a refund fails, the refund amount is burnt.
The refund receipt is an `ActionReceipt` that consists of a single action `Transfer` with the `deposit` amount of the refund.

## Deposit Refunds

Deposit refunds are generated when an action receipt fails to execute. All attached deposit amounts are summed together and
sent as a refund to a `predecessor_id` (because only the predecessor can attach deposits).

Deposit refunds have the following fields in the `ActionReceipt`:
- `signer_id` is `system`
- `signer_public_key` is ED25519 key with data equal to 32 bytes of `0`.

## Gas Refunds

Gas refunds are generated when a receipt used the amount of gas lower than the attached amount of gas.

If the receipt execution succeeded, the gas amount is equal to `prepaid_gas + execution_gas - used_gas`.

If the receipt execution failed, the gas amount is equal to `prepaid_gas + execution_gas - burnt_gas`.

The difference between `burnt_gas` and `used_gas` is the `used_gas` also includes the fees and the prepaid gas of
newly generated receipts, e.g. from cross-contract calls in function calls actions.

Then the gas amount is converted to tokens by multiplying by the gas price at which the original transaction was generated.

Gas refunds have the following fields in the `ActionReceipt`:
- `signer_id` is the actual `signer_id` from the receipt that generates this refund.
- `signer_public_key` is the `signer_public_key` from the receipt that generates this refund.

## Access Key Allowance refunds

When an account used a restricted access key with `FunctionCallPermission`, it may have had a limited allowance.
The allowance was charged for the full amount of receipt fees including full prepaid gas.
To refund the allowance we distinguish between Deposit refunds and Gas refunds using `signer_id` in the action receipt.

If the `signer_id == receiver_id && predecessor_id == "system"` it means it's a gas refund and the runtime should try to refund the allowance.

Note, that it's not always possible to refund the allowance, because the access key can be deleted between the moment when the transaction was
issued and when the gas refund arrived. In this case we use the best effort to refund the allowance. It means:
- the access key on the `signer_id` account with the public key `signer_public_key` should exist
- the access key permission should be `FunctionCallPermission`
- the allowance should be set to `Some` limited value, instead of unlimited allowance (`None`)
- the runtime uses saturating add to increase the allowance, to avoid overflows
Pyth Price Feeds Launch on NEAR Protocol Bringing Equity, Commodities, and Market Data On Chain
NEAR FOUNDATION
November 30, 2023
Pyth, the largest first-party provider of real-time market data for crypto, equities, FX, and commodities to more than 40 blockchains, has launched on NEAR protocol. Pyth, whose services are used by more than 80 market participants — including Jane Street, CBOE, Binance, OKX, and Bybit — brings high-fidelity, high frequency financial market data to the NEAR blockchain natively for the first time.

Previously, Pyth had deployed its feeds to Aurora, the EVM chain built on NEAR. But today Pyth data feeds are fully compatible with NEAR Protocol.   

The announcement is a boon to the burgeoning DeFi ecosystem built on top of NEAR, which stands to benefit from data feeds that update every 300 milliseconds.

While other oracle providers use third-party data providers or relayers, Pyth’s data comes from institutions directly. Additionally, Pyth does not use price triggers to prevent certain prices from being pushed. Pyth uses Confidence Intervals to ensure continuous price availability. This new metric allows projects to consume Pyth’s price feeds during the most volatile market conditions.

The Importance of Oracles 
Oracles are an important part of any DeFi ecosystem, since they are the information bridges between blockchains and databases. Although oracles could be built by the developers of DeFi projects, out-of-box, decentralized oracles are helpful for builders to start quickly without losing time and effort creating their own oracles. 

“Celebrating a new era of data reliability and trust, Douro Labs is thrilled to announce the seamless integration of Pyth Network with the NEAR blockchain,” says Abhimanyu Bansal, Head of Partnerships at Douro Labs. 

“This strategic partnership empowers developers on NEAR with real-time, accurate data feeds, and as we bridge the gap between the physical and digital worlds this integration propels us towards a future of decentralized applications that are not only secure but also truly informed.”

Pyth has a robust network that is able to deliver price data even during sizable events. During the LUNA/UST incident in May ‘22, Pyth managed to track the LUNA price very accurately during the UST de-peg, while other networks stopped updating the price, causing inaccurate price data. 

In less than a year since Pyth’s launch, the network secured more than $2.0B in total value. Pyth has facilitated over $70 billion in trading volume and received over a million client downloads from passionate developers. Pyth supports 350+ low-latency price feeds across digital assets, equities, ETFs, forex pairs, and commodities.
import DocCardList from '@theme/DocCardList';
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';

# Standards

<DocCardList items={useCurrentSidebarCategory().items}/>

## Table of Contents

- [Fungible Token](Tokens/FungibleToken/README.md)
    - [Core Standard](Tokens/FungibleToken/Core.md)
    - [Metadata](Tokens/FungibleToken/Metadata.md)
    - [Events](Tokens/FungibleToken/Event.md)
- [Non-Fungible Token](Tokens/NonFungibleToken/README.md)
    - [Core Standard](Tokens/NonFungibleToken/Core.md)
    - [Metadata](Tokens/NonFungibleToken/Metadata.md)
    - [Approval Management](Tokens/NonFungibleToken/ApprovalManagement.md)
    - [Enumeration](Tokens/NonFungibleToken/Enumeration.md)
    - [Royalty Payout](Tokens/NonFungibleToken/Payout.md)
    - [Events](Tokens/NonFungibleToken/Event.md)
- [Storage Management](StorageManagement.md)
- [Events Format](EventsFormat.md)
---
title: Recruitment Resources
sidebar_label: Recruitment Resources
sidebar_position: 1
---

---

With NEAR being among the most interoperable and developer friendly Layer 1’s, developers of any technical background should find building on NEAR proves to be a great experience.

:::info on this page
* Career Portals
* Community Hubs
:::


## Discover Talent & Post Open Roles 


### [NEAR Careers Portal](https://careers.near.org/jobs)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="link__logo iconExternalLink_node_modules-@docusaurus-theme-classic-lib-next-theme-IconExternalLink-styles-module"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>

Discover open roles available within the NEAR Ecosystem, and you can also post open roles within your team as well.

---

## Recruitment Support


### [![Black Freelancer](@site/static/img/logo_blackfreelancer.svg)](https://www.blackfreelancer.com/)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="link__logo iconExternalLink_node_modules-@docusaurus-theme-classic-lib-next-theme-IconExternalLink-styles-module"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>

BlackFreelancer is a hub for black creatives across the globe to showcase their work and get hired.

### [![BEExperience](@site/static/img/logo_beexperience.svg)](https://beexperience.io/)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="link__logo iconExternalLink_node_modules-@docusaurus-theme-classic-lib-next-theme-IconExternalLink-styles-module"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>

The HUB of education and recruitment within Web3. Beexperience provides services to hiring entities, as well as individuals seeking employment.

* Help with connecting candidates to open vacancies.
* HR and Technical screening interviews to garantuee talent.
* Educational frameworks to help with onboarding and upskilling
* Providing facilities for instructor lead workshops both virtually and in person 
* Web3 LinkedIn framework

<!-- ### [![NEAR Week](@site/static/img/logo_nearweek.svg)](https://nearweek.com/)<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="link__logo iconExternalLink_node_modules-@docusaurus-theme-classic-lib-next-theme-IconExternalLink-styles-module"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg>

Community-driven newsletter. It covers anything and everything within the NEAR Ecosystem. If you're looking for an extra dose of NEAR-focused news, look no further. -->
```js
import { Wallet } from './near-wallet';

const DAO_CONTRACT_ADDRESS = "primitives.sputnik-dao.near";
const wallet = new Wallet({ createAccessKeyFor: DAO_CONTRACT_ADDRESS });
 
await wallet.callMethod({
  method: 'act_proposal',
  args: { id: 0, action: "VoteApprove" },
  contractId: DAO_CONTRACT_ADDRESS,
  gas: 300000000000000,
});
```

:::note
Available vote options: `VoteApprove`, `VoteReject`, `VoteRemove`.
:::

_The `Wallet` object comes from our [quickstart template](https://github.com/near-examples/hello-near-examples/blob/main/frontend/near-wallet.js)_
---
sidebar_position: 1
---

# Unit Tests

You can unit test abstracted logic implemented by smart contract functions like regular JavaScript functions with any testing library of your liking. A simple example would look as follows: 

#### Contract 
```js	
@NearBindgen({})
export class Contract {
  ...
  doSomething(): string {
    return callSomeFunction();
  }
}
```

#### Unit Test File 
```js
describe('Contract', () => {
  it('callSomeFunction should work', () => {
    ...
    results = callSomeFunction();
    // then assert results are what you expect
    ....
  });
});
```

As for testing the smart contract functions themselves, we recommend using [integration tests](./integration-tests.md) instead as they fully replicate the environment on which that logic will run.
---
sidebar_position: 2
title: "Private Methods"
---

# Private Methods

## When Using Callbacks

Usually, when a contract has to have a callback for a remote cross-contract call, this callback method should only be called by the contract itself to avoid someone else calling it and changing the state. A common pattern is to have an assertion that validates that the direct caller (predecessor account ID) matches to the contract's account (current account ID). The `({ privateFunction: true })` decorator simplifies this by making it a single line decorator while improving readability.

Use this annotation within the designated contract class with the [`NearBindgen({})` decorator](../contract-structure/near-bindgen.md) as follows:

```js
@call({ privateFunction: true })
my_method({}) {
    // ...
}
```

Which is equivalent to:

```js
@call({})
my_method({}) {
    if near.currentAccountId() != near.predecessorAccountId() {
        throw new Error("Method method is private");
    }
    // ...
}
```

Now with this annotation, only the account of the contract itself can call this method, either directly or through a promise.

## Writing Internal Methods

Not all functions need to be exposed publicly. It may be beneficial to write private methods for helper or utility functions, for instance. There are three approaches to write internal methods:

1. Declare the method without using the `call` or `view` decorators.

```js
helperMethod(a, b) {
  // ...
}
```

2. Using an internal helper function in the module scope.

```javascript
// Function that can be called in another JS file
function getFirstName(account) {
  // ...
}
```

3. Importing a helper function or class from another module.

Another way of not exporting methods is by having a separate class, that is not marked with `NearBindgen({})`.

```js
import { getFirstName } from "./helpers.js";

@NearBindgen({})
export class Contract {
  // ...
}

class Helpers {
  // ...
}
```