@swapkit/core 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +13 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @swapkit/core
|
|
2
2
|
|
|
3
|
+
## 4.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#332](https://github.com/swapkit/sdk/pull/332) [`d099d5f`](https://github.com/swapkit/sdk/commit/d099d5f95289e25a053cb0575f464c18419eebf0) Thanks [@towanTG](https://github.com/towanTG)! - `approveAssetValue` and `isAssetValueApproved` take **either the route or an explicit assetValue + spender/plugin address** — a route carries everything: the approval subject (a Stellar trustline belongs to the buy asset; an EVM allowance covers `sellAsset`/`sellAmount`), the spender (`meta.approvalAddress`), and the plugin (resolved the same way `swap()` resolves it: swapkit-routed providers and direct-signing wallets go to the swapkit plugin, everything else by the route's provider).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
// POST /swap returned 200 with approvalTx { txType: "STELLAR", tx } and no tx:
|
|
11
|
+
const approved = await swapKit.isAssetValueApproved(route); // hasTrustline on the buy asset
|
|
12
|
+
if (!approved) {
|
|
13
|
+
await swapKit.approveAssetValue(route); // receiving wallet signs route.approvalTx.tx
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const refreshedRoute = await SwapKitApi.getRouteWithTx({
|
|
17
|
+
routeId,
|
|
18
|
+
sourceAddress,
|
|
19
|
+
destinationAddress,
|
|
20
|
+
}); // re-POST /swap
|
|
21
|
+
await swapKit.swap({ route: refreshedRoute });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The explicit form is unchanged: `approveAssetValue(assetValue, spenderOrPluginName)`. EVM allowance behavior is untouched.
|
|
25
|
+
|
|
26
|
+
## 4.5.1
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- [#331](https://github.com/swapkit/sdk/pull/331) [`f740a74`](https://github.com/swapkit/sdk/commit/f740a742a0cf879b4e56bb73647d21642bc22e9d) Thanks [@towanTG](https://github.com/towanTG)! - Add client-side support for the Stellar trustline approval flow: swap response types model the `approvalTx` union (EVM | Stellar changeTrust XDR) and `nextActions`, `approveAssetValue`/`isAssetValueApproved` switch between EVM allowances and Stellar trustlines (checking via the new Stellar toolbox `hasTrustline({ address, assetValue })`, approving by signing the API-provided changeTrust XDR with the destination wallet). The swap method itself is unchanged — integrators approve first, re-fetch the route, then swap. (via @swapkit/helpers@4.19.0)
|
|
31
|
+
- Update generated token lists. (via @swapkit/helpers@4.19.0)
|
|
32
|
+
- [#329](https://github.com/swapkit/sdk/pull/329) [`55d9edc`](https://github.com/swapkit/sdk/commit/55d9edcc603e0139588c905e41a59eaaa3275cda) Thanks [@towanTG](https://github.com/towanTG)! - Update NEAR provider token list: add Stellar assets (XLM.XLM, XLM.USDC) and latest NEAR-intents listings (SWEAT, GMX, KAITO, AAVE, LINK, UNI, and more); remove BTC.BTC(OMNI) (via @swapkit/helpers@4.19.0)
|
|
33
|
+
|
|
3
34
|
## 4.5.0
|
|
4
35
|
|
|
5
36
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var{defineProperty:
|
|
1
|
+
var{defineProperty:O,getOwnPropertyNames:E,getOwnPropertyDescriptor:jj}=Object,x=Object.prototype.hasOwnProperty;function P(J){return this[J]}var B=(J,L,$)=>{var I=E(L);for(let X of I)if(!x.call(J,X)&&X!=="default")O(J,X,{get:P.bind(L,X),enumerable:!0});if($){for(let X of I)if(!x.call($,X)&&X!=="default")O($,X,{get:P.bind(L,X),enumerable:!0});return $}};var qj=(J)=>{var L=(S??=new WeakMap).get(J),$;if(L)return L;if(L=O({},"__esModule",{value:!0}),J&&typeof J==="object"||typeof J==="function"){for(var I of E(J))if(!x.call(L,I))O(L,I,{get:P.bind(J,I),enumerable:!($=jj(J,I))||$.enumerable})}return S.set(J,L),L},S;var zj=(J)=>J;function Gj(J,L){this[J]=zj.bind(null,L)}var Hj=(J,L)=>{for(var $ in L)O(J,$,{get:L[$],enumerable:!0,configurable:!0,set:Gj.bind(L,$)})};var k={};Hj(k,{resolveRoutePluginName:()=>v,getRouteApprovalAssetValue:()=>V,SwapKit:()=>Lj});module.exports=qj(k);var q=require("@swapkit/helpers"),y=require("@swapkit/helpers/api");B(k,require("@swapkit/helpers"),module.exports);var Jj=[q.ProviderName.FLASHNET,q.ProviderName.MAYAN];function v({pluginName:J,providers:L,useDirectSigning:$}){return L.some((X)=>Jj.includes(X))||$?"swapkit":J||L[0]}function V(J){let L="approvalTx"in J?J.approvalTx:void 0;return L!==void 0&&"txType"in L&&L.txType==="STELLAR"?q.AssetValue.from({asset:J.buyAsset}):q.AssetValue.from({asset:J.sellAsset,value:J.sellAmount})}function Lj({config:J,plugins:L,wallets:$}={}){if(J)q.SKConfig.set(J);let I={},X=Object.entries(L||{}).reduce((j,[G,z])=>{let H=z({getWallet:Y});return j[G]=H,j},{}),W=Object.entries($||{}).reduce((j,[G,z])=>{let H=z.connectWallet({addChain:w});return j[G]=H,j},{});function A(j){let G=j&&X[j],z=Object.values(X).find((Q)=>Q.supportedSwapkitProviders?.includes(j)),H=G||z;if(!H)throw new q.SwapKitError("core_plugin_not_found");return H}function w(j){let G=Y(j.chain),z=j?.balance||G?.balance||[q.AssetValue.from({chain:j.chain})],H={...G,...j,balance:z};return I[j.chain]=H,H}function T({pluginName:j,route:G,useDirectSigning:z}){return A(v({pluginName:j,providers:G.providers,useDirectSigning:z}))}function m({assetValue:j,plugin:G,route:z,spenderAddress:H,type:Q}){if(Q===q.ApproveMode.CheckOnly&&"isAssetValueApproved"in G)return G.isAssetValueApproved({assetValue:j,route:z,spenderAddress:H});if(Q===q.ApproveMode.Approve&&"approveAssetValue"in G)return G.approveAssetValue({assetValue:j,route:z,spenderAddress:H});throw new q.SwapKitError({errorKey:"core_approve_asset_target_invalid",info:{message:`Target ${String(H??z?.providers[0])} cannot be used for approve operation`}})}function b({assetValue:j,type:G="checkOnly",contractAddress:z,route:H}){let Q=j??(H?V(H):void 0);if(!Q)throw new q.SwapKitError("core_approve_asset_target_invalid");let Z=z??H?.meta.approvalAddress,R=H?T({route:H,useDirectSigning:Boolean(Y(Q.chain)?.supportsDirectSigning)}):Z&&X[Z];if(R)return m({assetValue:Q,plugin:R,route:H,spenderAddress:Z,type:G});let f=Q.chain,_=q.EVMChains.includes(f);if(_&&Q.isGasAsset||!_||Q.isSynthetic)return Promise.resolve(G==="checkOnly"?!0:"approved");let U=Y(f),D=G==="checkOnly"?U.isApproved:U.approve;if(!D)throw new q.SwapKitError("core_wallet_connection_not_found");if(!(Q.address&&U.address&&typeof Z==="string"))throw new q.SwapKitError("core_approve_asset_address_or_from_not_found");return D({amount:Q.getBaseValue("bigint"),assetAddress:Q.address,from:U.address,spenderAddress:Z})}function Y(j){return I[j]}function h(){return{...I}}function d(j){return Y(j)?.address||""}function g(j,G){return j instanceof q.AssetValue?b({assetValue:j,contractAddress:G,type:q.ApproveMode.Approve}):b({route:j,type:q.ApproveMode.Approve})}function u(j,G){return j instanceof q.AssetValue?b({assetValue:j,contractAddress:G,type:q.ApproveMode.CheckOnly}):b({route:j,type:q.ApproveMode.CheckOnly})}function K(j){Y(j)?.disconnect?.(),delete I[j]}function c(){for(let j of Object.keys(I))K(j)}function o(j,G){return G?N(j).then(({balance:z})=>z):Y(j)?.balance||[]}async function N(j,G=!0){let z=Y(j);if(!z)throw new q.SwapKitError("core_wallet_connection_not_found");let H=await z.getBalance?.(z.address,G);return z.balance=H||[q.AssetValue.from({chain:j})],z}function p({route:j,pluginName:G,...z}){let H=q.AssetValue.from({asset:j.sellAsset}).chain,Q=Y(H);if(!Q)throw new q.SwapKitError("core_wallet_connection_not_found");let Z=T({pluginName:G,route:j,useDirectSigning:Boolean(Q.supportsDirectSigning&&j.tx)});if("swap"in Z)return Z.swap({...z,route:j});throw new q.SwapKitError("core_plugin_swap_not_found")}function i({assetValue:j,...G}){let z=j.chain;if([q.Chain.Radix].includes(z)||!Y(z))throw new q.SwapKitError("core_wallet_connection_not_found");return Y(z).transfer({...G,assetValue:j})}function n({chain:j,message:G}){let z=Y(j);if(!z)throw new q.SwapKitError("core_wallet_connection_not_found");if("signMessage"in z)return z.signMessage?.(G);throw new q.SwapKitError({errorKey:"core_wallet_sign_message_not_supported",info:{chain:j,wallet:z.walletType}})}function r({chain:j,domain:G,primaryType:z,types:H,value:Q}){let Z=Y(j);if(!Z)throw new q.SwapKitError("core_wallet_connection_not_found");if("signTypedData"in Z&&typeof Z.signTypedData==="function")return Z.signTypedData({domain:G,primaryType:z,types:H,value:Q});throw new q.SwapKitError({errorKey:"core_wallet_sign_typed_data_not_supported",info:{chain:j,wallet:Z.walletType}})}async function s({address:j,chain:G,message:z,signature:H}){if(G!==q.Chain.THORChain)throw new q.SwapKitError({errorKey:"core_verify_message_not_supported",info:{chain:G}});let{getCosmosToolbox:Q}=await import("@swapkit/toolboxes/cosmos");return Q(G).verifySignature({address:j,message:z,signature:H})}async function l({type:j,feeOptionKey:G,params:z}){let{assetValue:H}=z,{chain:Q}=H;if(!Y(Q))throw new q.SwapKitError("core_wallet_connection_not_found");let Z=q.AssetValue.from({chain:Q}),{match:R}=await import("ts-pattern");return await R(Q).returnType().with(...q.EVMChains,(_)=>{let{address:F,...U}=Y(_),D=R(j).with("transfer",()=>U.createTransferTx(z)).with("approve",(a)=>{let{contractAddress:M}=z;return U.createApprovalTx({amount:H.getBaseValue("bigint"),assetAddress:H.address,from:F,spenderAddress:M})}).with("swap",(a)=>{let{route:{providers:[M],tx:e}}=z;if(M&&[q.ProviderName.CHAINFLIP,q.ProviderName.CHAINFLIP_STREAMING].includes(M))return U.createTransferTx({assetValue:H,recipient:F,sender:F});let C=e;return{...C,value:y.parseTransactionValue(C.value)}}).otherwise(()=>{return});if(!D)return Z;return U.estimateTransactionFee({...D,feeOption:G})}).with(...q.CosmosChains,async()=>{let{estimateTransactionFee:_}=await import("@swapkit/toolboxes/cosmos");return _(z)}).with(...q.UTXOChains,(_)=>{let{address:F,...U}=Y(_);return U.estimateTransactionFee({...z,feeOptionKey:G,recipient:F,sender:F})}).with(q.Chain.Tron,q.Chain.Ton,q.Chain.Polkadot,(_)=>{let{address:F,...U}=Y(_);return U.estimateTransactionFee({...z,recipient:F,sender:F})}).with(q.Chain.Aptos,q.Chain.Cardano,q.Chain.Ripple,q.Chain.Stellar,q.Chain.Sui,(_)=>Y(_).estimateTransactionFee()).otherwise(()=>Z)}async function t({address:j,chain:G}){try{let{getAddressValidator:z}=await import("@swapkit/toolboxes");return(await z())({address:j,chain:G})}catch{return!1}}return{...X,...W,approveAssetValue:g,disconnectAll:c,disconnectChain:K,estimateTransactionFee:l,getAddress:d,getAllWallets:h,getBalance:o,getWallet:Y,getWalletWithBalance:N,isAssetValueApproved:u,signMessage:n,signTypedData:r,swap:p,transfer:i,validateAddress:t,verifyMessage:s}}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var f=((Q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Q,{get:(X,F)=>(typeof require<"u"?require:X)[F]}):Q)(function(Q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});import{ApproveMode as R,AssetValue as _,Chain as U,CosmosChains as l,EVMChains as S,ProviderName as x,SKConfig as t,SwapKitError as Y,UTXOChains as a}from"@swapkit/helpers";import{parseTransactionValue as e}from"@swapkit/helpers/api";export*from"@swapkit/helpers";var jj=[x.FLASHNET,x.MAYAN];function qj({pluginName:Q,providers:X,useDirectSigning:F}){return X.some((B)=>jj.includes(B))||F?"swapkit":Q||X[0]}function zj(Q){let X="approvalTx"in Q?Q.approvalTx:void 0;return X!==void 0&&"txType"in X&&X.txType==="STELLAR"?_.from({asset:Q.buyAsset}):_.from({asset:Q.sellAsset,value:Q.sellAmount})}function Lj({config:Q,plugins:X,wallets:F}={}){if(Q)t.set(Q);let k={},B=Object.entries(X||{}).reduce((j,[z,q])=>{let G=q({getWallet:J});return j[z]=G,j},{}),E=Object.entries(F||{}).reduce((j,[z,q])=>{let G=q.connectWallet({addChain:v});return j[z]=G,j},{});function y(j){let z=j&&B[j],q=Object.values(B).find((H)=>H.supportedSwapkitProviders?.includes(j)),G=z||q;if(!G)throw new Y("core_plugin_not_found");return G}function v(j){let z=J(j.chain),q=j?.balance||z?.balance||[_.from({chain:j.chain})],G={...z,...j,balance:q};return k[j.chain]=G,G}function T({pluginName:j,route:z,useDirectSigning:q}){return y(qj({pluginName:j,providers:z.providers,useDirectSigning:q}))}function V({assetValue:j,plugin:z,route:q,spenderAddress:G,type:H}){if(H===R.CheckOnly&&"isAssetValueApproved"in z)return z.isAssetValueApproved({assetValue:j,route:q,spenderAddress:G});if(H===R.Approve&&"approveAssetValue"in z)return z.approveAssetValue({assetValue:j,route:q,spenderAddress:G});throw new Y({errorKey:"core_approve_asset_target_invalid",info:{message:`Target ${String(G??q?.providers[0])} cannot be used for approve operation`}})}function b({assetValue:j,type:z="checkOnly",contractAddress:q,route:G}){let H=j??(G?zj(G):void 0);if(!H)throw new Y("core_approve_asset_target_invalid");let L=q??G?.meta.approvalAddress,D=G?T({route:G,useDirectSigning:Boolean(J(H.chain)?.supportsDirectSigning)}):L&&B[L];if(D)return V({assetValue:H,plugin:D,route:G,spenderAddress:L,type:z});let P=H.chain,$=S.includes(P);if($&&H.isGasAsset||!$||H.isSynthetic)return Promise.resolve(z==="checkOnly"?!0:"approved");let Z=J(P),O=z==="checkOnly"?Z.isApproved:Z.approve;if(!O)throw new Y("core_wallet_connection_not_found");if(!(H.address&&Z.address&&typeof L==="string"))throw new Y("core_approve_asset_address_or_from_not_found");return O({amount:H.getBaseValue("bigint"),assetAddress:H.address,from:Z.address,spenderAddress:L})}function J(j){return k[j]}function W(){return{...k}}function A(j){return J(j)?.address||""}function w(j,z){return j instanceof _?b({assetValue:j,contractAddress:z,type:R.Approve}):b({route:j,type:R.Approve})}function m(j,z){return j instanceof _?b({assetValue:j,contractAddress:z,type:R.CheckOnly}):b({route:j,type:R.CheckOnly})}function K(j){J(j)?.disconnect?.(),delete k[j]}function h(){for(let j of Object.keys(k))K(j)}function d(j,z){return z?N(j).then(({balance:q})=>q):J(j)?.balance||[]}async function N(j,z=!0){let q=J(j);if(!q)throw new Y("core_wallet_connection_not_found");let G=await q.getBalance?.(q.address,z);return q.balance=G||[_.from({chain:j})],q}function g({route:j,pluginName:z,...q}){let G=_.from({asset:j.sellAsset}).chain,H=J(G);if(!H)throw new Y("core_wallet_connection_not_found");let L=T({pluginName:z,route:j,useDirectSigning:Boolean(H.supportsDirectSigning&&j.tx)});if("swap"in L)return L.swap({...q,route:j});throw new Y("core_plugin_swap_not_found")}function u({assetValue:j,...z}){let q=j.chain;if([U.Radix].includes(q)||!J(q))throw new Y("core_wallet_connection_not_found");return J(q).transfer({...z,assetValue:j})}function c({chain:j,message:z}){let q=J(j);if(!q)throw new Y("core_wallet_connection_not_found");if("signMessage"in q)return q.signMessage?.(z);throw new Y({errorKey:"core_wallet_sign_message_not_supported",info:{chain:j,wallet:q.walletType}})}function o({chain:j,domain:z,primaryType:q,types:G,value:H}){let L=J(j);if(!L)throw new Y("core_wallet_connection_not_found");if("signTypedData"in L&&typeof L.signTypedData==="function")return L.signTypedData({domain:z,primaryType:q,types:G,value:H});throw new Y({errorKey:"core_wallet_sign_typed_data_not_supported",info:{chain:j,wallet:L.walletType}})}async function p({address:j,chain:z,message:q,signature:G}){if(z!==U.THORChain)throw new Y({errorKey:"core_verify_message_not_supported",info:{chain:z}});let{getCosmosToolbox:H}=await import("@swapkit/toolboxes/cosmos");return H(z).verifySignature({address:j,message:q,signature:G})}async function i({type:j,feeOptionKey:z,params:q}){let{assetValue:G}=q,{chain:H}=G;if(!J(H))throw new Y("core_wallet_connection_not_found");let L=_.from({chain:H}),{match:D}=await import("ts-pattern");return await D(H).returnType().with(...S,($)=>{let{address:I,...Z}=J($),O=D(j).with("transfer",()=>Z.createTransferTx(q)).with("approve",(r)=>{let{contractAddress:M}=q;return Z.createApprovalTx({amount:G.getBaseValue("bigint"),assetAddress:G.address,from:I,spenderAddress:M})}).with("swap",(r)=>{let{route:{providers:[M],tx:s}}=q;if(M&&[x.CHAINFLIP,x.CHAINFLIP_STREAMING].includes(M))return Z.createTransferTx({assetValue:G,recipient:I,sender:I});let C=s;return{...C,value:e(C.value)}}).otherwise(()=>{return});if(!O)return L;return Z.estimateTransactionFee({...O,feeOption:z})}).with(...l,async()=>{let{estimateTransactionFee:$}=await import("@swapkit/toolboxes/cosmos");return $(q)}).with(...a,($)=>{let{address:I,...Z}=J($);return Z.estimateTransactionFee({...q,feeOptionKey:z,recipient:I,sender:I})}).with(U.Tron,U.Ton,U.Polkadot,($)=>{let{address:I,...Z}=J($);return Z.estimateTransactionFee({...q,recipient:I,sender:I})}).with(U.Aptos,U.Cardano,U.Ripple,U.Stellar,U.Sui,($)=>J($).estimateTransactionFee()).otherwise(()=>L)}async function n({address:j,chain:z}){try{let{getAddressValidator:q}=await import("@swapkit/toolboxes");return(await q())({address:j,chain:z})}catch{return!1}}return{...B,...E,approveAssetValue:w,disconnectAll:h,disconnectChain:K,estimateTransactionFee:i,getAddress:A,getAllWallets:W,getBalance:d,getWallet:J,getWalletWithBalance:N,isAssetValueApproved:m,signMessage:c,signTypedData:o,swap:g,transfer:u,validateAddress:n,verifyMessage:p}}export{qj as resolveRoutePluginName,zj as getRouteApprovalAssetValue,Lj as SwapKit};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetValue, Chain, type ChainWallet, type ConditionalAssetValueReturn, type FeeOption, type GenericTransferParams, type SKConfigState, type SwapParams } from "@swapkit/helpers";
|
|
1
|
+
import { AssetValue, Chain, type ChainWallet, type ConditionalAssetValueReturn, type FeeOption, type GenericTransferParams, ProviderName as PluginNameEnum, type SKConfigState, type SwapParams } from "@swapkit/helpers";
|
|
2
2
|
import { type QuoteResponseRoute, type SwapRouteV2Response } from "@swapkit/helpers/api";
|
|
3
3
|
import type { createPlugin } from "@swapkit/plugins";
|
|
4
4
|
import type { FullWallet } from "@swapkit/toolboxes";
|
|
@@ -10,12 +10,18 @@ export type SwapKitParams<P, W> = {
|
|
|
10
10
|
wallets?: W;
|
|
11
11
|
};
|
|
12
12
|
type SwapRoute = QuoteResponseRoute | SwapRouteV2Response;
|
|
13
|
+
export declare function resolveRoutePluginName({ pluginName, providers, useDirectSigning, }: {
|
|
14
|
+
pluginName?: string;
|
|
15
|
+
providers: readonly PluginNameEnum[];
|
|
16
|
+
useDirectSigning: boolean;
|
|
17
|
+
}): string | undefined;
|
|
18
|
+
export declare function getRouteApprovalAssetValue(route: SwapRoute): AssetValue;
|
|
13
19
|
export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>, Wallets extends ReturnType<typeof createWallet>>({ config, plugins, wallets }?: {
|
|
14
20
|
config?: SKConfigState;
|
|
15
21
|
plugins?: Plugins;
|
|
16
22
|
wallets?: Wallets;
|
|
17
23
|
}): (keyof Plugins extends infer T extends keyof Plugins ? { [key in T]: ReturnType<Plugins[key]>; } : never) & { [key_1 in keyof Wallets]: ReturnType<Wallets[key_1]["connectWallet"]>; } & {
|
|
18
|
-
approveAssetValue: (
|
|
24
|
+
approveAssetValue: (target: AssetValue | SwapRoute, contractAddress?: string | keyof Plugins) => Promise<string>;
|
|
19
25
|
disconnectAll: () => void;
|
|
20
26
|
disconnectChain: <T_1 extends Chain>(chain: T_1) => void;
|
|
21
27
|
estimateTransactionFee: <P extends keyof Plugins, T_1 extends "swap" | "transfer" | "approve">({ type, feeOptionKey, params, }: {
|
|
@@ -4930,6 +4936,10 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
4930
4936
|
estimateTransactionFee: () => Promise<AssetValue>;
|
|
4931
4937
|
getAddress: () => Promise<string>;
|
|
4932
4938
|
getBalance: (checkAddress?: string) => Promise<AssetValue[]>;
|
|
4939
|
+
hasTrustline: ({ address, assetValue }: {
|
|
4940
|
+
address: string;
|
|
4941
|
+
assetValue: AssetValue;
|
|
4942
|
+
}) => Promise<boolean>;
|
|
4933
4943
|
signAndBroadcastTransaction: (transaction: {
|
|
4934
4944
|
toXDR: () => string;
|
|
4935
4945
|
}) => Promise<string>;
|
|
@@ -5491,7 +5501,7 @@ export declare function SwapKit<Plugins extends ReturnType<typeof createPlugin>,
|
|
|
5491
5501
|
getBalance: <T_1 extends Chain, R extends boolean>(chain: T_1, refresh?: R) => ConditionalAssetValueReturn<R>;
|
|
5492
5502
|
getWallet: <T_1 extends Chain>(chain: T_1) => FullWallet[T_1];
|
|
5493
5503
|
getWalletWithBalance: <T_1 extends Chain>(chain: T_1, scamFilter?: boolean) => Promise<FullWallet[T_1]>;
|
|
5494
|
-
isAssetValueApproved: (
|
|
5504
|
+
isAssetValueApproved: (target: AssetValue | SwapRoute, contractAddress?: string | keyof Plugins) => Promise<boolean>;
|
|
5495
5505
|
signMessage: ({ chain, message }: {
|
|
5496
5506
|
chain: Chain;
|
|
5497
5507
|
message: string;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-dev",
|
|
3
3
|
"dependencies": {
|
|
4
|
-
"@swapkit/helpers": "4.
|
|
5
|
-
"@swapkit/plugins": "4.
|
|
6
|
-
"@swapkit/toolboxes": "4.
|
|
7
|
-
"@swapkit/wallet-core": "4.3.
|
|
4
|
+
"@swapkit/helpers": "4.19.0",
|
|
5
|
+
"@swapkit/plugins": "4.7.0",
|
|
6
|
+
"@swapkit/toolboxes": "4.26.0",
|
|
7
|
+
"@swapkit/wallet-core": "4.3.18"
|
|
8
8
|
},
|
|
9
9
|
"description": "SwapKit - Core",
|
|
10
10
|
"devDependencies": {
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"type-check:go": "tsgo"
|
|
37
37
|
},
|
|
38
38
|
"type": "module",
|
|
39
|
-
"version": "4.
|
|
39
|
+
"version": "4.6.0"
|
|
40
40
|
}
|