Note: the swap SDK does NOT adhere to semantic versioning. The major and minor correspond to the runtime version of the Chainflip protocol that the SDK is intended to be used with.
Deprecated functionality will be retained for two releases after the release in which it is deprecated.
getQuote
can respond with a 500 status code and a JSON response body with an stringerror
field. This field has been replaced bymessage
to be inline with how errors are returned in other parts of the API.
SwapSDK.prototype.executeSwap
allows to not wait for transaction inclusion by passing{ wait: 0 }
astxOpts
param now. The method will return the transaction hash of the submitted transaction.
SwapSDK.prototype.getQuote
currently responds with a 500 if there is insufficient liquidity. It has been changed to a 400 because there are steps the user can take to fix the error, namely change the swap input amount. The error message has been changed to a more informativeinsufficient liquidity for requested amount
.SwapSDK.prototype.getQuote
andrequestSwapDepositChannel
reject requests with amounts larger than the largest value of a 128 bit integer.
SwapSDK.prototype.getStatus
will return the list of affiliate brokers for a deposit channel if it was opened with affiliates.SwapSDK.prototype.getQuote
supports an optionalbrokerCommissionBps
andaffiliateBrokers
option. If given, thebrokerCommissionBps
option will be used instead of thebrokerCommissionBps
used to initialize the SDK instance.SwapSDK.prototype.requestDepositAddress
supports an optionalbrokerCommissionBps
andaffiliateBrokers
option. The new options are only available when initializing the SDK with a brokerUrl and will be applied only to the requested deposit channel.
SwapSDK.prototype.requestDepositAddress
now returns thechannelOpeningFee
, of typebigint
. It is measured in Flipperino (the base unit of $FLIP). This fee is incurred when a broker opens a swap deposit channel.SwapSDK.prototype.channelOpeningFees
has been added and returns the channel opening fee for each chain. It returns a map of each supportedChainflipChain
to abigint
which is the fee in Flipperino to open a swap deposit channel.SwapSDK.prototype.getRequiredBlockConfirmations
has been added. It returnsChainMap<number | null>
which signifies 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.USDT
has been added to ourChainAssetMap
data structure under theEthereum
key:
type ChainAssetMap<T> = {
Bitcoin: {
BTC: T;
};
Ethereum: {
ETH: T;
USDC: T;
FLIP: T;
+ USDT: T;
};
Polkadot: {
DOT: T;
};
}
broadcastTransactionRef
has been added to thegetStatus
response for swaps in theBROADCASTED
andCOMPLETE
state. 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.getRequiredBlockConfirmations
now has a return type ofChainMap<number | null>
instead ofChainMap<number | undefined>
to be more consistent with existing return types.SwapSDK.prototype.getAssets
now uses thecf_supported_assets
RPC method to determine the supported assets of the connected Chainflip network. The format of the returned data was not changed.SwapSDK.prototype.getChains
now uses thecf_supported_assets
RPC method to determine the supported chains of the connected Chainflip network. The format of the returned data was not changed.
getQuote
can respond with a 500 status code and a JSON response body with an stringerror
field. A duplicatemessage
field has been added to be consistent with error handling with other parts of the API. Theerror
field will be removed in a future release.
getQuote
can respond with a 500 status code and a JSON response body with an stringerror
field. This field has been duplicated asmessage
to be inline with how errors are handled in the other methods. Theerror
field has been deprecated and will be removed after 1.4.0- removed the
0x
prefix from Bitcoin transaction hashes in the status response