@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 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 c=Object.defineProperty;var n=(o,t)=>c(o,"name",{value:t,configurable:!0});var A=(o,t)=>{for(var i in t)c(o,i,{get:t[i],enumerable:!0})};var p={};A(p,{connect:()=>I});import{ActionBuilder as m}from"@hub3js/core";import{connectAndUpdateStateForSingleNetwork as P,intoConnecting as f,intoConnectionFinished as C}from"@hub3js/std/operators";var I=n(()=>new m("connect").and(P).before(f).after(C),"connect");var s={};A(s,{formatAddressToCAIP:()=>_});import{AccountId as a}from"caip";var e="xrpl",r="mainnet";function _(o){return a.format({address:o,chainId:{namespace:e,reference:r}})}n(_,"formatAddressToCAIP");export{e as CAIP_NAMESPACE,r as CAIP_XRPL_CHAIN_ID,p as builders,s as utils};
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,OCKnB,IAAMC,EAAiB,OACjBC,EAAqB,UDF3B,SAASC,EAAoBC,EAAyB,CAC3D,OAAOC,EAAU,OAAO,CACtB,QAAAD,EACA,QAAS,CACP,UAAWE,EACX,UAAWC,CACb,CACF,CAAC,CACH,CARgBC,EAAAL,EAAA",
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", "formatAddressToCAIP", "address", "AccountId", "CAIP_NAMESPACE", "CAIP_XRPL_CHAIN_ID", "__name"]
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
@@ -1,2 +1,3 @@
1
+ export declare function isXrplNamespace(caip2ChainId: string): boolean;
1
2
  export declare function formatAddressToCAIP(address: string): string;
2
3
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ3D"}
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.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.0"
29
+ "@hub3js/core": "^0.61.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@hub3js/core": "^0.61.0"
32
+ "@hub3js/core": "^0.61.1"
33
33
  },
34
34
  "dependencies": {
35
- "@hub3js/std": "^0.2.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
@@ -3,3 +3,4 @@ export type { XRPLActions } from './types.js';
3
3
 
4
4
  export * as utils from './utils.js';
5
5
  export { CAIP_XRPL_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
6
+ export { isXrplNamespace } from './utils.js';
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,