@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
package/dist/index.mjs
CHANGED
|
@@ -30,7 +30,7 @@ var cp_amm_default = {
|
|
|
30
30
|
address: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG",
|
|
31
31
|
metadata: {
|
|
32
32
|
name: "cp_amm",
|
|
33
|
-
version: "0.1.
|
|
33
|
+
version: "0.1.1",
|
|
34
34
|
spec: "0.1.0",
|
|
35
35
|
description: "Created with Anchor"
|
|
36
36
|
},
|
|
@@ -591,38 +591,38 @@ var cp_amm_default = {
|
|
|
591
591
|
{
|
|
592
592
|
kind: "const",
|
|
593
593
|
value: [
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
594
|
+
48,
|
|
595
|
+
9,
|
|
596
|
+
89,
|
|
597
|
+
123,
|
|
598
|
+
106,
|
|
599
|
+
114,
|
|
600
|
+
131,
|
|
601
|
+
251,
|
|
602
|
+
50,
|
|
601
603
|
173,
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
161,
|
|
611
|
-
33,
|
|
604
|
+
254,
|
|
605
|
+
250,
|
|
606
|
+
10,
|
|
607
|
+
80,
|
|
608
|
+
160,
|
|
609
|
+
84,
|
|
610
|
+
143,
|
|
611
|
+
100,
|
|
612
612
|
81,
|
|
613
|
-
|
|
613
|
+
249,
|
|
614
|
+
134,
|
|
615
|
+
112,
|
|
616
|
+
30,
|
|
617
|
+
213,
|
|
618
|
+
50,
|
|
614
619
|
166,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
68,
|
|
622
|
-
162,
|
|
623
|
-
70,
|
|
624
|
-
126,
|
|
625
|
-
100
|
|
620
|
+
239,
|
|
621
|
+
78,
|
|
622
|
+
53,
|
|
623
|
+
175,
|
|
624
|
+
188,
|
|
625
|
+
85
|
|
626
626
|
]
|
|
627
627
|
},
|
|
628
628
|
{
|
|
@@ -684,38 +684,38 @@ var cp_amm_default = {
|
|
|
684
684
|
{
|
|
685
685
|
kind: "const",
|
|
686
686
|
value: [
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
687
|
+
48,
|
|
688
|
+
9,
|
|
689
|
+
89,
|
|
690
|
+
123,
|
|
691
|
+
106,
|
|
692
|
+
114,
|
|
693
|
+
131,
|
|
694
|
+
251,
|
|
695
|
+
50,
|
|
694
696
|
173,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
161,
|
|
704
|
-
33,
|
|
697
|
+
254,
|
|
698
|
+
250,
|
|
699
|
+
10,
|
|
700
|
+
80,
|
|
701
|
+
160,
|
|
702
|
+
84,
|
|
703
|
+
143,
|
|
704
|
+
100,
|
|
705
705
|
81,
|
|
706
|
-
|
|
706
|
+
249,
|
|
707
|
+
134,
|
|
708
|
+
112,
|
|
709
|
+
30,
|
|
710
|
+
213,
|
|
711
|
+
50,
|
|
707
712
|
166,
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
68,
|
|
715
|
-
162,
|
|
716
|
-
70,
|
|
717
|
-
126,
|
|
718
|
-
100
|
|
713
|
+
239,
|
|
714
|
+
78,
|
|
715
|
+
53,
|
|
716
|
+
175,
|
|
717
|
+
188,
|
|
718
|
+
85
|
|
719
719
|
]
|
|
720
720
|
},
|
|
721
721
|
{
|
|
@@ -1309,7 +1309,100 @@ var cp_amm_default = {
|
|
|
1309
1309
|
},
|
|
1310
1310
|
{
|
|
1311
1311
|
kind: "arg",
|
|
1312
|
-
path: "
|
|
1312
|
+
path: "index"
|
|
1313
|
+
}
|
|
1314
|
+
]
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
name: "admin",
|
|
1319
|
+
writable: true,
|
|
1320
|
+
signer: true
|
|
1321
|
+
},
|
|
1322
|
+
{
|
|
1323
|
+
name: "system_program",
|
|
1324
|
+
address: "11111111111111111111111111111111"
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
name: "event_authority",
|
|
1328
|
+
pda: {
|
|
1329
|
+
seeds: [
|
|
1330
|
+
{
|
|
1331
|
+
kind: "const",
|
|
1332
|
+
value: [
|
|
1333
|
+
95,
|
|
1334
|
+
95,
|
|
1335
|
+
101,
|
|
1336
|
+
118,
|
|
1337
|
+
101,
|
|
1338
|
+
110,
|
|
1339
|
+
116,
|
|
1340
|
+
95,
|
|
1341
|
+
97,
|
|
1342
|
+
117,
|
|
1343
|
+
116,
|
|
1344
|
+
104,
|
|
1345
|
+
111,
|
|
1346
|
+
114,
|
|
1347
|
+
105,
|
|
1348
|
+
116,
|
|
1349
|
+
121
|
|
1350
|
+
]
|
|
1351
|
+
}
|
|
1352
|
+
]
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
name: "program"
|
|
1357
|
+
}
|
|
1358
|
+
],
|
|
1359
|
+
args: [
|
|
1360
|
+
{
|
|
1361
|
+
name: "index",
|
|
1362
|
+
type: "u64"
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
name: "config_parameters",
|
|
1366
|
+
type: {
|
|
1367
|
+
defined: {
|
|
1368
|
+
name: "StaticConfigParameters"
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
]
|
|
1373
|
+
},
|
|
1374
|
+
{
|
|
1375
|
+
name: "create_dynamic_config",
|
|
1376
|
+
discriminator: [
|
|
1377
|
+
81,
|
|
1378
|
+
251,
|
|
1379
|
+
122,
|
|
1380
|
+
78,
|
|
1381
|
+
66,
|
|
1382
|
+
57,
|
|
1383
|
+
208,
|
|
1384
|
+
82
|
|
1385
|
+
],
|
|
1386
|
+
accounts: [
|
|
1387
|
+
{
|
|
1388
|
+
name: "config",
|
|
1389
|
+
writable: true,
|
|
1390
|
+
pda: {
|
|
1391
|
+
seeds: [
|
|
1392
|
+
{
|
|
1393
|
+
kind: "const",
|
|
1394
|
+
value: [
|
|
1395
|
+
99,
|
|
1396
|
+
111,
|
|
1397
|
+
110,
|
|
1398
|
+
102,
|
|
1399
|
+
105,
|
|
1400
|
+
103
|
|
1401
|
+
]
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
kind: "arg",
|
|
1405
|
+
path: "index"
|
|
1313
1406
|
}
|
|
1314
1407
|
]
|
|
1315
1408
|
}
|
|
@@ -1357,11 +1450,15 @@ var cp_amm_default = {
|
|
|
1357
1450
|
}
|
|
1358
1451
|
],
|
|
1359
1452
|
args: [
|
|
1453
|
+
{
|
|
1454
|
+
name: "index",
|
|
1455
|
+
type: "u64"
|
|
1456
|
+
},
|
|
1360
1457
|
{
|
|
1361
1458
|
name: "config_parameters",
|
|
1362
1459
|
type: {
|
|
1363
1460
|
defined: {
|
|
1364
|
-
name: "
|
|
1461
|
+
name: "DynamicConfigParameters"
|
|
1365
1462
|
}
|
|
1366
1463
|
}
|
|
1367
1464
|
}
|
|
@@ -2307,18 +2404,90 @@ var cp_amm_default = {
|
|
|
2307
2404
|
]
|
|
2308
2405
|
},
|
|
2309
2406
|
{
|
|
2310
|
-
name: "
|
|
2407
|
+
name: "initialize_pool_with_dynamic_config",
|
|
2311
2408
|
discriminator: [
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2409
|
+
149,
|
|
2410
|
+
82,
|
|
2411
|
+
72,
|
|
2412
|
+
197,
|
|
2413
|
+
253,
|
|
2414
|
+
252,
|
|
2415
|
+
68,
|
|
2416
|
+
15
|
|
2320
2417
|
],
|
|
2321
2418
|
accounts: [
|
|
2419
|
+
{
|
|
2420
|
+
name: "creator"
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
name: "position_nft_mint",
|
|
2424
|
+
docs: [
|
|
2425
|
+
"position_nft_mint"
|
|
2426
|
+
],
|
|
2427
|
+
writable: true,
|
|
2428
|
+
signer: true
|
|
2429
|
+
},
|
|
2430
|
+
{
|
|
2431
|
+
name: "position_nft_account",
|
|
2432
|
+
docs: [
|
|
2433
|
+
"position nft account"
|
|
2434
|
+
],
|
|
2435
|
+
writable: true,
|
|
2436
|
+
pda: {
|
|
2437
|
+
seeds: [
|
|
2438
|
+
{
|
|
2439
|
+
kind: "const",
|
|
2440
|
+
value: [
|
|
2441
|
+
112,
|
|
2442
|
+
111,
|
|
2443
|
+
115,
|
|
2444
|
+
105,
|
|
2445
|
+
116,
|
|
2446
|
+
105,
|
|
2447
|
+
111,
|
|
2448
|
+
110,
|
|
2449
|
+
95,
|
|
2450
|
+
110,
|
|
2451
|
+
102,
|
|
2452
|
+
116,
|
|
2453
|
+
95,
|
|
2454
|
+
97,
|
|
2455
|
+
99,
|
|
2456
|
+
99,
|
|
2457
|
+
111,
|
|
2458
|
+
117,
|
|
2459
|
+
110,
|
|
2460
|
+
116
|
|
2461
|
+
]
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
kind: "account",
|
|
2465
|
+
path: "position_nft_mint"
|
|
2466
|
+
}
|
|
2467
|
+
]
|
|
2468
|
+
}
|
|
2469
|
+
},
|
|
2470
|
+
{
|
|
2471
|
+
name: "payer",
|
|
2472
|
+
docs: [
|
|
2473
|
+
"Address paying to create the pool. Can be anyone"
|
|
2474
|
+
],
|
|
2475
|
+
writable: true,
|
|
2476
|
+
signer: true
|
|
2477
|
+
},
|
|
2478
|
+
{
|
|
2479
|
+
name: "pool_creator_authority",
|
|
2480
|
+
signer: true,
|
|
2481
|
+
relations: [
|
|
2482
|
+
"config"
|
|
2483
|
+
]
|
|
2484
|
+
},
|
|
2485
|
+
{
|
|
2486
|
+
name: "config",
|
|
2487
|
+
docs: [
|
|
2488
|
+
"Which config the pool belongs to."
|
|
2489
|
+
]
|
|
2490
|
+
},
|
|
2322
2491
|
{
|
|
2323
2492
|
name: "pool_authority",
|
|
2324
2493
|
pda: {
|
|
@@ -2347,67 +2516,301 @@ var cp_amm_default = {
|
|
|
2347
2516
|
},
|
|
2348
2517
|
{
|
|
2349
2518
|
name: "pool",
|
|
2519
|
+
docs: [
|
|
2520
|
+
"Initialize an account to store the pool state"
|
|
2521
|
+
],
|
|
2350
2522
|
writable: true
|
|
2351
2523
|
},
|
|
2352
2524
|
{
|
|
2353
|
-
name: "
|
|
2525
|
+
name: "position",
|
|
2354
2526
|
writable: true,
|
|
2355
2527
|
pda: {
|
|
2356
2528
|
seeds: [
|
|
2357
2529
|
{
|
|
2358
2530
|
kind: "const",
|
|
2359
2531
|
value: [
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
97,
|
|
2369
|
-
117,
|
|
2370
|
-
108,
|
|
2371
|
-
116
|
|
2532
|
+
112,
|
|
2533
|
+
111,
|
|
2534
|
+
115,
|
|
2535
|
+
105,
|
|
2536
|
+
116,
|
|
2537
|
+
105,
|
|
2538
|
+
111,
|
|
2539
|
+
110
|
|
2372
2540
|
]
|
|
2373
2541
|
},
|
|
2374
2542
|
{
|
|
2375
2543
|
kind: "account",
|
|
2376
|
-
path: "
|
|
2377
|
-
},
|
|
2378
|
-
{
|
|
2379
|
-
kind: "arg",
|
|
2380
|
-
path: "reward_index"
|
|
2544
|
+
path: "position_nft_mint"
|
|
2381
2545
|
}
|
|
2382
2546
|
]
|
|
2383
2547
|
}
|
|
2384
2548
|
},
|
|
2385
2549
|
{
|
|
2386
|
-
name: "
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
writable: true,
|
|
2391
|
-
signer: true
|
|
2392
|
-
},
|
|
2393
|
-
{
|
|
2394
|
-
name: "token_program"
|
|
2550
|
+
name: "token_a_mint",
|
|
2551
|
+
docs: [
|
|
2552
|
+
"Token a mint"
|
|
2553
|
+
]
|
|
2395
2554
|
},
|
|
2396
2555
|
{
|
|
2397
|
-
name: "
|
|
2398
|
-
|
|
2556
|
+
name: "token_b_mint",
|
|
2557
|
+
docs: [
|
|
2558
|
+
"Token b mint"
|
|
2559
|
+
]
|
|
2399
2560
|
},
|
|
2400
2561
|
{
|
|
2401
|
-
name: "
|
|
2562
|
+
name: "token_a_vault",
|
|
2563
|
+
docs: [
|
|
2564
|
+
"Token a vault for the pool"
|
|
2565
|
+
],
|
|
2566
|
+
writable: true,
|
|
2402
2567
|
pda: {
|
|
2403
2568
|
seeds: [
|
|
2404
2569
|
{
|
|
2405
2570
|
kind: "const",
|
|
2406
2571
|
value: [
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2572
|
+
116,
|
|
2573
|
+
111,
|
|
2574
|
+
107,
|
|
2575
|
+
101,
|
|
2576
|
+
110,
|
|
2577
|
+
95,
|
|
2578
|
+
118,
|
|
2579
|
+
97,
|
|
2580
|
+
117,
|
|
2581
|
+
108,
|
|
2582
|
+
116
|
|
2583
|
+
]
|
|
2584
|
+
},
|
|
2585
|
+
{
|
|
2586
|
+
kind: "account",
|
|
2587
|
+
path: "token_a_mint"
|
|
2588
|
+
},
|
|
2589
|
+
{
|
|
2590
|
+
kind: "account",
|
|
2591
|
+
path: "pool"
|
|
2592
|
+
}
|
|
2593
|
+
]
|
|
2594
|
+
}
|
|
2595
|
+
},
|
|
2596
|
+
{
|
|
2597
|
+
name: "token_b_vault",
|
|
2598
|
+
docs: [
|
|
2599
|
+
"Token b vault for the pool"
|
|
2600
|
+
],
|
|
2601
|
+
writable: true,
|
|
2602
|
+
pda: {
|
|
2603
|
+
seeds: [
|
|
2604
|
+
{
|
|
2605
|
+
kind: "const",
|
|
2606
|
+
value: [
|
|
2607
|
+
116,
|
|
2608
|
+
111,
|
|
2609
|
+
107,
|
|
2610
|
+
101,
|
|
2611
|
+
110,
|
|
2612
|
+
95,
|
|
2613
|
+
118,
|
|
2614
|
+
97,
|
|
2615
|
+
117,
|
|
2616
|
+
108,
|
|
2617
|
+
116
|
|
2618
|
+
]
|
|
2619
|
+
},
|
|
2620
|
+
{
|
|
2621
|
+
kind: "account",
|
|
2622
|
+
path: "token_b_mint"
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
kind: "account",
|
|
2626
|
+
path: "pool"
|
|
2627
|
+
}
|
|
2628
|
+
]
|
|
2629
|
+
}
|
|
2630
|
+
},
|
|
2631
|
+
{
|
|
2632
|
+
name: "payer_token_a",
|
|
2633
|
+
docs: [
|
|
2634
|
+
"payer token a account"
|
|
2635
|
+
],
|
|
2636
|
+
writable: true
|
|
2637
|
+
},
|
|
2638
|
+
{
|
|
2639
|
+
name: "payer_token_b",
|
|
2640
|
+
docs: [
|
|
2641
|
+
"creator token b account"
|
|
2642
|
+
],
|
|
2643
|
+
writable: true
|
|
2644
|
+
},
|
|
2645
|
+
{
|
|
2646
|
+
name: "token_a_program",
|
|
2647
|
+
docs: [
|
|
2648
|
+
"Program to create mint account and mint tokens"
|
|
2649
|
+
]
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
name: "token_b_program",
|
|
2653
|
+
docs: [
|
|
2654
|
+
"Program to create mint account and mint tokens"
|
|
2655
|
+
]
|
|
2656
|
+
},
|
|
2657
|
+
{
|
|
2658
|
+
name: "token_2022_program",
|
|
2659
|
+
docs: [
|
|
2660
|
+
"Program to create NFT mint/token account and transfer for token22 account"
|
|
2661
|
+
],
|
|
2662
|
+
address: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"
|
|
2663
|
+
},
|
|
2664
|
+
{
|
|
2665
|
+
name: "system_program",
|
|
2666
|
+
address: "11111111111111111111111111111111"
|
|
2667
|
+
},
|
|
2668
|
+
{
|
|
2669
|
+
name: "event_authority",
|
|
2670
|
+
pda: {
|
|
2671
|
+
seeds: [
|
|
2672
|
+
{
|
|
2673
|
+
kind: "const",
|
|
2674
|
+
value: [
|
|
2675
|
+
95,
|
|
2676
|
+
95,
|
|
2677
|
+
101,
|
|
2678
|
+
118,
|
|
2679
|
+
101,
|
|
2680
|
+
110,
|
|
2681
|
+
116,
|
|
2682
|
+
95,
|
|
2683
|
+
97,
|
|
2684
|
+
117,
|
|
2685
|
+
116,
|
|
2686
|
+
104,
|
|
2687
|
+
111,
|
|
2688
|
+
114,
|
|
2689
|
+
105,
|
|
2690
|
+
116,
|
|
2691
|
+
121
|
|
2692
|
+
]
|
|
2693
|
+
}
|
|
2694
|
+
]
|
|
2695
|
+
}
|
|
2696
|
+
},
|
|
2697
|
+
{
|
|
2698
|
+
name: "program"
|
|
2699
|
+
}
|
|
2700
|
+
],
|
|
2701
|
+
args: [
|
|
2702
|
+
{
|
|
2703
|
+
name: "params",
|
|
2704
|
+
type: {
|
|
2705
|
+
defined: {
|
|
2706
|
+
name: "InitializeCustomizablePoolParameters"
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
]
|
|
2711
|
+
},
|
|
2712
|
+
{
|
|
2713
|
+
name: "initialize_reward",
|
|
2714
|
+
discriminator: [
|
|
2715
|
+
95,
|
|
2716
|
+
135,
|
|
2717
|
+
192,
|
|
2718
|
+
196,
|
|
2719
|
+
242,
|
|
2720
|
+
129,
|
|
2721
|
+
230,
|
|
2722
|
+
68
|
|
2723
|
+
],
|
|
2724
|
+
accounts: [
|
|
2725
|
+
{
|
|
2726
|
+
name: "pool_authority",
|
|
2727
|
+
pda: {
|
|
2728
|
+
seeds: [
|
|
2729
|
+
{
|
|
2730
|
+
kind: "const",
|
|
2731
|
+
value: [
|
|
2732
|
+
112,
|
|
2733
|
+
111,
|
|
2734
|
+
111,
|
|
2735
|
+
108,
|
|
2736
|
+
95,
|
|
2737
|
+
97,
|
|
2738
|
+
117,
|
|
2739
|
+
116,
|
|
2740
|
+
104,
|
|
2741
|
+
111,
|
|
2742
|
+
114,
|
|
2743
|
+
105,
|
|
2744
|
+
116,
|
|
2745
|
+
121
|
|
2746
|
+
]
|
|
2747
|
+
}
|
|
2748
|
+
]
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
{
|
|
2752
|
+
name: "pool",
|
|
2753
|
+
writable: true
|
|
2754
|
+
},
|
|
2755
|
+
{
|
|
2756
|
+
name: "reward_vault",
|
|
2757
|
+
writable: true,
|
|
2758
|
+
pda: {
|
|
2759
|
+
seeds: [
|
|
2760
|
+
{
|
|
2761
|
+
kind: "const",
|
|
2762
|
+
value: [
|
|
2763
|
+
114,
|
|
2764
|
+
101,
|
|
2765
|
+
119,
|
|
2766
|
+
97,
|
|
2767
|
+
114,
|
|
2768
|
+
100,
|
|
2769
|
+
95,
|
|
2770
|
+
118,
|
|
2771
|
+
97,
|
|
2772
|
+
117,
|
|
2773
|
+
108,
|
|
2774
|
+
116
|
|
2775
|
+
]
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
kind: "account",
|
|
2779
|
+
path: "pool"
|
|
2780
|
+
},
|
|
2781
|
+
{
|
|
2782
|
+
kind: "arg",
|
|
2783
|
+
path: "reward_index"
|
|
2784
|
+
}
|
|
2785
|
+
]
|
|
2786
|
+
}
|
|
2787
|
+
},
|
|
2788
|
+
{
|
|
2789
|
+
name: "reward_mint"
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
name: "admin",
|
|
2793
|
+
writable: true,
|
|
2794
|
+
signer: true
|
|
2795
|
+
},
|
|
2796
|
+
{
|
|
2797
|
+
name: "token_program"
|
|
2798
|
+
},
|
|
2799
|
+
{
|
|
2800
|
+
name: "system_program",
|
|
2801
|
+
address: "11111111111111111111111111111111"
|
|
2802
|
+
},
|
|
2803
|
+
{
|
|
2804
|
+
name: "event_authority",
|
|
2805
|
+
pda: {
|
|
2806
|
+
seeds: [
|
|
2807
|
+
{
|
|
2808
|
+
kind: "const",
|
|
2809
|
+
value: [
|
|
2810
|
+
95,
|
|
2811
|
+
95,
|
|
2812
|
+
101,
|
|
2813
|
+
118,
|
|
2411
2814
|
101,
|
|
2412
2815
|
110,
|
|
2413
2816
|
116,
|
|
@@ -3660,6 +4063,19 @@ var cp_amm_default = {
|
|
|
3660
4063
|
54
|
|
3661
4064
|
]
|
|
3662
4065
|
},
|
|
4066
|
+
{
|
|
4067
|
+
name: "EvtCreateDynamicConfig",
|
|
4068
|
+
discriminator: [
|
|
4069
|
+
231,
|
|
4070
|
+
197,
|
|
4071
|
+
13,
|
|
4072
|
+
164,
|
|
4073
|
+
248,
|
|
4074
|
+
213,
|
|
4075
|
+
133,
|
|
4076
|
+
152
|
|
4077
|
+
]
|
|
4078
|
+
},
|
|
3663
4079
|
{
|
|
3664
4080
|
name: "EvtCreatePosition",
|
|
3665
4081
|
discriminator: [
|
|
@@ -4030,6 +4446,16 @@ var cp_amm_default = {
|
|
|
4030
4446
|
code: 6039,
|
|
4031
4447
|
name: "PositionIsNotEmpty",
|
|
4032
4448
|
msg: "Position is not empty"
|
|
4449
|
+
},
|
|
4450
|
+
{
|
|
4451
|
+
code: 6040,
|
|
4452
|
+
name: "InvalidPoolCreatorAuthority",
|
|
4453
|
+
msg: "Invalid pool creator authority"
|
|
4454
|
+
},
|
|
4455
|
+
{
|
|
4456
|
+
code: 6041,
|
|
4457
|
+
name: "InvalidConfigType",
|
|
4458
|
+
msg: "Invalid config type"
|
|
4033
4459
|
}
|
|
4034
4460
|
],
|
|
4035
4461
|
types: [
|
|
@@ -4259,14 +4685,21 @@ var cp_amm_default = {
|
|
|
4259
4685
|
type: "u8"
|
|
4260
4686
|
},
|
|
4261
4687
|
{
|
|
4262
|
-
name: "
|
|
4688
|
+
name: "config_type",
|
|
4263
4689
|
docs: [
|
|
4264
|
-
"
|
|
4690
|
+
"Config type mode, 0 for static, 1 for dynamic"
|
|
4265
4691
|
],
|
|
4266
|
-
type:
|
|
4692
|
+
type: "u8"
|
|
4693
|
+
},
|
|
4694
|
+
{
|
|
4695
|
+
name: "_padding_0",
|
|
4696
|
+
docs: [
|
|
4697
|
+
"padding 0"
|
|
4698
|
+
],
|
|
4699
|
+
type: {
|
|
4267
4700
|
array: [
|
|
4268
4701
|
"u8",
|
|
4269
|
-
|
|
4702
|
+
5
|
|
4270
4703
|
]
|
|
4271
4704
|
}
|
|
4272
4705
|
},
|
|
@@ -4308,45 +4741,13 @@ var cp_amm_default = {
|
|
|
4308
4741
|
}
|
|
4309
4742
|
},
|
|
4310
4743
|
{
|
|
4311
|
-
name: "
|
|
4744
|
+
name: "DynamicConfigParameters",
|
|
4312
4745
|
type: {
|
|
4313
4746
|
kind: "struct",
|
|
4314
4747
|
fields: [
|
|
4315
|
-
{
|
|
4316
|
-
name: "pool_fees",
|
|
4317
|
-
type: {
|
|
4318
|
-
defined: {
|
|
4319
|
-
name: "PoolFeeParameters"
|
|
4320
|
-
}
|
|
4321
|
-
}
|
|
4322
|
-
},
|
|
4323
|
-
{
|
|
4324
|
-
name: "sqrt_min_price",
|
|
4325
|
-
type: "u128"
|
|
4326
|
-
},
|
|
4327
|
-
{
|
|
4328
|
-
name: "sqrt_max_price",
|
|
4329
|
-
type: "u128"
|
|
4330
|
-
},
|
|
4331
|
-
{
|
|
4332
|
-
name: "vault_config_key",
|
|
4333
|
-
type: "pubkey"
|
|
4334
|
-
},
|
|
4335
4748
|
{
|
|
4336
4749
|
name: "pool_creator_authority",
|
|
4337
4750
|
type: "pubkey"
|
|
4338
|
-
},
|
|
4339
|
-
{
|
|
4340
|
-
name: "activation_type",
|
|
4341
|
-
type: "u8"
|
|
4342
|
-
},
|
|
4343
|
-
{
|
|
4344
|
-
name: "collect_fee_mode",
|
|
4345
|
-
type: "u8"
|
|
4346
|
-
},
|
|
4347
|
-
{
|
|
4348
|
-
name: "index",
|
|
4349
|
-
type: "u64"
|
|
4350
4751
|
}
|
|
4351
4752
|
]
|
|
4352
4753
|
}
|
|
@@ -4748,7 +5149,7 @@ var cp_amm_default = {
|
|
|
4748
5149
|
{
|
|
4749
5150
|
name: "EvtCreateConfig",
|
|
4750
5151
|
docs: [
|
|
4751
|
-
"Create config"
|
|
5152
|
+
"Create static config"
|
|
4752
5153
|
],
|
|
4753
5154
|
type: {
|
|
4754
5155
|
kind: "struct",
|
|
@@ -4796,6 +5197,29 @@ var cp_amm_default = {
|
|
|
4796
5197
|
]
|
|
4797
5198
|
}
|
|
4798
5199
|
},
|
|
5200
|
+
{
|
|
5201
|
+
name: "EvtCreateDynamicConfig",
|
|
5202
|
+
docs: [
|
|
5203
|
+
"Create dynamic config"
|
|
5204
|
+
],
|
|
5205
|
+
type: {
|
|
5206
|
+
kind: "struct",
|
|
5207
|
+
fields: [
|
|
5208
|
+
{
|
|
5209
|
+
name: "config",
|
|
5210
|
+
type: "pubkey"
|
|
5211
|
+
},
|
|
5212
|
+
{
|
|
5213
|
+
name: "pool_creator_authority",
|
|
5214
|
+
type: "pubkey"
|
|
5215
|
+
},
|
|
5216
|
+
{
|
|
5217
|
+
name: "index",
|
|
5218
|
+
type: "u64"
|
|
5219
|
+
}
|
|
5220
|
+
]
|
|
5221
|
+
}
|
|
5222
|
+
},
|
|
4799
5223
|
{
|
|
4800
5224
|
name: "EvtCreatePosition",
|
|
4801
5225
|
type: {
|
|
@@ -5401,18 +5825,11 @@ var cp_amm_default = {
|
|
|
5401
5825
|
type: "u128"
|
|
5402
5826
|
},
|
|
5403
5827
|
{
|
|
5404
|
-
name: "
|
|
5405
|
-
docs: [
|
|
5406
|
-
"token a reserve"
|
|
5407
|
-
],
|
|
5408
|
-
type: "u64"
|
|
5409
|
-
},
|
|
5410
|
-
{
|
|
5411
|
-
name: "token_b_reserve",
|
|
5828
|
+
name: "_padding",
|
|
5412
5829
|
docs: [
|
|
5413
|
-
"
|
|
5830
|
+
"padding, previous reserve amount, be careful to use that field"
|
|
5414
5831
|
],
|
|
5415
|
-
type: "
|
|
5832
|
+
type: "u128"
|
|
5416
5833
|
},
|
|
5417
5834
|
{
|
|
5418
5835
|
name: "protocol_a_fee",
|
|
@@ -6135,6 +6552,46 @@ var cp_amm_default = {
|
|
|
6135
6552
|
]
|
|
6136
6553
|
}
|
|
6137
6554
|
},
|
|
6555
|
+
{
|
|
6556
|
+
name: "StaticConfigParameters",
|
|
6557
|
+
type: {
|
|
6558
|
+
kind: "struct",
|
|
6559
|
+
fields: [
|
|
6560
|
+
{
|
|
6561
|
+
name: "pool_fees",
|
|
6562
|
+
type: {
|
|
6563
|
+
defined: {
|
|
6564
|
+
name: "PoolFeeParameters"
|
|
6565
|
+
}
|
|
6566
|
+
}
|
|
6567
|
+
},
|
|
6568
|
+
{
|
|
6569
|
+
name: "sqrt_min_price",
|
|
6570
|
+
type: "u128"
|
|
6571
|
+
},
|
|
6572
|
+
{
|
|
6573
|
+
name: "sqrt_max_price",
|
|
6574
|
+
type: "u128"
|
|
6575
|
+
},
|
|
6576
|
+
{
|
|
6577
|
+
name: "vault_config_key",
|
|
6578
|
+
type: "pubkey"
|
|
6579
|
+
},
|
|
6580
|
+
{
|
|
6581
|
+
name: "pool_creator_authority",
|
|
6582
|
+
type: "pubkey"
|
|
6583
|
+
},
|
|
6584
|
+
{
|
|
6585
|
+
name: "activation_type",
|
|
6586
|
+
type: "u8"
|
|
6587
|
+
},
|
|
6588
|
+
{
|
|
6589
|
+
name: "collect_fee_mode",
|
|
6590
|
+
type: "u8"
|
|
6591
|
+
}
|
|
6592
|
+
]
|
|
6593
|
+
}
|
|
6594
|
+
},
|
|
6138
6595
|
{
|
|
6139
6596
|
name: "SwapParameters",
|
|
6140
6597
|
type: {
|
|
@@ -6405,6 +6862,12 @@ var MIN_SQRT_PRICE = new BN("4295048016");
|
|
|
6405
6862
|
var MAX_SQRT_PRICE = new BN("79226673521066979257578248091");
|
|
6406
6863
|
var MIN_CU_BUFFER = 5e4;
|
|
6407
6864
|
var MAX_CU_BUFFER = 2e5;
|
|
6865
|
+
var DYNAMIC_FEE_FILTER_PERIOD_DEFAULT = 10;
|
|
6866
|
+
var DYNAMIC_FEE_DECAY_PERIOD_DEFAULT = 120;
|
|
6867
|
+
var DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT = 5e3;
|
|
6868
|
+
var BIN_STEP_BPS_DEFAULT = 1;
|
|
6869
|
+
var BIN_STEP_BPS_U128_DEFAULT = new BN("1844674407370955");
|
|
6870
|
+
var MAX_PRICE_CHANGE_BPS_DEFAULT = 1500;
|
|
6408
6871
|
|
|
6409
6872
|
// src/pda.ts
|
|
6410
6873
|
function getFirstKey(key1, key2) {
|
|
@@ -6515,10 +6978,10 @@ import {
|
|
|
6515
6978
|
function getTokenProgram(flag) {
|
|
6516
6979
|
return flag == 0 ? TOKEN_PROGRAM_ID : TOKEN_2022_PROGRAM_ID;
|
|
6517
6980
|
}
|
|
6518
|
-
var getTokenDecimals = (connection, mint) => __async(
|
|
6981
|
+
var getTokenDecimals = (connection, mint) => __async(null, null, function* () {
|
|
6519
6982
|
return (yield getMint(connection, mint)).decimals;
|
|
6520
6983
|
});
|
|
6521
|
-
var getOrCreateATAInstruction = (_0, _1, _2, ..._3) => __async(
|
|
6984
|
+
var getOrCreateATAInstruction = (_0, _1, _2, ..._3) => __async(null, [_0, _1, _2, ..._3], function* (connection, tokenMint, owner, payer = owner, allowOwnerOffCurve = true, tokenProgram) {
|
|
6522
6985
|
const toAccount = getAssociatedTokenAddressSync(
|
|
6523
6986
|
tokenMint,
|
|
6524
6987
|
owner,
|
|
@@ -6564,7 +7027,7 @@ var wrapSOLInstruction = (from, to, amount) => {
|
|
|
6564
7027
|
})
|
|
6565
7028
|
];
|
|
6566
7029
|
};
|
|
6567
|
-
var unwrapSOLInstruction = (
|
|
7030
|
+
var unwrapSOLInstruction = (_0, ..._1) => __async(null, [_0, ..._1], function* (owner, receiver = owner, allowOwnerOffCurve = true) {
|
|
6568
7031
|
const wSolATAAccount = getAssociatedTokenAddressSync(
|
|
6569
7032
|
NATIVE_MINT,
|
|
6570
7033
|
owner,
|
|
@@ -6573,7 +7036,7 @@ var unwrapSOLInstruction = (owner, allowOwnerOffCurve = true) => __async(void 0,
|
|
|
6573
7036
|
if (wSolATAAccount) {
|
|
6574
7037
|
const closedWrappedSolInstruction = createCloseAccountInstruction(
|
|
6575
7038
|
wSolATAAccount,
|
|
6576
|
-
|
|
7039
|
+
receiver,
|
|
6577
7040
|
owner,
|
|
6578
7041
|
[],
|
|
6579
7042
|
TOKEN_PROGRAM_ID
|
|
@@ -6803,6 +7266,7 @@ function getAmountBFromLiquidityDelta(liquidity, currentSqrtPrice, minSqrtPrice,
|
|
|
6803
7266
|
}
|
|
6804
7267
|
|
|
6805
7268
|
// src/helpers/fee.ts
|
|
7269
|
+
import Decimal2 from "decimal.js";
|
|
6806
7270
|
function getBaseFeeNumerator(feeSchedulerMode, cliffFeeNumerator, period, reductionFactor) {
|
|
6807
7271
|
let feeNumerator;
|
|
6808
7272
|
if (feeSchedulerMode == 0 /* Linear */) {
|
|
@@ -6824,10 +7288,10 @@ function getDynamicFeeNumerator(volatilityAccumulator, binStep, variableFeeContr
|
|
|
6824
7288
|
return vFee.add(new BN5(99999999999)).div(new BN5(1e11));
|
|
6825
7289
|
}
|
|
6826
7290
|
function getFeeNumerator(currentPoint, activationPoint, numberOfPeriod, periodFrequency, feeSchedulerMode, cliffFeeNumerator, reductionFactor, dynamicFeeParams) {
|
|
6827
|
-
if (Number(periodFrequency) == 0) {
|
|
7291
|
+
if (Number(periodFrequency) == 0 || new BN5(currentPoint).lt(activationPoint)) {
|
|
6828
7292
|
return cliffFeeNumerator;
|
|
6829
7293
|
}
|
|
6830
|
-
const period =
|
|
7294
|
+
const period = BN5.min(
|
|
6831
7295
|
new BN5(numberOfPeriod),
|
|
6832
7296
|
new BN5(currentPoint).sub(activationPoint).div(periodFrequency)
|
|
6833
7297
|
);
|
|
@@ -6872,19 +7336,111 @@ function getSwapAmount(inAmount, sqrtPrice, liquidity, tradeFeeNumerator, aToB,
|
|
|
6872
7336
|
totalFee = getTotalFeeOnAmount(inAmount, tradeFeeNumerator);
|
|
6873
7337
|
actualInAmount = inAmount.sub(totalFee);
|
|
6874
7338
|
}
|
|
7339
|
+
const nextSqrtPrice = getNextSqrtPrice(
|
|
7340
|
+
actualInAmount,
|
|
7341
|
+
sqrtPrice,
|
|
7342
|
+
liquidity,
|
|
7343
|
+
aToB
|
|
7344
|
+
);
|
|
6875
7345
|
const outAmount = aToB ? getAmountBFromLiquidityDelta(
|
|
6876
7346
|
liquidity,
|
|
6877
7347
|
sqrtPrice,
|
|
6878
|
-
|
|
7348
|
+
nextSqrtPrice,
|
|
6879
7349
|
1 /* Down */
|
|
6880
7350
|
) : getAmountAFromLiquidityDelta(
|
|
6881
7351
|
liquidity,
|
|
6882
7352
|
sqrtPrice,
|
|
6883
|
-
|
|
7353
|
+
nextSqrtPrice,
|
|
6884
7354
|
1 /* Down */
|
|
6885
7355
|
);
|
|
6886
7356
|
const amountOut = feeMode.feeOnInput ? outAmount : (totalFee = getTotalFeeOnAmount(outAmount, tradeFeeNumerator), outAmount.sub(totalFee));
|
|
6887
|
-
return { amountOut, totalFee };
|
|
7357
|
+
return { amountOut, totalFee, nextSqrtPrice };
|
|
7358
|
+
}
|
|
7359
|
+
function bpsToFeeNumerator(bps) {
|
|
7360
|
+
return new BN5(bps * FEE_DENOMINATOR).divn(BASIS_POINT_MAX);
|
|
7361
|
+
}
|
|
7362
|
+
function feeNumeratorToBps(feeNumerator) {
|
|
7363
|
+
return feeNumerator.muln(BASIS_POINT_MAX).div(new BN5(FEE_DENOMINATOR)).toNumber();
|
|
7364
|
+
}
|
|
7365
|
+
function getBaseFeeParams(maxBaseFeeBps, minBaseFeeBps, feeSchedulerMode, numberOfPeriod, totalDuration) {
|
|
7366
|
+
if (maxBaseFeeBps == minBaseFeeBps) {
|
|
7367
|
+
if (numberOfPeriod != 0 || totalDuration != 0) {
|
|
7368
|
+
throw new Error("numberOfPeriod and totalDuration must both be zero");
|
|
7369
|
+
}
|
|
7370
|
+
return {
|
|
7371
|
+
cliffFeeNumerator: bpsToFeeNumerator(maxBaseFeeBps),
|
|
7372
|
+
numberOfPeriod: 0,
|
|
7373
|
+
periodFrequency: new BN5(0),
|
|
7374
|
+
reductionFactor: new BN5(0),
|
|
7375
|
+
feeSchedulerMode: 0
|
|
7376
|
+
};
|
|
7377
|
+
}
|
|
7378
|
+
if (numberOfPeriod <= 0) {
|
|
7379
|
+
throw new Error("Total periods must be greater than zero");
|
|
7380
|
+
}
|
|
7381
|
+
if (maxBaseFeeBps > feeNumeratorToBps(new BN5(MAX_FEE_NUMERATOR))) {
|
|
7382
|
+
throw new Error(
|
|
7383
|
+
`maxBaseFeeBps (${maxBaseFeeBps} bps) exceeds maximum allowed value of ${feeNumeratorToBps(
|
|
7384
|
+
new BN5(MAX_FEE_NUMERATOR)
|
|
7385
|
+
)} bps`
|
|
7386
|
+
);
|
|
7387
|
+
}
|
|
7388
|
+
if (minBaseFeeBps > maxBaseFeeBps) {
|
|
7389
|
+
throw new Error(
|
|
7390
|
+
"minBaseFee bps must be less than or equal to maxBaseFee bps"
|
|
7391
|
+
);
|
|
7392
|
+
}
|
|
7393
|
+
if (numberOfPeriod == 0 || totalDuration == 0) {
|
|
7394
|
+
throw new Error(
|
|
7395
|
+
"numberOfPeriod and totalDuration must both greater than zero"
|
|
7396
|
+
);
|
|
7397
|
+
}
|
|
7398
|
+
const maxBaseFeeNumerator = bpsToFeeNumerator(maxBaseFeeBps);
|
|
7399
|
+
const minBaseFeeNumerator = bpsToFeeNumerator(minBaseFeeBps);
|
|
7400
|
+
const periodFrequency = new BN5(totalDuration / numberOfPeriod);
|
|
7401
|
+
let reductionFactor;
|
|
7402
|
+
if (feeSchedulerMode == 0 /* Linear */) {
|
|
7403
|
+
const totalReduction = maxBaseFeeNumerator.sub(minBaseFeeNumerator);
|
|
7404
|
+
reductionFactor = totalReduction.divn(numberOfPeriod);
|
|
7405
|
+
} else {
|
|
7406
|
+
const ratio = minBaseFeeNumerator.toNumber() / maxBaseFeeNumerator.toNumber();
|
|
7407
|
+
const decayBase = Math.pow(ratio, 1 / numberOfPeriod);
|
|
7408
|
+
reductionFactor = new BN5(BASIS_POINT_MAX * (1 - decayBase));
|
|
7409
|
+
}
|
|
7410
|
+
return {
|
|
7411
|
+
cliffFeeNumerator: maxBaseFeeNumerator,
|
|
7412
|
+
numberOfPeriod,
|
|
7413
|
+
periodFrequency,
|
|
7414
|
+
reductionFactor,
|
|
7415
|
+
feeSchedulerMode
|
|
7416
|
+
};
|
|
7417
|
+
}
|
|
7418
|
+
function getDynamicFeeParams(baseFeeBps, maxPriceChangeBps = MAX_PRICE_CHANGE_BPS_DEFAULT) {
|
|
7419
|
+
if (maxPriceChangeBps > MAX_PRICE_CHANGE_BPS_DEFAULT) {
|
|
7420
|
+
throw new Error(
|
|
7421
|
+
`maxPriceChangeBps (${maxPriceChangeBps} bps) must be less than or equal to ${MAX_PRICE_CHANGE_BPS_DEFAULT}`
|
|
7422
|
+
);
|
|
7423
|
+
}
|
|
7424
|
+
const priceRatio = maxPriceChangeBps / BASIS_POINT_MAX + 1;
|
|
7425
|
+
const sqrtPriceRatioQ64 = new BN5(
|
|
7426
|
+
Decimal2.sqrt(priceRatio.toString()).mul(Decimal2.pow(2, 64)).floor().toFixed()
|
|
7427
|
+
);
|
|
7428
|
+
const deltaBinId = sqrtPriceRatioQ64.sub(ONE).div(BIN_STEP_BPS_U128_DEFAULT).muln(2);
|
|
7429
|
+
const maxVolatilityAccumulator = new BN5(deltaBinId.muln(BASIS_POINT_MAX));
|
|
7430
|
+
const squareVfaBin = maxVolatilityAccumulator.mul(new BN5(BIN_STEP_BPS_DEFAULT)).pow(new BN5(2));
|
|
7431
|
+
const baseFeeNumerator = new BN5(bpsToFeeNumerator(baseFeeBps));
|
|
7432
|
+
const maxDynamicFeeNumerator = baseFeeNumerator.muln(20).divn(100);
|
|
7433
|
+
const vFee = maxDynamicFeeNumerator.mul(new BN5(1e11)).sub(new BN5(99999999999));
|
|
7434
|
+
const variableFeeControl = vFee.div(squareVfaBin);
|
|
7435
|
+
return {
|
|
7436
|
+
binStep: BIN_STEP_BPS_DEFAULT,
|
|
7437
|
+
binStepU128: BIN_STEP_BPS_U128_DEFAULT,
|
|
7438
|
+
filterPeriod: DYNAMIC_FEE_FILTER_PERIOD_DEFAULT,
|
|
7439
|
+
decayPeriod: DYNAMIC_FEE_DECAY_PERIOD_DEFAULT,
|
|
7440
|
+
reductionFactor: DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT,
|
|
7441
|
+
maxVolatilityAccumulator: maxVolatilityAccumulator.toNumber(),
|
|
7442
|
+
variableFeeControl: variableFeeControl.toNumber()
|
|
7443
|
+
};
|
|
6888
7444
|
}
|
|
6889
7445
|
|
|
6890
7446
|
// src/helpers/computeUnits.ts
|
|
@@ -6894,7 +7450,7 @@ import {
|
|
|
6894
7450
|
TransactionMessage,
|
|
6895
7451
|
VersionedTransaction
|
|
6896
7452
|
} from "@solana/web3.js";
|
|
6897
|
-
var getSimulationComputeUnits = (connection, instructions, payer, lookupTables, commitment = "confirmed") => __async(
|
|
7453
|
+
var getSimulationComputeUnits = (connection, instructions, payer, lookupTables, commitment = "confirmed") => __async(null, null, function* () {
|
|
6898
7454
|
var _a, _b, _c;
|
|
6899
7455
|
const testInstructions = [
|
|
6900
7456
|
// Set an arbitrarily high number in simulation
|
|
@@ -6926,7 +7482,7 @@ var getSimulationComputeUnits = (connection, instructions, payer, lookupTables,
|
|
|
6926
7482
|
}
|
|
6927
7483
|
return rpcResponse.value.unitsConsumed || null;
|
|
6928
7484
|
});
|
|
6929
|
-
var getEstimatedComputeUnitUsageWithBuffer = (connection, instructions, feePayer, buffer) => __async(
|
|
7485
|
+
var getEstimatedComputeUnitUsageWithBuffer = (connection, instructions, feePayer, buffer) => __async(null, null, function* () {
|
|
6930
7486
|
if (!buffer) {
|
|
6931
7487
|
buffer = 0.1;
|
|
6932
7488
|
}
|
|
@@ -6949,7 +7505,7 @@ var getEstimatedComputeUnitUsageWithBuffer = (connection, instructions, feePayer
|
|
|
6949
7505
|
}
|
|
6950
7506
|
return estimatedComputeUnitUsage + extraComputeUnitBuffer;
|
|
6951
7507
|
});
|
|
6952
|
-
var getEstimatedComputeUnitIxWithBuffer = (connection, instructions, feePayer, buffer) => __async(
|
|
7508
|
+
var getEstimatedComputeUnitIxWithBuffer = (connection, instructions, feePayer, buffer) => __async(null, null, function* () {
|
|
6953
7509
|
const units = yield getEstimatedComputeUnitUsageWithBuffer(
|
|
6954
7510
|
connection,
|
|
6955
7511
|
instructions,
|
|
@@ -6964,7 +7520,7 @@ var getEstimatedComputeUnitIxWithBuffer = (connection, instructions, feePayer, b
|
|
|
6964
7520
|
|
|
6965
7521
|
// src/helpers/utils.ts
|
|
6966
7522
|
import { BN as BN6 } from "@coral-xyz/anchor";
|
|
6967
|
-
import
|
|
7523
|
+
import Decimal3 from "decimal.js";
|
|
6968
7524
|
var getMaxAmountWithSlippage = (amount, rate) => {
|
|
6969
7525
|
const slippage = (100 + rate) / 100 * BASIS_POINT_MAX;
|
|
6970
7526
|
return amount.mul(new BN6(slippage)).div(new BN6(BASIS_POINT_MAX));
|
|
@@ -6973,22 +7529,22 @@ var getMinAmountWithSlippage = (amount, rate) => {
|
|
|
6973
7529
|
const slippage = (100 - rate) / 100 * BASIS_POINT_MAX;
|
|
6974
7530
|
return amount.mul(new BN6(slippage)).div(new BN6(BASIS_POINT_MAX));
|
|
6975
7531
|
};
|
|
6976
|
-
var getPriceImpact = (
|
|
6977
|
-
const diff =
|
|
6978
|
-
return new
|
|
7532
|
+
var getPriceImpact = (nextSqrtPrice, currentSqrtPrice) => {
|
|
7533
|
+
const diff = nextSqrtPrice.pow(new BN6(2)).sub(currentSqrtPrice.pow(new BN6(2))).abs();
|
|
7534
|
+
return new Decimal3(diff.toString()).div(new Decimal3(currentSqrtPrice.pow(new BN6(2)).toString())).mul(100).toNumber();
|
|
6979
7535
|
};
|
|
6980
7536
|
var getPriceFromSqrtPrice = (sqrtPrice, tokenADecimal, tokenBDecimal) => {
|
|
6981
|
-
const decimalSqrtPrice = new
|
|
6982
|
-
const price = decimalSqrtPrice.mul(decimalSqrtPrice).mul(new
|
|
7537
|
+
const decimalSqrtPrice = new Decimal3(sqrtPrice.toString());
|
|
7538
|
+
const price = decimalSqrtPrice.mul(decimalSqrtPrice).mul(new Decimal3(__pow(10, tokenADecimal - tokenBDecimal))).div(Decimal3.pow(2, 128)).toString();
|
|
6983
7539
|
return price;
|
|
6984
7540
|
};
|
|
6985
7541
|
var getSqrtPriceFromPrice = (price, tokenADecimal, tokenBDecimal) => {
|
|
6986
|
-
const decimalPrice = new
|
|
7542
|
+
const decimalPrice = new Decimal3(price);
|
|
6987
7543
|
const adjustedByDecimals = decimalPrice.div(
|
|
6988
|
-
new
|
|
7544
|
+
new Decimal3(__pow(10, tokenADecimal - tokenBDecimal))
|
|
6989
7545
|
);
|
|
6990
|
-
const sqrtValue =
|
|
6991
|
-
const sqrtValueQ64 = sqrtValue.mul(
|
|
7546
|
+
const sqrtValue = Decimal3.sqrt(adjustedByDecimals);
|
|
7547
|
+
const sqrtValueQ64 = sqrtValue.mul(Decimal3.pow(2, 64));
|
|
6992
7548
|
return new BN6(sqrtValueQ64.floor().toFixed());
|
|
6993
7549
|
};
|
|
6994
7550
|
var getUnClaimReward = (poolState, positionState) => {
|
|
@@ -7028,28 +7584,28 @@ var vestingByPositionFilter = (position) => {
|
|
|
7028
7584
|
|
|
7029
7585
|
// src/helpers/priceMath.ts
|
|
7030
7586
|
import { BN as BN7 } from "@coral-xyz/anchor";
|
|
7031
|
-
import
|
|
7587
|
+
import Decimal4 from "decimal.js";
|
|
7032
7588
|
function calculateInitSqrtPrice(tokenAAmount, tokenBAmount, minSqrtPrice, maxSqrtPrice) {
|
|
7033
7589
|
if (tokenAAmount.isZero() || tokenBAmount.isZero()) {
|
|
7034
7590
|
throw new Error("Amount cannot be zero");
|
|
7035
7591
|
}
|
|
7036
|
-
const amountADecimal = new
|
|
7037
|
-
const amountBDecimal = new
|
|
7038
|
-
const minSqrtPriceDecimal = new
|
|
7039
|
-
|
|
7592
|
+
const amountADecimal = new Decimal4(tokenAAmount.toString());
|
|
7593
|
+
const amountBDecimal = new Decimal4(tokenBAmount.toString());
|
|
7594
|
+
const minSqrtPriceDecimal = new Decimal4(minSqrtPrice.toString()).div(
|
|
7595
|
+
Decimal4.pow(2, 64)
|
|
7040
7596
|
);
|
|
7041
|
-
const maxSqrtPriceDecimal = new
|
|
7042
|
-
|
|
7597
|
+
const maxSqrtPriceDecimal = new Decimal4(maxSqrtPrice.toString()).div(
|
|
7598
|
+
Decimal4.pow(2, 64)
|
|
7043
7599
|
);
|
|
7044
|
-
const x = new
|
|
7600
|
+
const x = new Decimal4(1).div(maxSqrtPriceDecimal);
|
|
7045
7601
|
const y = amountBDecimal.div(amountADecimal);
|
|
7046
7602
|
const xy = x.mul(y);
|
|
7047
7603
|
const paMinusXY = minSqrtPriceDecimal.sub(xy);
|
|
7048
7604
|
const xyMinusPa = xy.sub(minSqrtPriceDecimal);
|
|
7049
|
-
const fourY = new
|
|
7605
|
+
const fourY = new Decimal4(4).mul(y);
|
|
7050
7606
|
const discriminant = xyMinusPa.mul(xyMinusPa).add(fourY);
|
|
7051
7607
|
const sqrtDiscriminant = discriminant.sqrt();
|
|
7052
|
-
const result = paMinusXY.add(sqrtDiscriminant).div(new
|
|
7608
|
+
const result = paMinusXY.add(sqrtDiscriminant).div(new Decimal4(2)).mul(Decimal4.pow(2, 64));
|
|
7053
7609
|
return new BN7(result.floor().toFixed());
|
|
7054
7610
|
}
|
|
7055
7611
|
|
|
@@ -7177,7 +7733,7 @@ function getAvailableVestingLiquidity(vestingData, currentPoint) {
|
|
|
7177
7733
|
}
|
|
7178
7734
|
|
|
7179
7735
|
// src/CpAmm.ts
|
|
7180
|
-
import { min as min2 } from "bn.js";
|
|
7736
|
+
import { min as min2, max } from "bn.js";
|
|
7181
7737
|
var CpAmm = class {
|
|
7182
7738
|
constructor(connection) {
|
|
7183
7739
|
this._program = new Program(cp_amm_default, {
|
|
@@ -7185,13 +7741,7 @@ var CpAmm = class {
|
|
|
7185
7741
|
});
|
|
7186
7742
|
this.poolAuthority = derivePoolAuthority();
|
|
7187
7743
|
}
|
|
7188
|
-
|
|
7189
|
-
* Returns the Anchor program instance.
|
|
7190
|
-
* @returns The AmmProgram instance.
|
|
7191
|
-
*/
|
|
7192
|
-
getProgram() {
|
|
7193
|
-
return this._program;
|
|
7194
|
-
}
|
|
7744
|
+
//// ANCHOR: PRIVATE FUNCTIONS //////
|
|
7195
7745
|
/**
|
|
7196
7746
|
* Prepares token accounts for a transaction by retrieving or creating associated token accounts.
|
|
7197
7747
|
* @private
|
|
@@ -7203,8 +7753,17 @@ var CpAmm = class {
|
|
|
7203
7753
|
* @returns {Promise<{tokenAAta: PublicKey, tokenBAta: PublicKey, instructions: TransactionInstruction[]}>}
|
|
7204
7754
|
* The token account addresses and any instructions needed to create them
|
|
7205
7755
|
*/
|
|
7206
|
-
prepareTokenAccounts(
|
|
7756
|
+
prepareTokenAccounts(params) {
|
|
7207
7757
|
return __async(this, null, function* () {
|
|
7758
|
+
const {
|
|
7759
|
+
payer,
|
|
7760
|
+
tokenAOwner,
|
|
7761
|
+
tokenBOwner,
|
|
7762
|
+
tokenAMint,
|
|
7763
|
+
tokenBMint,
|
|
7764
|
+
tokenAProgram,
|
|
7765
|
+
tokenBProgram
|
|
7766
|
+
} = params;
|
|
7208
7767
|
const instructions = [];
|
|
7209
7768
|
const [
|
|
7210
7769
|
{ ataPubkey: tokenAAta, ix: createInputTokenAccountIx },
|
|
@@ -7213,16 +7772,16 @@ var CpAmm = class {
|
|
|
7213
7772
|
getOrCreateATAInstruction(
|
|
7214
7773
|
this._program.provider.connection,
|
|
7215
7774
|
tokenAMint,
|
|
7216
|
-
|
|
7217
|
-
|
|
7775
|
+
tokenAOwner,
|
|
7776
|
+
payer,
|
|
7218
7777
|
true,
|
|
7219
7778
|
tokenAProgram
|
|
7220
7779
|
),
|
|
7221
7780
|
getOrCreateATAInstruction(
|
|
7222
7781
|
this._program.provider.connection,
|
|
7223
7782
|
tokenBMint,
|
|
7224
|
-
|
|
7225
|
-
|
|
7783
|
+
tokenBOwner,
|
|
7784
|
+
payer,
|
|
7226
7785
|
true,
|
|
7227
7786
|
tokenBProgram
|
|
7228
7787
|
)
|
|
@@ -7532,6 +8091,132 @@ var CpAmm = class {
|
|
|
7532
8091
|
};
|
|
7533
8092
|
});
|
|
7534
8093
|
}
|
|
8094
|
+
/**
|
|
8095
|
+
* Private helper method to prepare common customizable pool creation logic
|
|
8096
|
+
* @param {PrepareCustomizablePoolParams} params - Common parameters for pool creation
|
|
8097
|
+
* @returns Prepared transaction data including instructions and accounts
|
|
8098
|
+
*/
|
|
8099
|
+
prepareCreatePoolParams(params) {
|
|
8100
|
+
return __async(this, null, function* () {
|
|
8101
|
+
const {
|
|
8102
|
+
pool,
|
|
8103
|
+
tokenAMint,
|
|
8104
|
+
tokenBMint,
|
|
8105
|
+
tokenAAmount,
|
|
8106
|
+
tokenBAmount,
|
|
8107
|
+
payer,
|
|
8108
|
+
positionNft,
|
|
8109
|
+
tokenAProgram,
|
|
8110
|
+
tokenBProgram
|
|
8111
|
+
} = params;
|
|
8112
|
+
const position = derivePositionAddress(positionNft);
|
|
8113
|
+
const positionNftAccount = derivePositionNftAccount(positionNft);
|
|
8114
|
+
const tokenAVault = deriveTokenVaultAddress(tokenAMint, pool);
|
|
8115
|
+
const tokenBVault = deriveTokenVaultAddress(tokenBMint, pool);
|
|
8116
|
+
const {
|
|
8117
|
+
tokenAAta: payerTokenA,
|
|
8118
|
+
tokenBAta: payerTokenB,
|
|
8119
|
+
instructions: preInstructions
|
|
8120
|
+
} = yield this.prepareTokenAccounts({
|
|
8121
|
+
payer,
|
|
8122
|
+
tokenAOwner: payer,
|
|
8123
|
+
tokenBOwner: payer,
|
|
8124
|
+
tokenAMint,
|
|
8125
|
+
tokenBMint,
|
|
8126
|
+
tokenAProgram,
|
|
8127
|
+
tokenBProgram
|
|
8128
|
+
});
|
|
8129
|
+
if (tokenAMint.equals(NATIVE_MINT2)) {
|
|
8130
|
+
const wrapSOLIx = wrapSOLInstruction(
|
|
8131
|
+
payer,
|
|
8132
|
+
payerTokenA,
|
|
8133
|
+
BigInt(tokenAAmount.toString())
|
|
8134
|
+
);
|
|
8135
|
+
preInstructions.push(...wrapSOLIx);
|
|
8136
|
+
}
|
|
8137
|
+
if (tokenBMint.equals(NATIVE_MINT2)) {
|
|
8138
|
+
const wrapSOLIx = wrapSOLInstruction(
|
|
8139
|
+
payer,
|
|
8140
|
+
payerTokenB,
|
|
8141
|
+
BigInt(tokenBAmount.toString())
|
|
8142
|
+
);
|
|
8143
|
+
preInstructions.push(...wrapSOLIx);
|
|
8144
|
+
}
|
|
8145
|
+
const tokenBadgeAccounts = this.getTokenBadgeAccounts(
|
|
8146
|
+
tokenAMint,
|
|
8147
|
+
tokenBMint
|
|
8148
|
+
);
|
|
8149
|
+
return {
|
|
8150
|
+
position,
|
|
8151
|
+
positionNftAccount,
|
|
8152
|
+
tokenAVault,
|
|
8153
|
+
tokenBVault,
|
|
8154
|
+
payerTokenA,
|
|
8155
|
+
payerTokenB,
|
|
8156
|
+
preInstructions,
|
|
8157
|
+
tokenBadgeAccounts
|
|
8158
|
+
};
|
|
8159
|
+
});
|
|
8160
|
+
}
|
|
8161
|
+
/**
|
|
8162
|
+
* Sets up token accounts and instructions for fee claim operations.
|
|
8163
|
+
* @private
|
|
8164
|
+
* @param {SetupFeeClaimAccountsParams} params - Parameters for setting up fee claim accounts.
|
|
8165
|
+
* @returns Token accounts and instructions for fee claiming.
|
|
8166
|
+
*/
|
|
8167
|
+
setupFeeClaimAccounts(params) {
|
|
8168
|
+
return __async(this, null, function* () {
|
|
8169
|
+
const {
|
|
8170
|
+
payer,
|
|
8171
|
+
owner,
|
|
8172
|
+
tokenAMint,
|
|
8173
|
+
tokenBMint,
|
|
8174
|
+
tokenAProgram,
|
|
8175
|
+
tokenBProgram,
|
|
8176
|
+
receiver,
|
|
8177
|
+
tempWSolAccount
|
|
8178
|
+
} = params;
|
|
8179
|
+
const tokenAIsSOL = tokenAMint.equals(NATIVE_MINT2);
|
|
8180
|
+
const tokenBIsSOL = tokenBMint.equals(NATIVE_MINT2);
|
|
8181
|
+
const hasSolToken = tokenAIsSOL || tokenBIsSOL;
|
|
8182
|
+
const preInstructions = [];
|
|
8183
|
+
const postInstructions = [];
|
|
8184
|
+
let tokenAAccount;
|
|
8185
|
+
let tokenBAccount;
|
|
8186
|
+
let tokenAOwner = owner;
|
|
8187
|
+
let tokenBOwner = owner;
|
|
8188
|
+
if (receiver) {
|
|
8189
|
+
tokenAOwner = tokenAIsSOL ? tempWSolAccount : receiver;
|
|
8190
|
+
tokenBOwner = tokenBIsSOL ? tempWSolAccount : receiver;
|
|
8191
|
+
}
|
|
8192
|
+
const { tokenAAta, tokenBAta, instructions } = yield this.prepareTokenAccounts({
|
|
8193
|
+
payer,
|
|
8194
|
+
tokenAOwner,
|
|
8195
|
+
tokenBOwner,
|
|
8196
|
+
tokenAMint,
|
|
8197
|
+
tokenBMint,
|
|
8198
|
+
tokenAProgram,
|
|
8199
|
+
tokenBProgram
|
|
8200
|
+
});
|
|
8201
|
+
tokenAAccount = tokenAAta;
|
|
8202
|
+
tokenBAccount = tokenBAta;
|
|
8203
|
+
preInstructions.push(...instructions);
|
|
8204
|
+
if (hasSolToken) {
|
|
8205
|
+
const closeWrappedSOLIx = yield unwrapSOLInstruction(
|
|
8206
|
+
tempWSolAccount != null ? tempWSolAccount : owner,
|
|
8207
|
+
receiver != null ? receiver : owner
|
|
8208
|
+
);
|
|
8209
|
+
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
8210
|
+
}
|
|
8211
|
+
return {
|
|
8212
|
+
tokenAAccount,
|
|
8213
|
+
tokenBAccount,
|
|
8214
|
+
preInstructions,
|
|
8215
|
+
postInstructions
|
|
8216
|
+
};
|
|
8217
|
+
});
|
|
8218
|
+
}
|
|
8219
|
+
//// ANCHOR: GETTER/FETCHER FUNCTIONS //////
|
|
7535
8220
|
/**
|
|
7536
8221
|
* Fetches the Config state of the program.
|
|
7537
8222
|
* @param config - Public key of the config account.
|
|
@@ -7806,7 +8491,7 @@ var CpAmm = class {
|
|
|
7806
8491
|
reductionFactor,
|
|
7807
8492
|
dynamicFeeParams
|
|
7808
8493
|
);
|
|
7809
|
-
const { amountOut, totalFee } = getSwapAmount(
|
|
8494
|
+
const { amountOut, totalFee, nextSqrtPrice } = getSwapAmount(
|
|
7810
8495
|
actualAmountIn,
|
|
7811
8496
|
sqrtPriceQ64,
|
|
7812
8497
|
liquidityQ64,
|
|
@@ -7832,7 +8517,7 @@ var CpAmm = class {
|
|
|
7832
8517
|
swapOutAmount: actualAmountOut,
|
|
7833
8518
|
minSwapOutAmount,
|
|
7834
8519
|
totalFee,
|
|
7835
|
-
priceImpact: getPriceImpact(
|
|
8520
|
+
priceImpact: getPriceImpact(nextSqrtPrice, sqrtPriceQ64)
|
|
7836
8521
|
};
|
|
7837
8522
|
}
|
|
7838
8523
|
/**
|
|
@@ -7855,13 +8540,11 @@ var CpAmm = class {
|
|
|
7855
8540
|
maxSqrtPrice,
|
|
7856
8541
|
sqrtPrice
|
|
7857
8542
|
} = params;
|
|
7858
|
-
const actualAmountIn = inputTokenInfo ?
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
).transferFee
|
|
7864
|
-
) : inAmount;
|
|
8543
|
+
const actualAmountIn = inputTokenInfo ? calculateTransferFeeExcludedAmount(
|
|
8544
|
+
inAmount,
|
|
8545
|
+
inputTokenInfo.mint,
|
|
8546
|
+
inputTokenInfo.currentEpoch
|
|
8547
|
+
).amount : inAmount;
|
|
7865
8548
|
const { liquidityDelta, rawAmount } = isTokenA ? {
|
|
7866
8549
|
liquidityDelta: getLiquidityDeltaFromAmountA(
|
|
7867
8550
|
actualAmountIn,
|
|
@@ -8036,6 +8719,7 @@ var CpAmm = class {
|
|
|
8036
8719
|
liquidityDelta
|
|
8037
8720
|
};
|
|
8038
8721
|
}
|
|
8722
|
+
//// ANCHOR: MAIN ENDPOINT //////
|
|
8039
8723
|
/**
|
|
8040
8724
|
* Builds a transaction to create a permissionless pool.
|
|
8041
8725
|
* @param params - Parameters for pool creation.
|
|
@@ -8056,44 +8740,40 @@ var CpAmm = class {
|
|
|
8056
8740
|
tokenAAmount,
|
|
8057
8741
|
tokenBAmount,
|
|
8058
8742
|
tokenAProgram,
|
|
8059
|
-
tokenBProgram
|
|
8743
|
+
tokenBProgram,
|
|
8744
|
+
isLockLiquidity
|
|
8060
8745
|
} = params;
|
|
8061
8746
|
const pool = derivePoolAddress(config, tokenAMint, tokenBMint);
|
|
8062
|
-
const position = derivePositionAddress(positionNft);
|
|
8063
|
-
const positionNftAccount = derivePositionNftAccount(positionNft);
|
|
8064
|
-
const tokenAVault = deriveTokenVaultAddress(tokenAMint, pool);
|
|
8065
|
-
const tokenBVault = deriveTokenVaultAddress(tokenBMint, pool);
|
|
8066
8747
|
const {
|
|
8067
|
-
|
|
8068
|
-
|
|
8069
|
-
|
|
8070
|
-
|
|
8071
|
-
|
|
8748
|
+
position,
|
|
8749
|
+
positionNftAccount,
|
|
8750
|
+
tokenAVault,
|
|
8751
|
+
tokenBVault,
|
|
8752
|
+
payerTokenA,
|
|
8753
|
+
payerTokenB,
|
|
8754
|
+
preInstructions,
|
|
8755
|
+
tokenBadgeAccounts
|
|
8756
|
+
} = yield this.prepareCreatePoolParams({
|
|
8757
|
+
pool,
|
|
8072
8758
|
tokenAMint,
|
|
8073
8759
|
tokenBMint,
|
|
8760
|
+
tokenAAmount,
|
|
8761
|
+
tokenBAmount,
|
|
8762
|
+
payer,
|
|
8763
|
+
positionNft,
|
|
8074
8764
|
tokenAProgram,
|
|
8075
8765
|
tokenBProgram
|
|
8076
|
-
);
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
|
|
8085
|
-
|
|
8086
|
-
const wrapSOLIx = wrapSOLInstruction(
|
|
8087
|
-
payer,
|
|
8088
|
-
payerTokenB,
|
|
8089
|
-
BigInt(tokenBAmount.toString())
|
|
8090
|
-
);
|
|
8091
|
-
preInstructions.push(...wrapSOLIx);
|
|
8766
|
+
});
|
|
8767
|
+
const postInstruction = [];
|
|
8768
|
+
if (isLockLiquidity) {
|
|
8769
|
+
const permanentLockIx = yield this._program.methods.permanentLockPosition(liquidityDelta).accountsPartial({
|
|
8770
|
+
position,
|
|
8771
|
+
positionNftAccount,
|
|
8772
|
+
pool,
|
|
8773
|
+
owner: creator
|
|
8774
|
+
}).instruction();
|
|
8775
|
+
postInstruction.push(permanentLockIx);
|
|
8092
8776
|
}
|
|
8093
|
-
const tokenBadgeAccounts = this.getTokenBadgeAccounts(
|
|
8094
|
-
tokenAMint,
|
|
8095
|
-
tokenBMint
|
|
8096
|
-
);
|
|
8097
8777
|
const tx = yield this._program.methods.initializePool({
|
|
8098
8778
|
liquidity: liquidityDelta,
|
|
8099
8779
|
sqrtPrice: initSqrtPrice,
|
|
@@ -8117,7 +8797,7 @@ var CpAmm = class {
|
|
|
8117
8797
|
tokenAProgram,
|
|
8118
8798
|
tokenBProgram,
|
|
8119
8799
|
systemProgram: SystemProgram2.programId
|
|
8120
|
-
}).preInstructions(preInstructions).remainingAccounts(tokenBadgeAccounts).transaction();
|
|
8800
|
+
}).preInstructions(preInstructions).postInstructions(postInstruction).remainingAccounts(tokenBadgeAccounts).transaction();
|
|
8121
8801
|
return tx;
|
|
8122
8802
|
});
|
|
8123
8803
|
}
|
|
@@ -8146,45 +8826,40 @@ var CpAmm = class {
|
|
|
8146
8826
|
activationPoint,
|
|
8147
8827
|
activationType,
|
|
8148
8828
|
tokenAProgram,
|
|
8149
|
-
tokenBProgram
|
|
8829
|
+
tokenBProgram,
|
|
8830
|
+
isLockLiquidity
|
|
8150
8831
|
} = params;
|
|
8151
8832
|
const pool = deriveCustomizablePoolAddress(tokenAMint, tokenBMint);
|
|
8152
|
-
const position = derivePositionAddress(positionNft);
|
|
8153
|
-
const positionNftAccount = derivePositionNftAccount(positionNft);
|
|
8154
|
-
const tokenAVault = deriveTokenVaultAddress(tokenAMint, pool);
|
|
8155
|
-
const tokenBVault = deriveTokenVaultAddress(tokenBMint, pool);
|
|
8156
8833
|
const {
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8834
|
+
position,
|
|
8835
|
+
positionNftAccount,
|
|
8836
|
+
tokenAVault,
|
|
8837
|
+
tokenBVault,
|
|
8838
|
+
payerTokenA,
|
|
8839
|
+
payerTokenB,
|
|
8840
|
+
preInstructions,
|
|
8841
|
+
tokenBadgeAccounts
|
|
8842
|
+
} = yield this.prepareCreatePoolParams({
|
|
8843
|
+
pool,
|
|
8162
8844
|
tokenAMint,
|
|
8163
8845
|
tokenBMint,
|
|
8846
|
+
tokenAAmount,
|
|
8847
|
+
tokenBAmount: tokenBMint.equals(NATIVE_MINT2) ? max(tokenBAmount, new BN10(1)) : tokenBAmount,
|
|
8848
|
+
payer,
|
|
8849
|
+
positionNft,
|
|
8164
8850
|
tokenAProgram,
|
|
8165
8851
|
tokenBProgram
|
|
8166
|
-
);
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
const lamports = tokenBAmount.eq(new BN10(0)) ? new BN10(1) : tokenBAmount;
|
|
8177
|
-
const wrapSOLIx = wrapSOLInstruction(
|
|
8178
|
-
payer,
|
|
8179
|
-
payerTokenB,
|
|
8180
|
-
BigInt(lamports.toString())
|
|
8181
|
-
);
|
|
8182
|
-
preInstructions.push(...wrapSOLIx);
|
|
8852
|
+
});
|
|
8853
|
+
const postInstruction = [];
|
|
8854
|
+
if (isLockLiquidity) {
|
|
8855
|
+
const permanentLockIx = yield this._program.methods.permanentLockPosition(liquidityDelta).accountsPartial({
|
|
8856
|
+
position,
|
|
8857
|
+
positionNftAccount,
|
|
8858
|
+
pool,
|
|
8859
|
+
owner: creator
|
|
8860
|
+
}).instruction();
|
|
8861
|
+
postInstruction.push(permanentLockIx);
|
|
8183
8862
|
}
|
|
8184
|
-
const tokenBadgeAccounts = this.getTokenBadgeAccounts(
|
|
8185
|
-
tokenAMint,
|
|
8186
|
-
tokenBMint
|
|
8187
|
-
);
|
|
8188
8863
|
const transaction = yield this._program.methods.initializeCustomizablePool({
|
|
8189
8864
|
poolFees,
|
|
8190
8865
|
sqrtMinPrice,
|
|
@@ -8213,7 +8888,97 @@ var CpAmm = class {
|
|
|
8213
8888
|
tokenAProgram,
|
|
8214
8889
|
tokenBProgram,
|
|
8215
8890
|
systemProgram: SystemProgram2.programId
|
|
8216
|
-
}).preInstructions(preInstructions).remainingAccounts(tokenBadgeAccounts).transaction();
|
|
8891
|
+
}).preInstructions(preInstructions).postInstructions(postInstruction).remainingAccounts(tokenBadgeAccounts).transaction();
|
|
8892
|
+
return { tx: transaction, pool, position };
|
|
8893
|
+
});
|
|
8894
|
+
}
|
|
8895
|
+
createCustomPoolWithDynamicConfig(params) {
|
|
8896
|
+
return __async(this, null, function* () {
|
|
8897
|
+
const {
|
|
8898
|
+
tokenAMint,
|
|
8899
|
+
tokenBMint,
|
|
8900
|
+
tokenAAmount,
|
|
8901
|
+
tokenBAmount,
|
|
8902
|
+
sqrtMinPrice,
|
|
8903
|
+
sqrtMaxPrice,
|
|
8904
|
+
liquidityDelta,
|
|
8905
|
+
initSqrtPrice,
|
|
8906
|
+
payer,
|
|
8907
|
+
config,
|
|
8908
|
+
poolCreatorAuthority,
|
|
8909
|
+
creator,
|
|
8910
|
+
positionNft,
|
|
8911
|
+
poolFees,
|
|
8912
|
+
hasAlphaVault,
|
|
8913
|
+
collectFeeMode,
|
|
8914
|
+
activationPoint,
|
|
8915
|
+
activationType,
|
|
8916
|
+
tokenAProgram,
|
|
8917
|
+
tokenBProgram,
|
|
8918
|
+
isLockLiquidity
|
|
8919
|
+
} = params;
|
|
8920
|
+
const pool = derivePoolAddress(config, tokenAMint, tokenBMint);
|
|
8921
|
+
const {
|
|
8922
|
+
position,
|
|
8923
|
+
positionNftAccount,
|
|
8924
|
+
tokenAVault,
|
|
8925
|
+
tokenBVault,
|
|
8926
|
+
payerTokenA,
|
|
8927
|
+
payerTokenB,
|
|
8928
|
+
preInstructions,
|
|
8929
|
+
tokenBadgeAccounts
|
|
8930
|
+
} = yield this.prepareCreatePoolParams({
|
|
8931
|
+
pool,
|
|
8932
|
+
tokenAMint,
|
|
8933
|
+
tokenBMint,
|
|
8934
|
+
tokenAAmount,
|
|
8935
|
+
tokenBAmount,
|
|
8936
|
+
payer,
|
|
8937
|
+
positionNft,
|
|
8938
|
+
tokenAProgram,
|
|
8939
|
+
tokenBProgram
|
|
8940
|
+
});
|
|
8941
|
+
const postInstruction = [];
|
|
8942
|
+
if (isLockLiquidity) {
|
|
8943
|
+
const permanentLockIx = yield this._program.methods.permanentLockPosition(liquidityDelta).accountsPartial({
|
|
8944
|
+
position,
|
|
8945
|
+
positionNftAccount,
|
|
8946
|
+
pool,
|
|
8947
|
+
owner: creator
|
|
8948
|
+
}).instruction();
|
|
8949
|
+
postInstruction.push(permanentLockIx);
|
|
8950
|
+
}
|
|
8951
|
+
const transaction = yield this._program.methods.initializePoolWithDynamicConfig({
|
|
8952
|
+
poolFees,
|
|
8953
|
+
sqrtMinPrice,
|
|
8954
|
+
sqrtMaxPrice,
|
|
8955
|
+
hasAlphaVault,
|
|
8956
|
+
liquidity: liquidityDelta,
|
|
8957
|
+
sqrtPrice: initSqrtPrice,
|
|
8958
|
+
activationType,
|
|
8959
|
+
collectFeeMode,
|
|
8960
|
+
activationPoint
|
|
8961
|
+
}).accountsPartial({
|
|
8962
|
+
creator,
|
|
8963
|
+
positionNftAccount,
|
|
8964
|
+
positionNftMint: positionNft,
|
|
8965
|
+
payer,
|
|
8966
|
+
poolAuthority: this.poolAuthority,
|
|
8967
|
+
pool,
|
|
8968
|
+
position,
|
|
8969
|
+
poolCreatorAuthority,
|
|
8970
|
+
config,
|
|
8971
|
+
tokenAMint,
|
|
8972
|
+
tokenBMint,
|
|
8973
|
+
tokenAVault,
|
|
8974
|
+
tokenBVault,
|
|
8975
|
+
payerTokenA,
|
|
8976
|
+
payerTokenB,
|
|
8977
|
+
token2022Program: TOKEN_2022_PROGRAM_ID2,
|
|
8978
|
+
tokenAProgram,
|
|
8979
|
+
tokenBProgram,
|
|
8980
|
+
systemProgram: SystemProgram2.programId
|
|
8981
|
+
}).preInstructions(preInstructions).postInstructions(postInstruction).remainingAccounts(tokenBadgeAccounts).transaction();
|
|
8217
8982
|
return { tx: transaction, pool, position };
|
|
8218
8983
|
});
|
|
8219
8984
|
}
|
|
@@ -8256,13 +9021,15 @@ var CpAmm = class {
|
|
|
8256
9021
|
tokenAAta: tokenAAccount,
|
|
8257
9022
|
tokenBAta: tokenBAccount,
|
|
8258
9023
|
instructions: preInstructions
|
|
8259
|
-
} = yield this.prepareTokenAccounts(
|
|
8260
|
-
owner,
|
|
9024
|
+
} = yield this.prepareTokenAccounts({
|
|
9025
|
+
payer: owner,
|
|
9026
|
+
tokenAOwner: owner,
|
|
9027
|
+
tokenBOwner: owner,
|
|
8261
9028
|
tokenAMint,
|
|
8262
9029
|
tokenBMint,
|
|
8263
9030
|
tokenAProgram,
|
|
8264
9031
|
tokenBProgram
|
|
8265
|
-
);
|
|
9032
|
+
});
|
|
8266
9033
|
if (tokenAMint.equals(NATIVE_MINT2)) {
|
|
8267
9034
|
const wrapSOLIx = wrapSOLInstruction(
|
|
8268
9035
|
owner,
|
|
@@ -8334,8 +9101,6 @@ var CpAmm = class {
|
|
|
8334
9101
|
tokenBAmountThreshold,
|
|
8335
9102
|
tokenAMint,
|
|
8336
9103
|
tokenBMint,
|
|
8337
|
-
tokenAVault,
|
|
8338
|
-
tokenBVault,
|
|
8339
9104
|
tokenAProgram,
|
|
8340
9105
|
tokenBProgram
|
|
8341
9106
|
} = params;
|
|
@@ -8343,13 +9108,17 @@ var CpAmm = class {
|
|
|
8343
9108
|
tokenAAta: tokenAAccount,
|
|
8344
9109
|
tokenBAta: tokenBAccount,
|
|
8345
9110
|
instructions: preInstructions
|
|
8346
|
-
} = yield this.prepareTokenAccounts(
|
|
8347
|
-
owner,
|
|
9111
|
+
} = yield this.prepareTokenAccounts({
|
|
9112
|
+
payer: owner,
|
|
9113
|
+
tokenAOwner: owner,
|
|
9114
|
+
tokenBOwner: owner,
|
|
8348
9115
|
tokenAMint,
|
|
8349
9116
|
tokenBMint,
|
|
8350
9117
|
tokenAProgram,
|
|
8351
9118
|
tokenBProgram
|
|
8352
|
-
);
|
|
9119
|
+
});
|
|
9120
|
+
const tokenAVault = deriveTokenVaultAddress(tokenAMint, pool);
|
|
9121
|
+
const tokenBVault = deriveTokenVaultAddress(tokenBMint, pool);
|
|
8353
9122
|
if (tokenAMint.equals(NATIVE_MINT2)) {
|
|
8354
9123
|
const wrapSOLIx = wrapSOLInstruction(
|
|
8355
9124
|
owner,
|
|
@@ -8437,13 +9206,15 @@ var CpAmm = class {
|
|
|
8437
9206
|
tokenAAta: tokenAAccount,
|
|
8438
9207
|
tokenBAta: tokenBAccount,
|
|
8439
9208
|
instructions: preInstructions
|
|
8440
|
-
} = yield this.prepareTokenAccounts(
|
|
8441
|
-
owner,
|
|
9209
|
+
} = yield this.prepareTokenAccounts({
|
|
9210
|
+
payer: owner,
|
|
9211
|
+
tokenAOwner: owner,
|
|
9212
|
+
tokenBOwner: owner,
|
|
8442
9213
|
tokenAMint,
|
|
8443
9214
|
tokenBMint,
|
|
8444
9215
|
tokenAProgram,
|
|
8445
9216
|
tokenBProgram
|
|
8446
|
-
);
|
|
9217
|
+
});
|
|
8447
9218
|
const postInstructions = [];
|
|
8448
9219
|
if ([tokenAMint.toBase58(), tokenBMint.toBase58()].includes(
|
|
8449
9220
|
NATIVE_MINT2.toBase58()
|
|
@@ -8508,13 +9279,15 @@ var CpAmm = class {
|
|
|
8508
9279
|
tokenAAta: tokenAAccount,
|
|
8509
9280
|
tokenBAta: tokenBAccount,
|
|
8510
9281
|
instructions: preInstructions
|
|
8511
|
-
} = yield this.prepareTokenAccounts(
|
|
8512
|
-
owner,
|
|
9282
|
+
} = yield this.prepareTokenAccounts({
|
|
9283
|
+
payer: owner,
|
|
9284
|
+
tokenAOwner: owner,
|
|
9285
|
+
tokenBOwner: owner,
|
|
8513
9286
|
tokenAMint,
|
|
8514
9287
|
tokenBMint,
|
|
8515
9288
|
tokenAProgram,
|
|
8516
9289
|
tokenBProgram
|
|
8517
|
-
);
|
|
9290
|
+
});
|
|
8518
9291
|
const postInstructions = [];
|
|
8519
9292
|
if ([tokenAMint.toBase58(), tokenBMint.toBase58()].includes(
|
|
8520
9293
|
NATIVE_MINT2.toBase58()
|
|
@@ -8587,13 +9360,15 @@ var CpAmm = class {
|
|
|
8587
9360
|
tokenAAta: inputTokenAccount,
|
|
8588
9361
|
tokenBAta: outputTokenAccount,
|
|
8589
9362
|
instructions: preInstructions
|
|
8590
|
-
} = yield this.prepareTokenAccounts(
|
|
9363
|
+
} = yield this.prepareTokenAccounts({
|
|
8591
9364
|
payer,
|
|
8592
|
-
|
|
8593
|
-
|
|
8594
|
-
|
|
8595
|
-
|
|
8596
|
-
|
|
9365
|
+
tokenAOwner: payer,
|
|
9366
|
+
tokenBOwner: payer,
|
|
9367
|
+
tokenAMint: inputTokenMint,
|
|
9368
|
+
tokenBMint: outputTokenMint,
|
|
9369
|
+
tokenAProgram: inputTokenProgram,
|
|
9370
|
+
tokenBProgram: outputTokenProgram
|
|
9371
|
+
});
|
|
8597
9372
|
if (inputTokenMint.equals(NATIVE_MINT2)) {
|
|
8598
9373
|
const wrapSOLIx = wrapSOLInstruction(
|
|
8599
9374
|
payer,
|
|
@@ -8693,67 +9468,6 @@ var CpAmm = class {
|
|
|
8693
9468
|
return new Transaction().add(instruction);
|
|
8694
9469
|
});
|
|
8695
9470
|
}
|
|
8696
|
-
/**
|
|
8697
|
-
* Builds a transaction to claim position fee rewards.
|
|
8698
|
-
* @param {ClaimPositionFeeParams} params - Parameters for claiming position fee.
|
|
8699
|
-
* @returns Transaction builder.
|
|
8700
|
-
*/
|
|
8701
|
-
claimPositionFee(params) {
|
|
8702
|
-
return __async(this, null, function* () {
|
|
8703
|
-
const {
|
|
8704
|
-
owner,
|
|
8705
|
-
pool,
|
|
8706
|
-
position,
|
|
8707
|
-
positionNftAccount,
|
|
8708
|
-
tokenAVault,
|
|
8709
|
-
tokenBVault,
|
|
8710
|
-
tokenAMint,
|
|
8711
|
-
tokenBMint,
|
|
8712
|
-
tokenAProgram,
|
|
8713
|
-
tokenBProgram
|
|
8714
|
-
} = params;
|
|
8715
|
-
const {
|
|
8716
|
-
tokenAAta: tokenAAccount,
|
|
8717
|
-
tokenBAta: tokenBAccount,
|
|
8718
|
-
instructions: preInstructions
|
|
8719
|
-
} = yield this.prepareTokenAccounts(
|
|
8720
|
-
owner,
|
|
8721
|
-
tokenAMint,
|
|
8722
|
-
tokenBMint,
|
|
8723
|
-
tokenAProgram,
|
|
8724
|
-
tokenBProgram
|
|
8725
|
-
);
|
|
8726
|
-
const postInstructions = [];
|
|
8727
|
-
if ([tokenAMint.toBase58(), tokenBMint.toBase58()].includes(
|
|
8728
|
-
NATIVE_MINT2.toBase58()
|
|
8729
|
-
)) {
|
|
8730
|
-
const closeWrappedSOLIx = yield unwrapSOLInstruction(owner);
|
|
8731
|
-
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
8732
|
-
}
|
|
8733
|
-
const claimPositionFeeInstruction = yield this.buildClaimPositionFeeInstruction({
|
|
8734
|
-
owner,
|
|
8735
|
-
poolAuthority: this.poolAuthority,
|
|
8736
|
-
pool,
|
|
8737
|
-
position,
|
|
8738
|
-
positionNftAccount,
|
|
8739
|
-
tokenAAccount,
|
|
8740
|
-
tokenBAccount,
|
|
8741
|
-
tokenAVault,
|
|
8742
|
-
tokenBVault,
|
|
8743
|
-
tokenAMint,
|
|
8744
|
-
tokenBMint,
|
|
8745
|
-
tokenAProgram,
|
|
8746
|
-
tokenBProgram
|
|
8747
|
-
});
|
|
8748
|
-
const transaction = new Transaction();
|
|
8749
|
-
transaction.add(
|
|
8750
|
-
...preInstructions.length > 0 ? preInstructions : [],
|
|
8751
|
-
claimPositionFeeInstruction,
|
|
8752
|
-
...postInstructions.length > 0 ? postInstructions : []
|
|
8753
|
-
);
|
|
8754
|
-
return transaction;
|
|
8755
|
-
});
|
|
8756
|
-
}
|
|
8757
9471
|
closePosition(params) {
|
|
8758
9472
|
return __async(this, null, function* () {
|
|
8759
9473
|
const { owner, pool, position, positionNftMint, positionNftAccount } = params;
|
|
@@ -8808,13 +9522,15 @@ var CpAmm = class {
|
|
|
8808
9522
|
tokenAAta: tokenAAccount,
|
|
8809
9523
|
tokenBAta: tokenBAccount,
|
|
8810
9524
|
instructions: preInstructions
|
|
8811
|
-
} = yield this.prepareTokenAccounts(
|
|
8812
|
-
owner,
|
|
9525
|
+
} = yield this.prepareTokenAccounts({
|
|
9526
|
+
payer: owner,
|
|
9527
|
+
tokenAOwner: owner,
|
|
9528
|
+
tokenBOwner: owner,
|
|
8813
9529
|
tokenAMint,
|
|
8814
9530
|
tokenBMint,
|
|
8815
9531
|
tokenAProgram,
|
|
8816
9532
|
tokenBProgram
|
|
8817
|
-
);
|
|
9533
|
+
});
|
|
8818
9534
|
const postInstructions = [];
|
|
8819
9535
|
if ([tokenAMint.toBase58(), tokenBMint.toBase58()].includes(
|
|
8820
9536
|
NATIVE_MINT2.toBase58()
|
|
@@ -8899,13 +9615,15 @@ var CpAmm = class {
|
|
|
8899
9615
|
tokenAAta: tokenAAccount,
|
|
8900
9616
|
tokenBAta: tokenBAccount,
|
|
8901
9617
|
instructions: preInstructions
|
|
8902
|
-
} = yield this.prepareTokenAccounts(
|
|
8903
|
-
owner,
|
|
9618
|
+
} = yield this.prepareTokenAccounts({
|
|
9619
|
+
payer: owner,
|
|
9620
|
+
tokenAOwner: owner,
|
|
9621
|
+
tokenBOwner: owner,
|
|
8904
9622
|
tokenAMint,
|
|
8905
9623
|
tokenBMint,
|
|
8906
9624
|
tokenAProgram,
|
|
8907
9625
|
tokenBProgram
|
|
8908
|
-
);
|
|
9626
|
+
});
|
|
8909
9627
|
let positionBLiquidityDelta = positionBState.unlockedLiquidity;
|
|
8910
9628
|
if (positionBVestings.length > 0) {
|
|
8911
9629
|
const totalAvailableVestingLiquidity = positionBVestings.reduce(
|
|
@@ -8930,15 +9648,26 @@ var CpAmm = class {
|
|
|
8930
9648
|
});
|
|
8931
9649
|
refreshVestingInstruction && preInstructions.push(refreshVestingInstruction);
|
|
8932
9650
|
}
|
|
9651
|
+
const tokenAWithdrawAmount = getAmountAFromLiquidityDelta(
|
|
9652
|
+
positionBLiquidityDelta,
|
|
9653
|
+
poolState.sqrtPrice,
|
|
9654
|
+
poolState.sqrtMaxPrice,
|
|
9655
|
+
1 /* Down */
|
|
9656
|
+
);
|
|
9657
|
+
const tokenBWithdrawAmount = getAmountBFromLiquidityDelta(
|
|
9658
|
+
positionBLiquidityDelta,
|
|
9659
|
+
poolState.sqrtPrice,
|
|
9660
|
+
poolState.sqrtMinPrice,
|
|
9661
|
+
1 /* Down */
|
|
9662
|
+
);
|
|
9663
|
+
const newLiquidityDelta = this.getLiquidityDelta({
|
|
9664
|
+
maxAmountTokenA: tokenAWithdrawAmount,
|
|
9665
|
+
maxAmountTokenB: tokenBWithdrawAmount,
|
|
9666
|
+
sqrtMaxPrice: poolState.sqrtMaxPrice,
|
|
9667
|
+
sqrtMinPrice: poolState.sqrtMinPrice,
|
|
9668
|
+
sqrtPrice: poolState.sqrtPrice
|
|
9669
|
+
});
|
|
8933
9670
|
const transaction = new Transaction();
|
|
8934
|
-
if (poolState.tokenAMint.equals(NATIVE_MINT2)) {
|
|
8935
|
-
const wrapSOLIx = wrapSOLInstruction(owner, tokenAAccount, BigInt(1));
|
|
8936
|
-
preInstructions.push(...wrapSOLIx);
|
|
8937
|
-
}
|
|
8938
|
-
if (poolState.tokenBMint.equals(NATIVE_MINT2)) {
|
|
8939
|
-
const wrapSOLIx = wrapSOLInstruction(owner, tokenBAccount, BigInt(1));
|
|
8940
|
-
preInstructions.push(...wrapSOLIx);
|
|
8941
|
-
}
|
|
8942
9671
|
if (preInstructions.length > 0) {
|
|
8943
9672
|
transaction.add(...preInstructions);
|
|
8944
9673
|
}
|
|
@@ -8967,7 +9696,7 @@ var CpAmm = class {
|
|
|
8967
9696
|
tokenBVault,
|
|
8968
9697
|
tokenAProgram,
|
|
8969
9698
|
tokenBProgram,
|
|
8970
|
-
liquidityDelta:
|
|
9699
|
+
liquidityDelta: newLiquidityDelta,
|
|
8971
9700
|
tokenAAmountThreshold: tokenAAmountAddLiquidityThreshold,
|
|
8972
9701
|
tokenBAmountThreshold: tokenBAmountAddLiquidityThreshold
|
|
8973
9702
|
});
|
|
@@ -9094,7 +9823,15 @@ var CpAmm = class {
|
|
|
9094
9823
|
*/
|
|
9095
9824
|
claimPartnerFee(params) {
|
|
9096
9825
|
return __async(this, null, function* () {
|
|
9097
|
-
const {
|
|
9826
|
+
const {
|
|
9827
|
+
feePayer,
|
|
9828
|
+
receiver,
|
|
9829
|
+
tempWSolAccount,
|
|
9830
|
+
partner,
|
|
9831
|
+
pool,
|
|
9832
|
+
maxAmountA,
|
|
9833
|
+
maxAmountB
|
|
9834
|
+
} = params;
|
|
9098
9835
|
const poolState = yield this.fetchPoolState(pool);
|
|
9099
9836
|
const {
|
|
9100
9837
|
tokenAVault,
|
|
@@ -9106,38 +9843,159 @@ var CpAmm = class {
|
|
|
9106
9843
|
} = poolState;
|
|
9107
9844
|
const tokenAProgram = getTokenProgram(tokenAFlag);
|
|
9108
9845
|
const tokenBProgram = getTokenProgram(tokenBFlag);
|
|
9846
|
+
const payer = feePayer != null ? feePayer : partner;
|
|
9847
|
+
const { tokenAAccount, tokenBAccount, preInstructions, postInstructions } = yield this.setupFeeClaimAccounts({
|
|
9848
|
+
payer,
|
|
9849
|
+
owner: partner,
|
|
9850
|
+
tokenAMint,
|
|
9851
|
+
tokenBMint,
|
|
9852
|
+
tokenAProgram,
|
|
9853
|
+
tokenBProgram,
|
|
9854
|
+
receiver,
|
|
9855
|
+
tempWSolAccount
|
|
9856
|
+
});
|
|
9857
|
+
return yield this._program.methods.claimPartnerFee(maxAmountA, maxAmountB).accountsPartial({
|
|
9858
|
+
poolAuthority: this.poolAuthority,
|
|
9859
|
+
pool,
|
|
9860
|
+
tokenAAccount,
|
|
9861
|
+
tokenBAccount,
|
|
9862
|
+
tokenAVault,
|
|
9863
|
+
tokenBVault,
|
|
9864
|
+
tokenAMint,
|
|
9865
|
+
tokenBMint,
|
|
9866
|
+
partner,
|
|
9867
|
+
tokenAProgram,
|
|
9868
|
+
tokenBProgram
|
|
9869
|
+
}).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
9870
|
+
});
|
|
9871
|
+
}
|
|
9872
|
+
/**
|
|
9873
|
+
* Builds a transaction to claim position fee rewards.
|
|
9874
|
+
* @param {ClaimPositionFeeParams} params - Parameters for claiming position fee.
|
|
9875
|
+
* @returns Transaction builder.
|
|
9876
|
+
*/
|
|
9877
|
+
claimPositionFee(params) {
|
|
9878
|
+
return __async(this, null, function* () {
|
|
9879
|
+
const {
|
|
9880
|
+
receiver,
|
|
9881
|
+
tempWSolAccount,
|
|
9882
|
+
feePayer,
|
|
9883
|
+
owner,
|
|
9884
|
+
pool,
|
|
9885
|
+
position,
|
|
9886
|
+
positionNftAccount,
|
|
9887
|
+
tokenAVault,
|
|
9888
|
+
tokenBVault,
|
|
9889
|
+
tokenAMint,
|
|
9890
|
+
tokenBMint,
|
|
9891
|
+
tokenAProgram,
|
|
9892
|
+
tokenBProgram
|
|
9893
|
+
} = params;
|
|
9894
|
+
const payer = feePayer != null ? feePayer : owner;
|
|
9895
|
+
const { tokenAAccount, tokenBAccount, preInstructions, postInstructions } = yield this.setupFeeClaimAccounts({
|
|
9896
|
+
payer,
|
|
9897
|
+
owner,
|
|
9898
|
+
tokenAMint,
|
|
9899
|
+
tokenBMint,
|
|
9900
|
+
tokenAProgram,
|
|
9901
|
+
tokenBProgram,
|
|
9902
|
+
receiver,
|
|
9903
|
+
tempWSolAccount
|
|
9904
|
+
});
|
|
9905
|
+
const claimPositionFeeInstruction = yield this.buildClaimPositionFeeInstruction({
|
|
9906
|
+
owner,
|
|
9907
|
+
poolAuthority: this.poolAuthority,
|
|
9908
|
+
pool,
|
|
9909
|
+
position,
|
|
9910
|
+
positionNftAccount,
|
|
9911
|
+
tokenAAccount,
|
|
9912
|
+
tokenBAccount,
|
|
9913
|
+
tokenAVault,
|
|
9914
|
+
tokenBVault,
|
|
9915
|
+
tokenAMint,
|
|
9916
|
+
tokenBMint,
|
|
9917
|
+
tokenAProgram,
|
|
9918
|
+
tokenBProgram
|
|
9919
|
+
});
|
|
9920
|
+
const transaction = new Transaction();
|
|
9921
|
+
transaction.add(
|
|
9922
|
+
...preInstructions.length > 0 ? preInstructions : [],
|
|
9923
|
+
claimPositionFeeInstruction,
|
|
9924
|
+
...postInstructions.length > 0 ? postInstructions : []
|
|
9925
|
+
);
|
|
9926
|
+
return transaction;
|
|
9927
|
+
});
|
|
9928
|
+
}
|
|
9929
|
+
/**
|
|
9930
|
+
* Builds a transaction to claim position fee rewards.
|
|
9931
|
+
* @param {ClaimPositionFeeParams2} params - Parameters for claiming position fee.
|
|
9932
|
+
* @returns Transaction builder.
|
|
9933
|
+
*/
|
|
9934
|
+
claimPositionFee2(params) {
|
|
9935
|
+
return __async(this, null, function* () {
|
|
9936
|
+
const {
|
|
9937
|
+
receiver,
|
|
9938
|
+
feePayer,
|
|
9939
|
+
owner,
|
|
9940
|
+
pool,
|
|
9941
|
+
position,
|
|
9942
|
+
positionNftAccount,
|
|
9943
|
+
tokenAVault,
|
|
9944
|
+
tokenBVault,
|
|
9945
|
+
tokenAMint,
|
|
9946
|
+
tokenBMint,
|
|
9947
|
+
tokenAProgram,
|
|
9948
|
+
tokenBProgram
|
|
9949
|
+
} = params;
|
|
9950
|
+
const payer = feePayer != null ? feePayer : owner;
|
|
9951
|
+
let tokenAOwner = receiver;
|
|
9952
|
+
let tokenBOwner = receiver;
|
|
9953
|
+
if (tokenAMint.equals(NATIVE_MINT2)) {
|
|
9954
|
+
tokenAOwner = owner;
|
|
9955
|
+
}
|
|
9956
|
+
if (tokenBMint.equals(NATIVE_MINT2)) {
|
|
9957
|
+
tokenBOwner = owner;
|
|
9958
|
+
}
|
|
9109
9959
|
const {
|
|
9110
9960
|
tokenAAta: tokenAAccount,
|
|
9111
9961
|
tokenBAta: tokenBAccount,
|
|
9112
|
-
instructions:
|
|
9113
|
-
} = yield this.prepareTokenAccounts(
|
|
9114
|
-
|
|
9962
|
+
instructions: preInstruction
|
|
9963
|
+
} = yield this.prepareTokenAccounts({
|
|
9964
|
+
payer,
|
|
9965
|
+
tokenAOwner,
|
|
9966
|
+
tokenBOwner,
|
|
9115
9967
|
tokenAMint,
|
|
9116
9968
|
tokenBMint,
|
|
9117
9969
|
tokenAProgram,
|
|
9118
9970
|
tokenBProgram
|
|
9119
|
-
);
|
|
9971
|
+
});
|
|
9120
9972
|
const postInstructions = [];
|
|
9121
|
-
if (
|
|
9122
|
-
|
|
9123
|
-
poolState.tokenBMint.toBase58()
|
|
9124
|
-
].includes(NATIVE_MINT2.toBase58())) {
|
|
9125
|
-
const closeWrappedSOLIx = yield unwrapSOLInstruction(partner);
|
|
9973
|
+
if (tokenAMint.equals(NATIVE_MINT2) || tokenBMint.equals(NATIVE_MINT2)) {
|
|
9974
|
+
const closeWrappedSOLIx = yield unwrapSOLInstruction(owner, receiver);
|
|
9126
9975
|
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
9127
9976
|
}
|
|
9128
|
-
|
|
9977
|
+
const claimPositionFeeInstruction = yield this.buildClaimPositionFeeInstruction({
|
|
9978
|
+
owner,
|
|
9129
9979
|
poolAuthority: this.poolAuthority,
|
|
9130
9980
|
pool,
|
|
9981
|
+
position,
|
|
9982
|
+
positionNftAccount,
|
|
9131
9983
|
tokenAAccount,
|
|
9132
9984
|
tokenBAccount,
|
|
9133
9985
|
tokenAVault,
|
|
9134
9986
|
tokenBVault,
|
|
9135
9987
|
tokenAMint,
|
|
9136
9988
|
tokenBMint,
|
|
9137
|
-
partner,
|
|
9138
9989
|
tokenAProgram,
|
|
9139
9990
|
tokenBProgram
|
|
9140
|
-
})
|
|
9991
|
+
});
|
|
9992
|
+
const transaction = new Transaction();
|
|
9993
|
+
transaction.add(
|
|
9994
|
+
...preInstruction.length > 0 ? preInstruction : [],
|
|
9995
|
+
claimPositionFeeInstruction,
|
|
9996
|
+
...postInstructions.length > 0 ? postInstructions : []
|
|
9997
|
+
);
|
|
9998
|
+
return transaction;
|
|
9141
9999
|
});
|
|
9142
10000
|
}
|
|
9143
10001
|
/**
|
|
@@ -9148,6 +10006,7 @@ var CpAmm = class {
|
|
|
9148
10006
|
claimReward(params) {
|
|
9149
10007
|
return __async(this, null, function* () {
|
|
9150
10008
|
const {
|
|
10009
|
+
feePayer,
|
|
9151
10010
|
user,
|
|
9152
10011
|
position,
|
|
9153
10012
|
positionNftAccount,
|
|
@@ -9163,7 +10022,7 @@ var CpAmm = class {
|
|
|
9163
10022
|
this._program.provider.connection,
|
|
9164
10023
|
rewardInfo.mint,
|
|
9165
10024
|
user,
|
|
9166
|
-
user,
|
|
10025
|
+
feePayer != null ? feePayer : user,
|
|
9167
10026
|
true,
|
|
9168
10027
|
tokenProgram
|
|
9169
10028
|
);
|
|
@@ -9193,14 +10052,20 @@ export {
|
|
|
9193
10052
|
ActivationPoint,
|
|
9194
10053
|
ActivationType,
|
|
9195
10054
|
BASIS_POINT_MAX,
|
|
10055
|
+
BIN_STEP_BPS_DEFAULT,
|
|
10056
|
+
BIN_STEP_BPS_U128_DEFAULT,
|
|
9196
10057
|
CP_AMM_PROGRAM_ID,
|
|
9197
10058
|
CollectFeeMode,
|
|
9198
10059
|
CpAmm,
|
|
10060
|
+
DYNAMIC_FEE_DECAY_PERIOD_DEFAULT,
|
|
10061
|
+
DYNAMIC_FEE_FILTER_PERIOD_DEFAULT,
|
|
10062
|
+
DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT,
|
|
9199
10063
|
FEE_DENOMINATOR,
|
|
9200
10064
|
FeeSchedulerMode,
|
|
9201
10065
|
LIQUIDITY_SCALE,
|
|
9202
10066
|
MAX_CU_BUFFER,
|
|
9203
10067
|
MAX_FEE_NUMERATOR,
|
|
10068
|
+
MAX_PRICE_CHANGE_BPS_DEFAULT,
|
|
9204
10069
|
MAX_SQRT_PRICE,
|
|
9205
10070
|
MIN_CU_BUFFER,
|
|
9206
10071
|
MIN_SQRT_PRICE,
|
|
@@ -9208,6 +10073,7 @@ export {
|
|
|
9208
10073
|
Rounding,
|
|
9209
10074
|
SCALE_OFFSET,
|
|
9210
10075
|
TradeDirection,
|
|
10076
|
+
bpsToFeeNumerator,
|
|
9211
10077
|
calculateInitSqrtPrice,
|
|
9212
10078
|
calculateTransferFeeExcludedAmount,
|
|
9213
10079
|
calculateTransferFeeIncludedAmount,
|
|
@@ -9223,13 +10089,16 @@ export {
|
|
|
9223
10089
|
deriveRewardVaultAddress,
|
|
9224
10090
|
deriveTokenBadgeAddress,
|
|
9225
10091
|
deriveTokenVaultAddress,
|
|
10092
|
+
feeNumeratorToBps,
|
|
9226
10093
|
getAllPositionNftAccountByOwner,
|
|
9227
10094
|
getAllUserPositionNftAccount,
|
|
9228
10095
|
getAmountAFromLiquidityDelta,
|
|
9229
10096
|
getAmountBFromLiquidityDelta,
|
|
9230
10097
|
getAvailableVestingLiquidity,
|
|
9231
10098
|
getBaseFeeNumerator,
|
|
10099
|
+
getBaseFeeParams,
|
|
9232
10100
|
getDynamicFeeNumerator,
|
|
10101
|
+
getDynamicFeeParams,
|
|
9233
10102
|
getEstimatedComputeUnitIxWithBuffer,
|
|
9234
10103
|
getEstimatedComputeUnitUsageWithBuffer,
|
|
9235
10104
|
getFeeNumerator,
|