Type alias PolicyEngineIdlTypes

PolicyEngineIdlTypes: {
    accounts: [{
        discriminator: [218, 201, 183, 164, 156, 127, 81, 175];
        name: "policyAccount";
    }, {
        discriminator: [124, 85, 205, 80, 2, 18, 26, 45];
        name: "policyEngineAccount";
    }, {
        discriminator: [83, 95, 166, 148, 57, 30, 90, 210];
        name: "trackerAccount";
    }];
    address: "po1cPf1eyUJJPqULw4so3T4JU9pdFn83CDyuLEKFAau";
    errors: [{
        code: 6000;
        msg: "Invalid policy passed";
        name: "invalidPolicy";
    }, {
        code: 6001;
        msg: "Transaction amount limit exceeded";
        name: "transactionAmountLimitExceeded";
    }, {
        code: 6002;
        msg: "Transaction amount velocity exceeded";
        name: "transactionAmountVelocityExceeded";
    }, {
        code: 6003;
        msg: "Transaction count velocity exceeded";
        name: "transactionCountVelocityExceeded";
    }, {
        code: 6004;
        msg: "Identity level limit exceeded";
        name: "identityLevelLimitExceeded";
    }, {
        code: 6005;
        msg: "Policy registry is full, cannot add more policies";
        name: "policyEngineFull";
    }, {
        code: 6006;
        msg: "Policy not found";
        name: "policyNotFound";
    }, {
        code: 6007;
        msg: "Identity filter failed";
        name: "identityFilterFailed";
    }, {
        code: 6008;
        msg: "Unauthorized signer";
        name: "unauthorizedSigner";
    }, {
        code: 6009;
        msg: "Policy already exists";
        name: "policyAlreadyExists";
    }, {
        code: 6010;
        msg: "Max balance exceeded";
        name: "maxBalanceExceeded";
    }, {
        code: 6011;
        msg: "Invalid CPI transfer amount";
        name: "invalidCpiTransferAmount";
    }, {
        code: 6012;
        msg: "Invalid CPI transfer mint";
        name: "invalidCpiTransferMint";
    }, {
        code: 6013;
        msg: "Invalid CPI transfer program";
        name: "invalidCpiTransferProgram";
    }, {
        code: 6014;
        msg: "Invalid PDA passed in";
        name: "invalidPdaPassedIn";
    }, {
        code: 6015;
        msg: "Transfer history full";
        name: "transferHistoryFull";
    }];
    instructions: [{
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "policyEngine";
            writable: true;
        }, {
            name: "policyAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "policyEngine";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "identityFilter";
            type: {
                defined: {
                    name: "identityFilter";
                };
            };
        }, {
            name: "policyType";
            type: {
                defined: {
                    name: "policyType";
                };
            };
        }];
        discriminator: [247, 116, 130, 17, 89, 232, 103, 16];
        docs: ["attach a policy"];
        name: "attachToPolicyAccount";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "policyEngine";
            writable: true;
        }, {
            name: "policyAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "policyEngine";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "identityFilter";
            type: {
                defined: {
                    name: "identityFilter";
                };
            };
        }, {
            name: "policyType";
            type: {
                defined: {
                    name: "policyType";
                };
            };
        }];
        discriminator: [52, 228, 143, 138, 102, 135, 59, 193];
        docs: ["policies", "create policy account"];
        name: "createPolicyAccount";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "assetMint";
        }, {
            name: "policyEngine";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "assetMint";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "authority";
            type: "pubkey";
        }, {
            name: "delegate";
            type: {
                option: "pubkey";
            };
        }];
        discriminator: [85, 105, 207, 153, 73, 125, 225, 54];
        docs: ["create a policy registry"];
        name: "createPolicyEngine";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "owner";
        }, {
            name: "assetMint";
        }, {
            name: "trackerAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "assetMint";
                }, {
                    kind: "account";
                    path: "owner";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }, {
            name: "eventAuthority";
            pda: {
                seeds: [{
                    kind: "const";
                    value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121];
                }];
            };
        }, {
            name: "program";
        }];
        args: [];
        discriminator: [40, 16, 40, 191, 109, 177, 83, 190];
        docs: ["create tracker account"];
        name: "createTrackerAccount";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "policyEngine";
            writable: true;
        }, {
            name: "policyAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "policyEngine";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "hash";
            type: "string";
        }];
        discriminator: [81, 24, 116, 10, 12, 108, 109, 242];
        docs: ["remove policy"];
        name: "detachFromPolicyAccount";
    }, {
        accounts: [{
            name: "sourceAccount";
            pda: {
                program: {
                    kind: "const";
                    value: [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
                };
                seeds: [{
                    kind: "account";
                    path: "ownerDelegate";
                }, {
                    kind: "const";
                    value: [6, 221, 246, 225, 238, 117, 143, 222, 24, 66, 93, 188, 228, 108, 205, 218, 182, 26, 252, 77, 131, 185, 13, 39, 254, 189, 249, 40, 216, 161, 139, 252];
                }, {
                    kind: "account";
                    path: "assetMint";
                }];
            };
        }, {
            name: "assetMint";
        }, {
            name: "destinationAccount";
        }, {
            name: "ownerDelegate";
        }, {
            name: "extraMetasAccount";
            pda: {
                seeds: [{
                    kind: "const";
                    value: [101, 120, 116, 114, 97, 45, 97, 99, 99, 111, 117, 110, 116, 45, 109, 101, 116, 97, 115];
                }, {
                    kind: "account";
                    path: "assetMint";
                }];
            };
        }, {
            address: "po1cPf1eyUJJPqULw4so3T4JU9pdFn83CDyuLEKFAau";
            name: "policyEngine";
        }, {
            name: "policyEngineAccount";
        }, {
            address: "idtynCMYbdisCTv4FrCWPSQboZb1uM4TV2cPi79yxQf";
            name: "identityRegistry";
        }, {
            name: "identityRegistryAccount";
        }, {
            name: "identityAccount";
            writable: true;
        }, {
            name: "trackerAccount";
            writable: true;
        }, {
            name: "policyAccount";
        }, {
            name: "instructionsProgram";
        }];
        args: [{
            name: "amount";
            type: "u64";
        }];
        discriminator: [105, 37, 101, 197, 75, 251, 102, 26];
        docs: ["execute transfer hook"];
        name: "executeTransaction";
    }];
    metadata: {
        description: "The Policy Registry Program (PRP) enables the creation of policies that can be used to control the flow of funds in a programmatic way.";
        name: "policyEngine";
        spec: "0.1.0";
        version: "0.0.1";
    };
    types: [{
        name: "comparisionType";
        repr: {
            kind: "rust";
        };
        type: {
            kind: "enum";
            variants: [{
                name: "or";
            }, {
                name: "and";
            }];
        };
    }, {
        name: "identityFilter";
        type: {
            fields: [{
                name: "identityLevels";
                type: {
                    array: ["u8", 10];
                };
            }, {
                name: "comparisionType";
                type: {
                    defined: {
                        name: "comparisionType";
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "policy";
        type: {
            fields: [{
                name: "hash";
                type: "string";
            }, {
                name: "identityFilter";
                type: {
                    defined: {
                        name: "identityFilter";
                    };
                };
            }, {
                name: "policyType";
                type: {
                    defined: {
                        name: "policyType";
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "policyAccount";
        type: {
            fields: [{
                name: "version";
                type: "u8";
            }, {
                docs: ["Engine account that the policy belongs to"];
                name: "policyEngine";
                type: "pubkey";
            }, {
                docs: ["Different policies that can be applied to the policy account", "initial max len"];
                name: "policies";
                type: {
                    vec: {
                        defined: {
                            name: "policy";
                        };
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "policyEngineAccount";
        type: {
            fields: [{
                docs: ["version"];
                name: "version";
                type: "u8";
            }, {
                docs: ["asset mint"];
                name: "assetMint";
                type: "pubkey";
            }, {
                docs: ["authority of the registry"];
                name: "authority";
                type: "pubkey";
            }, {
                docs: ["policy delegate"];
                name: "delegate";
                type: "pubkey";
            }, {
                docs: ["max timeframe of all the policies"];
                name: "maxTimeframe";
                type: "i64";
            }];
            kind: "struct";
        };
    }, {
        name: "policyType";
        type: {
            kind: "enum";
            variants: [{
                name: "identityApproval";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }];
                name: "transactionAmountLimit";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }, {
                    name: "timeframe";
                    type: "i64";
                }];
                name: "transactionAmountVelocity";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }, {
                    name: "timeframe";
                    type: "i64";
                }];
                name: "transactionCountVelocity";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }];
                name: "maxBalance";
            }];
        };
    }, {
        name: "trackerAccount";
        type: {
            fields: [{
                name: "version";
                type: "u8";
            }, {
                name: "assetMint";
                type: "pubkey";
            }, {
                name: "owner";
                type: "pubkey";
            }, {
                name: "transfers";
                type: {
                    vec: {
                        defined: {
                            name: "transfer";
                        };
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "transfer";
        type: {
            fields: [{
                name: "amount";
                type: "u64";
            }, {
                name: "timestamp";
                type: "i64";
            }];
            kind: "struct";
        };
    }];
}

Program IDL in camelCase format in order to be used in JS/TS.

Note that this is only a type helper and is not the actual IDL. The original IDL can be found at target/idl/policy_engine.json.

Type declaration

  • accounts: [{
        discriminator: [218, 201, 183, 164, 156, 127, 81, 175];
        name: "policyAccount";
    }, {
        discriminator: [124, 85, 205, 80, 2, 18, 26, 45];
        name: "policyEngineAccount";
    }, {
        discriminator: [83, 95, 166, 148, 57, 30, 90, 210];
        name: "trackerAccount";
    }]
  • address: "po1cPf1eyUJJPqULw4so3T4JU9pdFn83CDyuLEKFAau"
  • errors: [{
        code: 6000;
        msg: "Invalid policy passed";
        name: "invalidPolicy";
    }, {
        code: 6001;
        msg: "Transaction amount limit exceeded";
        name: "transactionAmountLimitExceeded";
    }, {
        code: 6002;
        msg: "Transaction amount velocity exceeded";
        name: "transactionAmountVelocityExceeded";
    }, {
        code: 6003;
        msg: "Transaction count velocity exceeded";
        name: "transactionCountVelocityExceeded";
    }, {
        code: 6004;
        msg: "Identity level limit exceeded";
        name: "identityLevelLimitExceeded";
    }, {
        code: 6005;
        msg: "Policy registry is full, cannot add more policies";
        name: "policyEngineFull";
    }, {
        code: 6006;
        msg: "Policy not found";
        name: "policyNotFound";
    }, {
        code: 6007;
        msg: "Identity filter failed";
        name: "identityFilterFailed";
    }, {
        code: 6008;
        msg: "Unauthorized signer";
        name: "unauthorizedSigner";
    }, {
        code: 6009;
        msg: "Policy already exists";
        name: "policyAlreadyExists";
    }, {
        code: 6010;
        msg: "Max balance exceeded";
        name: "maxBalanceExceeded";
    }, {
        code: 6011;
        msg: "Invalid CPI transfer amount";
        name: "invalidCpiTransferAmount";
    }, {
        code: 6012;
        msg: "Invalid CPI transfer mint";
        name: "invalidCpiTransferMint";
    }, {
        code: 6013;
        msg: "Invalid CPI transfer program";
        name: "invalidCpiTransferProgram";
    }, {
        code: 6014;
        msg: "Invalid PDA passed in";
        name: "invalidPdaPassedIn";
    }, {
        code: 6015;
        msg: "Transfer history full";
        name: "transferHistoryFull";
    }]
  • instructions: [{
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "policyEngine";
            writable: true;
        }, {
            name: "policyAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "policyEngine";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "identityFilter";
            type: {
                defined: {
                    name: "identityFilter";
                };
            };
        }, {
            name: "policyType";
            type: {
                defined: {
                    name: "policyType";
                };
            };
        }];
        discriminator: [247, 116, 130, 17, 89, 232, 103, 16];
        docs: ["attach a policy"];
        name: "attachToPolicyAccount";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "policyEngine";
            writable: true;
        }, {
            name: "policyAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "policyEngine";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "identityFilter";
            type: {
                defined: {
                    name: "identityFilter";
                };
            };
        }, {
            name: "policyType";
            type: {
                defined: {
                    name: "policyType";
                };
            };
        }];
        discriminator: [52, 228, 143, 138, 102, 135, 59, 193];
        docs: ["policies", "create policy account"];
        name: "createPolicyAccount";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "assetMint";
        }, {
            name: "policyEngine";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "assetMint";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "authority";
            type: "pubkey";
        }, {
            name: "delegate";
            type: {
                option: "pubkey";
            };
        }];
        discriminator: [85, 105, 207, 153, 73, 125, 225, 54];
        docs: ["create a policy registry"];
        name: "createPolicyEngine";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "owner";
        }, {
            name: "assetMint";
        }, {
            name: "trackerAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "assetMint";
                }, {
                    kind: "account";
                    path: "owner";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }, {
            name: "eventAuthority";
            pda: {
                seeds: [{
                    kind: "const";
                    value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121];
                }];
            };
        }, {
            name: "program";
        }];
        args: [];
        discriminator: [40, 16, 40, 191, 109, 177, 83, 190];
        docs: ["create tracker account"];
        name: "createTrackerAccount";
    }, {
        accounts: [{
            name: "payer";
            signer: true;
            writable: true;
        }, {
            name: "signer";
            signer: true;
        }, {
            name: "policyEngine";
            writable: true;
        }, {
            name: "policyAccount";
            pda: {
                seeds: [{
                    kind: "account";
                    path: "policyEngine";
                }];
            };
            writable: true;
        }, {
            address: "11111111111111111111111111111111";
            name: "systemProgram";
        }];
        args: [{
            name: "hash";
            type: "string";
        }];
        discriminator: [81, 24, 116, 10, 12, 108, 109, 242];
        docs: ["remove policy"];
        name: "detachFromPolicyAccount";
    }, {
        accounts: [{
            name: "sourceAccount";
            pda: {
                program: {
                    kind: "const";
                    value: [140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89];
                };
                seeds: [{
                    kind: "account";
                    path: "ownerDelegate";
                }, {
                    kind: "const";
                    value: [6, 221, 246, 225, 238, 117, 143, 222, 24, 66, 93, 188, 228, 108, 205, 218, 182, 26, 252, 77, 131, 185, 13, 39, 254, 189, 249, 40, 216, 161, 139, 252];
                }, {
                    kind: "account";
                    path: "assetMint";
                }];
            };
        }, {
            name: "assetMint";
        }, {
            name: "destinationAccount";
        }, {
            name: "ownerDelegate";
        }, {
            name: "extraMetasAccount";
            pda: {
                seeds: [{
                    kind: "const";
                    value: [101, 120, 116, 114, 97, 45, 97, 99, 99, 111, 117, 110, 116, 45, 109, 101, 116, 97, 115];
                }, {
                    kind: "account";
                    path: "assetMint";
                }];
            };
        }, {
            address: "po1cPf1eyUJJPqULw4so3T4JU9pdFn83CDyuLEKFAau";
            name: "policyEngine";
        }, {
            name: "policyEngineAccount";
        }, {
            address: "idtynCMYbdisCTv4FrCWPSQboZb1uM4TV2cPi79yxQf";
            name: "identityRegistry";
        }, {
            name: "identityRegistryAccount";
        }, {
            name: "identityAccount";
            writable: true;
        }, {
            name: "trackerAccount";
            writable: true;
        }, {
            name: "policyAccount";
        }, {
            name: "instructionsProgram";
        }];
        args: [{
            name: "amount";
            type: "u64";
        }];
        discriminator: [105, 37, 101, 197, 75, 251, 102, 26];
        docs: ["execute transfer hook"];
        name: "executeTransaction";
    }]
  • metadata: {
        description: "The Policy Registry Program (PRP) enables the creation of policies that can be used to control the flow of funds in a programmatic way.";
        name: "policyEngine";
        spec: "0.1.0";
        version: "0.0.1";
    }
    • description: "The Policy Registry Program (PRP) enables the creation of policies that can be used to control the flow of funds in a programmatic way."
    • name: "policyEngine"
    • spec: "0.1.0"
    • version: "0.0.1"
  • types: [{
        name: "comparisionType";
        repr: {
            kind: "rust";
        };
        type: {
            kind: "enum";
            variants: [{
                name: "or";
            }, {
                name: "and";
            }];
        };
    }, {
        name: "identityFilter";
        type: {
            fields: [{
                name: "identityLevels";
                type: {
                    array: ["u8", 10];
                };
            }, {
                name: "comparisionType";
                type: {
                    defined: {
                        name: "comparisionType";
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "policy";
        type: {
            fields: [{
                name: "hash";
                type: "string";
            }, {
                name: "identityFilter";
                type: {
                    defined: {
                        name: "identityFilter";
                    };
                };
            }, {
                name: "policyType";
                type: {
                    defined: {
                        name: "policyType";
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "policyAccount";
        type: {
            fields: [{
                name: "version";
                type: "u8";
            }, {
                docs: ["Engine account that the policy belongs to"];
                name: "policyEngine";
                type: "pubkey";
            }, {
                docs: ["Different policies that can be applied to the policy account", "initial max len"];
                name: "policies";
                type: {
                    vec: {
                        defined: {
                            name: "policy";
                        };
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "policyEngineAccount";
        type: {
            fields: [{
                docs: ["version"];
                name: "version";
                type: "u8";
            }, {
                docs: ["asset mint"];
                name: "assetMint";
                type: "pubkey";
            }, {
                docs: ["authority of the registry"];
                name: "authority";
                type: "pubkey";
            }, {
                docs: ["policy delegate"];
                name: "delegate";
                type: "pubkey";
            }, {
                docs: ["max timeframe of all the policies"];
                name: "maxTimeframe";
                type: "i64";
            }];
            kind: "struct";
        };
    }, {
        name: "policyType";
        type: {
            kind: "enum";
            variants: [{
                name: "identityApproval";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }];
                name: "transactionAmountLimit";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }, {
                    name: "timeframe";
                    type: "i64";
                }];
                name: "transactionAmountVelocity";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }, {
                    name: "timeframe";
                    type: "i64";
                }];
                name: "transactionCountVelocity";
            }, {
                fields: [{
                    name: "limit";
                    type: "u64";
                }];
                name: "maxBalance";
            }];
        };
    }, {
        name: "trackerAccount";
        type: {
            fields: [{
                name: "version";
                type: "u8";
            }, {
                name: "assetMint";
                type: "pubkey";
            }, {
                name: "owner";
                type: "pubkey";
            }, {
                name: "transfers";
                type: {
                    vec: {
                        defined: {
                            name: "transfer";
                        };
                    };
                };
            }];
            kind: "struct";
        };
    }, {
        name: "transfer";
        type: {
            fields: [{
                name: "amount";
                type: "u64";
            }, {
                name: "timestamp";
                type: "i64";
            }];
            kind: "struct";
        };
    }]