-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to using cosmwasm-typescript-gen (#347)
* Add latest ts types * Remove old generated ts files * Use cosmwasm-typescript-gen + Add ProposalModulesResponse to cw_core schema * Remove tsconfig files * Switch to cosmwasm-typescript-gen v 0.2.15 * Add ci step * Fix ci step to use proper dir * remove legacy ts files * Upgrade cosmwasm-typescript-gen to 0.3.4 and fix more yarn build errors * Fix missing schema exports * Generate ts changes for latest main changes * Regenerate types after rebasing main
- Loading branch information
Showing
129 changed files
with
6,327 additions
and
3,760 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
on: [push, pull_request] | ||
|
||
name: Typescript Codegen | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- name: Yarn install | ||
run: yarn --cwd ./types install | ||
- name: Yarn build | ||
run: yarn --cwd ./types build | ||
- name: Yarn codegen | ||
run: yarn --cwd ./types codegen | ||
- name: Check for ts changes | ||
# fails if any changes not committed | ||
run: git diff --exit-code . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ProposalModulesResponse", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Addr" | ||
}, | ||
"definitions": { | ||
"Addr": { | ||
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", | ||
"type": "string" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
contracts/cw-named-groups/schema/is_address_in_group_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "IsAddressInGroupResponse", | ||
"type": "object", | ||
"required": [ | ||
"is_in_group" | ||
], | ||
"properties": { | ||
"is_in_group": { | ||
"type": "boolean" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "ConfigResponse", | ||
"type": "object", | ||
"required": [ | ||
"admin", | ||
"payment_info" | ||
], | ||
"properties": { | ||
"admin": { | ||
"$ref": "#/definitions/Addr" | ||
}, | ||
"payment_info": { | ||
"$ref": "#/definitions/PaymentInfo" | ||
} | ||
}, | ||
"definitions": { | ||
"Addr": { | ||
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", | ||
"type": "string" | ||
}, | ||
"PaymentInfo": { | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"native_payment" | ||
], | ||
"properties": { | ||
"native_payment": { | ||
"type": "object", | ||
"required": [ | ||
"payment_amount", | ||
"token_denom" | ||
], | ||
"properties": { | ||
"payment_amount": { | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
"token_denom": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"cw20_payment" | ||
], | ||
"properties": { | ||
"cw20_payment": { | ||
"type": "object", | ||
"required": [ | ||
"payment_amount", | ||
"token_address" | ||
], | ||
"properties": { | ||
"payment_amount": { | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
"token_address": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
}, | ||
"Uint128": { | ||
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 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 `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", | ||
"type": "string" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
contracts/cw20-stake-external-rewards/schema/get_pending_rewards_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "GetPendingRewardsResponse", | ||
"type": "object", | ||
"required": [ | ||
"address", | ||
"denom", | ||
"last_update_block", | ||
"pending_rewards" | ||
], | ||
"properties": { | ||
"address": { | ||
"type": "string" | ||
}, | ||
"denom": { | ||
"$ref": "#/definitions/Denom" | ||
}, | ||
"last_update_block": { | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
}, | ||
"pending_rewards": { | ||
"$ref": "#/definitions/Uint128" | ||
} | ||
}, | ||
"definitions": { | ||
"Addr": { | ||
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", | ||
"type": "string" | ||
}, | ||
"Denom": { | ||
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"native" | ||
], | ||
"properties": { | ||
"native": { | ||
"type": "string" | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
{ | ||
"type": "object", | ||
"required": [ | ||
"cw20" | ||
], | ||
"properties": { | ||
"cw20": { | ||
"$ref": "#/definitions/Addr" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
] | ||
}, | ||
"Uint128": { | ||
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 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 `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", | ||
"type": "string" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
contracts/cw20-stake-reward-distributor/schema/info_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "InfoResponse", | ||
"type": "object", | ||
"required": [ | ||
"balance", | ||
"config", | ||
"last_payment_block" | ||
], | ||
"properties": { | ||
"balance": { | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
"config": { | ||
"$ref": "#/definitions/Config" | ||
}, | ||
"last_payment_block": { | ||
"type": "integer", | ||
"format": "uint64", | ||
"minimum": 0.0 | ||
} | ||
}, | ||
"definitions": { | ||
"Addr": { | ||
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", | ||
"type": "string" | ||
}, | ||
"Config": { | ||
"type": "object", | ||
"required": [ | ||
"owner", | ||
"reward_rate", | ||
"reward_token", | ||
"staking_addr" | ||
], | ||
"properties": { | ||
"owner": { | ||
"$ref": "#/definitions/Addr" | ||
}, | ||
"reward_rate": { | ||
"$ref": "#/definitions/Uint128" | ||
}, | ||
"reward_token": { | ||
"$ref": "#/definitions/Addr" | ||
}, | ||
"staking_addr": { | ||
"$ref": "#/definitions/Addr" | ||
} | ||
} | ||
}, | ||
"Uint128": { | ||
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 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 `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", | ||
"type": "string" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.