Releases: chainflip-io/chainflip-sdk-monorepo
@chainflip/sdk/v1.7.0
1.7.0
Added
- A new method has been added to the
SwapSDK
,requestDepositAddressV2
. This
event simplifies deposit channel creation by accepting the quote that is
returned by the SDK to set the correct assets, DCA parameters, and Boost fee. - A new method has been added to the
SwapSDK
,approveAndExecuteSwap
.
This is a convenience method that can be used to skip the manual token
allowance approval. Upon calling, the method will make sure there is enough
ERC20 token allowance before proceeding with initiating the swap. SwapSDK.prototype.getQuoteV2
returns arecommendedSlippageTolerancePercent
property now. The value is calculated based on current market conditions to prevent
refunds while protecting against big price movements. It can be passed into
therequestDepositAddressV2
method to set the slippage tolerance for a swap.SwapSDK.prototype.getStatusV2
andSwapSDK.prototype.getQuoteV2
return an
estimatedDurationsSeconds
property now. It includes the estimated time in seconds
different stages of a swap:deposit
: time for a deposit to be witnessed and the respective swap being scheduledswap
: time for a swap to be fully executedegress
: time until the output transaction is included in a block
Changed
- Fill or Kill parameters are now mandatory when opening a deposit channel through
the default broker endpoint. If you are using your own broker, the parameters are
still optional for now. SwapSDK.prototype.getStatus
: deprecateddepositTransactionHash
was removed.
UsedepositTransactionRef
instead.SwapSDK.prototype.getStatus
: deprecatedccmMetadata
was removed.
UseccmParams
instead.SwapSDK.prototype.requestDepositAddress
: deprecatedccmMetadata
was removed.
UseccmParams
instead.SwapSDK.prototype.executeSwap
: deprecatedccmMetadata
was removed.
UseccmParams
instead.
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.6.6...@chainflip/sdk/v1.7.0
@chainflip/sdk/v1.6.6
1.6.6
Fixed
- Polkadot destination address were being improperly validated before being sent
to the broker.
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.6.5...@chainflip/sdk/v1.6.6
@chainflip/sdk/v1.6.5
1.6.5
Changed
- In order to open a DCA deposit channel, Fill or Kill parameters must now be
provided.
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.6.4...@chainflip/sdk/v1.6.5
@chainflip/sdk/v1.6.4
1.6.4
Changed
- Optional parameter to enable DCA during SDK initialization. The default value
for this parameter isfalse
.new ChainflipSDK({ ... enabledFeatures: { dca: true; }; });
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.6.3...@chainflip/sdk/v1.6.4
@chainflip/sdk/v1.6.3
1.6.3
Fixed
- Fixed a bug in the smart contract swaps where the CF Parameters were not being
properly passed to the smart contract call.
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.6.2...@chainflip/sdk/v1.6.3
@chainflip/sdk/v1.6.2
1.6.2
Changed
- Upgraded our internal RPC package to remove a web API and improve
compatibility with React Native/the Hermes compiler.
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.6.1...@chainflip/sdk/v1.6.2
@chainflip/sdk/v1.6.1
1.6.1
Changed
- Upgraded our internal Bitcoin package to remove WebAssembly. The WebAssembly
caused issues with React Native users as there is no WebAssembly runtime.
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.6.0...@chainflip/sdk/v1.6.1
@chainflip/sdk/v1.6.0
1.6.0
See migration guide here
Deprecated
SwapSDK.prototype.getQuote
is now deprecatedSwapSDK.prototype.getStatus
is now deprecated
Added
SwapSDK.prototype.getQuoteV2
- Returns an array of quotes instead of single quote and includes new properties.
type
: quote type (DCA or REGULAR)dcaParams
: object withnumberOfChunks
andchunkIntervalBlocks
- Returns an array of quotes instead of single quote and includes new properties.
SwapSDK.prototype.getStatusV2
- Revamped statuses and support for dca swaps
SwapSDK.prototype.requestDepositAddress
supports an optional
dcaParams
option. It includesnumberOfChunks
: The number of chunks to split the swap intochunkIntervalBlocks
: Interval in state-chain blocks between each chunk. (minimum value: 2 blocks)
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.5.0...@chainflip/sdk/v1.6.0
@chainflip/sdk/v1.5.0
1.5.0
Added
SwapSDK.prototype.requestDepositAddress
supports an optional
FillOrKillParams
option. It includesretryDurationBlocks
: number of blocks to retry the swap if the price was
lower than theminPrice
refundAddress
: the address to refund the funds to in case the price limit
was never metminPrice
: the minimum price that the swap can happen at. The swap will not
go through if the price is below this value
SwapSDK.prototype.getStatus
will return adepositTransactionRef
. This
references the transaction that triggered a swap. For Bitcoin and EVM chains,
this is a transaction hash. For Polkadot, it is a block number and extrinsic
index in the format of${blockNumber}-${extrinsicIndex}
.SwapSDK.prototype.getStatus
will return a
srcChainRequiredBlockConfirmations
. This is the number of confirmations the
protocol requires before recognizing a transaction as confirmed. For networks
like Polkadot, there is deterministic finality, and therefore, no confirmation
count is required.SwapSDK.prototype.getStatus
will returnFillOrKillParams
that includesretryDurationBlocks
: number of state chain blocks to continue retrying the
swap if the price is below the expected pricerefundAddress
: the address to return the funds to in case of not reaching
the expected priceminPrice
: the minimum price that the swap can happen at
egressType
property has been added toEGRESS_SCHEDULED
,
BROADCAST_REQUESTED
,BROADCASTED
,COMPLETE
andBROADCAST_ABORTED
states which can beSWAP
orREFUND
. Refund may happen in case of a fill or
kill swap.- New failure values added under the
FAILED
stateREFUND_EGRESS_IGNORED
: This happens if the refund egress has been ignored,
most likely due to refund egress amount being lower than the egress fee.
Fixed
SwapSDK.prototype.getStatus
returned abroadcastTransactionRef
with a0x
prefix for bitcoin transactions previously. This is not accepted by popular
bitcoin block explorers and was therefore adjusted to not return a0x
prefix. The returned data was not changed for other chains.SwapSDK.prototype.getStatus
will return deposit channel info even when
querying directly by swap id.
Removed
getQuote
used to respond with a 500 status code and a JSON response body
with a stringerror
field. A duplicatemessage
field was added in version
1.3 to be consistent with error handling with other parts of the API. The
error
field has be removed.
Deprecated
SwapSDK.prototype.getStatus
:depositTransactionHash
is deprecated and will
be removed in a future release. UsedepositTransactionRef
instead.SwapSDK.prototype.getStatus
:ccmMetadata
is deprecated and will be removed
in a future release. UseccmParams
instead.SwapSDK.prototype.requestDepositAddress
:ccmMetadata
is deprecated and
will be removed in a future release. UseccmParams
instead.SwapSDK.prototype.executeSwap
:ccmMetadata
is deprecated and will be
removed in a future release. UseccmParams
instead.
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.4.2...@chainflip/sdk/v1.5.0
@chainflip/sdk/v1.4.2
1.4.2
SwapSDK.prototype.getBoostLiquidity
- new method that returns the current
liquidity state of the boost pools. Supports filtering of the results by:chainAsset: UncheckedAssetAndChain
- the combination of chain & asset (for
ex.{ chain: "Bitcoin", asset: "BTC" }
)feeTierBps: number
- the fee tier of the pool (for ex. 5, 10, 30)
Full Changelog: https://github.com/chainflip-io/chainflip-sdk-monorepo/compare/@chainflip/sdk/v1.4.0...@chainflip/sdk/v1.4.2