Skip to content

Commit

Permalink
fix: typos and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zcstarr committed Sep 29, 2021
1 parent 687d9b5 commit 8577307
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
18 changes: 6 additions & 12 deletions specs/Standards/MultiToken/Enumeration.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Multi Token Enumeration
# Multi Token Enumeration([NEP-246](https://github.com/near/NEPs/discussions/246))


Version `1.0.0`

Expand All @@ -15,22 +16,15 @@ While some Multi Token contracts may forego this extension to save [storage] cos
Prior art:

- [ERC-721]'s enumeration extension
- [NEP-181]'s enumeration extension
- [Non Fungible Token Standard's](../NonFungibleToken/Enumeration.md) enumeration extension

## Interface

The contract must implement the following view methods:

```ts
// Metadata field is optional if metadata extension is implemented. Includes the base token metadata id and the token_metadata object, that represents the token specific metadata.
type MTToken {
id: string
metadata?: {
base_metadata_id: string
token_metadata: MTTokenMetadata
}
}

```ts
// Get a list of all tokens
//
// Arguments:
Expand All @@ -42,7 +36,7 @@ type MTToken {
function mt_tokens(
from_index: string|null, // default: "0"
limit: number|null, // default: unlimited (could fail due to gas limit)
): MTToken[] {}
): Token[] {}

// Get list of all tokens owned by a given account
//
Expand All @@ -57,7 +51,7 @@ function mt_tokens_for_owner(
account_id: string,
from_index: string|null, // default: 0
limit: number|null, // default: unlimited (could fail due to gas limit)
): MTToken[] {}
): Token[] {}
```

The contract must implement the following view methods if using metadata extension:
Expand Down
8 changes: 4 additions & 4 deletions specs/Standards/MultiToken/Metadata.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Multi Token Metadata
# Multi Token Metadata([NEP-246](https://github.com/near/NEPs/discussions/246))


Version `1.0.0`

Expand Down Expand Up @@ -80,8 +81,7 @@ A new attribute MUST be added to each `Token` struct:
```diff
type Token = {
id: string,
amount: string,
+ metadata: MTTokenMetadata,
+ token_metadata?: MTTokenMetadata,
+ base_metadata_id: string,
}
```
Expand Down Expand Up @@ -126,7 +126,7 @@ For `MTAllTokenMetadata`:

### No incurred cost for core NFT behavior

Contracts should be implemented in a way to avoid extra gas fees for serialization & deserialization of metadata for calls to `mt_*` methods other than `mt_*metadata*` or `mt_token`. See `near-contract-standards` [implementation using `LazyOption`](https://github.com/near/near-sdk-rs/blob/c2771af7fdfe01a4e8414046752ee16fb0d29d39/examples/fungible-token/ft/src/lib.rs#L71) as a reference example.
Contracts should be implemented in a way to avoid extra gas fees for serialization & deserialization of metadata for calls to `mt_*` methods other than `mt_metadata*` or `mt_tokens`. See `near-contract-standards` [implementation using `LazyOption`](https://github.com/near/near-sdk-rs/blob/c2771af7fdfe01a4e8414046752ee16fb0d29d39/examples/fungible-token/ft/src/lib.rs#L71) as a reference example.

## Drawbacks

Expand Down

0 comments on commit 8577307

Please sign in to comment.