@bitgo-beta/sdk-coin-trx 1.2.3-alpha.43 → 1.2.3-alpha.430

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 (132) hide show
  1. package/dist/resources/protobuf/Contract.proto +32 -0
  2. package/dist/resources/protobuf/tron.d.ts +1478 -214
  3. package/dist/resources/protobuf/tron.js +6312 -2600
  4. package/dist/resources/protobuf/tron.proto +6 -0
  5. package/dist/src/index.js +6 -2
  6. package/dist/src/lib/constants.d.ts +3 -0
  7. package/dist/src/lib/constants.d.ts.map +1 -0
  8. package/dist/src/lib/constants.js +6 -0
  9. package/dist/src/lib/contractCallBuilder.d.ts +1 -35
  10. package/dist/src/lib/contractCallBuilder.d.ts.map +1 -1
  11. package/dist/src/lib/contractCallBuilder.js +12 -75
  12. package/dist/src/lib/delegateResourceTxBuilder.d.ts +27 -0
  13. package/dist/src/lib/delegateResourceTxBuilder.d.ts.map +1 -0
  14. package/dist/src/lib/delegateResourceTxBuilder.js +98 -0
  15. package/dist/src/lib/enum.d.ts +36 -1
  16. package/dist/src/lib/enum.d.ts.map +1 -1
  17. package/dist/src/lib/enum.js +40 -4
  18. package/dist/src/lib/freezeBalanceTxBuilder.d.ts +71 -0
  19. package/dist/src/lib/freezeBalanceTxBuilder.d.ts.map +1 -0
  20. package/dist/src/lib/freezeBalanceTxBuilder.js +211 -0
  21. package/dist/src/lib/iface.d.ts +220 -2
  22. package/dist/src/lib/iface.d.ts.map +1 -1
  23. package/dist/src/lib/iface.js +1 -1
  24. package/dist/src/lib/index.js +23 -9
  25. package/dist/src/lib/keyPair.d.ts +0 -1
  26. package/dist/src/lib/keyPair.d.ts.map +1 -1
  27. package/dist/src/lib/keyPair.js +31 -18
  28. package/dist/src/lib/resourceManagementTxBuilder.d.ts +72 -0
  29. package/dist/src/lib/resourceManagementTxBuilder.d.ts.map +1 -0
  30. package/dist/src/lib/resourceManagementTxBuilder.js +150 -0
  31. package/dist/src/lib/tokenTransferBuilder.d.ts +1 -1
  32. package/dist/src/lib/tokenTransferBuilder.js +3 -3
  33. package/dist/src/lib/transaction.d.ts.map +1 -1
  34. package/dist/src/lib/transaction.js +92 -6
  35. package/dist/src/lib/transactionBuilder.d.ts +50 -5
  36. package/dist/src/lib/transactionBuilder.d.ts.map +1 -1
  37. package/dist/src/lib/transactionBuilder.js +110 -21
  38. package/dist/src/lib/undelegateResourceTxBuilder.d.ts +27 -0
  39. package/dist/src/lib/undelegateResourceTxBuilder.d.ts.map +1 -0
  40. package/dist/src/lib/undelegateResourceTxBuilder.js +98 -0
  41. package/dist/src/lib/unfreezeBalanceTxBuilder.d.ts +65 -0
  42. package/dist/src/lib/unfreezeBalanceTxBuilder.d.ts.map +1 -0
  43. package/dist/src/lib/unfreezeBalanceTxBuilder.js +204 -0
  44. package/dist/src/lib/utils.d.ts +85 -4
  45. package/dist/src/lib/utils.d.ts.map +1 -1
  46. package/dist/src/lib/utils.js +445 -47
  47. package/dist/src/lib/voteWitnessTxBuilder.d.ts +62 -0
  48. package/dist/src/lib/voteWitnessTxBuilder.d.ts.map +1 -0
  49. package/dist/src/lib/voteWitnessTxBuilder.js +219 -0
  50. package/dist/src/lib/withdrawBuilder.d.ts +49 -0
  51. package/dist/src/lib/withdrawBuilder.d.ts.map +1 -0
  52. package/dist/src/lib/withdrawBuilder.js +167 -0
  53. package/dist/src/lib/withdrawExpireUnfreezeTxBuilder.d.ts +49 -0
  54. package/dist/src/lib/withdrawExpireUnfreezeTxBuilder.d.ts.map +1 -0
  55. package/dist/src/lib/withdrawExpireUnfreezeTxBuilder.js +167 -0
  56. package/dist/src/lib/wrappedBuilder.d.ts +56 -0
  57. package/dist/src/lib/wrappedBuilder.d.ts.map +1 -1
  58. package/dist/src/lib/wrappedBuilder.js +86 -2
  59. package/dist/src/trx.d.ts +78 -4
  60. package/dist/src/trx.d.ts.map +1 -1
  61. package/dist/src/trx.js +436 -147
  62. package/dist/src/trxToken.d.ts +2 -2
  63. package/dist/src/trxToken.d.ts.map +1 -1
  64. package/dist/src/trxToken.js +5 -5
  65. package/dist/test/fixtures.d.ts +40 -0
  66. package/dist/test/fixtures.d.ts.map +1 -0
  67. package/dist/test/fixtures.js +46 -0
  68. package/dist/test/resources.d.ts +586 -0
  69. package/dist/test/resources.d.ts.map +1 -0
  70. package/dist/test/resources.js +746 -0
  71. package/dist/test/unit/index.d.ts +2 -0
  72. package/dist/test/unit/index.d.ts.map +1 -0
  73. package/dist/test/unit/index.js +19 -0
  74. package/dist/test/unit/keyPair.d.ts +2 -0
  75. package/dist/test/unit/keyPair.d.ts.map +1 -0
  76. package/dist/test/unit/keyPair.js +163 -0
  77. package/dist/test/unit/transaction.d.ts +2 -0
  78. package/dist/test/unit/transaction.d.ts.map +1 -0
  79. package/dist/test/unit/transaction.js +38 -0
  80. package/dist/test/unit/transactionBuilder/contractCallBuilder.d.ts +2 -0
  81. package/dist/test/unit/transactionBuilder/contractCallBuilder.d.ts.map +1 -0
  82. package/dist/test/unit/transactionBuilder/contractCallBuilder.js +315 -0
  83. package/dist/test/unit/transactionBuilder/delegateResourceTxBuilder.d.ts +2 -0
  84. package/dist/test/unit/transactionBuilder/delegateResourceTxBuilder.d.ts.map +1 -0
  85. package/dist/test/unit/transactionBuilder/delegateResourceTxBuilder.js +255 -0
  86. package/dist/test/unit/transactionBuilder/freezeBalanceTxBuilder.d.ts +2 -0
  87. package/dist/test/unit/transactionBuilder/freezeBalanceTxBuilder.d.ts.map +1 -0
  88. package/dist/test/unit/transactionBuilder/freezeBalanceTxBuilder.js +285 -0
  89. package/dist/test/unit/transactionBuilder/tokenTransferBuilder.d.ts +2 -0
  90. package/dist/test/unit/transactionBuilder/tokenTransferBuilder.d.ts.map +1 -0
  91. package/dist/test/unit/transactionBuilder/tokenTransferBuilder.js +42 -0
  92. package/dist/test/unit/transactionBuilder/undelegateResourceTxBuilder.d.ts +2 -0
  93. package/dist/test/unit/transactionBuilder/undelegateResourceTxBuilder.d.ts.map +1 -0
  94. package/dist/test/unit/transactionBuilder/undelegateResourceTxBuilder.js +255 -0
  95. package/dist/test/unit/transactionBuilder/unfreezeBalanceTxBuilder.d.ts +2 -0
  96. package/dist/test/unit/transactionBuilder/unfreezeBalanceTxBuilder.d.ts.map +1 -0
  97. package/dist/test/unit/transactionBuilder/unfreezeBalanceTxBuilder.js +256 -0
  98. package/dist/test/unit/transactionBuilder/voteWitnessTxBuilder.d.ts +2 -0
  99. package/dist/test/unit/transactionBuilder/voteWitnessTxBuilder.d.ts.map +1 -0
  100. package/dist/test/unit/transactionBuilder/voteWitnessTxBuilder.js +277 -0
  101. package/dist/test/unit/transactionBuilder/withdrawBalanceBuilder.d.ts +2 -0
  102. package/dist/test/unit/transactionBuilder/withdrawBalanceBuilder.d.ts.map +1 -0
  103. package/dist/test/unit/transactionBuilder/withdrawBalanceBuilder.js +213 -0
  104. package/dist/test/unit/transactionBuilder/withdrawExpireUnfreezeTxBuilder.d.ts +2 -0
  105. package/dist/test/unit/transactionBuilder/withdrawExpireUnfreezeTxBuilder.d.ts.map +1 -0
  106. package/dist/test/unit/transactionBuilder/withdrawExpireUnfreezeTxBuilder.js +213 -0
  107. package/dist/test/unit/transactionBuilder/wrappedBuilder.d.ts +2 -0
  108. package/dist/test/unit/transactionBuilder/wrappedBuilder.d.ts.map +1 -0
  109. package/dist/test/unit/transactionBuilder/wrappedBuilder.js +50 -0
  110. package/dist/test/unit/transactionBuilder.d.ts +2 -0
  111. package/dist/test/unit/transactionBuilder.d.ts.map +1 -0
  112. package/dist/test/unit/transactionBuilder.js +178 -0
  113. package/dist/test/unit/trx.d.ts +2 -0
  114. package/dist/test/unit/trx.d.ts.map +1 -0
  115. package/dist/test/unit/trx.js +639 -0
  116. package/dist/test/unit/util.d.ts +2 -0
  117. package/dist/test/unit/util.d.ts.map +1 -0
  118. package/dist/test/unit/util.js +141 -0
  119. package/dist/test/unit/verifyTransaction.d.ts +2 -0
  120. package/dist/test/unit/verifyTransaction.d.ts.map +1 -0
  121. package/dist/test/unit/verifyTransaction.js +378 -0
  122. package/dist/tsconfig.tsbuildinfo +1 -0
  123. package/package.json +20 -15
  124. package/.eslintignore +0 -5
  125. package/.mocharc.yml +0 -8
  126. package/CHANGELOG.md +0 -118
  127. package/resources/README.md +0 -31
  128. package/resources/protobuf/Contract.proto +0 -256
  129. package/resources/protobuf/Discover.proto +0 -44
  130. package/resources/protobuf/tron.d.ts +0 -11205
  131. package/resources/protobuf/tron.js +0 -33480
  132. package/resources/protobuf/tron.proto +0 -677
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitgo-beta/sdk-coin-trx",
3
- "version": "1.2.3-alpha.43",
3
+ "version": "1.2.3-alpha.430",
4
4
  "description": "BitGo SDK coin library for Tron",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
