{"id":25595483,"url":"https://github.com/polywrap/safe-api-plugin","last_synced_at":"2026-04-15T03:30:20.107Z","repository":{"id":197988674,"uuid":"699331261","full_name":"polywrap/safe-api-plugin","owner":"polywrap","description":"Safe API plugin","archived":false,"fork":false,"pushed_at":"2023-10-11T18:50:25.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-03T13:40:47.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polywrap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-02T12:28:33.000Z","updated_at":"2023-10-03T18:37:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"b34be2ce-8588-45d3-8d34-c4dbdefce85b","html_url":"https://github.com/polywrap/safe-api-plugin","commit_stats":null,"previous_names":["polywrap/safe-api-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-api-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-api-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-api-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polywrap%2Fsafe-api-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polywrap","download_url":"https://codeload.github.com/polywrap/safe-api-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240005369,"owners_count":19732740,"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":[],"created_at":"2025-02-21T11:29:18.767Z","updated_at":"2026-04-15T03:30:20.076Z","avatar_url":"https://github.com/polywrap.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Safe API Kit Plugin\n\nThis plugin facilitates the interaction with the Safe Transaction Service API using Polywrap. The Safe Transaction Service API provides functionalities for multi-signature transactions, ERC20 tokens information, Safe account histories, and more.\n\n## Features:\n\n1. **Get Service Information**: Retrieve configuration and information of the Safe Transaction Service.\n2. **Master Copies**: Obtain a list of Safe master copies.\n3. **Data Decoding**: Decode specific Safe transaction data.\n4. **Safes Information**: Get safes based on owner or module addresses and retrieve all configuration and data related to a specific safe.\n5. **Transactions**: Extract details, confirmations, propose new transactions, and get histories of different types of transactions (multi-signature, incoming, module).\n6. **Delegates**: Manage (add, remove) and fetch Safe delegates.\n7. **ERC20 Tokens**: Fetch a list of all ERC20 tokens and get details about a specific token.\n\n## Types:\n\nThe SDK contains several types to structure the data. Some of the core types are:\n\n- `SafeServiceInfoResponse`: Contains details like the service name, version, and API settings.\n- `MasterCopyResponse`: Provides information about Safe master copies.\n- `SafeInfoResponse`: Contains configuration and data of a specific safe.\n- `SafeMultisigTransactionResponse`: Gives details of a multi-signature transaction.\n- `SafeDelegateListResponse`: Offers a list of delegates and their information.\n  ... [and more]\n\n## Usage:\n\n## Installation:\n\n```bash\nnpm install @polywrap/safe-api-plugin\n```\n\n## Usage:\n\nFirst, make sure you have installed and set up the necessary packages:\n\n- `@polywrap/client-js`\n- `@polywrap/client-config-builder-js`\n- `ethers`\n- `@safe-global/protocol-kit`\n\n### Setup:\n\nTo set up the plugin with `PolywrapClient`, follow the steps:\n\n```javascript\nimport { PolywrapClient } from \"@polywrap/client-js\";\nimport { PolywrapClientConfigBuilder } from \"@polywrap/client-config-builder-js\";\nimport { Safe } from \"../types\"; // Ensure you import or define the required types\nimport { safeApiPlugin } from \"@polywrap/safe-api-plugin\";\nimport { ethers } from \"ethers\";\nimport { EthersAdapter } from \"@safe-global/protocol-kit\";\n\nconst provider = new ethers.providers.JsonRpcProvider(\"YOUR_INFURA_ENDPOINT\");\nconst safeOwner = provider.getSigner(0);\n\nconst ethAdapter = new EthersAdapter({\n  ethers,\n  signerOrProvider: safeOwner,\n});\n\nconst config = new PolywrapClientConfigBuilder()\n  .setPackage(\n    \"plugin/safe-api-kit\",\n    safeApiPlugin({\n      txServiceUrl: \"https://safe-transaction-mainnet.safe.global\",\n      ethAdapter,\n      signer: safeOwner,\n    })\n  )\n  .build();\n\nconst client = new PolywrapClient(config);\nconst safe = new Safe(client);\n```\n\n### Fetching Safe Info:\n\nTo fetch information about a specific Safe:\n\n```javascript\nconst info = await safe.getSafeInfo({\n  safeAddress: \"YOUR_SAFE_ADDRESS\",\n});\nconsole.log(info);\n```\n\n### Fetching Safes by Owner:\n\nTo retrieve a list of Safes owned by a specific address:\n\n```javascript\nconst safes = await safe.getSafesByOwner({\n  ownerAddress: \"OWNER_ADDRESS\",\n});\nconsole.log(safes);\n```\n\n## Errors:\n\nThe API can throw errors for various reasons. For example:\n\n- `Invalid data`: Data provided does not match the expected format.\n- `Not Found`: The requested resource is not available.\n- `Checksum address validation failed`: The Ethereum address provided does not pass the checksum validation.\n\nAlways handle these errors gracefully in your application.\n\n## Feedback and Contributions\n\nIf you encounter any issues or have feature requests, please open an issue on our GitHub repository. Contributions are also welcome! Please ensure to follow the contribution guidelines and code of conduct.\n\n## License\n\nThis SDK is licensed under the [MIT License](LICENSE). Please refer to the LICENSE file for detailed information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolywrap%2Fsafe-api-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolywrap%2Fsafe-api-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolywrap%2Fsafe-api-plugin/lists"}