IDL diff
376 removals
755 lines
516 additions
900 lines
{
{
"version": "0.1.0",
"address": "id11111111111111111111111111111111111111111",
"name": "idl",
"metadata": {
"name": "idl",
"version": "0.1.0",
"description": "Created with Anchor"
},
"docs": [
"docs": [
"IDL test program documentation."
"IDL test program documentation."
],
],
"constants": [
"instructions": [
{
Text moved to lines 895-897
"name": "U8",
"type": "u8",
"value": "6"
},
{
"name": "I128",
"type": "i128",
"value": "1_000_000"
},
{
{
Text moved to lines 885-887
"name": "BYTE_STR",
"name": "cause_error",
"type": "u8",
"discriminator": [
"value": "116"
67,
104,
37,
17,
2,
155,
68,
17
],
"accounts": [],
"args": []
},
},
{
{
Text moved with changes to lines 880-883 (97.7% similarity)
"name": "BYTES_STR",
"type": "bytes",
"value": "[116, 101, 115, 116]"
}
],
"instructions": [
{
"name": "initialize",
"name": "initialize",
"discriminator": [
175,
175,
109,
31,
13,
152,
155,
237
],
"accounts": [
"accounts": [
{
{
"name": "state",
"name": "state",
"isMut": true,
"isSigner": true,
"docs": [
"docs": [
"State account"
"State account"
]
],
"writable": true,
"signer": true
},
},
{
{
"name": "nested",
"name": "nested",
"accounts": [
"accounts": [
{
{
"name": "clock",
"name": "clock",
"isMut": false,
"isSigner": false,
"docs": [
"docs": [
"Sysvar clock"
"Sysvar clock"
]
],
"address": "SysvarC1ock11111111111111111111111111111111"
},
},
{
{
"name": "rent",
"name": "rent",
"isMut": false,
"address": "SysvarRent111111111111111111111111111111111"
"isSigner": false
}
}
]
]
},
},
{
{
"name": "zcAccount",
"name": "zc_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "tokenAccount",
"name": "token_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "mintAccount",
"name": "mint_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "tokenInterfaceAccount",
"name": "token_interface_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "mintInterfaceAccount",
"name": "mint_interface_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "payer",
"name": "payer",
"isMut": true,
"writable": true,
"isSigner": true
"signer": true
},
},
{
{
"name": "systemProgram",
"name": "system_program",
"isMut": false,
"address": "11111111111111111111111111111111"
"isSigner": false
}
}
],
],
"args": []
"args": []
},
},
{
{
"name": "initializeWithValues",
"name": "initialize_with_values",
"docs": [
"docs": [
"Initializes an account with specified values"
"Initializes an account with specified values"
],
],
"discriminator": [
220,
73,
8,
213,
178,
69,
181,
141
],
"accounts": [
"accounts": [
{
{
"name": "state",
"name": "state",
"isMut": true,
"isSigner": true,
"docs": [
"docs": [
"State account"
"State account"
]
],
"writable": true,
"signer": true
},
},
{
{
"name": "nested",
"name": "nested",
"accounts": [
"accounts": [
{
{
"name": "clock",
"name": "clock",
"isMut": false,
"isSigner": false,
"docs": [
"docs": [
"Sysvar clock"
"Sysvar clock"
]
],
"address": "SysvarC1ock11111111111111111111111111111111"
},
},
{
{
"name": "rent",
"name": "rent",
"isMut": false,
"address": "SysvarRent111111111111111111111111111111111"
"isSigner": false
}
}
]
]
},
},
{
{
"name": "zcAccount",
"name": "zc_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "tokenAccount",
"name": "token_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "mintAccount",
"name": "mint_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "tokenInterfaceAccount",
"name": "token_interface_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "mintInterfaceAccount",
"name": "mint_interface_account"
"isMut": false,
"isSigner": false
},
},
{
{
"name": "payer",
"name": "payer",
"isMut": true,
"writable": true,
"isSigner": true
"signer": true
},
},
{
{
"name": "systemProgram",
"name": "system_program",
"isMut": false,
"address": "11111111111111111111111111111111"
"isSigner": false
}
}
],
],
"args": [
"args": [
{
{
"name": "boolField",
"name": "bool_field",
"type": "bool"
"type": "bool"
},
},
{
{
"name": "u8Field",
"name": "u8_field",
"type": "u8"
"type": "u8"
},
},
{
{
"name": "i8Field",
"name": "i8_field",
"type": "i8"
"type": "i8"
},
},
{
{
"name": "u16Field",
"name": "u16_field",
"type": "u16"
"type": "u16"
},
},
{
{
"name": "i16Field",
"name": "i16_field",
"type": "i16"
"type": "i16"
},
},
{
{
"name": "u32Field",
"name": "u32_field",
"type": "u32"
"type": "u32"
},
},
{
{
"name": "i32Field",
"name": "i32_field",
"type": "i32"
"type": "i32"
},
},
{
{
"name": "f32Field",
"name": "f32_field",
"type": "f32"
"type": "f32"
},
},
{
{
"name": "u64Field",
"name": "u64_field",
"type": "u64"
"type": "u64"
},
},
{
{
"name": "i64Field",
"name": "i64_field",
"type": "i64"
"type": "i64"
},
},
{
{
"name": "f64Field",
"name": "f64_field",
"type": "f64"
"type": "f64"
},
},
{
{
"name": "u128Field",
"name": "u128_field",
"type": "u128"
"type": "u128"
},
},
{
{
"name": "i128Field",
"name": "i128_field",
"type": "i128"
"type": "i128"
},
},
{
{
"name": "bytesField",
"name": "bytes_field",
"type": "bytes"
"type": "bytes"
},
},
{
{
"name": "stringField",
"name": "string_field",
"type": "string"
"type": "string"
},
},
{
{
"name": "pubkeyField",
"name": "pubkey_field",
"type": "publicKey"
"type": "pubkey"
},
},
{
{
"name": "vecField",
"name": "vec_field",
"type": {
"type": {
"vec": "u64"
"vec": "u64"
}
}
},
},
{
{
"name": "vecStructField",
"name": "vec_struct_field",
"type": {
"type": {
"vec": {
"vec": {
"defined": "FooStruct"
"defined": {
"name": "FooStruct"
}
}
}
}
}
},
},
{
{
"name": "optionField",
"name": "option_field",
"type": {
"type": {
"option": "bool"
"option": "bool"
}
}
},
},
{
{
"name": "optionStructField",
"name": "option_struct_field",
"type": {
"type": {
"option": {
"option": {
"defined": "FooStruct"
"defined": {
"name": "FooStruct"
}
}
}
}
}
},
},
{
{
"name": "structField",
"name": "struct_field",
"type": {
"type": {
"defined": "FooStruct"
"defined": {
"name": "FooStruct"
}
}
}
},
},
{
{
"name": "arrayField",
"name": "array_field",
"type": {
"type": {
"array": [
"array": [
"bool",
"bool",
3
3
]
]
}
}
},
},
{
{
"name": "enumField1",
"name": "enum_field_1",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
},
},
{
{
"name": "enumField2",
"name": "enum_field_2",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
},
},
{
{
"name": "enumField3",
"name": "enum_field_3",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
},
},
{
{
"name": "enumField4",
"name": "enum_field_4",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
}
}
]
]
},
},
{
{
"name": "initializeWithValues2",
"name": "initialize_with_values2",
"docs": [
"docs": [
"a separate instruction due to initialize_with_values having too many arguments",
"a separate instruction due to initialize_with_values having too many arguments",
"https://github.com/solana-labs/solana/issues/23978"
"https://github.com/solana-labs/solana/issues/23978"
],
],
"discriminator": [
248,
190,
21,
97,
239,
148,
39,
181
],
"accounts": [
"accounts": [
{
{
"name": "state",
"name": "state",
"isMut": true,
"writable": true,
"isSigner": true
"signer": true
},
},
{
{
"name": "payer",
"name": "payer",
"isMut": true,
"writable": true,
"isSigner": true
"signer": true
},
},
{
{
"name": "systemProgram",
"name": "system_program",
"isMut": false,
"address": "11111111111111111111111111111111"
"isSigner": false
}
}
],
],
"args": [
"args": [
{
{
"name": "vecOfOption",
"name": "vec_of_option",
"type": {
"type": {
"vec": {
"vec": {
"option": "u64"
"option": "u64"
}
}
}
}
},
},
{
{
"name": "boxField",
"name": "box_field",
"type": "bool"
"type": "bool"
}
}
],
],
"returns": {
"returns": {
"defined": "SomeRetStruct"
"defined": {
"name": "SomeRetStruct"
}
}
}
},
{
"name": "causeError",
"accounts": [],
"args": []
}
}
],
],
"accounts": [
"accounts": [
{
{
"name": "SomeZcAccount",
"discriminator": [
56,
72,
82,
194,
210,
35,
17,
191
]
},
{
"name": "State",
"discriminator": [
216,
146,
107,
94,
104,
75,
182,
177
]
},
{
"name": "State2",
"discriminator": [
106,
97,
255,
161,
250,
205,
185,
192
]
}
],
"events": [
{
"name": "SomeEvent",
"discriminator": [
39,
221,
150,
148,
91,
206,
29,
Text moved with changes from lines 735-739 (97.9% similarity)
93
]
}
],
"errors": [
{
Text moved from lines 741-743
"code": 6000,
"name": "SomeError",
"msg": "Example error."
},
{
Text moved from lines 746-748
"code": 6001,
"name": "OtherError",
"msg": "Another error."
},
{
"code": 6002,
"name": "ErrorWithoutMsg"
Text moved with changes from lines 525-529 (98.4% similarity)
}
],
"types": [
{
"name": "BarStruct",
"docs": [
"Bar struct type"
],
"type": {
"kind": "struct",
"fields": [
{
Text moved with changes from lines 549-556 (99.2% similarity)
"name": "some_field",
"docs": [
"Some field"
],
"type": "bool"
},
{
"name": "other_field",
"type": "u8"
}
]
}
Text moved with changes from lines 629-644 (99.0% similarity)
},
{
"name": "FooEnum",
"docs": [
"Enum type"
],
"type": {
"kind": "enum",
"variants": [
{
"name": "Unnamed",
"fields": [
"bool",
"u8",
{
"defined": {
"name": "BarStruct"
}
}
]
},
{
"name": "UnnamedSingle",
"fields": [
{
"defined": {
"name": "BarStruct"
}
}
]
},
{
"name": "Named",
Text moved with changes from lines 656-682 (78.9% similarity)
"fields": [
{
"name": "bool_field",
"docs": [
"A bool field inside a struct tuple kind"
],
"type": "bool"
},
{
"name": "u8_field",
"type": "u8"
},
{
"name": "nested",
"type": {
"defined": {
"name": "BarStruct"
}
}
}
]
},
{
"name": "Struct",
"fields": [
{
"defined": {
"name": "BarStruct"
}
}
]
},
{
"name": "OptionStruct",
"fields": [
{
Text moved with changes from lines 688-701 (90.6% similarity)
"option": {
"defined": {
"name": "BarStruct"
}
}
}
]
},
{
"name": "VecStruct",
"fields": [
{
"vec": {
"defined": {
"name": "BarStruct"
}
}
}
]
},
{
"name": "NoFields"
}
]
}
},
{
Text moved with changes from lines 563-578 (98.9% similarity)
"name": "FooStruct",
"type": {
"kind": "struct",
"fields": [
{
"name": "field1",
"type": "u8"
},
{
"name": "field2",
"type": "u16"
},
{
"name": "nested",
"type": {
"defined": {
"name": "BarStruct"
}
Text moved with changes from lines 579-585 (97.2% similarity)
}
},
{
"name": "vec_nested",
"type": {
"vec": {
"defined": {
"name": "BarStruct"
}
}
}
},
{
"name": "option_nested",
"type": {
"option": {
"defined": {
"name": "BarStruct"
}
}
}
},
{
"name": "enum_field",
"type": {
"defined": {
"name": "FooEnum"
}
Text moved with changes from lines 601-615 (96.2% similarity)
}
}
]
}
},
{
"name": "SomeEvent",
"type": {
"kind": "struct",
"fields": [
{
"name": "bool_field",
"type": "bool"
},
{
"name": "external_my_struct",
"type": {
"defined": {
"name": "external::MyStruct"
}
}
},
{
"name": "other_module_my_struct",
"type": {
"defined": {
"name": "idl::some_other_module::MyStruct"
}
}
}
]
}
},
{
"name": "SomeRetStruct",
"type": {
"kind": "struct",
"fields": [
{
"name": "some_field",
"type": "u8"
}
]
}
},
{
"name": "SomeZcAccount",
"serialization": "bytemuck",
"repr": {
"kind": "c"
},
Text moved with changes from lines 514-520 (97.7% similarity)
"type": {
"kind": "struct",
"fields": [
{
"name": "field",
"type": {
"defined": {
"name": "ZcStruct"
}
}
}
]
}
},
{
"name": "State",
"name": "State",
"docs": [
"docs": [
"An account containing various fields"
"An account containing various fields"
],
],
"type": {
"type": {
"kind": "struct",
"kind": "struct",
"fields": [
"fields": [
{
{
"name": "boolField",
"name": "bool_field",
"docs": [
"docs": [
"A boolean field"
"A boolean field"
],
],
"type": "bool"
"type": "bool"
},
},
{
{
"name": "u8Field",
"name": "u8_field",
"type": "u8"
"type": "u8"
},
},
{
{
"name": "i8Field",
"name": "i8_field",
"type": "i8"
"type": "i8"
},
},
{
{
"name": "u16Field",
"name": "u16_field",
"type": "u16"
"type": "u16"
},
},
{
{
"name": "i16Field",
"name": "i16_field",
"type": "i16"
"type": "i16"
},
},
{
{
"name": "u32Field",
"name": "u32_field",
"type": "u32"
"type": "u32"
},
},
{
{
"name": "i32Field",
"name": "i32_field",
"type": "i32"
"type": "i32"
},
},
{
{
"name": "f32Field",
"name": "f32_field",
"type": "f32"
"type": "f32"
},
},
{
{
"name": "u64Field",
"name": "u64_field",
"type": "u64"
"type": "u64"
},
},
{
{
"name": "i64Field",
"name": "i64_field",
"type": "i64"
"type": "i64"
},
},
{
{
"name": "f64Field",
"name": "f64_field",
"type": "f64"
"type": "f64"
},
},
{
{
"name": "u128Field",
"name": "u128_field",
"type": "u128"
"type": "u128"
},
},
{
{
"name": "i128Field",
"name": "i128_field",
"type": "i128"
"type": "i128"
},
},
{
{
"name": "bytesField",
"name": "bytes_field",
"type": "bytes"
"type": "bytes"
},
},
{
{
"name": "stringField",
"name": "string_field",
"type": "string"
"type": "string"
},
},
{
{
"name": "pubkeyField",
"name": "pubkey_field",
"type": "publicKey"
"type": "pubkey"
},
},
{
{
"name": "vecField",
"name": "vec_field",
"type": {
"type": {
"vec": "u64"
"vec": "u64"
}
}
},
},
{
{
"name": "vecStructField",
"name": "vec_struct_field",
"type": {
"type": {
"vec": {
"vec": {
"defined": "FooStruct"
"defined": {
"name": "FooStruct"
}
}
}
}
}
},
},
{
{
"name": "optionField",
"name": "option_field",
"type": {
"type": {
"option": "bool"
"option": "bool"
}
}
},
},
{
{
"name": "optionStructField",
"name": "option_struct_field",
"type": {
"type": {
"option": {
"option": {
"defined": "FooStruct"
"defined": {
"name": "FooStruct"
}
}
}
}
}
},
},
{
{
"name": "structField",
"name": "struct_field",
"type": {
"type": {
"defined": "FooStruct"
"defined": {
"name": "FooStruct"
}
}
}
},
},
{
{
"name": "arrayField",
"name": "array_field",
"type": {
"type": {
"array": [
"array": [
"bool",
"bool",
3
3
]
]
}
}
},
},
{
{
"name": "enumField1",
"name": "enum_field_1",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
},
},
{
{
"name": "enumField2",
"name": "enum_field_2",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
},
},
{
{
"name": "enumField3",
"name": "enum_field_3",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
},
},
{
{
"name": "enumField4",
"name": "enum_field_4",
"type": {
"type": {
"defined": "FooEnum"
"defined": {
"name": "FooEnum"
}
}
}
}
}
]
]
}
}
},
},
{
{
"name": "State2",
"name": "State2",
"type": {
"type": {
"kind": "struct",
"kind": "struct",
"fields": [
"fields": [
{
{
"name": "vecOfOption",
"name": "vec_of_option",
"type": {
"type": {
"vec": {
"vec": {
"option": "u64"
"option": "u64"
}
}
}
}
},
},
{
{
"name": "boxField",
"name": "box_field",
"type": "bool"
"type": "bool"
}
}
]
]
}
}
},
},
{
{
"name": "SomeZcAccount",
"name": "ZcStruct",
Text moved with changes to lines 644-650 (97.7% similarity)
"type": {
"serialization": "bytemuck",
"kind": "struct",
"repr": {
"fields": [
"kind": "c"
{
},
"name": "field",
"type": {
"defined": "ZcStruct"
}
}
]
}
Text moved with changes to lines 427-431 (98.4% similarity)
}
],
"types": [
{
"name": "MyStruct",
"type": {
"type": {
"kind": "struct",
"kind": "struct",
"fields": [
"fields": [
{
{
"name": "someU8",
"name": "some_field",
"type": "u8"
"type": "u16"
}
}
]
]
}
}
},
},
{
{
"name": "BarStruct",
"name": "external::MyStruct",
"docs": [
"Bar struct type"
],
"type": {
"type": {
"kind": "struct",
"kind": "struct",
"fields": [
"fields": [
{
{
Text moved with changes to lines 439-446 (99.2% similarity)
"name": "someField",
"name": "some_field",
"docs": [
"Some field"
],
"type": "bool"
},
{
"name": "otherField",
"type": "u8"
"type": "u8"
}
}
]
]
}
}
},
},
{
{
Text moved with changes to lines 547-562 (98.9% similarity)
"name": "FooStruct",
"name": "idl::some_other_module::MyStruct",
"type": {
"kind": "struct",
"fields": [
{
"name": "field1",
"type": "u8"
},
{
"name": "field2",
"type": "u16"
},
{
"name": "nested",
"type": {
"defined": "BarStruct"
Text moved with changes to lines 565-571 (97.2% similarity)
}
},
{
"name": "vecNested",
"type": {
"vec": {
"defined": "BarStruct"
}
}
},
{
"name": "optionNested",
"type": {
"option": {
"defined": "BarStruct"
}
}
},
{
"name": "enumField",
"type": {
"defined": "FooEnum"
Text moved with changes to lines 593-607 (96.2% similarity)
}
}
]
}
},
{
"name": "ZcStruct",
"type": {
"kind": "struct",
"fields": [
{
"name": "someField",
"type": "u16"
}
]
}
},
{
"name": "SomeRetStruct",
"type": {
"type": {
"kind": "struct",
"kind": "struct",
"fields": [
"fields": [
{
{
"name": "someField",
"name": "some_u8",
"type": "u8"
"type": "u8"
}
}
]
]
}
}
Text moved with changes to lines 451-466 (99.0% similarity)
},
{
"name": "FooEnum",
"docs": [
"Enum type"
],
"type": {
"kind": "enum",
"variants": [
{
"name": "Unnamed",
"fields": [
"bool",
"u8",
{
"defined": "BarStruct"
}
]
},
{
"name": "UnnamedSingle",
"fields": [
{
"defined": "BarStruct"
}
]
},
Text moved with changes to lines 484-510 (78.9% similarity)
{
"name": "Named",
"fields": [
{
"name": "boolField",
"docs": [
"A bool field inside a struct tuple kind"
],
"type": "bool"
},
{
"name": "u8Field",
"type": "u8"
},
{
"name": "nested",
"type": {
"defined": "BarStruct"
}
}
]
},
{
"name": "Struct",
"fields": [
{
"defined": "BarStruct"
}
]
},
{
"name": "OptionStruct",
Text moved with changes to lines 520-533 (90.6% similarity)
"fields": [
{
"option": {
"defined": "BarStruct"
}
}
]
},
{
"name": "VecStruct",
"fields": [
{
"vec": {
"defined": "BarStruct"
}
}
]
},
{
"name": "NoFields"
}
]
}
}
}
],
],
"events": [
"constants": [
{
{
Text moved with changes from lines 24-27 (97.7% similarity)
"name": "SomeEvent",
"name": "BYTES_STR",
"fields": [
"type": "bytes",
{
"value": "[116, 101, 115, 116]"
"name": "boolField",
},
"type": "bool",
"index": false
},
{
"name": "externalMyStruct",
"type": {
"defined": "external::MyStruct"
},
"index": false
},
{
"name": "otherModuleMyStruct",
"type": {
"defined": "some_other_module::MyStruct"
},
"index": false
Text moved with changes to lines 409-413 (97.9% similarity)
}
]
}
],
"errors": [
{
{
Text moved to lines 415-417
Text moved from lines 19-21
"code": 6000,
"name": "BYTE_STR",
"name": "SomeError",
"type": "u8",
"msg": "Example error."
"value": "116"
},
},
{
{
Text moved to lines 420-422
"code": 6001,
"name": "I128",
"name": "OtherError",
"type": "i128",
"msg": "Another error."
"value": "1000000"
},
},
{
{
Text moved from lines 9-11
"code": 6002,
"name": "U8",
"name": "ErrorWithoutMsg"
"type": "u8",
"value": "6"
}
}
]
]
}
}