@meteora-ag/cp-amm-sdk 1.0.0 → 1.0.1-1.rc-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.d.mts +1266 -332
- package/dist/index.d.ts +1266 -332
- package/dist/index.js +1231 -362
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1248 -379
- package/dist/index.mjs.map +1 -1
- package/node_modules/@babel/runtime/helpers/esm/interopRequireWildcard.js +19 -24
- package/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js +178 -210
- package/node_modules/@babel/runtime/helpers/interopRequireWildcard.js +19 -24
- package/node_modules/@babel/runtime/helpers/regeneratorRuntime.js +178 -210
- package/node_modules/@babel/runtime/package.json +1 -4
- package/node_modules/@coral-xyz/anchor/dist/browser/index.js +11 -12
- package/node_modules/@coral-xyz/anchor/dist/browser/index.js.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/browser/src/coder/borsh/idl.d.ts.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/cjs/coder/borsh/idl.d.ts.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/cjs/coder/borsh/idl.js +8 -9
- package/node_modules/@coral-xyz/anchor/dist/cjs/coder/borsh/idl.js.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/cjs/program/accounts-resolver.js +3 -3
- package/node_modules/@coral-xyz/anchor/dist/cjs/program/accounts-resolver.js.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/esm/coder/borsh/idl.d.ts.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/esm/coder/borsh/idl.js +8 -9
- package/node_modules/@coral-xyz/anchor/dist/esm/coder/borsh/idl.js.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/esm/program/accounts-resolver.js +3 -3
- package/node_modules/@coral-xyz/anchor/dist/esm/program/accounts-resolver.js.map +1 -1
- package/node_modules/@coral-xyz/anchor/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/node_modules/@coral-xyz/anchor/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@coral-xyz/anchor/package.json +3 -3
- package/node_modules/@coral-xyz/anchor-errors/package.json +1 -1
- package/node_modules/@coral-xyz/borsh/package.json +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/README.md +321 -436
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/_shortw_utils.d.ts +2 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/_shortw_utils.js +2 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/abstract/bls.d.ts +5 -5
- package/node_modules/@noble/curves/abstract/bls.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/bls.js +15 -16
- package/node_modules/@noble/curves/abstract/bls.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/abstract/curve.d.ts +11 -3
- package/node_modules/@noble/curves/abstract/curve.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/curve.js +93 -81
- package/node_modules/@noble/curves/abstract/curve.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/edwards.d.ts +2 -2
- package/node_modules/@noble/curves/abstract/edwards.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/edwards.js +72 -72
- package/node_modules/@noble/curves/abstract/edwards.js.map +1 -0
- package/node_modules/@noble/curves/abstract/fft.d.ts +120 -0
- package/node_modules/@noble/curves/abstract/fft.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/fft.js +439 -0
- package/node_modules/@noble/curves/abstract/fft.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/abstract/hash-to-curve.d.ts +15 -9
- package/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/hash-to-curve.js +49 -39
- package/node_modules/@noble/curves/abstract/hash-to-curve.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/abstract/modular.d.ts +13 -12
- package/node_modules/@noble/curves/abstract/modular.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/modular.js +167 -167
- package/node_modules/@noble/curves/abstract/modular.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/abstract/montgomery.d.ts +4 -9
- package/node_modules/@noble/curves/abstract/montgomery.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/montgomery.js +140 -0
- package/node_modules/@noble/curves/abstract/montgomery.js.map +1 -0
- package/node_modules/@noble/curves/abstract/poseidon.d.ts +76 -0
- package/node_modules/@noble/curves/abstract/poseidon.d.ts.map +1 -0
- package/node_modules/@noble/curves/abstract/poseidon.js +300 -0
- package/node_modules/@noble/curves/abstract/poseidon.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/abstract/tower.d.ts +2 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/tower.d.ts.map +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/tower.js +17 -18
- package/node_modules/@noble/curves/abstract/tower.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/utils.d.ts +5 -2
- package/node_modules/@noble/curves/abstract/utils.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/utils.js +27 -14
- package/node_modules/@noble/curves/abstract/utils.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/weierstrass.d.ts +45 -10
- package/node_modules/@noble/curves/abstract/weierstrass.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/abstract/weierstrass.js +153 -117
- package/node_modules/@noble/curves/abstract/weierstrass.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/bls12-381.d.ts +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/bls12-381.d.ts.map +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/bls12-381.js +50 -64
- package/node_modules/@noble/curves/bls12-381.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/bn254.d.ts +3 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/bn254.d.ts.map +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/bn254.js +39 -29
- package/node_modules/@noble/curves/bn254.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves/esm → @noble/curves}/ed25519.d.ts +26 -10
- package/node_modules/@noble/curves/ed25519.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/ed25519.js +93 -83
- package/node_modules/@noble/curves/ed25519.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/ed448.d.ts +26 -10
- package/node_modules/@noble/curves/ed448.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/ed448.js +92 -82
- package/node_modules/@noble/curves/ed448.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/_shortw_utils.d.ts +2 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/_shortw_utils.js +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/abstract/bls.d.ts +5 -5
- package/node_modules/@noble/curves/esm/abstract/bls.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/bls.js +6 -7
- package/node_modules/@noble/curves/esm/abstract/bls.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/abstract/curve.d.ts +11 -3
- package/node_modules/@noble/curves/esm/abstract/curve.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/curve.js +90 -78
- package/node_modules/@noble/curves/esm/abstract/curve.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/edwards.d.ts +2 -2
- package/node_modules/@noble/curves/esm/abstract/edwards.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/edwards.js +53 -53
- package/node_modules/@noble/curves/esm/abstract/edwards.js.map +1 -0
- package/node_modules/@noble/curves/esm/abstract/fft.d.ts +120 -0
- package/node_modules/@noble/curves/esm/abstract/fft.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/abstract/fft.js +426 -0
- package/node_modules/@noble/curves/esm/abstract/fft.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/abstract/hash-to-curve.d.ts +15 -9
- package/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/hash-to-curve.js +33 -23
- package/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/abstract/modular.d.ts +13 -12
- package/node_modules/@noble/curves/esm/abstract/modular.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/modular.js +159 -159
- package/node_modules/@noble/curves/esm/abstract/modular.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/abstract/montgomery.d.ts +4 -9
- package/node_modules/@noble/curves/esm/abstract/montgomery.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/abstract/montgomery.js +137 -0
- package/node_modules/@noble/curves/esm/abstract/montgomery.js.map +1 -0
- package/node_modules/@noble/curves/esm/abstract/poseidon.d.ts +76 -0
- package/node_modules/@noble/curves/esm/abstract/poseidon.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/abstract/poseidon.js +291 -0
- package/node_modules/@noble/curves/esm/abstract/poseidon.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/abstract/tower.d.ts +2 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/tower.d.ts.map +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/tower.js +9 -10
- package/node_modules/@noble/curves/esm/abstract/tower.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/utils.d.ts +5 -2
- package/node_modules/@noble/curves/esm/abstract/utils.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/utils.js +26 -13
- package/node_modules/@noble/curves/esm/abstract/utils.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/weierstrass.d.ts +45 -10
- package/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/abstract/weierstrass.js +127 -91
- package/node_modules/@noble/curves/esm/abstract/weierstrass.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/bls12-381.d.ts +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/bls12-381.d.ts.map +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/bls12-381.js +18 -32
- package/node_modules/@noble/curves/esm/bls12-381.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/bn254.d.ts +3 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/bn254.d.ts.map +1 -1
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/bn254.js +17 -7
- package/node_modules/@noble/curves/esm/bn254.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble/curves → @noble/curves/esm}/ed25519.d.ts +26 -10
- package/node_modules/@noble/curves/esm/ed25519.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/ed25519.js +48 -38
- package/node_modules/@noble/curves/esm/ed25519.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/ed448.d.ts +26 -10
- package/node_modules/@noble/curves/esm/ed448.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/ed448.js +59 -49
- package/node_modules/@noble/curves/esm/ed448.js.map +1 -0
- package/node_modules/@noble/curves/esm/jubjub.d.ts +12 -0
- package/node_modules/@noble/curves/esm/jubjub.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/jubjub.js +12 -0
- package/node_modules/@noble/curves/esm/jubjub.js.map +1 -0
- package/node_modules/@noble/curves/esm/misc.d.ts +21 -0
- package/node_modules/@noble/curves/esm/misc.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/misc.js +107 -0
- package/node_modules/@noble/curves/esm/misc.js.map +1 -0
- package/node_modules/@noble/curves/esm/nist.d.ts +30 -0
- package/node_modules/@noble/curves/esm/nist.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/nist.js +121 -0
- package/node_modules/@noble/curves/esm/nist.js.map +1 -0
- package/node_modules/@noble/curves/esm/p256.d.ts +12 -0
- package/node_modules/@noble/curves/esm/p256.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/p256.js +12 -0
- package/node_modules/@noble/curves/esm/p256.js.map +1 -0
- package/node_modules/@noble/curves/esm/p384.d.ts +13 -0
- package/node_modules/@noble/curves/esm/p384.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/p384.js +13 -0
- package/node_modules/@noble/curves/esm/p384.js.map +1 -0
- package/node_modules/@noble/curves/esm/p521.d.ts +12 -0
- package/node_modules/@noble/curves/esm/p521.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/p521.js +12 -0
- package/node_modules/@noble/curves/esm/p521.js.map +1 -0
- package/node_modules/@noble/curves/esm/pasta.d.ts +10 -0
- package/node_modules/@noble/curves/esm/pasta.d.ts.map +1 -0
- package/node_modules/@noble/curves/esm/pasta.js +10 -0
- package/node_modules/@noble/curves/esm/pasta.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/secp256k1.d.ts +15 -10
- package/node_modules/@noble/curves/esm/secp256k1.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/secp256k1.js +23 -20
- package/node_modules/@noble/curves/esm/secp256k1.js.map +1 -0
- package/node_modules/@noble/curves/jubjub.d.ts +12 -0
- package/node_modules/@noble/curves/jubjub.d.ts.map +1 -0
- package/node_modules/@noble/curves/jubjub.js +15 -0
- package/node_modules/@noble/curves/jubjub.js.map +1 -0
- package/node_modules/@noble/curves/misc.d.ts +21 -0
- package/node_modules/@noble/curves/misc.d.ts.map +1 -0
- package/node_modules/@noble/curves/misc.js +112 -0
- package/node_modules/@noble/curves/misc.js.map +1 -0
- package/node_modules/@noble/curves/nist.d.ts +30 -0
- package/node_modules/@noble/curves/nist.d.ts.map +1 -0
- package/node_modules/@noble/curves/nist.js +124 -0
- package/node_modules/@noble/curves/nist.js.map +1 -0
- package/node_modules/@noble/curves/p256.d.ts +12 -0
- package/node_modules/@noble/curves/p256.d.ts.map +1 -0
- package/node_modules/@noble/curves/p256.js +9 -0
- package/node_modules/@noble/curves/p256.js.map +1 -0
- package/node_modules/@noble/curves/p384.d.ts +13 -0
- package/node_modules/@noble/curves/p384.d.ts.map +1 -0
- package/node_modules/@noble/curves/p384.js +10 -0
- package/node_modules/@noble/curves/p384.js.map +1 -0
- package/node_modules/@noble/curves/p521.d.ts +12 -0
- package/node_modules/@noble/curves/p521.d.ts.map +1 -0
- package/node_modules/@noble/curves/p521.js +9 -0
- package/node_modules/@noble/curves/p521.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/package.json +126 -13
- package/node_modules/@noble/curves/pasta.d.ts +10 -0
- package/node_modules/@noble/curves/pasta.d.ts.map +1 -0
- package/node_modules/@noble/curves/pasta.js +13 -0
- package/node_modules/@noble/curves/pasta.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/secp256k1.d.ts +15 -10
- package/node_modules/@noble/curves/secp256k1.d.ts.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/secp256k1.js +62 -59
- package/node_modules/@noble/curves/secp256k1.js.map +1 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/_shortw_utils.ts +2 -2
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/bls.ts +10 -10
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/curve.ts +99 -85
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/edwards.ts +71 -64
- package/node_modules/@noble/curves/src/abstract/fft.ts +508 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/hash-to-curve.ts +49 -39
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/modular.ts +155 -154
- package/node_modules/@noble/curves/src/abstract/montgomery.ts +165 -0
- package/node_modules/@noble/curves/src/abstract/poseidon.ts +331 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/tower.ts +10 -11
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/utils.ts +28 -15
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/abstract/weierstrass.ts +182 -120
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/bls12-381.ts +21 -37
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/bn254.ts +18 -8
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/ed25519.ts +55 -40
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/ed448.ts +105 -88
- package/node_modules/@noble/curves/src/jubjub.ts +12 -0
- package/node_modules/@noble/curves/src/misc.ts +123 -0
- package/node_modules/@noble/curves/src/nist.ts +155 -0
- package/node_modules/@noble/curves/src/p256.ts +11 -0
- package/node_modules/@noble/curves/src/p384.ts +13 -0
- package/node_modules/@noble/curves/src/p521.ts +11 -0
- package/node_modules/@noble/curves/src/pasta.ts +9 -0
- package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/secp256k1.ts +27 -22
- package/node_modules/@noble/hashes/README.md +217 -268
- package/node_modules/@noble/hashes/_assert.d.ts +12 -18
- package/node_modules/@noble/hashes/_assert.d.ts.map +1 -1
- package/node_modules/@noble/hashes/_assert.js +12 -44
- package/node_modules/@noble/hashes/_assert.js.map +1 -1
- package/node_modules/@noble/hashes/_blake.d.ts +8 -28
- package/node_modules/@noble/hashes/_blake.d.ts.map +1 -1
- package/node_modules/@noble/hashes/_blake.js +19 -106
- package/node_modules/@noble/hashes/_blake.js.map +1 -1
- package/node_modules/@noble/hashes/_md.d.ts +22 -5
- package/node_modules/@noble/hashes/_md.d.ts.map +1 -1
- package/node_modules/@noble/hashes/_md.js +43 -18
- package/node_modules/@noble/hashes/_md.js.map +1 -1
- package/node_modules/@noble/hashes/_u64.d.ts +1 -1
- package/node_modules/@noble/hashes/_u64.d.ts.map +1 -1
- package/node_modules/@noble/hashes/_u64.js +6 -5
- package/node_modules/@noble/hashes/_u64.js.map +1 -1
- package/node_modules/@noble/hashes/argon2.d.ts +9 -9
- package/node_modules/@noble/hashes/argon2.d.ts.map +1 -1
- package/node_modules/@noble/hashes/argon2.js +62 -57
- package/node_modules/@noble/hashes/argon2.js.map +1 -1
- package/node_modules/@noble/hashes/blake1.d.ts +19 -39
- package/node_modules/@noble/hashes/blake1.d.ts.map +1 -1
- package/node_modules/@noble/hashes/blake1.js +107 -119
- package/node_modules/@noble/hashes/blake1.js.map +1 -1
- package/node_modules/@noble/hashes/blake2.d.ts +116 -0
- package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2.js +420 -0
- package/node_modules/@noble/hashes/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/blake2b.d.ts +6 -48
- package/node_modules/@noble/hashes/blake2b.d.ts.map +1 -1
- package/node_modules/@noble/hashes/blake2b.js +6 -189
- package/node_modules/@noble/hashes/blake2b.js.map +1 -1
- package/node_modules/@noble/hashes/blake2s.d.ts +14 -55
- package/node_modules/@noble/hashes/blake2s.d.ts.map +1 -1
- package/node_modules/@noble/hashes/blake2s.js +17 -125
- package/node_modules/@noble/hashes/blake2s.js.map +1 -1
- package/node_modules/@noble/hashes/blake3.d.ts +6 -6
- package/node_modules/@noble/hashes/blake3.d.ts.map +1 -1
- package/node_modules/@noble/hashes/blake3.js +62 -62
- package/node_modules/@noble/hashes/blake3.js.map +1 -1
- package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -1
- package/node_modules/@noble/hashes/eskdf.js +18 -20
- package/node_modules/@noble/hashes/eskdf.js.map +1 -1
- package/node_modules/@noble/hashes/esm/_assert.d.ts +12 -18
- package/node_modules/@noble/hashes/esm/_assert.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/_assert.js +10 -39
- package/node_modules/@noble/hashes/esm/_assert.js.map +1 -1
- package/node_modules/@noble/hashes/esm/_blake.d.ts +8 -28
- package/node_modules/@noble/hashes/esm/_blake.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/_blake.js +16 -104
- package/node_modules/@noble/hashes/esm/_blake.js.map +1 -1
- package/node_modules/@noble/hashes/esm/_md.d.ts +22 -5
- package/node_modules/@noble/hashes/esm/_md.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/_md.js +35 -10
- package/node_modules/@noble/hashes/esm/_md.js.map +1 -1
- package/node_modules/@noble/hashes/esm/_u64.d.ts +1 -1
- package/node_modules/@noble/hashes/esm/_u64.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/_u64.js +5 -4
- package/node_modules/@noble/hashes/esm/_u64.js.map +1 -1
- package/node_modules/@noble/hashes/esm/argon2.d.ts +9 -9
- package/node_modules/@noble/hashes/esm/argon2.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/argon2.js +44 -39
- package/node_modules/@noble/hashes/esm/argon2.js.map +1 -1
- package/node_modules/@noble/hashes/esm/blake1.d.ts +19 -39
- package/node_modules/@noble/hashes/esm/blake1.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/blake1.js +84 -96
- package/node_modules/@noble/hashes/esm/blake1.js.map +1 -1
- package/node_modules/@noble/hashes/esm/blake2.d.ts +116 -0
- package/node_modules/@noble/hashes/esm/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2.js +413 -0
- package/node_modules/@noble/hashes/esm/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/esm/blake2b.d.ts +6 -48
- package/node_modules/@noble/hashes/esm/blake2b.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/blake2b.js +6 -188
- package/node_modules/@noble/hashes/esm/blake2b.js.map +1 -1
- package/node_modules/@noble/hashes/esm/blake2s.d.ts +14 -55
- package/node_modules/@noble/hashes/esm/blake2s.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/blake2s.js +16 -120
- package/node_modules/@noble/hashes/esm/blake2s.js.map +1 -1
- package/node_modules/@noble/hashes/esm/blake3.d.ts +6 -6
- package/node_modules/@noble/hashes/esm/blake3.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/blake3.js +46 -57
- package/node_modules/@noble/hashes/esm/blake3.js.map +1 -1
- package/node_modules/@noble/hashes/esm/eskdf.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/eskdf.js +9 -11
- package/node_modules/@noble/hashes/esm/eskdf.js.map +1 -1
- package/node_modules/@noble/hashes/esm/hkdf.d.ts +1 -1
- package/node_modules/@noble/hashes/esm/hkdf.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/hkdf.js +10 -11
- package/node_modules/@noble/hashes/esm/hkdf.js.map +1 -1
- package/node_modules/@noble/hashes/esm/hmac.d.ts +6 -1
- package/node_modules/@noble/hashes/esm/hmac.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/hmac.js +5 -3
- package/node_modules/@noble/hashes/esm/hmac.js.map +1 -1
- package/node_modules/@noble/hashes/esm/index.js +3 -5
- package/node_modules/@noble/hashes/esm/index.js.map +1 -1
- package/node_modules/@noble/hashes/esm/legacy.d.ts +71 -0
- package/node_modules/@noble/hashes/esm/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/esm/legacy.js +281 -0
- package/node_modules/@noble/hashes/esm/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts +4 -4
- package/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/pbkdf2.js +8 -8
- package/node_modules/@noble/hashes/esm/pbkdf2.js.map +1 -1
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts +6 -17
- package/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/ripemd160.js +6 -96
- package/node_modules/@noble/hashes/esm/ripemd160.js.map +1 -1
- package/node_modules/@noble/hashes/esm/scrypt.d.ts +3 -3
- package/node_modules/@noble/hashes/esm/scrypt.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/scrypt.js +14 -19
- package/node_modules/@noble/hashes/esm/scrypt.js.map +1 -1
- package/node_modules/@noble/hashes/esm/sha1.d.ts +6 -17
- package/node_modules/@noble/hashes/esm/sha1.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/sha1.js +6 -79
- package/node_modules/@noble/hashes/esm/sha1.js.map +1 -1
- package/node_modules/@noble/hashes/esm/sha2.d.ts +155 -3
- package/node_modules/@noble/hashes/esm/sha2.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/sha2.js +371 -4
- package/node_modules/@noble/hashes/esm/sha2.js.map +1 -1
- package/node_modules/@noble/hashes/esm/sha256.d.ts +10 -22
- package/node_modules/@noble/hashes/esm/sha256.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/sha256.js +10 -120
- package/node_modules/@noble/hashes/esm/sha256.js.map +1 -1
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts +16 -4
- package/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/sha3-addons.js +27 -21
- package/node_modules/@noble/hashes/esm/sha3-addons.js.map +1 -1
- package/node_modules/@noble/hashes/esm/sha3.d.ts +7 -6
- package/node_modules/@noble/hashes/esm/sha3.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/sha3.js +42 -35
- package/node_modules/@noble/hashes/esm/sha3.js.map +1 -1
- package/node_modules/@noble/hashes/esm/sha512.d.ts +18 -108
- package/node_modules/@noble/hashes/esm/sha512.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/sha512.js +18 -234
- package/node_modules/@noble/hashes/esm/sha512.js.map +1 -1
- package/node_modules/@noble/hashes/esm/utils.d.ts +60 -19
- package/node_modules/@noble/hashes/esm/utils.d.ts.map +1 -1
- package/node_modules/@noble/hashes/esm/utils.js +94 -25
- package/node_modules/@noble/hashes/esm/utils.js.map +1 -1
- package/node_modules/@noble/hashes/hkdf.d.ts +1 -1
- package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -1
- package/node_modules/@noble/hashes/hkdf.js +15 -16
- package/node_modules/@noble/hashes/hkdf.js.map +1 -1
- package/node_modules/@noble/hashes/hmac.d.ts +6 -1
- package/node_modules/@noble/hashes/hmac.d.ts.map +1 -1
- package/node_modules/@noble/hashes/hmac.js +11 -9
- package/node_modules/@noble/hashes/hmac.js.map +1 -1
- package/node_modules/@noble/hashes/index.js +3 -5
- package/node_modules/@noble/hashes/index.js.map +1 -1
- package/node_modules/@noble/hashes/legacy.d.ts +71 -0
- package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/legacy.js +287 -0
- package/node_modules/@noble/hashes/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/package.json +104 -6
- package/node_modules/@noble/hashes/pbkdf2.d.ts +4 -4
- package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -1
- package/node_modules/@noble/hashes/pbkdf2.js +17 -17
- package/node_modules/@noble/hashes/pbkdf2.js.map +1 -1
- package/node_modules/@noble/hashes/ripemd160.d.ts +6 -17
- package/node_modules/@noble/hashes/ripemd160.d.ts.map +1 -1
- package/node_modules/@noble/hashes/ripemd160.js +6 -97
- package/node_modules/@noble/hashes/ripemd160.js.map +1 -1
- package/node_modules/@noble/hashes/scrypt.d.ts +3 -3
- package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -1
- package/node_modules/@noble/hashes/scrypt.js +60 -65
- package/node_modules/@noble/hashes/scrypt.js.map +1 -1
- package/node_modules/@noble/hashes/sha1.d.ts +6 -17
- package/node_modules/@noble/hashes/sha1.d.ts.map +1 -1
- package/node_modules/@noble/hashes/sha1.js +6 -80
- package/node_modules/@noble/hashes/sha1.js.map +1 -1
- package/node_modules/@noble/hashes/sha2.d.ts +155 -3
- package/node_modules/@noble/hashes/sha2.d.ts.map +1 -1
- package/node_modules/@noble/hashes/sha2.js +378 -11
- package/node_modules/@noble/hashes/sha2.js.map +1 -1
- package/node_modules/@noble/hashes/sha256.d.ts +10 -22
- package/node_modules/@noble/hashes/sha256.d.ts.map +1 -1
- package/node_modules/@noble/hashes/sha256.js +11 -122
- package/node_modules/@noble/hashes/sha256.js.map +1 -1
- package/node_modules/@noble/hashes/sha3-addons.d.ts +16 -4
- package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -1
- package/node_modules/@noble/hashes/sha3-addons.js +41 -35
- package/node_modules/@noble/hashes/sha3-addons.js.map +1 -1
- package/node_modules/@noble/hashes/sha3.d.ts +7 -6
- package/node_modules/@noble/hashes/sha3.d.ts.map +1 -1
- package/node_modules/@noble/hashes/sha3.js +52 -45
- package/node_modules/@noble/hashes/sha3.js.map +1 -1
- package/node_modules/@noble/hashes/sha512.d.ts +18 -108
- package/node_modules/@noble/hashes/sha512.d.ts.map +1 -1
- package/node_modules/@noble/hashes/sha512.js +19 -239
- package/node_modules/@noble/hashes/sha512.js.map +1 -1
- package/node_modules/@noble/hashes/src/_assert.ts +18 -50
- package/node_modules/@noble/hashes/src/_blake.ts +18 -115
- package/node_modules/@noble/hashes/src/_md.ts +47 -12
- package/node_modules/@noble/hashes/src/_u64.ts +5 -9
- package/node_modules/@noble/hashes/src/argon2.ts +60 -49
- package/node_modules/@noble/hashes/src/blake1.ts +112 -126
- package/node_modules/@noble/hashes/src/blake2.ts +486 -0
- package/node_modules/@noble/hashes/src/blake2b.ts +6 -205
- package/node_modules/@noble/hashes/src/blake2s.ts +16 -150
- package/node_modules/@noble/hashes/src/blake3.ts +53 -62
- package/node_modules/@noble/hashes/src/eskdf.ts +9 -11
- package/node_modules/@noble/hashes/src/hkdf.ts +10 -11
- package/node_modules/@noble/hashes/src/hmac.ts +5 -3
- package/node_modules/@noble/hashes/src/index.ts +3 -5
- package/node_modules/@noble/hashes/src/legacy.ts +293 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +20 -18
- package/node_modules/@noble/hashes/src/ripemd160.ts +6 -103
- package/node_modules/@noble/hashes/src/scrypt.ts +25 -20
- package/node_modules/@noble/hashes/src/sha1.ts +6 -79
- package/node_modules/@noble/hashes/src/sha2.ts +399 -4
- package/node_modules/@noble/hashes/src/sha256.ts +15 -127
- package/node_modules/@noble/hashes/src/sha3-addons.ts +34 -23
- package/node_modules/@noble/hashes/src/sha3.ts +59 -45
- package/node_modules/@noble/hashes/src/sha512.ts +27 -250
- package/node_modules/@noble/hashes/src/utils.ts +132 -42
- package/node_modules/@noble/hashes/utils.d.ts +60 -19
- package/node_modules/@noble/hashes/utils.d.ts.map +1 -1
- package/node_modules/@noble/hashes/utils.js +110 -33
- package/node_modules/@noble/hashes/utils.js.map +1 -1
- package/node_modules/{file-uri-to-path → @solana/codecs-core}/LICENSE +8 -8
- package/node_modules/@solana/codecs-core/README.md +662 -0
- package/node_modules/@solana/codecs-core/dist/index.browser.cjs +504 -0
- package/node_modules/@solana/codecs-core/dist/index.browser.cjs.map +1 -0
- package/node_modules/@solana/codecs-core/dist/index.browser.mjs +460 -0
- package/node_modules/@solana/codecs-core/dist/index.browser.mjs.map +1 -0
- package/node_modules/@solana/codecs-core/dist/index.native.mjs +460 -0
- package/node_modules/@solana/codecs-core/dist/index.native.mjs.map +1 -0
- package/node_modules/@solana/codecs-core/dist/index.node.cjs +504 -0
- package/node_modules/@solana/codecs-core/dist/index.node.cjs.map +1 -0
- package/node_modules/@solana/codecs-core/dist/index.node.mjs +460 -0
- package/node_modules/@solana/codecs-core/dist/index.node.mjs.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/add-codec-sentinel.d.ts +70 -0
- package/node_modules/@solana/codecs-core/dist/types/add-codec-sentinel.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/add-codec-size-prefix.d.ts +67 -0
- package/node_modules/@solana/codecs-core/dist/types/add-codec-size-prefix.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/assertions.d.ts +62 -0
- package/node_modules/@solana/codecs-core/dist/types/assertions.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/bytes.d.ts +92 -0
- package/node_modules/@solana/codecs-core/dist/types/bytes.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/codec.d.ts +827 -0
- package/node_modules/@solana/codecs-core/dist/types/codec.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/combine-codec.d.ts +75 -0
- package/node_modules/@solana/codecs-core/dist/types/combine-codec.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/fix-codec-size.d.ts +111 -0
- package/node_modules/@solana/codecs-core/dist/types/fix-codec-size.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/index.d.ts +667 -0
- package/node_modules/@solana/codecs-core/dist/types/index.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/offset-codec.d.ts +328 -0
- package/node_modules/@solana/codecs-core/dist/types/offset-codec.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/pad-codec.d.ts +162 -0
- package/node_modules/@solana/codecs-core/dist/types/pad-codec.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/readonly-uint8array.d.ts +19 -0
- package/node_modules/@solana/codecs-core/dist/types/readonly-uint8array.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/resize-codec.d.ts +129 -0
- package/node_modules/@solana/codecs-core/dist/types/resize-codec.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/reverse-codec.d.ts +92 -0
- package/node_modules/@solana/codecs-core/dist/types/reverse-codec.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/dist/types/transform-codec.d.ts +114 -0
- package/node_modules/@solana/codecs-core/dist/types/transform-codec.d.ts.map +1 -0
- package/node_modules/@solana/codecs-core/package.json +83 -0
- package/node_modules/@solana/codecs-numbers/LICENSE +20 -0
- package/node_modules/@solana/codecs-numbers/README.md +130 -0
- package/node_modules/@solana/codecs-numbers/dist/index.browser.cjs +331 -0
- package/node_modules/@solana/codecs-numbers/dist/index.browser.cjs.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/index.browser.mjs +289 -0
- package/node_modules/@solana/codecs-numbers/dist/index.browser.mjs.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/index.native.mjs +289 -0
- package/node_modules/@solana/codecs-numbers/dist/index.native.mjs.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/index.node.cjs +331 -0
- package/node_modules/@solana/codecs-numbers/dist/index.node.cjs.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/index.node.mjs +289 -0
- package/node_modules/@solana/codecs-numbers/dist/index.node.mjs.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/assertions.d.ts +27 -0
- package/node_modules/@solana/codecs-numbers/dist/types/assertions.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/common.d.ts +84 -0
- package/node_modules/@solana/codecs-numbers/dist/types/common.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/f32.d.ts +87 -0
- package/node_modules/@solana/codecs-numbers/dist/types/f32.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/f64.d.ts +87 -0
- package/node_modules/@solana/codecs-numbers/dist/types/f64.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i128.d.ts +91 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i128.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i16.d.ts +87 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i16.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i32.d.ts +87 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i32.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i64.d.ts +90 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i64.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i8.d.ts +75 -0
- package/node_modules/@solana/codecs-numbers/dist/types/i8.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/index.d.ts +26 -0
- package/node_modules/@solana/codecs-numbers/dist/types/index.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/short-u16.d.ts +96 -0
- package/node_modules/@solana/codecs-numbers/dist/types/short-u16.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u128.d.ts +87 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u128.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u16.d.ts +85 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u16.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u32.d.ts +85 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u32.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u64.d.ts +88 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u64.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u8.d.ts +71 -0
- package/node_modules/@solana/codecs-numbers/dist/types/u8.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/dist/types/utils.d.ts +18 -0
- package/node_modules/@solana/codecs-numbers/dist/types/utils.d.ts.map +1 -0
- package/node_modules/@solana/codecs-numbers/package.json +83 -0
- package/node_modules/@solana/errors/LICENSE +20 -0
- package/node_modules/@solana/errors/README.md +87 -0
- package/node_modules/@solana/errors/bin/cli.mjs +7 -0
- package/node_modules/@solana/errors/dist/cli.mjs +570 -0
- package/node_modules/@solana/errors/dist/index.browser.cjs +1084 -0
- package/node_modules/@solana/errors/dist/index.browser.cjs.map +1 -0
- package/node_modules/@solana/errors/dist/index.browser.mjs +852 -0
- package/node_modules/@solana/errors/dist/index.browser.mjs.map +1 -0
- package/node_modules/@solana/errors/dist/index.native.mjs +852 -0
- package/node_modules/@solana/errors/dist/index.native.mjs.map +1 -0
- package/node_modules/@solana/errors/dist/index.node.cjs +1084 -0
- package/node_modules/@solana/errors/dist/index.node.cjs.map +1 -0
- package/node_modules/@solana/errors/dist/index.node.mjs +852 -0
- package/node_modules/@solana/errors/dist/index.node.mjs.map +1 -0
- package/node_modules/@solana/errors/dist/types/codes.d.ts +275 -0
- package/node_modules/@solana/errors/dist/types/codes.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/context.d.ts +398 -0
- package/node_modules/@solana/errors/dist/types/context.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/error.d.ts +75 -0
- package/node_modules/@solana/errors/dist/types/error.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/index.d.ts +72 -0
- package/node_modules/@solana/errors/dist/types/index.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/instruction-error.d.ts +9 -0
- package/node_modules/@solana/errors/dist/types/instruction-error.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/json-rpc-error.d.ts +51 -0
- package/node_modules/@solana/errors/dist/types/json-rpc-error.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/message-formatter.d.ts +4 -0
- package/node_modules/@solana/errors/dist/types/message-formatter.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/messages.d.ts +16 -0
- package/node_modules/@solana/errors/dist/types/messages.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/rpc-enum-errors.d.ts +31 -0
- package/node_modules/@solana/errors/dist/types/rpc-enum-errors.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/stack-trace.d.ts +2 -0
- package/node_modules/@solana/errors/dist/types/stack-trace.d.ts.map +1 -0
- package/node_modules/@solana/errors/dist/types/transaction-error.d.ts +5 -0
- package/node_modules/@solana/errors/dist/types/transaction-error.d.ts.map +1 -0
- package/node_modules/@solana/errors/node_modules/chalk/package.json +83 -0
- package/node_modules/@solana/errors/node_modules/chalk/readme.md +297 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/index.d.ts +325 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/index.js +225 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/utilities.js +33 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/node_modules/@solana/errors/node_modules/chalk/source/vendor/supports-color/index.js +182 -0
- package/node_modules/{bindings/LICENSE.md → @solana/errors/node_modules/commander/LICENSE} +1 -1
- package/node_modules/@solana/errors/node_modules/commander/Readme.md +1149 -0
- package/node_modules/@solana/errors/node_modules/commander/esm.mjs +16 -0
- package/node_modules/@solana/errors/node_modules/commander/index.js +24 -0
- package/node_modules/@solana/errors/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/@solana/errors/node_modules/commander/lib/command.js +2662 -0
- package/node_modules/@solana/errors/node_modules/commander/lib/error.js +39 -0
- package/node_modules/@solana/errors/node_modules/commander/lib/help.js +709 -0
- package/node_modules/@solana/errors/node_modules/commander/lib/option.js +367 -0
- package/node_modules/@solana/errors/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/@solana/errors/node_modules/commander/package-support.json +16 -0
- package/node_modules/@solana/errors/node_modules/commander/package.json +82 -0
- package/node_modules/@solana/errors/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/@solana/errors/node_modules/commander/typings/index.d.ts +1045 -0
- package/node_modules/@solana/errors/package.json +84 -0
- package/node_modules/@solana/web3.js/README.md +4 -4
- package/node_modules/@solana/web3.js/lib/index.browser.cjs.js +10 -20
- package/node_modules/@solana/web3.js/lib/index.browser.cjs.js.map +1 -1
- package/node_modules/@solana/web3.js/lib/index.browser.esm.js +8 -18
- package/node_modules/@solana/web3.js/lib/index.browser.esm.js.map +1 -1
- package/node_modules/@solana/web3.js/lib/index.cjs.js +10 -20
- package/node_modules/@solana/web3.js/lib/index.cjs.js.map +1 -1
- package/node_modules/@solana/web3.js/lib/index.esm.js +8 -18
- package/node_modules/@solana/web3.js/lib/index.esm.js.map +1 -1
- package/node_modules/@solana/web3.js/lib/index.iife.js +213 -88
- package/node_modules/@solana/web3.js/lib/index.iife.js.map +1 -1
- package/node_modules/@solana/web3.js/lib/index.iife.min.js +2 -2
- package/node_modules/@solana/web3.js/lib/index.iife.min.js.map +1 -1
- package/node_modules/@solana/web3.js/lib/index.native.js +10 -20
- package/node_modules/@solana/web3.js/lib/index.native.js.map +1 -1
- package/node_modules/@solana/web3.js/package.json +5 -5
- package/node_modules/@solana/web3.js/src/programs/address-lookup-table/index.ts +5 -2
- package/node_modules/@solana/web3.js/src/utils/bigint.ts +14 -33
- package/node_modules/@swc/helpers/_/_overload_yield/package.json +4 -0
- package/node_modules/@swc/helpers/cjs/_async_generator.cjs +10 -12
- package/node_modules/@swc/helpers/cjs/_async_generator_delegate.cjs +11 -7
- package/node_modules/@swc/helpers/cjs/_await_async_generator.cjs +2 -2
- package/node_modules/@swc/helpers/cjs/_overload_yield.cjs +8 -0
- package/node_modules/@swc/helpers/cjs/index.cjs +4 -0
- package/node_modules/@swc/helpers/esm/_async_generator.js +10 -12
- package/node_modules/@swc/helpers/esm/_async_generator_delegate.js +11 -7
- package/node_modules/@swc/helpers/esm/_await_async_generator.js +2 -2
- package/node_modules/@swc/helpers/esm/_overload_yield.js +6 -0
- package/node_modules/@swc/helpers/esm/index.js +1 -0
- package/node_modules/@swc/helpers/package.json +219 -1
- package/node_modules/@swc/helpers/scripts/build.js +15 -3
- package/node_modules/@swc/helpers/src/_overload_yield.mjs +1 -0
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert.d.ts +7 -48
- package/node_modules/@types/node/async_hooks.d.ts +64 -2
- package/node_modules/@types/node/buffer.buffer.d.ts +3 -0
- package/node_modules/@types/node/buffer.d.ts +2 -2
- package/node_modules/@types/node/cluster.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +8 -9
- package/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
- package/node_modules/@types/node/fs/promises.d.ts +21 -24
- package/node_modules/@types/node/fs.d.ts +93 -9
- package/node_modules/@types/node/globals.d.ts +141 -281
- package/node_modules/@types/node/http.d.ts +22 -1
- package/node_modules/@types/node/http2.d.ts +3 -4
- package/node_modules/@types/node/inspector.d.ts +36 -0
- package/node_modules/@types/node/module.d.ts +25 -0
- package/node_modules/@types/node/net.d.ts +14 -8
- package/node_modules/@types/node/package.json +7 -2
- package/node_modules/@types/node/process.d.ts +22 -0
- package/node_modules/@types/node/querystring.d.ts +2 -3
- package/node_modules/@types/node/readline.d.ts +6 -1
- package/node_modules/@types/node/sqlite.d.ts +36 -13
- package/node_modules/@types/node/stream/web.d.ts +3 -3
- package/node_modules/@types/node/test.d.ts +54 -6
- package/node_modules/@types/node/tls.d.ts +34 -1
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +3 -0
- package/node_modules/@types/node/util.d.ts +232 -94
- package/node_modules/@types/node/v8.d.ts +81 -0
- package/node_modules/@types/node/vm.d.ts +20 -5
- package/node_modules/@types/node/zlib.d.ts +167 -36
- package/node_modules/bn.js/README.md +2 -2
- package/node_modules/bn.js/lib/bn.js +1 -0
- package/node_modules/bn.js/package.json +1 -1
- package/node_modules/{jsonparse/README.markdown → camelcase/license} +2 -4
- package/node_modules/jayson/lib/utils.js +11 -8
- package/node_modules/jayson/package.json +10 -7
- package/node_modules/rpc-websockets/node_modules/ws/lib/permessage-deflate.js +14 -0
- package/node_modules/rpc-websockets/node_modules/ws/lib/websocket.js +1 -1
- package/node_modules/rpc-websockets/node_modules/ws/package.json +2 -2
- package/node_modules/stream-chain/LICENSE +11 -0
- package/node_modules/stream-chain/README.md +334 -0
- package/node_modules/stream-chain/defs.js +22 -0
- package/node_modules/stream-chain/index.js +203 -0
- package/node_modules/stream-chain/package.json +31 -0
- package/node_modules/stream-chain/utils/FromIterable.js +94 -0
- package/node_modules/stream-chain/utils/Reduce.js +40 -0
- package/node_modules/stream-chain/utils/asFun.js +85 -0
- package/node_modules/stream-chain/utils/asGen.js +77 -0
- package/node_modules/stream-chain/utils/comp.js +20 -0
- package/node_modules/stream-chain/utils/fold.js +43 -0
- package/node_modules/stream-chain/utils/gen.js +24 -0
- package/node_modules/stream-chain/utils/scan.js +41 -0
- package/node_modules/stream-chain/utils/skip.js +32 -0
- package/node_modules/stream-chain/utils/skipWhile.js +46 -0
- package/node_modules/stream-chain/utils/take.js +39 -0
- package/node_modules/stream-chain/utils/takeWhile.js +47 -0
- package/node_modules/stream-json/Assembler.js +154 -0
- package/node_modules/stream-json/Disassembler.js +209 -0
- package/node_modules/stream-json/Emitter.js +22 -0
- package/node_modules/stream-json/LICENSE +34 -0
- package/node_modules/stream-json/Parser.js +545 -0
- package/node_modules/stream-json/README.md +128 -0
- package/node_modules/stream-json/Stringer.js +153 -0
- package/node_modules/stream-json/filters/Filter.js +130 -0
- package/node_modules/stream-json/filters/FilterBase.js +201 -0
- package/node_modules/stream-json/filters/Ignore.js +24 -0
- package/node_modules/stream-json/filters/Pick.js +58 -0
- package/node_modules/stream-json/filters/Replace.js +115 -0
- package/node_modules/stream-json/index.js +11 -0
- package/node_modules/stream-json/jsonl/Parser.js +131 -0
- package/node_modules/stream-json/jsonl/Stringer.js +29 -0
- package/node_modules/stream-json/package.json +45 -0
- package/node_modules/stream-json/streamers/StreamArray.js +44 -0
- package/node_modules/stream-json/streamers/StreamBase.js +101 -0
- package/node_modules/stream-json/streamers/StreamObject.js +43 -0
- package/node_modules/stream-json/streamers/StreamValues.js +33 -0
- package/node_modules/stream-json/utils/Batch.js +44 -0
- package/node_modules/stream-json/utils/Utf8Stream.js +53 -0
- package/node_modules/stream-json/utils/Verifier.js +485 -0
- package/node_modules/stream-json/utils/emit.js +5 -0
- package/node_modules/stream-json/utils/withParser.js +10 -0
- package/package.json +2 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/bls.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/bls.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/curve.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/curve.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/edwards.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/edwards.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/hash-to-curve.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/hash-to-curve.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/modular.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/modular.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/montgomery.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/montgomery.js +0 -160
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/montgomery.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/poseidon.d.ts +0 -39
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/poseidon.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/poseidon.js +0 -121
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/poseidon.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/tower.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/utils.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/utils.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/weierstrass.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/abstract/weierstrass.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/bls12-381.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/bn254.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/ed25519.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/ed25519.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/ed448.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/ed448.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/bls.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/bls.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/curve.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/curve.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/edwards.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/edwards.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/hash-to-curve.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/hash-to-curve.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/modular.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/modular.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/montgomery.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/montgomery.js +0 -157
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/montgomery.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/poseidon.d.ts +0 -39
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/poseidon.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/poseidon.js +0 -116
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/poseidon.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/tower.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/utils.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/utils.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/weierstrass.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/abstract/weierstrass.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/bls12-381.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/bn254.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/ed25519.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/ed25519.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/ed448.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/ed448.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/jubjub.d.ts +0 -5
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/jubjub.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/jubjub.js +0 -61
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/jubjub.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p256.d.ts +0 -11
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p256.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p256.js +0 -49
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p256.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p384.d.ts +0 -11
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p384.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p384.js +0 -53
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p384.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p521.d.ts +0 -12
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p521.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p521.js +0 -61
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/p521.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/pasta.d.ts +0 -8
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/pasta.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/pasta.js +0 -34
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/pasta.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/secp256k1.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/esm/secp256k1.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/jubjub.d.ts +0 -5
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/jubjub.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/jubjub.js +0 -66
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/jubjub.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p256.d.ts +0 -11
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p256.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p256.js +0 -52
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p256.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p384.d.ts +0 -11
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p384.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p384.js +0 -56
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p384.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p521.d.ts +0 -12
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p521.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p521.js +0 -64
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/p521.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/pasta.d.ts +0 -8
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/pasta.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/pasta.js +0 -37
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/pasta.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/secp256k1.d.ts.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/secp256k1.js.map +0 -1
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/src/abstract/montgomery.ts +0 -196
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/src/abstract/poseidon.ts +0 -136
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/src/jubjub.ts +0 -63
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/src/p256.ts +0 -54
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/src/p384.ts +0 -58
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/src/p521.ts +0 -75
- package/node_modules/@solana/web3.js/node_modules/@noble/curves/src/pasta.ts +0 -39
- package/node_modules/JSONStream/.travis.yml +0 -8
- package/node_modules/JSONStream/LICENSE.APACHE2 +0 -15
- package/node_modules/JSONStream/LICENSE.MIT +0 -24
- package/node_modules/JSONStream/bin.js +0 -12
- package/node_modules/JSONStream/examples/all_docs.js +0 -13
- package/node_modules/JSONStream/index.js +0 -247
- package/node_modules/JSONStream/package.json +0 -40
- package/node_modules/JSONStream/readme.markdown +0 -207
- package/node_modules/JSONStream/test/bool.js +0 -41
- package/node_modules/JSONStream/test/browser.js +0 -18
- package/node_modules/JSONStream/test/destroy_missing.js +0 -27
- package/node_modules/JSONStream/test/doubledot1.js +0 -29
- package/node_modules/JSONStream/test/doubledot2.js +0 -30
- package/node_modules/JSONStream/test/empty.js +0 -44
- package/node_modules/JSONStream/test/error_contents.js +0 -45
- package/node_modules/JSONStream/test/fixtures/all_npm.json +0 -4030
- package/node_modules/JSONStream/test/fixtures/couch_sample.json +0 -18
- package/node_modules/JSONStream/test/fixtures/depth.json +0 -15
- package/node_modules/JSONStream/test/fixtures/error.json +0 -1
- package/node_modules/JSONStream/test/fixtures/header_footer.json +0 -19
- package/node_modules/JSONStream/test/fn.js +0 -39
- package/node_modules/JSONStream/test/gen.js +0 -135
- package/node_modules/JSONStream/test/header_footer.js +0 -55
- package/node_modules/JSONStream/test/issues.js +0 -34
- package/node_modules/JSONStream/test/keys.js +0 -105
- package/node_modules/JSONStream/test/map.js +0 -40
- package/node_modules/JSONStream/test/multiple_objects.js +0 -36
- package/node_modules/JSONStream/test/multiple_objects_error.js +0 -29
- package/node_modules/JSONStream/test/null.js +0 -28
- package/node_modules/JSONStream/test/parsejson.js +0 -29
- package/node_modules/JSONStream/test/run.js +0 -13
- package/node_modules/JSONStream/test/stringify.js +0 -41
- package/node_modules/JSONStream/test/stringify_object.js +0 -47
- package/node_modules/JSONStream/test/test.js +0 -35
- package/node_modules/JSONStream/test/test2.js +0 -29
- package/node_modules/JSONStream/test/two-ways.js +0 -41
- package/node_modules/bigint-buffer/.travis.yml +0 -51
- package/node_modules/bigint-buffer/LICENSE +0 -202
- package/node_modules/bigint-buffer/README.md +0 -121
- package/node_modules/bigint-buffer/binding.gyp +0 -8
- package/node_modules/bigint-buffer/build/Makefile +0 -347
- package/node_modules/bigint-buffer/build/Release/.deps/Release/bigint_buffer.node.d +0 -1
- package/node_modules/bigint-buffer/build/Release/.deps/Release/obj.target/bigint_buffer/src/bigint-buffer.o.d +0 -12
- package/node_modules/bigint-buffer/build/Release/bigint_buffer.node +0 -0
- package/node_modules/bigint-buffer/build/Release/obj.target/bigint_buffer/src/bigint-buffer.o +0 -0
- package/node_modules/bigint-buffer/build/bigint_buffer.target.mk +0 -180
- package/node_modules/bigint-buffer/build/binding.Makefile +0 -6
- package/node_modules/bigint-buffer/build/config.gypi +0 -450
- package/node_modules/bigint-buffer/build/gyp-mac-tool +0 -772
- package/node_modules/bigint-buffer/dist/browser.js +0 -69
- package/node_modules/bigint-buffer/dist/index.bench.d.ts +0 -1
- package/node_modules/bigint-buffer/dist/index.d.ts +0 -27
- package/node_modules/bigint-buffer/dist/index.spec.d.ts +0 -1
- package/node_modules/bigint-buffer/dist/node.js +0 -77
- package/node_modules/bigint-buffer/helper/bigint.d.ts +0 -3
- package/node_modules/bigint-buffer/karma.conf.js +0 -62
- package/node_modules/bigint-buffer/package.json +0 -89
- package/node_modules/bigint-buffer/rollup.config.js +0 -13
- package/node_modules/bigint-buffer/src/bigint-buffer.c +0 -203
- package/node_modules/bigint-buffer/src/index.bench.ts +0 -207
- package/node_modules/bigint-buffer/src/index.spec.ts +0 -288
- package/node_modules/bigint-buffer/src/index.ts +0 -84
- package/node_modules/bigint-buffer/tsconfig.json +0 -19
- package/node_modules/bindings/README.md +0 -98
- package/node_modules/bindings/bindings.js +0 -221
- package/node_modules/bindings/package.json +0 -28
- package/node_modules/file-uri-to-path/.npmignore +0 -1
- package/node_modules/file-uri-to-path/.travis.yml +0 -30
- package/node_modules/file-uri-to-path/History.md +0 -21
- package/node_modules/file-uri-to-path/README.md +0 -74
- package/node_modules/file-uri-to-path/index.d.ts +0 -2
- package/node_modules/file-uri-to-path/index.js +0 -66
- package/node_modules/file-uri-to-path/package.json +0 -32
- package/node_modules/file-uri-to-path/test/test.js +0 -24
- package/node_modules/file-uri-to-path/test/tests.json +0 -13
- package/node_modules/jsonparse/.npmignore +0 -1
- package/node_modules/jsonparse/LICENSE +0 -24
- package/node_modules/jsonparse/bench.js +0 -26
- package/node_modules/jsonparse/examples/twitterfeed.js +0 -30
- package/node_modules/jsonparse/jsonparse.js +0 -413
- package/node_modules/jsonparse/package.json +0 -22
- package/node_modules/jsonparse/samplejson/basic.json +0 -167
- package/node_modules/jsonparse/samplejson/basic2.json +0 -180
- package/node_modules/jsonparse/test/big-token.js +0 -24
- package/node_modules/jsonparse/test/boundary.js +0 -110
- package/node_modules/jsonparse/test/offset.js +0 -67
- package/node_modules/jsonparse/test/primitives.js +0 -57
- package/node_modules/jsonparse/test/surrogate.js +0 -26
- package/node_modules/jsonparse/test/unvalid.js +0 -15
- package/node_modules/jsonparse/test/utf8.js +0 -38
- package/node_modules/regenerator-runtime/LICENSE +0 -21
- package/node_modules/regenerator-runtime/README.md +0 -31
- package/node_modules/regenerator-runtime/package.json +0 -19
- package/node_modules/regenerator-runtime/path.js +0 -11
- package/node_modules/regenerator-runtime/runtime.js +0 -761
- package/node_modules/through/.travis.yml +0 -5
- package/node_modules/through/LICENSE.APACHE2 +0 -15
- package/node_modules/through/LICENSE.MIT +0 -24
- package/node_modules/through/index.js +0 -108
- package/node_modules/through/package.json +0 -36
- package/node_modules/through/readme.markdown +0 -64
- package/node_modules/through/test/async.js +0 -28
- package/node_modules/through/test/auto-destroy.js +0 -30
- package/node_modules/through/test/buffering.js +0 -71
- package/node_modules/through/test/end.js +0 -45
- package/node_modules/through/test/index.js +0 -133
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/LICENSE +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/_shortw_utils.d.ts.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/_shortw_utils.js.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/_shortw_utils.d.ts.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/_shortw_utils.js.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/index.d.ts +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/index.d.ts.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/index.js +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/index.js.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/esm/package.json +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/index.d.ts +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/index.d.ts.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/index.js +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/index.js.map +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/index.ts +0 -0
- /package/node_modules/{@solana/web3.js/node_modules/@noble → @noble}/curves/src/package.json +0 -0
- /package/node_modules/{@coral-xyz/anchor/node_modules/camelcase → @solana/errors/node_modules/chalk}/license +0 -0
- /package/node_modules/{@coral-xyz/anchor/node_modules/camelcase → camelcase}/index.d.ts +0 -0
- /package/node_modules/{@coral-xyz/anchor/node_modules/camelcase → camelcase}/index.js +0 -0
- /package/node_modules/{@coral-xyz/anchor/node_modules/camelcase → camelcase}/package.json +0 -0
- /package/node_modules/{@coral-xyz/anchor/node_modules/camelcase → camelcase}/readme.md +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/CopyrightNotice.txt +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/LICENSE.txt +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/README.md +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/SECURITY.md +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/modules/index.d.ts +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/modules/index.js +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/modules/package.json +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/package.json +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/tslib.d.ts +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/tslib.es6.html +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/tslib.es6.js +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/tslib.es6.mjs +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/tslib.html +0 -0
- /package/node_modules/{@swc/helpers/node_modules/tslib → tslib}/tslib.js +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from './codec';
|
|
2
|
+
/**
|
|
3
|
+
* Reverses the bytes of a fixed-size encoder.
|
|
4
|
+
*
|
|
5
|
+
* Given a `FixedSizeEncoder`, this function returns a new `FixedSizeEncoder` that
|
|
6
|
+
* reverses the bytes within the fixed-size byte array when encoding.
|
|
7
|
+
*
|
|
8
|
+
* This can be useful to modify endianness or for other byte-order transformations.
|
|
9
|
+
*
|
|
10
|
+
* For more details, see {@link reverseCodec}.
|
|
11
|
+
*
|
|
12
|
+
* @typeParam TFrom - The type of the value to encode.
|
|
13
|
+
* @typeParam TSize - The fixed size of the encoded value in bytes.
|
|
14
|
+
*
|
|
15
|
+
* @param encoder - The fixed-size encoder to reverse.
|
|
16
|
+
* @returns A new encoder that writes bytes in reverse order.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* Encoding a `u16` value in reverse order.
|
|
20
|
+
* ```ts
|
|
21
|
+
* const encoder = reverseEncoder(getU16Encoder({ endian: Endian.Big }));
|
|
22
|
+
* const bytes = encoder.encode(0x1234); // 0x3412 (bytes are flipped)
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link reverseCodec}
|
|
26
|
+
* @see {@link reverseDecoder}
|
|
27
|
+
*/
|
|
28
|
+
export declare function reverseEncoder<TFrom, TSize extends number>(encoder: FixedSizeEncoder<TFrom, TSize>): FixedSizeEncoder<TFrom, TSize>;
|
|
29
|
+
/**
|
|
30
|
+
* Reverses the bytes of a fixed-size decoder.
|
|
31
|
+
*
|
|
32
|
+
* Given a `FixedSizeDecoder`, this function returns a new `FixedSizeDecoder` that
|
|
33
|
+
* reverses the bytes within the fixed-size byte array before decoding.
|
|
34
|
+
*
|
|
35
|
+
* This can be useful to modify endianness or for other byte-order transformations.
|
|
36
|
+
*
|
|
37
|
+
* For more details, see {@link reverseCodec}.
|
|
38
|
+
*
|
|
39
|
+
* @typeParam TTo - The type of the decoded value.
|
|
40
|
+
* @typeParam TSize - The fixed size of the decoded value in bytes.
|
|
41
|
+
*
|
|
42
|
+
* @param decoder - The fixed-size decoder to reverse.
|
|
43
|
+
* @returns A new decoder that reads bytes in reverse order.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* Decoding a reversed `u16` value.
|
|
47
|
+
* ```ts
|
|
48
|
+
* const decoder = reverseDecoder(getU16Decoder({ endian: Endian.Big }));
|
|
49
|
+
* const value = decoder.decode(new Uint8Array([0x34, 0x12])); // 0x1234 (bytes are flipped back)
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link reverseCodec}
|
|
53
|
+
* @see {@link reverseEncoder}
|
|
54
|
+
*/
|
|
55
|
+
export declare function reverseDecoder<TTo, TSize extends number>(decoder: FixedSizeDecoder<TTo, TSize>): FixedSizeDecoder<TTo, TSize>;
|
|
56
|
+
/**
|
|
57
|
+
* Reverses the bytes of a fixed-size codec.
|
|
58
|
+
*
|
|
59
|
+
* Given a `FixedSizeCodec`, this function returns a new `FixedSizeCodec` that
|
|
60
|
+
* reverses the bytes within the fixed-size byte array during encoding and decoding.
|
|
61
|
+
*
|
|
62
|
+
* This can be useful to modify endianness or for other byte-order transformations.
|
|
63
|
+
*
|
|
64
|
+
* @typeParam TFrom - The type of the value to encode.
|
|
65
|
+
* @typeParam TTo - The type of the decoded value.
|
|
66
|
+
* @typeParam TSize - The fixed size of the encoded/decoded value in bytes.
|
|
67
|
+
*
|
|
68
|
+
* @param codec - The fixed-size codec to reverse.
|
|
69
|
+
* @returns A new codec that encodes and decodes bytes in reverse order.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* Reversing a `u16` codec.
|
|
73
|
+
* ```ts
|
|
74
|
+
* const codec = reverseCodec(getU16Codec({ endian: Endian.Big }));
|
|
75
|
+
* const bytes = codec.encode(0x1234); // 0x3412 (bytes are flipped)
|
|
76
|
+
* const value = codec.decode(bytes); // 0x1234 (bytes are flipped back)
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* If you only need to reverse an encoder, use {@link reverseEncoder}.
|
|
81
|
+
* If you only need to reverse a decoder, use {@link reverseDecoder}.
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* const bytes = reverseEncoder(getU16Encoder()).encode(0x1234);
|
|
85
|
+
* const value = reverseDecoder(getU16Decoder()).decode(bytes);
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @see {@link reverseEncoder}
|
|
89
|
+
* @see {@link reverseDecoder}
|
|
90
|
+
*/
|
|
91
|
+
export declare function reverseCodec<TFrom, TTo extends TFrom, TSize extends number>(codec: FixedSizeCodec<TFrom, TTo, TSize>): FixedSizeCodec<TFrom, TTo, TSize>;
|
|
92
|
+
//# sourceMappingURL=reverse-codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reverse-codec.d.ts","sourceRoot":"","sources":["../../src/reverse-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EACnB,MAAM,SAAS,CAAC;AAsBjB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,EACtD,OAAO,EAAE,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,GACxC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAehC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,SAAS,MAAM,EACpD,OAAO,EAAE,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,GACtC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAe9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,GAAG,SAAS,KAAK,EAAE,KAAK,SAAS,MAAM,EACvE,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,GACzC,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAEnC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { Codec, Decoder, Encoder, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from './codec';
|
|
2
|
+
import { ReadonlyUint8Array } from './readonly-uint8array';
|
|
3
|
+
/**
|
|
4
|
+
* Transforms an encoder by mapping its input values.
|
|
5
|
+
*
|
|
6
|
+
* This function takes an existing `Encoder<A>` and returns an `Encoder<B>`, allowing values of type `B`
|
|
7
|
+
* to be converted into values of type `A` before encoding. The transformation is applied via the `unmap` function.
|
|
8
|
+
*
|
|
9
|
+
* This is useful for handling type conversions, applying default values, or structuring data before encoding.
|
|
10
|
+
*
|
|
11
|
+
* For more details, see {@link transformCodec}.
|
|
12
|
+
*
|
|
13
|
+
* @typeParam TOldFrom - The original type expected by the encoder.
|
|
14
|
+
* @typeParam TNewFrom - The new type that will be transformed before encoding.
|
|
15
|
+
*
|
|
16
|
+
* @param encoder - The encoder to transform.
|
|
17
|
+
* @param unmap - A function that converts values of `TNewFrom` into `TOldFrom` before encoding.
|
|
18
|
+
* @returns A new encoder that accepts `TNewFrom` values and transforms them before encoding.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* Encoding a string by counting its characters and storing the length as a `u32`.
|
|
22
|
+
* ```ts
|
|
23
|
+
* const encoder = transformEncoder(getU32Encoder(), (value: string) => value.length);
|
|
24
|
+
* encoder.encode("hello"); // 0x05000000 (stores length 5)
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see {@link transformCodec}
|
|
28
|
+
* @see {@link transformDecoder}
|
|
29
|
+
*/
|
|
30
|
+
export declare function transformEncoder<TOldFrom, TNewFrom, TSize extends number>(encoder: FixedSizeEncoder<TOldFrom, TSize>, unmap: (value: TNewFrom) => TOldFrom): FixedSizeEncoder<TNewFrom, TSize>;
|
|
31
|
+
export declare function transformEncoder<TOldFrom, TNewFrom>(encoder: VariableSizeEncoder<TOldFrom>, unmap: (value: TNewFrom) => TOldFrom): VariableSizeEncoder<TNewFrom>;
|
|
32
|
+
export declare function transformEncoder<TOldFrom, TNewFrom>(encoder: Encoder<TOldFrom>, unmap: (value: TNewFrom) => TOldFrom): Encoder<TNewFrom>;
|
|
33
|
+
/**
|
|
34
|
+
* Transforms a decoder by mapping its output values.
|
|
35
|
+
*
|
|
36
|
+
* This function takes an existing `Decoder<A>` and returns a `Decoder<B>`, allowing values of type `A`
|
|
37
|
+
* to be converted into values of type `B` after decoding. The transformation is applied via the `map` function.
|
|
38
|
+
*
|
|
39
|
+
* This is useful for post-processing, type conversions, or enriching decoded data.
|
|
40
|
+
*
|
|
41
|
+
* For more details, see {@link transformCodec}.
|
|
42
|
+
*
|
|
43
|
+
* @typeParam TOldTo - The original type returned by the decoder.
|
|
44
|
+
* @typeParam TNewTo - The new type that will be transformed after decoding.
|
|
45
|
+
*
|
|
46
|
+
* @param decoder - The decoder to transform.
|
|
47
|
+
* @param map - A function that converts values of `TOldTo` into `TNewTo` after decoding.
|
|
48
|
+
* @returns A new decoder that decodes into `TNewTo`.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* Decoding a stored `u32` length into a string of `'x'` characters.
|
|
52
|
+
* ```ts
|
|
53
|
+
* const decoder = transformDecoder(getU32Decoder(), (length) => 'x'.repeat(length));
|
|
54
|
+
* decoder.decode(new Uint8Array([0x05, 0x00, 0x00, 0x00])); // "xxxxx"
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @see {@link transformCodec}
|
|
58
|
+
* @see {@link transformEncoder}
|
|
59
|
+
*/
|
|
60
|
+
export declare function transformDecoder<TOldTo, TNewTo, TSize extends number>(decoder: FixedSizeDecoder<TOldTo, TSize>, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): FixedSizeDecoder<TNewTo, TSize>;
|
|
61
|
+
export declare function transformDecoder<TOldTo, TNewTo>(decoder: VariableSizeDecoder<TOldTo>, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): VariableSizeDecoder<TNewTo>;
|
|
62
|
+
export declare function transformDecoder<TOldTo, TNewTo>(decoder: Decoder<TOldTo>, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): Decoder<TNewTo>;
|
|
63
|
+
/**
|
|
64
|
+
* Transforms a codec by mapping its input and output values.
|
|
65
|
+
*
|
|
66
|
+
* This function takes an existing `Codec<A, B>` and returns a `Codec<C, D>`, allowing:
|
|
67
|
+
* - Values of type `C` to be transformed into `A` before encoding.
|
|
68
|
+
* - Values of type `B` to be transformed into `D` after decoding.
|
|
69
|
+
*
|
|
70
|
+
* This is useful for adapting codecs to work with different representations, handling default values, or
|
|
71
|
+
* converting between primitive and structured types.
|
|
72
|
+
*
|
|
73
|
+
* @typeParam TOldFrom - The original type expected by the codec.
|
|
74
|
+
* @typeParam TNewFrom - The new type that will be transformed before encoding.
|
|
75
|
+
* @typeParam TOldTo - The original type returned by the codec.
|
|
76
|
+
* @typeParam TNewTo - The new type that will be transformed after decoding.
|
|
77
|
+
*
|
|
78
|
+
* @param codec - The codec to transform.
|
|
79
|
+
* @param unmap - A function that converts values of `TNewFrom` into `TOldFrom` before encoding.
|
|
80
|
+
* @param map - A function that converts values of `TOldTo` into `TNewTo` after decoding (optional).
|
|
81
|
+
* @returns A new codec that encodes `TNewFrom` and decodes into `TNewTo`.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* Mapping a `u32` codec to encode string lengths and decode them into `'x'` characters.
|
|
85
|
+
* ```ts
|
|
86
|
+
* const codec = transformCodec(
|
|
87
|
+
* getU32Codec(),
|
|
88
|
+
* (value: string) => value.length, // Encode string length
|
|
89
|
+
* (length) => 'x'.repeat(length) // Decode length into a string of 'x's
|
|
90
|
+
* );
|
|
91
|
+
*
|
|
92
|
+
* const bytes = codec.encode("hello"); // 0x05000000 (stores length 5)
|
|
93
|
+
* const value = codec.decode(bytes); // "xxxxx"
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* If only input transformation is needed, use {@link transformEncoder}.
|
|
98
|
+
* If only output transformation is needed, use {@link transformDecoder}.
|
|
99
|
+
*
|
|
100
|
+
* ```ts
|
|
101
|
+
* const bytes = transformEncoder(getU32Encoder(), (value: string) => value.length).encode("hello");
|
|
102
|
+
* const value = transformDecoder(getU32Decoder(), (length) => 'x'.repeat(length)).decode(bytes);
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* @see {@link transformEncoder}
|
|
106
|
+
* @see {@link transformDecoder}
|
|
107
|
+
*/
|
|
108
|
+
export declare function transformCodec<TOldFrom, TNewFrom, TTo extends TNewFrom & TOldFrom, TSize extends number>(codec: FixedSizeCodec<TOldFrom, TTo, TSize>, unmap: (value: TNewFrom) => TOldFrom): FixedSizeCodec<TNewFrom, TTo, TSize>;
|
|
109
|
+
export declare function transformCodec<TOldFrom, TNewFrom, TTo extends TNewFrom & TOldFrom>(codec: VariableSizeCodec<TOldFrom, TTo>, unmap: (value: TNewFrom) => TOldFrom): VariableSizeCodec<TNewFrom, TTo>;
|
|
110
|
+
export declare function transformCodec<TOldFrom, TNewFrom, TTo extends TNewFrom & TOldFrom>(codec: Codec<TOldFrom, TTo>, unmap: (value: TNewFrom) => TOldFrom): Codec<TNewFrom, TTo>;
|
|
111
|
+
export declare function transformCodec<TOldFrom, TNewFrom, TOldTo extends TOldFrom, TNewTo extends TNewFrom, TSize extends number>(codec: FixedSizeCodec<TOldFrom, TOldTo, TSize>, unmap: (value: TNewFrom) => TOldFrom, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): FixedSizeCodec<TNewFrom, TNewTo, TSize>;
|
|
112
|
+
export declare function transformCodec<TOldFrom, TNewFrom, TOldTo extends TOldFrom, TNewTo extends TNewFrom>(codec: VariableSizeCodec<TOldFrom, TOldTo>, unmap: (value: TNewFrom) => TOldFrom, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): VariableSizeCodec<TNewFrom, TNewTo>;
|
|
113
|
+
export declare function transformCodec<TOldFrom, TNewFrom, TOldTo extends TOldFrom, TNewTo extends TNewFrom>(codec: Codec<TOldFrom, TOldTo>, unmap: (value: TNewFrom) => TOldFrom, map: (value: TOldTo, bytes: ReadonlyUint8Array | Uint8Array, offset: number) => TNewTo): Codec<TNewFrom, TNewTo>;
|
|
114
|
+
//# sourceMappingURL=transform-codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-codec.d.ts","sourceRoot":"","sources":["../../src/transform-codec.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAIL,OAAO,EACP,OAAO,EACP,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAEhB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,SAAS,MAAM,EACrE,OAAO,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,EAC1C,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,GACrC,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACrC,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAC/C,OAAO,EAAE,mBAAmB,CAAC,QAAQ,CAAC,EACtC,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,GACrC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACjC,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAC/C,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,GACrC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAarB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAS,MAAM,EACjE,OAAO,EAAE,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,EACxC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GACvF,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACnC,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAC3C,OAAO,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACpC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GACvF,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC/B,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAC3C,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,EACxB,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GACvF,OAAO,CAAC,MAAM,CAAC,CAAC;AAcnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,GAAG,QAAQ,EAAE,KAAK,SAAS,MAAM,EACpG,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,EAC3C,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,GACrC,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACxC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,GAAG,QAAQ,EAC9E,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,EACvC,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,GACrC,iBAAiB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AACpC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,GAAG,QAAQ,EAC9E,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,EAC3B,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,GACrC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AACxB,wBAAgB,cAAc,CAC1B,QAAQ,EACR,QAAQ,EACR,MAAM,SAAS,QAAQ,EACvB,MAAM,SAAS,QAAQ,EACvB,KAAK,SAAS,MAAM,EAEpB,KAAK,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAC9C,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,EACpC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GACvF,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC3C,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,QAAQ,EAAE,MAAM,SAAS,QAAQ,EAC/F,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC1C,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,EACpC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GACvF,iBAAiB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACvC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,QAAQ,EAAE,MAAM,SAAS,QAAQ,EAC/F,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,EAC9B,KAAK,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,EACpC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GACvF,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solana/codecs-core",
|
|
3
|
+
"version": "2.1.1",
|
|
4
|
+
"description": "Core types and helpers for encoding and decoding byte arrays on Solana",
|
|
5
|
+
"exports": {
|
|
6
|
+
"edge-light": {
|
|
7
|
+
"import": "./dist/index.node.mjs",
|
|
8
|
+
"require": "./dist/index.node.cjs"
|
|
9
|
+
},
|
|
10
|
+
"workerd": {
|
|
11
|
+
"import": "./dist/index.node.mjs",
|
|
12
|
+
"require": "./dist/index.node.cjs"
|
|
13
|
+
},
|
|
14
|
+
"browser": {
|
|
15
|
+
"import": "./dist/index.browser.mjs",
|
|
16
|
+
"require": "./dist/index.browser.cjs"
|
|
17
|
+
},
|
|
18
|
+
"node": {
|
|
19
|
+
"import": "./dist/index.node.mjs",
|
|
20
|
+
"require": "./dist/index.node.cjs"
|
|
21
|
+
},
|
|
22
|
+
"react-native": "./dist/index.native.mjs",
|
|
23
|
+
"types": "./dist/types/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"browser": {
|
|
26
|
+
"./dist/index.node.cjs": "./dist/index.browser.cjs",
|
|
27
|
+
"./dist/index.node.mjs": "./dist/index.browser.mjs"
|
|
28
|
+
},
|
|
29
|
+
"main": "./dist/index.node.cjs",
|
|
30
|
+
"module": "./dist/index.node.mjs",
|
|
31
|
+
"react-native": "./dist/index.native.mjs",
|
|
32
|
+
"types": "./dist/types/index.d.ts",
|
|
33
|
+
"type": "commonjs",
|
|
34
|
+
"files": [
|
|
35
|
+
"./dist/"
|
|
36
|
+
],
|
|
37
|
+
"sideEffects": false,
|
|
38
|
+
"keywords": [
|
|
39
|
+
"blockchain",
|
|
40
|
+
"solana",
|
|
41
|
+
"web3"
|
|
42
|
+
],
|
|
43
|
+
"author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/anza-xyz/kit"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/anza-xyz/kit/issues"
|
|
51
|
+
},
|
|
52
|
+
"browserslist": [
|
|
53
|
+
"supports bigint and not dead",
|
|
54
|
+
"maintained node versions"
|
|
55
|
+
],
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@solana/errors": "2.1.1"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"typescript": ">=5.3.3"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=20.18.0"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"benchmark": "./src/__benchmarks__/run.ts",
|
|
67
|
+
"compile:docs": "typedoc",
|
|
68
|
+
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
|
|
69
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
70
|
+
"dev": "jest -c ../../node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
71
|
+
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ \"$PUBLISH_TAG\" != \"canary\" ] && pnpm dist-tag add $npm_package_name@$npm_package_version latest) || true))",
|
|
72
|
+
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
|
|
73
|
+
"style:fix": "pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*",
|
|
74
|
+
"test:lint": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
75
|
+
"test:prettier": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
76
|
+
"test:treeshakability:browser": "agadoo dist/index.browser.mjs",
|
|
77
|
+
"test:treeshakability:native": "agadoo dist/index.native.mjs",
|
|
78
|
+
"test:treeshakability:node": "agadoo dist/index.node.mjs",
|
|
79
|
+
"test:typecheck": "tsc --noEmit",
|
|
80
|
+
"test:unit:browser": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
|
|
81
|
+
"test:unit:node": "TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2023 Solana Labs, Inc
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
[![npm][npm-image]][npm-url]
|
|
2
|
+
[![npm-downloads][npm-downloads-image]][npm-url]
|
|
3
|
+
<br />
|
|
4
|
+
[![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]
|
|
5
|
+
|
|
6
|
+
[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square
|
|
7
|
+
[code-style-prettier-url]: https://github.com/prettier/prettier
|
|
8
|
+
[npm-downloads-image]: https://img.shields.io/npm/dm/@solana/codecs-numbers?style=flat
|
|
9
|
+
[npm-image]: https://img.shields.io/npm/v/@solana/codecs-numbers?style=flat
|
|
10
|
+
[npm-url]: https://www.npmjs.com/package/@solana/codecs-numbers
|
|
11
|
+
|
|
12
|
+
# @solana/codecs-numbers
|
|
13
|
+
|
|
14
|
+
This package contains codecs for numbers of different sizes and endianness. It can be used standalone, but it is also exported as part of Kit [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).
|
|
15
|
+
|
|
16
|
+
This package is also part of the [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs) which acts as an entry point for all codec packages as well as for their documentation.
|
|
17
|
+
|
|
18
|
+
## Integer codecs
|
|
19
|
+
|
|
20
|
+
This package provides ten codecs of five different byte sizes for integers. Five of them store unsigned integers and the other five store signed integers.
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// Unsigned integers.
|
|
24
|
+
getU8Codec().encode(42); // 0x2a
|
|
25
|
+
getU16Codec().encode(42); // 0x2a00
|
|
26
|
+
getU32Codec().encode(42); // 0x2a000000
|
|
27
|
+
getU64Codec().encode(42); // 0x2a00000000000000
|
|
28
|
+
getU128Codec().encode(42); // 0x2a000000000000000000000000000000
|
|
29
|
+
|
|
30
|
+
// Signed integers.
|
|
31
|
+
getI8Codec().encode(-42); // 0xd6
|
|
32
|
+
getI16Codec().encode(-42); // 0xd6ff
|
|
33
|
+
getI32Codec().encode(-42); // 0xd6ffffff
|
|
34
|
+
getI64Codec().encode(-42); // 0xd6ffffffffffffff
|
|
35
|
+
getI128Codec().encode(-42); // 0xd6ffffffffffffffffffffffffffffff
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
By default, integers are stored using little endianness but you may change this behaviour via the `endian` option. This option is available for every codec that uses more than a single byte.
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
// Big-endian unsigned integers.
|
|
42
|
+
getU16Codec({ endian: Endian.Big }).encode(42); // 0x002a
|
|
43
|
+
getU32Codec({ endian: Endian.Big }).encode(42); // 0x0000002a
|
|
44
|
+
getU64Codec({ endian: Endian.Big }).encode(42); // 0x000000000000002a
|
|
45
|
+
getU128Codec({ endian: Endian.Big }).encode(42); // 0x0000000000000000000000000000002a
|
|
46
|
+
|
|
47
|
+
// Big-endian signed integers.
|
|
48
|
+
getI16Codec({ endian: Endian.Big }).encode(-42); // 0xffd6
|
|
49
|
+
getI32Codec({ endian: Endian.Big }).encode(-42); // 0xffffffd6
|
|
50
|
+
getI64Codec({ endian: Endian.Big }).encode(-42); // 0xffffffffffffffd6
|
|
51
|
+
getI128Codec({ endian: Endian.Big }).encode(-42); // 0xffffffffffffffffffffffffffffffd6
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
All integer codecs are of type `Codec<number>` except for the `u64`, `u128`, `i64` and `i128` codecs which are of type `Codec<number | bigint, bigint>`. This means we can provide either a `number` of a `bigint` value to encode but the decoded value will always be a `bigint`. This is because JavaScript's native `number` type does not support numbers larger than `2^53 - 1` and these large integer codecs have the potential to go over that value.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
const bytesFromNumber = getU64Codec().encode(42);
|
|
58
|
+
getU64Codec().decode(bytesFromNumber); // BigInt(42)
|
|
59
|
+
|
|
60
|
+
// OR
|
|
61
|
+
const bytesFromBigInt = getU64Codec().encode(BigInt(42));
|
|
62
|
+
getU64Codec().decode(bytesFromBigInt); // BigInt(42)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Finally, for each of these `get*Codec` functions, separate `get*Encoder` and `get*Decoder` functions exist to focus on only one side of the serialization and tree-shake the rest of the functions away.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
const bytes = getU8Encoder().encode(42);
|
|
69
|
+
const value = getU8Decoder().decode(bytes);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Decimal number codecs
|
|
73
|
+
|
|
74
|
+
This package also provides two codecs for floating numbers. One using 32 bits and one using 64 bits.
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
getF32Codec().encode(-1.5); // 0x0000c0bf
|
|
78
|
+
getF64Codec().encode(-1.5); // 0x000000000000f8bf
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Similarly to the integer codecs, they are stored in little-endian by default but may be stored in big-endian using the `endian` option.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
getF32Codec({ endian: Endian.Big }).encode(-1.5); // 0xbfc00000
|
|
85
|
+
getF64Codec({ endian: Endian.Big }).encode(-1.5); // 0xbff8000000000000
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Note that based on the selected codec, some of the precision of the number you are encoding may be lost when decoding it. For instance, when storing `3.1415` using a `f32` codec, you will not get the exact same number back.
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
const bytes = getF32Codec().encode(3.1415); // 0x560e4940
|
|
92
|
+
const value = getF32Codec().decode(bytes); // 3.1414999961853027 !== 3.1415
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
As usual, separate encoder and decoder functions are available for these codecs.
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
getF32Encoder().encode(-1.5);
|
|
99
|
+
getF32Decoder().decode(new Uint8Array([...]));
|
|
100
|
+
|
|
101
|
+
getF64Encoder().encode(-1.5);
|
|
102
|
+
getF64Decoder().decode(new Uint8Array([...]));
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Short u16 codec
|
|
106
|
+
|
|
107
|
+
This last integer codec is less common `VariableSizeCodec` that stores an unsigned integer using between 1 to 3 bytes depending on the value of that integer.
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
const bytes = getShortU16Codec().encode(42); // 0x2a
|
|
111
|
+
const value = getShortU16Codec().decode(bytes); // 42
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
If the provided integer is equal to or lower than `0x7f`, it will be stored as-is, using a single byte. However, if the integer is above `0x7f`, then the top bit is set and the remaining value is stored in the next bytes. Each byte follows the same pattern until the third byte. The third byte, if needed, uses all 8 bits to store the last byte of the original value.
|
|
115
|
+
|
|
116
|
+
In other words, this codec provides an extendable size that adapts based on the integer. In the illustration below, you can see the `0` and `1` byte flags for each scenario as well as the available bits to store the integer marked with `X`.
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
0XXXXXXX <- From 0 to 127.
|
|
120
|
+
1XXXXXXX 0XXXXXXX <- From 128 to 16,383.
|
|
121
|
+
1XXXXXXX 1XXXXXXX XXXXXXXX <- From 16,384 to 4,194,303.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
This codec is mainly used internally when encoding and decoding Solana transactions.
|
|
125
|
+
|
|
126
|
+
Separate encoder and decoder functions are also available via `getShortU16Encoder` and `getShortU16Decoder` respectively.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
To read more about the available codecs and how to use them, check out the documentation of the main [`@solana/codecs` package](https://github.com/anza-xyz/kit/tree/main/packages/codecs).
|