{ "contract_name": "nym-ecash", "contract_version": "0.1.0", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "InstantiateMsg", "description": "Instantiation payload. The sender of the instantiate transaction becomes the contract admin; the three addresses are bech32-validated and persisted as immutable cross-contract pointers (see spec requirement \"Contract instantiation\").", "type": "object", "required": [ "deposit_amount", "group_addr", "holding_account", "multisig_addr" ], "properties": { "deposit_amount": { "description": "Default per-deposit price. The denom of this coin is the contract's canonical denom for the rest of its lifetime.", "allOf": [ { "$ref": "#/definitions/Coin" } ] }, "group_addr": { "description": "cw4 group contract referenced by the (stubbed) blacklist proposal flow.", "type": "string" }, "holding_account": { "description": "Cosmos SDK address reserved for the future pool-contract transition. Stored in `Config` but never debited by the current contract.", "type": "string" }, "multisig_addr": { "description": "cw3 multisig contract that gates `RedeemTickets` and (in the redesign) blacklist proposals. Not updatable through any execute path.", "type": "string" } }, "additionalProperties": false, "definitions": { "Coin": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "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" } } }, "execute": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ExecuteMsg", "oneOf": [ { "description": "Submitted by clients to escrow funds and register a claimed ed25519 identity key. Mints a sequential `deposit_id`. The contract does not verify control of the identity key - that proof is checked off-chain by nym-api signers at blind-sign time.", "type": "object", "required": [ "deposit_ticket_book_funds" ], "properties": { "deposit_ticket_book_funds": { "type": "object", "required": [ "identity_key" ], "properties": { "identity_key": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Submitted by gateways to request batch redemption of spent tickets. Dispatches a `Propose` SubMsg to the multisig contract; the actual transfer effect is gated behind multisig approval.", "type": "object", "required": [ "request_redemption" ], "properties": { "request_redemption": { "type": "object", "required": [ "commitment_bs58", "number_of_tickets" ], "properties": { "commitment_bs58": { "type": "string" }, "number_of_tickets": { "type": "integer", "format": "uint16", "minimum": 0.0 } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "**Legacy / dead code.** Only callable by the multisig; bumps the unredeemed-tickets counter and emits a `ticket_redemption` event with `moved_to_holding_account = \"false\"`. No known consumer depends on the side effects; candidate for removal in a follow-on breaking-schema change.", "type": "object", "required": [ "redeem_tickets" ], "properties": { "redeem_tickets": { "type": "object", "required": [ "gw", "n" ], "properties": { "gw": { "type": "string" }, "n": { "type": "integer", "format": "uint16", "minimum": 0.0 } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Transfer the contract admin role. Only the current admin may sign. Dispatches via the cw_controllers `execute_update_admin` handshake.", "type": "object", "required": [ "update_admin" ], "properties": { "update_admin": { "type": "object", "required": [ "admin" ], "properties": { "admin": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Overwrite `Config::deposit_amount`. Only callable by the contract admin. Rejects values below `nym_network_defaults::TICKETBOOK_SIZE` and trips `TicketBookSizeChanged` if the snapshotted invariant has diverged from the current crate constant.", "type": "object", "required": [ "update_default_deposit_value" ], "properties": { "update_default_deposit_value": { "type": "object", "required": [ "new_deposit" ], "properties": { "new_deposit": { "$ref": "#/definitions/Coin" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Set (or overwrite) a reduced deposit price for a specific address. Only callable by the contract admin.", "type": "object", "required": [ "set_reduced_deposit_price" ], "properties": { "set_reduced_deposit_price": { "type": "object", "required": [ "address", "deposit" ], "properties": { "address": { "type": "string" }, "deposit": { "$ref": "#/definitions/Coin" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Remove the reduced deposit price for a specific address, reverting them to the default price. Returns an error if the address has no custom price set. Only callable by the contract admin.", "type": "object", "required": [ "remove_reduced_deposit_price" ], "properties": { "remove_reduced_deposit_price": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "**Stubbed**: always returns `EcashContractError::UnimplementedBlacklisting`. Storage, reply handler, and helper paths exist but are unreachable from the public ExecuteMsg surface. Preserved for the redesign.", "type": "object", "required": [ "propose_to_blacklist" ], "properties": { "propose_to_blacklist": { "type": "object", "required": [ "public_key" ], "properties": { "public_key": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "*Stubbed**: always returns `EcashContractError::UnimplementedBlacklisting`.", "type": "object", "required": [ "add_to_blacklist" ], "properties": { "add_to_blacklist": { "type": "object", "required": [ "public_key" ], "properties": { "public_key": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false } ], "definitions": { "Coin": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "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" } } }, "query": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "QueryMsg", "oneOf": [ { "description": "Look up a blacklist entry by its bs58-encoded ed25519 public key. Always returns `None` on a freshly deployed contract because the blacklist execute paths are stubbed.", "type": "object", "required": [ "get_blacklisted_account" ], "properties": { "get_blacklisted_account": { "type": "object", "required": [ "public_key" ], "properties": { "public_key": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Paginated listing of blacklist entries. Always empty today (see stubbed blacklist surface). Defaults: limit 50, max 75.", "type": "object", "required": [ "get_blacklist_paged" ], "properties": { "get_blacklist_paged": { "type": "object", "properties": { "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "start_after": { "type": [ "string", "null" ] } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Default per-deposit price (`Config::deposit_amount`). The `GetRequiredDepositAmount` aliases are kept for backwards compatibility.", "type": "object", "required": [ "get_default_deposit_amount" ], "properties": { "get_default_deposit_amount": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "Per-address reduced deposit price override, if any. `None` for any non-whitelisted address.", "type": "object", "required": [ "get_reduced_deposit_amount" ], "properties": { "get_reduced_deposit_amount": { "type": "object", "required": [ "address" ], "properties": { "address": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Enumerate every reduced-deposit whitelist entry in ascending address order. Unpaginated by design (the whitelist is expected to stay small).", "type": "object", "required": [ "get_all_whitelisted_accounts" ], "properties": { "get_all_whitelisted_accounts": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "Look up a deposit by id. Returns `{ id, deposit: None }` when the id has not yet been assigned.", "type": "object", "required": [ "get_deposit" ], "properties": { "get_deposit": { "type": "object", "required": [ "deposit_id" ], "properties": { "deposit_id": { "type": "integer", "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Most recently assigned deposit (or `{ deposit: None }` on a fresh contract). See `DepositStorage::latest_deposit`.", "type": "object", "required": [ "get_latest_deposit" ], "properties": { "get_latest_deposit": { "type": "object", "additionalProperties": false } }, "additionalProperties": false }, { "description": "Paginated listing of deposits in ascending id order. Defaults: limit 50, max 100.", "type": "object", "required": [ "get_deposits_paged" ], "properties": { "get_deposits_paged": { "type": "object", "properties": { "limit": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 }, "start_after": { "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false } }, "additionalProperties": false }, { "description": "Aggregate statistics: global totals + per-account custom-price breakdowns. Reassembled in a single read pass from `PoolCounters` and `DepositStatsStorage`.", "type": "object", "required": [ "get_deposits_statistics" ], "properties": { "get_deposits_statistics": { "type": "object", "additionalProperties": false } }, "additionalProperties": false } ] }, "migrate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", "type": "object", "required": [ "initial_whitelist" ], "properties": { "initial_whitelist": { "description": "Initial set of whitelisted accounts with their reduced deposit prices. Each entry is validated and stored during migration.", "type": "array", "items": { "$ref": "#/definitions/WhitelistedDeposit" } } }, "additionalProperties": false, "definitions": { "Coin": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "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" }, "WhitelistedDeposit": { "description": "An address and its reduced deposit price, used when seeding the whitelist via migration.", "type": "object", "required": [ "address", "deposit" ], "properties": { "address": { "type": "string" }, "deposit": { "$ref": "#/definitions/Coin" } }, "additionalProperties": false } } }, "sudo": null, "responses": { "get_all_whitelisted_accounts": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "WhitelistedAccountsResponse", "description": "Response shape for `GetAllWhitelistedAccounts`. Unpaginated - the whitelist is expected to stay small.", "type": "object", "required": [ "whitelisted_accounts" ], "properties": { "whitelisted_accounts": { "type": "array", "items": { "$ref": "#/definitions/WhitelistedAccount" } } }, "additionalProperties": false, "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" }, "Coin": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "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" }, "WhitelistedAccount": { "description": "Whitelist entry: an address and the reduced deposit price it may pay. Persisted in the `\"reduced_deposits\"` storage map.", "type": "object", "required": [ "address", "deposit" ], "properties": { "address": { "$ref": "#/definitions/Addr" }, "deposit": { "$ref": "#/definitions/Coin" } }, "additionalProperties": false } } }, "get_blacklist_paged": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PagedBlacklistedAccountResponse", "description": "Page of blacklist entries returned by `GetBlacklistPaged`. Always empty on a freshly deployed contract.", "type": "object", "required": [ "accounts", "per_page" ], "properties": { "accounts": { "type": "array", "items": { "$ref": "#/definitions/BlacklistedAccount" } }, "per_page": { "type": "integer", "format": "uint", "minimum": 0.0 }, "start_next_after": { "description": "Field indicating paging information for the following queries if the caller wishes to get further entries.", "type": [ "string", "null" ] } }, "additionalProperties": false, "definitions": { "BlacklistedAccount": { "description": "Public-key + metadata pair surfaced by `GetBlacklistedAccount` / `GetBlacklistPaged`. Always empty on a freshly deployed contract.", "type": "object", "required": [ "info", "public_key" ], "properties": { "info": { "$ref": "#/definitions/Blacklisting" }, "public_key": { "type": "string" } }, "additionalProperties": false }, "Blacklisting": { "description": "Per-key blacklist record: the multisig proposal that approved it and the block height at which finalisation landed (None until finalised).", "type": "object", "required": [ "proposal_id" ], "properties": { "finalized_at_height": { "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "proposal_id": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false } } }, "get_blacklisted_account": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "BlacklistedAccountResponse", "description": "Response shape for `GetBlacklistedAccount`. `account` is `None` for any key not present in the (currently always-empty) blacklist.", "type": "object", "properties": { "account": { "anyOf": [ { "$ref": "#/definitions/Blacklisting" }, { "type": "null" } ] } }, "additionalProperties": false, "definitions": { "Blacklisting": { "description": "Per-key blacklist record: the multisig proposal that approved it and the block height at which finalisation landed (None until finalised).", "type": "object", "required": [ "proposal_id" ], "properties": { "finalized_at_height": { "type": [ "integer", "null" ], "format": "uint64", "minimum": 0.0 }, "proposal_id": { "type": "integer", "format": "uint64", "minimum": 0.0 } }, "additionalProperties": false } } }, "get_default_deposit_amount": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Coin", "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "type": "string" } }, "additionalProperties": false, "definitions": { "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" } } }, "get_deposit": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "DepositResponse", "description": "Response shape for `GetDeposit { deposit_id }`. `deposit` is `None` when the id has not yet been assigned (`id >= total_deposits_made`).", "type": "object", "required": [ "id" ], "properties": { "deposit": { "anyOf": [ { "$ref": "#/definitions/Deposit" }, { "type": "null" } ] }, "id": { "type": "integer", "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false, "definitions": { "Deposit": { "description": "Opaque on-chain record of a deposit: the depositor-claimed bs58-encoded ed25519 identity public key. The contract does not verify control of the corresponding private key.", "type": "object", "required": [ "bs58_encoded_ed25519_pubkey" ], "properties": { "bs58_encoded_ed25519_pubkey": { "type": "string" } }, "additionalProperties": false } } }, "get_deposits_paged": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PagedDepositsResponse", "description": "Page of deposits returned by `GetDepositsPaged`. `start_next_after` is the id of the last returned entry; pass it as the next call's `start_after`.", "type": "object", "required": [ "deposits" ], "properties": { "deposits": { "type": "array", "items": { "$ref": "#/definitions/DepositData" } }, "start_next_after": { "description": "Field indicating paging information for the following queries if the caller wishes to get further entries.", "type": [ "integer", "null" ], "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false, "definitions": { "Deposit": { "description": "Opaque on-chain record of a deposit: the depositor-claimed bs58-encoded ed25519 identity public key. The contract does not verify control of the corresponding private key.", "type": "object", "required": [ "bs58_encoded_ed25519_pubkey" ], "properties": { "bs58_encoded_ed25519_pubkey": { "type": "string" } }, "additionalProperties": false }, "DepositData": { "description": "`(deposit_id, deposit)` pair surfaced by the latest-deposit and paginated deposit queries.", "type": "object", "required": [ "deposit", "id" ], "properties": { "deposit": { "$ref": "#/definitions/Deposit" }, "id": { "type": "integer", "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false } } }, "get_deposits_statistics": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "DepositsStatistics", "description": "Aggregate statistics about all deposits made through the ecash contract.", "type": "object", "required": [ "deposited_with_custom_price", "deposits_made_with_custom_price", "total_deposited", "total_deposited_with_custom_price", "total_deposited_with_default_price", "total_deposits_made", "total_deposits_made_with_custom_price", "total_deposits_made_with_default_price" ], "properties": { "deposited_with_custom_price": { "description": "Per-account breakdown of deposited amounts for whitelisted addresses.", "type": "object", "additionalProperties": false }, "deposits_made_with_custom_price": { "description": "Per-account breakdown of deposit counts for whitelisted addresses.", "type": "object", "additionalProperties": false }, "total_deposited": { "description": "Total value of all deposits ever made (at any price tier), sourced from `PoolCounters::total_deposited`.", "allOf": [ { "$ref": "#/definitions/Coin" } ] }, "total_deposited_with_custom_price": { "description": "Total value deposited at custom prices, summed across all whitelisted accounts.", "allOf": [ { "$ref": "#/definitions/Coin" } ] }, "total_deposited_with_default_price": { "description": "Total value deposited at the default price.", "allOf": [ { "$ref": "#/definitions/Coin" } ] }, "total_deposits_made": { "description": "Total number of deposits ever made (at any price tier), derived from the deposit id counter.", "type": "integer", "format": "uint32", "minimum": 0.0 }, "total_deposits_made_with_custom_price": { "description": "Number of deposits made at any custom (reduced) price, summed across all whitelisted accounts.", "type": "integer", "format": "uint32", "minimum": 0.0 }, "total_deposits_made_with_default_price": { "description": "Number of deposits made at the default (non-reduced) price.", "type": "integer", "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false, "definitions": { "Coin": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "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" } } }, "get_latest_deposit": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "LatestDepositResponse", "description": "Response shape for `GetLatestDeposit`. `deposit` is `None` on a freshly deployed contract.", "type": "object", "properties": { "deposit": { "anyOf": [ { "$ref": "#/definitions/DepositData" }, { "type": "null" } ] } }, "additionalProperties": false, "definitions": { "Deposit": { "description": "Opaque on-chain record of a deposit: the depositor-claimed bs58-encoded ed25519 identity public key. The contract does not verify control of the corresponding private key.", "type": "object", "required": [ "bs58_encoded_ed25519_pubkey" ], "properties": { "bs58_encoded_ed25519_pubkey": { "type": "string" } }, "additionalProperties": false }, "DepositData": { "description": "`(deposit_id, deposit)` pair surfaced by the latest-deposit and paginated deposit queries.", "type": "object", "required": [ "deposit", "id" ], "properties": { "deposit": { "$ref": "#/definitions/Deposit" }, "id": { "type": "integer", "format": "uint32", "minimum": 0.0 } }, "additionalProperties": false } } }, "get_reduced_deposit_amount": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Nullable_Coin", "anyOf": [ { "$ref": "#/definitions/Coin" }, { "type": "null" } ], "definitions": { "Coin": { "type": "object", "required": [ "amount", "denom" ], "properties": { "amount": { "$ref": "#/definitions/Uint128" }, "denom": { "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" } } } } }