Object Store Gateway Contract Attributes
This library includes helper functions for appending event attributes in a CosmWasm-based
smart contract.
This is to be used in tandem with the event-stream-watching
capabilities of Object Store Gateway.
To generate access grants and revokes via the gateway, include the OsGatewayAttributeGenerator
in your Response declaration with the desired values:
mod some_mod {
use cosmwasm_std::Response;
use os_gateway_contract_attributes::OsGatewayAttributeGenerator;
fn gen_grant_response() -> Response<String> {
Response::new()
.add_attributes(
OsGatewayAttributeGenerator::access_grant(
"scope1qzn7jghj8puprmdcvunm3330jutsj803zz",
"tp12vu3ww5tfta78fl3fvehacunrud4gtqqcpfwnr",
)
.with_access_grant_id("my_unique_id")
)
}
fn gen_revoke_response() -> Response<String> {
Response::new()
.add_attributes(
OsGatewayAttributeGenerator::access_revoke(
"scope1qzn7jghj8puprmdcvunm3330jutsj803zz",
"tp12vu3ww5tfta78fl3fvehacunrud4gtqqcpfwnr",
)
)
}
}