@sleet-js/hos-contracts-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 +9 -0
- package/README.md +42 -0
- package/package.json +18 -0
- package/src/hos_lockup_contract.ts +43 -0
- package/src/hos_venear_contract.ts +43 -0
- package/src/hos_voting_contract.ts +31 -0
- package/src/index.ts +5 -0
- package/tsconfig.json +28 -0
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,42 @@
|
|
|
1
|
+
# hos-contracts-methods-const
|
|
2
|
+
const's for near house of stake gov smart contracts methods
|
|
3
|
+
|
|
4
|
+
ℹ️ can be used with any near api js option.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### DEV
|
|
10
|
+
to devlop and publish this package
|
|
11
|
+
```bash
|
|
12
|
+
bun install
|
|
13
|
+
bun run index.ts
|
|
14
|
+
bun build index.ts
|
|
15
|
+
bun publish --dry-run
|
|
16
|
+
bunx npm login
|
|
17
|
+
bun publish --access public
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### HOW TO USE
|
|
23
|
+
|
|
24
|
+
add
|
|
25
|
+
```sh
|
|
26
|
+
npm i @sleet-js/hos-contracts-methods-const
|
|
27
|
+
bun add @sleet-js/hos-contracts-methods-const
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
This package conatins the consts for these smart contracts
|
|
31
|
+
- venear-contract (venear.dao) - ```hos_venear_contract_methods_const```
|
|
32
|
+
- lockup-contract (differnt for every user) -
|
|
33
|
+
- voting-contract (vote.dao) - ```hos_voting_contract_methods_const```
|
|
34
|
+
|
|
35
|
+
see the code here: https://github.com/houseofstake/house-of-stake-contracts
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
This project was created using `bun init` in bun v1.2.12. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
|
41
|
+
|
|
42
|
+
copyright 2025 by sleet.near
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sleet-js/hos-contracts-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,43 @@
|
|
|
1
|
+
// ===============================================
|
|
2
|
+
// ====== hos_lockup_contract_methods_const ======
|
|
3
|
+
export const hos_lockup_contract_methods_const = {
|
|
4
|
+
begin_unlock_near: "begin_unlock_near",
|
|
5
|
+
contract_source_metadata: "contract_source_metadata",
|
|
6
|
+
delete_lockup: "delete_lockup",
|
|
7
|
+
deposit_and_stake: "deposit_and_stake",
|
|
8
|
+
deposit_to_staking_pool: "deposit_to_staking_pool",
|
|
9
|
+
end_unlock_near: "end_unlock_near",
|
|
10
|
+
get_balance: "get_balance",
|
|
11
|
+
get_known_deposited_balance: "get_known_deposited_balance",
|
|
12
|
+
get_liquid_owners_balance: "get_liquid_owners_balance",
|
|
13
|
+
get_lockup_update_nonce: "get_lockup_update_nonce",
|
|
14
|
+
get_owner_account_id: "get_owner_account_id",
|
|
15
|
+
get_owners_balance: "get_owners_balance",
|
|
16
|
+
get_staking_pool_account_id: "get_staking_pool_account_id",
|
|
17
|
+
get_venear_liquid_balance: "get_venear_liquid_balance",
|
|
18
|
+
get_venear_locked_balance: "get_venear_locked_balance",
|
|
19
|
+
get_venear_pending_balance: "get_venear_pending_balance",
|
|
20
|
+
get_venear_unlock_timestamp: "get_venear_unlock_timestamp",
|
|
21
|
+
get_version: "get_version",
|
|
22
|
+
lock_near: "lock_near",
|
|
23
|
+
lock_pending_near: "lock_pending_near",
|
|
24
|
+
new: "new",
|
|
25
|
+
on_get_account_total_balance: "on_get_account_total_balance",
|
|
26
|
+
on_get_account_unstaked_balance_to_withdraw_by_owner: "on_get_account_unstaked_balance_to_withdraw_by_owner",
|
|
27
|
+
on_staking_pool_deposit: "on_staking_pool_deposit",
|
|
28
|
+
on_staking_pool_deposit_and_stake: "on_staking_pool_deposit_and_stake",
|
|
29
|
+
on_staking_pool_stake: "on_staking_pool_stake",
|
|
30
|
+
on_staking_pool_unstake: "on_staking_pool_unstake",
|
|
31
|
+
on_staking_pool_unstake_all: "on_staking_pool_unstake_all",
|
|
32
|
+
on_staking_pool_withdraw: "on_staking_pool_withdraw",
|
|
33
|
+
on_whitelist_is_whitelisted: "on_whitelist_is_whitelisted",
|
|
34
|
+
refresh_staking_pool_balance: "refresh_staking_pool_balance",
|
|
35
|
+
select_staking_pool: "select_staking_pool",
|
|
36
|
+
stake: "stake",
|
|
37
|
+
transfer: "transfer",
|
|
38
|
+
unselect_staking_pool: "unselect_staking_pool",
|
|
39
|
+
unstake: "unstake",
|
|
40
|
+
unstake_all: "unstake_all",
|
|
41
|
+
withdraw_all_from_staking_pool: "withdraw_all_from_staking_pool",
|
|
42
|
+
withdraw_from_staking_pool: "withdraw_from_staking_pool",
|
|
43
|
+
} as const;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// ===============================================
|
|
2
|
+
// ====== hos_venear_contract_methods_const ======
|
|
3
|
+
export const hos_venear_contract_methods_const = {
|
|
4
|
+
accept_ownership: "accept_ownership",
|
|
5
|
+
contract_source_metadata: "contract_source_metadata",
|
|
6
|
+
delegate_all: "delegate_all",
|
|
7
|
+
deploy_lockup: "deploy_lockup",
|
|
8
|
+
ft_balance_of: "ft_balance_of",
|
|
9
|
+
ft_metadata: "ft_metadata",
|
|
10
|
+
ft_total_supply: "ft_total_supply",
|
|
11
|
+
ft_transfer: "ft_transfer",
|
|
12
|
+
ft_transfer_call: "ft_transfer_call",
|
|
13
|
+
get_account_by_index: "get_account_by_index",
|
|
14
|
+
get_account_info: "get_account_info",
|
|
15
|
+
get_accounts: "get_accounts",
|
|
16
|
+
get_accounts_raw: "get_accounts_raw",
|
|
17
|
+
get_config: "get_config",
|
|
18
|
+
get_lockup_account_id: "get_lockup_account_id",
|
|
19
|
+
get_lockup_deployment_cost: "get_lockup_deployment_cost",
|
|
20
|
+
get_num_accounts: "get_num_accounts",
|
|
21
|
+
get_proof: "get_proof",
|
|
22
|
+
get_snapshot: "get_snapshot",
|
|
23
|
+
get_version: "get_version",
|
|
24
|
+
is_paused: "is_paused",
|
|
25
|
+
migrate_state: "migrate_state",
|
|
26
|
+
new: "new",
|
|
27
|
+
on_lockup_deployed: "on_lockup_deployed",
|
|
28
|
+
on_lockup_update: "on_lockup_update",
|
|
29
|
+
pause: "pause",
|
|
30
|
+
propose_new_owner_account_id: "propose_new_owner_account_id",
|
|
31
|
+
set_guardians: "set_guardians",
|
|
32
|
+
set_local_deposit: "set_local_deposit",
|
|
33
|
+
set_lockup_code_deployers: "set_lockup_code_deployers",
|
|
34
|
+
set_lockup_contract: "set_lockup_contract",
|
|
35
|
+
set_staking_pool_whitelist_account_id: "set_staking_pool_whitelist_account_id",
|
|
36
|
+
set_unlock_duration_sec: "set_unlock_duration_sec",
|
|
37
|
+
storage_balance_bounds: "storage_balance_bounds",
|
|
38
|
+
storage_balance_of: "storage_balance_of",
|
|
39
|
+
storage_deposit: "storage_deposit",
|
|
40
|
+
storage_withdraw: "storage_withdraw",
|
|
41
|
+
undelegate: "undelegate",
|
|
42
|
+
unpause: "unpause",
|
|
43
|
+
} as const;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// ===============================================
|
|
2
|
+
// ====== hos_voting_contract_methods_const ======
|
|
3
|
+
export const hos_voting_contract_methods_const = {
|
|
4
|
+
accept_ownership: "accept_ownership",
|
|
5
|
+
approve_proposal: "approve_proposal",
|
|
6
|
+
contract_source_metadata: "contract_source_metadata",
|
|
7
|
+
create_proposal: "create_proposal",
|
|
8
|
+
get_approved_proposals: "get_approved_proposals",
|
|
9
|
+
get_config: "get_config",
|
|
10
|
+
get_num_approved_proposals: "get_num_approved_proposals",
|
|
11
|
+
get_num_proposals: "get_num_proposals",
|
|
12
|
+
get_proposal: "get_proposal",
|
|
13
|
+
get_proposals: "get_proposals",
|
|
14
|
+
get_version: "get_version",
|
|
15
|
+
get_vote: "get_vote",
|
|
16
|
+
is_paused: "is_paused",
|
|
17
|
+
migrate_state: "migrate_state",
|
|
18
|
+
new: "new",
|
|
19
|
+
on_get_snapshot: "on_get_snapshot",
|
|
20
|
+
pause: "pause",
|
|
21
|
+
propose_new_owner_account_id: "propose_new_owner_account_id",
|
|
22
|
+
reject_proposal: "reject_proposal",
|
|
23
|
+
set_base_proposal_fee: "set_base_proposal_fee",
|
|
24
|
+
set_guardians: "set_guardians",
|
|
25
|
+
set_max_number_of_voting_options: "set_max_number_of_voting_options",
|
|
26
|
+
set_reviewer_ids: "set_reviewer_ids",
|
|
27
|
+
set_venear_account_id: "set_venear_account_id",
|
|
28
|
+
set_voting_duration: "set_voting_duration",
|
|
29
|
+
unpause: "unpause",
|
|
30
|
+
vote: "vote",
|
|
31
|
+
} as const;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// =======================================
|
|
2
|
+
// ===== hos-contracts-methods-const =====
|
|
3
|
+
export { hos_venear_contract_methods_const } from "./hos_venear_contract";
|
|
4
|
+
export { hos_voting_contract_methods_const } from "./hos_voting_contract";
|
|
5
|
+
export { hos_lockup_contract_methods_const } from "./hos_lockup_contract";
|
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
|
+
}
|