@swapkit/wallet-keystore 4.5.8 → 5.0.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 +13 -19
- package/package.json +3 -5
- package/dist/index.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
# @swapkit/wallet-keystore
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
- [`
|
|
8
|
-
- [#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
## 4.5.6
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- [`f90fa82`](https://github.com/swapkit/sdk/commit/f90fa826d1e56dba934ee968ec31a94ae20399fd) Thanks [@towanTG](https://github.com/towanTG)! - Update generated token lists (prod and dev). Remove the hand-maintained hypercore token list and its `hype`/`hypercore` list names — the api serves no HYPE provider, so the documented exception from 4.4.0 is retired and static lists are again 100% provider-generated. (via @swapkit/helpers@4.20.2)
|
|
21
|
-
- [`c3ef809`](https://github.com/swapkit/sdk/commit/c3ef80967cab859310aa7e20e6f0aeb817027bb7) Thanks [@towanTG](https://github.com/towanTG)! - Refresh generated token lists — flashnet now carries the HyperEVM assets (HYPEREVM.HYPE, USDC, USDe, USDT0). The generator drops non-native `HYPE.*` identifiers misfiled by providers: HyperEVM assets belong on `HYPEREVM.*`, and the HYPE (Hypercore) chain keeps only native HYPE. (via @swapkit/helpers@4.20.2)
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#344](https://github.com/swapkit/sdk/pull/344) [`7f99d74`](https://github.com/swapkit/sdk/commit/7f99d74ec21d58d07b2cccc5b111f8fdae6c7afb) Thanks [@ice-chillios](https://github.com/ice-chillios)! - **ESM-only packages.** CommonJS output (`.cjs`) and `require` export conditions have been removed; every package now ships ESM only (code-splitting stays enabled), with a uniform `{ default, types }` exports shape. `buildPackage` from `@swapkit/tools-builder` no longer emits CJS and the unused `esmOnly` option has been removed.
|
|
8
|
+
- [#249](https://github.com/swapkit/sdk/pull/249) [`41505dc`](https://github.com/swapkit/sdk/commit/41505dc0f4f77dd301cfced063013efb6307b9bb) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Replace `@cosmjs/{amino,crypto,proto-signing,stargate}@0.39.0` with native `@swapkit/cosmos-signer` package. The new signer is ESM-native (no CJS↔ESM-only-noble breakage), uses only `@noble/curves`, `@noble/hashes`, `@scure/{base,bip32,bip39}` + `cosmjs-types` for proto encoders. **No `@cosmjs/*` runtime dependency.** (via @swapkit/toolboxes@5.0.0)
|
|
9
|
+
- [#298](https://github.com/swapkit/sdk/pull/298) [`3017621`](https://github.com/swapkit/sdk/commit/3017621ee5c2da15550036853df74d81f59d6ffb) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Speed up `createTransaction` across toolboxes by removing serial and redundant network round-trips from the build path. Two techniques, both backward-compatible: (via @swapkit/toolboxes@5.0.0)
|
|
10
|
+
- [#360](https://github.com/swapkit/sdk/pull/360) [`d6061d5`](https://github.com/swapkit/sdk/commit/d6061d58367cdf077acf60421a1e8b448363f486) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Add HyperCore `sendAsset` payin support. (via @swapkit/toolboxes@5.0.0)
|
|
11
|
+
- [#295](https://github.com/swapkit/sdk/pull/295) [`fd1d5d7`](https://github.com/swapkit/sdk/commit/fd1d5d7304eda3ff20c53b14d0eb5998fb6b8250) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Remove `ethers` and `@near-js/providers` from `@swapkit/helpers`. EVM address checksum/validation now uses an in-house EIP-55 implementation backed by `@noble/hashes`, ERC-20 symbol decoding reuses the existing dynamic-string ABI decoder, and NEAR token metadata is fetched via JSON-RPC through `RequestClient`. Public behaviour is preserved (ethers-parity semantics, including throw-on-bad-checksum). (via @swapkit/toolboxes@5.0.0)
|
|
12
|
+
- [#295](https://github.com/swapkit/sdk/pull/295) [`fd1d5d7`](https://github.com/swapkit/sdk/commit/fd1d5d7304eda3ff20c53b14d0eb5998fb6b8250) Thanks [@ice-chillios](https://github.com/ice-chillios)! - Consolidate scattered helper utility modules (explorer URLs, validators, widget auth, TNS cost helpers) into grouped homes. Pure internal relocation — the public export surface is unchanged. (via @swapkit/toolboxes@5.0.0)
|
|
13
|
+
- [#353](https://github.com/swapkit/sdk/pull/353) [`2d00760`](https://github.com/swapkit/sdk/commit/2d0076010f56b843295fa814922b46385d3fc52b) Thanks [@towanTG](https://github.com/towanTG)! - Update generated token lists (prod and dev). Remove the hand-maintained hypercore token list and its `hype`/`hypercore` list names — the api serves no HYPE provider, so the documented exception from 4.4.0 is retired and static lists are again 100% provider-generated. (via @swapkit/toolboxes@5.0.0)
|
|
14
|
+
- Update generated token lists. (via @swapkit/toolboxes@5.0.0)
|
|
15
|
+
- [#354](https://github.com/swapkit/sdk/pull/354) [`8d21eef`](https://github.com/swapkit/sdk/commit/8d21eefe8a5379347a6a9b92978b0336e1a155a4) Thanks [@towanTG](https://github.com/towanTG)! - Refresh generated token lists (prod and dev) — dev flashnet now carries the HyperEVM assets (`HYPEREVM.HYPE`, `USDC`, `USDe`, `USDT0`) alongside `HYPE.USDC`. Lists mirror provider output verbatim; no identifiers are filtered. (via @swapkit/toolboxes@5.0.0)
|
|
22
16
|
|
|
23
17
|
## 4.5.5
|
|
24
18
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "swapkit-dev",
|
|
3
|
-
"dependencies": { "@swapkit/helpers": "
|
|
3
|
+
"dependencies": { "@swapkit/helpers": "5.0.0", "@swapkit/toolboxes": "5.0.0", "@swapkit/wallet-core": "5.0.0" },
|
|
4
4
|
"description": "SwapKit - Wallet Keystore",
|
|
5
|
-
"exports": {
|
|
6
|
-
".": { "import": "./dist/index.js", "require": "./dist/index.cjs", "types": "./dist/types/index.d.ts" }
|
|
7
|
-
},
|
|
5
|
+
"exports": { ".": { "default": "./dist/index.js", "types": "./dist/types/index.d.ts" } },
|
|
8
6
|
"files": ["dist/", "CHANGELOG.md"],
|
|
9
7
|
"homepage": "https://github.com/swapkit/SwapKit",
|
|
10
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -24,5 +22,5 @@
|
|
|
24
22
|
"type-check:go": "tsgo"
|
|
25
23
|
},
|
|
26
24
|
"type": "module",
|
|
27
|
-
"version": "
|
|
25
|
+
"version": "5.0.0"
|
|
28
26
|
}
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var{defineProperty:h,getOwnPropertyNames:S,getOwnPropertyDescriptor:w}=Object,R=Object.prototype.hasOwnProperty;function X(e){return this[e]}var K=(e)=>{var n=(C??=new WeakMap).get(e),r;if(n)return n;if(n=h({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of S(e))if(!R.call(n,o))h(n,o,{get:X.bind(e,o),enumerable:!(r=w(e,o))||r.enumerable})}return C.set(e,n),n},C;var I=(e)=>e;function F(e,n){this[e]=I.bind(null,n)}var j=(e,n)=>{for(var r in n)h(e,r,{get:n[r],enumerable:!0,configurable:!0,set:F.bind(n,r)})};var Y={};j(Y,{validatePhrase:()=>O,keystoreWallet:()=>U,generatePhrase:()=>E,encryptToKeyStore:()=>y,decryptFromKeystore:()=>P,createKeystoreWallet:()=>D,KEYSTORE_SUPPORTED_CHAINS:()=>v});module.exports=K(Y);var t=require("@swapkit/helpers"),f=require("@swapkit/wallet-core");var u=require("node:crypto"),p=require("@scure/bip39"),b=require("@scure/bip39/wordlists/english.js");async function H(e){let{blake2b:n}=await import("@noble/hashes/blake2.js"),r=e instanceof Buffer?e:Buffer.from(e,"hex"),o=n(r,{dkLen:32});return Array.from(o).map((i)=>i<16?`0${i.toString(16)}`:i.toString(16)).join("")}async function y(e,n){let o=u.randomBytes(16),i=u.randomBytes(32),a={c:262144,dklen:32,prf:"hmac-sha256",salt:i.toString("hex")},s=u.pbkdf2Sync(n,i,a.c,a.dklen,"sha256"),c=u.createCipheriv("aes-128-ctr",s.subarray(0,16),o),l=Buffer.concat([c.update(Buffer.from(e,"utf8")),c.final()]),g=Buffer.concat([s.subarray(16,32),Buffer.from(l)]),d=await H(g);return{crypto:{cipher:"aes-128-ctr",cipherparams:{iv:o.toString("hex")},ciphertext:l.toString("hex"),kdf:"pbkdf2",kdfparams:a,mac:d},meta:"xchain-keystore",version:1}}function E(e=12){return p.generateMnemonic(b.wordlist,e===12?128:256)}function O(e){return p.validateMnemonic(e,b.wordlist)}async function P(e,n){let{SwapKitError:r}=await import("@swapkit/helpers");switch(e.version){case 1:{let o=e.crypto.kdfparams,i=Buffer.from(o.salt,"hex"),a=u.pbkdf2Sync(n,i,o.c,o.dklen,"sha256"),s=Buffer.from(e.crypto.ciphertext,"hex"),c=Buffer.concat([a.subarray(16,32),s]);if(await H(c)!==e.crypto.mac)throw new r("wallet_keystore_invalid_password");let g=u.createDecipheriv(e.crypto.cipher,a.subarray(0,16),Buffer.from(e.crypto.cipherparams.iv,"hex"));return Buffer.concat([g.update(s),g.final()]).toString("utf8")}default:throw new r("wallet_keystore_unsupported_version")}}function B(e){return typeof e==="object"&&e!==null&&"deriveAddressAtIndex"in e&&typeof e.deriveAddressAtIndex==="function"&&"getExtendedPublicKey"in e&&typeof e.getExtendedPublicKey==="function"&&"getBalance"in e&&typeof e.getBalance==="function"}async function N(e,n){let{createHDWalletHelpers:r,getUtxoApi:o}=await import("@swapkit/toolboxes/utxo");function i(l){let{accountIndex:g,count:d,startIndex:m=0,change:x=!1}=l;if(d<1||d>1000)throw RangeError(`count must be between 1 and 1000, got ${d}`);if(m<0)throw RangeError(`startIndex must be non-negative, got ${m}`);let A=[];for(let T=0;T<d;T++){let W=n.deriveAddressAtIndex({accountIndex:g,change:x,index:m+T});if(W)A.push(W)}return A}let{scanForAddresses:a,getAggregatedBalance:s,getAggregatedUtxos:c}=r({chain:e,deriveAddress:(l)=>n.deriveAddressAtIndex(l),getBalance:n.getBalance,getUtxos:(l)=>o(e).getUtxos({address:l,fetchTxHex:!0})});return{deriveAddresses:i,getAggregatedBalance:s,getAggregatedUtxos:c,scanForAddresses:a}}var U=f.createWallet({connect:({addChain:e})=>async function(r,o,i){let a=await D({chains:r,derivationPathMapOrIndex:i,phrase:o});for(let s of Object.values(a))e({...s,chain:s.chain,walletType:t.WalletOption.KEYSTORE});return!0},directSigningSupport:{...Object.fromEntries(t.EVMChains.map((e)=>[e,!0])),...Object.fromEntries(t.UTXOChains.map((e)=>[e,!0])),...Object.fromEntries(t.CosmosChains.filter((e)=>e!==t.Chain.Harbor).map((e)=>[e,!0])),[t.Chain.Aleo]:!0,[t.Chain.Aptos]:!0,[t.Chain.Cardano]:!0,[t.Chain.Hype]:!0,[t.Chain.Near]:!0,[t.Chain.Ripple]:!0,[t.Chain.Solana]:!0,[t.Chain.Stellar]:!0,[t.Chain.Sui]:!0,[t.Chain.Ton]:!0,[t.Chain.Tron]:!0},name:"connectKeystore",supportedChains:[...t.EVMChains,...t.UTXOChains,...t.CosmosChains.filter((e)=>e!==t.Chain.Harbor),t.Chain.Aleo,t.Chain.Aptos,t.Chain.Cardano,t.Chain.Ripple,t.Chain.Solana,t.Chain.Stellar,t.Chain.Sui,t.Chain.Ton,t.Chain.Tron,t.Chain.Near,t.Chain.Hype],walletType:t.WalletOption.KEYSTORE}),v=f.getWalletSupportedChains(U);async function D({chains:e,phrase:n,derivationPathMapOrIndex:r}){let o=t.filterSupportedChains({chains:e,supportedChains:v,walletType:t.WalletOption.KEYSTORE});return(await Promise.all(o.map(async(a)=>{let{getToolbox:s}=await import("@swapkit/toolboxes"),c=typeof r==="number"?r:0,l=r&&typeof r==="object"?r[a]:void 0,g=t.NetworkDerivationPath[a].slice(0,a===t.Chain.Solana||a===t.Chain.Aleo?4:5),d=l||t.updateDerivationPath(g,{index:c}),m=await s(a,{derivationPath:d,phrase:n}),x=await m.getAddress()||"",A=t.UTXOChains.includes(a)&&B(m)?await N(a,m):{};return{...m,...A,address:x,chain:a}}))).reduce((a,s)=>{return a[s.chain]=s,a},{})}
|