Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking β€œSign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.x #440

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open

2.x #440

Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
4079781
chore: remove solis
kwiss Sep 9, 2024
ab724d6
fix: remove crate reference to solis
kwiss Sep 9, 2024
f083deb
feat(contract): explore the possibility to use a fully onchain orderb…
ptisserand Sep 10, 2024
2083606
feat(deployer-sdk): update deployer & sdk to support contracts v2 (#444)
kwiss Sep 10, 2024
9219328
feat(fees): merge fees
gershon Sep 10, 2024
759cd3a
Feature/dev 717 add optional wait for transaction in sdk actions (#446)
gershon Sep 10, 2024
116c732
fix(contracts): update rust toolchain
gershon Sep 10, 2024
e14bbde
fix(react-sdk): remove arkchain refs
kwiss Sep 10, 2024
1c027aa
refactor(core): update tests (#447)
gershon Sep 10, 2024
dff8083
feat(sdk-deployer): update for v2
kwiss Sep 13, 2024
881ffc5
test(core): update test env path (#453)
gershon Sep 14, 2024
15dc33d
feat(core): simplify core action parameters (#454)
gershon Sep 14, 2024
1f9de36
feat(examples): move fees to its own script, use optional token ID fo…
kwiss Sep 14, 2024
1bcd652
fix: scripts
kwiss Sep 14, 2024
b40ae78
feat(react): test hooks (#457)
gershon Sep 16, 2024
2210e6a
feat(collection): add collection offer (#452)
gershon Sep 17, 2024
dae2498
feat(test): fix core and react test issues (#459)
gershon Sep 24, 2024
ca8464c
contracts: update starknet-foundry to 0.30.0
ptisserand Sep 10, 2024
3923f5f
contracts: add event testing in create_order
ptisserand Sep 10, 2024
fa46d5a
contracts: don't emit anymore `OrderExecuted` directly from starknet …
ptisserand Sep 10, 2024
0ec898c
conntracts: remove OrderExecuted event in executor and use #[flat] fo…
ptisserand Sep 11, 2024
86bbf23
contracts: add test cases for create auction & collection offer orders
ptisserand Sep 11, 2024
fc8798d
contracts: move create_* to setup.cairo
ptisserand Sep 11, 2024
424736b
contracts: WIP cancel_order tests
ptisserand Sep 11, 2024
61aab3a
fix(contracts): ensure caller is the canceller & canceller is the off…
ptisserand Sep 11, 2024
b5dc967
contracts: add cancel_order tests
ptisserand Sep 11, 2024
6e5a008
fix(contracts): ensure an order with same hash can't be created twice
ptisserand Sep 12, 2024
3045d3e
contracts: add test case for expired orders creation
ptisserand Sep 12, 2024
d3b6d26
contracts(starknet): arkchain orderbook is no more used
ptisserand Sep 13, 2024
5efaf02
CI: run SDK test with devnet
ptisserand Sep 14, 2024
2f9b030
fix(CI): add missing shell property for action
ptisserand Sep 14, 2024
55b36cb
turbo: ARKCHAIN_RPC_URL is no more needed
ptisserand Sep 14, 2024
8ef8bbe
fix(CI): add missing step for devnet environment
ptisserand Sep 14, 2024
e234097
CI: starknet-devnet-rs 0.2.0 have been released
ptisserand Sep 19, 2024
91454d8
feat(diri): update indexer to support new event format.
ptisserand Sep 19, 2024
8a110e0
fix(diri): ensure events are handled sorted by block number
ptisserand Aug 23, 2024
3df7dcc
feat(diri): add BLOCK_START, BLOCK_END, BLOCK_RANGE and SLEEP_PERIOD …
ptisserand Sep 19, 2024
19d59ca
feat(diri): use clap to parse display-events arguments
ptisserand Sep 23, 2024
1358eda
feat(diri): add JSON output support in display-events
ptisserand Sep 24, 2024
e00e087
feat(diri): add `order_type` field
ptisserand Sep 24, 2024
c00fd82
feat(diri): move type conversion to orderbook/events
ptisserand Sep 24, 2024
82a3fbe
feat(diri): update JSON output and add missing end update
ptisserand Sep 24, 2024
df3b518
CI: add step to dump devnet state after contract deployment
ptisserand Sep 24, 2024
a5bcdb0
restore turbo.json & pnpm-lock
ptisserand Sep 24, 2024
3f148b2
CI: update command to run SDK tests
ptisserand Sep 24, 2024
3de7c7f
CI: run SDK fulfill action test and reset starknet devnet state
ptisserand Sep 24, 2024
7689a2a
CI: store devnet state after setArkFees has been called.
ptisserand Sep 24, 2024
785ab1d
display-events: add limit_wait_retries to end indexing when reached
ptisserand Sep 26, 2024
3167efb
feat(diri): add address filtering when fetching events
ptisserand Sep 30, 2024
c17a7e2
contracts(starknet): remove not more needed order info storage
ptisserand Oct 1, 2024
10a2199
contracts: removed obsolete contracts
ptisserand Oct 3, 2024
606ab01
contracts: update README
ptisserand Oct 3, 2024
0e43f98
feat(sdk-scrips): update SDK tests & scripts
kwiss Oct 10, 2024
f82f8b4
CI: update environment file and remove useless steps
ptisserand Oct 10, 2024
79affd9
feat: Support for erc1155 (#473)
manlikeHB Oct 10, 2024
ba8f33f
chore(release): enter prerelease mode and version packages
kwiss Oct 10, 2024
d5ff7f4
chore(release): exit prerelease mode and version packages
kwiss Oct 10, 2024
0bc1940
chore(release): enter prerelease mode and version packages
kwiss Oct 10, 2024
6d31848
fix: update contract address
kwiss Oct 10, 2024
afbaa74
chore: changeset
kwiss Oct 10, 2024
9975b56
Manually bump pre-release versions and update changelogs
kwiss Oct 10, 2024
0a0a5c4
Manually bump pre-release versions and update changelogs
kwiss Oct 10, 2024
8d298de
fix: contracts, missing provider, add changelog for beta update
kwiss Oct 14, 2024
901f635
feat(diri): split diri orderbook event in another package (#482)
ptisserand Oct 15, 2024
446631d
feat: add custom errors (#480)
NueloSE Oct 16, 2024
d81ed8d
fix: emit OrderCancelled event when an order is cancelled by a new on…
ptisserand Oct 23, 2024
429aca1
fix: export query provider
kwiss Nov 18, 2024
8d6f8a5
fix: contracts deployer, update changeset beta & deploy mainnet contract
kwiss Nov 18, 2024
f476019
patch: update packages version
kwiss Nov 18, 2024
7d51aa7
fix: contract
kwiss Nov 19, 2024
d78f8ed
fix: update scripts & readme
kwiss Nov 19, 2024
2ca0228
feat: expose types required by orderbook indexer (#504)
ptisserand Nov 26, 2024
97407cf
chore(lib): bump sqlx to 0.8.2 for v2
maissani Dec 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: expose types required by orderbook indexer (#504)
## Description
Add public enums for `OrderType` and `RouteType`

<!--
Please do not leave this blank.
Describe the changes in this PR. What does it [add/remove/fix/replace]?

For crafting a good description, consider using ChatGPT to help
articulate your changes.
-->

## What type of PR is this? (check all applicable)

- [x] πŸ• Feature (`feat:`)
- [ ] πŸ› Bug Fix (`fix:`)
- [ ] πŸ“ Documentation Update (`docs:`)
- [ ] 🎨 Style (`style:`)
- [ ] πŸ§‘β€πŸ’» Code Refactor (`refactor:`)
- [ ] πŸ”₯ Performance Improvements (`perf:`)
- [ ] βœ… Test (`test:`)
- [ ] πŸ€– Build (`build:`)
- [ ] πŸ” CI (`ci:`)
- [ ] πŸ“¦ Chore (`chore:`)
- [ ] ⏩ Revert (`revert:`)
- [ ] πŸš€ Breaking Changes (`BREAKING CHANGE:`)

## Related Tickets & Documents

<!--
Please use this format to link related issues: Fixes #<issue_number>
More info:
https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Added tests?

- [ ] πŸ‘ yes
- [ ] πŸ™… no, because they aren't needed
- [ ] πŸ™‹ no, because I need help

## Added to documentation?

- [ ] πŸ“œ README.md
- [ ] πŸ““ Documentation
- [ ] πŸ™… no documentation needed

## [optional] Are there any post-deployment tasks we need to perform?

<!-- Describe any additional tasks, if any, and provide steps. -->

## [optional] What gif best describes this PR or how it makes you feel?

<!-- Share a fun gif related to your PR! -->

### PR Title and Description Guidelines:

- Ensure your PR title follows semantic versioning standards. This helps
automate releases and changelogs.
- Use types like `feat:`, `fix:`, `chore:`, `BREAKING CHANGE:` etc. in
your PR title.
- Your PR title will be used as a commit message when merging. Make sure
it adheres to [Conventional Commits
standards](https://www.conventionalcommits.org/).

## Closing Issues

<!--
Use keywords to close related issues. This ensures that the associated
issues will automatically close when the PR is merged.

- `Fixes #123` will close issue 123 when the PR is merged.
- `Closes #123` will also close issue 123 when the PR is merged.
- `Resolves #123` will also close issue 123 when the PR is merged.

You can also use multiple keywords in one comment:
- `Fixes #123, Resolves #456`

More info:
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->
  • Loading branch information
ptisserand authored Nov 26, 2024
commit 2ca0228715acaa3493aba10c220fcd0c1dd36f35
30 changes: 30 additions & 0 deletions crates/orderbook/src/events/order_placed.rs
Original file line number Diff line number Diff line change
@@ -40,6 +40,14 @@ abigen!(
{
"name": "Erc721ToErc20",
"type": "()"
},
{
"name": "Erc20ToErc1155",
"type": "()"
},
{
"name": "Erc1155ToErc20",
"type": "()"
}
]
},
@@ -198,3 +206,25 @@ impl TryFrom<EmittedEvent> for OrderPlaced {
}
}
}

impl From<&RouteType> for crate::RouteType {
fn from(value: &RouteType) -> Self {
match value {
RouteType::Erc20ToErc721 => crate::RouteType::Erc20ToErc721,
RouteType::Erc721ToErc20 => crate::RouteType::Erc721ToErc20,
RouteType::Erc20ToErc1155 => crate::RouteType::Erc20ToErc1155,
RouteType::Erc1155ToErc20 => crate::RouteType::Erc1155ToErc20,
}
}
}

impl From<&OrderType> for crate::OrderType {
fn from(value: &OrderType) -> Self {
match value {
OrderType::Listing => crate::OrderType::Listing,
OrderType::Auction => crate::OrderType::Auction,
OrderType::Offer => crate::OrderType::Offer,
OrderType::CollectionOffer => crate::OrderType::CollectionOffer,
}
}
}
26 changes: 26 additions & 0 deletions crates/orderbook/src/lib.rs
Original file line number Diff line number Diff line change
@@ -43,3 +43,29 @@ impl From<EmittedEvent> for Event {
}
}
}

pub enum RouteType {
Erc20ToErc721,
Erc721ToErc20,
Erc20ToErc1155,
Erc1155ToErc20,
}

pub enum OrderType {
Listing,
Auction,
Offer,
CollectionOffer,
}

pub mod error {
use starknet::core::types::Felt;

pub const CANCELLED_USER: Felt = Felt::from_hex_unchecked("0x43414e43454c4c45445f55534552");
pub const CANCELLED_BY_NEW_ORDER: Felt =
Felt::from_hex_unchecked("0x43414e43454c4c45445f4e45575f4f52444552");
pub const CANCELLED_ASSET_FAULT: Felt =
Felt::from_hex_unchecked("0x43414e43454c4c45445f41535345545f4641554c54");
pub const CANCELLED_OWNERSHIP: Felt =
Felt::from_hex_unchecked("0x43414e43454c4c45445f4f574e455253484950");
}