@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.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import { gql, GraphQLClient } from 'graphql-request';
|
|
|
5
5
|
// src/client.ts
|
|
6
6
|
var CONTRACT_ADDRESSES = {
|
|
7
7
|
[baseSepolia.id]: {
|
|
8
|
-
diamond: "
|
|
8
|
+
diamond: "0x31a4126aec35b36d46dd371eb0f0d5b71e1c2292",
|
|
9
9
|
conditionalTokens: "0x7364747372Ac4a175B5326f5B2C9CB1C271d32e8",
|
|
10
|
-
usdc: "
|
|
10
|
+
usdc: "0x1d3caa0156e8e573814b78766ba7958d7e11488b",
|
|
11
11
|
subgraph: "https://api.studio.thegraph.com/query/1716020/oddmaki/version/latest"
|
|
12
12
|
}
|
|
13
13
|
};
|
|
@@ -6822,6 +6822,260 @@ var ERC20_default = [
|
|
|
6822
6822
|
}
|
|
6823
6823
|
];
|
|
6824
6824
|
|
|
6825
|
+
// src/contracts/abis/UmaOracle.json
|
|
6826
|
+
var UmaOracle_default = [
|
|
6827
|
+
{
|
|
6828
|
+
type: "function",
|
|
6829
|
+
name: "assertTruth",
|
|
6830
|
+
inputs: [
|
|
6831
|
+
{
|
|
6832
|
+
name: "claim",
|
|
6833
|
+
type: "bytes",
|
|
6834
|
+
internalType: "bytes"
|
|
6835
|
+
},
|
|
6836
|
+
{
|
|
6837
|
+
name: "asserter",
|
|
6838
|
+
type: "address",
|
|
6839
|
+
internalType: "address"
|
|
6840
|
+
},
|
|
6841
|
+
{
|
|
6842
|
+
name: "callbackRecipient",
|
|
6843
|
+
type: "address",
|
|
6844
|
+
internalType: "address"
|
|
6845
|
+
},
|
|
6846
|
+
{
|
|
6847
|
+
name: "escalationManager",
|
|
6848
|
+
type: "address",
|
|
6849
|
+
internalType: "address"
|
|
6850
|
+
},
|
|
6851
|
+
{
|
|
6852
|
+
name: "liveness",
|
|
6853
|
+
type: "uint64",
|
|
6854
|
+
internalType: "uint64"
|
|
6855
|
+
},
|
|
6856
|
+
{
|
|
6857
|
+
name: "currency",
|
|
6858
|
+
type: "address",
|
|
6859
|
+
internalType: "contract IERC20"
|
|
6860
|
+
},
|
|
6861
|
+
{
|
|
6862
|
+
name: "bond",
|
|
6863
|
+
type: "uint256",
|
|
6864
|
+
internalType: "uint256"
|
|
6865
|
+
},
|
|
6866
|
+
{
|
|
6867
|
+
name: "identifier",
|
|
6868
|
+
type: "bytes32",
|
|
6869
|
+
internalType: "bytes32"
|
|
6870
|
+
},
|
|
6871
|
+
{
|
|
6872
|
+
name: "domainId",
|
|
6873
|
+
type: "bytes32",
|
|
6874
|
+
internalType: "bytes32"
|
|
6875
|
+
}
|
|
6876
|
+
],
|
|
6877
|
+
outputs: [
|
|
6878
|
+
{
|
|
6879
|
+
name: "",
|
|
6880
|
+
type: "bytes32",
|
|
6881
|
+
internalType: "bytes32"
|
|
6882
|
+
}
|
|
6883
|
+
],
|
|
6884
|
+
stateMutability: "nonpayable"
|
|
6885
|
+
},
|
|
6886
|
+
{
|
|
6887
|
+
type: "function",
|
|
6888
|
+
name: "defaultIdentifier",
|
|
6889
|
+
inputs: [],
|
|
6890
|
+
outputs: [
|
|
6891
|
+
{
|
|
6892
|
+
name: "",
|
|
6893
|
+
type: "bytes32",
|
|
6894
|
+
internalType: "bytes32"
|
|
6895
|
+
}
|
|
6896
|
+
],
|
|
6897
|
+
stateMutability: "view"
|
|
6898
|
+
},
|
|
6899
|
+
{
|
|
6900
|
+
type: "function",
|
|
6901
|
+
name: "getAssertion",
|
|
6902
|
+
inputs: [
|
|
6903
|
+
{
|
|
6904
|
+
name: "assertionId",
|
|
6905
|
+
type: "bytes32",
|
|
6906
|
+
internalType: "bytes32"
|
|
6907
|
+
}
|
|
6908
|
+
],
|
|
6909
|
+
outputs: [
|
|
6910
|
+
{
|
|
6911
|
+
name: "",
|
|
6912
|
+
type: "tuple",
|
|
6913
|
+
internalType: "struct OptimisticOracleV3Interface.Assertion",
|
|
6914
|
+
components: [
|
|
6915
|
+
{
|
|
6916
|
+
name: "escalationManagerSettings",
|
|
6917
|
+
type: "tuple",
|
|
6918
|
+
internalType: "struct OptimisticOracleV3Interface.EscalationManagerSettings",
|
|
6919
|
+
components: [
|
|
6920
|
+
{
|
|
6921
|
+
name: "arbitrateViaEscalationManager",
|
|
6922
|
+
type: "bool",
|
|
6923
|
+
internalType: "bool"
|
|
6924
|
+
},
|
|
6925
|
+
{
|
|
6926
|
+
name: "discardOracle",
|
|
6927
|
+
type: "bool",
|
|
6928
|
+
internalType: "bool"
|
|
6929
|
+
},
|
|
6930
|
+
{
|
|
6931
|
+
name: "validateDisputers",
|
|
6932
|
+
type: "bool",
|
|
6933
|
+
internalType: "bool"
|
|
6934
|
+
},
|
|
6935
|
+
{
|
|
6936
|
+
name: "assertingCaller",
|
|
6937
|
+
type: "address",
|
|
6938
|
+
internalType: "address"
|
|
6939
|
+
},
|
|
6940
|
+
{
|
|
6941
|
+
name: "escalationManager",
|
|
6942
|
+
type: "address",
|
|
6943
|
+
internalType: "address"
|
|
6944
|
+
}
|
|
6945
|
+
]
|
|
6946
|
+
},
|
|
6947
|
+
{
|
|
6948
|
+
name: "asserter",
|
|
6949
|
+
type: "address",
|
|
6950
|
+
internalType: "address"
|
|
6951
|
+
},
|
|
6952
|
+
{
|
|
6953
|
+
name: "assertionTime",
|
|
6954
|
+
type: "uint64",
|
|
6955
|
+
internalType: "uint64"
|
|
6956
|
+
},
|
|
6957
|
+
{
|
|
6958
|
+
name: "settled",
|
|
6959
|
+
type: "bool",
|
|
6960
|
+
internalType: "bool"
|
|
6961
|
+
},
|
|
6962
|
+
{
|
|
6963
|
+
name: "currency",
|
|
6964
|
+
type: "address",
|
|
6965
|
+
internalType: "contract IERC20"
|
|
6966
|
+
},
|
|
6967
|
+
{
|
|
6968
|
+
name: "expirationTime",
|
|
6969
|
+
type: "uint64",
|
|
6970
|
+
internalType: "uint64"
|
|
6971
|
+
},
|
|
6972
|
+
{
|
|
6973
|
+
name: "settlementResolution",
|
|
6974
|
+
type: "bool",
|
|
6975
|
+
internalType: "bool"
|
|
6976
|
+
},
|
|
6977
|
+
{
|
|
6978
|
+
name: "domainId",
|
|
6979
|
+
type: "bytes32",
|
|
6980
|
+
internalType: "bytes32"
|
|
6981
|
+
},
|
|
6982
|
+
{
|
|
6983
|
+
name: "identifier",
|
|
6984
|
+
type: "bytes32",
|
|
6985
|
+
internalType: "bytes32"
|
|
6986
|
+
},
|
|
6987
|
+
{
|
|
6988
|
+
name: "bond",
|
|
6989
|
+
type: "uint256",
|
|
6990
|
+
internalType: "uint256"
|
|
6991
|
+
},
|
|
6992
|
+
{
|
|
6993
|
+
name: "callbackRecipient",
|
|
6994
|
+
type: "address",
|
|
6995
|
+
internalType: "address"
|
|
6996
|
+
},
|
|
6997
|
+
{
|
|
6998
|
+
name: "disputer",
|
|
6999
|
+
type: "address",
|
|
7000
|
+
internalType: "address"
|
|
7001
|
+
}
|
|
7002
|
+
]
|
|
7003
|
+
}
|
|
7004
|
+
],
|
|
7005
|
+
stateMutability: "view"
|
|
7006
|
+
},
|
|
7007
|
+
{
|
|
7008
|
+
type: "function",
|
|
7009
|
+
name: "getAssertionResult",
|
|
7010
|
+
inputs: [
|
|
7011
|
+
{
|
|
7012
|
+
name: "assertionId",
|
|
7013
|
+
type: "bytes32",
|
|
7014
|
+
internalType: "bytes32"
|
|
7015
|
+
}
|
|
7016
|
+
],
|
|
7017
|
+
outputs: [
|
|
7018
|
+
{
|
|
7019
|
+
name: "",
|
|
7020
|
+
type: "bool",
|
|
7021
|
+
internalType: "bool"
|
|
7022
|
+
}
|
|
7023
|
+
],
|
|
7024
|
+
stateMutability: "view"
|
|
7025
|
+
},
|
|
7026
|
+
{
|
|
7027
|
+
type: "function",
|
|
7028
|
+
name: "getMinimumBond",
|
|
7029
|
+
inputs: [
|
|
7030
|
+
{
|
|
7031
|
+
name: "currency",
|
|
7032
|
+
type: "address",
|
|
7033
|
+
internalType: "address"
|
|
7034
|
+
}
|
|
7035
|
+
],
|
|
7036
|
+
outputs: [
|
|
7037
|
+
{
|
|
7038
|
+
name: "",
|
|
7039
|
+
type: "uint256",
|
|
7040
|
+
internalType: "uint256"
|
|
7041
|
+
}
|
|
7042
|
+
],
|
|
7043
|
+
stateMutability: "view"
|
|
7044
|
+
},
|
|
7045
|
+
{
|
|
7046
|
+
type: "function",
|
|
7047
|
+
name: "isSettled",
|
|
7048
|
+
inputs: [
|
|
7049
|
+
{
|
|
7050
|
+
name: "assertionId",
|
|
7051
|
+
type: "bytes32",
|
|
7052
|
+
internalType: "bytes32"
|
|
7053
|
+
}
|
|
7054
|
+
],
|
|
7055
|
+
outputs: [
|
|
7056
|
+
{
|
|
7057
|
+
name: "settled",
|
|
7058
|
+
type: "bool",
|
|
7059
|
+
internalType: "bool"
|
|
7060
|
+
}
|
|
7061
|
+
],
|
|
7062
|
+
stateMutability: "view"
|
|
7063
|
+
},
|
|
7064
|
+
{
|
|
7065
|
+
type: "function",
|
|
7066
|
+
name: "settleAssertion",
|
|
7067
|
+
inputs: [
|
|
7068
|
+
{
|
|
7069
|
+
name: "assertionId",
|
|
7070
|
+
type: "bytes32",
|
|
7071
|
+
internalType: "bytes32"
|
|
7072
|
+
}
|
|
7073
|
+
],
|
|
7074
|
+
outputs: [],
|
|
7075
|
+
stateMutability: "nonpayable"
|
|
7076
|
+
}
|
|
7077
|
+
];
|
|
7078
|
+
|
|
6825
7079
|
// src/modules/venue.ts
|
|
6826
7080
|
var VenueModule = class extends BaseModule {
|
|
6827
7081
|
/**
|
|
@@ -7219,6 +7473,18 @@ function clearDecimalsCache() {
|
|
|
7219
7473
|
}
|
|
7220
7474
|
|
|
7221
7475
|
// src/modules/market.ts
|
|
7476
|
+
var CTF_IS_APPROVED_FOR_ALL_ABI = [
|
|
7477
|
+
{
|
|
7478
|
+
name: "isApprovedForAll",
|
|
7479
|
+
type: "function",
|
|
7480
|
+
stateMutability: "view",
|
|
7481
|
+
inputs: [
|
|
7482
|
+
{ name: "account", type: "address" },
|
|
7483
|
+
{ name: "operator", type: "address" }
|
|
7484
|
+
],
|
|
7485
|
+
outputs: [{ name: "", type: "bool" }]
|
|
7486
|
+
}
|
|
7487
|
+
];
|
|
7222
7488
|
var MarketModule = class extends BaseModule {
|
|
7223
7489
|
/**
|
|
7224
7490
|
* Format market question into UMA-compliant ancillary data
|
|
@@ -7649,11 +7915,12 @@ var MarketModule = class extends BaseModule {
|
|
|
7649
7915
|
async convertPositions(params) {
|
|
7650
7916
|
const wallet = this.walletClient;
|
|
7651
7917
|
const account = await this.getSignerAccount();
|
|
7918
|
+
const accountAddress = await this.getSignerAddress();
|
|
7652
7919
|
const isApproved = await this.publicClient.readContract({
|
|
7653
7920
|
address: this.config.conditionalTokensAddress,
|
|
7654
|
-
abi:
|
|
7921
|
+
abi: CTF_IS_APPROVED_FOR_ALL_ABI,
|
|
7655
7922
|
functionName: "isApprovedForAll",
|
|
7656
|
-
args: [
|
|
7923
|
+
args: [accountAddress, this.config.diamondAddress]
|
|
7657
7924
|
});
|
|
7658
7925
|
if (!isApproved) {
|
|
7659
7926
|
throw new Error(
|
|
@@ -10012,15 +10279,6 @@ var TokenModule = class extends BaseModule {
|
|
|
10012
10279
|
});
|
|
10013
10280
|
}
|
|
10014
10281
|
};
|
|
10015
|
-
var optimisticOracleV3Abi = [
|
|
10016
|
-
{
|
|
10017
|
-
inputs: [{ name: "currency", type: "address" }],
|
|
10018
|
-
name: "getMinimumBond",
|
|
10019
|
-
outputs: [{ name: "", type: "uint256" }],
|
|
10020
|
-
stateMutability: "view",
|
|
10021
|
-
type: "function"
|
|
10022
|
-
}
|
|
10023
|
-
];
|
|
10024
10282
|
var UmaModule = class extends BaseModule {
|
|
10025
10283
|
/**
|
|
10026
10284
|
* Assert an outcome for a market question
|
|
@@ -10121,7 +10379,7 @@ var UmaModule = class extends BaseModule {
|
|
|
10121
10379
|
});
|
|
10122
10380
|
const minimumBond = await this.publicClient.readContract({
|
|
10123
10381
|
address: umaOracle,
|
|
10124
|
-
abi:
|
|
10382
|
+
abi: UmaOracle_default,
|
|
10125
10383
|
functionName: "getMinimumBond",
|
|
10126
10384
|
args: [currency]
|
|
10127
10385
|
});
|
|
@@ -11056,6 +11314,6 @@ function parseMetadata(json) {
|
|
|
11056
11314
|
// src/index.ts
|
|
11057
11315
|
var version = "0.1.0";
|
|
11058
11316
|
|
|
11059
|
-
export { AccessControlFacet_default as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet_default as BatchOrdersFacetABI, CONTRACT_ADDRESSES, ConditionalTokens_default as ConditionalTokensABI, DEFAULT_CHAIN, ERC20_default as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet_default as LimitOrdersFacetABI, MarketGroupFacet_default as MarketGroupFacetABI, MarketModule, MarketOrdersFacet_default as MarketOrdersFacetABI, MarketsFacet_default as MarketsFacetABI, MatchingFacet_default as MatchingFacetABI, MetadataFacet_default as MetadataFacetABI, NegRiskFacet_default as NegRiskFacetABI, OddMakiClient, OrderBookFacet_default as OrderBookFacetABI, PROTOCOL_FEES, PriceMarketFacet_default as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet_default as ProtocolFacetABI, PublicModule, PythResolutionFacet_default as PythResolutionFacetABI, ResolutionFacet_default as ResolutionFacetABI, SubgraphClient, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet_default as TagsFacetABI, TokenModule, TradeModule, UMA_DEFAULTS, UmaModule, VALID_TICK_SIZES, VaultFacet_default as VaultFacetABI, VenueFacet_default as VenueFacetABI, VenueModule, WhitelistAccessControl_default as WhitelistAccessControlABI, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
|
|
11317
|
+
export { AccessControlFacet_default as AccessControlFacetABI, AccessControlModule, BatchOrdersFacet_default as BatchOrdersFacetABI, CONTRACT_ADDRESSES, ConditionalTokens_default as ConditionalTokensABI, DEFAULT_CHAIN, ERC20_default as ERC20ABI, FeedProvider, GET_ALL_MARKETS_FEED, GET_ALL_MARKETS_FEED_BY_VOLUME, GET_CHART_TRADES, GET_CHART_TRADES_ALL, GET_GROUP_MARKETS, GET_LEADERBOARD, GET_MARKET, GET_MARKETS, GET_MARKETS_WITH_PRICING, GET_MARKET_GROUP, GET_MARKET_GROUPS, GET_MARKET_GROUP_ITEM, GET_MARKET_TOP_HOLDERS, GET_ORDERS, GET_PROTOCOL_STATS, GET_QUESTION, GET_QUESTIONS, GET_RECENT_MARKETS, GET_RECENT_TRADES, GET_TOP_OF_BOOK, GET_TRADER_CLOSED_POSITIONS, GET_TRADER_FILLS, GET_TRADER_POSITIONS, GET_TRADER_PROFILE, GET_TRADES, GET_UNIFIED_MARKET_FEED, GET_UNIFIED_MARKET_FEED_BY_VOLUME, GET_USER, GET_VENUES, LimitOrdersFacet_default as LimitOrdersFacetABI, MarketGroupFacet_default as MarketGroupFacetABI, MarketModule, MarketOrdersFacet_default as MarketOrdersFacetABI, MarketsFacet_default as MarketsFacetABI, MatchingFacet_default as MatchingFacetABI, MetadataFacet_default as MetadataFacetABI, NegRiskFacet_default as NegRiskFacetABI, OddMakiClient, OrderBookFacet_default as OrderBookFacetABI, PROTOCOL_FEES, PriceMarketFacet_default as PriceMarketFacetABI, PriceMarketModule, ProtocolFacet_default as ProtocolFacetABI, PublicModule, PythResolutionFacet_default as PythResolutionFacetABI, ResolutionFacet_default as ResolutionFacetABI, SubgraphClient, TICK_SIZE_FINE, TICK_SIZE_STANDARD, TagsFacet_default as TagsFacetABI, TokenModule, TradeModule, UMA_DEFAULTS, UmaModule, UmaOracle_default as UmaOracleABI, VALID_TICK_SIZES, VaultFacet_default as VaultFacetABI, VenueFacet_default as VenueFacetABI, VenueModule, WhitelistAccessControl_default as WhitelistAccessControlABI, calculateChancePercent, clearDecimalsCache, createExpiry, createOddMakiClient, formatAmount, formatAncillaryData, formatTimestamp, getCachedTokenDecimals, getOutcomePrice, getTokenDecimals, isValidTickSize, parseAmount, parseAncillaryData, parseMetadata, parseTokenAmount, priceToTick, resolveIPFSUri, tickToPercentage, tickToPrice, version };
|
|
11060
11318
|
//# sourceMappingURL=index.mjs.map
|
|
11061
11319
|
//# sourceMappingURL=index.mjs.map
|