pub struct Idl {
pub address: String,
pub instructions: Vec<IdlInstructionsItem>,
pub metadata: Option<IdlMetadata>,
pub types: Vec<Map<String, Value>>,
}
Expand description
IDL Specification following Anchor’s IDL format v0.30+.
JSON schema
{
"description": "IDL Specification following Anchor's IDL format v0.30+.",
"type": "object",
"required": [
"address",
"instructions"
],
"properties": {
"address": {
"description": "The program address.",
"examples": [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
],
"type": "string"
},
"instructions": {
"description": "List of program instructions.",
"examples": [
[
{
"accounts": [
{
"name": "mint",
"writable": true
},
{
"name": "rent"
}
],
"args": [
{
"name": "amount",
"type": "u64"
},
{
"name": "decimals",
"type": "u8"
}
],
"discriminator": [
119,
250,
202,
24,
253,
135,
244,
121
],
"name": "transfer_checked"
}
]
],
"type": "array",
"items": {
"type": "object",
"required": [
"args",
"discriminator",
"name"
],
"properties": {
"accounts": {
"description": "Optional list of accounts required by the instruction.",
"type": "array",
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"description": "The account name.",
"examples": [
"mint"
],
"type": "string"
},
"signer": {
"description": "Whether the account must be a signer.",
"examples": [
false
],
"type": "boolean"
},
"writable": {
"description": "Whether the account is writable.",
"examples": [
true
],
"type": "boolean"
}
}
}
},
"args": {
"description": "List of instruction arguments.",
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"type"
],
"properties": {
"name": {
"description": "The argument name.",
"examples": [
"amount"
],
"type": "string"
},
"type": {
"description": "The argument type.",
"examples": [
"u64"
],
"type": "string"
}
}
}
},
"discriminator": {
"description": "Array of 8 numbers representing the instruction discriminator.",
"examples": [
[
119,
250,
202,
24,
253,
135,
244,
121
]
],
"type": "array",
"items": {
"type": "integer",
"maximum": 255.0,
"minimum": 0.0
},
"maxItems": 8,
"minItems": 8
},
"name": {
"description": "The instruction name.",
"examples": [
"transfer_checked"
],
"type": "string"
}
}
}
},
"metadata": {
"description": "Optional metadata about the IDL.",
"examples": [
{
"name": "system_program",
"spec": "0.1.0",
"version": "0.1.0"
}
],
"type": "object",
"properties": {
"name": {
"description": "The program name.",
"examples": [
"system_program"
],
"type": "string"
},
"spec": {
"description": "The IDL specification version.",
"examples": [
"0.1.0"
],
"type": "string"
},
"version": {
"description": "The program version.",
"examples": [
"0.1.0"
],
"type": "string"
}
}
},
"types": {
"description": "Optional type definitions for custom data structures used in the program.",
"examples": [
[
{
"fields": [
{
"name": "id",
"type": "u64"
},
{
"name": "owner",
"type": "pubkey"
}
],
"name": "MyStruct",
"type": "struct"
}
]
],
"type": "array",
"items": {
"type": "object"
}
}
},
"x-audience": "public"
}
Fields§
§address: String
The program address.
instructions: Vec<IdlInstructionsItem>
List of program instructions.
metadata: Option<IdlMetadata>
§types: Vec<Map<String, Value>>
Optional type definitions for custom data structures used in the program.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Idl
impl<'de> Deserialize<'de> for Idl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Idl> for SolDataCriterionIdlsItem
impl From<Idl> for SolDataCriterionIdlsItem
Auto Trait Implementations§
impl Freeze for Idl
impl RefUnwindSafe for Idl
impl Send for Idl
impl Sync for Idl
impl Unpin for Idl
impl UnwindSafe for Idl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more