Struct nft_pixelboard_io::InitNFTPixelboard
source · pub struct InitNFTPixelboard {
pub owner: ActorId,
pub block_side_length: BlockSideLength,
pub pixel_price: u128,
pub resolution: Resolution,
pub commission_percentage: u8,
pub painting: Vec<Color>,
pub ft_program: ActorId,
pub nft_program: ActorId,
}
Expand description
Initializes the NFT pixelboard program.
§Requirements
owner
address mustn’t be [ActorId::zero()
].block_side_length
must be more than 0.pixel_price
mustn’t be more thanMAX_PIXEL_PRICE
.- A width &
height (
resolution
) of a canvas must be more than 0. - Each side of
resolution
must be a multiple ofblock_side_length
. painting
length must equal a pixel count in a canvas (which can be calculated by multiplying a width & height fromresolution
).commission_percentage
mustn’t be more than 100.ft_program
address mustn’t be [ActorId::zero()
].nft_program
address mustn’t be [ActorId::zero()
].
Fields§
§owner: ActorId
An address of a pixelboard owner to which minting fees and commissions on resales will be transferred.
block_side_length: BlockSideLength
A block side length.
To avoid a canvas clogging with one pixel NFTs, blocks are used instead
of pixels to set NFT Rectangle
s. This parameter is used to set a
side length of these pixel blocks. If blocks aren’t needed, then this
parameter can be set to 1, so the block side length will equal a pixel.
pixel_price: u128
The price of a free pixel. It’ll be used to calculate a minting price.
resolution: Resolution
§commission_percentage: u8
A commission percentage that’ll be included in each NFT resale.
painting: Vec<Color>
A painting that’ll be displayed on the free territory of a pixelboard.
ft_program: ActorId
A FT program address.
nft_program: ActorId
An NFT program address.
Trait Implementations§
source§impl Clone for InitNFTPixelboard
impl Clone for InitNFTPixelboard
source§fn clone(&self) -> InitNFTPixelboard
fn clone(&self) -> InitNFTPixelboard
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Decode for InitNFTPixelboard
impl Decode for InitNFTPixelboard
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
Attempt to deserialise the value from input.
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
source§impl Encode for InitNFTPixelboard
impl Encode for InitNFTPixelboard
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
source§impl TypeInfo for InitNFTPixelboard
impl TypeInfo for InitNFTPixelboard
impl EncodeLike for InitNFTPixelboard
Auto Trait Implementations§
impl Freeze for InitNFTPixelboard
impl RefUnwindSafe for InitNFTPixelboard
impl Send for InitNFTPixelboard
impl Sync for InitNFTPixelboard
impl Unpin for InitNFTPixelboard
impl UnwindSafe for InitNFTPixelboard
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Decode
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
§fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>
Return an encoding of
Self
prepended by given slice.