Skip to content

Commit

Permalink
Adding Stoic and Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
skilesare committed Jan 31, 2023
1 parent 29c2ac2 commit 6bf8589
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
8 changes: 8 additions & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ Token-id - Each token in your collection has a unique text-based namespace id.

Library-id - Each library item in your token's asset library has a unique text-based namespace id.

v0.1.2-2

* Adds gateway principal to the storage_info_nft_origyn query
* EXT - Adds compatibility for stoic wallet. query getEXTTokenIdentifier(token_id) to get the identifier necessary to add an NFT to a wallet.

v0.1.2-1

* Fixes a bug where two buyers within a few blocks(while token send in flight) could give both set of tokens to the seller. The first to be processed now locks the NFT until the transaction success or fails.
* Also adds royalty_originator_override = "com.origyn.originator.override" that allows a minter to override the collection level originator when minting an nft.

v0.1.2

Expand Down
20 changes: 12 additions & 8 deletions docs/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ Storage info can be pulled with the code below:
allocated_storage: Nat;
available_space: Nat;
allocations: [AllocationRecordStable];
gateway: Principal;
};
public type AllocationRecordStable = {
Expand Down Expand Up @@ -2000,23 +2001,26 @@ Features:

### HTTP NFT Information

exos.host/_/canister_id/_/token_id - Returns the primary asset
prptl.io/_/canister_id/_/token_id - Returns the primary asset

exos.host/_/canister_id/_/token_id/preview - Returns the preview asset
prptl.io/_/canister_id/_/token_id/preview - Returns the preview asset

exos.host/_/canister_id/_/token_id/ex - Origyn NFTs are self contained internet addressable objects. All the data for rendering is contained inside the NFT (authors can choose to host data on other platforms). Returns an HTML interface that displays the NFT according to the NFT authors specification.
prptl.io/_/canister_id/_/token_id/ex - Origyn NFTs are self contained internet addressable objects. All the data for rendering is contained inside the NFT (authors can choose to host data on other platforms). Returns an HTML interface that displays the NFT according to the NFT authors specification.

exos.host/_/canister_id/_/token_id/_/library_id - Returns the asset in the library
prptl.io/_/canister_id/_/token_id/_/library_id - Returns the asset in the library

exos.host/_/canister_id/_/token_id/_/library_id/info - Returns a json representation of assets in the library
prptl.io/_/canister_id/_/token_id/_/library_id/info - Returns a json representation of assets in the library

exos.host/_/canister_id/_/token_id/info - Returns a json representation of the metadata, including the library items
prptl.io/_/canister_id/_/token_id/info - Returns a json representation of the metadata, including the library items

exos.host/_/canister_id/_/token_id/info?query=[Query] - Returns a json representation of the metadata passed through a query
prptl.io/_/canister_id/_/token_id/info?query=[Query] - Returns a json representation of the metadata passed through a query

### Collection Information

exos.host/_/canister_id/collection - Returns a json representation of collection information
prptl.io/_/canister_id/collection - Returns a json representation of collection information

* http routes - /ledger_info/{page}/{page_size} now returns the ledger json for the collection level
* http routes - /-/token_id/ledger_info/{page}/{page_size} now returns the ledger json for the token level



Expand Down
1 change: 1 addition & 0 deletions src/origyn_nft_reference/main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,7 @@ shared (deployer) actor class Nft_Canister(__initargs : Types.InitArgs) = this {
return #ok({
allocated_storage = state.state.canister_allocated_storage;
available_space = state.state.canister_availible_space;
gateway = state.canister();
allocations = Iter.toArray<Types.AllocationRecordStable>(Iter.map<Types.AllocationRecord,Types.AllocationRecordStable>(Map.vals<(Text,Text),Types.AllocationRecord>(state.state.allocations),Types.allocation_record_stabalize));
});
};
Expand Down
2 changes: 1 addition & 1 deletion src/origyn_nft_reference/metadata.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ module {
state: Types.State,
token_id : Text,
caller : Principal, canister : ?Principal, canister_owner: Principal) : Result.Result<CandyTypes.CandyValue, Types.OrigynError>{
switch(Map.get(state.state.nft_metadata, Map.thash,token_id)){
switch(Map.get(state.state.nft_metadata, Map.thash, token_id)){
case(null){
//nft metadata doesn't exist
return #err(Types.errors(#token_not_found, "get_metadata_for_token - cannot find token id in metadata- " # token_id, ?caller));
Expand Down
1 change: 1 addition & 0 deletions src/origyn_nft_reference/mint.mo
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ module {
};

var found_metadata : CandyTypes.CandyValue = #Empty;

//try to find existing metadata
switch(Map.get(state.state.nft_metadata, Map.thash, id_val)){
case(null){
Expand Down
2 changes: 2 additions & 0 deletions src/origyn_nft_reference/storage_canister.mo
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ shared (deployer) actor class Storage_Canister(__initargs : Types.StorageInitArg
allocated_storage = state_current.canister_allocated_storage;
available_space = state_current.canister_availible_space;
allocations = Iter.toArray<Types.AllocationRecordStable>(Iter.map<Types.AllocationRecord,Types.AllocationRecordStable>(Map.vals<(Text,Text),Types.AllocationRecord>(state_current.allocations),Types.allocation_record_stabalize));
gateway = state_current.collection_data.owner ;
});
};

Expand All @@ -204,6 +205,7 @@ shared (deployer) actor class Storage_Canister(__initargs : Types.StorageInitArg
return #ok({
allocated_storage = state_current.canister_allocated_storage;
available_space = state_current.canister_availible_space;
gateway = state_current.collection_data.owner;
allocations = Iter.toArray<Types.AllocationRecordStable>(Iter.map<Types.AllocationRecord,Types.AllocationRecordStable>(Map.vals<(Text,Text),Types.AllocationRecord>(state_current.allocations),Types.allocation_record_stabalize));
});
};
Expand Down
1 change: 1 addition & 0 deletions src/origyn_nft_reference/types.mo
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ module {
allocated_storage: Nat;
available_space: Nat;
allocations: [AllocationRecordStable];
gateway: Principal;
};

public type BucketData = {
Expand Down
2 changes: 2 additions & 0 deletions src/origyn_storage_reference/storage_canister.mo
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ shared (deployer) actor class Storage_Canister(__initargs : Types.StorageInitArg
return #ok({
allocated_storage = state_current.canister_allocated_storage;
available_space = state_current.canister_availible_space;
gateway = state_current.collection_data.owner ;
allocations = Iter.toArray<Types.AllocationRecordStable>(Iter.map<Types.AllocationRecord,Types.AllocationRecordStable>(Map.vals<(Text,Text),Types.AllocationRecord>(state_current.allocations),Types.allocation_record_stabalize));
});
};
Expand All @@ -202,6 +203,7 @@ shared (deployer) actor class Storage_Canister(__initargs : Types.StorageInitArg
return #ok({
allocated_storage = state_current.canister_allocated_storage;
available_space = state_current.canister_availible_space;
gateway = state_current.collection_data.owner ;
allocations = Iter.toArray<Types.AllocationRecordStable>(Iter.map<Types.AllocationRecord,Types.AllocationRecordStable>(Map.vals<(Text,Text),Types.AllocationRecord>(state_current.allocations),Types.allocation_record_stabalize));
});
};
Expand Down

0 comments on commit 6bf8589

Please sign in to comment.