Skip to content

Commit

Permalink
fix: correct fields and add schema (#353)
Browse files Browse the repository at this point in the history
* fix: correct fields and add schema
  • Loading branch information
RamyEB authored May 15, 2024
1 parent 54c80a8 commit 47547e4
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-jeans-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/wallet-api-manifest-validator": minor
---

Modify fields and add $schema
22 changes: 17 additions & 5 deletions packages/manifest-validator/src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const networks = {
type: "object",
properties: {
currency: {
enum: CURRENCIES_ID,
type: "string",
examples: CURRENCIES_ID,
},
chainID: {
type: "number",
Expand All @@ -34,14 +35,17 @@ export const schema = {
title: "Manifest schema for Wallet App",
type: "object",
properties: {
$schema: {
type: "string",
},
id: {
type: "string",
minLength: 3,
maxLength: 50,
pattern: "^[a-z][a-z0-9-]*$",
pattern: "^[a-zA-Z0-9_][a-zA-Z0-9_-]*$",
errorMessage: {
pattern:
"${0#} must start with a lowercase letter and can only contain lowercase letters, digits, or hyphens.",
"${0#} must start with a letter or digit and can only contain letters, digits, or hyphens.",
},
},
author: {
Expand Down Expand Up @@ -71,6 +75,9 @@ export const schema = {
type: "string",
format: "uri",
},
private: {
type: "boolean",
},
platforms: {
type: "array",
uniqueItems: true,
Expand Down Expand Up @@ -102,7 +109,8 @@ export const schema = {
type: "array",
uniqueItems: true,
items: {
enum: CURRENCIES_ID,
type: "string",
examples: CURRENCIES_ID,
},
},
{
Expand Down Expand Up @@ -185,7 +193,7 @@ export const schema = {
},
permissions: {
type: "array",
minItems: 1,
minItems: 0,
items: {
type: "string",
},
Expand Down Expand Up @@ -253,6 +261,10 @@ export const schema = {
"currencies",
"content",
"permissions",
"homepageUrl",
"branch",
"domains",
"visibility",
],
additionalProperties: {
not: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
},
"homepageUrl": "https://earn.alkemi.network",
"supportUrl": "https://earn.alkemi.network",
"domains": ["https"],
"branch": "stable",
"icon": "https://cdn.live.ledger.com/icons/platform/alkemi.png",
"platforms": ["ios"],
"apiVersion": "^1.0.0 || ~0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
},
"homepageUrl": "https://earn.alkemi.network",
"supportUrl": "https://earn.alkemi.network",
"domains": ["https"],
"branch": "stable",
"icon": "https://cdn.live.ledger.com/icons/platform/alkemi.png",
"platforms": ["android", "ios", "desktop"],
"apiVersion": "^1.0.0 || ~0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
},
"homepageUrl": "https://earn.alkemi.network",
"supportUrl": "https://earn.alkemi.network",
"domains": ["https"],
"branch": "stable",
"icon": "https://cdn.live.ledger.com/icons/platform/alkemi.png",
"platforms": ["android"],
"apiVersion": "^1.0.0 || ~0.0.1",
Expand Down

0 comments on commit 47547e4

Please sign in to comment.