torchsdk 2.0.0 → 2.1.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.
@@ -2,7 +2,7 @@
2
2
  "address": "8hbUkonssSEEtkqzwM7ZcZrD9evacM92TcWSooVF4BeT",
3
3
  "metadata": {
4
4
  "name": "torch_market",
5
- "version": "3.0.0",
5
+ "version": "3.1.0",
6
6
  "spec": "0.1.0",
7
7
  "description": "torch.market"
8
8
  },
@@ -341,6 +341,107 @@
341
341
  "Pool token vault 1 (for reading reserves)"
342
342
  ]
343
343
  },
344
+ {
345
+ "name": "torch_vault",
346
+ "docs": [
347
+ "[V18] Optional: Torch vault — collateral comes from vault ATA, SOL goes to vault"
348
+ ],
349
+ "writable": true,
350
+ "optional": true
351
+ },
352
+ {
353
+ "name": "vault_wallet_link",
354
+ "docs": [
355
+ "[V18] Optional: Proves borrower is authorized to use the vault"
356
+ ],
357
+ "optional": true,
358
+ "pda": {
359
+ "seeds": [
360
+ {
361
+ "kind": "const",
362
+ "value": [
363
+ 118,
364
+ 97,
365
+ 117,
366
+ 108,
367
+ 116,
368
+ 95,
369
+ 119,
370
+ 97,
371
+ 108,
372
+ 108,
373
+ 101,
374
+ 116
375
+ ]
376
+ },
377
+ {
378
+ "kind": "account",
379
+ "path": "borrower"
380
+ }
381
+ ]
382
+ }
383
+ },
384
+ {
385
+ "name": "vault_token_account",
386
+ "docs": [
387
+ "[V18] Optional: Vault's token ATA — collateral taken from here"
388
+ ],
389
+ "writable": true,
390
+ "optional": true,
391
+ "pda": {
392
+ "seeds": [
393
+ {
394
+ "kind": "account",
395
+ "path": "torch_vault"
396
+ },
397
+ {
398
+ "kind": "account",
399
+ "path": "token_program"
400
+ },
401
+ {
402
+ "kind": "account",
403
+ "path": "mint"
404
+ }
405
+ ],
406
+ "program": {
407
+ "kind": "const",
408
+ "value": [
409
+ 140,
410
+ 151,
411
+ 37,
412
+ 143,
413
+ 78,
414
+ 36,
415
+ 137,
416
+ 241,
417
+ 187,
418
+ 61,
419
+ 16,
420
+ 41,
421
+ 20,
422
+ 142,
423
+ 13,
424
+ 131,
425
+ 11,
426
+ 90,
427
+ 19,
428
+ 153,
429
+ 218,
430
+ 255,
431
+ 16,
432
+ 132,
433
+ 4,
434
+ 142,
435
+ 123,
436
+ 216,
437
+ 219,
438
+ 233,
439
+ 248,
440
+ 89
441
+ ]
442
+ }
443
+ }
444
+ },
344
445
  {
345
446
  "name": "token_program"
346
447
  },
@@ -824,6 +925,68 @@
824
925
  ]
825
926
  }
826
927
  },
928
+ {
929
+ "name": "vault_token_account",
930
+ "docs": [
931
+ "[V18] Optional: Vault's token ATA — tokens go here instead of buyer's wallet",
932
+ "When present, torch_vault must also be present."
933
+ ],
934
+ "writable": true,
935
+ "optional": true,
936
+ "pda": {
937
+ "seeds": [
938
+ {
939
+ "kind": "account",
940
+ "path": "torch_vault"
941
+ },
942
+ {
943
+ "kind": "account",
944
+ "path": "token_program"
945
+ },
946
+ {
947
+ "kind": "account",
948
+ "path": "mint"
949
+ }
950
+ ],
951
+ "program": {
952
+ "kind": "const",
953
+ "value": [
954
+ 140,
955
+ 151,
956
+ 37,
957
+ 143,
958
+ 78,
959
+ 36,
960
+ 137,
961
+ 241,
962
+ 187,
963
+ 61,
964
+ 16,
965
+ 41,
966
+ 20,
967
+ 142,
968
+ 13,
969
+ 131,
970
+ 11,
971
+ 90,
972
+ 19,
973
+ 153,
974
+ 218,
975
+ 255,
976
+ 16,
977
+ 132,
978
+ 4,
979
+ 142,
980
+ 123,
981
+ 216,
982
+ 219,
983
+ 233,
984
+ 248,
985
+ 89
986
+ ]
987
+ }
988
+ }
989
+ },
827
990
  {
828
991
  "name": "token_program"
829
992
  },
