{"id":18369818,"url":"https://github.com/cawfree/use-delegatecash","last_synced_at":"2025-04-06T18:32:33.053Z","repository":{"id":65496514,"uuid":"593067620","full_name":"cawfree/use-delegatecash","owner":"cawfree","description":"⚛️ 💸 React.js hooks for delegate.cash","archived":false,"fork":false,"pushed_at":"2023-02-09T00:05:36.000Z","size":92,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-23T03:31:39.688Z","etag":null,"topics":["asset","cash","delegate","eip-5639","ethereum","ethers","protection","react","wagmi"],"latest_commit_sha":null,"homepage":"https://delegate.cash","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/cawfree.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-25T06:28:09.000Z","updated_at":"2023-05-17T01:40:33.000Z","dependencies_parsed_at":"2023-02-16T09:16:02.373Z","dependency_job_id":null,"html_url":"https://github.com/cawfree/use-delegatecash","commit_stats":{"total_commits":22,"total_committers":2,"mean_commits":11.0,"dds":"0.045454545454545414","last_synced_commit":"7fbdc0cedf8ade064e96fae191fbc11a4ef20f2d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Fuse-delegatecash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Fuse-delegatecash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Fuse-delegatecash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cawfree%2Fuse-delegatecash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cawfree","download_url":"https://codeload.github.com/cawfree/use-delegatecash/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249515,"owners_count":20908212,"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":["asset","cash","delegate","eip-5639","ethereum","ethers","protection","react","wagmi"],"created_at":"2024-11-05T23:32:20.747Z","updated_at":"2025-04-06T18:32:31.130Z","avatar_url":"https://github.com/cawfree.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-delegatecash\n⚛️ 💸 React.js hooks for [__delegate.cash__](https://delegate.cash) which enable you to build safer user experiences powered by asset delegation. Supports both [__React__](https://reactjs.org/) and [__React Native__](https://reactnative.dev).\n\n### 🚀 Getting Started\n\nTo get started, make sure you've got the following dependencies installed:\n\n```\nyarn add ethers wagmi delegatecash@0.3.1 use-delegatecash\n```\n\n\u003e 💭 `use-delegatecash` assumes you've already declared a [`WagmiConfig`](https://github.com/wagmi-dev/wagmi) at the root of your application.\n\n### ✍️ Usage\n\n`use-delegatecash` wraps all of the getter functions exported by [`delegatecash`](https://github.com/delegatecash/delegatecash-javascript-sdk) inside stateful typesafe React hooks.\n\nYou can also `useDelegateCash()` to return a [`DelegateCash`](https://github.com/delegatecash/delegatecash-javascript-sdk/blob/ef2f7b2d0e50b7b2ac8a9faef0edd1ed07e6807a/src/index.ts#L7) object, which can be used to initiate transactions.\n\n```typescript\nimport * as React from 'react';\nimport {\n  ActivityIndicator,\n  StyleSheet,\n  Text,\n  View,\n} from 'react-native';\n\nimport {\n  useCheckDelegateForAll,\n  useGetDelegatesForContract,\n  useCheckDelegateForContract,\n  useCheckDelegateForToken,\n  useDelegateCash,\n  useGetContractLevelDelegations,\n  useGetDelegatesForAll,\n  useGetDelegatesForContract,\n  useGetDelegationsByDelegate,\n  useGetTokenLevelDelegations,\n  isDelegateCashResult,\n  isDelegateCashError,\n} from 'use-delegatecash';\n\nexport const AppExample = React.memo(\n  function AppExample(): JSX.Element {\n    const state = useGetDelegatesForAll({\n      vault: '0x312e71162Df834A87a2684d30562b94816b0f072',\n    });\n    return (\n      \u003cView style={[StyleSheet.absoluteFill, styles.center]}\u003e\n        {isDelegateCashError(state)\n          ? \u003cText children={state.error.message} /\u003e\n          : isDelegateCashResult(state)\n          ? \u003cText children=\"Got result!\" /\u003e\n          : \u003cActivityIndicator /\u003e}\n      \u003c/View\u003e\n    );\n  },\n);\n\nconst styles = StyleSheet.create({\n  center: {alignItems: 'center', justifyContent: 'center'},\n});\n```\n\n### ✌️License\n[__MIT__](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Fuse-delegatecash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcawfree%2Fuse-delegatecash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcawfree%2Fuse-delegatecash/lists"}