@stryke-xyz/premarket-sdk 1.2.0 → 1.2.2
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/README.md +5 -4
- package/dist/cjs/abi/MarketsRegistry.abi.json +98 -0
- package/dist/cjs/abi/OptionMarketVault.abi.json +78 -5
- package/dist/cjs/config/index.js +4 -0
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/registry/markets-registry-contract.js +4 -1
- package/dist/cjs/registry/types.js +6 -2
- package/dist/cjs/vault/transactions.js +4 -3
- package/dist/esm/abi/MarketsRegistry.abi.json +98 -0
- package/dist/esm/abi/OptionMarketVault.abi.json +78 -5
- package/dist/esm/config/index.js +1 -0
- package/dist/esm/package.json +1 -1
- package/dist/esm/registry/markets-registry-contract.js +4 -1
- package/dist/esm/registry/types.js +6 -2
- package/dist/esm/vault/transactions.js +4 -3
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/registry/types.d.ts +4 -0
- package/dist/types/vault/transactions.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -539,7 +539,7 @@ Restricted or role-gated builders:
|
|
|
539
539
|
callable only by RedeemKeeper role.
|
|
540
540
|
- `buildDelegateRolloverTransaction(vaultAddress, oldPrmTokenId, holder)` —
|
|
541
541
|
callable only by RolloverKeeper role.
|
|
542
|
-
- `buildDelegateWithdrawTransaction(vaultAddress, prmTokenId, amount, owner, receiver)` —
|
|
542
|
+
- `buildDelegateWithdrawTransaction(vaultAddress, prmTokenId, amount, owner, receiver?)` —
|
|
543
543
|
callable only by WithdrawKeeper role.
|
|
544
544
|
- `buildFillMarketDeliveryTransaction(vaultAddress, marketId, amount)` —
|
|
545
545
|
physical settlement market funding.
|
|
@@ -753,9 +753,9 @@ Public token maps:
|
|
|
753
753
|
|
|
754
754
|
Important nuance:
|
|
755
755
|
|
|
756
|
-
- `USDM`, `USDT0`, `MARKETS_REGISTRY`, `
|
|
757
|
-
`ERC_TOKENS_RESTRICTION_MODULE` are partial maps because
|
|
758
|
-
not exist on every supported chain
|
|
756
|
+
- `USDM`, `USDT0`, `MARKETS_REGISTRY`, `COMMUNITY_MARKET_MANAGER`,
|
|
757
|
+
`FEE_REGISTRY`, and `ERC_TOKENS_RESTRICTION_MODULE` are partial maps because
|
|
758
|
+
those deployments do not exist on every supported chain
|
|
759
759
|
|
|
760
760
|
### Contract address maps
|
|
761
761
|
|
|
@@ -765,6 +765,7 @@ Public address maps:
|
|
|
765
765
|
- `OPTION_MARKET_VAULT`
|
|
766
766
|
- `EXCHANGE`
|
|
767
767
|
- `MARKETS_REGISTRY`
|
|
768
|
+
- `COMMUNITY_MARKET_MANAGER`
|
|
768
769
|
- `ENTRY_POINT`
|
|
769
770
|
- `SIMPLE_ACCOUNT_FACTORY`
|
|
770
771
|
- `FEE_REGISTRY`
|
|
@@ -549,6 +549,19 @@
|
|
|
549
549
|
"outputs": [],
|
|
550
550
|
"stateMutability": "nonpayable"
|
|
551
551
|
},
|
|
552
|
+
{
|
|
553
|
+
"type": "function",
|
|
554
|
+
"name": "setVault",
|
|
555
|
+
"inputs": [
|
|
556
|
+
{
|
|
557
|
+
"name": "vault_",
|
|
558
|
+
"type": "address",
|
|
559
|
+
"internalType": "address"
|
|
560
|
+
}
|
|
561
|
+
],
|
|
562
|
+
"outputs": [],
|
|
563
|
+
"stateMutability": "nonpayable"
|
|
564
|
+
},
|
|
552
565
|
{
|
|
553
566
|
"type": "function",
|
|
554
567
|
"name": "transferOwnership",
|
|
@@ -562,6 +575,24 @@
|
|
|
562
575
|
"outputs": [],
|
|
563
576
|
"stateMutability": "nonpayable"
|
|
564
577
|
},
|
|
578
|
+
{
|
|
579
|
+
"type": "function",
|
|
580
|
+
"name": "updateFinalTick",
|
|
581
|
+
"inputs": [
|
|
582
|
+
{
|
|
583
|
+
"name": "marketId",
|
|
584
|
+
"type": "uint256",
|
|
585
|
+
"internalType": "uint256"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "tick",
|
|
589
|
+
"type": "uint256",
|
|
590
|
+
"internalType": "uint256"
|
|
591
|
+
}
|
|
592
|
+
],
|
|
593
|
+
"outputs": [],
|
|
594
|
+
"stateMutability": "nonpayable"
|
|
595
|
+
},
|
|
565
596
|
{
|
|
566
597
|
"type": "function",
|
|
567
598
|
"name": "updateMarketExpiry",
|
|
@@ -631,6 +662,19 @@
|
|
|
631
662
|
"outputs": [],
|
|
632
663
|
"stateMutability": "nonpayable"
|
|
633
664
|
},
|
|
665
|
+
{
|
|
666
|
+
"type": "function",
|
|
667
|
+
"name": "updateNullOutcome",
|
|
668
|
+
"inputs": [
|
|
669
|
+
{
|
|
670
|
+
"name": "marketId",
|
|
671
|
+
"type": "uint256",
|
|
672
|
+
"internalType": "uint256"
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
"outputs": [],
|
|
676
|
+
"stateMutability": "nonpayable"
|
|
677
|
+
},
|
|
634
678
|
{
|
|
635
679
|
"type": "function",
|
|
636
680
|
"name": "updateToken",
|
|
@@ -654,6 +698,19 @@
|
|
|
654
698
|
"outputs": [],
|
|
655
699
|
"stateMutability": "nonpayable"
|
|
656
700
|
},
|
|
701
|
+
{
|
|
702
|
+
"type": "function",
|
|
703
|
+
"name": "vault",
|
|
704
|
+
"inputs": [],
|
|
705
|
+
"outputs": [
|
|
706
|
+
{
|
|
707
|
+
"name": "",
|
|
708
|
+
"type": "address",
|
|
709
|
+
"internalType": "address"
|
|
710
|
+
}
|
|
711
|
+
],
|
|
712
|
+
"stateMutability": "view"
|
|
713
|
+
},
|
|
657
714
|
{
|
|
658
715
|
"type": "event",
|
|
659
716
|
"name": "AddressFeesUpdated",
|
|
@@ -963,6 +1020,31 @@
|
|
|
963
1020
|
],
|
|
964
1021
|
"anonymous": false
|
|
965
1022
|
},
|
|
1023
|
+
{
|
|
1024
|
+
"type": "event",
|
|
1025
|
+
"name": "VaultUpdated",
|
|
1026
|
+
"inputs": [
|
|
1027
|
+
{
|
|
1028
|
+
"name": "previousVault",
|
|
1029
|
+
"type": "address",
|
|
1030
|
+
"indexed": true,
|
|
1031
|
+
"internalType": "address"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
"name": "newVault",
|
|
1035
|
+
"type": "address",
|
|
1036
|
+
"indexed": true,
|
|
1037
|
+
"internalType": "address"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"name": "sender",
|
|
1041
|
+
"type": "address",
|
|
1042
|
+
"indexed": true,
|
|
1043
|
+
"internalType": "address"
|
|
1044
|
+
}
|
|
1045
|
+
],
|
|
1046
|
+
"anonymous": false
|
|
1047
|
+
},
|
|
966
1048
|
{
|
|
967
1049
|
"type": "error",
|
|
968
1050
|
"name": "AddressEmptyCode",
|
|
@@ -979,6 +1061,22 @@
|
|
|
979
1061
|
"name": "FailedCall",
|
|
980
1062
|
"inputs": []
|
|
981
1063
|
},
|
|
1064
|
+
{
|
|
1065
|
+
"type": "error",
|
|
1066
|
+
"name": "FinalizedOutcomeRequired",
|
|
1067
|
+
"inputs": [
|
|
1068
|
+
{
|
|
1069
|
+
"name": "marketId",
|
|
1070
|
+
"type": "uint256",
|
|
1071
|
+
"internalType": "uint256"
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"name": "expiry",
|
|
1075
|
+
"type": "uint256",
|
|
1076
|
+
"internalType": "uint256"
|
|
1077
|
+
}
|
|
1078
|
+
]
|
|
1079
|
+
},
|
|
982
1080
|
{
|
|
983
1081
|
"type": "error",
|
|
984
1082
|
"name": "InvalidFeeRate",
|
|
@@ -217,11 +217,6 @@
|
|
|
217
217
|
"name": "owner",
|
|
218
218
|
"type": "address",
|
|
219
219
|
"internalType": "address"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"name": "rec",
|
|
223
|
-
"type": "address",
|
|
224
|
-
"internalType": "address"
|
|
225
220
|
}
|
|
226
221
|
],
|
|
227
222
|
"outputs": [],
|
|
@@ -574,6 +569,30 @@
|
|
|
574
569
|
],
|
|
575
570
|
"stateMutability": "nonpayable"
|
|
576
571
|
},
|
|
572
|
+
{
|
|
573
|
+
"type": "function",
|
|
574
|
+
"name": "nullOutcomes",
|
|
575
|
+
"inputs": [
|
|
576
|
+
{
|
|
577
|
+
"name": "marketId",
|
|
578
|
+
"type": "uint256",
|
|
579
|
+
"internalType": "uint256"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "expiry",
|
|
583
|
+
"type": "uint256",
|
|
584
|
+
"internalType": "uint256"
|
|
585
|
+
}
|
|
586
|
+
],
|
|
587
|
+
"outputs": [
|
|
588
|
+
{
|
|
589
|
+
"name": "isNullOutcome",
|
|
590
|
+
"type": "bool",
|
|
591
|
+
"internalType": "bool"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
"stateMutability": "view"
|
|
595
|
+
},
|
|
577
596
|
{
|
|
578
597
|
"type": "function",
|
|
579
598
|
"name": "optionPrmToPrm",
|
|
@@ -1003,6 +1022,19 @@
|
|
|
1003
1022
|
"outputs": [],
|
|
1004
1023
|
"stateMutability": "nonpayable"
|
|
1005
1024
|
},
|
|
1025
|
+
{
|
|
1026
|
+
"type": "function",
|
|
1027
|
+
"name": "updateNullOutcome",
|
|
1028
|
+
"inputs": [
|
|
1029
|
+
{
|
|
1030
|
+
"name": "marketId",
|
|
1031
|
+
"type": "uint256",
|
|
1032
|
+
"internalType": "uint256"
|
|
1033
|
+
}
|
|
1034
|
+
],
|
|
1035
|
+
"outputs": [],
|
|
1036
|
+
"stateMutability": "nonpayable"
|
|
1037
|
+
},
|
|
1006
1038
|
{
|
|
1007
1039
|
"type": "function",
|
|
1008
1040
|
"name": "withdraw",
|
|
@@ -1278,6 +1310,37 @@
|
|
|
1278
1310
|
],
|
|
1279
1311
|
"anonymous": false
|
|
1280
1312
|
},
|
|
1313
|
+
{
|
|
1314
|
+
"type": "event",
|
|
1315
|
+
"name": "NullOutcomeUpdated",
|
|
1316
|
+
"inputs": [
|
|
1317
|
+
{
|
|
1318
|
+
"name": "marketId",
|
|
1319
|
+
"type": "uint256",
|
|
1320
|
+
"indexed": true,
|
|
1321
|
+
"internalType": "uint256"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
"name": "previousExpiry",
|
|
1325
|
+
"type": "uint256",
|
|
1326
|
+
"indexed": true,
|
|
1327
|
+
"internalType": "uint256"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
"name": "expiry",
|
|
1331
|
+
"type": "uint256",
|
|
1332
|
+
"indexed": true,
|
|
1333
|
+
"internalType": "uint256"
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
"name": "updater",
|
|
1337
|
+
"type": "address",
|
|
1338
|
+
"indexed": false,
|
|
1339
|
+
"internalType": "address"
|
|
1340
|
+
}
|
|
1341
|
+
],
|
|
1342
|
+
"anonymous": false
|
|
1343
|
+
},
|
|
1281
1344
|
{
|
|
1282
1345
|
"type": "event",
|
|
1283
1346
|
"name": "OperatorSet",
|
|
@@ -1744,6 +1807,11 @@
|
|
|
1744
1807
|
}
|
|
1745
1808
|
]
|
|
1746
1809
|
},
|
|
1810
|
+
{
|
|
1811
|
+
"type": "error",
|
|
1812
|
+
"name": "DeliveryAlreadyFilled",
|
|
1813
|
+
"inputs": []
|
|
1814
|
+
},
|
|
1747
1815
|
{
|
|
1748
1816
|
"type": "error",
|
|
1749
1817
|
"name": "DeliveryNotFilled",
|
|
@@ -1806,6 +1874,11 @@
|
|
|
1806
1874
|
}
|
|
1807
1875
|
]
|
|
1808
1876
|
},
|
|
1877
|
+
{
|
|
1878
|
+
"type": "error",
|
|
1879
|
+
"name": "InvalidFinalTick",
|
|
1880
|
+
"inputs": []
|
|
1881
|
+
},
|
|
1809
1882
|
{
|
|
1810
1883
|
"type": "error",
|
|
1811
1884
|
"name": "InvalidMarket",
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -12,6 +12,9 @@ _export(exports, {
|
|
|
12
12
|
get CHAIN_ID_TO_CHAIN () {
|
|
13
13
|
return CHAIN_ID_TO_CHAIN;
|
|
14
14
|
},
|
|
15
|
+
get COMMUNITY_MARKET_MANAGER () {
|
|
16
|
+
return COMMUNITY_MARKET_MANAGER;
|
|
17
|
+
},
|
|
15
18
|
get ENTRY_POINT () {
|
|
16
19
|
return ENTRY_POINT;
|
|
17
20
|
},
|
|
@@ -129,6 +132,7 @@ var _obj5;
|
|
|
129
132
|
/** Exchange contract addresses by supported chain. */ var EXCHANGE = (_obj5 = {}, _define_property(_obj5, _chains.anvil.id, "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"), _define_property(_obj5, _chains.arbitrum.id, "0x8e25cc9aed1131c54b176ef2f0a3a5593db1554b"), _define_property(_obj5, _chains1.megaETH.id, "0x26f5D84aA1E894B059040cE2aE8cbf772A20125f"), _obj5);
|
|
130
133
|
var _obj6;
|
|
131
134
|
/** MarketsRegistry contract addresses on chains where the registry is deployed. */ var MARKETS_REGISTRY = (_obj6 = {}, _define_property(_obj6, _chains.anvil.id, "0x5FbDB2315678afecb367f032d93F642f64180aa3"), _define_property(_obj6, _chains1.megaETH.id, "0x1c5FFbaEBa3Ef9fB6C650a4FF364918Bce418675"), _obj6);
|
|
135
|
+
/** CommunityMarketManager contract addresses on chains where it is deployed. */ var COMMUNITY_MARKET_MANAGER = _define_property({}, _chains1.megaETH.id, "0x702efdacE3c278A13e8a1CC9b4161Cb8d8cFbcC9");
|
|
132
136
|
var _obj7;
|
|
133
137
|
/** ERC-4337 EntryPoint addresses used by Stryke smart accounts. */ var ENTRY_POINT = (_obj7 = {}, _define_property(_obj7, _chains.anvil.id, "0x09635F643e140090A9A8Dcd712eD6285858ceBef"), _define_property(_obj7, _chains.arbitrum.id, "0x0000000071727De22E5E9d8BAf0edAc6f37da032"), _define_property(_obj7, _chains1.megaETH.id, "0x09635F643e140090A9A8Dcd712eD6285858ceBef"), _obj7);
|
|
134
138
|
var _obj8;
|
package/dist/cjs/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@stryke-xyz/premarket-sdk","version":"1.2.
|
|
1
|
+
{"name":"@stryke-xyz/premarket-sdk","version":"1.2.2","type":"commonjs"}
|
|
@@ -49,6 +49,7 @@ function _interop_require_default(obj) {
|
|
|
49
49
|
}
|
|
50
50
|
var marketsRegistryAbi = _MarketsRegistryabijson.default;
|
|
51
51
|
/** Minimal transaction envelope returned by registry calldata builders. */ function normalizeMarket(market) {
|
|
52
|
+
var _market_isSpread, _market_useAbsoluteSpreadCollateral;
|
|
52
53
|
return {
|
|
53
54
|
underlying: market.underlying,
|
|
54
55
|
collateral: market.collateral,
|
|
@@ -65,7 +66,9 @@ var marketsRegistryAbi = _MarketsRegistryabijson.default;
|
|
|
65
66
|
rolloverFeeBps: BigInt(market.rolloverFeeBps),
|
|
66
67
|
marketType: Number(market.marketType),
|
|
67
68
|
isCollateralScaled: market.isCollateralScaled,
|
|
68
|
-
nonRollable: market.nonRollable
|
|
69
|
+
nonRollable: market.nonRollable,
|
|
70
|
+
isSpread: (_market_isSpread = market.isSpread) !== null && _market_isSpread !== void 0 ? _market_isSpread : false,
|
|
71
|
+
useAbsoluteSpreadCollateral: (_market_useAbsoluteSpreadCollateral = market.useAbsoluteSpreadCollateral) !== null && _market_useAbsoluteSpreadCollateral !== void 0 ? _market_useAbsoluteSpreadCollateral : false
|
|
69
72
|
};
|
|
70
73
|
}
|
|
71
74
|
/** Calldata and transaction helpers for the markets registry contract. */ var MarketsRegistryContract = /*#__PURE__*/ function() {
|
|
@@ -41,7 +41,9 @@ _export(exports, {
|
|
|
41
41
|
rolloverFeeBps: market.rolloverFeeBps.toString(),
|
|
42
42
|
marketType: Number(market.marketType),
|
|
43
43
|
isCollateralScaled: market.isCollateralScaled,
|
|
44
|
-
nonRollable: market.nonRollable
|
|
44
|
+
nonRollable: market.nonRollable,
|
|
45
|
+
isSpread: market.isSpread,
|
|
46
|
+
useAbsoluteSpreadCollateral: market.useAbsoluteSpreadCollateral
|
|
45
47
|
};
|
|
46
48
|
}
|
|
47
49
|
/** Restores bigint fee and sizing fields from a serialized market payload. */ function deserializeRegistryMarket(market) {
|
|
@@ -61,6 +63,8 @@ _export(exports, {
|
|
|
61
63
|
rolloverFeeBps: BigInt(market.rolloverFeeBps),
|
|
62
64
|
marketType: market.marketType,
|
|
63
65
|
isCollateralScaled: market.isCollateralScaled,
|
|
64
|
-
nonRollable: market.nonRollable
|
|
66
|
+
nonRollable: market.nonRollable,
|
|
67
|
+
isSpread: market.isSpread,
|
|
68
|
+
useAbsoluteSpreadCollateral: market.useAbsoluteSpreadCollateral
|
|
65
69
|
};
|
|
66
70
|
}
|
|
@@ -71,7 +71,7 @@ var optionMarketVaultAbi = (0, _viem.parseAbi)([
|
|
|
71
71
|
"function redeem(uint256 oPrmTokenId, address rec) external returns (uint256 profit)",
|
|
72
72
|
"function delegateRedeem(uint256 oPrmTokenId, address rec) external returns (uint256 profit)",
|
|
73
73
|
"function delegateRollover(uint256 oldPrmTokenId, address holder) external returns (uint256 newPrmTokenId, uint256 newOPrmTokenId, uint256 newAmount)",
|
|
74
|
-
"function delegateWithdraw(uint256 prmTokenId, uint256 amount, address owner
|
|
74
|
+
"function delegateWithdraw(uint256 prmTokenId, uint256 amount, address owner) external",
|
|
75
75
|
"function fillMarketDelivery(uint256 marketId, uint256 amount) external",
|
|
76
76
|
"function rollover(uint256 oldPrmTokenId) external returns (uint256 newPrmTokenId, uint256 newOPrmTokenId, uint256 newAmount)",
|
|
77
77
|
"function setOperator(address operator, bool approved) external returns (bool)",
|
|
@@ -189,6 +189,8 @@ var optionMarketVaultAbi = (0, _viem.parseAbi)([
|
|
|
189
189
|
/**
|
|
190
190
|
* Build a delegated withdraw transaction. Callable only by WithdrawKeeper role.
|
|
191
191
|
*/ function buildDelegateWithdrawTransaction(vaultAddress, prmTokenId, amount, owner, receiver) {
|
|
192
|
+
// `receiver` is retained for source compatibility; the live contract now pays the owner.
|
|
193
|
+
void receiver;
|
|
192
194
|
return {
|
|
193
195
|
to: vaultAddress,
|
|
194
196
|
data: (0, _viem.encodeFunctionData)({
|
|
@@ -197,8 +199,7 @@ var optionMarketVaultAbi = (0, _viem.parseAbi)([
|
|
|
197
199
|
args: [
|
|
198
200
|
prmTokenId,
|
|
199
201
|
amount,
|
|
200
|
-
owner
|
|
201
|
-
receiver
|
|
202
|
+
owner
|
|
202
203
|
]
|
|
203
204
|
})
|
|
204
205
|
};
|
|
@@ -549,6 +549,19 @@
|
|
|
549
549
|
"outputs": [],
|
|
550
550
|
"stateMutability": "nonpayable"
|
|
551
551
|
},
|
|
552
|
+
{
|
|
553
|
+
"type": "function",
|
|
554
|
+
"name": "setVault",
|
|
555
|
+
"inputs": [
|
|
556
|
+
{
|
|
557
|
+
"name": "vault_",
|
|
558
|
+
"type": "address",
|
|
559
|
+
"internalType": "address"
|
|
560
|
+
}
|
|
561
|
+
],
|
|
562
|
+
"outputs": [],
|
|
563
|
+
"stateMutability": "nonpayable"
|
|
564
|
+
},
|
|
552
565
|
{
|
|
553
566
|
"type": "function",
|
|
554
567
|
"name": "transferOwnership",
|
|
@@ -562,6 +575,24 @@
|
|
|
562
575
|
"outputs": [],
|
|
563
576
|
"stateMutability": "nonpayable"
|
|
564
577
|
},
|
|
578
|
+
{
|
|
579
|
+
"type": "function",
|
|
580
|
+
"name": "updateFinalTick",
|
|
581
|
+
"inputs": [
|
|
582
|
+
{
|
|
583
|
+
"name": "marketId",
|
|
584
|
+
"type": "uint256",
|
|
585
|
+
"internalType": "uint256"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"name": "tick",
|
|
589
|
+
"type": "uint256",
|
|
590
|
+
"internalType": "uint256"
|
|
591
|
+
}
|
|
592
|
+
],
|
|
593
|
+
"outputs": [],
|
|
594
|
+
"stateMutability": "nonpayable"
|
|
595
|
+
},
|
|
565
596
|
{
|
|
566
597
|
"type": "function",
|
|
567
598
|
"name": "updateMarketExpiry",
|
|
@@ -631,6 +662,19 @@
|
|
|
631
662
|
"outputs": [],
|
|
632
663
|
"stateMutability": "nonpayable"
|
|
633
664
|
},
|
|
665
|
+
{
|
|
666
|
+
"type": "function",
|
|
667
|
+
"name": "updateNullOutcome",
|
|
668
|
+
"inputs": [
|
|
669
|
+
{
|
|
670
|
+
"name": "marketId",
|
|
671
|
+
"type": "uint256",
|
|
672
|
+
"internalType": "uint256"
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
"outputs": [],
|
|
676
|
+
"stateMutability": "nonpayable"
|
|
677
|
+
},
|
|
634
678
|
{
|
|
635
679
|
"type": "function",
|
|
636
680
|
"name": "updateToken",
|
|
@@ -654,6 +698,19 @@
|
|
|
654
698
|
"outputs": [],
|
|
655
699
|
"stateMutability": "nonpayable"
|
|
656
700
|
},
|
|
701
|
+
{
|
|
702
|
+
"type": "function",
|
|
703
|
+
"name": "vault",
|
|
704
|
+
"inputs": [],
|
|
705
|
+
"outputs": [
|
|
706
|
+
{
|
|
707
|
+
"name": "",
|
|
708
|
+
"type": "address",
|
|
709
|
+
"internalType": "address"
|
|
710
|
+
}
|
|
711
|
+
],
|
|
712
|
+
"stateMutability": "view"
|
|
713
|
+
},
|
|
657
714
|
{
|
|
658
715
|
"type": "event",
|
|
659
716
|
"name": "AddressFeesUpdated",
|
|
@@ -963,6 +1020,31 @@
|
|
|
963
1020
|
],
|
|
964
1021
|
"anonymous": false
|
|
965
1022
|
},
|
|
1023
|
+
{
|
|
1024
|
+
"type": "event",
|
|
1025
|
+
"name": "VaultUpdated",
|
|
1026
|
+
"inputs": [
|
|
1027
|
+
{
|
|
1028
|
+
"name": "previousVault",
|
|
1029
|
+
"type": "address",
|
|
1030
|
+
"indexed": true,
|
|
1031
|
+
"internalType": "address"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
"name": "newVault",
|
|
1035
|
+
"type": "address",
|
|
1036
|
+
"indexed": true,
|
|
1037
|
+
"internalType": "address"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"name": "sender",
|
|
1041
|
+
"type": "address",
|
|
1042
|
+
"indexed": true,
|
|
1043
|
+
"internalType": "address"
|
|
1044
|
+
}
|
|
1045
|
+
],
|
|
1046
|
+
"anonymous": false
|
|
1047
|
+
},
|
|
966
1048
|
{
|
|
967
1049
|
"type": "error",
|
|
968
1050
|
"name": "AddressEmptyCode",
|
|
@@ -979,6 +1061,22 @@
|
|
|
979
1061
|
"name": "FailedCall",
|
|
980
1062
|
"inputs": []
|
|
981
1063
|
},
|
|
1064
|
+
{
|
|
1065
|
+
"type": "error",
|
|
1066
|
+
"name": "FinalizedOutcomeRequired",
|
|
1067
|
+
"inputs": [
|
|
1068
|
+
{
|
|
1069
|
+
"name": "marketId",
|
|
1070
|
+
"type": "uint256",
|
|
1071
|
+
"internalType": "uint256"
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
"name": "expiry",
|
|
1075
|
+
"type": "uint256",
|
|
1076
|
+
"internalType": "uint256"
|
|
1077
|
+
}
|
|
1078
|
+
]
|
|
1079
|
+
},
|
|
982
1080
|
{
|
|
983
1081
|
"type": "error",
|
|
984
1082
|
"name": "InvalidFeeRate",
|
|
@@ -217,11 +217,6 @@
|
|
|
217
217
|
"name": "owner",
|
|
218
218
|
"type": "address",
|
|
219
219
|
"internalType": "address"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
"name": "rec",
|
|
223
|
-
"type": "address",
|
|
224
|
-
"internalType": "address"
|
|
225
220
|
}
|
|
226
221
|
],
|
|
227
222
|
"outputs": [],
|
|
@@ -574,6 +569,30 @@
|
|
|
574
569
|
],
|
|
575
570
|
"stateMutability": "nonpayable"
|
|
576
571
|
},
|
|
572
|
+
{
|
|
573
|
+
"type": "function",
|
|
574
|
+
"name": "nullOutcomes",
|
|
575
|
+
"inputs": [
|
|
576
|
+
{
|
|
577
|
+
"name": "marketId",
|
|
578
|
+
"type": "uint256",
|
|
579
|
+
"internalType": "uint256"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"name": "expiry",
|
|
583
|
+
"type": "uint256",
|
|
584
|
+
"internalType": "uint256"
|
|
585
|
+
}
|
|
586
|
+
],
|
|
587
|
+
"outputs": [
|
|
588
|
+
{
|
|
589
|
+
"name": "isNullOutcome",
|
|
590
|
+
"type": "bool",
|
|
591
|
+
"internalType": "bool"
|
|
592
|
+
}
|
|
593
|
+
],
|
|
594
|
+
"stateMutability": "view"
|
|
595
|
+
},
|
|
577
596
|
{
|
|
578
597
|
"type": "function",
|
|
579
598
|
"name": "optionPrmToPrm",
|
|
@@ -1003,6 +1022,19 @@
|
|
|
1003
1022
|
"outputs": [],
|
|
1004
1023
|
"stateMutability": "nonpayable"
|
|
1005
1024
|
},
|
|
1025
|
+
{
|
|
1026
|
+
"type": "function",
|
|
1027
|
+
"name": "updateNullOutcome",
|
|
1028
|
+
"inputs": [
|
|
1029
|
+
{
|
|
1030
|
+
"name": "marketId",
|
|
1031
|
+
"type": "uint256",
|
|
1032
|
+
"internalType": "uint256"
|
|
1033
|
+
}
|
|
1034
|
+
],
|
|
1035
|
+
"outputs": [],
|
|
1036
|
+
"stateMutability": "nonpayable"
|
|
1037
|
+
},
|
|
1006
1038
|
{
|
|
1007
1039
|
"type": "function",
|
|
1008
1040
|
"name": "withdraw",
|
|
@@ -1278,6 +1310,37 @@
|
|
|
1278
1310
|
],
|
|
1279
1311
|
"anonymous": false
|
|
1280
1312
|
},
|
|
1313
|
+
{
|
|
1314
|
+
"type": "event",
|
|
1315
|
+
"name": "NullOutcomeUpdated",
|
|
1316
|
+
"inputs": [
|
|
1317
|
+
{
|
|
1318
|
+
"name": "marketId",
|
|
1319
|
+
"type": "uint256",
|
|
1320
|
+
"indexed": true,
|
|
1321
|
+
"internalType": "uint256"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
"name": "previousExpiry",
|
|
1325
|
+
"type": "uint256",
|
|
1326
|
+
"indexed": true,
|
|
1327
|
+
"internalType": "uint256"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
"name": "expiry",
|
|
1331
|
+
"type": "uint256",
|
|
1332
|
+
"indexed": true,
|
|
1333
|
+
"internalType": "uint256"
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
"name": "updater",
|
|
1337
|
+
"type": "address",
|
|
1338
|
+
"indexed": false,
|
|
1339
|
+
"internalType": "address"
|
|
1340
|
+
}
|
|
1341
|
+
],
|
|
1342
|
+
"anonymous": false
|
|
1343
|
+
},
|
|
1281
1344
|
{
|
|
1282
1345
|
"type": "event",
|
|
1283
1346
|
"name": "OperatorSet",
|
|
@@ -1744,6 +1807,11 @@
|
|
|
1744
1807
|
}
|
|
1745
1808
|
]
|
|
1746
1809
|
},
|
|
1810
|
+
{
|
|
1811
|
+
"type": "error",
|
|
1812
|
+
"name": "DeliveryAlreadyFilled",
|
|
1813
|
+
"inputs": []
|
|
1814
|
+
},
|
|
1747
1815
|
{
|
|
1748
1816
|
"type": "error",
|
|
1749
1817
|
"name": "DeliveryNotFilled",
|
|
@@ -1806,6 +1874,11 @@
|
|
|
1806
1874
|
}
|
|
1807
1875
|
]
|
|
1808
1876
|
},
|
|
1877
|
+
{
|
|
1878
|
+
"type": "error",
|
|
1879
|
+
"name": "InvalidFinalTick",
|
|
1880
|
+
"inputs": []
|
|
1881
|
+
},
|
|
1809
1882
|
{
|
|
1810
1883
|
"type": "error",
|
|
1811
1884
|
"name": "InvalidMarket",
|
package/dist/esm/config/index.js
CHANGED
|
@@ -78,6 +78,7 @@ var _obj5;
|
|
|
78
78
|
/** Exchange contract addresses by supported chain. */ export var EXCHANGE = (_obj5 = {}, _define_property(_obj5, anvil.id, "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"), _define_property(_obj5, arbitrum.id, "0x8e25cc9aed1131c54b176ef2f0a3a5593db1554b"), _define_property(_obj5, megaETH.id, "0x26f5D84aA1E894B059040cE2aE8cbf772A20125f"), _obj5);
|
|
79
79
|
var _obj6;
|
|
80
80
|
/** MarketsRegistry contract addresses on chains where the registry is deployed. */ export var MARKETS_REGISTRY = (_obj6 = {}, _define_property(_obj6, anvil.id, "0x5FbDB2315678afecb367f032d93F642f64180aa3"), _define_property(_obj6, megaETH.id, "0x1c5FFbaEBa3Ef9fB6C650a4FF364918Bce418675"), _obj6);
|
|
81
|
+
/** CommunityMarketManager contract addresses on chains where it is deployed. */ export var COMMUNITY_MARKET_MANAGER = _define_property({}, megaETH.id, "0x702efdacE3c278A13e8a1CC9b4161Cb8d8cFbcC9");
|
|
81
82
|
var _obj7;
|
|
82
83
|
/** ERC-4337 EntryPoint addresses used by Stryke smart accounts. */ export var ENTRY_POINT = (_obj7 = {}, _define_property(_obj7, anvil.id, "0x09635F643e140090A9A8Dcd712eD6285858ceBef"), _define_property(_obj7, arbitrum.id, "0x0000000071727De22E5E9d8BAf0edAc6f37da032"), _define_property(_obj7, megaETH.id, "0x09635F643e140090A9A8Dcd712eD6285858ceBef"), _obj7);
|
|
83
84
|
var _obj8;
|
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@stryke-xyz/premarket-sdk","version":"1.2.
|
|
1
|
+
{"name":"@stryke-xyz/premarket-sdk","version":"1.2.2","type":"module"}
|
|
@@ -36,6 +36,7 @@ import MarketsRegistryAbi from "../abi/MarketsRegistry.abi.json" with {
|
|
|
36
36
|
};
|
|
37
37
|
var marketsRegistryAbi = MarketsRegistryAbi;
|
|
38
38
|
/** Minimal transaction envelope returned by registry calldata builders. */ function normalizeMarket(market) {
|
|
39
|
+
var _market_isSpread, _market_useAbsoluteSpreadCollateral;
|
|
39
40
|
return {
|
|
40
41
|
underlying: market.underlying,
|
|
41
42
|
collateral: market.collateral,
|
|
@@ -52,7 +53,9 @@ var marketsRegistryAbi = MarketsRegistryAbi;
|
|
|
52
53
|
rolloverFeeBps: BigInt(market.rolloverFeeBps),
|
|
53
54
|
marketType: Number(market.marketType),
|
|
54
55
|
isCollateralScaled: market.isCollateralScaled,
|
|
55
|
-
nonRollable: market.nonRollable
|
|
56
|
+
nonRollable: market.nonRollable,
|
|
57
|
+
isSpread: (_market_isSpread = market.isSpread) !== null && _market_isSpread !== void 0 ? _market_isSpread : false,
|
|
58
|
+
useAbsoluteSpreadCollateral: (_market_useAbsoluteSpreadCollateral = market.useAbsoluteSpreadCollateral) !== null && _market_useAbsoluteSpreadCollateral !== void 0 ? _market_useAbsoluteSpreadCollateral : false
|
|
56
59
|
};
|
|
57
60
|
}
|
|
58
61
|
/** Calldata and transaction helpers for the markets registry contract. */ export var MarketsRegistryContract = /*#__PURE__*/ function() {
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
rolloverFeeBps: market.rolloverFeeBps.toString(),
|
|
21
21
|
marketType: Number(market.marketType),
|
|
22
22
|
isCollateralScaled: market.isCollateralScaled,
|
|
23
|
-
nonRollable: market.nonRollable
|
|
23
|
+
nonRollable: market.nonRollable,
|
|
24
|
+
isSpread: market.isSpread,
|
|
25
|
+
useAbsoluteSpreadCollateral: market.useAbsoluteSpreadCollateral
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
/** Restores bigint fee and sizing fields from a serialized market payload. */ export function deserializeRegistryMarket(market) {
|
|
@@ -40,6 +42,8 @@
|
|
|
40
42
|
rolloverFeeBps: BigInt(market.rolloverFeeBps),
|
|
41
43
|
marketType: market.marketType,
|
|
42
44
|
isCollateralScaled: market.isCollateralScaled,
|
|
43
|
-
nonRollable: market.nonRollable
|
|
45
|
+
nonRollable: market.nonRollable,
|
|
46
|
+
isSpread: market.isSpread,
|
|
47
|
+
useAbsoluteSpreadCollateral: market.useAbsoluteSpreadCollateral
|
|
44
48
|
};
|
|
45
49
|
}
|
|
@@ -8,7 +8,7 @@ var optionMarketVaultAbi = parseAbi([
|
|
|
8
8
|
"function redeem(uint256 oPrmTokenId, address rec) external returns (uint256 profit)",
|
|
9
9
|
"function delegateRedeem(uint256 oPrmTokenId, address rec) external returns (uint256 profit)",
|
|
10
10
|
"function delegateRollover(uint256 oldPrmTokenId, address holder) external returns (uint256 newPrmTokenId, uint256 newOPrmTokenId, uint256 newAmount)",
|
|
11
|
-
"function delegateWithdraw(uint256 prmTokenId, uint256 amount, address owner
|
|
11
|
+
"function delegateWithdraw(uint256 prmTokenId, uint256 amount, address owner) external",
|
|
12
12
|
"function fillMarketDelivery(uint256 marketId, uint256 amount) external",
|
|
13
13
|
"function rollover(uint256 oldPrmTokenId) external returns (uint256 newPrmTokenId, uint256 newOPrmTokenId, uint256 newAmount)",
|
|
14
14
|
"function setOperator(address operator, bool approved) external returns (bool)",
|
|
@@ -126,6 +126,8 @@ var optionMarketVaultAbi = parseAbi([
|
|
|
126
126
|
/**
|
|
127
127
|
* Build a delegated withdraw transaction. Callable only by WithdrawKeeper role.
|
|
128
128
|
*/ export function buildDelegateWithdrawTransaction(vaultAddress, prmTokenId, amount, owner, receiver) {
|
|
129
|
+
// `receiver` is retained for source compatibility; the live contract now pays the owner.
|
|
130
|
+
void receiver;
|
|
129
131
|
return {
|
|
130
132
|
to: vaultAddress,
|
|
131
133
|
data: encodeFunctionData({
|
|
@@ -134,8 +136,7 @@ var optionMarketVaultAbi = parseAbi([
|
|
|
134
136
|
args: [
|
|
135
137
|
prmTokenId,
|
|
136
138
|
amount,
|
|
137
|
-
owner
|
|
138
|
-
receiver
|
|
139
|
+
owner
|
|
139
140
|
]
|
|
140
141
|
})
|
|
141
142
|
};
|
|
@@ -26,6 +26,8 @@ export declare const OPTION_MARKET_VAULT: Record<SUPPORTED_CHAINS, `0x${string}`
|
|
|
26
26
|
export declare const EXCHANGE: Record<SUPPORTED_CHAINS, `0x${string}`>;
|
|
27
27
|
/** MarketsRegistry contract addresses on chains where the registry is deployed. */
|
|
28
28
|
export declare const MARKETS_REGISTRY: Partial<Record<SUPPORTED_CHAINS, `0x${string}`>>;
|
|
29
|
+
/** CommunityMarketManager contract addresses on chains where it is deployed. */
|
|
30
|
+
export declare const COMMUNITY_MARKET_MANAGER: Partial<Record<SUPPORTED_CHAINS, `0x${string}`>>;
|
|
29
31
|
/** ERC-4337 EntryPoint addresses used by Stryke smart accounts. */
|
|
30
32
|
export declare const ENTRY_POINT: Record<SUPPORTED_CHAINS, `0x${string}`>;
|
|
31
33
|
/** Simple account factory addresses by supported chain. */
|
|
@@ -22,6 +22,8 @@ export interface RegistryMarket {
|
|
|
22
22
|
marketType: MarketType;
|
|
23
23
|
isCollateralScaled: boolean;
|
|
24
24
|
nonRollable: boolean;
|
|
25
|
+
isSpread?: boolean;
|
|
26
|
+
useAbsoluteSpreadCollateral?: boolean;
|
|
25
27
|
}
|
|
26
28
|
/** JSON-safe registry market payload used in APIs or config files. */
|
|
27
29
|
export interface SerializedRegistryMarket {
|
|
@@ -41,6 +43,8 @@ export interface SerializedRegistryMarket {
|
|
|
41
43
|
marketType: number;
|
|
42
44
|
isCollateralScaled: boolean;
|
|
43
45
|
nonRollable: boolean;
|
|
46
|
+
isSpread?: boolean;
|
|
47
|
+
useAbsoluteSpreadCollateral?: boolean;
|
|
44
48
|
}
|
|
45
49
|
/** Converts a registry market into its stringified transport-safe shape. */
|
|
46
50
|
export declare function serializeRegistryMarket(market: RegistryMarket): SerializedRegistryMarket;
|
|
@@ -56,7 +56,7 @@ export declare function buildUnwindTransaction(vaultAddress: `0x${string}`, prmT
|
|
|
56
56
|
/**
|
|
57
57
|
* Build a delegated withdraw transaction. Callable only by WithdrawKeeper role.
|
|
58
58
|
*/
|
|
59
|
-
export declare function buildDelegateWithdrawTransaction(vaultAddress: `0x${string}`, prmTokenId: bigint, amount: bigint, owner: Address, receiver
|
|
59
|
+
export declare function buildDelegateWithdrawTransaction(vaultAddress: `0x${string}`, prmTokenId: bigint, amount: bigint, owner: Address, receiver?: Address): TransactionCall;
|
|
60
60
|
/**
|
|
61
61
|
* Build market delivery funding transaction for physical settlement markets.
|
|
62
62
|
*/
|