@@ -1770,6 +1933,109 @@
1770
1933
  }
1771
1934
  ]
1772
1935
  },
1936
+ {
1937
+ "name": "fund_vault_wsol",
1938
+ "docs": [
1939
+ "[V19] Fund vault WSOL ATA with lamports from vault PDA.",
1940
+ "Must be called before vault_swap (buy) in the same transaction.",
1941
+ "Isolates direct lamport manipulation from CPIs to avoid runtime balance errors."
1942
+ ],
1943
+ "discriminator": [
1944
+ 100,
1945
+ 184,
1946
+ 41,
1947
+ 110,
1948
+ 24,
1949
+ 100,
1950
+ 34,
1951
+ 246
1952
+ ],
1953
+ "accounts": [
1954
+ {
1955
+ "name": "signer",
1956
+ "docs": [
1957
+ "Controller wallet (linked to vault)"
1958
+ ],
1959
+ "signer": true
1960
+ },
1961
+ {
1962
+ "name": "torch_vault",
1963
+ "docs": [
1964
+ "Vault PDA (SOL source)"
1965
+ ],
1966
+ "writable": true,
1967
+ "pda": {
1968
+ "seeds": [
1969
+ {
1970
+ "kind": "const",
1971
+ "value": [
1972
+ 116,
1973
+ 111,
1974
+ 114,
1975
+ 99,
1976
+ 104,
1977
+ 95,
1978
+ 118,
1979
+ 97,
1980
+ 117,
1981
+ 108,
1982
+ 116
1983
+ ]
1984
+ },
1985
+ {
1986
+ "kind": "account",
1987
+ "path": "torch_vault.creator",
1988
+ "account": "TorchVault"
1989
+ }
1990
+ ]
1991
+ }
1992
+ },
1993
+ {
1994
+ "name": "vault_wallet_link",
1995
+ "docs": [
1996
+ "Vault wallet link (proves signer is authorized)"
1997
+ ],
1998
+ "pda": {
1999
+ "seeds": [
2000
+ {
2001
+ "kind": "const",
2002
+ "value": [
2003
+ 118,
2004
+ 97,
2005
+ 117,
2006
+ 108,
2007
+ 116,
2008
+ 95,
2009
+ 119,
2010
+ 97,
2011
+ 108,
2012
+ 108,
2013
+ 101,
2014
+ 116
2015
+ ]
2016
+ },
2017
+ {
2018
+ "kind": "account",
2019
+ "path": "signer"
2020
+ }
2021
+ ]
2022
+ }
2023
+ },
2024
+ {
2025
+ "name": "vault_wsol_account",
2026
+ "docs": [
2027
+ "Vault's WSOL ATA (lamport destination)"
2028
+ ],
2029
+ "writable": true
2030
+ }
2031
+ ],
2032
+ "args": [
2033
+ {
2034
+ "name": "amount",
2035
+ "type": "u64"
2036
+ }
2037
+ ]
2038
+ },
1773
2039
  {
1774
2040
  "name": "harvest_fees",
1775
2041
  "docs": [
@@ -3075,20 +3341,121 @@
3075
3341
  }
3076
3342
  },
3077
3343
  {
3078
- "name": "token_program"
3344
+ "name": "torch_vault",
3345
+ "docs": [
3346
+ "[V18] Optional: Torch vault — SOL repaid from vault, collateral returned to vault ATA"
3347
+ ],
3348
+ "writable": true,
3349
+ "optional": true
3079
3350
  },
