@dcl/protocol 1.0.0-4982121558.commit-4b98e1a → 1.0.0-4982615619.commit-96dba07
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/out-js/decentraland/sdk/components/nft_shape.gen.d.ts +3 -3
- package/out-js/decentraland/sdk/components/nft_shape.gen.js +7 -7
- package/out-ts/decentraland/sdk/components/nft_shape.gen.ts +10 -10
- package/package.json +2 -2
- package/proto/decentraland/sdk/components/nft_shape.proto +3 -3
package/README.md
CHANGED
|
@@ -20,21 +20,39 @@ protoc \
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
# Style Guidelines
|
|
23
|
+
|
|
23
24
|
1. All .proto files are snake_case.proto.
|
|
24
25
|
2. For pascal or camel case usage, please make a deterministic one from the snake case. Example: nft_shape will transform to NftShape.
|
|
25
26
|
3. See https://docs.buf.build/best-practices/style-guide. The most of other styles are taken from there, the Buf configuration is in proto/buf.yml.
|
|
26
27
|
4. Use public/ folder only for .proto with protocol exposing, that is only for files with `import public`. This folder is not processed by the linter.
|
|
27
28
|
|
|
28
29
|
# Dev with Decentraland Repositories
|
|
30
|
+
|
|
29
31
|
Many repositories depend on this protocol definition and that sometimes implies some merge order. We don't have to worry much about compatibility because the checks are running with each PR, if you break something, the CI will warn you. But, in some cases, it's desirable to merge the implementation in a specific order to avoid unexpected behavior in the corner cases (multiple repositories are waiting for the build at the same time).
|
|
30
32
|
|
|
33
|
+
> **Important Note: Avoid Merging Protocol PR Without Completed Unity Implementation**
|
|
34
|
+
>
|
|
35
|
+
> Please don't merge a protocol PR into the main branch unless the corresponding implementation in Unity has been completed. This is important to avoid any potential issues or build failures in Unity.
|
|
36
|
+
>
|
|
37
|
+
> The ideal order for introducing breaking changes in the protocol is as follows:
|
|
38
|
+
>
|
|
39
|
+
> 1. Create a PR in the Protocol repository.
|
|
40
|
+
> 2. Use the npm test link from the CI of the protocol PR in the protocol-dependent application for development.
|
|
41
|
+
> 3. Once both the protocol PR and the protocol-dependent application (e.g. unity-renderer) PR are ready for merging, synchronize their merging as follows:
|
|
42
|
+
> 1. Merge the protocol PR.
|
|
43
|
+
> 2. Modify protocol-dependent application PR to use the `@dcl/protocol@next` package to stop using the PR npm test link.
|
|
44
|
+
> 3. Merge the protocol-dependent application PR.
|
|
45
|
+
|
|
31
46
|
Some dev-cases are described here:
|
|
32
|
-
|
|
47
|
+
|
|
48
|
+
## SDK: New component or component modification
|
|
49
|
+
|
|
33
50
|
Repositories: [unity-renderer](https://github.com/decentraland/unity-renderer/) and [js-sdk-toolchain](https://github.com/decentraland/js-sdk-toolchain/)
|
|
34
51
|
|
|
35
52
|
At the protocol level both operations shouldn't be a problem, but `js-sdk-toolchain` CI will fail if the component is not tested. This can happen if the PR **`A`** from the protocol is merged, and you update your PR **`B`** from `js-sdk-toolchain` with the changes before the PR **`A`** from `js-sdk-toolchain` is merged.
|
|
36
53
|
|
|
37
54
|
Some guidelines and testing before merge:
|
|
55
|
+
|
|
38
56
|
- The protocol package is uploaded to S3 while developing in a PR. This can be used in the target repositories
|
|
39
57
|
- Testing in the playground: Playground allows us to test by adding query parameters: `https://playground.decentraland.org/?&renderer-branch=**feat/my-new-component**&sdk-branch=**feat/new-component-approach**`
|
|
40
58
|
- Testing locally: you can write an example scene and install the package `@dcl/sdk` uploaded to S3 commented in the PR comments.
|
|
@@ -42,16 +60,20 @@ Some guidelines and testing before merge:
|
|
|
42
60
|
- Start merging when the three PRs are already to merge: first merge the Protocol one, then update the other two with the version @next and merge them at the same time.
|
|
43
61
|
|
|
44
62
|
## SDK: New APIs or APIs modifications
|
|
45
|
-
|
|
63
|
+
|
|
64
|
+
Repositories: [kernel](https://github.com/decentraland/kernel/), [js-sdk-toolchain](https://github.com/decentraland/js-sdk-toolchain/) and [scene-runtime](https://github.com/decentraland/scene-runtime/)
|
|
46
65
|
In this case, there is no problem with when each PR is merged. It's recommendable to merge first the rpc server-side (in this case, Kernel), second the `scene-runtime` (and this would require a second update from `kernel`) and last the `js-sdk-toolchain`.
|
|
47
66
|
|
|
48
67
|
## Renderer protocol (RPC)
|
|
68
|
+
|
|
49
69
|
Repositories: [kernel](https://github.com/decentraland/kernel/) and [unity-renderer](https://github.com/decentraland/unity-renderer/)
|
|
50
70
|
|
|
51
71
|
TODO
|
|
52
72
|
|
|
53
73
|
## BFF
|
|
74
|
+
|
|
54
75
|
TODO
|
|
55
76
|
|
|
56
|
-
## Comms
|
|
77
|
+
## Comms
|
|
78
|
+
|
|
57
79
|
TODO
|
|
@@ -33,15 +33,15 @@ export declare function nftFrameTypeToJSON(object: NftFrameType): string;
|
|
|
33
33
|
/**
|
|
34
34
|
* The NftShape component renders a framed picture from an NFT. It supports PNG, JPEG and GIF files.
|
|
35
35
|
*
|
|
36
|
-
* The `
|
|
37
|
-
*
|
|
36
|
+
* The `urn` field is the URI of the NFT, and must follow the format 'urn:decentraland:<CHAIN>:<CONTRACT_STANDARD>:<CONTRACT_ADDRESS>:<TOKEN_ID>'
|
|
37
|
+
* Example: 'urn:decentraland:ethereum:erc721:0x00000000:123'
|
|
38
38
|
*
|
|
39
39
|
* The picture frame can have several different styles, plus a background color for images that have
|
|
40
40
|
* transparent pixels.
|
|
41
41
|
*/
|
|
42
42
|
export interface PBNftShape {
|
|
43
43
|
/** the URI of the NFT */
|
|
44
|
-
|
|
44
|
+
urn: string;
|
|
45
45
|
/** the frame style (default NFT_CLASSIC) */
|
|
46
46
|
style?: NftFrameType | undefined;
|
|
47
47
|
/** RGB background (default [0.6404918, 0.611472, 0.8584906]) */
|
|
@@ -169,13 +169,13 @@ function nftFrameTypeToJSON(object) {
|
|
|
169
169
|
}
|
|
170
170
|
exports.nftFrameTypeToJSON = nftFrameTypeToJSON;
|
|
171
171
|
function createBasePBNftShape() {
|
|
172
|
-
return {
|
|
172
|
+
return { urn: "", style: undefined, color: undefined };
|
|
173
173
|
}
|
|
174
174
|
var PBNftShape;
|
|
175
175
|
(function (PBNftShape) {
|
|
176
176
|
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
177
|
-
if (message.
|
|
178
|
-
writer.uint32(10).string(message.
|
|
177
|
+
if (message.urn !== "") {
|
|
178
|
+
writer.uint32(10).string(message.urn);
|
|
179
179
|
}
|
|
180
180
|
if (message.style !== undefined) {
|
|
181
181
|
writer.uint32(16).int32(message.style);
|
|
@@ -197,7 +197,7 @@ var PBNftShape;
|
|
|
197
197
|
if (tag !== 10) {
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
|
-
message.
|
|
200
|
+
message.urn = reader.string();
|
|
201
201
|
continue;
|
|
202
202
|
case 2:
|
|
203
203
|
if (tag !== 16) {
|
|
@@ -222,7 +222,7 @@ var PBNftShape;
|
|
|
222
222
|
PBNftShape.decode = decode;
|
|
223
223
|
function fromJSON(object) {
|
|
224
224
|
return {
|
|
225
|
-
|
|
225
|
+
urn: isSet(object.urn) ? String(object.urn) : "",
|
|
226
226
|
style: isSet(object.style) ? nftFrameTypeFromJSON(object.style) : undefined,
|
|
227
227
|
color: isSet(object.color) ? colors_gen_1.Color3.fromJSON(object.color) : undefined,
|
|
228
228
|
};
|
|
@@ -230,7 +230,7 @@ var PBNftShape;
|
|
|
230
230
|
PBNftShape.fromJSON = fromJSON;
|
|
231
231
|
function toJSON(message) {
|
|
232
232
|
const obj = {};
|
|
233
|
-
message.
|
|
233
|
+
message.urn !== undefined && (obj.urn = message.urn);
|
|
234
234
|
message.style !== undefined &&
|
|
235
235
|
(obj.style = message.style !== undefined ? nftFrameTypeToJSON(message.style) : undefined);
|
|
236
236
|
message.color !== undefined && (obj.color = message.color ? colors_gen_1.Color3.toJSON(message.color) : undefined);
|
|
@@ -244,7 +244,7 @@ var PBNftShape;
|
|
|
244
244
|
function fromPartial(object) {
|
|
245
245
|
var _a, _b;
|
|
246
246
|
const message = createBasePBNftShape();
|
|
247
|
-
message.
|
|
247
|
+
message.urn = (_a = object.urn) !== null && _a !== void 0 ? _a : "";
|
|
248
248
|
message.style = (_b = object.style) !== null && _b !== void 0 ? _b : undefined;
|
|
249
249
|
message.color = (object.color !== undefined && object.color !== null)
|
|
250
250
|
? colors_gen_1.Color3.fromPartial(object.color)
|
|
@@ -167,15 +167,15 @@ export function nftFrameTypeToJSON(object: NftFrameType): string {
|
|
|
167
167
|
/**
|
|
168
168
|
* The NftShape component renders a framed picture from an NFT. It supports PNG, JPEG and GIF files.
|
|
169
169
|
*
|
|
170
|
-
* The `
|
|
171
|
-
*
|
|
170
|
+
* The `urn` field is the URI of the NFT, and must follow the format 'urn:decentraland:<CHAIN>:<CONTRACT_STANDARD>:<CONTRACT_ADDRESS>:<TOKEN_ID>'
|
|
171
|
+
* Example: 'urn:decentraland:ethereum:erc721:0x00000000:123'
|
|
172
172
|
*
|
|
173
173
|
* The picture frame can have several different styles, plus a background color for images that have
|
|
174
174
|
* transparent pixels.
|
|
175
175
|
*/
|
|
176
176
|
export interface PBNftShape {
|
|
177
177
|
/** the URI of the NFT */
|
|
178
|
-
|
|
178
|
+
urn: string;
|
|
179
179
|
/** the frame style (default NFT_CLASSIC) */
|
|
180
180
|
style?:
|
|
181
181
|
| NftFrameType
|
|
@@ -185,13 +185,13 @@ export interface PBNftShape {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
function createBasePBNftShape(): PBNftShape {
|
|
188
|
-
return {
|
|
188
|
+
return { urn: "", style: undefined, color: undefined };
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export namespace PBNftShape {
|
|
192
192
|
export function encode(message: PBNftShape, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
193
|
-
if (message.
|
|
194
|
-
writer.uint32(10).string(message.
|
|
193
|
+
if (message.urn !== "") {
|
|
194
|
+
writer.uint32(10).string(message.urn);
|
|
195
195
|
}
|
|
196
196
|
if (message.style !== undefined) {
|
|
197
197
|
writer.uint32(16).int32(message.style);
|
|
@@ -214,7 +214,7 @@ export namespace PBNftShape {
|
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
message.
|
|
217
|
+
message.urn = reader.string();
|
|
218
218
|
continue;
|
|
219
219
|
case 2:
|
|
220
220
|
if (tag !== 16) {
|
|
@@ -241,7 +241,7 @@ export namespace PBNftShape {
|
|
|
241
241
|
|
|
242
242
|
export function fromJSON(object: any): PBNftShape {
|
|
243
243
|
return {
|
|
244
|
-
|
|
244
|
+
urn: isSet(object.urn) ? String(object.urn) : "",
|
|
245
245
|
style: isSet(object.style) ? nftFrameTypeFromJSON(object.style) : undefined,
|
|
246
246
|
color: isSet(object.color) ? Color3.fromJSON(object.color) : undefined,
|
|
247
247
|
};
|
|
@@ -249,7 +249,7 @@ export namespace PBNftShape {
|
|
|
249
249
|
|
|
250
250
|
export function toJSON(message: PBNftShape): unknown {
|
|
251
251
|
const obj: any = {};
|
|
252
|
-
message.
|
|
252
|
+
message.urn !== undefined && (obj.urn = message.urn);
|
|
253
253
|
message.style !== undefined &&
|
|
254
254
|
(obj.style = message.style !== undefined ? nftFrameTypeToJSON(message.style) : undefined);
|
|
255
255
|
message.color !== undefined && (obj.color = message.color ? Color3.toJSON(message.color) : undefined);
|
|
@@ -262,7 +262,7 @@ export namespace PBNftShape {
|
|
|
262
262
|
|
|
263
263
|
export function fromPartial<I extends Exact<DeepPartial<PBNftShape>, I>>(object: I): PBNftShape {
|
|
264
264
|
const message = createBasePBNftShape();
|
|
265
|
-
message.
|
|
265
|
+
message.urn = object.urn ?? "";
|
|
266
266
|
message.style = object.style ?? undefined;
|
|
267
267
|
message.color = (object.color !== undefined && object.color !== null)
|
|
268
268
|
? Color3.fromPartial(object.color)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/protocol",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-4982615619.commit-96dba07",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "decentraland/protocol.git",
|
|
6
6
|
"homepage": "https://github.com/decentraland/protocol#readme",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"out-js",
|
|
30
30
|
"public"
|
|
31
31
|
],
|
|
32
|
-
"commit": "
|
|
32
|
+
"commit": "96dba079e43c49ba396b15cd7c0cfefb3a268d51"
|
|
33
33
|
}
|
|
@@ -9,13 +9,13 @@ option (common.ecs_component_id) = 1040;
|
|
|
9
9
|
|
|
10
10
|
// The NftShape component renders a framed picture from an NFT. It supports PNG, JPEG and GIF files.
|
|
11
11
|
//
|
|
12
|
-
// The `
|
|
13
|
-
//
|
|
12
|
+
// The `urn` field is the URI of the NFT, and must follow the format 'urn:decentraland:<CHAIN>:<CONTRACT_STANDARD>:<CONTRACT_ADDRESS>:<TOKEN_ID>'
|
|
13
|
+
// Example: 'urn:decentraland:ethereum:erc721:0x00000000:123'
|
|
14
14
|
//
|
|
15
15
|
// The picture frame can have several different styles, plus a background color for images that have
|
|
16
16
|
// transparent pixels.
|
|
17
17
|
message PBNftShape {
|
|
18
|
-
string
|
|
18
|
+
string urn = 1; // the URI of the NFT
|
|
19
19
|
optional NftFrameType style = 2; // the frame style (default NFT_CLASSIC)
|
|
20
20
|
optional decentraland.common.Color3 color = 3; // RGB background (default [0.6404918, 0.611472, 0.8584906])
|
|
21
21
|
}
|