Skip to content

Commit

Permalink
chore: bump sdk nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 3, 2024
1 parent 5f45945 commit 32aa8cd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-comics-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@swapkit/plugin-kado": minor
---

Nightly release
57 changes: 21 additions & 36 deletions packages/plugins/kado/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ function mapKadoQuoteToQuoteResponse({
sellAsset: sellAsset.toString(),
sellAmount: sellAsset.getValue("string"),
buyAsset: buyAsset.toString(),
expectedBuyAmount: buyAssetAmount.toString(),
expectedBuyAmountMaxSlippage: buyAssetAmount.toString(),
expectedBuyAmount: buyAssetAmount.getValue("string"),
expectedBuyAmountMaxSlippage: buyAssetAmount.getValue("string"),
sourceAddress: "{sourceAddress}",
destinationAddress: "{destinationAddress}",
fees: [
Expand Down Expand Up @@ -81,7 +81,22 @@ function mapKadoQuoteToQuoteResponse({
buyAsset: buyAsset.toString(),
buyAmount: quote.data.quote.receive.unitCount.toString(),
buyAmountMaxSlippage: quote.data.quote.receive.unitCount.toString(),
fees: [],
fees: [
{
asset: quote.data.quote.processingFee.currency,
amount: quote.data.quote.processingFee.amount.toString(),
type: FeeTypeEnum.LIQUIDITY,
protocol: ProviderName.KADO,
chain: Chain.Fiat,
},
{
asset: quote.data.quote.networkFee.currency,
amount: quote.data.quote.networkFee.amount.toString(),
type: FeeTypeEnum.NETWORK,
protocol: ProviderName.KADO,
chain: buyAsset.chain,
},
],
},
],
warnings: [],
Expand Down Expand Up @@ -204,39 +219,9 @@ function plugin({ config: { kadoApiKey } }: SwapKitPluginParams<{ kadoApiKey: st
}

async function getBlockchains() {
const response = await RequestClient.get<{
success: boolean;
message: string;
data: {
blockchains: {
_id: string;
supportedEnvironment: string;
network: string;
origin: string;
label: string;
associatedAssets: {
_id: string;
name: string;
description: string;
label: string;
supportedProviders: string[];
stablecoin: boolean;
liveOnRamp: boolean;
createdAt: string;
updatedAt: string;
__v: number;
priority: number;
};
avgTransactionTimeSeconds: number;
usesAvaxRouter: boolean;
liveOnRamp: boolean;
createdAt: string;
updatedAt: string;
__v: number;
priority: number;
}[];
};
}>("https://api.kado.money/v1/ramp/blockchains");
const response = await RequestClient.get<KadoBlockchainsResponse>(
"https://api.kado.money/v1/ramp/blockchains",
);

if (!response.success) {
throw new Error(response.message);
Expand Down

0 comments on commit 32aa8cd

Please sign in to comment.