3080
3351
  {
3081
- "name": "system_program",
3082
- "address": "11111111111111111111111111111111"
3083
- }
3084
- ],
3085
- "args": [
3086
- {
3087
- "name": "sol_amount",
3088
- "type": "u64"
3089
- }
3090
- ]
3091
- },
3352
+ "name": "vault_wallet_link",
3353
+ "docs": [
3354
+ "[V18] Optional: Proves borrower is authorized to use the vault"
3355
+ ],
3356
+ "optional": true,
3357
+ "pda": {
3358
+ "seeds": [
3359
+ {
3360
+ "kind": "const",
3361
+ "value": [
3362
+ 118,
3363
+ 97,
3364
+ 117,
3365
+ 108,
3366
+ 116,
3367
+ 95,
3368
+ 119,
3369
+ 97,
3370
+ 108,
3371
+ 108,
3372
+ 101,
3373
+ 116
3374
+ ]
3375
+ },
3376
+ {
3377
+ "kind": "account",
3378
+ "path": "borrower"
3379
+ }
3380
+ ]
3381
+ }
3382
+ },
3383
+ {
3384
+ "name": "vault_token_account",
3385
+ "docs": [
3386
+ "[V18] Optional: Vault's token ATA — returned collateral goes here"
3387
+ ],
3388
+ "writable": true,
3389
+ "optional": true,
3390
+ "pda": {
3391
+ "seeds": [
3392
+ {
3393
+ "kind": "account",
3394
+ "path": "torch_vault"
3395
+ },
3396
+ {
3397
+ "kind": "account",
3398
+ "path": "token_program"
3399
+ },
3400
+ {
3401
+ "kind": "account",
3402
+ "path": "mint"
3403
+ }
3404
+ ],
3405
+ "program": {
3406
+ "kind": "const",
3407
+ "value": [
3408
+ 140,
3409
+ 151,
3410
+ 37,
3411
+ 143,
3412
+ 78,
3413
+ 36,
3414
+ 137,
3415
+ 241,
3416
+ 187,
3417
+ 61,
3418
+ 16,
3419
+ 41,
3420
+ 20,
3421
+ 142,
3422
+ 13,
3423
+ 131,
3424
+ 11,
3425
+ 90,
3426
+ 19,
3427
+ 153,
3428
+ 218,
3429
+ 255,
3430
+ 16,
3431
+ 132,
3432
+ 4,
3433
+ 142,
3434
+ 123,
3435
+ 216,
3436
+ 219,
3437
+ 233,
3438
+ 248,
3439
+ 89
3440
+ ]
3441
+ }
3442
+ }
3443
+ },
3444
+ {
3445
+ "name": "token_program"
3446
+ },
3447
+ {
3448
+ "name": "system_program",
3449
+ "address": "11111111111111111111111111111111"
3450
+ }
3451
+ ],
3452
+ "args": [
3453
+ {
3454
+ "name": "sol_amount",
3455
+ "type": "u64"
3456
+ }
3457
+ ]
3458
+ },
3092
3459
  {
3093
3460
  "name": "sell",
3094
3461
  "docs": [
@@ -3422,6 +3789,107 @@
3422
3789
  ]
3423
3790
  }
3424
3791
  },
3792
+ {
3793
+ "name": "torch_vault",
3794
+ "docs": [
3795
+ "[V18] Optional: Torch vault as SOL destination (agent safety)"
3796
+ ],
3797
+ "writable": true,
3798
+ "optional": true
3799
+ },
3800
+ {
3801
+ "name": "vault_wallet_link",
3802
+ "docs": [
3803
+ "[V18] Optional: Proves seller is authorized to use the vault"
3804
+ ],
3805
+ "optional": true,
3806
+ "pda": {
3807
+ "seeds": [
3808
+ {
3809
+ "kind": "const",
3810
+ "value": [
3811
+ 118,
3812
+ 97,
3813
+ 117,
3814
+ 108,
3815
+ 116,
3816
+ 95,
3817
+ 119,
3818
+ 97,
3819
+ 108,
3820
+ 108,
3821
+ 101,
3822
+ 116
3823
+ ]
3824
+ },
3825
+ {
3826
+ "kind": "account",
3827
+ "path": "seller"
3828
+ }
3829
+ ]
3830
+ }
3831
+ },
3832
+ {
3833
+ "name": "vault_token_account",
3834
+ "docs": [
3835
+ "[V18] Optional: Vault's token ATA — tokens sold from here instead of seller's wallet"
3836
+ ],
3837
+ "writable": true,
3838
+ "optional": true,
3839
+ "pda": {
3840
+ "seeds": [
3841
+ {
3842
+ "kind": "account",
3843
+ "path": "torch_vault"
3844
+ },
3845
+ {
3846
+ "kind": "account",
3847
+ "path": "token_program"
3848
+ },
3849
+ {
3850
+ "kind": "account",
3851
+ "path": "mint"
3852
+ }
3853
+ ],
3854
+ "program": {
3855
+ "kind": "const",
3856
+ "value": [
3857
+ 140,
3858
+ 151,
3859
+ 37,
3860
+ 143,
3861
+ 78,
3862
+ 36,
3863
+ 137,
3864
+ 241,
3865
+ 187,
3866
+ 61,
3867
+ 16,
3868
+ 41,
3869
+ 20,
3870
+ 142,
3871
+ 13,
3872
+ 131,
3873
+ 11,
3874
+ 90,
3875
+ 19,
3876
+ 153,
3877
+ 218,
3878
+ 255,
3879
+ 16,
3880
+ 132,
3881
+ 4,
3882
+ 142,
3883
+ 123,
3884
+ 216,
3885
+ 219,
3886
+ 233,
3887
+ 248,
3888
+ 89
3889
+ ]
3890
+ }
3891
+ }
3892
+ },
3425
3893
  {
3426
3894
  "name": "token_program"
3427
3895
  },
