@gardenfi/orderbook 3.1.3-beta.1 → 3.1.3-beta.2

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/index9.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@gardenfi/utils"),d=require("./index4.cjs"),i=require("./index3.cjs"),o={[i.BlockchainType.bitcoin]:{address:()=>"",tx:(e,t)=>new s.Url("tx",e).endpoint(t).toString()},[i.BlockchainType.tron]:{address:(e,t)=>`${e}/#/address/${t}`,tx:(e,t)=>`${e}/#/transaction/${t.slice(2)}`},[i.BlockchainType.starknet]:{address:(e,t)=>new s.Url("contract",e).endpoint(t).toString(),tx:(e,t)=>new s.Url("tx",e).endpoint(t).toString()},[i.BlockchainType.xrpl]:{address:(e,t)=>new s.Url("accounts",e).endpoint(t).toString(),tx:(e,t)=>new s.Url("transactions",e).endpoint(t).toString()},[i.BlockchainType.solana]:{address:(e,t,n)=>{let r=new s.Url("address",e).endpoint(t);return n===s.Network.TESTNET&&(r=r.addSearchParams({cluster:"devnet"})),r.toString()},tx:(e,t,n)=>{let r=new s.Url("tx",e).endpoint(t);return n===s.Network.TESTNET&&(r=r.addSearchParams({cluster:"devnet"})),r.toString()}},default:{address:(e,t)=>new s.Url("address",e).endpoint(t).toString(),tx:(e,t)=>new s.Url("tx",e).endpoint(t).toString()}};class a{constructor(t,n,r){this.explorerUrl=n,this.network=r,this.chainType=d.getBlockchainType(t)}static from(t,n,r){return new a(t,n,r)}getAddressLink(t){return(o[this.chainType]??o.default).address(this.explorerUrl,t,this.network)}getTxLink(t){const n=this.extractTxHash(t);return(o[this.chainType]??o.default).tx(this.explorerUrl,n,this.network)}extractTxHash(t){var n,r;return((r=(n=t.split(",").at(-1))==null?void 0:n.split(":").at(0))==null?void 0:r.trim())??""}}exports.ExplorerUrlBuilder=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@gardenfi/utils"),d=require("./index4.cjs"),i=require("./index3.cjs"),o={[i.BlockchainType.bitcoin]:{address:(e,t)=>new s.Url("address",e).endpoint(t).toString(),tx:(e,t)=>new s.Url("tx",e).endpoint(t).toString()},[i.BlockchainType.tron]:{address:(e,t)=>`${e}/#/address/${t}`,tx:(e,t)=>`${e}/#/transaction/${t.slice(2)}`},[i.BlockchainType.starknet]:{address:(e,t)=>new s.Url("contract",e).endpoint(t).toString(),tx:(e,t)=>new s.Url("tx",e).endpoint(t).toString()},[i.BlockchainType.xrpl]:{address:(e,t)=>new s.Url("accounts",e).endpoint(t).toString(),tx:(e,t)=>new s.Url("transactions",e).endpoint(t).toString()},[i.BlockchainType.solana]:{address:(e,t,n)=>{let r=new s.Url("address",e).endpoint(t);return n===s.Network.TESTNET&&(r=r.addSearchParams({cluster:"devnet"})),r.toString()},tx:(e,t,n)=>{let r=new s.Url("tx",e).endpoint(t);return n===s.Network.TESTNET&&(r=r.addSearchParams({cluster:"devnet"})),r.toString()}},default:{address:(e,t)=>new s.Url("address",e).endpoint(t).toString(),tx:(e,t)=>new s.Url("tx",e).endpoint(t).toString()}};class a{constructor(t,n,r){this.explorerUrl=n,this.network=r,this.chainType=d.getBlockchainType(t)}static from(t,n,r){return new a(t,n,r)}getAddressLink(t){return(o[this.chainType]??o.default).address(this.explorerUrl,t,this.network)}getTxLink(t){const n=this.extractTxHash(t);return(o[this.chainType]??o.default).tx(this.explorerUrl,n,this.network)}extractTxHash(t){var n,r;return((r=(n=t.split(",").at(-1))==null?void 0:n.split(":").at(0))==null?void 0:r.trim())??""}}exports.ExplorerUrlBuilder=a;
package/dist/index9.js CHANGED
@@ -1,44 +1,44 @@
1
- import { Url as s, Network as a } from "@gardenfi/utils";
1
+ import { Url as s, Network as d } from "@gardenfi/utils";
2
2
  import { getBlockchainType as c } from "./index4.js";
