{"id":18813045,"url":"https://github.com/oddsdk/odd-walletauth","last_synced_at":"2025-04-13T21:26:10.625Z","repository":{"id":54725149,"uuid":"483301120","full_name":"oddsdk/odd-walletauth","owner":"oddsdk","description":"Use your blockchain wallet as an ODD SDK authentication strategy.","archived":false,"fork":false,"pushed_at":"2023-04-11T17:45:03.000Z","size":1096,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-28T07:19:02.912Z","etag":null,"topics":["blockchain","ethereum","fission","odd","oddjs"],"latest_commit_sha":null,"homepage":"https://fission.codes/walletauth/","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/oddsdk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-04-19T15:20:58.000Z","updated_at":"2023-07-29T20:06:30.000Z","dependencies_parsed_at":"2024-11-07T23:36:24.783Z","dependency_job_id":"55c56aec-6072-42c5-8ad4-9c3567d33cc7","html_url":"https://github.com/oddsdk/odd-walletauth","commit_stats":null,"previous_names":["fission-codes/webnative-walletauth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddsdk%2Fodd-walletauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddsdk%2Fodd-walletauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddsdk%2Fodd-walletauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oddsdk%2Fodd-walletauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oddsdk","download_url":"https://codeload.github.com/oddsdk/odd-walletauth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248784188,"owners_count":21161071,"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":["blockchain","ethereum","fission","odd","oddjs"],"created_at":"2024-11-07T23:36:06.970Z","updated_at":"2025-04-13T21:26:10.603Z","avatar_url":"https://github.com/oddsdk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Use the [ODD SDK](https://github.com/oddsdk/ts-odd#readme) with a blockchain wallet. Access your personal encrypted file system with your wallet keys.\n\n## Usage\n\nUses Ethereum by default with `window.ethereum` as the provider. Currently only works with MetaMask because it's the only wallet with encryption and decryption.\n\n```ts\nimport * as walletauth from \"odd-walletauth\";\nimport { AppScenario } from \"@oddjs/odd\";\n\n// Initialise\n\nconst program = await walletauth.program({\n  // optional event handlers\n  onAccountChange: (newProgram) =\u003e handleProgram(newProgram),\n  onDisconnect: () =\u003e {\n    /* eg. logout() */\n  },\n});\n\nhandleProgram(program);\n\nfunction handleProgram(program) {\n  if (program.session) {\n    // ✅ Authenticated\n  } else {\n    // Failed to authenticate with wallet\n  }\n}\n```\n\nUse a custom Ethereum provider:\n\n```ts\nimport * as ethereum from \"odd-walletauth/wallet/ethereum\";\n\nethereum.setProvider(window.ethereum);\n```\n\n**You can also write an implementation for other wallets.** Note that the DID method has to be supported by the [Fission server](https://github.com/fission-codes/fission), unless you're using other services with the ODD SDK. At the moment of writing, you can only use the `key` method for DIDs with the Fission servers. It supports ED25519, RSA and SECP256K1 keys, same for the UCAN algorithms.\n\n```ts\nimport { Implementation } from \"odd-walletauth/wallet/implementation\"\n\nconst impl: Implementation = {\n  decrypt: (encryptedMessage: Uint8Array) =\u003e Promise\u003cUint8Array\u003e,\n  encrypt: (storage: Storage.Implementation, data: Uint8Array) =\u003e Promise\u003cUint8Array\u003e,\n  init: (storage: Storage.Implementation, args: InitArgs) =\u003e Promise\u003cvoid\u003e,\n  publicSignature: {\n    type: string\n    magicBytes: Uint8Array\n    key: (storage: Storage.Implementation) =\u003e Promise\u003cUint8Array\u003e\n  },\n  sign: (data: Uint8Array) =\u003e Promise\u003cUint8Array\u003e,\n  ucanAlgorithm: string,\n  username: () =\u003e Promise\u003cstring\u003e,\n  verifySignedMessage: (storage: Storage.Implementation, args: VerifyArgs) =\u003e Promise\u003cboolean\u003e,\n}\n\n// When creating a Program indicate that you want to use your custom wallet implementation.\nwalletauth.program({\n  wallet: impl\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foddsdk%2Fodd-walletauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foddsdk%2Fodd-walletauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foddsdk%2Fodd-walletauth/lists"}