@hub3js/xrpl 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.
@@ -0,0 +1,4 @@
1
+ import type { XRPLActions } from './types.js';
2
+ import { ActionBuilder } from '@hub3js/core';
3
+ export declare const connect: () => ActionBuilder<XRPLActions, "connect">;
4
+ //# 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,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO7C,eAAO,MAAM,OAAO,6CAIc,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const CAIP_NAMESPACE = "xrpl";
2
+ export declare const CAIP_XRPL_CHAIN_ID = "mainnet";
3
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,kBAAkB,YAAY,CAAC"}
package/dist/mod.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * as builders from './builders.js';
2
+ export type { XRPLActions } from './types.js';
3
+ export * as utils from './utils.js';
4
+ export { CAIP_XRPL_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
5
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +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"}
package/dist/mod.js ADDED
@@ -0,0 +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};
2
+ //# sourceMappingURL=mod.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 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"]
7
+ }
@@ -0,0 +1,10 @@
1
+ import type { Accounts, AutoImplementedActionsByRecommended, CommonActions } from '@hub3js/std/types';
2
+ import type { AccountLinesTrustline } from 'xrpl';
3
+ export interface XRPLActions extends AutoImplementedActionsByRecommended, CommonActions {
4
+ connect: () => Promise<Accounts>;
5
+ canEagerConnect: () => Promise<boolean>;
6
+ accountLines: (account: string, options?: {
7
+ peer?: string;
8
+ }) => Promise<AccountLinesTrustline[]>;
9
+ }
10
+ //# 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;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,WAAW,WACf,SAAQ,mCAAmC,EAAE,aAAa;IAC1D,OAAO,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjC,eAAe,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,YAAY,EAAE,CACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KACxB,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACvC"}
@@ -0,0 +1,2 @@
1
+ export declare function formatAddressToCAIP(address: string): string;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +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"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@hub3js/xrpl",
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
+ "xrpl": "^4.2.0"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }
package/readme.md ADDED
@@ -0,0 +1,3 @@
1
+ # @hub3js/xrpl
2
+
3
+ Package for handling XRPL wallets supported by Rango
@@ -0,0 +1,14 @@
1
+ import type { XRPLActions } 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<XRPLActions, 'connect'>('connect')
12
+ .and(connectAndUpdateStateForSingleNetwork)
13
+ .before(intoConnecting)
14
+ .after(intoConnectionFinished);
@@ -0,0 +1,7 @@
1
+ /*
2
+ * @see https://namespaces.chainagnostic.org/xrpl/README
3
+ */
4
+
5
+ // if the value neeeds to be change make sure you will update mapCaipNamespaceToLegacyNetworkName as well
6
+ export const CAIP_NAMESPACE = 'xrpl';
7
+ export const CAIP_XRPL_CHAIN_ID = 'mainnet';
package/src/mod.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * as builders from './builders.js';
2
+ export type { XRPLActions } from './types.js';
3
+
4
+ export * as utils from './utils.js';
5
+ export { CAIP_XRPL_CHAIN_ID, CAIP_NAMESPACE } from './constants.js';
package/src/types.ts ADDED
@@ -0,0 +1,16 @@
1
+ import type {
2
+ Accounts,
3
+ AutoImplementedActionsByRecommended,
4
+ CommonActions,
5
+ } from '@hub3js/std/types';
6
+ import type { AccountLinesTrustline } from 'xrpl';
7
+
8
+ export interface XRPLActions
9
+ extends AutoImplementedActionsByRecommended, CommonActions {
10
+ connect: () => Promise<Accounts>;
11
+ canEagerConnect: () => Promise<boolean>;
12
+ accountLines: (
13
+ account: string,
14
+ options?: { peer?: string },
15
+ ) => Promise<AccountLinesTrustline[]>;
16
+ }
package/src/utils.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { AccountId } from 'caip';
2
+
3
+ import { CAIP_NAMESPACE, CAIP_XRPL_CHAIN_ID } from './constants.js';
4
+
5
+ export function formatAddressToCAIP(address: string): string {
6
+ return AccountId.format({
7
+ address,
8
+ chainId: {
9
+ namespace: CAIP_NAMESPACE,
10
+ reference: CAIP_XRPL_CHAIN_ID,
11
+ },
12
+ });
13
+ }