@nimiq/fastspot-api
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -8,3 +8,3 @@ import { RequestAsset, SwapAsset, Estimate, PreSwap, ContractWithEstimate, Swap, Limits, UserLimits, AssetList, ReferralCodes } from './types'; | ||
export declare function confirmSwap(swap: PreSwap, redeem: { | ||
asset: SwapAsset.NIM | SwapAsset.BTC | SwapAsset.USDC; | ||
asset: SwapAsset.NIM | SwapAsset.BTC | SwapAsset.USDC | SwapAsset.USDC_MATIC; | ||
address: string; | ||
@@ -18,3 +18,3 @@ } | { | ||
}, refund?: { | ||
asset: SwapAsset.NIM | SwapAsset.BTC | SwapAsset.USDC; | ||
asset: SwapAsset.NIM | SwapAsset.BTC | SwapAsset.USDC | SwapAsset.USDC_MATIC; | ||
address: string; | ||
@@ -21,0 +21,0 @@ } | { |
@@ -5,3 +5,3 @@ import { SwapAsset, Precision, } from './types'; | ||
// Some fees for USDC are provided in MATIC, and must be converted accordingly | ||
if (asset === SwapAsset.USDC && options.treatUsdcAsMatic) | ||
if ((asset === SwapAsset.USDC || asset === SwapAsset.USDC_MATIC) && options.treatUsdcAsMatic) | ||
decimals = 18; | ||
@@ -44,2 +44,3 @@ if (typeof decimals === 'undefined') | ||
case SwapAsset.USDC: | ||
case SwapAsset.USDC_MATIC: | ||
htlc = { | ||
@@ -46,0 +47,0 @@ address: contract.id.substring(0, 2) === '0x' ? contract.id : `0x${contract.id}`, |
@@ -5,2 +5,3 @@ export declare enum SwapAsset { | ||
USDC = "USDC", | ||
USDC_MATIC = "USDC_MATIC", | ||
EUR = "EUR" | ||
@@ -19,2 +20,3 @@ } | ||
readonly USDC: 6; | ||
readonly USDC_MATIC: 6; | ||
readonly EUR: 2; | ||
@@ -107,3 +109,3 @@ readonly USD: 2; | ||
scriptBytes: string; | ||
} : T extends SwapAsset.USDC ? { | ||
} : T extends SwapAsset.USDC | SwapAsset.USDC_MATIC ? { | ||
address: string; | ||
@@ -219,3 +221,3 @@ data?: string; | ||
status: ContractStatus; | ||
htlc: T extends SwapAsset.NIM ? NimHtlcDetails : T extends SwapAsset.BTC ? BtcHtlcDetails : T extends SwapAsset.USDC ? UsdcHtlcDetails : T extends SwapAsset.EUR ? EurHtlcDetails : never; | ||
htlc: T extends SwapAsset.NIM ? NimHtlcDetails : T extends SwapAsset.BTC ? BtcHtlcDetails : T extends SwapAsset.USDC | SwapAsset.USDC_MATIC ? UsdcHtlcDetails : T extends SwapAsset.EUR ? EurHtlcDetails : never; | ||
}; | ||
@@ -222,0 +224,0 @@ export declare type ContractWithEstimate<T extends SwapAsset> = Estimate & { |
@@ -6,2 +6,3 @@ export var SwapAsset; | ||
SwapAsset["USDC"] = "USDC"; | ||
SwapAsset["USDC_MATIC"] = "USDC_MATIC"; | ||
SwapAsset["EUR"] = "EUR"; | ||
@@ -17,2 +18,3 @@ })(SwapAsset || (SwapAsset = {})); | ||
[SwapAsset.USDC]: 6, | ||
[SwapAsset.USDC_MATIC]: 6, | ||
[SwapAsset.EUR]: 2, | ||
@@ -19,0 +21,0 @@ [ReferenceAsset.USD]: 2, |
{ | ||
"name": "@nimiq/fastspot-api", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "Typescript library to interact with the Fastspot API", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:nimiq/fastspot-api.git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37625
674