diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4a00c4f89..c66b32b0d 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,4 +17,4 @@ jobs: run: go build -v ./... - name: Test - run: go test -v `go list ./... | grep -v -E 'x/nftbackedloan/|x/derivatives/|x/pricefeed/|x/ecosystemincentive/'` + run: go test -v `go list ./... | grep -v -E 'x/derivatives/|x/pricefeed/|x/ecosystemincentive/|x/nftbackedloan/'` diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index cbca947cd..dadd41617 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -96,6 +96,7 @@ import ( yieldaggregatortypes "github.com/UnUniFi/chain/x/yieldaggregator/types" nftbackedloankeeper "github.com/UnUniFi/chain/x/nftbackedloan/keeper" + // nftbackedloantypes "github.com/UnUniFi/chain/x/nftbackedloan/types" derivativeskeeper "github.com/UnUniFi/chain/x/derivatives/keeper" nftfactorykeeper "github.com/UnUniFi/chain/x/nftfactory/keeper" @@ -103,6 +104,7 @@ import ( pricefeedkeeper "github.com/UnUniFi/chain/x/pricefeed/keeper" ecosystemincentivekeeper "github.com/UnUniFi/chain/x/ecosystemincentive/keeper" + // ecosystemincentivetypes "github.com/UnUniFi/chain/x/ecosystemincentive/types" ) type AppKeepers struct { @@ -486,6 +488,7 @@ func NewAppKeeper( // ) // create Keeper objects which have Hooks + // appKeepers.NftbackedloanKeeper = nftbackedloanKeeper // appKeepers.NftbackedloanKeeper = *nftbackedloanKeeper.SetHooks(nftbackedloantypes.NewMultiNftbackedloanHooks(appKeepers.EcosystemincentiveKeeper.Hooks())) // appKeepers.PricefeedKeeper = pricefeedkeeper.NewKeeper( diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 38d336680..eaa0862c2 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -30,7 +30,9 @@ import ( buildertypes "github.com/skip-mev/pob/x/builder/types" + // ecosystemincentivetypes "github.com/UnUniFi/chain/x/ecosystemincentive/types" epochstypes "github.com/UnUniFi/chain/x/epochs/types" + // nftbackedloantypes "github.com/UnUniFi/chain/x/nftbackedloan/types" icacallbackstypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/icacallbacks/types" interchainquerytypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/interchainquery/types" recordstypes "github.com/UnUniFi/chain/x/yieldaggregator/submodules/records/types" diff --git a/docs/client/swagger.yaml b/docs/client/swagger.yaml index 06d75efd1..75cc414e1 100644 --- a/docs/client/swagger.yaml +++ b/docs/client/swagger.yaml @@ -5090,48 +5090,6 @@ paths: type: string tags: - Query - /ununifi/ecosystemincentive/belonging-recipient-containers/{address}: - get: - operationId: BelongingRecipientContainerIdsByAddr - responses: - '200': - description: A successful response. - schema: - type: object - properties: - recipient_container_ids: - type: array - items: - type: string - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: address - in: path - required: true - type: string - tags: - - Query /ununifi/ecosystemincentive/params: get: summary: Parameters queries the parameters of the module. @@ -5219,29 +5177,17 @@ paths: format: byte tags: - Query - /ununifi/ecosystemincentive/recipient-containers/{id}: + /ununifi/ecosystemincentive/recipients: get: - operationId: RecipientContainer + operationId: RecipientAddressWithNftId responses: '200': description: A successful response. schema: type: object properties: - recipient_container: - type: object - properties: - id: - type: string - weighted_addresses: - type: array - items: - type: object - properties: - address: - type: string - weight: - type: string + address: + type: string default: description: An unexpected error response. schema: @@ -5265,23 +5211,42 @@ paths: type: string format: byte parameters: - - name: id - in: path - required: true + - name: class_id + in: query + required: false + type: string + - name: token_id + in: query + required: false type: string tags: - Query - /ununifi/ecosystemincentive/recorded-recipient-containers/{class_id}/{nft_id}: + /ununifi/ecosystemincentive/rewards/{address}: get: - operationId: RecordedRecipientContainerId + operationId: EcosystemRewards responses: '200': description: A successful response. schema: type: object properties: - recipient_container_id: - type: string + rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. default: description: An unexpected error response. schema: @@ -5305,33 +5270,43 @@ paths: type: string format: byte parameters: - - name: class_id + - name: address in: path required: true type: string - - name: nft_id - in: path - required: true + - name: denom + in: query + required: false type: string tags: - Query - /ununifi/ecosystemincentive/rewards/{address}: + /ununifi/nftbackedloan/bids: get: - operationId: AllRewards + operationId: NftBids responses: '200': description: A successful response. schema: type: object properties: - rewards: - type: object - properties: - address: - type: string - rewards: - type: array - items: + bids: + type: array + items: + type: object + properties: + id: + type: object + properties: + nft_id: + type: object + properties: + class_id: + type: string + token_id: + type: string + bidder: + type: string + price: type: object properties: denom: @@ -5346,59 +5321,69 @@ paths: custom method signatures required by gogoproto. - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: + deposit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + paid_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + expiry: type: string - value: + format: date-time + interest_rate: type: string - format: byte - parameters: - - name: address - in: path - required: true - type: string - tags: - - Query - /ununifi/ecosystemincentive/rewards/{address}/{denom}: - get: - operationId: Reward - responses: - '200': - description: A successful response. - schema: - type: object - properties: - reward: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. + automatic_payment: + type: boolean + created_at: + type: string + format: date-time + loan: + title: borrow info + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - NOTE: The amount field is an Int which implements the custom - method + NOTE: The amount field is an Int which implements + the custom method - signatures required by gogoproto. + signatures required by gogoproto. + last_repaid_at: + type: string + format: date-time default: description: An unexpected error response. schema: @@ -5422,17 +5407,17 @@ paths: type: string format: byte parameters: - - name: address - in: path - required: true + - name: class_id + in: query + required: false type: string - - name: denom - in: path - required: true + - name: token_id + in: query + required: false type: string tags: - Query - /ununifi/nftbackedloan/bidder-bids/{bidder}: + /ununifi/nftbackedloan/bids/{bidder}: get: operationId: BidderBids responses: @@ -5454,7 +5439,7 @@ paths: properties: class_id: type: string - nft_id: + token_id: type: string bidder: type: string @@ -5513,7 +5498,7 @@ paths: created_at: type: string format: date-time - borrow: + loan: title: borrow info type: object properties: @@ -5565,7 +5550,7 @@ paths: type: string tags: - Query - /ununifi/nftbackedloan/liquidation/{class_id}/{nft_id}: + /ununifi/nftbackedloan/liquidation: get: operationId: Liquidation responses: @@ -5647,50 +5632,55 @@ paths: format: byte parameters: - name: class_id - in: path - required: true + in: query + required: false type: string - - name: nft_id - in: path - required: true + - name: token_id + in: query + required: false type: string tags: - Query - /ununifi/nftbackedloan/listed-class/{class_id}/{nft_limit}: + /ununifi/nftbackedloan/listed-classes: get: - operationId: ListedClass + operationId: ListedClasses responses: '200': description: A successful response. schema: type: object properties: - class_id: - type: string - name: - type: string - description: - type: string - symbol: - type: string - uri: - type: string - urihash: - type: string - nfts: + classes: type: array items: type: object properties: - id: + class_id: type: string - uri: + name: type: string - uri_hash: + description: type: string - nft_count: - type: string - format: uint64 + symbol: + type: string + uri: + type: string + urihash: + type: string + nfts: + type: array + items: + type: object + properties: + id: + type: string + uri: + type: string + uri_hash: + type: string + nft_count: + type: string + format: uint64 default: description: An unexpected error response. schema: @@ -5714,57 +5704,48 @@ paths: type: string format: byte parameters: - - name: class_id - in: path - required: true - type: string - name: nft_limit - in: path - required: true + in: query + required: false type: integer format: int32 tags: - Query - /ununifi/nftbackedloan/listed-classes: + /ununifi/nftbackedloan/listed-classes/class: get: - operationId: ListedClasses + operationId: ListedClass responses: '200': description: A successful response. schema: type: object properties: - classes: + class_id: + type: string + name: + type: string + description: + type: string + symbol: + type: string + uri: + type: string + urihash: + type: string + nfts: type: array items: type: object properties: - class_id: - type: string - name: - type: string - description: - type: string - symbol: + id: type: string uri: type: string - urihash: - type: string - nfts: - type: array - items: - type: object - properties: - id: - type: string - uri: - type: string - uri_hash: - type: string - nft_count: + uri_hash: type: string - format: uint64 + nft_count: + type: string + format: uint64 default: description: An unexpected error response. schema: @@ -5788,6 +5769,10 @@ paths: type: string format: byte parameters: + - name: class_id + in: query + required: false + type: string - name: nft_limit in: query required: false @@ -5817,7 +5802,7 @@ paths: properties: class_id: type: string - nft_id: + token_id: type: string owner: type: string @@ -5833,7 +5818,9 @@ paths: default: UNKNOWN bid_denom: type: string - minimum_deposit_rate: + min_deposit_rate: + type: string + min_bid_period: type: string started_at: type: string @@ -5865,8 +5852,6 @@ paths: signatures required by gogoproto. collected_amount_negative: type: boolean - minimum_bidding_period: - type: string nft_info: type: object properties: @@ -5905,7 +5890,106 @@ paths: type: string tags: - Query - /ununifi/nftbackedloan/loans/{class_id}/{nft_id}: + /ununifi/nftbackedloan/listed-nfts/nft: + get: + operationId: ListedNft + responses: + '200': + description: A successful response. + schema: + type: object + properties: + listing: + type: object + properties: + nft_id: + type: object + properties: + class_id: + type: string + token_id: + type: string + owner: + type: string + state: + type: string + enum: + - UNKNOWN + - LISTING + - BIDDING + - SELLING_DECISION + - LIQUIDATION + - SUCCESSFUL_BID + default: UNKNOWN + bid_denom: + type: string + min_deposit_rate: + type: string + min_bid_period: + type: string + started_at: + type: string + format: date-time + liquidated_at: + type: string + format: date-time + full_payment_end_at: + type: string + format: date-time + successful_bid_end_at: + type: string + format: date-time + collected_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + collected_amount_negative: + type: boolean + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: class_id + in: query + required: false + type: string + - name: token_id + in: query + required: false + type: string + tags: + - Query + /ununifi/nftbackedloan/loans: get: operationId: Loan responses: @@ -5919,7 +6003,7 @@ paths: properties: class_id: type: string - nft_id: + token_id: type: string borrowing_amount: type: object @@ -5990,297 +6074,60 @@ paths: format: byte parameters: - name: class_id - in: path - required: true + in: query + required: false type: string - - name: nft_id - in: path - required: true + - name: token_id + in: query + required: false type: string tags: - Query - /ununifi/nftbackedloan/nft-bids/{class_id}/{nft_id}: + /ununifi/nftbackedloan/params: get: - operationId: NftBids + operationId: NftBackedLoanParams responses: '200': description: A successful response. schema: type: object properties: - bids: - type: array - items: - type: object - properties: - id: - type: object - properties: - nft_id: - type: object - properties: - class_id: - type: string - nft_id: - type: string - bidder: - type: string - price: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - deposit: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - paid_amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - expiry: - type: string - format: date-time - interest_rate: - type: string - automatic_payment: - type: boolean - created_at: - type: string - format: date-time - borrow: - title: borrow info - type: object - properties: - amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an - amount. - - - NOTE: The amount field is an Int which implements - the custom method - - signatures required by gogoproto. - last_repaid_at: - type: string - format: date-time - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: class_id - in: path - required: true - type: string - - name: nft_id - in: path - required: true - type: string - tags: - - Query - /ununifi/nftbackedloan/nft-listing/{class_id}/{nft_id}: - get: - operationId: NftListing - responses: - '200': - description: A successful response. - schema: - type: object - properties: - listing: - type: object - properties: - nft_id: - type: object - properties: - class_id: - type: string - nft_id: - type: string - owner: - type: string - state: - type: string - enum: - - UNKNOWN - - LISTING - - BIDDING - - SELLING_DECISION - - LIQUIDATION - - SUCCESSFUL_BID - default: UNKNOWN - bid_denom: - type: string - minimum_deposit_rate: - type: string - started_at: - type: string - format: date-time - liquidated_at: - type: string - format: date-time - full_payment_end_at: - type: string - format: date-time - successful_bid_end_at: - type: string - format: date-time - collected_amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the - custom method - - signatures required by gogoproto. - collected_amount_negative: - type: boolean - minimum_bidding_period: - type: string - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: class_id - in: path - required: true - type: string - - name: nft_id - in: path - required: true - type: string - tags: - - Query - /ununifi/nftbackedloan/params: - get: - operationId: NftBackedLoanParams - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: object - properties: - min_staking_for_listing: - type: string - bid_tokens: - type: array - items: - type: string - nft_listing_cancel_required_seconds: - type: string - format: uint64 - bid_cancel_required_seconds: - type: string - format: uint64 - nft_listing_full_payment_period: - type: string - format: uint64 - nft_listing_nft_delivery_period: - type: string - format: uint64 - nft_listing_commission_fee: - type: string - format: uint64 - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: + params: + type: object + properties: + min_staking_for_listing: + type: string + bid_tokens: + type: array + items: + type: string + nft_listing_cancel_required_seconds: + type: string + format: uint64 + bid_cancel_required_seconds: + type: string + format: uint64 + nft_listing_full_payment_period: + type: string + format: uint64 + nft_listing_nft_delivery_period: + type: string + format: uint64 + nft_listing_commission_rate: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: type: array items: type: object @@ -6348,127 +6195,29 @@ paths: format: uint64 tags: - Query - /ununifi/nftfactory/class_ids_by_name/{class_name}: + /ununifi/nftfactory/class/factory/{creator}/{subclass}/authority-metadata: get: - operationId: ClassIdsByName + operationId: ClassAuthorityMetadata responses: '200': description: A successful response. schema: type: object properties: - class_name_id_list: + authority_metadata: type: object properties: - class_name: + Admin: type: string - class_id: - type: array - items: - type: string - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: class_name - in: path - required: true - type: string - tags: - - Query - /ununifi/nftfactory/class_ids_by_owner/{owner}: - get: - operationId: ClassIdsByOwner - responses: - '200': - description: A successful response. - schema: - type: object - properties: - owning_class_id_list: - type: object - properties: - owner: - type: string - class_id: - type: array - items: - type: string - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: owner - in: path - required: true - type: string - tags: - - Query - /ununifi/nftfactory/class_owner/{class_id}: - get: - operationId: ClassAttributes - responses: - '200': - description: A successful response. - schema: - type: object - properties: - class_attributes: - type: object - properties: - class_id: - type: string - owner: - type: string - base_token_uri: - type: string - minting_permission: - type: string - enum: - - OnlyOwner - - Anyone - default: OnlyOwner - token_supply_cap: - type: string - format: uint64 + title: Can be empty for no admin, or a valid address + description: >- + ClassAuthorityMetadata specifies metadata for addresses that + have specific + + capabilities over a nft factory class. Right now there is only + one Admin + + permission, but is planned to be extended to the future. default: description: An unexpected error response. schema: @@ -6492,23 +6241,29 @@ paths: type: string format: byte parameters: - - name: class_id + - name: creator + in: path + required: true + type: string + - name: subclass in: path required: true type: string tags: - Query - /ununifi/nftfactory/nft_minter/{class_id}/{nft_id}: + /ununifi/nftfactory/classes-from-creator/{creator}: get: - operationId: NFTMinter + operationId: ClassesFromCreator responses: '200': description: A successful response. schema: type: object properties: - minter: - type: string + classes: + type: array + items: + type: string default: description: An unexpected error response. schema: @@ -6532,11 +6287,7 @@ paths: type: string format: byte parameters: - - name: class_id - in: path - required: true - type: string - - name: nft_id + - name: creator in: path required: true type: string @@ -6552,29 +6303,37 @@ paths: type: object properties: params: + description: params defines the parameters of the module. type: object properties: - MaxNFTSupplyCap: - type: string - format: uint64 - MinClassNameLen: - type: string - format: uint64 - MaxClassNameLen: - type: string - format: uint64 - MinUriLen: - type: string - format: uint64 - MaxUriLen: - type: string - format: uint64 - MaxSymbolLen: - type: string - format: uint64 - MaxDescriptionLen: + class_creation_fee: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. + title: >- + ClassCreationFee is the fee required to create a new denom + using the nftfactory module + fee_collector_address: type: string - format: uint64 + title: >- + FeeCollectorAddress is the address where fees collected + from denom creation are sent to + description: >- + QueryParamsResponse is the response type for the Query/Params RPC + method. default: description: An unexpected error response. schema: @@ -7209,6 +6968,10 @@ paths: properties: commission_rate: type: string + title: |- + TODO: add deposit_commission_rate + TODO: add reserve_annual_commission_rate + TODO: rename to withdraw_commission_rate vault_creation_fee: type: object properties: @@ -7239,6 +7002,8 @@ paths: custom method signatures required by gogoproto. + fee_collector_address: + type: string description: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -7280,16 +7045,27 @@ paths: items: type: object properties: - denom: - type: string - id: - type: string - format: uint64 - contract_address: + strategy: + type: object + properties: + denom: + type: string + id: + type: string + format: uint64 + contract_address: + type: string + name: + type: string + description: + type: string + git_url: + type: string + deposit_fee_rate: type: string - name: + withdraw_fee_rate: type: string - git_url: + performance_fee_rate: type: string pagination: type: object @@ -7405,16 +7181,27 @@ paths: strategy: type: object properties: - denom: - type: string - id: - type: string - format: uint64 - contract_address: + strategy: + type: object + properties: + denom: + type: string + id: + type: string + format: uint64 + contract_address: + type: string + name: + type: string + description: + type: string + git_url: + type: string + deposit_fee_rate: type: string - name: + withdraw_fee_rate: type: string - git_url: + performance_fee_rate: type: string default: description: An unexpected error response. @@ -7465,42 +7252,58 @@ paths: items: type: object properties: - id: - type: string - format: uint64 - denom: - type: string - owner: - type: string - owner_deposit: + vault: type: object properties: + id: + type: string + format: uint64 denom: type: string - amount: + name: type: string - description: >- - Coin defines a token with a denomination and an amount. + description: + type: string + owner: + type: string + owner_deposit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. - NOTE: The amount field is an Int which implements the - custom method + NOTE: The amount field is an Int which implements + the custom method - signatures required by gogoproto. - withdraw_commission_rate: + signatures required by gogoproto. + withdraw_commission_rate: + type: string + withdraw_reserve_rate: + type: string + strategy_weights: + type: array + items: + type: object + properties: + strategy_id: + type: string + format: uint64 + weight: + type: string + fee_collector_address: + type: string + total_bonded_amount: type: string - withdraw_reserve_rate: + total_unbonding_amount: + type: string + withdraw_reserve: type: string - strategy_weights: - type: array - items: - type: object - properties: - strategy_id: - type: string - format: uint64 - weight: - type: string pagination: type: object properties: @@ -7599,6 +7402,101 @@ paths: type: boolean tags: - Query + /ununifi/yieldaggregator/vaults/share-holders/{share_holder}: + get: + operationId: VaultAllByShareHolder + responses: + '200': + description: A successful response. + schema: + type: object + properties: + vaults: + type: array + items: + type: object + properties: + vault: + type: object + properties: + id: + type: string + format: uint64 + denom: + type: string + name: + type: string + description: + type: string + owner: + type: string + owner_deposit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements + the custom method + + signatures required by gogoproto. + withdraw_commission_rate: + type: string + withdraw_reserve_rate: + type: string + strategy_weights: + type: array + items: + type: object + properties: + strategy_id: + type: string + format: uint64 + weight: + type: string + fee_collector_address: + type: string + total_bonded_amount: + type: string + total_unbonding_amount: + type: string + withdraw_reserve: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: share_holder + in: path + required: true + type: string + tags: + - Query /ununifi/yieldaggregator/vaults/{id}: get: operationId: Vault @@ -7616,6 +7514,10 @@ paths: format: uint64 denom: type: string + name: + type: string + description: + type: string owner: type: string owner_deposit: @@ -7647,6 +7549,14 @@ paths: format: uint64 weight: type: string + fee_collector_address: + type: string + total_bonded_amount: + type: string + total_unbonding_amount: + type: string + withdraw_reserve: + type: string strategies: type: array items: @@ -7661,16 +7571,10 @@ paths: type: string name: type: string + description: + type: string git_url: type: string - vault_address: - type: string - total_bonded_amount: - type: string - total_unbonding_amount: - type: string - total_withdrawal_balance: - type: string default: description: An unexpected error response. schema: @@ -7768,6 +7672,36 @@ paths: schema: type: object properties: + share_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + fee: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. redeem_amount: type: object properties: @@ -7779,6 +7713,21 @@ paths: Coin defines a token with a denomination and an amount. + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + total_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method @@ -10073,38 +10022,23 @@ definitions: the combined those rates for the incentive cannot be exceed 1 description: Params defines the parameters for the module. - ununifi.ecosystemincentive.QueryAllRewardsResponse: + ununifi.ecosystemincentive.QueryEcosystemRewardsResponse: type: object properties: rewards: - type: object - properties: - address: - type: string - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - ununifi.ecosystemincentive.QueryBelongingRecipientContainerIdsByAddrResponse: - type: object - properties: - recipient_container_ids: type: array items: - type: string + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. ununifi.ecosystemincentive.QueryParamsResponse: type: object properties: @@ -10159,57 +10093,11 @@ definitions: incentive, the combined those rates for the incentive cannot be exceed 1 - ununifi.ecosystemincentive.QueryRecipientContainerResponse: - type: object - properties: - recipient_container: - type: object - properties: - id: - type: string - weighted_addresses: - type: array - items: - type: object - properties: - address: - type: string - weight: - type: string - ununifi.ecosystemincentive.QueryRecordedRecipientContainerIdResponse: - type: object - properties: - recipient_container_id: - type: string - ununifi.ecosystemincentive.QueryRewardResponse: - type: object - properties: - reward: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - ununifi.ecosystemincentive.RecipientContainer: + ununifi.ecosystemincentive.QueryRecipientAddressWithNftIdResponse: type: object properties: - id: + address: type: string - weighted_addresses: - type: array - items: - type: object - properties: - address: - type: string - weight: - type: string ununifi.ecosystemincentive.RewardParams: type: object properties: @@ -10222,203 +10110,72 @@ definitions: properties: reward_type: type: string - enum: - - UNKNOWN - - STAKERS - - FRONTEND_DEVELOPERS - - COMMUNITY_POOL - default: UNKNOWN - description: >- - STAKERS type reward will be distributed for the stakers of GUU - token. - - FRONTEND_DEVELOPERS type reward will be disributed for the - creators of frontend of UnUniFi's services. - - COMMUNITY_POOL type reward will be distributed for the community - pool. - rate: - type: string - title: >- - RewardRate defines the ratio to take reward for a specific - reward_type. - - The total sum of reward_rate in a module cannot be exceed 1 - title: |- - RewardParams defines which module have which rewards type and rate - to maintain the correctness of the fee rate in a module - e.g. if nftbackedloan module have "Frontend" and "Collection" incentive, - the combined those rates for the incentive cannot be exceed 1 - ununifi.ecosystemincentive.RewardRate: - type: object - properties: - reward_type: - type: string - enum: - - UNKNOWN - - STAKERS - - FRONTEND_DEVELOPERS - - COMMUNITY_POOL - default: UNKNOWN - description: >- - STAKERS type reward will be distributed for the stakers of GUU token. - - FRONTEND_DEVELOPERS type reward will be disributed for the creators of - frontend of UnUniFi's services. - - COMMUNITY_POOL type reward will be distributed for the community pool. - rate: - type: string - title: |- - RewardRate defines the ratio to take reward for a specific reward_type. - The total sum of reward_rate in a module cannot be exceed 1 - ununifi.ecosystemincentive.RewardStore: - type: object - properties: - address: - type: string - rewards: - type: array - items: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - ununifi.ecosystemincentive.RewardType: - type: string - enum: - - UNKNOWN - - STAKERS - - FRONTEND_DEVELOPERS - - COMMUNITY_POOL - default: UNKNOWN - description: >- - STAKERS type reward will be distributed for the stakers of GUU token. - - FRONTEND_DEVELOPERS type reward will be disributed for the creators of - frontend of UnUniFi's services. - - COMMUNITY_POOL type reward will be distributed for the community pool. - ununifi.ecosystemincentive.WeightedAddress: - type: object - properties: - address: - type: string - weight: - type: string - ununifi.nftbackedloan.BidId: - type: object - properties: - nft_id: - type: object - properties: - class_id: - type: string - nft_id: - type: string - bidder: - type: string - ununifi.nftbackedloan.Borrowing: - type: object - properties: - amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - last_repaid_at: - type: string - format: date-time - ununifi.nftbackedloan.Liquidation: - type: object - properties: - amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: |- - Coin defines a token with a denomination and an amount. - - NOTE: The amount field is an Int which implements the custom method - signatures required by gogoproto. - liquidation_date: - type: string - format: date-time - ununifi.nftbackedloan.Liquidations: - type: object - properties: - liquidation: - type: object - properties: - amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - liquidation_date: - type: string - format: date-time - next_liquidation: - type: array - items: - type: object - properties: - amount: - type: object - properties: - denom: - type: string - amount: - type: string + enum: + - UNKNOWN + - STAKERS + - FRONTEND_DEVELOPERS + - COMMUNITY_POOL + default: UNKNOWN description: >- - Coin defines a token with a denomination and an amount. - + STAKERS type reward will be distributed for the stakers of GUU + token. - NOTE: The amount field is an Int which implements the custom - method + FRONTEND_DEVELOPERS type reward will be disributed for the + creators of frontend of UnUniFi's services. - signatures required by gogoproto. - liquidation_date: + COMMUNITY_POOL type reward will be distributed for the community + pool. + rate: type: string - format: date-time - ununifi.nftbackedloan.ListingState: + title: >- + RewardRate defines the ratio to take reward for a specific + reward_type. + + The total sum of reward_rate in a module cannot be exceed 1 + title: |- + RewardParams defines which module have which rewards type and rate + to maintain the correctness of the fee rate in a module + e.g. if nftbackedloan module have "Frontend" and "Collection" incentive, + the combined those rates for the incentive cannot be exceed 1 + ununifi.ecosystemincentive.RewardRate: + type: object + properties: + reward_type: + type: string + enum: + - UNKNOWN + - STAKERS + - FRONTEND_DEVELOPERS + - COMMUNITY_POOL + default: UNKNOWN + description: >- + STAKERS type reward will be distributed for the stakers of GUU token. + + FRONTEND_DEVELOPERS type reward will be disributed for the creators of + frontend of UnUniFi's services. + + COMMUNITY_POOL type reward will be distributed for the community pool. + rate: + type: string + title: |- + RewardRate defines the ratio to take reward for a specific reward_type. + The total sum of reward_rate in a module cannot be exceed 1 + ununifi.ecosystemincentive.RewardType: type: string enum: - UNKNOWN - - LISTING - - BIDDING - - SELLING_DECISION - - LIQUIDATION - - SUCCESSFUL_BID + - STAKERS + - FRONTEND_DEVELOPERS + - COMMUNITY_POOL default: UNKNOWN - ununifi.nftbackedloan.NftBid: + description: >- + STAKERS type reward will be distributed for the stakers of GUU token. + + FRONTEND_DEVELOPERS type reward will be disributed for the creators of + frontend of UnUniFi's services. + + COMMUNITY_POOL type reward will be distributed for the community pool. + ununifi.nftbackedloan.Bid: type: object properties: id: @@ -10429,7 +10186,7 @@ definitions: properties: class_id: type: string - nft_id: + token_id: type: string bidder: type: string @@ -10479,7 +10236,7 @@ definitions: created_at: type: string format: date-time - borrow: + loan: title: borrow info type: object properties: @@ -10501,23 +10258,7 @@ definitions: last_repaid_at: type: string format: date-time - ununifi.nftbackedloan.NftIdentifier: - type: object - properties: - class_id: - type: string - nft_id: - type: string - ununifi.nftbackedloan.NftInfo: - type: object - properties: - id: - type: string - uri: - type: string - uri_hash: - type: string - ununifi.nftbackedloan.NftListing: + ununifi.nftbackedloan.BidId: type: object properties: nft_id: @@ -10525,37 +10266,14 @@ definitions: properties: class_id: type: string - nft_id: + token_id: type: string - owner: - type: string - state: - type: string - enum: - - UNKNOWN - - LISTING - - BIDDING - - SELLING_DECISION - - LIQUIDATION - - SUCCESSFUL_BID - default: UNKNOWN - bid_denom: - type: string - minimum_deposit_rate: - type: string - started_at: - type: string - format: date-time - liquidated_at: - type: string - format: date-time - full_payment_end_at: - type: string - format: date-time - successful_bid_end_at: + bidder: type: string - format: date-time - collected_amount: + ununifi.nftbackedloan.Liquidation: + type: object + properties: + amount: type: object properties: denom: @@ -10567,11 +10285,57 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - collected_amount_negative: - type: boolean - minimum_bidding_period: + liquidation_date: type: string - ununifi.nftbackedloan.NftListingDetail: + format: date-time + ununifi.nftbackedloan.Liquidations: + type: object + properties: + liquidation: + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + liquidation_date: + type: string + format: date-time + next_liquidation: + type: array + items: + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + liquidation_date: + type: string + format: date-time + ununifi.nftbackedloan.ListedNftDetail: type: object properties: listing: @@ -10582,7 +10346,7 @@ definitions: properties: class_id: type: string - nft_id: + token_id: type: string owner: type: string @@ -10598,7 +10362,9 @@ definitions: default: UNKNOWN bid_denom: type: string - minimum_deposit_rate: + min_deposit_rate: + type: string + min_bid_period: type: string started_at: type: string @@ -10629,8 +10395,6 @@ definitions: signatures required by gogoproto. collected_amount_negative: type: boolean - minimum_bidding_period: - type: string nft_info: type: object properties: @@ -10640,6 +10404,104 @@ definitions: type: string uri_hash: type: string + ununifi.nftbackedloan.Listing: + type: object + properties: + nft_id: + type: object + properties: + class_id: + type: string + token_id: + type: string + owner: + type: string + state: + type: string + enum: + - UNKNOWN + - LISTING + - BIDDING + - SELLING_DECISION + - LIQUIDATION + - SUCCESSFUL_BID + default: UNKNOWN + bid_denom: + type: string + min_deposit_rate: + type: string + min_bid_period: + type: string + started_at: + type: string + format: date-time + liquidated_at: + type: string + format: date-time + full_payment_end_at: + type: string + format: date-time + successful_bid_end_at: + type: string + format: date-time + collected_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + collected_amount_negative: + type: boolean + ununifi.nftbackedloan.ListingState: + type: string + enum: + - UNKNOWN + - LISTING + - BIDDING + - SELLING_DECISION + - LIQUIDATION + - SUCCESSFUL_BID + default: UNKNOWN + ununifi.nftbackedloan.Loan: + type: object + properties: + amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + last_repaid_at: + type: string + format: date-time + ununifi.nftbackedloan.NftId: + type: object + properties: + class_id: + type: string + token_id: + type: string + ununifi.nftbackedloan.NftInfo: + type: object + properties: + id: + type: string + uri: + type: string + uri_hash: + type: string ununifi.nftbackedloan.Params: type: object properties: @@ -10661,9 +10523,8 @@ definitions: nft_listing_nft_delivery_period: type: string format: uint64 - nft_listing_commission_fee: + nft_listing_commission_rate: type: string - format: uint64 ununifi.nftbackedloan.QueryBidderBidsResponse: type: object properties: @@ -10680,7 +10541,7 @@ definitions: properties: class_id: type: string - nft_id: + token_id: type: string bidder: type: string @@ -10739,7 +10600,7 @@ definitions: created_at: type: string format: date-time - borrow: + loan: title: borrow info type: object properties: @@ -10874,6 +10735,66 @@ definitions: nft_count: type: string format: uint64 + ununifi.nftbackedloan.QueryListedNftResponse: + type: object + properties: + listing: + type: object + properties: + nft_id: + type: object + properties: + class_id: + type: string + token_id: + type: string + owner: + type: string + state: + type: string + enum: + - UNKNOWN + - LISTING + - BIDDING + - SELLING_DECISION + - LIQUIDATION + - SUCCESSFUL_BID + default: UNKNOWN + bid_denom: + type: string + min_deposit_rate: + type: string + min_bid_period: + type: string + started_at: + type: string + format: date-time + liquidated_at: + type: string + format: date-time + full_payment_end_at: + type: string + format: date-time + successful_bid_end_at: + type: string + format: date-time + collected_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + collected_amount_negative: + type: boolean ununifi.nftbackedloan.QueryListedNftsResponse: type: object properties: @@ -10890,7 +10811,7 @@ definitions: properties: class_id: type: string - nft_id: + token_id: type: string owner: type: string @@ -10906,7 +10827,9 @@ definitions: default: UNKNOWN bid_denom: type: string - minimum_deposit_rate: + min_deposit_rate: + type: string + min_bid_period: type: string started_at: type: string @@ -10937,8 +10860,6 @@ definitions: signatures required by gogoproto. collected_amount_negative: type: boolean - minimum_bidding_period: - type: string nft_info: type: object properties: @@ -10956,7 +10877,7 @@ definitions: properties: class_id: type: string - nft_id: + token_id: type: string borrowing_amount: type: object @@ -11010,7 +10931,7 @@ definitions: properties: class_id: type: string - nft_id: + token_id: type: string bidder: type: string @@ -11069,7 +10990,7 @@ definitions: created_at: type: string format: date-time - borrow: + loan: title: borrow info type: object properties: @@ -11091,66 +11012,6 @@ definitions: last_repaid_at: type: string format: date-time - ununifi.nftbackedloan.QueryNftListingResponse: - type: object - properties: - listing: - type: object - properties: - nft_id: - type: object - properties: - class_id: - type: string - nft_id: - type: string - owner: - type: string - state: - type: string - enum: - - UNKNOWN - - LISTING - - BIDDING - - SELLING_DECISION - - LIQUIDATION - - SUCCESSFUL_BID - default: UNKNOWN - bid_denom: - type: string - minimum_deposit_rate: - type: string - started_at: - type: string - format: date-time - liquidated_at: - type: string - format: date-time - full_payment_end_at: - type: string - format: date-time - successful_bid_end_at: - type: string - format: date-time - collected_amount: - type: object - properties: - denom: - type: string - amount: - type: string - description: >- - Coin defines a token with a denomination and an amount. - - - NOTE: The amount field is an Int which implements the custom - method - - signatures required by gogoproto. - collected_amount_negative: - type: boolean - minimum_bidding_period: - type: string ununifi.nftbackedloan.QueryParamsResponse: type: object properties: @@ -11175,9 +11036,8 @@ definitions: nft_listing_nft_delivery_period: type: string format: uint64 - nft_listing_commission_fee: + nft_listing_commission_rate: type: string - format: uint64 ununifi.nftbackedloan.QueryRewardsResponse: type: object properties: @@ -11195,149 +11055,98 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - ununifi.nftfactory.ClassAttributes: - type: object - properties: - class_id: - type: string - owner: - type: string - base_token_uri: - type: string - minting_permission: - type: string - enum: - - OnlyOwner - - Anyone - default: OnlyOwner - token_supply_cap: - type: string - format: uint64 - ununifi.nftfactory.ClassNameIdList: + ununifi.nftfactory.ClassAuthorityMetadata: type: object properties: - class_name: + Admin: type: string - class_id: - type: array - items: - type: string - ununifi.nftfactory.MintingPermission: - type: string - enum: - - OnlyOwner - - Anyone - default: OnlyOwner - ununifi.nftfactory.OwningClassIdList: + title: Can be empty for no admin, or a valid address + description: |- + ClassAuthorityMetadata specifies metadata for addresses that have specific + capabilities over a nft factory class. Right now there is only one Admin + permission, but is planned to be extended to the future. + ununifi.nftfactory.Params: type: object properties: - owner: - type: string - class_id: + class_creation_fee: type: array items: - type: string - ununifi.nftfactory.Params: - type: object - properties: - MaxNFTSupplyCap: - type: string - format: uint64 - MinClassNameLen: - type: string - format: uint64 - MaxClassNameLen: - type: string - format: uint64 - MinUriLen: - type: string - format: uint64 - MaxUriLen: - type: string - format: uint64 - MaxSymbolLen: - type: string - format: uint64 - MaxDescriptionLen: - type: string - format: uint64 - ununifi.nftfactory.QueryClassAttributesResponse: - type: object - properties: - class_attributes: - type: object - properties: - class_id: - type: string - owner: - type: string - base_token_uri: - type: string - minting_permission: - type: string - enum: - - OnlyOwner - - Anyone - default: OnlyOwner - token_supply_cap: - type: string - format: uint64 - ununifi.nftfactory.QueryClassIdsByNameResponse: - type: object - properties: - class_name_id_list: - type: object - properties: - class_name: - type: string - class_id: - type: array - items: + type: object + properties: + denom: + type: string + amount: type: string - ununifi.nftfactory.QueryClassIdsByOwnerResponse: + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + title: >- + ClassCreationFee is the fee required to create a new denom using the + nftfactory module + fee_collector_address: + type: string + title: >- + FeeCollectorAddress is the address where fees collected from denom + creation are sent to + ununifi.nftfactory.QueryClassAuthorityMetadataResponse: type: object properties: - owning_class_id_list: + authority_metadata: type: object properties: - owner: + Admin: type: string - class_id: - type: array - items: - type: string - ununifi.nftfactory.QueryNFTMinterResponse: + title: Can be empty for no admin, or a valid address + description: >- + ClassAuthorityMetadata specifies metadata for addresses that have + specific + + capabilities over a nft factory class. Right now there is only one + Admin + + permission, but is planned to be extended to the future. + ununifi.nftfactory.QueryClassesFromCreatorResponse: type: object properties: - minter: - type: string + classes: + type: array + items: + type: string ununifi.nftfactory.QueryParamsResponse: type: object properties: params: + description: params defines the parameters of the module. type: object properties: - MaxNFTSupplyCap: - type: string - format: uint64 - MinClassNameLen: - type: string - format: uint64 - MaxClassNameLen: - type: string - format: uint64 - MinUriLen: - type: string - format: uint64 - MaxUriLen: - type: string - format: uint64 - MaxSymbolLen: - type: string - format: uint64 - MaxDescriptionLen: + class_creation_fee: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: >- + ClassCreationFee is the fee required to create a new denom using + the nftfactory module + fee_collector_address: type: string - format: uint64 + title: >- + FeeCollectorAddress is the address where fees collected from denom + creation are sent to + description: QueryParamsResponse is the response type for the Query/Params RPC method. ununifi.pricefeed.CurrentPrice: type: object properties: @@ -11613,6 +11422,10 @@ definitions: properties: commission_rate: type: string + title: |- + TODO: add deposit_commission_rate + TODO: add reserve_annual_commission_rate + TODO: rename to withdraw_commission_rate vault_creation_fee: type: object properties: @@ -11637,25 +11450,37 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. - description: Params defines the parameters for the module. + fee_collector_address: + type: string ununifi.yieldaggregator.QueryAllStrategyResponse: type: object properties: - strategies: - type: array - items: - type: object - properties: - denom: - type: string - id: - type: string - format: uint64 - contract_address: + strategies: + type: array + items: + type: object + properties: + strategy: + type: object + properties: + denom: + type: string + id: + type: string + format: uint64 + contract_address: + type: string + name: + type: string + description: + type: string + git_url: + type: string + deposit_fee_rate: type: string - name: + withdraw_fee_rate: type: string - git_url: + performance_fee_rate: type: string pagination: type: object @@ -11682,7 +11507,7 @@ definitions: repeated Bar results = 1; PageResponse page = 2; } - ununifi.yieldaggregator.QueryAllVaultResponse: + ununifi.yieldaggregator.QueryAllVaultByShareHolderResponse: type: object properties: vaults: @@ -11690,42 +11515,116 @@ definitions: items: type: object properties: - id: + vault: + type: object + properties: + id: + type: string + format: uint64 + denom: + type: string + name: + type: string + description: + type: string + owner: + type: string + owner_deposit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + withdraw_commission_rate: + type: string + withdraw_reserve_rate: + type: string + strategy_weights: + type: array + items: + type: object + properties: + strategy_id: + type: string + format: uint64 + weight: + type: string + fee_collector_address: + type: string + total_bonded_amount: type: string - format: uint64 - denom: + total_unbonding_amount: type: string - owner: + withdraw_reserve: type: string - owner_deposit: + ununifi.yieldaggregator.QueryAllVaultResponse: + type: object + properties: + vaults: + type: array + items: + type: object + properties: + vault: type: object properties: + id: + type: string + format: uint64 denom: type: string - amount: + name: type: string - description: >- - Coin defines a token with a denomination and an amount. + description: + type: string + owner: + type: string + owner_deposit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. - NOTE: The amount field is an Int which implements the custom - method + NOTE: The amount field is an Int which implements the custom + method - signatures required by gogoproto. - withdraw_commission_rate: + signatures required by gogoproto. + withdraw_commission_rate: + type: string + withdraw_reserve_rate: + type: string + strategy_weights: + type: array + items: + type: object + properties: + strategy_id: + type: string + format: uint64 + weight: + type: string + fee_collector_address: + type: string + total_bonded_amount: type: string - withdraw_reserve_rate: + total_unbonding_amount: + type: string + withdraw_reserve: type: string - strategy_weights: - type: array - items: - type: object - properties: - strategy_id: - type: string - format: uint64 - weight: - type: string pagination: type: object properties: @@ -11769,6 +11668,30 @@ definitions: ununifi.yieldaggregator.QueryEstimateRedeemAmountResponse: type: object properties: + share_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. + fee: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. redeem_amount: type: object properties: @@ -11781,22 +11704,45 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + total_amount: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. ununifi.yieldaggregator.QueryGetStrategyResponse: type: object properties: strategy: type: object properties: - denom: - type: string - id: - type: string - format: uint64 - contract_address: + strategy: + type: object + properties: + denom: + type: string + id: + type: string + format: uint64 + contract_address: + type: string + name: + type: string + description: + type: string + git_url: + type: string + deposit_fee_rate: type: string - name: + withdraw_fee_rate: type: string - git_url: + performance_fee_rate: type: string ununifi.yieldaggregator.QueryGetVaultResponse: type: object @@ -11809,6 +11755,10 @@ definitions: format: uint64 denom: type: string + name: + type: string + description: + type: string owner: type: string owner_deposit: @@ -11840,6 +11790,14 @@ definitions: format: uint64 weight: type: string + fee_collector_address: + type: string + total_bonded_amount: + type: string + total_unbonding_amount: + type: string + withdraw_reserve: + type: string strategies: type: array items: @@ -11854,16 +11812,10 @@ definitions: type: string name: type: string + description: + type: string git_url: type: string - vault_address: - type: string - total_bonded_amount: - type: string - total_unbonding_amount: - type: string - total_withdrawal_balance: - type: string ununifi.yieldaggregator.QueryParamsResponse: type: object properties: @@ -11873,6 +11825,10 @@ definitions: properties: commission_rate: type: string + title: |- + TODO: add deposit_commission_rate + TODO: add reserve_annual_commission_rate + TODO: rename to withdraw_commission_rate vault_creation_fee: type: object properties: @@ -11903,6 +11859,8 @@ definitions: method signatures required by gogoproto. + fee_collector_address: + type: string description: QueryParamsResponse is response type for the Query/Params RPC method. ununifi.yieldaggregator.Strategy: type: object @@ -11916,8 +11874,35 @@ definitions: type: string name: type: string + description: + type: string git_url: type: string + ununifi.yieldaggregator.StrategyContainer: + type: object + properties: + strategy: + type: object + properties: + denom: + type: string + id: + type: string + format: uint64 + contract_address: + type: string + name: + type: string + description: + type: string + git_url: + type: string + deposit_fee_rate: + type: string + withdraw_fee_rate: + type: string + performance_fee_rate: + type: string ununifi.yieldaggregator.StrategyWeight: type: object properties: @@ -11934,6 +11919,10 @@ definitions: format: uint64 denom: type: string + name: + type: string + description: + type: string owner: type: string owner_deposit: @@ -11962,3 +11951,59 @@ definitions: format: uint64 weight: type: string + fee_collector_address: + type: string + ununifi.yieldaggregator.VaultContainer: + type: object + properties: + vault: + type: object + properties: + id: + type: string + format: uint64 + denom: + type: string + name: + type: string + description: + type: string + owner: + type: string + owner_deposit: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + withdraw_commission_rate: + type: string + withdraw_reserve_rate: + type: string + strategy_weights: + type: array + items: + type: object + properties: + strategy_id: + type: string + format: uint64 + weight: + type: string + fee_collector_address: + type: string + total_bonded_amount: + type: string + total_unbonding_amount: + type: string + withdraw_reserve: + type: string diff --git a/proto/ununifi/derivatives/query.proto b/proto/ununifi/derivatives/query.proto index 53e9842ab..67a0affe4 100644 --- a/proto/ununifi/derivatives/query.proto +++ b/proto/ununifi/derivatives/query.proto @@ -38,7 +38,7 @@ service Query { } rpc PerpetualFuturesMarket(QueryPerpetualFuturesMarketRequest) returns (QueryPerpetualFuturesMarketResponse) { - option (google.api.http).get = "/ununifi/derivatives/perpetual-futures/{base_denom}/{quote_denom}"; + option (google.api.http).get = "/ununifi/derivatives/perpetual-futures/market"; } rpc PerpetualOptions(QueryPerpetualOptionsRequest) returns (QueryPerpetualOptionsResponse) { @@ -46,7 +46,7 @@ service Query { } rpc PerpetualOptionsMarket(QueryPerpetualOptionsMarketRequest) returns (QueryPerpetualOptionsMarketResponse) { - option (google.api.http).get = "/ununifi/derivatives/perpetual-options/{base_denom}/{quote_denom}"; + option (google.api.http).get = "/ununifi/derivatives/perpetual-options/market"; } rpc AllPositions(QueryAllPositionsRequest) returns (QueryAllPositionsResponse) { @@ -79,17 +79,12 @@ service Query { } rpc EstimateDLPTokenAmount(QueryEstimateDLPTokenAmountRequest) returns (QueryEstimateDLPTokenAmountResponse) { - option (google.api.http).get = "/ununifi/derivatives/estimate-dlp-token-amount/{mint_denom}/{amount}"; + option (google.api.http).get = "/ununifi/derivatives/estimate-dlp-token-amount"; } rpc EstimateRedeemTokenAmount(QueryEstimateRedeemTokenAmountRequest) returns (QueryEstimateRedeemTokenAmountResponse) { - option (google.api.http).get = "/ununifi/derivatives/estimate-redeem-amount/{redeem_denom}/{lpt_amount}"; - } - - rpc AvailableAssetInPoolByDenom(QueryAvailableAssetInPoolByDenomRequest) - returns (QueryAvailableAssetInPoolByDenomResponse) { - option (google.api.http).get = "/ununifi/derivatives/pools/available-asset/{denom}"; + option (google.api.http).get = "/ununifi/derivatives/estimate-redeem-amount"; } rpc AvailableAssetsInPool(QueryAvailableAssetsInPoolRequest) returns (QueryAvailableAssetsInPoolResponse) { @@ -346,22 +341,12 @@ message QueryEstimateRedeemTokenAmountResponse { ]; } -message QueryAvailableAssetInPoolByDenomRequest { +message QueryAvailableAssetsInPoolRequest { string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; } -message QueryAvailableAssetInPoolByDenomResponse { - cosmos.base.v1beta1.Coin available_asset = 1 [ - (gogoproto.moretags) = "yaml:\"available_asset\"", - (gogoproto.nullable) = false - ]; -} - -message QueryAvailableAssetsInPoolRequest { -} - message QueryAvailableAssetsInPoolResponse { repeated cosmos.base.v1beta1.Coin available_assets = 1 [ (gogoproto.moretags) = "yaml:\"available_assets\"", diff --git a/proto/ununifi/ecosystemincentive/event.proto b/proto/ununifi/ecosystemincentive/event.proto index 93d55b88a..867df785d 100644 --- a/proto/ununifi/ecosystemincentive/event.proto +++ b/proto/ununifi/ecosystemincentive/event.proto @@ -27,24 +27,30 @@ message EventWithdrawReward { // message EventFailedParsingTxMemoData { // string class_id = 1 [(gogoproto.moretags) = "yaml:\"class_id\""]; -// string nft_id = 2 [(gogoproto.moretags) = "yaml:\"nft_id\""]; +// string token_id = 2 [(gogoproto.moretags) = "yaml:\"token_id\""]; // string memo = 3 [(gogoproto.moretags) = "yaml:\"memo\""]; // } +message EventRecordedRecipientWithNftId { + string recipient = 1 [(gogoproto.moretags) = "yaml:\"recipient\""]; + string class_id = 2 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 3 [(gogoproto.moretags) = "yaml:\"token_id\""]; +} + message EventDeletedNftIdRecordedForFrontendReward { - string recipient_container_id = 1 [(gogoproto.moretags) = "yaml:\"recipient_container_id\""]; - string class_id = 2 [(gogoproto.moretags) = "yaml:\"class_id\""]; - string token_id = 3 [(gogoproto.moretags) = "yaml:\"nft_id\""]; + string recipient = 1 [(gogoproto.moretags) = "yaml:\"recipient\""]; + string class_id = 2 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 3 [(gogoproto.moretags) = "yaml:\"token_id\""]; } message EventNotRecordedNftId { string class_id = 1 [(gogoproto.moretags) = "yaml:\"class_id\""]; - string token_id = 2 [(gogoproto.moretags) = "yaml:\"nft_id\""]; + string token_id = 2 [(gogoproto.moretags) = "yaml:\"token_id\""]; } message EventUpdatedReward { - string recipient_container_id = 1 [(gogoproto.moretags) = "yaml:\"recipient_container_id\""]; - cosmos.base.v1beta1.Coin earned_reward = 2 [ + string recipient = 1 [(gogoproto.moretags) = "yaml:\"recipient\""]; + cosmos.base.v1beta1.Coin earned_reward = 2 [ (gogoproto.moretags) = "yaml:\"earned_reward\"", (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", (gogoproto.nullable) = false @@ -63,5 +69,5 @@ message EventDistributionForStakers { message EventVersionUnmatched { uint32 unmatched_version = 1 [(gogoproto.moretags) = "yaml:\"unmatched_version\""]; string class_id = 2 [(gogoproto.moretags) = "yaml:\"class_id\""]; - string nft_id = 3 [(gogoproto.moretags) = "yaml:\"nft_id\""]; + string token_id = 3 [(gogoproto.moretags) = "yaml:\"token_id\""]; } diff --git a/proto/ununifi/ecosystemincentive/memo.proto b/proto/ununifi/ecosystemincentive/memo.proto index ab9a86301..13c988996 100644 --- a/proto/ununifi/ecosystemincentive/memo.proto +++ b/proto/ununifi/ecosystemincentive/memo.proto @@ -5,6 +5,12 @@ import "gogoproto/gogo.proto"; option go_package = "github.com/UnUniFi/chain/x/ecosystemincentive/types"; +message FrontendTxMemo { + FrontendMetadata frontend = 1 [ + (gogoproto.moretags) = "yaml:\"frontend\"" + ]; +} + message FrontendMetadata { uint32 version = 1 [ (gogoproto.moretags) = "yaml:\"version\"" diff --git a/proto/ununifi/ecosystemincentive/query.proto b/proto/ununifi/ecosystemincentive/query.proto index 467d7d7dd..826337a22 100644 --- a/proto/ununifi/ecosystemincentive/query.proto +++ b/proto/ununifi/ecosystemincentive/query.proto @@ -17,12 +17,12 @@ service Query { option (google.api.http).get = "/ununifi/ecosystemincentive/params"; } - rpc AllRewards(QueryAllRewardsRequest) returns (QueryAllRewardsResponse) { + rpc EcosystemRewards(QueryEcosystemRewardsRequest) returns (QueryEcosystemRewardsResponse) { option (google.api.http).get = "/ununifi/ecosystemincentive/rewards/{address}"; } - rpc Reward(QueryRewardRequest) returns (QueryRewardResponse) { - option (google.api.http).get = "/ununifi/ecosystemincentive/rewards/{address}/{denom}"; + rpc RecipientAddressWithNftId(QueryRecipientAddressWithNftIdRequest) returns (QueryRecipientAddressWithNftIdResponse) { + option (google.api.http).get = "/ununifi/ecosystemincentive/recipients"; } } @@ -33,23 +33,24 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.moretags) = "yaml:\"params\"", (gogoproto.nullable) = false]; } -message QueryAllRewardsRequest { +message QueryEcosystemRewardsRequest { string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; } -message QueryAllRewardsResponse { - RewardRecord reward_record = 1 [(gogoproto.moretags) = "yaml:\"reward_record\"", (gogoproto.nullable) = false]; +message QueryEcosystemRewardsResponse { + repeated cosmos.base.v1beta1.Coin rewards = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"rewards\"", + (gogoproto.nullable) = false + ]; } -message QueryRewardRequest { - string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; - string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; +message QueryRecipientAddressWithNftIdRequest { + string class_id = 1 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 2 [(gogoproto.moretags) = "yaml:\"token_id\""]; } -message QueryRewardResponse { - cosmos.base.v1beta1.Coin reward = 1 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"reward\"", - (gogoproto.nullable) = false - ]; +message QueryRecipientAddressWithNftIdResponse { + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; } diff --git a/proto/ununifi/nftbackedloan/nftbackedloan.proto b/proto/ununifi/nftbackedloan/nftbackedloan.proto index f174db362..49804dec9 100644 --- a/proto/ununifi/nftbackedloan/nftbackedloan.proto +++ b/proto/ununifi/nftbackedloan/nftbackedloan.proto @@ -29,8 +29,8 @@ message BidId { } message ListedClass { - string class_id = 1; - repeated string nft_ids = 2; + string class_id = 1; + repeated string token_ids = 2; } message NftInfo { diff --git a/proto/ununifi/nftbackedloan/query.proto b/proto/ununifi/nftbackedloan/query.proto index 9cfdd0554..a9d2f1197 100644 --- a/proto/ununifi/nftbackedloan/query.proto +++ b/proto/ununifi/nftbackedloan/query.proto @@ -17,42 +17,34 @@ service Query { rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/ununifi/nftbackedloan/params"; } - rpc NftListing(QueryNftListingRequest) returns (QueryNftListingResponse) { - option (google.api.http).get = "/ununifi/nftbackedloan/nft-listing/{class_id}/{nft_id}"; - } rpc ListedNfts(QueryListedNftsRequest) returns (QueryListedNftsResponse) { option (google.api.http).get = "/ununifi/nftbackedloan/listed-nfts"; } + rpc ListedNft(QueryListedNftRequest) returns (QueryListedNftResponse) { + option (google.api.http).get = "/ununifi/nftbackedloan/listed-nfts/nft"; + } rpc ListedClasses(QueryListedClassesRequest) returns (QueryListedClassesResponse) { option (google.api.http).get = "/ununifi/nftbackedloan/listed-classes"; } rpc ListedClass(QueryListedClassRequest) returns (QueryListedClassResponse) { - option (google.api.http).get = "/ununifi/nftbackedloan/listed-class/{class_id}/{nft_limit}"; + option (google.api.http).get = "/ununifi/nftbackedloan/listed-classes/class"; } - // rpc Loans(QueryLoansRequest) returns (QueryLoansResponse) { - // option (google.api.http).get = "/ununifi/nftbackedloan/loans"; - // } - rpc Loan(QueryLoanRequest) returns (QueryLoanResponse) { - option (google.api.http).get = "/ununifi/nftbackedloan/loans/{class_id}/{nft_id}"; + option (google.api.http).get = "/ununifi/nftbackedloan/loans"; } rpc NftBids(QueryNftBidsRequest) returns (QueryNftBidsResponse) { - option (google.api.http).get = "/ununifi/nftbackedloan/nft-bids/{class_id}/{nft_id}"; + option (google.api.http).get = "/ununifi/nftbackedloan/bids"; } rpc BidderBids(QueryBidderBidsRequest) returns (QueryBidderBidsResponse) { - option (google.api.http).get = "/ununifi/nftbackedloan/bidder-bids/{bidder}"; + option (google.api.http).get = "/ununifi/nftbackedloan/bids/{bidder}"; } - // rpc PaymentStatus(QueryPaymentStatusRequest) returns (QueryPaymentStatusResponse) { - // option (google.api.http).get = "/ununifi/nftbackedloan/payment-status/{class_id}/{nft_id}/{bidder}"; - // } - rpc Rewards(QueryRewardsRequest) returns (QueryRewardsResponse) { option (google.api.http).get = "/ununifi/nftbackedloan/rewards/{address}"; } rpc Liquidation(QueryLiquidationRequest) returns (QueryLiquidationResponse) { - option (google.api.http).get = "/ununifi/nftbackedloan/liquidation/{class_id}/{nft_id}"; + option (google.api.http).get = "/ununifi/nftbackedloan/liquidation"; } } @@ -61,11 +53,11 @@ message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } -message QueryNftListingRequest { +message QueryListedNftRequest { string class_id = 1; - string nft_id = 2; + string token_id = 2; } -message QueryNftListingResponse { +message QueryListedNftResponse { Listing listing = 1 [(gogoproto.nullable) = false]; } @@ -83,12 +75,12 @@ message QueryListedClassRequest { int32 nft_limit = 2; } -message NftListingDetail { +message ListedNftDetail { Listing listing = 1 [(gogoproto.nullable) = false]; - NftInfo nft_info = 2 [(gogoproto.nullable) = false]; + NftInfo nft_info = 2 [(gogoproto.nullable) = false]; } message QueryListedNftsResponse { - repeated NftListingDetail listings = 1 [(gogoproto.nullable) = false]; + repeated ListedNftDetail listings = 1 [(gogoproto.nullable) = false]; } message QueryListedClassesResponse { @@ -112,7 +104,7 @@ message QueryListedClassResponse { message QueryLoanRequest { string class_id = 1; - string nft_id = 2; + string token_id = 2; } message QueryLoanResponse { @@ -124,24 +116,12 @@ message QueryLoanResponse { message QueryNftBidsRequest { string class_id = 1; - string nft_id = 2; + string token_id = 2; } message QueryNftBidsResponse { repeated Bid bids = 1 [(gogoproto.nullable) = false]; } -// message QueryPaymentStatusRequest { -// string class_id = 1; -// string nft_id = 2; -// string bidder = 3 [ -// (gogoproto.moretags) = "yaml:\"bidder\"", -// (cosmos_proto.scalar) = "github.com/UnUniFi/chain/types.StringAccAddress" -// ]; -// } -// message QueryPaymentStatusResponse { -// PaymentStatus paymentStatus = 1 [(gogoproto.nullable) = false]; -// } - message QueryBidderBidsRequest { string bidder = 1 [ (gogoproto.moretags) = "yaml:\"bidder\"", @@ -161,7 +141,7 @@ message QueryRewardsResponse { message QueryLiquidationRequest { string class_id = 1; - string nft_id = 2; + string token_id = 2; } message QueryLiquidationResponse { diff --git a/proto/ununifi/yieldaggregator/query.proto b/proto/ununifi/yieldaggregator/query.proto index 37ee1c6c2..f58c15024 100644 --- a/proto/ununifi/yieldaggregator/query.proto +++ b/proto/ununifi/yieldaggregator/query.proto @@ -175,4 +175,5 @@ message QueryEstimateRedeemAmountResponse { cosmos.base.v1beta1.Coin share_amount = 1 [(gogoproto.nullable) = false]; cosmos.base.v1beta1.Coin fee = 2 [(gogoproto.nullable) = false]; cosmos.base.v1beta1.Coin redeem_amount = 3 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin total_amount = 4 [(gogoproto.nullable) = false]; } diff --git a/x/derivatives/client/cli/query.go b/x/derivatives/client/cli/query.go index d83dd90ae..868b419f0 100644 --- a/x/derivatives/client/cli/query.go +++ b/x/derivatives/client/cli/query.go @@ -40,7 +40,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdQueryDLPTokenRate()) cmd.AddCommand(CmdQueryEstimateDLPTokenAmount()) cmd.AddCommand(CmdQueryEstimateRedeemTokenAmount()) - cmd.AddCommand(CmdQueryAvailableAssetInPoolByDenom()) cmd.AddCommand(CmdQueryAvailableAssetsInPool()) cmd.AddCommand(CmdQueryAllPendingPaymentPositions()) cmd.AddCommand(CmdQueryPendingPaymentPosition()) @@ -440,46 +439,26 @@ func CmdQueryEstimateRedeemTokenAmount() *cobra.Command { return cmd } -func CmdQueryAvailableAssetInPoolByDenom() *cobra.Command { +func CmdQueryAvailableAssetsInPool() *cobra.Command { cmd := &cobra.Command{ - Use: "available-asset [denom]", - Short: "shows the available amount of the asset", - Args: cobra.ExactArgs(1), + Use: "available-assets [denom]", + Short: "shows the available amount of assets in the pool", + Args: cobra.MinimumNArgs(0), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.AvailableAssetInPoolByDenom( - context.Background(), - &types.QueryAvailableAssetInPoolByDenomRequest{ - Denom: args[0], - }, - ) - if err != nil { - return err + var denom string + if len(args) > 1 { + denom = args[1] + } else { + denom = "" } - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func CmdQueryAvailableAssetsInPool() *cobra.Command { - cmd := &cobra.Command{ - Use: "available-assets", - Short: "shows the available amount of all assets in the pool", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.AvailableAssetsInPool( context.Background(), - &types.QueryAvailableAssetsInPoolRequest{}, + &types.QueryAvailableAssetsInPoolRequest{Denom: denom}, ) if err != nil { return err diff --git a/x/derivatives/keeper/grpc_query.go b/x/derivatives/keeper/grpc_query.go index a936b1c73..7c25b50d5 100644 --- a/x/derivatives/keeper/grpc_query.go +++ b/x/derivatives/keeper/grpc_query.go @@ -461,34 +461,25 @@ func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil } -func (k Keeper) AvailableAssetInPoolByDenom(c context.Context, req *types.QueryAvailableAssetInPoolByDenomRequest) (*types.QueryAvailableAssetInPoolByDenomResponse, error) { +func (k Keeper) AvailableAssetsInPool(c context.Context, req *types.QueryAvailableAssetsInPoolRequest) (*types.QueryAvailableAssetsInPoolResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } ctx := sdk.UnwrapSDKContext(c) - availableAsset, err := k.AvailableAssetInPool(ctx, req.Denom) + availableAssets, err := k.AllAvailableAssetsInPool(ctx) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } - return &types.QueryAvailableAssetInPoolByDenomResponse{ - AvailableAsset: availableAsset, - }, nil -} - -func (k Keeper) AvailableAssetsInPool(c context.Context, req *types.QueryAvailableAssetsInPoolRequest) (*types.QueryAvailableAssetsInPoolResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") + if req.Denom == "" { + return &types.QueryAvailableAssetsInPoolResponse{AvailableAssets: availableAssets}, nil } - ctx := sdk.UnwrapSDKContext(c) - availableAssets, err := k.AllAvailableAssetsInPool(ctx) - if err != nil { - return nil, status.Error(codes.InvalidArgument, err.Error()) + exist, asset := availableAssets.Find(req.Denom) + if !exist { + return &types.QueryAvailableAssetsInPoolResponse{AvailableAssets: sdk.Coins{sdk.NewInt64Coin(req.Denom, 0)}}, nil } - return &types.QueryAvailableAssetsInPoolResponse{ - AvailableAssets: availableAssets, - }, nil + return &types.QueryAvailableAssetsInPoolResponse{AvailableAssets: sdk.Coins{asset}}, nil } diff --git a/x/derivatives/types/query.pb.go b/x/derivatives/types/query.pb.go index cc016eeea..75dc19e29 100644 --- a/x/derivatives/types/query.pb.go +++ b/x/derivatives/types/query.pb.go @@ -1602,106 +1602,15 @@ func (m *QueryEstimateRedeemTokenAmountResponse) GetFee() types.Coin { return types.Coin{} } -type QueryAvailableAssetInPoolByDenomRequest struct { - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` -} - -func (m *QueryAvailableAssetInPoolByDenomRequest) Reset() { - *m = QueryAvailableAssetInPoolByDenomRequest{} -} -func (m *QueryAvailableAssetInPoolByDenomRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAvailableAssetInPoolByDenomRequest) ProtoMessage() {} -func (*QueryAvailableAssetInPoolByDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70653932d804dff0, []int{34} -} -func (m *QueryAvailableAssetInPoolByDenomRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAvailableAssetInPoolByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAvailableAssetInPoolByDenomRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAvailableAssetInPoolByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAvailableAssetInPoolByDenomRequest.Merge(m, src) -} -func (m *QueryAvailableAssetInPoolByDenomRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAvailableAssetInPoolByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAvailableAssetInPoolByDenomRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAvailableAssetInPoolByDenomRequest proto.InternalMessageInfo - -func (m *QueryAvailableAssetInPoolByDenomRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" -} - -type QueryAvailableAssetInPoolByDenomResponse struct { - AvailableAsset types.Coin `protobuf:"bytes,1,opt,name=available_asset,json=availableAsset,proto3" json:"available_asset" yaml:"available_asset"` -} - -func (m *QueryAvailableAssetInPoolByDenomResponse) Reset() { - *m = QueryAvailableAssetInPoolByDenomResponse{} -} -func (m *QueryAvailableAssetInPoolByDenomResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAvailableAssetInPoolByDenomResponse) ProtoMessage() {} -func (*QueryAvailableAssetInPoolByDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_70653932d804dff0, []int{35} -} -func (m *QueryAvailableAssetInPoolByDenomResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAvailableAssetInPoolByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAvailableAssetInPoolByDenomResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryAvailableAssetInPoolByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAvailableAssetInPoolByDenomResponse.Merge(m, src) -} -func (m *QueryAvailableAssetInPoolByDenomResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAvailableAssetInPoolByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAvailableAssetInPoolByDenomResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAvailableAssetInPoolByDenomResponse proto.InternalMessageInfo - -func (m *QueryAvailableAssetInPoolByDenomResponse) GetAvailableAsset() types.Coin { - if m != nil { - return m.AvailableAsset - } - return types.Coin{} -} - type QueryAvailableAssetsInPoolRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` } func (m *QueryAvailableAssetsInPoolRequest) Reset() { *m = QueryAvailableAssetsInPoolRequest{} } func (m *QueryAvailableAssetsInPoolRequest) String() string { return proto.CompactTextString(m) } func (*QueryAvailableAssetsInPoolRequest) ProtoMessage() {} func (*QueryAvailableAssetsInPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_70653932d804dff0, []int{36} + return fileDescriptor_70653932d804dff0, []int{34} } func (m *QueryAvailableAssetsInPoolRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1730,6 +1639,13 @@ func (m *QueryAvailableAssetsInPoolRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryAvailableAssetsInPoolRequest proto.InternalMessageInfo +func (m *QueryAvailableAssetsInPoolRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + type QueryAvailableAssetsInPoolResponse struct { AvailableAssets []types.Coin `protobuf:"bytes,1,rep,name=available_assets,json=availableAssets,proto3" json:"available_assets" yaml:"available_assets"` } @@ -1738,7 +1654,7 @@ func (m *QueryAvailableAssetsInPoolResponse) Reset() { *m = QueryAvailab func (m *QueryAvailableAssetsInPoolResponse) String() string { return proto.CompactTextString(m) } func (*QueryAvailableAssetsInPoolResponse) ProtoMessage() {} func (*QueryAvailableAssetsInPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_70653932d804dff0, []int{37} + return fileDescriptor_70653932d804dff0, []int{35} } func (m *QueryAvailableAssetsInPoolResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1809,8 +1725,6 @@ func init() { proto.RegisterType((*QueryEstimateDLPTokenAmountResponse)(nil), "ununifi.derivatives.QueryEstimateDLPTokenAmountResponse") proto.RegisterType((*QueryEstimateRedeemTokenAmountRequest)(nil), "ununifi.derivatives.QueryEstimateRedeemTokenAmountRequest") proto.RegisterType((*QueryEstimateRedeemTokenAmountResponse)(nil), "ununifi.derivatives.QueryEstimateRedeemTokenAmountResponse") - proto.RegisterType((*QueryAvailableAssetInPoolByDenomRequest)(nil), "ununifi.derivatives.QueryAvailableAssetInPoolByDenomRequest") - proto.RegisterType((*QueryAvailableAssetInPoolByDenomResponse)(nil), "ununifi.derivatives.QueryAvailableAssetInPoolByDenomResponse") proto.RegisterType((*QueryAvailableAssetsInPoolRequest)(nil), "ununifi.derivatives.QueryAvailableAssetsInPoolRequest") proto.RegisterType((*QueryAvailableAssetsInPoolResponse)(nil), "ununifi.derivatives.QueryAvailableAssetsInPoolResponse") } @@ -1818,155 +1732,148 @@ func init() { func init() { proto.RegisterFile("ununifi/derivatives/query.proto", fileDescriptor_70653932d804dff0) } var fileDescriptor_70653932d804dff0 = []byte{ - // 2356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xef, 0x6f, 0xdc, 0x48, - 0xf9, 0xaf, 0x9b, 0xb6, 0xdf, 0xcb, 0x24, 0x69, 0xd2, 0x69, 0x7e, 0xba, 0xed, 0x3a, 0x9d, 0x5e, - 0xd3, 0xb4, 0xd7, 0x5d, 0x5f, 0xd3, 0xaa, 0xbd, 0xcb, 0xb5, 0x3d, 0x65, 0x9b, 0x4b, 0xdb, 0x53, - 0xfb, 0xbd, 0xad, 0x69, 0x91, 0x40, 0x48, 0xc6, 0x59, 0x4f, 0xb6, 0xa6, 0x5e, 0xdb, 0xb5, 0xbd, - 0x51, 0xf7, 0xa2, 0x20, 0x84, 0x84, 0x84, 0x84, 0x38, 0x21, 0x9d, 0x00, 0xf1, 0x07, 0x1c, 0xd2, - 0x89, 0x97, 0x48, 0x20, 0x90, 0x78, 0x87, 0x50, 0x5f, 0xc1, 0x21, 0x04, 0xe2, 0x87, 0xb4, 0x82, - 0x16, 0xc4, 0x6b, 0xf6, 0x2f, 0x40, 0x9e, 0x79, 0xec, 0xb5, 0x1d, 0xaf, 0xd7, 0x1b, 0x54, 0xc1, - 0xab, 0xae, 0x67, 0x9e, 0x1f, 0x9f, 0xcf, 0xf3, 0xcc, 0x3c, 0x33, 0xcf, 0xa4, 0x48, 0x6a, 0x59, - 0x2d, 0xcb, 0xd8, 0x32, 0x64, 0x9d, 0xba, 0xc6, 0xb6, 0xe6, 0x1b, 0xdb, 0xd4, 0x93, 0x9f, 0xb6, - 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 0x8c, 0xe6, 0x88, 0x32, 0x1a, 0x7c, 0xac, 0x07, 0xbf, 0xf1, 0x35, 0x34, 0xc6, - 0x83, 0xcc, 0xd5, 0x78, 0xf0, 0x66, 0xbb, 0x1d, 0x09, 0x73, 0xb5, 0xd8, 0x24, 0x51, 0x10, 0xfb, - 0x62, 0x8a, 0xe4, 0x93, 0x11, 0x74, 0x26, 0x17, 0x15, 0xe4, 0xbc, 0x86, 0x0e, 0x3b, 0xae, 0x51, - 0xa7, 0x80, 0x68, 0x75, 0xa8, 0x10, 0x8d, 0x43, 0x95, 0x0b, 0x0c, 0x10, 0x85, 0x1b, 0xea, 0xbb, - 0x8a, 0x0e, 0xee, 0x7f, 0x15, 0x7d, 0x65, 0xcf, 0x2a, 0xe2, 0x49, 0xbd, 0xf5, 0x0a, 0x56, 0x50, - 0x73, 0xef, 0x0a, 0x3a, 0xc4, 0x9c, 0xad, 0xbf, 0x92, 0xd5, 0xb3, 0x67, 0xd7, 0x7e, 0xe0, 0xb0, - 0x89, 0x70, 0xd7, 0x4a, 0xe9, 0x4d, 0x1b, 0xcd, 0xf3, 0x04, 0x66, 0x2c, 0x3f, 0x90, 0xf8, 0xaf, - 0x2e, 0xbf, 0xb3, 0xe9, 0xd5, 0x97, 0x02, 0x05, 0xe0, 0x37, 0xd1, 0x3c, 0x13, 0x5b, 0x33, 0xcd, - 0x28, 0x24, 0x21, 0xe2, 0x0d, 0x84, 0x7a, 0x17, 0x20, 0xb8, 0x3f, 0x2c, 0x55, 0xe0, 0x52, 0x13, - 0x40, 0xac, 0xf0, 0xab, 0x1a, 0xdc, 0x83, 0x2a, 0x35, 0xad, 0x41, 0x41, 0x57, 0x89, 0x69, 0x92, - 0x9f, 0x0a, 0x68, 0x21, 0xc3, 0x49, 0x54, 0xf3, 0x46, 0x7b, 0x89, 0x16, 0x16, 0x47, 0x96, 0xc7, - 0x56, 0x4e, 0xf5, 0x39, 0xe3, 0xb9, 0x54, 0x75, 0xba, 0xdb, 0x91, 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, 0x98, 0xfd, 0xf5, 0x60, - 0xf3, 0x08, 0xfb, 0xbf, 0x30, 0x97, 0xff, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xdd, 0xda, 0x20, 0x0d, - 0x42, 0x24, 0x00, 0x00, + // 2244 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x5a, 0xed, 0x6f, 0xdc, 0x48, + 0x19, 0xaf, 0x9b, 0xb6, 0x5c, 0x26, 0x49, 0x93, 0x4e, 0xf3, 0xea, 0xb6, 0xeb, 0x74, 0xee, 0x9a, + 0xa6, 0xbd, 0xee, 0xee, 0xf5, 0x85, 0xf6, 0x2e, 0xd7, 0xeb, 0x29, 0xdb, 0x5c, 0xae, 0x3d, 0x5a, + 0xd8, 0x9a, 0x16, 0x09, 0x84, 0x64, 0x66, 0xd7, 0xb3, 0x1b, 0x53, 0xaf, 0xed, 0xd8, 0xde, 0xa8, + 0x7b, 0x55, 0x11, 0x42, 0x42, 0x42, 0x42, 0x20, 0xa4, 0x0a, 0x10, 0x7f, 0xc0, 0x21, 0x9d, 0xf8, + 0x88, 0x04, 0x02, 0x89, 0x2f, 0xc0, 0x87, 0xf2, 0x05, 0x0e, 0x21, 0x24, 0x04, 0xd2, 0x0a, 0x5a, + 0x24, 0x3e, 0xb3, 0x7f, 0x01, 0xf2, 0xcc, 0x63, 0xc7, 0xde, 0x78, 0xbd, 0xde, 0xa0, 0x0a, 0x3e, + 0x65, 0x67, 0xe6, 0x79, 0xf9, 0xfd, 0x9e, 0x79, 0xe6, 0xf1, 0x3c, 0xa3, 0x20, 0xa5, 0x6d, 0xb5, + 0x2d, 0xa3, 0x61, 0x94, 0x75, 0xe6, 0x1a, 0x3b, 0xd4, 0x37, 0x76, 0x98, 0x57, 0xde, 0x6e, 0x33, + 0xb7, 0x53, 0x72, 0x5c, 0xdb, 0xb7, 0xf1, 0x71, 0x10, 0x28, 0xc5, 0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17, 0xf7, 0x86, 0xb3, 0x43, 0x81, 0x0b, 0x3c, 0x09, 0xe4, 0xd7, 0xd0, 0x2c, 0xdc, + 0x76, 0x84, 0xe9, 0x30, 0x32, 0x0a, 0x9a, 0x08, 0xbd, 0x69, 0x86, 0x2e, 0x36, 0x53, 0x45, 0xe1, + 0xd4, 0x6d, 0x9d, 0xfc, 0x76, 0x0c, 0xcd, 0xf5, 0x69, 0x02, 0x5d, 0x15, 0xbd, 0x12, 0xca, 0x41, + 0x48, 0x87, 0xb0, 0x5d, 0x78, 0xd6, 0x55, 0xa4, 0x5e, 0x57, 0x99, 0x4e, 0x32, 0x26, 0x6a, 0x64, + 0x07, 0x33, 0x34, 0xb3, 0x43, 0xcd, 0x36, 0xc7, 0x1c, 0x5c, 0x3d, 0x1b, 0x86, 0x0f, 0xac, 0x97, + 0x12, 0xac, 0x43, 0xbe, 0x37, 0x6d, 0xc3, 0xaa, 0x28, 0x41, 0x3d, 0xee, 0x75, 0x95, 0x05, 0x61, + 0xb7, 0xdf, 0x00, 0x51, 0xa7, 0xa3, 0xa9, 0x2a, 0x9f, 0xc1, 0xdf, 0x92, 0xd0, 0x42, 0x8b, 0xba, + 0x4d, 0xc3, 0xd2, 0x5a, 0xd4, 0xb0, 0x7c, 0x66, 0x51, 0xab, 0xce, 0x34, 0x97, 0xfa, 0x0c, 0xca, + 0x41, 0x75, 0xe4, 0x1a, 0x5f, 0x80, 0x4a, 0x94, 0x6e, 0x96, 0xa8, 0x73, 0x62, 0xe5, 0xee, 0xee, + 0x82, 0x4a, 0x7d, 0x16, 0x30, 0x66, 0x8d, 0x06, 0xab, 0x07, 0xb1, 0xd2, 0x84, 0x08, 0x2f, 0x12, + 0xa3, 0x30, 0xee, 0x37, 0x40, 0xd4, 0xe9, 0x68, 0xea, 0xae, 0x98, 0xf9, 0xa5, 0x84, 0x56, 0x53, + 0x6b, 0x78, 0xb8, 0x3b, 0x9f, 0x37, 0x3e, 0x0c, 0x53, 0x1e, 0x7f, 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x57, 0xf2, + 0xb5, 0x91, 0xf5, 0x72, 0xe1, 0x17, 0x49, 0x14, 0x35, 0x45, 0x45, 0xd1, 0x27, 0x55, 0x36, 0x9f, + 0x3d, 0x2f, 0x48, 0x9f, 0x3c, 0x2f, 0x48, 0x7f, 0x7f, 0x5e, 0x90, 0xbe, 0xf7, 0xa2, 0x70, 0xe0, + 0x93, 0x17, 0x85, 0x03, 0x7f, 0x79, 0x51, 0x38, 0xf0, 0xa5, 0x0b, 0xb1, 0x47, 0xe4, 0x07, 0xd6, + 0x03, 0xcb, 0xd8, 0x34, 0xca, 0xf5, 0x2d, 0x6a, 0x58, 0xe5, 0x47, 0x09, 0xc3, 0xfc, 0x39, 0xb9, + 0x76, 0x84, 0xff, 0x73, 0xc4, 0xe5, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x11, 0xb4, 0xaf, + 0x53, 0x22, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2000,7 +1907,6 @@ type QueryClient interface { DLPTokenRates(ctx context.Context, in *QueryDLPTokenRateRequest, opts ...grpc.CallOption) (*QueryDLPTokenRateResponse, error) EstimateDLPTokenAmount(ctx context.Context, in *QueryEstimateDLPTokenAmountRequest, opts ...grpc.CallOption) (*QueryEstimateDLPTokenAmountResponse, error) EstimateRedeemTokenAmount(ctx context.Context, in *QueryEstimateRedeemTokenAmountRequest, opts ...grpc.CallOption) (*QueryEstimateRedeemTokenAmountResponse, error) - AvailableAssetInPoolByDenom(ctx context.Context, in *QueryAvailableAssetInPoolByDenomRequest, opts ...grpc.CallOption) (*QueryAvailableAssetInPoolByDenomResponse, error) AvailableAssetsInPool(ctx context.Context, in *QueryAvailableAssetsInPoolRequest, opts ...grpc.CallOption) (*QueryAvailableAssetsInPoolResponse, error) } @@ -2165,15 +2071,6 @@ func (c *queryClient) EstimateRedeemTokenAmount(ctx context.Context, in *QueryEs return out, nil } -func (c *queryClient) AvailableAssetInPoolByDenom(ctx context.Context, in *QueryAvailableAssetInPoolByDenomRequest, opts ...grpc.CallOption) (*QueryAvailableAssetInPoolByDenomResponse, error) { - out := new(QueryAvailableAssetInPoolByDenomResponse) - err := c.cc.Invoke(ctx, "/ununifi.derivatives.Query/AvailableAssetInPoolByDenom", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) AvailableAssetsInPool(ctx context.Context, in *QueryAvailableAssetsInPoolRequest, opts ...grpc.CallOption) (*QueryAvailableAssetsInPoolResponse, error) { out := new(QueryAvailableAssetsInPoolResponse) err := c.cc.Invoke(ctx, "/ununifi.derivatives.Query/AvailableAssetsInPool", in, out, opts...) @@ -2204,7 +2101,6 @@ type QueryServer interface { DLPTokenRates(context.Context, *QueryDLPTokenRateRequest) (*QueryDLPTokenRateResponse, error) EstimateDLPTokenAmount(context.Context, *QueryEstimateDLPTokenAmountRequest) (*QueryEstimateDLPTokenAmountResponse, error) EstimateRedeemTokenAmount(context.Context, *QueryEstimateRedeemTokenAmountRequest) (*QueryEstimateRedeemTokenAmountResponse, error) - AvailableAssetInPoolByDenom(context.Context, *QueryAvailableAssetInPoolByDenomRequest) (*QueryAvailableAssetInPoolByDenomResponse, error) AvailableAssetsInPool(context.Context, *QueryAvailableAssetsInPoolRequest) (*QueryAvailableAssetsInPoolResponse, error) } @@ -2263,9 +2159,6 @@ func (*UnimplementedQueryServer) EstimateDLPTokenAmount(ctx context.Context, req func (*UnimplementedQueryServer) EstimateRedeemTokenAmount(ctx context.Context, req *QueryEstimateRedeemTokenAmountRequest) (*QueryEstimateRedeemTokenAmountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EstimateRedeemTokenAmount not implemented") } -func (*UnimplementedQueryServer) AvailableAssetInPoolByDenom(ctx context.Context, req *QueryAvailableAssetInPoolByDenomRequest) (*QueryAvailableAssetInPoolByDenomResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AvailableAssetInPoolByDenom not implemented") -} func (*UnimplementedQueryServer) AvailableAssetsInPool(ctx context.Context, req *QueryAvailableAssetsInPoolRequest) (*QueryAvailableAssetsInPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AvailableAssetsInPool not implemented") } @@ -2580,24 +2473,6 @@ func _Query_EstimateRedeemTokenAmount_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } -func _Query_AvailableAssetInPoolByDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAvailableAssetInPoolByDenomRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).AvailableAssetInPoolByDenom(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/ununifi.derivatives.Query/AvailableAssetInPoolByDenom", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AvailableAssetInPoolByDenom(ctx, req.(*QueryAvailableAssetInPoolByDenomRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_AvailableAssetsInPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAvailableAssetsInPoolRequest) if err := dec(in); err != nil { @@ -2688,10 +2563,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "EstimateRedeemTokenAmount", Handler: _Query_EstimateRedeemTokenAmount_Handler, }, - { - MethodName: "AvailableAssetInPoolByDenom", - Handler: _Query_AvailableAssetInPoolByDenom_Handler, - }, { MethodName: "AvailableAssetsInPool", Handler: _Query_AvailableAssetsInPool_Handler, @@ -3906,7 +3777,7 @@ func (m *QueryEstimateRedeemTokenAmountResponse) MarshalToSizedBuffer(dAtA []byt return len(dAtA) - i, nil } -func (m *QueryAvailableAssetInPoolByDenomRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAvailableAssetsInPoolRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3916,12 +3787,12 @@ func (m *QueryAvailableAssetInPoolByDenomRequest) Marshal() (dAtA []byte, err er return dAtA[:n], nil } -func (m *QueryAvailableAssetInPoolByDenomRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAvailableAssetsInPoolRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAvailableAssetInPoolByDenomRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAvailableAssetsInPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3936,62 +3807,6 @@ func (m *QueryAvailableAssetInPoolByDenomRequest) MarshalToSizedBuffer(dAtA []by return len(dAtA) - i, nil } -func (m *QueryAvailableAssetInPoolByDenomResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAvailableAssetInPoolByDenomResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAvailableAssetInPoolByDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.AvailableAsset.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *QueryAvailableAssetsInPoolRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryAvailableAssetsInPoolRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAvailableAssetsInPoolRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *QueryAvailableAssetsInPoolResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -4511,7 +4326,7 @@ func (m *QueryEstimateRedeemTokenAmountResponse) Size() (n int) { return n } -func (m *QueryAvailableAssetInPoolByDenomRequest) Size() (n int) { +func (m *QueryAvailableAssetsInPoolRequest) Size() (n int) { if m == nil { return 0 } @@ -4524,26 +4339,6 @@ func (m *QueryAvailableAssetInPoolByDenomRequest) Size() (n int) { return n } -func (m *QueryAvailableAssetInPoolByDenomResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.AvailableAsset.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryAvailableAssetsInPoolRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *QueryAvailableAssetsInPoolResponse) Size() (n int) { if m == nil { return 0 @@ -7734,7 +7529,7 @@ func (m *QueryEstimateRedeemTokenAmountResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAvailableAssetInPoolByDenomRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAvailableAssetsInPoolRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7757,10 +7552,10 @@ func (m *QueryAvailableAssetInPoolByDenomRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAvailableAssetInPoolByDenomRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAvailableAssetsInPoolRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAvailableAssetInPoolByDenomRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAvailableAssetsInPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -7816,139 +7611,6 @@ func (m *QueryAvailableAssetInPoolByDenomRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAvailableAssetInPoolByDenomResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAvailableAssetInPoolByDenomResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAvailableAssetInPoolByDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AvailableAsset", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AvailableAsset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAvailableAssetsInPoolRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryAvailableAssetsInPoolRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAvailableAssetsInPoolRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *QueryAvailableAssetsInPoolResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/derivatives/types/query.pb.gw.go b/x/derivatives/types/query.pb.gw.go index 2ffac3375..d78698e4e 100644 --- a/x/derivatives/types/query.pb.gw.go +++ b/x/derivatives/types/query.pb.gw.go @@ -159,37 +159,19 @@ func local_request_Query_PerpetualFutures_0(ctx context.Context, marshaler runti } +var ( + filter_Query_PerpetualFuturesMarket_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_PerpetualFuturesMarket_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryPerpetualFuturesMarketRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["base_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "base_denom") - } - - protoReq.BaseDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "base_denom", err) - } - - val, ok = pathParams["quote_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "quote_denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.QuoteDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "quote_denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PerpetualFuturesMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.PerpetualFuturesMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -201,33 +183,11 @@ func local_request_Query_PerpetualFuturesMarket_0(ctx context.Context, marshaler var protoReq QueryPerpetualFuturesMarketRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["base_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "base_denom") - } - - protoReq.BaseDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "base_denom", err) - } - - val, ok = pathParams["quote_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "quote_denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.QuoteDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "quote_denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PerpetualFuturesMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.PerpetualFuturesMarket(ctx, &protoReq) @@ -253,37 +213,19 @@ func local_request_Query_PerpetualOptions_0(ctx context.Context, marshaler runti } +var ( + filter_Query_PerpetualOptionsMarket_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_PerpetualOptionsMarket_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryPerpetualOptionsMarketRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["base_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "base_denom") - } - - protoReq.BaseDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "base_denom", err) - } - - val, ok = pathParams["quote_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "quote_denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.QuoteDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "quote_denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PerpetualOptionsMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.PerpetualOptionsMarket(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -295,33 +237,11 @@ func local_request_Query_PerpetualOptionsMarket_0(ctx context.Context, marshaler var protoReq QueryPerpetualOptionsMarketRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["base_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "base_denom") - } - - protoReq.BaseDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "base_denom", err) - } - - val, ok = pathParams["quote_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "quote_denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.QuoteDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "quote_denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_PerpetualOptionsMarket_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.PerpetualOptionsMarket(ctx, &protoReq) @@ -645,37 +565,19 @@ func local_request_Query_DLPTokenRates_0(ctx context.Context, marshaler runtime. } +var ( + filter_Query_EstimateDLPTokenAmount_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_EstimateDLPTokenAmount_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryEstimateDLPTokenAmountRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["mint_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mint_denom") - } - - protoReq.MintDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mint_denom", err) - } - - val, ok = pathParams["amount"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Amount, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EstimateDLPTokenAmount_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.EstimateDLPTokenAmount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -687,33 +589,11 @@ func local_request_Query_EstimateDLPTokenAmount_0(ctx context.Context, marshaler var protoReq QueryEstimateDLPTokenAmountRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["mint_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "mint_denom") - } - - protoReq.MintDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "mint_denom", err) - } - - val, ok = pathParams["amount"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Amount, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EstimateDLPTokenAmount_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.EstimateDLPTokenAmount(ctx, &protoReq) @@ -721,37 +601,19 @@ func local_request_Query_EstimateDLPTokenAmount_0(ctx context.Context, marshaler } +var ( + filter_Query_EstimateRedeemTokenAmount_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_EstimateRedeemTokenAmount_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryEstimateRedeemTokenAmountRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["redeem_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "redeem_denom") - } - - protoReq.RedeemDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "redeem_denom", err) - } - - val, ok = pathParams["lpt_amount"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lpt_amount") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.LptAmount, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lpt_amount", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EstimateRedeemTokenAmount_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.EstimateRedeemTokenAmount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -763,33 +625,11 @@ func local_request_Query_EstimateRedeemTokenAmount_0(ctx context.Context, marsha var protoReq QueryEstimateRedeemTokenAmountRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["redeem_denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "redeem_denom") - } - - protoReq.RedeemDenom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "redeem_denom", err) - } - - val, ok = pathParams["lpt_amount"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lpt_amount") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.LptAmount, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lpt_amount", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EstimateRedeemTokenAmount_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.EstimateRedeemTokenAmount(ctx, &protoReq) @@ -797,64 +637,21 @@ func local_request_Query_EstimateRedeemTokenAmount_0(ctx context.Context, marsha } -func request_Query_AvailableAssetInPoolByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAvailableAssetInPoolByDenomRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) - } - - msg, err := client.AvailableAssetInPoolByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} +var ( + filter_Query_AvailableAssetsInPool_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) -func local_request_Query_AvailableAssetInPoolByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAvailableAssetInPoolByDenomRequest +func request_Query_AvailableAssetsInPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAvailableAssetsInPoolRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AvailableAssetsInPool_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.AvailableAssetInPoolByDenom(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_AvailableAssetsInPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAvailableAssetsInPoolRequest - var metadata runtime.ServerMetadata - msg, err := client.AvailableAssetsInPool(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -864,6 +661,13 @@ func local_request_Query_AvailableAssetsInPool_0(ctx context.Context, marshaler var protoReq QueryAvailableAssetsInPoolRequest var metadata runtime.ServerMetadata + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AvailableAssetsInPool_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.AvailableAssetsInPool(ctx, &protoReq) return msg, metadata, err @@ -1266,29 +1070,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_AvailableAssetInPoolByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_AvailableAssetInPoolByDenom_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AvailableAssetInPoolByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_AvailableAssetsInPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1693,26 +1474,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_AvailableAssetInPoolByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_AvailableAssetInPoolByDenom_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_AvailableAssetInPoolByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_AvailableAssetsInPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1747,11 +1508,11 @@ var ( pattern_Query_PerpetualFutures_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "derivatives", "perpetual-futures"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_PerpetualFuturesMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "derivatives", "perpetual-futures", "base_denom", "quote_denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_PerpetualFuturesMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ununifi", "derivatives", "perpetual-futures", "market"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PerpetualOptions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "derivatives", "perpetual-options"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_PerpetualOptionsMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "derivatives", "perpetual-options", "base_denom", "quote_denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_PerpetualOptionsMarket_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ununifi", "derivatives", "perpetual-options", "market"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllPositions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "derivatives", "positions"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1767,11 +1528,9 @@ var ( pattern_Query_DLPTokenRates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ununifi", "derivatives", "pools", "dlp"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_EstimateDLPTokenAmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "derivatives", "estimate-dlp-token-amount", "mint_denom", "amount"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EstimateDLPTokenAmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "derivatives", "estimate-dlp-token-amount"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_EstimateRedeemTokenAmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "derivatives", "estimate-redeem-amount", "redeem_denom", "lpt_amount"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_AvailableAssetInPoolByDenom_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "derivatives", "pools", "available-asset", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EstimateRedeemTokenAmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "derivatives", "estimate-redeem-amount"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AvailableAssetsInPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ununifi", "derivatives", "pools", "available-assets"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -1811,7 +1570,5 @@ var ( forward_Query_EstimateRedeemTokenAmount_0 = runtime.ForwardResponseMessage - forward_Query_AvailableAssetInPoolByDenom_0 = runtime.ForwardResponseMessage - forward_Query_AvailableAssetsInPool_0 = runtime.ForwardResponseMessage ) diff --git a/x/ecosystemincentive/README.md b/x/ecosystemincentive/README.md index 0e8866ec3..b78276645 100644 --- a/x/ecosystemincentive/README.md +++ b/x/ecosystemincentive/README.md @@ -2,103 +2,77 @@ ## Abstract -The `ecosystem-incentive` module provides the feature to incentivize the parties who bring value to our NFT market place users, especially frontend creator for the UnUniFi's NFTFi features by distributing certain rate of the NFT traded fee to the subjects. -The subjects put the required information in somewhare (current idea is memo field of the target message like MsgPayAuctionFee) and withdraw the accumulated rewards all at once or for one specific denom. +The `ecosystem-incentive` module provides the feature to incentivize the parties who bring value to our NFT market place users, especially frontend creator for the UnUniFi's NFTFi features by distributing certain rate of the NFT traded fee to the subjects. +The subjects put the required information in somewhare (current idea is memo field of the target message like MsgPayAuctionFee) and withdraw the accumulated rewards all at once or for one specific denom. ## Contents TODO: contents -# Concepts +## Concepts -**NOTE: This is early draft.** +This module aims to provide the incentive for the parties which especially bring value to our ecosystem like frontend service creator. +Focusing on the case for the frontend service creator, any of them who creates UnUniFi NFT market and NFTFi frontend service are the subjects to receive Ecosystem Incentive reward from the NFT trading fee which are used in NFT market. -This module aims to provide the incentive for the parties which especially bring value to our ecosystem like frontend service creator. -Fucosing on the case for the frontend service creator, any of them who creates UnUniFi NFT market and NFTFi frontend service are the subjects to recieve Ecosystem Incentive reward from the NFT trading fee in many denoms which are used in NFT market. +### Getting Ecosystem Incentive Reward -## Joining Ecosystem Incentive +This model of distribution reward could be applied to many use-cases. But, we write down only about the case for nftbackedloan Frontend model here for better explanation of the sense of this module. -Any subjects can send a register message `MsgIncentiveRegister` with the `incentive_id` and `subject_weight_map`. +First, add the following JSON to the TxMemo field when sending the nftbackedloan's MsgListNft to the chain. The address is the address you want to receive the reward. -## Getting Ecosystem Incentive Reward - -This model of distribution reward could be applied to many use-cases. But, we write down only about the case for nftbackedloan Frontend model here for better explanation of the sense of this module. -First, the subjects must register to get incentive by sending `MsgIncentiveRegister`. -Once the `incentive_id` is registered, they insert that `incentive_id` in the target message which is `MsgListNft` memo field precisely to get the reward for the nftbackedloan Frontend incentive mode. -Once the `NftIdentifer` on the market is connected with `incentive_id`, `AfterNftPaymentWithCommission` hook function triggers methods to reflect the reward amount for according addresses in `incentive_id`. - -## Withdrawing Ecosystem Incentive Reward - -Any registered subjects can withdraw thier reward by sending a withdrawal message if they are there. -They can withdraw all rewards across all denoms by sending `MsgWithdrawAllRewards`. -In other way, they can withdraw specific denom reward by sending `MsgWithdrawSpecificDenomReward`. - -## The Reward Mechanism +```json +{ "frontend": { "version": 1, "recipient": "ununifixxxxxxx" } } +``` -All the reward comes from the fees that UnUniFi protocol earned in addition to gas fee which is defined in protocol as glocal parameter. -There is nothing inflational effect or depletion by rewarding subjects. +In this way, the reward recipient is linked to the NFT ID, and a portion of the commission from this NFT transaction is given to the recipient. +This operation is handled by the `AfterNftPaymentWithCommission` hook function. -# State +### Withdrawing Ecosystem Incentive Reward -**NOTE: This is early draft.** +Rewards are accumulated in the ecosysytemincentive module and can be received in the following ways. -## IncentiveUnit +`MsgWithdrawAllRewards` ```protobuf -message IncentiveUnit { - string id = 1 [ - (gogoproto.moretags) = "yaml:\"id\"" - ]; - repeated SubjectInfo subject_info_list = 2 [ - (gogoproto.moretags) = "yaml:\"subject_info_lists\"", - (gogoproto.nullable) = false +message MsgWithdrawAllRewards { + string sender = 1 [ + (gogoproto.moretags) = "yaml:\"sender\"" ]; } +``` -message SubjectInfo { - string address = 1 [ - (gogoproto.moretags) = "yaml:\"subject_addr\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false - ]; - string weight = 2 [ - (gogoproto.moretags) = "yaml:\"weight\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false +`MsgWithdrawReward` + +```protobuf +message MsgWithdrawReward { + string sender = 1 [ + (gogoproto.moretags) = "yaml:\"sender\"" ]; + string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; } ``` -- Incentive: `"incentive_id" -> format(IncentiveStore)` - -### incentive_id - -`incentive_id` is the unique identifier in the `incentive_store` for the subjects. Hence, it can't be duplicated. +### The Reward Mechanism -## SubjectInfo +All the reward comes from the fees that UnUniFi protocol earned in addition to gas fee which is defined in protocol as global parameter. +There is nothing inflationary effect or depletion by rewarding subjects. -### weight +## State -The ratio of the reward distribution in a `incentive_store` unit. -`incentive_store` can contain several `subject`s and ratio for each. +### nftbackedloanFrontendTable +`format(nft_id) -> format(recipient_address)` -## nftbackedloanFrontendIncentiveIdTable +This KVStore manages what NFT is linked to which `recipient_address`. -- nftbackedloan_frontend_incentive_id_table: `format(nft_id) -> format(incentive_id)` +### RewardTable -This KVStore manages what NFT is connected to which `incentive_id`. - -## RewardTable - -RewardTable is the record of the rewards for the subject of the `ecosystem-incentive`. +RewardTable is the record of the `ecosystem-incentive` rewards. ```protobuf -message Reward { - string subject_addr = 1 [ - (gogoproto.moretags) = "yaml:\"subject_addr\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false +message RewardRecord { + string address = 1 [ + (gogoproto.moretags) = "yaml:\"address\"" ]; repeated cosmos.base.v1beta1.Coin rewards = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", @@ -115,15 +89,14 @@ message Reward { ```protobuf message Params { repeated RewardParams reward_params = 1 [ (gogoproto.moretags) = "yaml:\"reward_params\"" ]; - uint64 max_incentive_unit_id_len = 2 [ (gogoproto.moretags) = "yaml:\"max_incentive_unit_id_len\"" ]; - uint64 max_subject_info_num_in_unit = 3 [ (gogoproto.moretags) = "yaml:\"max_subject_info_num_in_unit\"" ]; } message RewardParams { - string module_name = 1 [(gogoproto.nullable) = false]; - repeated IncentiveUnit incentive_units = 2 [(gogoproto.nullable) = false]; - repeated RewardStore reward_stores = 3 [(gogoproto.nullable) = false]; - repeated IncentiveUnitIdsByAddr incentive_unit_ids_by_addr = 4 [(gogoproto.nullable) = false]; + string module_name = 1 [ (gogoproto.moretags) = "yaml:\"module_name\"" ]; + repeated RewardRate reward_rate = 2 [ + (gogoproto.moretags) = "yaml:\"reward_rate\"", + (gogoproto.nullable) = false + ]; } // RewardRate defines the ratio to take reward for a specific reward_type. @@ -137,360 +110,223 @@ message RewardRate { ]; } -// nftbackedloan_FRONTEND type reward will be disributed for the creators of frontend of UnUniFi's services. +// STAKERS type reward will be distributed for the stakers of GUU token. +// FRONTEND_DEVELOPERS type reward will be distributed for the creators of frontend of UnUniFi's services. +// COMMUNITY_POOL type reward will be distributed for the community pool. enum RewardType { UNKNOWN = 0; STAKERS = 1; FRONTEND_DEVELOPERS = 2; + COMMUNITY_POOL = 3; } ``` -`Params` contains `RewardParams` as the configuration of this module parameters and `MaxIncentiveUnitIdLen` as to define the max length of the IncentiveUnitId. - ### RewardRate -The factor to multipy the trading fee for the reward of this module. -e.g. If `reward_rate` is 80% and the trading fee that is made in a target message is 100GUU, the actual reward for target `incentive_id` subjects is `100GUU * 0.80 = 80GUU`. +The factor to multiple the trading fee for the reward of this module. +e.g. If `reward_rate` is 80% and the trading fee that is made in a target message is 100GUU, the actual reward is `100GUU * 0.80 = 80GUU`. ### RewardType The reward type manages the types of the reward for the various subject. -At first, we support frontend creator. But, the reward will be able to distributed for the different type of parties in our ecosystem. +At first, we support frontend creator. But, the reward will be able to distributed for the different type of parties in our ecosystem in the future. -### MaxIncentiveUnitIdLen +## Ante Handler -The length of `IncentiveUnitId` must be between `MaxIncentiveUnitIdLen` and 0. +When an NFT is listed in nftbackedloan, AnteHandlers is used to read the MsgListNft and link the NFT to the recipient address. -## IncentiveUnitIdsByAddr +AnteHandlers Reference + -IncentiveUnitIdsByAddr is the collection of the incentive unit ids for each address. +At this time, a memo in the following format should be included in the MsgListNft. -```protobuf -message IncentiveUnitIdsByAddr { - string address = 1 [ - (gogoproto.moretags) = "yaml:\"address\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false - ]; - repeated string incentive_unit_ids = 2 [ - (gogoproto.moretags) = "yaml:\"incentive_unit_ids\"", - (gogoproto.nullable) = false - ]; -} +```json +{ "frontend": { "version": 1, "recipient": "ununifixxxxxxx" } } ``` -# Hooks +On CLI, send Tx as follows + +```bash +ununifid tx nftbackedloan list \ +$class_id $token_id \ +--note "{\"frontend\":{\"version\": 1, \"recipient\": \"ununifixxxxxxx\"}}" +``` -**NOTE: This is early draft.** +## Hooks -All rewards accumulation are executed when the according hooks function is called. +All rewards accumulation are executed when the according hooks function is called. The example hooks functions interfaces in x/nftbackedloan module: ```go type nftbackedloanHooks interface { - AfterNftListed(ctx sdk.Context, nftIdentifier NftIdentifier, txMemo string) - AfterNftPaymentWithCommission(ctx sdk.Context, nftIdentifier NftIdentifier, fee sdk.Coin) - AfterNftUnlistedWithoutPayment(ctx sdk.Context, nftIdentifier NftIdentifier) + AfterNftPaymentWithCommission(ctx sdk.Context, nftIdentifier NftIdentifier, fee sdk.Coin) + AfterNftUnlistedWithoutPayment(ctx sdk.Context, nftIdentifier NftIdentifier) } ``` -## AfterNftListed - -This hook function is called for the resistration for the `ecosystem-incentive` with the `txMemo` and `nftIdentifiler`. -To pass the `txMemo` from the memo data of `MsgListNft` requires a method to get memo data in the process of `MsgListNft` in `x/nftbackedloan` module. - -### Location to be inserted - -- `ListNft(ctx sdk.Context, msg *types.MsgListNft)` from x/nftbackedloan in nft_listing.go - -## AfterNftPaymentWithCommission +### AfterNftPaymentWithCommission This hook function is called for the accumulation of the reward for the subjects which are connected with the `nftIdentifiler` in the argument. The calculation of the actual reward amount is executed in methods which this hook function calls in this module. -### Location to be inserted +#### Location to be inserted AfterNftPaymentWithCommission -- `ProcessPaymentWithCommissionFee(ctx sdk.Context, listingOwner sdk.AccAddress, denom string, amount sdk.Int)` from x/nftbackedloan in nft_listing.go +- `ProcessPaymentWithCommissionFee(ctx sdk.Context, listingOwner sdk.AccAddress, denom string, amount sdk.Int)` from x/nftbackedloan in nft_listing.go -## AfterNftUnlistedWithoutPayment +### AfterNftUnlistedWithoutPayment -This hook function is called when a nft is unlisted for some reason like liquidation. +This hook function is called when a nft is unlisted for some reason like liquidation. The purpose is to remove the unlisted nft information from `nftbackedloanFrontendIncentiveIdTable` KVStore to keep the data consystent. -### Location to be inserted +#### Location to be inserted AfterNftUnlistedWithoutPayment - `CancelNftListing(ctx sdk.Context, msg *types.MsgCancelNftListing)` from x/nftbackedloan in nft_listing.go - Case which bid's length for the listing is 0 in `SetLiquidation(ctx sdk.Context, msg *types.MsgEndNftListing)` from x/nftbackedloan in nft_listing.go -# Data structure for the memo field - -We use tx memo field data to identify what incentive will be distributed to what `incentive-unit` by putting the correct formatted json data into that. - -The v1's formal data archtecture is: - -```json -{ - "version": "v1", - "incentive_unit_id": "incentive_unit-1" -} -``` - -NOTE: There's a lot of chances to be changed this structure with the change of the version. Please note it when to use. - ## Frontends -We use memo field data to know which frontend a lisetd nft used in the case of frontend-incentive model. -So we have to use the organized data structure of memo field in a listing tx (MsgListNft) to distingush it as a legitimate entry or not. - -Even if you put the wrong formatted data in the memo of tx contains MsgListNft, the MsgListNft itself will still succeed. The registration of the information which nft-id relates to what `incentive-unit-id` will just fail. - - +We use memo field data to know which frontend a lisetd nft used in the case of frontend-incentive model. +So we have to use the organized data structure of memo field in a listing tx (MsgListNft) to distinguish it as a legitimate entry or not. -# Messages and Queries +Even if you put the wrong formatted data in the memo of tx contains MsgListNft, the MsgListNft itself will still succeed. The registration of the information which nft-id relates to what `reciever_address` will just fail. -**NOTE: This is early draft.** +## Messages and Queries -## Messages +### Messages All messages of `ecosystem-incentive`. -### Register - -A message to register `incentive_unit` to take reward from `ecosystem-incentive`. - -```protobuf -message MsgRegister { - string sender = 1 [ - (gogoproto.moretags) = "yaml:\"sender\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false - ]; - string incentive_unit_id = 2 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ]; - repeated string subject_addrs = 3 [ - (gogoproto.moretags) = "yaml:\"subject_addrs\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false - ]; - repeated string weights = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"weights\"", - (gogoproto.nullable) = false - ]; -} -message MsgRegisterResponse {} -``` - -`weights` must be `1.000000000000000000` (just ok as long as it represent 1). -For example, -ok: [0.5, 0.5], [0.33, 0.33, 0.34] -not: [0.5, 0.1], [0.33, 0.33, 0.3333] - -And more importantly, don't forget how one `subject_addr` is associated with one `weight`. It's just order for those two lists. For example, in this case -```shell -subject_addrs = [ -"ununifi17gs6kgph4657epky2ctl9sf66ucyua939nexgl", -"ununifi1w9s3wpkh0kfk0t40m4lwjsx6h2v6gktsvfrgux" -] -weights = [ -"0.6", -"0.4 -] -``` - -`ununifi17gs6kgph4657epky2ctl9sf66ucyua939nexgl`'s `weight` will be `0.6` and `ununifi1w9s3wpkh0kfk0t40m4lwjsx6h2v6gktsvfrgux`'s will be `0.4`. - -#### CLI - -We receive a JSON file in CLI command for this message. -Example JSON file for CLI tx command: - -```Json -{ - "incentive_id": "incentive-unit1", - "subject_addrs": [ - "ununifi17gs6kgph4657epky2ctl9sf66ucyua939nexgl", - "ununifi1w9s3wpkh0kfk0t40m4lwjsx6h2v6gktsvfrgux" - ], - "weights": [ - "0.50", - "0.50" - ] -} -``` - -### WithdrawAllRewards +#### WithdrawAllRewards A message to withdraw all accumulated rewards across all denoms. ```protobuf message MsgWithdrawAllRewards { string sender = 1 [ - (gogoproto.moretags) = "yaml:\"sender\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false + (gogoproto.moretags) = "yaml:\"sender\"" ]; } ``` -### WithdrawReward +#### WithdrawReward A message to withdraw accumulated reward of specified denom. ```protobuf message MsgWithdrawReward { string sender = 1 [ - (gogoproto.moretags) = "yaml:\"sender\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false + (gogoproto.moretags) = "yaml:\"sender\"" ]; string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; } ``` -## Queries +### Queries All queries of `ecosystem-incentive`. -### IncentiveUnit - -```protobuf -message QueryIncentiveUnitRequest { - string incentive_unit_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ]; -} - -message QueryIncentiveUnitResponse { - IncentiveUnit incentive_unit = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit\"" ]; -} -``` - -### AllRewards +#### AllRewards ```protobuf message QueryAllRewardsRequest { - string subject_addr = 1 [ (gogoproto.moretags) = "yaml:\"subject_addr\"" ]; + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; } message QueryAllRewardsResponse { - Reward rewards = 1 [ - (gogoproto.moretags) = "yaml:\"rewards\"", - (gogoproto.nullable) = false - ]; + RewardRecord reward_record = 1 [(gogoproto.moretags) = "yaml:\"reward_record\"", (gogoproto.nullable) = false]; } ``` -### SpecificDenomReward +#### SpecificDenomReward ```protobuf message QueryRewardRequest { - string subject_addr = 1 [ (gogoproto.moretags) = "yaml:\"subject_addr\"" ]; - string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ]; + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; + string denom = 2 [(gogoproto.moretags) = "yaml:\"denom\""]; } message QueryRewardResponse { cosmos.base.v1beta1.Coin reward = 1 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"reward\"", - (gogoproto.nullable) = false + (gogoproto.moretags) = "yaml:\"reward\"", + (gogoproto.nullable) = false ]; } ``` -### IncentiveUnitIdsByAddr +### RecipientAddressWithNftId ```protobuf -message QueryIncentiveUnitIdsByAddrRequest { - string address = 1 [ - (gogoproto.moretags) = "yaml:\"address\"" - ]; +message QueryRecipientAddressWithNftIdRequest { + string class_id = 1 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 2 [(gogoproto.moretags) = "yaml:\"token_id\""]; } -message QueryIncentiveUnitIdsByAddrResponse { - IncentiveUnitIdsByAddr incentive_unit_ids_by_addr = 1 [ - (gogoproto.moretags) = "yaml:\"incentive_unit_ids_by_addr\"", - (gogoproto.nullable) = false - ]; +message QueryRecipientAddressWithNftIdResponse { + string address = 1 [(gogoproto.moretags) = "yaml:\"address\""]; } ``` -# Events +## Events ```protobuf -message EventRegister { - string incentive_unit_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ]; - repeated SubjectInfo subject_info_lists = 2 [ - (gogoproto.moretags) = "yaml:\"subject_info_lists\"", - (gogoproto.nullable) = false - ]; -} - message EventWithdrawAllRewards { - string sender = 1 [ - (gogoproto.moretags) = "yaml:\"sender\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false - ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; repeated cosmos.base.v1beta1.Coin all_withdrawn_rewards = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"all_withdrawn_rewards\"", - (gogoproto.nullable) = false + (gogoproto.moretags) = "yaml:\"all_withdrawn_rewards\"", + (gogoproto.nullable) = false ]; } message EventWithdrawReward { - string sender = 1 [ - (gogoproto.moretags) = "yaml:\"sender\"", - (gogoproto.customtype) = "github.com/UnUniFi/chain/types.StringAccAddress", - (gogoproto.nullable) = false - ]; + string sender = 1 [(gogoproto.moretags) = "yaml:\"sender\""]; cosmos.base.v1beta1.Coin withdrawn_reward = 2 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.moretags) = "yaml:\"withdrawn_reward\"", - (gogoproto.nullable) = false + (gogoproto.moretags) = "yaml:\"withdrawn_reward\"", + (gogoproto.nullable) = false ]; } -message EventFailedParsingMemoInputs { - string class_id = 1 [ (gogoproto.moretags) = "yaml:\"class_id\"" ]; - string nft_id = 2 [ (gogoproto.moretags) = "yaml:\"nft_id\"" ]; - string memo = 3 [ (gogoproto.moretags) = "yaml:\"memo\"" ]; -} - -message EventRecordedIncentiveUnitId { - string incentive_unit_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ]; - string class_id = 2 [ (gogoproto.moretags) = "yaml:\"class_id\"" ]; - string nft_id = 3 [ (gogoproto.moretags) = "yaml:\"nft_id\"" ]; +message EventRecordedRecipientWithNftId { + string recipient = 1 [(gogoproto.moretags) = "yaml:\"recipient\""]; + string class_id = 2 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 3 [(gogoproto.moretags) = "yaml:\"token_id\""]; } message EventDeletedNftIdRecordedForFrontendReward { - string incentive_unit_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ]; - string class_id = 2 [ (gogoproto.moretags) = "yaml:\"class_id\"" ]; - string nft_id = 3 [ (gogoproto.moretags) = "yaml:\"nft_id\"" ]; -} - -message EventNotRegisteredIncentiveUnitId { - string incentive_unit_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ]; - string class_id = 2 [ (gogoproto.moretags) = "yaml:\"class_id\"" ]; - string nft_id = 3 [ (gogoproto.moretags) = "yaml:\"nft_id\"" ]; + string recipient = 1 [(gogoproto.moretags) = "yaml:\"recipient\""]; + string class_id = 2 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 3 [(gogoproto.moretags) = "yaml:\"token_id\""]; } message EventNotRecordedNftId { - string class_id = 1 [ (gogoproto.moretags) = "yaml:\"class_id\"" ]; - string nft_id = 2 [ (gogoproto.moretags) = "yaml:\"nft_id\"" ]; + string class_id = 1 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 2 [(gogoproto.moretags) = "yaml:\"token_id\""]; } message EventUpdatedReward { - string incentive_unit_id = 1 [ (gogoproto.moretags) = "yaml:\"incentive_unit_id\"" ]; + string recipient = 1 [(gogoproto.moretags) = "yaml:\"recipient\""]; cosmos.base.v1beta1.Coin earned_reward = 2 [ - (gogoproto.moretags) = "yaml:\"earned_reward\"", + (gogoproto.moretags) = "yaml:\"earned_reward\"", (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", - (gogoproto.nullable) = false + (gogoproto.nullable) = false + ]; +} + +message EventDistributionForStakers { + cosmos.base.v1beta1.Coin distributed_amount = 1 [ + (gogoproto.moretags) = "yaml:\"distributed_amount\"", + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin", + (gogoproto.nullable) = false ]; + int64 block_height = 2 [(gogoproto.moretags) = "yaml:\"block_height\""]; } message EventVersionUnmatched { - string unmatched_version = 1 [ (gogoproto.moretags) = "yaml:\"unmatched_version\"" ]; - string class_id = 2 [ (gogoproto.moretags) = "yaml:\"class_id\"" ]; - string nft_id = 3 [ (gogoproto.moretags) = "yaml:\"nft_id\"" ]; + uint32 unmatched_version = 1 [(gogoproto.moretags) = "yaml:\"unmatched_version\""]; + string class_id = 2 [(gogoproto.moretags) = "yaml:\"class_id\""]; + string token_id = 3 [(gogoproto.moretags) = "yaml:\"token_id\""]; } ``` diff --git a/x/ecosystemincentive/client/cli/query.go b/x/ecosystemincentive/client/cli/query.go index e3ff50792..04b4eb41d 100644 --- a/x/ecosystemincentive/client/cli/query.go +++ b/x/ecosystemincentive/client/cli/query.go @@ -25,26 +25,62 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand( CmdQueryParams(), - CmdQueryAllRewards(), + CmdQueryRewards(), + CmdQueryRecipientAddressWithNftId(), ) return cmd } -func CmdQueryAllRewards() *cobra.Command { +func CmdQueryRewards() *cobra.Command { cmd := &cobra.Command{ - Use: "all-rewards [address]", - Short: "shows all rewards that defined address have", - Args: cobra.ExactArgs(1), + Use: "rewards [address] [denom]", + Short: "shows ecosystem reward by address & denom", + Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) queryClient := types.NewQueryClient(clientCtx) - req := &types.QueryAllRewardsRequest{ + var denom string + if len(args) > 1 { + denom = args[1] + } else { + denom = "" + } + + req := &types.QueryEcosystemRewardsRequest{ Address: args[0], + Denom: denom, + } + + res, err := queryClient.EcosystemRewards(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +func CmdQueryRecipientAddressWithNftId() *cobra.Command { + cmd := &cobra.Command{ + Use: "recipient-with-nft [class_id] [token_id]", + Short: "shows recipient address by nft id", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryRecipientAddressWithNftIdRequest{ + ClassId: args[0], + TokenId: args[1], } - res, err := queryClient.AllRewards(context.Background(), req) + res, err := queryClient.RecipientAddressWithNftId(context.Background(), req) if err != nil { return err } diff --git a/x/ecosystemincentive/keeper/frontend_incentive.go b/x/ecosystemincentive/keeper/frontend_incentive.go index ec3281062..60c730ac5 100644 --- a/x/ecosystemincentive/keeper/frontend_incentive.go +++ b/x/ecosystemincentive/keeper/frontend_incentive.go @@ -14,14 +14,14 @@ func (k Keeper) MemoTxHandler(ctx sdk.Context, msgs []sdk.Msg, memo string) { return } - d := make(map[string]interface{}) + d := make(map[string]json.RawMessage) err := json.Unmarshal([]byte(memo), &d) if err != nil || d["frontend"] == nil { return } - + // txMemo := types.FrontendTxMemo{} metadata := types.FrontendMetadata{} - err = json.Unmarshal([]byte(memo), &metadata) + err = json.Unmarshal(d["frontend"], &metadata) if err != nil { return } @@ -53,14 +53,14 @@ func (k Keeper) HandleMemoTxWithMsgListNft(ctx sdk.Context, msg *nftbackedloanty // types.AvailableVersions[0] = 1 case types.AvailableVersions[0]: // Store the incentive-unit-id in NftIdForFrontend KVStore with nft-id as key - k.RecordRecipientWithNftId(ctx, msg.NftId, metadata.Recipient) + _ = k.RecordRecipientWithNftId(ctx, msg.NftId, metadata.Recipient) // If the value doesn't match any cases, emit event and don't do anything default: _ = ctx.EventManager().EmitTypedEvent(&types.EventVersionUnmatched{ UnmatchedVersion: metadata.Version, ClassId: msg.NftId.ClassId, - NftId: msg.NftId.TokenId, + TokenId: msg.NftId.TokenId, }) } } diff --git a/x/ecosystemincentive/keeper/grpc_query.go b/x/ecosystemincentive/keeper/grpc_query.go index 4d15baf45..258a6ac7e 100644 --- a/x/ecosystemincentive/keeper/grpc_query.go +++ b/x/ecosystemincentive/keeper/grpc_query.go @@ -8,6 +8,7 @@ import ( "google.golang.org/grpc/status" "github.com/UnUniFi/chain/x/ecosystemincentive/types" + nftbackedloantypes "github.com/UnUniFi/chain/x/nftbackedloan/types" ) var _ types.QueryServer = Keeper{} @@ -21,8 +22,7 @@ func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil } -// AllRewards returns the RewardStore defined by subject address -func (k Keeper) AllRewards(c context.Context, req *types.QueryAllRewardsRequest) (*types.QueryAllRewardsResponse, error) { +func (k Keeper) EcosystemRewards(c context.Context, req *types.QueryEcosystemRewardsRequest) (*types.QueryEcosystemRewardsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid argument") } @@ -30,37 +30,36 @@ func (k Keeper) AllRewards(c context.Context, req *types.QueryAllRewardsRequest) accAddr, err := sdk.AccAddressFromBech32(req.Address) if err != nil { - return nil, err + return &types.QueryEcosystemRewardsResponse{Rewards: sdk.Coins{}}, err } - record, exists := k.GetRewardRecord(ctx, accAddr) - if !exists { - return nil, types.ErrAddressNotHaveReward + allRewards, exist := k.GetRewardRecord(ctx, accAddr) + if !exist { + return &types.QueryEcosystemRewardsResponse{Rewards: allRewards.Rewards}, nil + } + + if req.Denom == "" { + return &types.QueryEcosystemRewardsResponse{Rewards: allRewards.Rewards}, nil } - return &types.QueryAllRewardsResponse{RewardRecord: record}, nil + exist, reward := allRewards.Rewards.Find(req.Denom) + if !exist { + return &types.QueryEcosystemRewardsResponse{Rewards: sdk.Coins{sdk.NewInt64Coin(req.Denom, 0)}}, nil + } + + return &types.QueryEcosystemRewardsResponse{Rewards: sdk.Coins{reward}}, nil } -func (k Keeper) Reward(c context.Context, req *types.QueryRewardRequest) (*types.QueryRewardResponse, error) { +func (k Keeper) RecipientAddressWithNftId(c context.Context, req *types.QueryRecipientAddressWithNftIdRequest) (*types.QueryRecipientAddressWithNftIdResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid argument") } ctx := sdk.UnwrapSDKContext(c) - accAddr, err := sdk.AccAddressFromBech32(req.Address) - if err != nil { - return &types.QueryRewardResponse{Reward: sdk.Coin{}}, err - } - - allRewards, exists := k.GetRewardRecord(ctx, accAddr) - if !exists { - return &types.QueryRewardResponse{Reward: sdk.Coin{}}, types.ErrAddressNotHaveReward - } - - exists, reward := allRewards.Rewards.Find(req.Denom) + recipient, exists := k.GetRecipientByNftId(ctx, nftbackedloantypes.NftId{ClassId: req.ClassId, TokenId: req.TokenId}) if !exists { - return &types.QueryRewardResponse{Reward: sdk.Coin{}}, types.ErrDenomRewardNotExists + return &types.QueryRecipientAddressWithNftIdResponse{Address: ""}, nil } - return &types.QueryRewardResponse{Reward: reward}, nil + return &types.QueryRecipientAddressWithNftIdResponse{Address: recipient}, nil } diff --git a/x/ecosystemincentive/keeper/hooks.go b/x/ecosystemincentive/keeper/hooks.go index 2bb1bac2c..be99e6b30 100644 --- a/x/ecosystemincentive/keeper/hooks.go +++ b/x/ecosystemincentive/keeper/hooks.go @@ -21,18 +21,18 @@ func (h Hooks) AfterNftPaymentWithCommission(ctx sdk.Context, nftIdentifier nftb // if there's no fee, return if !fee.IsZero() { // call RewardDistributionOfnftbackedloan method to update reward information - // for all the subjects of the nftmarke reward - if err := h.k.RewardDistributionOfnftbackedloan(ctx, nftIdentifier, fee); err != nil { + // for all the subjects of the nftbackedloan reward + if err := h.k.RewardDistributionOfNftbackedloan(ctx, nftIdentifier, fee); err != nil { panic(err) } } - // delete the recorded nft-id with incetive-unit-id - h.k.DeleteFrontendRecord(ctx, nftIdentifier) + // delete the recorded nft-id + _ = h.k.DeleteFrontendRecord(ctx, nftIdentifier) } // AfterNftUnlistedWithoutPayment is called every time nft is unlisted without payment func (h Hooks) AfterNftUnlistedWithoutPayment(ctx sdk.Context, nftIdentifier nftbackedloantypes.NftId) { - // delete the recorded nft-id with incetive-unit-id - h.k.DeleteFrontendRecord(ctx, nftIdentifier) + // delete the recorded nft-id + _ = h.k.DeleteFrontendRecord(ctx, nftIdentifier) } diff --git a/x/ecosystemincentive/keeper/hooks_test.go b/x/ecosystemincentive/keeper/hooks_test.go deleted file mode 100644 index 3957c57dc..000000000 --- a/x/ecosystemincentive/keeper/hooks_test.go +++ /dev/null @@ -1,186 +0,0 @@ -package keeper_test - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - - "github.com/UnUniFi/chain/x/ecosystemincentive/types" - nftbackedloantypes "github.com/UnUniFi/chain/x/nftbackedloan/types" -) - -func (suite *KeeperTestSuite) TestAfterNftPaymentWithCommission() { - tests := []struct { - testCase string - nftId nftbackedloantypes.NftId - reward sdk.Coin - recipientContainerId string - subjectAddrs []string - weights []sdk.Dec - recordedBefore bool - expectPass bool - // calculate the reward for recipientContainer using the default rate - expRewardForRecipientContainer sdk.Int - // calculate the reward for stakers using the default rate - expRewardForStakers sdk.Coin - }{ - { - testCase: "failure case since incentive unit id was not recorded with nft id", - nftId: nftbackedloantypes.NftId{ - ClassId: "class1", - TokenId: "nft1", - }, - reward: sdk.Coin{"uguu", sdk.NewInt(100)}, - recipientContainerId: "recipientContainerId1", - subjectAddrs: []string{ - suite.addrs[0].String(), - }, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1")}, - recordedBefore: false, - expectPass: false, - }, - { - testCase: "failure case since there's no fee to distribute", - nftId: nftbackedloantypes.NftId{ - ClassId: "class2", - TokenId: "nft2", - }, - reward: sdk.Coin{"uguu", sdk.NewInt(0)}, - recipientContainerId: "recipientContainerId1", - subjectAddrs: []string{ - suite.addrs[0].String(), - }, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1")}, - recordedBefore: true, - expectPass: false, - }, - { - testCase: "ordinal case", - nftId: nftbackedloantypes.NftId{ - ClassId: "class3", - TokenId: "nft3", - }, - reward: sdk.Coin{"uguu", sdk.NewInt(100)}, - recipientContainerId: "recipientContainerId3", - subjectAddrs: []string{ - suite.addrs[0].String(), - }, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1")}, - recordedBefore: true, - expectPass: true, - expRewardForRecipientContainer: sdk.MustNewDecFromStr("0.5").MulInt(sdk.NewInt(100)).TruncateInt(), - expRewardForStakers: sdk.NewCoin("uguu", sdk.MustNewDecFromStr("0.5").MulInt(sdk.NewInt(100)).TruncateInt()), - }, - { - testCase: "ordinal case", - nftId: nftbackedloantypes.NftId{ - ClassId: "class4", - TokenId: "nft4", - }, - reward: sdk.Coin{"uguu", sdk.NewInt(100)}, - recipientContainerId: "recipientContainerId4", - subjectAddrs: []string{ - suite.addrs[0].String(), - }, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1")}, - recordedBefore: true, - expectPass: true, - expRewardForRecipientContainer: sdk.MustNewDecFromStr("0.5").MulInt(sdk.NewInt(100)).TruncateInt(), - expRewardForStakers: sdk.NewCoin("uguu", sdk.MustNewDecFromStr("0.5").MulInt(sdk.NewInt(100)).TruncateInt()), - }, - } - - for _, tc := range tests { - suite.SetupTest() - - if tc.recordedBefore { - suite.app.EcosystemincentiveKeeper.RecordRecipientWithNftId(suite.ctx, tc.nftId, tc.recipientContainerId) - } - - _ = suite.app.BankKeeper.MintCoins(suite.ctx, minttypes.ModuleName, sdk.Coins{tc.reward}) - _ = suite.app.BankKeeper.SendCoinsFromModuleToModule(suite.ctx, minttypes.ModuleName, types.ModuleName, sdk.Coins{tc.reward}) - - suite.app.EcosystemincentiveKeeper.Hooks().AfterNftPaymentWithCommission(suite.ctx, tc.nftId, tc.reward) - - if tc.expectPass { - totalRewardForRecipientContainer := sdk.ZeroInt() - for _, subject := range tc.subjectAddrs { - rewardStore, exists := suite.app.EcosystemincentiveKeeper.GetRewardRecord(suite.ctx, sdk.AccAddress(subject)) - totalRewardForRecipientContainer = totalRewardForRecipientContainer.Add(rewardStore.Rewards.AmountOf(tc.reward.Denom)) - suite.Require().True(exists) - } - suite.Require().Equal(tc.expRewardForRecipientContainer, totalRewardForRecipientContainer) - - // check the reward distribution for stakers by checking the balance of the fee_collector module account - feeCollectorAcc := suite.app.AccountKeeper.GetModuleAddress(types.ModuleName) - feeCollectorAccBalance := suite.app.BankKeeper.GetBalance(suite.ctx, feeCollectorAcc, tc.reward.Denom) - suite.Require().Equal(tc.expRewardForStakers, feeCollectorAccBalance) - } else { - for _, subject := range tc.subjectAddrs { - _, exists := suite.app.EcosystemincentiveKeeper.GetRewardStore(suite.ctx, sdk.AccAddress(subject)) - suite.Require().False(exists) - } - } - - _, exists := suite.app.EcosystemincentiveKeeper.GetRecipientContainerIdByNftId(suite.ctx, tc.nftId) - suite.Require().False(exists) - } -} - -func (suite *KeeperTestSuite) TestAfterNftUnlistedWithoutPayment() { - tests := []struct { - testCase string - nftId nftbackedloantypes.NftId - recipientContainerId string - subjectAddrs []string - weights []sdk.Dec - registerBefore bool - expectPass bool - }{ - { - testCase: "ordinal case", - nftId: nftbackedloantypes.NftId{ - ClassId: "class1", - TokenId: "nft1", - }, - recipientContainerId: "recipientContainerId1", - subjectAddrs: []string{ - suite.addrs[0].String(), - }, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1")}, - registerBefore: true, - }, - { - testCase: "not recorded case", - nftId: nftbackedloantypes.NftId{ - ClassId: "class2", - TokenId: "nft2", - }, - recipientContainerId: "recipientContainerId2", - subjectAddrs: []string{ - suite.addrs[0].String(), - }, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1")}, - registerBefore: true, - }, - } - - for _, tc := range tests { - _, err := suite.app.EcosystemincentiveKeeper.Register(suite.ctx, &types.MsgRegister{ - Sender: tc.subjectAddrs[0], - RecipientContainerId: tc.recipientContainerId, - Addresses: tc.subjectAddrs, - Weights: tc.weights, - }) - suite.Require().NoError(err) - if tc.registerBefore { - suite.app.EcosystemincentiveKeeper.RecordRecipientContainerIdWithNftId(suite.ctx, tc.nftId, tc.recipientContainerId) - } - - suite.NotPanics(func() { - suite.app.EcosystemincentiveKeeper.Hooks().AfterNftUnlistedWithoutPayment(suite.ctx, tc.nftId) - }) - - _, exists := suite.app.EcosystemincentiveKeeper.GetRecipientContainerIdByNftId(suite.ctx, tc.nftId) - suite.Require().False(exists) - } -} diff --git a/x/ecosystemincentive/keeper/nftbackedloan_frontend.go b/x/ecosystemincentive/keeper/nftbackedloan_frontend.go index 97fa61b70..1ee40b343 100644 --- a/x/ecosystemincentive/keeper/nftbackedloan_frontend.go +++ b/x/ecosystemincentive/keeper/nftbackedloan_frontend.go @@ -15,7 +15,7 @@ import ( ) // RecordRecipientWithNftId is for recording recipient with nftId -// to know of the receriver of the incentive reward for the frontend creator +// to know of the recipient of the incentive reward for the frontend creator // of nftbackedloan in AfterNftPaymentWithCommission method. func (k Keeper) RecordRecipientWithNftId(ctx sdk.Context, nftId nftbackedloantypes.NftId, recipient string) error { if _, exists := k.GetRecipientByNftId(ctx, nftId); exists { @@ -28,11 +28,11 @@ func (k Keeper) RecordRecipientWithNftId(ctx sdk.Context, nftId nftbackedloantyp } // emit event to tell it succeeded. - // err = ctx.EventManager().EmitTypedEvent(&types.EventRecordedRecipientContainerId{ - // RecipientContainerId: recipientContainerId, - // ClassId: nftId.ClassId, - // NftId: nftId.NftId, - // }) + err = ctx.EventManager().EmitTypedEvent(&types.EventRecordedRecipientWithNftId{ + Recipient: recipient, + ClassId: nftId.ClassId, + TokenId: nftId.TokenId, + }) return err } @@ -43,7 +43,7 @@ func (k Keeper) DeleteFrontendRecord(ctx sdk.Context, nftId nftbackedloantypes.N // but not panic and just return recipient, exists := k.GetRecipientByNftId(ctx, nftId) if !exists { - return fmt.Errorf(sdkerrors.Wrap(types.ErrRecipientContainerIdByNftIdDoesntExist, nftId.String()).Error()) + return fmt.Errorf(sdkerrors.Wrap(types.ErrRecipientByNftIdNotExist, nftId.String()).Error()) } @@ -51,9 +51,9 @@ func (k Keeper) DeleteFrontendRecord(ctx sdk.Context, nftId nftbackedloantypes.N // emit event for telling the nftId is deleted from the KVStore err := ctx.EventManager().EmitTypedEvent(&types.EventDeletedNftIdRecordedForFrontendReward{ - RecipientContainerId: recipient, - ClassId: nftId.ClassId, - TokenId: nftId.TokenId, + Recipient: recipient, + ClassId: nftId.ClassId, + TokenId: nftId.TokenId, }) return err @@ -61,7 +61,7 @@ func (k Keeper) DeleteFrontendRecord(ctx sdk.Context, nftId nftbackedloantypes.N func (k Keeper) SetRecipientByNftId(ctx sdk.Context, nftIdByte nftbackedloantypes.NftId, recipient string) error { store := ctx.KVStore(k.storeKey) - prefixStore := prefix.NewStore(store, []byte(types.KeyPrefixRecipientContainerIdByNftId)) + prefixStore := prefix.NewStore(store, []byte(types.KeyPrefixRecipientByNftId)) prefixStore.Set(nftIdByte.IdBytes(), []byte(recipient)) return nil @@ -69,7 +69,7 @@ func (k Keeper) SetRecipientByNftId(ctx sdk.Context, nftIdByte nftbackedloantype func (k Keeper) GetRecipientByNftId(ctx sdk.Context, nftId nftbackedloantypes.NftId) (string, bool) { store := ctx.KVStore(k.storeKey) - prefixStore := prefix.NewStore(store, []byte(types.KeyPrefixRecipientContainerIdByNftId)) + prefixStore := prefix.NewStore(store, []byte(types.KeyPrefixRecipientByNftId)) bz := prefixStore.Get(nftId.IdBytes()) if bz == nil { @@ -83,7 +83,7 @@ func (k Keeper) GetRecipientByNftId(ctx sdk.Context, nftId nftbackedloantypes.Nf func (k Keeper) DeleteRecipientByNftId(ctx sdk.Context, nftId nftbackedloantypes.NftId) { // Delete incentive unit id by nft id store := ctx.KVStore(k.storeKey) - prefixStore := prefix.NewStore(store, []byte(types.KeyPrefixRecipientContainerIdByNftId)) + prefixStore := prefix.NewStore(store, []byte(types.KeyPrefixRecipientByNftId)) prefixStore.Delete(nftId.IdBytes()) } @@ -105,11 +105,11 @@ func (k Keeper) AccumulateRewardForFrontend(ctx sdk.Context, recipient string, r panic(err) } - // emit event to inform that the recipientContainer defined by recipientContainerId + // emit event to inform the recipient // received new reward _ = ctx.EventManager().EmitTypedEvent(&types.EventUpdatedReward{ - RecipientContainerId: recipient, - EarnedReward: reward, + Recipient: recipient, + EarnedReward: reward, }) return nil } diff --git a/x/ecosystemincentive/keeper/nftbackedloan_frontend_test.go b/x/ecosystemincentive/keeper/nftbackedloan_frontend_test.go index 31cd318c8..d27a82c6e 100644 --- a/x/ecosystemincentive/keeper/nftbackedloan_frontend_test.go +++ b/x/ecosystemincentive/keeper/nftbackedloan_frontend_test.go @@ -1,241 +1,19 @@ package keeper_test import ( - "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - // nfttypes "github.com/cosmos/cosmos-sdk/x/nft" - - "github.com/cometbft/cometbft/crypto/ed25519" - "github.com/UnUniFi/chain/x/ecosystemincentive/types" nftbackedloantypes "github.com/UnUniFi/chain/x/nftbackedloan/types" ) -func (suite *KeeperTestSuite) TestRecordIncentiveUnitIdWithNftId() { - sender := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) - - tests := []struct { - testCase string - classId string - nftId string - recipientContainerId string - subjectAddrs []string - weights []sdk.Dec - registerBefore bool - expectPass bool - }{ - { - testCase: "not registered", - classId: "class1", - nftId: "nft1", - recipientContainerId: "id1", - subjectAddrs: []string{sender.String()}, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1.0")}, - registerBefore: false, - expectPass: false, - }, - { - testCase: "registered", - classId: "class2", - nftId: "nft2", - recipientContainerId: "id2", - subjectAddrs: []string{sender.String()}, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1.0")}, - registerBefore: true, - expectPass: true, - }, - { - testCase: "already recorded", - classId: "class2", - nftId: "nft2", - recipientContainerId: "id3", - subjectAddrs: []string{sender.String()}, - weights: []sdk.Dec{sdk.MustNewDecFromStr("1.0")}, - registerBefore: true, - expectPass: false, - }, - } - for _, test := range tests { - nftId := nftbackedloantypes.NftId{ - ClassId: test.classId, - TokenId: test.nftId, - } - - if test.registerBefore { - _, _ = suite.app.EcosystemincentiveKeeper.Register( - suite.ctx, - &types.MsgRegister{ - Sender: sender.String(), - RecipientContainerId: test.recipientContainerId, - Addresses: test.subjectAddrs, - Weights: test.weights, - }, - ) - - err := suite.RecordIncentiveUnitIdWithNftIdTest(suite.ctx, nftId, test.recipientContainerId) - - if test.expectPass { - suite.Require().NoError(err) - } else { - suite.Require().Error(err) - } - } else { - err := suite.RecordIncentiveUnitIdWithNftIdTest(suite.ctx, nftId, test.recipientContainerId) - suite.Require().Error(err) - } - } -} - -func (suite *KeeperTestSuite) TestAccumulateRewardForFrontend() { - sender := sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()) - - tests := []struct { - testCase string - recipientContainerId string - subjectAddrs []string - weights []sdk.Dec - fee sdk.Coin - nftId nftbackedloantypes.NftId - rewardAmount math.Int - expect bool - record bool - multipleSubject bool - amplify bool - }{ - { - testCase: "not recorded", - recipientContainerId: "failure", - subjectAddrs: []string{sender.String()}, - weights: []sdk.Dec{sdk.OneDec()}, - fee: sdk.Coin{}, - nftId: nftbackedloantypes.NftId{ - ClassId: "class2", - TokenId: "nft2", - }, - expect: false, - record: false, - multipleSubject: false, - amplify: false, - }, - { - testCase: "single success case", - recipientContainerId: "id1", - subjectAddrs: []string{sender.String()}, - weights: []sdk.Dec{sdk.OneDec()}, - fee: sdk.Coin{ - Denom: "uguu", - Amount: sdk.NewInt(1000), - }, - nftId: nftbackedloantypes.NftId{ - ClassId: "class1", - TokenId: "nft1", - }, - expect: true, - record: true, - multipleSubject: false, - amplify: false, - }, - { - testCase: "multiple subject case", - recipientContainerId: "id2", - subjectAddrs: []string{ - sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()).String(), - sdk.AccAddress(ed25519.GenPrivKey().PubKey().Address().Bytes()).String(), - }, - weights: []sdk.Dec{ - sdk.MustNewDecFromStr("0.5"), - sdk.MustNewDecFromStr("0.5"), - }, - fee: sdk.Coin{Denom: "uguu", Amount: math.NewInt(1000)}, - nftId: nftbackedloantypes.NftId{ - ClassId: "class2", - TokenId: "nft2", - }, - expect: true, - record: true, - multipleSubject: true, - amplify: false, - }, - { - testCase: "amplify case", - recipientContainerId: "id1", - subjectAddrs: []string{sender.String()}, - weights: []sdk.Dec{sdk.OneDec()}, - fee: sdk.Coin{ - Denom: "uguu", - Amount: sdk.NewInt(1000), - }, - nftId: nftbackedloantypes.NftId{ - ClassId: "class3", - TokenId: "nft3", - }, - rewardAmount: math.NewInt(500), - expect: true, - record: true, - multipleSubject: false, - amplify: true, - }, - } - - for _, test := range tests { - _, _ = suite.app.EcosystemincentiveKeeper.Register( - suite.ctx, - &types.MsgRegister{ - Sender: sender.String(), - RecipientContainerId: test.recipientContainerId, - Addresses: test.subjectAddrs, - Weights: test.weights, - }) - - if test.record { - suite.app.EcosystemincentiveKeeper.RecordRecipientContainerIdWithNftId(suite.ctx, test.nftId, test.recipientContainerId) - } - - if test.expect { - err := suite.AccumulateRewardForFrontendTest(suite.ctx, test.nftId, test.fee) - suite.Require().NoError(err) - - // check the actual accumalted reward amount - feeRate := suite.app.EcosystemincentiveKeeper.GetnftbackedloanFrontendRewardRate(suite.ctx) - rewardAmount := feeRate.MulInt(test.fee.Amount).RoundInt() - if test.multipleSubject { - for index := range test.weights { - rewardStore, _ := suite.app.EcosystemincentiveKeeper.GetRewardStore(suite.ctx, sdk.AccAddress(test.subjectAddrs[index])) - suite.Require().Equal(test.weights[index].MulInt(rewardAmount).RoundInt(), rewardStore.Rewards.AmountOf(test.fee.Denom)) - } - } else if test.amplify { - rewardStore, _ := suite.app.EcosystemincentiveKeeper.GetRewardStore(suite.ctx, sdk.AccAddress(test.subjectAddrs[0])) - suite.Require().Equal(test.weights[0].MulInt(rewardAmount).RoundInt().Add(test.rewardAmount), rewardStore.Rewards.AmountOf(test.fee.Denom)) - } else { - rewardStore, _ := suite.app.EcosystemincentiveKeeper.GetRewardStore(suite.ctx, sdk.AccAddress(test.subjectAddrs[0])) - suite.Require().Equal(test.weights[0].MulInt(rewardAmount).RoundInt(), rewardStore.Rewards.AmountOf(test.fee.Denom)) - } - } else { - err := suite.AccumulateRewardForFrontendTest(suite.ctx, test.nftId, test.fee) - suite.Require().Error(err) - - _, exists := suite.app.EcosystemincentiveKeeper.GetRewardStore(suite.ctx, sender) - suite.Require().False(exists) - } - } -} - -// RecordIncentiveUnitIdWithNftIdTest is a mehtod to have the exact same logic -// for being used in test cases to return error as return value -// since the normal RecordIncentiveUnitIdWithNftId doesn't return any value by intention -func (suite *KeeperTestSuite) RecordIncentiveUnitIdWithNftIdTest(ctx sdk.Context, nftId nftbackedloantypes.NftId, recipientContainerId string) error { +func (suite *KeeperTestSuite) RecordRecipientWithNftIdTest(ctx sdk.Context, nftId nftbackedloantypes.NftId, recipient string) error { // panic if the nftId is already recorded in the store. - if _, exists := suite.app.EcosystemincentiveKeeper.GetRecipientContainerIdByNftId(ctx, nftId); exists { + if _, exists := suite.app.EcosystemincentiveKeeper.GetRecipientByNftId(ctx, nftId); exists { return types.ErrRecordedNftId } - // check recipientContainerId is already registered - if _, exists := suite.app.EcosystemincentiveKeeper.GetRecipientContainer(ctx, recipientContainerId); !exists { - return types.ErrNotRegisteredRecipientContainerId - } - - if err := suite.app.EcosystemincentiveKeeper.SetRecipientContainerIdByNftId(ctx, nftId, recipientContainerId); err != nil { + if err := suite.app.EcosystemincentiveKeeper.SetRecipientByNftId(ctx, nftId, recipient); err != nil { return err } @@ -244,44 +22,25 @@ func (suite *KeeperTestSuite) RecordIncentiveUnitIdWithNftIdTest(ctx sdk.Context // Just mock method to use in only test func (suite *KeeperTestSuite) AccumulateRewardForFrontendTest(ctx sdk.Context, nftId nftbackedloantypes.NftId, fee sdk.Coin) error { - // get recipientContainerId by nftId from IncentiveUnitIdByNftId KVStore - recipientContainerId, exists := suite.app.EcosystemincentiveKeeper.GetRecipientContainerIdByNftId(ctx, nftId) + // get recipient by nftId + recipient, exists := suite.app.EcosystemincentiveKeeper.GetRecipientByNftId(ctx, nftId) if !exists { - return types.ErrRegisteredIncentiveId + return types.ErrNotRegisteredRecipient } - incentiveUnit, exists := suite.app.EcosystemincentiveKeeper.GetRecipientContainer(ctx, recipientContainerId) - if !exists { - return types.ErrNotRegisteredRecipientContainerId - } - - nftbackedloanFrontendRewardRate := suite.app.EcosystemincentiveKeeper.GetnftbackedloanFrontendRewardRate(ctx) + nftbackedloanFrontendRewardRate := suite.app.EcosystemincentiveKeeper.GetNftbackedloanFrontendRewardRate(ctx) // if the reward rate was not found, emit panic if nftbackedloanFrontendRewardRate == sdk.ZeroDec() { return types.ErrRewardRateNotFound } - // rewardAmountForAll = fee * rewardRate - rewardAmountForAll := nftbackedloanFrontendRewardRate.MulInt(fee.Amount).RoundInt() - - for _, subjectInfo := range incentiveUnit.WeightedAddresses { - rewardStore, exists := suite.app.EcosystemincentiveKeeper.GetRewardStore(ctx, sdk.AccAddress(subjectInfo.Address)) - if !exists { - rewardStore = types.NewRewardStore(subjectInfo.Address, nil) - } - - weight := subjectInfo.Weight - - // calculate actual reward to distribute for the subject addr by considering - // its weight defined in IncentivenUnit - // newRewardAmount = weight * rewardAmountForAll - newRewardAmount := weight.MulInt(rewardAmountForAll).RoundInt() - rewardCoin := sdk.NewCoin(fee.Denom, newRewardAmount) - rewardStore.Rewards = rewardStore.Rewards.Add(sdk.NewCoins(rewardCoin)...) - if err := suite.app.EcosystemincentiveKeeper.SetRewardStore(ctx, rewardStore); err != nil { - return err - } + reward, exists := suite.app.EcosystemincentiveKeeper.GetRewardRecord(ctx, sdk.AccAddress(recipient)) + if !exists { + reward = types.NewRewardRecord(recipient, nil) + } + if err := suite.app.EcosystemincentiveKeeper.SetRewardRecord(ctx, reward); err != nil { + return err } return nil diff --git a/x/ecosystemincentive/keeper/reward_service.go b/x/ecosystemincentive/keeper/reward_service.go index 0dfc14eb7..1e4d57749 100644 --- a/x/ecosystemincentive/keeper/reward_service.go +++ b/x/ecosystemincentive/keeper/reward_service.go @@ -9,30 +9,29 @@ import ( nftbackedloantypes "github.com/UnUniFi/chain/x/nftbackedloan/types" ) -func (k Keeper) RewardDistributionOfnftbackedloan(ctx sdk.Context, nftId nftbackedloantypes.NftId, fee sdk.Coin) error { +func (k Keeper) RewardDistributionOfNftbackedloan(ctx sdk.Context, nftId nftbackedloantypes.NftId, fee sdk.Coin) error { totalReward := sdk.ZeroInt() rewardForCommunityPool := sdk.ZeroInt() - // First, get recipientContainerId by nftId from RecipientContainerIdByNftId KVStore - // If the recipientContainerId doesn't exist, return nil and distribute the reward for the frontend + // First, get recipient by nftId from RecipientByNftId KVStore + // If the recipient doesn't exist, return nil and distribute the reward for the frontend // to the treasury. nftbackedloanFrontendRewardRate := k.GetNftbackedloanFrontendRewardRate(ctx) if nftbackedloanFrontendRewardRate == sdk.ZeroDec() { return sdkerrors.Wrap(types.ErrRewardRateIsZero, "nftbackedloan frontend") } - rewardForRecipientContainer := nftbackedloanFrontendRewardRate.MulInt(fee.Amount).TruncateInt() - totalReward = totalReward.Add(rewardForRecipientContainer) - recipientContainerId, exists := k.GetRecipientByNftId(ctx, nftId) - if !exists { - // emit event to inform the nftId is not associated with recipientContainerId and return + rewardForRecipient := nftbackedloanFrontendRewardRate.MulInt(fee.Amount).TruncateInt() + totalReward = totalReward.Add(rewardForRecipient) + recipient, exist := k.GetRecipientByNftId(ctx, nftId) + if !exist { + // emit event to inform the nftId is not associated with recipient and return _ = ctx.EventManager().EmitTypedEvent(&types.EventNotRecordedNftId{ ClassId: nftId.ClassId, TokenId: nftId.TokenId, }) - // Distribute the reward to the community pool if there's no recipientContainerId associated with the nftId - rewardForCommunityPool = rewardForCommunityPool.Add(rewardForRecipientContainer) - } else { - rewardForRecipientContainer = sdk.ZeroInt() + // Distribute the reward to the community pool if there's no recipient associated with the nftId + rewardForCommunityPool = rewardForCommunityPool.Add(rewardForRecipient) + rewardForRecipient = sdk.ZeroInt() } stakersRewardRate := k.GetStakersRewardRate(ctx) @@ -57,8 +56,8 @@ func (k Keeper) RewardDistributionOfnftbackedloan(ctx sdk.Context, nftId nftback } // Distribute the reward to the recipients if the reward exists - if !rewardForRecipientContainer.IsZero() { - if err := k.AccumulateRewardForFrontend(ctx, recipientContainerId, sdk.NewCoin(fee.Denom, rewardForRecipientContainer)); err != nil { + if !rewardForRecipient.IsZero() { + if err := k.AccumulateRewardForFrontend(ctx, recipient, sdk.NewCoin(fee.Denom, rewardForRecipient)); err != nil { return err } } diff --git a/x/ecosystemincentive/keeper/reward_service_test.go b/x/ecosystemincentive/keeper/reward_service_test.go index b1e0f36f4..0e08832a6 100644 --- a/x/ecosystemincentive/keeper/reward_service_test.go +++ b/x/ecosystemincentive/keeper/reward_service_test.go @@ -9,7 +9,7 @@ import ( nftbackedloantypes "github.com/UnUniFi/chain/x/nftbackedloan/types" ) -func (suite *KeeperTestSuite) TestRewardDistributionOfnftbackedloan() { +func (suite *KeeperTestSuite) TestRewardDistributionOfNftbackedloan() { testCases := []struct { testCase string nftId nftbackedloantypes.NftId @@ -42,7 +42,7 @@ func (suite *KeeperTestSuite) TestRewardDistributionOfnftbackedloan() { _ = suite.app.BankKeeper.SendCoinsFromModuleToModule(suite.ctx, minttypes.ModuleName, types.ModuleName, sdk.Coins{tc.reward}) if tc.success { - err := suite.app.EcosystemincentiveKeeper.RewardDistributionOfnftbackedloan(suite.ctx, tc.nftId, tc.reward) + err := suite.app.EcosystemincentiveKeeper.RewardDistributionOfNftbackedloan(suite.ctx, tc.nftId, tc.reward) suite.Require().NoError(err) // TODO: check the reward distribution by seeing the balance of the approriate accounts @@ -50,7 +50,7 @@ func (suite *KeeperTestSuite) TestRewardDistributionOfnftbackedloan() { // reward := suite.app.BankKeeper.GetBalance(suite.ctx, suite.app.EcosystemincentiveKeeper.GetnftbackedloanAddress(suite.ctx), tc.reward.Denom) // suite.Require().Equal(tc.reward, reward) } else { - err := suite.app.EcosystemincentiveKeeper.RewardDistributionOfnftbackedloan(suite.ctx, tc.nftId, tc.reward) + err := suite.app.EcosystemincentiveKeeper.RewardDistributionOfNftbackedloan(suite.ctx, tc.nftId, tc.reward) suite.Require().Error(err) } } diff --git a/x/ecosystemincentive/keeper/test/01_record_recipient_with_nft.sh b/x/ecosystemincentive/keeper/test/01_record_recipient_with_nft.sh new file mode 100644 index 000000000..6495c2953 --- /dev/null +++ b/x/ecosystemincentive/keeper/test/01_record_recipient_with_nft.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# block speed +sleep=5 +class_id=test +token_id=a01 +user1_address=ununifi155u042u8wk3al32h3vzxu989jj76k4zcu44v6w + +echo "------------create class------------" +ununifid tx nftfactory create-class $class_id \ +--from user1 --keyring-backend test --chain-id test --yes + +class_id=$(ununifid q nftfactory classes-from-creator $user1_address -o json | jq .classes[0] | tr -d '"') + +sleep $sleep + +echo "------------mint nft------------" +ununifid tx nftfactory mint-nft \ +$class_id $token_id $user1_address \ +--from user1 --keyring-backend test --chain-id test --yes + +sleep $sleep + +echo "------------list nft------------" +ununifid tx nftbackedloan list \ +$class_id $token_id \ +--note "{\"frontend\":{\"version\": 1, \"recipient\": \"$user1_address\"}}" \ +--from user1 --keyring-backend test --chain-id test --yes + +sleep $sleep + +echo "------------check recipient registered------------" +recipient_address=$(ununifid q ecosystem-incentive recipient-with-nft $class_id $token_id -o json | jq .address | tr -d '"') + +if [ "$user1_address" = "$recipient_address" ]; then + echo "pass: registered recipient is correct: $recipient_address" +else + echo "error: registered recipient is incorrect:" + echo "initial: $user1_address actual: $recipient_address" +fi \ No newline at end of file diff --git a/x/ecosystemincentive/keeper/test/02_nftbackedloan_reward.sh b/x/ecosystemincentive/keeper/test/02_nftbackedloan_reward.sh new file mode 100644 index 000000000..a737b8157 --- /dev/null +++ b/x/ecosystemincentive/keeper/test/02_nftbackedloan_reward.sh @@ -0,0 +1,73 @@ +#!/bin/sh + +# block speed +sleep=5 +class_id=test +token_id=a01 +user1_address=ununifi155u042u8wk3al32h3vzxu989jj76k4zcu44v6w +user2_address=ununifi1v0h8j7x7kfys29kj4uwdudcc9y0nx6twwxahla + +echo "------------create class------------" +ununifid tx nftfactory create-class $class_id \ +--from user1 --keyring-backend test --chain-id test --yes + +sleep $sleep + +class_id=$(ununifid q nftfactory classes-from-creator $user1_address -o json | jq .classes[0] | tr -d '"') + +echo "------------mint nft------------" +ununifid tx nftfactory mint-nft \ +$class_id $token_id $user1_address \ +--from user1 --keyring-backend test --chain-id test --yes + +sleep $sleep + +echo "------------list nft------------" +ununifid tx nftbackedloan list \ +$class_id $token_id \ +--note "{\"frontend\":{\"version\": 1, \"recipient\": \"$user1_address\"}}" \ +--from user1 --keyring-backend test --chain-id test --yes + +sleep $sleep + +echo "------------bid nft from user2------------" +ununifid tx nftbackedloan place-bid \ +$class_id $token_id \ +200uguu 50uguu 0.1 7200 --automatic-payment=false --from user2 --keyring-backend test --chain-id test --yes + +sleep $sleep + +echo "------------selling decision------------" +ununifid tx nftbackedloan selling-decision \ +$class_id $token_id \ +--from user1 --keyring-backend test --chain-id test --yes + +sleep $sleep + +echo "------------pay remainder------------" +ununifid tx nftbackedloan pay-remainder \ +$class_id $token_id \ +--from user2 --keyring-backend test --chain-id test --yes + +sleep $sleep + +echo "============check nft status selling_decision ============" +ununifid q nftbackedloan nft-listing $class_id $token_id + +echo "wait.......... NftListingFullPaymentPeriod: 30s" +sleep 30 + +echo "============check nft status successful_bid ============" +ununifid q nftbackedloan nft-listing $class_id $token_id + +echo "wait.......... NftListingNftDeliveryPeriod: 30s" +sleep 30 + +reward=$(ununifid q ecosystem-incentive all-rewards $user1_address -o json | jq .reward_record.rewards[0].amount | tr -d '"') +denom=$(ununifid q ecosystem-incentive all-rewards $user1_address -o json | jq .reward_record.rewards[0].denom | tr -d '"') + +if [ "$reward" -gt "0" ]; then + echo "pass: reward exist: $reward $denom" +else + echo "error: reward not exist: $reward" +fi diff --git a/x/ecosystemincentive/types/errors.go b/x/ecosystemincentive/types/errors.go index 03d903996..0b2de4d7d 100644 --- a/x/ecosystemincentive/types/errors.go +++ b/x/ecosystemincentive/types/errors.go @@ -5,20 +5,14 @@ import ( ) var ( - ErrInvalidTotalWeight = sdkerrors.Register(ModuleName, 1, "total weight in an incentive_unit is invalid") - ErrSubjectsWeightsNumUnmatched = sdkerrors.Register(ModuleName, 2, "the numbers of subjects and weights must be same") - ErrRegisteredIncentiveId = sdkerrors.Register(ModuleName, 3, "the incentive id is already used") - ErrRewardNotExists = sdkerrors.Register(ModuleName, 4, "the reward for the subject doesn't exist") - ErrDenomRewardNotExists = sdkerrors.Register(ModuleName, 5, "the reward of the denom for the subject doesn't exist") - ErrCoinAmount = sdkerrors.Register(ModuleName, 6, "must be 0 amount after sending token") - ErrRecordedNftId = sdkerrors.Register(ModuleName, 7, "the nft_id is already recorded") - ErrNotRegisteredRecipientContainerId = sdkerrors.Register(ModuleName, 8, "the incentive_unit_id is not registered") - ErrRecipientContainerIdByNftIdDoesntExist = sdkerrors.Register(ModuleName, 9, "the nft_id is not recorded with any incentive-unit") - ErrRewardRateNotFound = sdkerrors.Register(ModuleName, 10, "the reward rate in the params was not found") - ErrAddressNotHaveReward = sdkerrors.Register(ModuleName, 11, "the address doesn't have any rewards") - ErrUnknownMemoVersion = sdkerrors.Register(ModuleName, 12, "the version in the memo inputs is unknown") - ErrInvalidRecipientContainerId = sdkerrors.Register(ModuleName, 13, "recipient container id includes invalid characteres") - ErrAddressNotHasRecipientContainerId = sdkerrors.Register(ModuleName, 14, "the address deosn't have any incentive unit id") - ErrRewardExceedsFee = sdkerrors.Register(ModuleName, 15, "the total reward exceeds the fee") - ErrRewardRateIsZero = sdkerrors.Register(ModuleName, 16, "the reward rate is set zero for") + ErrRewardNotExists = sdkerrors.Register(ModuleName, 1, "the reward for the subject doesn't exist") + ErrDenomRewardNotExists = sdkerrors.Register(ModuleName, 2, "the reward of the denom for the subject doesn't exist") + ErrCoinAmount = sdkerrors.Register(ModuleName, 3, "must be 0 amount after sending token") + ErrRecordedNftId = sdkerrors.Register(ModuleName, 4, "the nft_id is already recorded") + ErrNotRegisteredRecipient = sdkerrors.Register(ModuleName, 5, "the recipient is not registered") + ErrRecipientByNftIdNotExist = sdkerrors.Register(ModuleName, 6, "the recipient by nft_id doesn't exist") + ErrRewardRateNotFound = sdkerrors.Register(ModuleName, 7, "the reward rate in the params was not found") + ErrAddressNotHaveReward = sdkerrors.Register(ModuleName, 8, "the address doesn't have any rewards") + ErrRewardExceedsFee = sdkerrors.Register(ModuleName, 9, "the total reward exceeds the fee") + ErrRewardRateIsZero = sdkerrors.Register(ModuleName, 16, "the reward rate is set zero for") ) diff --git a/x/ecosystemincentive/types/event.pb.go b/x/ecosystemincentive/types/event.pb.go index 41be7c081..7f620d261 100644 --- a/x/ecosystemincentive/types/event.pb.go +++ b/x/ecosystemincentive/types/event.pb.go @@ -129,10 +129,70 @@ func (m *EventWithdrawReward) GetWithdrawnReward() types.Coin { return types.Coin{} } +type EventRecordedRecipientWithNftId struct { + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` + ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty" yaml:"class_id"` + TokenId string `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" yaml:"token_id"` +} + +func (m *EventRecordedRecipientWithNftId) Reset() { *m = EventRecordedRecipientWithNftId{} } +func (m *EventRecordedRecipientWithNftId) String() string { return proto.CompactTextString(m) } +func (*EventRecordedRecipientWithNftId) ProtoMessage() {} +func (*EventRecordedRecipientWithNftId) Descriptor() ([]byte, []int) { + return fileDescriptor_4bc2d07e5e7a71a2, []int{2} +} +func (m *EventRecordedRecipientWithNftId) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRecordedRecipientWithNftId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRecordedRecipientWithNftId.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventRecordedRecipientWithNftId) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRecordedRecipientWithNftId.Merge(m, src) +} +func (m *EventRecordedRecipientWithNftId) XXX_Size() int { + return m.Size() +} +func (m *EventRecordedRecipientWithNftId) XXX_DiscardUnknown() { + xxx_messageInfo_EventRecordedRecipientWithNftId.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRecordedRecipientWithNftId proto.InternalMessageInfo + +func (m *EventRecordedRecipientWithNftId) GetRecipient() string { + if m != nil { + return m.Recipient + } + return "" +} + +func (m *EventRecordedRecipientWithNftId) GetClassId() string { + if m != nil { + return m.ClassId + } + return "" +} + +func (m *EventRecordedRecipientWithNftId) GetTokenId() string { + if m != nil { + return m.TokenId + } + return "" +} + type EventDeletedNftIdRecordedForFrontendReward struct { - RecipientContainerId string `protobuf:"bytes,1,opt,name=recipient_container_id,json=recipientContainerId,proto3" json:"recipient_container_id,omitempty" yaml:"recipient_container_id"` - ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty" yaml:"class_id"` - TokenId string `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" yaml:"nft_id"` + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` + ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty" yaml:"class_id"` + TokenId string `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" yaml:"token_id"` } func (m *EventDeletedNftIdRecordedForFrontendReward) Reset() { @@ -143,7 +203,7 @@ func (m *EventDeletedNftIdRecordedForFrontendReward) String() string { } func (*EventDeletedNftIdRecordedForFrontendReward) ProtoMessage() {} func (*EventDeletedNftIdRecordedForFrontendReward) Descriptor() ([]byte, []int) { - return fileDescriptor_4bc2d07e5e7a71a2, []int{2} + return fileDescriptor_4bc2d07e5e7a71a2, []int{3} } func (m *EventDeletedNftIdRecordedForFrontendReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -172,9 +232,9 @@ func (m *EventDeletedNftIdRecordedForFrontendReward) XXX_DiscardUnknown() { var xxx_messageInfo_EventDeletedNftIdRecordedForFrontendReward proto.InternalMessageInfo -func (m *EventDeletedNftIdRecordedForFrontendReward) GetRecipientContainerId() string { +func (m *EventDeletedNftIdRecordedForFrontendReward) GetRecipient() string { if m != nil { - return m.RecipientContainerId + return m.Recipient } return "" } @@ -195,14 +255,14 @@ func (m *EventDeletedNftIdRecordedForFrontendReward) GetTokenId() string { type EventNotRecordedNftId struct { ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty" yaml:"class_id"` - TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" yaml:"nft_id"` + TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" yaml:"token_id"` } func (m *EventNotRecordedNftId) Reset() { *m = EventNotRecordedNftId{} } func (m *EventNotRecordedNftId) String() string { return proto.CompactTextString(m) } func (*EventNotRecordedNftId) ProtoMessage() {} func (*EventNotRecordedNftId) Descriptor() ([]byte, []int) { - return fileDescriptor_4bc2d07e5e7a71a2, []int{3} + return fileDescriptor_4bc2d07e5e7a71a2, []int{4} } func (m *EventNotRecordedNftId) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -246,15 +306,15 @@ func (m *EventNotRecordedNftId) GetTokenId() string { } type EventUpdatedReward struct { - RecipientContainerId string `protobuf:"bytes,1,opt,name=recipient_container_id,json=recipientContainerId,proto3" json:"recipient_container_id,omitempty" yaml:"recipient_container_id"` - EarnedReward types.Coin `protobuf:"bytes,2,opt,name=earned_reward,json=earnedReward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"earned_reward" yaml:"earned_reward"` + Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` + EarnedReward types.Coin `protobuf:"bytes,2,opt,name=earned_reward,json=earnedReward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"earned_reward" yaml:"earned_reward"` } func (m *EventUpdatedReward) Reset() { *m = EventUpdatedReward{} } func (m *EventUpdatedReward) String() string { return proto.CompactTextString(m) } func (*EventUpdatedReward) ProtoMessage() {} func (*EventUpdatedReward) Descriptor() ([]byte, []int) { - return fileDescriptor_4bc2d07e5e7a71a2, []int{4} + return fileDescriptor_4bc2d07e5e7a71a2, []int{5} } func (m *EventUpdatedReward) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,9 +343,9 @@ func (m *EventUpdatedReward) XXX_DiscardUnknown() { var xxx_messageInfo_EventUpdatedReward proto.InternalMessageInfo -func (m *EventUpdatedReward) GetRecipientContainerId() string { +func (m *EventUpdatedReward) GetRecipient() string { if m != nil { - return m.RecipientContainerId + return m.Recipient } return "" } @@ -306,7 +366,7 @@ func (m *EventDistributionForStakers) Reset() { *m = EventDistributionFo func (m *EventDistributionForStakers) String() string { return proto.CompactTextString(m) } func (*EventDistributionForStakers) ProtoMessage() {} func (*EventDistributionForStakers) Descriptor() ([]byte, []int) { - return fileDescriptor_4bc2d07e5e7a71a2, []int{5} + return fileDescriptor_4bc2d07e5e7a71a2, []int{6} } func (m *EventDistributionForStakers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -352,14 +412,14 @@ func (m *EventDistributionForStakers) GetBlockHeight() int64 { type EventVersionUnmatched struct { UnmatchedVersion uint32 `protobuf:"varint,1,opt,name=unmatched_version,json=unmatchedVersion,proto3" json:"unmatched_version,omitempty" yaml:"unmatched_version"` ClassId string `protobuf:"bytes,2,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty" yaml:"class_id"` - NftId string `protobuf:"bytes,3,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty" yaml:"nft_id"` + TokenId string `protobuf:"bytes,3,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" yaml:"token_id"` } func (m *EventVersionUnmatched) Reset() { *m = EventVersionUnmatched{} } func (m *EventVersionUnmatched) String() string { return proto.CompactTextString(m) } func (*EventVersionUnmatched) ProtoMessage() {} func (*EventVersionUnmatched) Descriptor() ([]byte, []int) { - return fileDescriptor_4bc2d07e5e7a71a2, []int{6} + return fileDescriptor_4bc2d07e5e7a71a2, []int{7} } func (m *EventVersionUnmatched) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -402,9 +462,9 @@ func (m *EventVersionUnmatched) GetClassId() string { return "" } -func (m *EventVersionUnmatched) GetNftId() string { +func (m *EventVersionUnmatched) GetTokenId() string { if m != nil { - return m.NftId + return m.TokenId } return "" } @@ -412,6 +472,7 @@ func (m *EventVersionUnmatched) GetNftId() string { func init() { proto.RegisterType((*EventWithdrawAllRewards)(nil), "ununifi.ecosystemincentive.EventWithdrawAllRewards") proto.RegisterType((*EventWithdrawReward)(nil), "ununifi.ecosystemincentive.EventWithdrawReward") + proto.RegisterType((*EventRecordedRecipientWithNftId)(nil), "ununifi.ecosystemincentive.EventRecordedRecipientWithNftId") proto.RegisterType((*EventDeletedNftIdRecordedForFrontendReward)(nil), "ununifi.ecosystemincentive.EventDeletedNftIdRecordedForFrontendReward") proto.RegisterType((*EventNotRecordedNftId)(nil), "ununifi.ecosystemincentive.EventNotRecordedNftId") proto.RegisterType((*EventUpdatedReward)(nil), "ununifi.ecosystemincentive.EventUpdatedReward") @@ -424,52 +485,51 @@ func init() { } var fileDescriptor_4bc2d07e5e7a71a2 = []byte{ - // 710 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x95, 0x41, 0x4f, 0x1b, 0x39, - 0x14, 0xc7, 0xe3, 0xa0, 0x65, 0x59, 0x03, 0x02, 0x26, 0xb0, 0x04, 0x96, 0xcd, 0xb0, 0x73, 0xd8, - 0xcd, 0xae, 0x76, 0x67, 0xc4, 0x72, 0xe3, 0x46, 0x68, 0xd3, 0xa6, 0x6a, 0x51, 0x35, 0x55, 0x8a, - 0xd4, 0x4b, 0x34, 0x19, 0x3f, 0x12, 0x2b, 0x13, 0x3b, 0xb2, 0x9d, 0xa4, 0x7c, 0x82, 0x5e, 0x39, - 0xf5, 0xda, 0x7b, 0x3f, 0x43, 0x3f, 0x00, 0x47, 0xa4, 0x5e, 0x7a, 0x4a, 0x2b, 0x22, 0xf5, 0x03, - 0xe4, 0xd2, 0x6b, 0x15, 0xdb, 0x41, 0x84, 0x50, 0x4a, 0x0e, 0x3d, 0x8d, 0xed, 0xf7, 0xfc, 0x7f, - 0xff, 0xdf, 0xd3, 0xb3, 0x06, 0xff, 0xd9, 0x66, 0x6d, 0x46, 0x8f, 0x69, 0x00, 0x31, 0x97, 0x27, - 0x52, 0x41, 0x93, 0xb2, 0x18, 0x98, 0xa2, 0x1d, 0x08, 0xa0, 0x03, 0x4c, 0xf9, 0x2d, 0xc1, 0x15, - 0x77, 0x36, 0x6d, 0x9e, 0x3f, 0x99, 0xb7, 0xb9, 0x7b, 0x9b, 0xc6, 0xc4, 0x91, 0x11, 0xdc, 0x5c, - 0xad, 0xf1, 0x1a, 0xd7, 0xcb, 0x60, 0xb8, 0xb2, 0xa7, 0xb9, 0x98, 0xcb, 0x26, 0x97, 0x41, 0x35, - 0x92, 0x10, 0x74, 0x76, 0xaa, 0xa0, 0xa2, 0x9d, 0x20, 0xe6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d, 0x94, 0xe6, 0xbf, 0xd5, 0xee, 0x63, 0x6b, - 0x77, 0xc3, 0xd8, 0x9d, 0x94, 0x98, 0xca, 0xf3, 0xca, 0x95, 0xfb, 0xfb, 0xfa, 0xba, 0xb3, 0x87, - 0x17, 0xaa, 0x09, 0x8f, 0x1b, 0x95, 0x3a, 0xd0, 0x5a, 0x5d, 0xe9, 0x06, 0xce, 0x14, 0xd6, 0x07, - 0x3d, 0x37, 0x63, 0x4a, 0x5e, 0x8d, 0x7a, 0xe1, 0xbc, 0xde, 0x3e, 0x34, 0xbb, 0x77, 0xc8, 0x8e, - 0xd9, 0x73, 0x10, 0x92, 0x72, 0x56, 0x66, 0xcd, 0x48, 0xc5, 0x75, 0x20, 0x4e, 0x09, 0xaf, 0xb4, - 0x47, 0x9b, 0x4a, 0xc7, 0x44, 0x35, 0xec, 0x62, 0x61, 0x6b, 0xd0, 0x73, 0xb3, 0x46, 0x7a, 0x22, - 0xc5, 0x0b, 0x97, 0x2f, 0xcf, 0xac, 0xe6, 0xd4, 0x0f, 0x25, 0x8f, 0x67, 0xcd, 0x5c, 0x7e, 0xfb, - 0x99, 0xfc, 0xc4, 0x86, 0x6f, 0xa1, 0xf0, 0xe4, 0xec, 0x22, 0x87, 0xce, 0x2f, 0x72, 0xe8, 0xd3, - 0x45, 0x0e, 0x9d, 0xf6, 0x73, 0xa9, 0xf3, 0x7e, 0x2e, 0xf5, 0xa1, 0x9f, 0x4b, 0xbd, 0xd8, 0xbd, - 0xd2, 0xd0, 0x32, 0x2b, 0x33, 0x5a, 0xa4, 0x41, 0x5c, 0x8f, 0x28, 0x0b, 0x5e, 0xde, 0xf4, 0x87, - 0xd1, 0x1d, 0xae, 0xce, 0xea, 0xff, 0xc3, 0xee, 0xd7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x7d, - 0xe8, 0xa8, 0xd0, 0x06, 0x00, 0x00, + // 696 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0x41, 0x4f, 0x53, 0x4b, + 0x14, 0xc7, 0x3b, 0x90, 0xc0, 0x63, 0x80, 0x00, 0xb7, 0x10, 0x0a, 0x8f, 0xf4, 0x92, 0xbb, 0x78, + 0x8f, 0xf7, 0x12, 0xef, 0x0d, 0xb0, 0x63, 0x47, 0xd5, 0x6a, 0x8d, 0x12, 0x73, 0x4d, 0x35, 0x71, + 0xd3, 0xdc, 0xde, 0x39, 0xb4, 0x93, 0xde, 0xce, 0x34, 0x33, 0xd3, 0x56, 0x3e, 0x81, 0x5b, 0x56, + 0x6e, 0xdd, 0xbb, 0x77, 0x6f, 0x5c, 0xb1, 0x24, 0xba, 0x71, 0x55, 0x0d, 0x24, 0x7e, 0x80, 0x7e, + 0x02, 0xd3, 0x99, 0xb9, 0x58, 0x28, 0x21, 0x34, 0xc6, 0xc4, 0x15, 0x33, 0x73, 0xce, 0xf9, 0x9f, + 0xff, 0xef, 0x70, 0x9a, 0x8b, 0xff, 0x69, 0xb3, 0x36, 0xa3, 0x87, 0x34, 0x80, 0x98, 0xcb, 0x23, + 0xa9, 0xa0, 0x49, 0x59, 0x0c, 0x4c, 0xd1, 0x0e, 0x04, 0xd0, 0x01, 0xa6, 0xfc, 0x96, 0xe0, 0x8a, + 0x3b, 0xeb, 0x36, 0xcf, 0x1f, 0xcd, 0x5b, 0xdf, 0xbd, 0x49, 0x63, 0xe4, 0xc9, 0x08, 0xae, 0x2f, + 0xd7, 0x78, 0x8d, 0xeb, 0x63, 0x30, 0x38, 0xd9, 0xd7, 0x7c, 0xcc, 0x65, 0x93, 0xcb, 0xa0, 0x1a, + 0x49, 0x08, 0x3a, 0xdb, 0x55, 0x50, 0xd1, 0x76, 0x10, 0x73, 0xca, 0x4c, 0xdc, 0xfb, 0x8e, 0xf0, + 0xea, 0xfd, 0x81, 0xad, 0x17, 0x54, 0xd5, 0x89, 0x88, 0xba, 0xfb, 0x49, 0x12, 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2e, 0x77, 0xf6, 0xf0, 0x5c, 0x35, + 0xe1, 0x71, 0xa3, 0x52, 0x07, 0x5a, 0xab, 0x2b, 0x3d, 0xc0, 0xc9, 0xc2, 0x6a, 0xbf, 0xe7, 0x66, + 0x4d, 0xcb, 0xe1, 0xa8, 0x17, 0xce, 0xea, 0xeb, 0x43, 0x73, 0xfb, 0x88, 0xec, 0x0e, 0x3d, 0x07, + 0x21, 0x29, 0x67, 0x65, 0xd6, 0x8c, 0x54, 0x5c, 0x07, 0xe2, 0x94, 0xf0, 0x52, 0x3b, 0xbd, 0x54, + 0x3a, 0x26, 0xaa, 0x61, 0xe7, 0x0b, 0x1b, 0xfd, 0x9e, 0x9b, 0x33, 0xd2, 0x23, 0x29, 0x5e, 0xb8, + 0x78, 0xf1, 0x66, 0x35, 0x7f, 0xf7, 0xef, 0xa0, 0xf0, 0xe4, 0xe4, 0x2c, 0x8f, 0x4e, 0xcf, 0xf2, + 0xe8, 0xdb, 0x59, 0x1e, 0x1d, 0x9f, 0xe7, 0x33, 0xa7, 0xe7, 0xf9, 0xcc, 0x97, 0xf3, 0x7c, 0xe6, + 0xe5, 0xee, 0xd0, 0x58, 0xcb, 0xac, 0xcc, 0x68, 0x91, 0x06, 0x71, 0x3d, 0xa2, 0x2c, 0x78, 0x75, + 0xdd, 0x97, 0x4d, 0xcf, 0xb9, 0x3a, 0xa5, 0xbf, 0x4b, 0xbb, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x81, 0xf3, 0xde, 0xab, 0x48, 0x07, 0x00, 0x00, } func (m *EventWithdrawAllRewards) Marshal() (dAtA []byte, err error) { @@ -556,6 +616,50 @@ func (m *EventWithdrawReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *EventRecordedRecipientWithNftId) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventRecordedRecipientWithNftId) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRecordedRecipientWithNftId) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintEvent(dAtA, i, uint64(len(m.TokenId))) + i-- + dAtA[i] = 0x1a + } + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClassId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Recipient))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *EventDeletedNftIdRecordedForFrontendReward) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -590,10 +694,10 @@ func (m *EventDeletedNftIdRecordedForFrontendReward) MarshalToSizedBuffer(dAtA [ i-- dAtA[i] = 0x12 } - if len(m.RecipientContainerId) > 0 { - i -= len(m.RecipientContainerId) - copy(dAtA[i:], m.RecipientContainerId) - i = encodeVarintEvent(dAtA, i, uint64(len(m.RecipientContainerId))) + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Recipient))) i-- dAtA[i] = 0xa } @@ -667,10 +771,10 @@ func (m *EventUpdatedReward) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x12 - if len(m.RecipientContainerId) > 0 { - i -= len(m.RecipientContainerId) - copy(dAtA[i:], m.RecipientContainerId) - i = encodeVarintEvent(dAtA, i, uint64(len(m.RecipientContainerId))) + if len(m.Recipient) > 0 { + i -= len(m.Recipient) + copy(dAtA[i:], m.Recipient) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Recipient))) i-- dAtA[i] = 0xa } @@ -735,10 +839,10 @@ func (m *EventVersionUnmatched) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NftId) > 0 { - i -= len(m.NftId) - copy(dAtA[i:], m.NftId) - i = encodeVarintEvent(dAtA, i, uint64(len(m.NftId))) + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintEvent(dAtA, i, uint64(len(m.TokenId))) i-- dAtA[i] = 0x1a } @@ -802,13 +906,34 @@ func (m *EventWithdrawReward) Size() (n int) { return n } +func (m *EventRecordedRecipientWithNftId) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Recipient) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ClassId) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.TokenId) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + return n +} + func (m *EventDeletedNftIdRecordedForFrontendReward) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.RecipientContainerId) + l = len(m.Recipient) if l > 0 { n += 1 + l + sovEvent(uint64(l)) } @@ -846,7 +971,7 @@ func (m *EventUpdatedReward) Size() (n int) { } var l int _ = l - l = len(m.RecipientContainerId) + l = len(m.Recipient) if l > 0 { n += 1 + l + sovEvent(uint64(l)) } @@ -882,7 +1007,7 @@ func (m *EventVersionUnmatched) Size() (n int) { if l > 0 { n += 1 + l + sovEvent(uint64(l)) } - l = len(m.NftId) + l = len(m.TokenId) if l > 0 { n += 1 + l + sovEvent(uint64(l)) } @@ -1126,6 +1251,152 @@ func (m *EventWithdrawReward) Unmarshal(dAtA []byte) error { } return nil } +func (m *EventRecordedRecipientWithNftId) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventRecordedRecipientWithNftId: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRecordedRecipientWithNftId: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Recipient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClassId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TokenId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EventDeletedNftIdRecordedForFrontendReward) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1157,7 +1428,7 @@ func (m *EventDeletedNftIdRecordedForFrontendReward) Unmarshal(dAtA []byte) erro switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RecipientContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1185,7 +1456,7 @@ func (m *EventDeletedNftIdRecordedForFrontendReward) Unmarshal(dAtA []byte) erro if postIndex > l { return io.ErrUnexpectedEOF } - m.RecipientContainerId = string(dAtA[iNdEx:postIndex]) + m.Recipient = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -1417,7 +1688,7 @@ func (m *EventUpdatedReward) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RecipientContainerId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Recipient", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1445,7 +1716,7 @@ func (m *EventUpdatedReward) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RecipientContainerId = string(dAtA[iNdEx:postIndex]) + m.Recipient = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -1685,7 +1956,7 @@ func (m *EventVersionUnmatched) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NftId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1713,7 +1984,7 @@ func (m *EventVersionUnmatched) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NftId = string(dAtA[iNdEx:postIndex]) + m.TokenId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/ecosystemincentive/types/keys.go b/x/ecosystemincentive/types/keys.go index d68a011aa..9862425df 100644 --- a/x/ecosystemincentive/types/keys.go +++ b/x/ecosystemincentive/types/keys.go @@ -18,17 +18,12 @@ const ( ) var ( - // KeyPrefixRecipientContainer defines prefix key for RecipientContainer - KeyPrefixRecipientContainer = []byte{0x01} + // KeyPrefixRecipient defines prefix key for Incentive-Recipient + KeyPrefixRecipient = []byte{0x01} // KeyPrefixReward defines prefix key for Reward KeyPrefixRewardStore = []byte{0x02} - // KeyPrefixRecipientContainerIdByNftId defines prefix key for nft_id with incentive_id - KeyPrefixRecipientContainerIdByNftId = []byte{0x03} - - // KeyPrefixRecipientContainerIdByAddr defines prefix key for recipientContainerIdsByAddr with address - KeyPrefixRecipientContainerIdsByAddr = []byte{0x04} - - RecipientContainerIdPattern = `^[a-z][a-z0-9_]*$` + // KeyPrefixRecipientByNftId defines prefix key for nft_id with recipient + KeyPrefixRecipientByNftId = []byte{0x03} ) diff --git a/x/ecosystemincentive/types/memo.pb.go b/x/ecosystemincentive/types/memo.pb.go index 8a114a0e5..7cfb962d5 100644 --- a/x/ecosystemincentive/types/memo.pb.go +++ b/x/ecosystemincentive/types/memo.pb.go @@ -23,6 +23,50 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type FrontendTxMemo struct { + Frontend *FrontendMetadata `protobuf:"bytes,1,opt,name=frontend,proto3" json:"frontend,omitempty" yaml:"frontend"` +} + +func (m *FrontendTxMemo) Reset() { *m = FrontendTxMemo{} } +func (m *FrontendTxMemo) String() string { return proto.CompactTextString(m) } +func (*FrontendTxMemo) ProtoMessage() {} +func (*FrontendTxMemo) Descriptor() ([]byte, []int) { + return fileDescriptor_6a43f0dcca886bed, []int{0} +} +func (m *FrontendTxMemo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FrontendTxMemo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FrontendTxMemo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FrontendTxMemo) XXX_Merge(src proto.Message) { + xxx_messageInfo_FrontendTxMemo.Merge(m, src) +} +func (m *FrontendTxMemo) XXX_Size() int { + return m.Size() +} +func (m *FrontendTxMemo) XXX_DiscardUnknown() { + xxx_messageInfo_FrontendTxMemo.DiscardUnknown(m) +} + +var xxx_messageInfo_FrontendTxMemo proto.InternalMessageInfo + +func (m *FrontendTxMemo) GetFrontend() *FrontendMetadata { + if m != nil { + return m.Frontend + } + return nil +} + type FrontendMetadata struct { Version uint32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty" yaml:"version"` Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty" yaml:"recipient"` @@ -32,7 +76,7 @@ func (m *FrontendMetadata) Reset() { *m = FrontendMetadata{} } func (m *FrontendMetadata) String() string { return proto.CompactTextString(m) } func (*FrontendMetadata) ProtoMessage() {} func (*FrontendMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_6a43f0dcca886bed, []int{0} + return fileDescriptor_6a43f0dcca886bed, []int{1} } func (m *FrontendMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -76,6 +120,7 @@ func (m *FrontendMetadata) GetRecipient() string { } func init() { + proto.RegisterType((*FrontendTxMemo)(nil), "ununifi.ecosystemincentive.FrontendTxMemo") proto.RegisterType((*FrontendMetadata)(nil), "ununifi.ecosystemincentive.FrontendMetadata") } @@ -84,22 +129,60 @@ func init() { } var fileDescriptor_6a43f0dcca886bed = []byte{ - // 239 bytes of a gzipped FileDescriptorProto + // 285 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2d, 0xcd, 0x2b, 0xcd, 0xcb, 0x4c, 0xcb, 0xd4, 0x4f, 0x4d, 0xce, 0x2f, 0xae, 0x2c, 0x2e, 0x49, 0xcd, 0xcd, 0xcc, 0x4b, 0x4e, 0xcd, 0x2b, 0xc9, 0x2c, 0x4b, 0xd5, 0xcf, 0x4d, 0xcd, 0xcd, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x82, 0x2a, 0xd3, 0xc3, 0x54, 0x26, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, - 0xa6, 0x0f, 0x62, 0x41, 0x74, 0x28, 0x95, 0x70, 0x09, 0xb8, 0x15, 0xe5, 0xe7, 0x95, 0xa4, 0xe6, - 0xa5, 0xf8, 0xa6, 0x96, 0x24, 0xa6, 0x24, 0x96, 0x24, 0x0a, 0xe9, 0x70, 0xb1, 0x97, 0xa5, 0x16, - 0x15, 0x67, 0xe6, 0xe7, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x3a, 0x09, 0x7d, 0xba, 0x27, 0xcf, - 0x57, 0x99, 0x98, 0x9b, 0x63, 0xa5, 0x04, 0x95, 0x50, 0x0a, 0x82, 0x29, 0x11, 0x32, 0xe2, 0xe2, - 0x2c, 0x4a, 0x4d, 0xce, 0x2c, 0xc8, 0x4c, 0xcd, 0x2b, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x74, - 0x12, 0xf9, 0x74, 0x4f, 0x5e, 0x00, 0xa2, 0x1e, 0x2e, 0xa5, 0x14, 0x84, 0x50, 0xe6, 0xe4, 0x7b, - 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, - 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0xc6, 0xe9, 0x99, 0x25, 0x19, 0xa5, - 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xa1, 0x79, 0xa1, 0x79, 0x99, 0x6e, 0x99, 0xfa, 0xc9, 0x19, - 0x89, 0x99, 0x79, 0xfa, 0x15, 0xd8, 0xfc, 0x5e, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, - 0x8b, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x88, 0xdf, 0xdc, 0x19, 0x26, 0x01, 0x00, 0x00, + 0xa6, 0x0f, 0x62, 0x41, 0x74, 0x28, 0xe5, 0x73, 0xf1, 0xb9, 0x15, 0xe5, 0xe7, 0x95, 0xa4, 0xe6, + 0xa5, 0x84, 0x54, 0xf8, 0xa6, 0xe6, 0xe6, 0x0b, 0xc5, 0x72, 0x71, 0xa4, 0x41, 0x45, 0x24, 0x18, + 0x15, 0x18, 0x35, 0xb8, 0x8d, 0x74, 0xf4, 0x70, 0x1b, 0xab, 0x07, 0xd3, 0xed, 0x9b, 0x5a, 0x92, + 0x98, 0x92, 0x58, 0x92, 0xe8, 0x24, 0xfc, 0xe9, 0x9e, 0x3c, 0x7f, 0x65, 0x62, 0x6e, 0x8e, 0x95, + 0x12, 0xcc, 0x1c, 0xa5, 0x20, 0xb8, 0x91, 0x4a, 0x25, 0x5c, 0x02, 0xe8, 0x5a, 0x84, 0x74, 0xb8, + 0xd8, 0xcb, 0x52, 0x8b, 0x8a, 0x33, 0xf3, 0xf3, 0xc0, 0x36, 0xf2, 0x3a, 0x09, 0x7d, 0xba, 0x27, + 0xcf, 0x07, 0x31, 0x03, 0x2a, 0xa1, 0x14, 0x04, 0x53, 0x22, 0x64, 0xc4, 0xc5, 0x59, 0x94, 0x9a, + 0x9c, 0x59, 0x90, 0x99, 0x9a, 0x57, 0x22, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf2, 0xe9, + 0x9e, 0xbc, 0x00, 0x44, 0x3d, 0x5c, 0x4a, 0x29, 0x08, 0xa1, 0xcc, 0xc9, 0xf7, 0xc4, 0x23, 0x39, + 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, + 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x8c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, + 0xf3, 0x73, 0xf5, 0x43, 0xf3, 0x42, 0xf3, 0x32, 0xdd, 0x32, 0xf5, 0x93, 0x33, 0x12, 0x33, 0xf3, + 0xf4, 0x2b, 0xb0, 0x05, 0x76, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0xf0, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x4a, 0xa0, 0x6b, 0x97, 0x01, 0x00, 0x00, +} + +func (m *FrontendTxMemo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FrontendTxMemo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FrontendTxMemo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Frontend != nil { + { + size, err := m.Frontend.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMemo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *FrontendMetadata) Marshal() (dAtA []byte, err error) { @@ -148,6 +231,19 @@ func encodeVarintMemo(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *FrontendTxMemo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Frontend != nil { + l = m.Frontend.Size() + n += 1 + l + sovMemo(uint64(l)) + } + return n +} + func (m *FrontendMetadata) Size() (n int) { if m == nil { return 0 @@ -170,6 +266,92 @@ func sovMemo(x uint64) (n int) { func sozMemo(x uint64) (n int) { return sovMemo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *FrontendTxMemo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FrontendTxMemo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FrontendTxMemo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Frontend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMemo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMemo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMemo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Frontend == nil { + m.Frontend = &FrontendMetadata{} + } + if err := m.Frontend.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMemo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMemo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *FrontendMetadata) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ecosystemincentive/types/query.pb.go b/x/ecosystemincentive/types/query.pb.go index 20bb8ee21..b31ab75ed 100644 --- a/x/ecosystemincentive/types/query.pb.go +++ b/x/ecosystemincentive/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" @@ -112,22 +113,23 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -type QueryAllRewardsRequest struct { +type QueryEcosystemRewardsRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` } -func (m *QueryAllRewardsRequest) Reset() { *m = QueryAllRewardsRequest{} } -func (m *QueryAllRewardsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllRewardsRequest) ProtoMessage() {} -func (*QueryAllRewardsRequest) Descriptor() ([]byte, []int) { +func (m *QueryEcosystemRewardsRequest) Reset() { *m = QueryEcosystemRewardsRequest{} } +func (m *QueryEcosystemRewardsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryEcosystemRewardsRequest) ProtoMessage() {} +func (*QueryEcosystemRewardsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bcc47a5d1657c31d, []int{2} } -func (m *QueryAllRewardsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryEcosystemRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryEcosystemRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllRewardsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryEcosystemRewardsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -137,41 +139,48 @@ func (m *QueryAllRewardsRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryAllRewardsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRewardsRequest.Merge(m, src) +func (m *QueryEcosystemRewardsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEcosystemRewardsRequest.Merge(m, src) } -func (m *QueryAllRewardsRequest) XXX_Size() int { +func (m *QueryEcosystemRewardsRequest) XXX_Size() int { return m.Size() } -func (m *QueryAllRewardsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRewardsRequest.DiscardUnknown(m) +func (m *QueryEcosystemRewardsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEcosystemRewardsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllRewardsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryEcosystemRewardsRequest proto.InternalMessageInfo -func (m *QueryAllRewardsRequest) GetAddress() string { +func (m *QueryEcosystemRewardsRequest) GetAddress() string { if m != nil { return m.Address } return "" } -type QueryAllRewardsResponse struct { - RewardRecord RewardRecord `protobuf:"bytes,1,opt,name=reward_record,json=rewardRecord,proto3" json:"reward_record" yaml:"reward_record"` +func (m *QueryEcosystemRewardsRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +type QueryEcosystemRewardsResponse struct { + Rewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=rewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards" yaml:"rewards"` } -func (m *QueryAllRewardsResponse) Reset() { *m = QueryAllRewardsResponse{} } -func (m *QueryAllRewardsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllRewardsResponse) ProtoMessage() {} -func (*QueryAllRewardsResponse) Descriptor() ([]byte, []int) { +func (m *QueryEcosystemRewardsResponse) Reset() { *m = QueryEcosystemRewardsResponse{} } +func (m *QueryEcosystemRewardsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryEcosystemRewardsResponse) ProtoMessage() {} +func (*QueryEcosystemRewardsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bcc47a5d1657c31d, []int{3} } -func (m *QueryAllRewardsResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryEcosystemRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryAllRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryEcosystemRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryAllRewardsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryEcosystemRewardsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -181,42 +190,42 @@ func (m *QueryAllRewardsResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryAllRewardsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllRewardsResponse.Merge(m, src) +func (m *QueryEcosystemRewardsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryEcosystemRewardsResponse.Merge(m, src) } -func (m *QueryAllRewardsResponse) XXX_Size() int { +func (m *QueryEcosystemRewardsResponse) XXX_Size() int { return m.Size() } -func (m *QueryAllRewardsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllRewardsResponse.DiscardUnknown(m) +func (m *QueryEcosystemRewardsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryEcosystemRewardsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryAllRewardsResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryEcosystemRewardsResponse proto.InternalMessageInfo -func (m *QueryAllRewardsResponse) GetRewardRecord() RewardRecord { +func (m *QueryEcosystemRewardsResponse) GetRewards() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { - return m.RewardRecord + return m.Rewards } - return RewardRecord{} + return nil } -type QueryRewardRequest struct { - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"` +type QueryRecipientAddressWithNftIdRequest struct { + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty" yaml:"class_id"` + TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty" yaml:"token_id"` } -func (m *QueryRewardRequest) Reset() { *m = QueryRewardRequest{} } -func (m *QueryRewardRequest) String() string { return proto.CompactTextString(m) } -func (*QueryRewardRequest) ProtoMessage() {} -func (*QueryRewardRequest) Descriptor() ([]byte, []int) { +func (m *QueryRecipientAddressWithNftIdRequest) Reset() { *m = QueryRecipientAddressWithNftIdRequest{} } +func (m *QueryRecipientAddressWithNftIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRecipientAddressWithNftIdRequest) ProtoMessage() {} +func (*QueryRecipientAddressWithNftIdRequest) Descriptor() ([]byte, []int) { return fileDescriptor_bcc47a5d1657c31d, []int{4} } -func (m *QueryRewardRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryRecipientAddressWithNftIdRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryRewardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryRecipientAddressWithNftIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryRewardRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryRecipientAddressWithNftIdRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -226,48 +235,50 @@ func (m *QueryRewardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryRewardRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRewardRequest.Merge(m, src) +func (m *QueryRecipientAddressWithNftIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRecipientAddressWithNftIdRequest.Merge(m, src) } -func (m *QueryRewardRequest) XXX_Size() int { +func (m *QueryRecipientAddressWithNftIdRequest) XXX_Size() int { return m.Size() } -func (m *QueryRewardRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRewardRequest.DiscardUnknown(m) +func (m *QueryRecipientAddressWithNftIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRecipientAddressWithNftIdRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryRewardRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryRecipientAddressWithNftIdRequest proto.InternalMessageInfo -func (m *QueryRewardRequest) GetAddress() string { +func (m *QueryRecipientAddressWithNftIdRequest) GetClassId() string { if m != nil { - return m.Address + return m.ClassId } return "" } -func (m *QueryRewardRequest) GetDenom() string { +func (m *QueryRecipientAddressWithNftIdRequest) GetTokenId() string { if m != nil { - return m.Denom + return m.TokenId } return "" } -type QueryRewardResponse struct { - Reward types.Coin `protobuf:"bytes,1,opt,name=reward,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"reward" yaml:"reward"` +type QueryRecipientAddressWithNftIdResponse struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` } -func (m *QueryRewardResponse) Reset() { *m = QueryRewardResponse{} } -func (m *QueryRewardResponse) String() string { return proto.CompactTextString(m) } -func (*QueryRewardResponse) ProtoMessage() {} -func (*QueryRewardResponse) Descriptor() ([]byte, []int) { +func (m *QueryRecipientAddressWithNftIdResponse) Reset() { + *m = QueryRecipientAddressWithNftIdResponse{} +} +func (m *QueryRecipientAddressWithNftIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRecipientAddressWithNftIdResponse) ProtoMessage() {} +func (*QueryRecipientAddressWithNftIdResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bcc47a5d1657c31d, []int{5} } -func (m *QueryRewardResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryRecipientAddressWithNftIdResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryRecipientAddressWithNftIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryRewardResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryRecipientAddressWithNftIdResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -277,32 +288,32 @@ func (m *QueryRewardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryRewardResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryRewardResponse.Merge(m, src) +func (m *QueryRecipientAddressWithNftIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRecipientAddressWithNftIdResponse.Merge(m, src) } -func (m *QueryRewardResponse) XXX_Size() int { +func (m *QueryRecipientAddressWithNftIdResponse) XXX_Size() int { return m.Size() } -func (m *QueryRewardResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryRewardResponse.DiscardUnknown(m) +func (m *QueryRecipientAddressWithNftIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRecipientAddressWithNftIdResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryRewardResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryRecipientAddressWithNftIdResponse proto.InternalMessageInfo -func (m *QueryRewardResponse) GetReward() types.Coin { +func (m *QueryRecipientAddressWithNftIdResponse) GetAddress() string { if m != nil { - return m.Reward + return m.Address } - return types.Coin{} + return "" } func init() { proto.RegisterType((*QueryParamsRequest)(nil), "ununifi.ecosystemincentive.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "ununifi.ecosystemincentive.QueryParamsResponse") - proto.RegisterType((*QueryAllRewardsRequest)(nil), "ununifi.ecosystemincentive.QueryAllRewardsRequest") - proto.RegisterType((*QueryAllRewardsResponse)(nil), "ununifi.ecosystemincentive.QueryAllRewardsResponse") - proto.RegisterType((*QueryRewardRequest)(nil), "ununifi.ecosystemincentive.QueryRewardRequest") - proto.RegisterType((*QueryRewardResponse)(nil), "ununifi.ecosystemincentive.QueryRewardResponse") + proto.RegisterType((*QueryEcosystemRewardsRequest)(nil), "ununifi.ecosystemincentive.QueryEcosystemRewardsRequest") + proto.RegisterType((*QueryEcosystemRewardsResponse)(nil), "ununifi.ecosystemincentive.QueryEcosystemRewardsResponse") + proto.RegisterType((*QueryRecipientAddressWithNftIdRequest)(nil), "ununifi.ecosystemincentive.QueryRecipientAddressWithNftIdRequest") + proto.RegisterType((*QueryRecipientAddressWithNftIdResponse)(nil), "ununifi.ecosystemincentive.QueryRecipientAddressWithNftIdResponse") } func init() { @@ -310,44 +321,47 @@ func init() { } var fileDescriptor_bcc47a5d1657c31d = []byte{ - // 591 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0x56, 0x1a, 0x71, 0x6c, 0x45, 0xc6, 0xaa, 0x35, 0x94, 0x8d, 0x0c, 0xd2, 0x96, 0x62, - 0x77, 0x68, 0x42, 0x11, 0x04, 0x41, 0x23, 0xf4, 0x26, 0xd8, 0x85, 0x5e, 0xbc, 0xc8, 0x64, 0x77, - 0xdc, 0x8c, 0xcd, 0xce, 0x6c, 0x77, 0x36, 0xd5, 0x50, 0x7a, 0xf1, 0xe0, 0xc1, 0x93, 0x20, 0xfe, - 0x07, 0x11, 0x7f, 0x48, 0x8f, 0x05, 0x2f, 0x9e, 0xa2, 0x24, 0xfe, 0x82, 0xdc, 0xbc, 0x49, 0x66, - 0xde, 0x62, 0x42, 0x74, 0x9b, 0x7a, 0xda, 0xe5, 0xcd, 0xf7, 0xbe, 0xef, 0x7b, 0x6f, 0xbe, 0x5d, - 0xb4, 0xda, 0x91, 0x1d, 0x29, 0x5e, 0x08, 0xca, 0x03, 0xa5, 0xbb, 0x3a, 0xe3, 0xb1, 0x90, 0x01, - 0x97, 0x99, 0x38, 0xe4, 0xf4, 0xa0, 0xc3, 0xd3, 0xae, 0x97, 0xa4, 0x2a, 0x53, 0xb8, 0x02, 0x38, - 0x6f, 0x1a, 0x57, 0x59, 0x8a, 0x54, 0xa4, 0x0c, 0x8c, 0x8e, 0xde, 0x6c, 0x47, 0x65, 0x25, 0x52, - 0x2a, 0x6a, 0x73, 0xca, 0x12, 0x41, 0x99, 0x94, 0x2a, 0x63, 0x99, 0x50, 0x52, 0xc3, 0xe9, 0x46, - 0xa0, 0x74, 0xac, 0x34, 0x6d, 0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xe9, 0xbb, 0xce, 0x69, 0xdf, 0x75, 0x7e, 0xf4, 0x5d, 0xe7, 0xfd, 0xc0, 0x2d, - 0x9d, 0x0e, 0xdc, 0xd2, 0xb7, 0x81, 0x5b, 0x7a, 0x56, 0x1f, 0x8b, 0xd1, 0x9e, 0xdc, 0x93, 0x62, - 0x47, 0xd0, 0xa0, 0xc5, 0x84, 0xa4, 0xaf, 0xff, 0x26, 0x61, 0x72, 0xd5, 0x2c, 0x9b, 0x7f, 0x53, - 0xfd, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0xd3, 0x62, 0x7e, 0xbf, 0x05, 0x00, 0x00, + // 631 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4f, 0x6b, 0x14, 0x3f, + 0x18, 0xde, 0xe9, 0xef, 0xd7, 0xae, 0xa6, 0xfe, 0x29, 0x69, 0x85, 0x76, 0xa9, 0xb3, 0x25, 0xe8, + 0xba, 0x14, 0x9b, 0xd0, 0x16, 0x41, 0xbd, 0x75, 0x44, 0xa1, 0x07, 0xc5, 0x0e, 0x54, 0xc1, 0x8b, + 0x64, 0x67, 0xd2, 0xd9, 0xd0, 0x4e, 0x32, 0x9d, 0x64, 0x5b, 0x17, 0xf1, 0xe2, 0xc5, 0xab, 0x20, + 0x82, 0x9f, 0xc1, 0xbb, 0x57, 0xcf, 0x3d, 0x16, 0xbd, 0x78, 0x5a, 0xa5, 0xf5, 0x13, 0xec, 0x27, + 0x90, 0x4d, 0x32, 0x50, 0xbb, 0xee, 0xae, 0x7f, 0x4e, 0x13, 0xde, 0xf7, 0x79, 0x9f, 0xf7, 0x79, + 0x9f, 0xbc, 0x19, 0x50, 0x6b, 0x89, 0x96, 0xe0, 0x5b, 0x9c, 0xb0, 0x48, 0xaa, 0xb6, 0xd2, 0x2c, + 0xe5, 0x22, 0x62, 0x42, 0xf3, 0x3d, 0x46, 0x76, 0x5b, 0x2c, 0x6f, 0xe3, 0x2c, 0x97, 0x5a, 0xc2, + 0x8a, 0xc3, 0xe1, 0x7e, 0x5c, 0x65, 0x26, 0x91, 0x89, 0x34, 0x30, 0xd2, 0x3b, 0xd9, 0x8a, 0xca, + 0x7c, 0x22, 0x65, 0xb2, 0xc3, 0x08, 0xcd, 0x38, 0xa1, 0x42, 0x48, 0x4d, 0x35, 0x97, 0x42, 0xb9, + 0xec, 0x62, 0x24, 0x55, 0x2a, 0x15, 0x69, 0x50, 0xe5, 0x1a, 0x91, 0xbd, 0xe5, 0x06, 0xd3, 0x74, + 0x99, 0x64, 0x34, 0xe1, 0xc2, 0x80, 0x1d, 0xf6, 0xda, 0x10, 0x8d, 0x19, 0xcd, 0x69, 0x5a, 0x90, + 0xae, 0x0e, 0x01, 0xf6, 0x87, 0x5c, 0x91, 0x7f, 0x52, 0x49, 0xa1, 0x21, 0x92, 0xdc, 0x75, 0x47, + 0x33, 0x00, 0x6e, 0xf4, 0xf4, 0x3d, 0x34, 0x9d, 0x42, 0xb6, 0xdb, 0x62, 0x4a, 0xa3, 0x26, 0x98, + 0xfe, 0x29, 0xaa, 0x32, 0x29, 0x14, 0x83, 0x1b, 0x60, 0xc2, 0x2a, 0x9a, 0xf5, 0x16, 0xbc, 0xfa, + 0xe4, 0x0a, 0xc2, 0x83, 0x7d, 0xc3, 0xb6, 0x36, 0xb8, 0x74, 0xd0, 0xa9, 0x96, 0xba, 0x9d, 0xea, + 0xf9, 0x36, 0x4d, 0x77, 0x6e, 0x23, 0x5b, 0x8f, 0x42, 0x47, 0x84, 0x34, 0x98, 0x37, 0x9d, 0xee, + 0x16, 0x04, 0x21, 0xdb, 0xa7, 0x79, 0x5c, 0x28, 0x81, 0xd7, 0x41, 0x99, 0xc6, 0x71, 0xce, 0x94, + 0xed, 0x79, 0x36, 0x80, 0xdd, 0x4e, 0xf5, 0x82, 0xe5, 0x72, 0x09, 0x14, 0x16, 0x10, 0x58, 0x03, + 0xe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4, 0x42, 0x7e, 0x1b, 0x6f, 0x35, 0xa2, 0xc5, 0x97, 0x9f, 0xbf, + 0xbf, 0x19, 0xbb, 0x02, 0x11, 0x19, 0xf9, 0xde, 0xe0, 0x47, 0x0f, 0x4c, 0x9d, 0xde, 0x0c, 0x78, + 0x73, 0x64, 0xc7, 0x01, 0x3b, 0x5c, 0xb9, 0xf5, 0x17, 0x95, 0x4e, 0xf5, 0x0d, 0xa3, 0x9a, 0xc0, + 0xa5, 0x61, 0xaa, 0xdd, 0xea, 0x90, 0xe7, 0xce, 0xe1, 0x17, 0xf0, 0x93, 0x07, 0xe6, 0x06, 0x5e, + 0x1b, 0x5c, 0x1b, 0xa9, 0x67, 0xd4, 0xee, 0x55, 0x82, 0x7f, 0xa1, 0x70, 0xb3, 0x61, 0x33, 0x5b, + 0x1d, 0xd6, 0x86, 0xcf, 0xe6, 0x68, 0x54, 0x70, 0xff, 0xe0, 0xc8, 0xf7, 0x0e, 0x8f, 0x7c, 0xef, + 0xdb, 0x91, 0xef, 0xbd, 0x3e, 0xf6, 0x4b, 0x87, 0xc7, 0x7e, 0xe9, 0xcb, 0xb1, 0x5f, 0x7a, 0xb2, + 0x7a, 0xe2, 0x99, 0x6d, 0x8a, 0x4d, 0xc1, 0xef, 0x71, 0x12, 0x35, 0x29, 0x17, 0xe4, 0xd9, 0xaf, + 0x38, 0xcd, 0xbb, 0x6b, 0x4c, 0x98, 0x1f, 0xe0, 0xea, 0x8f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb9, + 0x1c, 0xc8, 0x42, 0x24, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -364,8 +378,8 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - AllRewards(ctx context.Context, in *QueryAllRewardsRequest, opts ...grpc.CallOption) (*QueryAllRewardsResponse, error) - Reward(ctx context.Context, in *QueryRewardRequest, opts ...grpc.CallOption) (*QueryRewardResponse, error) + EcosystemRewards(ctx context.Context, in *QueryEcosystemRewardsRequest, opts ...grpc.CallOption) (*QueryEcosystemRewardsResponse, error) + RecipientAddressWithNftId(ctx context.Context, in *QueryRecipientAddressWithNftIdRequest, opts ...grpc.CallOption) (*QueryRecipientAddressWithNftIdResponse, error) } type queryClient struct { @@ -385,18 +399,18 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) AllRewards(ctx context.Context, in *QueryAllRewardsRequest, opts ...grpc.CallOption) (*QueryAllRewardsResponse, error) { - out := new(QueryAllRewardsResponse) - err := c.cc.Invoke(ctx, "/ununifi.ecosystemincentive.Query/AllRewards", in, out, opts...) +func (c *queryClient) EcosystemRewards(ctx context.Context, in *QueryEcosystemRewardsRequest, opts ...grpc.CallOption) (*QueryEcosystemRewardsResponse, error) { + out := new(QueryEcosystemRewardsResponse) + err := c.cc.Invoke(ctx, "/ununifi.ecosystemincentive.Query/EcosystemRewards", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) Reward(ctx context.Context, in *QueryRewardRequest, opts ...grpc.CallOption) (*QueryRewardResponse, error) { - out := new(QueryRewardResponse) - err := c.cc.Invoke(ctx, "/ununifi.ecosystemincentive.Query/Reward", in, out, opts...) +func (c *queryClient) RecipientAddressWithNftId(ctx context.Context, in *QueryRecipientAddressWithNftIdRequest, opts ...grpc.CallOption) (*QueryRecipientAddressWithNftIdResponse, error) { + out := new(QueryRecipientAddressWithNftIdResponse) + err := c.cc.Invoke(ctx, "/ununifi.ecosystemincentive.Query/RecipientAddressWithNftId", in, out, opts...) if err != nil { return nil, err } @@ -407,8 +421,8 @@ func (c *queryClient) Reward(ctx context.Context, in *QueryRewardRequest, opts . type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - AllRewards(context.Context, *QueryAllRewardsRequest) (*QueryAllRewardsResponse, error) - Reward(context.Context, *QueryRewardRequest) (*QueryRewardResponse, error) + EcosystemRewards(context.Context, *QueryEcosystemRewardsRequest) (*QueryEcosystemRewardsResponse, error) + RecipientAddressWithNftId(context.Context, *QueryRecipientAddressWithNftIdRequest) (*QueryRecipientAddressWithNftIdResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -418,11 +432,11 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) AllRewards(ctx context.Context, req *QueryAllRewardsRequest) (*QueryAllRewardsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AllRewards not implemented") +func (*UnimplementedQueryServer) EcosystemRewards(ctx context.Context, req *QueryEcosystemRewardsRequest) (*QueryEcosystemRewardsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EcosystemRewards not implemented") } -func (*UnimplementedQueryServer) Reward(ctx context.Context, req *QueryRewardRequest) (*QueryRewardResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Reward not implemented") +func (*UnimplementedQueryServer) RecipientAddressWithNftId(ctx context.Context, req *QueryRecipientAddressWithNftIdRequest) (*QueryRecipientAddressWithNftIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RecipientAddressWithNftId not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { @@ -447,38 +461,38 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_AllRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllRewardsRequest) +func _Query_EcosystemRewards_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryEcosystemRewardsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).AllRewards(ctx, in) + return srv.(QueryServer).EcosystemRewards(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ununifi.ecosystemincentive.Query/AllRewards", + FullMethod: "/ununifi.ecosystemincentive.Query/EcosystemRewards", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).AllRewards(ctx, req.(*QueryAllRewardsRequest)) + return srv.(QueryServer).EcosystemRewards(ctx, req.(*QueryEcosystemRewardsRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_Reward_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryRewardRequest) +func _Query_RecipientAddressWithNftId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRecipientAddressWithNftIdRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Reward(ctx, in) + return srv.(QueryServer).RecipientAddressWithNftId(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ununifi.ecosystemincentive.Query/Reward", + FullMethod: "/ununifi.ecosystemincentive.Query/RecipientAddressWithNftId", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Reward(ctx, req.(*QueryRewardRequest)) + return srv.(QueryServer).RecipientAddressWithNftId(ctx, req.(*QueryRecipientAddressWithNftIdRequest)) } return interceptor(ctx, in, info, handler) } @@ -492,12 +506,12 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Params_Handler, }, { - MethodName: "AllRewards", - Handler: _Query_AllRewards_Handler, + MethodName: "EcosystemRewards", + Handler: _Query_EcosystemRewards_Handler, }, { - MethodName: "Reward", - Handler: _Query_Reward_Handler, + MethodName: "RecipientAddressWithNftId", + Handler: _Query_RecipientAddressWithNftId_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -560,7 +574,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryAllRewardsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryEcosystemRewardsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -570,16 +584,23 @@ func (m *QueryAllRewardsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllRewardsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryEcosystemRewardsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryEcosystemRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0x12 + } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) @@ -590,7 +611,7 @@ func (m *QueryAllRewardsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryAllRewardsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryEcosystemRewardsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -600,30 +621,34 @@ func (m *QueryAllRewardsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryAllRewardsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryEcosystemRewardsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryEcosystemRewardsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.RewardRecord.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Rewards) > 0 { + for iNdEx := len(m.Rewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryRewardRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryRecipientAddressWithNftIdRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -633,34 +658,34 @@ func (m *QueryRewardRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryRewardRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRecipientAddressWithNftIdRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryRewardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRecipientAddressWithNftIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Denom) > 0 { - i -= len(m.Denom) - copy(dAtA[i:], m.Denom) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenId))) i-- dAtA[i] = 0x12 } - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + if len(m.ClassId) > 0 { + i -= len(m.ClassId) + copy(dAtA[i:], m.ClassId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ClassId))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryRewardResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryRecipientAddressWithNftIdResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -670,26 +695,23 @@ func (m *QueryRewardResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryRewardResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRecipientAddressWithNftIdResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryRewardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRecipientAddressWithNftIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Reward.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -724,7 +746,7 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryAllRewardsRequest) Size() (n int) { +func (m *QueryEcosystemRewardsRequest) Size() (n int) { if m == nil { return 0 } @@ -734,45 +756,55 @@ func (m *QueryAllRewardsRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } -func (m *QueryAllRewardsResponse) Size() (n int) { +func (m *QueryEcosystemRewardsResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.RewardRecord.Size() - n += 1 + l + sovQuery(uint64(l)) + if len(m.Rewards) > 0 { + for _, e := range m.Rewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } return n } -func (m *QueryRewardRequest) Size() (n int) { +func (m *QueryRecipientAddressWithNftIdRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Address) + l = len(m.ClassId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.Denom) + l = len(m.TokenId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryRewardResponse) Size() (n int) { +func (m *QueryRecipientAddressWithNftIdResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Reward.Size() - n += 1 + l + sovQuery(uint64(l)) + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -915,7 +947,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRewardsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryEcosystemRewardsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -938,10 +970,10 @@ func (m *QueryAllRewardsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRewardsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEcosystemRewardsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEcosystemRewardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -976,6 +1008,38 @@ func (m *QueryAllRewardsRequest) Unmarshal(dAtA []byte) error { } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -997,7 +1061,7 @@ func (m *QueryAllRewardsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryAllRewardsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryEcosystemRewardsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1020,15 +1084,15 @@ func (m *QueryAllRewardsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryAllRewardsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryEcosystemRewardsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryEcosystemRewardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Rewards", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1055,7 +1119,8 @@ func (m *QueryAllRewardsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RewardRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Rewards = append(m.Rewards, types.Coin{}) + if err := m.Rewards[len(m.Rewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1080,7 +1145,7 @@ func (m *QueryAllRewardsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryRewardRequest) Unmarshal(dAtA []byte) error { +func (m *QueryRecipientAddressWithNftIdRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1103,15 +1168,15 @@ func (m *QueryRewardRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryRewardRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryRecipientAddressWithNftIdRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRewardRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryRecipientAddressWithNftIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClassId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1139,11 +1204,11 @@ func (m *QueryRewardRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Address = string(dAtA[iNdEx:postIndex]) + m.ClassId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1171,7 +1236,7 @@ func (m *QueryRewardRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.TokenId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1194,7 +1259,7 @@ func (m *QueryRewardRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryRewardResponse) Unmarshal(dAtA []byte) error { +func (m *QueryRecipientAddressWithNftIdResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1217,17 +1282,17 @@ func (m *QueryRewardResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryRewardResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryRecipientAddressWithNftIdResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRewardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryRecipientAddressWithNftIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Reward", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1237,24 +1302,23 @@ func (m *QueryRewardResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Reward.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/ecosystemincentive/types/query.pb.gw.go b/x/ecosystemincentive/types/query.pb.gw.go index b3cae2069..006166568 100644 --- a/x/ecosystemincentive/types/query.pb.gw.go +++ b/x/ecosystemincentive/types/query.pb.gw.go @@ -51,8 +51,12 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -func request_Query_AllRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRewardsRequest +var ( + filter_Query_EcosystemRewards_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_EcosystemRewards_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEcosystemRewardsRequest var metadata runtime.ServerMetadata var ( @@ -73,40 +77,20 @@ func request_Query_AllRewards_0(ctx context.Context, marshaler runtime.Marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - msg, err := client.AllRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_AllRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllRewardsRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EcosystemRewards_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.AllRewards(ctx, &protoReq) + msg, err := client.EcosystemRewards(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func request_Query_Reward_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRewardRequest +func local_request_Query_EcosystemRewards_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryEcosystemRewardsRequest var metadata runtime.ServerMetadata var ( @@ -127,56 +111,50 @@ func request_Query_Reward_0(ctx context.Context, marshaler runtime.Marshaler, cl return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_EcosystemRewards_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.Reward(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := server.EcosystemRewards(ctx, &protoReq) return msg, metadata, err } -func local_request_Query_Reward_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRewardRequest - var metadata runtime.ServerMetadata +var ( + filter_Query_RecipientAddressWithNftId_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) - var ( - val string - ok bool - err error - _ = err - ) +func request_Query_RecipientAddressWithNftId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRecipientAddressWithNftIdRequest + var metadata runtime.ServerMetadata - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecipientAddressWithNftId_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") - } + msg, err := client.RecipientAddressWithNftId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err - protoReq.Denom, err = runtime.String(val) +} - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) +func local_request_Query_RecipientAddressWithNftId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRecipientAddressWithNftIdRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_RecipientAddressWithNftId_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Reward(ctx, &protoReq) + msg, err := server.RecipientAddressWithNftId(ctx, &protoReq) return msg, metadata, err } @@ -210,7 +188,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_AllRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_EcosystemRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -221,7 +199,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_AllRewards_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_EcosystemRewards_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -229,11 +207,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_AllRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_EcosystemRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Reward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_RecipientAddressWithNftId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -244,7 +222,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_Reward_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_RecipientAddressWithNftId_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -252,7 +230,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_Reward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_RecipientAddressWithNftId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -317,7 +295,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_AllRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_EcosystemRewards_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -326,18 +304,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_AllRewards_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_EcosystemRewards_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_AllRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_EcosystemRewards_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_Reward_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_RecipientAddressWithNftId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -346,14 +324,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Reward_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_RecipientAddressWithNftId_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_Reward_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_RecipientAddressWithNftId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -363,15 +341,15 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "ecosystemincentive", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_AllRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "ecosystemincentive", "rewards", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_EcosystemRewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "ecosystemincentive", "rewards", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Reward_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "ecosystemincentive", "rewards", "address", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_RecipientAddressWithNftId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "ecosystemincentive", "recipients"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_AllRewards_0 = runtime.ForwardResponseMessage + forward_Query_EcosystemRewards_0 = runtime.ForwardResponseMessage - forward_Query_Reward_0 = runtime.ForwardResponseMessage + forward_Query_RecipientAddressWithNftId_0 = runtime.ForwardResponseMessage ) diff --git a/x/ecosystemincentive/types/validation.go b/x/ecosystemincentive/types/validation.go deleted file mode 100644 index 9ee312af2..000000000 --- a/x/ecosystemincentive/types/validation.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -import ( - "regexp" -) - -func ValidateRecipientContainerId(recipientContainerId string) error { - if !regexp.MustCompile(RecipientContainerIdPattern).MatchString(recipientContainerId) { - return ErrInvalidRecipientContainerId - } - - return nil -} diff --git a/x/ecosystemincentive/types/validation_test.go b/x/ecosystemincentive/types/validation_test.go deleted file mode 100644 index a410ee356..000000000 --- a/x/ecosystemincentive/types/validation_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package types_test - -// TODO -// func TestValidateIncentiveUnitIdLen() {} - -// TODO -// func TestValidateSubjectInfoNum() {} diff --git a/x/nftbackedloan/client/cli/query.go b/x/nftbackedloan/client/cli/query.go index 4f42a2bea..9ea0c27ab 100644 --- a/x/nftbackedloan/client/cli/query.go +++ b/x/nftbackedloan/client/cli/query.go @@ -25,7 +25,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand( CmdQueryParams(), - CmdQueryNftListing(), + CmdQueryListedNft(), CmdQueryListedNfts(), // CmdQueryLoans(), CmdQueryLoan(), @@ -65,7 +65,7 @@ func CmdQueryParams() *cobra.Command { return cmd } -func CmdQueryNftListing() *cobra.Command { +func CmdQueryListedNft() *cobra.Command { cmd := &cobra.Command{ Use: "nft-listing [class-id] [nft-id]", Short: "shows nft listing", @@ -75,12 +75,12 @@ func CmdQueryNftListing() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - params := &types.QueryNftListingRequest{ + params := &types.QueryListedNftRequest{ ClassId: args[0], - NftId: args[1], + TokenId: args[1], } - res, err := queryClient.NftListing(context.Background(), params) + res, err := queryClient.ListedNft(context.Background(), params) if err != nil { return err } @@ -172,7 +172,7 @@ func CmdQueryLoan() *cobra.Command { params := &types.QueryLoanRequest{ ClassId: args[0], - NftId: args[1], + TokenId: args[1], } res, err := queryClient.Loan(context.Background(), params) @@ -201,7 +201,7 @@ func CmdQueryNftBids() *cobra.Command { params := &types.QueryNftBidsRequest{ ClassId: args[0], - NftId: args[1], + TokenId: args[1], } res, err := queryClient.NftBids(context.Background(), params) @@ -317,7 +317,7 @@ func CmdQueryLiquidation() *cobra.Command { params := &types.QueryLiquidationRequest{ ClassId: args[0], - NftId: args[1], + TokenId: args[1], } res, err := queryClient.Liquidation(context.Background(), params) diff --git a/x/nftbackedloan/genesis.go b/x/nftbackedloan/genesis.go index ad1c23011..6ba54d084 100644 --- a/x/nftbackedloan/genesis.go +++ b/x/nftbackedloan/genesis.go @@ -11,7 +11,7 @@ import ( func InitGenesis(ctx sdk.Context, k keeper.Keeper, accountKeeper types.AccountKeeper, gs types.GenesisState) { k.SetParamSet(ctx, gs.Params) for _, listing := range gs.Listings { - k.SaveNftListing(ctx, listing) + k.SaveListedNft(ctx, listing) } for _, bid := range gs.Bids { k.SetBid(ctx, bid) @@ -25,7 +25,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, accountKeeper types.AccountKe func ExportGenesis(ctx sdk.Context, k keeper.Keeper) types.GenesisState { return types.GenesisState{ Params: k.GetParamSet(ctx), - Listings: k.GetAllNftListings(ctx), + Listings: k.GetAllListedNfts(ctx), Bids: k.GetAllBids(ctx), // Loans: k.GetAllDebts(ctx), } diff --git a/x/nftbackedloan/keeper/bid.go b/x/nftbackedloan/keeper/bid.go index 626be4374..9f078d694 100644 --- a/x/nftbackedloan/keeper/bid.go +++ b/x/nftbackedloan/keeper/bid.go @@ -104,7 +104,7 @@ func (k Keeper) DeleteBid(ctx sdk.Context, bid types.Bid) error { func (k Keeper) PlaceBid(ctx sdk.Context, msg *types.MsgPlaceBid) error { // Verify listing is in BIDDING state - listing, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, msg.NftId.IdBytes()) if err != nil { return err } @@ -179,7 +179,7 @@ func (k Keeper) ManualBid(ctx sdk.Context, listing types.Listing, newBid types.B if listing.State == types.ListingState_LISTING { listing.State = types.ListingState_BIDDING } - k.SaveNftListing(ctx, listing) + k.SaveListedNft(ctx, listing) return nil } @@ -263,7 +263,6 @@ func (k Keeper) SafeCloseBidCollectDeposit(ctx sdk.Context, bid types.Bid) (sdk. return CollectedAmount, nil } -// todo make unit test func (k Keeper) SafeCloseBidWithAllInterest(ctx sdk.Context, bid types.Bid, time time.Time) error { bidder, err := sdk.AccAddressFromBech32(bid.Id.Bidder) if err != nil { @@ -280,7 +279,7 @@ func (k Keeper) SafeCloseBidWithAllInterest(ctx sdk.Context, bid types.Bid, time } func (k Keeper) CancelBid(ctx sdk.Context, msg *types.MsgCancelBid) error { - listing, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, msg.NftId.IdBytes()) if err != nil { return err } @@ -337,7 +336,7 @@ func (k Keeper) CancelBid(ctx sdk.Context, msg *types.MsgCancelBid) error { } func (k Keeper) PayRemainder(ctx sdk.Context, msg *types.MsgPayRemainder) error { - listing, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, msg.NftId.IdBytes()) if err != nil { return err } @@ -399,7 +398,7 @@ func (k Keeper) GetExpiredBids(ctx sdk.Context, endTime time.Time) []types.Bid { func (k Keeper) DeleteBidsWithoutBorrowing(ctx sdk.Context, bids []types.Bid) { for _, bid := range bids { - listing, err := k.GetNftListingByIdBytes(ctx, bid.Id.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, bid.Id.NftId.IdBytes()) if err != nil { fmt.Println(err) continue diff --git a/x/nftbackedloan/keeper/bid_test.go b/x/nftbackedloan/keeper/bid_test.go index b7af7c45a..c2d8d03be 100644 --- a/x/nftbackedloan/keeper/bid_test.go +++ b/x/nftbackedloan/keeper/bid_test.go @@ -41,7 +41,7 @@ func (suite *KeeperTestSuite) TestPlaceBid() { AutomaticPayment: true, Deposit: sdk.NewInt64Coin("uatom", 1000000), }, - expectError: types.ErrNftListingDoesNotExist, + expectError: types.ErrListedNftDoesNotExist, expectPass: false, }, { diff --git a/x/nftbackedloan/keeper/grpc_query.go b/x/nftbackedloan/keeper/grpc_query.go index 7b4fcd393..4b2337bd2 100644 --- a/x/nftbackedloan/keeper/grpc_query.go +++ b/x/nftbackedloan/keeper/grpc_query.go @@ -23,18 +23,18 @@ func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types }, nil } -func (k Keeper) NftListing(c context.Context, req *types.QueryNftListingRequest) (*types.QueryNftListingResponse, error) { +func (k Keeper) ListedNft(c context.Context, req *types.QueryListedNftRequest) (*types.QueryListedNftResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "invalid request") } ctx := sdk.UnwrapSDKContext(c) - listing, err := k.GetNftListingByIdBytes(ctx, types.NftBytes(req.ClassId, req.NftId)) + listing, err := k.GetListedNftByIdBytes(ctx, types.NftBytes(req.ClassId, req.TokenId)) if err != nil { return nil, err } - return &types.QueryNftListingResponse{ + return &types.QueryListedNftResponse{ Listing: listing, }, nil } @@ -45,33 +45,31 @@ func (k Keeper) ListedNfts(c context.Context, req *types.QueryListedNftsRequest) } ctx := sdk.UnwrapSDKContext(c) - if req.Owner != "" { - acc, err := sdk.AccAddressFromBech32(req.Owner) - if err != nil { - return nil, status.Error(codes.InvalidArgument, "invalid request. address wrong") - } - return k.ListedNftsByOwner(c, acc) - } else { - listings := k.GetAllNftListings(ctx) - res, err := k.GetNftListingDetails(ctx, listings) + + if req.Owner == "" { + listings := k.GetAllListedNfts(ctx) + res, err := k.GetListedNftDetails(ctx, listings) if err != nil { - panic(err) + return nil, status.Error(codes.InvalidArgument, "invalid request. no nft details") } - return &types.QueryListedNftsResponse{ - Listings: res, - }, nil + return &types.QueryListedNftsResponse{Listings: res}, nil } + acc, err := sdk.AccAddressFromBech32(req.Owner) + if err != nil { + return nil, status.Error(codes.InvalidArgument, "invalid request. address wrong") + } + return k.ListedNftsByOwner(c, acc) } -func (k Keeper) GetNftListingDetails(ctx sdk.Context, listings []types.Listing) ([]types.NftListingDetail, error) { - res := []types.NftListingDetail{} +func (k Keeper) GetListedNftDetails(ctx sdk.Context, listings []types.Listing) ([]types.ListedNftDetail, error) { + res := []types.ListedNftDetail{} for _, v := range listings { nftInfo, found := k.nftKeeper.GetNFT(ctx, v.NftId.ClassId, v.NftId.TokenId) if !found { - return []types.NftListingDetail{}, types.ErrNftDoesNotExists + return []types.ListedNftDetail{}, types.ErrNftDoesNotExists } - detail := types.NftListingDetail{ + detail := types.ListedNftDetail{ Listing: v, NftInfo: types.NftInfo{ Id: nftInfo.GetId(), @@ -87,7 +85,7 @@ func (k Keeper) GetNftListingDetails(ctx sdk.Context, listings []types.Listing) func (k Keeper) ListedNftsByOwner(c context.Context, address sdk.AccAddress) (*types.QueryListedNftsResponse, error) { ctx := sdk.UnwrapSDKContext(c) listings := k.GetListingsByOwner(ctx, address) - res, err := k.GetNftListingDetails(ctx, listings) + res, err := k.GetListedNftDetails(ctx, listings) if err != nil { panic(err) } @@ -158,7 +156,7 @@ func (k Keeper) GetListedClass(ctx sdk.Context, classId string, limit int) (*typ var nfts []types.NftInfo var pnfts []*types.NftInfo - for i, v := range class.NftIds { + for i, v := range class.TokenIds { if limit <= i { break } @@ -180,7 +178,7 @@ func (k Keeper) GetListedClass(ctx sdk.Context, classId string, limit int) (*typ Symbol: classInfo.Symbol, Uri: classInfo.Uri, Urihash: classInfo.UriHash, - NftCount: uint64(len(class.NftIds)), + NftCount: uint64(len(class.TokenIds)), Nfts: pnfts, }, nil } @@ -191,10 +189,10 @@ func (k Keeper) Loan(c context.Context, req *types.QueryLoanRequest) (*types.Que } nftId := types.NftId{ ClassId: req.ClassId, - TokenId: req.NftId, + TokenId: req.TokenId, } ctx := sdk.UnwrapSDKContext(c) - listing, err := k.GetNftListingByIdBytes(ctx, nftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, nftId.IdBytes()) if err != nil { return &types.QueryLoanResponse{}, err } @@ -237,11 +235,18 @@ func (k Keeper) NftBids(c context.Context, req *types.QueryNftBidsRequest) (*typ return nil, status.Error(codes.InvalidArgument, "invalid request") } + if req.ClassId == "" && req.TokenId == "" { + bids := k.GetAllBids(sdk.UnwrapSDKContext(c)) + return &types.QueryNftBidsResponse{Bids: bids}, nil + } + + if req.ClassId == "" || req.TokenId == "" { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) - bids := k.GetBidsByNft(ctx, types.NftBytes(req.ClassId, req.NftId)) - return &types.QueryNftBidsResponse{ - Bids: bids, - }, nil + bids := k.GetBidsByNft(ctx, types.NftBytes(req.ClassId, req.TokenId)) + return &types.QueryNftBidsResponse{Bids: bids}, nil } func (k Keeper) BidderBids(c context.Context, req *types.QueryBidderBidsRequest) (*types.QueryBidderBidsResponse, error) { @@ -271,7 +276,7 @@ func (k Keeper) Liquidation(c context.Context, req *types.QueryLiquidationReques return nil, status.Error(codes.InvalidArgument, "invalid request") } ctx := sdk.UnwrapSDKContext(c) - listing, err := k.GetNftListingByIdBytes(ctx, types.NftBytes(req.ClassId, req.NftId)) + listing, err := k.GetListedNftByIdBytes(ctx, types.NftBytes(req.ClassId, req.TokenId)) if err != nil { return nil, err } diff --git a/x/nftbackedloan/keeper/grpc_query_test.go b/x/nftbackedloan/keeper/grpc_query_test.go index 762293b52..de3a61a81 100644 --- a/x/nftbackedloan/keeper/grpc_query_test.go +++ b/x/nftbackedloan/keeper/grpc_query_test.go @@ -19,12 +19,12 @@ func TestGRPCQuery(t *testing.T) { func (s *KeeperTestSuite) TestListedNfts() { var req *types.QueryListedNftsRequest - type postTest func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.NftListingDetail) + type postTest func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.ListedNftDetail) testCases := []struct { msg string malleate func(index int, require *require.Assertions) expError string - listingNft []types.NftListingDetail + listingNft []types.ListedNftDetail postTest postTest }{ { @@ -33,8 +33,8 @@ func (s *KeeperTestSuite) TestListedNfts() { req = &types.QueryListedNftsRequest{} }, "", - []types.NftListingDetail(nil), - func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.NftListingDetail) { + []types.ListedNftDetail(nil), + func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.ListedNftDetail) { require.Equal(res.Listings, expListingNft, "the error occurred on:%d", index) }, }, @@ -46,8 +46,8 @@ func (s *KeeperTestSuite) TestListedNfts() { } }, "invalid request. address wrong", - []types.NftListingDetail{}, - func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.NftListingDetail) { + []types.ListedNftDetail{}, + func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.ListedNftDetail) { }, }, { @@ -59,7 +59,7 @@ func (s *KeeperTestSuite) TestListedNfts() { } }, "", - []types.NftListingDetail{ + []types.ListedNftDetail{ { Listing: types.Listing{ NftId: types.NftId{ClassId: "class2", TokenId: "nft2"}, @@ -128,7 +128,7 @@ func (s *KeeperTestSuite) TestListedNfts() { }, }, }, - func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.NftListingDetail) { + func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.ListedNftDetail) { require.Equal(expListingNft, res.Listings, "the error occurred on:%d", msg, res.Listings[index].Listing.NftId) }, }, @@ -140,7 +140,7 @@ func (s *KeeperTestSuite) TestListedNfts() { } }, "", - []types.NftListingDetail{ + []types.ListedNftDetail{ { Listing: types.Listing{ NftId: types.NftId{ClassId: "class7", TokenId: "nft7"}, @@ -164,7 +164,7 @@ func (s *KeeperTestSuite) TestListedNfts() { }, }, }, - func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.NftListingDetail) { + func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.ListedNftDetail) { require.Equal(res.Listings, expListingNft, "the error occurred on:%d", msg) }, }, @@ -174,7 +174,7 @@ func (s *KeeperTestSuite) TestListedNfts() { req = &types.QueryListedNftsRequest{} }, "", - []types.NftListingDetail{ + []types.ListedNftDetail{ { Listing: types.Listing{ NftId: types.NftId{ClassId: "class2", TokenId: "nft2"}, @@ -265,7 +265,7 @@ func (s *KeeperTestSuite) TestListedNfts() { }, }, }, - func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.NftListingDetail) { + func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.ListedNftDetail) { require.Equal(res.Listings, expListingNft, "the error occurred on:%d", msg) }, }, @@ -277,8 +277,8 @@ func (s *KeeperTestSuite) TestListedNfts() { } }, "", - []types.NftListingDetail(nil), - func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.NftListingDetail) { + []types.ListedNftDetail(nil), + func(index int, msg string, require *require.Assertions, res *types.QueryListedNftsResponse, expListingNft []types.ListedNftDetail) { require.Equal(res.Listings, expListingNft, "the error occurred on:%d", msg, index) }, }, diff --git a/x/nftbackedloan/keeper/liquidation.go b/x/nftbackedloan/keeper/liquidation.go index bc76673f5..393a956cb 100644 --- a/x/nftbackedloan/keeper/liquidation.go +++ b/x/nftbackedloan/keeper/liquidation.go @@ -12,9 +12,9 @@ import ( // Status update to Liquidation func (k Keeper) SetLiquidation(ctx sdk.Context, msg *types.MsgEndNftListing) error { // check listing already exists - listing, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, msg.NftId.IdBytes()) if err != nil { - return types.ErrNftListingDoesNotExist + return types.ErrListedNftDoesNotExist } // Check nft exists @@ -47,20 +47,20 @@ func (k Keeper) SetLiquidation(ctx sdk.Context, msg *types.MsgEndNftListing) err return err } - k.DeleteNftListings(ctx, listing) + k.DeleteListedNfts(ctx, listing) // Call AfterNftUnlistedWithoutPayment to delete NFT ID from the ecosystem-incentive KVStore // since it's unlisted. - if _, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()); err != nil { - k.AfterNftUnlistedWithoutPayment(ctx, listing.NftId) - } + // if _, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()); err != nil { + // k.AfterNftUnlistedWithoutPayment(ctx, listing.NftId) + // } } else { params := k.GetParamSet(ctx) listing.State = types.ListingState_LIQUIDATION listing.LiquidatedAt = ctx.BlockTime() listing.FullPaymentEndAt = ctx.BlockTime().Add(time.Duration(params.NftListingFullPaymentPeriod) * time.Second) - k.SaveNftListing(ctx, listing) + k.SaveListedNft(ctx, listing) // automatic payment after listing ends for _, bid := range bids { @@ -109,7 +109,7 @@ func (k Keeper) LiquidateExpiredBids(ctx sdk.Context) { continue } - listing, err := k.GetNftListingByIdBytes(ctx, bid.Id.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, bid.Id.NftId.IdBytes()) if err != nil { fmt.Println("failed to get listing by id bytes: %w", err) continue @@ -155,7 +155,7 @@ func (k Keeper) RunLiquidationProcess(ctx sdk.Context, bids types.NftBids, listi fmt.Println("failed to liquidation process with no winner: %w", err) return err } - k.DeleteNftListings(ctx, listing) + k.DeleteListedNfts(ctx, listing) } else { // forfeitedBids, refundBids := types.ForfeitedBidsAndRefundBids(bidsSortedByDeposit, winnerBid) err := k.LiquidateWithWinner(cacheCtx, forfeitedBids, refundBids, listing) @@ -166,7 +166,7 @@ func (k Keeper) RunLiquidationProcess(ctx sdk.Context, bids types.NftBids, listi // schedule NFT & token send after X days listing.SuccessfulBidEndAt = ctx.BlockTime().Add(time.Second * time.Duration(params.NftListingNftDeliveryPeriod)) listing.State = types.ListingState_SUCCESSFUL_BID - k.SaveNftListing(ctx, listing) + k.SaveListedNft(ctx, listing) } write() return nil diff --git a/x/nftbackedloan/keeper/loan.go b/x/nftbackedloan/keeper/loan.go index abaf9e7ea..d11f94e40 100644 --- a/x/nftbackedloan/keeper/loan.go +++ b/x/nftbackedloan/keeper/loan.go @@ -7,7 +7,7 @@ import ( ) func (k Keeper) Borrow(ctx sdk.Context, msg *types.MsgBorrow) error { - listing, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, msg.NftId.IdBytes()) if err != nil { return err } @@ -39,7 +39,7 @@ func (k Keeper) Borrow(ctx sdk.Context, msg *types.MsgBorrow) error { } func (k Keeper) ManualBorrow(ctx sdk.Context, nft types.NftId, borrows []types.BorrowBid, borrower string) error { - listing, err := k.GetNftListingByIdBytes(ctx, nft.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, nft.IdBytes()) if err != nil { return err } @@ -106,7 +106,7 @@ func (k Keeper) Repay(ctx sdk.Context, msg *types.MsgRepay) error { } func (k Keeper) ManualRepay(ctx sdk.Context, nft types.NftId, repays []types.BorrowBid, borrower string) error { - listing, err := k.GetNftListingByIdBytes(ctx, nft.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, nft.IdBytes()) if err != nil { return err } @@ -180,7 +180,7 @@ func (k Keeper) ManualRepay(ctx sdk.Context, nft types.NftId, repays []types.Bor } func (k Keeper) AutoRepay(ctx sdk.Context, nft types.NftId, bids types.NftBids, borrower, receiver string) error { - listing, err := k.GetNftListingByIdBytes(ctx, nft.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, nft.IdBytes()) if err != nil { return err } diff --git a/x/nftbackedloan/keeper/nft_listed_class.go b/x/nftbackedloan/keeper/nft_listed_class.go index e44d53b7c..9b06357f5 100644 --- a/x/nftbackedloan/keeper/nft_listed_class.go +++ b/x/nftbackedloan/keeper/nft_listed_class.go @@ -8,7 +8,7 @@ import ( func (k Keeper) UpdateListedClass(ctx sdk.Context, listing types.Listing) { // if listing doesn't exist, delete it from listed calss - if _, err := k.GetNftListingByIdBytes(ctx, listing.IdBytes()); err != nil { + if _, err := k.GetListedNftByIdBytes(ctx, listing.IdBytes()); err != nil { k.DeleteListingFromListedClass(ctx, listing) return } @@ -33,8 +33,8 @@ func (k Keeper) SetListingInListedClass(ctx sdk.Context, listing types.Listing) if bzIdlist == nil { bz := k.cdc.MustMarshal( &types.ListedClass{ - ClassId: listing.NftId.ClassId, - NftIds: []string{listing.NftId.TokenId}, + ClassId: listing.NftId.ClassId, + TokenIds: []string{listing.NftId.TokenId}, }, ) store.Set(types.ClassKey(listing.ClassIdBytes()), bz) @@ -47,7 +47,7 @@ func (k Keeper) SetListingInListedClass(ctx sdk.Context, listing types.Listing) // if index != -1 { // return // } - class.NftIds = append(class.NftIds, listing.NftId.TokenId) + class.TokenIds = append(class.TokenIds, listing.NftId.TokenId) bz := k.cdc.MustMarshal(&class) store.Set(types.ClassKey(listing.ClassIdBytes()), bz) } @@ -66,7 +66,7 @@ func (k Keeper) DeleteListingFromListedClass(ctx sdk.Context, listing types.List // } // class.NftIds = keeper.RemoveIndex(class.NftIds, removeIndex) // if class doesn't have any listed nft, just delete class id key from KVStore - if len(class.NftIds) == 1 && class.NftIds[0] == listing.NftId.TokenId { + if len(class.TokenIds) == 1 && class.TokenIds[0] == listing.NftId.TokenId { store.Delete(types.ClassKey(listing.ClassIdBytes())) return } @@ -79,7 +79,7 @@ func (k Keeper) GetListedClassByClassIdBytes(ctx sdk.Context, classIdByte []byte store := ctx.KVStore(k.storeKey) bz := store.Get(classIdByte) if bz == nil { - return types.ListedClass{}, types.ErrNftListingDoesNotExist + return types.ListedClass{}, types.ErrListedNftDoesNotExist } class := types.ListedClass{} k.cdc.MustUnmarshal(bz, &class) diff --git a/x/nftbackedloan/keeper/nft_listing.go b/x/nftbackedloan/keeper/nft_listing.go index 1d78187ea..86ac58d7e 100644 --- a/x/nftbackedloan/keeper/nft_listing.go +++ b/x/nftbackedloan/keeper/nft_listing.go @@ -13,11 +13,11 @@ import ( "github.com/UnUniFi/chain/x/nftbackedloan/types" ) -func (k Keeper) GetNftListingByIdBytes(ctx sdk.Context, nftIdBytes []byte) (types.Listing, error) { +func (k Keeper) GetListedNftByIdBytes(ctx sdk.Context, nftIdBytes []byte) (types.Listing, error) { store := ctx.KVStore(k.storeKey) bz := store.Get(types.NftListingKey(nftIdBytes)) if bz == nil { - return types.Listing{}, types.ErrNftListingDoesNotExist + return types.Listing{}, types.ErrListedNftDoesNotExist } listing := types.Listing{} k.cdc.MustUnmarshal(bz, &listing) @@ -33,7 +33,7 @@ func (k Keeper) GetListingsByOwner(ctx sdk.Context, owner sdk.AccAddress) []type for ; it.Valid(); it.Next() { nftIdBytes := it.Value() - listing, err := k.GetNftListingByIdBytes(ctx, nftIdBytes) + listing, err := k.GetListedNftByIdBytes(ctx, nftIdBytes) if err != nil { fmt.Println("failed to get listing by id bytes: %w", err) continue @@ -63,14 +63,14 @@ func getTimeKey(prefix string, timestamp time.Time) []byte { } // call this method when you want to call SetNftListing -func (k Keeper) SaveNftListing(ctx sdk.Context, listing types.Listing) { - k.SetNftListing(ctx, listing) +func (k Keeper) SaveListedNft(ctx sdk.Context, listing types.Listing) { + k.SetListedNft(ctx, listing) k.UpdateListedClass(ctx, listing) } -func (k Keeper) SetNftListing(ctx sdk.Context, listing types.Listing) { - if oldListing, err := k.GetNftListingByIdBytes(ctx, listing.IdBytes()); err == nil { - k.DeleteNftListings(ctx, oldListing) +func (k Keeper) SetListedNft(ctx sdk.Context, listing types.Listing) { + if oldListing, err := k.GetListedNftByIdBytes(ctx, listing.IdBytes()); err == nil { + k.DeleteListedNfts(ctx, oldListing) } nftIdBytes := listing.IdBytes() @@ -93,12 +93,12 @@ func (k Keeper) SetNftListing(ctx sdk.Context, listing types.Listing) { } // call this method when you want to call DeleteNftListing -func (k Keeper) DeleteNftListings(ctx sdk.Context, listing types.Listing) { - k.DeleteNftListing(ctx, listing) +func (k Keeper) DeleteListedNfts(ctx sdk.Context, listing types.Listing) { + k.DeleteListedNft(ctx, listing) k.UpdateListedClass(ctx, listing) } -func (k Keeper) DeleteNftListing(ctx sdk.Context, listing types.Listing) { +func (k Keeper) DeleteListedNft(ctx sdk.Context, listing types.Listing) { nftIdBytes := listing.IdBytes() store := ctx.KVStore(k.storeKey) store.Delete(types.NftListingKey(nftIdBytes)) @@ -117,7 +117,7 @@ func (k Keeper) DeleteNftListing(ctx sdk.Context, listing types.Listing) { } } -func (k Keeper) GetFullPaymentNftListingsEndingAt(ctx sdk.Context, endTime time.Time) []types.Listing { +func (k Keeper) GetFullPaymentListedNftsEndingAt(ctx sdk.Context, endTime time.Time) []types.Listing { store := ctx.KVStore(k.storeKey) timeKey := getTimeKey(types.KeyPrefixFullPaymentPeriodListing, endTime) it := store.Iterator([]byte(types.KeyPrefixFullPaymentPeriodListing), storetypes.InclusiveEndBytes(timeKey)) @@ -126,7 +126,7 @@ func (k Keeper) GetFullPaymentNftListingsEndingAt(ctx sdk.Context, endTime time. listings := []types.Listing{} for ; it.Valid(); it.Next() { nftIdBytes := it.Value() - listing, err := k.GetNftListingByIdBytes(ctx, nftIdBytes) + listing, err := k.GetListedNftByIdBytes(ctx, nftIdBytes) if err != nil { fmt.Println("failed to get listing by id bytes: %w", err) continue @@ -137,7 +137,7 @@ func (k Keeper) GetFullPaymentNftListingsEndingAt(ctx sdk.Context, endTime time. return listings } -func (k Keeper) GetSuccessfulBidNftListingsEndingAt(ctx sdk.Context, endTime time.Time) []types.Listing { +func (k Keeper) GetSuccessfulBidListedNftsEndingAt(ctx sdk.Context, endTime time.Time) []types.Listing { store := ctx.KVStore(k.storeKey) timeKey := getTimeKey(types.KeyPrefixSuccessfulBidListing, endTime) it := store.Iterator([]byte(types.KeyPrefixSuccessfulBidListing), storetypes.InclusiveEndBytes(timeKey)) @@ -146,7 +146,7 @@ func (k Keeper) GetSuccessfulBidNftListingsEndingAt(ctx sdk.Context, endTime tim listings := []types.Listing{} for ; it.Valid(); it.Next() { nftIdBytes := it.Value() - listing, err := k.GetNftListingByIdBytes(ctx, nftIdBytes) + listing, err := k.GetListedNftByIdBytes(ctx, nftIdBytes) if err != nil { fmt.Println("failed to get listing by id bytes: %w", err) continue @@ -157,7 +157,7 @@ func (k Keeper) GetSuccessfulBidNftListingsEndingAt(ctx sdk.Context, endTime tim return listings } -func (k Keeper) GetAllNftListings(ctx sdk.Context) []types.Listing { +func (k Keeper) GetAllListedNfts(ctx sdk.Context) []types.Listing { store := ctx.KVStore(k.storeKey) it := sdk.KVStorePrefixIterator(store, []byte(types.KeyPrefixNftListing)) defer it.Close() @@ -205,7 +205,7 @@ func (k Keeper) ListNft(ctx sdk.Context, msg *types.MsgListNft) error { return err } - k.SaveNftListing(ctx, listing) + k.SaveListedNft(ctx, listing) // get the memo data from Tx contains MsgListNft // k.AfterNftListed(ctx, msg.NftId, GetMemo(ctx.TxBytes(), k.txCfg)) @@ -222,9 +222,9 @@ func (k Keeper) ListNft(ctx sdk.Context, msg *types.MsgListNft) error { func (k Keeper) CancelNftListing(ctx sdk.Context, msg *types.MsgCancelListing) error { // check listing already exists - listing, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, msg.NftId.IdBytes()) if err != nil { - return types.ErrNftListingDoesNotExist + return types.ErrListedNftDoesNotExist } // // Check nft exists @@ -268,11 +268,11 @@ func (k Keeper) CancelNftListing(ctx sdk.Context, msg *types.MsgCancelListing) e } // delete listing - k.DeleteNftListings(ctx, listing) + k.DeleteListedNfts(ctx, listing) // Call AfterNftUnlistedWithoutPayment to delete NFT ID from the ecosystem-incentive KVStore // since it's unlisted. - k.AfterNftUnlistedWithoutPayment(ctx, listing.NftId) + // k.AfterNftUnlistedWithoutPayment(ctx, listing.NftId) // Emit event for nft listing cancel _ = ctx.EventManager().EmitTypedEvent(&types.EventCancelListing{ @@ -287,7 +287,7 @@ func (k Keeper) CancelNftListing(ctx sdk.Context, msg *types.MsgCancelListing) e func (k Keeper) HandleFullPaymentsPeriodEndings(ctx sdk.Context) { params := k.GetParamSet(ctx) // get listings at the end of the payment period - listings := k.GetFullPaymentNftListingsEndingAt(ctx, ctx.BlockTime()) + listings := k.GetFullPaymentListedNftsEndingAt(ctx, ctx.BlockTime()) // handle not fully paid bids for _, listing := range listings { @@ -311,7 +311,7 @@ func (k Keeper) HandleFullPaymentsPeriodEndings(ctx sdk.Context) { func (k Keeper) DeliverSuccessfulBids(ctx sdk.Context) { params := k.GetParamSet(ctx) // get listings ended earlier - listings := k.GetSuccessfulBidNftListingsEndingAt(ctx, ctx.BlockTime()) + listings := k.GetSuccessfulBidListedNftsEndingAt(ctx, ctx.BlockTime()) _, _ = params, listings for _, listing := range listings { @@ -355,7 +355,7 @@ func (k Keeper) DeliverSuccessfulBids(ctx sdk.Context) { fmt.Println(err) continue } - k.DeleteNftListings(ctx, listing) + k.DeleteListedNfts(ctx, listing) cacheCtx, write := ctx.CacheContext() @@ -408,6 +408,6 @@ func (k Keeper) ProcessPaymentWithCommissionFee(ctx sdk.Context, listingOwner sd // Call AfterNftPaymentWithCommission hook method to inform the payment is successfully // executed. - k.AfterNftPaymentWithCommission(ctx, nftId, sdk.NewCoin(amount.Denom, fee)) + // k.AfterNftPaymentWithCommission(ctx, nftId, sdk.NewCoin(amount.Denom, fee)) return nil } diff --git a/x/nftbackedloan/keeper/nft_listing_test.go b/x/nftbackedloan/keeper/nft_listing_test.go index 6acb1995f..8c66ee57c 100644 --- a/x/nftbackedloan/keeper/nft_listing_test.go +++ b/x/nftbackedloan/keeper/nft_listing_test.go @@ -154,7 +154,7 @@ func (suite *KeeperTestSuite) TestListNft() { suite.Require().NoError(err) // get listing - listing, err := keeper.GetNftListingByIdBytes(suite.ctx, (types.NftId{ClassId: tc.classId, TokenId: tc.nftId}).IdBytes()) + listing, err := keeper.GetListedNftByIdBytes(suite.ctx, (types.NftId{ClassId: tc.classId, TokenId: tc.nftId}).IdBytes()) suite.Require().NoError(err) // check ownership is transferred @@ -331,7 +331,7 @@ func (suite *KeeperTestSuite) TestCancelNftListing() { suite.Require().Equal(owner, tc.nftOwner) // check nft listing is deleted - _, err := keeper.GetNftListingByIdBytes(suite.ctx, nftIdentifier.IdBytes()) + _, err := keeper.GetListedNftByIdBytes(suite.ctx, nftIdentifier.IdBytes()) suite.Require().Error(err) } else { suite.Require().Error(err) @@ -406,12 +406,12 @@ func (suite *KeeperTestSuite) TestDeliverSuccessfulBids() { }) suite.Require().NoError(err) - listing, err := keeper.GetNftListingByIdBytes(suite.ctx, nftIdentifier.IdBytes()) + listing, err := keeper.GetListedNftByIdBytes(suite.ctx, nftIdentifier.IdBytes()) suite.Require().NoError(err) listing.SuccessfulBidEndAt = now listing.LiquidatedAt = now listing.State = types.ListingState_SUCCESSFUL_BID - keeper.SetNftListing(suite.ctx, listing) + keeper.SetListedNft(suite.ctx, listing) suite.ctx = suite.ctx.WithBlockTime(now.Add(time.Second)) oldNftOwnerBalance := suite.app.BankKeeper.GetBalance(suite.ctx, nftOwner, "uguu") @@ -432,7 +432,7 @@ func (suite *KeeperTestSuite) TestDeliverSuccessfulBids() { suite.Require().Len(bids, 0) // check nft listing deleted - _, err = keeper.GetNftListingByIdBytes(suite.ctx, nftIdentifier.IdBytes()) + _, err = keeper.GetListedNftByIdBytes(suite.ctx, nftIdentifier.IdBytes()) suite.Require().Error(err) // check if AfterNftPaymentWithCommission is called diff --git a/x/nftbackedloan/keeper/sell.go b/x/nftbackedloan/keeper/sell.go index 4a8769828..8522538d9 100644 --- a/x/nftbackedloan/keeper/sell.go +++ b/x/nftbackedloan/keeper/sell.go @@ -11,9 +11,9 @@ import ( func (k Keeper) SetSellingDecision(ctx sdk.Context, msg *types.MsgSellingDecision) error { // check listing already exists - listing, err := k.GetNftListingByIdBytes(ctx, msg.NftId.IdBytes()) + listing, err := k.GetListedNftByIdBytes(ctx, msg.NftId.IdBytes()) if err != nil { - return types.ErrNftListingDoesNotExist + return types.ErrListedNftDoesNotExist } // Check nft exists @@ -49,7 +49,7 @@ func (k Keeper) SetSellingDecision(ctx sdk.Context, msg *types.MsgSellingDecisio listing.State = types.ListingState_SELLING_DECISION listing.LiquidatedAt = ctx.BlockTime() listing.FullPaymentEndAt = ctx.BlockTime().Add(time.Duration(params.NftListingFullPaymentPeriod) * time.Second) - k.SaveNftListing(ctx, listing) + k.SaveListedNft(ctx, listing) // automatic payment if enabled if len(bids) > 0 { @@ -119,6 +119,6 @@ func (k Keeper) RunSellingDecisionProcess(ctx sdk.Context, bids types.NftBids, l listing.SuccessfulBidEndAt = ctx.BlockTime().Add(time.Second * time.Duration(params.NftListingNftDeliveryPeriod)) listing.State = types.ListingState_SUCCESSFUL_BID } - k.SaveNftListing(ctx, listing) + k.SaveListedNft(ctx, listing) return nil } diff --git a/x/nftbackedloan/keeper/sell_test.go b/x/nftbackedloan/keeper/sell_test.go index 44be0d829..0483852a3 100644 --- a/x/nftbackedloan/keeper/sell_test.go +++ b/x/nftbackedloan/keeper/sell_test.go @@ -175,7 +175,7 @@ func (suite *KeeperTestSuite) TestSellingDecision() { } // check full payment end time update - listing, err := suite.app.NftbackedloanKeeper.GetNftListingByIdBytes(suite.ctx, nftIdentifier.IdBytes()) + listing, err := suite.app.NftbackedloanKeeper.GetListedNftByIdBytes(suite.ctx, nftIdentifier.IdBytes()) suite.Require().NoError(err) suite.Require().Equal(listing.State, types.ListingState_SELLING_DECISION) suite.Require().Equal(suite.ctx.BlockTime().Add(time.Second*time.Duration(params.NftListingFullPaymentPeriod)), listing.FullPaymentEndAt) diff --git a/x/nftbackedloan/keeper/utils.go b/x/nftbackedloan/keeper/utils.go index 33b8967c6..bb8858d7e 100644 --- a/x/nftbackedloan/keeper/utils.go +++ b/x/nftbackedloan/keeper/utils.go @@ -28,7 +28,7 @@ func ValidateListNftMsg(k Keeper, ctx sdk.Context, msg *types.MsgListNft) error func CheckListNft(k Keeper, ctx sdk.Context, sender sdk.AccAddress, nftId types.NftId, bidToken string, minimumDepositRate sdk.Dec) error { // check listing already exists - _, err := k.GetNftListingByIdBytes(ctx, nftId.IdBytes()) + _, err := k.GetListedNftByIdBytes(ctx, nftId.IdBytes()) if err == nil { return types.ErrNftListingAlreadyExists } diff --git a/x/nftbackedloan/types/errors.go b/x/nftbackedloan/types/errors.go index 37dca07d2..2aec40acc 100644 --- a/x/nftbackedloan/types/errors.go +++ b/x/nftbackedloan/types/errors.go @@ -6,7 +6,7 @@ import ( var ( ErrNftListingAlreadyExists = sdkerrors.Register(ModuleName, 1, "nft listing already exist") - ErrNftListingDoesNotExist = sdkerrors.Register(ModuleName, 2, "nft listing does not exist") + ErrListedNftDoesNotExist = sdkerrors.Register(ModuleName, 2, "nft listing does not exist") ErrBidDoesNotExists = sdkerrors.Register(ModuleName, 3, "nft bid does not exist") ErrNotSupportedBidToken = sdkerrors.Register(ModuleName, 4, "not supported bid token") ErrNftDoesNotExists = sdkerrors.Register(ModuleName, 5, "specified nft does not exist") diff --git a/x/nftbackedloan/types/nftbackedloan.pb.go b/x/nftbackedloan/types/nftbackedloan.pb.go index d4db40ec5..f9080a4d1 100644 --- a/x/nftbackedloan/types/nftbackedloan.pb.go +++ b/x/nftbackedloan/types/nftbackedloan.pb.go @@ -173,8 +173,8 @@ func (m *BidId) GetBidder() string { } type ListedClass struct { - ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - NftIds []string `protobuf:"bytes,2,rep,name=nft_ids,json=nftIds,proto3" json:"nft_ids,omitempty"` + ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` + TokenIds []string `protobuf:"bytes,2,rep,name=token_ids,json=tokenIds,proto3" json:"token_ids,omitempty"` } func (m *ListedClass) Reset() { *m = ListedClass{} } @@ -217,9 +217,9 @@ func (m *ListedClass) GetClassId() string { return "" } -func (m *ListedClass) GetNftIds() []string { +func (m *ListedClass) GetTokenIds() []string { if m != nil { - return m.NftIds + return m.TokenIds } return nil } @@ -754,82 +754,82 @@ func init() { } var fileDescriptor_9e729891a263bcae = []byte{ - // 1186 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0x13, 0x47, - 0x14, 0xce, 0x26, 0xfe, 0x49, 0x8e, 0x4d, 0xb2, 0x4c, 0x03, 0x38, 0x81, 0x3a, 0xd1, 0x56, 0x42, - 0xb4, 0x15, 0xb6, 0x00, 0xa1, 0x0a, 0x44, 0xa5, 0xda, 0xd9, 0x00, 0x4b, 0x23, 0x43, 0xed, 0x58, - 0x54, 0xbd, 0x59, 0x8d, 0x77, 0xc7, 0xce, 0x88, 0xdd, 0x19, 0xb3, 0x3b, 0x0b, 0xe4, 0x19, 0x7a, - 0xc3, 0x55, 0xdb, 0xb7, 0xe8, 0x4d, 0x1f, 0xa0, 0x97, 0x48, 0xbd, 0x41, 0xbd, 0xaa, 0x7a, 0x41, - 0x2b, 0x78, 0x83, 0x3e, 0x41, 0x35, 0x3f, 0x6b, 0x9b, 0x94, 0x80, 0x69, 0x7b, 0x65, 0x9f, 0x39, - 0xe7, 0xfb, 0xbe, 0xb3, 0x73, 0x7e, 0x76, 0xe1, 0xe3, 0x8c, 0x65, 0x8c, 0x0e, 0x69, 0x93, 0x0d, - 0xc5, 0x00, 0x07, 0x0f, 0x48, 0x18, 0x71, 0xcc, 0x5e, 0xb7, 0x1a, 0xe3, 0x84, 0x0b, 0x8e, 0x4e, - 0x99, 0xd0, 0xc6, 0x6b, 0xce, 0xcd, 0xf5, 0x11, 0x1f, 0x71, 0x15, 0xd1, 0x94, 0xff, 0x74, 0xf0, - 0xe6, 0xd6, 0x88, 0xf3, 0x51, 0x44, 0x9a, 0xca, 0x1a, 0x64, 0xc3, 0xa6, 0xa0, 0x31, 0x49, 0x05, - 0x8e, 0xc7, 0x26, 0xa0, 0x7e, 0x34, 0x20, 0xcc, 0x12, 0x2c, 0x28, 0x67, 0xb9, 0x3f, 0xe0, 0x69, - 0xcc, 0xd3, 0xe6, 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xde, 0x57, 0x7d, 0xcf, 0x6d, 0xed, 0xcb, 0x83, 0x02, 0x42, 0xb0, - 0xda, 0xeb, 0xef, 0xec, 0xec, 0xf6, 0x7a, 0x37, 0xfb, 0x7b, 0x7e, 0xdb, 0x73, 0xed, 0x62, 0xfb, - 0xf6, 0xb3, 0x97, 0x75, 0xeb, 0xf9, 0xcb, 0xba, 0xf5, 0xe7, 0xcb, 0xba, 0xf5, 0xf4, 0x55, 0x7d, - 0xe1, 0xf9, 0xab, 0xfa, 0xc2, 0x6f, 0xaf, 0xea, 0x0b, 0xdf, 0x34, 0x66, 0x36, 0x55, 0x9f, 0xf5, - 0x19, 0xbd, 0x49, 0x9b, 0xc1, 0x01, 0xa6, 0xac, 0xf9, 0xe4, 0xc8, 0x67, 0xb9, 0xda, 0x5a, 0x83, - 0x92, 0x7a, 0xce, 0x2b, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, 0x34, 0xcb, 0xe2, 0xe3, 0xbc, 0x0b, - 0x00, 0x00, + // 1189 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0x13, 0xc7, + 0x17, 0xcf, 0x26, 0xfe, 0xca, 0xb1, 0x49, 0x96, 0xf9, 0x07, 0xfe, 0x4e, 0xa0, 0x4e, 0xb4, 0x95, + 0x50, 0xda, 0x0a, 0x5b, 0x80, 0x50, 0x05, 0xa2, 0x52, 0xed, 0x38, 0xc0, 0xd2, 0xc8, 0xd0, 0x75, + 0x2c, 0xaa, 0xde, 0xac, 0xc6, 0xbb, 0x63, 0x67, 0xc4, 0xee, 0x8c, 0xd9, 0x9d, 0x05, 0xf2, 0x0c, + 0xbd, 0xe1, 0xaa, 0xed, 0x5b, 0xf4, 0xa6, 0x0f, 0xd0, 0x4b, 0xa4, 0xde, 0xa0, 0x5e, 0x55, 0xbd, + 0xa0, 0x15, 0xbc, 0x41, 0x9f, 0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 0xff, 0xff, 0x9c, 0xf1, 0xcb, + 0x14, 0xc0, 0x0b, 0x00, 0x00, } func (m *NftId) Marshal() (dAtA []byte, err error) { @@ -931,11 +931,11 @@ func (m *ListedClass) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NftIds) > 0 { - for iNdEx := len(m.NftIds) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.NftIds[iNdEx]) - copy(dAtA[i:], m.NftIds[iNdEx]) - i = encodeVarintNftbackedloan(dAtA, i, uint64(len(m.NftIds[iNdEx]))) + if len(m.TokenIds) > 0 { + for iNdEx := len(m.TokenIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.TokenIds[iNdEx]) + copy(dAtA[i:], m.TokenIds[iNdEx]) + i = encodeVarintNftbackedloan(dAtA, i, uint64(len(m.TokenIds[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -1472,8 +1472,8 @@ func (m *ListedClass) Size() (n int) { if l > 0 { n += 1 + l + sovNftbackedloan(uint64(l)) } - if len(m.NftIds) > 0 { - for _, s := range m.NftIds { + if len(m.TokenIds) > 0 { + for _, s := range m.TokenIds { l = len(s) n += 1 + l + sovNftbackedloan(uint64(l)) } @@ -1932,7 +1932,7 @@ func (m *ListedClass) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NftIds", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenIds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1960,7 +1960,7 @@ func (m *ListedClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NftIds = append(m.NftIds, string(dAtA[iNdEx:postIndex])) + m.TokenIds = append(m.TokenIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/nftbackedloan/types/query.pb.go b/x/nftbackedloan/types/query.pb.go index cd19a8b35..54f1296d8 100644 --- a/x/nftbackedloan/types/query.pb.go +++ b/x/nftbackedloan/types/query.pb.go @@ -113,23 +113,23 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } -type QueryNftListingRequest struct { +type QueryListedNftRequest struct { ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - NftId string `protobuf:"bytes,2,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty"` + TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` } -func (m *QueryNftListingRequest) Reset() { *m = QueryNftListingRequest{} } -func (m *QueryNftListingRequest) String() string { return proto.CompactTextString(m) } -func (*QueryNftListingRequest) ProtoMessage() {} -func (*QueryNftListingRequest) Descriptor() ([]byte, []int) { +func (m *QueryListedNftRequest) Reset() { *m = QueryListedNftRequest{} } +func (m *QueryListedNftRequest) String() string { return proto.CompactTextString(m) } +func (*QueryListedNftRequest) ProtoMessage() {} +func (*QueryListedNftRequest) Descriptor() ([]byte, []int) { return fileDescriptor_7db9d9524c1d8ab8, []int{2} } -func (m *QueryNftListingRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryListedNftRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryNftListingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryListedNftRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryNftListingRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryListedNftRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -139,48 +139,48 @@ func (m *QueryNftListingRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryNftListingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNftListingRequest.Merge(m, src) +func (m *QueryListedNftRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListedNftRequest.Merge(m, src) } -func (m *QueryNftListingRequest) XXX_Size() int { +func (m *QueryListedNftRequest) XXX_Size() int { return m.Size() } -func (m *QueryNftListingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNftListingRequest.DiscardUnknown(m) +func (m *QueryListedNftRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListedNftRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryNftListingRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryListedNftRequest proto.InternalMessageInfo -func (m *QueryNftListingRequest) GetClassId() string { +func (m *QueryListedNftRequest) GetClassId() string { if m != nil { return m.ClassId } return "" } -func (m *QueryNftListingRequest) GetNftId() string { +func (m *QueryListedNftRequest) GetTokenId() string { if m != nil { - return m.NftId + return m.TokenId } return "" } -type QueryNftListingResponse struct { +type QueryListedNftResponse struct { Listing Listing `protobuf:"bytes,1,opt,name=listing,proto3" json:"listing"` } -func (m *QueryNftListingResponse) Reset() { *m = QueryNftListingResponse{} } -func (m *QueryNftListingResponse) String() string { return proto.CompactTextString(m) } -func (*QueryNftListingResponse) ProtoMessage() {} -func (*QueryNftListingResponse) Descriptor() ([]byte, []int) { +func (m *QueryListedNftResponse) Reset() { *m = QueryListedNftResponse{} } +func (m *QueryListedNftResponse) String() string { return proto.CompactTextString(m) } +func (*QueryListedNftResponse) ProtoMessage() {} +func (*QueryListedNftResponse) Descriptor() ([]byte, []int) { return fileDescriptor_7db9d9524c1d8ab8, []int{3} } -func (m *QueryNftListingResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryListedNftResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryNftListingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryListedNftResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryNftListingResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryListedNftResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -190,19 +190,19 @@ func (m *QueryNftListingResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryNftListingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNftListingResponse.Merge(m, src) +func (m *QueryListedNftResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListedNftResponse.Merge(m, src) } -func (m *QueryNftListingResponse) XXX_Size() int { +func (m *QueryListedNftResponse) XXX_Size() int { return m.Size() } -func (m *QueryNftListingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNftListingResponse.DiscardUnknown(m) +func (m *QueryListedNftResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListedNftResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryNftListingResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryListedNftResponse proto.InternalMessageInfo -func (m *QueryNftListingResponse) GetListing() Listing { +func (m *QueryListedNftResponse) GetListing() Listing { if m != nil { return m.Listing } @@ -349,23 +349,23 @@ func (m *QueryListedClassRequest) GetNftLimit() int32 { return 0 } -type NftListingDetail struct { +type ListedNftDetail struct { Listing Listing `protobuf:"bytes,1,opt,name=listing,proto3" json:"listing"` NftInfo NftInfo `protobuf:"bytes,2,opt,name=nft_info,json=nftInfo,proto3" json:"nft_info"` } -func (m *NftListingDetail) Reset() { *m = NftListingDetail{} } -func (m *NftListingDetail) String() string { return proto.CompactTextString(m) } -func (*NftListingDetail) ProtoMessage() {} -func (*NftListingDetail) Descriptor() ([]byte, []int) { +func (m *ListedNftDetail) Reset() { *m = ListedNftDetail{} } +func (m *ListedNftDetail) String() string { return proto.CompactTextString(m) } +func (*ListedNftDetail) ProtoMessage() {} +func (*ListedNftDetail) Descriptor() ([]byte, []int) { return fileDescriptor_7db9d9524c1d8ab8, []int{7} } -func (m *NftListingDetail) XXX_Unmarshal(b []byte) error { +func (m *ListedNftDetail) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *NftListingDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ListedNftDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_NftListingDetail.Marshal(b, m, deterministic) + return xxx_messageInfo_ListedNftDetail.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -375,26 +375,26 @@ func (m *NftListingDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *NftListingDetail) XXX_Merge(src proto.Message) { - xxx_messageInfo_NftListingDetail.Merge(m, src) +func (m *ListedNftDetail) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListedNftDetail.Merge(m, src) } -func (m *NftListingDetail) XXX_Size() int { +func (m *ListedNftDetail) XXX_Size() int { return m.Size() } -func (m *NftListingDetail) XXX_DiscardUnknown() { - xxx_messageInfo_NftListingDetail.DiscardUnknown(m) +func (m *ListedNftDetail) XXX_DiscardUnknown() { + xxx_messageInfo_ListedNftDetail.DiscardUnknown(m) } -var xxx_messageInfo_NftListingDetail proto.InternalMessageInfo +var xxx_messageInfo_ListedNftDetail proto.InternalMessageInfo -func (m *NftListingDetail) GetListing() Listing { +func (m *ListedNftDetail) GetListing() Listing { if m != nil { return m.Listing } return Listing{} } -func (m *NftListingDetail) GetNftInfo() NftInfo { +func (m *ListedNftDetail) GetNftInfo() NftInfo { if m != nil { return m.NftInfo } @@ -402,7 +402,7 @@ func (m *NftListingDetail) GetNftInfo() NftInfo { } type QueryListedNftsResponse struct { - Listings []NftListingDetail `protobuf:"bytes,1,rep,name=listings,proto3" json:"listings"` + Listings []ListedNftDetail `protobuf:"bytes,1,rep,name=listings,proto3" json:"listings"` } func (m *QueryListedNftsResponse) Reset() { *m = QueryListedNftsResponse{} } @@ -438,7 +438,7 @@ func (m *QueryListedNftsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryListedNftsResponse proto.InternalMessageInfo -func (m *QueryListedNftsResponse) GetListings() []NftListingDetail { +func (m *QueryListedNftsResponse) GetListings() []ListedNftDetail { if m != nil { return m.Listings } @@ -591,7 +591,7 @@ func (m *QueryListedClassResponse) GetNftCount() uint64 { type QueryLoanRequest struct { ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - NftId string `protobuf:"bytes,2,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty"` + TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` } func (m *QueryLoanRequest) Reset() { *m = QueryLoanRequest{} } @@ -634,9 +634,9 @@ func (m *QueryLoanRequest) GetClassId() string { return "" } -func (m *QueryLoanRequest) GetNftId() string { +func (m *QueryLoanRequest) GetTokenId() string { if m != nil { - return m.NftId + return m.TokenId } return "" } @@ -711,7 +711,7 @@ func (m *QueryLoanResponse) GetTotalDeposit() types.Coin { type QueryNftBidsRequest struct { ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - NftId string `protobuf:"bytes,2,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty"` + TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` } func (m *QueryNftBidsRequest) Reset() { *m = QueryNftBidsRequest{} } @@ -754,9 +754,9 @@ func (m *QueryNftBidsRequest) GetClassId() string { return "" } -func (m *QueryNftBidsRequest) GetNftId() string { +func (m *QueryNftBidsRequest) GetTokenId() string { if m != nil { - return m.NftId + return m.TokenId } return "" } @@ -983,7 +983,7 @@ func (m *QueryRewardsResponse) GetRewards() []types.Coin { type QueryLiquidationRequest struct { ClassId string `protobuf:"bytes,1,opt,name=class_id,json=classId,proto3" json:"class_id,omitempty"` - NftId string `protobuf:"bytes,2,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty"` + TokenId string `protobuf:"bytes,2,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` } func (m *QueryLiquidationRequest) Reset() { *m = QueryLiquidationRequest{} } @@ -1026,9 +1026,9 @@ func (m *QueryLiquidationRequest) GetClassId() string { return "" } -func (m *QueryLiquidationRequest) GetNftId() string { +func (m *QueryLiquidationRequest) GetTokenId() string { if m != nil { - return m.NftId + return m.TokenId } return "" } @@ -1080,12 +1080,12 @@ func (m *QueryLiquidationResponse) GetLiquidations() *Liquidations { func init() { proto.RegisterType((*QueryParamsRequest)(nil), "ununifi.nftbackedloan.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "ununifi.nftbackedloan.QueryParamsResponse") - proto.RegisterType((*QueryNftListingRequest)(nil), "ununifi.nftbackedloan.QueryNftListingRequest") - proto.RegisterType((*QueryNftListingResponse)(nil), "ununifi.nftbackedloan.QueryNftListingResponse") + proto.RegisterType((*QueryListedNftRequest)(nil), "ununifi.nftbackedloan.QueryListedNftRequest") + proto.RegisterType((*QueryListedNftResponse)(nil), "ununifi.nftbackedloan.QueryListedNftResponse") proto.RegisterType((*QueryListedNftsRequest)(nil), "ununifi.nftbackedloan.QueryListedNftsRequest") proto.RegisterType((*QueryListedClassesRequest)(nil), "ununifi.nftbackedloan.QueryListedClassesRequest") proto.RegisterType((*QueryListedClassRequest)(nil), "ununifi.nftbackedloan.QueryListedClassRequest") - proto.RegisterType((*NftListingDetail)(nil), "ununifi.nftbackedloan.NftListingDetail") + proto.RegisterType((*ListedNftDetail)(nil), "ununifi.nftbackedloan.ListedNftDetail") proto.RegisterType((*QueryListedNftsResponse)(nil), "ununifi.nftbackedloan.QueryListedNftsResponse") proto.RegisterType((*QueryListedClassesResponse)(nil), "ununifi.nftbackedloan.QueryListedClassesResponse") proto.RegisterType((*QueryListedClassResponse)(nil), "ununifi.nftbackedloan.QueryListedClassResponse") @@ -1104,88 +1104,87 @@ func init() { func init() { proto.RegisterFile("ununifi/nftbackedloan/query.proto", fileDescriptor_7db9d9524c1d8ab8) } var fileDescriptor_7db9d9524c1d8ab8 = []byte{ - // 1294 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xcf, 0x26, 0x8e, 0x9d, 0x4e, 0xd2, 0xef, 0x37, 0x0c, 0x69, 0x71, 0x4c, 0xeb, 0x84, 0x81, - 0x2a, 0x69, 0x2a, 0xef, 0xe6, 0x07, 0xa0, 0xd0, 0xa2, 0xa2, 0x38, 0x11, 0x34, 0xa5, 0x04, 0x62, - 0xd4, 0x43, 0x11, 0x52, 0x34, 0xf6, 0xee, 0x3a, 0x23, 0xec, 0x19, 0x67, 0x77, 0xdc, 0x10, 0x45, - 0x91, 0x10, 0x07, 0xce, 0x48, 0x41, 0xe2, 0x08, 0x12, 0x37, 0x90, 0x38, 0x20, 0xfe, 0x88, 0x1e, - 0x2b, 0x90, 0x10, 0xa7, 0x08, 0x25, 0xfc, 0x05, 0xfd, 0x0b, 0xd0, 0xce, 0xbc, 0x5d, 0xdb, 0xb1, - 0x77, 0xed, 0xa6, 0xb7, 0x9d, 0x99, 0xf7, 0xe3, 0x33, 0xef, 0xcd, 0x7b, 0x9f, 0xb7, 0xe8, 0xb5, - 0x26, 0x6f, 0x72, 0xe6, 0x32, 0x8b, 0xbb, 0xb2, 0x4c, 0x2b, 0x5f, 0x38, 0x76, 0x4d, 0x50, 0x6e, - 0xed, 0x35, 0x1d, 0xef, 0xc0, 0x6c, 0x78, 0x42, 0x0a, 0x7c, 0x05, 0x44, 0xcc, 0x0e, 0x91, 0xdc, - 0x54, 0x55, 0x54, 0x85, 0x92, 0xb0, 0x82, 0x2f, 0x2d, 0x9c, 0xbb, 0x56, 0x15, 0xa2, 0x5a, 0x73, - 0x2c, 0xda, 0x60, 0x16, 0xe5, 0x5c, 0x48, 0x2a, 0x99, 0xe0, 0x3e, 0x9c, 0xce, 0xc0, 0xa9, 0x5a, - 0x95, 0x9b, 0xae, 0x25, 0x59, 0xdd, 0xf1, 0x25, 0x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xff, 0xcc, 0x2b, - 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x0c, 0x4d, 0x55, 0x81, 0x7a, 0x10, 0x00, 0x00, + // 1267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x26, 0x8e, 0x9d, 0xbc, 0x24, 0x34, 0x0c, 0x69, 0x71, 0xdc, 0xc4, 0x09, 0xdb, 0x34, + 0x75, 0xd3, 0x7a, 0xb7, 0x49, 0x39, 0xf0, 0x21, 0x81, 0xe2, 0x44, 0x28, 0x81, 0x34, 0x10, 0xa3, + 0x4a, 0x80, 0x90, 0xac, 0xb1, 0x77, 0xed, 0x8c, 0x6a, 0xcf, 0x38, 0x3b, 0xe3, 0x86, 0xa8, 0xaa, + 0x40, 0x1c, 0xe0, 0x8a, 0x00, 0x89, 0x8f, 0x2b, 0x37, 0xce, 0xfc, 0x11, 0x3d, 0x56, 0x70, 0xe1, + 0x14, 0xa1, 0x84, 0x23, 0xa7, 0xfe, 0x05, 0x68, 0x67, 0x66, 0xd7, 0x1f, 0x89, 0xd7, 0xdb, 0xe6, + 0xe4, 0x9d, 0x99, 0xf7, 0x7e, 0xef, 0x37, 0x6f, 0xde, 0xfc, 0xde, 0x18, 0x5e, 0x6b, 0xd1, 0x16, + 0x25, 0x55, 0x62, 0xd3, 0xaa, 0x28, 0xe3, 0xca, 0x03, 0xd7, 0xa9, 0x33, 0x4c, 0xed, 0x83, 0x96, + 0xeb, 0x1d, 0x59, 0x4d, 0x8f, 0x09, 0x86, 0x2e, 0x6b, 0x13, 0xab, 0xcb, 0x24, 0x33, 0x53, 0x63, + 0x35, 0x26, 0x2d, 0x6c, 0xff, 0x4b, 0x19, 0x67, 0xe6, 0x6a, 0x8c, 0xd5, 0xea, 0xae, 0x8d, 0x9b, + 0xc4, 0xc6, 0x94, 0x32, 0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0x00, 0xff, 0xff, 0xd4, 0xac, 0x03, 0x1c, 0x1c, + 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1201,8 +1200,8 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - NftListing(ctx context.Context, in *QueryNftListingRequest, opts ...grpc.CallOption) (*QueryNftListingResponse, error) ListedNfts(ctx context.Context, in *QueryListedNftsRequest, opts ...grpc.CallOption) (*QueryListedNftsResponse, error) + ListedNft(ctx context.Context, in *QueryListedNftRequest, opts ...grpc.CallOption) (*QueryListedNftResponse, error) ListedClasses(ctx context.Context, in *QueryListedClassesRequest, opts ...grpc.CallOption) (*QueryListedClassesResponse, error) ListedClass(ctx context.Context, in *QueryListedClassRequest, opts ...grpc.CallOption) (*QueryListedClassResponse, error) Loan(ctx context.Context, in *QueryLoanRequest, opts ...grpc.CallOption) (*QueryLoanResponse, error) @@ -1229,18 +1228,18 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . return out, nil } -func (c *queryClient) NftListing(ctx context.Context, in *QueryNftListingRequest, opts ...grpc.CallOption) (*QueryNftListingResponse, error) { - out := new(QueryNftListingResponse) - err := c.cc.Invoke(ctx, "/ununifi.nftbackedloan.Query/NftListing", in, out, opts...) +func (c *queryClient) ListedNfts(ctx context.Context, in *QueryListedNftsRequest, opts ...grpc.CallOption) (*QueryListedNftsResponse, error) { + out := new(QueryListedNftsResponse) + err := c.cc.Invoke(ctx, "/ununifi.nftbackedloan.Query/ListedNfts", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) ListedNfts(ctx context.Context, in *QueryListedNftsRequest, opts ...grpc.CallOption) (*QueryListedNftsResponse, error) { - out := new(QueryListedNftsResponse) - err := c.cc.Invoke(ctx, "/ununifi.nftbackedloan.Query/ListedNfts", in, out, opts...) +func (c *queryClient) ListedNft(ctx context.Context, in *QueryListedNftRequest, opts ...grpc.CallOption) (*QueryListedNftResponse, error) { + out := new(QueryListedNftResponse) + err := c.cc.Invoke(ctx, "/ununifi.nftbackedloan.Query/ListedNft", in, out, opts...) if err != nil { return nil, err } @@ -1313,8 +1312,8 @@ func (c *queryClient) Liquidation(ctx context.Context, in *QueryLiquidationReque // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - NftListing(context.Context, *QueryNftListingRequest) (*QueryNftListingResponse, error) ListedNfts(context.Context, *QueryListedNftsRequest) (*QueryListedNftsResponse, error) + ListedNft(context.Context, *QueryListedNftRequest) (*QueryListedNftResponse, error) ListedClasses(context.Context, *QueryListedClassesRequest) (*QueryListedClassesResponse, error) ListedClass(context.Context, *QueryListedClassRequest) (*QueryListedClassResponse, error) Loan(context.Context, *QueryLoanRequest) (*QueryLoanResponse, error) @@ -1331,12 +1330,12 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } -func (*UnimplementedQueryServer) NftListing(ctx context.Context, req *QueryNftListingRequest) (*QueryNftListingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NftListing not implemented") -} func (*UnimplementedQueryServer) ListedNfts(ctx context.Context, req *QueryListedNftsRequest) (*QueryListedNftsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListedNfts not implemented") } +func (*UnimplementedQueryServer) ListedNft(ctx context.Context, req *QueryListedNftRequest) (*QueryListedNftResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListedNft not implemented") +} func (*UnimplementedQueryServer) ListedClasses(ctx context.Context, req *QueryListedClassesRequest) (*QueryListedClassesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListedClasses not implemented") } @@ -1381,38 +1380,38 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf return interceptor(ctx, in, info, handler) } -func _Query_NftListing_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryNftListingRequest) +func _Query_ListedNfts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryListedNftsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).NftListing(ctx, in) + return srv.(QueryServer).ListedNfts(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ununifi.nftbackedloan.Query/NftListing", + FullMethod: "/ununifi.nftbackedloan.Query/ListedNfts", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).NftListing(ctx, req.(*QueryNftListingRequest)) + return srv.(QueryServer).ListedNfts(ctx, req.(*QueryListedNftsRequest)) } return interceptor(ctx, in, info, handler) } -func _Query_ListedNfts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryListedNftsRequest) +func _Query_ListedNft_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryListedNftRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ListedNfts(ctx, in) + return srv.(QueryServer).ListedNft(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ununifi.nftbackedloan.Query/ListedNfts", + FullMethod: "/ununifi.nftbackedloan.Query/ListedNft", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ListedNfts(ctx, req.(*QueryListedNftsRequest)) + return srv.(QueryServer).ListedNft(ctx, req.(*QueryListedNftRequest)) } return interceptor(ctx, in, info, handler) } @@ -1551,14 +1550,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Params", Handler: _Query_Params_Handler, }, - { - MethodName: "NftListing", - Handler: _Query_NftListing_Handler, - }, { MethodName: "ListedNfts", Handler: _Query_ListedNfts_Handler, }, + { + MethodName: "ListedNft", + Handler: _Query_ListedNft_Handler, + }, { MethodName: "ListedClasses", Handler: _Query_ListedClasses_Handler, @@ -1648,7 +1647,7 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryNftListingRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryListedNftRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1658,20 +1657,20 @@ func (m *QueryNftListingRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryNftListingRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryListedNftRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryNftListingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryListedNftRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.NftId) > 0 { - i -= len(m.NftId) - copy(dAtA[i:], m.NftId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.NftId))) + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenId))) i-- dAtA[i] = 0x12 } @@ -1685,7 +1684,7 @@ func (m *QueryNftListingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryNftListingResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryListedNftResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1695,12 +1694,12 @@ func (m *QueryNftListingResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryNftListingResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryListedNftResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryNftListingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryListedNftResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1811,7 +1810,7 @@ func (m *QueryListedClassRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *NftListingDetail) Marshal() (dAtA []byte, err error) { +func (m *ListedNftDetail) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1821,12 +1820,12 @@ func (m *NftListingDetail) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *NftListingDetail) MarshalTo(dAtA []byte) (int, error) { +func (m *ListedNftDetail) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *NftListingDetail) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ListedNftDetail) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2032,10 +2031,10 @@ func (m *QueryLoanRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NftId) > 0 { - i -= len(m.NftId) - copy(dAtA[i:], m.NftId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.NftId))) + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenId))) i-- dAtA[i] = 0x12 } @@ -2132,10 +2131,10 @@ func (m *QueryNftBidsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.NftId) > 0 { - i -= len(m.NftId) - copy(dAtA[i:], m.NftId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.NftId))) + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenId))) i-- dAtA[i] = 0x12 } @@ -2338,10 +2337,10 @@ func (m *QueryLiquidationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - if len(m.NftId) > 0 { - i -= len(m.NftId) - copy(dAtA[i:], m.NftId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.NftId))) + if len(m.TokenId) > 0 { + i -= len(m.TokenId) + copy(dAtA[i:], m.TokenId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenId))) i-- dAtA[i] = 0x12 } @@ -2421,7 +2420,7 @@ func (m *QueryParamsResponse) Size() (n int) { return n } -func (m *QueryNftListingRequest) Size() (n int) { +func (m *QueryListedNftRequest) Size() (n int) { if m == nil { return 0 } @@ -2431,14 +2430,14 @@ func (m *QueryNftListingRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.NftId) + l = len(m.TokenId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryNftListingResponse) Size() (n int) { +func (m *QueryListedNftResponse) Size() (n int) { if m == nil { return 0 } @@ -2490,7 +2489,7 @@ func (m *QueryListedClassRequest) Size() (n int) { return n } -func (m *NftListingDetail) Size() (n int) { +func (m *ListedNftDetail) Size() (n int) { if m == nil { return 0 } @@ -2585,7 +2584,7 @@ func (m *QueryLoanRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.NftId) + l = len(m.TokenId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -2619,7 +2618,7 @@ func (m *QueryNftBidsRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.NftId) + l = len(m.TokenId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -2706,7 +2705,7 @@ func (m *QueryLiquidationRequest) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } - l = len(m.NftId) + l = len(m.TokenId) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } @@ -2865,7 +2864,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryNftListingRequest) Unmarshal(dAtA []byte) error { +func (m *QueryListedNftRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2888,10 +2887,10 @@ func (m *QueryNftListingRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryNftListingRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryListedNftRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNftListingRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryListedNftRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2928,7 +2927,7 @@ func (m *QueryNftListingRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NftId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2956,7 +2955,7 @@ func (m *QueryNftListingRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NftId = string(dAtA[iNdEx:postIndex]) + m.TokenId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -2979,7 +2978,7 @@ func (m *QueryNftListingRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryNftListingResponse) Unmarshal(dAtA []byte) error { +func (m *QueryListedNftResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3002,10 +3001,10 @@ func (m *QueryNftListingResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryNftListingResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryListedNftResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNftListingResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryListedNftResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3314,7 +3313,7 @@ func (m *QueryListedClassRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *NftListingDetail) Unmarshal(dAtA []byte) error { +func (m *ListedNftDetail) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3337,10 +3336,10 @@ func (m *NftListingDetail) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: NftListingDetail: wiretype end group for non-group") + return fmt.Errorf("proto: ListedNftDetail: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: NftListingDetail: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ListedNftDetail: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3488,7 +3487,7 @@ func (m *QueryListedNftsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Listings = append(m.Listings, NftListingDetail{}) + m.Listings = append(m.Listings, ListedNftDetail{}) if err := m.Listings[len(m.Listings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3956,7 +3955,7 @@ func (m *QueryLoanRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NftId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3984,7 +3983,7 @@ func (m *QueryLoanRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NftId = string(dAtA[iNdEx:postIndex]) + m.TokenId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4252,7 +4251,7 @@ func (m *QueryNftBidsRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NftId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4280,7 +4279,7 @@ func (m *QueryNftBidsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NftId = string(dAtA[iNdEx:postIndex]) + m.TokenId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4769,7 +4768,7 @@ func (m *QueryLiquidationRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NftId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenId", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4797,7 +4796,7 @@ func (m *QueryLiquidationRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.NftId = string(dAtA[iNdEx:postIndex]) + m.TokenId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/nftbackedloan/types/query.pb.gw.go b/x/nftbackedloan/types/query.pb.gw.go index 771b3db1c..e3d88e8ac 100644 --- a/x/nftbackedloan/types/query.pb.gw.go +++ b/x/nftbackedloan/types/query.pb.gw.go @@ -51,114 +51,74 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal } -func request_Query_NftListing_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNftListingRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) +var ( + filter_Query_ListedNfts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } +func request_Query_ListedNfts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListedNftsRequest + var metadata runtime.ServerMetadata - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedNfts_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.NftListing(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListedNfts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_NftListing_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNftListingRequest +func local_request_Query_ListedNfts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListedNftsRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedNfts_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.NftListing(ctx, &protoReq) + msg, err := server.ListedNfts(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_ListedNfts_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_ListedNft_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_ListedNfts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryListedNftsRequest +func request_Query_ListedNft_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListedNftRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedNfts_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedNft_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ListedNfts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ListedNft(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_ListedNfts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryListedNftsRequest +func local_request_Query_ListedNft_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListedNftRequest var metadata runtime.ServerMetadata if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedNfts_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedNft_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ListedNfts(ctx, &protoReq) + msg, err := server.ListedNft(ctx, &protoReq) return msg, metadata, err } @@ -199,37 +159,19 @@ func local_request_Query_ListedClasses_0(ctx context.Context, marshaler runtime. } +var ( + filter_Query_ListedClass_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_ListedClass_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryListedClassRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_limit"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_limit") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftLimit, err = runtime.Int32(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_limit", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedClass_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.ListedClass(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -241,33 +183,11 @@ func local_request_Query_ListedClass_0(ctx context.Context, marshaler runtime.Ma var protoReq QueryListedClassRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_limit"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_limit") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftLimit, err = runtime.Int32(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_limit", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ListedClass_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.ListedClass(ctx, &protoReq) @@ -275,37 +195,19 @@ func local_request_Query_ListedClass_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_Query_Loan_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_Loan_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryLoanRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Loan_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Loan(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -317,33 +219,11 @@ func local_request_Query_Loan_0(ctx context.Context, marshaler runtime.Marshaler var protoReq QueryLoanRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Loan_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.Loan(ctx, &protoReq) @@ -351,37 +231,19 @@ func local_request_Query_Loan_0(ctx context.Context, marshaler runtime.Marshaler } +var ( + filter_Query_NftBids_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_NftBids_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryNftBidsRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_NftBids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.NftBids(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -393,33 +255,11 @@ func local_request_Query_NftBids_0(ctx context.Context, marshaler runtime.Marsha var protoReq QueryNftBidsRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_NftBids_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.NftBids(ctx, &protoReq) @@ -535,37 +375,19 @@ func local_request_Query_Rewards_0(ctx context.Context, marshaler runtime.Marsha } +var ( + filter_Query_Liquidation_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + func request_Query_Liquidation_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryLiquidationRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Liquidation_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Liquidation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -577,33 +399,11 @@ func local_request_Query_Liquidation_0(ctx context.Context, marshaler runtime.Ma var protoReq QueryLiquidationRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["class_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "class_id") - } - - protoReq.ClassId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "class_id", err) - } - - val, ok = pathParams["nft_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "nft_id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.NftId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "nft_id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Liquidation_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.Liquidation(ctx, &protoReq) @@ -640,7 +440,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_NftListing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListedNfts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -651,7 +451,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_NftListing_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListedNfts_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -659,11 +459,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_NftListing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListedNfts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_ListedNfts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListedNft_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -674,7 +474,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ListedNfts_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ListedNft_0(rctx, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { @@ -682,7 +482,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } - forward_Query_ListedNfts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListedNft_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -908,7 +708,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_NftListing_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListedNfts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -917,18 +717,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_NftListing_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListedNfts_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_NftListing_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListedNfts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_ListedNfts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ListedNft_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -937,14 +737,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_ListedNfts_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ListedNft_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_ListedNfts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ListedNft_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1094,32 +894,32 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "nftbackedloan", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NftListing_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "nftbackedloan", "nft-listing", "class_id", "nft_id"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ListedNfts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "nftbackedloan", "listed-nfts"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListedNft_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ununifi", "nftbackedloan", "listed-nfts", "nft"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListedClasses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "nftbackedloan", "listed-classes"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ListedClass_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "nftbackedloan", "listed-class", "class_id", "nft_limit"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListedClass_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ununifi", "nftbackedloan", "listed-classes", "class"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Loan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "nftbackedloan", "loans", "class_id", "nft_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Loan_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "nftbackedloan", "loans"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NftBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "nftbackedloan", "nft-bids", "class_id", "nft_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_NftBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "nftbackedloan", "bids"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_BidderBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "nftbackedloan", "bidder-bids", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_BidderBids_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "nftbackedloan", "bids", "bidder"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Rewards_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"ununifi", "nftbackedloan", "rewards", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_Liquidation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"ununifi", "nftbackedloan", "liquidation", "class_id", "nft_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Liquidation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"ununifi", "nftbackedloan", "liquidation"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_NftListing_0 = runtime.ForwardResponseMessage - forward_Query_ListedNfts_0 = runtime.ForwardResponseMessage + forward_Query_ListedNft_0 = runtime.ForwardResponseMessage + forward_Query_ListedClasses_0 = runtime.ForwardResponseMessage forward_Query_ListedClass_0 = runtime.ForwardResponseMessage diff --git a/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go b/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go index e8bcd8b4b..ba0c491d2 100644 --- a/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go +++ b/x/yieldaggregator/keeper/grpc_query_estimate_redeem_amount.go @@ -54,11 +54,12 @@ func (k Keeper) EstimateRedeemAmount(c context.Context, req *types.QueryEstimate withdrawModuleCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(params.CommissionRate).RoundInt() withdrawVaultCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(vault.WithdrawCommissionRate).RoundInt() withdrawAmountWithoutCommission := withdrawAmount.Sub(withdrawModuleCommissionFee).Sub(withdrawVaultCommissionFee) - fee := withdrawModuleCommissionFee.Add(withdrawVaultCommissionFee) + fee := withdrawFee.Add(withdrawModuleCommissionFee).Add(withdrawVaultCommissionFee) return &types.QueryEstimateRedeemAmountResponse{ ShareAmount: sdk.NewCoin(types.GetLPTokenDenom(vault.Id), burnAmount), Fee: sdk.NewCoin(principal.Denom, fee), RedeemAmount: sdk.NewCoin(principal.Denom, withdrawAmountWithoutCommission), + TotalAmount: principal, }, nil } diff --git a/x/yieldaggregator/types/query.pb.go b/x/yieldaggregator/types/query.pb.go index 8c8bbf719..d8623152a 100644 --- a/x/yieldaggregator/types/query.pb.go +++ b/x/yieldaggregator/types/query.pb.go @@ -845,6 +845,7 @@ type QueryEstimateRedeemAmountResponse struct { ShareAmount types.Coin `protobuf:"bytes,1,opt,name=share_amount,json=shareAmount,proto3" json:"share_amount"` Fee types.Coin `protobuf:"bytes,2,opt,name=fee,proto3" json:"fee"` RedeemAmount types.Coin `protobuf:"bytes,3,opt,name=redeem_amount,json=redeemAmount,proto3" json:"redeem_amount"` + TotalAmount types.Coin `protobuf:"bytes,4,opt,name=total_amount,json=totalAmount,proto3" json:"total_amount"` } func (m *QueryEstimateRedeemAmountResponse) Reset() { *m = QueryEstimateRedeemAmountResponse{} } @@ -901,6 +902,13 @@ func (m *QueryEstimateRedeemAmountResponse) GetRedeemAmount() types.Coin { return types.Coin{} } +func (m *QueryEstimateRedeemAmountResponse) GetTotalAmount() types.Coin { + if m != nil { + return m.TotalAmount + } + return types.Coin{} +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "ununifi.yieldaggregator.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "ununifi.yieldaggregator.QueryParamsResponse") @@ -927,85 +935,85 @@ func init() { } var fileDescriptor_4dec8609c4c8573d = []byte{ - // 1233 bytes of a gzipped FileDescriptorProto + // 1247 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4f, 0x6f, 0x1b, 0x45, 0x14, 0xcf, 0x3a, 0x7f, 0xd4, 0x3e, 0xb7, 0xa5, 0x9d, 0x3a, 0x34, 0x35, 0xc8, 0x4e, 0xb6, 0x6d, 0x12, 0x25, 0xb5, 0x37, 0x09, 0x07, 0x68, 0x42, 0x81, 0x38, 0x69, 0x42, 0x51, 0x91, 0x82, 0x43, - 0x8a, 0x44, 0x05, 0xd6, 0xd8, 0x3b, 0x59, 0x8f, 0xea, 0x9d, 0x71, 0x77, 0xc7, 0x09, 0x56, 0xd5, - 0x0b, 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x3d, 0xff, 0x44, 0xa3, 0xa6, 0xba, 0x12, 0x96, 0x7e, 0x9a, 0xaf, 0x72, 0x41, 0x0f, 0xe0, 0xb2, + 0xe0, 0x02, 0x57, 0x0a, 0x45, 0xce, 0x6c, 0x62, 0x17, 0x70, 0x95, 0xd7, 0x99, 0x98, 0x88, 0x4d, + 0x1a, 0xb3, 0x67, 0x73, 0xf3, 0xbe, 0xe5, 0xdf, 0x2f, 0xd3, 0xe3, 0x8a, 0xa6, 0x67, 0x3f, 0xcc, + 0x52, 0x6e, 0x55, 0xb1, 0x28, 0x67, 0xef, 0x32, 0xf1, 0xe2, 0x69, 0x06, 0x34, 0xff, 0xbb, 0x4c, + 0xe4, 0x2f, 0x49, 0x9c, 0x9c, 0x84, 0x59, 0x95, 0x28, 0x08, 0xc3, 0xeb, 0x0a, 0xbc, 0xce, 0x7c, + 0x78, 0xca, 0x9c, 0x00, 0x7f, 0x78, 0x70, 0xfc, 0x84, 0x84, 0xda, 0x09, 0x90, 0x74, 0x88, 0xfb, + 0x70, 0x71, 0x9f, 0x8a, 0xb2, 0xed, 0xe2, 0xfd, 0x82, 0x4b, 0x3c, 0xe2, 0xee, 0x91, 0x89, 0x91, + 0xc1, 0xc1, 0x5f, 0x0b, 0x40, 0xf2, 0x0a, 0xc3, 0xfc, 0xd5, 0x80, 0xf1, 0xb6, 0x3a, 0x6a, 0x7d, + 0xdc, 0x81, 0x31, 0x99, 0x3a, 0x5f, 0x1f, 0xc3, 0xb3, 0xf1, 0xa5, 0x99, 0xde, 0xe9, 0x6e, 0x96, + 0x29, 0xd0, 0x89, 0x72, 0x46, 0x9b, 0x21, 0x3d, 0xc4, 0x64, 0xe5, 0x66, 0xfa, 0xea, 0x41, 0x71, + 0x08, 0x09, 0x62, 0x03, 0xa6, 0x42, 0x44, 0x73, 0x8d, 0xed, 0x32, 0x76, 0xc9, 0x87, 0xbc, 0x62, + 0x13, 0x37, 0x50, 0xdf, 0x14, 0x9c, 0xf3, 0xfc, 0x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71, 0x5e, 0x52, 0xbc, 0x81, + 0xae, 0x75, 0xa5, 0xd8, 0x32, 0xe9, 0x7f, 0x36, 0xe0, 0x4c, 0x80, 0xd0, 0x8f, 0x5e, 0xe7, 0x10, + 0xef, 0x47, 0xef, 0x98, 0xc9, 0x61, 0x2e, 0x48, 0x7a, 0x73, 0x68, 0x36, 0x02, 0x3d, 0x95, 0xc5, + 0xdf, 0x0d, 0x40, 0x9d, 0x0d, 0x1c, 0xbd, 0xdd, 0x3b, 0x76, 0xd7, 0x59, 0x92, 0x7c, 0x67, 0x70, + 0x47, 0xcd, 0x7d, 0x55, 0x72, 0x5f, 0x41, 0xb7, 0xa2, 0x54, 0xdf, 0x22, 0x1a, 0x28, 0xe3, 0xcf, + 0x8a, 0x8c, 0x6a, 0x72, 0xe8, 0x85, 0x01, 0x89, 0xe3, 0x5a, 0x3a, 0xba, 0x15, 0x8d, 0xd5, 0x31, + 0xc3, 0x25, 0xb9, 0x7c, 0x12, 0x57, 0x7d, 0xa5, 0x35, 0x79, 0xa5, 0xdb, 0x68, 0x65, 0xb0, 0x2b, + 0xa9, 0x46, 0xae, 0x2f, 0x95, 0xfb, 0xe8, 0xd9, 0x41, 0xca, 0x78, 0x7e, 0x90, 0x32, 0xfe, 0x39, + 0x48, 0x19, 0xdf, 0x1d, 0xa6, 0x86, 0x9e, 0x1f, 0xa6, 0x86, 0xfe, 0x3a, 0x4c, 0x0d, 0x7d, 0xbe, + 0xe0, 0x50, 0x51, 0xae, 0x17, 0xb3, 0x25, 0x5e, 0xb5, 0x76, 0xd8, 0x0e, 0xa3, 0x1b, 0xd4, 0x2a, + 0x95, 0x31, 0x65, 0xd6, 0x57, 0x1d, 0x81, 0x44, 0xa3, 0x46, 0xbc, 0xe2, 0x98, 0xfc, 0xdf, 0xc6, + 0x5b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x8a, 0x58, 0xfc, 0x0b, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2064,6 +2072,16 @@ func (m *QueryEstimateRedeemAmountResponse) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l + { + size, err := m.TotalAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 { size, err := m.RedeemAmount.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -2375,6 +2393,8 @@ func (m *QueryEstimateRedeemAmountResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) l = m.RedeemAmount.Size() n += 1 + l + sovQuery(uint64(l)) + l = m.TotalAmount.Size() + n += 1 + l + sovQuery(uint64(l)) return n } @@ -4382,6 +4402,39 @@ func (m *QueryEstimateRedeemAmountResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:])