@swapkit/wallet-keystore 4.0.25 → 4.0.26
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 +2 -2
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var D=Object.create;var{getPrototypeOf:E,defineProperty:m,getOwnPropertyNames:v,getOwnPropertyDescriptor:A}=Object,b=Object.prototype.hasOwnProperty;var y=(t,e,n)=>{n=t!=null?D(E(t)):{};let a=e||!t||!t.__esModule?m(n,"default",{value:t,enumerable:!0}):n;for(let o of v(t))if(!b.call(a,o))m(a,o,{get:()=>t[o],enumerable:!0});return a},w=new WeakMap,_=(t)=>{var e=w.get(t),n;if(e)return e;if(e=m({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function")v(t).map((a)=>!b.call(e,a)&&m(e,a,{get:()=>t[a],enumerable:!(n=A(t,a))||n.enumerable}));return w.set(t,e),e};var R=(t,e)=>{for(var n in e)m(t,n,{get:e[n],enumerable:!0,configurable:!0,set:(a)=>e[n]=()=>a})};var j={};R(j,{validatePhrase:()=>F,keystoreWallet:()=>S,generatePhrase:()=>W,encryptToKeyStore:()=>U,decryptFromKeystore:()=>N,KEYSTORE_SUPPORTED_CHAINS:()=>Y});module.exports=_(j);var r=require("@swapkit/helpers"),d=require("@swapkit/wallet-core");var c=require("node:crypto"),u=require("@scure/bip39"),g=require("@scure/bip39/wordlists/english");async function k(t){let{blake2bFinal:e,blake2bInit:n,blake2bUpdate:a}=(await import("blakejs")).default,o=t;if(!(o instanceof Buffer))o=Buffer.from(o,"hex");let s=n(32);return a(s,o),Array.from(e(s)).map((i)=>i<16?`0${i.toString(16)}`:i.toString(16)).join("")}async function U(t,e){let a=c.randomBytes(16),o=c.randomBytes(32),s={c:262144,dklen:32,prf:"hmac-sha256",salt:o.toString("hex")},i=c.pbkdf2Sync(e,o,s.c,s.dklen,"sha256"),f=c.createCipheriv("aes-128-ctr",i.subarray(0,16),a),p=Buffer.concat([f.update(Buffer.from(t,"utf8")),f.final()]),l=Buffer.concat([i.subarray(16,32),Buffer.from(p)]),h=await k(l);return{crypto:{cipher:"aes-128-ctr",cipherparams:{iv:a.toString("hex")},ciphertext:p.toString("hex"),kdf:"pbkdf2",kdfparams:s,mac:h},meta:"xchain-keystore",version:1}}function W(t=12){return u.generateMnemonic(g.wordlist,t===12?128:256)}function F(t){return u.validateMnemonic(t,g.wordlist)}async function N(t,e){let{SwapKitError:n}=await import("@swapkit/helpers");switch(t.version){case 1:{let a=t.crypto.kdfparams,o=Buffer.from(a.salt,"hex"),s=c.pbkdf2Sync(e,o,a.c,a.dklen,"sha256"),i=Buffer.from(t.crypto.ciphertext,"hex"),f=Buffer.concat([s.subarray(16,32),i]);if(await k(f)!==t.crypto.mac)throw new n("wallet_keystore_invalid_password");let l=c.createDecipheriv(t.crypto.cipher,s.subarray(0,16),Buffer.from(t.crypto.cipherparams.iv,"hex"));return Buffer.concat([l.update(i),l.final()]).toString("utf8")}default:throw new n("wallet_keystore_unsupported_version")}}var S=d.createWallet({connect:({addChain:t,supportedChains:e,walletType:n})=>async function(o,s,i){let f=r.filterSupportedChains({chains:o,supportedChains:e,walletType:n});return await Promise.all(f.map(async(p)=>{let l=typeof i==="number"?i:0,h=i&&typeof i==="object"?i[p]:void 0,C=r.NetworkDerivationPath[p].slice(0,p===r.Chain.Solana?4:5),B=h||r.updateDerivationPath(C,{index:l}),{getToolbox:P}=await import("@swapkit/toolboxes"),x=await P(p,{derivationPath:B,phrase:s}),K=await x.getAddress()||"",T={...x,address:K};t({...T,chain:p,walletType:r.WalletOption.KEYSTORE})})),!0},name:"connectKeystore",supportedChains:[...r.EVMChains,...r.UTXOChains,...r.CosmosChains,r.Chain.Polkadot,r.Chain.Chainflip,r.Chain.Ripple,r.Chain.Solana,r.Chain.Tron,r.Chain.Near],walletType:r.WalletOption.KEYSTORE}),Y=d.getWalletSupportedChains(S);
|
|
1
|
+
var D=Object.create;var{getPrototypeOf:E,defineProperty:m,getOwnPropertyNames:v,getOwnPropertyDescriptor:A}=Object,b=Object.prototype.hasOwnProperty;var y=(t,e,n)=>{n=t!=null?D(E(t)):{};let a=e||!t||!t.__esModule?m(n,"default",{value:t,enumerable:!0}):n;for(let o of v(t))if(!b.call(a,o))m(a,o,{get:()=>t[o],enumerable:!0});return a},w=new WeakMap,_=(t)=>{var e=w.get(t),n;if(e)return e;if(e=m({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function")v(t).map((a)=>!b.call(e,a)&&m(e,a,{get:()=>t[a],enumerable:!(n=A(t,a))||n.enumerable}));return w.set(t,e),e};var R=(t,e)=>{for(var n in e)m(t,n,{get:e[n],enumerable:!0,configurable:!0,set:(a)=>e[n]=()=>a})};var j={};R(j,{validatePhrase:()=>F,keystoreWallet:()=>S,generatePhrase:()=>W,encryptToKeyStore:()=>U,decryptFromKeystore:()=>N,KEYSTORE_SUPPORTED_CHAINS:()=>Y});module.exports=_(j);var r=require("@swapkit/helpers"),d=require("@swapkit/wallet-core");var c=require("node:crypto"),u=require("@scure/bip39"),g=require("@scure/bip39/wordlists/english");async function k(t){let{blake2bFinal:e,blake2bInit:n,blake2bUpdate:a}=(await import("blakejs")).default,o=t;if(!(o instanceof Buffer))o=Buffer.from(o,"hex");let s=n(32);return a(s,o),Array.from(e(s)).map((i)=>i<16?`0${i.toString(16)}`:i.toString(16)).join("")}async function U(t,e){let a=c.randomBytes(16),o=c.randomBytes(32),s={c:262144,dklen:32,prf:"hmac-sha256",salt:o.toString("hex")},i=c.pbkdf2Sync(e,o,s.c,s.dklen,"sha256"),f=c.createCipheriv("aes-128-ctr",i.subarray(0,16),a),p=Buffer.concat([f.update(Buffer.from(t,"utf8")),f.final()]),l=Buffer.concat([i.subarray(16,32),Buffer.from(p)]),h=await k(l);return{crypto:{cipher:"aes-128-ctr",cipherparams:{iv:a.toString("hex")},ciphertext:p.toString("hex"),kdf:"pbkdf2",kdfparams:s,mac:h},meta:"xchain-keystore",version:1}}function W(t=12){return u.generateMnemonic(g.wordlist,t===12?128:256)}function F(t){return u.validateMnemonic(t,g.wordlist)}async function N(t,e){let{SwapKitError:n}=await import("@swapkit/helpers");switch(t.version){case 1:{let a=t.crypto.kdfparams,o=Buffer.from(a.salt,"hex"),s=c.pbkdf2Sync(e,o,a.c,a.dklen,"sha256"),i=Buffer.from(t.crypto.ciphertext,"hex"),f=Buffer.concat([s.subarray(16,32),i]);if(await k(f)!==t.crypto.mac)throw new n("wallet_keystore_invalid_password");let l=c.createDecipheriv(t.crypto.cipher,s.subarray(0,16),Buffer.from(t.crypto.cipherparams.iv,"hex"));return Buffer.concat([l.update(i),l.final()]).toString("utf8")}default:throw new n("wallet_keystore_unsupported_version")}}var S=d.createWallet({connect:({addChain:t,supportedChains:e,walletType:n})=>async function(o,s,i){let f=r.filterSupportedChains({chains:o,supportedChains:e,walletType:n});return await Promise.all(f.map(async(p)=>{let l=typeof i==="number"?i:0,h=i&&typeof i==="object"?i[p]:void 0,C=r.NetworkDerivationPath[p].slice(0,p===r.Chain.Solana?4:5),B=h||r.updateDerivationPath(C,{index:l}),{getToolbox:P}=await import("@swapkit/toolboxes"),x=await P(p,{derivationPath:B,phrase:s}),K=await x.getAddress()||"",T={...x,address:K};t({...T,chain:p,walletType:r.WalletOption.KEYSTORE})})),!0},name:"connectKeystore",supportedChains:[...r.EVMChains,...r.UTXOChains,...r.CosmosChains.filter((t)=>t!==r.Chain.Harbor),r.Chain.Polkadot,r.Chain.Chainflip,r.Chain.Ripple,r.Chain.Solana,r.Chain.Tron,r.Chain.Near],walletType:r.WalletOption.KEYSTORE}),Y=d.getWalletSupportedChains(S);
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=CA68086B2F87B43864756E2164756E21
|
|
4
4
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/helpers.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import {\n Chain,\n CosmosChains,\n type DerivationPathArray,\n EVMChains,\n filterSupportedChains,\n NetworkDerivationPath,\n UTXOChains,\n updateDerivationPath,\n WalletOption,\n} from \"@swapkit/helpers\";\nimport { createWallet, getWalletSupportedChains } from \"@swapkit/wallet-core\";\n\nexport const keystoreWallet = createWallet({\n connect: ({ addChain, supportedChains, walletType }) =>\n async function connectKeystore(\n chains: Chain[],\n phrase: string,\n derivationPathMapOrIndex?: { [chain in Chain]?: DerivationPathArray } | number,\n ) {\n const filteredChains = filterSupportedChains({ chains, supportedChains, walletType });\n\n await Promise.all(\n filteredChains.map(async (chain) => {\n const derivationPathIndex = typeof derivationPathMapOrIndex === \"number\" ? derivationPathMapOrIndex : 0;\n\n const derivationPathFromMap =\n derivationPathMapOrIndex && typeof derivationPathMapOrIndex === \"object\"\n ? derivationPathMapOrIndex[chain]\n : undefined;\n\n const derivationArrayToUpdate = NetworkDerivationPath[chain].slice(\n 0,\n chain === Chain.Solana ? 4 : 5,\n ) as DerivationPathArray;\n\n const derivationPath: DerivationPathArray =\n derivationPathFromMap || updateDerivationPath(derivationArrayToUpdate, { index: derivationPathIndex });\n\n const { getToolbox } = await import(\"@swapkit/toolboxes\");\n\n const toolbox = await getToolbox(chain, { derivationPath, phrase });\n const address = (await toolbox.getAddress()) || \"\";\n\n const wallet = { ...toolbox, address };\n\n addChain({ ...wallet, chain, walletType: WalletOption.KEYSTORE });\n }),\n );\n\n return true;\n },\n name: \"connectKeystore\",\n supportedChains: [\n ...EVMChains,\n ...UTXOChains,\n ...CosmosChains,\n Chain.Polkadot,\n Chain.Chainflip,\n Chain.Ripple,\n Chain.Solana,\n Chain.Tron,\n Chain.Near,\n ],\n walletType: WalletOption.KEYSTORE,\n});\n\nexport const KEYSTORE_SUPPORTED_CHAINS = getWalletSupportedChains(keystoreWallet);\n\nexport * from \"./helpers\";\n",
|
|
5
|
+
"import {\n Chain,\n CosmosChains,\n type DerivationPathArray,\n EVMChains,\n filterSupportedChains,\n NetworkDerivationPath,\n UTXOChains,\n updateDerivationPath,\n WalletOption,\n} from \"@swapkit/helpers\";\nimport { createWallet, getWalletSupportedChains } from \"@swapkit/wallet-core\";\n\nexport const keystoreWallet = createWallet({\n connect: ({ addChain, supportedChains, walletType }) =>\n async function connectKeystore(\n chains: Chain[],\n phrase: string,\n derivationPathMapOrIndex?: { [chain in Chain]?: DerivationPathArray } | number,\n ) {\n const filteredChains = filterSupportedChains({ chains, supportedChains, walletType });\n\n await Promise.all(\n filteredChains.map(async (chain) => {\n const derivationPathIndex = typeof derivationPathMapOrIndex === \"number\" ? derivationPathMapOrIndex : 0;\n\n const derivationPathFromMap =\n derivationPathMapOrIndex && typeof derivationPathMapOrIndex === \"object\"\n ? derivationPathMapOrIndex[chain]\n : undefined;\n\n const derivationArrayToUpdate = NetworkDerivationPath[chain].slice(\n 0,\n chain === Chain.Solana ? 4 : 5,\n ) as DerivationPathArray;\n\n const derivationPath: DerivationPathArray =\n derivationPathFromMap || updateDerivationPath(derivationArrayToUpdate, { index: derivationPathIndex });\n\n const { getToolbox } = await import(\"@swapkit/toolboxes\");\n\n const toolbox = await getToolbox(chain, { derivationPath, phrase });\n const address = (await toolbox.getAddress()) || \"\";\n\n const wallet = { ...toolbox, address };\n\n addChain({ ...wallet, chain, walletType: WalletOption.KEYSTORE });\n }),\n );\n\n return true;\n },\n name: \"connectKeystore\",\n supportedChains: [\n ...EVMChains,\n ...UTXOChains,\n ...CosmosChains.filter((chain) => chain !== Chain.Harbor),\n Chain.Polkadot,\n Chain.Chainflip,\n Chain.Ripple,\n Chain.Solana,\n Chain.Tron,\n Chain.Near,\n ],\n walletType: WalletOption.KEYSTORE,\n});\n\nexport const KEYSTORE_SUPPORTED_CHAINS = getWalletSupportedChains(keystoreWallet);\n\nexport * from \"./helpers\";\n",
|
|
6
6
|
"import { createCipheriv, createDecipheriv, pbkdf2Sync, randomBytes } from \"node:crypto\";\nimport { generateMnemonic, validateMnemonic } from \"@scure/bip39\";\nimport { wordlist } from \"@scure/bip39/wordlists/english\";\n\nexport type Keystore = {\n version: number;\n meta: string;\n crypto: {\n cipher: string;\n cipherparams: { iv: string };\n ciphertext: string;\n kdf: string;\n kdfparams: { prf: string; dklen: number; salt: string; c: number };\n mac: string;\n };\n};\n\nasync function blake256(initData: Buffer | string) {\n const { blake2bFinal, blake2bInit, blake2bUpdate } = (await import(\"blakejs\")).default;\n let data = initData;\n\n if (!(data instanceof Buffer)) {\n // @ts-expect-error\n data = Buffer.from(data, \"hex\");\n }\n\n const context = blake2bInit(32);\n blake2bUpdate(context, data);\n\n return Array.from(blake2bFinal(context))\n .map((byte) => (byte < 0x10 ? `0${byte.toString(16)}` : byte.toString(16)))\n .join(\"\");\n}\n\nexport async function encryptToKeyStore(phrase: string, password: string) {\n const cipher = \"aes-128-ctr\";\n const iv = randomBytes(16);\n const salt = randomBytes(32);\n const kdfParams = { c: 262144, dklen: 32, prf: \"hmac-sha256\", salt: salt.toString(\"hex\") };\n\n const derivedKey = pbkdf2Sync(password, salt, kdfParams.c, kdfParams.dklen, \"sha256\");\n const cipherIV = createCipheriv(cipher, derivedKey.subarray(0, 16), iv);\n const ciphertext = Buffer.concat([cipherIV.update(Buffer.from(phrase, \"utf8\")), cipherIV.final()]);\n const initData = Buffer.concat([derivedKey.subarray(16, 32), Buffer.from(ciphertext)]);\n const mac = await blake256(initData);\n\n return {\n crypto: {\n cipher,\n cipherparams: { iv: iv.toString(\"hex\") },\n ciphertext: ciphertext.toString(\"hex\"),\n kdf: \"pbkdf2\",\n kdfparams: kdfParams,\n mac,\n },\n meta: \"xchain-keystore\",\n version: 1,\n };\n}\n\nexport function generatePhrase(size: 12 | 24 = 12) {\n return generateMnemonic(wordlist, size === 12 ? 128 : 256);\n}\n\nexport function validatePhrase(phrase: string) {\n return validateMnemonic(phrase, wordlist);\n}\n\nexport async function decryptFromKeystore(keystore: Keystore, password: string) {\n const { SwapKitError } = await import(\"@swapkit/helpers\");\n\n switch (keystore.version) {\n case 1: {\n const kdfParams = keystore.crypto.kdfparams;\n const salt = Buffer.from(kdfParams.salt, \"hex\");\n const derivedKey = pbkdf2Sync(password, salt, kdfParams.c, kdfParams.dklen, \"sha256\");\n\n const ciphertext = Buffer.from(keystore.crypto.ciphertext, \"hex\");\n const initData = Buffer.concat([derivedKey.subarray(16, 32), ciphertext]);\n const mac = await blake256(initData);\n\n if (mac !== keystore.crypto.mac) {\n throw new SwapKitError(\"wallet_keystore_invalid_password\");\n }\n\n const decipher = createDecipheriv(\n keystore.crypto.cipher,\n derivedKey.subarray(0, 16),\n Buffer.from(keystore.crypto.cipherparams.iv, \"hex\"),\n );\n\n const phrase = Buffer.concat([decipher.update(ciphertext), decipher.final()]);\n return phrase.toString(\"utf8\");\n }\n\n default:\n throw new SwapKitError(\"wallet_keystore_unsupported_version\");\n }\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "w1BAUO,IAVP,8BAWA,kCCX0E,IAA1E,yBACA,0BACA,4CAeA,eAAe,CAAQ,CAAC,EAA2B,CACjD,IAAQ,eAAc,cAAa,kBAAmB,KAAa,oBAAY,QAC3E,EAAO,EAEX,GAAI,EAAE,aAAgB,QAEpB,EAAO,OAAO,KAAK,EAAM,KAAK,EAGhC,IAAM,EAAU,EAAY,EAAE,EAG9B,OAFA,EAAc,EAAS,CAAI,EAEpB,MAAM,KAAK,EAAa,CAAO,CAAC,EACpC,IAAI,CAAC,IAAU,EAAO,GAAO,IAAI,EAAK,SAAS,EAAE,IAAM,EAAK,SAAS,EAAE,CAAE,EACzE,KAAK,EAAE,EAGZ,eAAsB,CAAiB,CAAC,EAAgB,EAAkB,CAExE,IAAM,EAAK,cAAY,EAAE,EACnB,EAAO,cAA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GAAG,YACH,GAAG,aACH,GAAG,eAAa,OAAO,CAAC,IAAU,IAAU,QAAM,MAAM,EACxD,QAAM,SACN,QAAM,UACN,QAAM,OACN,QAAM,OACN,QAAM,KACN,QAAM,IACR,EACA,WAAY,eAAa,QAC3B,CAAC,EAEY,EAA4B,2BAAyB,CAAc",
|
|
9
|
+
"debugId": "CA68086B2F87B43864756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var P=Object.create;var{getPrototypeOf:K,defineProperty:d,getOwnPropertyNames:T}=Object;var D=Object.prototype.hasOwnProperty;var m=(t,o,a)=>{a=t!=null?P(K(t)):{};let n=o||!t||!t.__esModule?d(a,"default",{value:t,enumerable:!0}):a;for(let r of T(t))if(!D.call(n,r))d(n,r,{get:()=>t[r],enumerable:!0});return n};var h=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,a)=>(typeof require<"u"?require:o)[a]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});import{Chain as c,CosmosChains as U,EVMChains as W,filterSupportedChains as F,NetworkDerivationPath as N,UTXOChains as Y,updateDerivationPath as j,WalletOption as v}from"@swapkit/helpers";import{createWallet as
|
|
1
|
+
var P=Object.create;var{getPrototypeOf:K,defineProperty:d,getOwnPropertyNames:T}=Object;var D=Object.prototype.hasOwnProperty;var m=(t,o,a)=>{a=t!=null?P(K(t)):{};let n=o||!t||!t.__esModule?d(a,"default",{value:t,enumerable:!0}):a;for(let r of T(t))if(!D.call(n,r))d(n,r,{get:()=>t[r],enumerable:!0});return n};var h=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(o,a)=>(typeof require<"u"?require:o)[a]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});import{Chain as c,CosmosChains as U,EVMChains as W,filterSupportedChains as F,NetworkDerivationPath as N,UTXOChains as Y,updateDerivationPath as j,WalletOption as v}from"@swapkit/helpers";import{createWallet as H,getWalletSupportedChains as O}from"@swapkit/wallet-core";import{createCipheriv as E,createDecipheriv as A,pbkdf2Sync as g,randomBytes as y}from"node:crypto";import{generateMnemonic as _,validateMnemonic as R}from"@scure/bip39";import{wordlist as x}from"@scure/bip39/wordlists/english";async function w(t){let{blake2bFinal:o,blake2bInit:a,blake2bUpdate:n}=(await import("blakejs")).default,r=t;if(!(r instanceof Buffer))r=Buffer.from(r,"hex");let i=a(32);return n(i,r),Array.from(o(i)).map((e)=>e<16?`0${e.toString(16)}`:e.toString(16)).join("")}async function G(t,o){let n=y(16),r=y(32),i={c:262144,dklen:32,prf:"hmac-sha256",salt:r.toString("hex")},e=g(o,r,i.c,i.dklen,"sha256"),p=E("aes-128-ctr",e.subarray(0,16),n),s=Buffer.concat([p.update(Buffer.from(t,"utf8")),p.final()]),f=Buffer.concat([e.subarray(16,32),Buffer.from(s)]),l=await w(f);return{crypto:{cipher:"aes-128-ctr",cipherparams:{iv:n.toString("hex")},ciphertext:s.toString("hex"),kdf:"pbkdf2",kdfparams:i,mac:l},meta:"xchain-keystore",version:1}}function I(t=12){return _(x,t===12?128:256)}function J(t){return R(t,x)}async function L(t,o){let{SwapKitError:a}=await import("@swapkit/helpers");switch(t.version){case 1:{let n=t.crypto.kdfparams,r=Buffer.from(n.salt,"hex"),i=g(o,r,n.c,n.dklen,"sha256"),e=Buffer.from(t.crypto.ciphertext,"hex"),p=Buffer.concat([i.subarray(16,32),e]);if(await w(p)!==t.crypto.mac)throw new a("wallet_keystore_invalid_password");let f=A(t.crypto.cipher,i.subarray(0,16),Buffer.from(t.crypto.cipherparams.iv,"hex"));return Buffer.concat([f.update(e),f.final()]).toString("utf8")}default:throw new a("wallet_keystore_unsupported_version")}}var V=H({connect:({addChain:t,supportedChains:o,walletType:a})=>async function(r,i,e){let p=F({chains:r,supportedChains:o,walletType:a});return await Promise.all(p.map(async(s)=>{let f=typeof e==="number"?e:0,l=e&&typeof e==="object"?e[s]:void 0,b=N[s].slice(0,s===c.Solana?4:5),k=l||j(b,{index:f}),{getToolbox:S}=await import("@swapkit/toolboxes"),u=await S(s,{derivationPath:k,phrase:i}),C=await u.getAddress()||"",B={...u,address:C};t({...B,chain:s,walletType:v.KEYSTORE})})),!0},name:"connectKeystore",supportedChains:[...W,...Y,...U.filter((t)=>t!==c.Harbor),c.Polkadot,c.Chainflip,c.Ripple,c.Solana,c.Tron,c.Near],walletType:v.KEYSTORE}),tt=O(V);export{J as validatePhrase,V as keystoreWallet,I as generatePhrase,G as encryptToKeyStore,L as decryptFromKeystore,tt as KEYSTORE_SUPPORTED_CHAINS};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=0DBFD1628D835B3E64756E2164756E21
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts", "../src/helpers.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import {\n Chain,\n CosmosChains,\n type DerivationPathArray,\n EVMChains,\n filterSupportedChains,\n NetworkDerivationPath,\n UTXOChains,\n updateDerivationPath,\n WalletOption,\n} from \"@swapkit/helpers\";\nimport { createWallet, getWalletSupportedChains } from \"@swapkit/wallet-core\";\n\nexport const keystoreWallet = createWallet({\n connect: ({ addChain, supportedChains, walletType }) =>\n async function connectKeystore(\n chains: Chain[],\n phrase: string,\n derivationPathMapOrIndex?: { [chain in Chain]?: DerivationPathArray } | number,\n ) {\n const filteredChains = filterSupportedChains({ chains, supportedChains, walletType });\n\n await Promise.all(\n filteredChains.map(async (chain) => {\n const derivationPathIndex = typeof derivationPathMapOrIndex === \"number\" ? derivationPathMapOrIndex : 0;\n\n const derivationPathFromMap =\n derivationPathMapOrIndex && typeof derivationPathMapOrIndex === \"object\"\n ? derivationPathMapOrIndex[chain]\n : undefined;\n\n const derivationArrayToUpdate = NetworkDerivationPath[chain].slice(\n 0,\n chain === Chain.Solana ? 4 : 5,\n ) as DerivationPathArray;\n\n const derivationPath: DerivationPathArray =\n derivationPathFromMap || updateDerivationPath(derivationArrayToUpdate, { index: derivationPathIndex });\n\n const { getToolbox } = await import(\"@swapkit/toolboxes\");\n\n const toolbox = await getToolbox(chain, { derivationPath, phrase });\n const address = (await toolbox.getAddress()) || \"\";\n\n const wallet = { ...toolbox, address };\n\n addChain({ ...wallet, chain, walletType: WalletOption.KEYSTORE });\n }),\n );\n\n return true;\n },\n name: \"connectKeystore\",\n supportedChains: [\n ...EVMChains,\n ...UTXOChains,\n ...CosmosChains,\n Chain.Polkadot,\n Chain.Chainflip,\n Chain.Ripple,\n Chain.Solana,\n Chain.Tron,\n Chain.Near,\n ],\n walletType: WalletOption.KEYSTORE,\n});\n\nexport const KEYSTORE_SUPPORTED_CHAINS = getWalletSupportedChains(keystoreWallet);\n\nexport * from \"./helpers\";\n",
|
|
5
|
+
"import {\n Chain,\n CosmosChains,\n type DerivationPathArray,\n EVMChains,\n filterSupportedChains,\n NetworkDerivationPath,\n UTXOChains,\n updateDerivationPath,\n WalletOption,\n} from \"@swapkit/helpers\";\nimport { createWallet, getWalletSupportedChains } from \"@swapkit/wallet-core\";\n\nexport const keystoreWallet = createWallet({\n connect: ({ addChain, supportedChains, walletType }) =>\n async function connectKeystore(\n chains: Chain[],\n phrase: string,\n derivationPathMapOrIndex?: { [chain in Chain]?: DerivationPathArray } | number,\n ) {\n const filteredChains = filterSupportedChains({ chains, supportedChains, walletType });\n\n await Promise.all(\n filteredChains.map(async (chain) => {\n const derivationPathIndex = typeof derivationPathMapOrIndex === \"number\" ? derivationPathMapOrIndex : 0;\n\n const derivationPathFromMap =\n derivationPathMapOrIndex && typeof derivationPathMapOrIndex === \"object\"\n ? derivationPathMapOrIndex[chain]\n : undefined;\n\n const derivationArrayToUpdate = NetworkDerivationPath[chain].slice(\n 0,\n chain === Chain.Solana ? 4 : 5,\n ) as DerivationPathArray;\n\n const derivationPath: DerivationPathArray =\n derivationPathFromMap || updateDerivationPath(derivationArrayToUpdate, { index: derivationPathIndex });\n\n const { getToolbox } = await import(\"@swapkit/toolboxes\");\n\n const toolbox = await getToolbox(chain, { derivationPath, phrase });\n const address = (await toolbox.getAddress()) || \"\";\n\n const wallet = { ...toolbox, address };\n\n addChain({ ...wallet, chain, walletType: WalletOption.KEYSTORE });\n }),\n );\n\n return true;\n },\n name: \"connectKeystore\",\n supportedChains: [\n ...EVMChains,\n ...UTXOChains,\n ...CosmosChains.filter((chain) => chain !== Chain.Harbor),\n Chain.Polkadot,\n Chain.Chainflip,\n Chain.Ripple,\n Chain.Solana,\n Chain.Tron,\n Chain.Near,\n ],\n walletType: WalletOption.KEYSTORE,\n});\n\nexport const KEYSTORE_SUPPORTED_CHAINS = getWalletSupportedChains(keystoreWallet);\n\nexport * from \"./helpers\";\n",
|
|
6
6
|
"import { createCipheriv, createDecipheriv, pbkdf2Sync, randomBytes } from \"node:crypto\";\nimport { generateMnemonic, validateMnemonic } from \"@scure/bip39\";\nimport { wordlist } from \"@scure/bip39/wordlists/english\";\n\nexport type Keystore = {\n version: number;\n meta: string;\n crypto: {\n cipher: string;\n cipherparams: { iv: string };\n ciphertext: string;\n kdf: string;\n kdfparams: { prf: string; dklen: number; salt: string; c: number };\n mac: string;\n };\n};\n\nasync function blake256(initData: Buffer | string) {\n const { blake2bFinal, blake2bInit, blake2bUpdate } = (await import(\"blakejs\")).default;\n let data = initData;\n\n if (!(data instanceof Buffer)) {\n // @ts-expect-error\n data = Buffer.from(data, \"hex\");\n }\n\n const context = blake2bInit(32);\n blake2bUpdate(context, data);\n\n return Array.from(blake2bFinal(context))\n .map((byte) => (byte < 0x10 ? `0${byte.toString(16)}` : byte.toString(16)))\n .join(\"\");\n}\n\nexport async function encryptToKeyStore(phrase: string, password: string) {\n const cipher = \"aes-128-ctr\";\n const iv = randomBytes(16);\n const salt = randomBytes(32);\n const kdfParams = { c: 262144, dklen: 32, prf: \"hmac-sha256\", salt: salt.toString(\"hex\") };\n\n const derivedKey = pbkdf2Sync(password, salt, kdfParams.c, kdfParams.dklen, \"sha256\");\n const cipherIV = createCipheriv(cipher, derivedKey.subarray(0, 16), iv);\n const ciphertext = Buffer.concat([cipherIV.update(Buffer.from(phrase, \"utf8\")), cipherIV.final()]);\n const initData = Buffer.concat([derivedKey.subarray(16, 32), Buffer.from(ciphertext)]);\n const mac = await blake256(initData);\n\n return {\n crypto: {\n cipher,\n cipherparams: { iv: iv.toString(\"hex\") },\n ciphertext: ciphertext.toString(\"hex\"),\n kdf: \"pbkdf2\",\n kdfparams: kdfParams,\n mac,\n },\n meta: \"xchain-keystore\",\n version: 1,\n };\n}\n\nexport function generatePhrase(size: 12 | 24 = 12) {\n return generateMnemonic(wordlist, size === 12 ? 128 : 256);\n}\n\nexport function validatePhrase(phrase: string) {\n return validateMnemonic(phrase, wordlist);\n}\n\nexport async function decryptFromKeystore(keystore: Keystore, password: string) {\n const { SwapKitError } = await import(\"@swapkit/helpers\");\n\n switch (keystore.version) {\n case 1: {\n const kdfParams = keystore.crypto.kdfparams;\n const salt = Buffer.from(kdfParams.salt, \"hex\");\n const derivedKey = pbkdf2Sync(password, salt, kdfParams.c, kdfParams.dklen, \"sha256\");\n\n const ciphertext = Buffer.from(keystore.crypto.ciphertext, \"hex\");\n const initData = Buffer.concat([derivedKey.subarray(16, 32), ciphertext]);\n const mac = await blake256(initData);\n\n if (mac !== keystore.crypto.mac) {\n throw new SwapKitError(\"wallet_keystore_invalid_password\");\n }\n\n const decipher = createDecipheriv(\n keystore.crypto.cipher,\n derivedKey.subarray(0, 16),\n Buffer.from(keystore.crypto.cipherparams.iv, \"hex\"),\n );\n\n const phrase = Buffer.concat([decipher.update(ciphertext), decipher.final()]);\n return phrase.toString(\"utf8\");\n }\n\n default:\n throw new SwapKitError(\"wallet_keystore_unsupported_version\");\n }\n}\n"
|
|
7
7
|
],
|
|
8
|
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AAa,qCAAqC,GDnF3D,IAAM,EAAiB,EAAa,CACzC,QAAS,EAAG,WAAU,kBAAiB,gBACrC,cAA8B,CAC5B,EACA,EACA,EACA,CACA,IAAM,EAAiB,EAAsB,CAAE,SAAQ,kBAAiB,YAAW,CAAC,EA8BpF,OA5BA,MAAM,QAAQ,IACZ,EAAe,IAAI,MAAO,IAAU,CAClC,IAAM,EAAsB,OAAO,IAA6B,SAAW,EAA2B,EAEhG,EACJ,GAA4B,OAAO,IAA6B,SAC5D,EAAyB,GACzB,OAEA,EAA0B,EAAsB,GAAO,MAC3D,EACA,IAAU,EAAM,OAAS,EAAI,CAC/B,EAEM,EACJ,GAAyB,EAAqB,EAAyB,CAAE,MAAO,CAAoB,CAAC,GAE/F,cAAe,KAAa,8BAE9B,EAAU,MAAM,EAAW,EAAO,CAAE,iBAAgB,QAAO,CAAC,EAC5D,EAAW,MAAM,EAAQ,WAAW,GAAM,GAE1C,EAAS,IAAK,EAAS,SAAQ,EAErC,EAAS,IAAK,EAAQ,QAAO,WAAY,EAAa,QAAS,CAAC,EACjE,CACH,EAEO,IAEX,KAAM,kBACN,gBAAiB,CACf,GAAG,EACH,GAAG,EACH,GAAG,EAAa,OAAO,CAAC,IAAU,IAAU,EAAM,MAAM,EACxD,EAAM,SACN,EAAM,UACN,EAAM,OACN,EAAM,OACN,EAAM,KACN,EAAM,IACR,EACA,WAAY,EAAa,QAC3B,CAAC,EAEY,GAA4B,EAAyB,CAAc",
|
|
9
|
+
"debugId": "0DBFD1628D835B3E64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -34,9 +34,9 @@ export declare const keystoreWallet: {
|
|
|
34
34
|
TRON?: DerivationPathArray | undefined;
|
|
35
35
|
ZEC?: DerivationPathArray | undefined;
|
|
36
36
|
} | undefined) => Promise<boolean>;
|
|
37
|
-
supportedChains: (Chain.Arbitrum | Chain.Aurora | Chain.Avalanche | Chain.Base | Chain.Berachain | Chain.BinanceSmartChain | Chain.Bitcoin | Chain.BitcoinCash | Chain.Cosmos | Chain.Dash | Chain.Dogecoin | Chain.Ethereum | Chain.Gnosis | Chain.
|
|
37
|
+
supportedChains: (Chain.Arbitrum | Chain.Aurora | Chain.Avalanche | Chain.Base | Chain.Berachain | Chain.BinanceSmartChain | Chain.Bitcoin | Chain.BitcoinCash | Chain.Cosmos | Chain.Dash | Chain.Dogecoin | Chain.Ethereum | Chain.Gnosis | Chain.Kujira | Chain.Litecoin | Chain.Maya | Chain.Near | Chain.Noble | Chain.Optimism | Chain.Polkadot | Chain.Chainflip | Chain.Polygon | Chain.Ripple | Chain.THORChain | Chain.Solana | Chain.Tron | Chain.Zcash)[];
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
export declare const KEYSTORE_SUPPORTED_CHAINS: (Chain.Arbitrum | Chain.Aurora | Chain.Avalanche | Chain.Base | Chain.Berachain | Chain.BinanceSmartChain | Chain.Bitcoin | Chain.BitcoinCash | Chain.Cosmos | Chain.Dash | Chain.Dogecoin | Chain.Ethereum | Chain.Gnosis | Chain.
|
|
40
|
+
export declare const KEYSTORE_SUPPORTED_CHAINS: (Chain.Arbitrum | Chain.Aurora | Chain.Avalanche | Chain.Base | Chain.Berachain | Chain.BinanceSmartChain | Chain.Bitcoin | Chain.BitcoinCash | Chain.Cosmos | Chain.Dash | Chain.Dogecoin | Chain.Ethereum | Chain.Gnosis | Chain.Kujira | Chain.Litecoin | Chain.Maya | Chain.Near | Chain.Noble | Chain.Optimism | Chain.Polkadot | Chain.Chainflip | Chain.Polygon | Chain.Ripple | Chain.THORChain | Chain.Solana | Chain.Tron | Chain.Zcash)[];
|
|
41
41
|
export * from "./helpers";
|
|
42
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAEL,KAAK,mBAAmB,EAOzB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDzB,CAAC;AAEH,eAAO,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAEL,KAAK,mBAAmB,EAOzB,MAAM,kBAAkB,CAAC;AAG1B,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDzB,CAAC;AAEH,eAAO,MAAM,yBAAyB,sbAA2C,CAAC;AAElF,cAAc,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-oss",
|
|
3
|
-
"dependencies": { "@swapkit/helpers": "4.0.
|
|
3
|
+
"dependencies": { "@swapkit/helpers": "4.0.26", "@swapkit/toolboxes": "4.0.26", "@swapkit/wallet-core": "4.0.26" },
|
|
4
4
|
"description": "SwapKit - Wallet Keystore",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": { "import": "./dist/index.js", "require": "./dist/index.cjs", "types": "./dist/types/index.d.ts" }
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"type-check:go": "tsgo"
|
|
25
25
|
},
|
|
26
26
|
"type": "module",
|
|
27
|
-
"version": "4.0.
|
|
27
|
+
"version": "4.0.26"
|
|
28
28
|
}
|