@rango-dev/signer-ton 0.1.1-next.0

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.
@@ -0,0 +1,2 @@
1
+ export { DefaultTonSigner } from './signer';
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,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ var o=Object.defineProperty;var i=(s,n)=>o(s,"name",{value:n,configurable:!0});import{SignerError as t}from"rango-types";var r=class{constructor(n){this.provider=n;this.provider=n}async signMessage(){throw t.UnimplementedError("signMessage")}async signAndSendTx(n){let{type:a,blockChain:c,...e}=n;return await this.provider.send({method:"sendTransaction",params:[JSON.stringify(e)]}),{hash:"xxxxxxxx"}}};i(r,"DefaultTonSigner");export{r as DefaultTonSigner};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/signer.ts"],
4
+ "sourcesContent": ["import { GenericSigner, SignerError, TonTransaction } from 'rango-types';\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 async signMessage(): Promise<string> {\n throw SignerError.UnimplementedError('signMessage');\n }\n\n async signAndSendTx(tx: TonTransaction): Promise<{ hash: string }> {\n const { type, blockChain, ...transactionObjectForSign } = tx;\n\n await this.provider.send({\n method: 'sendTransaction',\n params: [JSON.stringify(transactionObjectForSign)],\n });\n /*\n No hash is returned when signing a Ton transaction.\n Returns a string for API consistency \n */\n return { hash: 'xxxxxxxx' };\n }\n}\n"],
5
+ "mappings": "+EAAA,OAAwB,eAAAA,MAAmC,cAEpD,IAAMC,EAAN,KAAgE,CAErE,YAAoBC,EAAe,CAAf,cAAAA,EAClB,KAAK,SAAWA,CAClB,CAEA,MAAM,aAA+B,CACnC,MAAMC,EAAY,mBAAmB,aAAa,CACpD,CAEA,MAAM,cAAcC,EAA+C,CACjE,GAAM,CAAE,KAAAC,EAAM,WAAAC,EAAY,GAAGC,CAAyB,EAAIH,EAE1D,aAAM,KAAK,SAAS,KAAK,CACvB,OAAQ,kBACR,OAAQ,CAAC,KAAK,UAAUG,CAAwB,CAAC,CACnD,CAAC,EAKM,CAAE,KAAM,UAAW,CAC5B,CACF,EAvBaC,EAAAP,EAAA",
6
+ "names": ["SignerError", "DefaultTonSigner", "provider", "SignerError", "tx", "type", "blockChain", "transactionObjectForSign", "__name"]
7
+ }
@@ -0,0 +1,10 @@
1
+ import { GenericSigner, TonTransaction } from 'rango-types';
2
+ export declare class DefaultTonSigner implements GenericSigner<TonTransaction> {
3
+ private provider;
4
+ constructor(provider: any);
5
+ signMessage(): Promise<string>;
6
+ signAndSendTx(tx: TonTransaction): Promise<{
7
+ hash: string;
8
+ }>;
9
+ }
10
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAEzE,qBAAa,gBAAiB,YAAW,aAAa,CAAC,cAAc,CAAC;IAExD,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,GAAG;IAI3B,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,aAAa,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAanE"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@rango-dev/signer-ton",
3
+ "version": "0.1.1-next.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "module": "./dist/index.js",
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
+ ],
16
+ "scripts": {
17
+ "build": "node ../../scripts/build/command.mjs --path signers/signer-ton",
18
+ "clean": "rimraf dist",
19
+ "format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
20
+ "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
21
+ },
22
+ "dependencies": {
23
+ "rango-types": "^0.1.45"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ }
28
+ }
package/readme.md ADDED
@@ -0,0 +1 @@
1
+ # @rango-dev/signer-ton
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { DefaultTonSigner } from './signer';
package/src/signer.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { GenericSigner, SignerError, TonTransaction } from 'rango-types';
2
+
3
+ export class DefaultTonSigner implements GenericSigner<TonTransaction> {
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ constructor(private provider: any) {
6
+ this.provider = provider;
7
+ }
8
+
9
+ async signMessage(): Promise<string> {
10
+ throw SignerError.UnimplementedError('signMessage');
11
+ }
12
+
13
+ async signAndSendTx(tx: TonTransaction): Promise<{ hash: string }> {
14
+ const { type, blockChain, ...transactionObjectForSign } = tx;
15
+
16
+ await this.provider.send({
17
+ method: 'sendTransaction',
18
+ params: [JSON.stringify(transactionObjectForSign)],
19
+ });
20
+ /*
21
+ No hash is returned when signing a Ton transaction.
22
+ Returns a string for API consistency
23
+ */
24
+ return { hash: 'xxxxxxxx' };
25
+ }
26
+ }