Closed peara closed 1 year ago
@larry0x @shanev @JakeHartnell Could you give some thought?
I'm supportive of adding this query.
Regarding the response type, considering the other query methods have their own response types:
#[cw_serde]
pub struct ApprovalResponse {
pub approval: Approval,
}
#[cw_serde]
pub struct ApprovalsResponse {
pub approvals: Vec<Approval>,
}
#[cw_serde]
pub struct OperatorsResponse {
pub operators: Vec<Approval>,
}
In order to be consistent, I think the Operator
query should also have its own response type:
#[cw_serde]
pub struct OperatorResponse {
pub approval: Approval,
}
Off topic - I think the AllOperators
query should be renamed to Operators
to be consistent with the naming convention of other queries.
Off topic - I think the
AllOperators
query should be renamed toOperators
to be consistent with the naming convention of other queries.
Although, I agree with this, this is a breaking change. There are also AllNftInfo
and AllTokens
which should be considered as well.
Fix #88. I added a new query
Operator(owner, operator, include_expired)
which returns anApprovalResponse
if there exists such valid operator for the given owner. Otherwise, it will return an NotFound error. This query should allow contracts such asMarketplace
orGameManager
check their required permission to manage users' NFTs easily.