@avail-project/ca-common 1.0.1 → 2.1.0
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/cjs/evmabi/fibrousrouter.abi.js +41 -0
- package/dist/cjs/evmabi/index.js +1 -0
- package/dist/cjs/proto/definition.js +153 -4
- package/dist/cjs/xcs/autochoice.js +96 -237
- package/dist/cjs/xcs/bebop-agg.js +34 -5
- package/dist/cjs/xcs/fibrous-agg.js +149 -0
- package/dist/cjs/xcs/index.js +1 -1
- package/dist/cjs/xcs/lifi-agg.js +34 -5
- package/dist/esm/evmabi/fibrousrouter.abi.js +38 -0
- package/dist/esm/evmabi/index.js +1 -0
- package/dist/esm/proto/definition.js +151 -3
- package/dist/esm/xcs/autochoice.js +98 -238
- package/dist/esm/xcs/bebop-agg.js +34 -5
- package/dist/esm/xcs/fibrous-agg.js +144 -0
- package/dist/esm/xcs/index.js +1 -1
- package/dist/esm/xcs/lifi-agg.js +34 -5
- package/dist/types/evmabi/fibrousrouter.abi.d.ts +77 -0
- package/dist/types/evmabi/index.d.ts +1 -0
- package/dist/types/proto/definition.d.ts +9 -0
- package/dist/types/xcs/autochoice.d.ts +6 -52
- package/dist/types/xcs/bebop-agg.d.ts +2 -2
- package/dist/types/xcs/fibrous-agg.d.ts +54 -0
- package/dist/types/xcs/iface.d.ts +37 -5
- package/dist/types/xcs/index.d.ts +1 -1
- package/dist/types/xcs/lifi-agg.d.ts +18 -14
- package/package.json +5 -2
- package/dist/cjs/xcs/yieldyak-agg.js +0 -113
- package/dist/esm/xcs/yieldyak-agg.js +0 -109
- package/dist/types/xcs/yieldyak-agg.d.ts +0 -21
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FibrousAggregator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const axios_1 = tslib_1.__importStar(require("axios"));
|
|
6
|
+
const decimal_js_1 = tslib_1.__importDefault(require("decimal.js"));
|
|
7
|
+
const viem_1 = require("viem");
|
|
8
|
+
const data_1 = require("../data");
|
|
9
|
+
const evmabi_1 = require("../evmabi");
|
|
10
|
+
const definition_1 = require("../proto/definition");
|
|
11
|
+
const iface_1 = require("./iface");
|
|
12
|
+
const ChainNameMapping = new data_1.ChainIDKeyedMap([
|
|
13
|
+
[new data_1.OmniversalChainID(definition_1.Universe.ETHEREUM, 8453), "base"],
|
|
14
|
+
[new data_1.OmniversalChainID(definition_1.Universe.ETHEREUM, 999), "hyperevm"],
|
|
15
|
+
[new data_1.OmniversalChainID(definition_1.Universe.ETHEREUM, 143), "monad"],
|
|
16
|
+
[new data_1.OmniversalChainID(definition_1.Universe.ETHEREUM, 4114), "citrea"],
|
|
17
|
+
]);
|
|
18
|
+
class FibrousAggregator {
|
|
19
|
+
static BASE_URL = "https://api.fibrous.finance";
|
|
20
|
+
axios;
|
|
21
|
+
slippage;
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
const { apiKey, slippage = 0.5 } = options;
|
|
24
|
+
this.slippage = slippage;
|
|
25
|
+
this.axios = axios_1.default.create({
|
|
26
|
+
baseURL: FibrousAggregator.BASE_URL,
|
|
27
|
+
headers: apiKey != null ? { "X-API-Key": apiKey } : undefined,
|
|
28
|
+
timeout: 10_000,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async getQuotes(requests) {
|
|
32
|
+
const list = await Promise.allSettled(requests.map(async (r) => {
|
|
33
|
+
if (r.type === iface_1.QuoteType.EXACT_OUT) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
if (r.chain.universe !== definition_1.Universe.ETHEREUM) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const chainName = ChainNameMapping.get(r.chain);
|
|
40
|
+
if (chainName == null) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const inputTokenAddr = (0, viem_1.getAddress)((0, viem_1.bytesToHex)(r.inputToken.subarray(12)));
|
|
44
|
+
const outputTokenAddr = (0, viem_1.getAddress)((0, viem_1.bytesToHex)(r.outputToken.subarray(12)));
|
|
45
|
+
const userAddrHex = (0, viem_1.getAddress)((0, viem_1.bytesToHex)(r.userAddress.subarray(12)));
|
|
46
|
+
let resp;
|
|
47
|
+
try {
|
|
48
|
+
resp = await this.axios({
|
|
49
|
+
method: "GET",
|
|
50
|
+
url: `/${chainName}/v2/routeAndCallData`,
|
|
51
|
+
params: {
|
|
52
|
+
amount: r.inputAmount.toString(),
|
|
53
|
+
tokenInAddress: inputTokenAddr,
|
|
54
|
+
tokenOutAddress: outputTokenAddr,
|
|
55
|
+
slippage: this.slippage,
|
|
56
|
+
destination: userAddrHex,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
if (e instanceof axios_1.AxiosError && e.isAxiosError) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
throw e;
|
|
65
|
+
}
|
|
66
|
+
if (!resp.data.route.success) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (resp.data.calldata.swap_parameters.length === 0) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const inputAmountInDecimal = new decimal_js_1.default(resp.data.route.inputAmount)
|
|
73
|
+
.div(decimal_js_1.default.pow(10, resp.data.route.inputToken.decimals))
|
|
74
|
+
.toFixed(resp.data.route.inputToken.decimals);
|
|
75
|
+
const outputAmountInDecimal = new decimal_js_1.default(resp.data.calldata.route.min_received)
|
|
76
|
+
.div(decimal_js_1.default.pow(10, resp.data.route.outputToken.decimals))
|
|
77
|
+
.toFixed(resp.data.route.outputToken.decimals);
|
|
78
|
+
const routerAddress = (0, viem_1.getAddress)(resp.data.router_address);
|
|
79
|
+
const isNativeInput = resp.data.calldata.route.swap_type === 0;
|
|
80
|
+
const quote = {
|
|
81
|
+
originalResponse: resp.data,
|
|
82
|
+
input: {
|
|
83
|
+
amount: inputAmountInDecimal,
|
|
84
|
+
amountRaw: BigInt(resp.data.route.inputAmount),
|
|
85
|
+
contractAddress: inputTokenAddr,
|
|
86
|
+
decimals: resp.data.route.inputToken.decimals,
|
|
87
|
+
value: decimal_js_1.default.mul(inputAmountInDecimal, resp.data.route.inputToken.price ?? 0).toNumber(),
|
|
88
|
+
symbol: resp.data.route.inputToken.symbol ??
|
|
89
|
+
resp.data.route.inputToken.name,
|
|
90
|
+
},
|
|
91
|
+
output: {
|
|
92
|
+
amount: outputAmountInDecimal,
|
|
93
|
+
amountRaw: BigInt(resp.data.calldata.route.min_received),
|
|
94
|
+
contractAddress: outputTokenAddr,
|
|
95
|
+
decimals: resp.data.route.outputToken.decimals,
|
|
96
|
+
value: decimal_js_1.default.mul(outputAmountInDecimal, resp.data.route.outputToken.price ?? 0).toNumber(),
|
|
97
|
+
symbol: resp.data.route.outputToken.symbol ??
|
|
98
|
+
resp.data.route.outputToken.name,
|
|
99
|
+
},
|
|
100
|
+
txData: {
|
|
101
|
+
approvalAddress: isNativeInput ? viem_1.zeroAddress : routerAddress,
|
|
102
|
+
tx: {
|
|
103
|
+
to: routerAddress,
|
|
104
|
+
value: isNativeInput
|
|
105
|
+
? (0, viem_1.toHex)(BigInt(resp.data.calldata.route.amount_in))
|
|
106
|
+
: (0, viem_1.toHex)(0),
|
|
107
|
+
data: (0, viem_1.encodeFunctionData)({
|
|
108
|
+
abi: evmabi_1.FibrousRouterABI,
|
|
109
|
+
functionName: "swap",
|
|
110
|
+
args: [
|
|
111
|
+
{
|
|
112
|
+
token_in: (0, viem_1.getAddress)(resp.data.calldata.route.token_in),
|
|
113
|
+
token_out: (0, viem_1.getAddress)(resp.data.calldata.route.token_out),
|
|
114
|
+
amount_in: BigInt(resp.data.calldata.route.amount_in),
|
|
115
|
+
amount_out: BigInt(resp.data.calldata.route.amount_out),
|
|
116
|
+
min_received: BigInt(resp.data.calldata.route.min_received),
|
|
117
|
+
destination: (0, viem_1.getAddress)(resp.data.calldata.route.destination),
|
|
118
|
+
swap_type: resp.data.calldata.route.swap_type,
|
|
119
|
+
},
|
|
120
|
+
resp.data.calldata.swap_parameters.map((swapParameter) => ({
|
|
121
|
+
token_in: (0, viem_1.getAddress)(swapParameter.token_in),
|
|
122
|
+
token_out: (0, viem_1.getAddress)(swapParameter.token_out),
|
|
123
|
+
rate: Number.parseInt(swapParameter.rate, 10),
|
|
124
|
+
protocol_id: Number.parseInt(swapParameter.protocol_id, 10),
|
|
125
|
+
pool_address: (0, viem_1.getAddress)(swapParameter.pool_address),
|
|
126
|
+
swap_type: swapParameter.swap_type,
|
|
127
|
+
extra_data: swapParameter.extra_data,
|
|
128
|
+
})),
|
|
129
|
+
],
|
|
130
|
+
}),
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
return quote;
|
|
135
|
+
}));
|
|
136
|
+
return list.map((item) => {
|
|
137
|
+
switch (item.status) {
|
|
138
|
+
case "fulfilled": {
|
|
139
|
+
return item.value;
|
|
140
|
+
}
|
|
141
|
+
case "rejected": {
|
|
142
|
+
console.error("Caught error in fetching Fibrous quotes:", item.reason);
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.FibrousAggregator = FibrousAggregator;
|
package/dist/cjs/xcs/index.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./iface"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./lifi-agg"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./yieldyak-agg"), exports);
|
|
7
6
|
tslib_1.__exportStar(require("./bebop-agg"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./fibrous-agg"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./autochoice"), exports);
|
package/dist/cjs/xcs/lifi-agg.js
CHANGED
|
@@ -6,11 +6,13 @@ const axios_1 = tslib_1.__importStar(require("axios"));
|
|
|
6
6
|
const viem_1 = require("viem");
|
|
7
7
|
const iface_1 = require("./iface");
|
|
8
8
|
const definition_1 = require("../proto/definition");
|
|
9
|
+
const decimal_js_1 = tslib_1.__importDefault(require("decimal.js"));
|
|
9
10
|
class LiFiAggregator {
|
|
10
11
|
static BASE_URL_V1 = "https://li.quest/v1";
|
|
11
12
|
static COMMON_OPTIONS = {
|
|
12
13
|
denyExchanges: "openocean",
|
|
13
14
|
slippage: "0.01",
|
|
15
|
+
skipSimulation: true,
|
|
14
16
|
};
|
|
15
17
|
axios;
|
|
16
18
|
constructor(apiKey) {
|
|
@@ -19,6 +21,7 @@ class LiFiAggregator {
|
|
|
19
21
|
headers: {
|
|
20
22
|
"x-lifi-api-key": apiKey,
|
|
21
23
|
},
|
|
24
|
+
timeout: 10_000,
|
|
22
25
|
});
|
|
23
26
|
}
|
|
24
27
|
async getQuotes(requests) {
|
|
@@ -80,12 +83,38 @@ class LiFiAggregator {
|
|
|
80
83
|
}
|
|
81
84
|
throw e;
|
|
82
85
|
}
|
|
86
|
+
const { estimate, transactionRequest: { to, value, data }, action: { fromToken, toToken }, } = resp.data;
|
|
87
|
+
const inputAmountInDecimal = new decimal_js_1.default(estimate.fromAmount)
|
|
88
|
+
.div(decimal_js_1.default.pow(10, fromToken.decimals))
|
|
89
|
+
.toFixed(fromToken.decimals);
|
|
90
|
+
const outputAmountInDecimal = new decimal_js_1.default(estimate.toAmountMin)
|
|
91
|
+
.div(decimal_js_1.default.pow(10, toToken.decimals))
|
|
92
|
+
.toFixed(toToken.decimals);
|
|
83
93
|
return {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
94
|
+
input: {
|
|
95
|
+
amount: inputAmountInDecimal,
|
|
96
|
+
amountRaw: BigInt(estimate.fromAmount),
|
|
97
|
+
contractAddress: inputTokenAddr,
|
|
98
|
+
decimals: fromToken.decimals,
|
|
99
|
+
value: decimal_js_1.default.mul(inputAmountInDecimal, fromToken.priceUSD).toNumber(),
|
|
100
|
+
symbol: fromToken.symbol,
|
|
101
|
+
},
|
|
102
|
+
output: {
|
|
103
|
+
amount: outputAmountInDecimal,
|
|
104
|
+
amountRaw: BigInt(estimate.toAmountMin),
|
|
105
|
+
contractAddress: outputTokenAddr,
|
|
106
|
+
decimals: toToken.decimals,
|
|
107
|
+
value: decimal_js_1.default.mul(outputAmountInDecimal, toToken.priceUSD).toNumber(),
|
|
108
|
+
symbol: toToken.symbol,
|
|
109
|
+
},
|
|
110
|
+
txData: {
|
|
111
|
+
approvalAddress: estimate.approvalAddress,
|
|
112
|
+
tx: {
|
|
113
|
+
to,
|
|
114
|
+
value,
|
|
115
|
+
data,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
89
118
|
};
|
|
90
119
|
}));
|
|
91
120
|
return list.map((item) => {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const FibrousRouterABI = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{
|
|
5
|
+
components: [
|
|
6
|
+
{ internalType: "address", name: "token_in", type: "address" },
|
|
7
|
+
{ internalType: "address", name: "token_out", type: "address" },
|
|
8
|
+
{ internalType: "uint256", name: "amount_in", type: "uint256" },
|
|
9
|
+
{ internalType: "uint256", name: "amount_out", type: "uint256" },
|
|
10
|
+
{ internalType: "uint256", name: "min_received", type: "uint256" },
|
|
11
|
+
{ internalType: "address", name: "destination", type: "address" },
|
|
12
|
+
{ internalType: "uint8", name: "swap_type", type: "uint8" },
|
|
13
|
+
],
|
|
14
|
+
internalType: "struct IFibrousRouter.RouteParam",
|
|
15
|
+
name: "route",
|
|
16
|
+
type: "tuple",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
components: [
|
|
20
|
+
{ internalType: "address", name: "token_in", type: "address" },
|
|
21
|
+
{ internalType: "address", name: "token_out", type: "address" },
|
|
22
|
+
{ internalType: "uint32", name: "rate", type: "uint32" },
|
|
23
|
+
{ internalType: "int24", name: "protocol_id", type: "int24" },
|
|
24
|
+
{ internalType: "address", name: "pool_address", type: "address" },
|
|
25
|
+
{ internalType: "uint8", name: "swap_type", type: "uint8" },
|
|
26
|
+
{ internalType: "bytes", name: "extra_data", type: "bytes" },
|
|
27
|
+
],
|
|
28
|
+
internalType: "struct IFibrousRouter.SwapParams[]",
|
|
29
|
+
name: "swap_parameters",
|
|
30
|
+
type: "tuple[]",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
name: "swap",
|
|
34
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
35
|
+
stateMutability: "payable",
|
|
36
|
+
type: "function",
|
|
37
|
+
},
|
|
38
|
+
];
|
package/dist/esm/evmabi/index.js
CHANGED
|
@@ -2771,8 +2771,91 @@ export const AdminFeeRecipient = {
|
|
|
2771
2771
|
return message;
|
|
2772
2772
|
},
|
|
2773
2773
|
};
|
|
2774
|
+
function createBasePerChainFeeBP() {
|
|
2775
|
+
return { universe: 0, chainID: new Uint8Array(0), feeBP: Long.UZERO };
|
|
2776
|
+
}
|
|
2777
|
+
export const PerChainFeeBP = {
|
|
2778
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2779
|
+
if (message.universe !== 0) {
|
|
2780
|
+
writer.uint32(8).int32(message.universe);
|
|
2781
|
+
}
|
|
2782
|
+
if (message.chainID.length !== 0) {
|
|
2783
|
+
writer.uint32(18).bytes(message.chainID);
|
|
2784
|
+
}
|
|
2785
|
+
if (!message.feeBP.equals(Long.UZERO)) {
|
|
2786
|
+
writer.uint32(24).uint64(message.feeBP.toString());
|
|
2787
|
+
}
|
|
2788
|
+
return writer;
|
|
2789
|
+
},
|
|
2790
|
+
decode(input, length) {
|
|
2791
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2792
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2793
|
+
const message = createBasePerChainFeeBP();
|
|
2794
|
+
while (reader.pos < end) {
|
|
2795
|
+
const tag = reader.uint32();
|
|
2796
|
+
switch (tag >>> 3) {
|
|
2797
|
+
case 1: {
|
|
2798
|
+
if (tag !== 8) {
|
|
2799
|
+
break;
|
|
2800
|
+
}
|
|
2801
|
+
message.universe = reader.int32();
|
|
2802
|
+
continue;
|
|
2803
|
+
}
|
|
2804
|
+
case 2: {
|
|
2805
|
+
if (tag !== 18) {
|
|
2806
|
+
break;
|
|
2807
|
+
}
|
|
2808
|
+
message.chainID = reader.bytes();
|
|
2809
|
+
continue;
|
|
2810
|
+
}
|
|
2811
|
+
case 3: {
|
|
2812
|
+
if (tag !== 24) {
|
|
2813
|
+
break;
|
|
2814
|
+
}
|
|
2815
|
+
message.feeBP = Long.fromString(reader.uint64().toString(), true);
|
|
2816
|
+
continue;
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2820
|
+
break;
|
|
2821
|
+
}
|
|
2822
|
+
reader.skip(tag & 7);
|
|
2823
|
+
}
|
|
2824
|
+
return message;
|
|
2825
|
+
},
|
|
2826
|
+
fromJSON(object) {
|
|
2827
|
+
return {
|
|
2828
|
+
universe: isSet(object.universe) ? universeFromJSON(object.universe) : 0,
|
|
2829
|
+
chainID: isSet(object.chainID) ? bytesFromBase64(object.chainID) : new Uint8Array(0),
|
|
2830
|
+
feeBP: isSet(object.feeBP) ? Long.fromValue(object.feeBP) : Long.UZERO,
|
|
2831
|
+
};
|
|
2832
|
+
},
|
|
2833
|
+
toJSON(message) {
|
|
2834
|
+
const obj = {};
|
|
2835
|
+
if (message.universe !== 0) {
|
|
2836
|
+
obj.universe = universeToJSON(message.universe);
|
|
2837
|
+
}
|
|
2838
|
+
if (message.chainID.length !== 0) {
|
|
2839
|
+
obj.chainID = base64FromBytes(message.chainID);
|
|
2840
|
+
}
|
|
2841
|
+
if (!message.feeBP.equals(Long.UZERO)) {
|
|
2842
|
+
obj.feeBP = (message.feeBP || Long.UZERO).toString();
|
|
2843
|
+
}
|
|
2844
|
+
return obj;
|
|
2845
|
+
},
|
|
2846
|
+
create(base) {
|
|
2847
|
+
return PerChainFeeBP.fromPartial(base ?? {});
|
|
2848
|
+
},
|
|
2849
|
+
fromPartial(object) {
|
|
2850
|
+
const message = createBasePerChainFeeBP();
|
|
2851
|
+
message.universe = object.universe ?? 0;
|
|
2852
|
+
message.chainID = object.chainID ?? new Uint8Array(0);
|
|
2853
|
+
message.feeBP = (object.feeBP !== undefined && object.feeBP !== null) ? Long.fromValue(object.feeBP) : Long.UZERO;
|
|
2854
|
+
return message;
|
|
2855
|
+
},
|
|
2856
|
+
};
|
|
2774
2857
|
function createBaseProtocolFees() {
|
|
2775
|
-
return { feeBP: Long.UZERO, collectionFees: [], fulfilmentFees: [], admin: "", feeRecipients: [] };
|
|
2858
|
+
return { feeBP: Long.UZERO, collectionFees: [], fulfilmentFees: [], admin: "", feeRecipients: [], perChainFeeBP: [] };
|
|
2776
2859
|
}
|
|
2777
2860
|
export const ProtocolFees = {
|
|
2778
2861
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -2791,6 +2874,9 @@ export const ProtocolFees = {
|
|
|
2791
2874
|
for (const v of message.feeRecipients) {
|
|
2792
2875
|
AdminFeeRecipient.encode(v, writer.uint32(42).fork()).join();
|
|
2793
2876
|
}
|
|
2877
|
+
for (const v of message.perChainFeeBP) {
|
|
2878
|
+
PerChainFeeBP.encode(v, writer.uint32(50).fork()).join();
|
|
2879
|
+
}
|
|
2794
2880
|
return writer;
|
|
2795
2881
|
},
|
|
2796
2882
|
decode(input, length) {
|
|
@@ -2835,6 +2921,13 @@ export const ProtocolFees = {
|
|
|
2835
2921
|
message.feeRecipients.push(AdminFeeRecipient.decode(reader, reader.uint32()));
|
|
2836
2922
|
continue;
|
|
2837
2923
|
}
|
|
2924
|
+
case 6: {
|
|
2925
|
+
if (tag !== 50) {
|
|
2926
|
+
break;
|
|
2927
|
+
}
|
|
2928
|
+
message.perChainFeeBP.push(PerChainFeeBP.decode(reader, reader.uint32()));
|
|
2929
|
+
continue;
|
|
2930
|
+
}
|
|
2838
2931
|
}
|
|
2839
2932
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2840
2933
|
break;
|
|
@@ -2856,6 +2949,9 @@ export const ProtocolFees = {
|
|
|
2856
2949
|
feeRecipients: globalThis.Array.isArray(object?.feeRecipients)
|
|
2857
2950
|
? object.feeRecipients.map((e) => AdminFeeRecipient.fromJSON(e))
|
|
2858
2951
|
: [],
|
|
2952
|
+
perChainFeeBP: globalThis.Array.isArray(object?.perChainFeeBP)
|
|
2953
|
+
? object.perChainFeeBP.map((e) => PerChainFeeBP.fromJSON(e))
|
|
2954
|
+
: [],
|
|
2859
2955
|
};
|
|
2860
2956
|
},
|
|
2861
2957
|
toJSON(message) {
|
|
@@ -2875,6 +2971,9 @@ export const ProtocolFees = {
|
|
|
2875
2971
|
if (message.feeRecipients?.length) {
|
|
2876
2972
|
obj.feeRecipients = message.feeRecipients.map((e) => AdminFeeRecipient.toJSON(e));
|
|
2877
2973
|
}
|
|
2974
|
+
if (message.perChainFeeBP?.length) {
|
|
2975
|
+
obj.perChainFeeBP = message.perChainFeeBP.map((e) => PerChainFeeBP.toJSON(e));
|
|
2976
|
+
}
|
|
2878
2977
|
return obj;
|
|
2879
2978
|
},
|
|
2880
2979
|
create(base) {
|
|
@@ -2887,6 +2986,7 @@ export const ProtocolFees = {
|
|
|
2887
2986
|
message.fulfilmentFees = object.fulfilmentFees?.map((e) => FixedFeeTuple.fromPartial(e)) || [];
|
|
2888
2987
|
message.admin = object.admin ?? "";
|
|
2889
2988
|
message.feeRecipients = object.feeRecipients?.map((e) => AdminFeeRecipient.fromPartial(e)) || [];
|
|
2989
|
+
message.perChainFeeBP = object.perChainFeeBP?.map((e) => PerChainFeeBP.fromPartial(e)) || [];
|
|
2890
2990
|
return message;
|
|
2891
2991
|
},
|
|
2892
2992
|
};
|
|
@@ -2981,7 +3081,14 @@ export const QueryGetProtocolFeesResponse = {
|
|
|
2981
3081
|
},
|
|
2982
3082
|
};
|
|
2983
3083
|
function createBaseMsgCreateProtocolFees() {
|
|
2984
|
-
return {
|
|
3084
|
+
return {
|
|
3085
|
+
creator: "",
|
|
3086
|
+
feeBP: Long.UZERO,
|
|
3087
|
+
collectionFees: [],
|
|
3088
|
+
fulfilmentFees: [],
|
|
3089
|
+
feeRecipients: [],
|
|
3090
|
+
perChainFeeBP: [],
|
|
3091
|
+
};
|
|
2985
3092
|
}
|
|
2986
3093
|
export const MsgCreateProtocolFees = {
|
|
2987
3094
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -3000,6 +3107,9 @@ export const MsgCreateProtocolFees = {
|
|
|
3000
3107
|
for (const v of message.feeRecipients) {
|
|
3001
3108
|
AdminFeeRecipient.encode(v, writer.uint32(42).fork()).join();
|
|
3002
3109
|
}
|
|
3110
|
+
for (const v of message.perChainFeeBP) {
|
|
3111
|
+
PerChainFeeBP.encode(v, writer.uint32(50).fork()).join();
|
|
3112
|
+
}
|
|
3003
3113
|
return writer;
|
|
3004
3114
|
},
|
|
3005
3115
|
decode(input, length) {
|
|
@@ -3044,6 +3154,13 @@ export const MsgCreateProtocolFees = {
|
|
|
3044
3154
|
message.feeRecipients.push(AdminFeeRecipient.decode(reader, reader.uint32()));
|
|
3045
3155
|
continue;
|
|
3046
3156
|
}
|
|
3157
|
+
case 6: {
|
|
3158
|
+
if (tag !== 50) {
|
|
3159
|
+
break;
|
|
3160
|
+
}
|
|
3161
|
+
message.perChainFeeBP.push(PerChainFeeBP.decode(reader, reader.uint32()));
|
|
3162
|
+
continue;
|
|
3163
|
+
}
|
|
3047
3164
|
}
|
|
3048
3165
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3049
3166
|
break;
|
|
@@ -3065,6 +3182,9 @@ export const MsgCreateProtocolFees = {
|
|
|
3065
3182
|
feeRecipients: globalThis.Array.isArray(object?.feeRecipients)
|
|
3066
3183
|
? object.feeRecipients.map((e) => AdminFeeRecipient.fromJSON(e))
|
|
3067
3184
|
: [],
|
|
3185
|
+
perChainFeeBP: globalThis.Array.isArray(object?.perChainFeeBP)
|
|
3186
|
+
? object.perChainFeeBP.map((e) => PerChainFeeBP.fromJSON(e))
|
|
3187
|
+
: [],
|
|
3068
3188
|
};
|
|
3069
3189
|
},
|
|
3070
3190
|
toJSON(message) {
|
|
@@ -3084,6 +3204,9 @@ export const MsgCreateProtocolFees = {
|
|
|
3084
3204
|
if (message.feeRecipients?.length) {
|
|
3085
3205
|
obj.feeRecipients = message.feeRecipients.map((e) => AdminFeeRecipient.toJSON(e));
|
|
3086
3206
|
}
|
|
3207
|
+
if (message.perChainFeeBP?.length) {
|
|
3208
|
+
obj.perChainFeeBP = message.perChainFeeBP.map((e) => PerChainFeeBP.toJSON(e));
|
|
3209
|
+
}
|
|
3087
3210
|
return obj;
|
|
3088
3211
|
},
|
|
3089
3212
|
create(base) {
|
|
@@ -3096,6 +3219,7 @@ export const MsgCreateProtocolFees = {
|
|
|
3096
3219
|
message.collectionFees = object.collectionFees?.map((e) => FixedFeeTuple.fromPartial(e)) || [];
|
|
3097
3220
|
message.fulfilmentFees = object.fulfilmentFees?.map((e) => FixedFeeTuple.fromPartial(e)) || [];
|
|
3098
3221
|
message.feeRecipients = object.feeRecipients?.map((e) => AdminFeeRecipient.fromPartial(e)) || [];
|
|
3222
|
+
message.perChainFeeBP = object.perChainFeeBP?.map((e) => PerChainFeeBP.fromPartial(e)) || [];
|
|
3099
3223
|
return message;
|
|
3100
3224
|
},
|
|
3101
3225
|
};
|
|
@@ -3137,7 +3261,14 @@ export const MsgCreateProtocolFeesResponse = {
|
|
|
3137
3261
|
},
|
|
3138
3262
|
};
|
|
3139
3263
|
function createBaseMsgUpdateProtocolFees() {
|
|
3140
|
-
return {
|
|
3264
|
+
return {
|
|
3265
|
+
creator: "",
|
|
3266
|
+
feeBP: Long.UZERO,
|
|
3267
|
+
collectionFees: [],
|
|
3268
|
+
fulfilmentFees: [],
|
|
3269
|
+
feeRecipients: [],
|
|
3270
|
+
perChainFeeBP: [],
|
|
3271
|
+
};
|
|
3141
3272
|
}
|
|
3142
3273
|
export const MsgUpdateProtocolFees = {
|
|
3143
3274
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -3156,6 +3287,9 @@ export const MsgUpdateProtocolFees = {
|
|
|
3156
3287
|
for (const v of message.feeRecipients) {
|
|
3157
3288
|
AdminFeeRecipient.encode(v, writer.uint32(42).fork()).join();
|
|
3158
3289
|
}
|
|
3290
|
+
for (const v of message.perChainFeeBP) {
|
|
3291
|
+
PerChainFeeBP.encode(v, writer.uint32(50).fork()).join();
|
|
3292
|
+
}
|
|
3159
3293
|
return writer;
|
|
3160
3294
|
},
|
|
3161
3295
|
decode(input, length) {
|
|
@@ -3200,6 +3334,13 @@ export const MsgUpdateProtocolFees = {
|
|
|
3200
3334
|
message.feeRecipients.push(AdminFeeRecipient.decode(reader, reader.uint32()));
|
|
3201
3335
|
continue;
|
|
3202
3336
|
}
|
|
3337
|
+
case 6: {
|
|
3338
|
+
if (tag !== 50) {
|
|
3339
|
+
break;
|
|
3340
|
+
}
|
|
3341
|
+
message.perChainFeeBP.push(PerChainFeeBP.decode(reader, reader.uint32()));
|
|
3342
|
+
continue;
|
|
3343
|
+
}
|
|
3203
3344
|
}
|
|
3204
3345
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3205
3346
|
break;
|
|
@@ -3221,6 +3362,9 @@ export const MsgUpdateProtocolFees = {
|
|
|
3221
3362
|
feeRecipients: globalThis.Array.isArray(object?.feeRecipients)
|
|
3222
3363
|
? object.feeRecipients.map((e) => AdminFeeRecipient.fromJSON(e))
|
|
3223
3364
|
: [],
|
|
3365
|
+
perChainFeeBP: globalThis.Array.isArray(object?.perChainFeeBP)
|
|
3366
|
+
? object.perChainFeeBP.map((e) => PerChainFeeBP.fromJSON(e))
|
|
3367
|
+
: [],
|
|
3224
3368
|
};
|
|
3225
3369
|
},
|
|
3226
3370
|
toJSON(message) {
|
|
@@ -3240,6 +3384,9 @@ export const MsgUpdateProtocolFees = {
|
|
|
3240
3384
|
if (message.feeRecipients?.length) {
|
|
3241
3385
|
obj.feeRecipients = message.feeRecipients.map((e) => AdminFeeRecipient.toJSON(e));
|
|
3242
3386
|
}
|
|
3387
|
+
if (message.perChainFeeBP?.length) {
|
|
3388
|
+
obj.perChainFeeBP = message.perChainFeeBP.map((e) => PerChainFeeBP.toJSON(e));
|
|
3389
|
+
}
|
|
3243
3390
|
return obj;
|
|
3244
3391
|
},
|
|
3245
3392
|
create(base) {
|
|
@@ -3252,6 +3399,7 @@ export const MsgUpdateProtocolFees = {
|
|
|
3252
3399
|
message.collectionFees = object.collectionFees?.map((e) => FixedFeeTuple.fromPartial(e)) || [];
|
|
3253
3400
|
message.fulfilmentFees = object.fulfilmentFees?.map((e) => FixedFeeTuple.fromPartial(e)) || [];
|
|
3254
3401
|
message.feeRecipients = object.feeRecipients?.map((e) => AdminFeeRecipient.fromPartial(e)) || [];
|
|
3402
|
+
message.perChainFeeBP = object.perChainFeeBP?.map((e) => PerChainFeeBP.fromPartial(e)) || [];
|
|
3255
3403
|
return message;
|
|
3256
3404
|
},
|
|
3257
3405
|
};
|