Skip to content

Commit

Permalink
Merge pull request #59 from thesixnetwork/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jonnifer-six authored Oct 26, 2022
2 parents 8cc30e4 + 41c284b commit 0c0cc30
Show file tree
Hide file tree
Showing 30 changed files with 2,304 additions and 2,381 deletions.
2,909 changes: 1,532 additions & 1,377 deletions docs/static/openapi.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions proto/evmsupport/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ option go_package = "github.com/thesixnetwork/sixnft/x/evmsupport/types";
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/sixnft/evmsupport/params";
option (google.api.http).get = "/thesixnetwork/sixnft/evmsupport/params";
}
// Queries a AddressBinding by index.
rpc AddressBinding(QueryGetAddressBindingRequest) returns (QueryGetAddressBindingResponse) {
option (google.api.http).get = "/sixnft/evmsupport/address_binding/{ethAddress}/{nativeAddress}";
option (google.api.http).get = "/thesixnetwork/sixnft/evmsupport/address_binding/{ethAddress}/{nativeAddress}";
}

// Queries a list of AddressBinding items.
rpc AddressBindingAll(QueryAllAddressBindingRequest) returns (QueryAllAddressBindingResponse) {
option (google.api.http).get = "/sixnft/evmsupport/address_binding";
option (google.api.http).get = "/thesixnetwork/sixnft/evmsupport/address_binding";
}

// this line is used by starport scaffolding # 2
Expand Down
4 changes: 2 additions & 2 deletions proto/nftadmin/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ option go_package = "github.com/thesixnetwork/sixnft/x/nftadmin/types";
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/sixnft/nftadmin/params";
option (google.api.http).get = "/thesixnetwork/sixnft/nftadmin/params";
}
// Queries a Authorization by index.
rpc Authorization(QueryGetAuthorizationRequest) returns (QueryGetAuthorizationResponse) {
option (google.api.http).get = "/sixnft/nftadmin/authorization";
option (google.api.http).get = "/thesixnetwork/sixnft/nftadmin/authorization";
}
// this line is used by starport scaffolding # 2
}
Expand Down
18 changes: 9 additions & 9 deletions proto/nftmngr/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,46 @@ option go_package = "github.com/thesixnetwork/sixnft/x/nftmngr/types";
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/sixnft/nftmngr/params";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/params";
}
// Queries a NFTSchema by index.
rpc NFTSchema(QueryGetNFTSchemaRequest) returns (QueryGetNFTSchemaResponse) {
option (google.api.http).get = "/sixnft/nftmngr/nft_schema/{code}";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/nft_schema/{code}";
}

// Queries a list of NFTSchema items.
rpc NFTSchemaAll(QueryAllNFTSchemaRequest) returns (QueryAllNFTSchemaResponse) {
option (google.api.http).get = "/sixnft/nftmngr/nft_schema";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/nft_schema";
}

// Queries a NftData by index.
rpc NftData(QueryGetNftDataRequest) returns (QueryGetNftDataResponse) {
option (google.api.http).get = "/sixnft/nftmngr/nft_data/{nftSchemaCode}/{tokenId}";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/nft_data/{nftSchemaCode}/{tokenId}";
}

// Queries a list of NftData items.
rpc NftDataAll(QueryAllNftDataRequest) returns (QueryAllNftDataResponse) {
option (google.api.http).get = "/sixnft/nftmngr/nft_data";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/nft_data";
}

// Queries a ActionByRefId by index.
rpc ActionByRefId(QueryGetActionByRefIdRequest) returns (QueryGetActionByRefIdResponse) {
option (google.api.http).get = "/sixnft/nftmngr/action_by_ref_id/{refId}";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/action_by_ref_id/{refId}";
}

// Queries a list of ActionByRefId items.
rpc ActionByRefIdAll(QueryAllActionByRefIdRequest) returns (QueryAllActionByRefIdResponse) {
option (google.api.http).get = "/sixnft/nftmngr/action_by_ref_id";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/action_by_ref_id";
}

// Queries a Organization by index.
rpc Organization(QueryGetOrganizationRequest) returns (QueryGetOrganizationResponse) {
option (google.api.http).get = "/sixnft/nftmngr/organization/{name}";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/organization/{name}";
}