@@ -3568,87 +4036,559 @@
3568
4036
  ]
3569
4037
  }
3570
4038
  },
4039
+ {
4040
+ "name": "torch_vault",
4041
+ "docs": [
4042
+ "[V18] Optional: Torch vault as SOL source (agent safety)"
4043
+ ],
4044
+ "writable": true,
4045
+ "optional": true
4046
+ },
4047
+ {
4048
+ "name": "vault_wallet_link",
4049
+ "docs": [
4050
+ "[V18] Optional: Proves user is authorized to use the vault"
4051
+ ],
4052
+ "optional": true,
4053
+ "pda": {
4054
+ "seeds": [
4055
+ {
4056
+ "kind": "const",
4057
+ "value": [
4058
+ 118,
4059
+ 97,
4060
+ 117,
4061
+ 108,
4062
+ 116,
4063
+ 95,
4064
+ 119,
4065
+ 97,
4066
+ 108,
4067
+ 108,
4068
+ 101,
4069
+ 116
4070
+ ]
4071
+ },
4072
+ {
4073
+ "kind": "account",
4074
+ "path": "user"
4075
+ }
4076
+ ]
4077
+ }
4078
+ },
4079
+ {
4080
+ "name": "system_program",
4081
+ "address": "11111111111111111111111111111111"
4082
+ }
4083
+ ],
4084
+ "args": []
4085
+ },
4086
+ {
4087
+ "name": "transfer_authority",
4088
+ "docs": [
4089
+ "[V14.1] Transfer vault authority to a new wallet.",
4090
+ "Does NOT affect wallet links."
4091
+ ],
4092
+ "discriminator": [
4093
+ 48,
4094
+ 169,
4095
+ 76,
4096
+ 72,
4097
+ 229,
4098
+ 180,
4099
+ 55,
4100
+ 161
4101
+ ],
4102
+ "accounts": [
4103
+ {
4104
+ "name": "authority",
4105
+ "signer": true,
4106
+ "relations": [
4107
+ "vault"
4108
+ ]
4109
+ },
4110
+ {
4111
+ "name": "vault",
4112
+ "writable": true,
4113
+ "pda": {
4114
+ "seeds": [
4115
+ {
4116
+ "kind": "const",
4117
+ "value": [
4118
+ 116,
4119
+ 111,
4120
+ 114,
4121
+ 99,
4122
+ 104,
4123
+ 95,
4124
+ 118,
4125
+ 97,
4126
+ 117,
4127
+ 108,
4128
+ 116
4129
+ ]
4130
+ },
4131
+ {
4132
+ "kind": "account",
4133
+ "path": "vault.creator",
4134
+ "account": "TorchVault"
4135
+ }
4136
+ ]
4137
+ }
4138
+ },
4139
+ {
4140
+ "name": "new_authority"
4141
+ }
4142
+ ],
4143
+ "args": []
4144
+ },
4145
+ {
4146
+ "name": "unlink_wallet",
4147
+ "docs": [
4148
+ "[V14.1] Unlink a wallet from a vault. Authority only.",
4149
+ "Closes the VaultWalletLink PDA, returning rent to authority."
4150
+ ],
4151
+ "discriminator": [
4152
+ 220,
4153
+ 121,
4154
+ 97,
4155
+ 13,
4156
+ 193,
4157
+ 137,
4158
+ 209,
4159
+ 159
4160
+ ],
4161
+ "accounts": [
4162
+ {
4163
+ "name": "authority",
4164
+ "writable": true,
4165
+ "signer": true,
4166
+ "relations": [
4167
+ "vault"
4168
+ ]
4169
+ },
4170
+ {
4171
+ "name": "vault",
4172
+ "writable": true,
4173
+ "pda": {
4174
+ "seeds": [
4175
+ {
4176
+ "kind": "const",
4177
+ "value": [
4178
+ 116,
4179
+ 111,
4180
+ 114,
4181
+ 99,
4182
+ 104,
4183
+ 95,
4184
+ 118,
4185
+ 97,
4186
+ 117,
4187
+ 108,
4188
+ 116
4189
+ ]
4190
+ },
4191
+ {
4192
+ "kind": "account",
4193
+ "path": "vault.creator",
4194
+ "account": "TorchVault"
4195
+ }
4196
+ ]
4197
+ }
4198
+ },
4199
+ {
4200
+ "name": "wallet_to_unlink"
4201
+ },
4202
+ {
4203
+ "name": "wallet_link",
4204
+ "writable": true,
4205
+ "pda": {
4206
+ "seeds": [
4207
+ {
4208
+ "kind": "const",
4209
+ "value": [
4210
+ 118,
4211
+ 97,
4212
+ 117,
4213
+ 108,
4214
+ 116,
4215
+ 95,
4216
+ 119,
4217
+ 97,
4218
+ 108,
4219
+ 108,
4220
+ 101,
4221
+ 116
4222
+ ]
4223
+ },
4224
+ {
4225
+ "kind": "account",
4226
+ "path": "wallet_to_unlink"
4227
+ }
4228
+ ]
4229
+ }
4230
+ },
4231
+ {
4232
+ "name": "system_program",
4233
+ "address": "11111111111111111111111111111111"
4234
+ }
4235
+ ],
4236
+ "args": []
4237
+ },
4238
+ {
4239
+ "name": "update_dev_wallet",
4240
+ "docs": [
4241
+ "[V8] Update the dev wallet address."
4242
+ ],
4243
+ "discriminator": [
4244
+ 152,
4245
+ 37,
4246
+ 243,
4247
+ 206,
4248
+ 192,
4249
+ 150,
4250
+ 129,
4251
+ 200
4252
+ ],
4253
+ "accounts": [
4254
+ {
4255
+ "name": "authority",
4256
+ "signer": true,
4257
+ "relations": [
4258
+ "global_config"
4259
+ ]
4260
+ },
4261
+ {
4262
+ "name": "global_config",
4263
+ "writable": true,
4264
+ "pda": {
4265
+ "seeds": [
4266
+ {
4267
+ "kind": "const",
4268
+ "value": [
4269
+ 103,
4270
+ 108,
4271
+ 111,
4272
+ 98,
4273
+ 97,
4274
+ 108,
4275
+ 95,
4276
+ 99,
4277
+ 111,
4278
+ 110,
4279
+ 102,
4280
+ 105,
4281
+ 103
4282
+ ]
4283
+ }
4284
+ ]
4285
+ }
4286
+ },
4287
+ {
4288
+ "name": "new_dev_wallet"
4289
+ }
4290
+ ],
4291
+ "args": []
4292
+ },
4293
+ {
4294
+ "name": "vault_swap",
4295
+ "docs": [
4296
+ "[V19] Vault-routed Raydium CPMM swap for migrated Torch tokens.",
4297
+ "Controller wallet signs, vault PDA executes. Full custody preserved.",
4298
+ "Handles both buy (SOL→Token) and sell (Token→SOL) via `is_buy` flag."
4299
+ ],
4300
+ "discriminator": [
4301
+ 143,
4302
+ 194,
4303
+ 154,
4304
+ 138,
4305
+ 230,
4306
+ 222,
4307
+ 237,
4308
+ 28
4309
+ ],
4310
+ "accounts": [
4311
+ {
4312
+ "name": "signer",
4313
+ "docs": [
4314
+ "Controller wallet (linked to vault)"
4315
+ ],
4316
+ "writable": true,
4317
+ "signer": true
4318
+ },
4319
+ {
4320
+ "name": "torch_vault",
4321
+ "docs": [
4322
+ "Vault (SOL source/destination)"
4323
+ ],
4324
+ "writable": true,
4325
+ "pda": {
4326
+ "seeds": [
4327
+ {
4328
+ "kind": "const",
4329
+ "value": [
4330
+ 116,
4331
+ 111,
4332
+ 114,
4333
+ 99,
4334
+ 104,
4335
+ 95,
4336
+ 118,
4337
+ 97,
4338
+ 117,
4339
+ 108,
4340
+ 116
4341
+ ]
4342
+ },
4343
+ {
4344
+ "kind": "account",
4345
+ "path": "torch_vault.creator",
4346
+ "account": "TorchVault"
4347
+ }
4348
+ ]
4349
+ }
4350
+ },
4351
+ {
4352
+ "name": "vault_wallet_link",
4353
+ "docs": [
4354
+ "Vault wallet link (proves signer is authorized)"
4355
+ ],
4356
+ "pda": {
4357
+ "seeds": [
4358
+ {
4359
+ "kind": "const",
4360
+ "value": [
4361
+ 118,
4362
+ 97,
4363
+ 117,
4364
+ 108,
4365
+ 116,
4366
+ 95,
4367
+ 119,
4368
+ 97,
4369
+ 108,
4370
+ 108,
4371
+ 101,
4372
+ 116
4373
+ ]
4374
+ },
4375
+ {
4376
+ "kind": "account",
4377
+ "path": "signer"
4378
+ }
4379
+ ]
4380
+ }
4381
+ },
4382
+ {
4383
+ "name": "mint",
4384
+ "docs": [
4385
+ "Token mint (mutable for Token-2022 transfer fee bookkeeping)"
4386
+ ],
4387
+ "writable": true
4388
+ },
4389
+ {
4390
+ "name": "bonding_curve",
4391
+ "docs": [
4392
+ "Bonding curve (validates this is a Torch token + migrated)"
4393
+ ],
4394
+ "pda": {
4395
+ "seeds": [
4396
+ {
4397
+ "kind": "const",
4398
+ "value": [
4399
+ 98,
4400
+ 111,
4401
+ 110,
4402
+ 100,
4403
+ 105,
4404
+ 110,
4405
+ 103,
4406
+ 95,
4407
+ 99,
4408
+ 117,
4409
+ 114,
4410
+ 118,
4411
+ 101
4412
+ ]
4413
+ },
4414
+ {
4415
+ "kind": "account",
4416
+ "path": "mint"
4417
+ }
4418
+ ]
4419
+ }
4420
+ },
4421
+ {
4422
+ "name": "vault_token_account",
4423
+ "docs": [
4424
+ "Vault's token ATA (Token-2022)",
4425
+ "Token source (sell) or destination (buy)"
4426
+ ],
4427
+ "writable": true,
4428
+ "pda": {
4429
+ "seeds": [
4430
+ {
4431
+ "kind": "account",
4432
+ "path": "torch_vault"
4433
+ },
4434
+ {
4435
+ "kind": "account",
4436
+ "path": "token_2022_program"
4437
+ },
4438
+ {
4439
+ "kind": "account",
4440
+ "path": "mint"
4441
+ }
4442
+ ],
4443
+ "program": {
4444
+ "kind": "const",
4445
+ "value": [
4446
+ 140,
4447
+ 151,
4448
+ 37,
4449
+ 143,
4450
+ 78,
4451
+ 36,
4452
+ 137,
4453
+ 241,
4454
+ 187,
4455
+ 61,
4456
+ 16,
4457
+ 41,
4458
+ 20,
4459
+ 142,
4460
+ 13,
4461
+ 131,
4462
+ 11,
4463
+ 90,
4464
+ 19,
4465
+ 153,
4466
+ 218,
4467
+ 255,
4468
+ 16,
4469
+ 132,
4470
+ 4,
4471
+ 142,
4472
+ 123,
4473
+ 216,
4474
+ 219,
4475
+ 233,
4476
+ 248,
4477
+ 89
4478
+ ]
4479
+ }
4480
+ }
4481
+ },
4482
+ {
4483
+ "name": "vault_wsol_account",
4484
+ "docs": [
4485
+ "Vault's WSOL ATA (SPL Token)",
4486
+ "SOL source (buy) or destination (sell)"
4487
+ ],
4488
+ "writable": true
4489
+ },
4490
+ {
4491
+ "name": "raydium_program",
4492
+ "address": "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"
4493
+ },
4494
+ {
4495
+ "name": "raydium_authority"
4496
+ },
4497
+ {
4498
+ "name": "amm_config",
4499
+ "docs": [
4500
+ "Raydium AMM config"
4501
+ ]
4502
+ },
4503
+ {
4504
+ "name": "pool_state",
4505
+ "docs": [
4506
+ "Raydium pool state"
4507
+ ],
4508
+ "writable": true
4509
+ },
4510
+ {
4511
+ "name": "pool_token_vault_0",
4512
+ "docs": [
4513
+ "Pool token vault 0"
4514
+ ],
4515
+ "writable": true
4516
+ },
4517
+ {
4518
+ "name": "pool_token_vault_1",
4519
+ "docs": [
4520
+ "Pool token vault 1"
4521
+ ],
4522
+ "writable": true
4523
+ },
4524
+ {
4525
+ "name": "observation_state",
4526
+ "docs": [
4527
+ "Raydium observation state"
4528
+ ],
4529
+ "writable": true
4530
+ },
4531
+ {
4532
+ "name": "wsol_mint",
4533
+ "docs": [
4534
+ "WSOL mint"
4535
+ ],
4536
+ "address": "So11111111111111111111111111111111111111112"
4537
+ },
4538
+ {
4539
+ "name": "token_program",
4540
+ "docs": [
4541
+ "SPL Token program (for WSOL operations)"
4542
+ ]
4543
+ },
4544
+ {
4545
+ "name": "token_2022_program",
4546
+ "docs": [
4547
+ "Token-2022 program (for Torch token operations)"
4548
+ ]
4549
+ },
4550
+ {
4551
+ "name": "associated_token_program",
4552
+ "docs": [
4553
+ "Associated Token Program (for WSOL ATA creation)"
4554
+ ],
4555
+ "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
4556
+ },
3571
4557
  {
3572
4558
  "name": "system_program",
3573
4559
  "address": "11111111111111111111111111111111"
3574
4560
  }
3575
4561
  ],
3576
- "args": []
3577
- },
3578
- {
3579
- "name": "transfer_authority",
3580
- "docs": [
3581
- "[V14.1] Transfer vault authority to a new wallet.",
3582
- "Does NOT affect wallet links."
3583
- ],
3584
- "discriminator": [
3585
- 48,
3586
- 169,
3587
- 76,
3588
- 72,
3589
- 229,
3590
- 180,
3591
- 55,
3592
- 161
3593
- ],
3594
- "accounts": [
4562
+ "args": [
3595
4563
  {
3596
- "name": "authority",
3597
- "signer": true,
3598
- "relations": [
3599
- "vault"
3600
- ]
4564
+ "name": "amount_in",
4565
+ "type": "u64"
3601
4566
  },
3602
4567
  {
3603
- "name": "vault",
3604
- "writable": true,
3605
- "pda": {
3606
- "seeds": [
3607
- {
3608
- "kind": "const",
3609
- "value": [
3610
- 116,
3611
- 111,
3612
- 114,
3613
- 99,
3614
- 104,
3615
- 95,
3616
- 118,
3617
- 97,
3618
- 117,
3619
- 108,
3620
- 116
3621
- ]
3622
- },
3623
- {
3624
- "kind": "account",
3625
- "path": "vault.creator",
3626
- "account": "TorchVault"
3627
- }
3628
- ]
3629
- }
4568
+ "name": "minimum_amount_out",
4569
+ "type": "u64"
3630
4570
  },
3631
4571
  {
3632
- "name": "new_authority"
4572
+ "name": "is_buy",
4573
+ "type": "bool"
3633
4574
  }
3634
- ],
3635
- "args": []
4575
+ ]
3636
4576
  },
