@oddmaki-protocol/sdk 0.5.1 → 0.6.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/LICENSE +1 -1
- package/README.md +7 -1
- package/dist/index.d.mts +256 -1
- package/dist/index.d.ts +256 -1
- package/dist/index.js +273 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +273 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
package/dist/index.js
CHANGED
|
@@ -7,9 +7,9 @@ var graphqlRequest = require('graphql-request');
|
|
|
7
7
|
// src/client.ts
|
|
8
8
|
var CONTRACT_ADDRESSES = {
|
|
9
9
|
[chains.baseSepolia.id]: {
|
|
10
|
-
diamond: "
|
|
10
|
+
diamond: "0x31a4126aec35b36d46dd371eb0f0d5b71e1c2292",
|
|
11
11
|
conditionalTokens: "0x7364747372Ac4a175B5326f5B2C9CB1C271d32e8",
|
|
12
|
-
usdc: "
|
|
12
|
+
usdc: "0x1d3caa0156e8e573814b78766ba7958d7e11488b",
|
|
13
13
|
subgraph: "https://api.studio.thegraph.com/query/1716020/oddmaki/version/latest"
|
|
14
14
|
}
|
|
15
15
|
};
|
|
@@ -6824,6 +6824,260 @@ var ERC20_default = [
|
|
|
6824
6824
|
}
|
|
6825
6825
|
];
|
|
6826
6826
|
|
|
6827
|
+
// src/contracts/abis/UmaOracle.json
|
|
6828
|
+
var UmaOracle_default = [
|
|
6829
|
+
{
|
|
6830
|
+
type: "function",
|
|
6831
|
+
name: "assertTruth",
|
|
6832
|
+
inputs: [
|
|
6833
|
+
{
|
|
6834
|
+
name: "claim",
|
|
6835
|
+
type: "bytes",
|
|
6836
|
+
internalType: "bytes"
|
|
6837
|
+
},
|
|
6838
|
+
{
|
|
6839
|
+
name: "asserter",
|
|
6840
|
+
type: "address",
|
|
6841
|
+
internalType: "address"
|
|
6842
|
+
},
|
|
6843
|
+
{
|
|
6844
|
+
name: "callbackRecipient",
|
|
6845
|
+
type: "address",
|
|
6846
|
+
internalType: "address"
|
|
6847
|
+
},
|
|
6848
|
+
{
|
|
6849
|
+
name: "escalationManager",
|
|
6850
|
+
type: "address",
|
|
6851
|
+
internalType: "address"
|
|
6852
|
+
},
|
|
6853
|
+
{
|
|
6854
|
+
name: "liveness",
|
|
6855
|
+
type: "uint64",
|
|
6856
|
+
internalType: "uint64"
|
|
6857
|
+
},
|
|
6858
|
+
{
|
|
6859
|
+
name: "currency",
|
|
6860
|
+
type: "address",
|
|
6861
|
+
internalType: "contract IERC20"
|
|
6862
|
+
},
|
|
6863
|
+
{
|
|
6864
|
+
name: "bond",
|
|
6865
|
+
type: "uint256",
|
|
6866
|
+
internalType: "uint256"
|
|
6867
|
+
},
|
|
6868
|
+
{
|
|
6869
|
+
name: "identifier",
|
|
6870
|
+
type: "bytes32",
|
|
6871
|
+
internalType: "bytes32"
|
|
6872
|
+
},
|
|
6873
|
+
{
|
|
6874
|
+
name: "domainId",
|
|
6875
|
+
type: "bytes32",
|
|
6876
|
+
internalType: "bytes32"
|
|
6877
|
+
}
|
|
6878
|
+
],
|
|
6879
|
+
outputs: [
|
|
6880
|
+
{
|
|
6881
|
+
name: "",
|
|
6882
|
+
type: "bytes32",
|
|
6883
|
+
internalType: "bytes32"
|
|
6884
|
+
}
|
|
6885
|
+
],
|
|
6886
|
+
stateMutability: "nonpayable"
|
|
6887
|
+
},
|
|
6888
|
+
{
|
|
6889
|
+
type: "function",
|
|
6890
|
+
name: "defaultIdentifier",
|
|
6891
|
+
inputs: [],
|
|
6892
|
+
outputs: [
|
|
6893
|
+
{
|
|
6894
|
+
name: "",
|
|
6895
|
+
type: "bytes32",
|
|
6896
|
+
internalType: "bytes32"
|
|
6897
|
+
}
|
|
6898
|
+
],
|
|
6899
|
+
stateMutability: "view"
|
|
6900
|
+
},
|
|
6901
|
+
{
|
|
6902
|
+
type: "function",
|
|
6903
|
+
name: "getAssertion",
|
|
6904
|
+
inputs: [
|
|
6905
|
+
{
|
|
6906
|
+
name: "assertionId",
|
|
6907
|
+
type: "bytes32",
|
|
6908
|
+
internalType: "bytes32"
|
|
6909
|
+
}
|
|
6910
|
+
],
|
|
6911
|
+
outputs: [
|
|
6912
|
+
{
|
|
6913
|
+
name: "",
|
|
6914
|
+
type: "tuple",
|
|
6915
|
+
internalType: "struct OptimisticOracleV3Interface.Assertion",
|
|
6916
|
+
components: [
|
|
6917
|
+
{
|
|
6918
|
+
name: "escalationManagerSettings",
|
|
6919
|
+
type: "tuple",
|
|
6920
|
+
internalType: "struct OptimisticOracleV3Interface.EscalationManagerSettings",
|
|
6921
|
+
components: [
|
|
6922
|
+
{
|
|
6923
|
+
name: "arbitrateViaEscalationManager",
|
|
6924
|
+
type: "bool",
|
|
6925
|
+
internalType: "bool"
|
|
6926
|
+
},
|
|
6927
|
+
{
|
|
6928
|
+
name: "discardOracle",
|
|
6929
|
+
type: "bool",
|
|
6930
|
+
internalType: "bool"
|
|
6931
|
+
},
|
|
6932
|
+
{
|
|
6933
|
+
name: "validateDisputers",
|
|
6934
|
+
type: "bool",
|
|
6935
|
+
internalType: "bool"
|
|
6936
|
+
},
|
|
6937
|
+
{
|
|
6938
|
+
name: "assertingCaller",
|
|
6939
|
+
type: "address",
|
|
6940
|
+
internalType: "address"
|
|
6941
|
+
},
|
|
6942
|
+
{
|
|
6943
|
+
name: "escalationManager",
|
|
6944
|
+
type: "address",
|
|
6945
|
+
internalType: "address"
|
|
6946
|
+
}
|
|
6947
|
+
]
|
|
6948
|
+
},
|
|
6949
|
+
{
|
|
6950
|
+
name: "asserter",
|
|
6951
|
+
type: "address",
|
|
6952
|
+
internalType: "address"
|
|
6953
|
+
},
|
|
6954
|
+
{
|
|
6955
|
+
name: "assertionTime",
|
|
6956
|
+
type: "uint64",
|
|
6957
|
+
internalType: "uint64"
|
|
6958
|
+
},
|
|
6959
|
+
{
|
|
6960
|
+
name: "settled",
|
|
6961
|
+
type: "bool",
|
|
6962
|
+
internalType: "bool"
|
|
6963
|
+
},
|
|
6964
|
+
{
|
|
6965
|
+
name: "currency",
|
|
6966
|
+
type: "address",
|
|
6967
|
+
internalType: "contract IERC20"
|
|
6968
|
+
},
|
|
6969
|
+
{
|
|
6970
|
+
name: "expirationTime",
|
|
6971
|
+
type: "uint64",
|
|
6972
|
+
internalType: "uint64"
|
|
6973
|
+
},
|
|
6974
|
+
{
|
|
6975
|
+
name: "settlementResolution",
|
|
6976
|
+
type: "bool",
|
|
6977
|
+
internalType: "bool"
|
|
6978
|
+
},
|
|
6979
|
+
{
|
|
6980
|
+
name: "domainId",
|
|
6981
|
+
type: "bytes32",
|
|
6982
|
+
internalType: "bytes32"
|
|
6983
|
+
},
|
|
6984
|
+
{
|
|
6985
|
+
name: "identifier",
|
|
6986
|
+
type: "bytes32",
|
|
6987
|
+
internalType: "bytes32"
|
|
6988
|
+
},
|
|
6989
|
+
{
|
|
6990
|
+
name: "bond",
|
|
6991
|
+
type: "uint256",
|
|
6992
|
+
internalType: "uint256"
|
|
6993
|
+
},
|
|
6994
|
+
{
|
|
6995
|
+
name: "callbackRecipient",
|
|
6996
|
+
type: "address",
|
|
6997
|
+
internalType: "address"
|
|
6998
|
+
},
|
|
6999
|
+
{
|
|
7000
|
+
name: "disputer",
|
|
7001
|
+
type: "address",
|
|
7002
|
+
internalType: "address"
|
|
7003
|
+
}
|
|
7004
|
+
]
|
|
7005
|
+
}
|
|
7006
|
+
],
|
|
7007
|
+
stateMutability: "view"
|
|
7008
|
+
},
|
|
7009
|
+
{
|
|
7010
|
+
type: "function",
|
|
7011
|
+
name: "getAssertionResult",
|
|
7012
|
+
inputs: [
|
|
7013
|
+
{
|
|
7014
|
+
name: "assertionId",
|
|
7015
|
+
type: "bytes32",
|
|
7016
|
+
internalType: "bytes32"
|
|
7017
|
+
}
|
|
7018
|
+
],
|
|
7019
|
+
outputs: [
|
|
7020
|
+
{
|
|
7021
|
+
name: "",
|
|
7022
|
+
type: "bool",
|
|
7023
|
+
internalType: "bool"
|
|
7024
|
+
}
|
|
7025
|
+
],
|
|
7026
|
+
stateMutability: "view"
|
|
7027
|
+
},
|
|
7028
|
+
{
|
|
7029
|
+
type: "function",
|
|
7030
|
+
name: "getMinimumBond",
|
|
7031
|
+
inputs: [
|
|
7032
|
+
{
|
|
7033
|
+
name: "currency",
|
|
7034
|
+
type: "address",
|
|
7035
|
+
internalType: "address"
|
|
7036
|
+
}
|
|
7037
|
+
],
|
|
7038
|
+
outputs: [
|
|
7039
|
+
{
|
|
7040
|
+
name: "",
|
|
7041
|
+
type: "uint256",
|
|
7042
|
+
internalType: "uint256"
|
|
7043
|
+
}
|
|
7044
|
+
],
|
|
7045
|
+
stateMutability: "view"
|
|
7046
|
+
},
|
|
7047
|
+
{
|
|
7048
|
+
type: "function",
|
|
7049
|
+
name: "isSettled",
|
|
7050
|
+
inputs: [
|
|
7051
|
+
{
|
|
7052
|
+
name: "assertionId",
|
|
7053
|
+
type: "bytes32",
|
|
7054
|
+
internalType: "bytes32"
|
|
7055
|
+
}
|
|
7056
|
+
],
|
|
7057
|
+
outputs: [
|
|
7058
|
+
{
|
|
7059
|
+
name: "settled",
|
|
7060
|
+
type: "bool",
|
|
7061
|
+
internalType: "bool"
|
|
7062
|
+
}
|
|
7063
|
+
],
|
|
7064
|
+
stateMutability: "view"
|
|
7065
|
+
},
|
|
7066
|
+
{
|
|
7067
|
+
type: "function",
|
|
7068
|
+
name: "settleAssertion",
|
|
7069
|
+
inputs: [
|
|
7070
|
+
{
|
|
7071
|
+
name: "assertionId",
|
|
7072
|
+
type: "bytes32",
|
|
7073
|
+
internalType: "bytes32"
|
|
7074
|
+
}
|
|
7075
|
+
],
|
|
7076
|
+
outputs: [],
|
|
7077
|
+
stateMutability: "nonpayable"
|
|
7078
|
+
}
|
|
7079
|
+
];
|
|
7080
|
+
|
|
6827
7081
|
// src/modules/venue.ts
|
|
6828
7082
|
var VenueModule = class extends BaseModule {
|
|
6829
7083
|
/**
|
|
@@ -7221,6 +7475,18 @@ function clearDecimalsCache() {
|
|
|
7221
7475
|
}
|
|
7222
7476
|
|
|
7223
7477
|
// src/modules/market.ts
|
|
7478
|
+
var CTF_IS_APPROVED_FOR_ALL_ABI = [
|
|
7479
|
+
{
|
|
7480
|
+
name: "isApprovedForAll",
|
|
7481
|
+
type: "function",
|
|
7482
|
+
stateMutability: "view",
|
|
7483
|
+
inputs: [
|
|
7484
|
+
{ name: "account", type: "address" },
|
|
7485
|
+
{ name: "operator", type: "address" }
|
|
7486
|
+
],
|
|
7487
|
+
outputs: [{ name: "", type: "bool" }]
|
|
7488
|
+
}
|
|
7489
|
+
];
|
|
7224
7490
|
var MarketModule = class extends BaseModule {
|
|
7225
7491
|
/**
|
|
7226
7492
|
* Format market question into UMA-compliant ancillary data
|
|
@@ -7651,11 +7917,12 @@ var MarketModule = class extends BaseModule {
|
|
|
7651
7917
|
async convertPositions(params) {
|
|
7652
7918
|
const wallet = this.walletClient;
|
|
7653
7919
|
const account = await this.getSignerAccount();
|
|
7920
|
+
const accountAddress = await this.getSignerAddress();
|
|
7654
7921
|
const isApproved = await this.publicClient.readContract({
|
|
7655
7922
|
address: this.config.conditionalTokensAddress,
|
|
7656
|
-
abi:
|
|
7923
|
+
abi: CTF_IS_APPROVED_FOR_ALL_ABI,
|
|
7657
7924
|
functionName: "isApprovedForAll",
|
|
7658
|
-
args: [
|
|
7925
|
+
args: [accountAddress, this.config.diamondAddress]
|
|
7659
7926
|
});
|
|
7660
7927
|
if (!isApproved) {
|
|
7661
7928
|
throw new Error(
|
|
@@ -10014,15 +10281,6 @@ var TokenModule = class extends BaseModule {
|
|
|
10014
10281
|
});
|
|
10015
10282
|
}
|
|
10016
10283
|
};
|
|
10017
|
-
var optimisticOracleV3Abi = [
|
|
10018
|
-
{
|
|
10019
|
-
inputs: [{ name: "currency", type: "address" }],
|
|
10020
|
-
name: "getMinimumBond",
|
|
10021
|
-
outputs: [{ name: "", type: "uint256" }],
|
|
10022
|
-
stateMutability: "view",
|
|
10023
|
-
type: "function"
|
|
10024
|
-
}
|
|
10025
|
-
];
|
|
10026
10284
|
var UmaModule = class extends BaseModule {
|
|
10027
10285
|
/**
|
|
10028
10286
|
* Assert an outcome for a market question
|
|
@@ -10123,7 +10381,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10123
10381
|
});
|
|
10124
10382
|
const minimumBond = await this.publicClient.readContract({
|
|
10125
10383
|
address: umaOracle,
|
|
10126
|
-
abi:
|
|
10384
|
+
abi: UmaOracle_default,
|
|
10127
10385
|
functionName: "getMinimumBond",
|
|
10128
10386
|
args: [currency]
|
|
10129
10387
|
});
|
|
@@ -11120,6 +11378,7 @@ exports.TokenModule = TokenModule;
|
|
|
11120
11378
|
exports.TradeModule = TradeModule;
|
|
11121
11379
|
exports.UMA_DEFAULTS = UMA_DEFAULTS;
|
|
11122
11380
|
exports.UmaModule = UmaModule;
|
|
11381
|
+
exports.UmaOracleABI = UmaOracle_default;
|
|
11123
11382
|
exports.VALID_TICK_SIZES = VALID_TICK_SIZES;
|
|
11124
11383
|
exports.VaultFacetABI = VaultFacet_default;
|
|
11125
11384
|
exports.VenueFacetABI = VenueFacet_default;
|