@@ -8,20 +8,20 @@
8
8
  "build": "npm run prepare",
9
9
  "build-ts": "yarn tsc --build --incremental --verbose .",
10
10
  "fmt": "prettier --write .",
11
- "check-fmt": "prettier --check .",
11
+ "check-fmt": "prettier --check '**/*.{ts,js,json}'",
12
12
  "clean": "rm -r ./dist",
13
13
  "lint": "eslint --quiet .",
14
- "prepare": "npm run build-ts && cp -r ./resources ./dist",
14
+ "prepare": "npm run build-ts && shx cp -r ./resources ./dist",
15
15
  "test": "npm run coverage",
16
16
  "coverage": "nyc -- npm run unit-test",
17
- "unit-test": "mocha",
17
+ "unit-test": "yarn run build && node --test dist/test/**/*.js",
18
18
  "gen-protobuf": "pbjs -t static-module -w commonjs -o ./resources/protobuf/tron.js ./resources/protobuf/Discover.proto ./resources/protobuf/Contract.proto ./resources/protobuf/tron.proto",
19
19
  "gen-protobufts": "pbts -o ./resources/protobuf/tron.d.ts ./resources/protobuf/tron.js"
20
20
  },
21
21
  "author": "BitGo SDK Team <sdkteam@bitgo.com>",
