four-flap-meme-sdk 1.4.87 → 1.4.89

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 (142) hide show
  1. package/dist/sol/constants.d.ts +126 -0
  2. package/dist/sol/constants.js +145 -0
  3. package/dist/sol/dex/blockrazor/client.d.ts +51 -0
  4. package/dist/sol/dex/blockrazor/client.js +96 -0
  5. package/dist/sol/dex/blockrazor/constants.d.ts +34 -0
  6. package/dist/sol/dex/blockrazor/constants.js +55 -0
  7. package/dist/sol/dex/blockrazor/geyser.d.ts +128 -0
  8. package/dist/sol/dex/blockrazor/geyser.js +530 -0
  9. package/dist/sol/dex/blockrazor/index.d.ts +18 -0
  10. package/dist/sol/dex/blockrazor/index.js +23 -0
  11. package/dist/sol/dex/blockrazor/send.d.ts +135 -0
  12. package/dist/sol/dex/blockrazor/send.js +254 -0
  13. package/dist/sol/dex/blockrazor/types.d.ts +191 -0
  14. package/dist/sol/dex/blockrazor/types.js +5 -0
  15. package/dist/sol/dex/index.d.ts +10 -0
  16. package/dist/sol/dex/index.js +16 -0
  17. package/dist/sol/dex/jup/client.d.ts +33 -0
  18. package/dist/sol/dex/jup/client.js +110 -0
  19. package/dist/sol/dex/jup/index.d.ts +16 -0
  20. package/dist/sol/dex/jup/index.js +148 -0
  21. package/dist/sol/dex/jup/legacy.d.ts +623 -0
  22. package/dist/sol/dex/jup/legacy.js +416 -0
  23. package/dist/sol/dex/jup/lend.d.ts +640 -0
  24. package/dist/sol/dex/jup/lend.js +603 -0
  25. package/dist/sol/dex/jup/portfolio.d.ts +362 -0
  26. package/dist/sol/dex/jup/portfolio.js +367 -0
  27. package/dist/sol/dex/jup/price.d.ts +173 -0
  28. package/dist/sol/dex/jup/price.js +220 -0
  29. package/dist/sol/dex/jup/recurring.d.ts +437 -0
  30. package/dist/sol/dex/jup/recurring.js +320 -0
  31. package/dist/sol/dex/jup/send.d.ts +282 -0
  32. package/dist/sol/dex/jup/send.js +295 -0
  33. package/dist/sol/dex/jup/studio.d.ts +457 -0
  34. package/dist/sol/dex/jup/studio.js +488 -0
  35. package/dist/sol/dex/jup/tokens.d.ts +767 -0
  36. package/dist/sol/dex/jup/tokens.js +697 -0
  37. package/dist/sol/dex/jup/trigger.d.ts +511 -0
  38. package/dist/sol/dex/jup/trigger.js +397 -0
  39. package/dist/sol/dex/jup/types.d.ts +433 -0
  40. package/dist/sol/dex/jup/types.js +5 -0
  41. package/dist/sol/dex/jup/ultra.d.ts +646 -0
  42. package/dist/sol/dex/jup/ultra.js +853 -0
  43. package/dist/sol/dex/meteora/client.d.ts +76 -0
  44. package/dist/sol/dex/meteora/client.js +219 -0
  45. package/dist/sol/dex/meteora/damm-v1-bundle.d.ts +61 -0
  46. package/dist/sol/dex/meteora/damm-v1-bundle.js +112 -0
  47. package/dist/sol/dex/meteora/damm-v1.d.ts +118 -0
  48. package/dist/sol/dex/meteora/damm-v1.js +315 -0
  49. package/dist/sol/dex/meteora/damm-v2-bundle.d.ts +82 -0
  50. package/dist/sol/dex/meteora/damm-v2-bundle.js +242 -0
  51. package/dist/sol/dex/meteora/damm-v2.d.ts +172 -0
  52. package/dist/sol/dex/meteora/damm-v2.js +632 -0
  53. package/dist/sol/dex/meteora/dbc-bundle.d.ts +123 -0
  54. package/dist/sol/dex/meteora/dbc-bundle.js +304 -0
  55. package/dist/sol/dex/meteora/dbc.d.ts +192 -0
  56. package/dist/sol/dex/meteora/dbc.js +619 -0
  57. package/dist/sol/dex/meteora/dlmm-bundle.d.ts +39 -0
  58. package/dist/sol/dex/meteora/dlmm-bundle.js +189 -0
  59. package/dist/sol/dex/meteora/dlmm.d.ts +157 -0
  60. package/dist/sol/dex/meteora/dlmm.js +671 -0
  61. package/dist/sol/dex/meteora/index.d.ts +25 -0
  62. package/dist/sol/dex/meteora/index.js +65 -0
  63. package/dist/sol/dex/meteora/types.d.ts +787 -0
  64. package/dist/sol/dex/meteora/types.js +110 -0
  65. package/dist/sol/dex/orca/index.d.ts +10 -0
  66. package/dist/sol/dex/orca/index.js +16 -0
  67. package/dist/sol/dex/orca/orca-bundle.d.ts +41 -0
  68. package/dist/sol/dex/orca/orca-bundle.js +173 -0
  69. package/dist/sol/dex/orca/orca.d.ts +65 -0
  70. package/dist/sol/dex/orca/orca.js +474 -0
  71. package/dist/sol/dex/orca/types.d.ts +263 -0
  72. package/dist/sol/dex/orca/types.js +38 -0
  73. package/dist/sol/dex/orca/wavebreak-bundle.d.ts +34 -0
  74. package/dist/sol/dex/orca/wavebreak-bundle.js +198 -0
  75. package/dist/sol/dex/orca/wavebreak-types.d.ts +227 -0
  76. package/dist/sol/dex/orca/wavebreak-types.js +23 -0
  77. package/dist/sol/dex/orca/wavebreak.d.ts +78 -0
  78. package/dist/sol/dex/orca/wavebreak.js +497 -0
  79. package/dist/sol/dex/pump/index.d.ts +9 -0
  80. package/dist/sol/dex/pump/index.js +14 -0
  81. package/dist/sol/dex/pump/pump-bundle.d.ts +92 -0
  82. package/dist/sol/dex/pump/pump-bundle.js +383 -0
  83. package/dist/sol/dex/pump/pump-swap-bundle.d.ts +103 -0
  84. package/dist/sol/dex/pump/pump-swap-bundle.js +380 -0
  85. package/dist/sol/dex/pump/pump-swap.d.ts +46 -0
  86. package/dist/sol/dex/pump/pump-swap.js +199 -0
  87. package/dist/sol/dex/pump/pump.d.ts +35 -0
  88. package/dist/sol/dex/pump/pump.js +352 -0
  89. package/dist/sol/dex/pump/types.d.ts +215 -0
  90. package/dist/sol/dex/pump/types.js +5 -0
  91. package/dist/sol/dex/raydium/index.d.ts +8 -0
  92. package/dist/sol/dex/raydium/index.js +12 -0
  93. package/dist/sol/dex/raydium/launchlab.d.ts +68 -0
  94. package/dist/sol/dex/raydium/launchlab.js +210 -0
  95. package/dist/sol/dex/raydium/raydium-bundle.d.ts +64 -0
  96. package/dist/sol/dex/raydium/raydium-bundle.js +324 -0
  97. package/dist/sol/dex/raydium/raydium.d.ts +40 -0
  98. package/dist/sol/dex/raydium/raydium.js +366 -0
  99. package/dist/sol/dex/raydium/types.d.ts +240 -0
  100. package/dist/sol/dex/raydium/types.js +5 -0
  101. package/dist/sol/index.d.ts +10 -0
  102. package/dist/sol/index.js +16 -0
  103. package/dist/sol/jito/bundle.d.ts +90 -0
  104. package/dist/sol/jito/bundle.js +263 -0
  105. package/dist/sol/jito/index.d.ts +7 -0
  106. package/dist/sol/jito/index.js +7 -0
  107. package/dist/sol/jito/tip.d.ts +51 -0
  108. package/dist/sol/jito/tip.js +83 -0
  109. package/dist/sol/jito/types.d.ts +100 -0
  110. package/dist/sol/jito/types.js +5 -0
  111. package/dist/sol/token/create-complete.d.ts +115 -0
  112. package/dist/sol/token/create-complete.js +235 -0
  113. package/dist/sol/token/create-token.d.ts +57 -0
  114. package/dist/sol/token/create-token.js +230 -0
  115. package/dist/sol/token/index.d.ts +9 -0
  116. package/dist/sol/token/index.js +14 -0
  117. package/dist/sol/token/metadata-upload.d.ts +86 -0
  118. package/dist/sol/token/metadata-upload.js +173 -0
  119. package/dist/sol/token/metadata.d.ts +92 -0
  120. package/dist/sol/token/metadata.js +274 -0
  121. package/dist/sol/token/types.d.ts +153 -0
  122. package/dist/sol/token/types.js +5 -0
  123. package/dist/sol/types.d.ts +176 -0
  124. package/dist/sol/types.js +7 -0
  125. package/dist/sol/utils/balance.d.ts +160 -0
  126. package/dist/sol/utils/balance.js +638 -0
  127. package/dist/sol/utils/connection.d.ts +78 -0
  128. package/dist/sol/utils/connection.js +168 -0
  129. package/dist/sol/utils/index.d.ts +9 -0
  130. package/dist/sol/utils/index.js +9 -0
  131. package/dist/sol/utils/lp-inspect.d.ts +129 -0
  132. package/dist/sol/utils/lp-inspect.js +900 -0
  133. package/dist/sol/utils/transfer.d.ts +125 -0
  134. package/dist/sol/utils/transfer.js +220 -0
  135. package/dist/sol/utils/wallet.d.ts +107 -0
  136. package/dist/sol/utils/wallet.js +210 -0
  137. package/dist/utils/constants.d.ts +2 -2
  138. package/dist/utils/constants.js +2 -2
  139. package/package.json +38 -3
  140. package/README.zh-CN.pdf +0 -0
  141. package/dist/flap/portal-bundle-merkle/encryption.d.ts +0 -16
  142. package/dist/flap/portal-bundle-merkle/encryption.js +0 -146
