Skip to content

Commit bc02679

Browse files
committed
add schemas
1 parent 6739521 commit bc02679

File tree

6 files changed

+181
-30
lines changed

6 files changed

+181
-30
lines changed

contracts/account/schema/valence-account.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"contract_name": "valence-account",
3-
"contract_version": "0.1.5",
3+
"contract_version": "0.1.7",
44
"idl_version": "1.0.0",
55
"instantiate": {
66
"$schema": "http://json-schema.org/draft-07/schema#",

contracts/auction/auction/schema/auction.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"contract_name": "auction",
3-
"contract_version": "0.1.5",
3+
"contract_version": "0.1.7",
44
"idl_version": "1.0.0",
55
"instantiate": {
66
"$schema": "http://json-schema.org/draft-07/schema#",

contracts/auction/auctions_manager/schema/auctions-manager.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"contract_name": "auctions-manager",
3-
"contract_version": "0.1.5",
3+
"contract_version": "0.1.7",
44
"idl_version": "1.0.0",
55
"instantiate": {
66
"$schema": "http://json-schema.org/draft-07/schema#",
@@ -185,12 +185,6 @@
185185
"definitions": {
186186
"AdminMsgs": {
187187
"oneOf": [
188-
{
189-
"type": "string",
190-
"enum": [
191-
"cancel_admin_change"
192-
]
193-
},
194188
{
195189
"type": "object",
196190
"required": [
@@ -488,6 +482,19 @@
488482
}
489483
},
490484
"additionalProperties": false
485+
},
486+
{
487+
"type": "object",
488+
"required": [
489+
"cancel_admin_change"
490+
],
491+
"properties": {
492+
"cancel_admin_change": {
493+
"type": "object",
494+
"additionalProperties": false
495+
}
496+
},
497+
"additionalProperties": false
491498
}
492499
]
493500
},

contracts/auction/price_oracle/schema/price-oracle.json

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"contract_name": "price-oracle",
3-
"contract_version": "0.1.5",
3+
"contract_version": "0.1.7",
44
"idl_version": "1.0.0",
55
"instantiate": {
66
"$schema": "http://json-schema.org/draft-07/schema#",
@@ -359,6 +359,27 @@
359359
},
360360
"additionalProperties": false
361361
},
362+
{
363+
"type": "object",
364+
"required": [
365+
"get_local_price"
366+
],
367+
"properties": {
368+
"get_local_price": {
369+
"type": "object",
370+
"required": [
371+
"pair"
372+
],
373+
"properties": {
374+
"pair": {
375+
"$ref": "#/definitions/Pair"
376+
}
377+
},
378+
"additionalProperties": false
379+
}
380+
},
381+
"additionalProperties": false
382+
},
362383
{
363384
"type": "object",
364385
"required": [
@@ -522,6 +543,48 @@
522543
}
523544
}
524545
},
546+
"get_local_price": {
547+
"$schema": "http://json-schema.org/draft-07/schema#",
548+
"title": "Array_of_Price",
549+
"type": "array",
550+
"items": {
551+
"$ref": "#/definitions/Price"
552+
},
553+
"definitions": {
554+
"Decimal": {
555+
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
556+
"type": "string"
557+
},
558+
"Price": {
559+
"type": "object",
560+
"required": [
561+
"price",
562+
"time"
563+
],
564+
"properties": {
565+
"price": {
566+
"$ref": "#/definitions/Decimal"
567+
},
568+
"time": {
569+
"$ref": "#/definitions/Timestamp"
570+
}
571+
},
572+
"additionalProperties": false
573+
},
574+
"Timestamp": {
575+
"description": "A point in time in nanosecond precision.\n\nThis type can represent times from 1970-01-01T00:00:00Z to 2554-07-21T23:34:33Z.\n\n## Examples\n\n``` # use cosmwasm_std::Timestamp; let ts = Timestamp::from_nanos(1_000_000_202); assert_eq!(ts.nanos(), 1_000_000_202); assert_eq!(ts.seconds(), 1); assert_eq!(ts.subsec_nanos(), 202);\n\nlet ts = ts.plus_seconds(2); assert_eq!(ts.nanos(), 3_000_000_202); assert_eq!(ts.seconds(), 3); assert_eq!(ts.subsec_nanos(), 202); ```",
576+
"allOf": [
577+
{
578+
"$ref": "#/definitions/Uint64"
579+
}
580+
]
581+
},
582+
"Uint64": {
583+
"description": "A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u64` to get the value out:\n\n``` # use cosmwasm_std::Uint64; let a = Uint64::from(42u64); assert_eq!(a.u64(), 42);\n\nlet b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```",
584+
"type": "string"
585+
}
586+
}
587+
},
525588
"get_price": {
526589
"$schema": "http://json-schema.org/draft-07/schema#",
527590
"title": "Price",

contracts/services/rebalancer/schema/rebalancer.json

Lines changed: 87 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"contract_name": "rebalancer",
3-
"contract_version": "0.1.5",
3+
"contract_version": "0.1.7",
44
"idl_version": "1.0.0",
55
"instantiate": {
66
"$schema": "http://json-schema.org/draft-07/schema#",
@@ -109,12 +109,6 @@
109109
"title": "ExecuteMsg",
110110
"description": "Rebalancer execute msgs.",
111111
"oneOf": [
112-
{
113-
"type": "string",
114-
"enum": [
115-
"approve_admin_change"
116-
]
117-
},
118112
{
119113
"type": "object",
120114
"required": [
@@ -150,6 +144,19 @@
150144
},
151145
"additionalProperties": false
152146
},
147+
{
148+
"type": "object",
149+
"required": [
150+
"approve_admin_change"
151+
],
152+
"properties": {
153+
"approve_admin_change": {
154+
"type": "object",
155+
"additionalProperties": false
156+
}
157+
},
158+
"additionalProperties": false
159+
},
153160
{
154161
"description": "Register this account to the service.",
155162
"type": "object",
@@ -443,14 +450,15 @@
443450
"maxItems": 2,
444451
"minItems": 2
445452
},
453+
"RebalancerAccountType": {
454+
"type": "string",
455+
"enum": [
456+
"regular",
457+
"program"
458+
]
459+
},
446460
"RebalancerAdminMsg": {
447461
"oneOf": [
448-
{
449-
"type": "string",
450-
"enum": [
451-
"cancel_admin_change"
452-
]
453-
},
454462
{
455463
"type": "object",
456464
"required": [
@@ -644,6 +652,19 @@
644652
}
645653
},
646654
"additionalProperties": false
655+
},
656+
{
657+
"type": "object",
658+
"required": [
659+
"cancel_admin_change"
660+
],
661+
"properties": {
662+
"cancel_admin_change": {
663+
"type": "object",
664+
"additionalProperties": false
665+
}
666+
},
667+
"additionalProperties": false
647668
}
648669
]
649670
},
@@ -656,6 +677,14 @@
656677
"targets"
657678
],
658679
"properties": {
680+
"account_type": {
681+
"default": "regular",
682+
"allOf": [
683+
{
684+
"$ref": "#/definitions/RebalancerAccountType"
685+
}
686+
]
687+
},
659688
"base_denom": {
660689
"description": "Base denom we will be calculating everything based on",
661690
"type": "string"
@@ -1161,6 +1190,13 @@
11611190
},
11621191
"additionalProperties": false
11631192
},
1193+
"RebalancerAccountType": {
1194+
"type": "string",
1195+
"enum": [
1196+
"regular",
1197+
"program"
1198+
]
1199+
},
11641200
"RebalancerConfig": {
11651201
"type": "object",
11661202
"required": [
@@ -1173,6 +1209,14 @@
11731209
"targets"
11741210
],
11751211
"properties": {
1212+
"account_type": {
1213+
"default": "regular",
1214+
"allOf": [
1215+
{
1216+
"$ref": "#/definitions/RebalancerAccountType"
1217+
}
1218+
]
1219+
},
11761220
"base_denom": {
11771221
"description": "The base denom we will be calculating everything based on",
11781222
"type": "string"
@@ -1272,6 +1316,14 @@
12721316
"targets"
12731317
],
12741318
"properties": {
1319+
"account_type": {
1320+
"default": "regular",
1321+
"allOf": [
1322+
{
1323+
"$ref": "#/definitions/RebalancerAccountType"
1324+
}
1325+
]
1326+
},
12751327
"base_denom": {
12761328
"description": "The base denom we will be calculating everything based on",
12771329
"type": "string"
@@ -1409,6 +1461,13 @@
14091461
},
14101462
"additionalProperties": false
14111463
},
1464+
"RebalancerAccountType": {
1465+
"type": "string",
1466+
"enum": [
1467+
"regular",
1468+
"program"
1469+
]
1470+
},
14121471
"SignedDecimal": {
14131472
"description": "A signed fixed-point decimal value with 18 fractional digits, i.e. SignedDecimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 170141183460469231731.687303715884105727 (which is (2^127 - 1) / 10^18) and the smallest is -170141183460469231731.687303715884105728 (which is -2^127 / 10^18).",
14141473
"type": "string"
@@ -1605,6 +1664,13 @@
16051664
}
16061665
]
16071666
},
1667+
"RebalancerAccountType": {
1668+
"type": "string",
1669+
"enum": [
1670+
"regular",
1671+
"program"
1672+
]
1673+
},
16081674
"RebalancerConfig": {
16091675
"type": "object",
16101676
"required": [
@@ -1617,6 +1683,14 @@
16171683
"targets"
16181684
],
16191685
"properties": {
1686+
"account_type": {
1687+
"default": "regular",
1688+
"allOf": [
1689+
{
1690+
"$ref": "#/definitions/RebalancerAccountType"
1691+
}
1692+
]
1693+
},
16201694
"base_denom": {
16211695
"description": "The base denom we will be calculating everything based on",
16221696
"type": "string"

contracts/services_manager/schema/services-manager.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"contract_name": "services-manager",
3-
"contract_version": "0.1.5",
3+
"contract_version": "0.1.7",
44
"idl_version": "1.0.0",
55
"instantiate": {
66
"$schema": "http://json-schema.org/draft-07/schema#",
@@ -247,12 +247,6 @@
247247
"ServicesManagerAdminMsg": {
248248
"description": "Admin messages for services manager",
249249
"oneOf": [
250-
{
251-
"type": "string",
252-
"enum": [
253-
"cancel_admin_change"
254-
]
255-
},
256250
{
257251
"description": "Add a service to the services manager",
258252
"type": "object",
@@ -387,6 +381,19 @@
387381
},
388382
"additionalProperties": false
389383
},
384+
{
385+
"type": "object",
386+
"required": [
387+
"cancel_admin_change"
388+
],
389+
"properties": {
390+
"cancel_admin_change": {
391+
"type": "object",
392+
"additionalProperties": false
393+
}
394+
},
395+
"additionalProperties": false
396+
},
390397
{
391398
"type": "object",
392399
"required": [

0 commit comments

Comments
 (0)