@oddmaki-protocol/sdk 0.5.0 → 0.5.1
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/index.d.mts +44 -42
- package/dist/index.d.ts +44 -42
- package/dist/index.js +77 -61
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +77 -61
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -38,6 +38,19 @@ var BaseModule = class {
|
|
|
38
38
|
}
|
|
39
39
|
return this.config.walletClient;
|
|
40
40
|
}
|
|
41
|
+
// Returns the hoisted LocalAccount when the wallet was created with a private
|
|
42
|
+
// key, so viem signs locally (eth_sendRawTransaction). Falls back to the
|
|
43
|
+
// address string for injected/JSON-RPC providers (wagmi, RainbowKit, etc).
|
|
44
|
+
async getSignerAccount() {
|
|
45
|
+
const wallet = this.walletClient;
|
|
46
|
+
if (wallet.account) return wallet.account;
|
|
47
|
+
const [address] = await wallet.getAddresses();
|
|
48
|
+
return address;
|
|
49
|
+
}
|
|
50
|
+
async getSignerAddress() {
|
|
51
|
+
const signer = await this.getSignerAccount();
|
|
52
|
+
return typeof signer === "string" ? signer : signer.address;
|
|
53
|
+
}
|
|
41
54
|
};
|
|
42
55
|
|
|
43
56
|
// src/contracts/abis/VenueFacet.json
|
|
@@ -6830,7 +6843,7 @@ var VenueModule = class extends BaseModule {
|
|
|
6830
6843
|
*/
|
|
6831
6844
|
async createVenue(params) {
|
|
6832
6845
|
const wallet = this.walletClient;
|
|
6833
|
-
const
|
|
6846
|
+
const account = await this.getSignerAccount();
|
|
6834
6847
|
const { request } = await this.publicClient.simulateContract({
|
|
6835
6848
|
address: this.config.diamondAddress,
|
|
6836
6849
|
abi: VenueFacet_default,
|
|
@@ -6857,7 +6870,7 @@ var VenueModule = class extends BaseModule {
|
|
|
6857
6870
|
*/
|
|
6858
6871
|
async updateFees(params) {
|
|
6859
6872
|
const wallet = this.walletClient;
|
|
6860
|
-
const
|
|
6873
|
+
const account = await this.getSignerAccount();
|
|
6861
6874
|
const { request } = await this.publicClient.simulateContract({
|
|
6862
6875
|
address: this.config.diamondAddress,
|
|
6863
6876
|
abi: VenueFacet_default,
|
|
@@ -6872,7 +6885,7 @@ var VenueModule = class extends BaseModule {
|
|
|
6872
6885
|
*/
|
|
6873
6886
|
async setPaused(venueId, paused) {
|
|
6874
6887
|
const wallet = this.walletClient;
|
|
6875
|
-
const
|
|
6888
|
+
const account = await this.getSignerAccount();
|
|
6876
6889
|
const functionName = paused ? "pauseVenue" : "unpauseVenue";
|
|
6877
6890
|
const { request } = await this.publicClient.simulateContract({
|
|
6878
6891
|
address: this.config.diamondAddress,
|
|
@@ -6899,7 +6912,7 @@ var VenueModule = class extends BaseModule {
|
|
|
6899
6912
|
*/
|
|
6900
6913
|
async updateVenue(params) {
|
|
6901
6914
|
const wallet = this.walletClient;
|
|
6902
|
-
const
|
|
6915
|
+
const account = await this.getSignerAccount();
|
|
6903
6916
|
const { request } = await this.publicClient.simulateContract({
|
|
6904
6917
|
address: this.config.diamondAddress,
|
|
6905
6918
|
abi: VenueFacet_default,
|
|
@@ -6921,7 +6934,7 @@ var VenueModule = class extends BaseModule {
|
|
|
6921
6934
|
*/
|
|
6922
6935
|
async updateOracleParams(params) {
|
|
6923
6936
|
const wallet = this.walletClient;
|
|
6924
|
-
const
|
|
6937
|
+
const account = await this.getSignerAccount();
|
|
6925
6938
|
const { request } = await this.publicClient.simulateContract({
|
|
6926
6939
|
address: this.config.diamondAddress,
|
|
6927
6940
|
abi: VenueFacet_default,
|
|
@@ -6970,7 +6983,7 @@ var VenueModule = class extends BaseModule {
|
|
|
6970
6983
|
*/
|
|
6971
6984
|
async setProtocolFeeBps(bps) {
|
|
6972
6985
|
const wallet = this.walletClient;
|
|
6973
|
-
const
|
|
6986
|
+
const account = await this.getSignerAccount();
|
|
6974
6987
|
const { request } = await this.publicClient.simulateContract({
|
|
6975
6988
|
address: this.config.diamondAddress,
|
|
6976
6989
|
abi: ProtocolFacet_default,
|
|
@@ -7231,7 +7244,8 @@ var MarketModule = class extends BaseModule {
|
|
|
7231
7244
|
*/
|
|
7232
7245
|
async createMarket(params) {
|
|
7233
7246
|
const wallet = this.walletClient;
|
|
7234
|
-
const
|
|
7247
|
+
const account = await this.getSignerAccount();
|
|
7248
|
+
const accountAddress = await this.getSignerAddress();
|
|
7235
7249
|
const venue = await this.publicClient.readContract({
|
|
7236
7250
|
address: this.config.diamondAddress,
|
|
7237
7251
|
abi: VenueFacet_default,
|
|
@@ -7246,7 +7260,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7246
7260
|
address: params.collateralToken,
|
|
7247
7261
|
abi: erc20Abi,
|
|
7248
7262
|
functionName: "allowance",
|
|
7249
|
-
args: [
|
|
7263
|
+
args: [accountAddress, this.config.diamondAddress]
|
|
7250
7264
|
});
|
|
7251
7265
|
if (allowance < totalRequired) {
|
|
7252
7266
|
throw new Error(
|
|
@@ -7257,7 +7271,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7257
7271
|
address: params.collateralToken,
|
|
7258
7272
|
abi: erc20Abi,
|
|
7259
7273
|
functionName: "balanceOf",
|
|
7260
|
-
args: [
|
|
7274
|
+
args: [accountAddress]
|
|
7261
7275
|
});
|
|
7262
7276
|
if (balance < totalRequired) {
|
|
7263
7277
|
throw new Error(
|
|
@@ -7500,7 +7514,8 @@ var MarketModule = class extends BaseModule {
|
|
|
7500
7514
|
*/
|
|
7501
7515
|
async createMarketGroup(params) {
|
|
7502
7516
|
const wallet = this.walletClient;
|
|
7503
|
-
const
|
|
7517
|
+
const account = await this.getSignerAccount();
|
|
7518
|
+
const accountAddress = await this.getSignerAddress();
|
|
7504
7519
|
const venue = await this.publicClient.readContract({
|
|
7505
7520
|
address: this.config.diamondAddress,
|
|
7506
7521
|
abi: VenueFacet_default,
|
|
@@ -7515,7 +7530,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7515
7530
|
address: params.collateralToken,
|
|
7516
7531
|
abi: erc20Abi,
|
|
7517
7532
|
functionName: "allowance",
|
|
7518
|
-
args: [
|
|
7533
|
+
args: [accountAddress, this.config.diamondAddress]
|
|
7519
7534
|
});
|
|
7520
7535
|
if (allowance < totalRequired) {
|
|
7521
7536
|
throw new Error(
|
|
@@ -7526,7 +7541,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7526
7541
|
address: params.collateralToken,
|
|
7527
7542
|
abi: erc20Abi,
|
|
7528
7543
|
functionName: "balanceOf",
|
|
7529
|
-
args: [
|
|
7544
|
+
args: [accountAddress]
|
|
7530
7545
|
});
|
|
7531
7546
|
if (balance < totalRequired) {
|
|
7532
7547
|
throw new Error(
|
|
@@ -7563,7 +7578,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7563
7578
|
*/
|
|
7564
7579
|
async addMarketToGroup(params) {
|
|
7565
7580
|
const wallet = this.walletClient;
|
|
7566
|
-
const
|
|
7581
|
+
const account = await this.getSignerAccount();
|
|
7567
7582
|
const { request } = await this.publicClient.simulateContract({
|
|
7568
7583
|
address: this.config.diamondAddress,
|
|
7569
7584
|
abi: MarketsFacet_default,
|
|
@@ -7578,7 +7593,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7578
7593
|
*/
|
|
7579
7594
|
async addPlaceholderMarkets(params) {
|
|
7580
7595
|
const wallet = this.walletClient;
|
|
7581
|
-
const
|
|
7596
|
+
const account = await this.getSignerAccount();
|
|
7582
7597
|
if (params.count < 1n || params.count > 50n) {
|
|
7583
7598
|
throw new Error("Count must be between 1 and 50");
|
|
7584
7599
|
}
|
|
@@ -7596,7 +7611,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7596
7611
|
*/
|
|
7597
7612
|
async activatePlaceholder(params) {
|
|
7598
7613
|
const wallet = this.walletClient;
|
|
7599
|
-
const
|
|
7614
|
+
const account = await this.getSignerAccount();
|
|
7600
7615
|
const { request } = await this.publicClient.simulateContract({
|
|
7601
7616
|
address: this.config.diamondAddress,
|
|
7602
7617
|
abi: MarketsFacet_default,
|
|
@@ -7616,7 +7631,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7616
7631
|
*/
|
|
7617
7632
|
async activateMarketGroup(params) {
|
|
7618
7633
|
const wallet = this.walletClient;
|
|
7619
|
-
const
|
|
7634
|
+
const account = await this.getSignerAccount();
|
|
7620
7635
|
const { request } = await this.publicClient.simulateContract({
|
|
7621
7636
|
address: this.config.diamondAddress,
|
|
7622
7637
|
abi: MarketGroupFacet_default,
|
|
@@ -7633,7 +7648,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7633
7648
|
*/
|
|
7634
7649
|
async convertPositions(params) {
|
|
7635
7650
|
const wallet = this.walletClient;
|
|
7636
|
-
const
|
|
7651
|
+
const account = await this.getSignerAccount();
|
|
7637
7652
|
const isApproved = await this.publicClient.readContract({
|
|
7638
7653
|
address: this.config.conditionalTokensAddress,
|
|
7639
7654
|
abi: ConditionalTokens_default,
|
|
@@ -7789,7 +7804,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7789
7804
|
*/
|
|
7790
7805
|
async pauseMarket(marketId) {
|
|
7791
7806
|
const wallet = this.walletClient;
|
|
7792
|
-
const
|
|
7807
|
+
const account = await this.getSignerAccount();
|
|
7793
7808
|
const { request } = await this.publicClient.simulateContract({
|
|
7794
7809
|
address: this.config.diamondAddress,
|
|
7795
7810
|
abi: MarketsFacet_default,
|
|
@@ -7805,7 +7820,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7805
7820
|
*/
|
|
7806
7821
|
async unpauseMarket(marketId) {
|
|
7807
7822
|
const wallet = this.walletClient;
|
|
7808
|
-
const
|
|
7823
|
+
const account = await this.getSignerAccount();
|
|
7809
7824
|
const { request } = await this.publicClient.simulateContract({
|
|
7810
7825
|
address: this.config.diamondAddress,
|
|
7811
7826
|
abi: MarketsFacet_default,
|
|
@@ -7824,7 +7839,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7824
7839
|
*/
|
|
7825
7840
|
async updateMarketTags(params) {
|
|
7826
7841
|
const wallet = this.walletClient;
|
|
7827
|
-
const
|
|
7842
|
+
const account = await this.getSignerAccount();
|
|
7828
7843
|
const encodedTags = params.tags.map(
|
|
7829
7844
|
(t) => stringToHex(t, { size: 32 })
|
|
7830
7845
|
);
|
|
@@ -7843,7 +7858,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7843
7858
|
*/
|
|
7844
7859
|
async updateMarketGroupTags(params) {
|
|
7845
7860
|
const wallet = this.walletClient;
|
|
7846
|
-
const
|
|
7861
|
+
const account = await this.getSignerAccount();
|
|
7847
7862
|
const encodedTags = params.tags.map(
|
|
7848
7863
|
(t) => stringToHex(t, { size: 32 })
|
|
7849
7864
|
);
|
|
@@ -7865,7 +7880,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7865
7880
|
*/
|
|
7866
7881
|
async updateMarketMetadata(params) {
|
|
7867
7882
|
const wallet = this.walletClient;
|
|
7868
|
-
const
|
|
7883
|
+
const account = await this.getSignerAccount();
|
|
7869
7884
|
const { request } = await this.publicClient.simulateContract({
|
|
7870
7885
|
address: this.config.diamondAddress,
|
|
7871
7886
|
abi: MetadataFacet_default,
|
|
@@ -7881,7 +7896,7 @@ var MarketModule = class extends BaseModule {
|
|
|
7881
7896
|
*/
|
|
7882
7897
|
async updateMarketGroupMetadata(params) {
|
|
7883
7898
|
const wallet = this.walletClient;
|
|
7884
|
-
const
|
|
7899
|
+
const account = await this.getSignerAccount();
|
|
7885
7900
|
const { request } = await this.publicClient.simulateContract({
|
|
7886
7901
|
address: this.config.diamondAddress,
|
|
7887
7902
|
abi: MetadataFacet_default,
|
|
@@ -7901,7 +7916,7 @@ var TradeModule = class extends BaseModule {
|
|
|
7901
7916
|
*/
|
|
7902
7917
|
async placeOrder(params) {
|
|
7903
7918
|
const wallet = this.walletClient;
|
|
7904
|
-
const
|
|
7919
|
+
const account = await this.getSignerAccount();
|
|
7905
7920
|
const { request } = await this.publicClient.simulateContract({
|
|
7906
7921
|
address: this.config.diamondAddress,
|
|
7907
7922
|
abi: LimitOrdersFacet_default,
|
|
@@ -7953,7 +7968,7 @@ var TradeModule = class extends BaseModule {
|
|
|
7953
7968
|
*/
|
|
7954
7969
|
async cancelOrder(orderId) {
|
|
7955
7970
|
const wallet = this.walletClient;
|
|
7956
|
-
const
|
|
7971
|
+
const account = await this.getSignerAccount();
|
|
7957
7972
|
const { request } = await this.publicClient.simulateContract({
|
|
7958
7973
|
address: this.config.diamondAddress,
|
|
7959
7974
|
abi: LimitOrdersFacet_default,
|
|
@@ -7972,7 +7987,7 @@ var TradeModule = class extends BaseModule {
|
|
|
7972
7987
|
*/
|
|
7973
7988
|
async cancelOrdersOnResolvedMarket(marketId, orderIds) {
|
|
7974
7989
|
const wallet = this.walletClient;
|
|
7975
|
-
const
|
|
7990
|
+
const account = await this.getSignerAccount();
|
|
7976
7991
|
const { request } = await this.publicClient.simulateContract({
|
|
7977
7992
|
address: this.config.diamondAddress,
|
|
7978
7993
|
abi: LimitOrdersFacet_default,
|
|
@@ -7993,7 +8008,7 @@ var TradeModule = class extends BaseModule {
|
|
|
7993
8008
|
*/
|
|
7994
8009
|
async placeMarketOrder(params) {
|
|
7995
8010
|
const wallet = this.walletClient;
|
|
7996
|
-
const
|
|
8011
|
+
const account = await this.getSignerAccount();
|
|
7997
8012
|
const { request } = await this.publicClient.simulateContract({
|
|
7998
8013
|
address: this.config.diamondAddress,
|
|
7999
8014
|
abi: MarketOrdersFacet_default,
|
|
@@ -8039,8 +8054,8 @@ var TradeModule = class extends BaseModule {
|
|
|
8039
8054
|
* Preview a market order (simulate transaction)
|
|
8040
8055
|
*/
|
|
8041
8056
|
async previewMarketOrder(params) {
|
|
8042
|
-
|
|
8043
|
-
const
|
|
8057
|
+
this.walletClient;
|
|
8058
|
+
const account = await this.getSignerAccount();
|
|
8044
8059
|
const { result } = await this.publicClient.simulateContract({
|
|
8045
8060
|
address: this.config.diamondAddress,
|
|
8046
8061
|
abi: MarketOrdersFacet_default,
|
|
@@ -8060,8 +8075,8 @@ var TradeModule = class extends BaseModule {
|
|
|
8060
8075
|
* Preview placing an order (simulate transaction to check for reverts)
|
|
8061
8076
|
*/
|
|
8062
8077
|
async previewPlaceOrder(params) {
|
|
8063
|
-
|
|
8064
|
-
const
|
|
8078
|
+
this.walletClient;
|
|
8079
|
+
const account = await this.getSignerAccount();
|
|
8065
8080
|
const { result } = await this.publicClient.simulateContract({
|
|
8066
8081
|
address: this.config.diamondAddress,
|
|
8067
8082
|
abi: LimitOrdersFacet_default,
|
|
@@ -8089,7 +8104,7 @@ var TradeModule = class extends BaseModule {
|
|
|
8089
8104
|
*/
|
|
8090
8105
|
async placeMarketSell(params) {
|
|
8091
8106
|
const wallet = this.walletClient;
|
|
8092
|
-
const
|
|
8107
|
+
const account = await this.getSignerAccount();
|
|
8093
8108
|
const { request } = await this.publicClient.simulateContract({
|
|
8094
8109
|
address: this.config.diamondAddress,
|
|
8095
8110
|
abi: MarketOrdersFacet_default,
|
|
@@ -8135,8 +8150,8 @@ var TradeModule = class extends BaseModule {
|
|
|
8135
8150
|
* Preview a market sell order (simulate transaction)
|
|
8136
8151
|
*/
|
|
8137
8152
|
async previewMarketSell(params) {
|
|
8138
|
-
|
|
8139
|
-
const
|
|
8153
|
+
this.walletClient;
|
|
8154
|
+
const account = await this.getSignerAccount();
|
|
8140
8155
|
const { result } = await this.publicClient.simulateContract({
|
|
8141
8156
|
address: this.config.diamondAddress,
|
|
8142
8157
|
abi: MarketOrdersFacet_default,
|
|
@@ -8195,7 +8210,7 @@ var TradeModule = class extends BaseModule {
|
|
|
8195
8210
|
*/
|
|
8196
8211
|
async matchOrders(params) {
|
|
8197
8212
|
const wallet = this.walletClient;
|
|
8198
|
-
const
|
|
8213
|
+
const account = await this.getSignerAccount();
|
|
8199
8214
|
const maxSteps = params.maxSteps || 10n;
|
|
8200
8215
|
const { request } = await this.publicClient.simulateContract({
|
|
8201
8216
|
address: this.config.diamondAddress,
|
|
@@ -8295,7 +8310,7 @@ var TradeModule = class extends BaseModule {
|
|
|
8295
8310
|
*/
|
|
8296
8311
|
async splitPosition(marketId, amount) {
|
|
8297
8312
|
const wallet = this.walletClient;
|
|
8298
|
-
const
|
|
8313
|
+
const account = await this.getSignerAccount();
|
|
8299
8314
|
const { request } = await this.publicClient.simulateContract({
|
|
8300
8315
|
address: this.config.diamondAddress,
|
|
8301
8316
|
abi: VaultFacet_default,
|
|
@@ -8313,7 +8328,7 @@ var TradeModule = class extends BaseModule {
|
|
|
8313
8328
|
*/
|
|
8314
8329
|
async mergePositions(marketId, amount) {
|
|
8315
8330
|
const wallet = this.walletClient;
|
|
8316
|
-
const
|
|
8331
|
+
const account = await this.getSignerAccount();
|
|
8317
8332
|
const { request } = await this.publicClient.simulateContract({
|
|
8318
8333
|
address: this.config.diamondAddress,
|
|
8319
8334
|
abi: VaultFacet_default,
|
|
@@ -8334,7 +8349,7 @@ var TradeModule = class extends BaseModule {
|
|
|
8334
8349
|
*/
|
|
8335
8350
|
async batchPlaceOrders(params) {
|
|
8336
8351
|
const wallet = this.walletClient;
|
|
8337
|
-
const
|
|
8352
|
+
const account = await this.getSignerAccount();
|
|
8338
8353
|
const { request } = await this.publicClient.simulateContract({
|
|
8339
8354
|
address: this.config.diamondAddress,
|
|
8340
8355
|
abi: BatchOrdersFacet_default,
|
|
@@ -8375,7 +8390,7 @@ var TradeModule = class extends BaseModule {
|
|
|
8375
8390
|
*/
|
|
8376
8391
|
async batchCancelOrders(orderIds) {
|
|
8377
8392
|
const wallet = this.walletClient;
|
|
8378
|
-
const
|
|
8393
|
+
const account = await this.getSignerAccount();
|
|
8379
8394
|
const { request } = await this.publicClient.simulateContract({
|
|
8380
8395
|
address: this.config.diamondAddress,
|
|
8381
8396
|
abi: BatchOrdersFacet_default,
|
|
@@ -8394,7 +8409,7 @@ var TradeModule = class extends BaseModule {
|
|
|
8394
8409
|
*/
|
|
8395
8410
|
async cancelAndReplace(params) {
|
|
8396
8411
|
const wallet = this.walletClient;
|
|
8397
|
-
const
|
|
8412
|
+
const account = await this.getSignerAccount();
|
|
8398
8413
|
const { request } = await this.publicClient.simulateContract({
|
|
8399
8414
|
address: this.config.diamondAddress,
|
|
8400
8415
|
abi: BatchOrdersFacet_default,
|
|
@@ -9919,7 +9934,7 @@ var TokenModule = class extends BaseModule {
|
|
|
9919
9934
|
*/
|
|
9920
9935
|
async mint(token, to, amount) {
|
|
9921
9936
|
const wallet = this.walletClient;
|
|
9922
|
-
const
|
|
9937
|
+
const account = await this.getSignerAccount();
|
|
9923
9938
|
const { request } = await this.publicClient.simulateContract({
|
|
9924
9939
|
address: token,
|
|
9925
9940
|
abi: ERC20_default,
|
|
@@ -9934,7 +9949,7 @@ var TokenModule = class extends BaseModule {
|
|
|
9934
9949
|
*/
|
|
9935
9950
|
async approve(token, spender, amount) {
|
|
9936
9951
|
const wallet = this.walletClient;
|
|
9937
|
-
const
|
|
9952
|
+
const account = await this.getSignerAccount();
|
|
9938
9953
|
const { request } = await this.publicClient.simulateContract({
|
|
9939
9954
|
address: token,
|
|
9940
9955
|
abi: ERC20_default,
|
|
@@ -10018,7 +10033,8 @@ var UmaModule = class extends BaseModule {
|
|
|
10018
10033
|
*/
|
|
10019
10034
|
async assertMarketOutcome(params) {
|
|
10020
10035
|
const wallet = this.walletClient;
|
|
10021
|
-
const
|
|
10036
|
+
const account = await this.getSignerAccount();
|
|
10037
|
+
const accountAddress = await this.getSignerAddress();
|
|
10022
10038
|
const autoApprove = params.autoApprove ?? true;
|
|
10023
10039
|
const registryData = await this.publicClient.readContract({
|
|
10024
10040
|
address: this.config.diamondAddress,
|
|
@@ -10033,7 +10049,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10033
10049
|
address: currency,
|
|
10034
10050
|
abi: erc20Abi,
|
|
10035
10051
|
functionName: "allowance",
|
|
10036
|
-
args: [
|
|
10052
|
+
args: [accountAddress, this.config.diamondAddress]
|
|
10037
10053
|
});
|
|
10038
10054
|
if (currentAllowance < bondAmount && autoApprove) {
|
|
10039
10055
|
const approveHash = await wallet.writeContract({
|
|
@@ -10053,7 +10069,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10053
10069
|
address: currency,
|
|
10054
10070
|
abi: erc20Abi,
|
|
10055
10071
|
functionName: "allowance",
|
|
10056
|
-
args: [
|
|
10072
|
+
args: [accountAddress, this.config.diamondAddress]
|
|
10057
10073
|
});
|
|
10058
10074
|
if (newAllowance < bondAmount) {
|
|
10059
10075
|
throw new Error(
|
|
@@ -10069,7 +10085,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10069
10085
|
address: currency,
|
|
10070
10086
|
abi: erc20Abi,
|
|
10071
10087
|
functionName: "balanceOf",
|
|
10072
|
-
args: [
|
|
10088
|
+
args: [accountAddress]
|
|
10073
10089
|
});
|
|
10074
10090
|
if (balance < bondAmount) {
|
|
10075
10091
|
throw new Error(
|
|
@@ -10117,7 +10133,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10117
10133
|
*/
|
|
10118
10134
|
async settleAssertion(assertionId) {
|
|
10119
10135
|
const wallet = this.walletClient;
|
|
10120
|
-
const
|
|
10136
|
+
const account = await this.getSignerAccount();
|
|
10121
10137
|
const { request } = await this.publicClient.simulateContract({
|
|
10122
10138
|
address: this.config.diamondAddress,
|
|
10123
10139
|
abi: ResolutionFacet_default,
|
|
@@ -10132,7 +10148,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10132
10148
|
*/
|
|
10133
10149
|
async reportResolution(params) {
|
|
10134
10150
|
const wallet = this.walletClient;
|
|
10135
|
-
const
|
|
10151
|
+
const account = await this.getSignerAccount();
|
|
10136
10152
|
const { request } = await this.publicClient.simulateContract({
|
|
10137
10153
|
address: this.config.diamondAddress,
|
|
10138
10154
|
abi: ResolutionFacet_default,
|
|
@@ -10199,7 +10215,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10199
10215
|
*/
|
|
10200
10216
|
async redeemWinnings(marketId) {
|
|
10201
10217
|
const wallet = this.walletClient;
|
|
10202
|
-
const
|
|
10218
|
+
const account = await this.getSignerAccount();
|
|
10203
10219
|
const oracleData = await this.publicClient.readContract({
|
|
10204
10220
|
address: this.config.diamondAddress,
|
|
10205
10221
|
abi: MarketsFacet_default,
|
|
@@ -10446,7 +10462,7 @@ var AccessControlModule = class extends BaseModule {
|
|
|
10446
10462
|
*/
|
|
10447
10463
|
async deployWhitelist() {
|
|
10448
10464
|
const wallet = this.walletClient;
|
|
10449
|
-
const
|
|
10465
|
+
const account = await this.getSignerAccount();
|
|
10450
10466
|
const { request } = await this.publicClient.simulateContract({
|
|
10451
10467
|
address: this.config.diamondAddress,
|
|
10452
10468
|
abi: AccessControlFacet_default,
|
|
@@ -10464,7 +10480,7 @@ var AccessControlModule = class extends BaseModule {
|
|
|
10464
10480
|
*/
|
|
10465
10481
|
async deployNFTGated(params) {
|
|
10466
10482
|
const wallet = this.walletClient;
|
|
10467
|
-
const
|
|
10483
|
+
const account = await this.getSignerAccount();
|
|
10468
10484
|
const { request } = await this.publicClient.simulateContract({
|
|
10469
10485
|
address: this.config.diamondAddress,
|
|
10470
10486
|
abi: AccessControlFacet_default,
|
|
@@ -10481,7 +10497,7 @@ var AccessControlModule = class extends BaseModule {
|
|
|
10481
10497
|
*/
|
|
10482
10498
|
async deployTokenGated(params) {
|
|
10483
10499
|
const wallet = this.walletClient;
|
|
10484
|
-
const
|
|
10500
|
+
const account = await this.getSignerAccount();
|
|
10485
10501
|
const { request } = await this.publicClient.simulateContract({
|
|
10486
10502
|
address: this.config.diamondAddress,
|
|
10487
10503
|
abi: AccessControlFacet_default,
|
|
@@ -10497,7 +10513,7 @@ var AccessControlModule = class extends BaseModule {
|
|
|
10497
10513
|
*/
|
|
10498
10514
|
async setMarketTradingAC(params) {
|
|
10499
10515
|
const wallet = this.walletClient;
|
|
10500
|
-
const
|
|
10516
|
+
const account = await this.getSignerAccount();
|
|
10501
10517
|
const { request } = await this.publicClient.simulateContract({
|
|
10502
10518
|
address: this.config.diamondAddress,
|
|
10503
10519
|
abi: AccessControlFacet_default,
|
|
@@ -10512,7 +10528,7 @@ var AccessControlModule = class extends BaseModule {
|
|
|
10512
10528
|
*/
|
|
10513
10529
|
async removeMarketTradingAC(params) {
|
|
10514
10530
|
const wallet = this.walletClient;
|
|
10515
|
-
const
|
|
10531
|
+
const account = await this.getSignerAccount();
|
|
10516
10532
|
const { request } = await this.publicClient.simulateContract({
|
|
10517
10533
|
address: this.config.diamondAddress,
|
|
10518
10534
|
abi: AccessControlFacet_default,
|
|
@@ -10551,7 +10567,7 @@ var AccessControlModule = class extends BaseModule {
|
|
|
10551
10567
|
*/
|
|
10552
10568
|
async addToWhitelist(params) {
|
|
10553
10569
|
const wallet = this.walletClient;
|
|
10554
|
-
const
|
|
10570
|
+
const account = await this.getSignerAccount();
|
|
10555
10571
|
const { request } = await this.publicClient.simulateContract({
|
|
10556
10572
|
address: params.acContract,
|
|
10557
10573
|
abi: WhitelistAccessControl_default,
|
|
@@ -10566,7 +10582,7 @@ var AccessControlModule = class extends BaseModule {
|
|
|
10566
10582
|
*/
|
|
10567
10583
|
async removeFromWhitelist(params) {
|
|
10568
10584
|
const wallet = this.walletClient;
|
|
10569
|
-
const
|
|
10585
|
+
const account = await this.getSignerAccount();
|
|
10570
10586
|
const { request } = await this.publicClient.simulateContract({
|
|
10571
10587
|
address: params.acContract,
|
|
10572
10588
|
abi: WhitelistAccessControl_default,
|
|
@@ -10628,10 +10644,10 @@ var PriceMarketModule = class extends BaseModule {
|
|
|
10628
10644
|
*/
|
|
10629
10645
|
async createPyth(params) {
|
|
10630
10646
|
const wallet = this.walletClient;
|
|
10631
|
-
const
|
|
10647
|
+
const account = await this.getSignerAccount();
|
|
10632
10648
|
const outcomes = params.outcomes ?? ["Up", "Down"];
|
|
10633
10649
|
const isStrikeMarket = params.strikePrice && params.strikePrice > BigInt(0);
|
|
10634
|
-
const { encodedTags, ancillaryData } = await this._prepareCreationCommon(params,
|
|
10650
|
+
const { encodedTags, ancillaryData } = await this._prepareCreationCommon(params, await this.getSignerAddress());
|
|
10635
10651
|
if (!isValidTickSize(params.tickSize)) {
|
|
10636
10652
|
throw new Error("Invalid tickSize: must be 1e15 (0.1%) or 1e16 (1%)");
|
|
10637
10653
|
}
|
|
@@ -10674,7 +10690,7 @@ var PriceMarketModule = class extends BaseModule {
|
|
|
10674
10690
|
*/
|
|
10675
10691
|
async resolvePyth(marketId) {
|
|
10676
10692
|
const wallet = this.walletClient;
|
|
10677
|
-
const
|
|
10693
|
+
const account = await this.getSignerAccount();
|
|
10678
10694
|
const pm = await this.get(marketId);
|
|
10679
10695
|
if (pm.resolved) {
|
|
10680
10696
|
throw new Error("Price market already resolved");
|
|
@@ -10767,7 +10783,7 @@ var PriceMarketModule = class extends BaseModule {
|
|
|
10767
10783
|
*/
|
|
10768
10784
|
async setPythContract(pythContract) {
|
|
10769
10785
|
const wallet = this.walletClient;
|
|
10770
|
-
const
|
|
10786
|
+
const account = await this.getSignerAccount();
|
|
10771
10787
|
const { request } = await this.publicClient.simulateContract({
|
|
10772
10788
|
address: this.config.diamondAddress,
|
|
10773
10789
|
abi: PythResolutionFacet_default,
|
|
@@ -10797,7 +10813,7 @@ var PriceMarketModule = class extends BaseModule {
|
|
|
10797
10813
|
*/
|
|
10798
10814
|
async setOpenMaxStaleness(openMaxStaleness) {
|
|
10799
10815
|
const wallet = this.walletClient;
|
|
10800
|
-
const
|
|
10816
|
+
const account = await this.getSignerAccount();
|
|
10801
10817
|
const { request } = await this.publicClient.simulateContract({
|
|
10802
10818
|
address: this.config.diamondAddress,
|
|
10803
10819
|
abi: PythResolutionFacet_default,
|