Skip to content

Commit

Permalink
Update discord_profile query response
Browse files Browse the repository at this point in the history
  • Loading branch information
ismellike committed Dec 19, 2024
1 parent d08efc2 commit 7c27af9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,16 +469,39 @@
},
"discord_profile": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Nullable_Uint64",
"title": "Nullable_DiscordProfile",
"anyOf": [
{
"$ref": "#/definitions/Uint64"
"$ref": "#/definitions/DiscordProfile"
},
{
"type": "null"
}
],
"definitions": {
"DiscordProfile": {
"type": "object",
"required": [
"user_id",
"username"
],
"properties": {
"avatar_hash": {
"type": [
"string",
"null"
]
},
"user_id": {
"$ref": "#/definitions/Uint64"
},
"username": {
"description": "The discord username",
"type": "string"
}
},
"additionalProperties": false
},
"Uint64": {
"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); ```",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion contracts/arena-discord-identity/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub enum ExecuteMsg {
#[cw_serde]
#[derive(QueryResponses, cw_orch::QueryFns)]
pub enum QueryMsg {
#[returns(Option<Uint64>)]
#[returns(Option<DiscordProfile>)]
DiscordProfile { addr: String },
#[returns(Vec<cosmwasm_std::Addr>)]
ConnectedWallets { discord_id: Uint64 },
Expand Down
4 changes: 2 additions & 2 deletions scripts/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ glob("../@(contracts)/**/schema").then((matches) => {
let contracts: ContractFile[] = [];

for (const x of matches) {
let split = x.split("\\");
let split = x.split("/");
let name = split[split.length - 2];
let dir = join(__dirname, "..", x).replaceAll("\\", "/");
let dir = join(__dirname, "..", x);

console.log(dir);
console.log(name);
Expand Down

0 comments on commit 7c27af9

Please sign in to comment.