@gardenfi/orderbook 3.0.6-beta.2 → 3.0.6-beta.4
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/index7.cjs +1 -1
- package/dist/index7.js +19 -19
- package/package.json +2 -2
package/dist/index7.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@gardenfi/utils"),e=require("./index3.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@gardenfi/utils"),e=require("./index3.cjs"),_=(t,n,l)=>{const a=t.endpoint(n);return l&&Object.entries(l).forEach(([p,r])=>{r!==void 0&&(Array.isArray(r)?a.searchParams.append(p,r.join(",")):a.searchParams.append(p,r.toString()))}),a},c=t=>i.hasKeys(t,["typed_data","initiate_transaction"])&&typeof t.initiate_transaction=="object"&&t.initiate_transaction&&i.hasKeys(t.initiate_transaction,["to","value","data","gas_limit","chain_id"]),o=t=>i.hasKeys(t,["typed_data","initiate_transaction"])&&typeof t.initiate_transaction=="object"&&t.initiate_transaction&&i.hasKeys(t.initiate_transaction,["to","selector","calldata"]),s=t=>i.hasKeys(t,["to","amount"])&&typeof t.to=="string"&&typeof t.amount=="string",y=t=>i.hasKeys(t,["versioned_tx"])&&typeof t.versioned_tx=="string",u=t=>i.hasKeys(t,["ptb_bytes"])&&Array.isArray(t.ptb_bytes)&&t.ptb_bytes.every(n=>typeof n=="number"),d=t=>i.hasKeys(t,["order_id","escrow_create_tx"])&&typeof t.escrow_create_tx=="object"&&t.escrow_create_tx&&i.hasKeys(t.escrow_create_tx,["Account","Amount","CancelAfter","Condition","Destination","TransactionType"]),f=t=>i.hasKeys(t,["source_swap","destination_swap"])&&typeof t.source_swap=="object"&&typeof t.destination_swap=="object";function h(t){return c(t)?{type:e.BlockchainType.evm,...t}:o(t)?{type:e.BlockchainType.starknet,...t}:s(t)?{type:e.BlockchainType.bitcoin,...t}:y(t)?{type:e.BlockchainType.solana,...t}:u(t)?{type:e.BlockchainType.sui,...t}:d(t)?{type:e.BlockchainType.xrpl,...t}:null}function O(t){return c(t)?e.BlockchainType.evm:o(t)?e.BlockchainType.starknet:s(t)?e.BlockchainType.bitcoin:y(t)?e.BlockchainType.solana:u(t)?e.BlockchainType.sui:d(t)?e.BlockchainType.xrpl:null}exports.ConstructUrl=_;exports.discriminateOrderResponse=h;exports.getOrderResponseType=O;exports.isBitcoinOrderResponse=s;exports.isEvmOrderResponse=c;exports.isOrder=f;exports.isSolanaOrderResponse=y;exports.isStarknetOrderResponse=o;exports.isSuiOrderResponse=u;exports.isXrplOrderResponse=d;
|
package/dist/index7.js
CHANGED
|
@@ -5,34 +5,34 @@ const m = (t, a, c) => {
|
|
|
5
5
|
return c && Object.entries(c).forEach(([o, n]) => {
|
|
6
6
|
n !== void 0 && (Array.isArray(n) ? e.searchParams.append(o, n.join(",")) : e.searchParams.append(o, n.toString()));
|
|
7
7
|
}), e;
|
|
8
|
-
},
|
|
8
|
+
}, u = (t) => r(t, ["typed_data", "initiate_transaction"]) && typeof t.initiate_transaction == "object" && t.initiate_transaction && r(t.initiate_transaction, [
|
|
9
9
|
"to",
|
|
10
10
|
"value",
|
|
11
11
|
"data",
|
|
12
12
|
"gas_limit",
|
|
13
13
|
"chain_id"
|
|
14
|
-
]),
|
|
14
|
+
]), f = (t) => r(t, ["typed_data", "initiate_transaction"]) && typeof t.initiate_transaction == "object" && t.initiate_transaction && r(t.initiate_transaction, ["to", "selector", "calldata"]), _ = (t) => r(t, ["to", "amount"]) && typeof t.to == "string" && typeof t.amount == "string", d = (t) => r(t, ["versioned_tx"]) && typeof t.versioned_tx == "string", y = (t) => r(t, ["ptb_bytes"]) && Array.isArray(t.ptb_bytes) && t.ptb_bytes.every((a) => typeof a == "number"), l = (t) => r(t, ["order_id", "escrow_create_tx"]) && typeof t.escrow_create_tx == "object" && t.escrow_create_tx && r(t.escrow_create_tx, [
|
|
15
15
|
"Account",
|
|
16
16
|
"Amount",
|
|
17
17
|
"CancelAfter",
|
|
18
18
|
"Condition",
|
|
19
19
|
"Destination",
|
|
20
20
|
"TransactionType"
|
|
21
|
-
])
|
|
22
|
-
function
|
|
23
|
-
return
|
|
21
|
+
]), p = (t) => r(t, ["source_swap", "destination_swap"]) && typeof t.source_swap == "object" && typeof t.destination_swap == "object";
|
|
22
|
+
function O(t) {
|
|
23
|
+
return u(t) ? {
|
|
24
24
|
type: i.evm,
|
|
25
25
|
...t
|
|
26
|
-
} :
|
|
26
|
+
} : f(t) ? {
|
|
27
27
|
type: i.starknet,
|
|
28
28
|
...t
|
|
29
|
-
} :
|
|
29
|
+
} : _(t) ? {
|
|
30
30
|
type: i.bitcoin,
|
|
31
31
|
...t
|
|
32
|
-
} :
|
|
32
|
+
} : d(t) ? {
|
|
33
33
|
type: i.solana,
|
|
34
34
|
...t
|
|
35
|
-
} :
|
|
35
|
+
} : y(t) ? {
|
|
36
36
|
type: i.sui,
|
|
37
37
|
...t
|
|
38
38
|
} : l(t) ? {
|
|
@@ -40,18 +40,18 @@ function p(t) {
|
|
|
40
40
|
...t
|
|
41
41
|
} : null;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function x(t) {
|
|
44
|
+
return u(t) ? i.evm : f(t) ? i.starknet : _(t) ? i.bitcoin : d(t) ? i.solana : y(t) ? i.sui : l(t) ? i.xrpl : null;
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
47
47
|
m as ConstructUrl,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
O as discriminateOrderResponse,
|
|
49
|
+
x as getOrderResponseType,
|
|
50
|
+
_ as isBitcoinOrderResponse,
|
|
51
|
+
u as isEvmOrderResponse,
|
|
52
|
+
p as isOrder,
|
|
53
|
+
d as isSolanaOrderResponse,
|
|
54
|
+
f as isStarknetOrderResponse,
|
|
55
|
+
y as isSuiOrderResponse,
|
|
56
56
|
l as isXrplOrderResponse
|
|
57
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/orderbook",
|
|
3
|
-
"version": "3.0.6-beta.
|
|
3
|
+
"version": "3.0.6-beta.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@coral-xyz/anchor": "^0.31.1",
|
|
31
|
-
"@gardenfi/utils": "3.0.0-beta.
|
|
31
|
+
"@gardenfi/utils": "3.0.0-beta.6",
|
|
32
32
|
"bufferutil": "^4.0.8",
|
|
33
33
|
"node-cache": "^5.1.2",
|
|
34
34
|
"siwe": "^2.1.4",
|