@hub3js/xrpl 0.2.2 → 0.2.3
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 builders from './builders.js';
|
|
|
2
2
|
export type { XRPLActions } from './types.js';
|
|
3
3
|
export * as utils from './utils.js';
|
|
4
4
|
export { CAIP_XRPL_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
|
|
5
|
+
export { isXrplNamespace } 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,QAAQ,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/mod.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p=Object.defineProperty;var t=(o,e)=>p(o,"name",{value:e,configurable:!0});var c=(o,e)=>{for(var i in e)p(o,i,{get:e[i],enumerable:!0})};var s={};c(s,{connect:()=>P});import{ActionBuilder as a}from"@hub3js/core";import{connectAndUpdateStateForSingleNetwork as f,intoConnecting as C,intoConnectionFinished as I}from"@hub3js/std/operators";var P=t(()=>new a("connect").and(f).before(C).after(I),"connect");var A={};c(A,{formatAddressToCAIP:()=>x,isXrplNamespace:()=>m});import{getNamespaceFromCaip2ChainId as _}from"@hub3js/std/utils";import{AccountId as d}from"caip";var r="xrpl",n="mainnet";function m(o){return _(o)===r}t(m,"isXrplNamespace");function x(o){return d.format({address:o,chainId:{namespace:r,reference:n}})}t(x,"formatAddressToCAIP");export{r as CAIP_NAMESPACE,n as CAIP_XRPL_CHAIN_ID,s as builders,m as isXrplNamespace,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/builders.ts", "../src/utils.ts", "../src/constants.ts"],
|
|
4
|
-
"sourcesContent": ["import type { XRPLActions } 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<XRPLActions, 'connect'>('connect')\n .and(connectAndUpdateStateForSingleNetwork)\n .before(intoConnecting)\n .after(intoConnectionFinished);\n", "import { AccountId } from 'caip';\n\nimport { CAIP_NAMESPACE, CAIP_XRPL_CHAIN_ID } from './constants.js';\n\nexport function formatAddressToCAIP(address: string): string {\n return AccountId.format({\n address,\n chainId: {\n namespace: CAIP_NAMESPACE,\n reference: CAIP_XRPL_CHAIN_ID,\n },\n });\n}\n", "/*\n * @see https://namespaces.chainagnostic.org/xrpl/README\n */\n\n// if the value neeeds to be change make sure you will update mapCaipNamespaceToLegacyNetworkName as well\nexport const CAIP_NAMESPACE = 'xrpl';\nexport const CAIP_XRPL_CHAIN_ID = 'mainnet';\n"],
|
|
5
|
-
"mappings": "6IAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAEA,OAAS,iBAAAC,MAAqB,eAC9B,OACE,yCAAAC,EACA,kBAAAC,EACA,0BAAAC,MACK,wBAEA,IAAMC,EAAUC,EAAA,IACrB,IAAIC,EAAsC,SAAS,EAChD,IAAIC,CAAqC,EACzC,OAAOC,CAAc,EACrB,MAAMC,CAAsB,EAJV,WCTvB,IAAAC,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,OAAS,aAAAC,MAAiB,
|
|
6
|
-
"names": ["builders_exports", "__export", "connect", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "connect", "__name", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "utils_exports", "__export", "formatAddressToCAIP", "AccountId", "CAIP_NAMESPACE", "CAIP_XRPL_CHAIN_ID", "
|
|
4
|
+
"sourcesContent": ["import type { XRPLActions } 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<XRPLActions, 'connect'>('connect')\n .and(connectAndUpdateStateForSingleNetwork)\n .before(intoConnecting)\n .after(intoConnectionFinished);\n", "import { getNamespaceFromCaip2ChainId } from '@hub3js/std/utils';\nimport { AccountId } from 'caip';\n\nimport { CAIP_NAMESPACE, CAIP_XRPL_CHAIN_ID } from './constants.js';\n\nexport function isXrplNamespace(caip2ChainId: string): boolean {\n return getNamespaceFromCaip2ChainId(caip2ChainId) === CAIP_NAMESPACE;\n}\n\nexport function formatAddressToCAIP(address: string): string {\n return AccountId.format({\n address,\n chainId: {\n namespace: CAIP_NAMESPACE,\n reference: CAIP_XRPL_CHAIN_ID,\n },\n });\n}\n", "/*\n * @see https://namespaces.chainagnostic.org/xrpl/README\n */\n\n// if the value neeeds to be change make sure you will update mapCaipNamespaceToLegacyNetworkName as well\nexport const CAIP_NAMESPACE = 'xrpl';\nexport const CAIP_XRPL_CHAIN_ID = 'mainnet';\n"],
|
|
5
|
+
"mappings": "6IAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAEA,OAAS,iBAAAC,MAAqB,eAC9B,OACE,yCAAAC,EACA,kBAAAC,EACA,0BAAAC,MACK,wBAEA,IAAMC,EAAUC,EAAA,IACrB,IAAIC,EAAsC,SAAS,EAChD,IAAIC,CAAqC,EACzC,OAAOC,CAAc,EACrB,MAAMC,CAAsB,EAJV,WCTvB,IAAAC,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,oBAAAC,IAAA,OAAS,gCAAAC,MAAoC,oBAC7C,OAAS,aAAAC,MAAiB,OCInB,IAAMC,EAAiB,OACjBC,EAAqB,UDD3B,SAASC,EAAgBC,EAA+B,CAC7D,OAAOC,EAA6BD,CAAY,IAAME,CACxD,CAFgBC,EAAAJ,EAAA,mBAIT,SAASK,EAAoBC,EAAyB,CAC3D,OAAOC,EAAU,OAAO,CACtB,QAAAD,EACA,QAAS,CACP,UAAWH,EACX,UAAWK,CACb,CACF,CAAC,CACH,CARgBJ,EAAAC,EAAA",
|
|
6
|
+
"names": ["builders_exports", "__export", "connect", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "connect", "__name", "ActionBuilder", "connectAndUpdateStateForSingleNetwork", "intoConnecting", "intoConnectionFinished", "utils_exports", "__export", "formatAddressToCAIP", "isXrplNamespace", "getNamespaceFromCaip2ChainId", "AccountId", "CAIP_NAMESPACE", "CAIP_XRPL_CHAIN_ID", "isXrplNamespace", "caip2ChainId", "getNamespaceFromCaip2ChainId", "CAIP_NAMESPACE", "__name", "formatAddressToCAIP", "address", "AccountId", "CAIP_XRPL_CHAIN_ID"]
|
|
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":"AAKA,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hub3js/xrpl",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
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.
|
|
29
|
+
"@hub3js/core": "^0.61.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@hub3js/core": "^0.61.
|
|
32
|
+
"@hub3js/core": "^0.61.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@hub3js/std": "^0.2.
|
|
35
|
+
"@hub3js/std": "^0.2.3",
|
|
36
36
|
"caip": "^1.1.1",
|
|
37
37
|
"rango-types": "^0.5.0",
|
|
38
38
|
"xrpl": "^4.2.0"
|
package/src/mod.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { getNamespaceFromCaip2ChainId } from '@hub3js/std/utils';
|
|
1
2
|
import { AccountId } from 'caip';
|
|
2
3
|
|
|
3
4
|
import { CAIP_NAMESPACE, CAIP_XRPL_CHAIN_ID } from './constants.js';
|
|
4
5
|
|
|
6
|
+
export function isXrplNamespace(caip2ChainId: string): boolean {
|
|
7
|
+
return getNamespaceFromCaip2ChainId(caip2ChainId) === CAIP_NAMESPACE;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
export function formatAddressToCAIP(address: string): string {
|
|
6
11
|
return AccountId.format({
|
|
7
12
|
address,
|