@wireio/stake 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.
Files changed (48) hide show
  1. package/LICENSE.md +114 -0
  2. package/README.md +28 -0
  3. package/lib/stake.browser.js +6875 -0
  4. package/lib/stake.browser.js.map +1 -0
  5. package/lib/stake.d.ts +6759 -0
  6. package/lib/stake.js +7178 -0
  7. package/lib/stake.js.map +1 -0
  8. package/lib/stake.m.js +6875 -0
  9. package/lib/stake.m.js.map +1 -0
  10. package/package.json +102 -0
  11. package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.dbg.json +4 -0
  12. package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.json +472 -0
  13. package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.dbg.json +4 -0
  14. package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.json +330 -0
  15. package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.dbg.json +4 -0
  16. package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.json +449 -0
  17. package/src/assets/solana/idl/deposit.json +260 -0
  18. package/src/assets/solana/idl/distribution.json +736 -0
  19. package/src/assets/solana/idl/liq_sol_token.json +275 -0
  20. package/src/assets/solana/idl/stake_controller.json +1788 -0
  21. package/src/assets/solana/idl/stake_registry.json +435 -0
  22. package/src/assets/solana/idl/treasury.json +336 -0
  23. package/src/assets/solana/idl/validator_leaderboard.json +528 -0
  24. package/src/assets/solana/idl/validator_registry.json +418 -0
  25. package/src/assets/solana/idl/yield_oracle.json +32 -0
  26. package/src/assets/solana/types/deposit.ts +266 -0
  27. package/src/assets/solana/types/distribution.ts +742 -0
  28. package/src/assets/solana/types/liq_sol_token.ts +281 -0
  29. package/src/assets/solana/types/stake_controller.ts +1794 -0
  30. package/src/assets/solana/types/stake_registry.ts +441 -0
  31. package/src/assets/solana/types/treasury.ts +342 -0
  32. package/src/assets/solana/types/validator_leaderboard.ts +534 -0
  33. package/src/assets/solana/types/validator_registry.ts +424 -0
  34. package/src/assets/solana/types/yield_oracle.ts +38 -0
  35. package/src/index.ts +21 -0
  36. package/src/networks/ethereum/contract.ts +167 -0
  37. package/src/networks/ethereum/ethereum.ts +64 -0
  38. package/src/networks/ethereum/types.ts +6 -0
  39. package/src/networks/solana/clients/deposit.client.ts +178 -0
  40. package/src/networks/solana/clients/distribution.client.ts +230 -0
  41. package/src/networks/solana/clients/leaderboard.client.ts +179 -0
  42. package/src/networks/solana/constants.ts +73 -0
  43. package/src/networks/solana/program.ts +113 -0
  44. package/src/networks/solana/solana.ts +84 -0
  45. package/src/networks/solana/utils.ts +122 -0
  46. package/src/staker/staker.ts +38 -0
  47. package/src/staker/types.ts +26 -0
  48. package/src/utils.ts +9 -0
