@dynamic-labs-wallet/tron 0.0.0 → 1.0.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.
- package/index.cjs +26 -0
- package/index.d.ts +1 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +2 -0
- package/package.json +32 -1
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -0
- package/src/types.d.ts +39 -0
- package/src/types.d.ts.map +1 -0
package/index.cjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
4
|
+
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
var n = Object.create(null);
|
|
7
|
+
if (e) {
|
|
8
|
+
Object.keys(e).forEach(function (k) {
|
|
9
|
+
if (k !== 'default') {
|
|
10
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return e[k]; }
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var sdkApiCore__namespace = /*#__PURE__*/_interopNamespaceDefault(sdkApiCore);
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.sdkApiCore = sdkApiCore__namespace;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
package/index.esm.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/index";
|
package/index.esm.js
ADDED
package/package.json
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@dynamic-labs-wallet/tron",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@dynamic-labs/sdk-api-core": "^0.0.984"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"nx": {
|
|
13
|
+
"sourceRoot": "packages/tron/src",
|
|
14
|
+
"projectType": "library",
|
|
15
|
+
"name": "tron",
|
|
16
|
+
"targets": {
|
|
17
|
+
"build": {}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"main": "./index.cjs",
|
|
21
|
+
"module": "./index.esm.js",
|
|
22
|
+
"types": "./index.esm.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": "./package.json",
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./index.esm.d.ts",
|
|
27
|
+
"import": "./index.esm.js",
|
|
28
|
+
"require": "./index.cjs",
|
|
29
|
+
"default": "./index.esm.js"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAClG,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC"}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
/**
|
|
3
|
+
* Unsigned TRON transaction shape, matching the JSON returned by full-node
|
|
4
|
+
* endpoints like `/wallet/createtransaction` or `/wallet/triggersmartcontract`.
|
|
5
|
+
*
|
|
6
|
+
* The wallet client only needs `raw_data_hex` to sign — the rest of the
|
|
7
|
+
* fields are forwarded back to the caller (and on to a TRON full node) so
|
|
8
|
+
* the signed transaction can be broadcast unchanged.
|
|
9
|
+
*/
|
|
10
|
+
export interface TronTransaction {
|
|
11
|
+
/** Pre-computed by the TRON full node; SHA256 of `raw_data_hex` */
|
|
12
|
+
txID?: string;
|
|
13
|
+
/** JSON view of the protobuf raw_data — passthrough for the consumer */
|
|
14
|
+
raw_data?: any;
|
|
15
|
+
/** Hex-encoded protobuf-serialized raw_data (this is what we sign) */
|
|
16
|
+
raw_data_hex: string;
|
|
17
|
+
/** Signatures already attached to the transaction (multi-sig flows) */
|
|
18
|
+
signature?: string[];
|
|
19
|
+
/** Visible flag for TRON address auto-conversion */
|
|
20
|
+
visible?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Context fields forwarded to policy validation for TRON transactions.
|
|
24
|
+
* Kept small in V1 — wallet-service is enum-only for TRON today, so this is
|
|
25
|
+
* mostly informational for client-side logging until validators land.
|
|
26
|
+
*/
|
|
27
|
+
export interface TronTransactionContext {
|
|
28
|
+
/** Hex-encoded raw_data bytes that were hashed */
|
|
29
|
+
rawDataHex: string;
|
|
30
|
+
/** txID (SHA256 of raw_data) as a 0x-prefixed hex string */
|
|
31
|
+
txid: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Sign-message context with TRON-specific transaction details attached.
|
|
35
|
+
*/
|
|
36
|
+
export interface TronSignMessageContext extends SignMessageContext {
|
|
37
|
+
tronTransaction?: TronTransactionContext;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IAExE,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,oDAAoD;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C"}
|