2022-03-24 06:40:03 +00:00
|
|
|
{
|
2022-12-09 10:45:39 +00:00
|
|
|
"name": "@cerc-io/laconic-sdk",
|
2023-12-07 02:57:20 +00:00
|
|
|
"version": "0.1.10",
|
2022-04-01 12:32:56 +00:00
|
|
|
"main": "dist/index.js",
|
|
|
|
"types": "dist/index.d.ts",
|
2022-10-10 22:13:24 +00:00
|
|
|
"repository": "git@github.com:cerc-io/laconic-sdk.git",
|
2022-04-04 11:14:04 +00:00
|
|
|
"author": "",
|
|
|
|
"license": "UNLICENSED",
|
2022-03-24 06:40:03 +00:00
|
|
|
"devDependencies": {
|
|
|
|
"@types/jest": "^27.4.1",
|
2022-04-08 10:32:24 +00:00
|
|
|
"@types/lodash": "^4.14.181",
|
2022-04-08 05:29:03 +00:00
|
|
|
"@types/semver": "^7.3.9",
|
2022-12-09 08:55:13 +00:00
|
|
|
"@types/tiny-secp256k1": "1.0.0",
|
2022-04-05 14:11:06 +00:00
|
|
|
"dotenv": "^16.0.0",
|
2022-09-28 17:22:34 +00:00
|
|
|
"google-protobuf": "^3.21.0",
|
|
|
|
"jest": "29.0.0",
|
Add new record types ApplicationRecord, WebAppDeploymentRecord, GeneralRecord (#44)
See also: https://git.vdb.to/cerc-io/laconicd/pulls/113
![image](/attachments/db05bbb6-86ca-4fbb-a8a4-fcd06501b1b1)
```
message ApplicationRecord {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string homepage = 5 [(gogoproto.moretags) = "json:\"homepage\" yaml:\"homepage\""];
string license = 6 [(gogoproto.moretags) = "json:\"license\" yaml:\"license\""];
string author = 7 [(gogoproto.moretags) = "json:\"author\" yaml:\"author\""];
string repository = 8 [(gogoproto.moretags) = "json:\"repository\" yaml:\"repository\""];
string repository_tag = 9 [(gogoproto.moretags) = "json:\"repositoryTag\" yaml:\"repositoryTag\""];
string app_version = 10 [(gogoproto.moretags) = "json:\"appVersion\" yaml:\"appVersion\""];
string app_type = 11 [(gogoproto.moretags) = "json:\"appType\" yaml:\"appType\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message WebAppDeploymentRecord {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string application = 5 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
string url = 6 [(gogoproto.moretags) = "json:\"\" yaml:\"name\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
message GeneralRecord {
string type = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string name = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
string description = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
string version = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
string category = 5 [(gogoproto.moretags) = "json:\"category\" yaml:\"category\""];
string value = 6 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
string meta = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
repeated string tags = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
```
```
❯ cat general.yml
record:
type: GeneralRecord
name: my-generic-record
version: 0.0.1
value: "anything-goes-here"
category: filter-by-this
tags:
- a
- b
- c
meta:
foo: bar
bar:
baz: boz
❯ bin/laconic cns record publish --filename general.yml --bond-id ba774084e25af5b29be126dda0bb910d93dea3634713a438ac257da5bbdc631c
{
"id": "bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q"
}
❯ bin/laconic cns record get --id bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q
[
{
"id": "bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q",
"names": null,
"owners": [
"9A66500A9AA574CAAB4EDB26F7333590BF452CE0"
],
"bondId": "ba774084e25af5b29be126dda0bb910d93dea3634713a438ac257da5bbdc631c",
"createTime": "2023-11-17T23:11:27Z",
"expiryTime": "2024-11-16T23:11:27Z",
"attributes": {
"meta": "{\"foo\":\"bar\",\"bar\":{\"baz\":\"boz\"}}",
"tags": [
"a",
"b",
"c"
],
"type": "GeneralRecord",
"name": "my-generic-record",
"version": "0.0.1",
"category": "filter-by-this",
"value": "anything-goes-here"
}
}
]
```
> Note: The repeated items are preserved as lists, but the object/map ends up encoded as a string. It would be nice to avoid this.
Reviewed-on: https://git.vdb.to/cerc-io/laconic-sdk/pulls/44
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-20 22:01:19 +00:00
|
|
|
"protoc-gen-ts": "^0.8.7",
|
2022-09-28 17:22:34 +00:00
|
|
|
"ts-jest": "^29.0.2",
|
2023-03-06 21:54:02 +00:00
|
|
|
"typescript": "^4.6.2"
|
2022-03-24 06:40:03 +00:00
|
|
|
},
|
|
|
|
"dependencies": {
|
2022-04-05 14:11:06 +00:00
|
|
|
"@cosmjs/amino": "^0.28.1",
|
2022-04-01 12:32:56 +00:00
|
|
|
"@cosmjs/crypto": "^0.28.1",
|
|
|
|
"@cosmjs/encoding": "^0.28.1",
|
2022-04-22 06:02:55 +00:00
|
|
|
"@ipld/dag-cbor": "^7.0.1",
|
|
|
|
"@ipld/dag-json": "^8.0.9",
|
2022-03-29 11:01:23 +00:00
|
|
|
"@metamask/eth-sig-util": "^4.0.0",
|
2022-12-09 11:53:09 +00:00
|
|
|
"@tharsis/address-converter": "^0.1.7",
|
|
|
|
"@tharsis/eip712": "^0.2.1",
|
|
|
|
"@tharsis/proto": "^0.1.16",
|
|
|
|
"@tharsis/provider": "^0.2.4",
|
|
|
|
"@tharsis/transactions": "^0.2.2",
|
2022-03-29 11:01:23 +00:00
|
|
|
"axios": "^0.26.1",
|
2022-12-09 12:43:53 +00:00
|
|
|
"bip32": "3.0.1",
|
2022-04-05 09:20:12 +00:00
|
|
|
"bip39": "^3.0.4",
|
2022-04-08 05:29:03 +00:00
|
|
|
"canonical-json": "^0.0.4",
|
2022-04-11 11:10:35 +00:00
|
|
|
"ethers": "^5.6.2",
|
2022-04-05 14:11:06 +00:00
|
|
|
"evmosjs": "^0.2.5",
|
2022-04-04 07:05:16 +00:00
|
|
|
"graphql.js": "^0.6.8",
|
2022-04-01 12:32:56 +00:00
|
|
|
"js-sha256": "^0.9.0",
|
2022-09-28 17:22:34 +00:00
|
|
|
"js-yaml": "^3.14.1",
|
2022-04-08 05:29:03 +00:00
|
|
|
"jsonschema": "^1.4.0",
|
2022-04-08 10:32:24 +00:00
|
|
|
"lodash": "^4.17.21",
|
2022-12-09 11:53:09 +00:00
|
|
|
"multiformats": "^9.5.4",
|
2022-04-08 05:29:03 +00:00
|
|
|
"node-yaml": "^4.0.1",
|
2022-12-09 11:53:09 +00:00
|
|
|
"secp256k1": "^4.0.1",
|
2022-04-08 05:29:03 +00:00
|
|
|
"semver": "^7.3.5",
|
2022-12-09 08:55:13 +00:00
|
|
|
"tiny-secp256k1": "^1.1.6"
|
2022-03-24 06:40:03 +00:00
|
|
|
},
|
|
|
|
"scripts": {
|
2022-04-11 06:58:14 +00:00
|
|
|
"test": "jest --runInBand --verbose",
|
2022-04-19 10:24:41 +00:00
|
|
|
"test:auctions": "TEST_AUCTIONS_ENABLED=1 jest --runInBand --verbose src/auction.test.ts",
|
2022-04-22 10:15:47 +00:00
|
|
|
"test:nameservice-expiry": "TEST_NAMESERVICE_EXPIRY=1 jest --runInBand --verbose src/nameservice-expiry.test.ts",
|
2022-04-01 12:32:56 +00:00
|
|
|
"build": "tsc"
|
2022-03-24 06:40:03 +00:00
|
|
|
}
|
|
|
|
}
|