// Queries a list of Organization items.
rpc OrganizationAll(QueryAllOrganizationRequest) returns (QueryAllOrganizationResponse) {
option (google.api.http).get = "/sixnft/nftmngr/organization";
option (google.api.http).get = "/thesixnetwork/sixnft/nftmngr/organization";
}

// Queries a NftCollection by index.
Expand Down
14 changes: 8 additions & 6 deletions proto/nftoracle/collection_owner_request.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ message OriginContractParam {
string chain = 1;
string contract_address = 2;
string contract_owner = 3;
}

message OriginContractInfo {
OriginContractParam contractOriginDataInfo = 1;
bytes hash = 2;
repeated string confirmers = 3;
google.protobuf.Timestamp request_expire = 4
[(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
}

message CollectionOwnerRequest {
Expand All @@ -34,3 +30,9 @@ message CollectionOwnerRequest {
int64 expired_height = 11;

}

message OriginContractInfo {
OriginContractParam contractOriginDataInfo = 1;
bytes hash = 2;
repeated string confirmers = 3;
}
10 changes: 5 additions & 5 deletions proto/nftoracle/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ option go_package = "github.com/thesixnetwork/sixnft/x/nftoracle/types";
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/sixnft/nftoracle/params";
option (google.api.http).get = "/thesixnetwork/sixnft/nftoracle/params";
}
// Queries a MintRequest by id.
rpc MintRequest(QueryGetMintRequestRequest) returns (QueryGetMintRequestResponse) {
option (google.api.http).get = "/sixnft/nftoracle/mint_request/{id}";
option (google.api.http).get = "/thesixnetwork/sixnft/nftoracle/mint_request/{id}";
}

// Queries a list of MintRequest items.
rpc MintRequestAll(QueryAllMintRequestRequest) returns (QueryAllMintRequestResponse) {
option (google.api.http).get = "/sixnft/nftoracle/mint_request";
option (google.api.http).get = "/thesixnetwork/sixnft/nftoracle/mint_request";
}

// Queries a ActionRequest by id.
rpc ActionRequest(QueryGetActionRequestRequest) returns (QueryGetActionRequestResponse) {
option (google.api.http).get = "/sixnft/nftoracle/action_request/{id}";
option (google.api.http).get = "/thesixnetwork/sixnft/nftoracle/action_request/{id}";
}

// Queries a list of ActionRequest items.
rpc ActionRequestAll(QueryAllActionRequestRequest) returns (QueryAllActionRequestResponse) {
option (google.api.http).get = "/sixnft/nftoracle/action_request";
option (google.api.http).get = "/thesixnetwork/sixnft/nftoracle/action_request";
}

// Queries a CollectionOwnerRequest by id.
Expand Down
43 changes: 32 additions & 11 deletions scripts/menu.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
EVMSIGN=./evmsign
default_schema_cdoe=$1
default_schema_code=$1
timestamp=$(date -u +"%Y-%m-%dT%H:%M:%S.000z")
echo "#############################################"
echo "## ##"
echo "## Welcome to the menu script ##"
Expand All @@ -20,31 +21,32 @@ echo "## 11. Oracle - Submit Action Response ##"
echo "## 12. Oracle - Create Verfify Request ##"
echo "## 13. Oracle - Get Verify Request ##"
echo "## 14. Oracle - Submit Verify Response ##"
echo "## Your choice: ##"
echo "## 15. Add Attribute ##"
echo "## 16. Add Action ##"
echo "## ##"
echo "#############################################"
read -p "Your choice: " choice
case $choice in
1) echo "Showing Schema"
read -p "Enter Schema Code: " schema_code
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi
sixnftd q nftmngr show-nft-schema ${schema_code} --output json | jq .
;;
2) echo "Showing NFT"
read -p "Enter Schema Code: " schema_code
read -p "Enter Token ID: " token_id
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi
sixnftd q nftmngr show-nft-data ${schema_code} ${token_id} --output json | jq .
;;
3) echo "Mockup Token"
read -p "Enter Schema Code: " schema_code
read -p "Enter Token ID: " token_id
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi
BASE64_META=`cat nft-data.json | sed "s/TOKENID/${token_id}/g" | sed "s/SCHEMA_CODE/${schema_code}/g" | base64 | tr -d '\n'`
sixnftd tx nftmngr create-metadata "${schema_code}" ${token_id} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y \
Expand All @@ -55,15 +57,15 @@ case $choice in
read -p "Enter Token ID: " token_id
read -p "Enter Action: " action
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi
sixnftd tx nftmngr perform-action-by-nftadmin ${schema_code} ${token_id} ${action} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y
;;
5) echo "Set NFT Attribute"
read -p "Enter Schema Code: " schema_code
read -p "Enter Value (attribute_name=N[value]): " value
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi

