@rango-dev/signer-tron 0.0.0-experimental-214d73c7-20260922
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/CHANGELOG.md +153 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +7 -0
- package/dist/signer.d.ts +13 -0
- package/dist/signer.d.ts.map +1 -0
- package/package.json +30 -0
- package/readme.md +3 -0
- package/src/index.ts +1 -0
- package/src/signer.ts +58 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# [0.43.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.42.0...signer-tron@0.43.0) (2026-09-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* ship dist and changelog when publishing with npm ([0a8bd5d](https://github.com/rango-exchange/rango-client/commit/0a8bd5d779bd652b6ca7195cda4ce465ba196f0e))
|
|
7
|
+
# [0.42.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.41.0...signer-tron@0.42.0) (2026-08-18)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# [0.41.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.40.1...signer-tron@0.41.0) (2026-05-31)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [0.40.1](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.40.0...signer-tron@0.40.1) (2026-05-02)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# [0.40.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.39.0...signer-tron@0.40.0) (2026-04-29)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# [0.39.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.38.0...signer-tron@0.39.0) (2025-08-19)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# [0.38.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.37.0...signer-tron@0.38.0) (2025-08-05)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# [0.37.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.36.0...signer-tron@0.37.0) (2025-07-22)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Reverts
|
|
35
|
+
|
|
36
|
+
* Revert "chore(release): publish" ([064ce15](https://github.com/rango-exchange/rango-client/commit/064ce157a2f819856f647f83aeb1c0410542e8d7))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# [0.35.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.34.0...signer-tron@0.35.0) (2025-06-09)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# [0.34.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.33.0...signer-tron@0.34.0) (2025-04-30)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* rename pbt to ptb for sui ([3d6d89f](https://github.com/rango-exchange/rango-client/commit/3d6d89f2265766607a15d61e0df92643fb33072b))
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* update sui to consider recent api changes ([d764b25](https://github.com/rango-exchange/rango-client/commit/d764b2501df9bb295f63cdbc0b05acd4a3abb4b9))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# [0.33.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.32.0...signer-tron@0.33.0) (2025-03-11)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# [0.32.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.31.0...signer-tron@0.32.0) (2025-02-23)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# [0.31.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.30.0...signer-tron@0.31.0) (2024-11-12)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# [0.30.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.29.0...signer-tron@0.30.0) (2024-10-12)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
* bump sdk and fix type issues ([d442208](https://github.com/rango-exchange/rango-client/commit/d4422083bf5dd27d5f509ce1db7f9560d05428c8))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
# [0.29.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.28.0...signer-tron@0.29.0) (2024-09-10)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# [0.28.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.27.0...signer-tron@0.28.0) (2024-08-11)
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Features
|
|
87
|
+
|
|
88
|
+
* implement sign message method for providers with a custom signer ([cf9515f](https://github.com/rango-exchange/rango-client/commit/cf9515feb5d3754aac9c228fe83315daf1350c85))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# [0.27.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.26.0...signer-tron@0.27.0) (2024-07-09)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# [0.26.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.25.0...signer-tron@0.26.0) (2024-02-20)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# [0.25.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.23.0...signer-tron@0.25.0) (2023-12-24)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Bug Fixes
|
|
104
|
+
|
|
105
|
+
* fix HMR for widget and playground ([8524820](https://github.com/rango-exchange/rango-client/commit/8524820f10cf0b8921f3db0c4f620ff98daa4103))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# [0.14.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.13.0...signer-tron@0.14.0) (2023-08-03)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# [0.13.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.12.0...signer-tron@0.13.0) (2023-08-01)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# [0.9.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.8.0...signer-tron@0.9.0) (2023-07-31)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
# [0.7.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.6.0...signer-tron@0.7.0) (2023-07-11)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# [0.6.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.5.0...signer-tron@0.6.0) (2023-07-11)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
# [0.5.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.4.0...signer-tron@0.5.0) (2023-05-31)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
# [0.4.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.3.0...signer-tron@0.4.0) (2023-05-31)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# [0.3.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.2.0...signer-tron@0.3.0) (2023-05-30)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
# [0.2.0](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.1.14...signer-tron@0.2.0) (2023-05-30)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## [0.1.13](https://github.com/rango-exchange/rango-client/compare/signer-tron@0.1.12...signer-tron@0.1.13) (2023-05-15)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### Bug Fixes
|
|
149
|
+
|
|
150
|
+
* update rango-types and fix notification bugs ([993f185](https://github.com/rango-exchange/rango-client/commit/993f185e0b8c5e5e15a2c65ba2d85d1f9c8daa90))
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var d=Object.defineProperty;var t=(a,r)=>d(a,"name",{value:r,configurable:!0});import{SignerError as n,SignerErrorCode as s}from"rango-types";var i=class a{static{t(this,"DefaultTronSigner")}provider;constructor(r){this.provider=r}static buildTx(r){let e={};return r.txID&&(e={...e,txID:r.txID}),r.visible!==void 0&&(e={...e,visible:r.visible}),r.__payload__&&(e={...e,__payload__:r.__payload__}),r.raw_data&&(e={...e,raw_data:r.raw_data}),r.raw_data_hex&&(e={...e,raw_data_hex:r.raw_data_hex}),e}async signMessage(r){try{return await this.provider.tronWeb.trx.signMessageV2(r)}catch(e){throw new n(s.SIGN_TX_ERROR,void 0,e)}}async signAndSendTx(r){try{let e=a.buildTx(r),o=await this.provider.tronWeb.trx.sign(e);return{hash:(await this.provider.tronWeb.trx.sendRawTransaction(o))?.transaction?.txID}}catch(e){throw new n(s.SEND_TX_ERROR,void 0,e)}}};export{i as DefaultTronSigner};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/signer.ts"],
|
|
4
|
+
"sourcesContent": ["import type { GenericSigner, TronTransaction } from 'rango-types';\n\nimport { SignerError, SignerErrorCode } from 'rango-types';\n\n/*\n * TODO - replace with real type\n * tslint:disable-next-line: no-any\n */\ntype TronExternalProvider = any;\n\nexport class DefaultTronSigner implements GenericSigner<TronTransaction> {\n private provider: TronExternalProvider;\n\n constructor(provider: TronExternalProvider) {\n this.provider = provider;\n }\n\n static buildTx(tronTx: TronTransaction) {\n let tx = {};\n if (!!tronTx.txID) {\n tx = { ...tx, txID: tronTx.txID };\n }\n if (tronTx.visible !== undefined) {\n tx = { ...tx, visible: tronTx.visible };\n }\n if (!!tronTx.__payload__) {\n tx = { ...tx, __payload__: tronTx.__payload__ };\n }\n if (!!tronTx.raw_data) {\n tx = { ...tx, raw_data: tronTx.raw_data };\n }\n if (!!tronTx.raw_data_hex) {\n tx = { ...tx, raw_data_hex: tronTx.raw_data_hex };\n }\n return tx;\n }\n async signMessage(msg: string): Promise<string> {\n try {\n return await this.provider.tronWeb.trx.signMessageV2(msg);\n } catch (error) {\n throw new SignerError(SignerErrorCode.SIGN_TX_ERROR, undefined, error);\n }\n }\n\n async signAndSendTx(tx: TronTransaction): Promise<{ hash: string }> {\n try {\n const transaction = DefaultTronSigner.buildTx(tx);\n const signedTxn = await this.provider.tronWeb.trx.sign(transaction);\n const receipt = await this.provider.tronWeb.trx.sendRawTransaction(\n signedTxn\n );\n const hash = receipt?.transaction?.txID;\n return { hash };\n } catch (error) {\n throw new SignerError(SignerErrorCode.SEND_TX_ERROR, undefined, error);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "+EAEA,OAAS,eAAAA,EAAa,mBAAAC,MAAuB,cAQtC,IAAMC,EAAN,MAAMC,CAA4D,CAVzE,MAUyE,CAAAC,EAAA,0BAC/D,SAER,YAAYC,EAAgC,CAC1C,KAAK,SAAWA,CAClB,CAEA,OAAO,QAAQC,EAAyB,CACtC,IAAIC,EAAK,CAAC,EACV,OAAMD,EAAO,OACXC,EAAK,CAAE,GAAGA,EAAI,KAAMD,EAAO,IAAK,GAE9BA,EAAO,UAAY,SACrBC,EAAK,CAAE,GAAGA,EAAI,QAASD,EAAO,OAAQ,GAElCA,EAAO,cACXC,EAAK,CAAE,GAAGA,EAAI,YAAaD,EAAO,WAAY,GAE1CA,EAAO,WACXC,EAAK,CAAE,GAAGA,EAAI,SAAUD,EAAO,QAAS,GAEpCA,EAAO,eACXC,EAAK,CAAE,GAAGA,EAAI,aAAcD,EAAO,YAAa,GAE3CC,CACT,CACA,MAAM,YAAYC,EAA8B,CAC9C,GAAI,CACF,OAAO,MAAM,KAAK,SAAS,QAAQ,IAAI,cAAcA,CAAG,CAC1D,OAASC,EAAO,CACd,MAAM,IAAIC,EAAYC,EAAgB,cAAe,OAAWF,CAAK,CACvE,CACF,CAEA,MAAM,cAAcF,EAAgD,CAClE,GAAI,CACF,IAAMK,EAAcT,EAAkB,QAAQI,CAAE,EAC1CM,EAAY,MAAM,KAAK,SAAS,QAAQ,IAAI,KAAKD,CAAW,EAKlE,MAAO,CAAE,MAJO,MAAM,KAAK,SAAS,QAAQ,IAAI,mBAC9CC,CACF,IACsB,aAAa,IACrB,CAChB,OAASJ,EAAO,CACd,MAAM,IAAIC,EAAYC,EAAgB,cAAe,OAAWF,CAAK,CACvE,CACF,CACF",
|
|
6
|
+
"names": ["SignerError", "SignerErrorCode", "DefaultTronSigner", "_DefaultTronSigner", "__name", "provider", "tronTx", "tx", "msg", "error", "SignerError", "SignerErrorCode", "transaction", "signedTxn"]
|
|
7
|
+
}
|
package/dist/signer.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GenericSigner, TronTransaction } from 'rango-types';
|
|
2
|
+
type TronExternalProvider = any;
|
|
3
|
+
export declare class DefaultTronSigner implements GenericSigner<TronTransaction> {
|
|
4
|
+
private provider;
|
|
5
|
+
constructor(provider: TronExternalProvider);
|
|
6
|
+
static buildTx(tronTx: TronTransaction): {};
|
|
7
|
+
signMessage(msg: string): Promise<string>;
|
|
8
|
+
signAndSendTx(tx: TronTransaction): Promise<{
|
|
9
|
+
hash: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQlE,KAAK,oBAAoB,GAAG,GAAG,CAAC;AAEhC,qBAAa,iBAAkB,YAAW,aAAa,CAAC,eAAe,CAAC;IACtE,OAAO,CAAC,QAAQ,CAAuB;gBAE3B,QAAQ,EAAE,oBAAoB;IAI1C,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe;IAmBhC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQzC,aAAa,CAAC,EAAE,EAAE,eAAe,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAapE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rango-dev/signer-tron",
|
|
3
|
+
"version": "0.0.0-experimental-214d73c7-20260922",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"source": "./src/index.ts",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"typings": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"src",
|
|
15
|
+
"CHANGELOG.md"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "yarn run rangutopia library build",
|
|
19
|
+
"ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json",
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
|
|
22
|
+
"lint": "eslint \"**/*.{ts,tsx}\""
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"rango-types": "0.0.0-experimental-009f8a4d-20260921"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/readme.md
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DefaultTronSigner } from './signer.js';
|
package/src/signer.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { GenericSigner, TronTransaction } from 'rango-types';
|
|
2
|
+
|
|
3
|
+
import { SignerError, SignerErrorCode } from 'rango-types';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* TODO - replace with real type
|
|
7
|
+
* tslint:disable-next-line: no-any
|
|
8
|
+
*/
|
|
9
|
+
type TronExternalProvider = any;
|
|
10
|
+
|
|
11
|
+
export class DefaultTronSigner implements GenericSigner<TronTransaction> {
|
|
12
|
+
private provider: TronExternalProvider;
|
|
13
|
+
|
|
14
|
+
constructor(provider: TronExternalProvider) {
|
|
15
|
+
this.provider = provider;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static buildTx(tronTx: TronTransaction) {
|
|
19
|
+
let tx = {};
|
|
20
|
+
if (!!tronTx.txID) {
|
|
21
|
+
tx = { ...tx, txID: tronTx.txID };
|
|
22
|
+
}
|
|
23
|
+
if (tronTx.visible !== undefined) {
|
|
24
|
+
tx = { ...tx, visible: tronTx.visible };
|
|
25
|
+
}
|
|
26
|
+
if (!!tronTx.__payload__) {
|
|
27
|
+
tx = { ...tx, __payload__: tronTx.__payload__ };
|
|
28
|
+
}
|
|
29
|
+
if (!!tronTx.raw_data) {
|
|
30
|
+
tx = { ...tx, raw_data: tronTx.raw_data };
|
|
31
|
+
}
|
|
32
|
+
if (!!tronTx.raw_data_hex) {
|
|
33
|
+
tx = { ...tx, raw_data_hex: tronTx.raw_data_hex };
|
|
34
|
+
}
|
|
35
|
+
return tx;
|
|
36
|
+
}
|
|
37
|
+
async signMessage(msg: string): Promise<string> {
|
|
38
|
+
try {
|
|
39
|
+
return await this.provider.tronWeb.trx.signMessageV2(msg);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
throw new SignerError(SignerErrorCode.SIGN_TX_ERROR, undefined, error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async signAndSendTx(tx: TronTransaction): Promise<{ hash: string }> {
|
|
46
|
+
try {
|
|
47
|
+
const transaction = DefaultTronSigner.buildTx(tx);
|
|
48
|
+
const signedTxn = await this.provider.tronWeb.trx.sign(transaction);
|
|
49
|
+
const receipt = await this.provider.tronWeb.trx.sendRawTransaction(
|
|
50
|
+
signedTxn
|
|
51
|
+
);
|
|
52
|
+
const hash = receipt?.transaction?.txID;
|
|
53
|
+
return { hash };
|
|
54
|
+
} catch (error) {
|
|
55
|
+
throw new SignerError(SignerErrorCode.SEND_TX_ERROR, undefined, error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|