@@ -0,0 +1,126 @@
1
+ /**
2
+ * Solana SDK 常量配置
3
+ * @module sol/constants
4
+ */
5
+ /**
6
+ * Jito 配置
7
+ *
8
+ * 注意:BLOCK_ENGINE_URL 需要由前端传入,不在 SDK 中写死
9
+ */
10
+ export declare const JITO_CONFIG: {
11
+ /** Tip 账户列表(随机选择一个)- 这些是 Jito 官方账户,固定不变 */
12
+ readonly TIP_ACCOUNTS: readonly ["96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5", "HFqU5x63VTqvQss8hp11i4bVmkzdNaVB6PYjYgNd4W5U", "Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY", "ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49", "DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh", "ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt", "DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL", "3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT"];
13
+ /** 最小 Tip(lamports) */
14
+ readonly MIN_TIP_LAMPORTS: 1000;
15
+ /** 默认 Tip(lamports)- 0.00001 SOL */
16
+ readonly DEFAULT_TIP_LAMPORTS: 10000;
17
+ };
18
+ /**
19
+ * Solana 系统程序地址
20
+ */
21
+ export declare const SYSTEM_PROGRAMS: {
22
+ /** Token Program */
23
+ readonly TOKEN_PROGRAM: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
24
+ /** Token-2022 Program */
25
+ readonly TOKEN_2022_PROGRAM: "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
26
+ /** Associated Token Account Program */
27
+ readonly ATA_PROGRAM: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
28
+ /** Metaplex Token Metadata Program */
29
+ readonly METADATA_PROGRAM: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s";
30
+ /** System Program */
31
+ readonly SYSTEM_PROGRAM: "11111111111111111111111111111111";
32
+ /** Rent Sysvar */
33
+ readonly RENT_SYSVAR: "SysvarRent111111111111111111111111111111111";
34
+ };
35
+ /**
36
+ * Pump.fun 程序地址
37
+ */
38
+ export declare const PUMP_PROGRAMS: {
39
+ /** Pump Program ID */
40
+ readonly PUMP_PROGRAM: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
41
+ /** Pump Swap Program ID */
42
+ readonly PUMP_SWAP_PROGRAM: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA";
43
+ /** Global Config */
44
+ readonly GLOBAL_CONFIG: "4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf";
45
+ };
46
+ /**
47
+ * Raydium 程序地址
48
+ */
49
+ export declare const RAYDIUM_PROGRAMS: {
50
+ /** AMM Program ID */
51
+ readonly AMM_PROGRAM: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8";
52
+ /** CLMM Program ID */
53
+ readonly CLMM_PROGRAM: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK";
54
+ /** LaunchLab Program ID */
55
+ readonly LAUNCHLAB_PROGRAM: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj";
56
+ };
57
+ /**
58
+ * Orca 程序地址
59
+ */
60
+ export declare const ORCA_PROGRAMS: {
61
+ /** Whirlpool Program ID */
62
+ readonly WHIRLPOOL_PROGRAM: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc";
63
+ };
64
+ /**
65
+ * Meteora 程序地址
66
+ */
67
+ export declare const METEORA_PROGRAMS: {
68
+ /** DLMM Program ID */
69
+ readonly DLMM_PROGRAM: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo";
70
+ /** DAMM v2 Program ID */
71
+ readonly DAMM_V2_PROGRAM: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG";
72
+ /** DBC Program ID */
73
+ readonly DBC_PROGRAM: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN";
74
+ };
75
+ /**
76
+ * 常用代币地址
77
+ */
78
+ export declare const TOKENS: {
79
+ /** Wrapped SOL */
80
+ readonly SOL: "So11111111111111111111111111111111111111112";
81
+ /** USDC */
82
+ readonly USDC: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
83
+ /** USDT */
84
+ readonly USDT: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB";
85
+ };
86
+ /**
87
+ * 交易默认配置
88
+ */
89
+ export declare const TX_CONFIG: {
90
+ /** 默认滑点 1% */
91
+ readonly DEFAULT_SLIPPAGE: 1;
92
+ /** 最大滑点 50% */
93
+ readonly MAX_SLIPPAGE: 50;
94
+ /** 计算单元限制 */
95
+ readonly COMPUTE_UNIT_LIMIT: 200000;
96
+ /** 计算单元价格(microlamports) */
97
+ readonly COMPUTE_UNIT_PRICE: 50000;
98
+ /** 确认超时(毫秒) */
99
+ readonly CONFIRMATION_TIMEOUT: 60000;
100
+ /** 默认 commitment */
101
+ readonly DEFAULT_COMMITMENT: "confirmed";
102
+ };
103
+ /**
104
+ * 账户大小(用于计算租金)
105
+ */
106
+ export declare const ACCOUNT_SIZE: {
107
+ /** Mint 账户大小 */
108
+ readonly MINT: 82;
109
+ /** Token 账户大小 */
110
+ readonly TOKEN_ACCOUNT: 165;
111
+ /** Metadata 账户大小(近似值) */
112
+ readonly METADATA: 679;
113
+ };
114
+ /**
115
+ * SOL 单位换算
116
+ */
117
+ export declare const SOL_DECIMALS = 9;
118
+ export declare const LAMPORTS_PER_SOL = 1000000000;
119
+ /**
120
+ * 将 SOL 转换为 lamports
121
+ */
122
+ export declare function solToLamports(sol: number): bigint;
123
+ /**
124
+ * 将 lamports 转换为 SOL
125
+ */
126
+ export declare function lamportsToSol(lamports: bigint): number;
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Solana SDK 常量配置
3
+ * @module sol/constants
4
+ */
5
+ // ==================== Jito Bundle 配置 ====================
6
+ /**
7
+ * Jito 配置
8
+ *
9
+ * 注意:BLOCK_ENGINE_URL 需要由前端传入,不在 SDK 中写死
10
+ */
11
+ export const JITO_CONFIG = {
12
+ /** Tip 账户列表(随机选择一个)- 这些是 Jito 官方账户,固定不变 */
13
+ TIP_ACCOUNTS: [
14
+ '96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5',
15
+ 'HFqU5x63VTqvQss8hp11i4bVmkzdNaVB6PYjYgNd4W5U',
16
+ 'Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY',
17
+ 'ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49',
18
+ 'DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh',
19
+ 'ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt',
20
+ 'DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL',
21
+ '3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT',
22
+ ],
23
+ /** 最小 Tip(lamports) */
24
+ MIN_TIP_LAMPORTS: 1000,
25
+ /** 默认 Tip(lamports)- 0.00001 SOL */
26
+ DEFAULT_TIP_LAMPORTS: 10000,
27
+ };
28
+ // ==================== 程序地址 ====================
29
+ /**
30
+ * Solana 系统程序地址
31
+ */
32
+ export const SYSTEM_PROGRAMS = {
33
+ /** Token Program */
34
+ TOKEN_PROGRAM: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
35
+ /** Token-2022 Program */
36
+ TOKEN_2022_PROGRAM: 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
37
+ /** Associated Token Account Program */
38
+ ATA_PROGRAM: 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
39
+ /** Metaplex Token Metadata Program */
40
+ METADATA_PROGRAM: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
41
+ /** System Program */
42
+ SYSTEM_PROGRAM: '11111111111111111111111111111111',
43
+ /** Rent Sysvar */
44
+ RENT_SYSVAR: 'SysvarRent111111111111111111111111111111111',
45
+ };
46
+ /**
47
+ * Pump.fun 程序地址
48
+ */
49
+ export const PUMP_PROGRAMS = {
50
+ /** Pump Program ID */
51
+ PUMP_PROGRAM: '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P',
52
+ /** Pump Swap Program ID */
53
+ PUMP_SWAP_PROGRAM: 'pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA',
54
+ /** Global Config */
55
+ GLOBAL_CONFIG: '4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf',
56
+ };
57
+ /**
58
+ * Raydium 程序地址
59
+ */
60
+ export const RAYDIUM_PROGRAMS = {
61
+ /** AMM Program ID */
62
+ AMM_PROGRAM: '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8',
63
+ /** CLMM Program ID */
64
+ CLMM_PROGRAM: 'CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK',
65
+ /** LaunchLab Program ID */
66
+ LAUNCHLAB_PROGRAM: 'LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj',
67
+ };
68
+ /**
69
+ * Orca 程序地址
70
+ */
71
+ export const ORCA_PROGRAMS = {
72
+ /** Whirlpool Program ID */
73
+ WHIRLPOOL_PROGRAM: 'whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc',
74
+ };
75
+ /**
76
+ * Meteora 程序地址
77
+ */
78
+ export const METEORA_PROGRAMS = {
79
+ /** DLMM Program ID */
80
+ DLMM_PROGRAM: 'LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo',
81
+ /** DAMM v2 Program ID */
82
+ DAMM_V2_PROGRAM: 'cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG',
83
+ /** DBC Program ID */
84
+ DBC_PROGRAM: 'dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN',
85
+ };
86
+ // ==================== 常用代币地址 ====================
87
+ /**
88
+ * 常用代币地址
89
+ */
90
+ export const TOKENS = {
91
+ /** Wrapped SOL */
92
+ SOL: 'So11111111111111111111111111111111111111112',
93
+ /** USDC */
94
+ USDC: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
95
+ /** USDT */
96
+ USDT: 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
97
+ };
98
+ // ==================== 交易配置 ====================
99
+ /**
100
+ * 交易默认配置
101
+ */
102
+ export const TX_CONFIG = {
103
+ /** 默认滑点 1% */
104
+ DEFAULT_SLIPPAGE: 1,
105
+ /** 最大滑点 50% */
106
+ MAX_SLIPPAGE: 50,
107
+ /** 计算单元限制 */
108
+ COMPUTE_UNIT_LIMIT: 200000,
109
+ /** 计算单元价格(microlamports) */
110
+ COMPUTE_UNIT_PRICE: 50000,
111
+ /** 确认超时(毫秒) */
112
+ CONFIRMATION_TIMEOUT: 60000,
113
+ /** 默认 commitment */
114
+ DEFAULT_COMMITMENT: 'confirmed',
115
+ };
116
+ // ==================== 账户大小 ====================
117
+ /**
118
+ * 账户大小(用于计算租金)
119
+ */
120
+ export const ACCOUNT_SIZE = {
121
+ /** Mint 账户大小 */
122
+ MINT: 82,
123
+ /** Token 账户大小 */
124
+ TOKEN_ACCOUNT: 165,
125
+ /** Metadata 账户大小(近似值) */
126
+ METADATA: 679,
127
+ };
128
+ // ==================== 单位换算 ====================
129
+ /**
130
+ * SOL 单位换算
131
+ */
132
+ export const SOL_DECIMALS = 9;
133
+ export const LAMPORTS_PER_SOL = 1000000000;
134
+ /**
135
+ * 将 SOL 转换为 lamports
136
+ */
137
+ export function solToLamports(sol) {
138
+ return BigInt(Math.floor(sol * LAMPORTS_PER_SOL));
139
+ }
140
+ /**
141
+ * 将 lamports 转换为 SOL
142
+ */
143
+ export function lamportsToSol(lamports) {
144
+ return Number(lamports) / LAMPORTS_PER_SOL;
145
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * BlockRazor 客户端配置管理
3
+ * @module sol/dex/blockrazor/client
4
+ */
5
+ import type { BlockRazorConfig, BlockRazorSendParams } from './types.js';
6
+ /**
7
+ * 设置默认 BlockRazor 配置
8
+ *
9
+ * @param config 配置
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { Sol } from 'four-flap-meme-sdk'
14
+ *
15
+ * Sol.setBlockRazorConfig({
16
+ * apiKey: 'your-auth-token',
17
+ * region: 'frankfurt',
18
+ * })
19
+ * ```
20
+ */
21
+ export declare function setBlockRazorConfig(config: BlockRazorConfig): void;
22
+ /**
23
+ * 获取 BlockRazor 配置
24
+ *
25
+ * @param config 可选配置(覆盖默认配置)
26
+ * @returns 配置对象
27
+ * @throws 未配置时抛出错误
28
+ */
29
+ export declare function getBlockRazorConfig(config?: BlockRazorConfig): BlockRazorConfig;
30
+ /**
31
+ * 获取端点 URL
32
+ *
33
+ * @param config 可选配置
34
+ * @returns 端点 URL
35
+ */
36
+ export declare function getBlockRazorEndpoint(config?: BlockRazorConfig): string;
37
+ /**
38
+ * 获取随机 BlockRazor Tip 账户
39
+ *
40
+ * 避免因地址占用导致的性能下降,建议轮换 Tip 账户。
41
+ *
42
+ * @returns 随机 Tip 账户地址
43
+ */
44
+ export declare function getRandomBlockRazorTipAccount(): string;
45
+ /**
46
+ * 验证发送交易参数
47
+ *
48
+ * @param params 发送参数
49
+ * @throws 参数无效时抛出错误
50
+ */
51
+ export declare function validateSendParams(params: BlockRazorSendParams): void;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * BlockRazor 客户端配置管理
3
+ * @module sol/dex/blockrazor/client
4
+ */
5
+ import { BLOCKRAZOR_ENDPOINTS, BLOCKRAZOR_TIP_ACCOUNTS } from './constants.js';
6
+ // ============================================================================
7
+ // 客户端管理
8
+ // ============================================================================
9
+ let defaultConfig = null;
10
+ /**
11
+ * 设置默认 BlockRazor 配置
12
+ *
13
+ * @param config 配置
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { Sol } from 'four-flap-meme-sdk'
18
+ *
19
+ * Sol.setBlockRazorConfig({
20
+ * apiKey: 'your-auth-token',
21
+ * region: 'frankfurt',
22
+ * })
23
+ * ```
24
+ */
25
+ export function setBlockRazorConfig(config) {
26
+ defaultConfig = config;
27
+ }
28
+ /**
29
+ * 获取 BlockRazor 配置
30
+ *
31
+ * @param config 可选配置(覆盖默认配置)
32
+ * @returns 配置对象
33
+ * @throws 未配置时抛出错误
34
+ */
35
+ export function getBlockRazorConfig(config) {
36
+ const cfg = config || defaultConfig;
37
+ if (!cfg) {
38
+ throw new Error('BlockRazor not configured. Call setBlockRazorConfig() first or pass config.');
39
+ }
40
+ return cfg;
41
+ }
42
+ /**
43
+ * 获取端点 URL
44
+ *
45
+ * @param config 可选配置
46
+ * @returns 端点 URL
47
+ */
48
+ export function getBlockRazorEndpoint(config) {
49
+ const cfg = getBlockRazorConfig(config);
50
+ if (cfg.endpoint) {
51
+ return cfg.endpoint;
52
+ }
53
+ const region = cfg.region || 'frankfurt';
54
+ switch (region) {
55
+ case 'frankfurt':
56
+ return BLOCKRAZOR_ENDPOINTS.FRANKFURT;
57
+ case 'newyork':
58
+ return BLOCKRAZOR_ENDPOINTS.NEW_YORK;
59
+ case 'tokyo':
60
+ return BLOCKRAZOR_ENDPOINTS.TOKYO;
61
+ case 'amsterdam':
62
+ return BLOCKRAZOR_ENDPOINTS.AMSTERDAM;
63
+ default:
64
+ return BLOCKRAZOR_ENDPOINTS.FRANKFURT;
65
+ }
66
+ }
67
+ /**
68
+ * 获取随机 BlockRazor Tip 账户
69
+ *
70
+ * 避免因地址占用导致的性能下降,建议轮换 Tip 账户。
71
+ *
72
+ * @returns 随机 Tip 账户地址
73
+ */
74
+ export function getRandomBlockRazorTipAccount() {
75
+ const index = Math.floor(Math.random() * BLOCKRAZOR_TIP_ACCOUNTS.length);
76
+ return BLOCKRAZOR_TIP_ACCOUNTS[index];
77
+ }
78
+ /**
79
+ * 验证发送交易参数
80
+ *
81
+ * @param params 发送参数
82
+ * @throws 参数无效时抛出错误
83
+ */
84
+ export function validateSendParams(params) {
85
+ if (!params.transaction) {
86
+ throw new Error('transaction is required');
87
+ }
88
+ if (params.mode && !['fast', 'sandwichMitigation'].includes(params.mode)) {
89
+ throw new Error('mode must be "fast" or "sandwichMitigation"');
90
+ }
91
+ if (params.safeWindow !== undefined) {
92
+ if (params.safeWindow < 3 || params.safeWindow > 13) {
93
+ throw new Error('safeWindow must be between 3 and 13');
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * BlockRazor 常量
3
+ * @module sol/dex/blockrazor/constants
4
+ */
5
+ /** BlockRazor 区域端点 */
6
+ export declare const BLOCKRAZOR_ENDPOINTS: {
7
+ /** 法兰克福 */
8
+ readonly FRANKFURT: "http://frankfurt.solana.blockrazor.xyz:443";
9
+ /** 纽约 */
10
+ readonly NEW_YORK: "http://newyork.solana.blockrazor.xyz:443";
11
+ /** 东京 */
12
+ readonly TOKYO: "http://tokyo.solana.blockrazor.xyz:443";
13
+ /** 阿姆斯特丹 */
14
+ readonly AMSTERDAM: "http://amsterdam.solana.blockrazor.xyz:443";
15
+ };
16
+ /** BlockRazor Tip 账户列表 */
17
+ export declare const BLOCKRAZOR_TIP_ACCOUNTS: readonly ["Gywj98ophM7GmkDdaWs4isqZnDdFCW7B46TXmKfvyqSm", "FjmZZrFvhnqqb9ThCuMVnENaM3JGVuGWNyCAxRJcFpg9", "6No2i3aawzHsjtThw81iq1EXPJN6rh8eSJCLaYZfKDTG", "A9cWowVAiHe9pJfKAj3TJiN9VpbzMUq6E4kEvf5mUT22", "68Pwb4jS7eZATjDfhmTXgRJjCiZmw1L7Huy4HNpnxJ3o", "4ABhJh5rZPjv63RBJBuyWzBK3g9gWMUQdTZP2kiW31V9", "B2M4NG5eyZp5SBQrSdtemzk5TqVuaWGQnowGaCBt8GyM", "5jA59cXMKQqZAVdtopv8q3yyw9SYfiE3vUCbt7p8MfVf", "5YktoWygr1Bp9wiS1xtMtUki1PeYuuzuCF98tqwYxf61", "295Avbam4qGShBYK7E9H5Ldew4B3WyJGmgmXfiWdeeyV", "EDi4rSy2LZgKJX74mbLTFk4mxoTgT6F7HxxzG2HBAFyK", "BnGKHAC386n4Qmv9xtpBVbRaUTKixjBe3oagkPFKtoy6", "Dd7K2Fp7AtoN8xCghKDRmyqr5U169t48Tw5fEd3wT9mq", "AP6qExwrbRgBAVaehg4b5xHENX815sMabtBzUzVB4v8S"];
18
+ /** 默认 Tip 金额 (lamports) */
19
+ export declare const DEFAULT_TIP_AMOUNT = 1000000;
20
+ /** 最小 Tip 金额 (lamports) */
21
+ export declare const MIN_TIP_AMOUNT = 1000000;
22
+ /** 默认请求超时 (ms) */
23
+ export declare const BLOCKRAZOR_DEFAULT_TIMEOUT = 10000;
24
+ /** Geyser Stream 端点 */
25
+ export declare const GEYSER_STREAM_ENDPOINTS: {
26
+ /** 东京 */
27
+ readonly TOKYO: "geyserstream-tokyo.blockrazor.xyz:443";
28
+ /** 法兰克福 */
29
+ readonly FRANKFURT: "geyserstream-frankfurt.blockrazor.xyz:443";
30
+ /** 纽约 */
31
+ readonly NEW_YORK: "geyserstream-newyork.blockrazor.xyz:443";
32
+ /** 阿姆斯特丹 */
33
+ readonly AMSTERDAM: "geyserstream-amsterdam.blockrazor.xyz:443";
34
+ };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * BlockRazor 常量
3
+ * @module sol/dex/blockrazor/constants
4
+ */
5
+ // ============================================================================
6
+ // Send Transaction 端点
7
+ // ============================================================================
8
+ /** BlockRazor 区域端点 */
9
+ export const BLOCKRAZOR_ENDPOINTS = {
10
+ /** 法兰克福 */
11
+ FRANKFURT: 'http://frankfurt.solana.blockrazor.xyz:443',
12
+ /** 纽约 */
13
+ NEW_YORK: 'http://newyork.solana.blockrazor.xyz:443',
14
+ /** 东京 */
15
+ TOKYO: 'http://tokyo.solana.blockrazor.xyz:443',
16
+ /** 阿姆斯特丹 */
17
+ AMSTERDAM: 'http://amsterdam.solana.blockrazor.xyz:443',
18
+ };
19
+ /** BlockRazor Tip 账户列表 */
20
+ export const BLOCKRAZOR_TIP_ACCOUNTS = [
21
+ 'Gywj98ophM7GmkDdaWs4isqZnDdFCW7B46TXmKfvyqSm',
22
+ 'FjmZZrFvhnqqb9ThCuMVnENaM3JGVuGWNyCAxRJcFpg9',
23
+ '6No2i3aawzHsjtThw81iq1EXPJN6rh8eSJCLaYZfKDTG',
24
+ 'A9cWowVAiHe9pJfKAj3TJiN9VpbzMUq6E4kEvf5mUT22',
25
+ '68Pwb4jS7eZATjDfhmTXgRJjCiZmw1L7Huy4HNpnxJ3o',
26
+ '4ABhJh5rZPjv63RBJBuyWzBK3g9gWMUQdTZP2kiW31V9',
27
+ 'B2M4NG5eyZp5SBQrSdtemzk5TqVuaWGQnowGaCBt8GyM',
28
+ '5jA59cXMKQqZAVdtopv8q3yyw9SYfiE3vUCbt7p8MfVf',
29
+ '5YktoWygr1Bp9wiS1xtMtUki1PeYuuzuCF98tqwYxf61',
30
+ '295Avbam4qGShBYK7E9H5Ldew4B3WyJGmgmXfiWdeeyV',
31
+ 'EDi4rSy2LZgKJX74mbLTFk4mxoTgT6F7HxxzG2HBAFyK',
32
+ 'BnGKHAC386n4Qmv9xtpBVbRaUTKixjBe3oagkPFKtoy6',
33
+ 'Dd7K2Fp7AtoN8xCghKDRmyqr5U169t48Tw5fEd3wT9mq',
34
+ 'AP6qExwrbRgBAVaehg4b5xHENX815sMabtBzUzVB4v8S',
35
+ ];
36
+ /** 默认 Tip 金额 (lamports) */
37
+ export const DEFAULT_TIP_AMOUNT = 1000000;
38
+ /** 最小 Tip 金额 (lamports) */
39
+ export const MIN_TIP_AMOUNT = 1000000;
40
+ /** 默认请求超时 (ms) */
41
+ export const BLOCKRAZOR_DEFAULT_TIMEOUT = 10000;
42
+ // ============================================================================
43
+ // Geyser Stream 端点
44
+ // ============================================================================
45
+ /** Geyser Stream 端点 */
46
+ export const GEYSER_STREAM_ENDPOINTS = {
47
+ /** 东京 */
48
+ TOKYO: 'geyserstream-tokyo.blockrazor.xyz:443',
49
+ /** 法兰克福 */
50
+ FRANKFURT: 'geyserstream-frankfurt.blockrazor.xyz:443',
51
+ /** 纽约 */
52
+ NEW_YORK: 'geyserstream-newyork.blockrazor.xyz:443',
53
+ /** 阿姆斯特丹 */
54
+ AMSTERDAM: 'geyserstream-amsterdam.blockrazor.xyz:443',
55
+ };
@@ -0,0 +1,128 @@
1
+ /**
2
+ * BlockRazor Geyser Stream 服务
3
+ * @module sol/dex/blockrazor/geyser
4
+ *
5
+ * Geyser Stream 是基于 Yellowstone gRPC 的高性能 Solana 数据流服务。
6
+ *
7
+ * @see https://blockrazor.gitbook.io/blockrazor/solana/geyser-stream
8
+ */
9
+ import type { GeyserRegion, GeyserSubscribeConfig, GeyserClientConfig, GeyserEventHandlers, GeyserStreamControl } from './types.js';
10
+ /**
11
+ * Geyser Proto 定义(内联)
12
+ *
13
+ * 用于动态加载 gRPC 服务
14
+ */
15
+ export declare const GEYSER_PROTO_DEFINITION = "\nsyntax = \"proto3\";\n\npackage geyser;\n\nservice Geyser {\n rpc Subscribe(stream SubscribeRequest) returns (stream SubscribeUpdate);\n}\n\nmessage SubscribeRequest {\n map<string, SubscribeRequestFilterAccounts> accounts = 1;\n map<string, SubscribeRequestFilterSlots> slots = 2;\n map<string, SubscribeRequestFilterTransactions> transactions = 3;\n map<string, SubscribeRequestFilterBlocks> blocks = 4;\n map<string, SubscribeRequestFilterBlocksMeta> blocks_meta = 5;\n map<string, SubscribeRequestFilterEntry> entry = 6;\n optional CommitmentLevel commitment = 7;\n repeated SubscribeRequestAccountsDataSlice accounts_data_slice = 8;\n optional SubscribeRequestPing ping = 9;\n}\n\nenum CommitmentLevel {\n PROCESSED = 0;\n CONFIRMED = 1;\n FINALIZED = 2;\n}\n\nmessage SubscribeRequestFilterAccounts {\n repeated string account = 1;\n repeated string owner = 2;\n repeated SubscribeRequestFilterAccountsFilter filters = 3;\n optional bool nonempty_txn_signature = 4;\n}\n\nmessage SubscribeRequestFilterAccountsFilter {\n oneof filter {\n SubscribeRequestFilterAccountsFilterMemcmp memcmp = 1;\n uint64 datasize = 2;\n bool token_account_state = 3;\n SubscribeRequestFilterAccountsFilterLamports lamports = 4;\n }\n}\n\nmessage SubscribeRequestFilterAccountsFilterMemcmp {\n uint64 offset = 1;\n oneof data {\n bytes bytes = 2;\n string base58 = 3;\n string base64 = 4;\n }\n}\n\nmessage SubscribeRequestFilterAccountsFilterLamports {\n oneof cmp {\n uint64 eq = 1;\n uint64 ne = 2;\n uint64 lt = 3;\n uint64 gt = 4;\n }\n}\n\nmessage SubscribeRequestFilterSlots {\n optional bool filter_by_commitment = 1;\n optional bool interleave_global_updates = 2;\n}\n\nmessage SubscribeRequestFilterTransactions {\n optional bool vote = 1;\n optional bool failed = 2;\n optional string signature = 3;\n repeated string account_include = 4;\n repeated string account_exclude = 5;\n repeated string account_required = 6;\n}\n\nmessage SubscribeRequestFilterBlocks {\n repeated string account_include = 1;\n optional bool include_transactions = 2;\n optional bool include_accounts = 3;\n optional bool include_entries = 4;\n}\n\nmessage SubscribeRequestFilterBlocksMeta {}\n\nmessage SubscribeRequestFilterEntry {}\n\nmessage SubscribeRequestAccountsDataSlice {\n uint64 offset = 1;\n uint64 length = 2;\n}\n\nmessage SubscribeRequestPing {\n int32 id = 1;\n}\n\nmessage SubscribeUpdate {\n repeated string filters = 1;\n oneof update_oneof {\n SubscribeUpdateAccount account = 2;\n SubscribeUpdateSlot slot = 3;\n SubscribeUpdateTransaction transaction = 4;\n SubscribeUpdateTransactionInfo transaction_info = 10;\n SubscribeUpdateBlock block = 5;\n SubscribeUpdatePing ping = 6;\n SubscribeUpdatePong pong = 7;\n SubscribeUpdateBlockMeta block_meta = 8;\n SubscribeUpdateEntry entry = 9;\n }\n uint64 created_at = 11;\n}\n\nmessage SubscribeUpdateAccount {\n SubscribeUpdateAccountInfo account = 1;\n uint64 slot = 2;\n optional bool is_startup = 3;\n}\n\nmessage SubscribeUpdateAccountInfo {\n bytes pubkey = 1;\n uint64 lamports = 2;\n bytes owner = 3;\n bool executable = 4;\n uint64 rent_epoch = 5;\n bytes data = 6;\n uint64 write_version = 7;\n optional bytes txn_signature = 8;\n}\n\nmessage SubscribeUpdateSlot {\n uint64 slot = 1;\n optional uint64 parent = 2;\n CommitmentLevel status = 3;\n optional int64 dead_error = 4;\n}\n\nmessage SubscribeUpdateTransaction {\n SubscribeUpdateTransactionInfo transaction = 1;\n uint64 slot = 2;\n}\n\nmessage SubscribeUpdateTransactionInfo {\n bytes signature = 1;\n bool is_vote = 2;\n bytes transaction = 3;\n bytes meta = 4;\n optional uint64 index = 5;\n}\n\nmessage SubscribeUpdateBlock {\n uint64 slot = 1;\n string blockhash = 2;\n SubscribeUpdateBlockRewards rewards = 3;\n UnixTimestamp block_time = 4;\n BlockHeight block_height = 5;\n uint64 parent_slot = 6;\n string parent_blockhash = 7;\n uint64 executed_transaction_count = 8;\n uint64 entries_count = 9;\n repeated SubscribeUpdateTransactionInfo transactions = 10;\n repeated SubscribeUpdateAccountInfo updated_account_count = 11;\n repeated SubscribeUpdateEntry entries = 12;\n}\n\nmessage SubscribeUpdateBlockRewards {\n bytes rewards = 1;\n}\n\nmessage UnixTimestamp {\n int64 timestamp = 1;\n}\n\nmessage BlockHeight {\n uint64 block_height = 1;\n}\n\nmessage SubscribeUpdatePing {}\n\nmessage SubscribeUpdatePong {\n int32 id = 1;\n}\n\nmessage SubscribeUpdateBlockMeta {\n uint64 slot = 1;\n string blockhash = 2;\n SubscribeUpdateBlockRewards rewards = 3;\n UnixTimestamp block_time = 4;\n BlockHeight block_height = 5;\n uint64 parent_slot = 6;\n string parent_blockhash = 7;\n uint64 executed_transaction_count = 8;\n uint64 entries_count = 9;\n}\n\nmessage SubscribeUpdateEntry {\n uint64 slot = 1;\n uint64 index = 2;\n uint64 num_hashes = 3;\n bytes hash = 4;\n uint64 executed_transaction_count = 5;\n optional uint64 starting_transaction_index = 6;\n}\n";
16
+ /**
17
+ * 获取 Geyser Stream 端点
18
+ *
19
+ * @param region 区域
20
+ * @returns gRPC 端点地址
21
+ */
22
+ export declare function getGeyserEndpoint(region?: GeyserRegion): string;
23
+ /**
24
+ * 构建 Geyser 订阅请求
25
+ *
26
+ * @param config 订阅配置
27
+ * @returns gRPC 请求对象
28
+ */
29
+ export declare function buildGeyserSubscribeRequest(config: GeyserSubscribeConfig): Record<string, unknown>;
30
+ /**
31
+ * 创建默认账户订阅配置
32
+ *
33
+ * @param owners 拥有者地址列表
34
+ * @param accounts 特定账户地址列表
35
+ * @returns 订阅配置
36
+ */
37
+ export declare function createAccountSubscribeConfig(owners?: string[], accounts?: string[]): GeyserSubscribeConfig;
38
+ /**
39
+ * 创建默认交易订阅配置
40
+ *
41
+ * @param accountInclude 包含涉及这些账户的交易
42
+ * @param accountRequired 交易必须涉及这些账户
43
+ * @returns 订阅配置
44
+ */
45
+ export declare function createTransactionSubscribeConfig(accountInclude?: string[], accountRequired?: string[]): GeyserSubscribeConfig;
46
+ /**
47
+ * 创建默认区块订阅配置
48
+ *
49
+ * @param accountInclude 包含涉及这些账户的区块
50
+ * @param includeTransactions 是否包含交易
51
+ * @returns 订阅配置
52
+ */
53
+ export declare function createBlockSubscribeConfig(accountInclude?: string[], includeTransactions?: boolean): GeyserSubscribeConfig;
54
+ /**
55
+ * 创建 Geyser 订阅(需要 @grpc/grpc-js 和 @grpc/proto-loader)
56
+ *
57
+ * 注意:此函数需要安装 gRPC 依赖:
58
+ * ```bash
59
+ * npm install @grpc/grpc-js @grpc/proto-loader
60
+ * ```
61
+ *
62
+ * @param clientConfig 客户端配置
63
+ * @param subscribeConfig 订阅配置
64
+ * @param handlers 事件处理器
65
+ * @returns 流控制对象
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * import { Sol } from 'four-flap-meme-sdk'
70
+ * import bs58 from 'bs58'
71
+ *
72
+ * const stream = await Sol.createGeyserSubscription(
73
+ * {
74
+ * host: Sol.getGeyserEndpoint('tokyo'),
75
+ * token: 'your-auth-token',
76
+ * },
77
+ * Sol.createTransactionSubscribeConfig(
78
+ * ['your-account-address'], // 监听涉及此账户的交易
79
+ * ),
80
+ * {
81
+ * onTransaction: (update, raw) => {
82
+ * console.log(`交易: ${bs58.encode(update.transaction.signature)}`)
83
+ * },
84
+ * onError: (err) => console.error('错误:', err),
85
+ * onEnd: () => console.log('流结束'),
86
+ * },
87
+ * )
88
+ *
89
+ * // 关闭流
90
+ * stream.close()
91
+ * ```
92
+ */
93
+ export declare function createGeyserSubscription(clientConfig: GeyserClientConfig, subscribeConfig: GeyserSubscribeConfig, handlers: GeyserEventHandlers): Promise<GeyserStreamControl>;
94
+ /**
95
+ * 简化版:订阅账户更新
96
+ *
97
+ * @param token 认证 Token
98
+ * @param accounts 账户地址列表
99
+ * @param onUpdate 更新回调
100
+ * @param region 区域(默认 tokyo)
101
+ * @returns 流控制对象
102
+ */
103
+ export declare function subscribeGeyserAccounts(token: string, accounts: string[], onUpdate: (pubkey: string, lamports: string, slot: string) => void, region?: GeyserRegion): Promise<{
104
+ close: () => void;
105
+ }>;
106
+ /**
107
+ * 简化版:订阅交易更新
108
+ *
109
+ * @param token 认证 Token
110
+ * @param accountInclude 包含涉及这些账户的交易
111
+ * @param onUpdate 更新回调
112
+ * @param region 区域(默认 tokyo)
113
+ * @returns 流控制对象
114
+ */
115
+ export declare function subscribeGeyserTransactions(token: string, accountInclude: string[], onUpdate: (signature: string, isVote: boolean, slot: string) => void, region?: GeyserRegion): Promise<{
116
+ close: () => void;
117
+ }>;
118
+ /**
119
+ * 简化版:订阅区块更新
120
+ *
121
+ * @param token 认证 Token
122
+ * @param onUpdate 更新回调
123
+ * @param region 区域(默认 tokyo)
124
+ * @returns 流控制对象
125
+ */
126
+ export declare function subscribeGeyserBlocks(token: string, onUpdate: (slot: string, blockhash: string, txCount: number) => void, region?: GeyserRegion): Promise<{
127
+ close: () => void;
128
+ }>;