@elmntl/vaults-v2 1.1.0 → 1.2.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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "ELE6rYCZUaegWxVhWM4ef9pXZBAgGUVaVKkTbDvX6BMU",
2
+ "address": "BZBw16QMsX6V2NvYw5Sj7oSkJ3stp4U4X9aC7M9g1XCs",
3
3
  "metadata": {
4
4
  "name": "elemental_vault_v2",
5
5
  "version": "2.0.0",
@@ -106,6 +106,61 @@
106
106
  }
107
107
  ]
108
108
  },
109
+ {
110
+ "name": "create_ticket",
111
+ "docs": [
112
+ "Create a withdrawal ticket for a partial or full amount.",
113
+ "Position stays active with remaining balance.",
114
+ "amount=0 creates a yield-only ticket (rewards without capital)."
115
+ ],
116
+ "discriminator": [
117
+ 16,
118
+ 178,
119
+ 122,
120
+ 25,
121
+ 213,
122
+ 85,
123
+ 96,
124
+ 129
125
+ ],
126
+ "accounts": [
127
+ {
128
+ "name": "payer",
129
+ "writable": true,
130
+ "signer": true
131
+ },
132
+ {
133
+ "name": "position_owner",
134
+ "accounts": [
135
+ {
136
+ "name": "owner",
137
+ "signer": true
138
+ },
139
+ {
140
+ "name": "position",
141
+ "writable": true
142
+ },
143
+ {
144
+ "name": "pool",
145
+ "writable": true
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ "name": "ticket",
151
+ "writable": true
152
+ },
153
+ {
154
+ "name": "system_program"
155
+ }
156
+ ],
157
+ "args": [
158
+ {
159
+ "name": "amount",
160
+ "type": "u64"
161
+ }
162
+ ]
163
+ },
109
164
  {
110
165
  "name": "deactivate",
111
166
  "docs": [
@@ -516,6 +571,71 @@
516
571
  }
517
572
  ]
518
573
  },
574
+ {
575
+ "name": "redeem_ticket",
576
+ "docs": [
577
+ "Redeem a matured withdrawal ticket (after 2-epoch cooldown).",
578
+ "Closes the ticket account and transfers vault_mint to user."
579
+ ],
580
+ "discriminator": [
581
+ 129,
582
+ 120,
583
+ 104,
584
+ 224,
585
+ 155,
586
+ 25,
587
+ 22,
588
+ 192
589
+ ],
590
+ "accounts": [
591
+ {
592
+ "name": "owner",
593
+ "signer": true
594
+ },
595
+ {
596
+ "name": "ticket",
597
+ "writable": true
598
+ },
599
+ {
600
+ "name": "position",
601
+ "writable": true
602
+ },
603
+ {
604
+ "name": "pool",
605
+ "writable": true
606
+ },
607
+ {
608
+ "name": "pool_authority"
609
+ },
610
+ {
611
+ "name": "liquidity_faucet",
612
+ "docs": [
613
+ "Faucet holding vault_mint for withdrawals (funded by admin)"
614
+ ],
615
+ "writable": true
616
+ },
617
+ {
618
+ "name": "user_vault_token_account",
619
+ "docs": [
620
+ "User's vault_mint token account (receives withdrawal)"
621
+ ],
622
+ "writable": true
623
+ },
624
+ {
625
+ "name": "vault_mint",
626
+ "docs": [
627
+ "The vault mint (what user receives)"
628
+ ]
629
+ },
630
+ {
631
+ "name": "token_program",
632
+ "docs": [
633
+ "Token program"
634
+ ]
635
+ }
636
+ ],
637
+ "args": []
638
+ },
519
639
  {
520
640
  "name": "transfer_to_faucet",
521
641
  "docs": [
@@ -597,11 +717,15 @@
597
717
  "accounts": [
598
718
  {
599
719
  "name": "admin",
720
+ "writable": true,
600
721
  "signer": true
601
722
  },
602
723
  {
603
724
  "name": "pool",
604
725
  "writable": true
726
+ },
727
+ {
728
+ "name": "system_program"
605
729
  }
606
730
  ],
607
731
  "args": [
@@ -766,6 +890,19 @@
766
890
  247,
767
891
  208
768
892
  ]
893
+ },
894
+ {
895
+ "name": "WithdrawalTicket",
896
+ "discriminator": [
897
+ 92,
898
+ 140,
899
+ 181,
900
+ 69,
901
+ 244,
902
+ 220,
903
+ 233,
904
+ 156
905
+ ]
769
906
  }
770
907
  ],
771
908
  "events": [
@@ -968,6 +1105,16 @@
968
1105
  "code": 6023,
969
1106
  "name": "NoFundsToFlush",
970
1107
  "msg": "No funds available to flush"
1108
+ },
1109
+ {
1110
+ "code": 6024,
1111
+ "name": "TicketModeActive",
1112
+ "msg": "Ticket mode is active - use create_ticket/redeem_ticket"
1113
+ },
1114
+ {
1115
+ "code": 6025,
1116
+ "name": "LegacyDeactivationPending",
1117
+ "msg": "Legacy deactivation pending - complete withdraw before using tickets"
971
1118
  }
972
1119
  ],