package/LICENSE.md ADDED
@@ -0,0 +1,114 @@
1
+ Wire Network
2
+ Copyright (c) 2024 WIRE NETWORK, INC. and its contributors. All Rights Reserved.
3
+ This software is owned and created by Wire Network, but it builds upon:
4
+
5
+ @wharfkit/contract
6
+ Copyright (c) 2023 FFF00 Agents AB & Greymass Inc. All Rights Reserved.
7
+
8
+ ---
9
+
10
+ # Functional Source License, Version 1.1, Apache 2.0 Future License
11
+
12
+ ## Abbreviation
13
+
14
+ FSL-1.1-Apache-2.0
15
+
16
+ ## Notice
17
+
18
+ Copyright 2024 WIRE NETWORK, INC.
19
+
20
+ ## Terms and Conditions
21
+
22
+ ### Licensor ("We")
23
+
24
+ The party offering the Software under these Terms and Conditions.
25
+
26
+ ### The Software
27
+
28
+ The "Software" is each version of the software that we make available under
29
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
30
+ Conditions with the Software.
31
+
32
+ ### License Grant
33
+
34
+ Subject to your compliance with this License Grant and the Patents,
35
+ Redistribution and Trademark clauses below, we hereby grant you the right to
36
+ use, copy, modify, create derivative works, publicly perform, publicly display
37
+ and redistribute the Software for any Permitted Purpose identified below.
38
+
39
+ ### Permitted Purpose
40
+
41
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
42
+ means making the Software available to others in a commercial product or
43
+ service that:
44
+
45
+ 1. substitutes for the Software;
46
+
47
+ 2. substitutes for any other product or service we offer using the Software
48
+ that exists as of the date we make the Software available; or
49
+
50
+ 3. offers the same or substantially similar functionality as the Software.
51
+
52
+ Permitted Purposes specifically include using the Software:
53
+
54
+ 1. for your internal use and access;
55
+
56
+ 2. for non-commercial education;
57
+
58
+ 3. for non-commercial research; and
59
+
60
+ 4. in connection with professional services that you provide to a licensee
61
+ using the Software in accordance with these Terms and Conditions.
62
+
63
+ ### Patents
64
+
65
+ To the extent your use for a Permitted Purpose would necessarily infringe our
66
+ patents, the license grant above includes a license under our patents. If you
67
+ make a claim against any party that the Software infringes or contributes to
68
+ the infringement of any patent, then your patent license to the Software ends
69
+ immediately.
70
+
71
+ ### Redistribution
72
+
73
+ The Terms and Conditions apply to all copies, modifications and derivatives of
74
+ the Software.
75
+
76
+ If you redistribute any copies, modifications or derivatives of the Software,
77
+ you must include a copy of or a link to these Terms and Conditions and not
78
+ remove any copyright notices provided in or with the Software.
79
+
80
+ ### Disclaimer
81
+
82
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
83
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
84
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
85
+
86
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
87
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
88
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
89
+
90
+ ### Trademarks
91
+
92
+ Except for displaying the License Details and identifying us as the origin of
93
+ the Software, you have no right under these Terms and Conditions to use our
94
+ trademarks, trade names, service marks or product names.
95
+
96
+ ## Grant of Future License
97
+
98
+ We hereby irrevocably grant you an additional license to use the Software under
99
+ the Apache License, Version 2.0 that is effective on the second anniversary of
100
+ the date we make the Software available. On or after that date, you may use the
101
+ Software under the Apache License, Version 2.0, in which case the following
102
+ will apply:
103
+
104
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
105
+ this file except in compliance with the License.
106
+
107
+ You may obtain a copy of the License at
108
+
109
+ <http://www.apache.org/licenses/LICENSE-2.0>
110
+
111
+ Unless required by applicable law or agreed to in writing, software distributed
112
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
113
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
114
+ specific language governing permissions and limitations under the License.
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # LIQ Staking Module
2
+
3
+ Library for interacting with the Liquidity Staking System on Wire Network
4
+
5
+ For networks: ETH, SOL, SUI, etc.
6
+
7
+ Features:
8
+
9
+ ## Installation
10
+
11
+ The `@wireio/stake` package is distributed as a module on [npm](https://www.npmjs.com/package/@wireio/stake).
12
+
13
+ ```sh
14
+ npm install @wireio/stake
15
+ # or
16
+ yarn add @wireio/stake
17
+ ```
18
+
19
+ ## Autodocs
20
+
21
+ - [API Documentation](https://Wire-Network.github.io/sdk-stake/)
22
+ - Code Coverage Report - Coming soon
23
+
24
+ ## Developing
25
+
26
+ You need [Make](https://www.gnu.org/software/make/), [node.js](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/en/docs/install) installed.
27
+
28
+ Clone the repository and run `make` to checkout all dependencies and build the project. See the [Makefile](./Makefile) for other useful targets. Before submitting a pull request make sure to run `make lint`.