3637
4577
  {
3638
- "name": "unlink_wallet",
4578
+ "name": "withdraw_tokens",
3639
4579
  "docs": [
3640
- "[V14.1] Unlink a wallet from a vault. Authority only.",
3641
- "Closes the VaultWalletLink PDA, returning rent to authority."
4580
+ "[V18] Withdraw tokens from vault ATA. Authority only.",
4581
+ "Composability escape hatch for external DeFi usage."
3642
4582
  ],
3643
4583
  "discriminator": [
3644
- 220,
3645
- 121,
3646
- 97,
3647
- 13,
3648
- 193,
3649
- 137,
3650
- 209,
3651
- 159
4584
+ 2,
4585
+ 4,
4586
+ 225,
4587
+ 61,
4588
+ 19,
4589
+ 182,
4590
+ 106,
4591
+ 170
3652
4592
  ],
3653
4593
  "accounts": [
3654
4594
  {
@@ -3689,98 +4629,85 @@
3689
4629
  }
3690
4630
  },
3691
4631
  {
3692
- "name": "wallet_to_unlink"
4632
+ "name": "mint"
3693
4633
  },
3694
4634
  {
3695
- "name": "wallet_link",
4635
+ "name": "vault_token_account",
4636
+ "docs": [
4637
+ "Vault's token ATA (source)"
4638
+ ],
3696
4639
  "writable": true,
3697
4640
  "pda": {
3698
4641
  "seeds": [
3699
4642
  {
3700
- "kind": "const",
3701
- "value": [
3702
- 118,
3703
- 97,
3704
- 117,
3705
- 108,
3706
- 116,
3707
- 95,
3708
- 119,
3709
- 97,
3710
- 108,
3711
- 108,
3712
- 101,
3713
- 116
3714
- ]
4643
+ "kind": "account",
4644
+ "path": "vault"
3715
4645
  },
3716
4646
  {
3717
4647
  "kind": "account",
3718
- "path": "wallet_to_unlink"
4648
+ "path": "token_program"
4649
+ },
4650
+ {
4651
+ "kind": "account",
4652
+ "path": "mint"
3719
4653
  }
3720
- ]
4654
+ ],
4655
+ "program": {
4656
+ "kind": "const",
4657
+ "value": [
4658
+ 140,
4659
+ 151,
4660
+ 37,
4661
+ 143,
4662
+ 78,
4663
+ 36,
4664
+ 137,
4665
+ 241,
4666
+ 187,
4667
+ 61,
4668
+ 16,
4669
+ 41,
4670
+ 20,
4671
+ 142,
4672
+ 13,
4673
+ 131,
4674
+ 11,
4675
+ 90,
4676
+ 19,
4677
+ 153,
4678
+ 218,
4679
+ 255,
4680
+ 16,
4681
+ 132,
4682
+ 4,
4683
+ 142,
4684
+ 123,
4685
+ 216,
4686
+ 219,
4687
+ 233,
4688
+ 248,
4689
+ 89
4690
+ ]
4691
+ }
3721
4692
  }
3722
4693
  },
