Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 8e1ca0d

Browse files
committed
Allow native SOL to be represented as a token
1 parent f8f51c1 commit 8e1ca0d

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

token/src/instruction.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,24 @@ pub enum TokenInstruction {
8585
/// 2. `[writable]` Token being burned.
8686
/// 3. Optional: `[writable]` Source account if key 1 is a delegate account.
8787
Burn(u64),
88+
89+
/// Initialize a wrapped SOL token account. The full SOL balance in the uninitialized account
90+
/// will be wrapped.
91+
///
92+
/// The `InitializeWrappedAccount` instruction requires no signers and MUST be included within
93+
/// the Transaction that creates the uninitialized account with the system program. Otherwise
94+
/// another party can acquire ownership of the uninitialized token account.
95+
///
96+
/// 0. `[writable]` An uninitialized token account
97+
/// 1. `[]` Initial owner for the token account.
98+
///
99+
InitializeWrappedAccount,
100+
101+
/// Deallocate and release all native SOL held by a token account
102+
/// 0. `[signer]` Owner of the token account.
103+
/// 1. `[writable]` Token account to release.
104+
/// 2. `[writable]` Destination account to receive the full SOL balance of the account.
105+
ReleaseAccount,
88106
}
89107
impl TokenInstruction {
90108
/// Deserializes a byte buffer into an [TokenInstruction](enum.TokenInstruction.html)

token/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ pub mod instruction;
77
pub mod option;
88
pub mod processor;
99
pub mod state;
10+
pub mod native_token;

token/src/native_token.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
/// The token type for wrapped native SOL
3+
solana_sdk::declare_id!("So11111111111111111111111111111111111111111");

0 commit comments

Comments
 (0)