Skip to content

Commit

Permalink
[ECO-2634] Complete market metadata readme (#489)
Browse files Browse the repository at this point in the history
Co-authored-by: alnoki <[email protected]>
  • Loading branch information
CRBl69 and alnoki authored Dec 30, 2024
1 parent a2a57bc commit be24e2c
Showing 1 changed file with 71 additions and 12 deletions.
83 changes: 71 additions & 12 deletions src/move/market_metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,91 @@ aptos move run \
--profile $PROFILE_NAME
```

## Set property
## Add properties

> If market metadata entry does not exist, create an empty entry. Then, add
> market properties, overwriting existing properties if they already exist.
```sh
MARKET_METADATA=0xaaa...
MODULE=emojicoin_dot_fun_market_metadata
FUNCTION=add_market_properties
PACKAGE_ADDRESS=0xabc...
MARKET_ADDRESS=0xdef...
PROFILE=my-profile
PROPERTY=string:foo
VALUE=string:bar
MARKET_ID=u64:1
PROPERTIES='"X profile","Website","Telegram"'
VALUES='"foo","bar","baz"'
```

```sh
aptos move run \
--args \
"address:$MARKET_ADDRESS" \
'string:['$PROPERTIES']' \
'string:['$VALUES']' \
--function-id "$PACKAGE_ADDRESS::$MODULE::$FUNCTION" \
--profile $PROFILE
```

<!-- markdownlint-disable MD013 -->
## Remove properties

> If the market has an entry, remove all specified keys. If the market has no
> entries after removing the keys, remove the market from the metadata registry.
```sh
MODULE=emojicoin_dot_fun_market_metadata
FUNCTION=remove_market_properties
PACKAGE_ADDRESS=0xabc...
MARKET_ADDRESS=0xdef...
PROFILE=my-profile
PROPERTIES='"X profile","Website"'
```

```sh
aptos move run \
--args $MARKET_ID $PROPERTY $VALUE \
--function-id $MARKET_METADATA::emojicoin_dot_fun_market_metadata::add_market_property \
--args "address:$MARKET_ADDRESS" 'string:['$PROPERTIES']' \
--function-id "$PACKAGE_ADDRESS::$MODULE::$FUNCTION" \
--profile $PROFILE
```

## Unset property
## Set properties

> Clear all properties for the given market if it has any, then set the supplied
> values. If there are no supplied key-value pairs, remove the market's entry
> from the metadata registry.
```sh
MODULE=emojicoin_dot_fun_market_metadata
FUNCTION=set_market_properties
PACKAGE_ADDRESS=0xabc...
MARKET_ADDRESS=0xdef...
PROFILE=my-profile
PROPERTIES='"X profile","Website","Telegram"'
VALUES='"foo","bar","baz"'
```

```sh
aptos move run \
--args $MARKET_ID $PROPERTY \
--function-id $MARKET_METADATA::emojicoin_dot_fun_market_metadata::remove_market_property \
--args \
"address:$MARKET_ADDRESS" \
'string:['$PROPERTIES']' \
'string:['$VALUES']' \
--function-id "$PACKAGE_ADDRESS::$MODULE::$FUNCTION" \
--profile $PROFILE
```

<!-- markdownlint-enable MD013 -->
## Emojicoin special properties

The `emojicoin dot fun` frontend will only consider the following values:

- `Discord`
- `Telegram`
- `Website`
- `X profile`

For example, to set the website to `https://example.org` and the x profile to
`0xabcd` for the `0xabcd` market, you can use the following variables:

```sh
PROPERTIES='"Website","X profile"'
VALUES='"https://example.org","https://x.com/0xabcd"'
```

0 comments on commit be24e2c

Please sign in to comment.