@ssv-labs/ssv-sdk 0.1.0 → 0.1.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/main.js CHANGED
@@ -4,7 +4,7 @@ const require$$0 = require("fs");
4
4
  const require$$1 = require("path");
5
5
  const require$$2 = require("os");
6
6
  const crypto$1 = require("crypto");
7
- const globals = require("./globals-iY-Y-uDY.js");
7
+ const globals = require("./globals-CkyOvtF5.js");
8
8
  const lodashEs = require("lodash-es");
9
9
  const viem = require("viem");
10
10
  const graphqlRequest = require("graphql-request");
@@ -3983,1077 +3983,6 @@ const TokenABI = [
3983
3983
  type: "function"
3984
3984
  }
3985
3985
  ];
3986
- const HoleskyV4GetterABI = [
3987
- {
3988
- inputs: [],
3989
- stateMutability: "nonpayable",
3990
- type: "constructor"
3991
- },
3992
- {
3993
- inputs: [
3994
- {
3995
- internalType: "address",
3996
- name: "contractAddress",
3997
- type: "address"
3998
- }
3999
- ],
4000
- name: "AddressIsWhitelistingContract",
4001
- type: "error"
4002
- },
4003
- {
4004
- inputs: [],
4005
- name: "ApprovalNotWithinTimeframe",
4006
- type: "error"
4007
- },
4008
- {
4009
- inputs: [],
4010
- name: "CallerNotOwner",
4011
- type: "error"
4012
- },
4013
- {
4014
- inputs: [
4015
- {
4016
- internalType: "address",
4017
- name: "caller",
4018
- type: "address"
4019
- },
4020
- {
4021
- internalType: "address",
4022
- name: "owner",
4023
- type: "address"
4024
- }
4025
- ],
4026
- name: "CallerNotOwnerWithData",
4027
- type: "error"
4028
- },
4029
- {
4030
- inputs: [],
4031
- name: "CallerNotWhitelisted",
4032
- type: "error"
4033
- },
4034
- {
4035
- inputs: [
4036
- {
4037
- internalType: "uint64",
4038
- name: "operatorId",
4039
- type: "uint64"
4040
- }
4041
- ],
4042
- name: "CallerNotWhitelistedWithData",
4043
- type: "error"
4044
- },
4045
- {
4046
- inputs: [],
4047
- name: "ClusterAlreadyEnabled",
4048
- type: "error"
4049
- },
4050
- {
4051
- inputs: [],
4052
- name: "ClusterDoesNotExists",
4053
- type: "error"
4054
- },
4055
- {
4056
- inputs: [],
4057
- name: "ClusterIsLiquidated",
4058
- type: "error"
4059
- },
4060
- {
4061
- inputs: [],
4062
- name: "ClusterNotLiquidatable",
4063
- type: "error"
4064
- },
4065
- {
4066
- inputs: [],
4067
- name: "EmptyPublicKeysList",
4068
- type: "error"
4069
- },
4070
- {
4071
- inputs: [
4072
- {
4073
- internalType: "uint64",
4074
- name: "operatorId",
4075
- type: "uint64"
4076
- }
4077
- ],
4078
- name: "ExceedValidatorLimit",
4079
- type: "error"
4080
- },
4081
- {
4082
- inputs: [
4083
- {
4084
- internalType: "uint64",
4085
- name: "operatorId",
4086
- type: "uint64"
4087
- }
4088
- ],
4089
- name: "ExceedValidatorLimitWithData",
4090
- type: "error"
4091
- },
4092
- {
4093
- inputs: [],
4094
- name: "FeeExceedsIncreaseLimit",
4095
- type: "error"
4096
- },
4097
- {
4098
- inputs: [],
4099
- name: "FeeIncreaseNotAllowed",
4100
- type: "error"
4101
- },
4102
- {
4103
- inputs: [],
4104
- name: "FeeTooHigh",
4105
- type: "error"
4106
- },
4107
- {
4108
- inputs: [],
4109
- name: "FeeTooLow",
4110
- type: "error"
4111
- },
4112
- {
4113
- inputs: [],
4114
- name: "IncorrectClusterState",
4115
- type: "error"
4116
- },
4117
- {
4118
- inputs: [],
4119
- name: "IncorrectValidatorState",
4120
- type: "error"
4121
- },
4122
- {
4123
- inputs: [
4124
- {
4125
- internalType: "bytes",
4126
- name: "publicKey",
4127
- type: "bytes"
4128
- }
4129
- ],
4130
- name: "IncorrectValidatorStateWithData",
4131
- type: "error"
4132
- },
4133
- {
4134
- inputs: [],
4135
- name: "InsufficientBalance",
4136
- type: "error"
4137
- },
4138
- {
4139
- inputs: [],
4140
- name: "InvalidContractAddress",
4141
- type: "error"
4142
- },
4143
- {
4144
- inputs: [],
4145
- name: "InvalidOperatorIdsLength",
4146
- type: "error"
4147
- },
4148
- {
4149
- inputs: [],
4150
- name: "InvalidPublicKeyLength",
4151
- type: "error"
4152
- },
4153
- {
4154
- inputs: [],
4155
- name: "InvalidWhitelistAddressesLength",
4156
- type: "error"
4157
- },
4158
- {
4159
- inputs: [
4160
- {
4161
- internalType: "address",
4162
- name: "contractAddress",
4163
- type: "address"
4164
- }
4165
- ],
4166
- name: "InvalidWhitelistingContract",
4167
- type: "error"
4168
- },
4169
- {
4170
- inputs: [],
4171
- name: "MaxValueExceeded",
4172
- type: "error"
4173
- },
4174
- {
4175
- inputs: [],
4176
- name: "NewBlockPeriodIsBelowMinimum",
4177
- type: "error"
4178
- },
4179
- {
4180
- inputs: [],
4181
- name: "NoFeeDeclared",
4182
- type: "error"
4183
- },
4184
- {
4185
- inputs: [],
4186
- name: "NotAuthorized",
4187
- type: "error"
4188
- },
4189
- {
4190
- inputs: [],
4191
- name: "OperatorAlreadyExists",
4192
- type: "error"
4193
- },
4194
- {
4195
- inputs: [],
4196
- name: "OperatorDoesNotExist",
4197
- type: "error"
4198
- },
4199
- {
4200
- inputs: [],
4201
- name: "OperatorsListNotUnique",
4202
- type: "error"
4203
- },
4204
- {
4205
- inputs: [],
4206
- name: "PublicKeysSharesLengthMismatch",
4207
- type: "error"
4208
- },
4209
- {
4210
- inputs: [],
4211
- name: "SameFeeChangeNotAllowed",
4212
- type: "error"
4213
- },
4214
- {
4215
- inputs: [],
4216
- name: "TargetModuleDoesNotExist",
4217
- type: "error"
4218
- },
4219
- {
4220
- inputs: [
4221
- {
4222
- internalType: "uint8",
4223
- name: "moduleId",
4224
- type: "uint8"
4225
- }
4226
- ],
4227
- name: "TargetModuleDoesNotExistWithData",
4228
- type: "error"
4229
- },
4230
- {
4231
- inputs: [],
4232
- name: "TokenTransferFailed",
4233
- type: "error"
4234
- },
4235
- {
4236
- inputs: [],
4237
- name: "UnsortedOperatorsList",
4238
- type: "error"
4239
- },
4240
- {
4241
- inputs: [],
4242
- name: "ValidatorAlreadyExists",
4243
- type: "error"
4244
- },
4245
- {
4246
- inputs: [
4247
- {
4248
- internalType: "bytes",
4249
- name: "publicKey",
4250
- type: "bytes"
4251
- }
4252
- ],
4253
- name: "ValidatorAlreadyExistsWithData",
4254
- type: "error"
4255
- },
4256
- {
4257
- inputs: [],
4258
- name: "ValidatorDoesNotExist",
4259
- type: "error"
4260
- },
4261
- {
4262
- inputs: [],
4263
- name: "ZeroAddressNotAllowed",
4264
- type: "error"
4265
- },
4266
- {
4267
- anonymous: false,
4268
- inputs: [
4269
- {
4270
- indexed: false,
4271
- internalType: "address",
4272
- name: "previousAdmin",
4273
- type: "address"
4274
- },
4275
- {
4276
- indexed: false,
4277
- internalType: "address",
4278
- name: "newAdmin",
4279
- type: "address"
4280
- }
4281
- ],
4282
- name: "AdminChanged",
4283
- type: "event"
4284
- },
4285
- {
4286
- anonymous: false,
4287
- inputs: [
4288
- {
4289
- indexed: true,
4290
- internalType: "address",
4291
- name: "beacon",
4292
- type: "address"
4293
- }
4294
- ],
4295
- name: "BeaconUpgraded",
4296
- type: "event"
4297
- },
4298
- {
4299
- anonymous: false,
4300
- inputs: [
4301
- {
4302
- indexed: false,
4303
- internalType: "uint8",
4304
- name: "version",
4305
- type: "uint8"
4306
- }
4307
- ],
4308
- name: "Initialized",
4309
- type: "event"
4310
- },
4311
- {
4312
- anonymous: false,
4313
- inputs: [
4314
- {
4315
- indexed: true,
4316
- internalType: "address",
4317
- name: "previousOwner",
4318
- type: "address"
4319
- },
4320
- {
4321
- indexed: true,
4322
- internalType: "address",
4323
- name: "newOwner",
4324
- type: "address"
4325
- }
4326
- ],
4327
- name: "OwnershipTransferStarted",
4328
- type: "event"
4329
- },
4330
- {
4331
- anonymous: false,
4332
- inputs: [
4333
- {
4334
- indexed: true,
4335
- internalType: "address",
4336
- name: "previousOwner",
4337
- type: "address"
4338
- },
4339
- {
4340
- indexed: true,
4341
- internalType: "address",
4342
- name: "newOwner",
4343
- type: "address"
4344
- }
4345
- ],
4346
- name: "OwnershipTransferred",
4347
- type: "event"
4348
- },
4349
- {
4350
- anonymous: false,
4351
- inputs: [
4352
- {
4353
- indexed: true,
4354
- internalType: "address",
4355
- name: "implementation",
4356
- type: "address"
4357
- }
4358
- ],
4359
- name: "Upgraded",
4360
- type: "event"
4361
- },
4362
- {
4363
- inputs: [],
4364
- name: "acceptOwnership",
4365
- outputs: [],
4366
- stateMutability: "nonpayable",
4367
- type: "function"
4368
- },
4369
- {
4370
- inputs: [
4371
- {
4372
- internalType: "address",
4373
- name: "clusterOwner",
4374
- type: "address"
4375
- },
4376
- {
4377
- internalType: "uint64[]",
4378
- name: "operatorIds",
4379
- type: "uint64[]"
4380
- },
4381
- {
4382
- components: [
4383
- {
4384
- internalType: "uint32",
4385
- name: "validatorCount",
4386
- type: "uint32"
4387
- },
4388
- {
4389
- internalType: "uint64",
4390
- name: "networkFeeIndex",
4391
- type: "uint64"
4392
- },
4393
- {
4394
- internalType: "uint64",
4395
- name: "index",
4396
- type: "uint64"
4397
- },
4398
- {
4399
- internalType: "bool",
4400
- name: "active",
4401
- type: "bool"
4402
- },
4403
- {
4404
- internalType: "uint256",
4405
- name: "balance",
4406
- type: "uint256"
4407
- }
4408
- ],
4409
- internalType: "struct ISSVNetworkCore.Cluster",
4410
- name: "cluster",
4411
- type: "tuple"
4412
- }
4413
- ],
4414
- name: "getBalance",
4415
- outputs: [
4416
- {
4417
- internalType: "uint256",
4418
- name: "",
4419
- type: "uint256"
4420
- }
4421
- ],
4422
- stateMutability: "view",
4423
- type: "function"
4424
- },
4425
- {
4426
- inputs: [
4427
- {
4428
- internalType: "address",
4429
- name: "clusterOwner",
4430
- type: "address"
4431
- },
4432
- {
4433
- internalType: "uint64[]",
4434
- name: "operatorIds",
4435
- type: "uint64[]"
4436
- },
4437
- {
4438
- components: [
4439
- {
4440
- internalType: "uint32",
4441
- name: "validatorCount",
4442
- type: "uint32"
4443
- },
4444
- {
4445
- internalType: "uint64",
4446
- name: "networkFeeIndex",
4447
- type: "uint64"
4448
- },
4449
- {
4450
- internalType: "uint64",
4451
- name: "index",
4452
- type: "uint64"
4453
- },
4454
- {
4455
- internalType: "bool",
4456
- name: "active",
4457
- type: "bool"
4458
- },
4459
- {
4460
- internalType: "uint256",
4461
- name: "balance",
4462
- type: "uint256"
4463
- }
4464
- ],
4465
- internalType: "struct ISSVNetworkCore.Cluster",
4466
- name: "cluster",
4467
- type: "tuple"
4468
- }
4469
- ],
4470
- name: "getBurnRate",
4471
- outputs: [
4472
- {
4473
- internalType: "uint256",
4474
- name: "",
4475
- type: "uint256"
4476
- }
4477
- ],
4478
- stateMutability: "view",
4479
- type: "function"
4480
- },
4481
- {
4482
- inputs: [],
4483
- name: "getLiquidationThresholdPeriod",
4484
- outputs: [
4485
- {
4486
- internalType: "uint64",
4487
- name: "",
4488
- type: "uint64"
4489
- }
4490
- ],
4491
- stateMutability: "view",
4492
- type: "function"
4493
- },
4494
- {
4495
- inputs: [],
4496
- name: "getMaximumOperatorFee",
4497
- outputs: [
4498
- {
4499
- internalType: "uint64",
4500
- name: "",
4501
- type: "uint64"
4502
- }
4503
- ],
4504
- stateMutability: "view",
4505
- type: "function"
4506
- },
4507
- {
4508
- inputs: [],
4509
- name: "getMinimumLiquidationCollateral",
4510
- outputs: [
4511
- {
4512
- internalType: "uint256",
4513
- name: "",
4514
- type: "uint256"
4515
- }
4516
- ],
4517
- stateMutability: "view",
4518
- type: "function"
4519
- },
4520
- {
4521
- inputs: [],
4522
- name: "getNetworkEarnings",
4523
- outputs: [
4524
- {
4525
- internalType: "uint256",
4526
- name: "",
4527
- type: "uint256"
4528
- }
4529
- ],
4530
- stateMutability: "view",
4531
- type: "function"
4532
- },
4533
- {
4534
- inputs: [],
4535
- name: "getNetworkFee",
4536
- outputs: [
4537
- {
4538
- internalType: "uint256",
4539
- name: "",
4540
- type: "uint256"
4541
- }
4542
- ],
4543
- stateMutability: "view",
4544
- type: "function"
4545
- },
4546
- {
4547
- inputs: [],
4548
- name: "getNetworkValidatorsCount",
4549
- outputs: [
4550
- {
4551
- internalType: "uint32",
4552
- name: "",
4553
- type: "uint32"
4554
- }
4555
- ],
4556
- stateMutability: "view",
4557
- type: "function"
4558
- },
4559
- {
4560
- inputs: [
4561
- {
4562
- internalType: "uint64",
4563
- name: "operatorId",
4564
- type: "uint64"
4565
- }
4566
- ],
4567
- name: "getOperatorById",
4568
- outputs: [
4569
- {
4570
- internalType: "address",
4571
- name: "",
4572
- type: "address"
4573
- },
4574
- {
4575
- internalType: "uint256",
4576
- name: "",
4577
- type: "uint256"
4578
- },
4579
- {
4580
- internalType: "uint32",
4581
- name: "",
4582
- type: "uint32"
4583
- },
4584
- {
4585
- internalType: "address",
4586
- name: "",
4587
- type: "address"
4588
- },
4589
- {
4590
- internalType: "bool",
4591
- name: "",
4592
- type: "bool"
4593
- },
4594
- {
4595
- internalType: "bool",
4596
- name: "",
4597
- type: "bool"
4598
- }
4599
- ],
4600
- stateMutability: "view",
4601
- type: "function"
4602
- },
4603
- {
4604
- inputs: [
4605
- {
4606
- internalType: "uint64",
4607
- name: "operatorId",
4608
- type: "uint64"
4609
- }
4610
- ],
4611
- name: "getOperatorDeclaredFee",
4612
- outputs: [
4613
- {
4614
- internalType: "bool",
4615
- name: "",
4616
- type: "bool"
4617
- },
4618
- {
4619
- internalType: "uint256",
4620
- name: "",
4621
- type: "uint256"
4622
- },
4623
- {
4624
- internalType: "uint64",
4625
- name: "",
4626
- type: "uint64"
4627
- },
4628
- {
4629
- internalType: "uint64",
4630
- name: "",
4631
- type: "uint64"
4632
- }
4633
- ],
4634
- stateMutability: "view",
4635
- type: "function"
4636
- },
4637
- {
4638
- inputs: [
4639
- {
4640
- internalType: "uint64",
4641
- name: "id",
4642
- type: "uint64"
4643
- }
4644
- ],
4645
- name: "getOperatorEarnings",
4646
- outputs: [
4647
- {
4648
- internalType: "uint256",
4649
- name: "",
4650
- type: "uint256"
4651
- }
4652
- ],
4653
- stateMutability: "view",
4654
- type: "function"
4655
- },
4656
- {
4657
- inputs: [
4658
- {
4659
- internalType: "uint64",
4660
- name: "operatorId",
4661
- type: "uint64"
4662
- }
4663
- ],
4664
- name: "getOperatorFee",
4665
- outputs: [
4666
- {
4667
- internalType: "uint256",
4668
- name: "",
4669
- type: "uint256"
4670
- }
4671
- ],
4672
- stateMutability: "view",
4673
- type: "function"
4674
- },
4675
- {
4676
- inputs: [],
4677
- name: "getOperatorFeeIncreaseLimit",
4678
- outputs: [
4679
- {
4680
- internalType: "uint64",
4681
- name: "",
4682
- type: "uint64"
4683
- }
4684
- ],
4685
- stateMutability: "view",
4686
- type: "function"
4687
- },
4688
- {
4689
- inputs: [],
4690
- name: "getOperatorFeePeriods",
4691
- outputs: [
4692
- {
4693
- internalType: "uint64",
4694
- name: "",
4695
- type: "uint64"
4696
- },
4697
- {
4698
- internalType: "uint64",
4699
- name: "",
4700
- type: "uint64"
4701
- }
4702
- ],
4703
- stateMutability: "view",
4704
- type: "function"
4705
- },
4706
- {
4707
- inputs: [
4708
- {
4709
- internalType: "address",
4710
- name: "clusterOwner",
4711
- type: "address"
4712
- },
4713
- {
4714
- internalType: "bytes",
4715
- name: "publicKey",
4716
- type: "bytes"
4717
- }
4718
- ],
4719
- name: "getValidator",
4720
- outputs: [
4721
- {
4722
- internalType: "bool",
4723
- name: "",
4724
- type: "bool"
4725
- }
4726
- ],
4727
- stateMutability: "view",
4728
- type: "function"
4729
- },
4730
- {
4731
- inputs: [],
4732
- name: "getValidatorsPerOperatorLimit",
4733
- outputs: [
4734
- {
4735
- internalType: "uint32",
4736
- name: "",
4737
- type: "uint32"
4738
- }
4739
- ],
4740
- stateMutability: "view",
4741
- type: "function"
4742
- },
4743
- {
4744
- inputs: [],
4745
- name: "getVersion",
4746
- outputs: [
4747
- {
4748
- internalType: "string",
4749
- name: "",
4750
- type: "string"
4751
- }
4752
- ],
4753
- stateMutability: "view",
4754
- type: "function"
4755
- },
4756
- {
4757
- inputs: [
4758
- {
4759
- internalType: "uint64[]",
4760
- name: "operatorIds",
4761
- type: "uint64[]"
4762
- },
4763
- {
4764
- internalType: "address",
4765
- name: "whitelistedAddress",
4766
- type: "address"
4767
- }
4768
- ],
4769
- name: "getWhitelistedOperators",
4770
- outputs: [
4771
- {
4772
- internalType: "uint64[]",
4773
- name: "whitelistedOperatorIds",
4774
- type: "uint64[]"
4775
- }
4776
- ],
4777
- stateMutability: "view",
4778
- type: "function"
4779
- },
4780
- {
4781
- inputs: [
4782
- {
4783
- internalType: "contract ISSVViews",
4784
- name: "ssvNetwork_",
4785
- type: "address"
4786
- }
4787
- ],
4788
- name: "initialize",
4789
- outputs: [],
4790
- stateMutability: "nonpayable",
4791
- type: "function"
4792
- },
4793
- {
4794
- inputs: [
4795
- {
4796
- internalType: "address",
4797
- name: "addressToCheck",
4798
- type: "address"
4799
- },
4800
- {
4801
- internalType: "uint256",
4802
- name: "operatorId",
4803
- type: "uint256"
4804
- },
4805
- {
4806
- internalType: "address",
4807
- name: "whitelistingContract",
4808
- type: "address"
4809
- }
4810
- ],
4811
- name: "isAddressWhitelistedInWhitelistingContract",
4812
- outputs: [
4813
- {
4814
- internalType: "bool",
4815
- name: "isWhitelisted",
4816
- type: "bool"
4817
- }
4818
- ],
4819
- stateMutability: "view",
4820
- type: "function"
4821
- },
4822
- {
4823
- inputs: [
4824
- {
4825
- internalType: "address",
4826
- name: "clusterOwner",
4827
- type: "address"
4828
- },
4829
- {
4830
- internalType: "uint64[]",
4831
- name: "operatorIds",
4832
- type: "uint64[]"
4833
- },
4834
- {
4835
- components: [
4836
- {
4837
- internalType: "uint32",
4838
- name: "validatorCount",
4839
- type: "uint32"
4840
- },
4841
- {
4842
- internalType: "uint64",
4843
- name: "networkFeeIndex",
4844
- type: "uint64"
4845
- },
4846
- {
4847
- internalType: "uint64",
4848
- name: "index",
4849
- type: "uint64"
4850
- },
4851
- {
4852
- internalType: "bool",
4853
- name: "active",
4854
- type: "bool"
4855
- },
4856
- {
4857
- internalType: "uint256",
4858
- name: "balance",
4859
- type: "uint256"
4860
- }
4861
- ],
4862
- internalType: "struct ISSVNetworkCore.Cluster",
4863
- name: "cluster",
4864
- type: "tuple"
4865
- }
4866
- ],
4867
- name: "isLiquidatable",
4868
- outputs: [
4869
- {
4870
- internalType: "bool",
4871
- name: "",
4872
- type: "bool"
4873
- }
4874
- ],
4875
- stateMutability: "view",
4876
- type: "function"
4877
- },
4878
- {
4879
- inputs: [
4880
- {
4881
- internalType: "address",
4882
- name: "clusterOwner",
4883
- type: "address"
4884
- },
4885
- {
4886
- internalType: "uint64[]",
4887
- name: "operatorIds",
4888
- type: "uint64[]"
4889
- },
4890
- {
4891
- components: [
4892
- {
4893
- internalType: "uint32",
4894
- name: "validatorCount",
4895
- type: "uint32"
4896
- },
4897
- {
4898
- internalType: "uint64",
4899
- name: "networkFeeIndex",
4900
- type: "uint64"
4901
- },
4902
- {
4903
- internalType: "uint64",
4904
- name: "index",
4905
- type: "uint64"
4906
- },
4907
- {
4908
- internalType: "bool",
4909
- name: "active",
4910
- type: "bool"
4911
- },
4912
- {
4913
- internalType: "uint256",
4914
- name: "balance",
4915
- type: "uint256"
4916
- }
4917
- ],
4918
- internalType: "struct ISSVNetworkCore.Cluster",
4919
- name: "cluster",
4920
- type: "tuple"
4921
- }
4922
- ],
4923
- name: "isLiquidated",
4924
- outputs: [
4925
- {
4926
- internalType: "bool",
4927
- name: "",
4928
- type: "bool"
4929
- }
4930
- ],
4931
- stateMutability: "view",
4932
- type: "function"
4933
- },
4934
- {
4935
- inputs: [
4936
- {
4937
- internalType: "address",
4938
- name: "contractAddress",
4939
- type: "address"
4940
- }
4941
- ],
4942
- name: "isWhitelistingContract",
4943
- outputs: [
4944
- {
4945
- internalType: "bool",
4946
- name: "",
4947
- type: "bool"
4948
- }
4949
- ],
4950
- stateMutability: "view",
4951
- type: "function"
4952
- },
4953
- {
4954
- inputs: [],
4955
- name: "owner",
4956
- outputs: [
4957
- {
4958
- internalType: "address",
4959
- name: "",
4960
- type: "address"
4961
- }
4962
- ],
4963
- stateMutability: "view",
4964
- type: "function"
4965
- },
4966
- {
4967
- inputs: [],
4968
- name: "pendingOwner",
4969
- outputs: [
4970
- {
4971
- internalType: "address",
4972
- name: "",
4973
- type: "address"
4974
- }
4975
- ],
4976
- stateMutability: "view",
4977
- type: "function"
4978
- },
4979
- {
4980
- inputs: [],
4981
- name: "proxiableUUID",
4982
- outputs: [
4983
- {
4984
- internalType: "bytes32",
4985
- name: "",
4986
- type: "bytes32"
4987
- }
4988
- ],
4989
- stateMutability: "view",
4990
- type: "function"
4991
- },
4992
- {
4993
- inputs: [],
4994
- name: "renounceOwnership",
4995
- outputs: [],
4996
- stateMutability: "nonpayable",
4997
- type: "function"
4998
- },
4999
- {
5000
- inputs: [],
5001
- name: "ssvNetwork",
5002
- outputs: [
5003
- {
5004
- internalType: "contract ISSVViews",
5005
- name: "",
5006
- type: "address"
5007
- }
5008
- ],
5009
- stateMutability: "view",
5010
- type: "function"
5011
- },
5012
- {
5013
- inputs: [
5014
- {
5015
- internalType: "address",
5016
- name: "newOwner",
5017
- type: "address"
5018
- }
5019
- ],
5020
- name: "transferOwnership",
5021
- outputs: [],
5022
- stateMutability: "nonpayable",
5023
- type: "function"
5024
- },
5025
- {
5026
- inputs: [
5027
- {
5028
- internalType: "address",
5029
- name: "newImplementation",
5030
- type: "address"
5031
- }
5032
- ],
5033
- name: "upgradeTo",
5034
- outputs: [],
5035
- stateMutability: "nonpayable",
5036
- type: "function"
5037
- },
5038
- {
5039
- inputs: [
5040
- {
5041
- internalType: "address",
5042
- name: "newImplementation",
5043
- type: "address"
5044
- },
5045
- {
5046
- internalType: "bytes",
5047
- name: "data",
5048
- type: "bytes"
5049
- }
5050
- ],
5051
- name: "upgradeToAndCall",
5052
- outputs: [],
5053
- stateMutability: "payable",
5054
- type: "function"
5055
- }
5056
- ];
5057
3986
  const paramsToArray = ({
5058
3987
  params,
5059
3988
  abiFunction
@@ -5134,7 +4063,7 @@ function urlJoin(...args) {
5134
4063
  const parts = Array.from(Array.isArray(args[0]) ? args[0] : args);
5135
4064
  return normalize(parts);
5136
4065
  }
5137
- const ABIS = [TokenABI, MainnetV4SetterABI, HoleskyV4GetterABI];
4066
+ const ABIS = [TokenABI, MainnetV4SetterABI];
5138
4067
  const createWriter = ({
5139
4068
  abi,
5140
4069
  publicClient,
@@ -5249,7 +4178,7 @@ const createSSVAPI = (endpoint) => {
5249
4178
  return getSSVAPI(endpoint);
5250
4179
  };
5251
4180
  const isConfig = (props) => {
5252
- return typeof props === "object" && props !== null && "publicClient" in props && "walletClient" in props && "chain" in props && "api" in props && "graphQLClient" in props && "contractAddresses" in props && "contract" in props && "graphEndpoint" in props && "restEndpoint" in props;
4181
+ return typeof props === "object" && props !== null && "publicClient" in props && "walletClient" in props && "chain" in props && "api" in props && "contractAddresses" in props && "contract" in props && "subgraph" in props && "rest" in props;
5253
4182
  };
5254
4183
  const createContractInteractions = ({
5255
4184
  walletClient,
@@ -5286,35 +4215,41 @@ const createContractInteractions = ({
5286
4215
  };
5287
4216
  };
5288
4217
  const createConfig = (props) => {
5289
- const parsed = globals.configArgsSchema.parse(props);
5290
- if (!parsed.walletClient.chain || !parsed.publicClient.chain || !globals.chainIds.includes(parsed.walletClient.chain?.id) || !globals.chainIds.includes(parsed.publicClient.chain?.id))
5291
- throw new Error(`Chain must be one of ${globals.chainIds.join(", ")}`);
5292
- const chainId = parsed.walletClient.chain.id;
4218
+ const { walletClient, publicClient, extendedConfig } = globals.configArgsSchema.parse(props);
4219
+ const hasAPIKey = Boolean(extendedConfig?.subgraph?.apiKey);
4220
+ const chainId = walletClient.chain.id;
5293
4221
  const chainContracts = globals.contracts[chainId];
5294
4222
  const addresses = {
5295
- setter: parsed._?.contractAddresses?.setter || chainContracts.setter,
5296
- getter: parsed._?.contractAddresses?.getter || chainContracts.getter,
5297
- token: parsed._?.contractAddresses?.token || chainContracts.token
4223
+ setter: extendedConfig?.contracts?.setter || chainContracts.setter,
4224
+ getter: extendedConfig?.contracts?.getter || chainContracts.getter,
4225
+ token: extendedConfig?.contracts?.token || chainContracts.token
5298
4226
  };
5299
4227
  const contract = createContractInteractions({
5300
- walletClient: parsed.walletClient,
5301
- publicClient: parsed.publicClient,
4228
+ walletClient,
4229
+ publicClient,
5302
4230
  addresses
5303
4231
  });
5304
- const graphEndpoint = parsed._?.graphUrl || globals.graph_endpoints[chainId];
5305
- const restEndpoint = parsed._?.restUrl || globals.rest_endpoints[chainId];
5306
- const graphQLClient = new graphqlRequest.GraphQLClient(graphEndpoint);
5307
- return {
5308
- publicClient: parsed.publicClient,
5309
- walletClient: parsed.walletClient,
5310
- chain: parsed.walletClient.chain,
4232
+ const graphEndpoint = extendedConfig?.subgraph?.endpoint || (hasAPIKey ? globals.paid_graph_endpoints[chainId] : globals.graph_endpoints[chainId]);
4233
+ const restEndpoint = extendedConfig?.rest?.endpoint || globals.rest_endpoints[chainId];
4234
+ const graphQLClient = new graphqlRequest.GraphQLClient(
5311
4235
  graphEndpoint,
5312
- restEndpoint,
4236
+ hasAPIKey ? { headers: { Authorization: `Bearer ${extendedConfig?.subgraph?.apiKey}` } } : void 0
4237
+ );
4238
+ return {
4239
+ publicClient,
4240
+ walletClient,
4241
+ chain: walletClient.chain,
5313
4242
  api: {
5314
4243
  ...createQueries(graphQLClient),
5315
4244
  ...createSSVAPI(restEndpoint)
5316
4245
  },
5317
- graphQLClient,
4246
+ subgraph: {
4247
+ client: graphQLClient,
4248
+ endpoint: graphEndpoint
4249
+ },
4250
+ rest: {
4251
+ endpoint: restEndpoint
4252
+ },
5318
4253
  contractAddresses: addresses,
5319
4254
  contract
5320
4255
  };
@@ -5850,6 +4785,7 @@ exports.globals = globals.globals;
5850
4785
  exports.graph_endpoints = globals.graph_endpoints;
5851
4786
  exports.hoodi = globals.hoodi;
5852
4787
  exports.networks = globals.networks;
4788
+ exports.paid_graph_endpoints = globals.paid_graph_endpoints;
5853
4789
  exports.registerValidatorsByClusterSizeLimits = globals.registerValidatorsByClusterSizeLimits;
5854
4790
  exports.rest_endpoints = globals.rest_endpoints;
5855
4791
  exports.KeyShares = KeyShares.KeyShares;