973
1120
  "types": [
@@ -1431,13 +1578,18 @@
1431
1578
  "type": "u8"
1432
1579
  },
1433
1580
  {
1434
- "name": "_padding",
1435
- "type": {
1436
- "array": [
1437
- "u8",
1438
- 3
1439
- ]
1440
- }
1581
+ "name": "ticket_mode",
1582
+ "docs": [
1583
+ "Whether this position uses ticket-based withdrawals (1=yes, 0=legacy)"
1584
+ ],
1585
+ "type": "u8"
1586
+ },
1587
+ {
1588
+ "name": "ticket_count",
1589
+ "docs": [
1590
+ "Auto-incrementing counter for ticket PDA derivation"
1591
+ ],
1592
+ "type": "u16"
1441
1593
  },
1442
1594
  {
1443
1595
  "name": "_reserved",
@@ -1577,6 +1729,57 @@
1577
1729
  }
1578
1730
  ]
1579
1731
  }
1732
+ },
1733
+ {
1734
+ "name": "WithdrawalTicket",
1735
+ "type": {
1736
+ "kind": "struct",
1737
+ "fields": [
1738
+ {
1739
+ "name": "pool",
1740
+ "type": "pubkey"
1741
+ },
1742
+ {
1743
+ "name": "owner",
1744
+ "type": "pubkey"
1745
+ },
1746
+ {
1747
+ "name": "amount",
1748
+ "docs": [
1749
+ "Principal amount being withdrawn"
1750
+ ],
1751
+ "type": "u64"
1752
+ },
1753
+ {
1754
+ "name": "reward_amount",
1755
+ "docs": [
1756
+ "Reward amount claimed at ticket creation"
1757
+ ],
1758
+ "type": "u64"
1759
+ },
1760
+ {
1761
+ "name": "created_epoch_index",
1762
+ "docs": [
1763
+ "Epoch index when ticket was created (must wait 2 epochs)"
1764
+ ],
1765
+ "type": "u32"
1766
+ },
1767
+ {
1768
+ "name": "ticket_index",
1769
+ "docs": [
1770
+ "Ticket index for this owner+pool (auto-incremented from position.ticket_count)"
1771
+ ],
1772
+ "type": "u16"
1773
+ },
1774
+ {
1775
+ "name": "bump",
1776
+ "docs": [
1777
+ "Bump seed for PDA"
1778
+ ],
1779
+ "type": "u8"
1780
+ }
1781
+ ]
1782
+ }
1580
1783
  }
1581
1784
  ]
