@rango-dev/signer-ton 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 ADDED
@@ -0,0 +1,127 @@
1
+ ## [0.30.1](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.30.0...signer-ton@0.30.1) (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.30.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.29.0...signer-ton@0.30.0) (2026-09-15)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **signers:** remove extra ton transaction fields ([5748292](https://github.com/rango-exchange/rango-client/commit/5748292491a9d5bcf1717cbd463ca99f782b884a))
13
+ # [0.29.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.28.1...signer-ton@0.29.0) (2026-08-18)
14
+
15
+
16
+
17
+ ## [0.28.1](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.28.0...signer-ton@0.28.1) (2026-06-02)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * remove null values from ton signer data and use raw address format ([9ca3f69](https://github.com/rango-exchange/rango-client/commit/9ca3f691e2a6bfe83d2377a565fd69f5c2b8ae45))
23
+
24
+
25
+
26
+ # [0.28.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.27.1...signer-ton@0.28.0) (2026-05-31)
27
+
28
+
29
+
30
+ ## [0.27.1](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.27.0...signer-ton@0.27.1) (2026-05-02)
31
+
32
+
33
+
34
+ # [0.27.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.26.0...signer-ton@0.27.0) (2026-04-29)
35
+
36
+
37
+
38
+ # [0.26.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.25.0...signer-ton@0.26.0) (2025-08-19)
39
+
40
+
41
+
42
+ # [0.25.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.24.0...signer-ton@0.25.0) (2025-08-05)
43
+
44
+
45
+
46
+ # [0.24.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.23.0...signer-ton@0.24.0) (2025-07-22)
47
+
48
+
49
+ ### Reverts
50
+
51
+ * Revert "chore(release): publish" ([064ce15](https://github.com/rango-exchange/rango-client/commit/064ce157a2f819856f647f83aeb1c0410542e8d7))
52
+
53
+
54
+
55
+ # [0.22.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.21.0...signer-ton@0.22.0) (2025-06-09)
56
+
57
+
58
+
59
+ # [0.21.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.20.0...signer-ton@0.21.0) (2025-04-30)
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * rename pbt to ptb for sui ([3d6d89f](https://github.com/rango-exchange/rango-client/commit/3d6d89f2265766607a15d61e0df92643fb33072b))
65
+
66
+
67
+ ### Features
68
+
69
+ * update sui to consider recent api changes ([d764b25](https://github.com/rango-exchange/rango-client/commit/d764b2501df9bb295f63cdbc0b05acd4a3abb4b9))
70
+
71
+
72
+
73
+ # [0.20.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.19.0...signer-ton@0.20.0) (2025-03-11)
74
+
75
+
76
+
77
+ # [0.19.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.18.0...signer-ton@0.19.0) (2025-02-23)
78
+
79
+
80
+
81
+ # [0.18.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.17.0...signer-ton@0.18.0) (2024-11-27)
82
+
83
+
84
+ ### Bug Fixes
85
+
86
+ * improve ton signer and mytonwallet provider ([7027755](https://github.com/rango-exchange/rango-client/commit/7027755740426359f42b088b842dfd01590df5c3))
87
+
88
+
89
+
90
+ # [0.17.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.16.0...signer-ton@0.17.0) (2024-11-12)
91
+
92
+
93
+
94
+ # [0.16.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.15.0...signer-ton@0.16.0) (2024-10-12)
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * bump sdk and fix type issues ([d442208](https://github.com/rango-exchange/rango-client/commit/d4422083bf5dd27d5f509ce1db7f9560d05428c8))
100
+
101
+
102
+
103
+ # [0.15.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.14.0...signer-ton@0.15.0) (2024-09-10)
104
+
105
+
106
+
107
+ # [0.14.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.13.0...signer-ton@0.14.0) (2024-08-11)
108
+
109
+
110
+
111
+ # [0.13.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.12.0...signer-ton@0.13.0) (2024-07-09)
112
+
113
+
114
+
115
+ # [0.12.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.11.0...signer-ton@0.12.0) (2024-02-20)
116
+
117
+
118
+
119
+ # [0.11.0](https://github.com/rango-exchange/rango-client/compare/signer-ton@0.9.0...signer-ton@0.11.0) (2023-12-24)
120
+
121
+
122
+ ### Bug Fixes
123
+
124
+ * fix HMR for widget and playground ([8524820](https://github.com/rango-exchange/rango-client/commit/8524820f10cf0b8921f3db0c4f620ff98daa4103))
125
+
126
+
127
+
@@ -0,0 +1,2 @@
1
+ export { DefaultTonSigner } from './signer.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ var d=Object.defineProperty;var T=(r,n)=>d(r,"name",{value:n,configurable:!0});import{Address as p,Cell as h}from"@ton/core";import{SignerError as u,TonChainID as f}from"rango-types";var e=class r{constructor(n){this.provider=n;this.provider=n}static{T(this,"DefaultTonSigner")}static buildTx(n){let{validUntil:s,network:a,from:t,messages:l}=n,o={valid_until:s,network:a??f.MAINNET,messages:l.map(({address:g,amount:c,stateInit:i,payload:m})=>({address:g,amount:c,...i!=null&&{stateInit:i},...m!=null&&{payload:m}}))};return t&&(o={...o,from:p.parse(t).toRawString()}),o}async signMessage(){throw u.UnimplementedError("signMessage")}async signAndSendTx(n){let{result:s}=await this.provider.send({method:"sendTransaction",params:[JSON.stringify(r.buildTx(n))]});return{hash:h.fromBase64(s).hash().toString("hex")}}};export{e as DefaultTonSigner};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/signer.ts"],
4
+ "sourcesContent": ["import type { GenericSigner, TonMessage, TonTransaction } from 'rango-types';\n\nimport { Address, Cell } from '@ton/core';\nimport { SignerError, TonChainID } from 'rango-types';\n\nexport type TonTransactionPayload = {\n valid_until: number;\n network: TonChainID;\n from?: string;\n messages: TonMessage[];\n};\n\nexport class DefaultTonSigner implements GenericSigner<TonTransaction> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(private provider: any) {\n this.provider = provider;\n }\n\n static buildTx(tonTx: TonTransaction): TonTransactionPayload {\n const { validUntil, network, from, messages } = tonTx;\n\n let tx: TonTransactionPayload = {\n valid_until: validUntil,\n network: network ?? TonChainID.MAINNET,\n messages: messages.map(({ address, amount, stateInit, payload }) => ({\n address,\n amount,\n ...(stateInit != null && { stateInit }),\n ...(payload != null && { payload }),\n })),\n };\n if (from) {\n tx = { ...tx, from: Address.parse(from).toRawString() };\n }\n return tx;\n }\n\n async signMessage(): Promise<string> {\n throw SignerError.UnimplementedError('signMessage');\n }\n\n async signAndSendTx(tx: TonTransaction): Promise<{ hash: string }> {\n const { result } = await this.provider.send({\n method: 'sendTransaction',\n params: [JSON.stringify(DefaultTonSigner.buildTx(tx))],\n });\n\n const hash = Cell.fromBase64(result).hash().toString('hex');\n return { hash };\n }\n}\n"],
5
+ "mappings": "+EAEA,OAAS,WAAAA,EAAS,QAAAC,MAAY,YAC9B,OAAS,eAAAC,EAAa,cAAAC,MAAkB,cASjC,IAAMC,EAAN,MAAMC,CAA0D,CAErE,YAAoBC,EAAe,CAAf,cAAAA,EAClB,KAAK,SAAWA,CAClB,CAhBF,MAYuE,CAAAC,EAAA,yBAMrE,OAAO,QAAQC,EAA8C,CAC3D,GAAM,CAAE,WAAAC,EAAY,QAAAC,EAAS,KAAAC,EAAM,SAAAC,CAAS,EAAIJ,EAE5CK,EAA4B,CAC9B,YAAaJ,EACb,QAASC,GAAWI,EAAW,QAC/B,SAAUF,EAAS,IAAI,CAAC,CAAE,QAAAG,EAAS,OAAAC,EAAQ,UAAAC,EAAW,QAAAC,CAAQ,KAAO,CACnE,QAAAH,EACA,OAAAC,EACA,GAAIC,GAAa,MAAQ,CAAE,UAAAA,CAAU,EACrC,GAAIC,GAAW,MAAQ,CAAE,QAAAA,CAAQ,CACnC,EAAE,CACJ,EACA,OAAIP,IACFE,EAAK,CAAE,GAAGA,EAAI,KAAMM,EAAQ,MAAMR,CAAI,EAAE,YAAY,CAAE,GAEjDE,CACT,CAEA,MAAM,aAA+B,CACnC,MAAMO,EAAY,mBAAmB,aAAa,CACpD,CAEA,MAAM,cAAcP,EAA+C,CACjE,GAAM,CAAE,OAAAQ,CAAO,EAAI,MAAM,KAAK,SAAS,KAAK,CAC1C,OAAQ,kBACR,OAAQ,CAAC,KAAK,UAAUhB,EAAiB,QAAQQ,CAAE,CAAC,CAAC,CACvD,CAAC,EAGD,MAAO,CAAE,KADIS,EAAK,WAAWD,CAAM,EAAE,KAAK,EAAE,SAAS,KAAK,CAC5C,CAChB,CACF",
6
+ "names": ["Address", "Cell", "SignerError", "TonChainID", "DefaultTonSigner", "_DefaultTonSigner", "provider", "__name", "tonTx", "validUntil", "network", "from", "messages", "tx", "TonChainID", "address", "amount", "stateInit", "payload", "Address", "SignerError", "result", "Cell"]
7
+ }
@@ -0,0 +1,18 @@
1
+ import type { GenericSigner, TonMessage, TonTransaction } from 'rango-types';
2
+ import { TonChainID } from 'rango-types';
3
+ export type TonTransactionPayload = {
4
+ valid_until: number;
5
+ network: TonChainID;
6
+ from?: string;
7
+ messages: TonMessage[];
8
+ };
9
+ export declare class DefaultTonSigner implements GenericSigner<TonTransaction> {
10
+ private provider;
11
+ constructor(provider: any);
12
+ static buildTx(tonTx: TonTransaction): TonTransactionPayload;
13
+ signMessage(): Promise<string>;
14
+ signAndSendTx(tx: TonTransaction): Promise<{
15
+ hash: string;
16
+ }>;
17
+ }
18
+ //# 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,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7E,OAAO,EAAe,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB,CAAC;AAEF,qBAAa,gBAAiB,YAAW,aAAa,CAAC,cAAc,CAAC;IAExD,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,GAAG;IAIjC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,qBAAqB;IAmBtD,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,aAAa,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CASnE"}
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@rango-dev/signer-ton",
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
+ "peerDependencies": {
28
+ "@ton/core": ">=0.59.0",
29
+ "@ton/crypto": ">=3.3.0"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ }
34
+ }
package/readme.md ADDED
@@ -0,0 +1,3 @@
1
+ # @rango-dev/signer-ton
2
+
3
+ Signer for Ton Transacations generated by Rango API
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { DefaultTonSigner } from './signer.js';
package/src/signer.ts ADDED
@@ -0,0 +1,51 @@
1
+ import type { GenericSigner, TonMessage, TonTransaction } from 'rango-types';
2
+
3
+ import { Address, Cell } from '@ton/core';
4
+ import { SignerError, TonChainID } from 'rango-types';
5
+
6
+ export type TonTransactionPayload = {
7
+ valid_until: number;
8
+ network: TonChainID;
9
+ from?: string;
10
+ messages: TonMessage[];
11
+ };
12
+
13
+ export class DefaultTonSigner implements GenericSigner<TonTransaction> {
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ constructor(private provider: any) {
16
+ this.provider = provider;
17
+ }
18
+
19
+ static buildTx(tonTx: TonTransaction): TonTransactionPayload {
20
+ const { validUntil, network, from, messages } = tonTx;
21
+
22
+ let tx: TonTransactionPayload = {
23
+ valid_until: validUntil,
24
+ network: network ?? TonChainID.MAINNET,
25
+ messages: messages.map(({ address, amount, stateInit, payload }) => ({
26
+ address,
27
+ amount,
28
+ ...(stateInit != null && { stateInit }),
29
+ ...(payload != null && { payload }),
30
+ })),
31
+ };
32
+ if (from) {
33
+ tx = { ...tx, from: Address.parse(from).toRawString() };
34
+ }
35
+ return tx;
36
+ }
37
+
38
+ async signMessage(): Promise<string> {
39
+ throw SignerError.UnimplementedError('signMessage');
40
+ }
41
+
42
+ async signAndSendTx(tx: TonTransaction): Promise<{ hash: string }> {
43
+ const { result } = await this.provider.send({
44
+ method: 'sendTransaction',
45
+ params: [JSON.stringify(DefaultTonSigner.buildTx(tx))],
46
+ });
47
+
48
+ const hash = Cell.fromBase64(result).hash().toString('hex');
49
+ return { hash };
50
+ }
51
+ }