pnp-sdk 0.2.10 → 0.2.11

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.cjs CHANGED
@@ -86,7 +86,7 @@ var import_anchor = require("@coral-xyz/anchor");
86
86
 
87
87
  // src/idl/pnp_protocol_solana.json
88
88
  var pnp_protocol_solana_default = {
89
- address: "6fnYZUSyp3vJxTNnayq5S62d363EFaGARnqYux5bqrxb",
89
+ address: "8PyE2dizL52ga7ytqLtqRyjwWp4yXEx8M5Z4BAHgHuTb",
90
90
  metadata: {
91
91
  name: "pnp_protocol_solana",
92
92
  version: "0.1.0",
@@ -3854,6 +3854,357 @@ var pnp_protocol_solana_default = {
3854
3854
  ],
3855
3855
  returns: "u64"
3856
3856
  },
3857
+ {
3858
+ name: "redeem_creator_liquidity",
3859
+ docs: [
3860
+ "Redeems creator's locked liquidity after market settlement (V2 only)",
3861
+ "",
3862
+ "# Arguments",
3863
+ "* `ctx` - The context containing creator liquidity redemption accounts",
3864
+ "",
3865
+ "# Returns",
3866
+ "* Amount of collateral redeemed"
3867
+ ],
3868
+ discriminator: [
3869
+ 189,
3870
+ 166,
3871
+ 66,
3872
+ 201,
3873
+ 145,
3874
+ 236,
3875
+ 219,
3876
+ 70
3877
+ ],
3878
+ accounts: [
3879
+ {
3880
+ name: "creator",
3881
+ docs: [
3882
+ "Creator who is claiming locked liquidity"
3883
+ ],
3884
+ writable: true,
3885
+ signer: true
3886
+ },
3887
+ {
3888
+ name: "market",
3889
+ docs: [
3890
+ "V2 Market account"
3891
+ ],
3892
+ writable: true,
3893
+ pda: {
3894
+ seeds: [
3895
+ {
3896
+ kind: "const",
3897
+ value: [
3898
+ 109,
3899
+ 97,
3900
+ 114,
3901
+ 107,
3902
+ 101,
3903
+ 116,
3904
+ 45,
3905
+ 118,
3906
+ 50
3907
+ ]
3908
+ },
3909
+ {
3910
+ kind: "account",
3911
+ path: "market.id",
3912
+ account: "Market"
3913
+ }
3914
+ ]
3915
+ }
3916
+ },
3917
+ {
3918
+ name: "yes_token_mint",
3919
+ docs: [
3920
+ "YES token mint"
3921
+ ],
3922
+ writable: true
3923
+ },
3924
+ {
3925
+ name: "no_token_mint",
3926
+ docs: [
3927
+ "NO token mint"
3928
+ ],
3929
+ writable: true
3930
+ },
3931
+ {
3932
+ name: "market_yes_token_vault",
3933
+ docs: [
3934
+ "Market vault holding creator's locked YES tokens (ATA owned by market PDA)"
3935
+ ],
3936
+ writable: true,
3937
+ pda: {
3938
+ seeds: [
3939
+ {
3940
+ kind: "account",
3941
+ path: "market"
3942
+ },
3943
+ {
3944
+ kind: "account",
3945
+ path: "token_program_decision"
3946
+ },
3947
+ {
3948
+ kind: "account",
3949
+ path: "yes_token_mint"
3950
+ }
3951
+ ],
3952
+ program: {
3953
+ kind: "const",
3954
+ value: [
3955
+ 140,
3956
+ 151,
3957
+ 37,
3958
+ 143,
3959
+ 78,
3960
+ 36,
3961
+ 137,
3962
+ 241,
3963
+ 187,
3964
+ 61,
3965
+ 16,
3966
+ 41,
3967
+ 20,
3968
+ 142,
3969
+ 13,
3970
+ 131,
3971
+ 11,
3972
+ 90,
3973
+ 19,
3974
+ 153,
3975
+ 218,
3976
+ 255,
3977
+ 16,
3978
+ 132,
3979
+ 4,
3980
+ 142,
3981
+ 123,
3982
+ 216,
3983
+ 219,
3984
+ 233,
3985
+ 248,
3986
+ 89
3987
+ ]
3988
+ }
3989
+ }
3990
+ },
3991
+ {
3992
+ name: "market_no_token_vault",
3993
+ docs: [
3994
+ "Market vault holding creator's locked NO tokens (ATA owned by market PDA)"
3995
+ ],
3996
+ writable: true,
3997
+ pda: {
3998
+ seeds: [
3999
+ {
4000
+ kind: "account",
4001
+ path: "market"
4002
+ },
4003
+ {
4004
+ kind: "account",
4005
+ path: "token_program_decision"
4006
+ },
4007
+ {
4008
+ kind: "account",
4009
+ path: "no_token_mint"
4010
+ }
4011
+ ],
4012
+ program: {
4013
+ kind: "const",
4014
+ value: [
4015
+ 140,
4016
+ 151,
4017
+ 37,
4018
+ 143,
4019
+ 78,
4020
+ 36,
4021
+ 137,
4022
+ 241,
4023
+ 187,
4024
+ 61,
4025
+ 16,
4026
+ 41,
4027
+ 20,
4028
+ 142,
4029
+ 13,
4030
+ 131,
4031
+ 11,
4032
+ 90,
4033
+ 19,
4034
+ 153,
4035
+ 218,
4036
+ 255,
4037
+ 16,
4038
+ 132,
4039
+ 4,
4040
+ 142,
4041
+ 123,
4042
+ 216,
4043
+ 219,
4044
+ 233,
4045
+ 248,
4046
+ 89
4047
+ ]
4048
+ }
4049
+ }
4050
+ },
4051
+ {
4052
+ name: "market_reserve_vault",
4053
+ docs: [
4054
+ "Market's collateral token vault (reserve)"
4055
+ ],
4056
+ writable: true,
4057
+ pda: {
4058
+ seeds: [
4059
+ {
4060
+ kind: "account",
4061
+ path: "market"
4062
+ },
4063
+ {
4064
+ kind: "account",
4065
+ path: "token_program"
4066
+ },
4067
+ {
4068
+ kind: "account",
4069
+ path: "collateral_token_mint"
4070
+ }
4071
+ ],
4072
+ program: {
4073
+ kind: "const",
4074
+ value: [
4075
+ 140,
4076
+ 151,
4077
+ 37,
4078
+ 143,
4079
+ 78,
4080
+ 36,
4081
+ 137,
4082
+ 241,
4083
+ 187,
4084
+ 61,
4085
+ 16,
4086
+ 41,
4087
+ 20,
4088
+ 142,
4089
+ 13,
4090
+ 131,
4091
+ 11,
4092
+ 90,
4093
+ 19,
4094
+ 153,
4095
+ 218,
4096
+ 255,
4097
+ 16,
4098
+ 132,
4099
+ 4,
4100
+ 142,
4101
+ 123,
4102
+ 216,
4103
+ 219,
4104
+ 233,
4105
+ 248,
4106
+ 89
4107
+ ]
4108
+ }
4109
+ }
4110
+ },
4111
+ {
4112
+ name: "collateral_token_mint",
4113
+ docs: [
4114
+ "Collateral token mint"
4115
+ ]
4116
+ },
4117
+ {
4118
+ name: "creator_collateral_token_account",
4119
+ docs: [
4120
+ "Creator's collateral token account (receives payout)"
4121
+ ],
4122
+ writable: true,
4123
+ pda: {
4124
+ seeds: [
4125
+ {
4126
+ kind: "account",
4127
+ path: "creator"
4128
+ },
4129
+ {
4130
+ kind: "account",
4131
+ path: "token_program"
4132
+ },
4133
+ {
4134
+ kind: "account",
4135
+ path: "collateral_token_mint"
4136
+ }
4137
+ ],
4138
+ program: {
4139
+ kind: "const",
4140
+ value: [
4141
+ 140,
4142
+ 151,
4143
+ 37,
4144
+ 143,
4145
+ 78,
4146
+ 36,
4147
+ 137,
4148
+ 241,
4149
+ 187,
4150
+ 61,
4151
+ 16,
4152
+ 41,
4153
+ 20,
4154
+ 142,
4155
+ 13,
4156
+ 131,
4157
+ 11,
4158
+ 90,
4159
+ 19,
4160
+ 153,
4161
+ 218,
4162
+ 255,
4163
+ 16,
4164
+ 132,
4165
+ 4,
4166
+ 142,
4167
+ 123,
4168
+ 216,
4169
+ 219,
4170
+ 233,
4171
+ 248,
4172
+ 89
4173
+ ]
4174
+ }
4175
+ }
4176
+ },
4177
+ {
4178
+ name: "token_program",
4179
+ docs: [
4180
+ "Token program for collateral transfers (may be Token-2022)"
4181
+ ]
4182
+ },
4183
+ {
4184
+ name: "token_program_decision",
4185
+ docs: [
4186
+ "Token program for decision token burns (always standard SPL Token)"
4187
+ ],
4188
+ address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
4189
+ },
4190
+ {
4191
+ name: "associated_token_program",
4192
+ docs: [
4193
+ "Associated token program"
4194
+ ],
4195
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
4196
+ },
4197
+ {
4198
+ name: "system_program",
4199
+ docs: [
4200
+ "System program"
4201
+ ],
4202
+ address: "11111111111111111111111111111111"
4203
+ }
4204
+ ],
4205
+ args: [],
4206
+ returns: "u64"
4207
+ },
3857
4208
  {
3858
4209
  name: "redeem_position",
3859
4210
  docs: [
@@ -5550,7 +5901,30 @@ var pnp_protocol_solana_default = {
5550
5901
  docs: [
5551
5902
  "V2 Market account to update"
5552
5903
  ],
5553
- writable: true
5904
+ writable: true,
5905
+ pda: {
5906
+ seeds: [
5907
+ {
5908
+ kind: "const",
5909
+ value: [
5910
+ 109,
5911
+ 97,
5912
+ 114,
5913
+ 107,
5914
+ 101,
5915
+ 116,
5916
+ 45,
5917
+ 118,
5918
+ 50
5919
+ ]
5920
+ },
5921
+ {
5922
+ kind: "account",
5923
+ path: "market.id",
5924
+ account: "Market"
5925
+ }
5926
+ ]
5927
+ }
5554
5928
  },
5555
5929
  {
5556
5930
  name: "market_extension",
@@ -5649,20 +6023,20 @@ var pnp_protocol_solana_default = {
5649
6023
  {
5650
6024
  name: "creator",
5651
6025
  docs: [
5652
- "Original market creator (for receiving initial tokens)"
6026
+ "Original market creator (for validation)"
5653
6027
  ]
5654
6028
  },
5655
6029
  {
5656
- name: "creator_yes_token_account",
6030
+ name: "market_yes_token_vault",
5657
6031
  docs: [
5658
- "Creator's YES token account"
6032
+ "Market vault for creator's locked YES tokens (ATA owned by market PDA)"
5659
6033
  ],
5660
6034
  writable: true,
5661
6035
  pda: {
5662
6036
  seeds: [
5663
6037
  {
5664
6038
  kind: "account",
5665
- path: "creator"
6039
+ path: "market"
5666
6040
  },
5667
6041
  {
5668
6042
  kind: "account",
@@ -5713,16 +6087,16 @@ var pnp_protocol_solana_default = {
5713
6087
  }
5714
6088
  },
5715
6089
  {
5716
- name: "creator_no_token_account",
6090
+ name: "market_no_token_vault",
5717
6091
  docs: [
5718
- "Creator's NO token account"
6092
+ "Market vault for creator's locked NO tokens (ATA owned by market PDA)"
5719
6093
  ],
5720
6094
  writable: true,
5721
6095
  pda: {
5722
6096
  seeds: [
5723
6097
  {
5724
6098
  kind: "account",
5725
- path: "creator"
6099
+ path: "market"
5726
6100
  },
5727
6101
  {
5728
6102
  kind: "account",
@@ -6590,18 +6964,154 @@ var pnp_protocol_solana_default = {
6590
6964
  address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
6591
6965
  },
6592
6966
  {
6593
- name: "associated_token_program",
6967
+ name: "associated_token_program",
6968
+ docs: [
6969
+ "Associated token program"
6970
+ ],
6971
+ address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
6972
+ },
6973
+ {
6974
+ name: "system_program",
6975
+ docs: [
6976
+ "System program"
6977
+ ],
6978
+ address: "11111111111111111111111111111111"
6979
+ }
6980
+ ],
6981
+ args: [
6982
+ {
6983
+ name: "yes_winner",
6984
+ type: "bool"
6985
+ }
6986
+ ],
6987
+ returns: {
6988
+ defined: {
6989
+ name: "WinningToken"
6990
+ }
6991
+ }
6992
+ },
6993
+ {
6994
+ name: "settle_market_v2",
6995
+ docs: [
6996
+ "Settles a V2 market with custom oracle support",
6997
+ "",
6998
+ "Unlike the original settle_market (which only accepts admin/global oracle),",
6999
+ "this instruction also accepts the per-market custom oracle from MarketExtension.",
7000
+ "",
7001
+ "# Arguments",
7002
+ "* `ctx` - The context containing V2 settlement accounts",
7003
+ "* `yes_winner` - If true, YES tokens win; if false, NO tokens win",
7004
+ "",
7005
+ "# Returns",
7006
+ "* The winning token type"
7007
+ ],
7008
+ discriminator: [
7009
+ 131,
7010
+ 199,
7011
+ 75,
7012
+ 155,
7013
+ 16,
7014
+ 199,
7015
+ 72,
7016
+ 1
7017
+ ],
7018
+ accounts: [
7019
+ {
7020
+ name: "settler",
7021
+ docs: [
7022
+ "Settler account \u2014 must be admin, global oracle, or custom oracle from extension"
7023
+ ],
7024
+ writable: true,
7025
+ signer: true
7026
+ },
7027
+ {
7028
+ name: "market",
7029
+ docs: [
7030
+ "V2 Market account"
7031
+ ],
7032
+ writable: true,
7033
+ pda: {
7034
+ seeds: [
7035
+ {
7036
+ kind: "const",
7037
+ value: [
7038
+ 109,
7039
+ 97,
7040
+ 114,
7041
+ 107,
7042
+ 101,
7043
+ 116,
7044
+ 45,
7045
+ 118,
7046
+ 50
7047
+ ]
7048
+ },
7049
+ {
7050
+ kind: "account",
7051
+ path: "market.id",
7052
+ account: "Market"
7053
+ }
7054
+ ]
7055
+ }
7056
+ },
7057
+ {
7058
+ name: "market_extension",
6594
7059
  docs: [
6595
- "Associated token program"
7060
+ "Optional market extension \u2014 pass if market has custom oracle"
6596
7061
  ],
6597
- address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
7062
+ optional: true,
7063
+ pda: {
7064
+ seeds: [
7065
+ {
7066
+ kind: "const",
7067
+ value: [
7068
+ 109,
7069
+ 97,
7070
+ 114,
7071
+ 107,
7072
+ 101,
7073
+ 116,
7074
+ 95,
7075
+ 101,
7076
+ 120,
7077
+ 116
7078
+ ]
7079
+ },
7080
+ {
7081
+ kind: "account",
7082
+ path: "market.id",
7083
+ account: "Market"
7084
+ }
7085
+ ]
7086
+ }
6598
7087
  },
6599
7088
  {
6600
- name: "system_program",
7089
+ name: "global_config",
6601
7090
  docs: [
6602
- "System program"
7091
+ "Global configuration"
6603
7092
  ],
6604
- address: "11111111111111111111111111111111"
7093
+ pda: {
7094
+ seeds: [
7095
+ {
7096
+ kind: "const",
7097
+ value: [
7098
+ 103,
7099
+ 108,
7100
+ 111,
7101
+ 98,
7102
+ 97,
7103
+ 108,
7104
+ 95,
7105
+ 99,
7106
+ 111,
7107
+ 110,
7108
+ 102,
7109
+ 105,
7110
+ 103
7111
+ ]
7112
+ }
7113
+ ]
7114
+ }
6605
7115
  }
6606
7116
  ],
6607
7117
  args: [
@@ -6823,6 +7333,71 @@ var pnp_protocol_solana_default = {
6823
7333
  type: "pubkey"
6824
7334
  }
6825
7335
  ]
7336
+ },
7337
+ {
7338
+ name: "update_oracle",
7339
+ docs: [
7340
+ "Updates the oracle program address (admin-only)",
7341
+ "",
7342
+ "# Arguments",
7343
+ "* `ctx` - The context containing oracle update accounts",
7344
+ "* `new_oracle` - The new oracle program public key"
7345
+ ],
7346
+ discriminator: [
7347
+ 112,
7348
+ 41,
7349
+ 209,
7350
+ 18,
7351
+ 248,
7352
+ 226,
7353
+ 252,
7354
+ 188
7355
+ ],
7356
+ accounts: [
7357
+ {
7358
+ name: "authority",
7359
+ docs: [
7360
+ "The admin authority. ONLY the admin can update the oracle \u2014 NOT the oracle itself.",
7361
+ "This prevents a compromised oracle from locking out the protocol."
7362
+ ],
7363
+ signer: true
7364
+ },
7365
+ {
7366
+ name: "global_config",
7367
+ docs: [
7368
+ "The global configuration account storing protocol settings"
7369
+ ],
7370
+ writable: true,
7371
+ pda: {
7372
+ seeds: [
7373
+ {
7374
+ kind: "const",
7375
+ value: [
7376
+ 103,
7377
+ 108,
7378
+ 111,
7379
+ 98,
7380
+ 97,
7381
+ 108,
7382
+ 95,
7383
+ 99,
7384
+ 111,
7385
+ 110,
7386
+ 102,
7387
+ 105,
7388
+ 103
7389
+ ]
7390
+ }
7391
+ ]
7392
+ }
7393
+ }
7394
+ ],
7395
+ args: [
7396
+ {
7397
+ name: "new_oracle",
7398
+ type: "pubkey"
7399
+ }
7400
+ ]
6826
7401
  }
6827
7402
  ],
6828
7403
  accounts: [
@@ -6932,6 +7507,19 @@ var pnp_protocol_solana_default = {
6932
7507
  7
6933
7508
  ]
6934
7509
  },
7510
+ {
7511
+ name: "CreatorLiquidityRedeemed",
7512
+ discriminator: [
7513
+ 242,
7514
+ 202,
7515
+ 33,
7516
+ 247,
7517
+ 73,
7518
+ 224,
7519
+ 194,
7520
+ 141
7521
+ ]
7522
+ },
6935
7523
  {
6936
7524
  name: "CreatorRefundEvent",
6937
7525
  discriminator: [
@@ -7140,6 +7728,19 @@ var pnp_protocol_solana_default = {
7140
7728
  165
7141
7729
  ]
7142
7730
  },
7731
+ {
7732
+ name: "SettleMarketV2Event",
7733
+ discriminator: [
7734
+ 134,
7735
+ 247,
7736
+ 23,
7737
+ 246,
7738
+ 163,
7739
+ 42,
7740
+ 206,
7741
+ 229
7742
+ ]
7743
+ },
7143
7744
  {
7144
7745
  name: "SettleMarketV3Event",
7145
7746
  discriminator: [
@@ -7152,6 +7753,19 @@ var pnp_protocol_solana_default = {
7152
7753
  44,
7153
7754
  100
7154
7755
  ]
7756
+ },
7757
+ {
7758
+ name: "UpdateOracleEvent",
7759
+ discriminator: [
7760
+ 160,
7761
+ 215,
7762
+ 18,
7763
+ 128,
7764
+ 160,
7765
+ 219,
7766
+ 87,
7767
+ 173
7768
+ ]
7155
7769
  }
7156
7770
  ],
7157
7771
  errors: [
@@ -7288,6 +7902,34 @@ var pnp_protocol_solana_default = {
7288
7902
  ]
7289
7903
  }
7290
7904
  },
7905
+ {
7906
+ name: "CreatorLiquidityRedeemed",
7907
+ type: {
7908
+ kind: "struct",
7909
+ fields: [
7910
+ {
7911
+ name: "market_id",
7912
+ type: "u64"
7913
+ },
7914
+ {
7915
+ name: "market",
7916
+ type: "pubkey"
7917
+ },
7918
+ {
7919
+ name: "creator",
7920
+ type: "pubkey"
7921
+ },
7922
+ {
7923
+ name: "winning_tokens_burned",
7924
+ type: "u64"
7925
+ },
7926
+ {
7927
+ name: "collateral_redeemed",
7928
+ type: "u64"
7929
+ }
7930
+ ]
7931
+ }
7932
+ },
7291
7933
  {
7292
7934
  name: "CreatorRefundEvent",
7293
7935
  docs: [
@@ -7637,6 +8279,27 @@ var pnp_protocol_solana_default = {
7637
8279
  {
7638
8280
  name: "version",
7639
8281
  type: "u8"
8282
+ },
8283
+ {
8284
+ name: "creator_yes_locked",
8285
+ docs: [
8286
+ "Amount of YES tokens locked in vault for creator (set during setMarketResolvableV2)"
8287
+ ],
8288
+ type: "u64"
8289
+ },
8290
+ {
8291
+ name: "creator_no_locked",
8292
+ docs: [
8293
+ "Amount of NO tokens locked in vault for creator (set during setMarketResolvableV2)"
8294
+ ],
8295
+ type: "u64"
8296
+ },
8297
+ {
8298
+ name: "creator_liquidity_claimed",
8299
+ docs: [
8300
+ "Whether the creator has already claimed locked liquidity"
8301
+ ],
8302
+ type: "bool"
7640
8303
  }
7641
8304
  ]
7642
8305
  }
@@ -8330,6 +8993,26 @@ var pnp_protocol_solana_default = {
8330
8993
  ]
8331
8994
  }
8332
8995
  },
8996
+ {
8997
+ name: "SettleMarketV2Event",
8998
+ type: {
8999
+ kind: "struct",
9000
+ fields: [
9001
+ {
9002
+ name: "market",
9003
+ type: "pubkey"
9004
+ },
9005
+ {
9006
+ name: "market_id",
9007
+ type: "u64"
9008
+ },
9009
+ {
9010
+ name: "yes_winner",
9011
+ type: "bool"
9012
+ }
9013
+ ]
9014
+ }
9015
+ },
8333
9016
  {
8334
9017
  name: "SettleMarketV3Event",
8335
9018
  type: {
@@ -8375,6 +9058,31 @@ var pnp_protocol_solana_default = {
8375
9058
  ]
8376
9059
  }
8377
9060
  },
9061
+ {
9062
+ name: "UpdateOracleEvent",
9063
+ docs: [
9064
+ "Event emitted when the oracle program address is updated"
9065
+ ],
9066
+ type: {
9067
+ kind: "struct",
9068
+ fields: [
9069
+ {
9070
+ name: "old_oracle",
9071
+ docs: [
9072
+ "The previous oracle program address"
9073
+ ],
9074
+ type: "pubkey"
9075
+ },
9076
+ {
9077
+ name: "new_oracle",
9078
+ docs: [
9079
+ "The new oracle program address"
9080
+ ],
9081
+ type: "pubkey"
9082
+ }
9083
+ ]
9084
+ }
9085
+ },
8378
9086
  {
8379
9087
  name: "WinningToken",
8380
9088
  docs: [
@@ -8533,6 +9241,7 @@ function constructAccountMetas(ixDef, accounts) {
8533
9241
  const pubkey = accounts[name];
8534
9242
  if (!pubkey) {
8535
9243
  if (optional) {
9244
+ metas.push({ pubkey: PNP_PROGRAM_ID, isSigner: false, isWritable: false });
8536
9245
  continue;
8537
9246
  }
8538
9247
  throw new Error(`Missing account for ${ixDef.name}: ${name}`);
@@ -8549,7 +9258,7 @@ function decodeAccount(accountName, data) {
8549
9258
 
8550
9259
  // src/platform/client.ts
8551
9260
  var MAINNET_PROGRAM_ID = PNP_PROGRAM_ID;
8552
- var DEVNET_PROGRAM_ID = new import_web32.PublicKey("pnpkv2qnh4bfpGvTugGDSEhvZC7DP4pVxTuDykV3BGz");
9261
+ var DEVNET_PROGRAM_ID = new import_web32.PublicKey("8PyE2dizL52ga7ytqLtqRyjwWp4yXEx8M5Z4BAHgHuTb");
8553
9262
  function isDevnetRpc(rpcUrl) {
8554
9263
  const url = rpcUrl.toLowerCase();
8555
9264
  return url.includes("devnet") || url.includes("dev.") || url.includes(":8899");
@@ -8716,11 +9425,17 @@ __export(pdas_exports, {
8716
9425
  deriveCreatorFeeTreasuryPda: () => deriveCreatorFeeTreasuryPda,
8717
9426
  deriveCreatorFeeTreasuryPdaLegacy: () => deriveCreatorFeeTreasuryPdaLegacy,
8718
9427
  deriveGlobalConfigPda: () => deriveGlobalConfigPda,
9428
+ deriveMarketExtensionPda: () => deriveMarketExtensionPda,
8719
9429
  deriveMarketPda: () => deriveMarketPda,
8720
9430
  deriveMarketPdaFromMints: () => deriveMarketPdaFromMints,
9431
+ deriveMarketV2Pda: () => deriveMarketV2Pda,
9432
+ deriveMarketV3ExtensionPda: () => deriveMarketV3ExtensionPda,
9433
+ deriveMarketV3Pda: () => deriveMarketV3Pda,
8721
9434
  deriveNoTokenMint: () => deriveNoTokenMint,
8722
9435
  derivePositionPda: () => derivePositionPda,
8723
9436
  deriveTokenMetadataPda: () => deriveTokenMetadataPda,
9437
+ deriveV3NoTokenMint: () => deriveV3NoTokenMint,
9438
+ deriveV3YesTokenMint: () => deriveV3YesTokenMint,
8724
9439
  deriveYesTokenMint: () => deriveYesTokenMint
8725
9440
  });
8726
9441
  var import_web34 = require("@solana/web3.js");
@@ -8785,6 +9500,42 @@ function deriveNoTokenMint(globalId, programId) {
8785
9500
  u64LeBuffer(globalId)
8786
9501
  ], programId);
8787
9502
  }
9503
+ function deriveMarketV2Pda(globalId, programId) {
9504
+ return import_web34.PublicKey.findProgramAddressSync([
9505
+ Buffer.from("market-v2"),
9506
+ u64LeBuffer(globalId)
9507
+ ], programId);
9508
+ }
9509
+ function deriveMarketV3Pda(globalId, programId) {
9510
+ return import_web34.PublicKey.findProgramAddressSync([
9511
+ Buffer.from("market-v3"),
9512
+ u64LeBuffer(globalId)
9513
+ ], programId);
9514
+ }
9515
+ function deriveV3YesTokenMint(globalId, programId) {
9516
+ return import_web34.PublicKey.findProgramAddressSync([
9517
+ Buffer.from("v3-yes-token"),
9518
+ u64LeBuffer(globalId)
9519
+ ], programId);
9520
+ }
9521
+ function deriveV3NoTokenMint(globalId, programId) {
9522
+ return import_web34.PublicKey.findProgramAddressSync([
9523
+ Buffer.from("v3-no-token"),
9524
+ u64LeBuffer(globalId)
9525
+ ], programId);
9526
+ }
9527
+ function deriveMarketExtensionPda(marketId, programId) {
9528
+ return import_web34.PublicKey.findProgramAddressSync([
9529
+ Buffer.from("market_ext"),
9530
+ u64LeBuffer(marketId)
9531
+ ], programId);
9532
+ }
9533
+ function deriveMarketV3ExtensionPda(marketId, programId) {
9534
+ return import_web34.PublicKey.findProgramAddressSync([
9535
+ Buffer.from("market_v3_ext"),
9536
+ u64LeBuffer(marketId)
9537
+ ], programId);
9538
+ }
8788
9539
  function deriveTokenMetadataPda(mint, metadataProgramId) {
8789
9540
  return import_web34.PublicKey.findProgramAddressSync([
8790
9541
  Buffer.from("metadata"),
@@ -8969,9 +9720,6 @@ var MarketModule = class {
8969
9720
  } else {
8970
9721
  throw new Error("Could not extract market_id from market account. Market account missing 'id' field.");
8971
9722
  }
8972
- if (marketId === 0n) {
8973
- throw new Error("Market ID is zero, which is invalid");
8974
- }
8975
9723
  const [globalConfig] = deriveGlobalConfigPda(this.client.programId);
8976
9724
  const globalConfigInfo = await this.client.connection.getAccountInfo(globalConfig, this.client.commitment);
8977
9725
  if (!globalConfigInfo) throw new Error("global_config not initialized on-chain");
@@ -9684,8 +10432,8 @@ var NodeKeypairSigner = class {
9684
10432
  var import_web311 = require("@solana/web3.js");
9685
10433
  var import_bn2 = require("bn.js");
9686
10434
  var anchor = __toESM(require("@coral-xyz/anchor"), 1);
9687
- var MAINNET_PROGRAM_ID2 = new import_web311.PublicKey("6fnYZUSyp3vJxTNnayq5S62d363EFaGARnqYux5bqrxb");
9688
- var DEVNET_PROGRAM_ID2 = new import_web311.PublicKey("pnpkv2qnh4bfpGvTugGDSEhvZC7DP4pVxTuDykV3BGz");
10435
+ var MAINNET_PROGRAM_ID2 = new import_web311.PublicKey("8PyE2dizL52ga7ytqLtqRyjwWp4yXEx8M5Z4BAHgHuTb");
10436
+ var DEVNET_PROGRAM_ID2 = new import_web311.PublicKey("8PyE2dizL52ga7ytqLtqRyjwWp4yXEx8M5Z4BAHgHuTb");
9689
10437
  var AnchorClient = class _AnchorClient {
9690
10438
  constructor(connection, signer, idlOverride, programIdOverride) {
9691
10439
  this.connection = connection;
@@ -10885,8 +11633,8 @@ Cause: ${err.message}`);
10885
11633
  [Buffer.from("global_config")],
10886
11634
  this.client.programId
10887
11635
  );
10888
- const globalConfigAccount = await this.anchorClient.program.account.globalConfig.fetch(globalConfigPDA);
10889
- const admin = new import_web314.PublicKey(globalConfigAccount.admin);
11636
+ const P2P_ADMIN = new import_web314.PublicKey("9joX7eXbU5N9t3ksw5Aj5mdoPvcjVcVvkzdiestDqbwf");
11637
+ const admin = P2P_ADMIN;
10890
11638
  const creator = new import_web314.PublicKey(marketAccount.creator);
10891
11639
  const yesTokenMint = new import_web314.PublicKey(marketAccount.yesTokenMint);
10892
11640
  const noTokenMint = new import_web314.PublicKey(marketAccount.noTokenMint);