four-flap-meme-sdk 1.5.6 → 1.5.8

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 (158) hide show
  1. package/README.zh-CN.pdf +0 -0
  2. package/dist/abis/common.js +2 -0
  3. package/dist/contracts/tm-bundle-merkle/config.d.ts +0 -1
  4. package/dist/contracts/tm-bundle-merkle/config.js +0 -1
  5. package/dist/contracts/tm-bundle-merkle/core.js +13 -9
  6. package/dist/flap/portal-bundle-merkle/config.d.ts +0 -1
  7. package/dist/flap/portal-bundle-merkle/config.js +0 -1
  8. package/dist/flap/portal-bundle-merkle/create-to-dex.d.ts +8 -2
  9. package/dist/flap/portal-bundle-merkle/create-to-dex.js +170 -128
  10. package/dist/flap/portal-bundle-merkle/encryption.d.ts +16 -0
  11. package/dist/flap/portal-bundle-merkle/encryption.js +146 -0
  12. package/dist/index.d.ts +0 -1
  13. package/dist/index.js +1 -1
  14. package/package.json +5 -41
  15. package/dist/sol/constants.d.ts +0 -150
  16. package/dist/sol/constants.js +0 -188
  17. package/dist/sol/dex/blockrazor/client.d.ts +0 -51
  18. package/dist/sol/dex/blockrazor/client.js +0 -96
  19. package/dist/sol/dex/blockrazor/constants.d.ts +0 -34
  20. package/dist/sol/dex/blockrazor/constants.js +0 -55
  21. package/dist/sol/dex/blockrazor/geyser.d.ts +0 -128
  22. package/dist/sol/dex/blockrazor/geyser.js +0 -530
  23. package/dist/sol/dex/blockrazor/index.d.ts +0 -18
  24. package/dist/sol/dex/blockrazor/index.js +0 -23
  25. package/dist/sol/dex/blockrazor/send.d.ts +0 -135
  26. package/dist/sol/dex/blockrazor/send.js +0 -254
  27. package/dist/sol/dex/blockrazor/types.d.ts +0 -191
  28. package/dist/sol/dex/blockrazor/types.js +0 -5
  29. package/dist/sol/dex/index.d.ts +0 -10
  30. package/dist/sol/dex/index.js +0 -16
  31. package/dist/sol/dex/jup/client.d.ts +0 -33
  32. package/dist/sol/dex/jup/client.js +0 -110
  33. package/dist/sol/dex/jup/index.d.ts +0 -16
  34. package/dist/sol/dex/jup/index.js +0 -148
  35. package/dist/sol/dex/jup/legacy.d.ts +0 -623
  36. package/dist/sol/dex/jup/legacy.js +0 -416
  37. package/dist/sol/dex/jup/lend.d.ts +0 -640
  38. package/dist/sol/dex/jup/lend.js +0 -603
  39. package/dist/sol/dex/jup/portfolio.d.ts +0 -362
  40. package/dist/sol/dex/jup/portfolio.js +0 -367
  41. package/dist/sol/dex/jup/price.d.ts +0 -173
  42. package/dist/sol/dex/jup/price.js +0 -220
  43. package/dist/sol/dex/jup/recurring.d.ts +0 -437
  44. package/dist/sol/dex/jup/recurring.js +0 -320
  45. package/dist/sol/dex/jup/send.d.ts +0 -282
  46. package/dist/sol/dex/jup/send.js +0 -295
  47. package/dist/sol/dex/jup/studio.d.ts +0 -457
  48. package/dist/sol/dex/jup/studio.js +0 -488
  49. package/dist/sol/dex/jup/tokens.d.ts +0 -767
  50. package/dist/sol/dex/jup/tokens.js +0 -697
  51. package/dist/sol/dex/jup/trigger.d.ts +0 -511
  52. package/dist/sol/dex/jup/trigger.js +0 -397
  53. package/dist/sol/dex/jup/types.d.ts +0 -433
  54. package/dist/sol/dex/jup/types.js +0 -5
  55. package/dist/sol/dex/jup/ultra.d.ts +0 -646
  56. package/dist/sol/dex/jup/ultra.js +0 -853
  57. package/dist/sol/dex/meteora/client.d.ts +0 -76
  58. package/dist/sol/dex/meteora/client.js +0 -219
  59. package/dist/sol/dex/meteora/damm-v1-bundle.d.ts +0 -61
  60. package/dist/sol/dex/meteora/damm-v1-bundle.js +0 -112
  61. package/dist/sol/dex/meteora/damm-v1.d.ts +0 -118
  62. package/dist/sol/dex/meteora/damm-v1.js +0 -315
  63. package/dist/sol/dex/meteora/damm-v2-bundle.d.ts +0 -82
  64. package/dist/sol/dex/meteora/damm-v2-bundle.js +0 -242
  65. package/dist/sol/dex/meteora/damm-v2.d.ts +0 -172
  66. package/dist/sol/dex/meteora/damm-v2.js +0 -632
  67. package/dist/sol/dex/meteora/dbc-bundle.d.ts +0 -123
  68. package/dist/sol/dex/meteora/dbc-bundle.js +0 -304
  69. package/dist/sol/dex/meteora/dbc.d.ts +0 -192
  70. package/dist/sol/dex/meteora/dbc.js +0 -619
  71. package/dist/sol/dex/meteora/dlmm-bundle.d.ts +0 -39
  72. package/dist/sol/dex/meteora/dlmm-bundle.js +0 -189
  73. package/dist/sol/dex/meteora/dlmm.d.ts +0 -157
  74. package/dist/sol/dex/meteora/dlmm.js +0 -671
  75. package/dist/sol/dex/meteora/index.d.ts +0 -25
  76. package/dist/sol/dex/meteora/index.js +0 -65
  77. package/dist/sol/dex/meteora/types.d.ts +0 -787
  78. package/dist/sol/dex/meteora/types.js +0 -110
  79. package/dist/sol/dex/orca/index.d.ts +0 -10
  80. package/dist/sol/dex/orca/index.js +0 -16
  81. package/dist/sol/dex/orca/orca-bundle.d.ts +0 -41
  82. package/dist/sol/dex/orca/orca-bundle.js +0 -173
  83. package/dist/sol/dex/orca/orca.d.ts +0 -65
  84. package/dist/sol/dex/orca/orca.js +0 -474
  85. package/dist/sol/dex/orca/types.d.ts +0 -263
  86. package/dist/sol/dex/orca/types.js +0 -38
  87. package/dist/sol/dex/orca/wavebreak-bundle.d.ts +0 -34
  88. package/dist/sol/dex/orca/wavebreak-bundle.js +0 -198
  89. package/dist/sol/dex/orca/wavebreak-types.d.ts +0 -227
  90. package/dist/sol/dex/orca/wavebreak-types.js +0 -23
  91. package/dist/sol/dex/orca/wavebreak.d.ts +0 -78
  92. package/dist/sol/dex/orca/wavebreak.js +0 -497
  93. package/dist/sol/dex/pump/index.d.ts +0 -9
  94. package/dist/sol/dex/pump/index.js +0 -14
  95. package/dist/sol/dex/pump/pump-bundle.d.ts +0 -92
  96. package/dist/sol/dex/pump/pump-bundle.js +0 -383
  97. package/dist/sol/dex/pump/pump-swap-bundle.d.ts +0 -103
  98. package/dist/sol/dex/pump/pump-swap-bundle.js +0 -380
  99. package/dist/sol/dex/pump/pump-swap.d.ts +0 -46
  100. package/dist/sol/dex/pump/pump-swap.js +0 -199
  101. package/dist/sol/dex/pump/pump.d.ts +0 -35
  102. package/dist/sol/dex/pump/pump.js +0 -352
  103. package/dist/sol/dex/pump/types.d.ts +0 -215
  104. package/dist/sol/dex/pump/types.js +0 -5
  105. package/dist/sol/dex/raydium/index.d.ts +0 -8
  106. package/dist/sol/dex/raydium/index.js +0 -12
  107. package/dist/sol/dex/raydium/launchlab.d.ts +0 -68
  108. package/dist/sol/dex/raydium/launchlab.js +0 -210
  109. package/dist/sol/dex/raydium/raydium-bundle.d.ts +0 -64
  110. package/dist/sol/dex/raydium/raydium-bundle.js +0 -324
  111. package/dist/sol/dex/raydium/raydium.d.ts +0 -40
  112. package/dist/sol/dex/raydium/raydium.js +0 -366
  113. package/dist/sol/dex/raydium/types.d.ts +0 -240
  114. package/dist/sol/dex/raydium/types.js +0 -5
  115. package/dist/sol/index.d.ts +0 -11
  116. package/dist/sol/index.js +0 -18
  117. package/dist/sol/jito/bundle.d.ts +0 -90
  118. package/dist/sol/jito/bundle.js +0 -263
  119. package/dist/sol/jito/index.d.ts +0 -7
  120. package/dist/sol/jito/index.js +0 -7
  121. package/dist/sol/jito/tip.d.ts +0 -51
  122. package/dist/sol/jito/tip.js +0 -83
  123. package/dist/sol/jito/types.d.ts +0 -100
  124. package/dist/sol/jito/types.js +0 -5
  125. package/dist/sol/nozomi/client.d.ts +0 -63
  126. package/dist/sol/nozomi/client.js +0 -222
  127. package/dist/sol/nozomi/index.d.ts +0 -8
  128. package/dist/sol/nozomi/index.js +0 -8
  129. package/dist/sol/nozomi/tip.d.ts +0 -50
  130. package/dist/sol/nozomi/tip.js +0 -80
  131. package/dist/sol/nozomi/types.d.ts +0 -96
  132. package/dist/sol/nozomi/types.js +0 -5
  133. package/dist/sol/token/create-complete.d.ts +0 -115
  134. package/dist/sol/token/create-complete.js +0 -235
  135. package/dist/sol/token/create-token.d.ts +0 -57
  136. package/dist/sol/token/create-token.js +0 -230
  137. package/dist/sol/token/index.d.ts +0 -9
  138. package/dist/sol/token/index.js +0 -14
  139. package/dist/sol/token/metadata-upload.d.ts +0 -86
  140. package/dist/sol/token/metadata-upload.js +0 -173
  141. package/dist/sol/token/metadata.d.ts +0 -92
  142. package/dist/sol/token/metadata.js +0 -274
  143. package/dist/sol/token/types.d.ts +0 -153
  144. package/dist/sol/token/types.js +0 -5
  145. package/dist/sol/types.d.ts +0 -176
  146. package/dist/sol/types.js +0 -7
  147. package/dist/sol/utils/balance.d.ts +0 -160
  148. package/dist/sol/utils/balance.js +0 -638
  149. package/dist/sol/utils/connection.d.ts +0 -78
  150. package/dist/sol/utils/connection.js +0 -168
  151. package/dist/sol/utils/index.d.ts +0 -9
  152. package/dist/sol/utils/index.js +0 -9
  153. package/dist/sol/utils/lp-inspect.d.ts +0 -129
  154. package/dist/sol/utils/lp-inspect.js +0 -900
  155. package/dist/sol/utils/transfer.d.ts +0 -196
  156. package/dist/sol/utils/transfer.js +0 -307
  157. package/dist/sol/utils/wallet.d.ts +0 -107
  158. package/dist/sol/utils/wallet.js +0 -210
@@ -1,96 +0,0 @@
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
- }
@@ -1,34 +0,0 @@
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
- };
@@ -1,55 +0,0 @@
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
- };
@@ -1,128 +0,0 @@
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
- }>;