Skip to content

Commit b5242bd

Browse files
committed
Merge branch 'main' into feature-ci-build
2 parents 04410cc + bbbb43f commit b5242bd

File tree

15 files changed

+6061
-3743
lines changed

15 files changed

+6061
-3743
lines changed

.yarnrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
nodeLinker: node-modules
2+
3+
plugins:
4+
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
5+
spec: "@yarnpkg/plugin-version"

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
To check the difference between the last releaes and the latest dev status, click the link above.
11+
12+
## [1.6.0] - 2023-10-03
13+
14+
### Added
15+
16+
1. Add initial registration action for IOTA.
17+
18+
## [1.5.0] - 2023-06-15
19+
20+
### Changed
21+
22+
1. [PR26](https://github.com/numbersprotocol/nit/pull/26): Remove default license from Asset Tree
23+
1. [PR27](https://github.com/numbersprotocol/nit/pull/27): Remove default empty abstract without input
24+
25+
## [1.4.0] - 2023-05-02
26+
27+
### Added
28+
29+
1. Add [Action Names](https://docs.numbersprotocol.io/introduction/numbers-protocol/defining-web3-assets/commit#actions)
30+
31+
### Changed
32+
33+
1. Add IPFS abstract layer to support multiple IPFS backends
34+
35+
## [1.3.0] - 2023-02-14
36+
37+
### Added
38+
39+
1. Add action action-mint-erc721-nft-jade
40+
2. Add Numbers networks into config template
41+
2. Add ESLint
42+
43+
### Changed
44+
45+
1. Remove not-yet-supported networks from the network dictionary
46+
47+
## [1.2.9] - 2023-01-28
48+
49+
### Fixed
50+
51+
1. Change default network in registration action from Avalanche to Jade
52+
53+
[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/1.6.0...HEAD
54+
[1.6.0]: https://github.com/numbersprotocol/capture-lite/compare/1.5.0...1.6.0
55+
[1.5.0]: https://github.com/numbersprotocol/capture-lite/compare/1.4.0...1.5.0
56+
[1.4.0]: https://github.com/numbersprotocol/capture-lite/compare/1.3.0...1.4.0
57+
[1.3.0]: https://github.com/numbersprotocol/capture-lite/compare/1.2.9...1.3.0
58+
[1.2.9]: https://github.com/numbersprotocol/capture-lite/releases/tag/1.2.9

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@numbersprotocol/nit",
3-
"version": "1.2.10",
3+
"version": "1.6.0",
44
"description": "git for web3 digital asset",
55
"main": "lib/nit.js",
66
"repository": "https://github.com/numbersprotocol/nit",
@@ -27,8 +27,8 @@
2727
"dev-global-uninstall": "yarn global remove @numbersprotocol/nit",
2828
"dev-install": "yarn run build && yarn add file:$PWD",
2929
"dev-uninstall": "yarn remove @numbersprotocol/nit && yarn run clean",
30-
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register 'tests/**/*.ts'",
31-
"test-single": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register"
30+
"tests": "mocha -r ts-node/register tests/**/*.ts",
31+
"test": "mocha -r ts-node/register"
3232
},
3333
"bin": "bin/nit.js",
3434
"devDependencies": {
@@ -41,7 +41,7 @@
4141
"@types/command-line-usage": "^5.0.2",
4242
"@types/crypto-js": "^4.1.1",
4343
"@types/mocha": "^9.1.0",
44-
"@types/node": "^18.13.0",
44+
"@types/node": "^18.16.1",
4545
"@typescript-eslint/eslint-plugin": "^5.51.0",
4646
"@typescript-eslint/parser": "^5.51.0",
4747
"chai": "^4.3.6",
@@ -59,6 +59,6 @@
5959
"/bin"
6060
],
6161
"volta": {
62-
"node": "16.19.0"
62+
"node": "18.16.0"
6363
}
6464
}

schema/dbml.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
```
1+
```dbml
22
Project IntegrityRecord {
33
Note: '''
44
description: Numbers Protocol Integrity Record spec
5-
version: 4.0.0
6-
date: 2022-08-25
5+
version: 4.3.0
6+
date: 2023-05-11
77
colors:
88
- purple: on blockchain (updatable)
99
- blue: files on IPFS (updatable)
10-
- yello: json
10+
- yellow: json
1111
- red: signature related
1212
- grey: centralized server or DID
1313
'''
@@ -19,13 +19,13 @@ Table commit [headercolor: #8e44ad] {
1919
assetTreeCid cid [note: 'CID of the asset Tree file']
2020
assetTreeSha256 sha256 [note: 'sha256sum of the asset Tree file']
2121
assetTreeSignature signature [note: 'EIP-191 signature signed by author.']
22-
author address [note: 'Who creates the commit.']
23-
committer address [note: 'Who registers the commit.']
24-
action cid [note: 'CID of the network action performed for the asset file.']
25-
actionResultUri str [note: 'Result uri of this action']
22+
committer address [note: 'Who registers the commit']
23+
author address [note: 'Who write the commit']
24+
action cid [note: 'CID of the action profile describing the action details including actionName.']
25+
actionName str [note: 'name of the action, unique string']
26+
actionResult str [note: 'Result uri of this action']
2627
provider cid [note: 'CID of the commit service provider.']
27-
abstract str [note: 'Committer can add a short description that summarizes the Integrity Record.']
28-
timestampCreated timestamp [note: 'The moment that Integrity Record is created in Unix timestamp']
28+
attachment str [note: 'the Nid of the attachment file.']
2929
3030
Note: '''
3131
1. The goal of Integrity Record is to ensure integrity of the raw asset and its derivatives like metadata and maybe the major asset.
@@ -67,14 +67,22 @@ Table assetTree [headercolor: #3498db] {
6767
_ none [note: 'placeholder for linking tables']
6868
assetCid cid [note: 'CID of the asset file (blob)']
6969
assetSha256 sha256 [note: 'sha256sum of the asset file (blob)']
70-
assetCreator address [note: 'Creator\'s wallet address']
71-
assetCreatorProfile cid [note: 'Creator of the asset file']
70+
encodingFormat str [note: 'The asset\'s type expressed using a MIME format.']
71+
assetCreator str [note: 'Creator\'s name']
72+
creatorProfile cid [note: 'Creator of the asset file']
73+
creatorWallet address [note: 'Creator\'s wallet address']
7274
assetTimestampCreated timestamp [note: 'Creation time of the asset file']
75+
assetLocationCreated str [note: 'Creation location of the asset file']
76+
parentAssetCid cid [note: 'Cid of the parent asset']
77+
generatedBy str [note: 'AI model used to generate the content']
78+
generatedThrough str [note: 'URL of AI service']
79+
usedBy str [note: 'URL of the website that uses the asset']
7380
license license [note: 'license of the asset file']
74-
nftRecord cid
81+
nftRecord "nftRecord[]" [note: 'List of NFT records']
7582
integrityCid cid [note: 'CID of the integrity proof']
7683
abstract str [note: 'description of this asset']
77-
encodingFormat str [note: 'The asset\'s type expressed using a MIME format.']
84+
custom json [note: 'custom fields']
85+
7886
7987
Note: '''
8088
EIP-191 Verification
@@ -109,7 +117,6 @@ Table nftRecord [headercolor: #3498db] {
109117
network network [note: 'network of the NFT token']
110118
contractAddress address
111119
tokenId str
112-
tokenUri str
113120
}
114121
115122
Table nft [headercolor: #8e44ad] {
@@ -207,10 +214,9 @@ Enum "proofKey" {
207214
}
208215
209216
Ref: "nftRecord"."tokenId" - "nft"."tokenId"
210-
Ref: "nftRecord"."tokenUri" - "nft".tokenUri
211217
Ref: "assetTree"."license" - "license"."_"
212218
Ref: "assetTree"."integrityCid" - "proofMetadata"."_"
213-
Ref: "assetTree"."assetCreatorProfile" - "identity"."_"
219+
Ref: "assetTree"."creatorProfile" - "identity"."_"
214220
Ref: "assetTree".nftRecord < nftRecord."_" // One asset can link to multiple nft_records
215221
Ref: "commit"."action" - "action"."_"
216222
Ref: "commit"."provider" - "identity"."_"

scripts/parseTxNid.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env ts-node
2+
3+
/*
4+
Execution: ts-node parseTxNid.ts
5+
Output: Nid: bafybeiajl3iadbz5phbig6ojxrau22a67lzrba2srdqn2jzy3bpl7oxd6u
6+
*/
7+
8+
import * as ethers from "ethers";
9+
10+
async function main() {
11+
const provider = new ethers.providers.JsonRpcProvider("https://mainnetrpc.num.network");
12+
// Tx Sample: https://mainnet.num.network/transaction/0xca942395e9c36b3217422979978838a45891336ca54bb036d6aecd43f0b56187
13+
const txHash = "0xca942395e9c36b3217422979978838a45891336ca54bb036d6aecd43f0b56187";
14+
15+
// parse the transaction with the function signature
16+
const abi = [ "function commit(string memory assetCid, string memory commitData) public returns (uint256 blockNumber)" ];
17+
const iface = new ethers.utils.Interface(abi);
18+
19+
const txData = await provider.getTransaction(txHash);
20+
// uncomment the following line to see the raw transaction data
21+
//console.log(txData);
22+
23+
const decodedTxData = iface.parseTransaction(txData);
24+
// uncomment the following line to see the decoded transaction data
25+
//console.log(decodedTxData);
26+
27+
console.log(`Nid: ${decodedTxData.args[0]}`);
28+
}
29+
30+
main()
31+
.then(() => process.exit(0))
32+
.catch((error) => {
33+
console.error(error);
34+
process.exit(1);
35+
});

0 commit comments

Comments
 (0)