@affluent-org/sdk 0.0.6 → 0.0.7
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/services/pool/index.js +24 -8
- package/dist/services/rfq-auction/index.js +15 -5
- package/dist/services/rfq-batch/index.d.ts +5 -25
- package/dist/services/rfq-batch/index.js +21 -7
- package/dist/services/share-vault/index.js +30 -10
- package/dist/services/strategy-vault/index.js +150 -50
- package/package.json +1 -1
|
@@ -112,13 +112,19 @@ class PoolServiceV1 {
|
|
|
112
112
|
// Owner
|
|
113
113
|
// ============================================================
|
|
114
114
|
async sendSetOwner(sender, params, value) {
|
|
115
|
-
|
|
115
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetOwnerMsg(this.ctx, params, value));
|
|
116
|
+
await trace.wait();
|
|
117
|
+
return trace;
|
|
116
118
|
}
|
|
117
119
|
async sendSetIrmConfig(sender, params, value) {
|
|
118
|
-
|
|
120
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetIrmConfigMsg(this.ctx, params, value));
|
|
121
|
+
await trace.wait();
|
|
122
|
+
return trace;
|
|
119
123
|
}
|
|
120
124
|
async sendSetFeeConfigurer(sender, params, value) {
|
|
121
|
-
|
|
125
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetFeeConfigurerMsg(this.ctx, params, value));
|
|
126
|
+
await trace.wait();
|
|
127
|
+
return trace;
|
|
122
128
|
}
|
|
123
129
|
// ============================================================
|
|
124
130
|
// User
|
|
@@ -127,7 +133,7 @@ class PoolServiceV1 {
|
|
|
127
133
|
const msg = await user.createSupplyMsg(this.ctx, sender, params, value);
|
|
128
134
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
129
135
|
const asset = (0, utils_1.toAddress)(params.assetAddress);
|
|
130
|
-
|
|
136
|
+
const trace = await trace_1.PoolSupplyTracer.create({
|
|
131
137
|
ctx: this.ctx,
|
|
132
138
|
msgBody: msg.input.body,
|
|
133
139
|
extHash: await result.getExternalHash(),
|
|
@@ -136,12 +142,14 @@ class PoolServiceV1 {
|
|
|
136
142
|
pool: (0, utils_1.toAddress)(params.poolAddress),
|
|
137
143
|
isWTON: this.ctx.isWTON(asset),
|
|
138
144
|
});
|
|
145
|
+
await trace.wait();
|
|
146
|
+
return trace;
|
|
139
147
|
}
|
|
140
148
|
async sendWithdraw(sender, params, value) {
|
|
141
149
|
const msg = await user.createWithdrawMsg(this.ctx, sender, params, value);
|
|
142
150
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
143
151
|
const asset = (0, utils_1.toAddress)(params.assetAddress);
|
|
144
|
-
|
|
152
|
+
const trace = await trace_1.PoolWithdrawTracer.create({
|
|
145
153
|
ctx: this.ctx,
|
|
146
154
|
msgBody: msg.input.body,
|
|
147
155
|
extHash: await result.getExternalHash(),
|
|
@@ -150,12 +158,14 @@ class PoolServiceV1 {
|
|
|
150
158
|
pool: (0, utils_1.toAddress)(params.poolAddress),
|
|
151
159
|
isWTON: this.ctx.isWTON(asset),
|
|
152
160
|
});
|
|
161
|
+
await trace.wait();
|
|
162
|
+
return trace;
|
|
153
163
|
}
|
|
154
164
|
async sendBorrow(sender, params, value) {
|
|
155
165
|
const msg = await user.createBorrowMsg(this.ctx, sender, params, value);
|
|
156
166
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
157
167
|
const asset = (0, utils_1.toAddress)(params.assetAddress);
|
|
158
|
-
|
|
168
|
+
const trace = await trace_1.PoolBorrowTracer.create({
|
|
159
169
|
ctx: this.ctx,
|
|
160
170
|
msgBody: msg.input.body,
|
|
161
171
|
extHash: await result.getExternalHash(),
|
|
@@ -164,12 +174,14 @@ class PoolServiceV1 {
|
|
|
164
174
|
pool: (0, utils_1.toAddress)(params.poolAddress),
|
|
165
175
|
isWTON: this.ctx.isWTON(asset),
|
|
166
176
|
});
|
|
177
|
+
await trace.wait();
|
|
178
|
+
return trace;
|
|
167
179
|
}
|
|
168
180
|
async sendRepay(sender, params, value) {
|
|
169
181
|
const msg = await user.createRepayMsg(this.ctx, sender, params, value);
|
|
170
182
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
171
183
|
const asset = (0, utils_1.toAddress)(params.assetAddress);
|
|
172
|
-
|
|
184
|
+
const trace = await trace_1.PoolRepayTracer.create({
|
|
173
185
|
ctx: this.ctx,
|
|
174
186
|
msgBody: msg.input.body,
|
|
175
187
|
extHash: await result.getExternalHash(),
|
|
@@ -178,9 +190,13 @@ class PoolServiceV1 {
|
|
|
178
190
|
pool: (0, utils_1.toAddress)(params.poolAddress),
|
|
179
191
|
isWTON: this.ctx.isWTON(asset),
|
|
180
192
|
});
|
|
193
|
+
await trace.wait();
|
|
194
|
+
return trace;
|
|
181
195
|
}
|
|
182
196
|
async sendLiquidate(sender, params, value) {
|
|
183
|
-
|
|
197
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createLiquidateMsg(this.ctx, sender, params, value));
|
|
198
|
+
await trace.wait();
|
|
199
|
+
return trace;
|
|
184
200
|
}
|
|
185
201
|
}
|
|
186
202
|
exports.PoolServiceV1 = PoolServiceV1;
|
|
@@ -81,7 +81,7 @@ class RFQAuctionServiceV1 {
|
|
|
81
81
|
const msg = await user.createAmountBidMsg(this.ctx, sender, params, value);
|
|
82
82
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
83
83
|
const bidAsset = (0, utils_1.toAddress)(params.bidAsset);
|
|
84
|
-
|
|
84
|
+
const trace = await trace_1.RFQAuctionBidTracer.create({
|
|
85
85
|
ctx: this.ctx,
|
|
86
86
|
msgBody: msg.input.body,
|
|
87
87
|
extHash: await result.getExternalHash(),
|
|
@@ -90,12 +90,14 @@ class RFQAuctionServiceV1 {
|
|
|
90
90
|
rfqAuction: (0, utils_1.toAddress)(params.rfqAuctionAddress),
|
|
91
91
|
isWTON: this.ctx.isWTON(bidAsset),
|
|
92
92
|
});
|
|
93
|
+
await trace.wait();
|
|
94
|
+
return trace;
|
|
93
95
|
}
|
|
94
96
|
async sendSlippageBid(sender, params, value) {
|
|
95
97
|
const msg = await user.createSlippageBidMsg(this.ctx, sender, params, value);
|
|
96
98
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
97
99
|
const bidAsset = (0, utils_1.toAddress)(params.bidAsset);
|
|
98
|
-
|
|
100
|
+
const trace = await trace_1.RFQAuctionBidTracer.create({
|
|
99
101
|
ctx: this.ctx,
|
|
100
102
|
msgBody: msg.input.body,
|
|
101
103
|
extHash: await result.getExternalHash(),
|
|
@@ -104,12 +106,14 @@ class RFQAuctionServiceV1 {
|
|
|
104
106
|
rfqAuction: (0, utils_1.toAddress)(params.rfqAuctionAddress),
|
|
105
107
|
isWTON: this.ctx.isWTON(bidAsset),
|
|
106
108
|
});
|
|
109
|
+
await trace.wait();
|
|
110
|
+
return trace;
|
|
107
111
|
}
|
|
108
112
|
async sendCancelBid(sender, params, value) {
|
|
109
113
|
const rfqData = await this.getRFQData(params.rfqAuctionAddress);
|
|
110
114
|
const msg = await user.createCancelBidMsg(this.ctx, params, value);
|
|
111
115
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
112
|
-
|
|
116
|
+
const trace = await trace_1.RFQAuctionCancelBidTracer.create({
|
|
113
117
|
ctx: this.ctx,
|
|
114
118
|
msgBody: msg.input.body,
|
|
115
119
|
extHash: await result.getExternalHash(),
|
|
@@ -118,15 +122,21 @@ class RFQAuctionServiceV1 {
|
|
|
118
122
|
rfqAuction: (0, utils_1.toAddress)(params.rfqAuctionAddress),
|
|
119
123
|
isWTON: this.ctx.isWTON(rfqData.buyAssetAddress),
|
|
120
124
|
});
|
|
125
|
+
await trace.wait();
|
|
126
|
+
return trace;
|
|
121
127
|
}
|
|
122
128
|
// ============================================================
|
|
123
129
|
// Market Maker
|
|
124
130
|
// ============================================================
|
|
125
131
|
async sendSettle(sender, params, value) {
|
|
126
|
-
|
|
132
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createSettleMsg(this.ctx, params, value));
|
|
133
|
+
await trace.wait();
|
|
134
|
+
return trace;
|
|
127
135
|
}
|
|
128
136
|
async sendClearBids(sender, params, value) {
|
|
129
|
-
|
|
137
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createClearBidsMsg(this.ctx, params, value));
|
|
138
|
+
await trace.wait();
|
|
139
|
+
return trace;
|
|
130
140
|
}
|
|
131
141
|
}
|
|
132
142
|
exports.RFQAuctionServiceV1 = RFQAuctionServiceV1;
|
|
@@ -52,30 +52,10 @@ export declare class RFQBatchServiceV1 {
|
|
|
52
52
|
}>;
|
|
53
53
|
sendAddOrder(sender: AddressSender, params: user.AddOrderParams, value?: bigint): Promise<RFQBatchAddOrderTracer>;
|
|
54
54
|
sendCancelOrder(sender: AddressSender, params: user.CancelOrderParams, value?: bigint): Promise<RFQBatchCancelOrderTracer>;
|
|
55
|
-
sendSettle(sender: AddressSender, params: user.SettleParams, value?: bigint): Promise<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
forwardPayload: import("@ton/core").Cell;
|
|
61
|
-
queryId: bigint | undefined;
|
|
62
|
-
} & {
|
|
63
|
-
seqno: number;
|
|
64
|
-
}>;
|
|
65
|
-
sendLock(sender: AddressSender, params: user.LockParams, value?: bigint): Promise<{
|
|
66
|
-
seqno: number;
|
|
67
|
-
}>;
|
|
68
|
-
sendPayout(sender: AddressSender, params: user.PayoutParams, value?: bigint): Promise<{
|
|
69
|
-
assetIdx: 0 | 1;
|
|
70
|
-
count: number;
|
|
71
|
-
} & {
|
|
72
|
-
seqno: number;
|
|
73
|
-
}>;
|
|
74
|
-
sendReopen(sender: AddressSender, params: user.ReopenParams, value?: bigint): Promise<{
|
|
75
|
-
seqno: number;
|
|
76
|
-
}>;
|
|
77
|
-
sendCollectFee(sender: AddressSender, params: user.CollectFeeParams, value?: bigint): Promise<{
|
|
78
|
-
seqno: number;
|
|
79
|
-
}>;
|
|
55
|
+
sendSettle(sender: AddressSender, params: user.SettleParams, value?: bigint): Promise<import("../..").SimpleTracer>;
|
|
56
|
+
sendLock(sender: AddressSender, params: user.LockParams, value?: bigint): Promise<import("../..").SimpleTracer>;
|
|
57
|
+
sendPayout(sender: AddressSender, params: user.PayoutParams, value?: bigint): Promise<import("../..").SimpleTracer>;
|
|
58
|
+
sendReopen(sender: AddressSender, params: user.ReopenParams, value?: bigint): Promise<import("../..").SimpleTracer>;
|
|
59
|
+
sendCollectFee(sender: AddressSender, params: user.CollectFeeParams, value?: bigint): Promise<import("../..").SimpleTracer>;
|
|
80
60
|
sendBatchPayout(sender: MultiSender, params: user.BatchPayoutParams, value?: bigint): Promise<void>;
|
|
81
61
|
}
|
|
@@ -81,7 +81,7 @@ class RFQBatchServiceV1 {
|
|
|
81
81
|
async sendAddOrder(sender, params, value) {
|
|
82
82
|
const msg = await user.createAddOrderMsg(this.ctx, sender, params, value);
|
|
83
83
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
84
|
-
|
|
84
|
+
const trace = await trace_1.RFQBatchAddOrderTracer.create({
|
|
85
85
|
ctx: this.ctx,
|
|
86
86
|
msgBody: msg.input.body,
|
|
87
87
|
extHash: await result.getExternalHash(),
|
|
@@ -89,11 +89,13 @@ class RFQBatchServiceV1 {
|
|
|
89
89
|
asset: (0, utils_1.toAddress)(params.assetAddress),
|
|
90
90
|
rfqBatch: (0, utils_1.toAddress)(params.rfqBatchAddress),
|
|
91
91
|
});
|
|
92
|
+
await trace.wait();
|
|
93
|
+
return trace;
|
|
92
94
|
}
|
|
93
95
|
async sendCancelOrder(sender, params, value) {
|
|
94
96
|
const msg = await user.createCancelOrderMsg(this.ctx, params, value);
|
|
95
97
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
96
|
-
|
|
98
|
+
const trace = await trace_1.RFQBatchCancelOrderTracer.create({
|
|
97
99
|
ctx: this.ctx,
|
|
98
100
|
msgBody: msg.input.body,
|
|
99
101
|
extHash: await result.getExternalHash(),
|
|
@@ -101,24 +103,36 @@ class RFQBatchServiceV1 {
|
|
|
101
103
|
asset: (0, utils_1.toAddress)(params.assetAddress),
|
|
102
104
|
rfqBatch: (0, utils_1.toAddress)(params.rfqBatchAddress),
|
|
103
105
|
});
|
|
106
|
+
await trace.wait();
|
|
107
|
+
return trace;
|
|
104
108
|
}
|
|
105
109
|
// ============================================================
|
|
106
110
|
// Market Maker
|
|
107
111
|
// ============================================================
|
|
108
112
|
async sendSettle(sender, params, value) {
|
|
109
|
-
|
|
113
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createSettleMsg(this.ctx, sender, params, value));
|
|
114
|
+
await trace.wait();
|
|
115
|
+
return trace;
|
|
110
116
|
}
|
|
111
117
|
async sendLock(sender, params, value) {
|
|
112
|
-
|
|
118
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createLockMsg(this.ctx, params, value));
|
|
119
|
+
await trace.wait();
|
|
120
|
+
return trace;
|
|
113
121
|
}
|
|
114
122
|
async sendPayout(sender, params, value) {
|
|
115
|
-
|
|
123
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createPayoutMsg(this.ctx, params, value));
|
|
124
|
+
await trace.wait();
|
|
125
|
+
return trace;
|
|
116
126
|
}
|
|
117
127
|
async sendReopen(sender, params, value) {
|
|
118
|
-
|
|
128
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createReopenMsg(this.ctx, params, value));
|
|
129
|
+
await trace.wait();
|
|
130
|
+
return trace;
|
|
119
131
|
}
|
|
120
132
|
async sendCollectFee(sender, params, value) {
|
|
121
|
-
|
|
133
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await user.createCollectFeeMsg(this.ctx, params, value));
|
|
134
|
+
await trace.wait();
|
|
135
|
+
return trace;
|
|
122
136
|
}
|
|
123
137
|
async sendBatchPayout(sender, params, value) {
|
|
124
138
|
const rfqBatchData = await this.getRFQBatchData(params.rfqBatchAddress);
|
|
@@ -95,31 +95,47 @@ class ShareVaultServiceV1 {
|
|
|
95
95
|
// Owner
|
|
96
96
|
// ============================================================
|
|
97
97
|
async sendSetWhitelistPools(sender, params, value) {
|
|
98
|
-
|
|
98
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetWhitelistPoolsMsg(this.ctx, params, value));
|
|
99
|
+
await trace.wait();
|
|
100
|
+
return trace;
|
|
99
101
|
}
|
|
100
102
|
async sendSetGasConfig(sender, params, value) {
|
|
101
|
-
|
|
103
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetGasConfigMsg(this.ctx, params, value));
|
|
104
|
+
await trace.wait();
|
|
105
|
+
return trace;
|
|
102
106
|
}
|
|
103
107
|
async sendChangeManager(sender, params, value) {
|
|
104
|
-
|
|
108
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createChangeManagerMsg(this.ctx, params, value));
|
|
109
|
+
await trace.wait();
|
|
110
|
+
return trace;
|
|
105
111
|
}
|
|
106
112
|
async sendChangeAdmin(sender, params, value) {
|
|
107
|
-
|
|
113
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createChangeAdminMsg(this.ctx, params, value));
|
|
114
|
+
await trace.wait();
|
|
115
|
+
return trace;
|
|
108
116
|
}
|
|
109
117
|
async sendUpgradeCode(sender, params, value) {
|
|
110
|
-
|
|
118
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createUpgradeCodeMsg(this.ctx, params, value));
|
|
119
|
+
await trace.wait();
|
|
120
|
+
return trace;
|
|
111
121
|
}
|
|
112
122
|
// ============================================================
|
|
113
123
|
// Manager
|
|
114
124
|
// ============================================================
|
|
115
125
|
async sendSupplyToPool(sender, params, value) {
|
|
116
|
-
|
|
126
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createSupplyToPoolMsg(this.ctx, params, value));
|
|
127
|
+
await trace.wait();
|
|
128
|
+
return trace;
|
|
117
129
|
}
|
|
118
130
|
async sendWithdrawFromPool(sender, params, value) {
|
|
119
|
-
|
|
131
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createWithdrawFromPoolMsg(this.ctx, params, value));
|
|
132
|
+
await trace.wait();
|
|
133
|
+
return trace;
|
|
120
134
|
}
|
|
121
135
|
async sendSetTargetWeight(sender, params, value) {
|
|
122
|
-
|
|
136
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createSetTargetWeightMsg(this.ctx, params, value));
|
|
137
|
+
await trace.wait();
|
|
138
|
+
return trace;
|
|
123
139
|
}
|
|
124
140
|
// ============================================================
|
|
125
141
|
// User
|
|
@@ -129,7 +145,7 @@ class ShareVaultServiceV1 {
|
|
|
129
145
|
const vaultData = await query.getVaultData(this.ctx, vault);
|
|
130
146
|
const msg = await user.createSupplyMsg(this.ctx, sender, params, value);
|
|
131
147
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
132
|
-
|
|
148
|
+
const trace = await trace_1.ShareVaultSupplyTracer.create({
|
|
133
149
|
ctx: this.ctx,
|
|
134
150
|
msgBody: msg.input.body,
|
|
135
151
|
extHash: await result.getExternalHash(),
|
|
@@ -138,13 +154,15 @@ class ShareVaultServiceV1 {
|
|
|
138
154
|
vault,
|
|
139
155
|
isWTON: this.ctx.isWTON(vaultData.asset),
|
|
140
156
|
});
|
|
157
|
+
await trace.wait();
|
|
158
|
+
return trace;
|
|
141
159
|
}
|
|
142
160
|
async sendWithdraw(sender, params, value) {
|
|
143
161
|
const vault = (0, utils_1.toAddress)(params.vaultAddress);
|
|
144
162
|
const vaultData = await query.getVaultData(this.ctx, vault);
|
|
145
163
|
const msg = await user.createWithdrawMsg(this.ctx, sender, params, value);
|
|
146
164
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
147
|
-
|
|
165
|
+
const trace = await trace_1.ShareVaultWithdrawTracer.create({
|
|
148
166
|
ctx: this.ctx,
|
|
149
167
|
msgBody: msg.input.body,
|
|
150
168
|
extHash: await result.getExternalHash(),
|
|
@@ -153,6 +171,8 @@ class ShareVaultServiceV1 {
|
|
|
153
171
|
vault,
|
|
154
172
|
isWTON: this.ctx.isWTON(vaultData.asset),
|
|
155
173
|
});
|
|
174
|
+
await trace.wait();
|
|
175
|
+
return trace;
|
|
156
176
|
}
|
|
157
177
|
async getValuationContext(vaultAddress) {
|
|
158
178
|
return query.getValuationContext(this.ctx, vaultAddress);
|
|
@@ -109,142 +109,230 @@ class StrategyVaultServiceV1 {
|
|
|
109
109
|
// Owner
|
|
110
110
|
// ============================================================
|
|
111
111
|
async sendSetOwner(sender, params) {
|
|
112
|
-
|
|
112
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetOwnerMsg(this.ctx, params));
|
|
113
|
+
await trace.wait();
|
|
114
|
+
return trace;
|
|
113
115
|
}
|
|
114
116
|
async sendSetGuardianAddress(sender, params, value) {
|
|
115
|
-
|
|
117
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetGuardianAddressMsg(this.ctx, params, value));
|
|
118
|
+
await trace.wait();
|
|
119
|
+
return trace;
|
|
116
120
|
}
|
|
117
121
|
async sendSetManager(sender, params) {
|
|
118
|
-
|
|
122
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetManagerMsg(this.ctx, params));
|
|
123
|
+
await trace.wait();
|
|
124
|
+
return trace;
|
|
119
125
|
}
|
|
120
126
|
async sendSetPrivateVault(sender, params, value) {
|
|
121
|
-
|
|
127
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetPrivateVaultMsg(this.ctx, params, value));
|
|
128
|
+
await trace.wait();
|
|
129
|
+
return trace;
|
|
122
130
|
}
|
|
123
131
|
async sendSetWhitelistedMinters(sender, params, value) {
|
|
124
|
-
|
|
132
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetWhitelistedMintersMsg(this.ctx, params, value));
|
|
133
|
+
await trace.wait();
|
|
134
|
+
return trace;
|
|
125
135
|
}
|
|
126
136
|
async sendSetMaxLeverageRatio(sender, params, value) {
|
|
127
|
-
|
|
137
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetMaxLeverageRatioMsg(this.ctx, params, value));
|
|
138
|
+
await trace.wait();
|
|
139
|
+
return trace;
|
|
128
140
|
}
|
|
129
141
|
async sendExecuteOwnerAction(sender, params, value) {
|
|
130
|
-
|
|
142
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createExecuteOwnerActionMsg(this.ctx, params, value));
|
|
143
|
+
await trace.wait();
|
|
144
|
+
return trace;
|
|
131
145
|
}
|
|
132
146
|
async sendRevertOwnerAction(sender, params, value) {
|
|
133
|
-
|
|
147
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createRevertOwnerActionMsg(this.ctx, params, value));
|
|
148
|
+
await trace.wait();
|
|
149
|
+
return trace;
|
|
134
150
|
}
|
|
135
151
|
async sendSetTimelock(sender, params, value) {
|
|
136
|
-
|
|
152
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetTimelockMsg(this.ctx, params, value));
|
|
153
|
+
await trace.wait();
|
|
154
|
+
return trace;
|
|
137
155
|
}
|
|
138
156
|
async sendSetManagementFeeRecipientAddress(sender, params, value) {
|
|
139
|
-
|
|
157
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetManagementFeeRecipientAddressMsg(this.ctx, params, value));
|
|
158
|
+
await trace.wait();
|
|
159
|
+
return trace;
|
|
140
160
|
}
|
|
141
161
|
async sendSetProtocolFeeRatePerYear(sender, params, value) {
|
|
142
|
-
|
|
162
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetProtocolFeeRatePerYearMsg(this.ctx, params, value));
|
|
163
|
+
await trace.wait();
|
|
164
|
+
return trace;
|
|
143
165
|
}
|
|
144
166
|
async sendSetProtocolFeeManagerAddress(sender, params, value) {
|
|
145
|
-
|
|
167
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetProtocolFeeManagerAddressMsg(this.ctx, params, value));
|
|
168
|
+
await trace.wait();
|
|
169
|
+
return trace;
|
|
146
170
|
}
|
|
147
171
|
async sendSetFactorialPoolConfig(sender, params) {
|
|
148
|
-
|
|
172
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetFactorialPoolConfigMsg(this.ctx, params));
|
|
173
|
+
await trace.wait();
|
|
174
|
+
return trace;
|
|
149
175
|
}
|
|
150
176
|
async sendSetAssetConfig(sender, params, value) {
|
|
151
|
-
|
|
177
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetAssetConfigMsg(this.ctx, params, value));
|
|
178
|
+
await trace.wait();
|
|
179
|
+
return trace;
|
|
152
180
|
}
|
|
153
181
|
async sendSetRFQConfig(sender, params, value) {
|
|
154
|
-
|
|
182
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetRFQConfigMsg(this.ctx, params, value));
|
|
183
|
+
await trace.wait();
|
|
184
|
+
return trace;
|
|
155
185
|
}
|
|
156
186
|
async sendSetManagementFeeRatePerYear(sender, params, value) {
|
|
157
|
-
|
|
187
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetManagementFeeRatePerYearMsg(this.ctx, params, value));
|
|
188
|
+
await trace.wait();
|
|
189
|
+
return trace;
|
|
158
190
|
}
|
|
159
191
|
async sendSetDepositCloseTimestamp(sender, params, value) {
|
|
160
|
-
|
|
192
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetDepositCloseTimestampMsg(this.ctx, params, value));
|
|
193
|
+
await trace.wait();
|
|
194
|
+
return trace;
|
|
161
195
|
}
|
|
162
196
|
async sendSetWithdrawOpenTimestamp(sender, params, value) {
|
|
163
|
-
|
|
197
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetWithdrawOpenTimestampMsg(this.ctx, params, value));
|
|
198
|
+
await trace.wait();
|
|
199
|
+
return trace;
|
|
164
200
|
}
|
|
165
201
|
async sendSetGasConfig(sender, params, value) {
|
|
166
|
-
|
|
202
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetGasConfigMsg(this.ctx, params, value));
|
|
203
|
+
await trace.wait();
|
|
204
|
+
return trace;
|
|
167
205
|
}
|
|
168
206
|
async sendSetOracleConfig(sender, params, value) {
|
|
169
|
-
|
|
207
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetOracleConfigMsg(this.ctx, params, value));
|
|
208
|
+
await trace.wait();
|
|
209
|
+
return trace;
|
|
170
210
|
}
|
|
171
211
|
async sendSetWalletCode(sender, params, value) {
|
|
172
|
-
|
|
212
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetWalletCodeMsg(this.ctx, params, value));
|
|
213
|
+
await trace.wait();
|
|
214
|
+
return trace;
|
|
173
215
|
}
|
|
174
216
|
async sendSetDataAggregatorCode(sender, params, value) {
|
|
175
|
-
|
|
217
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetDataAggregatorCodeMsg(this.ctx, params, value));
|
|
218
|
+
await trace.wait();
|
|
219
|
+
return trace;
|
|
176
220
|
}
|
|
177
221
|
async sendSetRFQCode(sender, params, value) {
|
|
178
|
-
|
|
222
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetRFQCodeMsg(this.ctx, params, value));
|
|
223
|
+
await trace.wait();
|
|
224
|
+
return trace;
|
|
179
225
|
}
|
|
180
226
|
async sendSetContent(sender, params, value) {
|
|
181
|
-
|
|
227
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createSetContentMsg(this.ctx, params, value));
|
|
228
|
+
await trace.wait();
|
|
229
|
+
return trace;
|
|
182
230
|
}
|
|
183
231
|
async sendUpgradeCode(sender, params, value) {
|
|
184
|
-
|
|
232
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createUpgradeCodeMsg(this.ctx, params, value));
|
|
233
|
+
await trace.wait();
|
|
234
|
+
return trace;
|
|
185
235
|
}
|
|
186
236
|
async sendCollectProtocolFee(sender, params, value) {
|
|
187
|
-
|
|
237
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createCollectProtocolFeeMsg(this.ctx, params, value));
|
|
238
|
+
await trace.wait();
|
|
239
|
+
return trace;
|
|
188
240
|
}
|
|
189
241
|
async sendClaimManagementFee(sender, params, value) {
|
|
190
|
-
|
|
242
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await owner.createClaimManagementFeeMsg(this.ctx, params, value));
|
|
243
|
+
await trace.wait();
|
|
244
|
+
return trace;
|
|
191
245
|
}
|
|
192
246
|
// ============================================================
|
|
193
247
|
// Manager
|
|
194
248
|
// ============================================================
|
|
195
249
|
async sendSupplyToFactorial(sender, params, value) {
|
|
196
|
-
|
|
250
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createSupplyToFactorialMsg(this.ctx, sender, params, value));
|
|
251
|
+
await trace.wait();
|
|
252
|
+
return trace;
|
|
197
253
|
}
|
|
198
254
|
async sendBorrowFromFactorial(sender, params, value) {
|
|
199
|
-
|
|
255
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createBorrowFromFactorialMsg(this.ctx, sender, params, value));
|
|
256
|
+
await trace.wait();
|
|
257
|
+
return trace;
|
|
200
258
|
}
|
|
201
259
|
async sendRepayToFactorial(sender, params, value) {
|
|
202
|
-
|
|
260
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createRepayToFactorialMsg(this.ctx, sender, params, value));
|
|
261
|
+
await trace.wait();
|
|
262
|
+
return trace;
|
|
203
263
|
}
|
|
204
264
|
async sendWithdrawFromFactorial(sender, params, value) {
|
|
205
|
-
|
|
265
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createWithdrawFromFactorialMsg(this.ctx, sender, params, value));
|
|
266
|
+
await trace.wait();
|
|
267
|
+
return trace;
|
|
206
268
|
}
|
|
207
269
|
async sendLiquidateToFactorial(sender, params, value) {
|
|
208
|
-
|
|
270
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createLiquidateToFactorialMsg(this.ctx, sender, params, value));
|
|
271
|
+
await trace.wait();
|
|
272
|
+
return trace;
|
|
209
273
|
}
|
|
210
274
|
async sendDepositToVault(sender, params) {
|
|
211
|
-
|
|
275
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createDepositToVaultMsg(this.ctx, sender, params));
|
|
276
|
+
await trace.wait();
|
|
277
|
+
return trace;
|
|
212
278
|
}
|
|
213
279
|
async sendWithdrawFromVault(sender, params) {
|
|
214
|
-
|
|
280
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createWithdrawFromVaultMsg(this.ctx, sender, params));
|
|
281
|
+
await trace.wait();
|
|
282
|
+
return trace;
|
|
215
283
|
}
|
|
216
284
|
async sendDepositToVaultQueue(sender, params) {
|
|
217
|
-
|
|
285
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createDepositToVaultQueueMsg(this.ctx, sender, params));
|
|
286
|
+
await trace.wait();
|
|
287
|
+
return trace;
|
|
218
288
|
}
|
|
219
289
|
async sendWithdrawFromVaultQueue(sender, params) {
|
|
220
|
-
|
|
290
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createWithdrawFromVaultQueueMsg(this.ctx, sender, params));
|
|
291
|
+
await trace.wait();
|
|
292
|
+
return trace;
|
|
221
293
|
}
|
|
222
294
|
async sendDepositToVaultQueueCancel(sender, params) {
|
|
223
|
-
|
|
295
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createDepositToVaultQueueCancelMsg(this.ctx, sender, params));
|
|
296
|
+
await trace.wait();
|
|
297
|
+
return trace;
|
|
224
298
|
}
|
|
225
299
|
async sendWithdrawFromVaultQueueCancel(sender, params) {
|
|
226
|
-
|
|
300
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createWithdrawFromVaultQueueCancelMsg(this.ctx, sender, params));
|
|
301
|
+
await trace.wait();
|
|
302
|
+
return trace;
|
|
227
303
|
}
|
|
228
304
|
async sendCreateAmountRFQ(sender, params, value) {
|
|
229
|
-
|
|
305
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createAmountRFQMsg(this.ctx, sender, params, value));
|
|
306
|
+
await trace.wait();
|
|
307
|
+
return trace;
|
|
230
308
|
}
|
|
231
309
|
async sendCreateSlippageRFQ(sender, params, value) {
|
|
232
|
-
|
|
310
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createSlippageRFQMsg(this.ctx, sender, params, value));
|
|
311
|
+
await trace.wait();
|
|
312
|
+
return trace;
|
|
233
313
|
}
|
|
234
314
|
async sendCancelRFQ(sender, params, value) {
|
|
235
|
-
|
|
315
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createCancelRFQMsg(this.ctx, sender, params, value));
|
|
316
|
+
await trace.wait();
|
|
317
|
+
return trace;
|
|
236
318
|
}
|
|
237
319
|
async sendUnwrapWTON(sender, params, value) {
|
|
238
320
|
return manager.sendUnwrapWTON(this.ctx, sender, params, value);
|
|
239
321
|
}
|
|
240
322
|
async sendConfirmQueue(sender, params) {
|
|
241
|
-
|
|
323
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createConfirmQueueMsg(this.ctx, sender, params));
|
|
324
|
+
await trace.wait();
|
|
325
|
+
return trace;
|
|
242
326
|
}
|
|
243
327
|
async sendExecuteDepositQueue(sender, params) {
|
|
244
|
-
|
|
328
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createExecuteDepositQueueMsg(this.ctx, sender, params));
|
|
329
|
+
await trace.wait();
|
|
330
|
+
return trace;
|
|
245
331
|
}
|
|
246
332
|
async sendExecuteWithdrawQueue(sender, params) {
|
|
247
|
-
|
|
333
|
+
const trace = await (0, send_msg_1.sendMsgAndWaitTxSimple)(this.ctx, sender, await manager.createExecuteWithdrawQueueMsg(this.ctx, sender, params));
|
|
334
|
+
await trace.wait();
|
|
335
|
+
return trace;
|
|
248
336
|
}
|
|
249
337
|
// ============================================================
|
|
250
338
|
// User
|
|
@@ -253,7 +341,7 @@ class StrategyVaultServiceV1 {
|
|
|
253
341
|
const msg = await user.createDepositAssetMsg(this.ctx, sender, params, value);
|
|
254
342
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
255
343
|
const asset = (0, utils_1.toAddress)(params.assetAddress);
|
|
256
|
-
|
|
344
|
+
const trace = await trace_1.StrategyVaultDepositTracer.create({
|
|
257
345
|
ctx: this.ctx,
|
|
258
346
|
msgBody: msg.input.body,
|
|
259
347
|
extHash: await result.getExternalHash(),
|
|
@@ -262,11 +350,13 @@ class StrategyVaultServiceV1 {
|
|
|
262
350
|
vault: (0, utils_1.toAddress)(params.strategyVaultAddress),
|
|
263
351
|
isWTON: this.ctx.isWTON(asset),
|
|
264
352
|
});
|
|
353
|
+
await trace.wait();
|
|
354
|
+
return trace;
|
|
265
355
|
}
|
|
266
356
|
async sendBurnVaultAsset(sender, params, value) {
|
|
267
357
|
const msg = await user.createBurnVaultAssetMsg(this.ctx, sender, params, value);
|
|
268
358
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
269
|
-
|
|
359
|
+
const trace = await trace_1.StrategyVaultWithdrawTracer.create({
|
|
270
360
|
ctx: this.ctx,
|
|
271
361
|
msgBody: msg.input.body,
|
|
272
362
|
extHash: await result.getExternalHash(),
|
|
@@ -275,12 +365,14 @@ class StrategyVaultServiceV1 {
|
|
|
275
365
|
vault: (0, utils_1.toAddress)(params.strategyVaultAddress),
|
|
276
366
|
isWTON: this.ctx.isWTON((0, utils_1.toAddress)(params.withdrawAssetAddress)),
|
|
277
367
|
});
|
|
368
|
+
await trace.wait();
|
|
369
|
+
return trace;
|
|
278
370
|
}
|
|
279
371
|
async sendDepositQueue(sender, params) {
|
|
280
372
|
const msg = await user.createDepositQueueMsg(this.ctx, sender, params);
|
|
281
373
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
282
374
|
const asset = (0, utils_1.toAddress)(params.assetAddress);
|
|
283
|
-
|
|
375
|
+
const trace = await trace_1.StrategyVaultDepositQueueTracer.create({
|
|
284
376
|
ctx: this.ctx,
|
|
285
377
|
msgBody: msg.input.body,
|
|
286
378
|
extHash: await result.getExternalHash(),
|
|
@@ -289,23 +381,27 @@ class StrategyVaultServiceV1 {
|
|
|
289
381
|
vault: (0, utils_1.toAddress)(params.strategyVaultAddress),
|
|
290
382
|
isWTON: this.ctx.isWTON(asset),
|
|
291
383
|
});
|
|
384
|
+
await trace.wait();
|
|
385
|
+
return trace;
|
|
292
386
|
}
|
|
293
387
|
async sendWithdrawQueue(sender, params) {
|
|
294
388
|
const msg = await user.createWithdrawQueueMsg(this.ctx, sender, params);
|
|
295
389
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
296
|
-
|
|
390
|
+
const trace = await trace_1.StrategyVaultWithdrawQueueTracer.create({
|
|
297
391
|
ctx: this.ctx,
|
|
298
392
|
msgBody: msg.input.body,
|
|
299
393
|
extHash: await result.getExternalHash(),
|
|
300
394
|
actor: sender.address,
|
|
301
395
|
vault: (0, utils_1.toAddress)(params.strategyVaultAddress),
|
|
302
396
|
});
|
|
397
|
+
await trace.wait();
|
|
398
|
+
return trace;
|
|
303
399
|
}
|
|
304
400
|
async sendCancelDepositQueue(sender, params) {
|
|
305
401
|
const msg = await user.createCancelDepositQueueMsg(this.ctx, params);
|
|
306
402
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
307
403
|
const asset = (0, utils_1.toAddress)(params.assetAddress);
|
|
308
|
-
|
|
404
|
+
const trace = await trace_1.StrategyVaultCancelDepositQueueTracer.create({
|
|
309
405
|
ctx: this.ctx,
|
|
310
406
|
msgBody: msg.input.body,
|
|
311
407
|
extHash: await result.getExternalHash(),
|
|
@@ -314,17 +410,21 @@ class StrategyVaultServiceV1 {
|
|
|
314
410
|
vault: (0, utils_1.toAddress)(params.strategyVaultAddress),
|
|
315
411
|
isWTON: this.ctx.isWTON(asset),
|
|
316
412
|
});
|
|
413
|
+
await trace.wait();
|
|
414
|
+
return trace;
|
|
317
415
|
}
|
|
318
416
|
async sendCancelWithdrawQueue(sender, params) {
|
|
319
417
|
const msg = await user.createCancelWithdrawQueueMsg(this.ctx, params);
|
|
320
418
|
const result = await (0, send_msg_1.sendMsgAndWaitTx)(this.ctx, sender, msg);
|
|
321
|
-
|
|
419
|
+
const trace = await trace_1.StrategyVaultCancelWithdrawQueueTracer.create({
|
|
322
420
|
ctx: this.ctx,
|
|
323
421
|
msgBody: msg.input.body,
|
|
324
422
|
extHash: await result.getExternalHash(),
|
|
325
423
|
actor: sender.address,
|
|
326
424
|
vault: (0, utils_1.toAddress)(params.strategyVaultAddress),
|
|
327
425
|
});
|
|
426
|
+
await trace.wait();
|
|
427
|
+
return trace;
|
|
328
428
|
}
|
|
329
429
|
async getValuationContext(vaultAddress) {
|
|
330
430
|
return query.getValuationContext(this.ctx, (0, utils_1.toAddress)(vaultAddress));
|