@neutral-trade/sdk 0.4.8 → 0.4.10

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.
@@ -31,7 +31,7 @@ function createAnchorProvider(connection, wallet) {
31
31
  //#endregion
32
32
  //#region src/idl/ntbundle.json
33
33
  var ntbundle_default = {
34
- address: "5qzXRABspP6QEFKyVddfvp3uGtz9ZGUk5YACZKrZhisK",
34
+ address: "BUNDDh4P5XviMm1f3gCvnq2qKx6TGosAGnoUK12e7cXU",
35
35
  metadata: {
36
36
  "name": "ntbundle",
37
37
  "version": "0.1.0",
@@ -337,6 +337,62 @@ var ntbundle_default = {
337
337
  "type": "u8"
338
338
  }]
339
339
  },
340
+ {
341
+ "name": "clear_user_withdrawal_timing_override",
342
+ "discriminator": [
343
+ 203,
344
+ 96,
345
+ 230,
346
+ 216,
347
+ 217,
348
+ 104,
349
+ 244,
350
+ 74
351
+ ],
352
+ "accounts": [
353
+ {
354
+ "name": "manager",
355
+ "writable": true,
356
+ "signer": true
357
+ },
358
+ { "name": "user_bundle_account_owner" },
359
+ {
360
+ "name": "user_bundle_account",
361
+ "writable": true,
362
+ "pda": { "seeds": [
363
+ {
364
+ "kind": "const",
365
+ "value": [
366
+ 85,
367
+ 83,
368
+ 69,
369
+ 82,
370
+ 95,
371
+ 66,
372
+ 85,
373
+ 78,
374
+ 68,
375
+ 76,
376
+ 69
377
+ ]
378
+ },
379
+ {
380
+ "kind": "account",
381
+ "path": "user_bundle_account_owner"
382
+ },
383
+ {
384
+ "kind": "account",
385
+ "path": "bundle_account"
386
+ }
387
+ ] }
388
+ },
389
+ { "name": "bundle_account" }
390
+ ],
391
+ "args": [{
392
+ "name": "clear_mask",
393
+ "type": "u8"
394
+ }]
395
+ },
340
396
  {
341
397
  "name": "close_user_bundle_account",
342
398
  "discriminator": [
@@ -2299,16 +2355,16 @@ var ntbundle_default = {
2299
2355
  "args": []
2300
2356
  },
2301
2357
  {
2302
- "name": "process_withdrawal",
2358
+ "name": "process_switch",
2303
2359
  "discriminator": [
2304
- 51,
2305
- 97,
2306
- 236,
2307
- 17,
2308
- 37,
2309
- 33,
2310
- 196,
2311
- 64
2360
+ 186,
2361
+ 170,
2362
+ 0,
2363
+ 66,
2364
+ 104,
2365
+ 81,
2366
+ 57,
2367
+ 195
2312
2368
  ],
2313
2369
  "accounts": [
2314
2370
  {
@@ -2326,13 +2382,13 @@ var ntbundle_default = {
2326
2382
  "writable": true
2327
2383
  },
2328
2384
  {
2329
- "name": "bundle_asset_account",
2385
+ "name": "source_bundle_asset_account",
2330
2386
  "writable": true,
2331
2387
  "pda": {
2332
2388
  "seeds": [
2333
2389
  {
2334
2390
  "kind": "account",
2335
- "path": "bundle_asset_authority"
2391
+ "path": "source_bundle_asset_authority"
2336
2392
  },
2337
2393
  {
2338
2394
  "kind": "const",
@@ -2416,49 +2472,7 @@ var ntbundle_default = {
2416
2472
  }
2417
2473
  },
2418
2474
  {
2419
- "name": "pending_bundle_asset_authority",
2420
- "writable": true,
2421
- "pda": { "seeds": [{
2422
- "kind": "const",
2423
- "value": [
2424
- 80,
2425
- 69,
2426
- 78,
2427
- 68,
2428
- 73,
2429
- 78,
2430
- 71,
2431
- 95,
2432
- 66,
2433
- 85,
2434
- 78,
2435
- 68,
2436
- 76,
2437
- 69,
2438
- 95,
2439
- 65,
2440
- 83,
2441
- 83,
2442
- 69,
2443
- 84,
2444
- 95,
2445
- 65,
2446
- 85,
2447
- 84,
2448
- 72,
2449
- 79,
2450
- 82,
2451
- 73,
2452
- 84,
2453
- 89
2454
- ]
2455
- }, {
2456
- "kind": "account",
2457
- "path": "bundle_account"
2458
- }] }
2459
- },
2460
- {
2461
- "name": "user_bundle_account",
2475
+ "name": "source_user_bundle_account",
2462
2476
  "writable": true,
2463
2477
  "pda": { "seeds": [
2464
2478
  {
@@ -2483,16 +2497,16 @@ var ntbundle_default = {
2483
2497
  },
2484
2498
  {
2485
2499
  "kind": "account",
2486
- "path": "bundle_account"
2500
+ "path": "source_bundle_account"
2487
2501
  }
2488
2502
  ] }
2489
2503
  },
2490
2504
  {
2491
- "name": "treasury_account",
2505
+ "name": "source_treasury_account",
2492
2506
  "writable": true
2493
2507
  },
2494
2508
  {
2495
- "name": "bundle_asset_authority",
2509
+ "name": "source_bundle_asset_authority",
2496
2510
  "writable": true,
2497
2511
  "pda": { "seeds": [{
2498
2512
  "kind": "const",
@@ -2522,15 +2536,15 @@ var ntbundle_default = {
2522
2536
  ]
2523
2537
  }, {
2524
2538
  "kind": "account",
2525
- "path": "bundle_account"
2539
+ "path": "source_bundle_account"
2526
2540
  }] }
2527
2541
  },
2528
2542
  {
2529
- "name": "bundle_account",
2543
+ "name": "source_bundle_account",
2530
2544
  "writable": true
2531
2545
  },
2532
2546
  {
2533
- "name": "bundle_temp_data",
2547
+ "name": "source_bundle_temp_data",
2534
2548
  "writable": true,
2535
2549
  "pda": { "seeds": [{
2536
2550
  "kind": "const",
@@ -2554,11 +2568,11 @@ var ntbundle_default = {
2554
2568
  ]
2555
2569
  }, {
2556
2570
  "kind": "account",
2557
- "path": "bundle_account"
2571
+ "path": "source_bundle_account"
2558
2572
  }] }
2559
2573
  },
2560
2574
  {
2561
- "name": "oracle_data",
2575
+ "name": "source_oracle_data",
2562
2576
  "writable": true,
2563
2577
  "pda": { "seeds": [{
2564
2578
  "kind": "const",
@@ -2572,40 +2586,12 @@ var ntbundle_default = {
2572
2586
  ]
2573
2587
  }, {
2574
2588
  "kind": "account",
2575
- "path": "bundle_account"
2589
+ "path": "source_bundle_account"
2576
2590
  }] }
2577
2591
  },
2592
+ { "name": "target_bundle_account" },
2578
2593
  {
2579
- "name": "token_program",
2580
- "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
2581
- },
2582
- {
2583
- "name": "system_program",
2584
- "address": "11111111111111111111111111111111"
2585
- }
2586
- ],
2587
- "args": []
2588
- },
2589
- {
2590
- "name": "refund_deposit",
2591
- "discriminator": [
2592
- 19,
2593
- 19,
2594
- 78,
2595
- 50,
2596
- 187,
2597
- 10,
2598
- 162,
2599
- 229
2600
- ],
2601
- "accounts": [
2602
- {
2603
- "name": "keeper",
2604
- "writable": true,
2605
- "signer": true
2606
- },
2607
- {
2608
- "name": "user_bundle_account",
2594
+ "name": "target_user_bundle_account",
2609
2595
  "writable": true,
2610
2596
  "pda": { "seeds": [
2611
2597
  {
@@ -2630,30 +2616,46 @@ var ntbundle_default = {
2630
2616
  },
2631
2617
  {
2632
2618
  "kind": "account",
2633
- "path": "bundle_account"
2619
+ "path": "target_bundle_account"
2634
2620
  }
2635
2621
  ] }
2636
2622
  },
2637
2623
  {
2638
- "name": "user_bundle_account_owner",
2639
- "docs": ["the owner of the pending request (for event purposes)."]
2640
- },
2641
- {
2642
- "name": "user_token_account",
2643
- "writable": true
2644
- },
2645
- {
2646
- "name": "asset_address",
2647
- "writable": true
2624
+ "name": "target_bundle_temp_data",
2625
+ "writable": true,
2626
+ "pda": { "seeds": [{
2627
+ "kind": "const",
2628
+ "value": [
2629
+ 66,
2630
+ 85,
2631
+ 78,
2632
+ 68,
2633
+ 76,
2634
+ 69,
2635
+ 95,
2636
+ 84,
2637
+ 69,
2638
+ 77,
2639
+ 80,
2640
+ 95,
2641
+ 68,
2642
+ 65,
2643
+ 84,
2644
+ 65
2645
+ ]
2646
+ }, {
2647
+ "kind": "account",
2648
+ "path": "target_bundle_account"
2649
+ }] }
2648
2650
  },
2649
2651
  {
2650
- "name": "bundle_asset_account",
2652
+ "name": "target_pending_deposit_token_account",
2651
2653
  "writable": true,
2652
2654
  "pda": {
2653
2655
  "seeds": [
2654
2656
  {
2655
2657
  "kind": "account",
2656
- "path": "bundle_asset_authority"
2658
+ "path": "target_pending_bundle_asset_authority"
2657
2659
  },
2658
2660
  {
2659
2661
  "kind": "const",
@@ -2737,11 +2739,18 @@ var ntbundle_default = {
2737
2739
  }
2738
2740
  },
2739
2741
  {
2740
- "name": "bundle_asset_authority",
2741
- "writable": true,
2742
+ "name": "target_pending_bundle_asset_authority",
2742
2743
  "pda": { "seeds": [{
2743
2744
  "kind": "const",
2744
2745
  "value": [
2746
+ 80,
2747
+ 69,
2748
+ 78,
2749
+ 68,
2750
+ 73,
2751
+ 78,
2752
+ 71,
2753
+ 95,
2745
2754
  66,
2746
2755
  85,
2747
2756
  78,
@@ -2767,41 +2776,30 @@ var ntbundle_default = {
2767
2776
  ]
2768
2777
  }, {
2769
2778
  "kind": "account",
2770
- "path": "bundle_account"
2779
+ "path": "target_bundle_account"
2771
2780
  }] }
2772
2781
  },
2773
2782
  {
2774
- "name": "bundle_account",
2775
- "writable": true
2776
- },
2777
- {
2778
- "name": "bundle_temp_data",
2779
- "writable": true,
2783
+ "name": "target_oracle_data",
2780
2784
  "pda": { "seeds": [{
2781
2785
  "kind": "const",
2782
2786
  "value": [
2783
- 66,
2784
- 85,
2785
- 78,
2786
- 68,
2787
- 76,
2788
- 69,
2789
- 95,
2790
- 84,
2791
- 69,
2792
- 77,
2793
- 80,
2794
- 95,
2795
- 68,
2787
+ 79,
2788
+ 82,
2796
2789
  65,
2797
- 84,
2798
- 65
2790
+ 67,
2791
+ 76,
2792
+ 69
2799
2793
  ]
2800
2794
  }, {
2801
2795
  "kind": "account",
2802
- "path": "bundle_account"
2796
+ "path": "target_bundle_account"
2803
2797
  }] }
2804
2798
  },
2799
+ {
2800
+ "name": "target_treasury_account",
2801
+ "writable": true
2802
+ },
2805
2803
  {
2806
2804
  "name": "token_program",
2807
2805
  "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
@@ -2814,32 +2812,547 @@ var ntbundle_default = {
2814
2812
  "args": []
2815
2813
  },
2816
2814
  {
2817
- "name": "remove_strategy",
2815
+ "name": "process_withdrawal",
2818
2816
  "discriminator": [
2819
- 185,
2820
- 238,
2821
- 33,
2822
- 91,
2823
- 134,
2824
- 210,
2817
+ 51,
2825
2818
  97,
2826
- 26
2819
+ 236,
2820
+ 17,
2821
+ 37,
2822
+ 33,
2823
+ 196,
2824
+ 64
2827
2825
  ],
2828
2826
  "accounts": [
2829
2827
  {
2830
- "name": "manager",
2828
+ "name": "keeper",
2831
2829
  "writable": true,
2832
2830
  "signer": true
2833
2831
  },
2832
+ { "name": "user_bundle_account_owner" },
2834
2833
  {
2835
- "name": "strategy_account",
2836
- "writable": true,
2837
- "pda": { "seeds": [
2838
- {
2839
- "kind": "const",
2840
- "value": [
2841
- 83,
2842
- 84,
2834
+ "name": "user_token_account",
2835
+ "writable": true
2836
+ },
2837
+ {
2838
+ "name": "asset_address",
2839
+ "writable": true
2840
+ },
2841
+ {
2842
+ "name": "bundle_asset_account",
2843
+ "writable": true,
2844
+ "pda": {
2845
+ "seeds": [
2846
+ {
2847
+ "kind": "account",
2848
+ "path": "bundle_asset_authority"
2849
+ },
2850
+ {
2851
+ "kind": "const",
2852
+ "value": [
2853
+ 6,
2854
+ 221,
2855
+ 246,
2856
+ 225,
2857
+ 215,
2858
+ 101,
2859
+ 161,
2860
+ 147,
2861
+ 217,
2862
+ 203,
2863
+ 225,
2864
+ 70,
2865
+ 206,
2866
+ 235,
2867
+ 121,
2868
+ 172,
2869
+ 28,
2870
+ 180,
2871
+ 133,
2872
+ 237,
2873
+ 95,
2874
+ 91,
2875
+ 55,
2876
+ 145,
2877
+ 58,
2878
+ 140,
2879
+ 245,
2880
+ 133,
2881
+ 126,
2882
+ 255,
2883
+ 0,
2884
+ 169
2885
+ ]
2886
+ },
2887
+ {
2888
+ "kind": "account",
2889
+ "path": "asset_address"
2890
+ }
2891
+ ],
2892
+ "program": {
2893
+ "kind": "const",
2894
+ "value": [
2895
+ 140,
2896
+ 151,
2897
+ 37,
2898
+ 143,
2899
+ 78,
2900
+ 36,
2901
+ 137,
2902
+ 241,
2903
+ 187,
2904
+ 61,
2905
+ 16,
2906
+ 41,
2907
+ 20,
2908
+ 142,
2909
+ 13,
2910
+ 131,
2911
+ 11,
2912
+ 90,
2913
+ 19,
2914
+ 153,
2915
+ 218,
2916
+ 255,
2917
+ 16,
2918
+ 132,
2919
+ 4,
2920
+ 142,
2921
+ 123,
2922
+ 216,
2923
+ 219,
2924
+ 233,
2925
+ 248,
2926
+ 89
2927
+ ]
2928
+ }
2929
+ }
2930
+ },
2931
+ {
2932
+ "name": "pending_bundle_asset_authority",
2933
+ "writable": true,
2934
+ "pda": { "seeds": [{
2935
+ "kind": "const",
2936
+ "value": [
2937
+ 80,
2938
+ 69,
2939
+ 78,
2940
+ 68,
2941
+ 73,
2942
+ 78,
2943
+ 71,
2944
+ 95,
2945
+ 66,
2946
+ 85,
2947
+ 78,
2948
+ 68,
2949
+ 76,
2950
+ 69,
2951
+ 95,
2952
+ 65,
2953
+ 83,
2954
+ 83,
2955
+ 69,
2956
+ 84,
2957
+ 95,
2958
+ 65,
2959
+ 85,
2960
+ 84,
2961
+ 72,
2962
+ 79,
2963
+ 82,
2964
+ 73,
2965
+ 84,
2966
+ 89
2967
+ ]
2968
+ }, {
2969
+ "kind": "account",
2970
+ "path": "bundle_account"
2971
+ }] }
2972
+ },
2973
+ {
2974
+ "name": "user_bundle_account",
2975
+ "writable": true,
2976
+ "pda": { "seeds": [
2977
+ {
2978
+ "kind": "const",
2979
+ "value": [
2980
+ 85,
2981
+ 83,
2982
+ 69,
2983
+ 82,
2984
+ 95,
2985
+ 66,
2986
+ 85,
2987
+ 78,
2988
+ 68,
2989
+ 76,
2990
+ 69
2991
+ ]
2992
+ },
2993
+ {
2994
+ "kind": "account",
2995
+ "path": "user_bundle_account_owner"
2996
+ },
2997
+ {
2998
+ "kind": "account",
2999
+ "path": "bundle_account"
3000
+ }
3001
+ ] }
3002
+ },
3003
+ {
3004
+ "name": "treasury_account",
3005
+ "writable": true
3006
+ },
3007
+ {
3008
+ "name": "bundle_asset_authority",
3009
+ "writable": true,
3010
+ "pda": { "seeds": [{
3011
+ "kind": "const",
3012
+ "value": [
3013
+ 66,
3014
+ 85,
3015
+ 78,
3016
+ 68,
3017
+ 76,
3018
+ 69,
3019
+ 95,
3020
+ 65,
3021
+ 83,
3022
+ 83,
3023
+ 69,
3024
+ 84,
3025
+ 95,
3026
+ 65,
3027
+ 85,
3028
+ 84,
3029
+ 72,
3030
+ 79,
3031
+ 82,
3032
+ 73,
3033
+ 84,
3034
+ 89
3035
+ ]
3036
+ }, {
3037
+ "kind": "account",
3038
+ "path": "bundle_account"
3039
+ }] }
3040
+ },
3041
+ {
3042
+ "name": "bundle_account",
3043
+ "writable": true
3044
+ },
3045
+ {
3046
+ "name": "bundle_temp_data",
3047
+ "writable": true,
3048
+ "pda": { "seeds": [{
3049
+ "kind": "const",
3050
+ "value": [
3051
+ 66,
3052
+ 85,
3053
+ 78,
3054
+ 68,
3055
+ 76,
3056
+ 69,
3057
+ 95,
3058
+ 84,
3059
+ 69,
3060
+ 77,
3061
+ 80,
3062
+ 95,
3063
+ 68,
3064
+ 65,
3065
+ 84,
3066
+ 65
3067
+ ]
3068
+ }, {
3069
+ "kind": "account",
3070
+ "path": "bundle_account"
3071
+ }] }
3072
+ },
3073
+ {
3074
+ "name": "oracle_data",
3075
+ "writable": true,
3076
+ "pda": { "seeds": [{
3077
+ "kind": "const",
3078
+ "value": [
3079
+ 79,
3080
+ 82,
3081
+ 65,
3082
+ 67,
3083
+ 76,
3084
+ 69
3085
+ ]
3086
+ }, {
3087
+ "kind": "account",
3088
+ "path": "bundle_account"
3089
+ }] }
3090
+ },
3091
+ {
3092
+ "name": "token_program",
3093
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
3094
+ },
3095
+ {
3096
+ "name": "system_program",
3097
+ "address": "11111111111111111111111111111111"
3098
+ }
3099
+ ],
3100
+ "args": []
3101
+ },
3102
+ {
3103
+ "name": "refund_deposit",
3104
+ "discriminator": [
3105
+ 19,
3106
+ 19,
3107
+ 78,
3108
+ 50,
3109
+ 187,
3110
+ 10,
3111
+ 162,
3112
+ 229
3113
+ ],
3114
+ "accounts": [
3115
+ {
3116
+ "name": "keeper",
3117
+ "writable": true,
3118
+ "signer": true
3119
+ },
3120
+ {
3121
+ "name": "user_bundle_account",
3122
+ "writable": true,
3123
+ "pda": { "seeds": [
3124
+ {
3125
+ "kind": "const",
3126
+ "value": [
3127
+ 85,
3128
+ 83,
3129
+ 69,
3130
+ 82,
3131
+ 95,
3132
+ 66,
3133
+ 85,
3134
+ 78,
3135
+ 68,
3136
+ 76,
3137
+ 69
3138
+ ]
3139
+ },
3140
+ {
3141
+ "kind": "account",
3142
+ "path": "user_bundle_account_owner"
3143
+ },
3144
+ {
3145
+ "kind": "account",
3146
+ "path": "bundle_account"
3147
+ }
3148
+ ] }
3149
+ },
3150
+ {
3151
+ "name": "user_bundle_account_owner",
3152
+ "docs": ["the owner of the pending request (for event purposes)."]
3153
+ },
3154
+ {
3155
+ "name": "user_token_account",
3156
+ "writable": true
3157
+ },
3158
+ {
3159
+ "name": "asset_address",
3160
+ "writable": true
3161
+ },
3162
+ {
3163
+ "name": "bundle_asset_account",
3164
+ "writable": true,
3165
+ "pda": {
3166
+ "seeds": [
3167
+ {
3168
+ "kind": "account",
3169
+ "path": "bundle_asset_authority"
3170
+ },
3171
+ {
3172
+ "kind": "const",
3173
+ "value": [
3174
+ 6,
3175
+ 221,
3176
+ 246,
3177
+ 225,
3178
+ 215,
3179
+ 101,
3180
+ 161,
3181
+ 147,
3182
+ 217,
3183
+ 203,
3184
+ 225,
3185
+ 70,
3186
+ 206,
3187
+ 235,
3188
+ 121,
3189
+ 172,
3190
+ 28,
3191
+ 180,
3192
+ 133,
3193
+ 237,
3194
+ 95,
3195
+ 91,
3196
+ 55,
3197
+ 145,
3198
+ 58,
3199
+ 140,
3200
+ 245,
3201
+ 133,
3202
+ 126,
3203
+ 255,
3204
+ 0,
3205
+ 169
3206
+ ]
3207
+ },
3208
+ {
3209
+ "kind": "account",
3210
+ "path": "asset_address"
3211
+ }
3212
+ ],
3213
+ "program": {
3214
+ "kind": "const",
3215
+ "value": [
3216
+ 140,
3217
+ 151,
3218
+ 37,
3219
+ 143,
3220
+ 78,
3221
+ 36,
3222
+ 137,
3223
+ 241,
3224
+ 187,
3225
+ 61,
3226
+ 16,
3227
+ 41,
3228
+ 20,
3229
+ 142,
3230
+ 13,
3231
+ 131,
3232
+ 11,
3233
+ 90,
3234
+ 19,
3235
+ 153,
3236
+ 218,
3237
+ 255,
3238
+ 16,
3239
+ 132,
3240
+ 4,
3241
+ 142,
3242
+ 123,
3243
+ 216,
3244
+ 219,
3245
+ 233,
3246
+ 248,
3247
+ 89
3248
+ ]
3249
+ }
3250
+ }
3251
+ },
3252
+ {
3253
+ "name": "bundle_asset_authority",
3254
+ "writable": true,
3255
+ "pda": { "seeds": [{
3256
+ "kind": "const",
3257
+ "value": [
3258
+ 66,
3259
+ 85,
3260
+ 78,
3261
+ 68,
3262
+ 76,
3263
+ 69,
3264
+ 95,
3265
+ 65,
3266
+ 83,
3267
+ 83,
3268
+ 69,
3269
+ 84,
3270
+ 95,
3271
+ 65,
3272
+ 85,
3273
+ 84,
3274
+ 72,
3275
+ 79,
3276
+ 82,
3277
+ 73,
3278
+ 84,
3279
+ 89
3280
+ ]
3281
+ }, {
3282
+ "kind": "account",
3283
+ "path": "bundle_account"
3284
+ }] }
3285
+ },
3286
+ {
3287
+ "name": "bundle_account",
3288
+ "writable": true
3289
+ },
3290
+ {
3291
+ "name": "bundle_temp_data",
3292
+ "writable": true,
3293
+ "pda": { "seeds": [{
3294
+ "kind": "const",
3295
+ "value": [
3296
+ 66,
3297
+ 85,
3298
+ 78,
3299
+ 68,
3300
+ 76,
3301
+ 69,
3302
+ 95,
3303
+ 84,
3304
+ 69,
3305
+ 77,
3306
+ 80,
3307
+ 95,
3308
+ 68,
3309
+ 65,
3310
+ 84,
3311
+ 65
3312
+ ]
3313
+ }, {
3314
+ "kind": "account",
3315
+ "path": "bundle_account"
3316
+ }] }
3317
+ },
3318
+ {
3319
+ "name": "token_program",
3320
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
3321
+ },
3322
+ {
3323
+ "name": "system_program",
3324
+ "address": "11111111111111111111111111111111"
3325
+ }
3326
+ ],
3327
+ "args": []
3328
+ },
3329
+ {
3330
+ "name": "remove_strategy",
3331
+ "discriminator": [
3332
+ 185,
3333
+ 238,
3334
+ 33,
3335
+ 91,
3336
+ 134,
3337
+ 210,
3338
+ 97,
3339
+ 26
3340
+ ],
3341
+ "accounts": [
3342
+ {
3343
+ "name": "manager",
3344
+ "writable": true,
3345
+ "signer": true
3346
+ },
3347
+ {
3348
+ "name": "strategy_account",
3349
+ "writable": true,
3350
+ "pda": { "seeds": [
3351
+ {
3352
+ "kind": "const",
3353
+ "value": [
3354
+ 83,
3355
+ 84,
2843
3356
  82,
2844
3357
  65,
2845
3358
  84,
@@ -2873,6 +3386,158 @@ var ntbundle_default = {
2873
3386
  ],
2874
3387
  "args": []
2875
3388
  },
3389
+ {
3390
+ "name": "request_bundle_switch",
3391
+ "discriminator": [
3392
+ 66,
3393
+ 9,
3394
+ 104,
3395
+ 111,
3396
+ 227,
3397
+ 251,
3398
+ 51,
3399
+ 176
3400
+ ],
3401
+ "accounts": [
3402
+ {
3403
+ "name": "withdrawal_request",
3404
+ "accounts": [
3405
+ {
3406
+ "name": "user",
3407
+ "writable": true,
3408
+ "signer": true
3409
+ },
3410
+ {
3411
+ "name": "user_bundle_account",
3412
+ "writable": true,
3413
+ "pda": { "seeds": [
3414
+ {
3415
+ "kind": "const",
3416
+ "value": [
3417
+ 85,
3418
+ 83,
3419
+ 69,
3420
+ 82,
3421
+ 95,
3422
+ 66,
3423
+ 85,
3424
+ 78,
3425
+ 68,
3426
+ 76,
3427
+ 69
3428
+ ]
3429
+ },
3430
+ {
3431
+ "kind": "account",
3432
+ "path": "user"
3433
+ },
3434
+ {
3435
+ "kind": "account",
3436
+ "path": "bundle_account"
3437
+ }
3438
+ ] }
3439
+ },
3440
+ {
3441
+ "name": "bundle_account",
3442
+ "writable": true
3443
+ },
3444
+ {
3445
+ "name": "oracle_data",
3446
+ "writable": true,
3447
+ "pda": { "seeds": [{
3448
+ "kind": "const",
3449
+ "value": [
3450
+ 79,
3451
+ 82,
3452
+ 65,
3453
+ 67,
3454
+ 76,
3455
+ 69
3456
+ ]
3457
+ }, {
3458
+ "kind": "account",
3459
+ "path": "bundle_account"
3460
+ }] }
3461
+ },
3462
+ {
3463
+ "name": "bundle_temp_data",
3464
+ "writable": true,
3465
+ "pda": { "seeds": [{
3466
+ "kind": "const",
3467
+ "value": [
3468
+ 66,
3469
+ 85,
3470
+ 78,
3471
+ 68,
3472
+ 76,
3473
+ 69,
3474
+ 95,
3475
+ 84,
3476
+ 69,
3477
+ 77,
3478
+ 80,
3479
+ 95,
3480
+ 68,
3481
+ 65,
3482
+ 84,
3483
+ 65
3484
+ ]
3485
+ }, {
3486
+ "kind": "account",
3487
+ "path": "bundle_account"
3488
+ }] }
3489
+ },
3490
+ {
3491
+ "name": "token_program",
3492
+ "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
3493
+ },
3494
+ {
3495
+ "name": "system_program",
3496
+ "address": "11111111111111111111111111111111"
3497
+ },
3498
+ {
3499
+ "name": "rent",
3500
+ "address": "SysvarRent111111111111111111111111111111111"
3501
+ }
3502
+ ]
3503
+ },
3504
+ { "name": "target_bundle_account" },
3505
+ {
3506
+ "name": "target_user_bundle_account",
3507
+ "pda": { "seeds": [
3508
+ {
3509
+ "kind": "const",
3510
+ "value": [
3511
+ 85,
3512
+ 83,
3513
+ 69,
3514
+ 82,
3515
+ 95,
3516
+ 66,
3517
+ 85,
3518
+ 78,
3519
+ 68,
3520
+ 76,
3521
+ 69
3522
+ ]
3523
+ },
3524
+ {
3525
+ "kind": "account",
3526
+ "path": "withdrawal_request.user",
3527
+ "account": "RequestWithdrawal"
3528
+ },
3529
+ {
3530
+ "kind": "account",
3531
+ "path": "target_bundle_account"
3532
+ }
3533
+ ] }
3534
+ }
3535
+ ],
3536
+ "args": [{
3537
+ "name": "shares_amount",
3538
+ "type": "u128"
3539
+ }]
3540
+ },
2876
3541
  {
2877
3542
  "name": "request_deposit",
2878
3543
  "discriminator": [
@@ -3631,6 +4296,80 @@ var ntbundle_default = {
3631
4296
  }
3632
4297
  ]
3633
4298
  },
4299
+ {
4300
+ "name": "set_user_withdrawal_timing_override",
4301
+ "discriminator": [
4302
+ 21,
4303
+ 31,
4304
+ 116,
4305
+ 121,
4306
+ 140,
4307
+ 237,
4308
+ 174,
4309
+ 244
4310
+ ],
4311
+ "accounts": [
4312
+ {
4313
+ "name": "manager",
4314
+ "writable": true,
4315
+ "signer": true
4316
+ },
4317
+ { "name": "user_bundle_account_owner" },
4318
+ {
4319
+ "name": "user_bundle_account",
4320
+ "writable": true,
4321
+ "pda": { "seeds": [
4322
+ {
4323
+ "kind": "const",
4324
+ "value": [
4325
+ 85,
4326
+ 83,
4327
+ 69,
4328
+ 82,
4329
+ 95,
4330
+ 66,
4331
+ 85,
4332
+ 78,
4333
+ 68,
4334
+ 76,
4335
+ 69
4336
+ ]
4337
+ },
4338
+ {
4339
+ "kind": "account",
4340
+ "path": "user_bundle_account_owner"
4341
+ },
4342
+ {
4343
+ "kind": "account",
4344
+ "path": "bundle_account"
4345
+ }
4346
+ ] }
4347
+ },
4348
+ { "name": "bundle_account" }
4349
+ ],
4350
+ "args": [
4351
+ {
4352
+ "name": "override_mask",
4353
+ "type": "u8"
4354
+ },
4355
+ {
4356
+ "name": "custom_withdrawal_delay",
4357
+ "type": "u64"
4358
+ },
4359
+ {
4360
+ "name": "custom_withdrawal_t_min",
4361
+ "type": "i64"
4362
+ },
4363
+ {
4364
+ "name": "custom_withdrawal_t_max",
4365
+ "type": "i64"
4366
+ },
4367
+ {
4368
+ "name": "custom_withdrawal_curve",
4369
+ "type": "f32"
4370
+ }
4371
+ ]
4372
+ },
3634
4373
  {
3635
4374
  "name": "set_withdrawal_redemption_schedule",
3636
4375
  "discriminator": [
@@ -4082,6 +4821,45 @@ var ntbundle_default = {
4082
4821
  208
4083
4822
  ]
4084
4823
  },
4824
+ {
4825
+ "name": "BundleSwitchCompleted",
4826
+ "discriminator": [
4827
+ 189,
4828
+ 237,
4829
+ 164,
4830
+ 90,
4831
+ 103,
4832
+ 174,
4833
+ 64,
4834
+ 73
4835
+ ]
4836
+ },
4837
+ {
4838
+ "name": "BundleSwitchFallbackToWallet",
4839
+ "discriminator": [
4840
+ 214,
4841
+ 242,
4842
+ 67,
4843
+ 218,
4844
+ 119,
4845
+ 180,
4846
+ 28,
4847
+ 139
4848
+ ]
4849
+ },
4850
+ {
4851
+ "name": "BundleSwitchRequested",
4852
+ "discriminator": [
4853
+ 88,
4854
+ 172,
4855
+ 46,
4856
+ 180,
4857
+ 196,
4858
+ 3,
4859
+ 226,
4860
+ 44
4861
+ ]
4862
+ },
4085
4863
  {
4086
4864
  "name": "ChangedCoreParams",
4087
4865
  "discriminator": [
@@ -4511,6 +5289,32 @@ var ntbundle_default = {
4511
5289
  66
4512
5290
  ]
4513
5291
  },
5292
+ {
5293
+ "name": "UserWithdrawalTimingOverrideCleared",
5294
+ "discriminator": [
5295
+ 78,
5296
+ 111,
5297
+ 250,
5298
+ 12,
5299
+ 64,
5300
+ 54,
5301
+ 226,
5302
+ 251
5303
+ ]
5304
+ },
5305
+ {
5306
+ "name": "UserWithdrawalTimingOverrideSet",
5307
+ "discriminator": [
5308
+ 119,
5309
+ 165,
5310
+ 226,
5311
+ 212,
5312
+ 49,
5313
+ 249,
5314
+ 115,
5315
+ 145
5316
+ ]
5317
+ },
4514
5318
  {
4515
5319
  "name": "VaultNeutralFeeIncrementerSet",
4516
5320
  "discriminator": [
@@ -4934,6 +5738,51 @@ var ntbundle_default = {
4934
5738
  "code": 6073,
4935
5739
  "name": "NoUserFeeOverrideToClear",
4936
5740
  "msg": "No user fee override to clear"
5741
+ },
5742
+ {
5743
+ "code": 6074,
5744
+ "name": "InvalidUserWithdrawalTimingConfig",
5745
+ "msg": "Invalid user withdrawal timing configuration"
5746
+ },
5747
+ {
5748
+ "code": 6075,
5749
+ "name": "EmptyUserWithdrawalTimingClearRequest",
5750
+ "msg": "Empty user withdrawal timing clear request"
5751
+ },
5752
+ {
5753
+ "code": 6076,
5754
+ "name": "NoUserWithdrawalTimingOverrideToClear",
5755
+ "msg": "No user withdrawal timing override to clear"
5756
+ },
5757
+ {
5758
+ "code": 6077,
5759
+ "name": "SwitchTargetSameAsSource",
5760
+ "msg": "Switch target cannot be source bundle"
5761
+ },
5762
+ {
5763
+ "code": 6078,
5764
+ "name": "SwitchAssetMintMismatch",
5765
+ "msg": "Switch asset mint mismatch"
5766
+ },
5767
+ {
5768
+ "code": 6079,
5769
+ "name": "SwitchAlreadyActive",
5770
+ "msg": "Switch already active"
5771
+ },
5772
+ {
5773
+ "code": 6080,
5774
+ "name": "NoPendingSwitch",
5775
+ "msg": "No pending switch"
5776
+ },
5777
+ {
5778
+ "code": 6081,
5779
+ "name": "SwitchTargetAccountsMissing",
5780
+ "msg": "Switch target accounts missing"
5781
+ },
5782
+ {
5783
+ "code": 6082,
5784
+ "name": "SwitchTargetAccountMismatch",
5785
+ "msg": "Switch target account mismatch"
4937
5786
  }
4938
5787
  ],
4939
5788
  types: [
@@ -5090,145 +5939,305 @@ var ntbundle_default = {
5090
5939
  "type": "u32"
5091
5940
  },
5092
5941
  {
5093
- "name": "oracle_buffer",
5094
- "type": "u64"
5942
+ "name": "oracle_buffer",
5943
+ "type": "u64"
5944
+ },
5945
+ {
5946
+ "name": "total_shares",
5947
+ "type": "u128"
5948
+ },
5949
+ {
5950
+ "name": "asset_precision",
5951
+ "type": "u64"
5952
+ },
5953
+ {
5954
+ "name": "asset_address",
5955
+ "type": "pubkey"
5956
+ },
5957
+ {
5958
+ "name": "asset_decimals",
5959
+ "type": "u8"
5960
+ },
5961
+ {
5962
+ "name": "withdrawal_t_min",
5963
+ "type": "i64"
5964
+ },
5965
+ {
5966
+ "name": "withdrawal_t_max",
5967
+ "type": "i64"
5968
+ },
5969
+ {
5970
+ "name": "withdrawal_curve",
5971
+ "type": "f32"
5972
+ },
5973
+ {
5974
+ "name": "permissionned",
5975
+ "type": "bool"
5976
+ },
5977
+ {
5978
+ "name": "manager_mfee_shares",
5979
+ "type": "u128"
5980
+ },
5981
+ {
5982
+ "name": "min_deposit_amount",
5983
+ "type": "u64"
5984
+ },
5985
+ {
5986
+ "name": "oracle_update_time_limit",
5987
+ "type": "i64"
5988
+ },
5989
+ {
5990
+ "name": "oracle_max_age",
5991
+ "type": "i64"
5992
+ },
5993
+ {
5994
+ "name": "withdrawal_redemption_request_cutoff_ts",
5995
+ "type": "i64"
5996
+ },
5997
+ {
5998
+ "name": "withdrawal_redemption_unlock_current_cycle_ts",
5999
+ "type": "i64"
6000
+ },
6001
+ {
6002
+ "name": "withdrawal_redemption_unlock_next_cycle_ts",
6003
+ "type": "i64"
6004
+ },
6005
+ {
6006
+ "name": "padding",
6007
+ "type": { "array": ["u8", 207] }
6008
+ }
6009
+ ]
6010
+ }
6011
+ },
6012
+ {
6013
+ "name": "BundleCreatorAccount",
6014
+ "type": {
6015
+ "kind": "struct",
6016
+ "fields": [{
6017
+ "name": "allowed",
6018
+ "type": "bool"
6019
+ }, {
6020
+ "name": "padding",
6021
+ "type": { "array": ["u8", 64] }
6022
+ }]
6023
+ }
6024
+ },
6025
+ {
6026
+ "name": "BundleCreatorAccountChanged",
6027
+ "type": {
6028
+ "kind": "struct",
6029
+ "fields": [{
6030
+ "name": "creator",
6031
+ "type": "pubkey"
6032
+ }, {
6033
+ "name": "allowed",
6034
+ "type": "bool"
6035
+ }]
6036
+ }
6037
+ },
6038
+ {
6039
+ "name": "BundleDepositorInitialized",
6040
+ "type": {
6041
+ "kind": "struct",
6042
+ "fields": [{
6043
+ "name": "bundle_depositor",
6044
+ "type": "pubkey"
6045
+ }]
6046
+ }
6047
+ },
6048
+ {
6049
+ "name": "BundleMasterAccount",
6050
+ "type": {
6051
+ "kind": "struct",
6052
+ "fields": [{
6053
+ "name": "admin",
6054
+ "type": "pubkey"
6055
+ }, {
6056
+ "name": "padding",
6057
+ "type": { "array": ["u8", 96] }
6058
+ }]
6059
+ }
6060
+ },
6061
+ {
6062
+ "name": "BundleMasterAccountInitialized",
6063
+ "type": {
6064
+ "kind": "struct",
6065
+ "fields": [{
6066
+ "name": "admin",
6067
+ "type": "pubkey"
6068
+ }]
6069
+ }
6070
+ },
6071
+ {
6072
+ "name": "BundleMasterAdminChanged",
6073
+ "type": {
6074
+ "kind": "struct",
6075
+ "fields": [{
6076
+ "name": "new_admin",
6077
+ "type": "pubkey"
6078
+ }]
6079
+ }
6080
+ },
6081
+ {
6082
+ "name": "BundleSwitchCompleted",
6083
+ "type": {
6084
+ "kind": "struct",
6085
+ "fields": [
6086
+ {
6087
+ "name": "user",
6088
+ "type": "pubkey"
6089
+ },
6090
+ {
6091
+ "name": "source_bundle",
6092
+ "type": "pubkey"
6093
+ },
6094
+ {
6095
+ "name": "target_bundle",
6096
+ "type": "pubkey"
6097
+ },
6098
+ {
6099
+ "name": "shares_redeemed",
6100
+ "type": "u128"
6101
+ },
6102
+ {
6103
+ "name": "gross_redemption",
6104
+ "type": "u64"
6105
+ },
6106
+ {
6107
+ "name": "net_to_destination",
6108
+ "type": "u64"
6109
+ },
6110
+ {
6111
+ "name": "net_credited_to_destination",
6112
+ "type": "u64"
6113
+ },
6114
+ {
6115
+ "name": "withdrawal_fee_a",
6116
+ "type": "u64"
6117
+ },
6118
+ {
6119
+ "name": "deposit_fee_b",
6120
+ "type": "u64"
6121
+ },
6122
+ {
6123
+ "name": "share_price",
6124
+ "type": "u128"
6125
+ },
6126
+ {
6127
+ "name": "user_shares_before",
6128
+ "type": "u128"
6129
+ },
6130
+ {
6131
+ "name": "user_shares_after",
6132
+ "type": "u128"
6133
+ },
6134
+ {
6135
+ "name": "total_shares_before",
6136
+ "type": "u128"
6137
+ },
6138
+ {
6139
+ "name": "total_shares_after",
6140
+ "type": "u128"
6141
+ },
6142
+ {
6143
+ "name": "timestamp",
6144
+ "type": "i64"
6145
+ }
6146
+ ]
6147
+ }
6148
+ },
6149
+ {
6150
+ "name": "BundleSwitchFallbackToWallet",
6151
+ "type": {
6152
+ "kind": "struct",
6153
+ "fields": [
6154
+ {
6155
+ "name": "user",
6156
+ "type": "pubkey"
6157
+ },
6158
+ {
6159
+ "name": "source_bundle",
6160
+ "type": "pubkey"
6161
+ },
6162
+ {
6163
+ "name": "target_bundle",
6164
+ "type": "pubkey"
6165
+ },
6166
+ {
6167
+ "name": "shares_redeemed",
6168
+ "type": "u128"
5095
6169
  },
5096
6170
  {
5097
- "name": "total_shares",
5098
- "type": "u128"
6171
+ "name": "gross_redemption",
6172
+ "type": "u64"
5099
6173
  },
5100
6174
  {
5101
- "name": "asset_precision",
6175
+ "name": "net_to_wallet",
5102
6176
  "type": "u64"
5103
6177
  },
5104
6178
  {
5105
- "name": "asset_address",
5106
- "type": "pubkey"
6179
+ "name": "withdrawal_fee_a",
6180
+ "type": "u64"
5107
6181
  },
5108
6182
  {
5109
- "name": "asset_decimals",
6183
+ "name": "reason",
5110
6184
  "type": "u8"
5111
6185
  },
5112
6186
  {
5113
- "name": "withdrawal_t_min",
6187
+ "name": "timestamp",
5114
6188
  "type": "i64"
5115
- },
6189
+ }
6190
+ ]
6191
+ }
6192
+ },
6193
+ {
6194
+ "name": "BundleSwitchRequested",
6195
+ "type": {
6196
+ "kind": "struct",
6197
+ "fields": [
5116
6198
  {
5117
- "name": "withdrawal_t_max",
5118
- "type": "i64"
6199
+ "name": "user",
6200
+ "type": "pubkey"
5119
6201
  },
5120
6202
  {
5121
- "name": "withdrawal_curve",
5122
- "type": "f32"
6203
+ "name": "source_bundle",
6204
+ "type": "pubkey"
5123
6205
  },
5124
6206
  {
5125
- "name": "permissionned",
5126
- "type": "bool"
6207
+ "name": "target_bundle",
6208
+ "type": "pubkey"
5127
6209
  },
5128
6210
  {
5129
- "name": "manager_mfee_shares",
6211
+ "name": "shares_amount",
5130
6212
  "type": "u128"
5131
6213
  },
5132
6214
  {
5133
- "name": "min_deposit_amount",
6215
+ "name": "estimated_gross_redemption",
5134
6216
  "type": "u64"
5135
6217
  },
5136
6218
  {
5137
- "name": "oracle_update_time_limit",
5138
- "type": "i64"
6219
+ "name": "estimated_net_to_destination",
6220
+ "type": "u64"
5139
6221
  },
5140
6222
  {
5141
- "name": "oracle_max_age",
5142
- "type": "i64"
6223
+ "name": "estimated_destination_deposit_fee",
6224
+ "type": "u64"
5143
6225
  },
5144
6226
  {
5145
- "name": "withdrawal_redemption_request_cutoff_ts",
5146
- "type": "i64"
6227
+ "name": "estimated_destination_pending_deposit",
6228
+ "type": "u64"
5147
6229
  },
5148
6230
  {
5149
- "name": "withdrawal_redemption_unlock_current_cycle_ts",
6231
+ "name": "cooldown_end_timestamp",
5150
6232
  "type": "i64"
5151
6233
  },
5152
6234
  {
5153
- "name": "withdrawal_redemption_unlock_next_cycle_ts",
6235
+ "name": "timestamp",
5154
6236
  "type": "i64"
5155
- },
5156
- {
5157
- "name": "padding",
5158
- "type": { "array": ["u8", 207] }
5159
6237
  }
5160
6238
  ]
5161
6239
  }
5162
6240
  },
5163
- {
5164
- "name": "BundleCreatorAccount",
5165
- "type": {
5166
- "kind": "struct",
5167
- "fields": [{
5168
- "name": "allowed",
5169
- "type": "bool"
5170
- }, {
5171
- "name": "padding",
5172
- "type": { "array": ["u8", 64] }
5173
- }]
5174
- }
5175
- },
5176
- {
5177
- "name": "BundleCreatorAccountChanged",
5178
- "type": {
5179
- "kind": "struct",
5180
- "fields": [{
5181
- "name": "creator",
5182
- "type": "pubkey"
5183
- }, {
5184
- "name": "allowed",
5185
- "type": "bool"
5186
- }]
5187
- }
5188
- },
5189
- {
5190
- "name": "BundleDepositorInitialized",
5191
- "type": {
5192
- "kind": "struct",
5193
- "fields": [{
5194
- "name": "bundle_depositor",
5195
- "type": "pubkey"
5196
- }]
5197
- }
5198
- },
5199
- {
5200
- "name": "BundleMasterAccount",
5201
- "type": {
5202
- "kind": "struct",
5203
- "fields": [{
5204
- "name": "admin",
5205
- "type": "pubkey"
5206
- }, {
5207
- "name": "padding",
5208
- "type": { "array": ["u8", 96] }
5209
- }]
5210
- }
5211
- },
5212
- {
5213
- "name": "BundleMasterAccountInitialized",
5214
- "type": {
5215
- "kind": "struct",
5216
- "fields": [{
5217
- "name": "admin",
5218
- "type": "pubkey"
5219
- }]
5220
- }
5221
- },
5222
- {
5223
- "name": "BundleMasterAdminChanged",
5224
- "type": {
5225
- "kind": "struct",
5226
- "fields": [{
5227
- "name": "new_admin",
5228
- "type": "pubkey"
5229
- }]
5230
- }
5231
- },
5232
6241
  {
5233
6242
  "name": "BundleTempData",
5234
6243
  "type": {
@@ -5948,9 +6957,41 @@ var ntbundle_default = {
5948
6957
  "name": "fee_override_flags",
5949
6958
  "type": "u8"
5950
6959
  },
6960
+ {
6961
+ "name": "custom_withdrawal_delay",
6962
+ "type": "u64"
6963
+ },
6964
+ {
6965
+ "name": "custom_withdrawal_t_min",
6966
+ "type": "i64"
6967
+ },
6968
+ {
6969
+ "name": "custom_withdrawal_t_max",
6970
+ "type": "i64"
6971
+ },
6972
+ {
6973
+ "name": "custom_withdrawal_curve",
6974
+ "type": "f32"
6975
+ },
6976
+ {
6977
+ "name": "withdrawal_timing_override_flags",
6978
+ "type": "u8"
6979
+ },
6980
+ {
6981
+ "name": "switch_active",
6982
+ "type": "bool"
6983
+ },
6984
+ {
6985
+ "name": "switch_target_bundle",
6986
+ "type": "pubkey"
6987
+ },
6988
+ {
6989
+ "name": "switch_created_at",
6990
+ "type": "i64"
6991
+ },
5951
6992
  {
5952
6993
  "name": "padding",
5953
- "type": { "array": ["u8", 247] }
6994
+ "type": { "array": ["u8", 177] }
5954
6995
  }
5955
6996
  ]
5956
6997
  }
@@ -6063,6 +7104,94 @@ var ntbundle_default = {
6063
7104
  ]
6064
7105
  }
6065
7106
  },
7107
+ {
7108
+ "name": "UserWithdrawalTimingOverrideCleared",
7109
+ "type": {
7110
+ "kind": "struct",
7111
+ "fields": [
7112
+ {
7113
+ "name": "manager",
7114
+ "type": "pubkey"
7115
+ },
7116
+ {
7117
+ "name": "user",
7118
+ "type": "pubkey"
7119
+ },
7120
+ {
7121
+ "name": "bundle_account_key",
7122
+ "type": "pubkey"
7123
+ },
7124
+ {
7125
+ "name": "clear_mask",
7126
+ "type": "u8"
7127
+ },
7128
+ {
7129
+ "name": "previous_flags",
7130
+ "type": "u8"
7131
+ },
7132
+ {
7133
+ "name": "new_flags",
7134
+ "type": "u8"
7135
+ },
7136
+ {
7137
+ "name": "timestamp",
7138
+ "type": "i64"
7139
+ }
7140
+ ]
7141
+ }
7142
+ },
7143
+ {
7144
+ "name": "UserWithdrawalTimingOverrideSet",
7145
+ "type": {
7146
+ "kind": "struct",
7147
+ "fields": [
7148
+ {
7149
+ "name": "manager",
7150
+ "type": "pubkey"
7151
+ },
7152
+ {
7153
+ "name": "user",
7154
+ "type": "pubkey"
7155
+ },
7156
+ {
7157
+ "name": "bundle_account_key",
7158
+ "type": "pubkey"
7159
+ },
7160
+ {
7161
+ "name": "override_mask",
7162
+ "type": "u8"
7163
+ },
7164
+ {
7165
+ "name": "previous_flags",
7166
+ "type": "u8"
7167
+ },
7168
+ {
7169
+ "name": "new_flags",
7170
+ "type": "u8"
7171
+ },
7172
+ {
7173
+ "name": "custom_withdrawal_delay",
7174
+ "type": "u64"
7175
+ },
7176
+ {
7177
+ "name": "custom_withdrawal_t_min",
7178
+ "type": "i64"
7179
+ },
7180
+ {
7181
+ "name": "custom_withdrawal_t_max",
7182
+ "type": "i64"
7183
+ },
7184
+ {
7185
+ "name": "custom_withdrawal_curve",
7186
+ "type": "f32"
7187
+ },
7188
+ {
7189
+ "name": "timestamp",
7190
+ "type": "i64"
7191
+ }
7192
+ ]
7193
+ }
7194
+ },
6066
7195
  {
6067
7196
  "name": "VaultNeutralFeeIncrementerSet",
6068
7197
  "type": {
@@ -11909,14 +13038,23 @@ function createBundleProgramById(provider, programId) {
11909
13038
  //#endregion
11910
13039
  //#region src/registry/vaults.devnet.json
11911
13040
  var vaults_devnet_default = [{
11912
- "vaultId": 100000001,
11913
- "name": "Dev1",
13041
+ "vaultId": 100000002,
13042
+ "name": "bundle-1",
11914
13043
  "type": "Bundle",
11915
13044
  "category": "Market Neutral",
11916
13045
  "vaultAddress": "HXvKAH4QyYMe7MsxC88pb19MhhYCEDHai87E8tZkmXmB",
11917
13046
  "depositToken": "USDC",
11918
13047
  "pointsMultiplier": 1,
11919
13048
  "pointsEnabled": true
13049
+ }, {
13050
+ "vaultId": 100000003,
13051
+ "name": "bundle-2",
13052
+ "type": "Bundle",
13053
+ "category": "Market Neutral",
13054
+ "vaultAddress": "6nRRXv7GzreuE1PUgHySf9u6wwzXq61eiQbBpik1fbjy",
13055
+ "depositToken": "USDC",
13056
+ "pointsMultiplier": 1,
13057
+ "pointsEnabled": true
11920
13058
  }];
11921
13059
 
11922
13060
  //#endregion
@@ -13162,6 +14300,59 @@ async function buildBundleRequestWithdrawInstructionWithVault({ bundleProgram, b
13162
14300
  rent: SYSVAR_RENT_PUBKEY
13163
14301
  }).instruction();
13164
14302
  }
14303
+ function assertSwitchVaultPair(sourceVault, targetVault, bundleCluster) {
14304
+ assertBundleVault(sourceVault);
14305
+ assertBundleVault(targetVault);
14306
+ if (sourceVault.vaultId === targetVault.vaultId) throw new Error("Source and target vault must differ");
14307
+ if (sourceVault.vaultAddress === targetVault.vaultAddress) throw new Error("Source and target bundle must differ");
14308
+ if (sourceVault.depositToken !== targetVault.depositToken) throw new Error(`Switch requires the same deposit token: source=${sourceVault.depositToken}, target=${targetVault.depositToken}`);
14309
+ if (bundleProgramIdForVault(sourceVault, bundleCluster) !== bundleProgramIdForVault(targetVault, bundleCluster)) throw new Error("Source and target vault must use the same bundle program");
14310
+ }
14311
+ /**
14312
+ * `requestBundleSwitch` only. Fetches source bundle, oracle, user bundle, and target bundle internally.
14313
+ * @internal
14314
+ */
14315
+ async function buildBundleRequestSwitchInstructionWithVault({ bundleProgram, bundleCluster = "mainnet", sourceVault, targetVault, user, amountRaw }) {
14316
+ assertSwitchVaultPair(sourceVault, targetVault, bundleCluster);
14317
+ const sourceBundlePDA = new PublicKey(sourceVault.vaultAddress);
14318
+ const targetBundlePDA = new PublicKey(targetVault.vaultAddress);
14319
+ const programId = bundleProgramIdForVault(sourceVault, bundleCluster);
14320
+ if (programId !== bundleProgram.programId.toBase58()) throw new Error(`Vault ${sourceVault.vaultId} program id mismatch: vault=${programId}, client=${bundleProgram.programId.toBase58()}`);
14321
+ const programPk = bundleProgram.programId;
14322
+ const oraclePDA = deriveOraclePDA(sourceBundlePDA, programPk);
14323
+ const userPDA = deriveUserPDA(user, sourceBundlePDA, programPk);
14324
+ const tempDataPDA = deriveTempDataPDA(sourceBundlePDA, programPk);
14325
+ const targetUserPDA = deriveUserPDA(user, targetBundlePDA, programPk);
14326
+ const [sourceBundleAccount, oracleData, userBundle, targetBundleAccount] = await Promise.all([
14327
+ bundleProgram.account.bundle.fetch(sourceBundlePDA),
14328
+ bundleProgram.account.oracleData.fetch(oraclePDA),
14329
+ bundleProgram.account.userBundleAccount.fetch(userPDA),
14330
+ bundleProgram.account.bundle.fetch(targetBundlePDA)
14331
+ ]);
14332
+ if (sourceBundleAccount.assetAddress.toBase58() !== targetBundleAccount.assetAddress.toBase58()) throw new Error("Switch requires the same asset mint on-chain");
14333
+ const totalEquity = BigInt(oracleData.averageExternalEquity.toString()) + BigInt(sourceBundleAccount.bundleUnderlyingBalance.toString());
14334
+ const totalShares = BigInt(sourceBundleAccount.totalShares.toString());
14335
+ const sharesAmount = computeRequestWithdrawalSharesFromAmountRaw({
14336
+ amountRaw: parseAmountRawToBigInt(amountRaw),
14337
+ userShares: new BN(userBundle.shares.toString()),
14338
+ totalEquity,
14339
+ totalShares
14340
+ });
14341
+ return await bundleProgram.methods.requestBundleSwitch(sharesAmount).accounts({
14342
+ withdrawalRequest: {
14343
+ user,
14344
+ userBundleAccount: userPDA,
14345
+ bundleAccount: sourceBundlePDA,
14346
+ oracleData: oraclePDA,
14347
+ bundleTempData: tempDataPDA,
14348
+ tokenProgram: TOKEN_PROGRAM_ID,
14349
+ systemProgram: SystemProgram.programId,
14350
+ rent: SYSVAR_RENT_PUBKEY
14351
+ },
14352
+ targetBundleAccount: targetBundlePDA,
14353
+ targetUserBundleAccount: targetUserPDA
14354
+ }).instruction();
14355
+ }
13165
14356
 
13166
14357
  //#endregion
13167
14358
  //#region src/utils/bundle-instructions.ts
@@ -13203,6 +14394,22 @@ async function buildBundleRequestWithdrawInstruction({ connection, bundleCluster
13203
14394
  amountRaw
13204
14395
  });
13205
14396
  }
14397
+ /**
14398
+ * `requestBundleSwitch` for built-in registry vaults (source → target, same deposit token).
14399
+ */
14400
+ async function buildBundleRequestSwitchInstruction({ connection, bundleCluster = "mainnet", sourceVaultId, targetVaultId, user, amountRaw }) {
14401
+ const { vault: sourceVault, programId } = resolveTrustedBundleVault(sourceVaultId, bundleCluster);
14402
+ const { vault: targetVault, programId: targetProgramId } = resolveTrustedBundleVault(targetVaultId, bundleCluster);
14403
+ if (targetProgramId !== programId) throw new Error("Source and target vault must use the same bundle program");
14404
+ return buildBundleRequestSwitchInstructionWithVault({
14405
+ bundleProgram: createAllowlistedBundleProgram(createAnchorProvider(connection), programId, bundleCluster),
14406
+ bundleCluster,
14407
+ sourceVault,
14408
+ targetVault,
14409
+ user,
14410
+ amountRaw
14411
+ });
14412
+ }
13206
14413
 
13207
14414
  //#endregion
13208
14415
  //#region src/utils/price.ts
@@ -13320,4 +14527,4 @@ function getBundleProgramForVault(core, vaultId, cluster) {
13320
14527
  }
13321
14528
 
13322
14529
  //#endregion
13323
- export { SupportedChain as A, createAllowlistedBundleProgram as B, getVaultById as C, vaultsDevnet as D, vaults as E, ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER as F, getDefaultBundleProgramIdByCluster as H, BUNDLE_PROGRAM_ID_V2_MAINNET as I, DEFAULT_BUNDLE_PROGRAM_ID_DEVNET as L, getSolanaTokenDecimals as M, getSolanaTokenMint as N, VaultCategory as O, tokens as P, DEFAULT_BUNDLE_PROGRAM_ID_MAINNET as R, getVaultByAddress as S, isValidVaultAddress as T, isAllowlistedBundleProgramId as U, createBundleProgramById as V, createDummyWallet as W, deriveUserPDA as _, buildBundleDepositInstructions as a, parseAmountRawToBigInt as b, buildBundleRequestWithdrawInstructionWithVault as c, SEED_PENDING_AUTH as d, SEED_TEMP as f, deriveTempDataPDA as g, derivePendingAuthPDA as h, initNeutralTradeCore as i, SupportedToken as j, VaultType as k, computeRequestWithdrawalSharesFromAmountRaw as l, deriveOraclePDA as m, buildRequestWithdrawInstructionForVaultId as n, buildBundleRequestWithdrawInstruction as o, SEED_USER as p, getBundleProgramForVault as r, buildBundleDepositInstructionsWithVault as s, buildDepositInstructionsForVaultId as t, SEED_ORACLE as u, getVaultDepositorAddressSync as v, getVaultRegistry as w, getBundleProgramId as x, humanFloatToAmountRawString as y, assertAllowlistedBundleProgramId as z };
14530
+ export { VaultCategory as A, DEFAULT_BUNDLE_PROGRAM_ID_MAINNET as B, getBundleProgramId as C, isValidVaultAddress as D, getVaultRegistry as E, getSolanaTokenMint as F, isAllowlistedBundleProgramId as G, createAllowlistedBundleProgram as H, tokens as I, createDummyWallet as K, ALLOWLISTED_BUNDLE_PROGRAM_IDS_BY_CLUSTER as L, SupportedChain as M, SupportedToken as N, vaults as O, getSolanaTokenDecimals as P, BUNDLE_PROGRAM_ID_V2_MAINNET as R, parseAmountRawToBigInt as S, getVaultById as T, createBundleProgramById as U, assertAllowlistedBundleProgramId as V, getDefaultBundleProgramIdByCluster as W, derivePendingAuthPDA as _, buildBundleDepositInstructions as a, getVaultDepositorAddressSync as b, buildBundleDepositInstructionsWithVault as c, computeRequestWithdrawalSharesFromAmountRaw as d, SEED_ORACLE as f, deriveOraclePDA as g, SEED_USER as h, initNeutralTradeCore as i, VaultType as j, vaultsDevnet as k, buildBundleRequestSwitchInstructionWithVault as l, SEED_TEMP as m, buildRequestWithdrawInstructionForVaultId as n, buildBundleRequestSwitchInstruction as o, SEED_PENDING_AUTH as p, getBundleProgramForVault as r, buildBundleRequestWithdrawInstruction as s, buildDepositInstructionsForVaultId as t, buildBundleRequestWithdrawInstructionWithVault as u, deriveTempDataPDA as v, getVaultByAddress as w, humanFloatToAmountRawString as x, deriveUserPDA as y, DEFAULT_BUNDLE_PROGRAM_ID_DEVNET as z };