@swapkit/wallet-keystore 4.5.9 → 5.0.1
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 +16 -19
- package/package.json +3 -5
- package/dist/index.cjs +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
# @swapkit/wallet-keystore
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 5.0.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [`
|
|
7
|
+
- [#363](https://github.com/swapkit/sdk/pull/363) [`7b9f214`](https://github.com/swapkit/sdk/commit/7b9f2145e8644975620db1f2b39775c33cb40d20) Thanks [@towanTG](https://github.com/towanTG)! - HyperCore balances are now API-first: `getBalance` queries the SwapKit (via @swapkit/toolboxes@5.1.0)
|
|
8
|
+
- [#366](https://github.com/swapkit/sdk/pull/366) [`c64be1d`](https://github.com/swapkit/sdk/commit/c64be1d700ef8855495ca9d7ef0ebe18f46687ee) Thanks [@towanTG](https://github.com/towanTG)! - HyperCore chain-query balances take decimals from Hyperliquid spotMeta (via @swapkit/toolboxes@5.1.0)
|
|
9
|
+
- Update generated token lists. (via @swapkit/toolboxes@5.1.0)
|
|
10
|
+
- [#363](https://github.com/swapkit/sdk/pull/363) [`7b9f214`](https://github.com/swapkit/sdk/commit/7b9f2145e8644975620db1f2b39775c33cb40d20) Thanks [@towanTG](https://github.com/towanTG)! - Correct the Hyperliquid chain display names: `Chain.Hyperevm`'s config is now (via @swapkit/toolboxes@5.1.0)
|
|
8
11
|
|
|
9
|
-
##
|
|
12
|
+
## 5.0.0
|
|
10
13
|
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
- [`c357b3b`](https://github.com/swapkit/sdk/commit/c357b3bc1a384d9ebdf1b4da2f4b94542636538e) Thanks [@towanTG](https://github.com/towanTG)! - Hypercore balances take their decimals from Hyperliquid's `weiDecimals` instead of a hardcoded ticker table. USDC is 8 decimals on Hypercore (it is 6 only on EVM chains), so the old `{ USDC: 6 }` fallback truncated spot balances; the table now applies only when spot metadata is unavailable. (via @swapkit/toolboxes@4.28.3)
|
|
14
|
-
- [#358](https://github.com/swapkit/sdk/pull/358) [`6734cab`](https://github.com/swapkit/sdk/commit/6734cab233f17b6e5372519fe43e029477117827) Thanks [@github-actions](https://github.com/apps/github-actions)! - Correct flashnet's Hypercore assets in the dev list. The api collapses flashnet's two Hyperliquid chains and emitted Hypercore USDC carrying HyperEVM USDC's contract address (`HYPE.USDC-0xb88339CB…`) — an EVM address is not a valid Hypercore asset id, so `spotSend` built from it was rejected. Hypercore entries are now generated in Hyperliquid `NAME:tokenId` form, matching what the hypercore toolbox builds at runtime: `HYPE.USDC-USDC:0x6d1e7cde…` and `HYPE.USDE-USDE:0x2e6d84f2…`, both 8 decimals (`weiDecimals`). `HYPEREVM.*` assets are untouched. (via @swapkit/toolboxes@4.28.3)
|
|
15
|
-
|
|
16
|
-
## 4.5.7
|
|
17
|
-
|
|
18
|
-
### Patch Changes
|
|
19
|
-
|
|
20
|
-
- [`bca217f`](https://github.com/swapkit/sdk/commit/bca217f89314ac520eae2d5eeeee027f125c4262) Thanks [@towanTG](https://github.com/towanTG)! - Refresh generated token lists and restore faithful provider mirroring. The `HYPE.*` filter added in 4.5.0 is removed: `HYPE.USDC-0xb88339CB…` is the identifier the api actually routes on (it is the only HYPE-family buy asset `/swapTo` returns on prod), so dropping it removed the static entry for a routable token. Dev flashnet now carries `HYPE.USDC` alongside its `HYPEREVM.*` assets, exactly as the provider serves them. (via @swapkit/helpers@4.20.3)
|
|
21
|
-
|
|
22
|
-
## 4.5.6
|
|
23
|
-
|
|
24
|
-
### Patch Changes
|
|
14
|
+
### Major Changes
|
|
25
15
|
|
|
26
|
-
- [`
|
|
27
|
-
- [`
|
|
16
|
+
- [#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.
|
|
17
|
+
- [#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)
|
|
18
|
+
- [#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)
|
|
19
|
+
- [#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)
|
|
20
|
+
- [#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)
|
|
21
|
+
- [#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)
|
|
22
|
+
- [#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)
|
|
23
|
+
- Update generated token lists. (via @swapkit/toolboxes@5.0.0)
|
|
24
|
+
- [#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)
|
|
28
25
|
|
|
29
26
|
## 4.5.5
|
|
30
27
|
|
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.1", "@swapkit/toolboxes": "5.1.0", "@swapkit/wallet-core": "5.0.1" },
|
|
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.1"
|
|
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},{})}
|