1582
1785
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmntl/vaults-v2",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "SDK for Elemental Vault V2 (ELE6) - Multi-mint vault with swap adapters",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "ELE6rYCZUaegWxVhWM4ef9pXZBAgGUVaVKkTbDvX6BMU",
2
+ "address": "BZBw16QMsX6V2NvYw5Sj7oSkJ3stp4U4X9aC7M9g1XCs",
3
3
  "metadata": {
4
4
  "name": "elemental_vault_v2",
5
5
  "version": "2.0.0",
@@ -106,6 +106,61 @@
106
106
  }
107
107
  ]
108
108
  },
109
+ {
110
+ "name": "create_ticket",
111
+ "docs": [
112
+ "Create a withdrawal ticket for a partial or full amount.",
113
+ "Position stays active with remaining balance.",
114
+ "amount=0 creates a yield-only ticket (rewards without capital)."
115
+ ],
116
+ "discriminator": [
117
+ 16,
118
+ 178,
119
+ 122,
120
+ 25,
121
+ 213,
122
+ 85,
123
+ 96,
124
+ 129
125
+ ],
126
+ "accounts": [
127
+ {
128
+ "name": "payer",
129
+ "writable": true,
130
+ "signer": true
131
+ },
132
+ {
133
+ "name": "position_owner",
134
+ "accounts": [
135
+ {
136
+ "name": "owner",
137
+ "signer": true
138
+ },
139
+ {
140
+ "name": "position",
141
+ "writable": true
142
+ },
143
+ {
144
+ "name": "pool",
145
+ "writable": true
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ "name": "ticket",
151
+ "writable": true
152
+ },
153
+ {
154
+ "name": "system_program"
155
+ }
156
+ ],
157
+ "args": [
158
+ {
159
+ "name": "amount",
160
+ "type": "u64"
161
+ }
162
+ ]
163
+ },
109
164
  {
110
165
  "name": "deactivate",
111
166
  "docs": [
@@ -516,6 +571,71 @@
516
571
  }
517
572
  ]
518
573
  },
574
+ {
575
+ "name": "redeem_ticket",
576
+ "docs": [
577
+ "Redeem a matured withdrawal ticket (after 2-epoch cooldown).",
578
+ "Closes the ticket account and transfers vault_mint to user."
579
+ ],
580
+ "discriminator": [
581
+ 129,
582
+ 120,
583
+ 104,
584
+ 224,
585
+ 155,
586
+ 25,
587
+ 22,
588
+ 192
589
+ ],
590
+ "accounts": [
591
+ {
592
+ "name": "owner",
593
+ "signer": true
594
+ },
595
+ {
596
+ "name": "ticket",
597
+ "writable": true
598
+ },
599
+ {
600
+ "name": "position",
601
+ "writable": true
602
+ },
603
+ {
604
+ "name": "pool",
605
+ "writable": true
606
+ },
607
+ {
608
+ "name": "pool_authority"
609
+ },
610
+ {
611
+ "name": "liquidity_faucet",
612
+ "docs": [
613
+ "Faucet holding vault_mint for withdrawals (funded by admin)"
614
+ ],
615
+ "writable": true
616
+ },
617
+ {
618
+ "name": "user_vault_token_account",
619
+ "docs": [
620
+ "User's vault_mint token account (receives withdrawal)"
621
+ ],
622
+ "writable": true
623
+ },
624
+ {
625
+ "name": "vault_mint",
626
+ "docs": [
627
+ "The vault mint (what user receives)"
628
+ ]
629
+ },
630
+ {
631
+ "name": "token_program",
632
+ "docs": [
633
+ "Token program"
634
+ ]
635
+ }
636
+ ],
637
+ "args": []
638
+ },
519
639
  {
520
640
  "name": "transfer_to_faucet",
521
641
  "docs": [
@@ -597,11 +717,15 @@
597
717
  "accounts": [
598
718
  {
599
719
  "name": "admin",
720
+ "writable": true,
600
721
  "signer": true
601
722
  },
602
723
  {
603
724
  "name": "pool",
604
725
  "writable": true
726
+ },
727
+ {
728
+ "name": "system_program"
605
729
  }
606
730
  ],
607
731
  "args": [
@@ -766,6 +890,19 @@
766
890
  247,
767
891
  208
768
892
  ]
893
+ },
894
+ {
895
+ "name": "WithdrawalTicket",
896
+ "discriminator": [
897
+ 92,
898
+ 140,
899
+ 181,
900
+ 69,
901
+ 244,
902
+ 220,
903
+ 233,
904
+ 156
905
+ ]
769
906
  }
770
907
  ],
771
908
  "events": [
@@ -968,6 +1105,16 @@
968
1105
  "code": 6023,
969
1106
  "name": "NoFundsToFlush",
970
1107
  "msg": "No funds available to flush"
1108
+ },
1109
+ {
1110
+ "code": 6024,
1111
+ "name": "TicketModeActive",
1112
+ "msg": "Ticket mode is active - use create_ticket/redeem_ticket"
1113
+ },
1114
+ {
1115
+ "code": 6025,
1116
+ "name": "LegacyDeactivationPending",
1117
+ "msg": "Legacy deactivation pending - complete withdraw before using tickets"
971
1118
  }
972
1119
  ],
