@reserve-protocol/sdk 0.1.2 → 0.1.3
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.mjs +48 -48
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10314,6 +10314,51 @@ const dtfIndexStakingVaultOptimisticAbi = [
|
|
|
10314
10314
|
}
|
|
10315
10315
|
];
|
|
10316
10316
|
//#endregion
|
|
10317
|
+
//#region src/index-dtf/abis/optimistic-timelock.ts
|
|
10318
|
+
const optimisticTimelockAbi = [{
|
|
10319
|
+
type: "function",
|
|
10320
|
+
name: "getRoleMemberCount",
|
|
10321
|
+
inputs: [{
|
|
10322
|
+
name: "role",
|
|
10323
|
+
type: "bytes32",
|
|
10324
|
+
internalType: "bytes32"
|
|
10325
|
+
}],
|
|
10326
|
+
outputs: [{
|
|
10327
|
+
name: "",
|
|
10328
|
+
type: "uint256",
|
|
10329
|
+
internalType: "uint256"
|
|
10330
|
+
}],
|
|
10331
|
+
stateMutability: "view"
|
|
10332
|
+
}, {
|
|
10333
|
+
type: "function",
|
|
10334
|
+
name: "getRoleMember",
|
|
10335
|
+
inputs: [{
|
|
10336
|
+
name: "role",
|
|
10337
|
+
type: "bytes32",
|
|
10338
|
+
internalType: "bytes32"
|
|
10339
|
+
}, {
|
|
10340
|
+
name: "index",
|
|
10341
|
+
type: "uint256",
|
|
10342
|
+
internalType: "uint256"
|
|
10343
|
+
}],
|
|
10344
|
+
outputs: [{
|
|
10345
|
+
name: "",
|
|
10346
|
+
type: "address",
|
|
10347
|
+
internalType: "address"
|
|
10348
|
+
}],
|
|
10349
|
+
stateMutability: "view"
|
|
10350
|
+
}];
|
|
10351
|
+
//#endregion
|
|
10352
|
+
//#region src/index-dtf/governance/optimistic-errors.ts
|
|
10353
|
+
function isUnsupportedOptimisticContractError(error) {
|
|
10354
|
+
const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
|
|
10355
|
+
return message.includes("returned no data") || message.includes("could not decode") || message.includes("data size of 0 bytes") || message.includes("function") && message.includes("not found");
|
|
10356
|
+
}
|
|
10357
|
+
function isUnsupportedVoteLockOptimisticReadError(error) {
|
|
10358
|
+
const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
|
|
10359
|
+
return isUnsupportedOptimisticContractError(error) || (message.includes("execution reverted") || message.includes("reverted")) && (message.includes("optimisticdelegates") || message.includes("getoptimisticvotes") || message.includes("getpastoptimisticvotes"));
|
|
10360
|
+
}
|
|
10361
|
+
//#endregion
|
|
10317
10362
|
//#region src/index-dtf/governance/utils.ts
|
|
10318
10363
|
const D18$1 = 10n ** 18n;
|
|
10319
10364
|
const MAX_UINT256$2 = (1n << 256n) - 1n;
|
|
@@ -10466,51 +10511,6 @@ function getVotePercentage(votes, totalVotes) {
|
|
|
10466
10511
|
return Number(votes * 10000n / totalVotes) / 100;
|
|
10467
10512
|
}
|
|
10468
10513
|
//#endregion
|
|
10469
|
-
//#region src/index-dtf/abis/optimistic-timelock.ts
|
|
10470
|
-
const optimisticTimelockAbi = [{
|
|
10471
|
-
type: "function",
|
|
10472
|
-
name: "getRoleMemberCount",
|
|
10473
|
-
inputs: [{
|
|
10474
|
-
name: "role",
|
|
10475
|
-
type: "bytes32",
|
|
10476
|
-
internalType: "bytes32"
|
|
10477
|
-
}],
|
|
10478
|
-
outputs: [{
|
|
10479
|
-
name: "",
|
|
10480
|
-
type: "uint256",
|
|
10481
|
-
internalType: "uint256"
|
|
10482
|
-
}],
|
|
10483
|
-
stateMutability: "view"
|
|
10484
|
-
}, {
|
|
10485
|
-
type: "function",
|
|
10486
|
-
name: "getRoleMember",
|
|
10487
|
-
inputs: [{
|
|
10488
|
-
name: "role",
|
|
10489
|
-
type: "bytes32",
|
|
10490
|
-
internalType: "bytes32"
|
|
10491
|
-
}, {
|
|
10492
|
-
name: "index",
|
|
10493
|
-
type: "uint256",
|
|
10494
|
-
internalType: "uint256"
|
|
10495
|
-
}],
|
|
10496
|
-
outputs: [{
|
|
10497
|
-
name: "",
|
|
10498
|
-
type: "address",
|
|
10499
|
-
internalType: "address"
|
|
10500
|
-
}],
|
|
10501
|
-
stateMutability: "view"
|
|
10502
|
-
}];
|
|
10503
|
-
//#endregion
|
|
10504
|
-
//#region src/index-dtf/governance/optimistic-errors.ts
|
|
10505
|
-
function isUnsupportedOptimisticContractError(error) {
|
|
10506
|
-
const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
|
|
10507
|
-
return message.includes("returned no data") || message.includes("could not decode") || message.includes("data size of 0 bytes") || message.includes("function") && message.includes("not found");
|
|
10508
|
-
}
|
|
10509
|
-
function isUnsupportedVoteLockOptimisticReadError(error) {
|
|
10510
|
-
const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
|
|
10511
|
-
return isUnsupportedOptimisticContractError(error) || (message.includes("execution reverted") || message.includes("reverted")) && (message.includes("optimisticdelegates") || message.includes("getoptimisticvotes") || message.includes("getpastoptimisticvotes"));
|
|
10512
|
-
}
|
|
10513
|
-
//#endregion
|
|
10514
10514
|
//#region src/index-dtf/governance/optimistic.ts
|
|
10515
10515
|
const MAX_UINT256$1 = (1n << 256n) - 1n;
|
|
10516
10516
|
const OPTIMISTIC_PROPOSER_ROLE = "0x26f49d08685d9cdd4951a7470bc8fbe9dd0f00419c1a44c1b89f845867ae12e0";
|
|
@@ -22882,9 +22882,9 @@ const EXTRA_PROPOSAL_CONTRACTS = [
|
|
|
22882
22882
|
contract: "Reserve Optimistic Governance Spell",
|
|
22883
22883
|
abi: upgradeSpellProposalAbi,
|
|
22884
22884
|
addresses: {
|
|
22885
|
-
1: "
|
|
22886
|
-
8453: "
|
|
22887
|
-
56: "
|
|
22885
|
+
1: "0xd7238463494fdd4b103c2ad9d229b3985b5bc6f1",
|
|
22886
|
+
8453: "0xe9ae2cb2b5e5658035617f92efa1878429f9cd3f",
|
|
22887
|
+
56: "0x3dde17cfd36e740cb7452cb2f59fc925eacb91ab"
|
|
22888
22888
|
}
|
|
22889
22889
|
}
|
|
22890
22890
|
];
|