3723
4694
  {
3724
- "name": "system_program",
3725
- "address": "11111111111111111111111111111111"
3726
- }
3727
- ],
3728
- "args": []
3729
- },
3730
- {
3731
- "name": "update_dev_wallet",
3732
- "docs": [
3733
- "[V8] Update the dev wallet address."
3734
- ],
3735
- "discriminator": [
3736
- 152,
3737
- 37,
3738
- 243,
3739
- 206,
3740
- 192,
3741
- 150,
3742
- 129,
3743
- 200
3744
- ],
3745
- "accounts": [
3746
- {
3747
- "name": "authority",
3748
- "signer": true,
3749
- "relations": [
3750
- "global_config"
3751
- ]
3752
- },
3753
- {
3754
- "name": "global_config",
3755
- "writable": true,
3756
- "pda": {
3757
- "seeds": [
3758
- {
3759
- "kind": "const",
3760
- "value": [
3761
- 103,
3762
- 108,
3763
- 111,
3764
- 98,
3765
- 97,
3766
- 108,
3767
- 95,
3768
- 99,
3769
- 111,
3770
- 110,
3771
- 102,
3772
- 105,
3773
- 103
3774
- ]
3775
- }
3776
- ]
3777
- }
4695
+ "name": "destination_token_account",
4696
+ "docs": [
4697
+ "Destination token account (any wallet's ATA)"
4698
+ ],
4699
+ "writable": true
3778
4700
  },
3779
4701
  {
3780
- "name": "new_dev_wallet"
4702
+ "name": "token_program"
3781
4703
  }
3782
4704
  ],
3783
- "args": []
4705
+ "args": [
4706
+ {
4707
+ "name": "amount",
4708
+ "type": "u64"
4709
+ }
4710
+ ]
3784
4711
  },
