UNPKG

@civic/sol-did-idl

Version:

The official Solana IDL for did:sol

1,042 lines (1,041 loc) 32.9 kB
{ "address": "didso1Dpqpm4CsiCjzP766BGY89CAdD6ZBL68cRhFPc", "metadata": { "name": "sol_did", "version": "3.3.0", "spec": "0.1.0", "description": "Martin Riedel", "repository": "https://github.com/identity-com/sol-did" }, "instructions": [ { "name": "add_service", "discriminator": [ 133, 207, 106, 32, 91, 111, 153, 30 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "service", "type": { "defined": { "name": "Service" } } }, { "name": "allow_overwrite", "type": "bool" }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "add_verification_method", "discriminator": [ 213, 200, 190, 61, 28, 104, 245, 25 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "verification_method", "type": { "defined": { "name": "VerificationMethod" } } }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "close", "discriminator": [ 98, 165, 201, 177, 108, 65, 206, 96 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true }, { "name": "destination", "writable": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "initialize", "discriminator": [ 175, 175, 109, 31, 13, 152, 155, 237 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "authority" } ] } }, { "name": "authority", "writable": true, "signer": true }, { "name": "payer", "writable": true, "signer": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "size", "type": "u32" } ] }, { "name": "remove_service", "discriminator": [ 19, 102, 8, 231, 40, 141, 9, 110 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "fragment", "type": "string" }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "remove_verification_method", "discriminator": [ 33, 238, 66, 183, 62, 210, 133, 150 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "fragment", "type": "string" }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "resize", "discriminator": [ 74, 27, 74, 155, 56, 134, 175, 125 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "payer", "writable": true, "signer": true }, { "name": "authority", "signer": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "size", "type": "u32" }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "set_controllers", "discriminator": [ 65, 40, 24, 8, 30, 81, 20, 179 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "set_controllers_arg", "type": { "defined": { "name": "SetControllersArg" } } }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "set_vm_flags", "discriminator": [ 216, 172, 84, 171, 196, 72, 7, 41 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "flags_vm", "type": { "defined": { "name": "UpdateFlagsVerificationMethod" } } }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] }, { "name": "update", "discriminator": [ 219, 200, 88, 176, 158, 63, 253, 127 ], "accounts": [ { "name": "did_data", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 100, 105, 100, 45, 97, 99, 99, 111, 117, 110, 116 ] }, { "kind": "account", "path": "did_data.initial_verification_method.key_data", "account": "DidAccount" } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "update_arg", "type": { "defined": { "name": "UpdateArg" } } }, { "name": "eth_signature", "type": { "option": { "defined": { "name": "Secp256k1RawSignature" } } } } ] } ], "accounts": [ { "name": "DidAccount", "discriminator": [ 77, 88, 239, 141, 251, 29, 237, 243 ] } ], "errors": [ { "code": 6000, "name": "VmFragmentNotFound", "msg": "No VM with the given fragment exists" }, { "code": 6001, "name": "VmFragmentAlreadyInUse", "msg": "Given VM fragment is already in use" }, { "code": 6002, "name": "VmGuardedFlagOnAdd", "msg": "Cannot add a verification method with guarded flag (OwnershipProof or Protected)" }, { "code": 6003, "name": "VmCannotRemoveLastAuthority", "msg": "Removing the last verification method would lead to a lockout" }, { "code": 6004, "name": "ServiceFragmentAlreadyInUse", "msg": "Service already exists in current service list" }, { "code": 6005, "name": "ServiceFragmentNotFound", "msg": "Service doesn't exists in current service list" }, { "code": 6006, "name": "InvalidOtherControllers", "msg": "Invalid other controllers. Invalid DID format or did:sol:<did>" }, { "code": 6007, "name": "InvalidNativeControllers", "msg": "Invalid native controllers. Cannot set itself as a controller" }, { "code": 6008, "name": "InsufficientInitialSize", "msg": "Initial Account size is insufficient for serialization" }, { "code": 6009, "name": "ConversionError", "msg": "Could not convert between data types" }, { "code": 6010, "name": "InvalidControllerChain", "msg": "Invalid chain of controlling DidAccounts" }, { "code": 6011, "name": "ErrorValidatingSecp256k1Signature", "msg": "An error occurred while validating Secp256k1 signature" }, { "code": 6012, "name": "WrongAuthorityForDid", "msg": "Wrong Authority for given DID" }, { "code": 6013, "name": "VmCannotRemoveProtected", "msg": "Cannot remove a protected verification method. You need to first remove the Protected Verification Method Flag in order for this operation to succeed" } ], "types": [ { "name": "DidAccount", "type": { "kind": "struct", "fields": [ { "name": "version", "docs": [ "Version identifier" ], "type": "u8" }, { "name": "bump", "docs": [ "Bump" ], "type": "u8" }, { "name": "nonce", "docs": [ "Nonce, for protecting against replay attacks around secp256k1 signatures." ], "type": "u64" }, { "name": "initial_verification_method", "docs": [ "The initial authority key, automatically being added to the array of all Verification Methods." ], "type": { "defined": { "name": "VerificationMethod" } } }, { "name": "verification_methods", "docs": [ "All verification methods" ], "type": { "vec": { "defined": { "name": "VerificationMethod" } } } }, { "name": "services", "docs": [ "Services" ], "type": { "vec": { "defined": { "name": "Service" } } } }, { "name": "native_controllers", "docs": [ "Controller (native) - did:sol:<controller>" ], "type": { "vec": "pubkey" } }, { "name": "other_controllers", "docs": [ "Controller (others) - all others" ], "type": { "vec": "string" } } ] } }, { "name": "Secp256k1RawSignature", "type": { "kind": "struct", "fields": [ { "name": "signature", "type": { "array": [ "u8", 64 ] } }, { "name": "recovery_id", "type": "u8" } ] } }, { "name": "Service", "docs": [ "A Service Definition [`DidAccount`]" ], "type": { "kind": "struct", "fields": [ { "name": "fragment", "type": "string" }, { "name": "service_type", "type": "string" }, { "name": "service_endpoint", "type": "string" } ] } }, { "name": "SetControllersArg", "docs": [ "Argument" ], "type": { "kind": "struct", "fields": [ { "name": "native_controllers", "type": { "vec": "pubkey" } }, { "name": "other_controllers", "type": { "vec": "string" } } ] } }, { "name": "UpdateArg", "docs": [ "Argument" ], "type": { "kind": "struct", "fields": [ { "name": "verification_methods", "docs": [ "All verification methods" ], "type": { "vec": { "defined": { "name": "VerificationMethod" } } } }, { "name": "services", "docs": [ "Services" ], "type": { "vec": { "defined": { "name": "Service" } } } }, { "name": "native_controllers", "docs": [ "Controller (native) - did:sol:<controller>" ], "type": { "vec": "pubkey" } }, { "name": "other_controllers", "docs": [ "Controller (others) - all others" ], "type": { "vec": "string" } } ] } }, { "name": "UpdateFlagsVerificationMethod", "docs": [ "Argument" ], "type": { "kind": "struct", "fields": [ { "name": "fragment", "type": "string" }, { "name": "flags", "type": "u16" } ] } }, { "name": "VerificationMethod", "docs": [ "The native authority key for a [`DidAccount`]" ], "type": { "kind": "struct", "fields": [ { "name": "fragment", "docs": [ "fragment" ], "type": "string" }, { "name": "flags", "docs": [ "The permissions this key has" ], "type": "u16" }, { "name": "method_type", "docs": [ "The actual verification method" ], "type": "u8" }, { "name": "key_data", "docs": [ "Dynamically sized key matching the given VerificationType" ], "type": "bytes" } ] } } ] }