@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 +1 -1
- package/dist/index9.js +25 -25
- package/package.json +1 -1
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
|
|
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: (
|
|
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: (
|
|
11
|
-
tx: (
|
|
10
|
+
address: (e, t) => `${e}/#/address/${t}`,
|
|
11
|
+
tx: (e, t) => `${e}/#/transaction/${t.slice(2)}`
|
|
12
12
|
},
|
|
13
13
|
[i.starknet]: {
|
|
14
|
-
address: (
|
|
15
|
-
tx: (
|
|
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: (
|
|
19
|
-
tx: (
|
|
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: (
|
|
23
|
-
let
|
|
24
|
-
return n ===
|
|
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: (
|
|
27
|
-
let
|
|
28
|
-
return n ===
|
|
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: (
|
|
33
|
-
tx: (
|
|
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
|
|
37
|
-
constructor(t, n,
|
|
38
|
-
this.explorerUrl = n, this.network =
|
|
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,
|
|
41
|
-
return new
|
|
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,
|
|
52
|
-
return ((
|
|
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
|
-
|
|
56
|
+
a as ExplorerUrlBuilder
|
|
57
57
|
};
|