@send-fun/sdk 1.0.1 → 1.2.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.
Files changed (72) hide show
  1. package/README.md +13 -5
  2. package/dist/index.cjs +797 -369
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +596 -94
  5. package/dist/index.d.cts.map +1 -1
  6. package/dist/index.d.mts +596 -94
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.mjs +527 -99
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +4 -6
  11. package/src/dex/generated/accounts/globalConfig.ts +39 -2
  12. package/src/dex/generated/accounts/pool.ts +41 -2
  13. package/src/dex/generated/accounts/rewardAccrual.ts +39 -2
  14. package/src/dex/generated/index.ts +1 -0
  15. package/src/dex/generated/instructions/buyExactIn.ts +1 -1
  16. package/src/dex/generated/instructions/buyExactOut.ts +1 -1
  17. package/src/dex/generated/instructions/claimCreatorFees.ts +1 -1
  18. package/src/dex/generated/instructions/claimProtocolFees.ts +1 -1
  19. package/src/dex/generated/instructions/sellExactIn.ts +1 -1
  20. package/src/dex/generated/instructions/sellExactOut.ts +1 -1
  21. package/src/dex/generated/plugins/sendDex.ts +1 -1
  22. package/src/dex/generated/shared/index.ts +52 -0
  23. package/src/dex/trade.ts +12 -13
  24. package/src/launchpad/create.ts +8 -8
  25. package/src/launchpad/generated/accounts/bondingCurve.ts +39 -2
  26. package/src/launchpad/generated/accounts/globalConfig.ts +39 -2
  27. package/src/launchpad/generated/accounts/rewardAccrual.ts +39 -2
  28. package/src/launchpad/generated/index.ts +1 -0
  29. package/src/launchpad/generated/instructions/buyExactIn.ts +1 -1
  30. package/src/launchpad/generated/instructions/buyExactOut.ts +1 -1
  31. package/src/launchpad/generated/instructions/claimCreatorFees.ts +1 -1
  32. package/src/launchpad/generated/instructions/claimProtocolFees.ts +1 -1
  33. package/src/launchpad/generated/instructions/createToken.ts +1 -1
  34. package/src/launchpad/generated/instructions/migrate.ts +1 -1
  35. package/src/launchpad/generated/instructions/sellExactIn.ts +1 -1
  36. package/src/launchpad/generated/instructions/sellExactOut.ts +1 -1
  37. package/src/launchpad/generated/plugins/sendLaunchpad.ts +1 -1
  38. package/src/launchpad/generated/shared/index.ts +52 -0
  39. package/src/launchpad/migrate.ts +1 -1
  40. package/src/launchpad/trade.ts +15 -15
  41. package/src/math/amm.ts +40 -33
  42. package/src/math/fee-decay.ts +3 -2
  43. package/src/math/fees.ts +4 -2
  44. package/src/math/internal.ts +1 -1
  45. package/src/nexus/fee-helpers.ts +5 -3
  46. package/src/nexus/generated/accounts/altRegistry.ts +41 -2
  47. package/src/nexus/generated/accounts/creatorFeeConfig.ts +39 -2
  48. package/src/nexus/generated/accounts/feePreset.ts +41 -2
  49. package/src/nexus/generated/accounts/globalConfig.ts +39 -2
  50. package/src/nexus/generated/accounts/partnerConfig.ts +39 -2
  51. package/src/nexus/generated/accounts/partnerMetadata.ts +39 -2
  52. package/src/nexus/generated/accounts/rewardState.ts +41 -2
  53. package/src/nexus/generated/accounts/stakingConfig.ts +39 -2
  54. package/src/nexus/generated/accounts/userRewardDebt.ts +39 -2
  55. package/src/nexus/generated/accounts/userStakePosition.ts +39 -2
  56. package/src/nexus/generated/index.ts +1 -0
  57. package/src/nexus/generated/instructions/claim.ts +1 -1
  58. package/src/nexus/generated/instructions/createUserRewardDebt.ts +1 -1
  59. package/src/nexus/generated/instructions/settle.ts +1 -1
  60. package/src/nexus/generated/instructions/stake.ts +1 -1
  61. package/src/nexus/generated/instructions/unstake.ts +1 -1
  62. package/src/nexus/generated/plugins/sendNexus.ts +1 -1
  63. package/src/nexus/generated/shared/index.ts +52 -0
  64. package/src/nexus/staking.ts +45 -41
  65. package/src/platform.ts +2 -2
  66. package/src/transfer-fee.ts +19 -17
  67. package/src/utils/chunk.ts +1 -1
  68. package/src/utils/creator-hash.ts +6 -3
  69. package/src/utils/index.ts +2 -0
  70. package/src/utils/mint-info.ts +8 -7
  71. package/src/utils/partner.ts +1 -1
  72. package/src/utils/pda.ts +1 -1
package/README.md CHANGED
@@ -12,16 +12,24 @@ It does not send transactions.
12
12
  ## Install
13
13
 
14
14
  ```sh
15
- pnpm add @send-fun/sdk
15
+ pnpm add @send-fun/sdk @solana/kit
16
16
  ```
17
17
 
18
+ `@solana/kit` is the only peer dependency: 6.x from 6.10.0, 7.x or 8.x. The SDK
19
+ imports `@solana/program-client-core` through `@solana/kit/program-client-core`.
20
+ Do not install `@solana/program-client-core` for the SDK.
21
+
22
+ That subpath needs `package.json` `exports` support: TypeScript
23
+ `moduleResolution` set to `node16`, `nodenext` or `bundler`, and Metro 0.82 or
24
+ later on React Native.
25
+
18
26
  ## Rules
19
27
 
20
- - Read `platformConfig` from the bonding curve or the pool. Do not use your own
21
- platform key.
28
+ - To trade, read `platformConfig` from the bonding curve or the pool.
29
+ - To create a token, get your platform key with
30
+ `platform.findPlatformAddress(slug)`.
22
31
  - A partner other than `constants.DEFAULT_PARTNER` must sign.
23
- - Get a platform key with `platform.findPlatformAddress(slug)`.
24
- - Do not edit the `generated` modules. They come from the program IDLs.
32
+ - The `generated` modules come from the program IDLs. Do not edit them.
25
33
 
26
34
  ## Documentation
27
35