3
3
  import { BlockchainType as i } from "./index3.js";
4
4
  const o = {
5
5
  [i.bitcoin]: {
6
- address: () => "",
7
- tx: (r, t) => new s("tx", r).endpoint(t).toString()
6
+ address: (e, t) => new s("address", e).endpoint(t).toString(),
7
+ tx: (e, t) => new s("tx", e).endpoint(t).toString()
8
8
  },
9
9
  [i.tron]: {
10
- address: (r, t) => `${r}/#/address/${t}`,
11
- tx: (r, t) => `${r}/#/transaction/${t.slice(2)}`
10
+ address: (e, t) => `${e}/#/address/${t}`,
11
+ tx: (e, t) => `${e}/#/transaction/${t.slice(2)}`
12
12
  },
13
13
  [i.starknet]: {
14
- address: (r, t) => new s("contract", r).endpoint(t).toString(),
15
- tx: (r, t) => new s("tx", r).endpoint(t).toString()
14
+ address: (e, t) => new s("contract", e).endpoint(t).toString(),
15
+ tx: (e, t) => new s("tx", e).endpoint(t).toString()
16
16
  },
17
17
  [i.xrpl]: {
18
- address: (r, t) => new s("accounts", r).endpoint(t).toString(),
19
- tx: (r, t) => new s("transactions", r).endpoint(t).toString()
18
+ address: (e, t) => new s("accounts", e).endpoint(t).toString(),
19
+ tx: (e, t) => new s("transactions", e).endpoint(t).toString()
20
20
  },
21
21
  [i.solana]: {
22
- address: (r, t, n) => {
23
- let e = new s("address", r).endpoint(t);
24
- return n === a.TESTNET && (e = e.addSearchParams({ cluster: "devnet" })), e.toString();
22
+ address: (e, t, n) => {
23
+ let r = new s("address", e).endpoint(t);
24
+ return n === d.TESTNET && (r = r.addSearchParams({ cluster: "devnet" })), r.toString();
25
25
  },
26
- tx: (r, t, n) => {
27
- let e = new s("tx", r).endpoint(t);
28
- return n === a.TESTNET && (e = e.addSearchParams({ cluster: "devnet" })), e.toString();
26
+ tx: (e, t, n) => {
27
+ let r = new s("tx", e).endpoint(t);
28
+ return n === d.TESTNET && (r = r.addSearchParams({ cluster: "devnet" })), r.toString();
29
29
  }
30
30
  },
31
31
  default: {
32
- address: (r, t) => new s("address", r).endpoint(t).toString(),
33
- tx: (r, t) => new s("tx", r).endpoint(t).toString()
32
+ address: (e, t) => new s("address", e).endpoint(t).toString(),
33
+ tx: (e, t) => new s("tx", e).endpoint(t).toString()
34
34
  }
35
35
  };
36
- class d {
37
- constructor(t, n, e) {
38
- this.explorerUrl = n, this.network = e, this.chainType = c(t);
36
+ class a {
37
+ constructor(t, n, r) {
38
+ this.explorerUrl = n, this.network = r, this.chainType = c(t);
39
39
  }
40
- static from(t, n, e) {
41
- return new d(t, n, e);
40
+ static from(t, n, r) {
41
+ return new a(t, n, r);
42
42
  }
43
43
  getAddressLink(t) {
44
44
  return (o[this.chainType] ?? o.default).address(this.explorerUrl, t, this.network);
@@ -48,10 +48,10 @@ class d {
48
48
  return (o[this.chainType] ?? o.default).tx(this.explorerUrl, n, this.network);
49
49
  }
50
50
  extractTxHash(t) {
51
- var n, e;
52
- return ((e = (n = t.split(",").at(-1)) == null ? void 0 : n.split(":").at(0)) == null ? void 0 : e.trim()) ?? "";
51
+ var n, r;
52
+ return ((r = (n = t.split(",").at(-1)) == null ? void 0 : n.split(":").at(0)) == null ? void 0 : r.trim()) ?? "";
53
53
  }
54
54
  }
55
55
  export {
56
- d as ExplorerUrlBuilder
56
+ a as ExplorerUrlBuilder
57
57
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/orderbook",
3
- "version": "3.1.3-beta.1",
3
+ "version": "3.1.3-beta.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",