973
1120
  "types": [
@@ -1431,13 +1578,18 @@
1431
1578
  "type": "u8"
1432
1579
  },
1433
1580
  {
1434
- "name": "_padding",
1435
- "type": {
1436
- "array": [
1437
- "u8",
1438
- 3
1439
- ]
1440
- }
1581
+ "name": "ticket_mode",
1582
+ "docs": [
1583
+ "Whether this position uses ticket-based withdrawals (1=yes, 0=legacy)"
1584
+ ],
1585
+ "type": "u8"
1586
+ },
1587
+ {
1588
+ "name": "ticket_count",
1589
+ "docs": [
1590
+ "Auto-incrementing counter for ticket PDA derivation"
1591
+ ],
1592
+ "type": "u16"
1441
1593
  },
1442
1594
  {
1443
1595
  "name": "_reserved",
@@ -1577,6 +1729,57 @@
1577
1729
  }
1578
1730
  ]
1579
1731
  }
1732
+ },
1733
+ {
1734
+ "name": "WithdrawalTicket",
1735
+ "type": {
1736
+ "kind": "struct",
1737
+ "fields": [
1738
+ {
1739
+ "name": "pool",
1740
+ "type": "pubkey"
1741
+ },
1742
+ {
1743
+ "name": "owner",
1744
+ "type": "pubkey"
1745
+ },
1746
+ {
1747
+ "name": "amount",
1748
+ "docs": [
1749
+ "Principal amount being withdrawn"
1750
+ ],
1751
+ "type": "u64"
1752
+ },
1753
+ {
1754
+ "name": "reward_amount",
1755
+ "docs": [
1756
+ "Reward amount claimed at ticket creation"
1757
+ ],
1758
+ "type": "u64"
1759
+ },
1760
+ {
1761
+ "name": "created_epoch_index",
1762
+ "docs": [
1763
+ "Epoch index when ticket was created (must wait 2 epochs)"
1764
+ ],
1765
+ "type": "u32"
1766
+ },
1767
+ {
1768
+ "name": "ticket_index",
1769
+ "docs": [
1770
+ "Ticket index for this owner+pool (auto-incremented from position.ticket_count)"
1771
+ ],
1772
+ "type": "u16"
1773
+ },
1774
+ {
1775
+ "name": "bump",
1776
+ "docs": [
1777
+ "Bump seed for PDA"
1778
+ ],
1779
+ "type": "u8"
1780
+ }
1781
+ ]
1782
+ }
1580
1783
  }
1581
1784
  ]
1582
1785
  }