const policy = await cdp.policies.createPolicy({
policy: {
scope: "account",
description: "Limits SOL transfers and SPL token operations",
rules: [
{
action: "reject",
operation: "signSolTransaction",
criteria: [
{
type: "solValue",
solValue: "1000000000", // 1 SOL in lamports
operator: ">",
},
{
type: "solAddress",
addresses: ["9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"],
operator: "in",
},
],
},
{
action: "accept",
operation: "sendSolTransaction",
criteria: [
{
type: "mintAddress",
addresses: ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"], // USDC mint
operator: "in",
},
],
},
],
}
});