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

Feat/Delta support #183

Merged
merged 186 commits into from
Dec 9, 2024
Merged

Feat/Delta support #183

merged 186 commits into from
Dec 9, 2024

Conversation

Velenir
Copy link
Member

@Velenir Velenir commented Nov 7, 2024

Adding support for Delta v2

closes FRNT-847

Base automatically changed from feat/etherV6_support to feat/web3_upgrade November 12, 2024 13:30
Base automatically changed from feat/web3_upgrade to feat/deps_update November 12, 2024 13:32
Base automatically changed from feat/deps_update to feat/viem_support November 12, 2024 13:33
Base automatically changed from feat/viem_support to feat/build_upgrade November 12, 2024 13:33
Base automatically changed from feat/build_upgrade to master November 12, 2024 13:39
Comment on lines 188 to 195
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
v = 27 + (bytes[32]! >> 7);
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
bytes[32]! &= 0x7f; // Clear the highest bit
} else {
// Extract v directly for 65-byte signature
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
v = bytes[64]!;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected that I don't have linter errors here without disabling?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strangely, I also don't have errors anymore 🤷

import type { Address, ConstructFetchInput } from '../../types';
import type { ParaswapDeltaAuction } from './helpers/types';

type OrderFromAPI = Omit<ParaswapDeltaAuction, 'signature'>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed, API now return a new orderHash field. Was added most likely with V2 release

import { DeltaAuctionOrder, ParaswapDeltaAuction } from './helpers/types';

export type DeltaOrderToPost = {
partner?: string; // @TODO not sure if this is optional, need to check
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is indeed optional, just checked
'anon' is assigned if not specified during /post

@@ -117,16 +145,25 @@ export type NFTOrdersFetchMethods = GetNFTOrdersContractFunctions &
PostNFTOrderFunctions &
BuildNFTOrdersTxFunctions;

export type DeltaFetchMehods = BuildDeltaOrderFunctions &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export type DeltaFetchMehods = BuildDeltaOrderFunctions &
export type DeltaFetchMethods = BuildDeltaOrderFunctions &

src/index.ts Outdated
@@ -256,11 +313,27 @@ export type {
BuildNFTOrderInput,
BuildNFTOrderDataInput,
NFTOrdersUserParams,
//types for Delta methos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//types for Delta methos
//types for Delta methods

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most likely this is left over from previous branches.
as discussed, let's cleanup this

Velenir and others added 9 commits November 28, 2024 11:53
* quote/getQuote

* reexport from quote

* simpleSDK/add quote

* partialSDK/simplify type

* fullSDK/add quote

* examples/simple/fix wrong Token

* quote/getQuote/more specific types

* examples/quote

* delta/buildDeltaOrders/allow to override partnerFee data

* quote/add tests

* examples/simpleQuote

* examples/quote/ fix amount var

* cleanup

* README/add quote usage

* buildDeltaOrder/partnerAndFee encoding shortcut

* cleanup

* DeltaAuctionOrder.nonce: number -> string

* test/delta/update

* tests/quote/update

* quote/getQuote res/fallback_reason -> fallbackReason

* quote/annotate some types

* tests/quote/update snaps

* quote/getQuote/update response types

* tests/quote/add gas cost error test

* tests/quote/fix purposefully failing tests

* tests/delta/fix orders order

* examples/quote/fix types

* fix linter

* examples/delta/improve flow

* delta/Permit/composeDeltaOrderPermit/special handling

* Readme/DELTA.md

* Readme/update

* cleanup

* add type ParaswapDeltaAuction.deltaVersion

* tests/delta/update snapshots

* fix typo

Co-authored-by: andriy-shymkiv <[email protected]>

---------

Co-authored-by: andriy-shymkiv <[email protected]>
@Velenir Velenir merged commit a4a997b into master Dec 9, 2024
2 checks passed
@Velenir Velenir deleted the feat/delta branch December 9, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants