Skip to content

Commit

Permalink
docs: Enhance API Reference - Documentation improvements (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
gtsonevv authored Oct 1, 2024
1 parent 2e49127 commit 1ec6634
Show file tree
Hide file tree
Showing 71 changed files with 795 additions and 88 deletions.
2 changes: 2 additions & 0 deletions benchmark/__tests__/util.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Functions consumed by the benchmark contracts tests

export function formatGas(gas) {
if (gas < 10 ** 12) {
let tGas = gas / 10 ** 12;
Expand Down
5 changes: 5 additions & 0 deletions benchmark/src/deploy-contract.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { near } from "near-sdk-js";

/**
* Used for contract deployment. More information for that
* can be found in the README.md
* - Deploy and cross contract call
*/
export function deploy_contract() {
let promiseId = near.promiseBatchCreate("a.caller.test.near");
near.promiseBatchActionCreateAccount(promiseId);
Expand Down
5 changes: 5 additions & 0 deletions benchmark/src/expensive-calc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { NearBindgen, call, near } from "near-sdk-js";

/**
* ExpensiveCalc is connected to the expensive contract. More information for that
* can be found in the README.md
* - Computational expensive contract
*/
@NearBindgen({})
export class ExpensiveCalc {
@call({})
Expand Down
4 changes: 4 additions & 0 deletions benchmark/src/highlevel-collection.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { NearBindgen, call, UnorderedMap } from "near-sdk-js";

/**
* More information for that can be found in the README.md
* - Highlevel collection
*/
@NearBindgen({})
export class HighlevelCollection {
constructor() {
Expand Down
4 changes: 4 additions & 0 deletions benchmark/src/highlevel-minimal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { NearBindgen, call } from "near-sdk-js";

/**
* More information for that can be found in the README.md
* - A highlevel minimal contract (using nearbindgen)
*/
@NearBindgen({})
export class HighlevelMinimal {
@call({})
Expand Down
8 changes: 8 additions & 0 deletions benchmark/src/lowlevel-api.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { near } from "near-sdk-js";

/**
* Helper method for the low level api. More information for that can be found in the README.md
* - Low level API
*/
export function lowlevel_storage_write() {
let data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
near.storageWriteRaw(data, data);
}

/**
* Helper method for the low level api. More information for that can be found in the README.md
* - Low level API
*/
export function lowlevel_storage_write_many() {
let data = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
near.storageWriteRaw(data, data);
Expand Down
4 changes: 4 additions & 0 deletions benchmark/src/lowlevel-minimal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { near } from "near-sdk-js";

/**
* More information for that can be found in the README.md
* - A minimal contract
*/
export function empty() {}
51 changes: 51 additions & 0 deletions packages/near-contract-standards/lib/fungible_token/core.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions packages/near-contract-standards/lib/fungible_token/receiver.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions packages/near-contract-standards/lib/fungible_token/resolver.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1ec6634

Please sign in to comment.