From a54f6b1778479cf4478d9dbcc301f73826da7d9d Mon Sep 17 00:00:00 2001 From: esaminu Date: Fri, 11 Nov 2022 02:49:35 +0400 Subject: [PATCH] feat: update examples to generic standard string --- neps/nep-0330.md | 22 +++++++++++----------- specs/Standards/SourceMetadata.md | 26 +++++++++++++------------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/neps/nep-0330.md b/neps/nep-0330.md index 939ce6ba4..cae5f6552 100644 --- a/neps/nep-0330.md +++ b/neps/nep-0330.md @@ -34,15 +34,15 @@ The metadata will include two optional fields: - `link`: a string that references the link to the open-source code. This can be anything such as Github or a CID to somewhere on IPFS. ```ts -type NEP { - NEP: number, // NEP number e.g. 0141 for NEP-0141 - version: string // semantic version number of the NEP e.g. "1.0.0" +type Standard { + standard: string, // standard name e.g. "nep141" + version: string // semantic version number of the Standard e.g. "1.0.0" } type ContractSourceMetadata = { version: string|null, // optional, commit hash being used for the currently deployed wasm. If the contract is not open-sourced, this could also be a numbering system for internal organization / tracking such as "1.0.0" and "2.1.0". - link: string|null, //optional, link to open source code such as a Github repository or a CID to somewhere on IPFS., - standards: NEP[]|null //optional, standards and extensions implemented in the currently deployed wasm e.g. [{NEP: 0141, version: "1.0.0"},{NEP: 0148, version: "1.0.0"}]. + link: string|null, //optional, link to open source code such as a Github repository or a CID to somewhere on IPFS. + standards: Standard[]|null //optional, standards and extensions implemented in the currently deployed wasm e.g. [{standard: "nep141", version: "1.0.0"},{standard: "nep148", version: "1.0.0"}]. } ``` @@ -62,11 +62,11 @@ type ContractSourceMetadata = { link: "https://github.com/near-examples/nft-tutorial", standards: [ { - NEP: 0171, + standard: "nep171", version: "1.0.2" }, { - NEP: 0177, + standard: "nep177", version: "2.0.1" } ] @@ -81,11 +81,11 @@ If someone were to call the view function `contract_metadata`, the contract woul link: "https://github.com/near-examples/nft-tutorial", standards: [ { - NEP: 0171, + standard: "nep171", version: "1.0.2" }, { - NEP: 0177, + standard: "nep177", version: "2.0.1" } ] @@ -101,7 +101,7 @@ pub struct Contract { pub contract_metadata: ContractSourceMetadata } -// NEP structure +// Standard structure pub struct Standard { pub standard: String, pub version: String @@ -111,7 +111,7 @@ pub struct Standard { pub struct ContractSourceMetadata { pub version: String, pub link: String, - pub standards: [NEP; 2] + pub standards: Vec } /// Minimum Viable Interface diff --git a/specs/Standards/SourceMetadata.md b/specs/Standards/SourceMetadata.md index 0c54cbc48..7e50e1789 100644 --- a/specs/Standards/SourceMetadata.md +++ b/specs/Standards/SourceMetadata.md @@ -33,15 +33,15 @@ The metadata will include two optional fields: - `link`: a string that references the link to the open-source code. This can be anything such as Github or a CID to somewhere on IPFS. ```ts -type NEP { - NEP: number, // NEP number e.g. 0141 for NEP-0141 - version: string // semantic version number of the NEP e.g. "1.0.0" +type Standard { + standard: string, // standard name e.g. "nep141" + version: string // semantic version number of the Standard e.g. "1.0.0" } type ContractSourceMetadata = { version: string|null, // optional, commit hash being used for the currently deployed wasm. If the contract is not open-sourced, this could also be a numbering system for internal organization / tracking such as "1.0.0" and "2.1.0". link: string|null, //optional, link to open source code such as a Github repository or a CID to somewhere on IPFS. - standards: NEP[]|null //optional, standards and extensions implemented in the currently deployed wasm e.g. [{NEP: 0141, version: "1.0.0"},{NEP: 0148, version: "1.0.0"}]. + standards: Standard[]|null //optional, standards and extensions implemented in the currently deployed wasm e.g. [{standard: "nep141", version: "1.0.0"},{standard: "nep148", version: "1.0.0"}]. } ``` @@ -61,11 +61,11 @@ type ContractSourceMetadata = { link: "https://github.com/near-examples/nft-tutorial", standards: [ { - NEP: 0171, + standard: "nep171", version: "1.0.2" }, { - NEP: 0177, + standard: "nep177", version: "2.0.1" } ] @@ -80,11 +80,11 @@ If someone were to call the view function `contract_metadata`, the contract woul link: "https://github.com/near-examples/nft-tutorial", standards: [ { - NEP: 0171, + standard: "nep171", version: "1.0.2" }, { - NEP: 0177, + standard: "nep177", version: "2.0.1" } ] @@ -100,17 +100,17 @@ pub struct Contract { pub contract_metadata: ContractSourceMetadata } -// NEP structure -pub struct NEP { - pub NEP: u16, - pub version: String +// Standard structure +type Standard { + standard: string, // standard name e.g. "nep141" + version: string // semantic version number of the Standard e.g. "1.0.0" } /// Contract metadata structure pub struct ContractSourceMetadata { pub version: String, pub link: String, - pub standards: [NEP; 2] + pub standards: Vec } /// Minimum Viable Interface