22
22
  "license": "MIT",
23
23
  "engines": {
24
- "node": ">=14 <17"
24
+ "node": ">=20 <23"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
@@ -46,21 +46,26 @@
46
46
  ]
47
47
  },
48
48
  "dependencies": {
49
- "@bitgo-beta/sdk-core": "2.4.1-alpha.43",
50
- "@bitgo-beta/statics": "10.0.1-alpha.43",
51
- "@bitgo-beta/utxo-lib": "4.0.1-alpha.43",
49
+ "@bitgo-beta/sdk-core": "2.4.1-alpha.433",
50
+ "@bitgo-beta/secp256k1": "1.0.1-alpha.391",
51
+ "@bitgo-beta/statics": "10.0.1-alpha.433",
52
52
  "@stablelib/hex": "^1.0.0",
53
53
  "bignumber.js": "^9.0.0",
54
54
  "ethers": "^5.7.2",
55
55
  "lodash": "^4.17.14",
56
- "protobufjs": "^6.8.9",
57
- "secp256k1": "^4.0.2",
58
- "superagent": "^3.8.3",
59
- "tronweb": "^5.0.0"
56
+ "long": "^5.3.2",
57
+ "protobufjs": "7.2.5",
58
+ "secp256k1": "5.0.1",
59
+ "superagent": "^9.0.1",
60
+ "tronweb": "5.1.0"
60
61
  },