3785
4712
  {
3786
4713
  "name": "withdraw_vault",
@@ -4058,6 +4985,19 @@
4058
4985
  52,
4059
4986
  101
4060
4987
  ]
4988
+ },
4989
+ {
4990
+ "name": "VaultSwapExecuted",
4991
+ "discriminator": [
4992
+ 76,
4993
+ 211,
4994
+ 61,
4995
+ 189,
4996
+ 247,
4997
+ 44,
4998
+ 198,
4999
+ 60
5000
+ ]
4061
5001
  }
4062
5002
  ],
4063
5003
  "errors": [
@@ -4350,6 +5290,11 @@
4350
5290
  "code": 6057,
4351
5291
  "name": "VaultWalletLinkMismatch",
4352
5292
  "msg": "Wallet link does not point to the provided vault"
5293
+ },
5294
+ {
5295
+ "code": 6058,
5296
+ "name": "InvalidWsolAccount",
5297
+ "msg": "Invalid WSOL account - must be vault's WSOL ATA"
4353
5298
  }
4354
5299
  ],
4355
5300
  "types": [
@@ -5196,6 +6141,13 @@
5196
6141
  ],
5197
6142
  "type": "u64"
5198
6143
  },
6144
+ {
6145
+ "name": "total_received",
6146
+ "docs": [
6147
+ "[V18] Lifetime SOL received back (sells, borrow proceeds)"
6148
+ ],
6149
+ "type": "u64"
6150
+ },
5199
6151
  {
5200
6152
  "name": "linked_wallets",
5201
6153
  "docs": [
@@ -5592,6 +6544,38 @@
5592
6544
  ]
5593
6545
  }
5594
6546
  },
6547
+ {
6548
+ "name": "VaultSwapExecuted",
6549
+ "type": {
6550
+ "kind": "struct",
6551
+ "fields": [
6552
+ {
6553
+ "name": "vault",
6554
+ "type": "pubkey"
6555
+ },
6556
+ {
6557
+ "name": "mint",
6558
+ "type": "pubkey"
6559
+ },
6560
+ {
6561
+ "name": "signer",
6562
+ "type": "pubkey"
6563
+ },
6564
+ {
6565
+ "name": "is_buy",
6566
+ "type": "bool"
6567
+ },
6568
+ {
6569
+ "name": "amount_in",
6570
+ "type": "u64"
6571
+ },
6572
+ {
6573
+ "name": "minimum_amount_out",
6574
+ "type": "u64"
6575
+ }
6576
+ ]
6577
+ }
6578
+ },
5595
6579
  {
5596
6580
  "name": "VaultWalletLink",
5597
6581
  "docs": [