@sleet-js/staking-pool-contract-methods-const 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 sleet.near
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # staking-pool-contract-methods-const
2
+ const's for near staking pools smart contracts methods
3
+
4
+ ℹ️ can be used with any near api js option.
5
+ <br/>
6
+ ℹ️ not all staking pool may have the same methods
7
+
8
+ ---
9
+
10
+ ### DEV
11
+ to devlop and publish this package
12
+ ```bash
13
+ bun install
14
+ bun run index.ts
15
+ bun build index.ts
16
+ bun publish --dry-run
17
+ bunx npm login
18
+ bun publish --access public
19
+ ```
20
+
21
+ ---
22
+
23
+ ### HOW TO USE
24
+
25
+ add
26
+ ```sh
27
+ npm i @sleet-js/staking-pool-contract-methods-const
28
+ bun add @sleet-js/staking-pool-contract-methods-const
29
+ ```
30
+
31
+ This package conatins the consts for these smart contracts
32
+ - [x] pool.near - ```factory_pool_methods_const```
33
+ - [x] poolv1.near - ```factory_poolv1_methods_const```
34
+ - [x] pool ("code_hash": "AjD4YJaXgpiRdiArqnzyDi7Bkr1gJms9Z2w7Ev5esTKB") - ```pool_methods_const```
35
+ - [x] poolv1 (J1arLz48fgXcGyCPVckFwLnewNH6j1uw79thsvwqGYTY) - ```poolv1_methods_const```
36
+ - [x] meta-pool.near (stnear) - ```meta_pool_methods_const```
37
+ - [x] linear-protocol.near (linear) - ```linear_protocol_methods_const```
38
+
39
+ ℹ️ if i missed a pool, or there is one you would like me to add let me know
40
+
41
+
42
+ ---
43
+
44
+ This project was created using `bun init` in bun v1.2.12. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
45
+
46
+ copyright 2025 by sleet.near
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@sleet-js/staking-pool-contract-methods-const",
3
+ "version": "0.0.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/sleet-js/smart-contract-methods-const.git"
7
+ },
8
+ "homepage": "https://sleet-js.near.page",
9
+ "license": "MIT",
10
+ "module": "src/index.ts",
11
+ "type": "module",
12
+ "devDependencies": {
13
+ "@types/bun": "latest"
14
+ },
15
+ "peerDependencies": {
16
+ "typescript": "^5"
17
+ }
18
+ }
@@ -0,0 +1,14 @@
1
+ // ========================================
2
+ // ====== factory_pool_methods_const ======
3
+ export const factory_pool_methods_const = {
4
+ store: "store",
5
+ new: "new",
6
+ get_min_attached_balance: "get_min_attached_balance",
7
+ get_number_of_staking_pools_created: "get_number_of_staking_pools_created",
8
+ create_staking_pool: "create_staking_pool",
9
+ on_staking_pool_create: "on_staking_pool_create",
10
+ get_code: "get_code",
11
+ allow_contract: "allow_contract",
12
+ disallow_contract: "disallow_contract",
13
+ is_contract_allowed: "is_contract_allowed",
14
+ } as const;
@@ -0,0 +1,9 @@
1
+ // ==========================================
2
+ // ====== factory_poolv1_methods_const ======
3
+ export const factory_poolv1_methods_const = {
4
+ new: "new",
5
+ get_min_attached_balance: "get_min_attached_balance",
6
+ get_number_of_staking_pools_created: "get_number_of_staking_pools_created",
7
+ create_staking_pool: "create_staking_pool",
8
+ on_staking_pool_create: "on_staking_pool_create",
9
+ } as const;
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ // ===============================================
2
+ // ===== staking-pool-contract-methods-const =====
3
+ export { factory_pool_methods_const } from "./factory_pool";
4
+ export { factory_poolv1_methods_const } from "./factory_poolv1";
5
+ export { pool_methods_const } from "./pool"
6
+ export { poolv1_methods_const } from "./poolv1"
7
+ export { meta_pool_methods_const } from "./meta_pool"
8
+ export { linear_protocol_methods_const } from "./linear_protocol"
@@ -0,0 +1,80 @@
1
+ // ===========================================
2
+ // ====== linear_protocol_methods_const ======
3
+ export const linear_protocol_methods_const = {
4
+ upgrade: "upgrade",
5
+ epoch_stake: "epoch_stake",
6
+ epoch_unstake: "epoch_unstake",
7
+ epoch_update_rewards: "epoch_update_rewards",
8
+ epoch_withdraw: "epoch_withdraw",
9
+ validator_staked_callback: "validator_staked_callback",
10
+ validator_unstaked_callback: "validator_unstaked_callback",
11
+ validator_get_balance_callback: "validator_get_balance_callback",
12
+ validator_get_account_callback: "validator_get_account_callback",
13
+ validator_withdraw_callback: "validator_withdraw_callback",
14
+ ft_transfer: "ft_transfer",
15
+ ft_transfer_call: "ft_transfer_call",
16
+ ft_total_supply: "ft_total_supply",
17
+ ft_balance_of: "ft_balance_of",
18
+ ft_resolve_transfer: "ft_resolve_transfer",
19
+ ft_price: "ft_price",
20
+ ft_metadata: "ft_metadata",
21
+ storage_deposit: "storage_deposit",
22
+ storage_withdraw: "storage_withdraw",
23
+ storage_unregister: "storage_unregister",
24
+ storage_balance_bounds: "storage_balance_bounds",
25
+ storage_balance_of: "storage_balance_of",
26
+ contract_source_metadata: "contract_source_metadata",
27
+ set_owner: "set_owner",
28
+ add_manager: "add_manager",
29
+ remove_manager: "remove_manager",
30
+ set_beneficiary: "set_beneficiary",
31
+ remove_beneficiary: "remove_beneficiary",
32
+ set_treasury: "set_treasury",
33
+ set_whitelist_contract_id: "set_whitelist_contract_id",
34
+ pause: "pause",
35
+ resume: "resume",
36
+ ping: "ping",
37
+ deposit: "deposit",
38
+ deposit_and_stake: "deposit_and_stake",
39
+ withdraw_all: "withdraw_all",
40
+ withdraw: "withdraw",
41
+ stake_all: "stake_all",
42
+ stake: "stake",
43
+ unstake_all: "unstake_all",
44
+ unstake: "unstake",
45
+ migrate: "migrate",
46
+ add_validator: "add_validator",
47
+ add_validators: "add_validators",
48
+ is_whitelisted_callback: "is_whitelisted_callback",
49
+ remove_validator: "remove_validator",
50
+ update_weight: "update_weight",
51
+ update_weights: "update_weights",
52
+ update_base_stake_amounts: "update_base_stake_amounts",
53
+ sync_balance_from_validator: "sync_balance_from_validator",
54
+ get_validator: "get_validator",
55
+ get_validators: "get_validators",
56
+ drain_unstake: "drain_unstake",
57
+ drain_withdraw: "drain_withdraw",
58
+ validator_drain_unstaked_callback: "validator_drain_unstaked_callback",
59
+ validator_drain_withdraw_callback: "validator_drain_withdraw_callback",
60
+ get_total_share_amount: "get_total_share_amount",
61
+ get_beneficiaries: "get_beneficiaries",
62
+ get_managers: "get_managers",
63
+ get_summary: "get_summary",
64
+ get_account_details: "get_account_details",
65
+ get_account_unstaked_balance: "get_account_unstaked_balance",
66
+ get_account_staked_balance: "get_account_staked_balance",
67
+ get_account_total_balance: "get_account_total_balance",
68
+ is_account_unstaked_balance_available: "is_account_unstaked_balance_available",
69
+ get_total_staked_balance: "get_total_staked_balance",
70
+ get_owner_id: "get_owner_id",
71
+ get_reward_fee_fraction: "get_reward_fee_fraction",
72
+ get_staking_key: "get_staking_key",
73
+ is_paused: "is_paused",
74
+ get_account: "get_account",
75
+ get_number_of_accounts: "get_number_of_accounts",
76
+ get_accounts: "get_accounts",
77
+ can_account_withdraw: "can_account_withdraw",
78
+ new: "new",
79
+ version: "version",
80
+ } as const;
@@ -0,0 +1,99 @@
1
+ // =====================================
2
+ // ====== meta_pool_methods_const ======
3
+ export const meta_pool_methods_const = {
4
+ distribute_staking: "distribute_staking",
5
+ on_staking_pool_stake_maybe_deposit: "on_staking_pool_stake_maybe_deposit",
6
+ manual_stake: "manual_stake",
7
+ force_rebalance_unstake: "force_rebalance_unstake",
8
+ rebalance_unstake_sp: "rebalance_unstake_sp",
9
+ do_rebalance_unstake: "do_rebalance_unstake",
10
+ distribute_unstaking: "distribute_unstaking",
11
+ on_staking_pool_unstake: "on_staking_pool_unstake",
12
+ set_busy: "set_busy",
13
+ sp_busy: "sp_busy",
14
+ extra_balance_accumulated: "extra_balance_accumulated",
15
+ transfer_extra_balance_accumulated: "transfer_extra_balance_accumulated",
16
+ sync_unstaked_balance: "sync_unstaked_balance",
17
+ on_get_sp_unstaked_balance: "on_get_sp_unstaked_balance",
18
+ distribute_rewards: "distribute_rewards",
19
+ on_get_sp_total_balance: "on_get_sp_total_balance",
20
+ get_staking_pool_requiring_retrieve: "get_staking_pool_requiring_retrieve",
21
+ retrieve_funds_from_a_pool: "retrieve_funds_from_a_pool",
22
+ on_retrieve_from_staking_pool: "on_retrieve_from_staking_pool",
23
+ end_of_epoch_clearing: "end_of_epoch_clearing",
24
+ migrate: "migrate",
25
+ pause_staking: "pause_staking",
26
+ un_pause_staking: "un_pause_staking",
27
+ get_staking_pool_list: "get_staking_pool_list",
28
+ remove_staking_pool: "remove_staking_pool",
29
+ add_staking_pool: "add_staking_pool",
30
+ set_staking_pools: "set_staking_pools",
31
+ compute_current_unstaking_delay: "compute_current_unstaking_delay",
32
+ get_operator_account_id: "get_operator_account_id",
33
+ set_operator_account_id: "set_operator_account_id",
34
+ get_treasury_account_id: "get_treasury_account_id",
35
+ set_treasury_account_id: "set_treasury_account_id",
36
+ set_owner_id: "set_owner_id",
37
+ get_known_deposited_balance: "get_known_deposited_balance",
38
+ get_account_info: "get_account_info",
39
+ get_contract_info: "get_contract_info",
40
+ set_contract_info: "set_contract_info",
41
+ get_st_near_price: "get_st_near_price",
42
+ get_contract_state: "get_contract_state",
43
+ get_contract_params: "get_contract_params",
44
+ set_contract_params: "set_contract_params",
45
+ set_reward_multipliers: "set_reward_multipliers",
46
+ set_max_meta_rewards: "set_max_meta_rewards",
47
+ get_sp_info: "get_sp_info",
48
+ get_staking_pool_requiring_unstake: "get_staking_pool_requiring_unstake",
49
+ storage_deposit: "storage_deposit",
50
+ storage_withdraw: "storage_withdraw",
51
+ storage_unregister: "storage_unregister",
52
+ storage_balance_bounds: "storage_balance_bounds",
53
+ storage_balance_of: "storage_balance_of",
54
+ ft_transfer: "ft_transfer",
55
+ ft_transfer_call: "ft_transfer_call",
56
+ ft_total_supply: "ft_total_supply",
57
+ ft_balance_of: "ft_balance_of",
58
+ ft_resolve_transfer: "ft_resolve_transfer",
59
+ ft_metadata: "ft_metadata",
60
+ ft_metadata_set: "ft_metadata_set",
61
+ new: "new",
62
+ ping: "ping",
63
+ deposit: "deposit",
64
+ withdraw: "withdraw",
65
+ withdraw_all: "withdraw_all",
66
+ withdraw_unstaked: "withdraw_unstaked",
67
+ deposit_and_stake: "deposit_and_stake",
68
+ stake_all: "stake_all",
69
+ stake: "stake",
70
+ unstake_all: "unstake_all",
71
+ unstake: "unstake",
72
+ stake_for_lockup: "stake_for_lockup",
73
+ unstake_from_lockup_shares: "unstake_from_lockup_shares",
74
+ withdraw_to_lockup: "withdraw_to_lockup",
75
+ get_account_unstaked_balance: "get_account_unstaked_balance",
76
+ get_account_staked_balance: "get_account_staked_balance",
77
+ get_account_total_balance: "get_account_total_balance",
78
+ get_account_available_balance: "get_account_available_balance",
79
+ is_account_unstaked_balance_available: "is_account_unstaked_balance_available",
80
+ get_owner_id: "get_owner_id",
81
+ get_reward_fee_fraction: "get_reward_fee_fraction",
82
+ get_reward_fee_bp: "get_reward_fee_bp",
83
+ set_reward_fee: "set_reward_fee",
84
+ get_staking_key: "get_staking_key",
85
+ is_staking_paused: "is_staking_paused",
86
+ get_account: "get_account",
87
+ get_number_of_accounts: "get_number_of_accounts",
88
+ get_accounts: "get_accounts",
89
+ get_accounts_info: "get_accounts_info",
90
+ get_near_amount_sell_stnear: "get_near_amount_sell_stnear",
91
+ nslp_get_discount_basis_points: "nslp_get_discount_basis_points",
92
+ liquid_unstake: "liquid_unstake",
93
+ nslp_add_liquidity: "nslp_add_liquidity",
94
+ nslp_remove_liquidity: "nslp_remove_liquidity",
95
+ stake_from_nslp: "stake_from_nslp",
96
+ realize_meta: "realize_meta",
97
+ harvest_meta: "harvest_meta",
98
+ upgrade: "upgrade",
99
+ } as const;
package/src/pool.ts ADDED
@@ -0,0 +1,56 @@
1
+ // ================================
2
+ // ====== pool_methods_const ======
3
+ export const pool_methods_const = {
4
+ upgrade: "upgrade",
5
+ update: "update",
6
+ migrate: "migrate",
7
+ callback_post_get_owner: "callback_post_get_owner",
8
+ callback_post_withdraw_reward: "callback_post_withdraw_reward",
9
+ claim: "claim",
10
+ stop_farm: "stop_farm",
11
+ set_owner_id: "set_owner_id",
12
+ update_staking_key: "update_staking_key",
13
+ update_reward_fee_fraction: "update_reward_fee_fraction",
14
+ decrease_burn_fee_fraction: "decrease_burn_fee_fraction",
15
+ pause_staking: "pause_staking",
16
+ resume_staking: "resume_staking",
17
+ add_authorized_user: "add_authorized_user",
18
+ remove_authorized_user: "remove_authorized_user",
19
+ add_authorized_farm_token: "add_authorized_farm_token",
20
+ remove_authorized_farm_token: "remove_authorized_farm_token",
21
+ deposit: "deposit",
22
+ deposit_and_stake: "deposit_and_stake",
23
+ withdraw_all: "withdraw_all",
24
+ withdraw: "withdraw",
25
+ stake_all: "stake_all",
26
+ stake: "stake",
27
+ unstake_all: "unstake_all",
28
+ unstake: "unstake",
29
+ unstake_burn: "unstake_burn",
30
+ burn: "burn",
31
+ on_stake_action: "on_stake_action",
32
+ ft_on_transfer: "ft_on_transfer",
33
+ get_pool_summary: "get_pool_summary",
34
+ get_version: "get_version",
35
+ get_owner_id: "get_owner_id",
36
+ get_factory_id: "get_factory_id",
37
+ get_authorized_users: "get_authorized_users",
38
+ get_authorized_farm_tokens: "get_authorized_farm_tokens",
39
+ get_active_farms: "get_active_farms",
40
+ get_farms: "get_farms",
41
+ get_farm: "get_farm",
42
+ get_unclaimed_reward: "get_unclaimed_reward",
43
+ get_account_unstaked_balance: "get_account_unstaked_balance",
44
+ get_account_staked_balance: "get_account_staked_balance",
45
+ get_account_total_balance: "get_account_total_balance",
46
+ is_account_unstaked_balance_available: "is_account_unstaked_balance_available",
47
+ get_total_staked_balance: "get_total_staked_balance",
48
+ get_reward_fee_fraction: "get_reward_fee_fraction",
49
+ get_staking_key: "get_staking_key",
50
+ is_staking_paused: "is_staking_paused",
51
+ get_account: "get_account",
52
+ get_number_of_accounts: "get_number_of_accounts",
53
+ get_accounts: "get_accounts",
54
+ new: "new",
55
+ ping: "ping",
56
+ } as const;
package/src/poolv1.ts ADDED
@@ -0,0 +1,32 @@
1
+ // ==================================
2
+ // ====== poolv1_methods_const ======
3
+ export const poolv1_methods_const = {
4
+ new: "new",
5
+ ping: "ping",
6
+ deposit: "deposit",
7
+ deposit_and_stake: "deposit_and_stake",
8
+ withdraw_all: "withdraw_all",
9
+ withdraw: "withdraw",
10
+ stake_all: "stake_all",
11
+ stake: "stake",
12
+ unstake_all: "unstake_all",
13
+ unstake: "unstake",
14
+ get_account_unstaked_balance: "get_account_unstaked_balance",
15
+ get_account_staked_balance: "get_account_staked_balance",
16
+ get_account_total_balance: "get_account_total_balance",
17
+ is_account_unstaked_balance_available: "is_account_unstaked_balance_available",
18
+ get_total_staked_balance: "get_total_staked_balance",
19
+ get_owner_id: "get_owner_id",
20
+ get_reward_fee_fraction: "get_reward_fee_fraction",
21
+ get_staking_key: "get_staking_key",
22
+ is_staking_paused: "is_staking_paused",
23
+ get_account: "get_account",
24
+ get_number_of_accounts: "get_number_of_accounts",
25
+ get_accounts: "get_accounts",
26
+ on_stake_action: "on_stake_action",
27
+ update_staking_key: "update_staking_key",
28
+ update_reward_fee_fraction: "update_reward_fee_fraction",
29
+ vote: "vote",
30
+ pause_staking: "pause_staking",
31
+ resume_staking: "resume_staking",
32
+ } as const;
package/tsconfig.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Environment setup & latest features
4
+ "lib": ["ESNext"],
5
+ "target": "ESNext",
6
+ "module": "ESNext",
7
+ "moduleDetection": "force",
8
+ "jsx": "react-jsx",
9
+ "allowJs": true,
10
+
11
+ // Bundler mode
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "noEmit": true,
16
+
17
+ // Best practices
18
+ "strict": true,
19
+ "skipLibCheck": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "noUncheckedIndexedAccess": true,
22
+
23
+ // Some stricter flags (disabled by default)
24
+ "noUnusedLocals": false,
25
+ "noUnusedParameters": false,
26
+ "noPropertyAccessFromIndexSignature": false
27
+ }
28
+ }