61
62
  "devDependencies": {
62
- "@bitgo-beta/sdk-api": "1.6.1-alpha.43",
63
- "@bitgo-beta/sdk-test": "^1.2.18"
63
+ "@bitgo-beta/sdk-api": "1.6.1-alpha.433",
64
+ "@bitgo-beta/sdk-test": "^9.1.19",
65
+ "shx": "^0.3.4"
64
66
  },
65
- "gitHead": "da47c2ed7125c9c0e4a059ddede378f4628cd195"
67
+ "gitHead": "7835e2e18a44b657528177d045e43a6f1b54dbcd",
68
+ "files": [
69
+ "dist"
70
+ ]
66
71
  }
package/.eslintignore DELETED
@@ -1,5 +0,0 @@
1
- node_modules
2
- .idea
3
- public
4
- dist
5
- resources
package/.mocharc.yml DELETED
@@ -1,8 +0,0 @@
1
- require: 'ts-node/register'
2
- timeout: '60000'
3
- reporter: 'min'
4
- reporter-option:
5
- - 'cdn=true'
6
- - 'json=false'
7
- exit: true
8
- spec: ['test/unit/**/*.ts']
package/CHANGELOG.md DELETED
@@ -1,118 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [1.7.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.7.1...@bitgo/sdk-coin-trx@1.7.2) (2023-04-25)
7
-
8
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
9
-
10
- ## [1.7.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.7.0...@bitgo/sdk-coin-trx@1.7.1) (2023-04-20)
11
-
12
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
13
-
14
- # [1.7.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.6.4...@bitgo/sdk-coin-trx@1.7.0) (2023-04-13)
15
-
16
- ### Features
17
-
18
- - **sdk-coin-trx:** add tokens to tron recovery method ([1aec210](https://github.com/BitGo/BitGoJS/commit/1aec2109bbd52a5c77d9df529ec73184c9babc85))
19
-
20
- ## [1.6.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.6.3...@bitgo/sdk-coin-trx@1.6.4) (2023-02-17)
21
-
22
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
23
-
24
- ## [1.6.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.6.0...@bitgo/sdk-coin-trx@1.6.3) (2023-02-16)
25
-
26
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
27
-
28
- ## [1.6.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.6.0...@bitgo/sdk-coin-trx@1.6.2) (2023-02-08)
29
-
30
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
31
-
32
- ## [1.6.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.6.0...@bitgo/sdk-coin-trx@1.6.1) (2023-01-30)
33
-
34
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
35
-
36
- # [1.6.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.5.0...@bitgo/sdk-coin-trx@1.6.0) (2023-01-25)
37
-
38
- ### Features
39
-
40
- - **sdk-coin-trx:** fix verifyTransaction method for trx tokens ([ef3d641](https://github.com/BitGo/BitGoJS/commit/ef3d641987285b3bfc7ff5a3765479de980bad2f))
41
-
42
- # [1.5.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.4.0...@bitgo/sdk-coin-trx@1.5.0) (2022-12-23)
43
-
44
- ### Bug Fixes
45
-
46
- - resolve security audit for jsonwebtoken ([ed06bde](https://github.com/BitGo/BitGoJS/commit/ed06bdef907a4e59c4fdc4a6f4be99930c215dd3))
47
-
48
- ### Features
49
-
50
- - **sdk-coin-trx:** support signing trx consolidations ([54fc2b0](https://github.com/BitGo/BitGoJS/commit/54fc2b064b5086a9d6dac98eca30ffa2222f5c29))
51
-
52
- # [1.4.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.3.3...@bitgo/sdk-coin-trx@1.4.0) (2022-12-20)
53
-
54
- ### Features
55
-
56
- - **sdk-coin-trx:** add tron tokens in verifyTransaction method ([06c8592](https://github.com/BitGo/BitGoJS/commit/06c85923af1bd00bc841fa9f825954806c643b4e))
57
- - **sdk-coin-trx:** add trx token transaction builder ([7358905](https://github.com/BitGo/BitGoJS/commit/7358905d1197d4d65e44d2e1b4d992b267097999))
58
- - **sdk-coin-trx:** export trx token transaction builder ([2869c69](https://github.com/BitGo/BitGoJS/commit/2869c69a2aa1e6fd8616c86182b9e158ec34252d))
59
-
60
- ## [1.3.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.3.2...@bitgo/sdk-coin-trx@1.3.3) (2022-12-09)
61
-
62
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
63
-
64
- ## [1.3.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.3.1...@bitgo/sdk-coin-trx@1.3.2) (2022-12-06)
65
-
66
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
67
-
68
- ## [1.3.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.3.0...@bitgo/sdk-coin-trx@1.3.1) (2022-12-01)
69
-
70
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
71
-
72
- # [1.3.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.2.0...@bitgo/sdk-coin-trx@1.3.0) (2022-11-29)
73
-
74
- ### Features
75
-
76
- - **sdk-coin-trx:** add tron token skeleton ([03198b0](https://github.com/BitGo/BitGoJS/commit/03198b0e23e6c87ce2d34d08973abca301f88252))
77
-
78
- ## [1.2.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.2.0...@bitgo/sdk-coin-trx@1.2.4) (2022-11-04)
79
-
80
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
81
-
82
- ## [1.2.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.2.0...@bitgo/sdk-coin-trx@1.2.2) (2022-10-27)
83
-
84
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
85
-
86
- ## [1.2.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.2.0...@bitgo/sdk-coin-trx@1.2.1) (2022-10-25)
87
-
88
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
89
-
90
- # [1.2.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.0.1-rc.5...@bitgo/sdk-coin-trx@1.2.0) (2022-10-18)
91
-
92
- ### Bug Fixes
93
-
94
- - **core:** fix bip32/ecpair, API vs Interface ([bec9c1e](https://github.com/BitGo/BitGoJS/commit/bec9c1e6ff0c23108dc27e171abdd3e4d2cfdfb1))
95
-
96
- ## [1.0.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.0.1-rc.5...@bitgo/sdk-coin-trx@1.0.1) (2022-07-19)
97
-
98
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
99
-
100
- ## [1.0.1-rc.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.0.1-rc.3...@bitgo/sdk-coin-trx@1.0.1-rc.5) (2022-07-19)
101
-
102
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
103
-
104
- ## [1.0.1-rc.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.0.1-rc.3...@bitgo/sdk-coin-trx@1.0.1-rc.4) (2022-07-18)
105
-
106
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
107
-
108
- ## [1.0.1-rc.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.0.1-rc.2...@bitgo/sdk-coin-trx@1.0.1-rc.3) (2022-07-15)
109
-
110
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
111
-
112
- ## [1.0.1-rc.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.0.1-rc.0...@bitgo/sdk-coin-trx@1.0.1-rc.2) (2022-07-15)
113
-
114
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
115
-
116
- ## [1.0.1-rc.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-trx@1.0.1-rc.0...@bitgo/sdk-coin-trx@1.0.1-rc.1) (2022-07-14)
117
-
118
- **Note:** Version bump only for package @bitgo/sdk-coin-trx
@@ -1,31 +0,0 @@
1
- # Resources
2
-
3
- This directory contains external logic required to handle signing/validation/address derivation for
4
- a specific coin.
5
-
6
- Typically, this manifests as a smaller snippet of code from a larger codebase, of which, this
7
- library only requires a small portion of.
8
-
9
- ---
10
-
11
- ## TRX Resources
12
-
13
- Tron uses [protocol buffers (protobufs)](https://developers.google.com/protocol-buffers). Instead of
14
- pulling a bunch of non-relevant Tron full node code into this library as a dependency, we grab
15
- exactly what we need and add it in `resources/`.
16
-
17
- ### Generating protobufs for Tron
18
-
19
- Static code for Tron protobufs is already included. Generating at build time can be problematic, until
20
- [this issue](https://github.com/protobufjs/protobuf.js/issues/1477) is resolved. Should we ever need to
21
- update the static code, the following commands can be run:
22
-
23
- ```bash
24
- npm run gen-protobuf
25
- ```
26
-
27
- To generate the respective TypeScript definitions:
28
-
29
- ```bash
30
- npm run gen-protobufts
31
- ```
@@ -1,256 +0,0 @@
1
- /*
2
- * java-tron is free software: you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License as published by
4
- * the Free Software Foundation, either version 3 of the License, or
5
- * (at your option) any later version.
6
- *
7
- * java-tron is distributed in the hope that it will be useful,
8
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
- * GNU General Public License for more details.
11
- *
12
- * You should have received a copy of the GNU General Public License
13
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
- */
15
-
16
- syntax = "proto3";
17
-
18
- package protocol;
19
-
20
- option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file
21
- option java_outer_classname = "Contract"; //Specify the class name of the generated Java file
22
- option go_package = "github.com/tronprotocol/grpc-gateway/core";
23
-
24
- import "tron.proto";
25
-
26
- message AccountCreateContract {
27
- bytes owner_address = 1;
28
- bytes account_address = 2;
29
- AccountType type = 3;
30
- }
31
-
32
- // Update account name. Account name is not unique now.
33
- message AccountUpdateContract {
34
- bytes account_name = 1;
35
- bytes owner_address = 2;
36
- }
37
-
38
- // Set account id if the account has no id. Account id is unique and case insensitive.
39
- message SetAccountIdContract {
40
- bytes account_id = 1;
41
- bytes owner_address = 2;
42
- }
43
-
44
- message TransferContract {
45
- bytes owner_address = 1;
46
- bytes to_address = 2;
47
- int64 amount = 3;
48
- }
49
-
50
- message TransferAssetContract {
51
- bytes asset_name = 1; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format.
52
- bytes owner_address = 2;
53
- bytes to_address = 3;
54
- int64 amount = 4;
55
- }
56
-
57
-
58
- message VoteAssetContract {
59
- bytes owner_address = 1;
60
- repeated bytes vote_address = 2;
61
- bool support = 3;
62
- int32 count = 5;
63
- }
64
-
65
- message VoteWitnessContract {
66
- message Vote {
67
- bytes vote_address = 1;
68
- int64 vote_count = 2;
69
- }
70
- bytes owner_address = 1;
71
- repeated Vote votes = 2;
72
- bool support = 3;
73
- }
74
-
75
- message UpdateSettingContract {
76
- bytes owner_address = 1;
77
- bytes contract_address = 2;
78
- int64 consume_user_resource_percent = 3;
79
- }
80
-
81
- message UpdateEnergyLimitContract {
82
- bytes owner_address = 1;
83
- bytes contract_address = 2;
84
- int64 origin_energy_limit = 3;
85
- }
86
-
87
- message ClearABIContract {
88
- bytes owner_address = 1;
89
- bytes contract_address = 2;
90
- }
91
-
92
- message WitnessCreateContract {
93
- bytes owner_address = 1;
94
- bytes url = 2;
95
- }
96
-
97
- message WitnessUpdateContract {
98
- bytes owner_address = 1;
99
- bytes update_url = 12;
100
- }
101
-
102
- message AssetIssueContract {
103
- string id = 41;
104
-
105
- message FrozenSupply {
106
- int64 frozen_amount = 1;
107
- int64 frozen_days = 2;
108
- }
109
- bytes owner_address = 1;
110
- bytes name = 2;
111
- bytes abbr = 3;
112
- int64 total_supply = 4;
113
- repeated FrozenSupply frozen_supply = 5;
114
- int32 trx_num = 6;
115
- int32 precision = 7;
116
- int32 num = 8;
117
- int64 start_time = 9;
118
- int64 end_time = 10;
119
- int64 order = 11; // useless
120
- int32 vote_score = 16;
121
- bytes description = 20;
122
- bytes url = 21;
123
- int64 free_asset_net_limit = 22;
124
- int64 public_free_asset_net_limit = 23;
125
- int64 public_free_asset_net_usage = 24;
126
- int64 public_latest_free_net_time = 25;
127
- }
128
-
129
- message ParticipateAssetIssueContract {
130
- bytes owner_address = 1;
131
- bytes to_address = 2;
132
- bytes asset_name = 3; // this field is token name before the proposal ALLOW_SAME_TOKEN_NAME is active, otherwise it is token id and token is should be in string format.
133
- int64 amount = 4; // the amount of drops
134
- }
135
-
136
-
137
- enum ResourceCode {
138
- BANDWIDTH = 0x00;
139
- ENERGY = 0x01;
140
- }
141
-
142
- message FreezeBalanceContract {
143
- bytes owner_address = 1;
144
- int64 frozen_balance = 2;
145
- int64 frozen_duration = 3;
146
-
147
- ResourceCode resource = 10;
148
- bytes receiver_address = 15;
149
- }
150
-
151
- message UnfreezeBalanceContract {
152
- bytes owner_address = 1;
153
-
154
- ResourceCode resource = 10;
155
- bytes receiver_address = 15;
156
- }
157
-
158
- message UnfreezeAssetContract {
159
- bytes owner_address = 1;
160
- }
161
-
162
- message WithdrawBalanceContract {
163
- bytes owner_address = 1;
164
- }
165
-
166
- message UpdateAssetContract {
167
- bytes owner_address = 1;
168
- bytes description = 2;
169
- bytes url = 3;
170
- int64 new_limit = 4;
171
- int64 new_public_limit = 5;
172
- }
173
-
174
- message ProposalCreateContract {
175
- bytes owner_address = 1;
176
- map<int64, int64> parameters = 2;
177
- }
178
-
179
- message ProposalApproveContract {
180
- bytes owner_address = 1;
181
- int64 proposal_id = 2;
182
- bool is_add_approval = 3; // add or remove approval
183
- }
184
-
185
- message ProposalDeleteContract {
186
- bytes owner_address = 1;
187
- int64 proposal_id = 2;
188
- }
189
-
190
- message CreateSmartContract {
191
- bytes owner_address = 1;
192
- SmartContract new_contract = 2;
193
- int64 call_token_value = 3;
194
- int64 token_id = 4;
195
- }
196
-
197
- message TriggerSmartContract {
198
- bytes owner_address = 1;
199
- bytes contract_address = 2;
200
- int64 call_value = 3;
201
- bytes data = 4;
202
- int64 call_token_value = 5;
203
- int64 token_id = 6;
204
- }
205
-
206
- message BuyStorageContract {
207
- bytes owner_address = 1;
208
- int64 quant = 2; // trx quantity for buy storage (sun)
209
- }
210
-
211
- message BuyStorageBytesContract {
212
- bytes owner_address = 1;
213
- int64 bytes = 2; // storage bytes for buy
214
- }
215
-
216
- message SellStorageContract {
217
- bytes owner_address = 1;
218
- int64 storage_bytes = 2;
219
- }
220
-
221
- message ExchangeCreateContract {
222
- bytes owner_address = 1;
223
- bytes first_token_id = 2;
224
- int64 first_token_balance = 3;
225
- bytes second_token_id = 4;
226
- int64 second_token_balance = 5;
227
- }
228
-
229
- message ExchangeInjectContract {
230
- bytes owner_address = 1;
231
- int64 exchange_id = 2;
232
- bytes token_id = 3;
233
- int64 quant = 4;
234
- }
235
-
236
- message ExchangeWithdrawContract {
237
- bytes owner_address = 1;
238
- int64 exchange_id = 2;
239
- bytes token_id = 3;
240
- int64 quant = 4;
241
- }
242
-
243
- message ExchangeTransactionContract {
244
- bytes owner_address = 1;
245
- int64 exchange_id = 2;
246
- bytes token_id = 3;
247
- int64 quant = 4;
248
- int64 expected = 5;
249
- }
250
-
251
- message AccountPermissionUpdateContract {
252
- bytes owner_address = 1;
253
- Permission owner = 2; //Empty is invalidate
254
- Permission witness = 3;//Can be empty
255
- repeated Permission actives = 4;//Empty is invalidate
256
- }
@@ -1,44 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package protocol;
4
-
5
-
6
- option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file
7
- option java_outer_classname = "Discover"; //Specify the class name of the generated Java file
8
- option go_package = "github.com/tronprotocol/grpc-gateway/core";
9
-
10
- message Endpoint {
11
- bytes address = 1;
12
- int32 port = 2;
13
- bytes nodeId = 3;
14
- }
15
-
16
- message PingMessage {
17
- Endpoint from = 1;
18
- Endpoint to = 2;
19
- int32 version = 3;
20
- int64 timestamp = 4;
21
- }
22
-
23
- message PongMessage {
24
- Endpoint from = 1;
25
- int32 echo = 2;
26
- int64 timestamp = 3;
27
- }
28
-
29
- message FindNeighbours {
30
- Endpoint from = 1;
31
- bytes targetId = 2;
32
- int64 timestamp = 3;
33
- }
34
-
35
- message Neighbours {
36
- Endpoint from = 1;
37
- repeated Endpoint neighbours = 2;
38
- int64 timestamp = 3;
39
- }
40
-
41
- message BackupMessage {
42
- bool flag = 1;
43
- int32 priority = 2;
44
- }