{"id":14971432,"url":"https://github.com/snowflake-so/snowflake-safe-sdk","last_synced_at":"2025-10-31T00:43:27.566Z","repository":{"id":38109515,"uuid":"500506586","full_name":"snowflake-so/snowflake-safe-sdk","owner":"snowflake-so","description":"Snowflake Safe SDK provides an easy way to interact with the Snowflake Safe app and onchain programs","archived":false,"fork":false,"pushed_at":"2022-10-03T16:18:02.000Z","size":661,"stargazers_count":7,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T20:55:55.634Z","etag":null,"topics":["automation","multisig","sdk","snowflake-so"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snowflake-so.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-06T16:18:52.000Z","updated_at":"2024-09-12T02:47:53.000Z","dependencies_parsed_at":"2022-08-08T23:01:15.328Z","dependency_job_id":null,"html_url":"https://github.com/snowflake-so/snowflake-safe-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowflake-so%2Fsnowflake-safe-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowflake-so%2Fsnowflake-safe-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowflake-so%2Fsnowflake-safe-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snowflake-so%2Fsnowflake-safe-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snowflake-so","download_url":"https://codeload.github.com/snowflake-so/snowflake-safe-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238347915,"owners_count":19457014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","multisig","sdk","snowflake-so"],"created_at":"2024-09-24T13:45:11.819Z","updated_at":"2025-10-26T15:30:29.780Z","avatar_url":"https://github.com/snowflake-so.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snowflake Safe SDK\n\nSnowflake Safe SDK provides an easy way to interact with the Snowflake Safe app and onchain programs\n\n## Installation\n\nInstall with npm\n\n```bash\nnpm i @snowflake-so/safe-sdk\n```\n\nInstall with yarn\n\n```bash\nyarn add @snowflake-so/safe-sdk\n```\n\n## Quick start guide\n\n### Initialize Snowflake\n\nTo create a new Snowflake service, we would need to initialize with the Provider.\n\n```typescript\n// if your Anchor version is older than 0.24.2,\n// please use Snowflake SDK version 1.0.11 and initialize the provider as below\nlet provider: Provider = Provider.local(API_URL);\n\n// if your Anchor version is 0.24.2 or later,\n// please use the latest version of Snowflake SDK and initialize the provider as below\nlet provider: Provider = AnchorProvider.local(API_URL);\n```\n\nThe `API_URL` is the endpoint to the Solana cluster. Empty API_URL is pointed to the `local testnet`\n\n- Mainnet Beta: `https://api.mainnet-beta.solana.com`\n- Testnet: `https://api.testnet.solana.com`\n- Devnet: `https://api.devnet.solana.com`\n\n```typescript\nlet snowflakeSafe: SnowflakeSafe = new SnowflakeSafe(provider);\n```\n\n---\n\n### Fetch safe\n\nFetch safe onchain information by safe address\n\n```typescript\nawait snowflakeSafe.fetchSafe(safeAddress);\n```\n\n### Fetch proposals of safe\n\nFetch all onchain proposals of the safe\n\n```typescript\nawait snowflakeSafe.fetchAllProposals(safeAddress);\n```\n\n### Fetch proposal\n\nFetch onchain proposal information\n\n```typescript\nawait snowflakeSafe.fetchProposal(proposalAddress);\n```\n\n### Fetch owned safes\n\nFetch all safes that the provided wallet owned\n\n```typescript\nawait snowflakeSafe.fetchOwnedSafes(ownerAddress);\n```\n\n---\n\n### Create a new safe\n\nCreate a new safe with one owner and approvals required as one\n\n```typescript\nconst input = {\n  approvalsRequired: 1,\n  owners: [owner],\n};\nconst [newSafeAddress, txId] = await snowflakeSafe.createSafe(\n  input.owners,\n  input.approvalsRequired\n);\n```\n\n### Create a new proposal\n\nCreate a new proposal that can be executed by any safe owners\n\n```typescript\nconst response = await snowflakeSafe.createProposal(safeAddress, 'hello world', instructions);\n```\n\n### Create a new recurring proposal\n\nCreate a new recurring proposal that can be executed automatically by Snowflake node operators\n\n```typescript\nconst proposal = new MultisigJobBuilder()\n  .jobName('hello world')\n  .jobInstructions(instructions)\n  .scheduleCron('0 0 * * *')\n  .build();\n\nconst [newProposalAddress, txId] = await snowflakeSafe.createRecurringProposal(\n  safeAddress,\n  proposal\n);\n```\n\n### Create a proposal with large payload\n\nIn production, there is proposal created with multiple actions which has bunches of accounts. This method is used to solve the issue\n\n```typescript\nconst [newProposalAddress] = await snowflakeSafe.createProposal(\n  safeAddress,\n  'hello world',\n  instructions,\n  [],\n  DEFAULT_FLOW_SIZE,\n  true,\n  true // Set separatedActions parameter to true\n);\n```\n\n### Update an existing safe\n\n#### Add owner proposal\n\nThe method will create a new instruction to propose adding new owner to the safe\n\n```typescript\nconst ix = await snowflakeSafe.createAddOwnerProposalInstruction(safeAddress, newOwner);\n```\n\n#### Remove owner proposal\n\nThe method will create a new instruction to propose removing an existing owner from the safe\n\n```typescript\nconst ix = await snowflakeSafe.createRemoveOwnerProposalInstruction(safeAddress, newOwner);\n```\n\n#### Change threshold proposal\n\nThe method will create a new instruction to propose changing threshold of the safe\n\n```typescript\nconst ix = await snowflakeSafe.createChangeThresholdProposalInstruction(safeAddress, newThreshold);\n```\n\n### Approve a proposal\n\n```typescript\nawait snowflakeSafe.approveProposal(flowAddress);\n```\n\n### Reject a proposal\n\n```typescript\nawait snowflakeSafe.rejectProposal(flowAddress);\n```\n\n### Execute a proposal\n\n```typescript\nawait snowflakeSafe.executeProposal(flowAddress);\n```\n\n### Abort a recurring proposal\n\n```typescript\nawait snowflakeSafe.abortRecurringProposal(flowAddress);\n```\n\n---\n\n### Build an once-off scheduled job\n\nWith Snowflake SDK, you can create a job with two line of code.\n\n```typescript\nconst job = new MultisigJobBuilder()\n  .jobName('hello world')\n  .jobInstructions(instructions)\n  .scheduleOnce(tomorrow())\n  .build();\n```\n\n### Build a recurring scheduled job\n\nSchedule a job that runs every minute for 10 times.\n\n```typescript\nconst job = new MultisigJobBuilder()\n  .jobName('hello world')\n  .jobInstructions(instructions)\n  .scheduleCron('* * * * *', 10)\n  .build();\n```\n\nSchedule a job that runs at 10:00 AM on the first day of every month .\n\n```typescript\nconst job = new MultisigJobBuilder()\n  .jobName('hello world')\n  .jobInstructions(instructions)\n  .scheduleCron('0 10 1 * *')\n  .build();\n```\n\n### Build a program condition triggered job\n\nSchedule a job that is triggered based on an arbitrary condition defined within the user program.\n\n```typescript\nconst job = new MultisigJobBuilder()\n  .jobName('hello world')\n  .jobInstructions(instructions)\n  .scheduleConditional(1)\n  .build();\n```\n\n## Support\n\n### Struggle with the SDK integration?\n\nIf you have any problem with using the SDK in your system, drop a question our Snowflake Discord #sdk to receive a support from our engineers.\n\n### Find a bug or want to contribute to Snowflake?\n\nIf you find a bug or have any problem and idea while using the SDK, you can create an issue on SDK Github.\n\n## License\n\nApache Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowflake-so%2Fsnowflake-safe-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnowflake-so%2Fsnowflake-safe-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnowflake-so%2Fsnowflake-safe-sdk/lists"}