@swapkit/wallet-core 4.1.28 → 4.2.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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/types/index.d.ts +5 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var{defineProperty:p,getOwnPropertyNames:
|
|
1
|
+
var{defineProperty:p,getOwnPropertyNames:d,getOwnPropertyDescriptor:u}=Object,y=Object.prototype.hasOwnProperty;function h(e){return this[e]}var C=(e)=>{var n=(o??=new WeakMap).get(e),t;if(n)return n;if(n=p({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var a of d(e))if(!y.call(n,a))p(n,a,{get:h.bind(e,a),enumerable:!(t=u(e,a))||t.enumerable})}return o.set(e,n),n},o;var S=(e)=>e;function g(e,n){this[e]=S.bind(null,n)}var T=(e,n)=>{for(var t in n)p(e,t,{get:n[t],enumerable:!0,configurable:!0,set:g.bind(n,t)})};var f={};T(f,{getWalletSupportedChains:()=>m,createWallet:()=>W});module.exports=C(f);function W({connect:e,directSigningSupport:n,name:t,supportedChains:a,walletType:s}){let i=n??{};function l({addChain:c}){return e({addChain:(r)=>c({supportsDirectSigning:i[r.chain]??!1,...r}),supportedChains:a,walletType:s})}return{[t]:{connectWallet:l,directSigningSupport:i,supportedChains:a}}}function m(e){let n=Object.keys(e)?.[0]||"";return e?.[n]?.supportedChains||[]}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function l({connect:e,directSigningSupport:n,name:i,supportedChains:t,walletType:r}){let a=n??{};function o({addChain:s}){return e({addChain:(p)=>s({supportsDirectSigning:a[p.chain]??!1,...p}),supportedChains:t,walletType:r})}return{[i]:{connectWallet:o,directSigningSupport:a,supportedChains:t}}}function c(e){let n=Object.keys(e)?.[0]||"";return e?.[n]?.supportedChains||[]}export{c as getWalletSupportedChains,l as createWallet};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { AddChainType, Chain, WalletOption } from "@swapkit/helpers";
|
|
2
|
-
export
|
|
2
|
+
export type DirectSigningSupport = Partial<Record<Chain, boolean>>;
|
|
3
|
+
export declare function createWallet<ConnectParams extends any[], SupportedChains extends Chain[], const Name extends string, WalletType extends WalletOption>({ connect, directSigningSupport, name, supportedChains, walletType, }: {
|
|
3
4
|
connect: (connectParams: {
|
|
4
5
|
addChain: AddChainType;
|
|
5
6
|
walletType: WalletType;
|
|
6
7
|
supportedChains: SupportedChains;
|
|
7
8
|
}) => (...params: ConnectParams) => Promise<boolean>;
|
|
9
|
+
directSigningSupport?: DirectSigningSupport;
|
|
8
10
|
name: Name;
|
|
9
11
|
supportedChains: SupportedChains;
|
|
10
12
|
walletType?: WalletType | string;
|
|
11
13
|
}): { [key in Name]: {
|
|
12
|
-
connectWallet: (
|
|
14
|
+
connectWallet: ({ addChain }: {
|
|
13
15
|
addChain: AddChainType;
|
|
14
16
|
}) => (...params: ConnectParams) => Promise<boolean>;
|
|
17
|
+
directSigningSupport: DirectSigningSupport;
|
|
15
18
|
supportedChains: SupportedChains;
|
|
16
19
|
}; };
|
|
17
20
|
export declare function getWalletSupportedChains<T extends ReturnType<typeof createWallet<any, any, any, any>>>(wallet: T): T[keyof T]["supportedChains"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE1E,wBAAgB,YAAY,CAC1B,aAAa,SAAS,GAAG,EAAE,EAC3B,eAAe,SAAS,KAAK,EAAE,EAC/B,KAAK,CAAC,IAAI,SAAS,MAAM,EACzB,UAAU,SAAS,YAAY,EAC/B,EACA,OA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IACb,aAAa,iBAboB;QAAE,QAAQ,EAAE,YAAY,CAAA;KAAE,iBAR7C,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAqBZ;IACpC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,eAAe,EAAE,eAAe,CAAC;CAClC,GACF,CACF;AAED,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EACpG,MAAM,EAAE,CAAC,GACR,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAG/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-dev",
|
|
3
|
-
"dependencies": { "@swapkit/helpers": "4.
|
|
3
|
+
"dependencies": { "@swapkit/helpers": "4.13.0" },
|
|
4
4
|
"description": "SwapKit - Wallet Core",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": { "import": "./dist/index.js", "require": "./dist/index.cjs", "types": "./dist/types/index.d.ts" }
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"type-check:go": "tsgo"
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
|
-
"version": "4.
|
|
26
|
+
"version": "4.2.0"
|
|
27
27
|
}
|