ATTRIBUTE_NAME=`echo $value | cut -d'=' -f1`
Expand Down Expand Up @@ -110,7 +112,7 @@ case $choice in
read -p "Enter Token ID: " token_id
read -p "Require confirmations: " require_confirmations
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi
sixnftd tx nftoracle create-mint-request ${schema_code} ${token_id} ${require_confirmations} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y
;;
Expand All @@ -132,7 +134,7 @@ case $choice in
read -p "Require confirmations: " require_confirmations
read -p "Reference ID: " reference_id
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi

BASE64JSON=`cat action-param.json | sed "s/ACTION/${action}/g" | sed "s/TOKEN_ID/${token_id}/g" | sed "s/SCHEMA_CODE/${schema_code}/g" | sed "s/REFID/${reference_id}/g"`
Expand Down Expand Up @@ -163,7 +165,7 @@ case $choice in
read -p "Enter Schema Code: " schema_code
read -p "Require confirmations: " require_confirmations
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi

BASE64JSON=`cat verify-collection-owner.json`
Expand All @@ -186,12 +188,31 @@ case $choice in
read -p "Verify Request ID: " verfiry_request_id
read -p "Oracle : " oracle_key_name
if [ -z "$schema_code" ]; then
schema_code=$default_schema_cdoe
schema_code=$default_schema_code
fi
BASE64_ORIGINDATA=`cat verify-collection-owner.json | base64 | tr -d '\n'`

sixnftd tx nftoracle submit-verify-collection-owner ${verfiry_request_id} ${schema_code} ${BASE64_ORIGINDATA} --from ${oracle_key_name} --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y
;;
15) echo "Add Attribute"
read -p "Enter Schema Code: " schema_code
if [ -z "$schema_code" ]; then
schema_code=$default_schema_code
fi
read -p "Location of attribute (0 or 1): " location
BASE64_ATTRIBUTE=`cat new-attribute.json | base64 | tr -d '\n'`
sixnftd tx nftmngr add-attribute ${schema_code} ${location} ${BASE64_ATTRIBUTE} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y \
--chain-id sixnft
;;
16) echo "Add Action"
read -p "Enter Schema Code: " schema_code
if [ -z "$schema_code" ]; then
schema_code=$default_schema_code
fi
BASE64_ACTION=`cat new-action.json | base64 | tr -d '\n'`
sixnftd tx nftmngr add-action ${schema_code} ${BASE64_ACTION} --from alice --gas auto --gas-adjustment 1.5 --gas-prices 0.1stake -y \
--chain-id sixnft
;;
*) echo "Invalid choice"
;;
esac
6 changes: 6 additions & 0 deletions scripts/new-action.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "new_action",
"desc": "Use Festival Pass2",
"when": "meta.GetNumber('some_attribute') == 0",
"then": ["meta.SetNumber('some_attribute',meta.GetNumber('some_attribute') 1)"]
}
18 changes: 18 additions & 0 deletions scripts/new-attribute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "new_attribute",
"default_mint_value": {
"boolean_attribute_value": {
"value": false
}
},
"data_type": "boolean",
"required": true,
"display_value_field": "value",
"display_option": {
"bool_true_value": "Yes",
"bool_false_value": "No",
"opensea": {
"trait_type": "New Attribute"
}
}
}
3 changes: 2 additions & 1 deletion scripts/verify-collection-owner.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"chain":"GOERLI",
"contract_address" : "0x9EC14dfF0049F8De41FE106f3221a50313F941aB",
"contract_owner" : "0xb7c2468b9481CbDfD029998d6bA98c55072d932e"
"contract_owner" : "0xb7c2468b9481CbDfD029998d6bA98c55072d932e",
"request_expire" : "2022-10-20T03:44:00Z"
}
Loading

0 comments on commit 0c0cc30

Please sign in to comment.