@hub3js/tvm 0.2.2 → 0.2.3-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.
- package/dist/mod.d.ts +1 -0
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +1 -1
- package/dist/mod.js.map +3 -3
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/mod.ts +1 -0
- package/src/utils.ts +5 -0
package/dist/mod.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export * as utils from './utils.js';
|
|
|
2
2
|
export * as builders from './builders.js';
|
|
3
3
|
export type { TonActions } from './types.js';
|
|
4
4
|
export { CAIP_NAMESPACE, CAIP_TON_CHAIN_ID } from './constants.js';
|
|
5
|
+
export { isTvmNamespace } from './utils.js';
|
|
5
6
|
//# sourceMappingURL=mod.d.ts.map
|
package/dist/mod.d.ts.map
CHANGED
|
@@ -1 +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"}
|
|
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;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/mod.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var i=Object.defineProperty;var n=(t
|
|
1
|
+
var i=Object.defineProperty;var n=(o,t)=>i(o,"name",{value:t,configurable:!0});var p=(o,t)=>{for(var c in t)i(o,c,{get:t[c],enumerable:!0})};var a={};p(a,{formatAccountsToCAIP:()=>I,isTvmNamespace:()=>s});import{getNamespaceFromCaip2ChainId as C}from"@hub3js/std/utils";import{AccountId as f}from"caip";var e="tvm",r="-239";function s(o){return C(o)==="tvm"}n(s,"isTvmNamespace");function I(o){return o.map(t=>f.format({address:t.toString(),chainId:{namespace:"tvm",reference:r}}))}n(I,"formatAccountsToCAIP");var A={};p(A,{canEagerConnect:()=>x,connect:()=>_});import{ActionBuilder as m}from"@hub3js/core";import{connectAndUpdateStateForSingleNetwork as N,intoConnecting as d,intoConnectionFinished as u}from"@hub3js/std/operators";var _=n(()=>new m("connect").and(N).before(d).after(u),"connect"),x=n(()=>new m("canEagerConnect"),"canEagerConnect");export{e as CAIP_NAMESPACE,r as CAIP_TON_CHAIN_ID,A as builders,s as isTvmNamespace,a as utils};
|
|
2
2
|
//# sourceMappingURL=mod.js.map
|
package/dist/mod.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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,
|
|
6
|
-
"names": ["utils_exports", "__export", "formatAccountsToCAIP", "AccountId", "CAIP_NAMESPACE", "CAIP_TON_CHAIN_ID", "formatAccountsToCAIP", "accounts", "account", "AccountId", "CAIP_TON_CHAIN_ID", "
|
|
4
|
+
"sourcesContent": ["import type { CaipAccount } from '@hub3js/std/types';\n\nimport { getNamespaceFromCaip2ChainId } from '@hub3js/std/utils';\nimport { AccountId } from 'caip';\n\nimport { CAIP_NAMESPACE, CAIP_TON_CHAIN_ID } from './constants.js';\n\nexport function isTvmNamespace(caip2ChainId: string): boolean {\n return getNamespaceFromCaip2ChainId(caip2ChainId) === CAIP_NAMESPACE;\n}\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,EAAA,mBAAAC,IAEA,OAAS,gCAAAC,MAAoC,oBAC7C,OAAS,aAAAC,MAAiB,OCHnB,IAAMC,EAAiB,MACjBC,EAAoB,ODM1B,SAASC,EAAeC,EAA+B,CAC5D,OAAOC,EAA6BD,CAAY,IAAM,KACxD,CAFgBE,EAAAH,EAAA,kBAIT,SAASI,EAAqBC,EAAoB,CACvD,OAAOA,EAAS,IACbC,GACCC,EAAU,OAAO,CACf,QAASD,EAAQ,SAAS,EAC1B,QAAS,CACP,UAAW,MACX,UAAWE,CACb,CACF,CAAC,CACL,CACF,CAXgBL,EAAAC,EAAA,wBEXhB,IAAAK,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", "isTvmNamespace", "getNamespaceFromCaip2ChainId", "AccountId", "CAIP_NAMESPACE", "CAIP_TON_CHAIN_ID", "isTvmNamespace", "caip2ChainId", "getNamespaceFromCaip2ChainId", "__name", "formatAccountsToCAIP", "accounts", "account", "AccountId", "CAIP_TON_CHAIN_ID", "builders_exports", "__export", "canEagerConnect", "connect", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "connect", "__name", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "canEagerConnect"]
|
|
7
7
|
}
|
package/dist/utils.d.ts
CHANGED
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,qCAWtD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hub3js/tvm",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/mod.ts",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"coverage": "vitest run --coverage"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@hub3js/core": "^0.61.0"
|
|
29
|
+
"@hub3js/core": "^0.61.1-next.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@hub3js/core": "^0.61.0"
|
|
32
|
+
"@hub3js/core": "^0.61.1-next.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@hub3js/std": "^0.2.
|
|
35
|
+
"@hub3js/std": "^0.2.3-next.0",
|
|
36
36
|
"caip": "^1.1.1",
|
|
37
37
|
"rango-types": "^0.5.0"
|
|
38
38
|
},
|
package/src/mod.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { CaipAccount } from '@hub3js/std/types';
|
|
2
2
|
|
|
3
|
+
import { getNamespaceFromCaip2ChainId } from '@hub3js/std/utils';
|
|
3
4
|
import { AccountId } from 'caip';
|
|
4
5
|
|
|
5
6
|
import { CAIP_NAMESPACE, CAIP_TON_CHAIN_ID } from './constants.js';
|
|
6
7
|
|
|
8
|
+
export function isTvmNamespace(caip2ChainId: string): boolean {
|
|
9
|
+
return getNamespaceFromCaip2ChainId(caip2ChainId) === CAIP_NAMESPACE;
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
export function formatAccountsToCAIP(accounts: string[]) {
|
|
8
13
|
return accounts.map(
|
|
9
14
|
(account) =>
|