@hub3js/tvm 0.0.0-experimental-29a36fc0-20260720
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/dist/builders.d.ts +5 -0
- package/dist/builders.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/mod.d.ts +5 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +2 -0
- package/dist/mod.js.map +7 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -0
- package/package.json +42 -0
- package/readme.md +3 -0
- package/src/builders.ts +17 -0
- package/src/constants.ts +2 -0
- package/src/mod.ts +5 -0
- package/src/types.ts +11 -0
- package/src/utils.ts +18 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TonActions } from './types.js';
|
|
2
|
+
import { ActionBuilder } from '@hub3js/core';
|
|
3
|
+
export declare const connect: () => ActionBuilder<TonActions, "connect">;
|
|
4
|
+
export declare const canEagerConnect: () => ActionBuilder<TonActions, "canEagerConnect">;
|
|
5
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../src/builders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO7C,eAAO,MAAM,OAAO,4CAIc,CAAC;AAEnC,eAAO,MAAM,eAAe,oDACyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,iBAAiB,SAAS,CAAC"}
|
package/dist/mod.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/mod.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var i=Object.defineProperty;var n=(t,o)=>i(t,"name",{value:o,configurable:!0});var p=(t,o)=>{for(var c in o)i(t,c,{get:o[c],enumerable:!0})};var s={};p(s,{formatAccountsToCAIP:()=>C});import{AccountId as m}from"caip";var e="tvm",r="-239";function C(t){return t.map(o=>m.format({address:o.toString(),chainId:{namespace:"tvm",reference:r}}))}n(C,"formatAccountsToCAIP");var a={};p(a,{canEagerConnect:()=>u,connect:()=>d});import{ActionBuilder as A}from"@hub3js/core";import{connectAndUpdateStateForSingleNetwork as f,intoConnecting as I,intoConnectionFinished as _}from"@hub3js/std/operators";var d=n(()=>new A("connect").and(f).before(I).after(_),"connect"),u=n(()=>new A("canEagerConnect"),"canEagerConnect");export{e as CAIP_NAMESPACE,r as CAIP_TON_CHAIN_ID,a as builders,s as utils};
|
|
2
|
+
//# sourceMappingURL=mod.js.map
|
package/dist/mod.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utils.ts", "../src/constants.ts", "../src/builders.ts"],
|
|
4
|
+
"sourcesContent": ["import type { CaipAccount } from '@hub3js/std/types';\n\nimport { AccountId } from 'caip';\n\nimport { CAIP_NAMESPACE, CAIP_TON_CHAIN_ID } from './constants.js';\n\nexport function formatAccountsToCAIP(accounts: string[]) {\n return accounts.map(\n (account) =>\n AccountId.format({\n address: account.toString(),\n chainId: {\n namespace: CAIP_NAMESPACE,\n reference: CAIP_TON_CHAIN_ID,\n },\n }) as CaipAccount,\n );\n}\n", "export const CAIP_NAMESPACE = 'tvm';\nexport const CAIP_TON_CHAIN_ID = '-239';\n", "import type { TonActions } from './types.js';\n\nimport { ActionBuilder } from '@hub3js/core';\nimport {\n connectAndUpdateStateForSingleNetwork,\n intoConnecting,\n intoConnectionFinished,\n} from '@hub3js/std/operators';\n\nexport const connect = () =>\n new ActionBuilder<TonActions, 'connect'>('connect')\n .and(connectAndUpdateStateForSingleNetwork)\n .before(intoConnecting)\n .after(intoConnectionFinished);\n\nexport const canEagerConnect = () =>\n new ActionBuilder<TonActions, 'canEagerConnect'>('canEagerConnect');\n"],
|
|
5
|
+
"mappings": "6IAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,IAEA,OAAS,aAAAC,MAAiB,OCFnB,IAAMC,EAAiB,MACjBC,EAAoB,ODK1B,SAASC,EAAqBC,EAAoB,CACvD,OAAOA,EAAS,IACbC,GACCC,EAAU,OAAO,CACf,QAASD,EAAQ,SAAS,EAC1B,QAAS,CACP,UAAW,MACX,UAAWE,CACb,CACF,CAAC,CACL,CACF,CAXgBC,EAAAL,EAAA,wBENhB,IAAAM,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,EAAA,YAAAC,IAEA,OAAS,iBAAAC,MAAqB,eAC9B,OACE,yCAAAC,EACA,kBAAAC,EACA,0BAAAC,MACK,wBAEA,IAAMC,EAAUC,EAAA,IACrB,IAAIC,EAAqC,SAAS,EAC/C,IAAIC,CAAqC,EACzC,OAAOC,CAAc,EACrB,MAAMC,CAAsB,EAJV,WAMVC,EAAkBL,EAAA,IAC7B,IAAIC,EAA6C,iBAAiB,EADrC",
|
|
6
|
+
"names": ["utils_exports", "__export", "formatAccountsToCAIP", "AccountId", "CAIP_NAMESPACE", "CAIP_TON_CHAIN_ID", "formatAccountsToCAIP", "accounts", "account", "AccountId", "CAIP_TON_CHAIN_ID", "__name", "builders_exports", "__export", "canEagerConnect", "connect", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "connect", "__name", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "canEagerConnect"]
|
|
7
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Accounts, AutoImplementedActionsByRecommended, CommonActions } from '@hub3js/std/types';
|
|
2
|
+
export interface TonActions extends AutoImplementedActionsByRecommended, CommonActions {
|
|
3
|
+
connect: () => Promise<Accounts>;
|
|
4
|
+
canEagerConnect: () => Promise<boolean>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,mCAAmC,EACnC,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,UACf,SAAQ,mCAAmC,EAAE,aAAa;IAC1D,OAAO,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjC,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAMA,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,qCAWtD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hub3js/tvm",
|
|
3
|
+
"version": "0.0.0-experimental-29a36fc0-20260720",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"source": "./src/mod.ts",
|
|
7
|
+
"main": "./dist/mod.js",
|
|
8
|
+
"typings": "./dist/mod.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/mod.d.ts",
|
|
12
|
+
"default": "./dist/mod.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "yarn run rangutopia library build",
|
|
21
|
+
"ts-check": "tsc --declaration --emitDeclarationOnly -p tsconfig.json",
|
|
22
|
+
"clean": "rimraf dist",
|
|
23
|
+
"format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
|
|
24
|
+
"lint": "eslint \"**/*.{ts,tsx}\"",
|
|
25
|
+
"test": "vitest",
|
|
26
|
+
"coverage": "vitest run --coverage"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@hub3js/core": "^0.0.0-experimental-29a36fc0-20260720"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@hub3js/core": "^0.0.0-experimental-29a36fc0-20260720"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@hub3js/std": "^0.0.0-experimental-29a36fc0-20260720",
|
|
36
|
+
"caip": "^1.1.1",
|
|
37
|
+
"rango-types": "^0.5.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/readme.md
ADDED
package/src/builders.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TonActions } from './types.js';
|
|
2
|
+
|
|
3
|
+
import { ActionBuilder } from '@hub3js/core';
|
|
4
|
+
import {
|
|
5
|
+
connectAndUpdateStateForSingleNetwork,
|
|
6
|
+
intoConnecting,
|
|
7
|
+
intoConnectionFinished,
|
|
8
|
+
} from '@hub3js/std/operators';
|
|
9
|
+
|
|
10
|
+
export const connect = () =>
|
|
11
|
+
new ActionBuilder<TonActions, 'connect'>('connect')
|
|
12
|
+
.and(connectAndUpdateStateForSingleNetwork)
|
|
13
|
+
.before(intoConnecting)
|
|
14
|
+
.after(intoConnectionFinished);
|
|
15
|
+
|
|
16
|
+
export const canEagerConnect = () =>
|
|
17
|
+
new ActionBuilder<TonActions, 'canEagerConnect'>('canEagerConnect');
|
package/src/constants.ts
ADDED
package/src/mod.ts
ADDED
package/src/types.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Accounts,
|
|
3
|
+
AutoImplementedActionsByRecommended,
|
|
4
|
+
CommonActions,
|
|
5
|
+
} from '@hub3js/std/types';
|
|
6
|
+
|
|
7
|
+
export interface TonActions
|
|
8
|
+
extends AutoImplementedActionsByRecommended, CommonActions {
|
|
9
|
+
connect: () => Promise<Accounts>;
|
|
10
|
+
canEagerConnect: () => Promise<boolean>;
|
|
11
|
+
}
|
package/src/utils.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CaipAccount } from '@hub3js/std/types';
|
|
2
|
+
|
|
3
|
+
import { AccountId } from 'caip';
|
|
4
|
+
|
|
5
|
+
import { CAIP_NAMESPACE, CAIP_TON_CHAIN_ID } from './constants.js';
|
|
6
|
+
|
|
7
|
+
export function formatAccountsToCAIP(accounts: string[]) {
|
|
8
|
+
return accounts.map(
|
|
9
|
+
(account) =>
|
|
10
|
+
AccountId.format({
|
|
11
|
+
address: account.toString(),
|
|
12
|
+
chainId: {
|
|
13
|
+
namespace: CAIP_NAMESPACE,
|
|
14
|
+
reference: CAIP_TON_CHAIN_ID,
|
|
15
|
+
},
|
|
16
|
+
}) as CaipAccount,
|
|
17
|
+
);
|
|
18
|
+
}
|