-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement setup for token uri component
- Loading branch information
Showing
5 changed files
with
104 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use starknet::ContractAddress; | ||
|
||
|
||
#[starknet::component] | ||
mod TokenURIComponent { | ||
// ************************************************************************* | ||
// IMPORT | ||
// ************************************************************************* | ||
use alexandria_bytes::{Bytes, BytesTrait}; | ||
use alexandria_encoding::sol_abi::{SolBytesTrait, SolAbiEncodeTrait}; | ||
use karst::base::utils::byte_array_extra::FeltTryIntoByteArray; | ||
|
||
// ************************************************************************* | ||
// STORAGE | ||
// ************************************************************************* | ||
#[storage] | ||
struct Storage {} | ||
|
||
|
||
// ************************************************************************* | ||
// EXTERNAL FUNCTIONS | ||
// ************************************************************************* | ||
#[embeddable_as(KarstTokenURI)] | ||
impl TokenUriImpl< | ||
TContractState, +HasComponent<TContractState> | ||
> of ITokenURI<ComponentState<TContractState>> { | ||
fn profile_get_token_uri( | ||
token_id: u256, mint_timestamp: u64, profile: Profile | ||
) -> ByteArray { | ||
"TODO" | ||
} | ||
fn handle_get_token_uri( | ||
token_id: u256, local_name: felt252, namespace: felt252 | ||
) -> ByteArray { | ||
"TODO" | ||
} | ||
|
||
fn follow_get_token_uri( | ||
follow_token_id: u256, followed_profile_address: ContractAddress, follow_timestamp: u64 | ||
) -> ByteArray { | ||
"TODO" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use starknet::ContractAddress; | ||
|
||
// ************************************************************************* | ||
// INTERFACE of TOKEN URI | ||
// ************************************************************************* | ||
#[starknet::interface] | ||
pub trait ITokenURI<TState>{ | ||
fn profile_get_token_uri(token_id: u256, mint_timestamp: u64, profile: Profile) -> ByteArray; | ||
|
||
fn handle_get_token_uri(token_id: u256, local_name: felt252, namespace: felt252) -> ByteArray; | ||
|
||
fn follow_get_token_uri( | ||
follow_token_id: u256, followed_profile_address: ContractAddress, follow_timestamp: u64 | ||
) -> ByteArray | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters