diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..7aea60f --- /dev/null +++ b/.env.example @@ -0,0 +1,11 @@ +# Values are read in test/privy/integration/integration_test_helper.rb + +# Details of the Privy APP used for the integration tests +TEST_APP_ID= +TEST_APP_SECRET= + +# Details of the custom auth JWT used for resource ownership +JWT_AUTH_SK= + +# Test account details +TEST_APP_TEST_ACCOUNT_OTP= diff --git a/.github/workflows/branch-target.yml b/.github/workflows/branch-target.yml new file mode 100644 index 0000000..34ab64d --- /dev/null +++ b/.github/workflows/branch-target.yml @@ -0,0 +1,76 @@ +name: Branch Target + +on: + pull_request: + types: [opened, reopened, edited, synchronize] + +concurrency: + group: branch-target-${{ github.event.pull_request.number }} + cancel-in-progress: true + +permissions: + pull-requests: write + contents: read + +jobs: + check: + name: check + runs-on: ubuntu-24.04 + timeout-minutes: 5 + steps: + - name: Validate base branch and manage sticky comment + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 + with: + script: | + const MARKER = ''; + const EXEMPT_AUTHORS = new Set(['stainless-app[bot]']); + + const pr = context.payload.pull_request; + const baseRef = pr.base.ref; + const author = pr.user.login; + const isExempt = EXEMPT_AUTHORS.has(author); + const targetsMain = baseRef === 'main'; + const shouldFail = targetsMain && !isExempt; + + const { owner, repo } = context.repo; + const issue_number = pr.number; + + const comments = await github.paginate( + github.rest.issues.listComments, + { owner, repo, issue_number, per_page: 100 }, + ); + const existing = comments.find( + c => c.user?.login === 'github-actions[bot]' && c.body?.includes(MARKER), + ); + + if (shouldFail) { + const body = [ + `:warning: **This PR targets \`${baseRef}\`.**`, + '', + 'Feature branches in this SDK should target `next` — `main` is reserved for release PRs.', + 'Please change the base branch to `next` (or another stacked feature branch). If you believe `main` really is the right target, let a maintainer know.', + '', + MARKER, + ].join('\n'); + + if (existing) { + if (existing.body !== body) { + await github.rest.issues.updateComment({ owner, repo, comment_id: existing.id, body }); + } + } else { + await github.rest.issues.createComment({ owner, repo, issue_number, body }); + } + + core.setFailed(`PR #${issue_number} targets \`${baseRef}\`. Retarget to \`next\`.`); + return; + } + + if (existing) { + await github.rest.issues.deleteComment({ owner, repo, comment_id: existing.id }); + } + + core.info( + isExempt + ? `Author ${author} is exempt; skipping base-ref check.` + : `PR targets \`${baseRef}\`; no action needed.`, + ); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..84e667a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,112 @@ +name: CI +on: + push: + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' + +jobs: + build: + timeout-minutes: 10 + name: build + permissions: + contents: read + id-token: write + runs-on: ${{ github.repository == 'stainless-sdks/privy-api-client-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: |- + github.repository == 'stainless-sdks/privy-api-client-ruby' && + (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Ruby + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 + with: + bundler-cache: false + - run: |- + bundle install + + - name: Get GitHub OIDC Token + if: |- + github.repository == 'stainless-sdks/privy-api-client-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') + id: github-oidc + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Build and upload gem artifacts + if: |- + github.repository == 'stainless-sdks/privy-api-client-ruby' && + !startsWith(github.ref, 'refs/heads/stl/') + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + PACKAGE_NAME: privy + run: ./scripts/utils/upload-artifact.sh + lint: + timeout-minutes: 10 + name: lint + runs-on: ${{ github.repository == 'stainless-sdks/privy-api-client-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Ruby + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 + with: + bundler-cache: false + - run: |- + bundle install + + - name: Run lints + run: ./scripts/lint + test: + timeout-minutes: 10 + name: test + runs-on: ${{ github.repository == 'stainless-sdks/privy-api-client-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Ruby + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 + with: + bundler-cache: false + - run: |- + bundle install + + - name: Run tests + run: ./scripts/test + integration: + timeout-minutes: 10 + name: integration + runs-on: ${{ github.repository == 'stainless-sdks/privy-api-client-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: |- + (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next')) || + (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) + steps: + - uses: actions/checkout@v6 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: false + - run: |- + bundle install + + - name: Run integration tests + env: + TEST_APP_ID: ${{ secrets.TEST_APP_ID }} + TEST_APP_SECRET: ${{ secrets.TEST_APP_SECRET }} + JWT_AUTH_SK: ${{ secrets.JWT_AUTH_SK }} + TEST_APP_TEST_ACCOUNT_OTP: ${{ secrets.TEST_APP_TEST_ACCOUNT_OTP }} + TESTOPTS: "-v" + run: bundle exec rake test:integration diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..18827a6 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,19 @@ +name: PR Title +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + pull-requests: read # Read PR details + contents: read # Read repository content + +jobs: + conventional-commits: + timeout-minutes: 5 + name: conventional-commits + runs-on: ubuntu-24.04 + steps: + - uses: ytanikin/pr-conventional-commits@639145d78959c53c43112365837e3abd21ed67c1 + with: + task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","style","build","release"]' + add_label: 'false' diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 0000000..1bd1708 --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,31 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to rubygems.org in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/privy-io/ruby-sdk/actions/workflows/publish-gem.yml +name: Publish Gem +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Ruby + uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 + with: + bundler-cache: false + - run: |- + bundle install + + - name: Publish to RubyGems.org + run: | + bash ./bin/publish-gem + env: + # `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org + RUBYGEMS_HOST: ${{ secrets.PRIVY_API_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.PRIVY_API_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..e2966c0 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,22 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'privy-io/ruby-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + RUBYGEMS_HOST: ${{ secrets.PRIVY_API_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} + GEM_HOST_API_KEY: ${{ secrets.PRIVY_API_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03fc448 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +*.gem +.env +.idea/ +.ignore +.prism.log +.stdy.log +.ruby-lsp/ +.yardoc/ +bin/tapioca +Brewfile.lock.json +doc/ +sorbet/tapioca/* diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..3d2ac0b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.1.0" +} \ No newline at end of file diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..c435569 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,296 @@ +# yaml-language-server: $schema=https://www.rubyschema.org/rubocop.json +--- +# Explicitly disable pending cops for now. This is the default behaviour but +# this avoids a large warning every time we run it. +# Stop RuboCop nagging about rubocop-rake. +# Ensure that RuboCop validates according to the lowest version of Ruby that we support. +AllCops: + Exclude: + - "bin/*" + NewCops: enable + SuggestExtensions: false + TargetRubyVersion: 3.2 + +# Whether MFA is required or not should be left to the token configuration. +Gemspec/RequireMFA: + Enabled: false + +# Don't require this extra line break, it can be excessive. +Layout/EmptyLineAfterGuardClause: + Enabled: false + +# Don't leave complex assignment values hanging off to the right. +Layout/EndAlignment: + EnforcedStyleAlignWith: variable + +Layout/FirstArrayElementLineBreak: + Enabled: true + +Layout/FirstHashElementLineBreak: + Enabled: true + +Layout/FirstMethodArgumentLineBreak: + Enabled: true + +Layout/FirstMethodParameterLineBreak: + Enabled: true + +# Set a reasonable line length; rely on other cops to correct long lines. +Layout/LineLength: + AllowedPatterns: + - "^\\s*#.*$" + - ^require(_relative)? + - "Privy::Internal::Type::BaseModel$" + - "^\\s*[A-Z0-9_]+ = :" + - "Privy::(Models|Resources|Test)::" + Max: 110 + +Layout/MultilineArrayLineBreaks: + Enabled: true + +# Start the assignment on the same line variable is mentioned. +Layout/MultilineAssignmentLayout: + EnforcedStyle: same_line + +Layout/MultilineHashKeyLineBreaks: + Enabled: true + +Layout/MultilineMethodArgumentLineBreaks: + Enabled: true + +Layout/MultilineMethodParameterLineBreaks: + Enabled: true + +# Prefer compact hash literals. +Layout/SpaceInsideHashLiteralBraces: + EnforcedStyle: no_space + Exclude: + - "**/*.rbi" + +Lint/BooleanSymbol: + Enabled: false + +# This option occasionally mangles identifier names +Lint/DeprecatedConstants: + Exclude: + - "**/*.rbi" + +# We use pattern assertion in tests to ensure correctness. +Lint/DuplicateMatchPattern: + Exclude: + - "test/**/*" + +# Fairly useful in tests for pattern assertions. +Lint/EmptyInPattern: + Exclude: + - "test/**/*" + +Lint/MissingCopEnableDirective: + Exclude: + - "examples/**/*.rb" + +Lint/MissingSuper: + Exclude: + - "**/*.rbi" + +Lint/SymbolConversion: + Exclude: + - "**/*.rbi" + +# Disabled for safety reasons, this option changes code semantics. +Lint/UnusedMethodArgument: + AutoCorrect: false + +# This option is prone to causing accidental bugs. +Lint/UselessAssignment: + AutoCorrect: false + Exclude: + - "examples/**/*.rb" + +Metrics/AbcSize: + Enabled: false + +Metrics/BlockLength: + AllowedPatterns: + - assert_pattern + - type_alias + - define_sorbet_constant! + Exclude: + - "**/*.rbi" + +Metrics/ClassLength: + Enabled: false + +Metrics/CollectionLiteralLength: + Exclude: + - "test/**/*" + +Metrics/CyclomaticComplexity: + Enabled: false + +Metrics/MethodLength: + Enabled: false + +Metrics/ModuleLength: + Enabled: false + +Metrics/ParameterLists: + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false + +Naming/AccessorMethodName: + Enabled: false + +# Need to preserve block identifier for documentation. +Naming/BlockForwarding: + Enabled: false + +# Underscores are generally useful for disambiguation. +Naming/ClassAndModuleCamelCase: + Enabled: false + +Naming/MethodParameterName: + Enabled: false + +Naming/PredicatePrefix: + Exclude: + - "**/*.rbi" + +Naming/VariableNumber: + Enabled: false + +# Nothing wrong with inline private methods. +Style/AccessModifierDeclarations: + Enabled: false + +Style/AccessorGrouping: + Exclude: + - "**/*.rbi" + +# Behaviour of alias_method is more predictable. +Style/Alias: + EnforcedStyle: prefer_alias_method + +# And/or have confusing precedence, avoid them. +Style/AndOr: + EnforcedStyle: always + +Style/ArgumentsForwarding: + Enabled: false + +Style/BisectedAttrAccessor: + Exclude: + - "**/*.rbi" + +# We prefer nested modules in lib/, but are currently using compact style for tests. +Style/ClassAndModuleChildren: + Exclude: + - "test/**/*" + +Style/CommentAnnotation: + Enabled: false + +# We should go back and add these docs, but ignore for now. +Style/Documentation: + Enabled: false + +# Allow explicit empty elses, for clarity. +Style/EmptyElse: + Enabled: false + +Style/EmptyMethod: + Exclude: + - "**/*.rbi" + +# We commonly use ENV['KEY'], it's OK. +Style/FetchEnvVar: + Enabled: false + +# Just to be safe, ensure nobody is mutating our internal strings. +Style/FrozenStringLiteralComment: + EnforcedStyle: always + Exclude: + - "**/*.rbi" + +# Nothing wrong with clear if statements. +Style/IfUnlessModifier: + Enabled: false + +# Rubocop is pretty bad about mangling single line lambdas. +Style/Lambda: + Enabled: false + +# Prefer consistency in method calling syntax. +Style/MethodCallWithArgsParentheses: + AllowedMethods: + - raise + Enabled: true + Exclude: + - "**/*.gemspec" + +Style/MultilineBlockChain: + Enabled: false + +# Perfectly fine. +Style/MultipleComparison: + Enabled: false + +Style/MutableConstant: + Exclude: + - "**/*.rbi" + +# Not all parameters should be named. +Style/NumberedParameters: + Enabled: false + +Style/NumberedParametersLimit: + Max: 2 + +# Reasonable to use brackets for errors with long messages. +Style/RaiseArgs: + Enabled: false + +# Be explicit about `RuntimeError`s. +Style/RedundantException: + Enabled: false + +Style/RedundantInitialize: + Exclude: + - "**/*.rbi" + +Style/RedundantParentheses: + Exclude: + - "**/*.rbi" + +# Prefer slashes for regex literals. +Style/RegexpLiteral: + EnforcedStyle: slashes + +# Allow explicit ifs, especially for imperative use. +Style/SafeNavigation: + Enabled: false + +Style/SignalException: + Exclude: + - Rakefile + - "**/*.rake" + +# We use these sparingly, where we anticipate future branches for the +# inner conditional. +Style/SoleNestedConditional: + Enabled: false + +# Prefer double quotes so that interpolation can be easily added. +Style/StringLiterals: + EnforcedStyle: double_quotes + +# Prefer explicit symbols for clarity; you can search for `:the_symbol`. +Style/SymbolArray: + EnforcedStyle: brackets + +# This option makes examples harder to read for ruby novices. +Style/SymbolProc: + Exclude: + - "examples/**/*.rb" diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..944880f --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.0 diff --git a/.solargraph.yml b/.solargraph.yml new file mode 100644 index 0000000..ce6251e --- /dev/null +++ b/.solargraph.yml @@ -0,0 +1,11 @@ +--- +max_files: 0 +include: + - '*.gemspec' + - 'Rakefile' + - 'examples/**/*.rb' + - 'lib/**/*.rb' + - 'test/privy/resource_namespaces.rb' + - 'test/privy/test_helper.rb' +exclude: + - 'rbi/**/*' diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 0000000..3636621 --- /dev/null +++ b/.stats.yml @@ -0,0 +1,4 @@ +configured_endpoints: 67 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/privy/privy-api-client-96e87387ff0352ca538b3f41d4e983254fc34674357deff9944c532cdaf4ff2a.yml +openapi_spec_hash: 8439ca2d33ca07a10f9c0242264c8b4f +config_hash: 512a8289801c5057de19974f4566e42b diff --git a/.yardopts b/.yardopts new file mode 100644 index 0000000..84c12f2 --- /dev/null +++ b/.yardopts @@ -0,0 +1,6 @@ +--type-name-tag generic:Generic +--default-return void +--markup markdown +--markup-provider redcarpet +--exclude /rbi +--exclude /sig diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6cdb21e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changelog + +## 0.1.0 (2026-05-14) + +Full Changelog: [v0.0.1...v0.1.0](https://github.com/privy-io/ruby-sdk/compare/v0.0.1...v0.1.0) + +### Features + +* **api:** api update ([b7efbbc](https://github.com/privy-io/ruby-sdk/commit/b7efbbc57f39c88dca2f523a173f7d0afc408842)) +* **api:** api update ([43c983a](https://github.com/privy-io/ruby-sdk/commit/43c983a91a908531b9e28ce35085ccd8115c712c)) +* **api:** manual updates ([cc4c2cd](https://github.com/privy-io/ruby-sdk/commit/cc4c2cdc156e9a175310f0e508fb58073431fce1)) +* **authorization:** add JwtExchangeService with HPKE encryption ([#12](https://github.com/privy-io/ruby-sdk/issues/12)) ([318b652](https://github.com/privy-io/ruby-sdk/commit/318b652dac0bb74028227de5a65086258dc2be9a)) +* **authorization:** add user_jwts support to AuthorizationContext ([#16](https://github.com/privy-io/ruby-sdk/issues/16)) ([dfedc4e](https://github.com/privy-io/ruby-sdk/commit/dfedc4e07e64c92651b0a9a11400d86dd0242d31)) +* **authorization:** P-256 signing, RFC 8785 canonicalization, prepare helper ([#5](https://github.com/privy-io/ruby-sdk/issues/5)) ([8a7255f](https://github.com/privy-io/ruby-sdk/commit/8a7255fdc926592d143e0f6e863901d0d3fcd643)) +* **client:** add authorization_key_cache_max_capacity option ([#45](https://github.com/privy-io/ruby-sdk/issues/45)) ([3369bc7](https://github.com/privy-io/ruby-sdk/commit/3369bc7503f3e50bed56e8d74a034698c4c65671)) +* **client:** Privy::PrivyClient wraps generated Privy::Client ([#4](https://github.com/privy-io/ruby-sdk/issues/4)) ([7ffbbc6](https://github.com/privy-io/ruby-sdk/commit/7ffbbc693f0d04c37dd5e0b046a08492c3617ccc)) +* **key_quorums:** add create convenience wrapper with kwargs interface ([#27](https://github.com/privy-io/ruby-sdk/issues/27)) ([ff985f6](https://github.com/privy-io/ruby-sdk/commit/ff985f62766dbc5b2dcc0b19a76e17bcd9e96752)) +* **key_quorums:** add delete convenience wrapper with authorization support ([#29](https://github.com/privy-io/ruby-sdk/issues/29)) ([cce679b](https://github.com/privy-io/ruby-sdk/commit/cce679b71c0129b1a95f473326634debe22bffb4)) +* **key_quorums:** add update convenience wrapper with authorization support ([#28](https://github.com/privy-io/ruby-sdk/issues/28)) ([4a472e1](https://github.com/privy-io/ruby-sdk/commit/4a472e1650036d6ff57bf52b893c522c2a2f787b)) +* **key_quorums:** request_expiry kwarg on update/delete ([#38](https://github.com/privy-io/ruby-sdk/issues/38)) ([50aebac](https://github.com/privy-io/ruby-sdk/commit/50aebacefbcd992f82d531ac7b033db95e24513a)) +* **policies:** add create convenience wrapper with idempotency support ([#21](https://github.com/privy-io/ruby-sdk/issues/21)) ([4fb79c0](https://github.com/privy-io/ruby-sdk/commit/4fb79c0ec215dd56bcb231375b9917f78f461eef)) +* **policies:** add create_rule convenience wrapper with authorization support ([#24](https://github.com/privy-io/ruby-sdk/issues/24)) ([87d1511](https://github.com/privy-io/ruby-sdk/commit/87d1511493e7ede9ef1e5dcf7494b805bef2c01d)) +* **policies:** add delete convenience wrapper with authorization support ([#23](https://github.com/privy-io/ruby-sdk/issues/23)) ([7cfc41b](https://github.com/privy-io/ruby-sdk/commit/7cfc41b5113fc74db67a435d676d4aee2a5a5076)) +* **policies:** add delete_rule convenience wrapper with authorization support ([#26](https://github.com/privy-io/ruby-sdk/issues/26)) ([88b4f02](https://github.com/privy-io/ruby-sdk/commit/88b4f02d82095558b0cd3a229364657181cce243)) +* **policies:** add update convenience wrapper with authorization support ([#22](https://github.com/privy-io/ruby-sdk/issues/22)) ([94da7b6](https://github.com/privy-io/ruby-sdk/commit/94da7b694a0fcd91c7dfb806ac10962c5b50d20c)) +* **policies:** add update_rule convenience wrapper with authorization support ([#25](https://github.com/privy-io/ruby-sdk/issues/25)) ([39ee81d](https://github.com/privy-io/ruby-sdk/commit/39ee81dc15e0784f04e9b93c801c5de1acc9fb42)) +* **policies:** request_expiry kwarg on update/delete/*_rule ([#37](https://github.com/privy-io/ruby-sdk/issues/37)) ([0966ac3](https://github.com/privy-io/ruby-sdk/commit/0966ac3352bb339d5643264911af3e6c0b85c0bf)) +* **public_api:** add PrivyRequestExpiryOptions config struct ([#34](https://github.com/privy-io/ruby-sdk/issues/34)) ([df65372](https://github.com/privy-io/ruby-sdk/commit/df65372803e9ce8946ed67e3069e7a144059a920)) +* **public_api:** PrivyClient#compute_request_expiry resolver ([#35](https://github.com/privy-io/ruby-sdk/issues/35)) ([19ac733](https://github.com/privy-io/ruby-sdk/commit/19ac733a149a8f08a774c2200a85d214ade2991e)) +* **services:** wallets create/update/rpc auto-inject auth + idempotency headers ([#10](https://github.com/privy-io/ruby-sdk/issues/10)) ([d03a736](https://github.com/privy-io/ruby-sdk/commit/d03a736cb79b638b46bfcade04fa8e97a5d1b19a)) +* **users:** add create convenience wrapper with kwargs interface ([#33](https://github.com/privy-io/ruby-sdk/issues/33)) ([f93e451](https://github.com/privy-io/ruby-sdk/commit/f93e4519775e1cb2c4fbe21e6dad68d63ac30daf)) +* **wallets:** add raw_sign and transfer convenience wrappers ([#18](https://github.com/privy-io/ruby-sdk/issues/18)) ([b4f1d1c](https://github.com/privy-io/ruby-sdk/commit/b4f1d1c4e61a8b101cad35aa108b3a8e267be234)) +* **wallets:** request_expiry kwarg on update/rpc/raw_sign/transfer ([#36](https://github.com/privy-io/ruby-sdk/issues/36)) ([f8e1074](https://github.com/privy-io/ruby-sdk/commit/f8e10746f833fac3bf4e4096d78b05983995e261)) + + +### Bug Fixes + +* classes resulting from intersections cannot have union parents ([1abe573](https://github.com/privy-io/ruby-sdk/commit/1abe5731705a3db306793be1c6ca374923b8fe10)) +* **client:** elide content type header on requests without body ([6741307](https://github.com/privy-io/ruby-sdk/commit/67413078f14b5dcb0dbca3acd35435765729ab4c)) +* **gen:** resolve lint errors in generated models ([#2](https://github.com/privy-io/ruby-sdk/issues/2)) ([5ed45a4](https://github.com/privy-io/ruby-sdk/commit/5ed45a46a0f1dea5bd413ecc4f0bfdbea8e49139)) +* **integration-tests:** isolate user data per test run ([#41](https://github.com/privy-io/ruby-sdk/issues/41)) ([a6ae14b](https://github.com/privy-io/ruby-sdk/commit/a6ae14b449eefc63cbb141f1840c21f2d545635f)) +* rename gem to privy_ruby ([#44](https://github.com/privy-io/ruby-sdk/issues/44)) ([b27c0dd](https://github.com/privy-io/ruby-sdk/commit/b27c0dd09e1f037375d97c5dbc86ce77c640b3cc)) + + +### Chores + +* **test:** print test names via TESTOPTS=-v in scripts/test ([#3](https://github.com/privy-io/ruby-sdk/issues/3)) ([6dcc2eb](https://github.com/privy-io/ruby-sdk/commit/6dcc2ebaac142a5e79434f6e7ce7dd38568fae1f)) + + +### Documentation + +* add CLAUDE.md with repo conventions and pitfalls ([#9](https://github.com/privy-io/ruby-sdk/issues/9)) ([ace5249](https://github.com/privy-io/ruby-sdk/commit/ace52499c509ba468f3c8c0ea7471aaf2bd8f02e)) +* document request-expiry configuration; ([#40](https://github.com/privy-io/ruby-sdk/issues/40)) ([e5b543b](https://github.com/privy-io/ruby-sdk/commit/e5b543bda950ca74fa3fd546544c6d1c11ea2bce)) + + +### Refactors + +* consolidate Privy::Authorization::Crypto into Privy::Cryptography ([#14](https://github.com/privy-io/ruby-sdk/issues/14)) ([8f096f7](https://github.com/privy-io/ruby-sdk/commit/8f096f7295ad41d7939805bae7d14a2d2dc22f24)) +* move signed_url and merge_prepared_headers to Authorization module ([#20](https://github.com/privy-io/ruby-sdk/issues/20)) ([f789358](https://github.com/privy-io/ruby-sdk/commit/f7893587bbb7926c96305660cd501dacfd602f3a)) +* **public_api:** drop content-type workarounds now obsolete ([#42](https://github.com/privy-io/ruby-sdk/issues/42)) ([afd9886](https://github.com/privy-io/ruby-sdk/commit/afd98860bbb3ceeabc45f07510ccef0ab11b8789)) +* rename authorization methods for cross-SDK consistency ([#15](https://github.com/privy-io/ruby-sdk/issues/15)) ([0ee0513](https://github.com/privy-io/ruby-sdk/commit/0ee05135eaa5e027e0350e9fc48f669549cf6f44)) +* rename prepare → prepare_request, align with Node SDK ([#17](https://github.com/privy-io/ruby-sdk/issues/17)) ([0fef5d2](https://github.com/privy-io/ruby-sdk/commit/0fef5d2b6a54b94fbbde13ec1e0c124382b22b61)) +* **wallets:** convert create/update/rpc to explicit kwargs interface ([#19](https://github.com/privy-io/ruby-sdk/issues/19)) ([575ccf4](https://github.com/privy-io/ruby-sdk/commit/575ccf4d6fe071b55478528ec9aa65efd5a6f2c9)) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..2a99ce7 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,165 @@ +# privy + +Ruby SDK for the Privy API. Stainless-generated core with a hand-authored `Privy::PrivyClient` + services layer composed on top. + +## Commands + +```bash +bundle install +bundle exec rake test # unit tests (WebMock-mocked, offline) +bundle exec rake test:integration # live-backend tests against staging; requires .env +PRIVY_LOG_HTTP=1 bundle exec rake test:integration # with readable HTTP traces +bundle exec rake lint # lint +``` + +## Directory Structure + +``` +lib/privy.rb # Top-level require graph; custom requires at the bottom +lib/privy/client.rb # GENERATED top-level API client +lib/privy/resources/ models/ internal/ # GENERATED service classes, model shapes, transport +lib/privy/public_api/ # CUSTOM Privy::PrivyClient + service wrappers +lib/privy/authorization/ # CUSTOM P-256 signing, RFC 8785 canonicalization, AuthorizationContext +test/privy/**/*_test.rb # Unit tests (WebMock blocks net) +test/privy/integration/ # Live-backend tests (needs .env) +.env # Gitignored; TEST_APP_ID, TEST_APP_SECRET, optional TEST_API_URL +``` + +## Key Patterns + +### Put new code under `public_api/` or `authorization/` — avoid editing generated files + +Stainless regenerates its files upstream and merges the regenerated versions back via git. Edits to generated files aren't silently clobbered, but they can trigger merge conflicts on the next regen and leave your custom logic divorced from what the generator produces. Keep custom logic in the custom tree unless there's no alternative. + +DO put new code under `lib/privy/public_api/` or `lib/privy/authorization/`: + +```ruby +# lib/privy/public_api/services/wallets.rb +class Privy::Services::Wallets < Privy::Resources::Wallets + def create(params = {}); end +end +``` + +DON'T edit generated files when a wrapper works: + +```ruby +# lib/privy/resources/wallets.rb — GENERATED; edits here conflict on regen +def create(params); end +``` + +### Custom services subclass generated resources — call `super` to delegate + +Services under `public_api/services/` inherit from the matching `Privy::Resources::*` and override only the methods that need header injection. Constructor takes both the generated `client:` and the custom `privy_client:`. + +DO subclass and call `super`: + +```ruby +class Privy::Services::Wallets < Privy::Resources::Wallets + attr_reader :privy_client + + def initialize(client:, privy_client:) + super(client: client) + @privy_client = privy_client + end + + def update(wallet_id, params = {}) + # header injection + super(wallet_id, params) + end +end +``` + +DON'T duplicate generated logic or skip `super`: + +```ruby +class Privy::Services::Wallets + def update(wallet_id, params = {}) + @client.request(method: :patch, path: "v1/wallets/#{wallet_id}", ...) + end +end +``` + +### Flat public class names despite subdir organization + +Files under `public_api/` and `authorization/` declare classes directly under `Privy::*`, not a namespace matching the path. Load order is explicit via `require_relative` in `lib/privy.rb`; no Zeitwerk. + +DO: a file at `lib/privy/public_api/privy_client.rb` declares `Privy::PrivyClient`: + +```ruby +module Privy + class PrivyClient; end +end +``` + +DON'T nest the namespace to match the path: + +```ruby +module Privy::PublicApi + class PrivyClient; end +end +``` + +### Integration tests re-enable net connect; unit tests stay offline + +`test/privy/test_helper.rb` blocks net via WebMock. The integration base class `Privy::Test::IntegrationTest` flips it back on in `setup` and skips when `.env` is missing. Put live-backend tests only under `test/privy/integration/`. + +DO: unit test with WebMock stubs, anywhere under `test/privy/`: + +```ruby +class Privy::Services::WalletsTest < Minitest::Test + include WebMock::API + def test_create_sends_idempotency_header + stub = stub_request(:post, "https://api.staging.privy.io/v1/wallets") + .with(headers: {"privy-idempotency-key" => "idem-1"}) + client.wallets.create(chain_type: :ethereum, idempotency_key: "idem-1") + assert_requested stub + end +end +``` + +DO: integration test under `test/privy/integration/` via the base class: + +```ruby +class Privy::Test::Integration::WalletsTest < Privy::Test::IntegrationTest + def test_create_ownerless_ethereum_wallet_returns_id_and_address + wallet = client.wallets.create(chain_type: :ethereum) + assert_equal(:ethereum, wallet.chain_type) + end +end +``` + +DON'T place live-backend tests outside `test/privy/integration/`: + +```ruby +# test/privy/services/wallets_test.rb +def test_hits_real_api + client.wallets.create(chain_type: :ethereum) # Fails: WebMock blocks net +end +``` + +### Compute authorization headers via `Privy::Authorization.prepare` — don't hand-roll signatures + +For mutating methods (update, rpc, raw_sign, transfer), use the helper to canonicalize the payload (RFC 8785), sign with any keys / `sign_fns` in the `AuthorizationContext`, and compose `privy-authorization-signature`, `privy-idempotency-key`, and `privy-request-expiry` in one call. + +DO: + +```ruby +prepared = Privy::Authorization.prepare( + privy_client, + method: :patch, + url: "#{api_base_url}v1/wallets/#{wallet_id}", + body: params, + authorization_context: authorization_context, + idempotency_key: idempotency_key, + request_expiry: request_expiry +) +params.merge!(prepared.headers.transform_keys { |k| k.tr("-", "_").to_sym }) +``` + +DON'T build headers by hand: + +```ruby +json = params.to_json +sig = OpenSSL::PKey.read(Base64.strict_decode64(pk)).sign("SHA256", json) +headers["privy-authorization-signature"] = Base64.strict_encode64(sig) +``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6ccd940 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,119 @@ +## Setting up the environment + +This repository contains a `.ruby-version` file, which should work with either [rbenv](https://github.com/rbenv/rbenv) or [asdf](https://github.com/asdf-vm/asdf) with the [ruby plugin](https://github.com/asdf-vm/asdf-ruby). + +Please follow the instructions for your preferred version manager to install the Ruby version specified in the `.ruby-version` file. + +To set up the repository, run: + +```bash +$ ./scripts/bootstrap +``` + +This will install all the required dependencies. + +## Modifying/Adding code + +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/privy/helpers/` and `examples/` directory. + +## Adding and running examples + +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. + +```ruby +#!/usr/bin/env ruby +# frozen_string_literal: true + +require_relative "../lib/privy" + +# ... +``` + +```bash +$ chmod +x './examples/.rb' + +# run the example against your api +$ ruby './examples/.rb' +``` + +## Using the repository from source + +If you’d like to use the repository from source, you can either install from git or reference a cloned repository: + +To install via git in your `Gemfile`: + +```ruby +gem "privy_ruby", git: "https://github.com/privy-io/ruby-sdk" +``` + +Alternatively, reference local copy of the repo: + +```bash +$ git clone -- 'https://github.com/privy-io/ruby-sdk' '' +``` + +```ruby +gem "privy_ruby", path: "" +``` + +## Running commands + +Running `rake` by itself will show all runnable commands. + +```bash +$ bundle exec rake +``` + +## Running tests + +```bash +$ bundle exec rake test +``` + +## Linting and formatting + +This repository uses [rubocop](https://github.com/rubocop/rubocop) for linting and formatting of `*.rb` files; And [syntax_tree](https://github.com/ruby-syntax-tree/syntax_tree) is used for formatting of both `*.rbi` and `*.rbs` files. + +There are two separate type checkers supported by this library: [sorbet](https://github.com/sorbet/sorbet) and [steep](https://github.com/soutaro/steep) are used for verifying `*.rbi` and `*.rbs` files respectively. + +To lint and typecheck: + +```bash +$ bundle exec rake lint +``` + +To format and fix all lint issues automatically: + +```bash +$ bundle exec rake format +``` + +## Editor Support + +### Ruby LSP + +[Ruby LSP](https://github.com/Shopify/ruby-lsp) has quite good support for go to definition, but not auto-completion. + +This can be installed along side Solargraph. + +### Solargraph + +[Solargraph](https://solargraph.org) has quite good support for auto-completion, but not go to definition. + +This can be installed along side Ruby LSP. + +### Sorbet + +[Sorbet](https://sorbet.org) should mostly work out of the box when editing this library directly. However, there are a some caveats due to the colocation of `*.rb` and `*.rbi` files in the same project. These issues should not otherwise manifest when this library is used as a dependency. + +1. For go to definition usages, sorbet might get confused and may not always navigate to the correct location. + +2. For each generic type in `*.rbi` files, a spurious "Duplicate type member" error is present. + +## Documentation Preview + +To preview the documentation, run: + +```bash +$ bundle exec rake docs:preview [PORT=8808] +``` diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..3f819e7 --- /dev/null +++ b/Gemfile @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +gemspec + +group :development do + gem "rake" + gem "rbs" + gem "rubocop" + gem "sorbet" + gem "steep" + gem "syntax_tree" + gem "syntax_tree-rbs", github: "ruby-syntax-tree/syntax_tree-rbs", branch: "main" + gem "tapioca" +end + +group :development, :test do + gem "async" + gem "minitest" + gem "minitest-focus" + gem "minitest-hooks" + gem "minitest-proveit" + gem "minitest-rg" + gem "webmock" +end + +group :development, :docs do + gem "redcarpet" + gem "webrick" + gem "yard" +end + +group :test do + gem "dotenv", "~> 3.1" + gem "jwt" +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..2252967 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,237 @@ +GIT + remote: https://github.com/ruby-syntax-tree/syntax_tree-rbs.git + revision: f94bc3060682ffbd126e4d5086ffedc89073d626 + branch: main + specs: + syntax_tree-rbs (1.0.0) + prettier_print + rbs + syntax_tree (>= 2.0.1) + +PATH + remote: . + specs: + privy_ruby (0.1.0) + cgi + connection_pool + hpke + +GEM + remote: https://rubygems.org/ + specs: + activesupport (8.1.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + ast (2.4.3) + async (2.34.0) + console (~> 1.29) + fiber-annotation + io-event (~> 1.11) + metrics (~> 0.12) + traces (~> 0.18) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) + cgi (0.5.1) + concurrent-ruby (1.3.5) + connection_pool (2.5.4) + console (1.34.2) + fiber-annotation + fiber-local (~> 1.1) + json + crack (1.0.1) + bigdecimal + rexml + csv (3.3.5) + dotenv (3.2.0) + drb (2.2.3) + erubi (1.13.1) + ffi (1.17.2-aarch64-linux-gnu) + ffi (1.17.2-aarch64-linux-musl) + ffi (1.17.2-arm64-darwin) + ffi (1.17.2-x86_64-darwin) + ffi (1.17.2-x86_64-linux-gnu) + ffi (1.17.2-x86_64-linux-musl) + fiber-annotation (0.2.0) + fiber-local (1.1.0) + fiber-storage + fiber-storage (1.0.1) + fileutils (1.8.0) + hashdiff (1.2.1) + hpke (1.0.0) + openssl (~> 3.3.0, >= 3.0) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + io-event (1.11.2) + json (2.15.2) + jwt (3.1.2) + base64 + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) + metrics (0.15.0) + minitest (5.26.0) + minitest-focus (1.4.0) + minitest (>= 4, < 6) + minitest-hooks (1.5.2) + minitest (> 5.3) + minitest-proveit (1.0.0) + minitest (> 5, < 7) + minitest-rg (5.3.0) + minitest (~> 5.0) + mutex_m (0.3.0) + netrc (0.11.0) + openssl (3.3.2) + parallel (1.27.0) + parser (3.3.10.0) + ast (~> 2.4.1) + racc + prettier_print (1.2.1) + prism (1.6.0) + public_suffix (6.0.2) + racc (1.8.1) + rainbow (3.1.1) + rake (13.3.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rbi (0.3.7) + prism (~> 1.0) + rbs (>= 3.4.4) + rbs (3.9.5) + logger + redcarpet (3.6.1) + regexp_parser (2.11.3) + rexml (3.4.4) + rubocop (1.81.7) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.47.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.47.1) + parser (>= 3.3.7.2) + prism (~> 1.4) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + sorbet (0.6.12690) + sorbet-static (= 0.6.12690) + sorbet-runtime (0.6.12690) + sorbet-static (0.6.12690-aarch64-linux) + sorbet-static (0.6.12690-universal-darwin) + sorbet-static (0.6.12690-x86_64-linux) + sorbet-static-and-runtime (0.6.12690) + sorbet (= 0.6.12690) + sorbet-runtime (= 0.6.12690) + spoom (1.6.3) + erubi (>= 1.10.0) + prism (>= 0.28.0) + rbi (>= 0.3.3) + rexml (>= 3.2.6) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) + steep (1.10.0) + activesupport (>= 5.1) + concurrent-ruby (>= 1.1.10) + csv (>= 3.0.9) + fileutils (>= 1.1.0) + json (>= 2.1.0) + language_server-protocol (>= 3.17.0.4, < 4.0) + listen (~> 3.0) + logger (>= 1.3.0) + mutex_m (>= 0.3.0) + parser (>= 3.1) + rainbow (>= 2.2.2, < 4.0) + rbs (~> 3.9) + securerandom (>= 0.1) + strscan (>= 1.0.0) + terminal-table (>= 2, < 5) + uri (>= 0.12.0) + strscan (3.1.5) + syntax_tree (6.3.0) + prettier_print (>= 1.2.0) + tapioca (0.16.11) + benchmark + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (~> 0.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.2.0) + thor (>= 1.2.0) + yard-sorbet + terminal-table (4.0.0) + unicode-display_width (>= 1.1.1, < 4) + thor (1.4.0) + traces (0.18.2) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.1.0) + webmock (3.26.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.9.1) + yard (0.9.37) + yard-sorbet (0.9.0) + sorbet-runtime + yard + +PLATFORMS + aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm64-darwin + universal-darwin + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl + +DEPENDENCIES + async + dotenv (~> 3.1) + jwt + minitest + minitest-focus + minitest-hooks + minitest-proveit + minitest-rg + privy_ruby! + rake + rbs + redcarpet + rubocop + sorbet + steep + syntax_tree + syntax_tree-rbs! + tapioca + webmock + webrick + yard + +BUNDLED WITH + 2.4.1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b231233 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2026 Privy API + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 8e007a0..28affe0 100644 --- a/README.md +++ b/README.md @@ -1 +1,300 @@ -# privy-api-client-ruby \ No newline at end of file +# Privy API Ruby API library + +The Privy API Ruby library provides convenient access to the Privy API REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/privy-io/ruby-sdk#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. + +It is generated with [Stainless](https://www.stainless.com/). + +## Documentation + +Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/privy_ruby). + +The REST API documentation can be found on [docs.privy.io](https://docs.privy.io). + +## Installation + +To use this gem, install via Bundler by adding the following to your application's `Gemfile`: + + + +```ruby +gem "privy_ruby", "~> 0.1.0" +``` + + + +## Usage + +```ruby +require "bundler/setup" +require "privy" + +privy_api = Privy::Client.new( + app_id: ENV["PRIVY_APP_ID"], # This is the default and can be omitted + app_secret: ENV["PRIVY_APP_SECRET"], # This is the default and can be omitted + environment: "staging" # defaults to "production" +) + +wallet = privy_api.wallets.get("wallet_id") + +puts(wallet.id) +``` + +### Pagination + +List methods in the Privy API API are paginated. + +This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually: + +```ruby +page = privy_api.wallets.list + +# Fetch single item from page. +wallet = page.data[0] +puts(wallet.id) + +# Automatically fetches more pages as needed. +page.auto_paging_each do |wallet| + puts(wallet.id) +end +``` + +Alternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages. + +```ruby +if page.next_page? + new_page = page.next_page + puts(new_page.data[0].id) +end +``` + +### Handling errors + +When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Privy::Errors::APIError` will be thrown: + +```ruby +begin + wallet = privy_api.wallets.get("wallet_id") +rescue Privy::Errors::APIConnectionError => e + puts("The server could not be reached") + puts(e.cause) # an underlying Exception, likely raised within `net/http` +rescue Privy::Errors::RateLimitError => e + puts("A 429 status code was received; we should back off a bit.") +rescue Privy::Errors::APIStatusError => e + puts("Another non-200-range status code was received") + puts(e.status) +end +``` + +Error codes are as follows: + +| Cause | Error Type | +| ---------------- | -------------------------- | +| HTTP 400 | `BadRequestError` | +| HTTP 401 | `AuthenticationError` | +| HTTP 403 | `PermissionDeniedError` | +| HTTP 404 | `NotFoundError` | +| HTTP 409 | `ConflictError` | +| HTTP 422 | `UnprocessableEntityError` | +| HTTP 429 | `RateLimitError` | +| HTTP >= 500 | `InternalServerError` | +| Other HTTP error | `APIStatusError` | +| Timeout | `APITimeoutError` | +| Network error | `APIConnectionError` | + +### Retries + +Certain errors will be automatically retried 2 times by default, with a short exponential backoff. + +Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default. + +You can use the `max_retries` option to configure or disable this: + +```ruby +# Configure the default for all requests: +privy_api = Privy::Client.new( + max_retries: 0 # default is 2 +) + +# Or, configure per-request: +privy_api.wallets.get("wallet_id", request_options: {max_retries: 5}) +``` + +### Timeouts + +By default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this: + +```ruby +# Configure the default for all requests: +privy_api = Privy::Client.new( + timeout: nil # default is 60 +) + +# Or, configure per-request: +privy_api.wallets.get("wallet_id", request_options: {timeout: 5}) +``` + +On timeout, `Privy::Errors::APITimeoutError` is raised. + +Note that requests that time out are retried by default. + +### Configuring request expiry + +Authorized methods on `Privy::PrivyClient` (`wallets.update` / `rpc` / `raw_sign` / `transfer`, `policies.update` / `delete` / `create_rule` / `update_rule` / `delete_rule`, `key_quorums.update` / `delete`) auto-set the `privy-request-expiry` header to 15 minutes from now by default. + +Override the default at the client level: + +```ruby +client = Privy::PrivyClient.new( + app_id: ENV["PRIVY_APP_ID"], + app_secret: ENV["PRIVY_APP_SECRET"], + request_expiry: Privy::PrivyRequestExpiryOptions.build(default_ms: 60_000) +) +``` + +Disable the auto-set entirely: + +```ruby +client = Privy::PrivyClient.new( + app_id: ENV["PRIVY_APP_ID"], + app_secret: ENV["PRIVY_APP_SECRET"], + request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true) +) +``` + +Override on a single call (absolute Unix-ms timestamp; takes precedence over both `default_ms` and `disabled`): + +```ruby +client.wallets.rpc( + wallet.id, + wallet_rpc_request_body: {...}, + authorization_context: ctx, + request_expiry: Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + 60_000 +) +``` + +## Advanced concepts + +### BaseModel + +All parameter and response objects inherit from `Privy::Internal::Type::BaseModel`, which provides several conveniences, including: + +1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax. + +2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true. + +3. Both instances and the classes themselves can be pretty-printed. + +4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`. + +### Making custom or undocumented requests + +#### Undocumented properties + +You can send undocumented parameters to any endpoint, and read undocumented response properties, like so: + +Note: the `extra_` parameters of the same name overrides the documented parameters. + +```ruby +wallet = + privy_api.wallets.get( + "wallet_id", + request_options: { + extra_query: {my_query_parameter: value}, + extra_body: {my_body_parameter: value}, + extra_headers: {"my-header": value} + } + ) + +puts(wallet[:my_undocumented_property]) +``` + +#### Undocumented request params + +If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above. + +#### Undocumented endpoints + +To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so: + +```ruby +response = client.request( + method: :post, + path: '/undocumented/endpoint', + query: {"dog": "woof"}, + headers: {"useful-header": "interesting-value"}, + body: {"hello": "world"} +) +``` + +### Concurrency & connection pooling + +The `Privy::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests. + +Each instance of `Privy::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings. + +When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout. + +Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure. + +## Sorbet + +This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime. + +You can provide typesafe request parameters like so: + +```ruby +privy_api.wallets.get("wallet_id") +``` + +Or, equivalently: + +```ruby +# Hashes work, but are not typesafe: +privy_api.wallets.get("wallet_id") + +# You can also splat a full Params class: +params = Privy::WalletGetParams.new +privy_api.wallets.get("wallet_id", **params) +``` + +### Enums + +Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime: + +```ruby +# :ethereum +puts(Privy::WalletChainType::ETHEREUM) + +# Revealed type: `T.all(Privy::WalletChainType, Symbol)` +T.reveal_type(Privy::WalletChainType::ETHEREUM) +``` + +Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: + +```ruby +# Using the enum constants preserves the tagged type information: +privy_api.wallets.create( + chain_type: Privy::WalletChainType::ETHEREUM, + # … +) + +# Literal values are also permissible: +privy_api.wallets.create( + chain_type: :ethereum, + # … +) +``` + +## Versioning + +This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time. + +This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes. + +## Requirements + +Ruby 3.2.0 or higher. + +## Contributing + +See [the contributing documentation](https://github.com/privy-io/ruby-sdk/tree/main/CONTRIBUTING.md). diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..e00dbb1 --- /dev/null +++ b/Rakefile @@ -0,0 +1,194 @@ +# frozen_string_literal: true + +require "pathname" +require "securerandom" +require "shellwords" + +require "minitest/test_task" +require "rake/clean" +require "rubocop/rake_task" + +tapioca = "sorbet/tapioca" +examples = "examples" +ignore_file = ".ignore" + +FILES_ENV = "FORMAT_FILE" + +CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file) + +CLOBBER.push(*%w[sorbet/rbi/annotations/ sorbet/rbi/gems/], tapioca) + +multitask(:default) do + sh(*%w[rake --tasks]) +end + +desc("Preview docs; use `PORT=` to change the port") +multitask(:"docs:preview") do + sh(*%w[yard server --reload --quiet --bind [::] --port], ENV.fetch("PORT", "8808")) +end + +desc("Run test suites; use `TEST=path/to/test.rb` to run a specific test file, `TESTOPTS=-v` for verbose") +multitask(:test) do + files = + if ENV.key?("TEST") + FileList[ENV.fetch("TEST")] + else + FileList["./test/**/*_test.rb"].exclude("./test/privy/integration/**/*_test.rb") + end + + rb = files.map { "require_relative(#{_1.dump});" }.join + + testopts = ENV["TESTOPTS"].to_s.shellsplit + ruby(*%w[-w -e], rb, "--", *testopts, verbose: false) { fail unless _1 } +end + +namespace :test do + desc("Run integration test suite against live backend") + multitask(:integration) do + files = + if ENV.key?("TEST") + FileList[ENV.fetch("TEST")] + else + FileList["./test/privy/integration/**/*_test.rb"] + end + + rb = files.map { "require_relative(#{_1.dump});" }.join + + testopts = ENV["TESTOPTS"].to_s.shellsplit + ruby(*%w[-w -e], rb, "--", *testopts, verbose: false) { fail unless _1 } + end +end + +xargs = %w[xargs --no-run-if-empty --null --max-procs=0 --max-args=300 --] +ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")} + +filtered = ->(ext, dirs) do + if ENV.key?(FILES_ENV) + %w[sed -E -n -e] << "/\\.#{ext}$/p" << "--" << ENV.fetch(FILES_ENV) + else + (%w[find] + dirs + %w[-type f -and -name]) << "*.#{ext}" << "-print0" + end +end + +desc("Lint `*.rb(i)`") +multitask(:"lint:rubocop") do + find = %w[find ./lib ./test ./rbi ./examples -type f -and ( -name *.rb -or -name *.rbi ) -print0] + + rubocop = %w[rubocop] + rubocop += %w[--format github] if ENV.key?("CI") + + # some lines cannot be shortened + rubocop += %w[--except Lint/RedundantCopDisableDirective,Layout/LineLength] + + lint = xargs + rubocop + sh("#{find.shelljoin} | #{lint.shelljoin}") +end + +norm_lines = %w[tr -- \n \0].shelljoin + +desc("Format `*.rb`") +multitask(:"format:rb") do + # while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support + files = filtered["rb", %w[./lib ./test ./examples]] + fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --] + sh("#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") +end + +desc("Format `*.rbi`") +multitask(:"format:rbi") do + files = filtered["rbi", %w[./rbi]] + fmt = xargs + %w[stree write --] + sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") +end + +desc("Format `*.rbs`") +multitask(:"format:rbs") do + files = filtered["rbs", %w[./sig]] + inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? ["-i", ""] : %w[-i] + uuid = SecureRandom.uuid + + # `syntax_tree` has trouble with `rbs`'s class & module aliases + + sed_bin = /darwin/ =~ RUBY_PLATFORM ? "/usr/bin/sed" : "sed" + sed = xargs + [sed_bin, "-E", *inplace, "-e"] + # annotate unprocessable aliases with a unique comment + pre = sed + ["s/(class|module) ([^ ]+) = (.+$)/# \\1 #{uuid}\\n\\2: \\3/", "--"] + fmt = xargs + %w[stree write --plugin=rbs --] + # remove the unique comment and unprocessable aliases to type aliases + subst = <<~SED + s/# (class|module) #{uuid}/\\1/ + t l1 + b + + : l1 + N + s/\\n *([^:]+): (.+)$/ \\1 = \\2/ + SED + # for each line: + # 1. try transform the unique comment into `class | module`, if successful, branch to label `l1`. + # 2. at label `l1`, join previously annotated line with `class | module` information. + pst = sed + [subst, "--"] + + success = false + + # transform class aliases to type aliases, which syntax tree has no trouble with + sh("#{files.shelljoin} | #{norm_lines} | #{pre.shelljoin}") + # run syntax tree to format `*.rbs` files + sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") do + success = _1 + end + # transform type aliases back to class aliases + sh("#{files.shelljoin} | #{norm_lines} | #{pst.shelljoin}") + + # always run post-processing to remove comment marker + fail unless success +end + +desc("Format everything") +multitask(format: [:"format:rb", :"format:rbi", :"format:rbs"]) + +desc("Typecheck `*.rbs`") +multitask(:"typecheck:steep") do + sh(*%w[steep check]) +end + +directory(examples) + +desc("Typecheck `*.rbi`") +multitask("typecheck:sorbet": examples) do + sh(*%w[srb typecheck --dir], examples) +end + +directory(tapioca) do + sh(*%w[tapioca init]) +end + +desc("Typecheck everything") +multitask(typecheck: [:"typecheck:steep", :"typecheck:sorbet"]) + +desc("Lint and typecheck") +multitask(lint: [:"lint:rubocop", :typecheck]) + +desc("Build yard docs") +multitask(:"build:docs") do + sh(*%w[yard]) +end + +desc("Build ruby gem") +multitask(:"build:gem") do + # optimizing for grepping through the gem bundle: many tools honour `.ignore` files, including VSCode + # + # both `rbi` and `sig` directories are navigable by their respective tool chains and therefore can be ignored by tools such as `rg` + Pathname(ignore_file).write(<<~GLOB) + rbi/* + sig/* + GLOB + + sh(*%w[gem build -- privy.gemspec]) + rm_rf(ignore_file) +end + +desc("Release ruby gem") +multitask(release: [:"build:gem"]) do + sh(*%w[gem push], *FileList["*.gem"]) +end diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..99cc5f3 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainless.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Privy API, please follow the respective company's security reporting guidelines. + +### Privy API Terms and Policies + +Please contact security@privy.io for any questions or concerns regarding the security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/Steepfile b/Steepfile new file mode 100644 index 0000000..528b48c --- /dev/null +++ b/Steepfile @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +require "yaml" + +target(:lib) do + configure_code_diagnostics(Steep::Diagnostic::Ruby.strict) + + signature("sig") + + YAML.safe_load_file("./manifest.yaml", symbolize_names: true) => {dependencies:} + # currently these libraries lack the `*.rbs` annotations required by `steep` + stdlibs = dependencies - %w[English etc net/http rbconfig set stringio] + + stdlibs.each { library(_1) } +end diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..c05436e --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${GEM_HOST_API_KEY}" ]; then + errors+=("The GEM_HOST_API_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/bin/publish-gem b/bin/publish-gem new file mode 100644 index 0000000..8444af2 --- /dev/null +++ b/bin/publish-gem @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail + +cd -- "$(dirname -- "$0")/.." + +bundle +find . -maxdepth 1 -type f -name "*.gem" -delete +rake release \ No newline at end of file diff --git a/examples/.keep b/examples/.keep new file mode 100644 index 0000000..d8c73e9 --- /dev/null +++ b/examples/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store example files demonstrating usage of this SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/lib/privy.rb b/lib/privy.rb new file mode 100644 index 0000000..300a49d --- /dev/null +++ b/lib/privy.rb @@ -0,0 +1,934 @@ +# frozen_string_literal: true + +# Standard libraries. +# rubocop:disable Lint/RedundantRequireStatement +require "English" +require "base64" +require "cgi" +require "date" +require "erb" +require "etc" +require "json" +require "net/http" +require "openssl" +require "pathname" +require "rbconfig" +require "securerandom" +require "set" +require "stringio" +require "time" +require "uri" +# rubocop:enable Lint/RedundantRequireStatement + +# We already ship the preferred sorbet manifests in the package itself. +# `tapioca` currently does not offer us a way to opt out of unnecessary compilation. +if Object.const_defined?(:Tapioca) && + caller.chain([$PROGRAM_NAME]).chain(ARGV).any?(/tapioca/) && + ARGV.none?(/dsl/) + return +end + +# Gems. +require "connection_pool" + +# Package files. +require_relative "privy/version" +require_relative "privy/internal/util" +require_relative "privy/internal/type/converter" +require_relative "privy/internal/type/unknown" +require_relative "privy/internal/type/boolean" +require_relative "privy/internal/type/file_input" +require_relative "privy/internal/type/enum" +require_relative "privy/internal/type/union" +require_relative "privy/internal/type/array_of" +require_relative "privy/internal/type/hash_of" +require_relative "privy/internal/type/base_model" +require_relative "privy/internal/type/base_page" +require_relative "privy/internal/type/request_parameters" +require_relative "privy/internal" +require_relative "privy/request_options" +require_relative "privy/file_part" +require_relative "privy/errors" +require_relative "privy/internal/transport/base_client" +require_relative "privy/internal/transport/pooled_net_requester" +require_relative "privy/client" +require_relative "privy/internal/cursor" +require_relative "privy/models/user_invite_input" +require_relative "privy/models/organization_secret_view" +require_relative "privy/models/embedded_wallet_input_schema" +require_relative "privy/models/policy_rule_request_body" +require_relative "privy/models/wallet_rpc_request_body" +require_relative "privy/models/transfer_request_body" +require_relative "privy/models/key_quorum_update_request_body" +require_relative "privy/models/wallet_update_request_body" +require_relative "privy/models/key_quorum_create_request_body" +require_relative "privy/models/base_intent_response" +require_relative "privy/models/linked_account_curve_signing_embedded_wallet" +require_relative "privy/models/linked_account_bitcoin_taproot_embedded_wallet" +require_relative "privy/models/linked_account_bitcoin_segwit_embedded_wallet" +require_relative "privy/models/linked_account_solana_embedded_wallet" +require_relative "privy/models/linked_account_ethereum_embedded_wallet" +require_relative "privy/models/user" +require_relative "privy/models/organization_secret_id_input" +require_relative "privy/models/wallet_authenticate_request_body" +require_relative "privy/models/wallet_export_request_body" +require_relative "privy/models/get_by_wallet_address_request_body" +require_relative "privy/models/raw_sign_input" +require_relative "privy/models/earn_incentive_claim_request_body" +require_relative "privy/models/earn_deposit_request_body" +require_relative "privy/models/earn_withdraw_request_body" +require_relative "privy/models/abi_parameter" +require_relative "privy/models/abi_schema" +require_relative "privy/models/account_balance_params" +require_relative "privy/models/account_balance_response" +require_relative "privy/models/account_display_name" +require_relative "privy/models/account_response" +require_relative "privy/models/accounts_dashboard_list_response" +require_relative "privy/models/accounts_list_response" +require_relative "privy/models/account_wallet" +require_relative "privy/models/account_wallet_configuration_item" +require_relative "privy/models/account_wallet_ids" +require_relative "privy/models/account_wallets_configuration" +require_relative "privy/models/action_request_body_condition" +require_relative "privy/models/additional_signer_input" +require_relative "privy/models/additional_signer_item_input" +require_relative "privy/models/address" +require_relative "privy/models/aggregation" +require_relative "privy/models/aggregation_condition" +require_relative "privy/models/aggregation_group_by" +require_relative "privy/models/aggregation_input" +require_relative "privy/models/aggregation_method" +require_relative "privy/models/aggregation_metric" +require_relative "privy/models/aggregation_window" +require_relative "privy/models/alchemy_paymaster_context" +require_relative "privy/models/allowlist_deletion_response" +require_relative "privy/models/allowlist_entry" +require_relative "privy/models/amount_type" +require_relative "privy/models/analytics_event_input" +require_relative "privy/models/app_get_gas_spend_params" +require_relative "privy/models/app_get_params" +require_relative "privy/models/app_get_test_credentials_params" +require_relative "privy/models/app_response" +require_relative "privy/models/apps/allowlist_create_params" +require_relative "privy/models/apps/allowlist_delete_params" +require_relative "privy/models/apps/allowlist_list_params" +require_relative "privy/models/apps/allowlist_list_response" +require_relative "privy/models/asset_account_with_balance" +require_relative "privy/models/authenticated_user" +require_relative "privy/models/authenticate_jwt_input" +require_relative "privy/models/authenticate_mode" +require_relative "privy/models/authenticate_mode_option" +require_relative "privy/models/authenticate_siwe_input" +require_relative "privy/models/authenticate_siws_input" +require_relative "privy/models/authorization_key_dashboard_response" +require_relative "privy/models/authorization_key_response" +require_relative "privy/models/authorization_key_role" +require_relative "privy/models/balance_asset" +require_relative "privy/models/balance_asset_by_chain" +require_relative "privy/models/balance_response" +require_relative "privy/models/base_action_result" +require_relative "privy/models/bridge_brl_fiat_virtual_account_deposit_instructions" +require_relative "privy/models/bridge_crypto_deposit_metadata" +require_relative "privy/models/bridge_crypto_transfer_metadata" +require_relative "privy/models/bridge_destination_asset" +require_relative "privy/models/bridge_eur_fiat_virtual_account_deposit_instructions" +require_relative "privy/models/bridge_fiat_customer_response" +require_relative "privy/models/bridge_fiat_deposit_metadata" +require_relative "privy/models/bridge_fiat_rejection_reason" +require_relative "privy/models/bridge_fiat_transfer_metadata" +require_relative "privy/models/bridge_fiat_virtual_account_deposit_instructions" +require_relative "privy/models/bridge_fiat_virtual_account_destination" +require_relative "privy/models/bridge_fiat_virtual_account_request" +require_relative "privy/models/bridge_fiat_virtual_account_response" +require_relative "privy/models/bridge_fiat_virtual_account_source" +require_relative "privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions" +require_relative "privy/models/bridge_metadata" +require_relative "privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions" +require_relative "privy/models/bridge_onramp_provider" +require_relative "privy/models/bridge_refund_metadata" +require_relative "privy/models/bridge_sandbox_fiat_customer_response" +require_relative "privy/models/bridge_sandbox_fiat_virtual_account_request" +require_relative "privy/models/bridge_sandbox_fiat_virtual_account_response" +require_relative "privy/models/bridge_source_asset" +require_relative "privy/models/bridge_static_memo_deposit_metadata" +require_relative "privy/models/bridge_transfer_refund_metadata" +require_relative "privy/models/bridge_usd_fiat_virtual_account_deposit_instructions" +require_relative "privy/models/caip_2" +require_relative "privy/models/caip_2_chain_id" +require_relative "privy/models/coinbase_blockchain" +require_relative "privy/models/coinbase_ethereum_asset" +require_relative "privy/models/coinbase_on_ramp_ethereum_address" +require_relative "privy/models/coinbase_on_ramp_init_ethereum_input" +require_relative "privy/models/coinbase_on_ramp_init_input" +require_relative "privy/models/coinbase_on_ramp_init_response" +require_relative "privy/models/coinbase_on_ramp_init_solana_input" +require_relative "privy/models/coinbase_on_ramp_solana_address" +require_relative "privy/models/coinbase_on_ramp_status" +require_relative "privy/models/coinbase_on_ramp_status_response" +require_relative "privy/models/coinbase_solana_asset" +require_relative "privy/models/condition_operator" +require_relative "privy/models/condition_set" +require_relative "privy/models/condition_set_authorization_headers" +require_relative "privy/models/condition_set_item" +require_relative "privy/models/condition_set_item_request_params" +require_relative "privy/models/condition_set_items" +require_relative "privy/models/condition_set_items_request_body" +require_relative "privy/models/condition_set_items_response" +require_relative "privy/models/condition_set_item_value_input" +require_relative "privy/models/condition_set_request_body" +require_relative "privy/models/condition_set_request_params" +require_relative "privy/models/condition_value" +require_relative "privy/models/create_account_from_wallet_ids_input" +require_relative "privy/models/create_account_from_wallets_configuration_input" +require_relative "privy/models/create_account_input" +require_relative "privy/models/create_organization_secret_response" +require_relative "privy/models/create_or_update_fiat_customer_request_input" +require_relative "privy/models/cross_app_connection" +require_relative "privy/models/cross_app_connections_response" +require_relative "privy/models/cross_app_embedded_wallet" +require_relative "privy/models/cross_app_smart_wallet" +require_relative "privy/models/crypto_currency_code" +require_relative "privy/models/currency" +require_relative "privy/models/currency_amount" +require_relative "privy/models/currency_asset" +require_relative "privy/models/curve_signing_chain_type" +require_relative "privy/models/curve_type" +require_relative "privy/models/custodial_wallet" +require_relative "privy/models/custodial_wallet_chain_type" +require_relative "privy/models/custodial_wallet_create_input" +require_relative "privy/models/custodial_wallet_provider" +require_relative "privy/models/custom_jwt_authenticate_request_body" +require_relative "privy/models/custom_jwt_link_request_body" +require_relative "privy/models/custom_metadata" +require_relative "privy/models/custom_oauth_provider_id" +require_relative "privy/models/custom_token_transfer_source" +require_relative "privy/models/earn_asset" +require_relative "privy/models/earn_deposit_action_response" +require_relative "privy/models/earn_incentive_claim_action_response" +require_relative "privy/models/earn_incetive_claim_reward_entry" +require_relative "privy/models/earn_withdraw_action_response" +require_relative "privy/models/email_domain" +require_relative "privy/models/email_domain_invite_input" +require_relative "privy/models/email_invite_input" +require_relative "privy/models/embedded_wallet_chain_config" +require_relative "privy/models/embedded_wallet_config_schema" +require_relative "privy/models/embedded_wallet_create_on_login" +require_relative "privy/models/embedded_wallet_creation_input" +require_relative "privy/models/embedded_wallet_mode" +require_relative "privy/models/embedded_wallet_recovery_method" +require_relative "privy/models/ethereum_7702_authorization_condition" +require_relative "privy/models/ethereum_calldata_condition" +require_relative "privy/models/ethereum_earn_position_query" +require_relative "privy/models/ethereum_earn_position_response" +require_relative "privy/models/ethereum_earn_provider" +require_relative "privy/models/ethereum_earn_vault_details_response" +require_relative "privy/models/ethereum_personal_sign_rpc_input" +require_relative "privy/models/ethereum_personal_sign_rpc_input_params" +require_relative "privy/models/ethereum_personal_sign_rpc_response" +require_relative "privy/models/ethereum_personal_sign_rpc_response_data" +require_relative "privy/models/ethereum_rpc_input" +require_relative "privy/models/ethereum_rpc_response" +require_relative "privy/models/ethereum_secp_256k_1_sign_rpc_input" +require_relative "privy/models/ethereum_secp_256k_1_sign_rpc_input_params" +require_relative "privy/models/ethereum_secp_256k_1_sign_rpc_response" +require_relative "privy/models/ethereum_secp_256k_1_sign_rpc_response_data" +require_relative "privy/models/ethereum_send_calls_call" +require_relative "privy/models/ethereum_send_calls_rpc_input" +require_relative "privy/models/ethereum_send_calls_rpc_input_params" +require_relative "privy/models/ethereum_send_calls_rpc_response" +require_relative "privy/models/ethereum_send_calls_rpc_response_data" +require_relative "privy/models/ethereum_send_transaction_rpc_input" +require_relative "privy/models/ethereum_send_transaction_rpc_input_params" +require_relative "privy/models/ethereum_send_transaction_rpc_response" +require_relative "privy/models/ethereum_send_transaction_rpc_response_data" +require_relative "privy/models/ethereum_sign_7702_authorization" +require_relative "privy/models/ethereum_sign_7702_authorization_rpc_input" +require_relative "privy/models/ethereum_sign_7702_authorization_rpc_input_params" +require_relative "privy/models/ethereum_sign_7702_authorization_rpc_response" +require_relative "privy/models/ethereum_sign_7702_authorization_rpc_response_data" +require_relative "privy/models/ethereum_sign_transaction_rpc_input" +require_relative "privy/models/ethereum_sign_transaction_rpc_input_params" +require_relative "privy/models/ethereum_sign_transaction_rpc_response" +require_relative "privy/models/ethereum_sign_transaction_rpc_response_data" +require_relative "privy/models/ethereum_sign_typed_data_rpc_input" +require_relative "privy/models/ethereum_sign_typed_data_rpc_input_params" +require_relative "privy/models/ethereum_sign_typed_data_rpc_response" +require_relative "privy/models/ethereum_sign_typed_data_rpc_response_data" +require_relative "privy/models/ethereum_sign_user_operation_rpc_input" +require_relative "privy/models/ethereum_sign_user_operation_rpc_input_params" +require_relative "privy/models/ethereum_sign_user_operation_rpc_response" +require_relative "privy/models/ethereum_sign_user_operation_rpc_response_data" +require_relative "privy/models/ethereum_transaction_condition" +require_relative "privy/models/ethereum_typed_data_domain_condition" +require_relative "privy/models/ethereum_typed_data_input" +require_relative "privy/models/ethereum_typed_data_message_condition" +require_relative "privy/models/ethereum_vault_details_input" +require_relative "privy/models/ethereum_vault_details_response" +require_relative "privy/models/ethereum_vault_position" +require_relative "privy/models/ethereum_vault_response" +require_relative "privy/models/ethereum_yield_claim_id_input" +require_relative "privy/models/ethereum_yield_claim_input" +require_relative "privy/models/ethereum_yield_claim_response" +require_relative "privy/models/ethereum_yield_claim_reward" +require_relative "privy/models/ethereum_yield_deposit_input" +require_relative "privy/models/ethereum_yield_position_response" +require_relative "privy/models/ethereum_yield_positions_input" +require_relative "privy/models/ethereum_yield_provider" +require_relative "privy/models/ethereum_yield_sweep_id_input" +require_relative "privy/models/ethereum_yield_sweep_response" +require_relative "privy/models/ethereum_yield_sweep_status" +require_relative "privy/models/ethereum_yield_sweep_type" +require_relative "privy/models/ethereum_yield_withdraw_input" +require_relative "privy/models/evm_caip_2_chain_id" +require_relative "privy/models/evm_transaction_wallet_action_step" +require_relative "privy/models/evm_user_operation_wallet_action_step" +require_relative "privy/models/evm_wallet_action_step_status" +require_relative "privy/models/export_private_key_rpc_input" +require_relative "privy/models/export_private_key_rpc_response" +require_relative "privy/models/export_seed_phrase_rpc_input" +require_relative "privy/models/export_seed_phrase_rpc_response" +require_relative "privy/models/export_type" +require_relative "privy/models/extended_chain_type" +require_relative "privy/models/external_oauth_provider_id" +require_relative "privy/models/external_transaction_wallet_action_step" +require_relative "privy/models/external_transaction_wallet_action_step_status" +require_relative "privy/models/failure_reason" +require_relative "privy/models/farcaster_authenticate_input" +require_relative "privy/models/farcaster_authenticate_request_body" +require_relative "privy/models/farcaster_connect_init_response" +require_relative "privy/models/farcaster_connect_init_response_body" +require_relative "privy/models/farcaster_connect_status_completed_response" +require_relative "privy/models/farcaster_connect_status_completed_response_body" +require_relative "privy/models/farcaster_connect_status_pending_response" +require_relative "privy/models/farcaster_connect_status_pending_response_body" +require_relative "privy/models/farcaster_init_input" +require_relative "privy/models/farcaster_init_request_body" +require_relative "privy/models/farcaster_link_input" +require_relative "privy/models/farcaster_link_request_body" +require_relative "privy/models/farcaster_signer_approved" +require_relative "privy/models/farcaster_signer_init_pending_approval" +require_relative "privy/models/farcaster_signer_init_request_body" +require_relative "privy/models/farcaster_signer_init_response_body" +require_relative "privy/models/farcaster_signer_revoked" +require_relative "privy/models/farcaster_signer_status_pending_approval" +require_relative "privy/models/farcaster_signer_status_response_body" +require_relative "privy/models/farcaster_unlink_input" +require_relative "privy/models/farcaster_unlink_request_body" +require_relative "privy/models/farcaster_v_2_authenticate_input" +require_relative "privy/models/farcaster_v_2_authenticate_request_body" +require_relative "privy/models/farcaster_v_2_init_input" +require_relative "privy/models/farcaster_v_2_init_request_body" +require_relative "privy/models/farcaster_v_2_init_response" +require_relative "privy/models/farcaster_v_2_init_response_body" +require_relative "privy/models/fiat_amount" +require_relative "privy/models/fiat_currency_code" +require_relative "privy/models/fiat_customer_response" +require_relative "privy/models/fiat_onramp_destination" +require_relative "privy/models/fiat_onramp_environment" +require_relative "privy/models/fiat_onramp_provider" +require_relative "privy/models/fiat_onramp_provider_error" +require_relative "privy/models/fiat_onramp_quote" +require_relative "privy/models/fiat_onramp_source" +require_relative "privy/models/fiat_onramp_transaction_status" +require_relative "privy/models/fiat_virtual_account_request" +require_relative "privy/models/fiat_virtual_account_response" +require_relative "privy/models/first_class_chain_type" +require_relative "privy/models/funding_config_response_schema" +require_relative "privy/models/funding_method_enum" +require_relative "privy/models/funding_option" +require_relative "privy/models/funds_deposited_webhook_payload" +require_relative "privy/models/funds_withdrawn_webhook_payload" +require_relative "privy/models/gas_spend_currency" +require_relative "privy/models/gas_spend_request_body" +require_relative "privy/models/gas_spend_response_body" +require_relative "privy/models/gas_sponsorship_configuration" +require_relative "privy/models/gas_sponsorship_configuration_input" +require_relative "privy/models/get_fiat_customer_request_input" +require_relative "privy/models/get_fiat_onramp_quotes_input" +require_relative "privy/models/get_fiat_onramp_quotes_response" +require_relative "privy/models/get_fiat_onramp_transaction_status_input" +require_relative "privy/models/get_fiat_onramp_transaction_status_response" +require_relative "privy/models/get_fiat_onramp_url_input" +require_relative "privy/models/get_fiat_onramp_url_response" +require_relative "privy/models/guest_authenticate_request_body" +require_relative "privy/models/hd_init_input" +require_relative "privy/models/hd_path" +require_relative "privy/models/hd_submit_input" +require_relative "privy/models/hex" +require_relative "privy/models/hpke_aead_algorithm" +require_relative "privy/models/hpke_encryption" +require_relative "privy/models/hpke_import_config" +require_relative "privy/models/icloud_client_type" +require_relative "privy/models/intent_authorization" +require_relative "privy/models/intent_authorization_key_quorum_member" +require_relative "privy/models/intent_authorization_member" +require_relative "privy/models/intent_authorized_webhook_payload" +require_relative "privy/models/intent_created_webhook_payload" +require_relative "privy/models/intent_create_policy_rule_params" +require_relative "privy/models/intent_creation_headers" +require_relative "privy/models/intent_delete_policy_rule_params" +require_relative "privy/models/intent_executed_webhook_payload" +require_relative "privy/models/intent_failed_webhook_payload" +require_relative "privy/models/intent_get_params" +require_relative "privy/models/intent_list_params" +require_relative "privy/models/intent_rejected_webhook_payload" +require_relative "privy/models/intent_response" +require_relative "privy/models/intent_rpc_params" +require_relative "privy/models/intent_status" +require_relative "privy/models/intent_transfer_params" +require_relative "privy/models/intent_type" +require_relative "privy/models/intent_update_key_quorum_params" +require_relative "privy/models/intent_update_policy_params" +require_relative "privy/models/intent_update_policy_rule_params" +require_relative "privy/models/intent_update_wallet_params" +require_relative "privy/models/key_quorum" +require_relative "privy/models/key_quorum_authorization_headers" +require_relative "privy/models/key_quorum_create_params" +require_relative "privy/models/key_quorum_delete_params" +require_relative "privy/models/key_quorum_get_params" +require_relative "privy/models/key_quorum_id" +require_relative "privy/models/key_quorum_intent_response" +require_relative "privy/models/key_quorum_update_params" +require_relative "privy/models/kraken_embed_current_day_pnl" +require_relative "privy/models/kraken_embed_get_asset_list_query_params_schema" +require_relative "privy/models/kraken_embed_get_portfolio_details_query_params_schema" +require_relative "privy/models/kraken_embed_get_portfolio_summary_query_params" +require_relative "privy/models/kraken_embed_get_portfolio_summary_response" +require_relative "privy/models/kraken_embed_get_portfolio_transactions_query_params_schema" +require_relative "privy/models/kraken_embed_get_quote_query_params" +require_relative "privy/models/kraken_embed_quote_cancelled_webhook_payload" +require_relative "privy/models/kraken_embed_quote_executed_webhook_payload" +require_relative "privy/models/kraken_embed_quote_execution_failed_webhook_payload" +require_relative "privy/models/kraken_embed_user_closed_webhook_payload" +require_relative "privy/models/kraken_embed_user_disabled_webhook_payload" +require_relative "privy/models/kraken_embed_user_verified_webhook_payload" +require_relative "privy/models/linked_account" +require_relative "privy/models/linked_account_apple_input" +require_relative "privy/models/linked_account_apple_oauth" +require_relative "privy/models/linked_account_authorization_key" +require_relative "privy/models/linked_account_base_wallet" +require_relative "privy/models/linked_account_cross_app" +require_relative "privy/models/linked_account_custom_jwt" +require_relative "privy/models/linked_account_custom_jwt_input" +require_relative "privy/models/linked_account_custom_oauth" +require_relative "privy/models/linked_account_discord_input" +require_relative "privy/models/linked_account_discord_oauth" +require_relative "privy/models/linked_account_email" +require_relative "privy/models/linked_account_email_input" +require_relative "privy/models/linked_account_embedded_wallet" +require_relative "privy/models/linked_account_embedded_wallet_with_id" +require_relative "privy/models/linked_account_ethereum" +require_relative "privy/models/linked_account_farcaster" +require_relative "privy/models/linked_account_farcaster_input" +require_relative "privy/models/linked_account_github_input" +require_relative "privy/models/linked_account_github_oauth" +require_relative "privy/models/linked_account_google_input" +require_relative "privy/models/linked_account_google_oauth" +require_relative "privy/models/linked_account_input" +require_relative "privy/models/linked_account_instagram_input" +require_relative "privy/models/linked_account_instagram_oauth" +require_relative "privy/models/linked_account_line_input" +require_relative "privy/models/linked_account_line_oauth" +require_relative "privy/models/linked_account_linked_in_input" +require_relative "privy/models/linked_account_linked_in_oauth" +require_relative "privy/models/linked_account_passkey" +require_relative "privy/models/linked_account_passkey_input" +require_relative "privy/models/linked_account_phone" +require_relative "privy/models/linked_account_phone_input" +require_relative "privy/models/linked_account_smart_wallet" +require_relative "privy/models/linked_account_solana" +require_relative "privy/models/linked_account_spotify_input" +require_relative "privy/models/linked_account_spotify_oauth" +require_relative "privy/models/linked_account_telegram" +require_relative "privy/models/linked_account_telegram_input" +require_relative "privy/models/linked_account_tiktok_input" +require_relative "privy/models/linked_account_tiktok_oauth" +require_relative "privy/models/linked_account_twitch_input" +require_relative "privy/models/linked_account_twitch_oauth" +require_relative "privy/models/linked_account_twitter_input" +require_relative "privy/models/linked_account_twitter_oauth" +require_relative "privy/models/linked_account_type" +require_relative "privy/models/linked_account_wallet_input" +require_relative "privy/models/linked_mfa_method" +require_relative "privy/models/link_jwt_input" +require_relative "privy/models/mfa_disabled_webhook_payload" +require_relative "privy/models/mfa_enabled_webhook_payload" +require_relative "privy/models/mfa_passkey_enrollment_request_body" +require_relative "privy/models/mfa_passkey_init_request_body" +require_relative "privy/models/mfa_passkey_init_response_body" +require_relative "privy/models/mfa_passkey_verify_request_body" +require_relative "privy/models/mfa_sms_enroll_request_body" +require_relative "privy/models/mfa_sms_init_enroll_input" +require_relative "privy/models/mfa_sms_init_request_body" +require_relative "privy/models/mfa_sms_init_verify_input" +require_relative "privy/models/mfa_sms_verify_request_body" +require_relative "privy/models/mfa_totp_init_response_body" +require_relative "privy/models/mfa_totp_input" +require_relative "privy/models/mfa_verify_response_body" +require_relative "privy/models/moonpay_currency_code" +require_relative "privy/models/moonpay_fiat_on_ramp_ethereum_config" +require_relative "privy/models/moonpay_fiat_on_ramp_ethereum_input" +require_relative "privy/models/moonpay_fiat_on_ramp_solana_config" +require_relative "privy/models/moonpay_fiat_on_ramp_solana_input" +require_relative "privy/models/moonpay_on_ramp_sandbox_config" +require_relative "privy/models/moonpay_on_ramp_sign_input" +require_relative "privy/models/moonpay_on_ramp_sign_response" +require_relative "privy/models/moonpay_payment_method" +require_relative "privy/models/moonpay_solana_currency_code" +require_relative "privy/models/moonpay_ui_config" +require_relative "privy/models/moonpay_ui_theme" +require_relative "privy/models/named_token_transfer_source" +require_relative "privy/models/oauth_authenticate_recovery_response" +require_relative "privy/models/oauth_authenticate_request_body" +require_relative "privy/models/oauth_authorization_code_request_body" +require_relative "privy/models/oauth_callback_icloud_expo_input" +require_relative "privy/models/oauth_code_type" +require_relative "privy/models/oauth_init_icloud_recovery_input" +require_relative "privy/models/oauth_init_recovery_input" +require_relative "privy/models/oauth_init_request_body" +require_relative "privy/models/oauth_init_response_body" +require_relative "privy/models/oauth_link_request_body" +require_relative "privy/models/oauth_link_response_body" +require_relative "privy/models/oauth_provider_id" +require_relative "privy/models/oauth_tokens" +require_relative "privy/models/oauth_transfer_request_body" +require_relative "privy/models/oauth_transfer_user_info" +require_relative "privy/models/oauth_transfer_user_info_meta" +require_relative "privy/models/oauth_unlink_request_body" +require_relative "privy/models/oauth_verify_request_body" +require_relative "privy/models/oauth_verify_response_body" +require_relative "privy/models/onramp_provider" +require_relative "privy/models/optional_refresh_token_input" +require_relative "privy/models/organization_secrets_list_response" +require_relative "privy/models/output_with_previous_transaction_data" +require_relative "privy/models/owner_id_input" +require_relative "privy/models/owner_input" +require_relative "privy/models/owner_input_public_key" +require_relative "privy/models/owner_input_user" +require_relative "privy/models/p_256_public_key" +require_relative "privy/models/passkey_assertion_response" +require_relative "privy/models/passkey_attestation_response" +require_relative "privy/models/passkey_authenticate_input" +require_relative "privy/models/passkey_authenticator_enrollment_options" +require_relative "privy/models/passkey_authenticator_enrollment_response" +require_relative "privy/models/passkey_authenticator_selection" +require_relative "privy/models/passkey_authenticator_verify_options" +require_relative "privy/models/passkey_authenticator_verify_response" +require_relative "privy/models/passkey_client_extension_results" +require_relative "privy/models/passkey_credential_descriptor" +require_relative "privy/models/passkey_cred_props_result" +require_relative "privy/models/passkey_enrollment_extensions" +require_relative "privy/models/passkey_init_input" +require_relative "privy/models/passkey_link_input" +require_relative "privy/models/passkey_mfa_method" +require_relative "privy/models/passkey_pub_key_cred_param" +require_relative "privy/models/passkey_register_input" +require_relative "privy/models/passkey_relying_party" +require_relative "privy/models/passkey_user" +require_relative "privy/models/passkey_verify_extensions" +require_relative "privy/models/passwordless_authenticate_request_body" +require_relative "privy/models/passwordless_init_request_body" +require_relative "privy/models/passwordless_link_request_body" +require_relative "privy/models/passwordless_sms_authenticate_request_body" +require_relative "privy/models/passwordless_sms_init_request_body" +require_relative "privy/models/passwordless_sms_link_request_body" +require_relative "privy/models/passwordless_sms_transfer_request_body" +require_relative "privy/models/passwordless_sms_unlink_request_body" +require_relative "privy/models/passwordless_sms_update_request_body" +require_relative "privy/models/passwordless_transfer_request_body" +require_relative "privy/models/passwordless_unlink_request_body" +require_relative "privy/models/passwordless_update_request_body" +require_relative "privy/models/patch_users_custom_metadata" +require_relative "privy/models/phone_invite_input" +require_relative "privy/models/policy" +require_relative "privy/models/policy_action" +require_relative "privy/models/policy_authorization_headers" +require_relative "privy/models/policy_condition" +require_relative "privy/models/policy_create_params" +require_relative "privy/models/policy_create_rule_params" +require_relative "privy/models/policy_delete_params" +require_relative "privy/models/policy_delete_rule_params" +require_relative "privy/models/policy_get_params" +require_relative "privy/models/policy_get_rule_params" +require_relative "privy/models/policy_input" +require_relative "privy/models/policy_intent_request_details" +require_relative "privy/models/policy_intent_response" +require_relative "privy/models/policy_method" +require_relative "privy/models/policy_request_body" +require_relative "privy/models/policy_rule_request_params" +require_relative "privy/models/policy_rule_response" +require_relative "privy/models/policy_update_params" +require_relative "privy/models/policy_update_rule_params" +require_relative "privy/models/private_key_export_input" +require_relative "privy/models/private_key_export_response" +require_relative "privy/models/private_key_export_webhook_payload" +require_relative "privy/models/private_key_init_input" +require_relative "privy/models/private_key_submit_input" +require_relative "privy/models/privy_oauth_provider_id" +require_relative "privy/models/quantity" +require_relative "privy/models/raw_sign_bytes_encoding" +require_relative "privy/models/raw_sign_bytes_hash_function" +require_relative "privy/models/raw_sign_bytes_params" +require_relative "privy/models/raw_sign_hash_params" +require_relative "privy/models/raw_sign_input_params" +require_relative "privy/models/raw_sign_response" +require_relative "privy/models/raw_sign_response_data" +require_relative "privy/models/recipient_public_key" +require_relative "privy/models/recovery_configuration_icloud_input" +require_relative "privy/models/recovery_configuration_icloud_response" +require_relative "privy/models/recovery_key_material_input" +require_relative "privy/models/recovery_key_material_response" +require_relative "privy/models/recovery_type" +require_relative "privy/models/response_passkey_init_authenticate" +require_relative "privy/models/response_passkey_init_link" +require_relative "privy/models/response_passkey_init_register" +require_relative "privy/models/rpc_intent_request_details" +require_relative "privy/models/rpc_intent_response" +require_relative "privy/models/rule_intent_create_request_details" +require_relative "privy/models/rule_intent_delete_request_details" +require_relative "privy/models/rule_intent_request_details" +require_relative "privy/models/rule_intent_response" +require_relative "privy/models/rule_intent_update_request_details" +require_relative "privy/models/seed_phrase_export_input" +require_relative "privy/models/seed_phrase_export_response" +require_relative "privy/models/seed_phrase_export_webhook_payload" +require_relative "privy/models/signing_algorithm" +require_relative "privy/models/siwe_address_input" +require_relative "privy/models/siwe_authenticate_request_body" +require_relative "privy/models/siwe_init_input" +require_relative "privy/models/siwe_init_request_body" +require_relative "privy/models/siwe_init_response_body" +require_relative "privy/models/siwe_input" +require_relative "privy/models/siwe_link_request_body" +require_relative "privy/models/siwe_link_smart_wallet_request_body" +require_relative "privy/models/siwe_nonce" +require_relative "privy/models/siwe_unlink_request_body" +require_relative "privy/models/siws_address_input" +require_relative "privy/models/siws_authenticate_request_body" +require_relative "privy/models/siws_init_input" +require_relative "privy/models/siws_init_request_body" +require_relative "privy/models/siws_init_response_body" +require_relative "privy/models/siws_input" +require_relative "privy/models/siws_link_request_body" +require_relative "privy/models/siws_nonce" +require_relative "privy/models/siws_unlink_request_body" +require_relative "privy/models/smart_wallet_configuration" +require_relative "privy/models/smart_wallet_configuration_disabled" +require_relative "privy/models/smart_wallet_configuration_enabled" +require_relative "privy/models/smart_wallet_configuration_input" +require_relative "privy/models/smart_wallet_configuration_input_enabled" +require_relative "privy/models/smart_wallet_network_configuration" +require_relative "privy/models/smart_wallet_network_configuration_input" +require_relative "privy/models/smart_wallet_siwe_input" +require_relative "privy/models/smart_wallet_type" +require_relative "privy/models/sms_mfa_method" +require_relative "privy/models/solana_program_instruction_condition" +require_relative "privy/models/solana_rpc_input" +require_relative "privy/models/solana_rpc_response" +require_relative "privy/models/solana_sign_and_send_transaction_rpc_input" +require_relative "privy/models/solana_sign_and_send_transaction_rpc_input_params" +require_relative "privy/models/solana_sign_and_send_transaction_rpc_response" +require_relative "privy/models/solana_sign_and_send_transaction_rpc_response_data" +require_relative "privy/models/solana_sign_message_rpc_input" +require_relative "privy/models/solana_sign_message_rpc_input_params" +require_relative "privy/models/solana_sign_message_rpc_response" +require_relative "privy/models/solana_sign_message_rpc_response_data" +require_relative "privy/models/solana_sign_transaction_rpc_input" +require_relative "privy/models/solana_sign_transaction_rpc_input_params" +require_relative "privy/models/solana_sign_transaction_rpc_response" +require_relative "privy/models/solana_sign_transaction_rpc_response_data" +require_relative "privy/models/solana_system_program_instruction_condition" +require_relative "privy/models/solana_token_program_instruction_condition" +require_relative "privy/models/solana_wallet_derivation_strategy" +require_relative "privy/models/spark_balance" +require_relative "privy/models/spark_claim_static_deposit_rpc_input" +require_relative "privy/models/spark_claim_static_deposit_rpc_input_params" +require_relative "privy/models/spark_claim_static_deposit_rpc_response" +require_relative "privy/models/spark_claim_static_deposit_rpc_response_data" +require_relative "privy/models/spark_create_lightning_invoice_rpc_input" +require_relative "privy/models/spark_create_lightning_invoice_rpc_input_params" +require_relative "privy/models/spark_create_lightning_invoice_rpc_response" +require_relative "privy/models/spark_get_balance_rpc_input" +require_relative "privy/models/spark_get_balance_rpc_response" +require_relative "privy/models/spark_get_claim_static_deposit_quote_rpc_input" +require_relative "privy/models/spark_get_claim_static_deposit_quote_rpc_input_params" +require_relative "privy/models/spark_get_claim_static_deposit_quote_rpc_response" +require_relative "privy/models/spark_get_claim_static_deposit_quote_rpc_response_data" +require_relative "privy/models/spark_get_static_deposit_address_rpc_input" +require_relative "privy/models/spark_get_static_deposit_address_rpc_response" +require_relative "privy/models/spark_get_static_deposit_address_rpc_response_data" +require_relative "privy/models/spark_lightning_fee" +require_relative "privy/models/spark_lightning_receive_request" +require_relative "privy/models/spark_lightning_send_request" +require_relative "privy/models/spark_network" +require_relative "privy/models/spark_output_selection_strategy" +require_relative "privy/models/spark_pay_lightning_invoice_rpc_input" +require_relative "privy/models/spark_pay_lightning_invoice_rpc_input_params" +require_relative "privy/models/spark_pay_lightning_invoice_rpc_response" +require_relative "privy/models/spark_rpc_input" +require_relative "privy/models/spark_rpc_response" +require_relative "privy/models/spark_signing_keyshare" +require_relative "privy/models/spark_sign_message_with_identity_key_rpc_input" +require_relative "privy/models/spark_sign_message_with_identity_key_rpc_input_params" +require_relative "privy/models/spark_sign_message_with_identity_key_rpc_response" +require_relative "privy/models/spark_sign_message_with_identity_key_rpc_response_data" +require_relative "privy/models/spark_token_balance" +require_relative "privy/models/spark_transfer" +require_relative "privy/models/spark_transfer_leaf" +require_relative "privy/models/spark_transfer_rpc_input" +require_relative "privy/models/spark_transfer_rpc_input_params" +require_relative "privy/models/spark_transfer_rpc_response" +require_relative "privy/models/spark_transfer_tokens_rpc_input" +require_relative "privy/models/spark_transfer_tokens_rpc_input_params" +require_relative "privy/models/spark_transfer_tokens_rpc_response" +require_relative "privy/models/spark_transfer_tokens_rpc_response_data" +require_relative "privy/models/spark_user_token_metadata" +require_relative "privy/models/spark_wallet_leaf" +require_relative "privy/models/success_response" +require_relative "privy/models/sui_command_name" +require_relative "privy/models/sui_transaction_command_condition" +require_relative "privy/models/sui_transaction_command_operator" +require_relative "privy/models/sui_transfer_objects_command_condition" +require_relative "privy/models/sui_transfer_objects_command_field" +require_relative "privy/models/svm_transaction_wallet_action_step" +require_relative "privy/models/svm_wallet_action_step_status" +require_relative "privy/models/swap_action_response" +require_relative "privy/models/swap_destination" +require_relative "privy/models/swap_quote_destination" +require_relative "privy/models/swap_quote_request_body" +require_relative "privy/models/swap_quote_response" +require_relative "privy/models/swap_request_body" +require_relative "privy/models/swap_source" +require_relative "privy/models/system_condition" +require_relative "privy/models/telegram_auth_config_schema" +require_relative "privy/models/telegram_authenticate_input" +require_relative "privy/models/telegram_authenticate_request_body" +require_relative "privy/models/telegram_auth_result" +require_relative "privy/models/telegram_link_request_body" +require_relative "privy/models/telegram_unlink_input" +require_relative "privy/models/telegram_unlink_request_body" +require_relative "privy/models/telegram_web_app_data" +require_relative "privy/models/tempo_aa_authorization" +require_relative "privy/models/tempo_call" +require_relative "privy/models/tempo_fee_payer_signature" +require_relative "privy/models/test_account" +require_relative "privy/models/test_accounts_response" +require_relative "privy/models/token_output" +require_relative "privy/models/token_transfer_destination" +require_relative "privy/models/token_transfer_source" +require_relative "privy/models/totp_mfa_method" +require_relative "privy/models/transaction" +require_relative "privy/models/transaction_broadcasted_webhook_payload" +require_relative "privy/models/transaction_confirmed_webhook_payload" +require_relative "privy/models/transaction_detail" +require_relative "privy/models/transaction_execution_reverted_webhook_payload" +require_relative "privy/models/transaction_failed_webhook_payload" +require_relative "privy/models/transaction_get_params" +require_relative "privy/models/transaction_list" +require_relative "privy/models/transaction_provider_error_webhook_payload" +require_relative "privy/models/transaction_replaced_webhook_payload" +require_relative "privy/models/transaction_scanning_asset_diff" +require_relative "privy/models/transaction_scanning_asset_info" +require_relative "privy/models/transaction_scanning_asset_value" +require_relative "privy/models/transaction_scanning_calldata" +require_relative "privy/models/transaction_scanning_exposure" +require_relative "privy/models/transaction_scanning_metadata" +require_relative "privy/models/transaction_scanning_params" +require_relative "privy/models/transaction_scanning_request_body" +require_relative "privy/models/transaction_scanning_response_body" +require_relative "privy/models/transaction_scanning_rpc_request" +require_relative "privy/models/transaction_scanning_simulation_error_result" +require_relative "privy/models/transaction_scanning_simulation_result" +require_relative "privy/models/transaction_scanning_simulation_success_result" +require_relative "privy/models/transaction_scanning_validation_error_result" +require_relative "privy/models/transaction_scanning_validation_result" +require_relative "privy/models/transaction_scanning_validation_success_result" +require_relative "privy/models/transaction_still_pending_webhook_payload" +require_relative "privy/models/transaction_token_address_input" +require_relative "privy/models/transfer_action_response" +require_relative "privy/models/transfer_farcaster_input" +require_relative "privy/models/transfer_intent_request_details" +require_relative "privy/models/transfer_intent_response" +require_relative "privy/models/transfer_received_transaction_detail" +require_relative "privy/models/transfer_sent_transaction_detail" +require_relative "privy/models/transfer_siwe_input" +require_relative "privy/models/transfer_siws_input" +require_relative "privy/models/transfer_telegram_input" +require_relative "privy/models/tron_calldata_condition" +require_relative "privy/models/tron_transaction_condition" +require_relative "privy/models/typed_data_domain_input_params" +require_relative "privy/models/typed_data_type_field_input" +require_relative "privy/models/typed_data_types_input_params" +require_relative "privy/models/unlink_passkey_input" +require_relative "privy/models/unsafe_unwrap_webhook_event" +require_relative "privy/models/unsigned_ethereum_transaction" +require_relative "privy/models/unsigned_standard_ethereum_transaction" +require_relative "privy/models/unsigned_tempo_transaction" +require_relative "privy/models/update_account_from_wallet_ids_input" +require_relative "privy/models/update_account_from_wallets_configuration_input" +require_relative "privy/models/update_account_input" +require_relative "privy/models/update_condition_set_request_body" +require_relative "privy/models/update_organization_secret_signing_key_input" +require_relative "privy/models/user_authenticated_webhook_payload" +require_relative "privy/models/user_batch_create_input" +require_relative "privy/models/user_created_webhook_payload" +require_relative "privy/models/user_create_params" +require_relative "privy/models/user_delete_params" +require_relative "privy/models/user_get_by_custom_auth_id_params" +require_relative "privy/models/user_get_by_discord_username_params" +require_relative "privy/models/user_get_by_email_address_params" +require_relative "privy/models/user_get_by_farcaster_id_params" +require_relative "privy/models/user_get_by_github_username_params" +require_relative "privy/models/user_get_by_phone_number_params" +require_relative "privy/models/user_get_by_smart_wallet_address_params" +require_relative "privy/models/user_get_by_telegram_user_id_params" +require_relative "privy/models/user_get_by_telegram_username_params" +require_relative "privy/models/user_get_by_twitter_subject_params" +require_relative "privy/models/user_get_by_twitter_username_params" +require_relative "privy/models/user_get_by_wallet_address_params" +require_relative "privy/models/user_get_params" +require_relative "privy/models/user_linked_account_webhook_payload" +require_relative "privy/models/user_list_params" +require_relative "privy/models/user_operation_completed_webhook_payload" +require_relative "privy/models/user_operation_input" +require_relative "privy/models/user_owned_recovery_option" +require_relative "privy/models/user_pregenerate_wallets_params" +require_relative "privy/models/user_search_params" +require_relative "privy/models/user_set_custom_metadata_params" +require_relative "privy/models/user_transferred_account_webhook_payload" +require_relative "privy/models/user_unlinked_account_webhook_payload" +require_relative "privy/models/user_unlink_linked_account_params" +require_relative "privy/models/user_updated_account_webhook_payload" +require_relative "privy/models/user_wallet_created_webhook_payload" +require_relative "privy/models/user_with_identity_token" +require_relative "privy/models/wallet" +require_relative "privy/models/wallet_action_earn_deposit_created_webhook_payload" +require_relative "privy/models/wallet_action_earn_deposit_failed_webhook_payload" +require_relative "privy/models/wallet_action_earn_deposit_rejected_webhook_payload" +require_relative "privy/models/wallet_action_earn_deposit_succeeded_webhook_payload" +require_relative "privy/models/wallet_action_earn_incentive_claim_created_webhook_payload" +require_relative "privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload" +require_relative "privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload" +require_relative "privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload" +require_relative "privy/models/wallet_action_earn_withdraw_created_webhook_payload" +require_relative "privy/models/wallet_action_earn_withdraw_failed_webhook_payload" +require_relative "privy/models/wallet_action_earn_withdraw_rejected_webhook_payload" +require_relative "privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload" +require_relative "privy/models/wallet_action_response" +require_relative "privy/models/wallet_action_status" +require_relative "privy/models/wallet_action_step" +require_relative "privy/models/wallet_action_step_type" +require_relative "privy/models/wallet_action_swap_created_webhook_payload" +require_relative "privy/models/wallet_action_swap_failed_webhook_payload" +require_relative "privy/models/wallet_action_swap_rejected_webhook_payload" +require_relative "privy/models/wallet_action_swap_succeeded_webhook_payload" +require_relative "privy/models/wallet_action_transfer_created_webhook_payload" +require_relative "privy/models/wallet_action_transfer_failed_webhook_payload" +require_relative "privy/models/wallet_action_transfer_rejected_webhook_payload" +require_relative "privy/models/wallet_action_transfer_succeeded_webhook_payload" +require_relative "privy/models/wallet_action_type" +require_relative "privy/models/wallet_additional_signer" +require_relative "privy/models/wallet_additional_signer_item" +require_relative "privy/models/wallet_api_register_authorization_key_input" +require_relative "privy/models/wallet_api_revoke_authorization_key_input" +require_relative "privy/models/wallet_asset" +require_relative "privy/models/wallet_authenticate_with_jwt_params" +require_relative "privy/models/wallet_authenticate_with_jwt_response" +require_relative "privy/models/wallet_authorization_headers" +require_relative "privy/models/wallet_batch_create_input" +require_relative "privy/models/wallet_batch_create_response" +require_relative "privy/models/wallet_batch_create_result" +require_relative "privy/models/wallet_batch_item_input" +require_relative "privy/models/wallet_chain_type" +require_relative "privy/models/wallet_create_params" +require_relative "privy/models/wallet_create_wallets_with_recovery_params" +require_relative "privy/models/wallet_create_wallets_with_recovery_response" +require_relative "privy/models/wallet_creation_additional_signer_item" +require_relative "privy/models/wallet_creation_input" +require_relative "privy/models/wallet_custodian" +require_relative "privy/models/wallet_entropy_type" +require_relative "privy/models/wallet_ethereum_asset" +require_relative "privy/models/wallet_export_params" +require_relative "privy/models/wallet_export_response_body" +require_relative "privy/models/wallet_funds_asset" +require_relative "privy/models/wallet_funds_erc_20_asset" +require_relative "privy/models/wallet_funds_native_token_asset" +require_relative "privy/models/wallet_funds_sac_asset" +require_relative "privy/models/wallet_funds_spl_asset" +require_relative "privy/models/wallet_get_params" +require_relative "privy/models/wallet_get_wallet_by_address_params" +require_relative "privy/models/wallet_import_init_response" +require_relative "privy/models/wallet_import_supported_chains" +require_relative "privy/models/wallet_import_supported_entropy_types" +require_relative "privy/models/wallet_init_import_params" +require_relative "privy/models/wallet_init_import_response" +require_relative "privy/models/wallet_intent_response" +require_relative "privy/models/wallet_invite_input" +require_relative "privy/models/wallet_list_params" +require_relative "privy/models/wallet_raw_sign_params" +require_relative "privy/models/wallet_recovered_webhook_payload" +require_relative "privy/models/wallet_recovery_setup_webhook_payload" +require_relative "privy/models/wallet_revoke_response" +require_relative "privy/models/wallet_rpc_params" +require_relative "privy/models/wallet_rpc_response" +require_relative "privy/models/wallets/balance_get_params" +require_relative "privy/models/wallets/balance_get_response" +require_relative "privy/models/wallets/earn/ethereum/incentive_claim_params" +require_relative "privy/models/wallets/earn/ethereum_deposit_params" +require_relative "privy/models/wallets/earn/ethereum_withdraw_params" +require_relative "privy/models/wallets/transaction_get_params" +require_relative "privy/models/wallets/transaction_get_response" +require_relative "privy/models/wallet_solana_asset" +require_relative "privy/models/wallet_submit_import_params" +require_relative "privy/models/wallet_transfer_params" +require_relative "privy/models/wallet_update_params" +require_relative "privy/models/webhook_payload" +require_relative "privy/models/webhook_unsafe_unwrap_params" +require_relative "privy/models/yield_authorization_headers" +require_relative "privy/models/yield_claim_confirmed_webhook_payload" +require_relative "privy/models/yield_deposit_confirmed_webhook_payload" +require_relative "privy/models/yield_withdraw_confirmed_webhook_payload" +require_relative "privy/models" +require_relative "privy/resources/accounts" +require_relative "privy/resources/aggregations" +require_relative "privy/resources/analytics" +require_relative "privy/resources/apps" +require_relative "privy/resources/apps/allowlist" +require_relative "privy/resources/client_auth" +require_relative "privy/resources/cross_app" +require_relative "privy/resources/embedded_wallets" +require_relative "privy/resources/funding" +require_relative "privy/resources/intents" +require_relative "privy/resources/key_quorums" +require_relative "privy/resources/kraken_embed" +require_relative "privy/resources/organizations" +require_relative "privy/resources/policies" +require_relative "privy/resources/shared" +require_relative "privy/resources/swaps" +require_relative "privy/resources/transactions" +require_relative "privy/resources/users" +require_relative "privy/resources/wallet_actions" +require_relative "privy/resources/wallets" +require_relative "privy/resources/wallets/balance" +require_relative "privy/resources/wallets/earn" +require_relative "privy/resources/wallets/earn/ethereum" +require_relative "privy/resources/wallets/earn/ethereum/incentive" +require_relative "privy/resources/wallets/transactions" +require_relative "privy/resources/webhooks" +require_relative "privy/resources/yield_" + +# Custom layer on top of the generated client. +require_relative "privy/public_api/services/wallets" +require_relative "privy/public_api/services/users" +require_relative "privy/public_api/services/policies" +require_relative "privy/public_api/services/key_quorums" +require_relative "privy/public_api/privy_request_expiry_options" +require_relative "privy/public_api/privy_client" + +# Cryptography (HPKE) +require_relative "privy/cryptography" + +# Authorization lib +require_relative "privy/authorization/canonicalization" +require_relative "privy/authorization/authorization" +require_relative "privy/authorization/jwt_exchange" diff --git a/lib/privy/authorization/authorization.rb b/lib/privy/authorization/authorization.rb new file mode 100644 index 0000000..4cb5887 --- /dev/null +++ b/lib/privy/authorization/authorization.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +require "openssl" + +module Privy + module Authorization + AuthorizationContext = Data.define(:authorization_private_keys, :signatures, :sign_fns, :user_jwts) do + def self.build( + authorization_private_keys: [], + signatures: [], + sign_fns: [], + user_jwts: [] + ) + new( + authorization_private_keys: authorization_private_keys, + signatures: signatures, + sign_fns: sign_fns, + user_jwts: user_jwts + ) + end + end + + WalletApiRequestSignatureInput = Data.define(:version, :method, :url, :body, :headers) do + def self.build(method:, url:, body:, headers:) + new(version: 1, method: method.to_s.upcase, url: url, body: body, headers: headers.compact) + end + end + + PreparedRequest = Data.define(:headers) + + module_function + + def signed_url(privy_client, path) + base = privy_client.api.base_url.to_s.chomp("/") + "#{base}/#{path}" + end + + def merge_prepared_headers!(params, headers) + if headers["privy-authorization-signature"] + params[:privy_authorization_signature] = + headers["privy-authorization-signature"] + end + params[:privy_idempotency_key] = headers["privy-idempotency-key"] if headers["privy-idempotency-key"] + params[:privy_request_expiry] = headers["privy-request-expiry"] if headers["privy-request-expiry"] + end + + def format_request_for_authorization_signature(input) + payload = { + version: input.version, + method: input.method, + url: input.url, + body: input.body.nil? || input.body == {} ? "" : input.body, + headers: input.headers + } + Privy::Authorization::Canonicalization.canonicalize(payload).b + end + + def generate_authorization_signature(private_key_base64:, payload:) + key = Privy::Cryptography.import_pkcs8_private_key(private_key_base64) + digest = OpenSSL::Digest.new("SHA256").digest(payload) + der = key.dsa_sign_asn1(digest) + [der].pack("m0") + end + + # Generates all authorization signatures for a request. + # + # Signatures come from four sources, combined in this order: + # 1. Precomputed signatures passed directly in the context + # 2. Explicit private keys provided in authorization_private_keys + # 3. Private keys obtained by exchanging user JWTs via HPKE + # 4. Sign functions (callbacks that receive the canonicalized payload) + def generate_authorization_signatures(privy_client, input:, context:) + if context.user_jwts.any? && privy_client.nil? + raise ArgumentError, + "privy_client is required when user_jwts are provided in the authorization context" + end + + # Canonicalize the request into a deterministic byte string for signing + payload = format_request_for_authorization_signature(input) + + # Exchange each user JWT for an ephemeral P-256 private key via HPKE. + # Results are cached by JwtExchangeService so repeated calls are cheap. + jwt_keys = context.user_jwts.map do |jwt| + privy_client.jwt_exchange.exchange_jwt_for_authorization_key(jwt) + end + all_private_keys = context.authorization_private_keys + jwt_keys + + key_sigs = all_private_keys.map do |pk| + generate_authorization_signature(private_key_base64: pk, payload: payload) + end + fn_sigs = context.sign_fns.map { |fn| fn.call(payload) } + + key_sigs + fn_sigs + context.signatures + end + + def prepare_request( + privy_client, + method:, + url:, + body:, + authorization_context: nil, + idempotency_key: nil, + request_expiry: nil + ) + ctx = authorization_context || AuthorizationContext.build + + headers = {} + headers["privy-idempotency-key"] = idempotency_key if idempotency_key + headers["privy-request-expiry"] = request_expiry.to_s if request_expiry + + signature_input = WalletApiRequestSignatureInput.build( + method: method, + url: url, + body: body, + headers: {"privy-app-id" => privy_client.app_id}.merge(headers) + ) + + signatures = generate_authorization_signatures(privy_client, input: signature_input, context: ctx) + headers["privy-authorization-signature"] = signatures.join(",") unless signatures.empty? + + PreparedRequest.new(headers: headers) + end + end +end diff --git a/lib/privy/authorization/canonicalization.rb b/lib/privy/authorization/canonicalization.rb new file mode 100644 index 0000000..8c4e404 --- /dev/null +++ b/lib/privy/authorization/canonicalization.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +require "json" + +module Privy + module Authorization + module Canonicalization + module_function + + def canonicalize(value) + serialize(coerce_keys(value)) + end + + def coerce_keys(value) + case value + when Hash + value.each_with_object({}) { |(k, v), h| h[k.to_s] = coerce_keys(v) } + when Array + value.map { |v| coerce_keys(v) } + else + value + end + end + + def serialize(value) + case value + when Hash + body = value.keys.sort_by { |k| k.encode("UTF-16BE").bytes } + .map { |k| "#{JSON.generate(k)}:#{serialize(value[k])}" } + .join(",") + "{#{body}}" + when Array + "[#{value.map { |v| serialize(v) }.join(',')}]" + when Float + raise ArgumentError, "NaN/Infinity not permitted" unless value.finite? + + format_number(value) + when Integer + value.to_s + when String, TrueClass, FalseClass, NilClass + JSON.generate(value) + else + raise ArgumentError, "Cannot canonicalize #{value.class}" + end + end + + # TODO: port the ES6 ToString algorithm (ecma-262) for full RFC 8785 compliance on arbitrary + # floats. MVP payloads only contain integer and simple-decimal values, so the simplified form + # below is sufficient for now. + def format_number(value) + int = value.to_i + value == int ? int.to_s : value.to_s + end + end + end +end diff --git a/lib/privy/authorization/jwt_exchange.rb b/lib/privy/authorization/jwt_exchange.rb new file mode 100644 index 0000000..a760d10 --- /dev/null +++ b/lib/privy/authorization/jwt_exchange.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +require "base64" + +module Privy + class JwtExchangeService + DEFAULT_CACHE_MAX_CAPACITY = 1000 + + attr_reader :cache_max_capacity + + def initialize(wallets_resource:, cache_max_capacity: DEFAULT_CACHE_MAX_CAPACITY) + @wallets = wallets_resource + @hpke_recipient = Privy::Cryptography::HpkeRecipient.new + @cache = {} + @cache_max_capacity = cache_max_capacity + @mutex = Mutex.new + end + + def exchange_jwt_for_authorization_key(jwt) + cached = get_cached(jwt) + return cached if cached + + response = @wallets.authenticate_with_jwt( + user_jwt: jwt, + encryption_type: :HPKE, + recipient_public_key: Base64.strict_encode64(@hpke_recipient.public_key_spki) + ) + + encrypted = response.encrypted_authorization_key + unless encrypted && encrypted.encryption_type.to_s == "HPKE" + raise Privy::Errors::Error, "JWT exchange failed: unsupported encryption type" + end + + decrypted_key = @hpke_recipient.decrypt( + Base64.strict_decode64(encrypted.encapsulated_key), + Base64.strict_decode64(encrypted.ciphertext) + ) + + authorization_key = decrypted_key.force_encoding("UTF-8") + cache_put(jwt, authorization_key, response.expires_at) + authorization_key + end + + private + + def get_cached(jwt) + @mutex.synchronize do + entry = @cache[jwt] + return nil unless entry + + if entry[:expires_at] > current_time_ms + entry[:key] + else + @cache.delete(jwt) + nil + end + end + end + + def cache_put(jwt, key, expires_at) + @mutex.synchronize do + evict_if_full + @cache[jwt] = {key: key, expires_at: expires_at} + end + end + + def evict_if_full + return unless @cache.size >= @cache_max_capacity + + now_ms = current_time_ms + @cache.delete_if { |_, v| v[:expires_at] <= now_ms } + @cache.delete(@cache.keys.first) if @cache.size >= @cache_max_capacity + end + + def current_time_ms + (Time.now.to_f * 1000).to_i + end + end +end diff --git a/lib/privy/client.rb b/lib/privy/client.rb new file mode 100644 index 0000000..567cb7c --- /dev/null +++ b/lib/privy/client.rb @@ -0,0 +1,203 @@ +# frozen_string_literal: true + +module Privy + class Client < Privy::Internal::Transport::BaseClient + # Default max number of retries to attempt after a failed retryable request. + DEFAULT_MAX_RETRIES = 2 + + # Default per-request timeout. + DEFAULT_TIMEOUT_IN_SECONDS = 60.0 + + # Default initial retry delay in seconds. + # Overall delay is calculated using exponential backoff + jitter. + DEFAULT_INITIAL_RETRY_DELAY = 0.5 + + # Default max retry delay in seconds. + DEFAULT_MAX_RETRY_DELAY = 8.0 + + # rubocop:disable Style/MutableConstant + # @type [Hash{Symbol=>String}] + ENVIRONMENTS = {production: "https://api.privy.io", staging: "https://api.staging.privy.io"} + # rubocop:enable Style/MutableConstant + + # App secret authentication. + # @return [String] + attr_reader :app_id + + # App secret authentication. + # @return [String] + attr_reader :app_secret + + # @return [Privy::Resources::Wallets] + attr_reader :wallets + + # Operations related to users + # @return [Privy::Resources::Users] + attr_reader :users + + # Operations related to policies + # @return [Privy::Resources::Policies] + attr_reader :policies + + # Operations related to transactions + # @return [Privy::Resources::Transactions] + attr_reader :transactions + + # Operations related to key quorums + # @return [Privy::Resources::KeyQuorums] + attr_reader :key_quorums + + # @return [Privy::Resources::Intents] + attr_reader :intents + + # Operations related to app settings and allowlist management + # @return [Privy::Resources::Apps] + attr_reader :apps + + # @return [Privy::Resources::Webhooks] + attr_reader :webhooks + + # @return [Privy::Resources::Accounts] + attr_reader :accounts + + # @return [Privy::Resources::Aggregations] + attr_reader :aggregations + + # @return [Privy::Resources::EmbeddedWallets] + attr_reader :embedded_wallets + + # @return [Privy::Resources::Analytics] + attr_reader :analytics + + # @return [Privy::Resources::ClientAuth] + attr_reader :client_auth + + # @return [Privy::Resources::Funding] + attr_reader :funding + + # @return [Privy::Resources::Organizations] + attr_reader :organizations + + # @return [Privy::Resources::CrossApp] + attr_reader :cross_app + + # @return [Privy::Resources::Shared] + attr_reader :shared + + # @return [Privy::Resources::WalletActions] + attr_reader :wallet_actions + + # @return [Privy::Resources::Yield] + attr_reader :yield_ + + # @return [Privy::Resources::KrakenEmbed] + attr_reader :kraken_embed + + # @return [Privy::Resources::Swaps] + attr_reader :swaps + + # @api private + # + # @return [Hash{String=>String}] + private def auth_headers + return {} if @app_id.nil? || @app_secret.nil? + + base64_credentials = ["#{@app_id}:#{@app_secret}"].pack("m0") + {"authorization" => "Basic #{base64_credentials}"} + end + + # Creates and returns a new client for interacting with the API. + # + # @param app_id [String, nil] App secret authentication. Defaults to `ENV["PRIVY_APP_ID"]` + # + # @param app_secret [String, nil] App secret authentication. Defaults to `ENV["PRIVY_APP_SECRET"]` + # + # @param environment [:production, :staging, nil] Specifies the environment to use for the API. + # + # Each environment maps to a different base URL: + # + # - `production` corresponds to `https://api.privy.io` + # - `staging` corresponds to `https://api.staging.privy.io` + # + # @param base_url [String, nil] Override the default base URL for the API, e.g., + # `"https://api.example.com/v2/"`. Defaults to `ENV["PRIVY_API_BASE_URL"]` + # + # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request. + # + # @param timeout [Float] + # + # @param initial_retry_delay [Float] + # + # @param max_retry_delay [Float] + def initialize( + app_id: ENV["PRIVY_APP_ID"], + app_secret: ENV["PRIVY_APP_SECRET"], + environment: nil, + base_url: ENV["PRIVY_API_BASE_URL"], + max_retries: self.class::DEFAULT_MAX_RETRIES, + timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY + ) + base_url ||= Privy::Client::ENVIRONMENTS.fetch(environment&.to_sym || :production) do + message = "environment must be one of #{Privy::Client::ENVIRONMENTS.keys}, got #{environment}" + raise ArgumentError.new(message) + end + + if app_id.nil? + raise ArgumentError.new("app_id is required, and can be set via environ: \"PRIVY_APP_ID\"") + end + if app_secret.nil? + raise ArgumentError.new("app_secret is required, and can be set via environ: \"PRIVY_APP_SECRET\"") + end + + headers = { + "privy-app-id" => (@app_id = app_id.to_s) + } + custom_headers_env = ENV["PRIVY_API_CUSTOM_HEADERS"] + unless custom_headers_env.nil? + parsed = {} + custom_headers_env.split("\n").each do |line| + colon = line.index(":") + unless colon.nil? + parsed[line[0...colon].strip] = line[(colon + 1)..].strip + end + end + headers = parsed.merge(headers) + end + + @app_secret = app_secret.to_s + + super( + base_url: base_url, + timeout: timeout, + max_retries: max_retries, + initial_retry_delay: initial_retry_delay, + max_retry_delay: max_retry_delay, + headers: headers + ) + + @wallets = Privy::Resources::Wallets.new(client: self) + @users = Privy::Resources::Users.new(client: self) + @policies = Privy::Resources::Policies.new(client: self) + @transactions = Privy::Resources::Transactions.new(client: self) + @key_quorums = Privy::Resources::KeyQuorums.new(client: self) + @intents = Privy::Resources::Intents.new(client: self) + @apps = Privy::Resources::Apps.new(client: self) + @webhooks = Privy::Resources::Webhooks.new(client: self) + @accounts = Privy::Resources::Accounts.new(client: self) + @aggregations = Privy::Resources::Aggregations.new(client: self) + @embedded_wallets = Privy::Resources::EmbeddedWallets.new(client: self) + @analytics = Privy::Resources::Analytics.new(client: self) + @client_auth = Privy::Resources::ClientAuth.new(client: self) + @funding = Privy::Resources::Funding.new(client: self) + @organizations = Privy::Resources::Organizations.new(client: self) + @cross_app = Privy::Resources::CrossApp.new(client: self) + @shared = Privy::Resources::Shared.new(client: self) + @wallet_actions = Privy::Resources::WalletActions.new(client: self) + @yield_ = Privy::Resources::Yield.new(client: self) + @kraken_embed = Privy::Resources::KrakenEmbed.new(client: self) + @swaps = Privy::Resources::Swaps.new(client: self) + end + end +end diff --git a/lib/privy/cryptography.rb b/lib/privy/cryptography.rb new file mode 100644 index 0000000..10086e4 --- /dev/null +++ b/lib/privy/cryptography.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require "openssl" +require "base64" +require "hpke" + +module Privy + module Cryptography + P256KeyPair = Data.define(:public_key, :private_key) + + # Returns a P256KeyPair with base64-encoded SPKI (public) and PKCS8 (private) keys. + def self.generate_p256_key_pair + key = OpenSSL::PKey::EC.generate("prime256v1") + P256KeyPair.new( + public_key: [key.public_to_der].pack("m0"), + private_key: [key.private_to_der].pack("m0") + ) + end + + def self.import_pkcs8_private_key(base64_pkcs8) + der = base64_pkcs8.unpack1("m0") + OpenSSL::PKey.read(der) + end + + class HpkeRecipient + # @return [String] Raw DER bytes of the SPKI-encoded public key + attr_reader :public_key_spki + + def initialize + @ec_key = OpenSSL::PKey::EC.generate("prime256v1") + @public_key_spki = @ec_key.public_to_der + @hpke = HPKE.new(HPKE::DHKEM_P256_HKDF_SHA256, HPKE::HKDF_SHA256, HPKE::CHACHA20_POLY1305) + end + + # Decrypts an HPKE-encrypted payload. + # + # @param encapsulated_key [String] Raw bytes of the encapsulated key from the sender + # @param ciphertext [String] Raw bytes of the ciphertext to decrypt + # @return [String] Decrypted plaintext bytes + def decrypt(encapsulated_key, ciphertext) + ctx = @hpke.setup_base_r(encapsulated_key, @ec_key, "") + ctx.open("", ciphertext) + end + + # @api private + # @return [OpenSSL::PKey::PKey] + def public_key_pkey + OpenSSL::PKey.read(@public_key_spki) + end + end + end +end diff --git a/lib/privy/errors.rb b/lib/privy/errors.rb new file mode 100644 index 0000000..936de81 --- /dev/null +++ b/lib/privy/errors.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +module Privy + module Errors + class Error < StandardError + # @!attribute cause + # + # @return [StandardError, nil] + end + + class ConversionError < Privy::Errors::Error + # @return [StandardError, nil] + def cause = @cause.nil? ? super : @cause + + # @api private + # + # @param on [Class] + # @param method [Symbol] + # @param target [Object] + # @param value [Object] + # @param cause [StandardError, nil] + def initialize(on:, method:, target:, value:, cause: nil) + cls = on.name.split("::").last + + message = [ + "Failed to parse #{cls}.#{method} from #{value.class} to #{target.inspect}.", + "To get the unparsed API response, use #{cls}[#{method.inspect}].", + cause && "Cause: #{cause.message}" + ].filter(&:itself).join(" ") + + @cause = cause + super(message) + end + end + + class APIError < Privy::Errors::Error + # @return [URI::Generic] + attr_accessor :url + + # @return [Integer, nil] + attr_accessor :status + + # @return [Hash{String=>String}, nil] + attr_accessor :headers + + # @return [Object, nil] + attr_accessor :body + + # @api private + # + # @param url [URI::Generic] + # @param status [Integer, nil] + # @param headers [Hash{String=>String}, nil] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil) + @url = url + @status = status + @headers = headers + @body = body + @request = request + @response = response + super(message) + end + end + + class APIConnectionError < Privy::Errors::APIError + # @!attribute status + # + # @return [nil] + + # @!attribute body + # + # @return [nil] + + # @api private + # + # @param url [URI::Generic] + # @param status [nil] + # @param headers [Hash{String=>String}, nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize( + url:, + status: nil, + headers: nil, + body: nil, + request: nil, + response: nil, + message: "Connection error." + ) + super + end + end + + class APITimeoutError < Privy::Errors::APIConnectionError + # @api private + # + # @param url [URI::Generic] + # @param status [nil] + # @param headers [Hash{String=>String}, nil] + # @param body [nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize( + url:, + status: nil, + headers: nil, + body: nil, + request: nil, + response: nil, + message: "Request timed out." + ) + super + end + end + + class APIStatusError < Privy::Errors::APIError + # @api private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param headers [Hash{String=>String}, nil] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + # + # @return [self] + def self.for(url:, status:, headers:, body:, request:, response:, message: nil) + kwargs = + { + url: url, + status: status, + headers: headers, + body: body, + request: request, + response: response, + message: message + } + + case status + in 400 + Privy::Errors::BadRequestError.new(**kwargs) + in 401 + Privy::Errors::AuthenticationError.new(**kwargs) + in 403 + Privy::Errors::PermissionDeniedError.new(**kwargs) + in 404 + Privy::Errors::NotFoundError.new(**kwargs) + in 409 + Privy::Errors::ConflictError.new(**kwargs) + in 422 + Privy::Errors::UnprocessableEntityError.new(**kwargs) + in 429 + Privy::Errors::RateLimitError.new(**kwargs) + in (500..) + Privy::Errors::InternalServerError.new(**kwargs) + else + Privy::Errors::APIStatusError.new(**kwargs) + end + end + + # @!parse + # # @return [Integer] + # attr_accessor :status + + # @api private + # + # @param url [URI::Generic] + # @param status [Integer] + # @param headers [Hash{String=>String}, nil] + # @param body [Object, nil] + # @param request [nil] + # @param response [nil] + # @param message [String, nil] + def initialize(url:, status:, headers:, body:, request:, response:, message: nil) + message ||= {url: url.to_s, status: status, body: body} + super( + url: url, + status: status, + headers: headers, + body: body, + request: request, + response: response, + message: message&.to_s + ) + end + end + + class BadRequestError < Privy::Errors::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Privy::Errors::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Privy::Errors::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Privy::Errors::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Privy::Errors::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Privy::Errors::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Privy::Errors::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Privy::Errors::APIStatusError + HTTP_STATUS = (500..) + end + end +end diff --git a/lib/privy/file_part.rb b/lib/privy/file_part.rb new file mode 100644 index 0000000..ed5cc8c --- /dev/null +++ b/lib/privy/file_part.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Privy + class FilePart + # @return [Pathname, StringIO, IO, String] + attr_reader :content + + # @return [String, nil] + attr_reader :content_type + + # @return [String, nil] + attr_reader :filename + + # @api private + # + # @return [String] + private def read + case content + in Pathname + content.read(binmode: true) + in StringIO + content.string + in IO + content.read + in String + content + end + end + + # @param a [Object] + # + # @return [String] + def to_json(*a) = read.to_json(*a) + + # @param a [Object] + # + # @return [String] + def to_yaml(*a) = read.to_yaml(*a) + + # @param content [Pathname, StringIO, IO, String] + # @param filename [Pathname, String, nil] + # @param content_type [String, nil] + def initialize(content, filename: nil, content_type: nil) + @content_type = content_type + @filename = + case [filename, (@content = content)] + in [String | Pathname, _] + ::File.basename(filename) + in [nil, Pathname] + content.basename.to_path + in [nil, IO] + content.to_path + else + filename + end + end + end +end diff --git a/lib/privy/internal.rb b/lib/privy/internal.rb new file mode 100644 index 0000000..f4b0397 --- /dev/null +++ b/lib/privy/internal.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Internal + extend Privy::Internal::Util::SorbetRuntimeSupport + + OMIT = + Object.new.tap do + _1.define_singleton_method(:inspect) { "#<#{Privy::Internal}::OMIT>" } + end + .freeze + + define_sorbet_constant!(:AnyHash) do + T.type_alias { T::Hash[Symbol, T.anything] } + end + define_sorbet_constant!(:FileInput) do + T.type_alias { T.any(Pathname, StringIO, IO, String, Privy::FilePart) } + end + end +end diff --git a/lib/privy/internal/cursor.rb b/lib/privy/internal/cursor.rb new file mode 100644 index 0000000..0bef31f --- /dev/null +++ b/lib/privy/internal/cursor.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Privy + module Internal + # @generic Elem + # + # @example + # if cursor.has_next? + # cursor = cursor.next_page + # end + # + # @example + # cursor.auto_paging_each do |wallet| + # puts(wallet) + # end + class Cursor + include Privy::Internal::Type::BasePage + + # @return [Array>, nil] + attr_accessor :data + + # @return [String] + attr_accessor :next_cursor + + # @return [Boolean] + def next_page? + !data.to_a.empty? && !next_cursor.to_s.empty? + end + + # @raise [Privy::HTTP::Error] + # @return [self] + def next_page + unless next_page? + message = "No more pages available. Please check #next_page? before calling ##{__method__}" + raise RuntimeError.new(message) + end + + req = Privy::Internal::Util.deep_merge(@req, {query: {cursor: next_cursor}}) + @client.request(req) + end + + # @param blk [Proc] + # + # @yieldparam [generic] + def auto_paging_each(&blk) + unless block_given? + raise ArgumentError.new("A block must be given to ##{__method__}") + end + + page = self + loop do + page.data&.each(&blk) + + break unless page.next_page? + page = page.next_page + end + end + + # @api private + # + # @param client [Privy::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}] + # @param page_data [Hash{Symbol=>Object}] + def initialize(client:, req:, headers:, page_data:) + super + + case page_data + in {data: Array => data} + @data = data.map { Privy::Internal::Type::Converter.coerce(@model, _1) } + else + end + @next_cursor = page_data[:next_cursor] + end + + # @api private + # + # @return [String] + def inspect + model = Privy::Internal::Type::Converter.inspect(@model, depth: 1) + + "#<#{self.class}[#{model}]:0x#{object_id.to_s(16)} next_cursor=#{next_cursor.inspect}>" + end + end + end +end diff --git a/lib/privy/internal/transport/base_client.rb b/lib/privy/internal/transport/base_client.rb new file mode 100644 index 0000000..4b99d3c --- /dev/null +++ b/lib/privy/internal/transport/base_client.rb @@ -0,0 +1,572 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Transport + # @api private + # + # @abstract + class BaseClient + extend Privy::Internal::Util::SorbetRuntimeSupport + + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + # rubocop:disable Style/MutableConstant + PLATFORM_HEADERS = + { + "x-stainless-arch" => Privy::Internal::Util.arch, + "x-stainless-lang" => "ruby", + "x-stainless-os" => Privy::Internal::Util.os, + "x-stainless-package-version" => Privy::VERSION, + "x-stainless-runtime" => ::RUBY_ENGINE, + "x-stainless-runtime-version" => ::RUBY_ENGINE_VERSION + } + # rubocop:enable Style/MutableConstant + + class << self + # @api private + # + # @param req [Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + def validate!(req) + keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] + case req + in Hash + req.each_key do |k| + unless keys.include?(k) + raise ArgumentError.new("Request `req` keys must be one of #{keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `req` must be a Hash or RequestOptions, got #{req.inspect}") + end + end + + # @api private + # + # @param status [Integer] + # @param headers [Hash{String=>String}] + # + # @return [Boolean] + def should_retry?(status, headers:) + coerced = Privy::Internal::Util.coerce_boolean(headers["x-should-retry"]) + case [coerced, status] + in [true | false, _] + coerced + in [_, 408 | 409 | 429 | (500..)] + # retry on: + # 408: timeouts + # 409: locks + # 429: rate limits + # 500+: unknown errors + true + else + false + end + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param status [Integer] + # + # @param response_headers [Hash{String=>String}] + # + # @return [Hash{Symbol=>Object}] + def follow_redirect(request, status:, response_headers:) + method, url, headers = request.fetch_values(:method, :url, :headers) + location = + Kernel.then do + URI.join(url, response_headers["location"]) + rescue ArgumentError + message = "Server responded with status #{status} but no valid location header." + raise Privy::Errors::APIConnectionError.new( + url: url, + response: response_headers, + message: message + ) + end + + request = {**request, url: location} + + case [url.scheme, location.scheme] + in ["https", "http"] + message = "Tried to redirect to a insecure URL" + raise Privy::Errors::APIConnectionError.new( + url: url, + response: response_headers, + message: message + ) + else + nil + end + + # from whatwg fetch spec + case [status, method] + in [301 | 302, :post] | [303, _] + drop = %w[content-encoding content-language content-length content-location content-type] + request = { + **request, + method: method == :head ? :head : :get, + headers: headers.except(*drop), + body: nil + } + else + end + + # from undici + if Privy::Internal::Util.uri_origin(url) != Privy::Internal::Util.uri_origin(location) + drop = %w[authorization cookie host proxy-authorization] + request = {**request, headers: request.fetch(:headers).except(*drop)} + end + + request + end + + # @api private + # + # @param status [Integer, Privy::Errors::APIConnectionError] + # @param stream [Enumerable, nil] + def reap_connection!(status, stream:) + case status + in (..199) | (300..499) + stream&.each { next } + in Privy::Errors::APIConnectionError | (500..) + Privy::Internal::Util.close_fused!(stream) + else + end + end + end + + # @return [URI::Generic] + attr_reader :base_url + + # @return [Float] + attr_reader :timeout + + # @return [Integer] + attr_reader :max_retries + + # @return [Float] + attr_reader :initial_retry_delay + + # @return [Float] + attr_reader :max_retry_delay + + # @return [Hash{String=>String}] + attr_reader :headers + + # @return [String, nil] + attr_reader :idempotency_header + + # @api private + # @return [Privy::Internal::Transport::PooledNetRequester] + attr_reader :requester + + # @api private + # + # @param base_url [String] + # @param timeout [Float] + # @param max_retries [Integer] + # @param initial_retry_delay [Float] + # @param max_retry_delay [Float] + # @param headers [Hash{String=>String, Integer, Array, nil}] + # @param idempotency_header [String, nil] + def initialize( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + @requester = Privy::Internal::Transport::PooledNetRequester.new + @headers = Privy::Internal::Util.normalized_headers( + self.class::PLATFORM_HEADERS, + { + "accept" => "application/json", + "content-type" => "application/json", + "user-agent" => user_agent + }, + headers + ) + @base_url_components = Privy::Internal::Util.parse_uri(base_url) + @base_url = Privy::Internal::Util.unparse_uri(@base_url_components) + @idempotency_header = idempotency_header&.to_s&.downcase + @timeout = timeout + @max_retries = max_retries + @initial_retry_delay = initial_retry_delay + @max_retry_delay = max_retry_delay + end + + # @api private + # + # @return [Hash{String=>String}] + private def auth_headers = {} + + # @api private + # + # @return [String] + private def user_agent = "#{self.class.name}/Ruby #{Privy::VERSION}" + + # @api private + # + # @return [String] + private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" + + # @api private + # + # @param req [Hash{Symbol=>Object}] . + # + # @option req [Symbol] :method + # + # @option req [String, Array] :path + # + # @option req [Hash{String=>Array, String, nil}, nil] :query + # + # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers + # + # @option req [Object, nil] :body + # + # @option req [Symbol, Integer, Array, Proc, nil] :unwrap + # + # @option req [Class, nil] :page + # + # @option req [Class, nil] :stream + # + # @option req [Privy::Internal::Type::Converter, Class, nil] :model + # + # @param opts [Hash{Symbol=>Object}] . + # + # @option opts [String, nil] :idempotency_key + # + # @option opts [Hash{String=>Array, String, nil}, nil] :extra_query + # + # @option opts [Hash{String=>String, nil}, nil] :extra_headers + # + # @option opts [Object, nil] :extra_body + # + # @option opts [Integer, nil] :max_retries + # + # @option opts [Float, nil] :timeout + # + # @return [Hash{Symbol=>Object}] + private def build_request(req, opts) + method, uninterpolated_path = req.fetch_values(:method, :path) + + path = Privy::Internal::Util.interpolate_path(uninterpolated_path) + + query = Privy::Internal::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h) + + headers = Privy::Internal::Util.normalized_headers( + @headers, + auth_headers, + req[:headers].to_h, + opts[:extra_headers].to_h + ) + + if @idempotency_header && + !headers.key?(@idempotency_header) && + (!Net::HTTP::IDEMPOTENT_METHODS_.include?(method.to_s.upcase) || opts.key?(:idempotency_key)) + headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key } + end + + unless headers.key?("x-stainless-retry-count") + headers["x-stainless-retry-count"] = "0" + end + + timeout = opts.fetch(:timeout, @timeout).to_f.clamp(0..) + unless headers.key?("x-stainless-timeout") || timeout.zero? + headers["x-stainless-timeout"] = timeout.to_s + end + + headers.reject! { |_, v| v.to_s.empty? } + + body = + case method + in :get | :head | :options | :trace + nil + else + Privy::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) + end + + headers.delete("content-type") if body.nil? + + url = Privy::Internal::Util.join_parsed_uri(@base_url_components, {**req, path: path, query: query}) + headers, encoded = Privy::Internal::Util.encode_content(headers, body) + { + method: method, + url: url, + headers: headers, + body: encoded, + max_retries: opts.fetch(:max_retries, @max_retries), + timeout: timeout + } + end + + # @api private + # + # @param headers [Hash{String=>String}] + # @param retry_count [Integer] + # + # @return [Float] + private def retry_delay(headers, retry_count:) + # Non-standard extension + span = Float(headers["retry-after-ms"], exception: false)&.then { _1 / 1000 } + return span if span + + retry_header = headers["retry-after"] + return span if (span = Float(retry_header, exception: false)) + + span = retry_header&.then do + Time.httpdate(_1) - Time.now + rescue ArgumentError + nil + end + return span if span + + scale = retry_count**2 + jitter = 1 - (0.25 * rand) + (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Integer] :max_retries + # + # @option request [Float] :timeout + # + # @param redirect_count [Integer] + # + # @param retry_count [Integer] + # + # @param send_retry_header [Boolean] + # + # @raise [Privy::Errors::APIError] + # @return [Array(Integer, Net::HTTPResponse, Enumerable)] + def send_request(request, redirect_count:, retry_count:, send_retry_header:) + url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout) + input = {**request.except(:timeout), deadline: Privy::Internal::Util.monotonic_secs + timeout} + + if send_retry_header + headers["x-stainless-retry-count"] = retry_count.to_s + end + + begin + status, response, stream = @requester.execute(input) + rescue Privy::Errors::APIConnectionError => e + status = e + end + headers = Privy::Internal::Util.normalized_headers(response&.each_header&.to_h) + + case status + in ..299 + [status, response, stream] + in 300..399 if redirect_count >= self.class::MAX_REDIRECTS + self.class.reap_connection!(status, stream: stream) + + message = "Failed to complete the request within #{self.class::MAX_REDIRECTS} redirects." + raise Privy::Errors::APIConnectionError.new(url: url, response: response, message: message) + in 300..399 + self.class.reap_connection!(status, stream: stream) + + request = self.class.follow_redirect(request, status: status, response_headers: headers) + send_request( + request, + redirect_count: redirect_count + 1, + retry_count: retry_count, + send_retry_header: send_retry_header + ) + in Privy::Errors::APIConnectionError if retry_count >= max_retries + raise status + in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: headers) + decoded = Kernel.then do + Privy::Internal::Util.decode_content(headers, stream: stream, suppress_error: true) + ensure + self.class.reap_connection!(status, stream: stream) + end + + raise Privy::Errors::APIStatusError.for( + url: url, + status: status, + headers: headers, + body: decoded, + request: nil, + response: response + ) + in (400..) | Privy::Errors::APIConnectionError + self.class.reap_connection!(status, stream: stream) + + delay = retry_delay(response || {}, retry_count: retry_count) + sleep(delay) + + send_request( + request, + redirect_count: redirect_count, + retry_count: retry_count + 1, + send_retry_header: send_retry_header + ) + end + end + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + # + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: Privy::Internal::Type::Unknown, options: {}) + # + # @param method [Symbol] + # + # @param path [String, Array] + # + # @param query [Hash{String=>Array, String, nil}, nil] + # + # @param headers [Hash{String=>String, Integer, Array, nil}, nil] + # + # @param body [Object, nil] + # + # @param unwrap [Symbol, Integer, Array, Proc, nil] + # + # @param page [Class, nil] + # + # @param stream [Class, nil] + # + # @param model [Privy::Internal::Type::Converter, Class, nil] + # + # @param options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] . + # + # @option options [String, nil] :idempotency_key + # + # @option options [Hash{String=>Array, String, nil}, nil] :extra_query + # + # @option options [Hash{String=>String, nil}, nil] :extra_headers + # + # @option options [Object, nil] :extra_body + # + # @option options [Integer, nil] :max_retries + # + # @option options [Float, nil] :timeout + # + # @raise [Privy::Errors::APIError] + # @return [Object] + def request(req) + self.class.validate!(req) + model = req.fetch(:model) { Privy::Internal::Type::Unknown } + opts = req[:options].to_h + unwrap = req[:unwrap] + Privy::RequestOptions.validate!(opts) + request = build_request(req.except(:options), opts) + url = request.fetch(:url) + + # Don't send the current retry count in the headers if the caller modified the header defaults. + send_retry_header = request.fetch(:headers)["x-stainless-retry-count"] == "0" + status, response, stream = send_request( + request, + redirect_count: 0, + retry_count: 0, + send_retry_header: send_retry_header + ) + + headers = Privy::Internal::Util.normalized_headers(response.each_header.to_h) + decoded = Privy::Internal::Util.decode_content(headers, stream: stream) + case req + in {stream: Class => st} + st.new( + model: model, + url: url, + status: status, + headers: headers, + response: response, + unwrap: unwrap, + stream: decoded + ) + in {page: Class => page} + page.new(client: self, req: req, headers: headers, page_data: decoded) + else + unwrapped = Privy::Internal::Util.dig(decoded, unwrap) + Privy::Internal::Type::Converter.coerce(model, unwrapped) + end + end + + # @api private + # + # @return [String] + def inspect + # rubocop:disable Layout/LineLength + "#<#{self.class.name}:0x#{object_id.to_s(16)} base_url=#{@base_url} max_retries=#{@max_retries} timeout=#{@timeout}>" + # rubocop:enable Layout/LineLength + end + + define_sorbet_constant!(:RequestComponents) do + T.type_alias do + { + method: Symbol, + path: T.any(String, T::Array[String]), + query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), + headers: T.nilable( + T::Hash[String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + )] + ), + body: T.nilable(T.anything), + unwrap: T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), + page: T.nilable(T::Class[Privy::Internal::Type::BasePage[Privy::Internal::Type::BaseModel]]), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Privy::Internal::Type::Converter::Input), + options: T.nilable(Privy::RequestOptions::OrHash) + } + end + end + define_sorbet_constant!(:RequestInput) do + T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + max_retries: Integer, + timeout: Float + } + end + end + end + end + end +end diff --git a/lib/privy/internal/transport/pooled_net_requester.rb b/lib/privy/internal/transport/pooled_net_requester.rb new file mode 100644 index 0000000..138dd36 --- /dev/null +++ b/lib/privy/internal/transport/pooled_net_requester.rb @@ -0,0 +1,210 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Transport + # @api private + class PooledNetRequester + extend Privy::Internal::Util::SorbetRuntimeSupport + + # from the golang stdlib + # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 + KEEP_ALIVE_TIMEOUT = 30 + + DEFAULT_MAX_CONNECTIONS = [Etc.nprocessors, 99].max + + class << self + # @api private + # + # @param cert_store [OpenSSL::X509::Store] + # @param url [URI::Generic] + # + # @return [Net::HTTP] + def connect(cert_store:, url:) + port = + case [url.port, url.scheme] + in [Integer, _] + url.port + in [nil, "http" | "ws"] + Net::HTTP.http_default_port + in [nil, "https" | "wss"] + Net::HTTP.https_default_port + end + + Net::HTTP.new(url.host, port).tap do + _1.use_ssl = %w[https wss].include?(url.scheme) + _1.max_retries = 0 + + (_1.cert_store = cert_store) if _1.use_ssl? + end + end + + # @api private + # + # @param conn [Net::HTTP] + # @param deadline [Float] + def calibrate_socket_timeout(conn, deadline) + timeout = deadline - Privy::Internal::Util.monotonic_secs + conn.open_timeout = conn.read_timeout = conn.write_timeout = conn.continue_timeout = timeout + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @param blk [Proc] + # + # @yieldparam [String] + # @return [Array(Net::HTTPGenericRequest, Proc)] + def build_request(request, &blk) + method, url, headers, body = request.fetch_values(:method, :url, :headers, :body) + req = Net::HTTPGenericRequest.new( + method.to_s.upcase, + !body.nil?, + method != :head, + URI(url.to_s) # ensure we construct a URI class of the right scheme + ) + + headers.each { req[_1] = _2 } + + case body + in nil + req["content-length"] ||= 0 unless req["transfer-encoding"] + in String + req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"] + req.body_stream = Privy::Internal::Util::ReadIOAdapter.new(body, &blk) + in StringIO + req["content-length"] ||= body.size.to_s unless req["transfer-encoding"] + req.body_stream = Privy::Internal::Util::ReadIOAdapter.new(body, &blk) + in Pathname | IO | Enumerator + req["transfer-encoding"] ||= "chunked" unless req["content-length"] + req.body_stream = Privy::Internal::Util::ReadIOAdapter.new(body, &blk) + end + + [req, req.body_stream&.method(:close)] + end + end + + # @api private + # + # @param url [URI::Generic] + # @param deadline [Float] + # @param blk [Proc] + # + # @raise [Timeout::Error] + # @yieldparam [Net::HTTP] + private def with_pool(url, deadline:, &blk) + origin = Privy::Internal::Util.uri_origin(url) + timeout = deadline - Privy::Internal::Util.monotonic_secs + pool = + @mutex.synchronize do + @pools[origin] ||= ConnectionPool.new(size: @size) do + self.class.connect(cert_store: @cert_store, url: url) + end + end + + pool.with(timeout: timeout, &blk) + end + + # @api private + # + # @param request [Hash{Symbol=>Object}] . + # + # @option request [Symbol] :method + # + # @option request [URI::Generic] :url + # + # @option request [Hash{String=>String}] :headers + # + # @option request [Object] :body + # + # @option request [Float] :deadline + # + # @return [Array(Integer, Net::HTTPResponse, Enumerable)] + def execute(request) + url, deadline = request.fetch_values(:url, :deadline) + + req = nil + finished = false + + # rubocop:disable Metrics/BlockLength + enum = Enumerator.new do |y| + next if finished + + with_pool(url, deadline: deadline) do |conn| + eof = false + closing = nil + ::Thread.handle_interrupt(Object => :never) do + ::Thread.handle_interrupt(Object => :immediate) do + req, closing = self.class.build_request(request) do + self.class.calibrate_socket_timeout(conn, deadline) + end + + self.class.calibrate_socket_timeout(conn, deadline) + unless conn.started? + conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT + conn.start + end + + self.class.calibrate_socket_timeout(conn, deadline) + ::Kernel.catch(:jump) do + conn.request(req) do |rsp| + y << [req, rsp] + ::Kernel.throw(:jump) if finished + + rsp.read_body do |bytes| + y << bytes.force_encoding(Encoding::BINARY) + ::Kernel.throw(:jump) if finished + + self.class.calibrate_socket_timeout(conn, deadline) + end + eof = true + end + end + end + ensure + begin + conn.finish if !eof && conn&.started? + ensure + closing&.call + end + end + end + rescue Timeout::Error + raise Privy::Errors::APITimeoutError.new(url: url, request: req) + rescue StandardError + raise Privy::Errors::APIConnectionError.new(url: url, request: req) + end + # rubocop:enable Metrics/BlockLength + + _, response = enum.next + body = Privy::Internal::Util.fused_enum(enum, external: true) do + finished = true + loop { enum.next } + end + [Integer(response.code), response, body] + end + + # @api private + # + # @param size [Integer] + def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS) + @mutex = Mutex.new + @size = size + @cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths) + @pools = {} + end + + define_sorbet_constant!(:Request) do + T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} } + end + end + end + end +end diff --git a/lib/privy/internal/type/array_of.rb b/lib/privy/internal/type/array_of.rb new file mode 100644 index 0000000..2e550fc --- /dev/null +++ b/lib/privy/internal/type/array_of.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # @abstract + # + # @generic Elem + # + # Array of items of a given type. + class ArrayOf + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + private_class_method :new + + # @overload [](type_info, spec = {}) + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [self] + def self.[](...) = new(...) + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ===(other) = other.is_a?(Array) && other.all?(item_type) + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ==(other) + # rubocop:disable Layout/LineLength + other.is_a?(Privy::Internal::Type::ArrayOf) && other.nilable? == nilable? && other.item_type == item_type + # rubocop:enable Layout/LineLength + end + + # @api public + # + # @return [Integer] + def hash = [self.class, item_type].hash + + # @api private + # + # @param value [Array, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Array, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + + unless value.is_a?(Array) + exactness[:no] += 1 + state[:error] = TypeError.new("#{value.class} can't be coerced into #{Array}") + return value + end + + target = item_type + exactness[:yes] += 1 + value + .map do |item| + case [nilable?, item] + in [true, nil] + exactness[:yes] += 1 + nil + else + Privy::Internal::Type::Converter.coerce(target, item, state: state) + end + end + end + + # @api private + # + # @param value [Array, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Array, Object] + def dump(value, state:) + target = item_type + if value.is_a?(Array) + value.map do + Privy::Internal::Type::Converter.dump(target, _1, state: state) + end + else + super + end + end + + # @api private + # + # @return [Object] + def to_sorbet_type + T::Array[Privy::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(item_type)] + end + + # @api private + # + # @return [generic] + protected def item_type = @item_type_fn.call + + # @api private + # + # @return [Boolean] + protected def nilable? = @nilable + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def initialize(type_info, spec = {}) + @item_type_fn = Privy::Internal::Type::Converter.type_info(type_info || spec) + @meta = Privy::Internal::Type::Converter.meta_info(type_info, spec) + @nilable = spec.fetch(:nil?, false) + end + + # @api private + # + # @param depth [Integer] + # + # @return [String] + def inspect(depth: 0) + items = Privy::Internal::Type::Converter.inspect(item_type, depth: depth.succ) + + "#{self.class}[#{[items, nilable? ? 'nil' : nil].compact.join(' | ')}]" + end + end + end + end +end diff --git a/lib/privy/internal/type/base_model.rb b/lib/privy/internal/type/base_model.rb new file mode 100644 index 0000000..755562a --- /dev/null +++ b/lib/privy/internal/type/base_model.rb @@ -0,0 +1,530 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @abstract + class BaseModel + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + class << self + # @api private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + # + # @param child [Class] + def inherited(child) + super + child.known_fields.replace(known_fields.dup) + end + + # @api private + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + def known_fields = @known_fields ||= {} + + # @api private + # + # @return [Hash{Symbol=>Hash{Symbol=>Object}}] + def fields + known_fields.transform_values do |field| + {**field.except(:type_fn), type: field.fetch(:type_fn).call} + end + end + + # @api private + # + # @param name_sym [Symbol] + # + # @param required [Boolean] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + private def add_field(name_sym, required:, type_info:, spec:) + meta = Privy::Internal::Type::Converter.meta_info(type_info, spec) + type_fn, info = + case type_info + in Proc | Privy::Internal::Type::Converter | Class + [Privy::Internal::Type::Converter.type_info({**spec, union: type_info}), spec] + in Hash + [Privy::Internal::Type::Converter.type_info(type_info), type_info] + end + + setter = :"#{name_sym}=" + api_name = info.fetch(:api_name, name_sym) + nilable = info.fetch(:nil?, false) + const = required && !nilable ? info.fetch(:const, Privy::Internal::OMIT) : Privy::Internal::OMIT + + [name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym) + + known_fields[name_sym] = + { + mode: @mode, + api_name: api_name, + required: required, + nilable: nilable, + const: const, + type_fn: type_fn, + meta: meta + } + + define_method(setter) do |value| + target = type_fn.call + state = Privy::Internal::Type::Converter.new_coerce_state(translate_names: false) + coerced = Privy::Internal::Type::Converter.coerce(target, value, state: state) + status = @coerced.store(name_sym, state.fetch(:error) || true) + stored = + case [target, status] + in [Privy::Internal::Type::Converter | Symbol, true] + coerced + else + value + end + @data.store(name_sym, stored) + end + + # rubocop:disable Style/CaseEquality + # rubocop:disable Metrics/BlockLength + define_method(name_sym) do + target = type_fn.call + + case @coerced[name_sym] + in true | false if Privy::Internal::Type::Converter === target + @data.fetch(name_sym) + in ::StandardError => e + raise Privy::Errors::ConversionError.new( + on: self.class, + method: __method__, + target: target, + value: @data.fetch(name_sym), + cause: e + ) + else + Kernel.then do + value = @data.fetch(name_sym) { const == Privy::Internal::OMIT ? nil : const } + state = Privy::Internal::Type::Converter.new_coerce_state(translate_names: false) + if (nilable || !required) && value.nil? + nil + else + Privy::Internal::Type::Converter.coerce( + target, value, state: state + ) + end + rescue StandardError => e + raise Privy::Errors::ConversionError.new( + on: self.class, + method: __method__, + target: target, + value: value, + cause: e + ) + end + end + end + # rubocop:enable Metrics/BlockLength + # rubocop:enable Style/CaseEquality + end + + # @api private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def required(name_sym, type_info, spec = {}) + add_field(name_sym, required: true, type_info: type_info, spec: spec) + end + + # @api private + # + # @param name_sym [Symbol] + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def optional(name_sym, type_info, spec = {}) + add_field(name_sym, required: false, type_info: type_info, spec: spec) + end + + # @api private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + # + # @param blk [Proc] + private def request_only(&blk) + @mode = :dump + blk.call + ensure + @mode = nil + end + + # @api private + # + # `response_only` attributes are omitted from `.#dump` when making requests + # + # @param blk [Proc] + private def response_only(&blk) + @mode = :coerce + blk.call + ensure + @mode = nil + end + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ==(other) + other.is_a?(Class) && other <= Privy::Internal::Type::BaseModel && other.fields == fields + end + + # @api public + # + # @return [Integer] + def hash = fields.hash + end + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ==(other) = self.class == other.class && @data == other.to_h + + # @api public + # + # @return [Integer] + def hash = [self.class, @data].hash + + class << self + # @api private + # + # @param value [Privy::Internal::Type::BaseModel, Hash{Object=>Object}, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [self, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + + if value.is_a?(self) + exactness[:yes] += 1 + return value + end + + unless (val = Privy::Internal::Util.coerce_hash(value)).is_a?(Hash) + exactness[:no] += 1 + state[:error] = TypeError.new("#{value.class} can't be coerced into #{Hash}") + return value + end + exactness[:yes] += 1 + + keys = val.keys.to_set + instance = new + data = instance.to_h + status = instance.instance_variable_get(:@coerced) + + # rubocop:disable Metrics/BlockLength + fields.each do |name, field| + mode, required, target = field.fetch_values(:mode, :required, :type) + api_name, nilable, const = field.fetch_values(:api_name, :nilable, :const) + src_name = state.fetch(:translate_names) ? api_name : name + + unless val.key?(src_name) + if required && mode != :dump && const == Privy::Internal::OMIT + exactness[nilable ? :maybe : :no] += 1 + else + exactness[:yes] += 1 + end + next + end + + item = val.fetch(src_name) + keys.delete(src_name) + + state[:error] = nil + converted = + if item.nil? && (nilable || !required) + exactness[nilable ? :yes : :maybe] += 1 + nil + else + coerced = Privy::Internal::Type::Converter.coerce(target, item, state: state) + case target + in Privy::Internal::Type::Converter | Symbol + coerced + else + item + end + end + + status.store(name, state.fetch(:error) || true) + data.store(name, converted) + end + # rubocop:enable Metrics/BlockLength + + keys.each { data.store(_1, val.fetch(_1)) } + instance + end + + # @api private + # + # @param value [self, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Hash{Object=>Object}, Object] + def dump(value, state:) + unless (coerced = Privy::Internal::Util.coerce_hash(value)).is_a?(Hash) + return super + end + + acc = {} + + coerced.each do |key, val| + name = key.is_a?(String) ? key.to_sym : key + case (field = known_fields[name]) + in nil + acc.store(name, super(val, state: state)) + else + api_name, mode, type_fn = field.fetch_values(:api_name, :mode, :type_fn) + case mode + in :coerce + next + else + target = type_fn.call + acc.store(api_name, Privy::Internal::Type::Converter.dump(target, val, state: state)) + end + end + end + + known_fields.each_value do |field| + api_name, mode, const = field.fetch_values(:api_name, :mode, :const) + next if mode == :coerce || acc.key?(api_name) || const == Privy::Internal::OMIT + acc.store(api_name, const) + end + + acc + end + + # @api private + # + # @return [Object] + def to_sorbet_type + self + end + end + + class << self + # @api private + # + # @param model [Privy::Internal::Type::BaseModel] + # @param convert [Boolean] + # + # @return [Hash{Symbol=>Object}] + def recursively_to_h(model, convert:) + rec = ->(x) do + case x + in Privy::Internal::Type::BaseModel + if convert + fields = x.class.known_fields + x.to_h.to_h do |key, val| + [key, rec.call(fields.key?(key) ? x.public_send(key) : val)] + rescue Privy::Errors::ConversionError + [key, rec.call(val)] + end + else + rec.call(x.to_h) + end + in Hash + x.transform_values(&rec) + in Array + x.map(&rec) + else + x + end + end + rec.call(model) + end + end + + # @api public + # + # Returns the raw value associated with the given key, if found. Otherwise, nil is + # returned. + # + # It is valid to lookup keys that are not in the API spec, for example to access + # undocumented features. This method does not parse response data into + # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. + # + # @param key [Symbol] + # + # @return [Object, nil] + def [](key) + unless key.instance_of?(Symbol) + raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") + end + + @data[key] + end + + # @api public + # + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + # + # @return [Hash{Symbol=>Object}] + def to_h = @data + + alias_method :to_hash, :to_h + + # @api public + # + # In addition to the behaviour of `#to_h`, this method will recursively call + # `#to_h` on nested models. + # + # @return [Hash{Symbol=>Object}] + def deep_to_h = self.class.recursively_to_h(@data, convert: false) + + # @param keys [Array, nil] + # + # @return [Hash{Symbol=>Object}] + # + # @example + # # `additional_signer_item_input` is a `Privy::AdditionalSignerItemInput` + # additional_signer_item_input => { + # signer_id: signer_id, + # override_policy_ids: override_policy_ids + # } + def deconstruct_keys(keys) + (keys || self.class.known_fields.keys) + .filter_map do |k| + unless self.class.known_fields.key?(k) + next + end + + [k, public_send(k)] + end + .to_h + end + + # @api public + # + # @param a [Object] + # + # @return [String] + def to_json(*a) = Privy::Internal::Type::Converter.dump(self.class, self).to_json(*a) + + # @api public + # + # @param a [Object] + # + # @return [String] + def to_yaml(*a) = Privy::Internal::Type::Converter.dump(self.class, self).to_yaml(*a) + + # Create a new instance of a model. + # + # @param data [Hash{Symbol=>Object}, self] + def initialize(data = {}) + @data = {} + @coerced = {} + Privy::Internal::Util.coerce_hash!(data).each do + if self.class.known_fields.key?(_1) + public_send(:"#{_1}=", _2) + else + @data.store(_1, _2) + @coerced.store(_1, false) + end + end + end + + class << self + # @api private + # + # @param depth [Integer] + # + # @return [String] + def inspect(depth: 0) + return super() if depth.positive? + + depth = depth.succ + deferred = fields.transform_values do |field| + type, required, nilable = field.fetch_values(:type, :required, :nilable) + inspected = [ + Privy::Internal::Type::Converter.inspect(type, depth: depth), + !required || nilable ? "nil" : nil + ].compact.join(" | ") + -> { inspected }.tap { _1.define_singleton_method(:inspect) { call } } + end + + "#{name}[#{deferred.inspect}]" + end + end + + # @api public + # + # @return [String] + def to_s = deep_to_h.to_s + + # @api private + # + # @return [String] + def inspect + converted = self.class.recursively_to_h(self, convert: true) + "#<#{self.class}:0x#{object_id.to_s(16)} #{converted}>" + end + + define_sorbet_constant!(:KnownField) do + T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean, nilable: T::Boolean} } + end + end + end + end +end diff --git a/lib/privy/internal/type/base_page.rb b/lib/privy/internal/type/base_page.rb new file mode 100644 index 0000000..678ae69 --- /dev/null +++ b/lib/privy/internal/type/base_page.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # @generic Elem + # + # This module provides a base implementation for paginated responses in the SDK. + module BasePage + # rubocop:disable Lint/UnusedMethodArgument + + # @api public + # + # @return [Boolean] + def next_page? = (raise NotImplementedError) + + # @api public + # + # @raise [Privy::Errors::APIError] + # @return [self] + def next_page = (raise NotImplementedError) + + # @api public + # + # @param blk [Proc] + # + # @yieldparam [generic] + # @return [void] + def auto_paging_each(&blk) = (raise NotImplementedError) + + # @return [Enumerable>] + def to_enum = super(:auto_paging_each) + + alias_method :enum_for, :to_enum + + # @api private + # + # @param client [Privy::Internal::Transport::BaseClient] + # @param req [Hash{Symbol=>Object}] + # @param headers [Hash{String=>String}] + # @param page_data [Object] + def initialize(client:, req:, headers:, page_data:) + @client = client + @req = req + @model = req.fetch(:model) + super() + end + + # rubocop:enable Lint/UnusedMethodArgument + end + end + end +end diff --git a/lib/privy/internal/type/boolean.rb b/lib/privy/internal/type/boolean.rb new file mode 100644 index 0000000..b9b191f --- /dev/null +++ b/lib/privy/internal/type/boolean.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # @abstract + # + # Ruby has no Boolean class; this is something for models to refer to. + class Boolean + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + private_class_method :new + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.===(other) = other == true || other == false + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.==(other) = other.is_a?(Class) && other <= Privy::Internal::Type::Boolean + + class << self + # @api private + # + # Coerce value to Boolean if possible, otherwise return the original value. + # + # @param value [Boolean, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Boolean, Object] + def coerce(value, state:) + state.fetch(:exactness)[value == true || value == false ? :yes : :no] += 1 + value + end + + # @!method dump(value, state:) + # @api private + # + # @param value [Boolean, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Boolean, Object] + + # @api private + # + # @return [Object] + def to_sorbet_type + T::Boolean + end + end + end + end + end +end diff --git a/lib/privy/internal/type/converter.rb b/lib/privy/internal/type/converter.rb new file mode 100644 index 0000000..ae277f9 --- /dev/null +++ b/lib/privy/internal/type/converter.rb @@ -0,0 +1,327 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + module Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + # rubocop:disable Lint/UnusedMethodArgument + + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce(value, state:) = (raise NotImplementedError) + + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Object] + def dump(value, state:) + case value + in Array + value.map { Privy::Internal::Type::Unknown.dump(_1, state: state) } + in Hash + value.transform_values { Privy::Internal::Type::Unknown.dump(_1, state: state) } + in Privy::Internal::Type::BaseModel + value.class.dump(value, state: state) + in StringIO + value.string + in Pathname | IO + state[:can_retry] = false if value.is_a?(IO) + Privy::FilePart.new(value) + in Privy::FilePart + state[:can_retry] = false if value.content.is_a?(IO) + value + else + value + end + end + + # @api private + # + # @param depth [Integer] + # + # @return [String] + def inspect(depth: 0) + super() + end + + # rubocop:enable Lint/UnusedMethodArgument + + class << self + # @api private + # + # @param spec [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [Proc] + def type_info(spec) + case spec + in Proc + spec + in Hash + type_info(spec.slice(:const, :enum, :union).first&.last) + in true | false + -> { Privy::Internal::Type::Boolean } + in Privy::Internal::Type::Converter | Class | Symbol + -> { spec } + in NilClass | Integer | Float + -> { spec.class } + end + end + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] . + # + # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option type_info [Proc] :enum + # + # @option type_info [Proc] :union + # + # @option type_info [Boolean] :"nil?" + # + # @param spec [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [Hash{Symbol=>Object}] + def meta_info(type_info, spec) + [spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?) + end + + # @api private + # + # @param translate_names [Boolean] + # + # @return [Hash{Symbol=>Object}] + def new_coerce_state(translate_names: true) + { + translate_names: translate_names, + strictness: true, + exactness: {yes: 0, no: 0, maybe: 0}, + error: nil, + branched: 0 + } + end + + # @api private + # + # Based on `target`, transform `value` into `target`, to the extent possible: + # + # 1. if the given `value` conforms to `target` already, return the given `value` + # 2. if it's possible and safe to convert the given `value` to `target`, then the + # converted value + # 3. otherwise, the given `value` unaltered + # + # The coercion process is subject to improvement between minor release versions. + # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode + # + # @param target [Privy::Internal::Type::Converter, Class] + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] The `strictness` is one of `true`, `false`. This informs the coercion strategy + # when we have to decide between multiple possible conversion targets: + # + # - `true`: the conversion must be exact, with minimum coercion. + # - `false`: the conversion can be approximate, with some coercion. + # + # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For + # any given conversion attempt, the exactness will be updated based on how closely + # the value recursively matches the target type: + # + # - `yes`: the value can be converted to the target type with minimum coercion. + # - `maybe`: the value can be converted to the target type with some reasonable + # coercion. + # - `no`: the value cannot be converted to the target type. + # + # See implementation below for more details. + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce(target, value, state: Privy::Internal::Type::Converter.new_coerce_state) + # rubocop:disable Metrics/BlockNesting + exactness = state.fetch(:exactness) + + case target + in Privy::Internal::Type::Converter + return target.coerce(value, state: state) + in Class + if value.is_a?(target) + exactness[:yes] += 1 + return value + end + + case target + in -> { _1 <= NilClass } + exactness[value.nil? ? :yes : :maybe] += 1 + return nil + in -> { _1 <= Integer } + case value + in Integer + exactness[:yes] += 1 + return value + else + Kernel.then do + return Integer(value).tap { exactness[:maybe] += 1 } + rescue ArgumentError, TypeError => e + state[:error] = e + end + end + in -> { _1 <= Float } + if value.is_a?(Numeric) + exactness[:yes] += 1 + return Float(value) + else + Kernel.then do + return Float(value).tap { exactness[:maybe] += 1 } + rescue ArgumentError, TypeError => e + state[:error] = e + end + end + in -> { _1 <= String } + case value + in String | Symbol | Numeric + exactness[value.is_a?(Numeric) ? :maybe : :yes] += 1 + return value.to_s + in StringIO + exactness[:yes] += 1 + return value.string + else + state[:error] = TypeError.new("#{value.class} can't be coerced into #{String}") + end + in -> { _1 <= Date || _1 <= Time } + Kernel.then do + return target.parse(value).tap { exactness[:yes] += 1 } + rescue ArgumentError, TypeError => e + state[:error] = e + end + in -> { _1 <= StringIO } if value.is_a?(String) + exactness[:yes] += 1 + return StringIO.new(value.b) + else + end + in Symbol + case value + in Symbol | String + if value.to_sym == target + exactness[:yes] += 1 + return target + else + exactness[:maybe] += 1 + return value + end + else + message = "cannot convert non-matching #{value.class} into #{target.inspect}" + state[:error] = ArgumentError.new(message) + end + else + end + + exactness[:no] += 1 + value + # rubocop:enable Metrics/BlockNesting + end + + # @api private + # + # @param target [Privy::Internal::Type::Converter, Class] + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Object] + def dump(target, value, state: {can_retry: true}) + case target + in Privy::Internal::Type::Converter + target.dump(value, state: state) + else + Privy::Internal::Type::Unknown.dump(value, state: state) + end + end + + # @api private + # + # @param target [Object] + # @param depth [Integer] + # + # @return [String] + def inspect(target, depth:) + case target + in Privy::Internal::Type::Converter + target.inspect(depth: depth.succ) + else + target.inspect + end + end + end + + define_sorbet_constant!(:Input) do + T.type_alias { T.any(Privy::Internal::Type::Converter, T::Class[T.anything]) } + end + define_sorbet_constant!(:CoerceState) do + T.type_alias do + { + translate_names: T::Boolean, + strictness: T::Boolean, + exactness: {yes: Integer, no: Integer, maybe: Integer}, + error: T::Class[StandardError], + branched: Integer + } + end + end + define_sorbet_constant!(:DumpState) do + T.type_alias { {can_retry: T::Boolean} } + end + end + end + end +end diff --git a/lib/privy/internal/type/enum.rb b/lib/privy/internal/type/enum.rb new file mode 100644 index 0000000..42893cf --- /dev/null +++ b/lib/privy/internal/type/enum.rb @@ -0,0 +1,152 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # A value from among a specified list of options. OpenAPI enum values map to Ruby + # values in the SDK as follows: + # + # 1. boolean => true | false + # 2. integer => Integer + # 3. float => Float + # 4. string => Symbol + # + # We can therefore convert string values to Symbols, but can't convert other + # values safely. + # + # @example + # # `amount_type` is a `Privy::AmountType` + # case amount_type + # when Privy::AmountType::EXACT_INPUT + # # ... + # when Privy::AmountType::EXACT_OUTPUT + # # ... + # else + # puts(amount_type) + # end + # + # @example + # case amount_type + # in :exact_input + # # ... + # in :exact_output + # # ... + # else + # puts(amount_type) + # end + module Enum + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + # All of the valid Symbol values for this enum. + # + # @return [Array] + def values = constants.map { const_get(_1) } + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ===(other) = values.include?(other) + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ==(other) + # rubocop:disable Style/CaseEquality + Privy::Internal::Type::Enum === other && other.values.to_set == values.to_set + # rubocop:enable Style/CaseEquality + end + + # @api public + # + # @return [Integer] + def hash = values.to_set.hash + + # @api private + # + # Unlike with primitives, `Enum` additionally validates that the value is a member + # of the enum. + # + # @param value [String, Symbol, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Symbol, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + val = value.is_a?(String) ? value.to_sym : value + + if values.include?(val) + exactness[:yes] += 1 + val + elsif values.first&.class == val.class + exactness[:maybe] += 1 + value + else + exactness[:no] += 1 + state[:error] = TypeError.new("#{value.class} can't be coerced into #{self}") + value + end + end + + # @!method dump(value, state:) + # @api private + # + # @param value [Symbol, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Symbol, Object] + + # @api private + # + # @return [Object] + def to_sorbet_type + types = values.map { Privy::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq + case types + in [] + T.noreturn + in [type] + type + else + T.any(*types) + end + end + + # @api private + # + # @param depth [Integer] + # + # @return [String] + def inspect(depth: 0) + if depth.positive? + return is_a?(Module) ? super() : self.class.name + end + + members = values.map { Privy::Internal::Type::Converter.inspect(_1, depth: depth.succ) } + prefix = is_a?(Module) ? name : self.class.name + + "#{prefix}[#{members.join(' | ')}]" + end + end + end + end +end diff --git a/lib/privy/internal/type/file_input.rb b/lib/privy/internal/type/file_input.rb new file mode 100644 index 0000000..6e055eb --- /dev/null +++ b/lib/privy/internal/type/file_input.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # @abstract + # + # Either `Pathname` or `StringIO`, or `IO`, or `Privy::Internal::Type::FileInput`. + # + # Note: when `IO` is used, all retries are disabled, since many IO` streams are + # not rewindable. + class FileInput + extend Privy::Internal::Type::Converter + + private_class_method :new + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.===(other) + case other + in Pathname | StringIO | IO | String | Privy::FilePart + true + else + false + end + end + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.==(other) = other.is_a?(Class) && other <= Privy::Internal::Type::FileInput + + class << self + # @api private + # + # @param value [StringIO, String, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [StringIO, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + case value + in String + exactness[:yes] += 1 + StringIO.new(value) + in StringIO + exactness[:yes] += 1 + value + else + state[:error] = TypeError.new("#{value.class} can't be coerced into #{StringIO}") + exactness[:no] += 1 + value + end + end + + # @api private + # + # @param value [Pathname, StringIO, IO, String, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Pathname, StringIO, IO, String, Object] + def dump(value, state:) + case value + in StringIO | String + # https://datatracker.ietf.org/doc/html/rfc7578#section-4.2 + # while not required, a filename is recommended, and in practice many servers do expect this + Privy::FilePart.new(value, filename: "upload") + in IO + state[:can_retry] = false + value.to_path.nil? ? Privy::FilePart.new(value, filename: "upload") : value + in Privy::FilePart if value.content.is_a?(IO) + state[:can_retry] = false + value + else + value + end + end + + # @api private + # + # @return [Object] + def to_sorbet_type + T.any(Pathname, StringIO, IO, String, Privy::FilePart) + end + end + end + end + end +end diff --git a/lib/privy/internal/type/hash_of.rb b/lib/privy/internal/type/hash_of.rb new file mode 100644 index 0000000..169ac4c --- /dev/null +++ b/lib/privy/internal/type/hash_of.rb @@ -0,0 +1,188 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # @abstract + # + # @generic Elem + # + # Hash of items of a given type. + class HashOf + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + private_class_method :new + + # @overload [](type_info, spec = {}) + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + # + # @return [self] + def self.[](...) = new(...) + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ===(other) + type = item_type + case other + in Hash + other.all? do |key, val| + case [key, val] + in [Symbol | String, ^type] + true + else + false + end + end + else + false + end + end + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ==(other) + # rubocop:disable Layout/LineLength + other.is_a?(Privy::Internal::Type::HashOf) && other.nilable? == nilable? && other.item_type == item_type + # rubocop:enable Layout/LineLength + end + + # @api public + # + # @return [Integer] + def hash = [self.class, item_type].hash + + # @api private + # + # @param value [Hash{Object=>Object}, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Hash{Symbol=>Object}, Object] + def coerce(value, state:) + exactness = state.fetch(:exactness) + + unless value.is_a?(Hash) + exactness[:no] += 1 + state[:error] = TypeError.new("#{value.class} can't be coerced into #{Hash}") + return value + end + + target = item_type + exactness[:yes] += 1 + value + .to_h do |key, val| + k = key.is_a?(String) ? key.to_sym : key + v = + case [nilable?, val] + in [true, nil] + exactness[:yes] += 1 + nil + else + Privy::Internal::Type::Converter.coerce(target, val, state: state) + end + + exactness[:no] += 1 unless k.is_a?(Symbol) + [k, v] + end + end + + # @api private + # + # @param value [Hash{Object=>Object}, Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Hash{Symbol=>Object}, Object] + def dump(value, state:) + target = item_type + if value.is_a?(Hash) + value.transform_values do + Privy::Internal::Type::Converter.dump(target, _1, state: state) + end + else + super + end + end + + # @api private + # + # @return [Object] + def to_sorbet_type + T::Hash[Privy::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(item_type)] + end + + # @api private + # + # @return [generic] + protected def item_type = @item_type_fn.call + + # @api private + # + # @return [Boolean] + protected def nilable? = @nilable + + # @api private + # + # @param type_info [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + def initialize(type_info, spec = {}) + @item_type_fn = Privy::Internal::Type::Converter.type_info(type_info || spec) + @meta = Privy::Internal::Type::Converter.meta_info(type_info, spec) + @nilable = spec.fetch(:nil?, false) + end + + # @api private + # + # @param depth [Integer] + # + # @return [String] + def inspect(depth: 0) + items = Privy::Internal::Type::Converter.inspect(item_type, depth: depth.succ) + + "#{self.class}[#{[items, nilable? ? 'nil' : nil].compact.join(' | ')}]" + end + end + end + end +end diff --git a/lib/privy/internal/type/request_parameters.rb b/lib/privy/internal/type/request_parameters.rb new file mode 100644 index 0000000..b3c3b5c --- /dev/null +++ b/lib/privy/internal/type/request_parameters.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + module RequestParameters + # @!attribute request_options + # Options to specify HTTP behaviour for this request. + # + # @return [Privy::RequestOptions, Hash{Symbol=>Object}] + + # @param mod [Module] + def self.included(mod) + raise ArgumentError.new(mod) unless mod <= Privy::Internal::Type::BaseModel + + mod.optional(:request_options, Privy::RequestOptions) + end + + # @api private + module Converter + # @api private + # + # @param params [Object] + # + # @return [Array(Object, Hash{Symbol=>Object})] + def dump_request(params) + state = {can_retry: true} + case (dumped = dump(params, state: state)) + in Hash + options = Privy::Internal::Util.coerce_hash!(dumped[:request_options]).to_h + request_options = state.fetch(:can_retry) ? options : {**options, max_retries: 0} + [dumped.except(:request_options), request_options] + else + [dumped, nil] + end + end + end + end + end + end +end diff --git a/lib/privy/internal/type/union.rb b/lib/privy/internal/type/union.rb new file mode 100644 index 0000000..72abe0a --- /dev/null +++ b/lib/privy/internal/type/union.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # @example + # # `ethereum_rpc_input` is a `Privy::EthereumRpcInput` + # case ethereum_rpc_input + # when Privy::EthereumSignTransactionRpcInput + # puts(ethereum_rpc_input.method_) + # when Privy::EthereumSendTransactionRpcInput + # puts(ethereum_rpc_input.caip2) + # when Privy::EthereumPersonalSignRpcInput + # puts(ethereum_rpc_input.params) + # else + # puts(ethereum_rpc_input) + # end + # + # @example + # case ethereum_rpc_input + # in {method_: :eth_signTransaction, params: params, address: address, chain_type: chain_type} + # puts(params) + # in {method_: :eth_sendTransaction, caip2: caip2, params: params, address: address} + # puts(caip2) + # in {method_: :personal_sign, params: params, address: address, chain_type: chain_type} + # puts(address) + # else + # puts(ethereum_rpc_input) + # end + module Union + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + # @api private + # + # All of the specified variant info for this union. + # + # @return [ArrayObject})>] + private def known_variants = (@known_variants ||= []) + + # @api private + # + # @return [ArrayObject})>] + protected def derefed_variants + known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] } + end + + # All of the specified variants for this union. + # + # @return [Array] + def variants = derefed_variants.map { _2 } + + # @api private + # + # @param property [Symbol] + private def discriminator(property) + case property + in Symbol + @discriminator = property + end + end + + # @api private + # + # @param key [Symbol, Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] + # + # @param spec [Hash{Symbol=>Object}, Proc, Privy::Internal::Type::Converter, Class] . + # + # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const + # + # @option spec [Proc] :enum + # + # @option spec [Proc] :union + # + # @option spec [Boolean] :"nil?" + private def variant(key, spec = nil) + meta = Privy::Internal::Type::Converter.meta_info(nil, spec) + variant_info = + case key + in Symbol + [key, Privy::Internal::Type::Converter.type_info(spec), meta] + in Proc | Privy::Internal::Type::Converter | Class | Hash + [nil, Privy::Internal::Type::Converter.type_info(key), meta] + end + + known_variants << variant_info + end + + # @api private + # + # @param value [Object] + # + # @return [Privy::Internal::Type::Converter, Class, nil] + private def resolve_variant(value) + case [@discriminator, value] + in [_, Privy::Internal::Type::BaseModel] + value.class + in [Symbol, Hash] + key = value.fetch(@discriminator) do + value.fetch(@discriminator.to_s, Privy::Internal::OMIT) + end + + return nil if key == Privy::Internal::OMIT + + key = key.to_sym if key.is_a?(String) + _, found = known_variants.find { |k,| k == key } + found&.call + else + nil + end + end + + # rubocop:disable Style/HashEachMethods + # rubocop:disable Style/CaseEquality + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ===(other) + known_variants.any? do |_, variant_fn| + variant_fn.call === other + end + end + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def ==(other) + Privy::Internal::Type::Union === other && other.derefed_variants == derefed_variants + end + + # @api public + # + # @return [Integer] + def hash = variants.hash + + # @api private + # + # Tries to efficiently coerce the given value to one of the known variants. + # + # If the value cannot match any of the known variants, the coercion is considered + # non-viable and returns the original value. + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce(value, state:) + if (target = resolve_variant(value)) + return Privy::Internal::Type::Converter.coerce(target, value, state: state) + end + + strictness = state.fetch(:strictness) + exactness = state.fetch(:exactness) + + alternatives = [] + known_variants.each do |_, variant_fn| + target = variant_fn.call + exact = state[:exactness] = {yes: 0, no: 0, maybe: 0} + state[:branched] += 1 + + coerced = Privy::Internal::Type::Converter.coerce(target, value, state: state) + yes, no, maybe = exact.values + if (no + maybe).zero? || (!strictness && yes.positive?) + exact.each { exactness[_1] += _2 } + state[:exactness] = exactness + return coerced + elsif maybe.positive? + alternatives << [[-yes, -maybe, no], exact, coerced] + end + end + + case alternatives.sort_by!(&:first) + in [] + exactness[:no] += 1 + state[:error] = ArgumentError.new("no matching variant for #{value.inspect}") + value + in [[_, exact, coerced], *] + exact.each { exactness[_1] += _2 } + coerced + end + .tap { state[:exactness] = exactness } + ensure + state[:strictness] = strictness + end + + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Object] + def dump(value, state:) + if (target = resolve_variant(value)) + return Privy::Internal::Type::Converter.dump(target, value, state: state) + end + + known_variants.each do + target = _2.call + return Privy::Internal::Type::Converter.dump(target, value, state: state) if target === value + end + + super + end + + # @api private + # + # @return [Object] + def to_sorbet_type + types = variants.map { Privy::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq + case types + in [] + T.noreturn + in [type] + type + else + T.any(*types) + end + end + + # rubocop:enable Style/CaseEquality + # rubocop:enable Style/HashEachMethods + + # @api private + # + # @param depth [Integer] + # + # @return [String] + def inspect(depth: 0) + if depth.positive? + return is_a?(Module) ? super() : self.class.name + end + + members = variants.map { Privy::Internal::Type::Converter.inspect(_1, depth: depth.succ) } + prefix = is_a?(Module) ? name : self.class.name + + "#{prefix}[#{members.join(' | ')}]" + end + end + end + end +end diff --git a/lib/privy/internal/type/unknown.rb b/lib/privy/internal/type/unknown.rb new file mode 100644 index 0000000..48a0466 --- /dev/null +++ b/lib/privy/internal/type/unknown.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module Privy + module Internal + module Type + # @api private + # + # @abstract + # + # When we don't know what to expect for the value. + class Unknown + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + # rubocop:disable Lint/UnusedMethodArgument + + private_class_method :new + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.===(other) = true + + # @api public + # + # @param other [Object] + # + # @return [Boolean] + def self.==(other) = other.is_a?(Class) && other <= Privy::Internal::Type::Unknown + + class << self + # @api private + # + # No coercion needed for Unknown type. + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :translate_names + # + # @option state [Boolean] :strictness + # + # @option state [Hash{Symbol=>Object}] :exactness + # + # @option state [Class] :error + # + # @option state [Integer] :branched + # + # @return [Object] + def coerce(value, state:) + state.fetch(:exactness)[:yes] += 1 + value + end + + # @!method dump(value, state:) + # @api private + # + # @param value [Object] + # + # @param state [Hash{Symbol=>Object}] . + # + # @option state [Boolean] :can_retry + # + # @return [Object] + + # @api private + # + # @return [Object] + def to_sorbet_type + T.anything + end + end + + # rubocop:enable Lint/UnusedMethodArgument + end + end + end +end diff --git a/lib/privy/internal/util.rb b/lib/privy/internal/util.rb new file mode 100644 index 0000000..185e330 --- /dev/null +++ b/lib/privy/internal/util.rb @@ -0,0 +1,966 @@ +# frozen_string_literal: true + +module Privy + module Internal + # @api private + module Util + # @api private + # + # @return [Float] + def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC) + + # @api private + # + # @param ns [Module, Class] + # + # @return [Enumerable] + def self.walk_namespaces(ns) + ns.constants(false).lazy.flat_map do + case (c = ns.const_get(_1, false)) + in Module | Class + walk_namespaces(c) + else + [] + end + end + .chain([ns]) + end + + class << self + # @api private + # + # @return [String] + def arch + case (arch = RbConfig::CONFIG["arch"])&.downcase + in nil + "unknown" + in /aarch64|arm64/ + "arm64" + in /x86_64/ + "x64" + in /arm/ + "arm" + else + "other:#{arch}" + end + end + + # @api private + # + # @return [String] + def os + case (host = RbConfig::CONFIG["host_os"])&.downcase + in nil + "Unknown" + in /linux/ + "Linux" + in /darwin/ + "MacOS" + in /freebsd/ + "FreeBSD" + in /openbsd/ + "OpenBSD" + in /mswin|mingw|cygwin|ucrt/ + "Windows" + else + "Other:#{host}" + end + end + end + + class << self + # @api private + # + # @param input [Object] + # + # @return [Boolean] + def primitive?(input) + case input + in true | false | Numeric | Symbol | String + true + else + false + end + end + + # @api private + # + # @param input [String, Boolean] + # + # @return [Boolean, Object] + def coerce_boolean(input) + case input.is_a?(String) ? input.downcase : input + in "true" + true + in "false" + false + else + input + end + end + + # @api private + # + # @param input [String, Boolean] + # + # @raise [ArgumentError] + # @return [Boolean, nil] + def coerce_boolean!(input) + case coerce_boolean(input) + in true | false | nil => coerced + coerced + else + raise ArgumentError.new("Unable to coerce #{input.inspect} into boolean value") + end + end + + # @api private + # + # @param input [String, Integer] + # + # @return [Integer, Object] + def coerce_integer(input) + Integer(input, exception: false) || input + end + + # @api private + # + # @param input [String, Integer, Float] + # + # @return [Float, Object] + def coerce_float(input) + Float(input, exception: false) || input + end + + # @api private + # + # @param input [Object] + # + # @return [Hash{Object=>Object}, Object] + def coerce_hash(input) + case input + in NilClass | Array | Set | Enumerator | StringIO | IO + input + else + input.respond_to?(:to_h) ? input.to_h : input + end + end + + # @api private + # + # @param input [Object] + # + # @raise [ArgumentError] + # @return [Hash{Object=>Object}, nil] + def coerce_hash!(input) + case coerce_hash(input) + in Hash | nil => coerced + coerced + else + message = "Expected a #{Hash} or #{Privy::Internal::Type::BaseModel}, got #{input.inspect}" + raise ArgumentError.new(message) + end + end + end + + class << self + # @api private + # + # @param lhs [Object] + # @param rhs [Object] + # @param concat [Boolean] + # + # @return [Object] + private def deep_merge_lr(lhs, rhs, concat: false) + case [lhs, rhs, concat] + in [Hash, Hash, _] + lhs.merge(rhs) { deep_merge_lr(_2, _3, concat: concat) } + in [Array, Array, true] + lhs.concat(rhs) + else + rhs + end + end + + # @api private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + # + # @param values [Array] + # + # @param sentinel [Object, nil] the value to return if no values are provided. + # + # @param concat [Boolean] whether to merge sequences by concatenation. + # + # @return [Object] + def deep_merge(*values, sentinel: nil, concat: false) + case values + in [value, *values] + values.reduce(value) do |acc, val| + deep_merge_lr(acc, val, concat: concat) + end + else + sentinel + end + end + + # @api private + # + # @param data [Hash{Symbol=>Object}, Array, Object] + # @param pick [Symbol, Integer, Array, Proc, nil] + # @param blk [Proc, nil] + # + # @return [Object, nil] + def dig(data, pick, &blk) + case [data, pick] + in [_, nil] + data + in [Hash, Symbol] | [Array, Integer] + data.fetch(pick) { blk&.call } + in [Hash | Array, Array] + pick.reduce(data) do |acc, key| + case acc + in Hash if acc.key?(key) + acc.fetch(key) + in Array if key.is_a?(Integer) && key < acc.length + acc[key] + else + return blk&.call + end + end + in [_, Proc] + pick.call(data) + else + blk&.call + end + end + end + + # @type [Regexp] + # + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/ + + class << self + # @api private + # + # @param uri [URI::Generic] + # + # @return [String] + def uri_origin(uri) + "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}" + end + + # @api private + # + # @param path [String, Integer] + # + # @return [String] + def encode_path(path) + path.to_s.gsub(Privy::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) } + end + + # @api private + # + # @param path [String, Array] + # + # @return [String] + def interpolate_path(path) + case path + in String + path + in [] + "" + in [String => p, *interpolations] + encoded = interpolations.map { encode_path(_1) } + format(p, *encoded) + end + end + end + + class << self + # @api private + # + # @param query [String, nil] + # + # @return [Hash{String=>Array}] + def decode_query(query) + CGI.parse(query.to_s) + end + + # @api private + # + # @param query [Hash{String=>Array, String, nil}, nil] + # + # @return [String, nil] + def encode_query(query) + query.to_h.empty? ? nil : URI.encode_www_form(query) + end + end + + class << self + # @api private + # + # @param url [URI::Generic, String] + # + # @return [Hash{Symbol=>String, Integer, nil}] + def parse_uri(url) + parsed = URI::Generic.component.zip(URI.split(url)).to_h + {**parsed, query: decode_query(parsed.fetch(:query))} + end + + # @api private + # + # @param parsed [Hash{Symbol=>String, Integer, nil}] . + # + # @option parsed [String, nil] :scheme + # + # @option parsed [String, nil] :host + # + # @option parsed [Integer, nil] :port + # + # @option parsed [String, nil] :path + # + # @option parsed [Hash{String=>Array}] :query + # + # @return [URI::Generic] + def unparse_uri(parsed) + URI::Generic.build(**parsed, query: encode_query(parsed.fetch(:query))) + end + + # @api private + # + # @param lhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option lhs [String, nil] :scheme + # + # @option lhs [String, nil] :host + # + # @option lhs [Integer, nil] :port + # + # @option lhs [String, nil] :path + # + # @option lhs [Hash{String=>Array}] :query + # + # @param rhs [Hash{Symbol=>String, Integer, nil}] . + # + # @option rhs [String, nil] :scheme + # + # @option rhs [String, nil] :host + # + # @option rhs [Integer, nil] :port + # + # @option rhs [String, nil] :path + # + # @option rhs [Hash{String=>Array}] :query + # + # @return [URI::Generic] + def join_parsed_uri(lhs, rhs) + base_path, base_query = lhs.fetch_values(:path, :query) + slashed = base_path.end_with?("/") ? base_path : "#{base_path}/" + + merged = {**parse_uri(rhs.fetch(:path)), **rhs.except(:path, :query)} + parsed_path, parsed_query = merged.fetch_values(:path, :query) + override = URI::Generic.build(**merged.slice(:scheme, :host, :port), path: parsed_path) + + joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override) + query = deep_merge( + joined.path == base_path ? base_query : {}, + parsed_query, + rhs[:query].to_h, + concat: true + ) + + joined.query = encode_query(query) + joined + end + end + + class << self + # @api private + # + # @param headers [Hash{String=>String, Integer, Array, nil}] + # + # @return [Hash{String=>String}] + def normalized_headers(*headers) + {}.merge(*headers.compact).to_h do |key, val| + value = + case val + in Array + val.filter_map { _1&.to_s&.strip }.join(", ") + else + val&.to_s&.strip + end + [key.downcase, value] + end + end + end + + # @api private + # + # An adapter that satisfies the IO interface required by `::IO.copy_stream` + class ReadIOAdapter + # @api private + # + # @return [Boolean, nil] + def close? = @closing + + # @api private + def close + case @stream + in Enumerator + Privy::Internal::Util.close_fused!(@stream) + in IO if close? + @stream.close + else + end + end + + # @api private + # + # @param max_len [Integer, nil] + # + # @return [String] + private def read_enum(max_len) + case max_len + in nil + @stream.to_a.join + in Integer + @buf << @stream.next while @buf.length < max_len + @buf.slice!(..max_len) + end + rescue StopIteration + @stream = nil + @buf.slice!(0..) + end + + # @api private + # + # @param max_len [Integer, nil] + # @param out_string [String, nil] + # + # @return [String, nil] + def read(max_len = nil, out_string = nil) + case @stream + in nil + nil + in IO | StringIO + @stream.read(max_len, out_string) + in Enumerator + read = read_enum(max_len) + case out_string + in String + out_string.replace(read) + in nil + read + end + end + .tap(&@blk) + end + + # @api private + # + # @param src [String, Pathname, StringIO, Enumerable] + # @param blk [Proc] + # + # @yieldparam [String] + def initialize(src, &blk) + @stream = + case src + in String + StringIO.new(src) + in Pathname + @closing = true + src.open(binmode: true) + else + src + end + @buf = String.new + @blk = blk + end + end + + class << self + # @param blk [Proc] + # + # @yieldparam [Enumerator::Yielder] + # @return [Enumerable] + def writable_enum(&blk) + Enumerator.new do |y| + y.define_singleton_method(:write) do + self << _1.dup + _1.bytesize + end + + blk.call(y) + end + end + end + + # @type [Regexp] + JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)} + # @type [Regexp] + JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)} + + class << self + # @api private + # + # @param query [Hash{Symbol=>Object}] + # + # @return [Hash{Symbol=>Object}] + def encode_query_params(query) + out = {} + query.each { write_query_param_element!(out, _1, _2) } + out + end + + # @api private + # + # @param collection [Hash{Symbol=>Object}] + # @param key [String] + # @param element [Object] + # + # @return [nil] + private def write_query_param_element!(collection, key, element) + case element + in Hash + element.each do |name, value| + write_query_param_element!(collection, "#{key}[#{name}]", value) + end + in Array + collection[key] = element.map(&:to_s).join(",") + else + collection[key] = element.to_s + end + end + + # @api private + # + # @param y [Enumerator::Yielder] + # @param val [Object] + # @param closing [Array] + # @param content_type [String, nil] + private def write_multipart_content(y, val:, closing:, content_type: nil) + content_line = "Content-Type: %s\r\n\r\n" + + case val + in Privy::FilePart + return write_multipart_content( + y, + val: val.content, + closing: closing, + content_type: val.content_type + ) + in Pathname + y << format(content_line, content_type || "application/octet-stream") + io = val.open(binmode: true) + closing << io.method(:close) + IO.copy_stream(io, y) + in IO + y << format(content_line, content_type || "application/octet-stream") + IO.copy_stream(val, y) + in StringIO + y << format(content_line, content_type || "application/octet-stream") + y << val.string + in -> { primitive?(_1) } + y << format(content_line, content_type || "text/plain") + y << val.to_s + else + y << format(content_line, content_type || "application/json") + y << JSON.generate(val) + end + y << "\r\n" + end + + # @api private + # + # @param y [Enumerator::Yielder] + # @param boundary [String] + # @param key [Symbol, String] + # @param val [Object] + # @param closing [Array] + private def write_multipart_chunk(y, boundary:, key:, val:, closing:) + y << "--#{boundary}\r\n" + y << "Content-Disposition: form-data" + + unless key.nil? + y << "; name=\"#{key}\"" + end + + case val + in Privy::FilePart unless val.filename.nil? + filename = encode_path(val.filename) + y << "; filename=\"#{filename}\"" + in Pathname | IO + filename = encode_path(::File.basename(val.to_path)) + y << "; filename=\"#{filename}\"" + else + end + y << "\r\n" + + write_multipart_content(y, val: val, closing: closing) + end + + # @api private + # + # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content + # + # @param body [Object] + # + # @return [Array(String, Enumerable)] + private def encode_multipart_streaming(body) + # rubocop:disable Style/CaseEquality + # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length + boundary = SecureRandom.urlsafe_base64(46) + + closing = [] + strio = writable_enum do |y| + case body + in Hash + body.each do |key, val| + case val + in Array if val.all? { primitive?(_1) || Privy::Internal::Type::FileInput === _1 } + val.each do |v| + write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing) + end + else + write_multipart_chunk(y, boundary: boundary, key: key, val: val, closing: closing) + end + end + else + write_multipart_chunk(y, boundary: boundary, key: nil, val: body, closing: closing) + end + y << "--#{boundary}--\r\n" + end + + fused_io = fused_enum(strio) { closing.each(&:call) } + [boundary, fused_io] + # rubocop:enable Style/CaseEquality + end + + # @api private + # + # @param headers [Hash{String=>String}] + # @param body [Object] + # + # @return [Object] + def encode_content(headers, body) + # rubocop:disable Style/CaseEquality + # rubocop:disable Layout/LineLength + content_type = headers["content-type"] + case [content_type, body] + in [Privy::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }] + [headers, JSON.generate(body)] + in [Privy::Internal::Util::JSONL_CONTENT, Enumerable] unless Privy::Internal::Type::FileInput === body + [headers, body.lazy.map { JSON.generate(_1) }] + in [%r{^multipart/form-data}, Hash | Privy::Internal::Type::FileInput] + boundary, strio = encode_multipart_streaming(body) + headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} + [headers, strio] + in [_, Symbol | Numeric] + [headers, body.to_s] + in [_, StringIO] + [headers, body.string] + in [_, Privy::FilePart] + [headers, body.content] + else + [headers, body] + end + # rubocop:enable Layout/LineLength + # rubocop:enable Style/CaseEquality + end + + # @api private + # + # https://www.iana.org/assignments/character-sets/character-sets.xhtml + # + # @param content_type [String] + # @param text [String] + def force_charset!(content_type, text:) + charset = /charset=([^;\s]+)/.match(content_type)&.captures&.first + + return unless charset + + begin + encoding = Encoding.find(charset) + text.force_encoding(encoding) + rescue ArgumentError + nil + end + end + + # @api private + # + # Assumes each chunk in stream has `Encoding::BINARY`. + # + # @param headers [Hash{String=>String}] + # @param stream [Enumerable] + # @param suppress_error [Boolean] + # + # @raise [JSON::ParserError] + # @return [Object] + def decode_content(headers, stream:, suppress_error: false) + case (content_type = headers["content-type"]) + in Privy::Internal::Util::JSON_CONTENT + return nil if (json = stream.to_a.join).empty? + + begin + JSON.parse(json, symbolize_names: true) + rescue JSON::ParserError => e + raise e unless suppress_error + json + end + in Privy::Internal::Util::JSONL_CONTENT + lines = decode_lines(stream) + chain_fused(lines) do |y| + lines.each do + next if _1.empty? + + y << JSON.parse(_1, symbolize_names: true) + end + end + in %r{^text/event-stream} + lines = decode_lines(stream) + decode_sse(lines) + else + text = stream.to_a.join + force_charset!(content_type, text: text) + StringIO.new(text) + end + end + end + + class << self + # @api private + # + # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html + # + # @param enum [Enumerable] + # @param external [Boolean] + # @param close [Proc] + # + # @return [Enumerable] + def fused_enum(enum, external: false, &close) + fused = false + iter = Enumerator.new do |y| + next if fused + + fused = true + if external + loop { y << enum.next } + else + enum.each(&y) + end + ensure + close&.call + close = nil + end + + iter.define_singleton_method(:rewind) do + fused = true + self + end + iter + end + + # @api private + # + # @param enum [Enumerable, nil] + def close_fused!(enum) + return unless enum.is_a?(Enumerator) + + # rubocop:disable Lint/UnreachableLoop + enum.rewind.each { break } + # rubocop:enable Lint/UnreachableLoop + end + + # @api private + # + # @param enum [Enumerable, nil] + # @param blk [Proc] + # + # @yieldparam [Enumerator::Yielder] + # @return [Enumerable] + def chain_fused(enum, &blk) + iter = Enumerator.new { blk.call(_1) } + fused_enum(iter) { close_fused!(enum) } + end + end + + class << self + # @api private + # + # Assumes Strings have been forced into having `Encoding::BINARY`. + # + # This decoder is responsible for reassembling lines split across multiple + # fragments. + # + # @param enum [Enumerable] + # + # @return [Enumerable] + def decode_lines(enum) + re = /(\r\n|\r|\n)/ + buffer = String.new + cr_seen = nil + + chain_fused(enum) do |y| + enum.each do |row| + offset = buffer.bytesize + buffer << row + while (match = re.match(buffer, cr_seen&.to_i || offset)) + case [match.captures.first, cr_seen] + in ["\r", nil] + cr_seen = match.end(1) + next + in ["\r" | "\r\n", Integer] + y << buffer.slice!(..(cr_seen.pred)) + else + y << buffer.slice!(..(match.end(1).pred)) + end + offset = 0 + cr_seen = nil + end + end + + y << buffer.slice!(..(cr_seen.pred)) unless cr_seen.nil? + y << buffer unless buffer.empty? + end + end + + # @api private + # + # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream + # + # Assumes that `lines` has been decoded with `#decode_lines`. + # + # @param lines [Enumerable] + # + # @return [EnumerableObject}>] + def decode_sse(lines) + # rubocop:disable Metrics/BlockLength + chain_fused(lines) do |y| + blank = {event: nil, data: nil, id: nil, retry: nil} + current = {} + + lines.each do |line| + case line.sub(/\R$/, "") + in "" + next if current.empty? + y << {**blank, **current} + current = {} + in /^:/ + next + in /^([^:]+):\s?(.*)$/ + field, value = Regexp.last_match.captures + case field + in "event" + current.merge!(event: value) + in "data" + (current[:data] ||= String.new) << (value << "\n") + in "id" unless value.include?("\0") + current.merge!(id: value) + in "retry" if /^\d+$/ =~ value + current.merge!(retry: Integer(value)) + else + end + else + end + end + # rubocop:enable Metrics/BlockLength + + y << {**blank, **current} unless current.empty? + end + end + end + + # @api private + module SorbetRuntimeSupport + class MissingSorbetRuntimeError < ::RuntimeError + end + + # @api private + # + # @return [Hash{Symbol=>Object}] + private def sorbet_runtime_constants = @sorbet_runtime_constants ||= {} + + # @api private + # + # @param name [Symbol] + def const_missing(name) + super unless sorbet_runtime_constants.key?(name) + + unless Object.const_defined?(:T) + message = "Trying to access a Sorbet constant #{name.inspect} without `sorbet-runtime`." + raise MissingSorbetRuntimeError.new(message) + end + + sorbet_runtime_constants.fetch(name).call + end + + # @api private + # + # @param name [Symbol] + # + # @return [Boolean] + def sorbet_constant_defined?(name) = sorbet_runtime_constants.key?(name) + + # @api private + # + # @param name [Symbol] + # @param blk [Proc] + def define_sorbet_constant!(name, &blk) = sorbet_runtime_constants.store(name, blk) + + # @api private + # + # @return [Object] + def to_sorbet_type = raise NotImplementedError + + class << self + # @api private + # + # @param type [Privy::Internal::Util::SorbetRuntimeSupport, Object] + # + # @return [Object] + def to_sorbet_type(type) + case type + in Privy::Internal::Util::SorbetRuntimeSupport + type.to_sorbet_type + in Class | Module + type + in true | false + T::Boolean + else + type.class + end + end + end + end + + extend Privy::Internal::Util::SorbetRuntimeSupport + + define_sorbet_constant!(:ParsedUri) do + T.type_alias do + { + scheme: T.nilable(String), + host: T.nilable(String), + port: T.nilable(Integer), + path: T.nilable(String), + query: T::Hash[String, T::Array[String]] + } + end + end + + define_sorbet_constant!(:ServerSentEvent) do + T.type_alias do + { + event: T.nilable(String), + data: T.nilable(String), + id: T.nilable(String), + retry: T.nilable(Integer) + } + end + end + end + end +end diff --git a/lib/privy/models.rb b/lib/privy/models.rb new file mode 100644 index 0000000..64175d7 --- /dev/null +++ b/lib/privy/models.rb @@ -0,0 +1,1730 @@ +# frozen_string_literal: true + +module Privy + [Privy::Internal::Type::BaseModel, *Privy::Internal::Type::BaseModel.subclasses].each do |cls| + cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, Privy::Internal::AnyHash) } } + end + + Privy::Internal::Util.walk_namespaces(Privy::Models).each do |mod| + case mod + in Privy::Internal::Type::Enum | Privy::Internal::Type::Union + mod.constants.each do |name| + case mod.const_get(name) + in true | false + mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } } + mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } } + in Integer + mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } } + mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } } + in Float + mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } } + mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } } + in Symbol + mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } } + mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } } + else + end + end + else + end + end + + Privy::Internal::Util.walk_namespaces(Privy::Models) + .lazy + .grep(Privy::Internal::Type::Union) + .each do |mod| + const = :Variants + next if mod.sorbet_constant_defined?(const) + + mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } } + end + + AbiParameter = Privy::Models::AbiParameter + + # @type [Privy::Internal::Type::Converter] + AbiSchema = Privy::Models::AbiSchema + + AbiSchemaItem = Privy::Models::AbiSchemaItem + + AccountBalanceParams = Privy::Models::AccountBalanceParams + + AccountBalanceResponse = Privy::Models::AccountBalanceResponse + + AccountDisplayName = Privy::Models::AccountDisplayName + + AccountResponse = Privy::Models::AccountResponse + + AccountsDashboardListResponse = Privy::Models::AccountsDashboardListResponse + + AccountsListResponse = Privy::Models::AccountsListResponse + + AccountWallet = Privy::Models::AccountWallet + + AccountWalletConfigurationItem = Privy::Models::AccountWalletConfigurationItem + + # @type [Privy::Internal::Type::Converter] + AccountWalletIDs = Privy::Models::AccountWalletIDs + + # @type [Privy::Internal::Type::Converter] + AccountWalletsConfiguration = Privy::Models::AccountWalletsConfiguration + + ActionRequestBodyCondition = Privy::Models::ActionRequestBodyCondition + + # @type [Privy::Internal::Type::Converter] + AdditionalSignerInput = Privy::Models::AdditionalSignerInput + + AdditionalSignerItemInput = Privy::Models::AdditionalSignerItemInput + + Address = Privy::Models::Address + + Aggregation = Privy::Models::Aggregation + + AggregationCondition = Privy::Models::AggregationCondition + + AggregationGroupBy = Privy::Models::AggregationGroupBy + + AggregationInput = Privy::Models::AggregationInput + + AggregationMethod = Privy::Models::AggregationMethod + + AggregationMetric = Privy::Models::AggregationMetric + + AggregationWindow = Privy::Models::AggregationWindow + + AlchemyPaymasterContext = Privy::Models::AlchemyPaymasterContext + + AllowlistDeletionResponse = Privy::Models::AllowlistDeletionResponse + + AllowlistEntry = Privy::Models::AllowlistEntry + + AmountType = Privy::Models::AmountType + + AnalyticsEventInput = Privy::Models::AnalyticsEventInput + + AppGetGasSpendParams = Privy::Models::AppGetGasSpendParams + + AppGetParams = Privy::Models::AppGetParams + + AppGetTestCredentialsParams = Privy::Models::AppGetTestCredentialsParams + + AppResponse = Privy::Models::AppResponse + + Apps = Privy::Models::Apps + + AssetAccountWithBalance = Privy::Models::AssetAccountWithBalance + + AuthenticatedUser = Privy::Models::AuthenticatedUser + + AuthenticateJwtInput = Privy::Models::AuthenticateJwtInput + + AuthenticateMode = Privy::Models::AuthenticateMode + + AuthenticateModeOption = Privy::Models::AuthenticateModeOption + + AuthenticateSiweInput = Privy::Models::AuthenticateSiweInput + + AuthenticateSiwsInput = Privy::Models::AuthenticateSiwsInput + + AuthorizationKeyDashboardResponse = Privy::Models::AuthorizationKeyDashboardResponse + + AuthorizationKeyResponse = Privy::Models::AuthorizationKeyResponse + + AuthorizationKeyRole = Privy::Models::AuthorizationKeyRole + + BalanceAsset = Privy::Models::BalanceAsset + + BalanceAssetByChain = Privy::Models::BalanceAssetByChain + + BalanceResponse = Privy::Models::BalanceResponse + + BaseActionResult = Privy::Models::BaseActionResult + + BaseIntentResponse = Privy::Models::BaseIntentResponse + + BridgeBrlFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions + + BridgeCryptoDepositMetadata = Privy::Models::BridgeCryptoDepositMetadata + + BridgeCryptoTransferMetadata = Privy::Models::BridgeCryptoTransferMetadata + + BridgeDestinationAsset = Privy::Models::BridgeDestinationAsset + + BridgeEurFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions + + BridgeFiatCustomerResponse = Privy::Models::BridgeFiatCustomerResponse + + BridgeFiatDepositMetadata = Privy::Models::BridgeFiatDepositMetadata + + BridgeFiatRejectionReason = Privy::Models::BridgeFiatRejectionReason + + BridgeFiatTransferMetadata = Privy::Models::BridgeFiatTransferMetadata + + BridgeFiatVirtualAccountDepositInstructions = Privy::Models::BridgeFiatVirtualAccountDepositInstructions + + BridgeFiatVirtualAccountDestination = Privy::Models::BridgeFiatVirtualAccountDestination + + BridgeFiatVirtualAccountRequest = Privy::Models::BridgeFiatVirtualAccountRequest + + BridgeFiatVirtualAccountResponse = Privy::Models::BridgeFiatVirtualAccountResponse + + BridgeFiatVirtualAccountSource = Privy::Models::BridgeFiatVirtualAccountSource + + BridgeGbpFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions + + BridgeMetadata = Privy::Models::BridgeMetadata + + BridgeMxnFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions + + BridgeOnrampProvider = Privy::Models::BridgeOnrampProvider + + BridgeRefundMetadata = Privy::Models::BridgeRefundMetadata + + BridgeSandboxFiatCustomerResponse = Privy::Models::BridgeSandboxFiatCustomerResponse + + BridgeSandboxFiatVirtualAccountRequest = Privy::Models::BridgeSandboxFiatVirtualAccountRequest + + BridgeSandboxFiatVirtualAccountResponse = Privy::Models::BridgeSandboxFiatVirtualAccountResponse + + BridgeSourceAsset = Privy::Models::BridgeSourceAsset + + BridgeStaticMemoDepositMetadata = Privy::Models::BridgeStaticMemoDepositMetadata + + BridgeTransferRefundMetadata = Privy::Models::BridgeTransferRefundMetadata + + BridgeUsdFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions + + Caip2 = Privy::Models::Caip2 + + Caip2ChainID = Privy::Models::Caip2ChainID + + CoinbaseBlockchain = Privy::Models::CoinbaseBlockchain + + CoinbaseEthereumAsset = Privy::Models::CoinbaseEthereumAsset + + CoinbaseOnRampEthereumAddress = Privy::Models::CoinbaseOnRampEthereumAddress + + CoinbaseOnRampInitEthereumInput = Privy::Models::CoinbaseOnRampInitEthereumInput + + CoinbaseOnRampInitInput = Privy::Models::CoinbaseOnRampInitInput + + CoinbaseOnRampInitResponse = Privy::Models::CoinbaseOnRampInitResponse + + CoinbaseOnRampInitSolanaInput = Privy::Models::CoinbaseOnRampInitSolanaInput + + CoinbaseOnRampSolanaAddress = Privy::Models::CoinbaseOnRampSolanaAddress + + CoinbaseOnRampStatus = Privy::Models::CoinbaseOnRampStatus + + CoinbaseOnRampStatusResponse = Privy::Models::CoinbaseOnRampStatusResponse + + CoinbaseSolanaAsset = Privy::Models::CoinbaseSolanaAsset + + ConditionOperator = Privy::Models::ConditionOperator + + ConditionSet = Privy::Models::ConditionSet + + ConditionSetAuthorizationHeaders = Privy::Models::ConditionSetAuthorizationHeaders + + ConditionSetItem = Privy::Models::ConditionSetItem + + ConditionSetItemRequestParams = Privy::Models::ConditionSetItemRequestParams + + # @type [Privy::Internal::Type::Converter] + ConditionSetItems = Privy::Models::ConditionSetItems + + # @type [Privy::Internal::Type::Converter] + ConditionSetItemsRequestBody = Privy::Models::ConditionSetItemsRequestBody + + ConditionSetItemsResponse = Privy::Models::ConditionSetItemsResponse + + ConditionSetItemValueInput = Privy::Models::ConditionSetItemValueInput + + ConditionSetRequestBody = Privy::Models::ConditionSetRequestBody + + ConditionSetRequestParams = Privy::Models::ConditionSetRequestParams + + ConditionValue = Privy::Models::ConditionValue + + CreateAccountFromWalletIDsInput = Privy::Models::CreateAccountFromWalletIDsInput + + CreateAccountFromWalletsConfigurationInput = Privy::Models::CreateAccountFromWalletsConfigurationInput + + CreateAccountInput = Privy::Models::CreateAccountInput + + CreateOrganizationSecretResponse = Privy::Models::CreateOrganizationSecretResponse + + CreateOrUpdateFiatCustomerRequestInput = Privy::Models::CreateOrUpdateFiatCustomerRequestInput + + CrossAppConnection = Privy::Models::CrossAppConnection + + CrossAppConnectionsResponse = Privy::Models::CrossAppConnectionsResponse + + CrossAppEmbeddedWallet = Privy::Models::CrossAppEmbeddedWallet + + CrossAppSmartWallet = Privy::Models::CrossAppSmartWallet + + CryptoCurrencyCode = Privy::Models::CryptoCurrencyCode + + Currency = Privy::Models::Currency + + CurrencyAmount = Privy::Models::CurrencyAmount + + CurrencyAsset = Privy::Models::CurrencyAsset + + CurveSigningChainType = Privy::Models::CurveSigningChainType + + CurveType = Privy::Models::CurveType + + CustodialWallet = Privy::Models::CustodialWallet + + CustodialWalletChainType = Privy::Models::CustodialWalletChainType + + CustodialWalletCreateInput = Privy::Models::CustodialWalletCreateInput + + CustodialWalletProvider = Privy::Models::CustodialWalletProvider + + CustomJwtAuthenticateRequestBody = Privy::Models::CustomJwtAuthenticateRequestBody + + CustomJwtLinkRequestBody = Privy::Models::CustomJwtLinkRequestBody + + # @type [Privy::Internal::Type::Converter] + CustomMetadata = Privy::Models::CustomMetadata + + CustomMetadataItem = Privy::Models::CustomMetadataItem + + CustomOAuthProviderID = Privy::Models::CustomOAuthProviderID + + CustomTokenTransferSource = Privy::Models::CustomTokenTransferSource + + EarnAsset = Privy::Models::EarnAsset + + EarnDepositActionResponse = Privy::Models::EarnDepositActionResponse + + EarnDepositRequestBody = Privy::Models::EarnDepositRequestBody + + EarnIncentiveClaimActionResponse = Privy::Models::EarnIncentiveClaimActionResponse + + EarnIncentiveClaimRequestBody = Privy::Models::EarnIncentiveClaimRequestBody + + EarnIncetiveClaimRewardEntry = Privy::Models::EarnIncetiveClaimRewardEntry + + EarnWithdrawActionResponse = Privy::Models::EarnWithdrawActionResponse + + EarnWithdrawRequestBody = Privy::Models::EarnWithdrawRequestBody + + EmailDomain = Privy::Models::EmailDomain + + EmailDomainInviteInput = Privy::Models::EmailDomainInviteInput + + EmailInviteInput = Privy::Models::EmailInviteInput + + EmbeddedWalletChainConfig = Privy::Models::EmbeddedWalletChainConfig + + EmbeddedWalletConfigSchema = Privy::Models::EmbeddedWalletConfigSchema + + EmbeddedWalletCreateOnLogin = Privy::Models::EmbeddedWalletCreateOnLogin + + EmbeddedWalletCreationInput = Privy::Models::EmbeddedWalletCreationInput + + EmbeddedWalletInputSchema = Privy::Models::EmbeddedWalletInputSchema + + EmbeddedWalletMode = Privy::Models::EmbeddedWalletMode + + EmbeddedWalletRecoveryMethod = Privy::Models::EmbeddedWalletRecoveryMethod + + Ethereum7702AuthorizationCondition = Privy::Models::Ethereum7702AuthorizationCondition + + EthereumCalldataCondition = Privy::Models::EthereumCalldataCondition + + EthereumEarnPositionQuery = Privy::Models::EthereumEarnPositionQuery + + EthereumEarnPositionResponse = Privy::Models::EthereumEarnPositionResponse + + EthereumEarnProvider = Privy::Models::EthereumEarnProvider + + EthereumEarnVaultDetailsResponse = Privy::Models::EthereumEarnVaultDetailsResponse + + EthereumPersonalSignRpcInput = Privy::Models::EthereumPersonalSignRpcInput + + EthereumPersonalSignRpcInputParams = Privy::Models::EthereumPersonalSignRpcInputParams + + EthereumPersonalSignRpcResponse = Privy::Models::EthereumPersonalSignRpcResponse + + EthereumPersonalSignRpcResponseData = Privy::Models::EthereumPersonalSignRpcResponseData + + EthereumRpcInput = Privy::Models::EthereumRpcInput + + EthereumRpcResponse = Privy::Models::EthereumRpcResponse + + EthereumSecp256k1SignRpcInput = Privy::Models::EthereumSecp256k1SignRpcInput + + EthereumSecp256k1SignRpcInputParams = Privy::Models::EthereumSecp256k1SignRpcInputParams + + EthereumSecp256k1SignRpcResponse = Privy::Models::EthereumSecp256k1SignRpcResponse + + EthereumSecp256k1SignRpcResponseData = Privy::Models::EthereumSecp256k1SignRpcResponseData + + EthereumSendCallsCall = Privy::Models::EthereumSendCallsCall + + EthereumSendCallsRpcInput = Privy::Models::EthereumSendCallsRpcInput + + EthereumSendCallsRpcInputParams = Privy::Models::EthereumSendCallsRpcInputParams + + EthereumSendCallsRpcResponse = Privy::Models::EthereumSendCallsRpcResponse + + EthereumSendCallsRpcResponseData = Privy::Models::EthereumSendCallsRpcResponseData + + EthereumSendTransactionRpcInput = Privy::Models::EthereumSendTransactionRpcInput + + EthereumSendTransactionRpcInputParams = Privy::Models::EthereumSendTransactionRpcInputParams + + EthereumSendTransactionRpcResponse = Privy::Models::EthereumSendTransactionRpcResponse + + EthereumSendTransactionRpcResponseData = Privy::Models::EthereumSendTransactionRpcResponseData + + EthereumSign7702Authorization = Privy::Models::EthereumSign7702Authorization + + EthereumSign7702AuthorizationRpcInput = Privy::Models::EthereumSign7702AuthorizationRpcInput + + EthereumSign7702AuthorizationRpcInputParams = Privy::Models::EthereumSign7702AuthorizationRpcInputParams + + EthereumSign7702AuthorizationRpcResponse = Privy::Models::EthereumSign7702AuthorizationRpcResponse + + EthereumSign7702AuthorizationRpcResponseData = + Privy::Models::EthereumSign7702AuthorizationRpcResponseData + + EthereumSignTransactionRpcInput = Privy::Models::EthereumSignTransactionRpcInput + + EthereumSignTransactionRpcInputParams = Privy::Models::EthereumSignTransactionRpcInputParams + + EthereumSignTransactionRpcResponse = Privy::Models::EthereumSignTransactionRpcResponse + + EthereumSignTransactionRpcResponseData = Privy::Models::EthereumSignTransactionRpcResponseData + + EthereumSignTypedDataRpcInput = Privy::Models::EthereumSignTypedDataRpcInput + + EthereumSignTypedDataRpcInputParams = Privy::Models::EthereumSignTypedDataRpcInputParams + + EthereumSignTypedDataRpcResponse = Privy::Models::EthereumSignTypedDataRpcResponse + + EthereumSignTypedDataRpcResponseData = Privy::Models::EthereumSignTypedDataRpcResponseData + + EthereumSignUserOperationRpcInput = Privy::Models::EthereumSignUserOperationRpcInput + + EthereumSignUserOperationRpcInputParams = Privy::Models::EthereumSignUserOperationRpcInputParams + + EthereumSignUserOperationRpcResponse = Privy::Models::EthereumSignUserOperationRpcResponse + + EthereumSignUserOperationRpcResponseData = Privy::Models::EthereumSignUserOperationRpcResponseData + + EthereumTransactionCondition = Privy::Models::EthereumTransactionCondition + + EthereumTypedDataDomainCondition = Privy::Models::EthereumTypedDataDomainCondition + + EthereumTypedDataInput = Privy::Models::EthereumTypedDataInput + + EthereumTypedDataMessageCondition = Privy::Models::EthereumTypedDataMessageCondition + + EthereumVaultDetailsInput = Privy::Models::EthereumVaultDetailsInput + + EthereumVaultDetailsResponse = Privy::Models::EthereumVaultDetailsResponse + + EthereumVaultPosition = Privy::Models::EthereumVaultPosition + + EthereumVaultResponse = Privy::Models::EthereumVaultResponse + + EthereumYieldClaimIDInput = Privy::Models::EthereumYieldClaimIDInput + + EthereumYieldClaimInput = Privy::Models::EthereumYieldClaimInput + + EthereumYieldClaimResponse = Privy::Models::EthereumYieldClaimResponse + + EthereumYieldClaimReward = Privy::Models::EthereumYieldClaimReward + + EthereumYieldDepositInput = Privy::Models::EthereumYieldDepositInput + + EthereumYieldPositionResponse = Privy::Models::EthereumYieldPositionResponse + + EthereumYieldPositionsInput = Privy::Models::EthereumYieldPositionsInput + + EthereumYieldProvider = Privy::Models::EthereumYieldProvider + + EthereumYieldSweepIDInput = Privy::Models::EthereumYieldSweepIDInput + + EthereumYieldSweepResponse = Privy::Models::EthereumYieldSweepResponse + + EthereumYieldSweepStatus = Privy::Models::EthereumYieldSweepStatus + + EthereumYieldSweepType = Privy::Models::EthereumYieldSweepType + + EthereumYieldWithdrawInput = Privy::Models::EthereumYieldWithdrawInput + + EvmCaip2ChainID = Privy::Models::EvmCaip2ChainID + + EvmTransactionWalletActionStep = Privy::Models::EvmTransactionWalletActionStep + + EvmUserOperationWalletActionStep = Privy::Models::EvmUserOperationWalletActionStep + + EvmWalletActionStepStatus = Privy::Models::EvmWalletActionStepStatus + + ExportPrivateKeyRpcInput = Privy::Models::ExportPrivateKeyRpcInput + + ExportPrivateKeyRpcResponse = Privy::Models::ExportPrivateKeyRpcResponse + + ExportSeedPhraseRpcInput = Privy::Models::ExportSeedPhraseRpcInput + + ExportSeedPhraseRpcResponse = Privy::Models::ExportSeedPhraseRpcResponse + + ExportType = Privy::Models::ExportType + + ExtendedChainType = Privy::Models::ExtendedChainType + + ExternalOAuthProviderID = Privy::Models::ExternalOAuthProviderID + + ExternalTransactionWalletActionStep = Privy::Models::ExternalTransactionWalletActionStep + + ExternalTransactionWalletActionStepStatus = Privy::Models::ExternalTransactionWalletActionStepStatus + + FailureReason = Privy::Models::FailureReason + + FarcasterAuthenticateInput = Privy::Models::FarcasterAuthenticateInput + + FarcasterAuthenticateRequestBody = Privy::Models::FarcasterAuthenticateRequestBody + + FarcasterConnectInitResponse = Privy::Models::FarcasterConnectInitResponse + + FarcasterConnectInitResponseBody = Privy::Models::FarcasterConnectInitResponseBody + + FarcasterConnectStatusCompletedResponse = Privy::Models::FarcasterConnectStatusCompletedResponse + + FarcasterConnectStatusCompletedResponseBody = Privy::Models::FarcasterConnectStatusCompletedResponseBody + + FarcasterConnectStatusPendingResponse = Privy::Models::FarcasterConnectStatusPendingResponse + + FarcasterConnectStatusPendingResponseBody = Privy::Models::FarcasterConnectStatusPendingResponseBody + + FarcasterInitInput = Privy::Models::FarcasterInitInput + + FarcasterInitRequestBody = Privy::Models::FarcasterInitRequestBody + + FarcasterLinkInput = Privy::Models::FarcasterLinkInput + + FarcasterLinkRequestBody = Privy::Models::FarcasterLinkRequestBody + + FarcasterSignerApproved = Privy::Models::FarcasterSignerApproved + + FarcasterSignerInitPendingApproval = Privy::Models::FarcasterSignerInitPendingApproval + + FarcasterSignerInitRequestBody = Privy::Models::FarcasterSignerInitRequestBody + + FarcasterSignerInitResponseBody = Privy::Models::FarcasterSignerInitResponseBody + + FarcasterSignerRevoked = Privy::Models::FarcasterSignerRevoked + + FarcasterSignerStatusPendingApproval = Privy::Models::FarcasterSignerStatusPendingApproval + + FarcasterSignerStatusResponseBody = Privy::Models::FarcasterSignerStatusResponseBody + + FarcasterUnlinkInput = Privy::Models::FarcasterUnlinkInput + + FarcasterUnlinkRequestBody = Privy::Models::FarcasterUnlinkRequestBody + + FarcasterV2AuthenticateInput = Privy::Models::FarcasterV2AuthenticateInput + + FarcasterV2AuthenticateRequestBody = Privy::Models::FarcasterV2AuthenticateRequestBody + + FarcasterV2InitInput = Privy::Models::FarcasterV2InitInput + + FarcasterV2InitRequestBody = Privy::Models::FarcasterV2InitRequestBody + + FarcasterV2InitResponse = Privy::Models::FarcasterV2InitResponse + + FarcasterV2InitResponseBody = Privy::Models::FarcasterV2InitResponseBody + + FiatAmount = Privy::Models::FiatAmount + + FiatCurrencyCode = Privy::Models::FiatCurrencyCode + + FiatCustomerResponse = Privy::Models::FiatCustomerResponse + + FiatOnrampDestination = Privy::Models::FiatOnrampDestination + + FiatOnrampEnvironment = Privy::Models::FiatOnrampEnvironment + + FiatOnrampProvider = Privy::Models::FiatOnrampProvider + + FiatOnrampProviderError = Privy::Models::FiatOnrampProviderError + + FiatOnrampQuote = Privy::Models::FiatOnrampQuote + + FiatOnrampSource = Privy::Models::FiatOnrampSource + + FiatOnrampTransactionStatus = Privy::Models::FiatOnrampTransactionStatus + + FiatVirtualAccountRequest = Privy::Models::FiatVirtualAccountRequest + + FiatVirtualAccountResponse = Privy::Models::FiatVirtualAccountResponse + + FirstClassChainType = Privy::Models::FirstClassChainType + + FundingConfigResponseSchema = Privy::Models::FundingConfigResponseSchema + + FundingMethodEnum = Privy::Models::FundingMethodEnum + + FundingOption = Privy::Models::FundingOption + + FundsDepositedWebhookPayload = Privy::Models::FundsDepositedWebhookPayload + + FundsWithdrawnWebhookPayload = Privy::Models::FundsWithdrawnWebhookPayload + + GasSpendCurrency = Privy::Models::GasSpendCurrency + + GasSpendRequestBody = Privy::Models::GasSpendRequestBody + + GasSpendResponseBody = Privy::Models::GasSpendResponseBody + + GasSponsorshipConfiguration = Privy::Models::GasSponsorshipConfiguration + + GasSponsorshipConfigurationInput = Privy::Models::GasSponsorshipConfigurationInput + + GetByWalletAddressRequestBody = Privy::Models::GetByWalletAddressRequestBody + + GetFiatCustomerRequestInput = Privy::Models::GetFiatCustomerRequestInput + + GetFiatOnrampQuotesInput = Privy::Models::GetFiatOnrampQuotesInput + + GetFiatOnrampQuotesResponse = Privy::Models::GetFiatOnrampQuotesResponse + + GetFiatOnrampTransactionStatusInput = Privy::Models::GetFiatOnrampTransactionStatusInput + + GetFiatOnrampTransactionStatusResponse = Privy::Models::GetFiatOnrampTransactionStatusResponse + + GetFiatOnrampURLInput = Privy::Models::GetFiatOnrampURLInput + + GetFiatOnrampURLResponse = Privy::Models::GetFiatOnrampURLResponse + + GuestAuthenticateRequestBody = Privy::Models::GuestAuthenticateRequestBody + + HDInitInput = Privy::Models::HDInitInput + + HDPath = Privy::Models::HDPath + + HDSubmitInput = Privy::Models::HDSubmitInput + + Hex = Privy::Models::Hex + + HpkeAeadAlgorithm = Privy::Models::HpkeAeadAlgorithm + + HpkeEncryption = Privy::Models::HpkeEncryption + + HpkeImportConfig = Privy::Models::HpkeImportConfig + + ICloudClientType = Privy::Models::ICloudClientType + + IntentAuthorization = Privy::Models::IntentAuthorization + + IntentAuthorizationKeyQuorumMember = Privy::Models::IntentAuthorizationKeyQuorumMember + + IntentAuthorizationMember = Privy::Models::IntentAuthorizationMember + + IntentAuthorizedWebhookPayload = Privy::Models::IntentAuthorizedWebhookPayload + + IntentCreatedWebhookPayload = Privy::Models::IntentCreatedWebhookPayload + + IntentCreatePolicyRuleParams = Privy::Models::IntentCreatePolicyRuleParams + + IntentCreationHeaders = Privy::Models::IntentCreationHeaders + + IntentDeletePolicyRuleParams = Privy::Models::IntentDeletePolicyRuleParams + + IntentExecutedWebhookPayload = Privy::Models::IntentExecutedWebhookPayload + + IntentFailedWebhookPayload = Privy::Models::IntentFailedWebhookPayload + + IntentGetParams = Privy::Models::IntentGetParams + + IntentListParams = Privy::Models::IntentListParams + + IntentRejectedWebhookPayload = Privy::Models::IntentRejectedWebhookPayload + + IntentResponse = Privy::Models::IntentResponse + + IntentRpcParams = Privy::Models::IntentRpcParams + + IntentStatus = Privy::Models::IntentStatus + + IntentTransferParams = Privy::Models::IntentTransferParams + + IntentType = Privy::Models::IntentType + + IntentUpdateKeyQuorumParams = Privy::Models::IntentUpdateKeyQuorumParams + + IntentUpdatePolicyParams = Privy::Models::IntentUpdatePolicyParams + + IntentUpdatePolicyRuleParams = Privy::Models::IntentUpdatePolicyRuleParams + + IntentUpdateWalletParams = Privy::Models::IntentUpdateWalletParams + + KeyQuorum = Privy::Models::KeyQuorum + + KeyQuorumAuthorizationHeaders = Privy::Models::KeyQuorumAuthorizationHeaders + + KeyQuorumCreateParams = Privy::Models::KeyQuorumCreateParams + + KeyQuorumCreateRequestBody = Privy::Models::KeyQuorumCreateRequestBody + + KeyQuorumDeleteParams = Privy::Models::KeyQuorumDeleteParams + + KeyQuorumGetParams = Privy::Models::KeyQuorumGetParams + + KeyQuorumID = Privy::Models::KeyQuorumID + + KeyQuorumIntentResponse = Privy::Models::KeyQuorumIntentResponse + + KeyQuorumUpdateParams = Privy::Models::KeyQuorumUpdateParams + + KeyQuorumUpdateRequestBody = Privy::Models::KeyQuorumUpdateRequestBody + + KrakenEmbedCurrentDayPnl = Privy::Models::KrakenEmbedCurrentDayPnl + + KrakenEmbedGetAssetListQueryParamsSchema = Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema + + KrakenEmbedGetPortfolioDetailsQueryParamsSchema = + Privy::Models::KrakenEmbedGetPortfolioDetailsQueryParamsSchema + + KrakenEmbedGetPortfolioSummaryQueryParams = Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams + + KrakenEmbedGetPortfolioSummaryResponse = Privy::Models::KrakenEmbedGetPortfolioSummaryResponse + + KrakenEmbedGetPortfolioTransactionsQueryParamsSchema = + Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema + + KrakenEmbedGetQuoteQueryParams = Privy::Models::KrakenEmbedGetQuoteQueryParams + + KrakenEmbedQuoteCancelledWebhookPayload = Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload + + KrakenEmbedQuoteExecutedWebhookPayload = Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload + + KrakenEmbedQuoteExecutionFailedWebhookPayload = + Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload + + KrakenEmbedUserClosedWebhookPayload = Privy::Models::KrakenEmbedUserClosedWebhookPayload + + KrakenEmbedUserDisabledWebhookPayload = Privy::Models::KrakenEmbedUserDisabledWebhookPayload + + KrakenEmbedUserVerifiedWebhookPayload = Privy::Models::KrakenEmbedUserVerifiedWebhookPayload + + LinkedAccount = Privy::Models::LinkedAccount + + LinkedAccountAppleInput = Privy::Models::LinkedAccountAppleInput + + LinkedAccountAppleOAuth = Privy::Models::LinkedAccountAppleOAuth + + LinkedAccountAuthorizationKey = Privy::Models::LinkedAccountAuthorizationKey + + LinkedAccountBaseWallet = Privy::Models::LinkedAccountBaseWallet + + LinkedAccountBitcoinSegwitEmbeddedWallet = Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet + + LinkedAccountBitcoinTaprootEmbeddedWallet = Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet + + LinkedAccountCrossApp = Privy::Models::LinkedAccountCrossApp + + LinkedAccountCurveSigningEmbeddedWallet = Privy::Models::LinkedAccountCurveSigningEmbeddedWallet + + LinkedAccountCustomJwt = Privy::Models::LinkedAccountCustomJwt + + LinkedAccountCustomJwtInput = Privy::Models::LinkedAccountCustomJwtInput + + LinkedAccountCustomOAuth = Privy::Models::LinkedAccountCustomOAuth + + LinkedAccountDiscordInput = Privy::Models::LinkedAccountDiscordInput + + LinkedAccountDiscordOAuth = Privy::Models::LinkedAccountDiscordOAuth + + LinkedAccountEmail = Privy::Models::LinkedAccountEmail + + LinkedAccountEmailInput = Privy::Models::LinkedAccountEmailInput + + LinkedAccountEmbeddedWallet = Privy::Models::LinkedAccountEmbeddedWallet + + LinkedAccountEmbeddedWalletWithID = Privy::Models::LinkedAccountEmbeddedWalletWithID + + LinkedAccountEthereum = Privy::Models::LinkedAccountEthereum + + LinkedAccountEthereumEmbeddedWallet = Privy::Models::LinkedAccountEthereumEmbeddedWallet + + LinkedAccountFarcaster = Privy::Models::LinkedAccountFarcaster + + LinkedAccountFarcasterInput = Privy::Models::LinkedAccountFarcasterInput + + LinkedAccountGitHubInput = Privy::Models::LinkedAccountGitHubInput + + LinkedAccountGitHubOAuth = Privy::Models::LinkedAccountGitHubOAuth + + LinkedAccountGoogleInput = Privy::Models::LinkedAccountGoogleInput + + LinkedAccountGoogleOAuth = Privy::Models::LinkedAccountGoogleOAuth + + LinkedAccountInput = Privy::Models::LinkedAccountInput + + LinkedAccountInstagramInput = Privy::Models::LinkedAccountInstagramInput + + LinkedAccountInstagramOAuth = Privy::Models::LinkedAccountInstagramOAuth + + LinkedAccountLineInput = Privy::Models::LinkedAccountLineInput + + LinkedAccountLineOAuth = Privy::Models::LinkedAccountLineOAuth + + LinkedAccountLinkedInInput = Privy::Models::LinkedAccountLinkedInInput + + LinkedAccountLinkedInOAuth = Privy::Models::LinkedAccountLinkedInOAuth + + LinkedAccountPasskey = Privy::Models::LinkedAccountPasskey + + LinkedAccountPasskeyInput = Privy::Models::LinkedAccountPasskeyInput + + LinkedAccountPhone = Privy::Models::LinkedAccountPhone + + LinkedAccountPhoneInput = Privy::Models::LinkedAccountPhoneInput + + LinkedAccountSmartWallet = Privy::Models::LinkedAccountSmartWallet + + LinkedAccountSolana = Privy::Models::LinkedAccountSolana + + LinkedAccountSolanaEmbeddedWallet = Privy::Models::LinkedAccountSolanaEmbeddedWallet + + LinkedAccountSpotifyInput = Privy::Models::LinkedAccountSpotifyInput + + LinkedAccountSpotifyOAuth = Privy::Models::LinkedAccountSpotifyOAuth + + LinkedAccountTelegram = Privy::Models::LinkedAccountTelegram + + LinkedAccountTelegramInput = Privy::Models::LinkedAccountTelegramInput + + LinkedAccountTiktokInput = Privy::Models::LinkedAccountTiktokInput + + LinkedAccountTiktokOAuth = Privy::Models::LinkedAccountTiktokOAuth + + LinkedAccountTwitchInput = Privy::Models::LinkedAccountTwitchInput + + LinkedAccountTwitchOAuth = Privy::Models::LinkedAccountTwitchOAuth + + LinkedAccountTwitterInput = Privy::Models::LinkedAccountTwitterInput + + LinkedAccountTwitterOAuth = Privy::Models::LinkedAccountTwitterOAuth + + LinkedAccountType = Privy::Models::LinkedAccountType + + LinkedAccountWalletInput = Privy::Models::LinkedAccountWalletInput + + LinkedMfaMethod = Privy::Models::LinkedMfaMethod + + LinkJwtInput = Privy::Models::LinkJwtInput + + MfaDisabledWebhookPayload = Privy::Models::MfaDisabledWebhookPayload + + MfaEnabledWebhookPayload = Privy::Models::MfaEnabledWebhookPayload + + MfaPasskeyEnrollmentRequestBody = Privy::Models::MfaPasskeyEnrollmentRequestBody + + MfaPasskeyInitRequestBody = Privy::Models::MfaPasskeyInitRequestBody + + MfaPasskeyInitResponseBody = Privy::Models::MfaPasskeyInitResponseBody + + MfaPasskeyVerifyRequestBody = Privy::Models::MfaPasskeyVerifyRequestBody + + MfaSMSEnrollRequestBody = Privy::Models::MfaSMSEnrollRequestBody + + MfaSMSInitEnrollInput = Privy::Models::MfaSMSInitEnrollInput + + MfaSMSInitRequestBody = Privy::Models::MfaSMSInitRequestBody + + MfaSMSInitVerifyInput = Privy::Models::MfaSMSInitVerifyInput + + MfaSMSVerifyRequestBody = Privy::Models::MfaSMSVerifyRequestBody + + MfaTotpInitResponseBody = Privy::Models::MfaTotpInitResponseBody + + MfaTotpInput = Privy::Models::MfaTotpInput + + MfaVerifyResponseBody = Privy::Models::MfaVerifyResponseBody + + MoonpayCurrencyCode = Privy::Models::MoonpayCurrencyCode + + MoonpayFiatOnRampEthereumConfig = Privy::Models::MoonpayFiatOnRampEthereumConfig + + MoonpayFiatOnRampEthereumInput = Privy::Models::MoonpayFiatOnRampEthereumInput + + MoonpayFiatOnRampSolanaConfig = Privy::Models::MoonpayFiatOnRampSolanaConfig + + MoonpayFiatOnRampSolanaInput = Privy::Models::MoonpayFiatOnRampSolanaInput + + MoonpayOnRampSandboxConfig = Privy::Models::MoonpayOnRampSandboxConfig + + MoonpayOnRampSignInput = Privy::Models::MoonpayOnRampSignInput + + MoonpayOnRampSignResponse = Privy::Models::MoonpayOnRampSignResponse + + MoonpayPaymentMethod = Privy::Models::MoonpayPaymentMethod + + MoonpaySolanaCurrencyCode = Privy::Models::MoonpaySolanaCurrencyCode + + MoonpayUiConfig = Privy::Models::MoonpayUiConfig + + MoonpayUiTheme = Privy::Models::MoonpayUiTheme + + NamedTokenTransferSource = Privy::Models::NamedTokenTransferSource + + OAuthAuthenticateRecoveryResponse = Privy::Models::OAuthAuthenticateRecoveryResponse + + OAuthAuthenticateRequestBody = Privy::Models::OAuthAuthenticateRequestBody + + OAuthAuthorizationCodeRequestBody = Privy::Models::OAuthAuthorizationCodeRequestBody + + OAuthCallbackICloudExpoInput = Privy::Models::OAuthCallbackICloudExpoInput + + OAuthCodeType = Privy::Models::OAuthCodeType + + OAuthInitICloudRecoveryInput = Privy::Models::OAuthInitICloudRecoveryInput + + OAuthInitRecoveryInput = Privy::Models::OAuthInitRecoveryInput + + OAuthInitRequestBody = Privy::Models::OAuthInitRequestBody + + OAuthInitResponseBody = Privy::Models::OAuthInitResponseBody + + OAuthLinkRequestBody = Privy::Models::OAuthLinkRequestBody + + OAuthLinkResponseBody = Privy::Models::OAuthLinkResponseBody + + OAuthProviderID = Privy::Models::OAuthProviderID + + OAuthTokens = Privy::Models::OAuthTokens + + OAuthTransferRequestBody = Privy::Models::OAuthTransferRequestBody + + OAuthTransferUserInfo = Privy::Models::OAuthTransferUserInfo + + OAuthTransferUserInfoMeta = Privy::Models::OAuthTransferUserInfoMeta + + OAuthUnlinkRequestBody = Privy::Models::OAuthUnlinkRequestBody + + OAuthVerifyRequestBody = Privy::Models::OAuthVerifyRequestBody + + OAuthVerifyResponseBody = Privy::Models::OAuthVerifyResponseBody + + OnrampProvider = Privy::Models::OnrampProvider + + OptionalRefreshTokenInput = Privy::Models::OptionalRefreshTokenInput + + OrganizationSecretIDInput = Privy::Models::OrganizationSecretIDInput + + OrganizationSecretsListResponse = Privy::Models::OrganizationSecretsListResponse + + OrganizationSecretView = Privy::Models::OrganizationSecretView + + OutputWithPreviousTransactionData = Privy::Models::OutputWithPreviousTransactionData + + OwnerIDInput = Privy::Models::OwnerIDInput + + OwnerInput = Privy::Models::OwnerInput + + OwnerInputPublicKey = Privy::Models::OwnerInputPublicKey + + OwnerInputUser = Privy::Models::OwnerInputUser + + P256PublicKey = Privy::Models::P256PublicKey + + PasskeyAssertionResponse = Privy::Models::PasskeyAssertionResponse + + PasskeyAttestationResponse = Privy::Models::PasskeyAttestationResponse + + PasskeyAuthenticateInput = Privy::Models::PasskeyAuthenticateInput + + PasskeyAuthenticatorEnrollmentOptions = Privy::Models::PasskeyAuthenticatorEnrollmentOptions + + PasskeyAuthenticatorEnrollmentResponse = Privy::Models::PasskeyAuthenticatorEnrollmentResponse + + PasskeyAuthenticatorSelection = Privy::Models::PasskeyAuthenticatorSelection + + PasskeyAuthenticatorVerifyOptions = Privy::Models::PasskeyAuthenticatorVerifyOptions + + PasskeyAuthenticatorVerifyResponse = Privy::Models::PasskeyAuthenticatorVerifyResponse + + PasskeyClientExtensionResults = Privy::Models::PasskeyClientExtensionResults + + PasskeyCredentialDescriptor = Privy::Models::PasskeyCredentialDescriptor + + PasskeyCredPropsResult = Privy::Models::PasskeyCredPropsResult + + PasskeyEnrollmentExtensions = Privy::Models::PasskeyEnrollmentExtensions + + PasskeyInitInput = Privy::Models::PasskeyInitInput + + PasskeyLinkInput = Privy::Models::PasskeyLinkInput + + PasskeyMfaMethod = Privy::Models::PasskeyMfaMethod + + PasskeyPubKeyCredParam = Privy::Models::PasskeyPubKeyCredParam + + PasskeyRegisterInput = Privy::Models::PasskeyRegisterInput + + PasskeyRelyingParty = Privy::Models::PasskeyRelyingParty + + PasskeyUser = Privy::Models::PasskeyUser + + PasskeyVerifyExtensions = Privy::Models::PasskeyVerifyExtensions + + PasswordlessAuthenticateRequestBody = Privy::Models::PasswordlessAuthenticateRequestBody + + PasswordlessInitRequestBody = Privy::Models::PasswordlessInitRequestBody + + PasswordlessLinkRequestBody = Privy::Models::PasswordlessLinkRequestBody + + PasswordlessSMSAuthenticateRequestBody = Privy::Models::PasswordlessSMSAuthenticateRequestBody + + PasswordlessSMSInitRequestBody = Privy::Models::PasswordlessSMSInitRequestBody + + PasswordlessSMSLinkRequestBody = Privy::Models::PasswordlessSMSLinkRequestBody + + PasswordlessSMSTransferRequestBody = Privy::Models::PasswordlessSMSTransferRequestBody + + PasswordlessSMSUnlinkRequestBody = Privy::Models::PasswordlessSMSUnlinkRequestBody + + PasswordlessSMSUpdateRequestBody = Privy::Models::PasswordlessSMSUpdateRequestBody + + PasswordlessTransferRequestBody = Privy::Models::PasswordlessTransferRequestBody + + PasswordlessUnlinkRequestBody = Privy::Models::PasswordlessUnlinkRequestBody + + PasswordlessUpdateRequestBody = Privy::Models::PasswordlessUpdateRequestBody + + PatchUsersCustomMetadata = Privy::Models::PatchUsersCustomMetadata + + PhoneInviteInput = Privy::Models::PhoneInviteInput + + Policy = Privy::Models::Policy + + PolicyAction = Privy::Models::PolicyAction + + PolicyAuthorizationHeaders = Privy::Models::PolicyAuthorizationHeaders + + PolicyCondition = Privy::Models::PolicyCondition + + PolicyCreateParams = Privy::Models::PolicyCreateParams + + PolicyCreateRuleParams = Privy::Models::PolicyCreateRuleParams + + PolicyDeleteParams = Privy::Models::PolicyDeleteParams + + PolicyDeleteRuleParams = Privy::Models::PolicyDeleteRuleParams + + PolicyGetParams = Privy::Models::PolicyGetParams + + PolicyGetRuleParams = Privy::Models::PolicyGetRuleParams + + # @type [Privy::Internal::Type::Converter] + PolicyInput = Privy::Models::PolicyInput + + PolicyIntentRequestDetails = Privy::Models::PolicyIntentRequestDetails + + PolicyIntentResponse = Privy::Models::PolicyIntentResponse + + PolicyMethod = Privy::Models::PolicyMethod + + PolicyRequestBody = Privy::Models::PolicyRequestBody + + PolicyRuleRequestBody = Privy::Models::PolicyRuleRequestBody + + PolicyRuleRequestParams = Privy::Models::PolicyRuleRequestParams + + PolicyRuleResponse = Privy::Models::PolicyRuleResponse + + PolicyUpdateParams = Privy::Models::PolicyUpdateParams + + PolicyUpdateRuleParams = Privy::Models::PolicyUpdateRuleParams + + PrivateKeyExportInput = Privy::Models::PrivateKeyExportInput + + PrivateKeyExportResponse = Privy::Models::PrivateKeyExportResponse + + PrivateKeyExportWebhookPayload = Privy::Models::PrivateKeyExportWebhookPayload + + PrivateKeyInitInput = Privy::Models::PrivateKeyInitInput + + PrivateKeySubmitInput = Privy::Models::PrivateKeySubmitInput + + PrivyOAuthProviderID = Privy::Models::PrivyOAuthProviderID + + Quantity = Privy::Models::Quantity + + RawSignBytesEncoding = Privy::Models::RawSignBytesEncoding + + RawSignBytesHashFunction = Privy::Models::RawSignBytesHashFunction + + RawSignBytesParams = Privy::Models::RawSignBytesParams + + RawSignHashParams = Privy::Models::RawSignHashParams + + RawSignInput = Privy::Models::RawSignInput + + RawSignInputParams = Privy::Models::RawSignInputParams + + RawSignResponse = Privy::Models::RawSignResponse + + RawSignResponseData = Privy::Models::RawSignResponseData + + RecipientPublicKey = Privy::Models::RecipientPublicKey + + RecoveryConfigurationICloudInput = Privy::Models::RecoveryConfigurationICloudInput + + RecoveryConfigurationICloudResponse = Privy::Models::RecoveryConfigurationICloudResponse + + RecoveryKeyMaterialInput = Privy::Models::RecoveryKeyMaterialInput + + RecoveryKeyMaterialResponse = Privy::Models::RecoveryKeyMaterialResponse + + RecoveryType = Privy::Models::RecoveryType + + ResponsePasskeyInitAuthenticate = Privy::Models::ResponsePasskeyInitAuthenticate + + ResponsePasskeyInitLink = Privy::Models::ResponsePasskeyInitLink + + ResponsePasskeyInitRegister = Privy::Models::ResponsePasskeyInitRegister + + RpcIntentRequestDetails = Privy::Models::RpcIntentRequestDetails + + RpcIntentResponse = Privy::Models::RpcIntentResponse + + RuleIntentCreateRequestDetails = Privy::Models::RuleIntentCreateRequestDetails + + RuleIntentDeleteRequestDetails = Privy::Models::RuleIntentDeleteRequestDetails + + RuleIntentRequestDetails = Privy::Models::RuleIntentRequestDetails + + RuleIntentResponse = Privy::Models::RuleIntentResponse + + RuleIntentUpdateRequestDetails = Privy::Models::RuleIntentUpdateRequestDetails + + SeedPhraseExportInput = Privy::Models::SeedPhraseExportInput + + SeedPhraseExportResponse = Privy::Models::SeedPhraseExportResponse + + SeedPhraseExportWebhookPayload = Privy::Models::SeedPhraseExportWebhookPayload + + SigningAlgorithm = Privy::Models::SigningAlgorithm + + SiweAddressInput = Privy::Models::SiweAddressInput + + SiweAuthenticateRequestBody = Privy::Models::SiweAuthenticateRequestBody + + SiweInitInput = Privy::Models::SiweInitInput + + SiweInitRequestBody = Privy::Models::SiweInitRequestBody + + SiweInitResponseBody = Privy::Models::SiweInitResponseBody + + SiweInput = Privy::Models::SiweInput + + SiweLinkRequestBody = Privy::Models::SiweLinkRequestBody + + SiweLinkSmartWalletRequestBody = Privy::Models::SiweLinkSmartWalletRequestBody + + SiweNonce = Privy::Models::SiweNonce + + SiweUnlinkRequestBody = Privy::Models::SiweUnlinkRequestBody + + SiwsAddressInput = Privy::Models::SiwsAddressInput + + SiwsAuthenticateRequestBody = Privy::Models::SiwsAuthenticateRequestBody + + SiwsInitInput = Privy::Models::SiwsInitInput + + SiwsInitRequestBody = Privy::Models::SiwsInitRequestBody + + SiwsInitResponseBody = Privy::Models::SiwsInitResponseBody + + SiwsInput = Privy::Models::SiwsInput + + SiwsLinkRequestBody = Privy::Models::SiwsLinkRequestBody + + SiwsNonce = Privy::Models::SiwsNonce + + SiwsUnlinkRequestBody = Privy::Models::SiwsUnlinkRequestBody + + SmartWalletConfiguration = Privy::Models::SmartWalletConfiguration + + SmartWalletConfigurationDisabled = Privy::Models::SmartWalletConfigurationDisabled + + SmartWalletConfigurationEnabled = Privy::Models::SmartWalletConfigurationEnabled + + SmartWalletConfigurationInput = Privy::Models::SmartWalletConfigurationInput + + SmartWalletConfigurationInputEnabled = Privy::Models::SmartWalletConfigurationInputEnabled + + SmartWalletNetworkConfiguration = Privy::Models::SmartWalletNetworkConfiguration + + SmartWalletNetworkConfigurationInput = Privy::Models::SmartWalletNetworkConfigurationInput + + SmartWalletSiweInput = Privy::Models::SmartWalletSiweInput + + SmartWalletType = Privy::Models::SmartWalletType + + SMSMfaMethod = Privy::Models::SMSMfaMethod + + SolanaProgramInstructionCondition = Privy::Models::SolanaProgramInstructionCondition + + SolanaRpcInput = Privy::Models::SolanaRpcInput + + SolanaRpcResponse = Privy::Models::SolanaRpcResponse + + SolanaSignAndSendTransactionRpcInput = Privy::Models::SolanaSignAndSendTransactionRpcInput + + SolanaSignAndSendTransactionRpcInputParams = Privy::Models::SolanaSignAndSendTransactionRpcInputParams + + SolanaSignAndSendTransactionRpcResponse = Privy::Models::SolanaSignAndSendTransactionRpcResponse + + SolanaSignAndSendTransactionRpcResponseData = Privy::Models::SolanaSignAndSendTransactionRpcResponseData + + SolanaSignMessageRpcInput = Privy::Models::SolanaSignMessageRpcInput + + SolanaSignMessageRpcInputParams = Privy::Models::SolanaSignMessageRpcInputParams + + SolanaSignMessageRpcResponse = Privy::Models::SolanaSignMessageRpcResponse + + SolanaSignMessageRpcResponseData = Privy::Models::SolanaSignMessageRpcResponseData + + SolanaSignTransactionRpcInput = Privy::Models::SolanaSignTransactionRpcInput + + SolanaSignTransactionRpcInputParams = Privy::Models::SolanaSignTransactionRpcInputParams + + SolanaSignTransactionRpcResponse = Privy::Models::SolanaSignTransactionRpcResponse + + SolanaSignTransactionRpcResponseData = Privy::Models::SolanaSignTransactionRpcResponseData + + SolanaSystemProgramInstructionCondition = Privy::Models::SolanaSystemProgramInstructionCondition + + SolanaTokenProgramInstructionCondition = Privy::Models::SolanaTokenProgramInstructionCondition + + SolanaWalletDerivationStrategy = Privy::Models::SolanaWalletDerivationStrategy + + SparkBalance = Privy::Models::SparkBalance + + SparkClaimStaticDepositRpcInput = Privy::Models::SparkClaimStaticDepositRpcInput + + SparkClaimStaticDepositRpcInputParams = Privy::Models::SparkClaimStaticDepositRpcInputParams + + SparkClaimStaticDepositRpcResponse = Privy::Models::SparkClaimStaticDepositRpcResponse + + SparkClaimStaticDepositRpcResponseData = Privy::Models::SparkClaimStaticDepositRpcResponseData + + SparkCreateLightningInvoiceRpcInput = Privy::Models::SparkCreateLightningInvoiceRpcInput + + SparkCreateLightningInvoiceRpcInputParams = Privy::Models::SparkCreateLightningInvoiceRpcInputParams + + SparkCreateLightningInvoiceRpcResponse = Privy::Models::SparkCreateLightningInvoiceRpcResponse + + SparkGetBalanceRpcInput = Privy::Models::SparkGetBalanceRpcInput + + SparkGetBalanceRpcResponse = Privy::Models::SparkGetBalanceRpcResponse + + SparkGetClaimStaticDepositQuoteRpcInput = Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput + + SparkGetClaimStaticDepositQuoteRpcInputParams = + Privy::Models::SparkGetClaimStaticDepositQuoteRpcInputParams + + SparkGetClaimStaticDepositQuoteRpcResponse = Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse + + SparkGetClaimStaticDepositQuoteRpcResponseData = + Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponseData + + SparkGetStaticDepositAddressRpcInput = Privy::Models::SparkGetStaticDepositAddressRpcInput + + SparkGetStaticDepositAddressRpcResponse = Privy::Models::SparkGetStaticDepositAddressRpcResponse + + SparkGetStaticDepositAddressRpcResponseData = Privy::Models::SparkGetStaticDepositAddressRpcResponseData + + SparkLightningFee = Privy::Models::SparkLightningFee + + SparkLightningReceiveRequest = Privy::Models::SparkLightningReceiveRequest + + SparkLightningSendRequest = Privy::Models::SparkLightningSendRequest + + SparkNetwork = Privy::Models::SparkNetwork + + SparkOutputSelectionStrategy = Privy::Models::SparkOutputSelectionStrategy + + SparkPayLightningInvoiceRpcInput = Privy::Models::SparkPayLightningInvoiceRpcInput + + SparkPayLightningInvoiceRpcInputParams = Privy::Models::SparkPayLightningInvoiceRpcInputParams + + SparkPayLightningInvoiceRpcResponse = Privy::Models::SparkPayLightningInvoiceRpcResponse + + SparkRpcInput = Privy::Models::SparkRpcInput + + SparkRpcResponse = Privy::Models::SparkRpcResponse + + SparkSigningKeyshare = Privy::Models::SparkSigningKeyshare + + SparkSignMessageWithIdentityKeyRpcInput = Privy::Models::SparkSignMessageWithIdentityKeyRpcInput + + SparkSignMessageWithIdentityKeyRpcInputParams = + Privy::Models::SparkSignMessageWithIdentityKeyRpcInputParams + + SparkSignMessageWithIdentityKeyRpcResponse = Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse + + SparkSignMessageWithIdentityKeyRpcResponseData = + Privy::Models::SparkSignMessageWithIdentityKeyRpcResponseData + + SparkTokenBalance = Privy::Models::SparkTokenBalance + + SparkTransfer = Privy::Models::SparkTransfer + + SparkTransferLeaf = Privy::Models::SparkTransferLeaf + + SparkTransferRpcInput = Privy::Models::SparkTransferRpcInput + + SparkTransferRpcInputParams = Privy::Models::SparkTransferRpcInputParams + + SparkTransferRpcResponse = Privy::Models::SparkTransferRpcResponse + + SparkTransferTokensRpcInput = Privy::Models::SparkTransferTokensRpcInput + + SparkTransferTokensRpcInputParams = Privy::Models::SparkTransferTokensRpcInputParams + + SparkTransferTokensRpcResponse = Privy::Models::SparkTransferTokensRpcResponse + + SparkTransferTokensRpcResponseData = Privy::Models::SparkTransferTokensRpcResponseData + + SparkUserTokenMetadata = Privy::Models::SparkUserTokenMetadata + + SparkWalletLeaf = Privy::Models::SparkWalletLeaf + + SuccessResponse = Privy::Models::SuccessResponse + + SuiCommandName = Privy::Models::SuiCommandName + + SuiTransactionCommandCondition = Privy::Models::SuiTransactionCommandCondition + + SuiTransactionCommandOperator = Privy::Models::SuiTransactionCommandOperator + + SuiTransferObjectsCommandCondition = Privy::Models::SuiTransferObjectsCommandCondition + + SuiTransferObjectsCommandField = Privy::Models::SuiTransferObjectsCommandField + + SvmTransactionWalletActionStep = Privy::Models::SvmTransactionWalletActionStep + + SvmWalletActionStepStatus = Privy::Models::SvmWalletActionStepStatus + + SwapActionResponse = Privy::Models::SwapActionResponse + + SwapDestination = Privy::Models::SwapDestination + + SwapQuoteDestination = Privy::Models::SwapQuoteDestination + + SwapQuoteRequestBody = Privy::Models::SwapQuoteRequestBody + + SwapQuoteResponse = Privy::Models::SwapQuoteResponse + + SwapRequestBody = Privy::Models::SwapRequestBody + + SwapSource = Privy::Models::SwapSource + + SystemCondition = Privy::Models::SystemCondition + + TelegramAuthConfigSchema = Privy::Models::TelegramAuthConfigSchema + + TelegramAuthenticateInput = Privy::Models::TelegramAuthenticateInput + + TelegramAuthenticateRequestBody = Privy::Models::TelegramAuthenticateRequestBody + + TelegramAuthResult = Privy::Models::TelegramAuthResult + + TelegramLinkRequestBody = Privy::Models::TelegramLinkRequestBody + + TelegramUnlinkInput = Privy::Models::TelegramUnlinkInput + + TelegramUnlinkRequestBody = Privy::Models::TelegramUnlinkRequestBody + + TelegramWebAppData = Privy::Models::TelegramWebAppData + + TempoAaAuthorization = Privy::Models::TempoAaAuthorization + + TempoCall = Privy::Models::TempoCall + + TempoFeePayerSignature = Privy::Models::TempoFeePayerSignature + + TestAccount = Privy::Models::TestAccount + + TestAccountsResponse = Privy::Models::TestAccountsResponse + + TokenOutput = Privy::Models::TokenOutput + + TokenTransferDestination = Privy::Models::TokenTransferDestination + + TokenTransferSource = Privy::Models::TokenTransferSource + + TotpMfaMethod = Privy::Models::TotpMfaMethod + + Transaction = Privy::Models::Transaction + + TransactionBroadcastedWebhookPayload = Privy::Models::TransactionBroadcastedWebhookPayload + + TransactionConfirmedWebhookPayload = Privy::Models::TransactionConfirmedWebhookPayload + + TransactionDetail = Privy::Models::TransactionDetail + + TransactionExecutionRevertedWebhookPayload = Privy::Models::TransactionExecutionRevertedWebhookPayload + + TransactionFailedWebhookPayload = Privy::Models::TransactionFailedWebhookPayload + + TransactionGetParams = Privy::Models::TransactionGetParams + + TransactionList = Privy::Models::TransactionList + + TransactionProviderErrorWebhookPayload = Privy::Models::TransactionProviderErrorWebhookPayload + + TransactionReplacedWebhookPayload = Privy::Models::TransactionReplacedWebhookPayload + + TransactionScanningAssetDiff = Privy::Models::TransactionScanningAssetDiff + + TransactionScanningAssetInfo = Privy::Models::TransactionScanningAssetInfo + + TransactionScanningAssetValue = Privy::Models::TransactionScanningAssetValue + + TransactionScanningCalldata = Privy::Models::TransactionScanningCalldata + + TransactionScanningExposure = Privy::Models::TransactionScanningExposure + + TransactionScanningMetadata = Privy::Models::TransactionScanningMetadata + + TransactionScanningParams = Privy::Models::TransactionScanningParams + + TransactionScanningRequestBody = Privy::Models::TransactionScanningRequestBody + + TransactionScanningResponseBody = Privy::Models::TransactionScanningResponseBody + + TransactionScanningRpcRequest = Privy::Models::TransactionScanningRpcRequest + + TransactionScanningSimulationErrorResult = Privy::Models::TransactionScanningSimulationErrorResult + + TransactionScanningSimulationResult = Privy::Models::TransactionScanningSimulationResult + + TransactionScanningSimulationSuccessResult = Privy::Models::TransactionScanningSimulationSuccessResult + + TransactionScanningValidationErrorResult = Privy::Models::TransactionScanningValidationErrorResult + + TransactionScanningValidationResult = Privy::Models::TransactionScanningValidationResult + + TransactionScanningValidationSuccessResult = Privy::Models::TransactionScanningValidationSuccessResult + + TransactionStillPendingWebhookPayload = Privy::Models::TransactionStillPendingWebhookPayload + + TransactionTokenAddressInput = Privy::Models::TransactionTokenAddressInput + + TransferActionResponse = Privy::Models::TransferActionResponse + + TransferFarcasterInput = Privy::Models::TransferFarcasterInput + + TransferIntentRequestDetails = Privy::Models::TransferIntentRequestDetails + + TransferIntentResponse = Privy::Models::TransferIntentResponse + + TransferReceivedTransactionDetail = Privy::Models::TransferReceivedTransactionDetail + + TransferRequestBody = Privy::Models::TransferRequestBody + + TransferSentTransactionDetail = Privy::Models::TransferSentTransactionDetail + + TransferSiweInput = Privy::Models::TransferSiweInput + + TransferSiwsInput = Privy::Models::TransferSiwsInput + + TransferTelegramInput = Privy::Models::TransferTelegramInput + + TronCalldataCondition = Privy::Models::TronCalldataCondition + + TronTransactionCondition = Privy::Models::TronTransactionCondition + + # @type [Privy::Internal::Type::Converter] + TypedDataDomainInputParams = Privy::Models::TypedDataDomainInputParams + + TypedDataTypeFieldInput = Privy::Models::TypedDataTypeFieldInput + + # @type [Privy::Internal::Type::Converter] + TypedDataTypesInputParams = Privy::Models::TypedDataTypesInputParams + + UnlinkPasskeyInput = Privy::Models::UnlinkPasskeyInput + + UnsafeUnwrapWebhookEvent = Privy::Models::UnsafeUnwrapWebhookEvent + + UnsignedEthereumTransaction = Privy::Models::UnsignedEthereumTransaction + + UnsignedStandardEthereumTransaction = Privy::Models::UnsignedStandardEthereumTransaction + + UnsignedTempoTransaction = Privy::Models::UnsignedTempoTransaction + + UpdateAccountFromWalletIDsInput = Privy::Models::UpdateAccountFromWalletIDsInput + + UpdateAccountFromWalletsConfigurationInput = Privy::Models::UpdateAccountFromWalletsConfigurationInput + + UpdateAccountInput = Privy::Models::UpdateAccountInput + + UpdateConditionSetRequestBody = Privy::Models::UpdateConditionSetRequestBody + + UpdateOrganizationSecretSigningKeyInput = Privy::Models::UpdateOrganizationSecretSigningKeyInput + + User = Privy::Models::User + + UserAuthenticatedWebhookPayload = Privy::Models::UserAuthenticatedWebhookPayload + + UserBatchCreateInput = Privy::Models::UserBatchCreateInput + + UserCreatedWebhookPayload = Privy::Models::UserCreatedWebhookPayload + + UserCreateParams = Privy::Models::UserCreateParams + + UserDeleteParams = Privy::Models::UserDeleteParams + + UserGetByCustomAuthIDParams = Privy::Models::UserGetByCustomAuthIDParams + + UserGetByDiscordUsernameParams = Privy::Models::UserGetByDiscordUsernameParams + + UserGetByEmailAddressParams = Privy::Models::UserGetByEmailAddressParams + + UserGetByFarcasterIDParams = Privy::Models::UserGetByFarcasterIDParams + + UserGetByGitHubUsernameParams = Privy::Models::UserGetByGitHubUsernameParams + + UserGetByPhoneNumberParams = Privy::Models::UserGetByPhoneNumberParams + + UserGetBySmartWalletAddressParams = Privy::Models::UserGetBySmartWalletAddressParams + + UserGetByTelegramUserIDParams = Privy::Models::UserGetByTelegramUserIDParams + + UserGetByTelegramUsernameParams = Privy::Models::UserGetByTelegramUsernameParams + + UserGetByTwitterSubjectParams = Privy::Models::UserGetByTwitterSubjectParams + + UserGetByTwitterUsernameParams = Privy::Models::UserGetByTwitterUsernameParams + + UserGetByWalletAddressParams = Privy::Models::UserGetByWalletAddressParams + + UserGetParams = Privy::Models::UserGetParams + + UserInviteInput = Privy::Models::UserInviteInput + + UserLinkedAccountWebhookPayload = Privy::Models::UserLinkedAccountWebhookPayload + + UserListParams = Privy::Models::UserListParams + + UserOperationCompletedWebhookPayload = Privy::Models::UserOperationCompletedWebhookPayload + + UserOperationInput = Privy::Models::UserOperationInput + + UserOwnedRecoveryOption = Privy::Models::UserOwnedRecoveryOption + + UserPregenerateWalletsParams = Privy::Models::UserPregenerateWalletsParams + + UserSearchParams = Privy::Models::UserSearchParams + + UserSetCustomMetadataParams = Privy::Models::UserSetCustomMetadataParams + + UserTransferredAccountWebhookPayload = Privy::Models::UserTransferredAccountWebhookPayload + + UserUnlinkedAccountWebhookPayload = Privy::Models::UserUnlinkedAccountWebhookPayload + + UserUnlinkLinkedAccountParams = Privy::Models::UserUnlinkLinkedAccountParams + + UserUpdatedAccountWebhookPayload = Privy::Models::UserUpdatedAccountWebhookPayload + + UserWalletCreatedWebhookPayload = Privy::Models::UserWalletCreatedWebhookPayload + + UserWithIdentityToken = Privy::Models::UserWithIdentityToken + + Wallet = Privy::Models::Wallet + + WalletActionEarnDepositCreatedWebhookPayload = + Privy::Models::WalletActionEarnDepositCreatedWebhookPayload + + WalletActionEarnDepositFailedWebhookPayload = Privy::Models::WalletActionEarnDepositFailedWebhookPayload + + WalletActionEarnDepositRejectedWebhookPayload = + Privy::Models::WalletActionEarnDepositRejectedWebhookPayload + + WalletActionEarnDepositSucceededWebhookPayload = + Privy::Models::WalletActionEarnDepositSucceededWebhookPayload + + WalletActionEarnIncentiveClaimCreatedWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload + + WalletActionEarnIncentiveClaimFailedWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload + + WalletActionEarnIncentiveClaimRejectedWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload + + WalletActionEarnIncentiveClaimSucceededWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload + + WalletActionEarnWithdrawCreatedWebhookPayload = + Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload + + WalletActionEarnWithdrawFailedWebhookPayload = + Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload + + WalletActionEarnWithdrawRejectedWebhookPayload = + Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload + + WalletActionEarnWithdrawSucceededWebhookPayload = + Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload + + WalletActionResponse = Privy::Models::WalletActionResponse + + WalletActionStatus = Privy::Models::WalletActionStatus + + WalletActionStep = Privy::Models::WalletActionStep + + WalletActionStepType = Privy::Models::WalletActionStepType + + WalletActionSwapCreatedWebhookPayload = Privy::Models::WalletActionSwapCreatedWebhookPayload + + WalletActionSwapFailedWebhookPayload = Privy::Models::WalletActionSwapFailedWebhookPayload + + WalletActionSwapRejectedWebhookPayload = Privy::Models::WalletActionSwapRejectedWebhookPayload + + WalletActionSwapSucceededWebhookPayload = Privy::Models::WalletActionSwapSucceededWebhookPayload + + WalletActionTransferCreatedWebhookPayload = Privy::Models::WalletActionTransferCreatedWebhookPayload + + WalletActionTransferFailedWebhookPayload = Privy::Models::WalletActionTransferFailedWebhookPayload + + WalletActionTransferRejectedWebhookPayload = Privy::Models::WalletActionTransferRejectedWebhookPayload + + WalletActionTransferSucceededWebhookPayload = Privy::Models::WalletActionTransferSucceededWebhookPayload + + WalletActionType = Privy::Models::WalletActionType + + # @type [Privy::Internal::Type::Converter] + WalletAdditionalSigner = Privy::Models::WalletAdditionalSigner + + WalletAdditionalSignerItem = Privy::Models::WalletAdditionalSignerItem + + WalletAPIRegisterAuthorizationKeyInput = Privy::Models::WalletAPIRegisterAuthorizationKeyInput + + WalletAPIRevokeAuthorizationKeyInput = Privy::Models::WalletAPIRevokeAuthorizationKeyInput + + WalletAsset = Privy::Models::WalletAsset + + WalletAuthenticateRequestBody = Privy::Models::WalletAuthenticateRequestBody + + WalletAuthenticateWithJwtParams = Privy::Models::WalletAuthenticateWithJwtParams + + WalletAuthenticateWithJwtResponse = Privy::Models::WalletAuthenticateWithJwtResponse + + WalletAuthorizationHeaders = Privy::Models::WalletAuthorizationHeaders + + WalletBatchCreateInput = Privy::Models::WalletBatchCreateInput + + WalletBatchCreateResponse = Privy::Models::WalletBatchCreateResponse + + WalletBatchCreateResult = Privy::Models::WalletBatchCreateResult + + WalletBatchItemInput = Privy::Models::WalletBatchItemInput + + WalletChainType = Privy::Models::WalletChainType + + WalletCreateParams = Privy::Models::WalletCreateParams + + WalletCreateWalletsWithRecoveryParams = Privy::Models::WalletCreateWalletsWithRecoveryParams + + WalletCreateWalletsWithRecoveryResponse = Privy::Models::WalletCreateWalletsWithRecoveryResponse + + WalletCreationAdditionalSignerItem = Privy::Models::WalletCreationAdditionalSignerItem + + WalletCreationInput = Privy::Models::WalletCreationInput + + WalletCustodian = Privy::Models::WalletCustodian + + WalletEntropyType = Privy::Models::WalletEntropyType + + WalletEthereumAsset = Privy::Models::WalletEthereumAsset + + WalletExportParams = Privy::Models::WalletExportParams + + WalletExportRequestBody = Privy::Models::WalletExportRequestBody + + WalletExportResponseBody = Privy::Models::WalletExportResponseBody + + WalletFundsAsset = Privy::Models::WalletFundsAsset + + WalletFundsErc20Asset = Privy::Models::WalletFundsErc20Asset + + WalletFundsNativeTokenAsset = Privy::Models::WalletFundsNativeTokenAsset + + WalletFundsSacAsset = Privy::Models::WalletFundsSacAsset + + WalletFundsSplAsset = Privy::Models::WalletFundsSplAsset + + WalletGetParams = Privy::Models::WalletGetParams + + WalletGetWalletByAddressParams = Privy::Models::WalletGetWalletByAddressParams + + WalletImportInitResponse = Privy::Models::WalletImportInitResponse + + WalletImportSupportedChains = Privy::Models::WalletImportSupportedChains + + WalletImportSupportedEntropyTypes = Privy::Models::WalletImportSupportedEntropyTypes + + WalletInitImportParams = Privy::Models::WalletInitImportParams + + WalletIntentResponse = Privy::Models::WalletIntentResponse + + WalletInviteInput = Privy::Models::WalletInviteInput + + WalletListParams = Privy::Models::WalletListParams + + WalletRawSignParams = Privy::Models::WalletRawSignParams + + WalletRecoveredWebhookPayload = Privy::Models::WalletRecoveredWebhookPayload + + WalletRecoverySetupWebhookPayload = Privy::Models::WalletRecoverySetupWebhookPayload + + WalletRevokeResponse = Privy::Models::WalletRevokeResponse + + WalletRpcParams = Privy::Models::WalletRpcParams + + WalletRpcRequestBody = Privy::Models::WalletRpcRequestBody + + WalletRpcResponse = Privy::Models::WalletRpcResponse + + Wallets = Privy::Models::Wallets + + WalletSolanaAsset = Privy::Models::WalletSolanaAsset + + WalletSubmitImportParams = Privy::Models::WalletSubmitImportParams + + WalletTransferParams = Privy::Models::WalletTransferParams + + WalletUpdateParams = Privy::Models::WalletUpdateParams + + WalletUpdateRequestBody = Privy::Models::WalletUpdateRequestBody + + WebhookPayload = Privy::Models::WebhookPayload + + WebhookUnsafeUnwrapParams = Privy::Models::WebhookUnsafeUnwrapParams + + YieldAuthorizationHeaders = Privy::Models::YieldAuthorizationHeaders + + YieldClaimConfirmedWebhookPayload = Privy::Models::YieldClaimConfirmedWebhookPayload + + YieldDepositConfirmedWebhookPayload = Privy::Models::YieldDepositConfirmedWebhookPayload + + YieldWithdrawConfirmedWebhookPayload = Privy::Models::YieldWithdrawConfirmedWebhookPayload +end diff --git a/lib/privy/models/abi_parameter.rb b/lib/privy/models/abi_parameter.rb new file mode 100644 index 0000000..a9d4a55 --- /dev/null +++ b/lib/privy/models/abi_parameter.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class AbiParameter < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [String] + required :type, String + + # @!attribute components + # + # @return [ArrayObject}>, nil] + optional :components, + Privy::Internal::Type::ArrayOf[Privy::Internal::Type::HashOf[Privy::Internal::Type::Unknown]] + + # @!attribute indexed + # + # @return [Boolean, nil] + optional :indexed, Privy::Internal::Type::Boolean + + # @!attribute internal_type + # + # @return [String, nil] + optional :internal_type, String, api_name: :internalType + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(type:, components: nil, indexed: nil, internal_type: nil, name: nil) + # A parameter in a Solidity ABI function or event definition. + # + # @param type [String] + # @param components [ArrayObject}>] + # @param indexed [Boolean] + # @param internal_type [String] + # @param name [String] + end + end +end diff --git a/lib/privy/models/abi_schema.rb b/lib/privy/models/abi_schema.rb new file mode 100644 index 0000000..6c02cb4 --- /dev/null +++ b/lib/privy/models/abi_schema.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Privy + module Models + class AbiSchemaItem < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::AbiSchemaItem::Type] + required :type, enum: -> { Privy::AbiSchemaItem::Type } + + # @!attribute anonymous + # + # @return [Boolean, nil] + optional :anonymous, Privy::Internal::Type::Boolean + + # @!attribute inputs + # + # @return [Array, nil] + optional :inputs, -> { Privy::Internal::Type::ArrayOf[Privy::AbiParameter] } + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute outputs + # + # @return [Array, nil] + optional :outputs, -> { Privy::Internal::Type::ArrayOf[Privy::AbiParameter] } + + # @!attribute state_mutability + # + # @return [Symbol, Privy::Models::AbiSchemaItem::StateMutability, nil] + optional :state_mutability, + enum: -> { + Privy::AbiSchemaItem::StateMutability + }, + api_name: :stateMutability + + # @!method initialize(type:, anonymous: nil, inputs: nil, name: nil, outputs: nil, state_mutability: nil) + # @param type [Symbol, Privy::Models::AbiSchemaItem::Type] + # @param anonymous [Boolean] + # @param inputs [Array] + # @param name [String] + # @param outputs [Array] + # @param state_mutability [Symbol, Privy::Models::AbiSchemaItem::StateMutability] + + # @see Privy::Models::AbiSchemaItem#type + module Type + extend Privy::Internal::Type::Enum + + TYPE_FUNCTION = :function + TYPE_CONSTRUCTOR = :constructor + TYPE_EVENT = :event + TYPE_FALLBACK = :fallback + TYPE_RECEIVE = :receive + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::AbiSchemaItem#state_mutability + module StateMutability + extend Privy::Internal::Type::Enum + + PURE = :pure + VIEW = :view + NONPAYABLE = :nonpayable + PAYABLE = :payable + + # @!method self.values + # @return [Array] + end + end + + # @type [Privy::Internal::Type::Converter] + AbiSchema = Privy::Internal::Type::ArrayOf[-> { Privy::AbiSchemaItem }] + end +end diff --git a/lib/privy/models/account_balance_params.rb b/lib/privy/models/account_balance_params.rb new file mode 100644 index 0000000..73f5a3e --- /dev/null +++ b/lib/privy/models/account_balance_params.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Privy + module Models + class AccountBalanceParams < Privy::Internal::Type::BaseModel + # @!attribute testnet_mode + # When set to true, returns balances from testnet chains instead of mainnets. + # + # @return [Symbol, Privy::Models::AccountBalanceParams::TestnetMode, nil] + optional :testnet_mode, enum: -> { Privy::AccountBalanceParams::TestnetMode } + + # @!method initialize(testnet_mode: nil) + # Query parameters for the account balance endpoint. + # + # @param testnet_mode [Symbol, Privy::Models::AccountBalanceParams::TestnetMode] When set to true, returns balances from testnet chains instead of mainnets. + + # When set to true, returns balances from testnet chains instead of mainnets. + # + # @see Privy::Models::AccountBalanceParams#testnet_mode + module TestnetMode + extend Privy::Internal::Type::Enum + + TRUE = :true + FALSE = :false + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/account_balance_response.rb b/lib/privy/models/account_balance_response.rb new file mode 100644 index 0000000..72ba22f --- /dev/null +++ b/lib/privy/models/account_balance_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class AccountBalanceResponse < Privy::Internal::Type::BaseModel + # @!attribute assets + # The individual asset balances, each computed across all supported chains. + # + # @return [Array] + required :assets, -> { Privy::Internal::Type::ArrayOf[Privy::BalanceAsset] } + + # @!attribute total + # A monetary value with its currency denomination. + # + # @return [Privy::Models::CurrencyAmount] + required :total, -> { Privy::CurrencyAmount } + + # @!attribute assets_by_chain + # Individual asset balances per chain. + # + # @return [Array, nil] + optional :assets_by_chain, -> { Privy::Internal::Type::ArrayOf[Privy::BalanceAssetByChain] } + + # @!method initialize(assets:, total:, assets_by_chain: nil) + # The balance of a digital asset account, aggregated across all wallets and + # supported chains. + # + # @param assets [Array] The individual asset balances, each computed across all supported chains. + # + # @param total [Privy::Models::CurrencyAmount] A monetary value with its currency denomination. + # + # @param assets_by_chain [Array] Individual asset balances per chain. + end + end +end diff --git a/lib/privy/models/account_display_name.rb b/lib/privy/models/account_display_name.rb new file mode 100644 index 0000000..94330cd --- /dev/null +++ b/lib/privy/models/account_display_name.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + AccountDisplayName = String + end +end diff --git a/lib/privy/models/account_response.rb b/lib/privy/models/account_response.rb new file mode 100644 index 0000000..64c13f1 --- /dev/null +++ b/lib/privy/models/account_response.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class AccountResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # The account ID. + # + # @return [String] + required :id, String + + # @!attribute display_name + # An optional display name for the account. + # + # @return [String, nil] + required :display_name, String, nil?: true + + # @!attribute wallets + # The wallets belonging to this account. + # + # @return [Array] + required :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::AccountWallet] } + + # @!method initialize(id:, display_name:, wallets:) + # A digital asset account that groups wallets under a single entity. + # + # @param id [String] The account ID. + # + # @param display_name [String, nil] An optional display name for the account. + # + # @param wallets [Array] The wallets belonging to this account. + end + end +end diff --git a/lib/privy/models/account_wallet.rb b/lib/privy/models/account_wallet.rb new file mode 100644 index 0000000..eb02ae2 --- /dev/null +++ b/lib/privy/models/account_wallet.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class AccountWallet < Privy::Internal::Type::BaseModel + # @!attribute id + # The wallet ID. + # + # @return [String] + required :id, String + + # @!attribute address + # The on-chain address of the wallet. + # + # @return [String] + required :address, String + + # @!attribute chain_type + # The wallet chain types that offer first class support. + # + # @return [Symbol, Privy::Models::FirstClassChainType] + required :chain_type, enum: -> { Privy::FirstClassChainType } + + # @!attribute custody + # Information about the custodian managing this wallet. + # + # @return [Privy::Models::WalletCustodian, nil] + optional :custody, -> { Privy::WalletCustodian } + + # @!method initialize(id:, address:, chain_type:, custody: nil) + # A wallet belonging to a digital asset account. + # + # @param id [String] The wallet ID. + # + # @param address [String] The on-chain address of the wallet. + # + # @param chain_type [Symbol, Privy::Models::FirstClassChainType] The wallet chain types that offer first class support. + # + # @param custody [Privy::Models::WalletCustodian] Information about the custodian managing this wallet. + end + end +end diff --git a/lib/privy/models/account_wallet_configuration_item.rb b/lib/privy/models/account_wallet_configuration_item.rb new file mode 100644 index 0000000..4e53aad --- /dev/null +++ b/lib/privy/models/account_wallet_configuration_item.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class AccountWalletConfigurationItem < Privy::Internal::Type::BaseModel + # @!attribute chain_type + # The wallet chain types that offer first class support. + # + # @return [Symbol, Privy::Models::FirstClassChainType] + required :chain_type, enum: -> { Privy::FirstClassChainType } + + # @!attribute custody + # Information about the custodian managing this wallet. + # + # @return [Privy::Models::WalletCustodian, nil] + optional :custody, -> { Privy::WalletCustodian } + + # @!method initialize(chain_type:, custody: nil) + # Configuration for a wallet to create within an account. + # + # @param chain_type [Symbol, Privy::Models::FirstClassChainType] The wallet chain types that offer first class support. + # + # @param custody [Privy::Models::WalletCustodian] Information about the custodian managing this wallet. + end + end +end diff --git a/lib/privy/models/account_wallet_ids.rb b/lib/privy/models/account_wallet_ids.rb new file mode 100644 index 0000000..a20e03d --- /dev/null +++ b/lib/privy/models/account_wallet_ids.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + AccountWalletIDs = Privy::Internal::Type::ArrayOf[String] + end +end diff --git a/lib/privy/models/account_wallets_configuration.rb b/lib/privy/models/account_wallets_configuration.rb new file mode 100644 index 0000000..6cf0c22 --- /dev/null +++ b/lib/privy/models/account_wallets_configuration.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + AccountWalletsConfiguration = + Privy::Internal::Type::ArrayOf[-> { Privy::AccountWalletConfigurationItem }] + end +end diff --git a/lib/privy/models/accounts_dashboard_list_response.rb b/lib/privy/models/accounts_dashboard_list_response.rb new file mode 100644 index 0000000..29878cf --- /dev/null +++ b/lib/privy/models/accounts_dashboard_list_response.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class AccountsDashboardListResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # The list of accounts, with balances included for dashboard display. + # + # @return [Array] + required :data, -> { Privy::Internal::Type::ArrayOf[Privy::AssetAccountWithBalance] } + + # @!attribute next_cursor + # Cursor for fetching the next page of results, or null if no more results. + # + # @return [String, nil] + required :next_cursor, String, nil?: true + + # @!method initialize(data:, next_cursor:) + # Paginated list of digital asset accounts for the dashboard. + # + # @param data [Array] The list of accounts, with balances included for dashboard display. + # + # @param next_cursor [String, nil] Cursor for fetching the next page of results, or null if no more results. + end + end +end diff --git a/lib/privy/models/accounts_list_response.rb b/lib/privy/models/accounts_list_response.rb new file mode 100644 index 0000000..ebdeb37 --- /dev/null +++ b/lib/privy/models/accounts_list_response.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class AccountsListResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # The list of accounts. + # + # @return [Array] + required :data, -> { Privy::Internal::Type::ArrayOf[Privy::AccountResponse] } + + # @!attribute next_cursor + # Cursor for fetching the next page of results, or null if no more results. + # + # @return [String, nil] + required :next_cursor, String, nil?: true + + # @!method initialize(data:, next_cursor:) + # Paginated list of digital asset accounts. + # + # @param data [Array] The list of accounts. + # + # @param next_cursor [String, nil] Cursor for fetching the next page of results, or null if no more results. + end + end +end diff --git a/lib/privy/models/action_request_body_condition.rb b/lib/privy/models/action_request_body_condition.rb new file mode 100644 index 0000000..c699308 --- /dev/null +++ b/lib/privy/models/action_request_body_condition.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Privy + module Models + class ActionRequestBodyCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [String] + required :field, String + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::ActionRequestBodyCondition::FieldSource] + required :field_source, enum: -> { Privy::ActionRequestBodyCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::ActionRequestBodyCondition} for more details. + # + # Condition on the original wallet action API request body fields. + # + # @param field [String] + # + # @param field_source [Symbol, Privy::Models::ActionRequestBodyCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::ActionRequestBodyCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + ACTION_REQUEST_BODY = :action_request_body + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/additional_signer_input.rb b/lib/privy/models/additional_signer_input.rb new file mode 100644 index 0000000..b73ed46 --- /dev/null +++ b/lib/privy/models/additional_signer_input.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + AdditionalSignerInput = Privy::Internal::Type::ArrayOf[-> { Privy::AdditionalSignerItemInput }] + end +end diff --git a/lib/privy/models/additional_signer_item_input.rb b/lib/privy/models/additional_signer_item_input.rb new file mode 100644 index 0000000..3162bc9 --- /dev/null +++ b/lib/privy/models/additional_signer_item_input.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class AdditionalSignerItemInput < Privy::Internal::Type::BaseModel + # @!attribute signer_id + # A unique identifier for a key quorum. + # + # @return [String] + required :signer_id, String + + # @!attribute override_policy_ids + # An optional list of up to one policy ID to enforce on the wallet. + # + # @return [Array, nil] + optional :override_policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(signer_id:, override_policy_ids: nil) + # A single additional signer for a wallet, with an optional policy override. + # + # @param signer_id [String] A unique identifier for a key quorum. + # + # @param override_policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + end + end +end diff --git a/lib/privy/models/address.rb b/lib/privy/models/address.rb new file mode 100644 index 0000000..843689d --- /dev/null +++ b/lib/privy/models/address.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + Address = String + end +end diff --git a/lib/privy/models/aggregation.rb b/lib/privy/models/aggregation.rb new file mode 100644 index 0000000..fea431a --- /dev/null +++ b/lib/privy/models/aggregation.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Privy + module Models + class Aggregation < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique ID of the aggregation. + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp of when the aggregation was created in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute method_ + # The RPC method this aggregation applies to. + # + # @return [Symbol, Privy::Models::AggregationMethod] + required :method_, enum: -> { Privy::AggregationMethod }, api_name: :method + + # @!attribute metric + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + # + # @return [Privy::Models::AggregationMetric] + required :metric, -> { Privy::AggregationMetric } + + # @!attribute name + # The name of the aggregation. + # + # @return [String] + required :name, String + + # @!attribute owner_id + # The key quorum ID of the owner of the aggregation. + # + # @return [String, nil] + required :owner_id, String, nil?: true + + # @!attribute window + # The time window configuration for an aggregation. + # + # @return [Privy::Models::AggregationWindow] + required :window, -> { Privy::AggregationWindow } + + # @!attribute conditions + # Optional conditions to filter events before aggregation. + # + # @return [Array, nil] + optional :conditions, -> { Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition] } + + # @!attribute group_by + # Optional grouping configuration for bucketing metrics. + # + # @return [Array, nil] + optional :group_by, -> { Privy::Internal::Type::ArrayOf[Privy::AggregationGroupBy] } + + # @!method initialize(id:, created_at:, method_:, metric:, name:, owner_id:, window:, conditions: nil, group_by: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::Aggregation} for more details. + # + # An aggregation that measures and tracks metrics over a period of time. + # + # @param id [String] Unique ID of the aggregation. + # + # @param created_at [Float] Unix timestamp of when the aggregation was created in milliseconds. + # + # @param method_ [Symbol, Privy::Models::AggregationMethod] The RPC method this aggregation applies to. + # + # @param metric [Privy::Models::AggregationMetric] The metric configuration for an aggregation, defining what field/field_source to + # + # @param name [String] The name of the aggregation. + # + # @param owner_id [String, nil] The key quorum ID of the owner of the aggregation. + # + # @param window [Privy::Models::AggregationWindow] The time window configuration for an aggregation. + # + # @param conditions [Array] Optional conditions to filter events before aggregation. + # + # @param group_by [Array] Optional grouping configuration for bucketing metrics. + end + end +end diff --git a/lib/privy/models/aggregation_condition.rb b/lib/privy/models/aggregation_condition.rb new file mode 100644 index 0000000..18fa9e7 --- /dev/null +++ b/lib/privy/models/aggregation_condition.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Models + class AggregationCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [String] + required :field, String + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::AggregationCondition::FieldSource] + required :field_source, enum: -> { Privy::AggregationCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::AggregationCondition} for more details. + # + # Condition referencing an aggregation value. The field must start with + # "aggregation." followed by the aggregation ID. + # + # @param field [String] + # + # @param field_source [Symbol, Privy::Models::AggregationCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::AggregationCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + REFERENCE = :reference + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/aggregation_group_by.rb b/lib/privy/models/aggregation_group_by.rb new file mode 100644 index 0000000..37a8913 --- /dev/null +++ b/lib/privy/models/aggregation_group_by.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class AggregationGroupBy < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [String] + required :field, String + + # @!attribute field_source + # + # @return [String] + required :field_source, String + + # @!attribute abi + # A Solidity ABI definition for decoding smart contract calldata. + # + # @return [Array, nil] + optional :abi, -> { Privy::Internal::Type::ArrayOf[Privy::AbiSchemaItem] } + + # @!method initialize(field:, field_source:, abi: nil) + # A grouping configuration for an aggregation. Maximum of 2 group_by fields + # allowed. + # + # @param field [String] + # + # @param field_source [String] + # + # @param abi [Array] A Solidity ABI definition for decoding smart contract calldata. + end + end +end diff --git a/lib/privy/models/aggregation_input.rb b/lib/privy/models/aggregation_input.rb new file mode 100644 index 0000000..dcbc571 --- /dev/null +++ b/lib/privy/models/aggregation_input.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Privy + module Models + class AggregationInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # The RPC method this aggregation applies to. + # + # @return [Symbol, Privy::Models::AggregationMethod] + required :method_, enum: -> { Privy::AggregationMethod }, api_name: :method + + # @!attribute metric + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + # + # @return [Privy::Models::AggregationMetric] + required :metric, -> { Privy::AggregationMetric } + + # @!attribute name + # The name of the aggregation. + # + # @return [String] + required :name, String + + # @!attribute window + # The time window configuration for an aggregation. + # + # @return [Privy::Models::AggregationWindow] + required :window, -> { Privy::AggregationWindow } + + # @!attribute conditions + # Optional conditions to filter events before aggregation. + # + # @return [Array, nil] + optional :conditions, -> { Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition] } + + # @!attribute group_by + # Optional grouping configuration for bucketing metrics. + # + # @return [Array, nil] + optional :group_by, -> { Privy::Internal::Type::ArrayOf[Privy::AggregationGroupBy] } + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!method initialize(method_:, metric:, name:, window:, conditions: nil, group_by: nil, owner: nil, owner_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::AggregationInput} for more details. + # + # Input for creating an aggregation. + # + # @param method_ [Symbol, Privy::Models::AggregationMethod] The RPC method this aggregation applies to. + # + # @param metric [Privy::Models::AggregationMetric] The metric configuration for an aggregation, defining what field/field_source to + # + # @param name [String] The name of the aggregation. + # + # @param window [Privy::Models::AggregationWindow] The time window configuration for an aggregation. + # + # @param conditions [Array] Optional conditions to filter events before aggregation. + # + # @param group_by [Array] Optional grouping configuration for bucketing metrics. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + end + end +end diff --git a/lib/privy/models/aggregation_method.rb b/lib/privy/models/aggregation_method.rb new file mode 100644 index 0000000..c629cb9 --- /dev/null +++ b/lib/privy/models/aggregation_method.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The RPC method this aggregation applies to. + module AggregationMethod + extend Privy::Internal::Type::Enum + + ETH_SIGN_TRANSACTION = :eth_signTransaction + ETH_SIGN_USER_OPERATION = :eth_signUserOperation + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/aggregation_metric.rb b/lib/privy/models/aggregation_metric.rb new file mode 100644 index 0000000..17d03af --- /dev/null +++ b/lib/privy/models/aggregation_metric.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class AggregationMetric < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [String] + required :field, String + + # @!attribute field_source + # + # @return [String] + required :field_source, String + + # @!attribute function + # The aggregation function to apply. + # + # @return [Symbol, Privy::Models::AggregationMetric::Function] + required :function, enum: -> { Privy::AggregationMetric::Function } + + # @!attribute abi + # A Solidity ABI definition for decoding smart contract calldata. + # + # @return [Array, nil] + optional :abi, -> { Privy::Internal::Type::ArrayOf[Privy::AbiSchemaItem] } + + # @!method initialize(field:, field_source:, function:, abi: nil) + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + # + # @param field [String] + # + # @param field_source [String] + # + # @param function [Symbol, Privy::Models::AggregationMetric::Function] The aggregation function to apply. + # + # @param abi [Array] A Solidity ABI definition for decoding smart contract calldata. + + # The aggregation function to apply. + # + # @see Privy::Models::AggregationMetric#function + module Function + extend Privy::Internal::Type::Enum + + SUM = :sum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/aggregation_window.rb b/lib/privy/models/aggregation_window.rb new file mode 100644 index 0000000..bd89f93 --- /dev/null +++ b/lib/privy/models/aggregation_window.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class AggregationWindow < Privy::Internal::Type::BaseModel + # @!attribute seconds + # Duration of the rolling window in seconds (1-72 hours). + # + # @return [Integer] + required :seconds, Integer + + # @!attribute type + # + # @return [Symbol, Privy::Models::AggregationWindow::Type] + required :type, enum: -> { Privy::AggregationWindow::Type } + + # @!method initialize(seconds:, type:) + # The time window configuration for an aggregation. + # + # @param seconds [Integer] Duration of the rolling window in seconds (1-72 hours). + # + # @param type [Symbol, Privy::Models::AggregationWindow::Type] + + # @see Privy::Models::AggregationWindow#type + module Type + extend Privy::Internal::Type::Enum + + ROLLING = :rolling + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/alchemy_paymaster_context.rb b/lib/privy/models/alchemy_paymaster_context.rb new file mode 100644 index 0000000..a08962e --- /dev/null +++ b/lib/privy/models/alchemy_paymaster_context.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class AlchemyPaymasterContext < Privy::Internal::Type::BaseModel + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!method initialize(policy_id:) + # The Alchemy paymaster context for a smart wallet network configuration. + # + # @param policy_id [String] + end + end +end diff --git a/lib/privy/models/allowlist_deletion_response.rb b/lib/privy/models/allowlist_deletion_response.rb new file mode 100644 index 0000000..2bd2165 --- /dev/null +++ b/lib/privy/models/allowlist_deletion_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class AllowlistDeletionResponse < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(message:) + # Confirmation response for deleting an allowlist entry. + # + # @param message [String] + end + end +end diff --git a/lib/privy/models/allowlist_entry.rb b/lib/privy/models/allowlist_entry.rb new file mode 100644 index 0000000..3924e5f --- /dev/null +++ b/lib/privy/models/allowlist_entry.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class AllowlistEntry < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute accepted_at + # + # @return [Float, nil] + required :accepted_at, Float, api_name: :acceptedAt, nil?: true + + # @!attribute app_id + # + # @return [String] + required :app_id, String, api_name: :appId + + # @!attribute type + # + # @return [String] + required :type, String + + # @!attribute value + # + # @return [String] + required :value, String + + # @!method initialize(id:, accepted_at:, app_id:, type:, value:) + # An allowlist entry for an app. + # + # @param id [String] + # @param accepted_at [Float, nil] + # @param app_id [String] + # @param type [String] + # @param value [String] + end + end +end diff --git a/lib/privy/models/amount_type.rb b/lib/privy/models/amount_type.rb new file mode 100644 index 0000000..36afdb4 --- /dev/null +++ b/lib/privy/models/amount_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Whether the amount refers to the input token or output token. + module AmountType + extend Privy::Internal::Type::Enum + + EXACT_INPUT = :exact_input + EXACT_OUTPUT = :exact_output + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/analytics_event_input.rb b/lib/privy/models/analytics_event_input.rb new file mode 100644 index 0000000..037ff8f --- /dev/null +++ b/lib/privy/models/analytics_event_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class AnalyticsEventInput < Privy::Internal::Type::BaseModel + # @!attribute event_name + # + # @return [String] + required :event_name, String + + # @!attribute client_id + # + # @return [String, nil] + optional :client_id, String + + # @!attribute payload + # + # @return [Hash{Symbol=>Object}, nil] + optional :payload, Privy::Internal::Type::HashOf[Privy::Internal::Type::Unknown] + + # @!method initialize(event_name:, client_id: nil, payload: nil) + # The input for capturing an analytics event. + # + # @param event_name [String] + # @param client_id [String] + # @param payload [Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/app_get_gas_spend_params.rb b/lib/privy/models/app_get_gas_spend_params.rb new file mode 100644 index 0000000..77a2073 --- /dev/null +++ b/lib/privy/models/app_get_gas_spend_params.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Apps#get_gas_spend + class AppGetGasSpendParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute end_timestamp + # + # @return [Float] + required :end_timestamp, Float + + # @!attribute start_timestamp + # + # @return [Float] + required :start_timestamp, Float + + # @!attribute wallet_ids + # + # @return [Array] + required :wallet_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(end_timestamp:, start_timestamp:, wallet_ids:, request_options: {}) + # @param end_timestamp [Float] + # @param start_timestamp [Float] + # @param wallet_ids [Array] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/app_get_params.rb b/lib/privy/models/app_get_params.rb new file mode 100644 index 0000000..85e1b3d --- /dev/null +++ b/lib/privy/models/app_get_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Apps#get + class AppGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute app_id + # The ID of the app. + # + # @return [String] + required :app_id, String + + # @!method initialize(app_id:, request_options: {}) + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/app_get_test_credentials_params.rb b/lib/privy/models/app_get_test_credentials_params.rb new file mode 100644 index 0000000..e7be0e1 --- /dev/null +++ b/lib/privy/models/app_get_test_credentials_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Apps#get_test_credentials + class AppGetTestCredentialsParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute app_id + # The ID of the app. + # + # @return [String] + required :app_id, String + + # @!method initialize(app_id:, request_options: {}) + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/app_response.rb b/lib/privy/models/app_response.rb new file mode 100644 index 0000000..c89a13a --- /dev/null +++ b/lib/privy/models/app_response.rb @@ -0,0 +1,527 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Apps#get + class AppResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute accent_color + # + # @return [String, nil] + required :accent_color, String, nil?: true + + # @!attribute allowed_domains + # + # @return [Array] + required :allowed_domains, Privy::Internal::Type::ArrayOf[String] + + # @!attribute allowed_native_app_ids + # + # @return [Array] + required :allowed_native_app_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute allowed_native_app_url_schemes + # + # @return [Array] + required :allowed_native_app_url_schemes, Privy::Internal::Type::ArrayOf[String] + + # @!attribute allowlist_config + # + # @return [Privy::Models::AppResponse::AllowlistConfig] + required :allowlist_config, -> { Privy::AppResponse::AllowlistConfig } + + # @!attribute allowlist_enabled + # + # @return [Boolean] + required :allowlist_enabled, Privy::Internal::Type::Boolean + + # @!attribute apple_oauth + # + # @return [Boolean] + required :apple_oauth, Privy::Internal::Type::Boolean + + # @!attribute captcha_enabled + # + # @return [Boolean] + required :captcha_enabled, Privy::Internal::Type::Boolean + + # @!attribute custom_api_url + # + # @return [String, nil] + required :custom_api_url, String, nil?: true + + # @!attribute custom_jwt_auth + # + # @return [Boolean] + required :custom_jwt_auth, Privy::Internal::Type::Boolean + + # @!attribute custom_oauth_providers + # + # @return [Array] + required :custom_oauth_providers, + -> { Privy::Internal::Type::ArrayOf[Privy::AppResponse::CustomOAuthProvider] } + + # @!attribute data_classification + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + # + # @return [Symbol, Privy::Models::AppResponse::DataClassification] + required :data_classification, enum: -> { Privy::AppResponse::DataClassification } + + # @!attribute disable_plus_emails + # + # @return [Boolean] + required :disable_plus_emails, Privy::Internal::Type::Boolean + + # @!attribute discord_oauth + # + # @return [Boolean] + required :discord_oauth, Privy::Internal::Type::Boolean + + # @!attribute email_auth + # + # @return [Boolean] + required :email_auth, Privy::Internal::Type::Boolean + + # @!attribute embedded_wallet_config + # Configuration for embedded wallets including the mode. + # + # @return [Privy::Models::EmbeddedWalletConfigSchema] + required :embedded_wallet_config, -> { Privy::EmbeddedWalletConfigSchema } + + # @!attribute enabled_captcha_provider + # + # @return [Symbol, Privy::Models::AppResponse::EnabledCaptchaProvider, nil] + required :enabled_captcha_provider, enum: -> { Privy::AppResponse::EnabledCaptchaProvider }, nil?: true + + # @!attribute enforce_wallet_uis + # + # @return [Boolean] + required :enforce_wallet_uis, Privy::Internal::Type::Boolean + + # @!attribute farcaster_auth + # + # @return [Boolean] + required :farcaster_auth, Privy::Internal::Type::Boolean + + # @!attribute farcaster_link_wallets_enabled + # + # @return [Boolean] + required :farcaster_link_wallets_enabled, Privy::Internal::Type::Boolean + + # @!attribute fiat_on_ramp_enabled + # + # @return [Boolean] + required :fiat_on_ramp_enabled, Privy::Internal::Type::Boolean + + # @!attribute github_oauth + # + # @return [Boolean] + required :github_oauth, Privy::Internal::Type::Boolean + + # @!attribute google_oauth + # + # @return [Boolean] + required :google_oauth, Privy::Internal::Type::Boolean + + # @!attribute guest_auth + # + # @return [Boolean] + required :guest_auth, Privy::Internal::Type::Boolean + + # @!attribute icon_url + # + # @return [String, nil] + required :icon_url, String, nil?: true + + # @!attribute instagram_oauth + # + # @return [Boolean] + required :instagram_oauth, Privy::Internal::Type::Boolean + + # @!attribute legacy_wallet_ui_config + # + # @return [Boolean] + required :legacy_wallet_ui_config, Privy::Internal::Type::Boolean + + # @!attribute line_oauth + # + # @return [Boolean] + required :line_oauth, Privy::Internal::Type::Boolean + + # @!attribute linkedin_oauth + # + # @return [Boolean] + required :linkedin_oauth, Privy::Internal::Type::Boolean + + # @!attribute logo_url + # + # @return [String, nil] + required :logo_url, String, nil?: true + + # @!attribute max_linked_wallets_per_user + # + # @return [Float, nil] + required :max_linked_wallets_per_user, Float, nil?: true + + # @!attribute mfa_methods + # + # @return [Array] + required :mfa_methods, -> { Privy::Internal::Type::ArrayOf[enum: Privy::AppResponse::MfaMethod] } + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute passkey_auth + # + # @return [Boolean] + required :passkey_auth, Privy::Internal::Type::Boolean + + # @!attribute passkeys_for_signup_enabled + # + # @return [Boolean] + required :passkeys_for_signup_enabled, Privy::Internal::Type::Boolean + + # @!attribute privacy_policy_url + # + # @return [String, nil] + required :privacy_policy_url, String, nil?: true + + # @!attribute require_users_accept_terms + # + # @return [Boolean, nil] + required :require_users_accept_terms, Privy::Internal::Type::Boolean, nil?: true + + # @!attribute show_wallet_login_first + # + # @return [Boolean] + required :show_wallet_login_first, Privy::Internal::Type::Boolean + + # @!attribute smart_wallet_config + # The configuration object for smart wallets. + # + # @return [Privy::Models::SmartWalletConfigurationDisabled, Privy::Models::SmartWalletConfigurationEnabled] + required :smart_wallet_config, union: -> { Privy::SmartWalletConfiguration } + + # @!attribute sms_auth + # + # @return [Boolean] + required :sms_auth, Privy::Internal::Type::Boolean + + # @!attribute solana_wallet_auth + # + # @return [Boolean] + required :solana_wallet_auth, Privy::Internal::Type::Boolean + + # @!attribute spotify_oauth + # + # @return [Boolean] + required :spotify_oauth, Privy::Internal::Type::Boolean + + # @!attribute telegram_auth + # + # @return [Boolean] + required :telegram_auth, Privy::Internal::Type::Boolean + + # @!attribute telegram_oauth + # + # @return [Boolean] + required :telegram_oauth, Privy::Internal::Type::Boolean + + # @!attribute terms_and_conditions_url + # + # @return [String, nil] + required :terms_and_conditions_url, String, nil?: true + + # @!attribute theme + # + # @return [String] + required :theme, String + + # @!attribute tiktok_oauth + # + # @return [Boolean] + required :tiktok_oauth, Privy::Internal::Type::Boolean + + # @!attribute twitch_oauth + # + # @return [Boolean] + required :twitch_oauth, Privy::Internal::Type::Boolean + + # @!attribute twitter_oauth + # + # @return [Boolean] + required :twitter_oauth, Privy::Internal::Type::Boolean + + # @!attribute twitter_oauth_on_mobile_enabled + # + # @return [Boolean] + required :twitter_oauth_on_mobile_enabled, Privy::Internal::Type::Boolean + + # @!attribute verification_key + # + # @return [String] + required :verification_key, String + + # @!attribute wallet_auth + # + # @return [Boolean] + required :wallet_auth, Privy::Internal::Type::Boolean + + # @!attribute wallet_connect_cloud_project_id + # + # @return [String, nil] + required :wallet_connect_cloud_project_id, String, nil?: true + + # @!attribute whatsapp_enabled + # + # @return [Boolean] + required :whatsapp_enabled, Privy::Internal::Type::Boolean + + # @!attribute captcha_site_key + # + # @return [String, nil] + optional :captcha_site_key, String + + # @!attribute funding_config + # Configuration for funding and on-ramp options. + # + # @return [Privy::Models::FundingConfigResponseSchema, nil] + optional :funding_config, -> { Privy::FundingConfigResponseSchema } + + # @!attribute telegram_auth_config + # Configuration for Telegram authentication. + # + # @return [Privy::Models::TelegramAuthConfigSchema, nil] + optional :telegram_auth_config, -> { Privy::TelegramAuthConfigSchema } + + # @!method initialize(id:, accent_color:, allowed_domains:, allowed_native_app_ids:, allowed_native_app_url_schemes:, allowlist_config:, allowlist_enabled:, apple_oauth:, captcha_enabled:, custom_api_url:, custom_jwt_auth:, custom_oauth_providers:, data_classification:, disable_plus_emails:, discord_oauth:, email_auth:, embedded_wallet_config:, enabled_captcha_provider:, enforce_wallet_uis:, farcaster_auth:, farcaster_link_wallets_enabled:, fiat_on_ramp_enabled:, github_oauth:, google_oauth:, guest_auth:, icon_url:, instagram_oauth:, legacy_wallet_ui_config:, line_oauth:, linkedin_oauth:, logo_url:, max_linked_wallets_per_user:, mfa_methods:, name:, passkey_auth:, passkeys_for_signup_enabled:, privacy_policy_url:, require_users_accept_terms:, show_wallet_login_first:, smart_wallet_config:, sms_auth:, solana_wallet_auth:, spotify_oauth:, telegram_auth:, telegram_oauth:, terms_and_conditions_url:, theme:, tiktok_oauth:, twitch_oauth:, twitter_oauth:, twitter_oauth_on_mobile_enabled:, verification_key:, wallet_auth:, wallet_connect_cloud_project_id:, whatsapp_enabled:, captcha_site_key: nil, funding_config: nil, telegram_auth_config: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::AppResponse} for more details. + # + # The response for getting an app. + # + # @param id [String] + # + # @param accent_color [String, nil] + # + # @param allowed_domains [Array] + # + # @param allowed_native_app_ids [Array] + # + # @param allowed_native_app_url_schemes [Array] + # + # @param allowlist_config [Privy::Models::AppResponse::AllowlistConfig] + # + # @param allowlist_enabled [Boolean] + # + # @param apple_oauth [Boolean] + # + # @param captcha_enabled [Boolean] + # + # @param custom_api_url [String, nil] + # + # @param custom_jwt_auth [Boolean] + # + # @param custom_oauth_providers [Array] + # + # @param data_classification [Symbol, Privy::Models::AppResponse::DataClassification] Indicates that this response contains only publicly accessible data, not a privi + # + # @param disable_plus_emails [Boolean] + # + # @param discord_oauth [Boolean] + # + # @param email_auth [Boolean] + # + # @param embedded_wallet_config [Privy::Models::EmbeddedWalletConfigSchema] Configuration for embedded wallets including the mode. + # + # @param enabled_captcha_provider [Symbol, Privy::Models::AppResponse::EnabledCaptchaProvider, nil] + # + # @param enforce_wallet_uis [Boolean] + # + # @param farcaster_auth [Boolean] + # + # @param farcaster_link_wallets_enabled [Boolean] + # + # @param fiat_on_ramp_enabled [Boolean] + # + # @param github_oauth [Boolean] + # + # @param google_oauth [Boolean] + # + # @param guest_auth [Boolean] + # + # @param icon_url [String, nil] + # + # @param instagram_oauth [Boolean] + # + # @param legacy_wallet_ui_config [Boolean] + # + # @param line_oauth [Boolean] + # + # @param linkedin_oauth [Boolean] + # + # @param logo_url [String, nil] + # + # @param max_linked_wallets_per_user [Float, nil] + # + # @param mfa_methods [Array] + # + # @param name [String] + # + # @param passkey_auth [Boolean] + # + # @param passkeys_for_signup_enabled [Boolean] + # + # @param privacy_policy_url [String, nil] + # + # @param require_users_accept_terms [Boolean, nil] + # + # @param show_wallet_login_first [Boolean] + # + # @param smart_wallet_config [Privy::Models::SmartWalletConfigurationDisabled, Privy::Models::SmartWalletConfigurationEnabled] The configuration object for smart wallets. + # + # @param sms_auth [Boolean] + # + # @param solana_wallet_auth [Boolean] + # + # @param spotify_oauth [Boolean] + # + # @param telegram_auth [Boolean] + # + # @param telegram_oauth [Boolean] + # + # @param terms_and_conditions_url [String, nil] + # + # @param theme [String] + # + # @param tiktok_oauth [Boolean] + # + # @param twitch_oauth [Boolean] + # + # @param twitter_oauth [Boolean] + # + # @param twitter_oauth_on_mobile_enabled [Boolean] + # + # @param verification_key [String] + # + # @param wallet_auth [Boolean] + # + # @param wallet_connect_cloud_project_id [String, nil] + # + # @param whatsapp_enabled [Boolean] + # + # @param captcha_site_key [String] + # + # @param funding_config [Privy::Models::FundingConfigResponseSchema] Configuration for funding and on-ramp options. + # + # @param telegram_auth_config [Privy::Models::TelegramAuthConfigSchema] Configuration for Telegram authentication. + + # @see Privy::Models::AppResponse#allowlist_config + class AllowlistConfig < Privy::Internal::Type::BaseModel + # @!attribute cta_link + # + # @return [String, nil] + required :cta_link, String, nil?: true + + # @!attribute cta_text + # + # @return [String, nil] + required :cta_text, String, nil?: true + + # @!attribute error_detail + # + # @return [String, nil] + required :error_detail, String, nil?: true + + # @!attribute error_title + # + # @return [String, nil] + required :error_title, String, nil?: true + + # @!method initialize(cta_link:, cta_text:, error_detail:, error_title:) + # @param cta_link [String, nil] + # @param cta_text [String, nil] + # @param error_detail [String, nil] + # @param error_title [String, nil] + end + + class CustomOAuthProvider < Privy::Internal::Type::BaseModel + # @!attribute enabled + # + # @return [Boolean] + required :enabled, Privy::Internal::Type::Boolean + + # @!attribute provider + # The ID of a custom OAuth provider, set up for this app. Must start with + # "custom:". + # + # @return [String] + required :provider, String + + # @!attribute provider_display_name + # + # @return [String] + required :provider_display_name, String + + # @!attribute provider_icon_url + # + # @return [String] + required :provider_icon_url, String + + # @!method initialize(enabled:, provider:, provider_display_name:, provider_icon_url:) + # Some parameter documentations has been truncated, see + # {Privy::Models::AppResponse::CustomOAuthProvider} for more details. + # + # @param enabled [Boolean] + # + # @param provider [String] The ID of a custom OAuth provider, set up for this app. Must start with "custom: + # + # @param provider_display_name [String] + # + # @param provider_icon_url [String] + end + + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + # + # @see Privy::Models::AppResponse#data_classification + module DataClassification + extend Privy::Internal::Type::Enum + + PUBLIC = :public + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::AppResponse#enabled_captcha_provider + module EnabledCaptchaProvider + extend Privy::Internal::Type::Enum + + TURNSTILE = :turnstile + HCAPTCHA = :hcaptcha + + # @!method self.values + # @return [Array] + end + + module MfaMethod + extend Privy::Internal::Type::Enum + + SMS = :sms + TOTP = :totp + PASSKEY = :passkey + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/apps/allowlist_create_params.rb b/lib/privy/models/apps/allowlist_create_params.rb new file mode 100644 index 0000000..1e3f6f3 --- /dev/null +++ b/lib/privy/models/apps/allowlist_create_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + module Apps + # @see Privy::Resources::Apps::Allowlist#create + class AllowlistCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute app_id + # The ID of the app. + # + # @return [String] + required :app_id, String + + # @!method initialize(app_id:, request_options: {}) + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/privy/models/apps/allowlist_delete_params.rb b/lib/privy/models/apps/allowlist_delete_params.rb new file mode 100644 index 0000000..f504f6d --- /dev/null +++ b/lib/privy/models/apps/allowlist_delete_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + module Apps + # @see Privy::Resources::Apps::Allowlist#delete + class AllowlistDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute app_id + # The ID of the app. + # + # @return [String] + required :app_id, String + + # @!method initialize(app_id:, request_options: {}) + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/privy/models/apps/allowlist_list_params.rb b/lib/privy/models/apps/allowlist_list_params.rb new file mode 100644 index 0000000..8677a31 --- /dev/null +++ b/lib/privy/models/apps/allowlist_list_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + module Apps + # @see Privy::Resources::Apps::Allowlist#list + class AllowlistListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute app_id + # The ID of the app. + # + # @return [String] + required :app_id, String + + # @!method initialize(app_id:, request_options: {}) + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end + end +end diff --git a/lib/privy/models/apps/allowlist_list_response.rb b/lib/privy/models/apps/allowlist_list_response.rb new file mode 100644 index 0000000..9b70095 --- /dev/null +++ b/lib/privy/models/apps/allowlist_list_response.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Privy + module Models + module Apps + # @type [Privy::Internal::Type::Converter] + AllowlistListResponse = Privy::Internal::Type::ArrayOf[-> { Privy::AllowlistEntry }] + end + end +end diff --git a/lib/privy/models/asset_account_with_balance.rb b/lib/privy/models/asset_account_with_balance.rb new file mode 100644 index 0000000..6417e01 --- /dev/null +++ b/lib/privy/models/asset_account_with_balance.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class AssetAccountWithBalance < Privy::Internal::Type::BaseModel + # @!attribute id + # The account ID. + # + # @return [String] + required :id, String + + # @!attribute balance + # Balances for an asset account or wallet + # + # @return [Privy::Models::BalanceResponse] + required :balance, -> { Privy::BalanceResponse } + + # @!attribute display_name + # An optional display name for the account. + # + # @return [String, nil] + required :display_name, String, nil?: true + + # @!attribute wallets + # The wallets belonging to this account. + # + # @return [Array] + required :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::AccountWallet] } + + # @!method initialize(id:, balance:, display_name:, wallets:) + # A digital asset account with its aggregated balance across all wallets and + # chains. + # + # @param id [String] The account ID. + # + # @param balance [Privy::Models::BalanceResponse] Balances for an asset account or wallet + # + # @param display_name [String, nil] An optional display name for the account. + # + # @param wallets [Array] The wallets belonging to this account. + end + end +end diff --git a/lib/privy/models/authenticate_jwt_input.rb b/lib/privy/models/authenticate_jwt_input.rb new file mode 100644 index 0000000..b37bedd --- /dev/null +++ b/lib/privy/models/authenticate_jwt_input.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class AuthenticateJwtInput < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(token: nil, mode: nil) + # Input for authenticating with a custom JWT. + # + # @param token [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/authenticate_mode.rb b/lib/privy/models/authenticate_mode.rb new file mode 100644 index 0000000..8071206 --- /dev/null +++ b/lib/privy/models/authenticate_mode.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class AuthenticateMode < Privy::Internal::Type::BaseModel + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(mode: nil) + # The authentication mode settings for the ceremony. + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/authenticate_mode_option.rb b/lib/privy/models/authenticate_mode_option.rb new file mode 100644 index 0000000..778d04d --- /dev/null +++ b/lib/privy/models/authenticate_mode_option.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Whether to allow sign-up during authentication. + module AuthenticateModeOption + extend Privy::Internal::Type::Enum + + NO_SIGNUP = :"no-signup" + LOGIN_OR_SIGN_UP = :"login-or-sign-up" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/authenticate_siwe_input.rb b/lib/privy/models/authenticate_siwe_input.rb new file mode 100644 index 0000000..3cd4f75 --- /dev/null +++ b/lib/privy/models/authenticate_siwe_input.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class AuthenticateSiweInput < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute chain_id + # + # @return [String, nil] + optional :chain_id, String, api_name: :chainId, nil?: true + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, chain_id: nil, connector_type: nil, mode: nil, wallet_client_type: nil) + # Input for authenticating a SIWE ceremony. + # + # @param message [String] + # + # @param signature [String] + # + # @param chain_id [String, nil] + # + # @param connector_type [String, nil] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + # + # @param wallet_client_type [String, nil] + end + end +end diff --git a/lib/privy/models/authenticate_siws_input.rb b/lib/privy/models/authenticate_siws_input.rb new file mode 100644 index 0000000..fe74240 --- /dev/null +++ b/lib/privy/models/authenticate_siws_input.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + class AuthenticateSiwsInput < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute message_type + # + # @return [Symbol, Privy::Models::AuthenticateSiwsInput::MessageType, nil] + optional :message_type, enum: -> { Privy::AuthenticateSiwsInput::MessageType } + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, connector_type: nil, message_type: nil, mode: nil, wallet_client_type: nil) + # Input for authenticating a SIWS ceremony. + # + # @param message [String] + # + # @param signature [String] + # + # @param connector_type [String, nil] + # + # @param message_type [Symbol, Privy::Models::AuthenticateSiwsInput::MessageType] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + # + # @param wallet_client_type [String, nil] + + # @see Privy::Models::AuthenticateSiwsInput#message_type + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION = :transaction + PLAIN = :plain + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/authenticated_user.rb b/lib/privy/models/authenticated_user.rb new file mode 100644 index 0000000..ed2806a --- /dev/null +++ b/lib/privy/models/authenticated_user.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Privy + module Models + class AuthenticatedUser < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + required :token, String, nil?: true + + # @!attribute privy_access_token + # + # @return [String, nil] + required :privy_access_token, String, nil?: true + + # @!attribute refresh_token + # + # @return [String, nil] + required :refresh_token, String, nil?: true + + # @!attribute session_update_action + # Instructs the client on how to handle tokens received + # + # @return [Symbol, Privy::Models::AuthenticatedUser::SessionUpdateAction] + required :session_update_action, enum: -> { Privy::AuthenticatedUser::SessionUpdateAction } + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!attribute identity_token + # + # @return [String, nil] + optional :identity_token, String + + # @!attribute is_new_user + # + # @return [Boolean, nil] + optional :is_new_user, Privy::Internal::Type::Boolean + + # @!attribute oauth_tokens + # OAuth tokens associated with the user. + # + # @return [Privy::Models::OAuthTokens, nil] + optional :oauth_tokens, -> { Privy::OAuthTokens } + + # @!method initialize(token:, privy_access_token:, refresh_token:, session_update_action:, user:, identity_token: nil, is_new_user: nil, oauth_tokens: nil) + # The authenticated user. + # + # @param token [String, nil] + # + # @param privy_access_token [String, nil] + # + # @param refresh_token [String, nil] + # + # @param session_update_action [Symbol, Privy::Models::AuthenticatedUser::SessionUpdateAction] Instructs the client on how to handle tokens received + # + # @param user [Privy::Models::User] A Privy user object. + # + # @param identity_token [String] + # + # @param is_new_user [Boolean] + # + # @param oauth_tokens [Privy::Models::OAuthTokens] OAuth tokens associated with the user. + + # Instructs the client on how to handle tokens received + # + # @see Privy::Models::AuthenticatedUser#session_update_action + module SessionUpdateAction + extend Privy::Internal::Type::Enum + + SET = :set + IGNORE = :ignore + CLEAR = :clear + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/authorization_key_dashboard_response.rb b/lib/privy/models/authorization_key_dashboard_response.rb new file mode 100644 index 0000000..c21a05a --- /dev/null +++ b/lib/privy/models/authorization_key_dashboard_response.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Privy + module Models + class AuthorizationKeyDashboardResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Float] + required :created_at, Float + + # @!attribute display_name + # + # @return [String, nil] + required :display_name, String, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute role + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + # + # @return [Symbol, Privy::Models::AuthorizationKeyRole, nil] + required :role, enum: -> { Privy::AuthorizationKeyRole }, nil?: true + + # @!method initialize(id:, created_at:, display_name:, public_key:, role:) + # Some parameter documentations has been truncated, see + # {Privy::Models::AuthorizationKeyDashboardResponse} for more details. + # + # Dashboard response for a wallet authorization key (includes role, which is an + # internal-only concept). + # + # @param id [String] + # + # @param created_at [Float] + # + # @param display_name [String, nil] + # + # @param public_key [String] + # + # @param role [Symbol, Privy::Models::AuthorizationKeyRole, nil] The role of an authorization key, controlling what actions it can authorize on a + end + end +end diff --git a/lib/privy/models/authorization_key_response.rb b/lib/privy/models/authorization_key_response.rb new file mode 100644 index 0000000..ca1a4fe --- /dev/null +++ b/lib/privy/models/authorization_key_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class AuthorizationKeyResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [Float] + required :created_at, Float + + # @!attribute display_name + # + # @return [String, nil] + required :display_name, String, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!method initialize(id:, created_at:, display_name:, public_key:) + # Public-facing response for a wallet authorization key. + # + # @param id [String] + # @param created_at [Float] + # @param display_name [String, nil] + # @param public_key [String] + end + end +end diff --git a/lib/privy/models/authorization_key_role.rb b/lib/privy/models/authorization_key_role.rb new file mode 100644 index 0000000..a30422f --- /dev/null +++ b/lib/privy/models/authorization_key_role.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + module AuthorizationKeyRole + extend Privy::Internal::Type::Enum + + ROOT = :root + MANAGER = :manager + DELEGATED_ACTIONS = :"delegated-actions" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/balance_asset.rb b/lib/privy/models/balance_asset.rb new file mode 100644 index 0000000..e70dee1 --- /dev/null +++ b/lib/privy/models/balance_asset.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class BalanceAsset < Privy::Internal::Type::BaseModel + # @!attribute amount + # The amount of the asset held, denominated in the unit of the asset itself, with + # 1 decimal of precision. + # + # @return [String] + required :amount, String + + # @!attribute price + # A monetary value with its currency denomination. + # + # @return [Privy::Models::CurrencyAmount] + required :price, -> { Privy::CurrencyAmount } + + # @!attribute symbol + # The symbol of the asset (e.g. USDC, ETH). + # + # @return [String] + required :symbol, String + + # @!method initialize(amount:, price:, symbol:) + # Some parameter documentations has been truncated, see + # {Privy::Models::BalanceAsset} for more details. + # + # A single asset entry in a balance, representing holdings across all supported + # chains. + # + # @param amount [String] The amount of the asset held, denominated in the unit of the asset itself, with + # + # @param price [Privy::Models::CurrencyAmount] A monetary value with its currency denomination. + # + # @param symbol [String] The symbol of the asset (e.g. USDC, ETH). + end + end +end diff --git a/lib/privy/models/balance_asset_by_chain.rb b/lib/privy/models/balance_asset_by_chain.rb new file mode 100644 index 0000000..fe513ef --- /dev/null +++ b/lib/privy/models/balance_asset_by_chain.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class BalanceAssetByChain < Privy::Internal::Type::BaseModel + # @!attribute amount + # The amount of the asset held on this chain, denominated in the unit of the asset + # itself. + # + # @return [String] + required :amount, String + + # @!attribute chain_id + # The CAIP-2 chain identifier (e.g. eip155:8453). + # + # @return [String] + required :chain_id, String + + # @!attribute price + # A monetary value with its currency denomination. + # + # @return [Privy::Models::CurrencyAmount] + required :price, -> { Privy::CurrencyAmount } + + # @!attribute symbol + # The symbol of the asset (e.g. USDC, ETH). + # + # @return [String] + required :symbol, String + + # @!method initialize(amount:, chain_id:, price:, symbol:) + # Some parameter documentations has been truncated, see + # {Privy::Models::BalanceAssetByChain} for more details. + # + # A single asset entry scoped to a specific chain. + # + # @param amount [String] The amount of the asset held on this chain, denominated in the unit of the asset + # + # @param chain_id [String] The CAIP-2 chain identifier (e.g. eip155:8453). + # + # @param price [Privy::Models::CurrencyAmount] A monetary value with its currency denomination. + # + # @param symbol [String] The symbol of the asset (e.g. USDC, ETH). + end + end +end diff --git a/lib/privy/models/balance_response.rb b/lib/privy/models/balance_response.rb new file mode 100644 index 0000000..83ca662 --- /dev/null +++ b/lib/privy/models/balance_response.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class BalanceResponse < Privy::Internal::Type::BaseModel + # @!attribute assets + # The individual asset balances, each computed across all supported chains. + # + # @return [Array] + required :assets, -> { Privy::Internal::Type::ArrayOf[Privy::BalanceAsset] } + + # @!attribute total + # A monetary value with its currency denomination. + # + # @return [Privy::Models::CurrencyAmount] + required :total, -> { Privy::CurrencyAmount } + + # @!attribute assets_by_chain + # Individual asset balances per chain. + # + # @return [Array, nil] + optional :assets_by_chain, -> { Privy::Internal::Type::ArrayOf[Privy::BalanceAssetByChain] } + + # @!method initialize(assets:, total:, assets_by_chain: nil) + # Balances for an asset account or wallet + # + # @param assets [Array] The individual asset balances, each computed across all supported chains. + # + # @param total [Privy::Models::CurrencyAmount] A monetary value with its currency denomination. + # + # @param assets_by_chain [Array] Individual asset balances per chain. + end + end +end diff --git a/lib/privy/models/base_action_result.rb b/lib/privy/models/base_action_result.rb new file mode 100644 index 0000000..5aae06e --- /dev/null +++ b/lib/privy/models/base_action_result.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class BaseActionResult < Privy::Internal::Type::BaseModel + # @!attribute executed_at + # Unix timestamp when the action was executed + # + # @return [Float] + required :executed_at, Float + + # @!attribute status_code + # HTTP status code from the action execution + # + # @return [Float] + required :status_code, Float + + # @!attribute authorized_by_display_name + # Display name of the key quorum that authorized execution + # + # @return [String, nil] + optional :authorized_by_display_name, String + + # @!attribute authorized_by_id + # ID of the key quorum that authorized execution + # + # @return [String, nil] + optional :authorized_by_id, String + + # @!method initialize(executed_at:, status_code:, authorized_by_display_name: nil, authorized_by_id: nil) + # Common fields for intent action execution results. + # + # @param executed_at [Float] Unix timestamp when the action was executed + # + # @param status_code [Float] HTTP status code from the action execution + # + # @param authorized_by_display_name [String] Display name of the key quorum that authorized execution + # + # @param authorized_by_id [String] ID of the key quorum that authorized execution + end + end +end diff --git a/lib/privy/models/base_intent_response.rb b/lib/privy/models/base_intent_response.rb new file mode 100644 index 0000000..7933eae --- /dev/null +++ b/lib/privy/models/base_intent_response.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module Privy + module Models + class BaseIntentResponse < Privy::Internal::Type::BaseModel + # @!attribute authorization_details + # Detailed authorization information including key quorum members, thresholds, and + # signature status + # + # @return [Array] + required :authorization_details, -> { Privy::Internal::Type::ArrayOf[Privy::IntentAuthorization] } + + # @!attribute created_at + # Unix timestamp when the intent was created + # + # @return [Float] + required :created_at, Float + + # @!attribute created_by_display_name + # Display name of the user who created the intent + # + # @return [String] + required :created_by_display_name, String + + # @!attribute custom_expiry + # Whether this intent has a custom expiry time set by the client. If false, the + # intent expires after a default duration. + # + # @return [Boolean] + required :custom_expiry, Privy::Internal::Type::Boolean + + # @!attribute expires_at + # Unix timestamp when the intent expires + # + # @return [Float] + required :expires_at, Float + + # @!attribute intent_id + # Unique ID for the intent + # + # @return [String] + required :intent_id, String + + # @!attribute resource_id + # ID of the resource being modified (wallet_id, policy_id, etc) + # + # @return [String] + required :resource_id, String + + # @!attribute status + # Current status of an intent. + # + # @return [Symbol, Privy::Models::IntentStatus] + required :status, enum: -> { Privy::IntentStatus } + + # @!attribute created_by_id + # ID of the user who created the intent. If undefined, the intent was created + # using the app secret + # + # @return [String, nil] + optional :created_by_id, String + + # @!attribute dismissal_reason + # Human-readable reason for dismissal, present when status is 'dismissed' + # + # @return [String, nil] + optional :dismissal_reason, String + + # @!attribute dismissed_at + # Unix timestamp when the intent was dismissed, present when status is 'dismissed' + # + # @return [Float, nil] + optional :dismissed_at, Float + + # @!attribute rejected_at + # Unix timestamp when the intent was rejected, present when status is 'rejected' + # + # @return [Float, nil] + optional :rejected_at, Float + + # @!method initialize(authorization_details:, created_at:, created_by_display_name:, custom_expiry:, expires_at:, intent_id:, resource_id:, status:, created_by_id: nil, dismissal_reason: nil, dismissed_at: nil, rejected_at: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::BaseIntentResponse} for more details. + # + # Common fields shared by all intent response types. + # + # @param authorization_details [Array] Detailed authorization information including key quorum members, thresholds, and + # + # @param created_at [Float] Unix timestamp when the intent was created + # + # @param created_by_display_name [String] Display name of the user who created the intent + # + # @param custom_expiry [Boolean] Whether this intent has a custom expiry time set by the client. If false, the in + # + # @param expires_at [Float] Unix timestamp when the intent expires + # + # @param intent_id [String] Unique ID for the intent + # + # @param resource_id [String] ID of the resource being modified (wallet_id, policy_id, etc) + # + # @param status [Symbol, Privy::Models::IntentStatus] Current status of an intent. + # + # @param created_by_id [String] ID of the user who created the intent. If undefined, the intent was created usin + # + # @param dismissal_reason [String] Human-readable reason for dismissal, present when status is 'dismissed' + # + # @param dismissed_at [Float] Unix timestamp when the intent was dismissed, present when status is 'dismissed' + # + # @param rejected_at [Float] Unix timestamp when the intent was rejected, present when status is 'rejected' + end + end +end diff --git a/lib/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rb b/lib/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rb new file mode 100644 index 0000000..342bb36 --- /dev/null +++ b/lib/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeBrlFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + # @!attribute account_holder_name + # + # @return [String] + required :account_holder_name, String + + # @!attribute asset + # + # @return [Symbol, Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::Asset] + required :asset, enum: -> { Privy::BridgeBrlFiatVirtualAccountDepositInstructions::Asset } + + # @!attribute bank_address + # + # @return [String] + required :bank_address, String + + # @!attribute bank_name + # + # @return [String] + required :bank_name, String + + # @!attribute br_code + # + # @return [String] + required :br_code, String + + # @!attribute payment_rails + # + # @return [Array] + required :payment_rails, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::BridgeBrlFiatVirtualAccountDepositInstructions::PaymentRail] } + + # @!method initialize(account_holder_name:, asset:, bank_address:, bank_name:, br_code:, payment_rails:) + # The deposit instructions for a virtual account. + # + # @param account_holder_name [String] + # @param asset [Symbol, Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::Asset] + # @param bank_address [String] + # @param bank_name [String] + # @param br_code [String] + # @param payment_rails [Array] + + # @see Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions#asset + module Asset + extend Privy::Internal::Type::Enum + + BRL = :brl + + # @!method self.values + # @return [Array] + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + PIX = :pix + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_crypto_deposit_metadata.rb b/lib/privy/models/bridge_crypto_deposit_metadata.rb new file mode 100644 index 0000000..b954c68 --- /dev/null +++ b/lib/privy/models/bridge_crypto_deposit_metadata.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeCryptoDepositMetadata < Privy::Internal::Type::BaseModel + # @!attribute drain_id + # + # @return [String] + required :drain_id, String + + # @!attribute liquidation_address + # The crypto address of the liquidation address that received the deposit. + # + # @return [String] + required :liquidation_address, String + + # @!attribute liquidation_address_id + # + # @return [String] + required :liquidation_address_id, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::BridgeCryptoDepositMetadata::Method] + required :method_, enum: -> { Privy::BridgeCryptoDepositMetadata::Method }, api_name: :method + + # @!attribute source_wallet_address + # The address that sent the deposit. + # + # @return [String] + required :source_wallet_address, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::BridgeCryptoDepositMetadata::Type] + required :type, enum: -> { Privy::BridgeCryptoDepositMetadata::Type } + + # @!method initialize(drain_id:, liquidation_address:, liquidation_address_id:, method_:, source_wallet_address:, type:) + # Bridge metadata for a crypto deposit via liquidation address. + # + # @param drain_id [String] + # + # @param liquidation_address [String] The crypto address of the liquidation address that received the deposit. + # + # @param liquidation_address_id [String] + # + # @param method_ [Symbol, Privy::Models::BridgeCryptoDepositMetadata::Method] + # + # @param source_wallet_address [String] The address that sent the deposit. + # + # @param type [Symbol, Privy::Models::BridgeCryptoDepositMetadata::Type] + + # @see Privy::Models::BridgeCryptoDepositMetadata#method_ + module Method + extend Privy::Internal::Type::Enum + + LIQUIDATION_ADDRESS = :liquidation_address + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::BridgeCryptoDepositMetadata#type + module Type + extend Privy::Internal::Type::Enum + + CRYPTO_DEPOSIT = :crypto_deposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_crypto_transfer_metadata.rb b/lib/privy/models/bridge_crypto_transfer_metadata.rb new file mode 100644 index 0000000..06428ab --- /dev/null +++ b/lib/privy/models/bridge_crypto_transfer_metadata.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeCryptoTransferMetadata < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::BridgeCryptoTransferMetadata::Method] + required :method_, enum: -> { Privy::BridgeCryptoTransferMetadata::Method }, api_name: :method + + # @!attribute source_wallet_address + # The wallet address that sent the transfer. + # + # @return [String] + required :source_wallet_address, String + + # @!attribute transfer_id + # + # @return [String] + required :transfer_id, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::BridgeCryptoTransferMetadata::Type] + required :type, enum: -> { Privy::BridgeCryptoTransferMetadata::Type } + + # @!method initialize(method_:, source_wallet_address:, transfer_id:, type:) + # Bridge metadata for a crypto deposit via transfer. + # + # @param method_ [Symbol, Privy::Models::BridgeCryptoTransferMetadata::Method] + # + # @param source_wallet_address [String] The wallet address that sent the transfer. + # + # @param transfer_id [String] + # + # @param type [Symbol, Privy::Models::BridgeCryptoTransferMetadata::Type] + + # @see Privy::Models::BridgeCryptoTransferMetadata#method_ + module Method + extend Privy::Internal::Type::Enum + + TRANSFER = :transfer + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::BridgeCryptoTransferMetadata#type + module Type + extend Privy::Internal::Type::Enum + + CRYPTO_DEPOSIT = :crypto_deposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_destination_asset.rb b/lib/privy/models/bridge_destination_asset.rb new file mode 100644 index 0000000..a9e1da7 --- /dev/null +++ b/lib/privy/models/bridge_destination_asset.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + module BridgeDestinationAsset + extend Privy::Internal::Type::Enum + + USDB = :usdb + USDC = :usdc + USDT = :usdt + DAI = :dai + PYUSD = :pyusd + EURC = :eurc + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rb b/lib/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rb new file mode 100644 index 0000000..0b04521 --- /dev/null +++ b/lib/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeEurFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + # @!attribute account_holder_name + # + # @return [String] + required :account_holder_name, String + + # @!attribute asset + # + # @return [Symbol, Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::Asset] + required :asset, enum: -> { Privy::BridgeEurFiatVirtualAccountDepositInstructions::Asset } + + # @!attribute bank_address + # + # @return [String] + required :bank_address, String + + # @!attribute bank_name + # + # @return [String] + required :bank_name, String + + # @!attribute bic + # + # @return [String] + required :bic, String + + # @!attribute iban + # + # @return [String] + required :iban, String + + # @!attribute payment_rails + # + # @return [Array] + required :payment_rails, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::BridgeEurFiatVirtualAccountDepositInstructions::PaymentRail] } + + # @!method initialize(account_holder_name:, asset:, bank_address:, bank_name:, bic:, iban:, payment_rails:) + # The deposit instructions for a virtual account. + # + # @param account_holder_name [String] + # @param asset [Symbol, Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::Asset] + # @param bank_address [String] + # @param bank_name [String] + # @param bic [String] + # @param iban [String] + # @param payment_rails [Array] + + # @see Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions#asset + module Asset + extend Privy::Internal::Type::Enum + + EUR = :eur + + # @!method self.values + # @return [Array] + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + SEPA = :sepa + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_fiat_customer_response.rb b/lib/privy/models/bridge_fiat_customer_response.rb new file mode 100644 index 0000000..e134b8c --- /dev/null +++ b/lib/privy/models/bridge_fiat_customer_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatCustomerResponse < Privy::Internal::Type::BaseModel + # @!attribute has_accepted_terms + # + # @return [Boolean] + required :has_accepted_terms, Privy::Internal::Type::Boolean + + # @!attribute provider + # + # @return [Symbol, Privy::Models::BridgeFiatCustomerResponse::Provider] + required :provider, enum: -> { Privy::BridgeFiatCustomerResponse::Provider } + + # @!attribute status + # Status of the KYC verification process. + # + # @return [Symbol, Privy::Models::BridgeFiatCustomerResponse::Status] + required :status, enum: -> { Privy::BridgeFiatCustomerResponse::Status } + + # @!attribute kyc_url + # + # @return [String, nil] + optional :kyc_url, String + + # @!attribute rejection_reasons + # + # @return [Array, nil] + optional :rejection_reasons, -> { Privy::Internal::Type::ArrayOf[Privy::BridgeFiatRejectionReason] } + + # @!method initialize(has_accepted_terms:, provider:, status:, kyc_url: nil, rejection_reasons: nil) + # The response for getting a native onramp provider customer. + # + # @param has_accepted_terms [Boolean] + # + # @param provider [Symbol, Privy::Models::BridgeFiatCustomerResponse::Provider] + # + # @param status [Symbol, Privy::Models::BridgeFiatCustomerResponse::Status] Status of the KYC verification process. + # + # @param kyc_url [String] + # + # @param rejection_reasons [Array] + + # @see Privy::Models::BridgeFiatCustomerResponse#provider + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE = :bridge + + # @!method self.values + # @return [Array] + end + + # Status of the KYC verification process. + # + # @see Privy::Models::BridgeFiatCustomerResponse#status + module Status + extend Privy::Internal::Type::Enum + + NOT_FOUND = :not_found + ACTIVE = :active + AWAITING_QUESTIONNAIRE = :awaiting_questionnaire + AWAITING_UBO = :awaiting_ubo + INCOMPLETE = :incomplete + NOT_STARTED = :not_started + OFFBOARDED = :offboarded + PAUSED = :paused + REJECTED = :rejected + UNDER_REVIEW = :under_review + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_fiat_deposit_metadata.rb b/lib/privy/models/bridge_fiat_deposit_metadata.rb new file mode 100644 index 0000000..6f0ff53 --- /dev/null +++ b/lib/privy/models/bridge_fiat_deposit_metadata.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatDepositMetadata < Privy::Internal::Type::BaseModel + # @!attribute activity_id + # + # @return [String] + required :activity_id, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::BridgeFiatDepositMetadata::Method] + required :method_, enum: -> { Privy::BridgeFiatDepositMetadata::Method }, api_name: :method + + # @!attribute type + # + # @return [Symbol, Privy::Models::BridgeFiatDepositMetadata::Type] + required :type, enum: -> { Privy::BridgeFiatDepositMetadata::Type } + + # @!attribute virtual_account_id + # + # @return [String] + required :virtual_account_id, String + + # @!method initialize(activity_id:, method_:, type:, virtual_account_id:) + # Bridge metadata for a fiat deposit via virtual account. + # + # @param activity_id [String] + # @param method_ [Symbol, Privy::Models::BridgeFiatDepositMetadata::Method] + # @param type [Symbol, Privy::Models::BridgeFiatDepositMetadata::Type] + # @param virtual_account_id [String] + + # @see Privy::Models::BridgeFiatDepositMetadata#method_ + module Method + extend Privy::Internal::Type::Enum + + VIRTUAL_ACCOUNT = :virtual_account + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::BridgeFiatDepositMetadata#type + module Type + extend Privy::Internal::Type::Enum + + FIAT_DEPOSIT = :fiat_deposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_fiat_rejection_reason.rb b/lib/privy/models/bridge_fiat_rejection_reason.rb new file mode 100644 index 0000000..e70e7ab --- /dev/null +++ b/lib/privy/models/bridge_fiat_rejection_reason.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatRejectionReason < Privy::Internal::Type::BaseModel + # @!attribute reason + # + # @return [String] + required :reason, String + + # @!method initialize(reason:) + # A rejection reason for a customer KYC verification. + # + # @param reason [String] + end + end +end diff --git a/lib/privy/models/bridge_fiat_transfer_metadata.rb b/lib/privy/models/bridge_fiat_transfer_metadata.rb new file mode 100644 index 0000000..5058790 --- /dev/null +++ b/lib/privy/models/bridge_fiat_transfer_metadata.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatTransferMetadata < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::BridgeFiatTransferMetadata::Method] + required :method_, enum: -> { Privy::BridgeFiatTransferMetadata::Method }, api_name: :method + + # @!attribute transfer_id + # + # @return [String] + required :transfer_id, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::BridgeFiatTransferMetadata::Type] + required :type, enum: -> { Privy::BridgeFiatTransferMetadata::Type } + + # @!method initialize(method_:, transfer_id:, type:) + # Bridge metadata for a fiat deposit via transfer. + # + # @param method_ [Symbol, Privy::Models::BridgeFiatTransferMetadata::Method] + # @param transfer_id [String] + # @param type [Symbol, Privy::Models::BridgeFiatTransferMetadata::Type] + + # @see Privy::Models::BridgeFiatTransferMetadata#method_ + module Method + extend Privy::Internal::Type::Enum + + TRANSFER = :transfer + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::BridgeFiatTransferMetadata#type + module Type + extend Privy::Internal::Type::Enum + + FIAT_DEPOSIT = :fiat_deposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_fiat_virtual_account_deposit_instructions.rb b/lib/privy/models/bridge_fiat_virtual_account_deposit_instructions.rb new file mode 100644 index 0000000..871775b --- /dev/null +++ b/lib/privy/models/bridge_fiat_virtual_account_deposit_instructions.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + # The deposit instructions for a virtual account. + module BridgeFiatVirtualAccountDepositInstructions + extend Privy::Internal::Type::Union + + discriminator :asset + + # The deposit instructions for a virtual account. + variant :usd, -> { Privy::BridgeUsdFiatVirtualAccountDepositInstructions } + + # The deposit instructions for a virtual account. + variant :eur, -> { Privy::BridgeEurFiatVirtualAccountDepositInstructions } + + # The deposit instructions for a virtual account. + variant :mxn, -> { Privy::BridgeMxnFiatVirtualAccountDepositInstructions } + + # The deposit instructions for a virtual account. + variant :brl, -> { Privy::BridgeBrlFiatVirtualAccountDepositInstructions } + + # The deposit instructions for a virtual account. + variant :gbp, -> { Privy::BridgeGbpFiatVirtualAccountDepositInstructions } + + # @!method self.variants + # @return [Array(Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions, Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions, Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions, Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions, Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions)] + end + end +end diff --git a/lib/privy/models/bridge_fiat_virtual_account_destination.rb b/lib/privy/models/bridge_fiat_virtual_account_destination.rb new file mode 100644 index 0000000..bae3863 --- /dev/null +++ b/lib/privy/models/bridge_fiat_virtual_account_destination.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatVirtualAccountDestination < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute asset + # + # @return [Symbol, Privy::Models::BridgeDestinationAsset] + required :asset, enum: -> { Privy::BridgeDestinationAsset } + + # @!attribute chain + # + # @return [String] + required :chain, String + + # @!method initialize(address:, asset:, chain:) + # @param address [String] + # @param asset [Symbol, Privy::Models::BridgeDestinationAsset] + # @param chain [String] + end + end +end diff --git a/lib/privy/models/bridge_fiat_virtual_account_request.rb b/lib/privy/models/bridge_fiat_virtual_account_request.rb new file mode 100644 index 0000000..825aff0 --- /dev/null +++ b/lib/privy/models/bridge_fiat_virtual_account_request.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatVirtualAccountRequest < Privy::Internal::Type::BaseModel + # @!attribute destination + # + # @return [Privy::Models::BridgeFiatVirtualAccountDestination] + required :destination, -> { Privy::BridgeFiatVirtualAccountDestination } + + # @!attribute provider + # + # @return [Symbol, Privy::Models::BridgeFiatVirtualAccountRequest::Provider] + required :provider, enum: -> { Privy::BridgeFiatVirtualAccountRequest::Provider } + + # @!attribute source + # + # @return [Privy::Models::BridgeFiatVirtualAccountSource] + required :source, -> { Privy::BridgeFiatVirtualAccountSource } + + # @!method initialize(destination:, provider:, source:) + # The request input for creating virtual account. + # + # @param destination [Privy::Models::BridgeFiatVirtualAccountDestination] + # @param provider [Symbol, Privy::Models::BridgeFiatVirtualAccountRequest::Provider] + # @param source [Privy::Models::BridgeFiatVirtualAccountSource] + + # @see Privy::Models::BridgeFiatVirtualAccountRequest#provider + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE = :bridge + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_fiat_virtual_account_response.rb b/lib/privy/models/bridge_fiat_virtual_account_response.rb new file mode 100644 index 0000000..994bc2a --- /dev/null +++ b/lib/privy/models/bridge_fiat_virtual_account_response.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatVirtualAccountResponse < Privy::Internal::Type::BaseModel + # @!attribute deposit_instructions + # The deposit instructions for a virtual account. + # + # @return [Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions, Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions, Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions, Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions, Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions] + required :deposit_instructions, union: -> { Privy::BridgeFiatVirtualAccountDepositInstructions } + + # @!attribute destination + # + # @return [Privy::Models::BridgeFiatVirtualAccountDestination] + required :destination, -> { Privy::BridgeFiatVirtualAccountDestination } + + # @!attribute provider + # + # @return [Symbol, Privy::Models::BridgeFiatVirtualAccountResponse::Provider] + required :provider, enum: -> { Privy::BridgeFiatVirtualAccountResponse::Provider } + + # @!attribute status + # + # @return [String] + required :status, String + + # @!method initialize(deposit_instructions:, destination:, provider:, status:) + # The response for creating virtual account. + # + # @param deposit_instructions [Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions, Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions, Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions, Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions, Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions] The deposit instructions for a virtual account. + # + # @param destination [Privy::Models::BridgeFiatVirtualAccountDestination] + # + # @param provider [Symbol, Privy::Models::BridgeFiatVirtualAccountResponse::Provider] + # + # @param status [String] + + # @see Privy::Models::BridgeFiatVirtualAccountResponse#provider + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE = :bridge + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_fiat_virtual_account_source.rb b/lib/privy/models/bridge_fiat_virtual_account_source.rb new file mode 100644 index 0000000..ea32737 --- /dev/null +++ b/lib/privy/models/bridge_fiat_virtual_account_source.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeFiatVirtualAccountSource < Privy::Internal::Type::BaseModel + # @!attribute asset + # + # @return [Symbol, Privy::Models::BridgeSourceAsset] + required :asset, enum: -> { Privy::BridgeSourceAsset } + + # @!method initialize(asset:) + # @param asset [Symbol, Privy::Models::BridgeSourceAsset] + end + end +end diff --git a/lib/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rb b/lib/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rb new file mode 100644 index 0000000..bbb4dad --- /dev/null +++ b/lib/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeGbpFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + # @!attribute account_holder_name + # + # @return [String] + required :account_holder_name, String + + # @!attribute account_number + # + # @return [String] + required :account_number, String + + # @!attribute asset + # + # @return [Symbol, Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::Asset] + required :asset, enum: -> { Privy::BridgeGbpFiatVirtualAccountDepositInstructions::Asset } + + # @!attribute bank_address + # + # @return [String] + required :bank_address, String + + # @!attribute bank_name + # + # @return [String] + required :bank_name, String + + # @!attribute payment_rails + # + # @return [Array] + required :payment_rails, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::BridgeGbpFiatVirtualAccountDepositInstructions::PaymentRail] } + + # @!attribute sort_code + # + # @return [String] + required :sort_code, String + + # @!method initialize(account_holder_name:, account_number:, asset:, bank_address:, bank_name:, payment_rails:, sort_code:) + # The deposit instructions for a virtual account. + # + # @param account_holder_name [String] + # @param account_number [String] + # @param asset [Symbol, Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::Asset] + # @param bank_address [String] + # @param bank_name [String] + # @param payment_rails [Array] + # @param sort_code [String] + + # @see Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions#asset + module Asset + extend Privy::Internal::Type::Enum + + GBP = :gbp + + # @!method self.values + # @return [Array] + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + FASTER_PAYMENTS = :faster_payments + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_metadata.rb b/lib/privy/models/bridge_metadata.rb new file mode 100644 index 0000000..f6099a2 --- /dev/null +++ b/lib/privy/models/bridge_metadata.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + # Metadata about a Bridge transaction associated with a wallet event. + module BridgeMetadata + extend Privy::Internal::Type::Union + + # Bridge metadata for a crypto deposit via liquidation address. + variant -> { Privy::BridgeCryptoDepositMetadata } + + # Bridge metadata for a refund via liquidation address. + variant -> { Privy::BridgeRefundMetadata } + + # Bridge metadata for a fiat deposit via virtual account. + variant -> { Privy::BridgeFiatDepositMetadata } + + # Bridge metadata for a crypto deposit via transfer. + variant -> { Privy::BridgeCryptoTransferMetadata } + + # Bridge metadata for a fiat deposit via transfer. + variant -> { Privy::BridgeFiatTransferMetadata } + + # Bridge metadata for a transfer refund. + variant -> { Privy::BridgeTransferRefundMetadata } + + # Bridge metadata for a fiat deposit via static memo. + variant -> { Privy::BridgeStaticMemoDepositMetadata } + + # @!method self.variants + # @return [Array(Privy::Models::BridgeCryptoDepositMetadata, Privy::Models::BridgeRefundMetadata, Privy::Models::BridgeFiatDepositMetadata, Privy::Models::BridgeCryptoTransferMetadata, Privy::Models::BridgeFiatTransferMetadata, Privy::Models::BridgeTransferRefundMetadata, Privy::Models::BridgeStaticMemoDepositMetadata)] + end + end +end diff --git a/lib/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rb b/lib/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rb new file mode 100644 index 0000000..2bd8469 --- /dev/null +++ b/lib/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeMxnFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + # @!attribute account_holder_name + # + # @return [String] + required :account_holder_name, String + + # @!attribute asset + # + # @return [Symbol, Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::Asset] + required :asset, enum: -> { Privy::BridgeMxnFiatVirtualAccountDepositInstructions::Asset } + + # @!attribute bank_address + # + # @return [String] + required :bank_address, String + + # @!attribute bank_name + # + # @return [String] + required :bank_name, String + + # @!attribute clabe + # + # @return [String] + required :clabe, String + + # @!attribute payment_rails + # + # @return [Array] + required :payment_rails, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::BridgeMxnFiatVirtualAccountDepositInstructions::PaymentRail] } + + # @!method initialize(account_holder_name:, asset:, bank_address:, bank_name:, clabe:, payment_rails:) + # The deposit instructions for a virtual account. + # + # @param account_holder_name [String] + # @param asset [Symbol, Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::Asset] + # @param bank_address [String] + # @param bank_name [String] + # @param clabe [String] + # @param payment_rails [Array] + + # @see Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions#asset + module Asset + extend Privy::Internal::Type::Enum + + MXN = :mxn + + # @!method self.values + # @return [Array] + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + SPEI = :spei + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_onramp_provider.rb b/lib/privy/models/bridge_onramp_provider.rb new file mode 100644 index 0000000..8a2815b --- /dev/null +++ b/lib/privy/models/bridge_onramp_provider.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Bridge provider variant — production or sandbox. + module BridgeOnrampProvider + extend Privy::Internal::Type::Enum + + BRIDGE = :bridge + BRIDGE_SANDBOX = :"bridge-sandbox" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/bridge_refund_metadata.rb b/lib/privy/models/bridge_refund_metadata.rb new file mode 100644 index 0000000..f80da18 --- /dev/null +++ b/lib/privy/models/bridge_refund_metadata.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeRefundMetadata < Privy::Internal::Type::BaseModel + # @!attribute drain_id + # + # @return [String] + required :drain_id, String + + # @!attribute liquidation_address_id + # + # @return [String] + required :liquidation_address_id, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::BridgeRefundMetadata::Method] + required :method_, enum: -> { Privy::BridgeRefundMetadata::Method }, api_name: :method + + # @!attribute original_transaction_hash + # The original deposit transaction hash that triggered the failed drain. + # + # @return [String] + required :original_transaction_hash, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::BridgeRefundMetadata::Type] + required :type, enum: -> { Privy::BridgeRefundMetadata::Type } + + # @!method initialize(drain_id:, liquidation_address_id:, method_:, original_transaction_hash:, type:) + # Bridge metadata for a refund via liquidation address. + # + # @param drain_id [String] + # + # @param liquidation_address_id [String] + # + # @param method_ [Symbol, Privy::Models::BridgeRefundMetadata::Method] + # + # @param original_transaction_hash [String] The original deposit transaction hash that triggered the failed drain. + # + # @param type [Symbol, Privy::Models::BridgeRefundMetadata::Type] + + # @see Privy::Models::BridgeRefundMetadata#method_ + module Method + extend Privy::Internal::Type::Enum + + LIQUIDATION_ADDRESS = :liquidation_address + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::BridgeRefundMetadata#type + module Type + extend Privy::Internal::Type::Enum + + REFUND = :refund + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_sandbox_fiat_customer_response.rb b/lib/privy/models/bridge_sandbox_fiat_customer_response.rb new file mode 100644 index 0000000..37bd29d --- /dev/null +++ b/lib/privy/models/bridge_sandbox_fiat_customer_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeSandboxFiatCustomerResponse < Privy::Internal::Type::BaseModel + # @!attribute has_accepted_terms + # + # @return [Boolean] + required :has_accepted_terms, Privy::Internal::Type::Boolean + + # @!attribute provider + # + # @return [Symbol, Privy::Models::BridgeSandboxFiatCustomerResponse::Provider] + required :provider, enum: -> { Privy::BridgeSandboxFiatCustomerResponse::Provider } + + # @!attribute status + # Status of the KYC verification process. + # + # @return [Symbol, Privy::Models::BridgeSandboxFiatCustomerResponse::Status] + required :status, enum: -> { Privy::BridgeSandboxFiatCustomerResponse::Status } + + # @!attribute kyc_url + # + # @return [String, nil] + optional :kyc_url, String + + # @!attribute rejection_reasons + # + # @return [Array, nil] + optional :rejection_reasons, -> { Privy::Internal::Type::ArrayOf[Privy::BridgeFiatRejectionReason] } + + # @!method initialize(has_accepted_terms:, provider:, status:, kyc_url: nil, rejection_reasons: nil) + # The response for getting a native onramp provider customer. + # + # @param has_accepted_terms [Boolean] + # + # @param provider [Symbol, Privy::Models::BridgeSandboxFiatCustomerResponse::Provider] + # + # @param status [Symbol, Privy::Models::BridgeSandboxFiatCustomerResponse::Status] Status of the KYC verification process. + # + # @param kyc_url [String] + # + # @param rejection_reasons [Array] + + # @see Privy::Models::BridgeSandboxFiatCustomerResponse#provider + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE_SANDBOX = :"bridge-sandbox" + + # @!method self.values + # @return [Array] + end + + # Status of the KYC verification process. + # + # @see Privy::Models::BridgeSandboxFiatCustomerResponse#status + module Status + extend Privy::Internal::Type::Enum + + NOT_FOUND = :not_found + ACTIVE = :active + AWAITING_QUESTIONNAIRE = :awaiting_questionnaire + AWAITING_UBO = :awaiting_ubo + INCOMPLETE = :incomplete + NOT_STARTED = :not_started + OFFBOARDED = :offboarded + PAUSED = :paused + REJECTED = :rejected + UNDER_REVIEW = :under_review + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_sandbox_fiat_virtual_account_request.rb b/lib/privy/models/bridge_sandbox_fiat_virtual_account_request.rb new file mode 100644 index 0000000..317858f --- /dev/null +++ b/lib/privy/models/bridge_sandbox_fiat_virtual_account_request.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeSandboxFiatVirtualAccountRequest < Privy::Internal::Type::BaseModel + # @!attribute destination + # + # @return [Privy::Models::BridgeFiatVirtualAccountDestination] + required :destination, -> { Privy::BridgeFiatVirtualAccountDestination } + + # @!attribute provider + # + # @return [Symbol, Privy::Models::BridgeSandboxFiatVirtualAccountRequest::Provider] + required :provider, enum: -> { Privy::BridgeSandboxFiatVirtualAccountRequest::Provider } + + # @!attribute source + # + # @return [Privy::Models::BridgeFiatVirtualAccountSource] + required :source, -> { Privy::BridgeFiatVirtualAccountSource } + + # @!method initialize(destination:, provider:, source:) + # The request input for creating virtual account. + # + # @param destination [Privy::Models::BridgeFiatVirtualAccountDestination] + # @param provider [Symbol, Privy::Models::BridgeSandboxFiatVirtualAccountRequest::Provider] + # @param source [Privy::Models::BridgeFiatVirtualAccountSource] + + # @see Privy::Models::BridgeSandboxFiatVirtualAccountRequest#provider + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE_SANDBOX = :"bridge-sandbox" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_sandbox_fiat_virtual_account_response.rb b/lib/privy/models/bridge_sandbox_fiat_virtual_account_response.rb new file mode 100644 index 0000000..aa96bd0 --- /dev/null +++ b/lib/privy/models/bridge_sandbox_fiat_virtual_account_response.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeSandboxFiatVirtualAccountResponse < Privy::Internal::Type::BaseModel + # @!attribute deposit_instructions + # The deposit instructions for a virtual account. + # + # @return [Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions, Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions, Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions, Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions, Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions] + required :deposit_instructions, union: -> { Privy::BridgeFiatVirtualAccountDepositInstructions } + + # @!attribute destination + # + # @return [Privy::Models::BridgeFiatVirtualAccountDestination] + required :destination, -> { Privy::BridgeFiatVirtualAccountDestination } + + # @!attribute provider + # + # @return [Symbol, Privy::Models::BridgeSandboxFiatVirtualAccountResponse::Provider] + required :provider, enum: -> { Privy::BridgeSandboxFiatVirtualAccountResponse::Provider } + + # @!attribute status + # + # @return [String] + required :status, String + + # @!method initialize(deposit_instructions:, destination:, provider:, status:) + # The response for creating virtual account. + # + # @param deposit_instructions [Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions, Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions, Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions, Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions, Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions] The deposit instructions for a virtual account. + # + # @param destination [Privy::Models::BridgeFiatVirtualAccountDestination] + # + # @param provider [Symbol, Privy::Models::BridgeSandboxFiatVirtualAccountResponse::Provider] + # + # @param status [String] + + # @see Privy::Models::BridgeSandboxFiatVirtualAccountResponse#provider + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE_SANDBOX = :"bridge-sandbox" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_source_asset.rb b/lib/privy/models/bridge_source_asset.rb new file mode 100644 index 0000000..50c73ba --- /dev/null +++ b/lib/privy/models/bridge_source_asset.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + module BridgeSourceAsset + extend Privy::Internal::Type::Enum + + USD = :usd + EUR = :eur + MXN = :mxn + BRL = :brl + GBP = :gbp + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/bridge_static_memo_deposit_metadata.rb b/lib/privy/models/bridge_static_memo_deposit_metadata.rb new file mode 100644 index 0000000..ba8a6e3 --- /dev/null +++ b/lib/privy/models/bridge_static_memo_deposit_metadata.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeStaticMemoDepositMetadata < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::BridgeStaticMemoDepositMetadata::Method] + required :method_, enum: -> { Privy::BridgeStaticMemoDepositMetadata::Method }, api_name: :method + + # @!attribute static_memo_event_id + # + # @return [String] + required :static_memo_event_id, String + + # @!attribute static_memo_id + # + # @return [String] + required :static_memo_id, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::BridgeStaticMemoDepositMetadata::Type] + required :type, enum: -> { Privy::BridgeStaticMemoDepositMetadata::Type } + + # @!method initialize(method_:, static_memo_event_id:, static_memo_id:, type:) + # Bridge metadata for a fiat deposit via static memo. + # + # @param method_ [Symbol, Privy::Models::BridgeStaticMemoDepositMetadata::Method] + # @param static_memo_event_id [String] + # @param static_memo_id [String] + # @param type [Symbol, Privy::Models::BridgeStaticMemoDepositMetadata::Type] + + # @see Privy::Models::BridgeStaticMemoDepositMetadata#method_ + module Method + extend Privy::Internal::Type::Enum + + STATIC_MEMO = :static_memo + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::BridgeStaticMemoDepositMetadata#type + module Type + extend Privy::Internal::Type::Enum + + FIAT_DEPOSIT = :fiat_deposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_transfer_refund_metadata.rb b/lib/privy/models/bridge_transfer_refund_metadata.rb new file mode 100644 index 0000000..ad7d2c8 --- /dev/null +++ b/lib/privy/models/bridge_transfer_refund_metadata.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeTransferRefundMetadata < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::BridgeTransferRefundMetadata::Method] + required :method_, enum: -> { Privy::BridgeTransferRefundMetadata::Method }, api_name: :method + + # @!attribute transfer_id + # + # @return [String] + required :transfer_id, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::BridgeTransferRefundMetadata::Type] + required :type, enum: -> { Privy::BridgeTransferRefundMetadata::Type } + + # @!attribute original_transaction_hash + # The original transfer transaction hash (if available). + # + # @return [String, nil] + optional :original_transaction_hash, String + + # @!method initialize(method_:, transfer_id:, type:, original_transaction_hash: nil) + # Bridge metadata for a transfer refund. + # + # @param method_ [Symbol, Privy::Models::BridgeTransferRefundMetadata::Method] + # + # @param transfer_id [String] + # + # @param type [Symbol, Privy::Models::BridgeTransferRefundMetadata::Type] + # + # @param original_transaction_hash [String] The original transfer transaction hash (if available). + + # @see Privy::Models::BridgeTransferRefundMetadata#method_ + module Method + extend Privy::Internal::Type::Enum + + TRANSFER = :transfer + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::BridgeTransferRefundMetadata#type + module Type + extend Privy::Internal::Type::Enum + + REFUND = :refund + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rb b/lib/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rb new file mode 100644 index 0000000..ef5e796 --- /dev/null +++ b/lib/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Privy + module Models + class BridgeUsdFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + # @!attribute asset + # + # @return [Symbol, Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::Asset] + required :asset, enum: -> { Privy::BridgeUsdFiatVirtualAccountDepositInstructions::Asset } + + # @!attribute bank_account_number + # + # @return [String] + required :bank_account_number, String + + # @!attribute bank_address + # + # @return [String] + required :bank_address, String + + # @!attribute bank_beneficiary_address + # + # @return [String] + required :bank_beneficiary_address, String + + # @!attribute bank_beneficiary_name + # + # @return [String] + required :bank_beneficiary_name, String + + # @!attribute bank_name + # + # @return [String] + required :bank_name, String + + # @!attribute bank_routing_number + # + # @return [String] + required :bank_routing_number, String + + # @!attribute payment_rails + # + # @return [Array] + required :payment_rails, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail] } + + # @!method initialize(asset:, bank_account_number:, bank_address:, bank_beneficiary_address:, bank_beneficiary_name:, bank_name:, bank_routing_number:, payment_rails:) + # The deposit instructions for a virtual account. + # + # @param asset [Symbol, Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::Asset] + # @param bank_account_number [String] + # @param bank_address [String] + # @param bank_beneficiary_address [String] + # @param bank_beneficiary_name [String] + # @param bank_name [String] + # @param bank_routing_number [String] + # @param payment_rails [Array] + + # @see Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions#asset + module Asset + extend Privy::Internal::Type::Enum + + USD = :usd + + # @!method self.values + # @return [Array] + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + ACH_PUSH = :ach_push + WIRE = :wire + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/caip_2.rb b/lib/privy/models/caip_2.rb new file mode 100644 index 0000000..79018f6 --- /dev/null +++ b/lib/privy/models/caip_2.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + Caip2 = String + end +end diff --git a/lib/privy/models/caip_2_chain_id.rb b/lib/privy/models/caip_2_chain_id.rb new file mode 100644 index 0000000..f4cffcd --- /dev/null +++ b/lib/privy/models/caip_2_chain_id.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + Caip2ChainID = String + end +end diff --git a/lib/privy/models/coinbase_blockchain.rb b/lib/privy/models/coinbase_blockchain.rb new file mode 100644 index 0000000..9349112 --- /dev/null +++ b/lib/privy/models/coinbase_blockchain.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + # A blockchain supported by Coinbase on-ramp. + module CoinbaseBlockchain + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + BITCOIN = :bitcoin + BASE = :base + AVACCHAIN = :avacchain + OPTIMISM = :optimism + SOLANA = :solana + POLYGON = :polygon + ARBITRUM = :arbitrum + STELLAR = :stellar + MONAD = :monad + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/coinbase_ethereum_asset.rb b/lib/privy/models/coinbase_ethereum_asset.rb new file mode 100644 index 0000000..0a407b1 --- /dev/null +++ b/lib/privy/models/coinbase_ethereum_asset.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # An Ethereum asset supported by Coinbase on-ramp. + module CoinbaseEthereumAsset + extend Privy::Internal::Type::Enum + + ETH = :eth + ETH_2 = :ETH + USDC = :USDC + POL = :POL + MON = :MON + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_ethereum_address.rb b/lib/privy/models/coinbase_on_ramp_ethereum_address.rb new file mode 100644 index 0000000..0423b2b --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_ethereum_address.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class CoinbaseOnRampEthereumAddress < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute blockchains + # + # @return [Array] + required :blockchains, -> { Privy::Internal::Type::ArrayOf[enum: Privy::CoinbaseBlockchain] } + + # @!method initialize(address:, blockchains:) + # An Ethereum address with supported blockchains for Coinbase on-ramp. + # + # @param address [String] + # @param blockchains [Array] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_init_ethereum_input.rb b/lib/privy/models/coinbase_on_ramp_init_ethereum_input.rb new file mode 100644 index 0000000..02b87a7 --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_init_ethereum_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class CoinbaseOnRampInitEthereumInput < Privy::Internal::Type::BaseModel + # @!attribute addresses + # + # @return [Array] + required :addresses, -> { Privy::Internal::Type::ArrayOf[Privy::CoinbaseOnRampEthereumAddress] } + + # @!attribute assets + # + # @return [Array, nil] + optional :assets, -> { Privy::Internal::Type::ArrayOf[enum: Privy::CoinbaseEthereumAsset] } + + # @!method initialize(addresses:, assets: nil) + # Input for initializing a Coinbase on-ramp session for Ethereum. + # + # @param addresses [Array] + # @param assets [Array] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_init_input.rb b/lib/privy/models/coinbase_on_ramp_init_input.rb new file mode 100644 index 0000000..ceb93ac --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_init_input.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # The input for initializing a Coinbase on-ramp session. + module CoinbaseOnRampInitInput + extend Privy::Internal::Type::Union + + # Input for initializing a Coinbase on-ramp session for Ethereum. + variant -> { Privy::CoinbaseOnRampInitEthereumInput } + + # Input for initializing a Coinbase on-ramp session for Solana. + variant -> { Privy::CoinbaseOnRampInitSolanaInput } + + # @!method self.variants + # @return [Array(Privy::Models::CoinbaseOnRampInitEthereumInput, Privy::Models::CoinbaseOnRampInitSolanaInput)] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_init_response.rb b/lib/privy/models/coinbase_on_ramp_init_response.rb new file mode 100644 index 0000000..c157b32 --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_init_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class CoinbaseOnRampInitResponse < Privy::Internal::Type::BaseModel + # @!attribute app_id + # + # @return [String] + required :app_id, String + + # @!attribute channel_id + # + # @return [String] + required :channel_id, String + + # @!attribute partner_user_id + # + # @return [String] + required :partner_user_id, String + + # @!attribute session_token + # + # @return [String] + required :session_token, String + + # @!method initialize(app_id:, channel_id:, partner_user_id:, session_token:) + # The response from initializing a Coinbase on-ramp session. + # + # @param app_id [String] + # @param channel_id [String] + # @param partner_user_id [String] + # @param session_token [String] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_init_solana_input.rb b/lib/privy/models/coinbase_on_ramp_init_solana_input.rb new file mode 100644 index 0000000..58f07d0 --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_init_solana_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class CoinbaseOnRampInitSolanaInput < Privy::Internal::Type::BaseModel + # @!attribute addresses + # + # @return [Array] + required :addresses, -> { Privy::Internal::Type::ArrayOf[Privy::CoinbaseOnRampSolanaAddress] } + + # @!attribute assets + # + # @return [Array, nil] + optional :assets, -> { Privy::Internal::Type::ArrayOf[enum: Privy::CoinbaseSolanaAsset] } + + # @!method initialize(addresses:, assets: nil) + # Input for initializing a Coinbase on-ramp session for Solana. + # + # @param addresses [Array] + # @param assets [Array] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_solana_address.rb b/lib/privy/models/coinbase_on_ramp_solana_address.rb new file mode 100644 index 0000000..cc1525c --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_solana_address.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class CoinbaseOnRampSolanaAddress < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute blockchains + # + # @return [Array] + required :blockchains, -> { Privy::Internal::Type::ArrayOf[enum: Privy::CoinbaseBlockchain] } + + # @!method initialize(address:, blockchains:) + # A Solana address with supported blockchains for Coinbase on-ramp. + # + # @param address [String] + # @param blockchains [Array] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_status.rb b/lib/privy/models/coinbase_on_ramp_status.rb new file mode 100644 index 0000000..e0778f7 --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_status.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # Status of a Coinbase on-ramp session. + module CoinbaseOnRampStatus + extend Privy::Internal::Type::Enum + + PENDING = :pending + SUCCESS = :success + FAILURE = :failure + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/coinbase_on_ramp_status_response.rb b/lib/privy/models/coinbase_on_ramp_status_response.rb new file mode 100644 index 0000000..8517ace --- /dev/null +++ b/lib/privy/models/coinbase_on_ramp_status_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class CoinbaseOnRampStatusResponse < Privy::Internal::Type::BaseModel + # @!attribute status + # Status of a Coinbase on-ramp session. + # + # @return [Symbol, Privy::Models::CoinbaseOnRampStatus] + required :status, enum: -> { Privy::CoinbaseOnRampStatus } + + # @!method initialize(status:) + # The response for getting the status of a Coinbase on-ramp session. + # + # @param status [Symbol, Privy::Models::CoinbaseOnRampStatus] Status of a Coinbase on-ramp session. + end + end +end diff --git a/lib/privy/models/coinbase_solana_asset.rb b/lib/privy/models/coinbase_solana_asset.rb new file mode 100644 index 0000000..cab5e9b --- /dev/null +++ b/lib/privy/models/coinbase_solana_asset.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # A Solana asset supported by Coinbase on-ramp. + module CoinbaseSolanaAsset + extend Privy::Internal::Type::Enum + + SOL = :SOL + USDC = :USDC + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/condition_operator.rb b/lib/privy/models/condition_operator.rb new file mode 100644 index 0000000..20093e9 --- /dev/null +++ b/lib/privy/models/condition_operator.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # Operator to use for policy conditions. + module ConditionOperator + extend Privy::Internal::Type::Enum + + EQ = :eq + GT = :gt + GTE = :gte + LT = :lt + LTE = :lte + IN = :in + IN_CONDITION_SET = :in_condition_set + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/condition_set.rb b/lib/privy/models/condition_set.rb new file mode 100644 index 0000000..8eb0c54 --- /dev/null +++ b/lib/privy/models/condition_set.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSet < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique ID of the created condition set. This will be the primary identifier when + # using the condition set in the future. + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp of when the condition set was created in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute name + # Name of the condition set. + # + # @return [String] + required :name, String + + # @!attribute owner_id + # A unique identifier for a key quorum. + # + # @return [String] + required :owner_id, String + + # @!method initialize(id:, created_at:, name:, owner_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::ConditionSet} for more details. + # + # A condition set for grouping related condition values. + # + # @param id [String] Unique ID of the created condition set. This will be the primary identifier when + # + # @param created_at [Float] Unix timestamp of when the condition set was created in milliseconds. + # + # @param name [String] Name of the condition set. + # + # @param owner_id [String] A unique identifier for a key quorum. + end + end +end diff --git a/lib/privy/models/condition_set_authorization_headers.rb b/lib/privy/models/condition_set_authorization_headers.rb new file mode 100644 index 0000000..1601444 --- /dev/null +++ b/lib/privy/models/condition_set_authorization_headers.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSetAuthorizationHeaders < Privy::Internal::Type::BaseModel + # @!attribute privy_app_id + # ID of your Privy app. + # + # @return [String] + required :privy_app_id, String, api_name: :"privy-app-id" + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String, api_name: :"privy-authorization-signature" + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String, api_name: :"privy-request-expiry" + + # @!method initialize(privy_app_id:, privy_authorization_signature: nil, privy_request_expiry: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::ConditionSetAuthorizationHeaders} for more details. + # + # Headers required to authorize modifications to condition sets. + # + # @param privy_app_id [String] ID of your Privy app. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + end + end +end diff --git a/lib/privy/models/condition_set_item.rb b/lib/privy/models/condition_set_item.rb new file mode 100644 index 0000000..93b68f1 --- /dev/null +++ b/lib/privy/models/condition_set_item.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSetItem < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique ID of the created condition set item. + # + # @return [String] + required :id, String + + # @!attribute condition_set_id + # Unique ID of the condition set this item belongs to. + # + # @return [String] + required :condition_set_id, String + + # @!attribute created_at + # Unix timestamp of when the condition set item was created in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute value + # The value stored in this condition set item. + # + # @return [String] + required :value, String + + # @!method initialize(id:, condition_set_id:, created_at:, value:) + # A single item in a condition set. + # + # @param id [String] Unique ID of the created condition set item. + # + # @param condition_set_id [String] Unique ID of the condition set this item belongs to. + # + # @param created_at [Float] Unix timestamp of when the condition set item was created in milliseconds. + # + # @param value [String] The value stored in this condition set item. + end + end +end diff --git a/lib/privy/models/condition_set_item_request_params.rb b/lib/privy/models/condition_set_item_request_params.rb new file mode 100644 index 0000000..df21972 --- /dev/null +++ b/lib/privy/models/condition_set_item_request_params.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSetItemRequestParams < Privy::Internal::Type::BaseModel + # @!attribute condition_set_id + # + # @return [String] + required :condition_set_id, String + + # @!attribute condition_set_item_id + # + # @return [String] + required :condition_set_item_id, String + + # @!method initialize(condition_set_id:, condition_set_item_id:) + # Unique IDs of the condition set and the condition set item within the condition + # set to take actions on. + # + # @param condition_set_id [String] + # @param condition_set_item_id [String] + end + end +end diff --git a/lib/privy/models/condition_set_item_value_input.rb b/lib/privy/models/condition_set_item_value_input.rb new file mode 100644 index 0000000..2469439 --- /dev/null +++ b/lib/privy/models/condition_set_item_value_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSetItemValueInput < Privy::Internal::Type::BaseModel + # @!attribute value + # + # @return [String] + required :value, String + + # @!method initialize(value:) + # A single value to add to a condition set. + # + # @param value [String] + end + end +end diff --git a/lib/privy/models/condition_set_items.rb b/lib/privy/models/condition_set_items.rb new file mode 100644 index 0000000..0375aae --- /dev/null +++ b/lib/privy/models/condition_set_items.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + ConditionSetItems = Privy::Internal::Type::ArrayOf[-> { Privy::ConditionSetItem }] + end +end diff --git a/lib/privy/models/condition_set_items_request_body.rb b/lib/privy/models/condition_set_items_request_body.rb new file mode 100644 index 0000000..0ed7de2 --- /dev/null +++ b/lib/privy/models/condition_set_items_request_body.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + ConditionSetItemsRequestBody = Privy::Internal::Type::ArrayOf[-> { Privy::ConditionSetItemValueInput }] + end +end diff --git a/lib/privy/models/condition_set_items_response.rb b/lib/privy/models/condition_set_items_response.rb new file mode 100644 index 0000000..df19408 --- /dev/null +++ b/lib/privy/models/condition_set_items_response.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSetItemsResponse < Privy::Internal::Type::BaseModel + # @!attribute items + # List of condition set items. + # + # @return [Array] + required :items, -> { Privy::Internal::Type::ArrayOf[Privy::ConditionSetItem] } + + # @!attribute next_cursor + # Cursor for pagination. Null if there are no more items. + # + # @return [String, nil] + required :next_cursor, String, nil?: true + + # @!method initialize(items:, next_cursor:) + # Paginated list of condition set items. + # + # @param items [Array] List of condition set items. + # + # @param next_cursor [String, nil] Cursor for pagination. Null if there are no more items. + end + end +end diff --git a/lib/privy/models/condition_set_request_body.rb b/lib/privy/models/condition_set_request_body.rb new file mode 100644 index 0000000..cc46226 --- /dev/null +++ b/lib/privy/models/condition_set_request_body.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSetRequestBody < Privy::Internal::Type::BaseModel + # @!attribute name + # Name to assign to condition set. + # + # @return [String] + required :name, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!method initialize(name:, owner: nil, owner_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::ConditionSetRequestBody} for more details. + # + # Request body for creating a condition set. Exactly one of `owner` or `owner_id` + # is required. + # + # @param name [String] Name to assign to condition set. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + end + end +end diff --git a/lib/privy/models/condition_set_request_params.rb b/lib/privy/models/condition_set_request_params.rb new file mode 100644 index 0000000..b76d672 --- /dev/null +++ b/lib/privy/models/condition_set_request_params.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class ConditionSetRequestParams < Privy::Internal::Type::BaseModel + # @!attribute condition_set_id + # + # @return [String] + required :condition_set_id, String + + # @!method initialize(condition_set_id:) + # Unique ID of the condition set to take actions on. + # + # @param condition_set_id [String] + end + end +end diff --git a/lib/privy/models/condition_value.rb b/lib/privy/models/condition_value.rb new file mode 100644 index 0000000..0c337fe --- /dev/null +++ b/lib/privy/models/condition_value.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + module ConditionValue + extend Privy::Internal::Type::Union + + variant String + + variant -> { Privy::Models::ConditionValue::StringArray } + + # @!method self.variants + # @return [Array(String, Array)] + + # @type [Privy::Internal::Type::Converter] + StringArray = Privy::Internal::Type::ArrayOf[String] + end + end +end diff --git a/lib/privy/models/create_account_from_wallet_ids_input.rb b/lib/privy/models/create_account_from_wallet_ids_input.rb new file mode 100644 index 0000000..8baa16c --- /dev/null +++ b/lib/privy/models/create_account_from_wallet_ids_input.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + class CreateAccountFromWalletIDsInput < Privy::Internal::Type::BaseModel + # @!attribute wallet_ids + # IDs for wallets to include in this account. + # + # @return [Array] + required :wallet_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute display_name + # An optional display name for the account. + # + # @return [String, nil] + optional :display_name, String + + # @!method initialize(wallet_ids:, display_name: nil) + # Input for creating a digital asset account from existing wallets with a + # `wallet_ids` parameter. + # + # @param wallet_ids [Array] IDs for wallets to include in this account. + # + # @param display_name [String] An optional display name for the account. + end + end +end diff --git a/lib/privy/models/create_account_from_wallets_configuration_input.rb b/lib/privy/models/create_account_from_wallets_configuration_input.rb new file mode 100644 index 0000000..96ce773 --- /dev/null +++ b/lib/privy/models/create_account_from_wallets_configuration_input.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Privy + module Models + class CreateAccountFromWalletsConfigurationInput < Privy::Internal::Type::BaseModel + # @!attribute wallets_configuration + # Configuration for the wallets on this account. + # + # @return [Array] + required :wallets_configuration, + -> { Privy::Internal::Type::ArrayOf[Privy::AccountWalletConfigurationItem] } + + # @!attribute display_name + # An optional display name for the account. + # + # @return [String, nil] + optional :display_name, String + + # @!method initialize(wallets_configuration:, display_name: nil) + # Input for creating a digital asset account from new wallets with a + # `wallets_configuration` specification. + # + # @param wallets_configuration [Array] Configuration for the wallets on this account. + # + # @param display_name [String] An optional display name for the account. + end + end +end diff --git a/lib/privy/models/create_account_input.rb b/lib/privy/models/create_account_input.rb new file mode 100644 index 0000000..9040da2 --- /dev/null +++ b/lib/privy/models/create_account_input.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # Input for creating a digital asset account. + module CreateAccountInput + extend Privy::Internal::Type::Union + + # Input for creating a digital asset account from new wallets with a `wallets_configuration` specification. + variant -> { Privy::CreateAccountFromWalletsConfigurationInput } + + # Input for creating a digital asset account from existing wallets with a `wallet_ids` parameter. + variant -> { Privy::CreateAccountFromWalletIDsInput } + + # @!method self.variants + # @return [Array(Privy::Models::CreateAccountFromWalletsConfigurationInput, Privy::Models::CreateAccountFromWalletIDsInput)] + end + end +end diff --git a/lib/privy/models/create_or_update_fiat_customer_request_input.rb b/lib/privy/models/create_or_update_fiat_customer_request_input.rb new file mode 100644 index 0000000..acabbbd --- /dev/null +++ b/lib/privy/models/create_or_update_fiat_customer_request_input.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class CreateOrUpdateFiatCustomerRequestInput < Privy::Internal::Type::BaseModel + # @!attribute has_accepted_terms + # + # @return [Boolean] + required :has_accepted_terms, Privy::Internal::Type::Boolean + + # @!attribute provider + # Valid set of onramp providers + # + # @return [Symbol, Privy::Models::OnrampProvider] + required :provider, enum: -> { Privy::OnrampProvider } + + # @!attribute kyc_redirect_url + # + # @return [String, nil] + optional :kyc_redirect_url, String + + # @!method initialize(has_accepted_terms:, provider:, kyc_redirect_url: nil) + # The request input for creating (or updating) a native onramp provider customer. + # + # @param has_accepted_terms [Boolean] + # + # @param provider [Symbol, Privy::Models::OnrampProvider] Valid set of onramp providers + # + # @param kyc_redirect_url [String] + end + end +end diff --git a/lib/privy/models/create_organization_secret_response.rb b/lib/privy/models/create_organization_secret_response.rb new file mode 100644 index 0000000..8e215a6 --- /dev/null +++ b/lib/privy/models/create_organization_secret_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class CreateOrganizationSecretResponse < Privy::Models::OrganizationSecretView + # @!attribute organization_secret + # The plaintext organization secret. Returned only at creation time. + # + # @return [String] + required :organization_secret, String + + # @!method initialize(organization_secret:) + # Response returned when creating a new organization secret. + # + # @param organization_secret [String] The plaintext organization secret. Returned only at creation time. + end + end +end diff --git a/lib/privy/models/cross_app_connection.rb b/lib/privy/models/cross_app_connection.rb new file mode 100644 index 0000000..5d4064b --- /dev/null +++ b/lib/privy/models/cross_app_connection.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class CrossAppConnection < Privy::Internal::Type::BaseModel + # @!attribute provider_app_custom_api_url + # + # @return [String, nil] + required :provider_app_custom_api_url, String, nil?: true + + # @!attribute provider_app_custom_auth_authorize_url + # + # @return [String, nil] + required :provider_app_custom_auth_authorize_url, String, nil?: true + + # @!attribute provider_app_custom_auth_transact_url + # + # @return [String, nil] + required :provider_app_custom_auth_transact_url, String, nil?: true + + # @!attribute provider_app_icon_url + # + # @return [String, nil] + required :provider_app_icon_url, String, nil?: true + + # @!attribute provider_app_id + # + # @return [String] + required :provider_app_id, String + + # @!attribute provider_app_name + # + # @return [String] + required :provider_app_name, String + + # @!attribute read_only + # + # @return [Boolean] + required :read_only, Privy::Internal::Type::Boolean + + # @!method initialize(provider_app_custom_api_url:, provider_app_custom_auth_authorize_url:, provider_app_custom_auth_transact_url:, provider_app_icon_url:, provider_app_id:, provider_app_name:, read_only:) + # A cross-app connection definition + # + # @param provider_app_custom_api_url [String, nil] + # @param provider_app_custom_auth_authorize_url [String, nil] + # @param provider_app_custom_auth_transact_url [String, nil] + # @param provider_app_icon_url [String, nil] + # @param provider_app_id [String] + # @param provider_app_name [String] + # @param read_only [Boolean] + end + end +end diff --git a/lib/privy/models/cross_app_connections_response.rb b/lib/privy/models/cross_app_connections_response.rb new file mode 100644 index 0000000..2e8385f --- /dev/null +++ b/lib/privy/models/cross_app_connections_response.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class CrossAppConnectionsResponse < Privy::Internal::Type::BaseModel + # @!attribute connections + # + # @return [Array] + required :connections, -> { Privy::Internal::Type::ArrayOf[Privy::CrossAppConnection] } + + # @!attribute data_classification + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + # + # @return [Symbol, Privy::Models::CrossAppConnectionsResponse::DataClassification] + required :data_classification, enum: -> { Privy::CrossAppConnectionsResponse::DataClassification } + + # @!method initialize(connections:, data_classification:) + # Some parameter documentations has been truncated, see + # {Privy::Models::CrossAppConnectionsResponse} for more details. + # + # The response for getting the list of cross-app connections. + # + # @param connections [Array] + # + # @param data_classification [Symbol, Privy::Models::CrossAppConnectionsResponse::DataClassification] Indicates that this response contains only publicly accessible data, not a privi + + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + # + # @see Privy::Models::CrossAppConnectionsResponse#data_classification + module DataClassification + extend Privy::Internal::Type::Enum + + PUBLIC = :public + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/cross_app_embedded_wallet.rb b/lib/privy/models/cross_app_embedded_wallet.rb new file mode 100644 index 0000000..0c31238 --- /dev/null +++ b/lib/privy/models/cross_app_embedded_wallet.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class CrossAppEmbeddedWallet < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # An embedded wallet associated with a cross-app account. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/cross_app_smart_wallet.rb b/lib/privy/models/cross_app_smart_wallet.rb new file mode 100644 index 0000000..a559f46 --- /dev/null +++ b/lib/privy/models/cross_app_smart_wallet.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class CrossAppSmartWallet < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # A smart wallet associated with a cross-app account. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/crypto_currency_code.rb b/lib/privy/models/crypto_currency_code.rb new file mode 100644 index 0000000..907fc6b --- /dev/null +++ b/lib/privy/models/crypto_currency_code.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + CryptoCurrencyCode = String + end +end diff --git a/lib/privy/models/currency.rb b/lib/privy/models/currency.rb new file mode 100644 index 0000000..e3e4007 --- /dev/null +++ b/lib/privy/models/currency.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class Currency < Privy::Internal::Type::BaseModel + # @!attribute chain + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @return [String] + required :chain, String + + # @!attribute asset + # A currency asset type. + # + # @return [Symbol, Privy::Models::CurrencyAsset, nil] + optional :asset, enum: -> { Privy::CurrencyAsset } + + # @!method initialize(chain:, asset: nil) + # A crypto currency identified by a CAIP-2 chain ID and optional asset. + # + # @param chain [String] A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @param asset [Symbol, Privy::Models::CurrencyAsset] A currency asset type. + end + end +end diff --git a/lib/privy/models/currency_amount.rb b/lib/privy/models/currency_amount.rb new file mode 100644 index 0000000..49de9cb --- /dev/null +++ b/lib/privy/models/currency_amount.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Privy + module Models + class CurrencyAmount < Privy::Internal::Type::BaseModel + # @!attribute currency + # Currency code + # + # @return [Symbol, Privy::Models::CurrencyAmount::Currency] + required :currency, enum: -> { Privy::CurrencyAmount::Currency } + + # @!attribute value + # The monetary value as a string. + # + # @return [String] + required :value, String + + # @!method initialize(currency:, value:) + # A monetary value with its currency denomination. + # + # @param currency [Symbol, Privy::Models::CurrencyAmount::Currency] Currency code + # + # @param value [String] The monetary value as a string. + + # Currency code + # + # @see Privy::Models::CurrencyAmount#currency + module Currency + extend Privy::Internal::Type::Enum + + USD = :usd + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/currency_asset.rb b/lib/privy/models/currency_asset.rb new file mode 100644 index 0000000..07a1c62 --- /dev/null +++ b/lib/privy/models/currency_asset.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # A currency asset type. + module CurrencyAsset + extend Privy::Internal::Type::Enum + + NATIVE_CURRENCY = :"native-currency" + USDC = :USDC + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/curve_signing_chain_type.rb b/lib/privy/models/curve_signing_chain_type.rb new file mode 100644 index 0000000..5606c36 --- /dev/null +++ b/lib/privy/models/curve_signing_chain_type.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + # The wallet chain types that support curve-based signing. + module CurveSigningChainType + extend Privy::Internal::Type::Enum + + COSMOS = :cosmos + STELLAR = :stellar + SUI = :sui + APTOS = :aptos + MOVEMENT = :movement + TRON = :tron + BITCOIN_SEGWIT = :"bitcoin-segwit" + BITCOIN_TAPROOT = :"bitcoin-taproot" + PEARL = :pearl + NEAR = :near + TON = :ton + STARKNET = :starknet + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/curve_type.rb b/lib/privy/models/curve_type.rb new file mode 100644 index 0000000..af0f576 --- /dev/null +++ b/lib/privy/models/curve_type.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # The cryptographic curve type used by the wallet. + module CurveType + extend Privy::Internal::Type::Enum + + SECP256K1 = :secp256k1 + ED25519 = :ed25519 + STARKNET = :starknet + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/custodial_wallet.rb b/lib/privy/models/custodial_wallet.rb new file mode 100644 index 0000000..c82043a --- /dev/null +++ b/lib/privy/models/custodial_wallet.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Privy + module Models + class CustodialWallet < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_type + # The chain type of the custodial wallet. + # + # @return [Symbol, Privy::Models::CustodialWalletChainType] + required :chain_type, enum: -> { Privy::CustodialWalletChainType } + + # @!attribute custody + # Information about the custodian managing this wallet. + # + # @return [Privy::Models::WalletCustodian] + required :custody, -> { Privy::WalletCustodian } + + # @!attribute owner_id + # + # @return [String, nil] + required :owner_id, String, nil?: true + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem] } + + # @!attribute policy_ids + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(id:, address:, chain_type:, custody:, owner_id:, additional_signers: nil, policy_ids: nil) + # Information about a custodial wallet. + # + # @param id [String] + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::CustodialWalletChainType] The chain type of the custodial wallet. + # + # @param custody [Privy::Models::WalletCustodian] Information about the custodian managing this wallet. + # + # @param owner_id [String, nil] + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param policy_ids [Array] + end + end +end diff --git a/lib/privy/models/custodial_wallet_chain_type.rb b/lib/privy/models/custodial_wallet_chain_type.rb new file mode 100644 index 0000000..23e4bdf --- /dev/null +++ b/lib/privy/models/custodial_wallet_chain_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The chain type of the custodial wallet. + module CustodialWalletChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/custodial_wallet_create_input.rb b/lib/privy/models/custodial_wallet_create_input.rb new file mode 100644 index 0000000..4f686b4 --- /dev/null +++ b/lib/privy/models/custodial_wallet_create_input.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Privy + module Models + class CustodialWalletCreateInput < Privy::Internal::Type::BaseModel + # @!attribute chain_type + # The chain type of the custodial wallet. + # + # @return [Symbol, Privy::Models::CustodialWalletChainType] + required :chain_type, enum: -> { Privy::CustodialWalletChainType } + + # @!attribute provider + # The provider of the custodial wallet. + # + # @return [Symbol, Privy::Models::CustodialWalletProvider] + required :provider, enum: -> { Privy::CustodialWalletProvider } + + # @!attribute provider_user_id + # The resource ID of the beneficiary of the custodial wallet, given by the + # licensing provider. + # + # @return [String] + required :provider_user_id, String + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::AdditionalSignerItemInput] } + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute policy_ids + # An optional list of up to one policy ID to enforce on the wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(chain_type:, provider:, provider_user_id:, additional_signers: nil, owner: nil, policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::CustodialWalletCreateInput} for more details. + # + # The input for creating a custodial wallet. + # + # @param chain_type [Symbol, Privy::Models::CustodialWalletChainType] The chain type of the custodial wallet. + # + # @param provider [Symbol, Privy::Models::CustodialWalletProvider] The provider of the custodial wallet. + # + # @param provider_user_id [String] The resource ID of the beneficiary of the custodial wallet, given by the licensi + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + end + end +end diff --git a/lib/privy/models/custodial_wallet_provider.rb b/lib/privy/models/custodial_wallet_provider.rb new file mode 100644 index 0000000..1b92a8f --- /dev/null +++ b/lib/privy/models/custodial_wallet_provider.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Privy + module Models + # The provider of the custodial wallet. + module CustodialWalletProvider + extend Privy::Internal::Type::Enum + + BRIDGE = :bridge + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/custom_jwt_authenticate_request_body.rb b/lib/privy/models/custom_jwt_authenticate_request_body.rb new file mode 100644 index 0000000..f21508b --- /dev/null +++ b/lib/privy/models/custom_jwt_authenticate_request_body.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class CustomJwtAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(token: nil, mode: nil) + # The request body for authenticating with a custom JWT. + # + # @param token [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/custom_jwt_link_request_body.rb b/lib/privy/models/custom_jwt_link_request_body.rb new file mode 100644 index 0000000..0da1c1a --- /dev/null +++ b/lib/privy/models/custom_jwt_link_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class CustomJwtLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!method initialize(token: nil) + # The request body for linking a custom JWT account. + # + # @param token [String] + end + end +end diff --git a/lib/privy/models/custom_metadata.rb b/lib/privy/models/custom_metadata.rb new file mode 100644 index 0000000..ab19443 --- /dev/null +++ b/lib/privy/models/custom_metadata.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + module CustomMetadataItem + extend Privy::Internal::Type::Union + + variant String + + variant Float + + variant Privy::Internal::Type::Boolean + + # @!method self.variants + # @return [Array(String, Float, Boolean)] + end + + # @type [Privy::Internal::Type::Converter] + CustomMetadata = Privy::Internal::Type::HashOf[union: -> { Privy::CustomMetadataItem }] + end +end diff --git a/lib/privy/models/custom_oauth_provider_id.rb b/lib/privy/models/custom_oauth_provider_id.rb new file mode 100644 index 0000000..a7abdf5 --- /dev/null +++ b/lib/privy/models/custom_oauth_provider_id.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + CustomOAuthProviderID = String + end +end diff --git a/lib/privy/models/custom_token_transfer_source.rb b/lib/privy/models/custom_token_transfer_source.rb new file mode 100644 index 0000000..3570fd9 --- /dev/null +++ b/lib/privy/models/custom_token_transfer_source.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class CustomTokenTransferSource < Privy::Internal::Type::BaseModel + # @!attribute amount + # Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 + # USDC, "0.01" for 0.01 ETH). Not in the smallest on-chain unit (wei, lamports, + # etc.). + # + # @return [String] + required :amount, String + + # @!attribute asset_address + # The token contract address (EVM) or mint address (Solana) of the asset to + # transfer. + # + # @return [String] + required :asset_address, String + + # @!attribute chain + # The blockchain network on which to perform the transfer. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and their + # respective testnets. + # + # @return [String] + required :chain, String + + # @!method initialize(amount:, asset_address:, chain:) + # Some parameter documentations has been truncated, see + # {Privy::Models::CustomTokenTransferSource} for more details. + # + # Source for a transfer identified by a token contract address (EVM) or mint + # address (Solana). Use this variant for tokens that are not first-class assets. + # + # @param amount [String] Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 USDC + # + # @param asset_address [String] The token contract address (EVM) or mint address (Solana) of the asset to transf + # + # @param chain [String] The blockchain network on which to perform the transfer. Supported chains includ + end + end +end diff --git a/lib/privy/models/earn_asset.rb b/lib/privy/models/earn_asset.rb new file mode 100644 index 0000000..7c0f8c0 --- /dev/null +++ b/lib/privy/models/earn_asset.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnAsset < Privy::Internal::Type::BaseModel + # @!attribute address + # Token contract address. + # + # @return [String] + required :address, String + + # @!attribute decimals + # Number of decimals for the asset (e.g. 6 for USDC). + # + # @return [Integer] + required :decimals, Integer + + # @!attribute symbol + # Lowercase token symbol (e.g. "usdc"). + # + # @return [String] + required :symbol, String + + # @!method initialize(address:, decimals:, symbol:) + # Asset metadata for an earn vault position. + # + # @param address [String] Token contract address. + # + # @param decimals [Integer] Number of decimals for the asset (e.g. 6 for USDC). + # + # @param symbol [String] Lowercase token symbol (e.g. "usdc"). + end + end +end diff --git a/lib/privy/models/earn_deposit_action_response.rb b/lib/privy/models/earn_deposit_action_response.rb new file mode 100644 index 0000000..a8e3e71 --- /dev/null +++ b/lib/privy/models/earn_deposit_action_response.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnDepositActionResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # The ID of the wallet action. + # + # @return [String] + required :id, String + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute created_at + # ISO 8601 timestamp of when the wallet action was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute raw_amount + # Base-unit amount of asset deposited (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute share_amount + # Vault shares received in base units. Populated after on-chain confirmation. + # + # @return [String, nil] + required :share_amount, String, nil?: true + + # @!attribute status + # Status of a wallet action. + # + # @return [Symbol, Privy::Models::WalletActionStatus] + required :status, enum: -> { Privy::WalletActionStatus } + + # @!attribute type + # + # @return [Symbol, Privy::Models::EarnDepositActionResponse::Type] + required :type, enum: -> { Privy::EarnDepositActionResponse::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!attribute steps + # The steps of the wallet action. Only returned if `?include=steps` is provided. + # + # @return [Array, nil] + optional :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!method initialize(id:, asset_address:, caip2:, created_at:, raw_amount:, share_amount:, status:, type:, vault_address:, vault_id:, wallet_id:, amount: nil, asset: nil, decimals: nil, failure_reason: nil, steps: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EarnDepositActionResponse} for more details. + # + # Response for an earn deposit action. + # + # @param id [String] The ID of the wallet action. + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param created_at [Time] ISO 8601 timestamp of when the wallet action was created. + # + # @param raw_amount [String] Base-unit amount of asset deposited (e.g. "1500000"). + # + # @param share_amount [String, nil] Vault shares received in base units. Populated after on-chain confirmation. + # + # @param status [Symbol, Privy::Models::WalletActionStatus] Status of a wallet action. + # + # @param type [Symbol, Privy::Models::EarnDepositActionResponse::Type] + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param steps [Array] The steps of the wallet action. Only returned if `?include=steps` is provided. + + # @see Privy::Models::EarnDepositActionResponse#type + module Type + extend Privy::Internal::Type::Enum + + EARN_DEPOSIT = :earn_deposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/earn_deposit_request_body.rb b/lib/privy/models/earn_deposit_request_body.rb new file mode 100644 index 0000000..cbe19be --- /dev/null +++ b/lib/privy/models/earn_deposit_request_body.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnDepositRequestBody < Privy::Internal::Type::BaseModel + # @!attribute vault_id + # The ID of the vault to deposit into. + # + # @return [String] + required :vault_id, String + + # @!attribute amount + # Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one + # of `amount` or `raw_amount` must be provided. + # + # @return [String, nil] + optional :amount, String + + # @!attribute raw_amount + # Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6 + # decimals). Exactly one of `amount` or `raw_amount` must be provided. + # + # @return [String, nil] + optional :raw_amount, String + + # @!method initialize(vault_id:, amount: nil, raw_amount: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EarnDepositRequestBody} for more details. + # + # Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or + # `raw_amount` must be provided. + # + # @param vault_id [String] The ID of the vault to deposit into. + # + # @param amount [String] Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one + # + # @param raw_amount [String] Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6 decimals) + end + end +end diff --git a/lib/privy/models/earn_incentive_claim_action_response.rb b/lib/privy/models/earn_incentive_claim_action_response.rb new file mode 100644 index 0000000..e85dde7 --- /dev/null +++ b/lib/privy/models/earn_incentive_claim_action_response.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnIncentiveClaimActionResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # The ID of the wallet action. + # + # @return [String] + required :id, String + + # @!attribute chain + # EVM chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :chain, String + + # @!attribute created_at + # ISO 8601 timestamp of when the wallet action was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute rewards + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @return [Array, nil] + required :rewards, + -> { + Privy::Internal::Type::ArrayOf[Privy::EarnIncetiveClaimRewardEntry] + }, + nil?: true + + # @!attribute status + # Status of a wallet action. + # + # @return [Symbol, Privy::Models::WalletActionStatus] + required :status, enum: -> { Privy::WalletActionStatus } + + # @!attribute type + # + # @return [Symbol, Privy::Models::EarnIncentiveClaimActionResponse::Type] + required :type, enum: -> { Privy::EarnIncentiveClaimActionResponse::Type } + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!attribute steps + # The steps of the wallet action. Only returned if `?include=steps` is provided. + # + # @return [Array, nil] + optional :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!method initialize(id:, chain:, created_at:, rewards:, status:, type:, wallet_id:, failure_reason: nil, steps: nil) + # Response for an earn incentive claim action. + # + # @param id [String] The ID of the wallet action. + # + # @param chain [String] EVM chain name (e.g. "base", "ethereum"). + # + # @param created_at [Time] ISO 8601 timestamp of when the wallet action was created. + # + # @param rewards [Array, nil] Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @param status [Symbol, Privy::Models::WalletActionStatus] Status of a wallet action. + # + # @param type [Symbol, Privy::Models::EarnIncentiveClaimActionResponse::Type] + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param steps [Array] The steps of the wallet action. Only returned if `?include=steps` is provided. + + # @see Privy::Models::EarnIncentiveClaimActionResponse#type + module Type + extend Privy::Internal::Type::Enum + + EARN_INCENTIVE_CLAIM = :earn_incentive_claim + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/earn_incentive_claim_request_body.rb b/lib/privy/models/earn_incentive_claim_request_body.rb new file mode 100644 index 0000000..6f0e802 --- /dev/null +++ b/lib/privy/models/earn_incentive_claim_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnIncentiveClaimRequestBody < Privy::Internal::Type::BaseModel + # @!attribute chain + # The blockchain network on which to perform the incentive claim. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along + # with their respective testnets. + # + # @return [String] + required :chain, String + + # @!method initialize(chain:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EarnIncentiveClaimRequestBody} for more details. + # + # Input for claiming incentive rewards. + # + # @param chain [String] The blockchain network on which to perform the incentive claim. Supported chains + end + end +end diff --git a/lib/privy/models/earn_incetive_claim_reward_entry.rb b/lib/privy/models/earn_incetive_claim_reward_entry.rb new file mode 100644 index 0000000..34936b8 --- /dev/null +++ b/lib/privy/models/earn_incetive_claim_reward_entry.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnIncetiveClaimRewardEntry < Privy::Internal::Type::BaseModel + # @!attribute amount + # Claimable amount in base units. + # + # @return [String] + required :amount, String + + # @!attribute token_address + # Address of the reward token. + # + # @return [String] + required :token_address, String + + # @!attribute token_symbol + # Symbol of the reward token (e.g. "MORPHO"). + # + # @return [String] + required :token_symbol, String + + # @!attribute token_decimals + # Number of decimal places for the reward token. + # + # @return [Integer, nil] + optional :token_decimals, Integer + + # @!method initialize(amount:, token_address:, token_symbol:, token_decimals: nil) + # A specific reward token and amount associated with an earn incentive claim. + # + # @param amount [String] Claimable amount in base units. + # + # @param token_address [String] Address of the reward token. + # + # @param token_symbol [String] Symbol of the reward token (e.g. "MORPHO"). + # + # @param token_decimals [Integer] Number of decimal places for the reward token. + end + end +end diff --git a/lib/privy/models/earn_withdraw_action_response.rb b/lib/privy/models/earn_withdraw_action_response.rb new file mode 100644 index 0000000..11e2336 --- /dev/null +++ b/lib/privy/models/earn_withdraw_action_response.rb @@ -0,0 +1,153 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnWithdrawActionResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # The ID of the wallet action. + # + # @return [String] + required :id, String + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute created_at + # ISO 8601 timestamp of when the wallet action was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute raw_amount + # Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute share_amount + # Vault shares burned in base units. Populated after on-chain confirmation. + # + # @return [String, nil] + required :share_amount, String, nil?: true + + # @!attribute status + # Status of a wallet action. + # + # @return [Symbol, Privy::Models::WalletActionStatus] + required :status, enum: -> { Privy::WalletActionStatus } + + # @!attribute type + # + # @return [Symbol, Privy::Models::EarnWithdrawActionResponse::Type] + required :type, enum: -> { Privy::EarnWithdrawActionResponse::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!attribute steps + # The steps of the wallet action. Only returned if `?include=steps` is provided. + # + # @return [Array, nil] + optional :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!method initialize(id:, asset_address:, caip2:, created_at:, raw_amount:, share_amount:, status:, type:, vault_address:, vault_id:, wallet_id:, amount: nil, asset: nil, decimals: nil, failure_reason: nil, steps: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EarnWithdrawActionResponse} for more details. + # + # Response for an earn withdraw action. + # + # @param id [String] The ID of the wallet action. + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param created_at [Time] ISO 8601 timestamp of when the wallet action was created. + # + # @param raw_amount [String] Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @param share_amount [String, nil] Vault shares burned in base units. Populated after on-chain confirmation. + # + # @param status [Symbol, Privy::Models::WalletActionStatus] Status of a wallet action. + # + # @param type [Symbol, Privy::Models::EarnWithdrawActionResponse::Type] + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param steps [Array] The steps of the wallet action. Only returned if `?include=steps` is provided. + + # @see Privy::Models::EarnWithdrawActionResponse#type + module Type + extend Privy::Internal::Type::Enum + + EARN_WITHDRAW = :earn_withdraw + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/earn_withdraw_request_body.rb b/lib/privy/models/earn_withdraw_request_body.rb new file mode 100644 index 0000000..100dbeb --- /dev/null +++ b/lib/privy/models/earn_withdraw_request_body.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Models + class EarnWithdrawRequestBody < Privy::Internal::Type::BaseModel + # @!attribute vault_id + # The ID of the vault to withdraw from. + # + # @return [String] + required :vault_id, String + + # @!attribute amount + # Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one + # of `amount` or `raw_amount` must be provided. + # + # @return [String, nil] + optional :amount, String + + # @!attribute raw_amount + # Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6 + # decimals). Exactly one of `amount` or `raw_amount` must be provided. + # + # @return [String, nil] + optional :raw_amount, String + + # @!method initialize(vault_id:, amount: nil, raw_amount: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EarnWithdrawRequestBody} for more details. + # + # Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or + # `raw_amount` must be provided. + # + # @param vault_id [String] The ID of the vault to withdraw from. + # + # @param amount [String] Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one + # + # @param raw_amount [String] Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6 decimals + end + end +end diff --git a/lib/privy/models/email_domain.rb b/lib/privy/models/email_domain.rb new file mode 100644 index 0000000..73aeda8 --- /dev/null +++ b/lib/privy/models/email_domain.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + EmailDomain = String + end +end diff --git a/lib/privy/models/email_domain_invite_input.rb b/lib/privy/models/email_domain_invite_input.rb new file mode 100644 index 0000000..3e86733 --- /dev/null +++ b/lib/privy/models/email_domain_invite_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EmailDomainInviteInput < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::EmailDomainInviteInput::Type] + required :type, enum: -> { Privy::EmailDomainInviteInput::Type } + + # @!attribute value + # An email domain. + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Allowlist invite input for an email domain. + # + # @param type [Symbol, Privy::Models::EmailDomainInviteInput::Type] + # + # @param value [String] An email domain. + + # @see Privy::Models::EmailDomainInviteInput#type + module Type + extend Privy::Internal::Type::Enum + + EMAIL_DOMAIN = :emailDomain + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/email_invite_input.rb b/lib/privy/models/email_invite_input.rb new file mode 100644 index 0000000..44086ba --- /dev/null +++ b/lib/privy/models/email_invite_input.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class EmailInviteInput < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::EmailInviteInput::Type] + required :type, enum: -> { Privy::EmailInviteInput::Type } + + # @!attribute value + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Allowlist invite input for an email address. + # + # @param type [Symbol, Privy::Models::EmailInviteInput::Type] + # @param value [String] + + # @see Privy::Models::EmailInviteInput#type + module Type + extend Privy::Internal::Type::Enum + + EMAIL = :email + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/embedded_wallet_chain_config.rb b/lib/privy/models/embedded_wallet_chain_config.rb new file mode 100644 index 0000000..c007aec --- /dev/null +++ b/lib/privy/models/embedded_wallet_chain_config.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EmbeddedWalletChainConfig < Privy::Internal::Type::BaseModel + # @!attribute create_on_login + # Whether to create embedded wallets on login. + # + # @return [Symbol, Privy::Models::EmbeddedWalletCreateOnLogin] + required :create_on_login, enum: -> { Privy::EmbeddedWalletCreateOnLogin } + + # @!method initialize(create_on_login:) + # Chain-specific configuration for embedded wallets. + # + # @param create_on_login [Symbol, Privy::Models::EmbeddedWalletCreateOnLogin] Whether to create embedded wallets on login. + end + end +end diff --git a/lib/privy/models/embedded_wallet_config_schema.rb b/lib/privy/models/embedded_wallet_config_schema.rb new file mode 100644 index 0000000..1a9bf5f --- /dev/null +++ b/lib/privy/models/embedded_wallet_config_schema.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EmbeddedWalletConfigSchema < Privy::Models::EmbeddedWalletInputSchema + # @!attribute mode + # The mode for embedded wallets. + # + # @return [Symbol, Privy::Models::EmbeddedWalletMode] + required :mode, enum: -> { Privy::EmbeddedWalletMode } + + # @!method initialize(mode:) + # Configuration for embedded wallets including the mode. + # + # @param mode [Symbol, Privy::Models::EmbeddedWalletMode] The mode for embedded wallets. + end + end +end diff --git a/lib/privy/models/embedded_wallet_create_on_login.rb b/lib/privy/models/embedded_wallet_create_on_login.rb new file mode 100644 index 0000000..90f8f98 --- /dev/null +++ b/lib/privy/models/embedded_wallet_create_on_login.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # Whether to create embedded wallets on login. + module EmbeddedWalletCreateOnLogin + extend Privy::Internal::Type::Enum + + USERS_WITHOUT_WALLETS = :"users-without-wallets" + ALL_USERS = :"all-users" + OFF = :off + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/embedded_wallet_creation_input.rb b/lib/privy/models/embedded_wallet_creation_input.rb new file mode 100644 index 0000000..f8e97aa --- /dev/null +++ b/lib/privy/models/embedded_wallet_creation_input.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + class EmbeddedWalletCreationInput < Privy::Internal::Type::BaseModel + # @!attribute wallets + # Wallets to create. + # + # @return [Array, nil] + optional :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::WalletCreationInput] } + + # @!method initialize(wallets: nil) + # The fields describing embedded wallet creation, used for user import and + # embedded wallet generation. + # + # @param wallets [Array] Wallets to create. + end + end +end diff --git a/lib/privy/models/embedded_wallet_input_schema.rb b/lib/privy/models/embedded_wallet_input_schema.rb new file mode 100644 index 0000000..ff529d5 --- /dev/null +++ b/lib/privy/models/embedded_wallet_input_schema.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Privy + module Models + class EmbeddedWalletInputSchema < Privy::Internal::Type::BaseModel + # @!attribute create_on_login + # Whether to create embedded wallets on login. + # + # @return [Symbol, Privy::Models::EmbeddedWalletCreateOnLogin] + required :create_on_login, enum: -> { Privy::EmbeddedWalletCreateOnLogin } + + # @!attribute ethereum + # Chain-specific configuration for embedded wallets. + # + # @return [Privy::Models::EmbeddedWalletChainConfig] + required :ethereum, -> { Privy::EmbeddedWalletChainConfig } + + # @!attribute solana + # Chain-specific configuration for embedded wallets. + # + # @return [Privy::Models::EmbeddedWalletChainConfig] + required :solana, -> { Privy::EmbeddedWalletChainConfig } + + # @!attribute user_owned_recovery_options + # + # @return [Array] + required :user_owned_recovery_options, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::UserOwnedRecoveryOption] } + + # @!attribute require_user_owned_recovery_on_create + # + # @return [Boolean, nil] + optional :require_user_owned_recovery_on_create, Privy::Internal::Type::Boolean + + # @!attribute require_user_password_on_create + # + # @return [Boolean, nil] + optional :require_user_password_on_create, Privy::Internal::Type::Boolean + + # @!method initialize(create_on_login:, ethereum:, solana:, user_owned_recovery_options:, require_user_owned_recovery_on_create: nil, require_user_password_on_create: nil) + # Input configuration for embedded wallets. + # + # @param create_on_login [Symbol, Privy::Models::EmbeddedWalletCreateOnLogin] Whether to create embedded wallets on login. + # + # @param ethereum [Privy::Models::EmbeddedWalletChainConfig] Chain-specific configuration for embedded wallets. + # + # @param solana [Privy::Models::EmbeddedWalletChainConfig] Chain-specific configuration for embedded wallets. + # + # @param user_owned_recovery_options [Array] + # + # @param require_user_owned_recovery_on_create [Boolean] + # + # @param require_user_password_on_create [Boolean] + end + end +end diff --git a/lib/privy/models/embedded_wallet_mode.rb b/lib/privy/models/embedded_wallet_mode.rb new file mode 100644 index 0000000..822ff0f --- /dev/null +++ b/lib/privy/models/embedded_wallet_mode.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The mode for embedded wallets. + module EmbeddedWalletMode + extend Privy::Internal::Type::Enum + + LEGACY_EMBEDDED_WALLETS_ONLY = :"legacy-embedded-wallets-only" + USER_CONTROLLED_SERVER_WALLETS_ONLY = :"user-controlled-server-wallets-only" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/embedded_wallet_recovery_method.rb b/lib/privy/models/embedded_wallet_recovery_method.rb new file mode 100644 index 0000000..20940bd --- /dev/null +++ b/lib/privy/models/embedded_wallet_recovery_method.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # The method used to recover an embedded wallet account. + module EmbeddedWalletRecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY = :privy + USER_PASSCODE = :"user-passcode" + GOOGLE_DRIVE = :"google-drive" + ICLOUD = :icloud + RECOVERY_ENCRYPTION_KEY = :"recovery-encryption-key" + PRIVY_V2 = :"privy-v2" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/ethereum_7702_authorization_condition.rb b/lib/privy/models/ethereum_7702_authorization_condition.rb new file mode 100644 index 0000000..24492a3 --- /dev/null +++ b/lib/privy/models/ethereum_7702_authorization_condition.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + class Ethereum7702AuthorizationCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::Ethereum7702AuthorizationCondition::Field] + required :field, enum: -> { Privy::Ethereum7702AuthorizationCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::Ethereum7702AuthorizationCondition::FieldSource] + required :field_source, enum: -> { Privy::Ethereum7702AuthorizationCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::Ethereum7702AuthorizationCondition} for more details. + # + # Allowed contract addresses for eth_sign7702Authorization requests. + # + # @param field [Symbol, Privy::Models::Ethereum7702AuthorizationCondition::Field] + # + # @param field_source [Symbol, Privy::Models::Ethereum7702AuthorizationCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::Ethereum7702AuthorizationCondition#field + module Field + extend Privy::Internal::Type::Enum + + CONTRACT = :contract + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::Ethereum7702AuthorizationCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_7702_AUTHORIZATION = :ethereum_7702_authorization + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_calldata_condition.rb b/lib/privy/models/ethereum_calldata_condition.rb new file mode 100644 index 0000000..452154e --- /dev/null +++ b/lib/privy/models/ethereum_calldata_condition.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumCalldataCondition < Privy::Internal::Type::BaseModel + # @!attribute abi + # A Solidity ABI definition for decoding smart contract calldata. + # + # @return [Array] + required :abi, -> { Privy::Internal::Type::ArrayOf[Privy::AbiSchemaItem] } + + # @!attribute field + # + # @return [String] + required :field, String + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::EthereumCalldataCondition::FieldSource] + required :field_source, enum: -> { Privy::EthereumCalldataCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(abi:, field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumCalldataCondition} for more details. + # + # The decoded calldata in a smart contract interaction as the smart contract + # method's parameters. Note that 'ethereum_calldata' conditions must contain an + # abi parameter with the JSON ABI of the smart contract. + # + # @param abi [Array] A Solidity ABI definition for decoding smart contract calldata. + # + # @param field [String] + # + # @param field_source [Symbol, Privy::Models::EthereumCalldataCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::EthereumCalldataCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_CALLDATA = :ethereum_calldata + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_earn_position_query.rb b/lib/privy/models/ethereum_earn_position_query.rb new file mode 100644 index 0000000..80025d8 --- /dev/null +++ b/lib/privy/models/ethereum_earn_position_query.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumEarnPositionQuery < Privy::Internal::Type::BaseModel + # @!attribute vault_id + # The vault ID to get position for. + # + # @return [String] + required :vault_id, String + + # @!method initialize(vault_id:) + # Query parameters for fetching an earn vault position. + # + # @param vault_id [String] The vault ID to get position for. + end + end +end diff --git a/lib/privy/models/ethereum_earn_position_response.rb b/lib/privy/models/ethereum_earn_position_response.rb new file mode 100644 index 0000000..2b7322c --- /dev/null +++ b/lib/privy/models/ethereum_earn_position_response.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumEarnPositionResponse < Privy::Internal::Type::BaseModel + # @!attribute asset + # Asset metadata for an earn vault position. + # + # @return [Privy::Models::EarnAsset] + required :asset, -> { Privy::EarnAsset } + + # @!attribute assets_in_vault + # Current asset value in the vault (realtime from ERC-4626), in smallest unit. + # + # @return [String] + required :assets_in_vault, String + + # @!attribute shares_in_vault + # Current vault shares held (realtime from ERC-4626). + # + # @return [String] + required :shares_in_vault, String + + # @!attribute total_deposited + # Total amount deposited into the vault, in smallest unit. + # + # @return [String] + required :total_deposited, String + + # @!attribute total_withdrawn + # Total amount withdrawn from the vault, in smallest unit. + # + # @return [String] + required :total_withdrawn, String + + # @!method initialize(asset:, assets_in_vault:, shares_in_vault:, total_deposited:, total_withdrawn:) + # A wallet's position in an earn vault. + # + # @param asset [Privy::Models::EarnAsset] Asset metadata for an earn vault position. + # + # @param assets_in_vault [String] Current asset value in the vault (realtime from ERC-4626), in smallest unit. + # + # @param shares_in_vault [String] Current vault shares held (realtime from ERC-4626). + # + # @param total_deposited [String] Total amount deposited into the vault, in smallest unit. + # + # @param total_withdrawn [String] Total amount withdrawn from the vault, in smallest unit. + end + end +end diff --git a/lib/privy/models/ethereum_earn_provider.rb b/lib/privy/models/ethereum_earn_provider.rb new file mode 100644 index 0000000..c8d4c94 --- /dev/null +++ b/lib/privy/models/ethereum_earn_provider.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Supported earn provider protocols. + module EthereumEarnProvider + extend Privy::Internal::Type::Enum + + MORPHO = :morpho + AAVE = :aave + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/ethereum_earn_vault_details_response.rb b/lib/privy/models/ethereum_earn_vault_details_response.rb new file mode 100644 index 0000000..13b605f --- /dev/null +++ b/lib/privy/models/ethereum_earn_vault_details_response.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumEarnVaultDetailsResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # Vault identifier. + # + # @return [String] + required :id, String + + # @!attribute app_apy + # Annual percentage yield earned by the app from fee wrapper fees, in basis + # points. + # + # @return [Float, nil] + required :app_apy, Float, nil?: true + + # @!attribute asset + # Asset metadata for an earn vault position. + # + # @return [Privy::Models::EarnAsset] + required :asset, -> { Privy::EarnAsset } + + # @!attribute available_liquidity_usd + # Available liquidity in USD. + # + # @return [Float, nil] + required :available_liquidity_usd, Float, nil?: true + + # @!attribute caip2 + # CAIP-2 chain identifier (e.g. "eip155:8453"). + # + # @return [String] + required :caip2, String + + # @!attribute name + # Human-readable vault name from the yield provider. + # + # @return [String] + required :name, String + + # @!attribute provider + # Supported earn provider protocols. + # + # @return [Symbol, Privy::Models::EthereumEarnProvider] + required :provider, enum: -> { Privy::EthereumEarnProvider } + + # @!attribute tvl_usd + # Total value locked in USD. + # + # @return [Float, nil] + required :tvl_usd, Float, nil?: true + + # @!attribute user_apy + # Current annual percentage yield in basis points (e.g. 500 for 5%). 1 basis point + # = 0.01%. + # + # @return [Float, nil] + required :user_apy, Float, nil?: true + + # @!attribute vault_address + # Onchain vault contract address. + # + # @return [String] + required :vault_address, String + + # @!method initialize(id:, app_apy:, asset:, available_liquidity_usd:, caip2:, name:, provider:, tvl_usd:, user_apy:, vault_address:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumEarnVaultDetailsResponse} for more details. + # + # Detailed vault information including current APY, liquidity, and asset metadata. + # + # @param id [String] Vault identifier. + # + # @param app_apy [Float, nil] Annual percentage yield earned by the app from fee wrapper fees, in basis points + # + # @param asset [Privy::Models::EarnAsset] Asset metadata for an earn vault position. + # + # @param available_liquidity_usd [Float, nil] Available liquidity in USD. + # + # @param caip2 [String] CAIP-2 chain identifier (e.g. "eip155:8453"). + # + # @param name [String] Human-readable vault name from the yield provider. + # + # @param provider [Symbol, Privy::Models::EthereumEarnProvider] Supported earn provider protocols. + # + # @param tvl_usd [Float, nil] Total value locked in USD. + # + # @param user_apy [Float, nil] Current annual percentage yield in basis points (e.g. 500 for 5%). 1 basis point + # + # @param vault_address [String] Onchain vault contract address. + end + end +end diff --git a/lib/privy/models/ethereum_personal_sign_rpc_input.rb b/lib/privy/models/ethereum_personal_sign_rpc_input.rb new file mode 100644 index 0000000..81e7117 --- /dev/null +++ b/lib/privy/models/ethereum_personal_sign_rpc_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumPersonalSignRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumPersonalSignRpcInput::Method] + required :method_, enum: -> { Privy::EthereumPersonalSignRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the EVM `personal_sign` RPC. + # + # @return [Privy::Models::EthereumPersonalSignRpcInputParams] + required :params, -> { Privy::EthereumPersonalSignRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumPersonalSignRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumPersonalSignRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Executes the EVM `personal_sign` RPC (EIP-191) to sign a message. + # + # @param method_ [Symbol, Privy::Models::EthereumPersonalSignRpcInput::Method] + # + # @param params [Privy::Models::EthereumPersonalSignRpcInputParams] Parameters for the EVM `personal_sign` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumPersonalSignRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumPersonalSignRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + PERSONAL_SIGN = :personal_sign + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumPersonalSignRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_personal_sign_rpc_input_params.rb b/lib/privy/models/ethereum_personal_sign_rpc_input_params.rb new file mode 100644 index 0000000..36fda88 --- /dev/null +++ b/lib/privy/models/ethereum_personal_sign_rpc_input_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumPersonalSignRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::EthereumPersonalSignRpcInputParams::Encoding] + required :encoding, enum: -> { Privy::EthereumPersonalSignRpcInputParams::Encoding } + + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(encoding:, message:) + # Parameters for the EVM `personal_sign` RPC. + # + # @param encoding [Symbol, Privy::Models::EthereumPersonalSignRpcInputParams::Encoding] + # @param message [String] + + # @see Privy::Models::EthereumPersonalSignRpcInputParams#encoding + module Encoding + extend Privy::Internal::Type::Enum + + UTF_8 = :"utf-8" + HEX = :hex + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_personal_sign_rpc_response.rb b/lib/privy/models/ethereum_personal_sign_rpc_response.rb new file mode 100644 index 0000000..5957fea --- /dev/null +++ b/lib/privy/models/ethereum_personal_sign_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumPersonalSignRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the EVM `personal_sign` RPC. + # + # @return [Privy::Models::EthereumPersonalSignRpcResponseData] + required :data, -> { Privy::EthereumPersonalSignRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumPersonalSignRpcResponse::Method] + required :method_, enum: -> { Privy::EthereumPersonalSignRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the EVM `personal_sign` RPC. + # + # @param data [Privy::Models::EthereumPersonalSignRpcResponseData] Data returned by the EVM `personal_sign` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumPersonalSignRpcResponse::Method] + + # @see Privy::Models::EthereumPersonalSignRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + PERSONAL_SIGN = :personal_sign + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_personal_sign_rpc_response_data.rb b/lib/privy/models/ethereum_personal_sign_rpc_response_data.rb new file mode 100644 index 0000000..dac16e0 --- /dev/null +++ b/lib/privy/models/ethereum_personal_sign_rpc_response_data.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumPersonalSignRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::EthereumPersonalSignRpcResponseData::Encoding] + required :encoding, enum: -> { Privy::EthereumPersonalSignRpcResponseData::Encoding } + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!method initialize(encoding:, signature:) + # Data returned by the EVM `personal_sign` RPC. + # + # @param encoding [Symbol, Privy::Models::EthereumPersonalSignRpcResponseData::Encoding] + # @param signature [String] + + # @see Privy::Models::EthereumPersonalSignRpcResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + HEX = :hex + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_rpc_input.rb b/lib/privy/models/ethereum_rpc_input.rb new file mode 100644 index 0000000..8ffe170 --- /dev/null +++ b/lib/privy/models/ethereum_rpc_input.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + # Request body for Ethereum wallet RPC operations, discriminated by method. + module EthereumRpcInput + extend Privy::Internal::Type::Union + + discriminator :method + + # Executes the EVM `eth_signTransaction` RPC to sign a transaction. + variant :eth_signTransaction, -> { Privy::EthereumSignTransactionRpcInput } + + # Executes the EVM `eth_sendTransaction` RPC to sign and broadcast a transaction. + variant :eth_sendTransaction, -> { Privy::EthereumSendTransactionRpcInput } + + # Executes the EVM `personal_sign` RPC (EIP-191) to sign a message. + variant :personal_sign, -> { Privy::EthereumPersonalSignRpcInput } + + # Executes the EVM `eth_signTypedData_v4` RPC (EIP-712) to sign a typed data object. + variant :eth_signTypedData_v4, -> { Privy::EthereumSignTypedDataRpcInput } + + # Signs a raw hash on the secp256k1 curve. + variant :secp256k1_sign, -> { Privy::EthereumSecp256k1SignRpcInput } + + # Signs an EIP-7702 authorization. + variant :eth_sign7702Authorization, -> { Privy::EthereumSign7702AuthorizationRpcInput } + + # Executes an RPC method to hash and sign a UserOperation. + variant :eth_signUserOperation, -> { Privy::EthereumSignUserOperationRpcInput } + + # Executes the `wallet_sendCalls` RPC (EIP-5792) to batch multiple calls into a single atomic transaction. + variant :wallet_sendCalls, -> { Privy::EthereumSendCallsRpcInput } + + # @!method self.variants + # @return [Array(Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput)] + end + end +end diff --git a/lib/privy/models/ethereum_rpc_response.rb b/lib/privy/models/ethereum_rpc_response.rb new file mode 100644 index 0000000..05afee5 --- /dev/null +++ b/lib/privy/models/ethereum_rpc_response.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + # Response body for Ethereum wallet RPC operations, discriminated by method. + module EthereumRpcResponse + extend Privy::Internal::Type::Union + + discriminator :method + + # Response to the EVM `personal_sign` RPC. + variant :personal_sign, -> { Privy::EthereumPersonalSignRpcResponse } + + # Response to the EVM `eth_signTypedData_v4` RPC. + variant :eth_signTypedData_v4, -> { Privy::EthereumSignTypedDataRpcResponse } + + # Response to the EVM `eth_signTransaction` RPC. + variant :eth_signTransaction, -> { Privy::EthereumSignTransactionRpcResponse } + + # Response to the EVM `eth_sendTransaction` RPC. + variant :eth_sendTransaction, -> { Privy::EthereumSendTransactionRpcResponse } + + # Response to the EVM `eth_signUserOperation` RPC. + variant :eth_signUserOperation, -> { Privy::EthereumSignUserOperationRpcResponse } + + # Response to the EVM `eth_sign7702Authorization` RPC. + variant :eth_sign7702Authorization, -> { Privy::EthereumSign7702AuthorizationRpcResponse } + + # Response to the EVM `secp256k1_sign` RPC. + variant :secp256k1_sign, -> { Privy::EthereumSecp256k1SignRpcResponse } + + # Response to the `wallet_sendCalls` RPC. + variant :wallet_sendCalls, -> { Privy::EthereumSendCallsRpcResponse } + + # @!method self.variants + # @return [Array(Privy::Models::EthereumPersonalSignRpcResponse, Privy::Models::EthereumSignTypedDataRpcResponse, Privy::Models::EthereumSignTransactionRpcResponse, Privy::Models::EthereumSendTransactionRpcResponse, Privy::Models::EthereumSignUserOperationRpcResponse, Privy::Models::EthereumSign7702AuthorizationRpcResponse, Privy::Models::EthereumSecp256k1SignRpcResponse, Privy::Models::EthereumSendCallsRpcResponse)] + end + end +end diff --git a/lib/privy/models/ethereum_secp_256k_1_sign_rpc_input.rb b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_input.rb new file mode 100644 index 0000000..99a4bad --- /dev/null +++ b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSecp256k1SignRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSecp256k1SignRpcInput::Method] + required :method_, enum: -> { Privy::EthereumSecp256k1SignRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the EVM `secp256k1_sign` RPC. + # + # @return [Privy::Models::EthereumSecp256k1SignRpcInputParams] + required :params, -> { Privy::EthereumSecp256k1SignRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumSecp256k1SignRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumSecp256k1SignRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Signs a raw hash on the secp256k1 curve. + # + # @param method_ [Symbol, Privy::Models::EthereumSecp256k1SignRpcInput::Method] + # + # @param params [Privy::Models::EthereumSecp256k1SignRpcInputParams] Parameters for the EVM `secp256k1_sign` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumSecp256k1SignRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumSecp256k1SignRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + SECP256K1_SIGN = :secp256k1_sign + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumSecp256k1SignRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rb b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rb new file mode 100644 index 0000000..dc796b1 --- /dev/null +++ b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSecp256k1SignRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute hash_ + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :hash_, String, api_name: :hash + + # @!method initialize(hash_:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSecp256k1SignRpcInputParams} for more details. + # + # Parameters for the EVM `secp256k1_sign` RPC. + # + # @param hash_ [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + end + end +end diff --git a/lib/privy/models/ethereum_secp_256k_1_sign_rpc_response.rb b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_response.rb new file mode 100644 index 0000000..4459db4 --- /dev/null +++ b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSecp256k1SignRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the EVM `secp256k1_sign` RPC. + # + # @return [Privy::Models::EthereumSecp256k1SignRpcResponseData] + required :data, -> { Privy::EthereumSecp256k1SignRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSecp256k1SignRpcResponse::Method] + required :method_, enum: -> { Privy::EthereumSecp256k1SignRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the EVM `secp256k1_sign` RPC. + # + # @param data [Privy::Models::EthereumSecp256k1SignRpcResponseData] Data returned by the EVM `secp256k1_sign` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumSecp256k1SignRpcResponse::Method] + + # @see Privy::Models::EthereumSecp256k1SignRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + SECP256K1_SIGN = :secp256k1_sign + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rb b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rb new file mode 100644 index 0000000..b503c92 --- /dev/null +++ b/lib/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSecp256k1SignRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::EthereumSecp256k1SignRpcResponseData::Encoding] + required :encoding, enum: -> { Privy::EthereumSecp256k1SignRpcResponseData::Encoding } + + # @!attribute signature + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :signature, String + + # @!method initialize(encoding:, signature:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSecp256k1SignRpcResponseData} for more details. + # + # Data returned by the EVM `secp256k1_sign` RPC. + # + # @param encoding [Symbol, Privy::Models::EthereumSecp256k1SignRpcResponseData::Encoding] + # + # @param signature [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + + # @see Privy::Models::EthereumSecp256k1SignRpcResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + HEX = :hex + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_send_calls_call.rb b/lib/privy/models/ethereum_send_calls_call.rb new file mode 100644 index 0000000..7c263a1 --- /dev/null +++ b/lib/privy/models/ethereum_send_calls_call.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendCallsCall < Privy::Internal::Type::BaseModel + # @!attribute to + # + # @return [String] + required :to, String + + # @!attribute data + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :data, String + + # @!attribute value + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :value, union: -> { Privy::Quantity } + + # @!method initialize(to:, data: nil, value: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSendCallsCall} for more details. + # + # A single call within a batched wallet_sendCalls request. + # + # @param to [String] + # + # @param data [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param value [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + end + end +end diff --git a/lib/privy/models/ethereum_send_calls_rpc_input.rb b/lib/privy/models/ethereum_send_calls_rpc_input.rb new file mode 100644 index 0000000..3193cd3 --- /dev/null +++ b/lib/privy/models/ethereum_send_calls_rpc_input.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendCallsRpcInput < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @return [String] + required :caip2, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSendCallsRpcInput::Method] + required :method_, enum: -> { Privy::EthereumSendCallsRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the `wallet_sendCalls` RPC. + # + # @return [Privy::Models::EthereumSendCallsRpcInputParams] + required :params, -> { Privy::EthereumSendCallsRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumSendCallsRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumSendCallsRpcInput::ChainType } + + # @!attribute experimental_data_suffix + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :experimental_data_suffix, String + + # @!attribute sponsor + # + # @return [Boolean, nil] + optional :sponsor, Privy::Internal::Type::Boolean + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(caip2:, method_:, params:, address: nil, chain_type: nil, experimental_data_suffix: nil, sponsor: nil, wallet_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSendCallsRpcInput} for more details. + # + # Executes the `wallet_sendCalls` RPC (EIP-5792) to batch multiple calls into a + # single atomic transaction. + # + # @param caip2 [String] A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @param method_ [Symbol, Privy::Models::EthereumSendCallsRpcInput::Method] + # + # @param params [Privy::Models::EthereumSendCallsRpcInputParams] Parameters for the `wallet_sendCalls` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumSendCallsRpcInput::ChainType] + # + # @param experimental_data_suffix [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param sponsor [Boolean] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumSendCallsRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + WALLET_SEND_CALLS = :wallet_sendCalls + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumSendCallsRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_send_calls_rpc_input_params.rb b/lib/privy/models/ethereum_send_calls_rpc_input_params.rb new file mode 100644 index 0000000..ddbb055 --- /dev/null +++ b/lib/privy/models/ethereum_send_calls_rpc_input_params.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendCallsRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute calls + # + # @return [Array] + required :calls, -> { Privy::Internal::Type::ArrayOf[Privy::EthereumSendCallsCall] } + + # @!method initialize(calls:) + # Parameters for the `wallet_sendCalls` RPC. + # + # @param calls [Array] + end + end +end diff --git a/lib/privy/models/ethereum_send_calls_rpc_response.rb b/lib/privy/models/ethereum_send_calls_rpc_response.rb new file mode 100644 index 0000000..0137189 --- /dev/null +++ b/lib/privy/models/ethereum_send_calls_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendCallsRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the `wallet_sendCalls` RPC. + # + # @return [Privy::Models::EthereumSendCallsRpcResponseData] + required :data, -> { Privy::EthereumSendCallsRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSendCallsRpcResponse::Method] + required :method_, enum: -> { Privy::EthereumSendCallsRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the `wallet_sendCalls` RPC. + # + # @param data [Privy::Models::EthereumSendCallsRpcResponseData] Data returned by the `wallet_sendCalls` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumSendCallsRpcResponse::Method] + + # @see Privy::Models::EthereumSendCallsRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + WALLET_SEND_CALLS = :wallet_sendCalls + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_send_calls_rpc_response_data.rb b/lib/privy/models/ethereum_send_calls_rpc_response_data.rb new file mode 100644 index 0000000..a64c42a --- /dev/null +++ b/lib/privy/models/ethereum_send_calls_rpc_response_data.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendCallsRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_id + # + # @return [String] + required :transaction_id, String + + # @!method initialize(caip2:, transaction_id:) + # Data returned by the `wallet_sendCalls` RPC. + # + # @param caip2 [String] A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @param transaction_id [String] + end + end +end diff --git a/lib/privy/models/ethereum_send_transaction_rpc_input.rb b/lib/privy/models/ethereum_send_transaction_rpc_input.rb new file mode 100644 index 0000000..ae1bc21 --- /dev/null +++ b/lib/privy/models/ethereum_send_transaction_rpc_input.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendTransactionRpcInput < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @return [String] + required :caip2, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSendTransactionRpcInput::Method] + required :method_, enum: -> { Privy::EthereumSendTransactionRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the EVM `eth_sendTransaction` RPC. + # + # @return [Privy::Models::EthereumSendTransactionRpcInputParams] + required :params, -> { Privy::EthereumSendTransactionRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumSendTransactionRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumSendTransactionRpcInput::ChainType } + + # @!attribute experimental_data_suffix + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :experimental_data_suffix, String + + # @!attribute reference_id + # + # @return [String, nil] + optional :reference_id, String + + # @!attribute sponsor + # + # @return [Boolean, nil] + optional :sponsor, Privy::Internal::Type::Boolean + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(caip2:, method_:, params:, address: nil, chain_type: nil, experimental_data_suffix: nil, reference_id: nil, sponsor: nil, wallet_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSendTransactionRpcInput} for more details. + # + # Executes the EVM `eth_sendTransaction` RPC to sign and broadcast a transaction. + # + # @param caip2 [String] A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @param method_ [Symbol, Privy::Models::EthereumSendTransactionRpcInput::Method] + # + # @param params [Privy::Models::EthereumSendTransactionRpcInputParams] Parameters for the EVM `eth_sendTransaction` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumSendTransactionRpcInput::ChainType] + # + # @param experimental_data_suffix [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param reference_id [String] + # + # @param sponsor [Boolean] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumSendTransactionRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SEND_TRANSACTION = :eth_sendTransaction + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumSendTransactionRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_send_transaction_rpc_input_params.rb b/lib/privy/models/ethereum_send_transaction_rpc_input_params.rb new file mode 100644 index 0000000..abd3ab1 --- /dev/null +++ b/lib/privy/models/ethereum_send_transaction_rpc_input_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendTransactionRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute transaction + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + # + # @return [Privy::Models::UnsignedStandardEthereumTransaction, Privy::Models::UnsignedTempoTransaction] + required :transaction, union: -> { Privy::UnsignedEthereumTransaction } + + # @!method initialize(transaction:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSendTransactionRpcInputParams} for more details. + # + # Parameters for the EVM `eth_sendTransaction` RPC. + # + # @param transaction [Privy::Models::UnsignedStandardEthereumTransaction, Privy::Models::UnsignedTempoTransaction] An unsigned Ethereum transaction object. Supports standard EVM transaction types + end + end +end diff --git a/lib/privy/models/ethereum_send_transaction_rpc_response.rb b/lib/privy/models/ethereum_send_transaction_rpc_response.rb new file mode 100644 index 0000000..4e320d5 --- /dev/null +++ b/lib/privy/models/ethereum_send_transaction_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendTransactionRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the EVM `eth_sendTransaction` RPC. + # + # @return [Privy::Models::EthereumSendTransactionRpcResponseData] + required :data, -> { Privy::EthereumSendTransactionRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSendTransactionRpcResponse::Method] + required :method_, enum: -> { Privy::EthereumSendTransactionRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the EVM `eth_sendTransaction` RPC. + # + # @param data [Privy::Models::EthereumSendTransactionRpcResponseData] Data returned by the EVM `eth_sendTransaction` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumSendTransactionRpcResponse::Method] + + # @see Privy::Models::EthereumSendTransactionRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SEND_TRANSACTION = :eth_sendTransaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_send_transaction_rpc_response_data.rb b/lib/privy/models/ethereum_send_transaction_rpc_response_data.rb new file mode 100644 index 0000000..9fd95a8 --- /dev/null +++ b/lib/privy/models/ethereum_send_transaction_rpc_response_data.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSendTransactionRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @return [String] + required :caip2, String + + # @!attribute hash_ + # + # @return [String] + required :hash_, String, api_name: :hash + + # @!attribute reference_id + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!attribute transaction_id + # + # @return [String, nil] + optional :transaction_id, String + + # @!attribute transaction_request + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + # + # @return [Privy::Models::UnsignedStandardEthereumTransaction, Privy::Models::UnsignedTempoTransaction, nil] + optional :transaction_request, union: -> { Privy::UnsignedEthereumTransaction } + + # @!attribute user_operation_hash + # + # @return [String, nil] + optional :user_operation_hash, String + + # @!method initialize(caip2:, hash_:, reference_id: nil, transaction_id: nil, transaction_request: nil, user_operation_hash: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSendTransactionRpcResponseData} for more details. + # + # Data returned by the EVM `eth_sendTransaction` RPC. + # + # @param caip2 [String] A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @param hash_ [String] + # + # @param reference_id [String, nil] + # + # @param transaction_id [String] + # + # @param transaction_request [Privy::Models::UnsignedStandardEthereumTransaction, Privy::Models::UnsignedTempoTransaction] An unsigned Ethereum transaction object. Supports standard EVM transaction types + # + # @param user_operation_hash [String] + end + end +end diff --git a/lib/privy/models/ethereum_sign_7702_authorization.rb b/lib/privy/models/ethereum_sign_7702_authorization.rb new file mode 100644 index 0000000..8faaccf --- /dev/null +++ b/lib/privy/models/ethereum_sign_7702_authorization.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSign7702Authorization < Privy::Internal::Type::BaseModel + # @!attribute chain_id + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer] + required :chain_id, union: -> { Privy::Quantity } + + # @!attribute contract + # + # @return [String] + required :contract, String + + # @!attribute nonce + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer] + required :nonce, union: -> { Privy::Quantity } + + # @!attribute r + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :r, String + + # @!attribute s + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :s, String + + # @!attribute y_parity + # + # @return [Float] + required :y_parity, Float + + # @!method initialize(chain_id:, contract:, nonce:, r:, s:, y_parity:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSign7702Authorization} for more details. + # + # A signed EIP-7702 authorization that delegates code execution to a contract + # address. + # + # @param chain_id [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param contract [String] + # + # @param nonce [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param r [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param s [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param y_parity [Float] + end + end +end diff --git a/lib/privy/models/ethereum_sign_7702_authorization_rpc_input.rb b/lib/privy/models/ethereum_sign_7702_authorization_rpc_input.rb new file mode 100644 index 0000000..9e505c7 --- /dev/null +++ b/lib/privy/models/ethereum_sign_7702_authorization_rpc_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSign7702AuthorizationRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcInput::Method] + required :method_, enum: -> { Privy::EthereumSign7702AuthorizationRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the EVM `eth_sign7702Authorization` RPC. + # + # @return [Privy::Models::EthereumSign7702AuthorizationRpcInputParams] + required :params, -> { Privy::EthereumSign7702AuthorizationRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumSign7702AuthorizationRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Signs an EIP-7702 authorization. + # + # @param method_ [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcInput::Method] + # + # @param params [Privy::Models::EthereumSign7702AuthorizationRpcInputParams] Parameters for the EVM `eth_sign7702Authorization` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumSign7702AuthorizationRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN7702_AUTHORIZATION = :eth_sign7702Authorization + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumSign7702AuthorizationRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rb b/lib/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rb new file mode 100644 index 0000000..6e9ac7e --- /dev/null +++ b/lib/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSign7702AuthorizationRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute chain_id + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer] + required :chain_id, union: -> { Privy::Quantity } + + # @!attribute contract + # + # @return [String] + required :contract, String + + # @!attribute executor + # + # @return [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcInputParams::Executor, nil] + optional :executor, enum: -> { Privy::EthereumSign7702AuthorizationRpcInputParams::Executor } + + # @!attribute nonce + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :nonce, union: -> { Privy::Quantity } + + # @!method initialize(chain_id:, contract:, executor: nil, nonce: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSign7702AuthorizationRpcInputParams} for more details. + # + # Parameters for the EVM `eth_sign7702Authorization` RPC. + # + # @param chain_id [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param contract [String] + # + # @param executor [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcInputParams::Executor] + # + # @param nonce [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + + # @see Privy::Models::EthereumSign7702AuthorizationRpcInputParams#executor + module Executor + extend Privy::Internal::Type::Enum + + SELF = :self + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_7702_authorization_rpc_response.rb b/lib/privy/models/ethereum_sign_7702_authorization_rpc_response.rb new file mode 100644 index 0000000..b2cd86f --- /dev/null +++ b/lib/privy/models/ethereum_sign_7702_authorization_rpc_response.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSign7702AuthorizationRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the EVM `eth_sign7702Authorization` RPC. + # + # @return [Privy::Models::EthereumSign7702AuthorizationRpcResponseData] + required :data, -> { Privy::EthereumSign7702AuthorizationRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcResponse::Method] + required :method_, + enum: -> { + Privy::EthereumSign7702AuthorizationRpcResponse::Method + }, + api_name: :method + + # @!method initialize(data:, method_:) + # Response to the EVM `eth_sign7702Authorization` RPC. + # + # @param data [Privy::Models::EthereumSign7702AuthorizationRpcResponseData] Data returned by the EVM `eth_sign7702Authorization` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumSign7702AuthorizationRpcResponse::Method] + + # @see Privy::Models::EthereumSign7702AuthorizationRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN7702_AUTHORIZATION = :eth_sign7702Authorization + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rb b/lib/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rb new file mode 100644 index 0000000..df471d2 --- /dev/null +++ b/lib/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSign7702AuthorizationRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute authorization + # A signed EIP-7702 authorization that delegates code execution to a contract + # address. + # + # @return [Privy::Models::EthereumSign7702Authorization] + required :authorization, -> { Privy::EthereumSign7702Authorization } + + # @!method initialize(authorization:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSign7702AuthorizationRpcResponseData} for more details. + # + # Data returned by the EVM `eth_sign7702Authorization` RPC. + # + # @param authorization [Privy::Models::EthereumSign7702Authorization] A signed EIP-7702 authorization that delegates code execution to a contract addr + end + end +end diff --git a/lib/privy/models/ethereum_sign_transaction_rpc_input.rb b/lib/privy/models/ethereum_sign_transaction_rpc_input.rb new file mode 100644 index 0000000..00528e2 --- /dev/null +++ b/lib/privy/models/ethereum_sign_transaction_rpc_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTransactionRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSignTransactionRpcInput::Method] + required :method_, enum: -> { Privy::EthereumSignTransactionRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the EVM `eth_signTransaction` RPC. + # + # @return [Privy::Models::EthereumSignTransactionRpcInputParams] + required :params, -> { Privy::EthereumSignTransactionRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumSignTransactionRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumSignTransactionRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Executes the EVM `eth_signTransaction` RPC to sign a transaction. + # + # @param method_ [Symbol, Privy::Models::EthereumSignTransactionRpcInput::Method] + # + # @param params [Privy::Models::EthereumSignTransactionRpcInputParams] Parameters for the EVM `eth_signTransaction` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumSignTransactionRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumSignTransactionRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TRANSACTION = :eth_signTransaction + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumSignTransactionRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_transaction_rpc_input_params.rb b/lib/privy/models/ethereum_sign_transaction_rpc_input_params.rb new file mode 100644 index 0000000..40fc7dd --- /dev/null +++ b/lib/privy/models/ethereum_sign_transaction_rpc_input_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTransactionRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute transaction + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + # + # @return [Privy::Models::UnsignedStandardEthereumTransaction, Privy::Models::UnsignedTempoTransaction] + required :transaction, union: -> { Privy::UnsignedEthereumTransaction } + + # @!method initialize(transaction:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSignTransactionRpcInputParams} for more details. + # + # Parameters for the EVM `eth_signTransaction` RPC. + # + # @param transaction [Privy::Models::UnsignedStandardEthereumTransaction, Privy::Models::UnsignedTempoTransaction] An unsigned Ethereum transaction object. Supports standard EVM transaction types + end + end +end diff --git a/lib/privy/models/ethereum_sign_transaction_rpc_response.rb b/lib/privy/models/ethereum_sign_transaction_rpc_response.rb new file mode 100644 index 0000000..2484757 --- /dev/null +++ b/lib/privy/models/ethereum_sign_transaction_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTransactionRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the EVM `eth_signTransaction` RPC. + # + # @return [Privy::Models::EthereumSignTransactionRpcResponseData] + required :data, -> { Privy::EthereumSignTransactionRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSignTransactionRpcResponse::Method] + required :method_, enum: -> { Privy::EthereumSignTransactionRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the EVM `eth_signTransaction` RPC. + # + # @param data [Privy::Models::EthereumSignTransactionRpcResponseData] Data returned by the EVM `eth_signTransaction` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumSignTransactionRpcResponse::Method] + + # @see Privy::Models::EthereumSignTransactionRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TRANSACTION = :eth_signTransaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_transaction_rpc_response_data.rb b/lib/privy/models/ethereum_sign_transaction_rpc_response_data.rb new file mode 100644 index 0000000..77058fb --- /dev/null +++ b/lib/privy/models/ethereum_sign_transaction_rpc_response_data.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTransactionRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::EthereumSignTransactionRpcResponseData::Encoding] + required :encoding, enum: -> { Privy::EthereumSignTransactionRpcResponseData::Encoding } + + # @!attribute signed_transaction + # + # @return [String] + required :signed_transaction, String + + # @!method initialize(encoding:, signed_transaction:) + # Data returned by the EVM `eth_signTransaction` RPC. + # + # @param encoding [Symbol, Privy::Models::EthereumSignTransactionRpcResponseData::Encoding] + # @param signed_transaction [String] + + # @see Privy::Models::EthereumSignTransactionRpcResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + RLP = :rlp + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_typed_data_rpc_input.rb b/lib/privy/models/ethereum_sign_typed_data_rpc_input.rb new file mode 100644 index 0000000..d1a0d8b --- /dev/null +++ b/lib/privy/models/ethereum_sign_typed_data_rpc_input.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTypedDataRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSignTypedDataRpcInput::Method] + required :method_, enum: -> { Privy::EthereumSignTypedDataRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the EVM `eth_signTypedData_v4` RPC. + # + # @return [Privy::Models::EthereumSignTypedDataRpcInputParams] + required :params, -> { Privy::EthereumSignTypedDataRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumSignTypedDataRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumSignTypedDataRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Executes the EVM `eth_signTypedData_v4` RPC (EIP-712) to sign a typed data + # object. + # + # @param method_ [Symbol, Privy::Models::EthereumSignTypedDataRpcInput::Method] + # + # @param params [Privy::Models::EthereumSignTypedDataRpcInputParams] Parameters for the EVM `eth_signTypedData_v4` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumSignTypedDataRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumSignTypedDataRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TYPED_DATA_V4 = :eth_signTypedData_v4 + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumSignTypedDataRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_typed_data_rpc_input_params.rb b/lib/privy/models/ethereum_sign_typed_data_rpc_input_params.rb new file mode 100644 index 0000000..18a15b4 --- /dev/null +++ b/lib/privy/models/ethereum_sign_typed_data_rpc_input_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTypedDataRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute typed_data + # EIP-712 typed data object. + # + # @return [Privy::Models::EthereumTypedDataInput] + required :typed_data, -> { Privy::EthereumTypedDataInput } + + # @!method initialize(typed_data:) + # Parameters for the EVM `eth_signTypedData_v4` RPC. + # + # @param typed_data [Privy::Models::EthereumTypedDataInput] EIP-712 typed data object. + end + end +end diff --git a/lib/privy/models/ethereum_sign_typed_data_rpc_response.rb b/lib/privy/models/ethereum_sign_typed_data_rpc_response.rb new file mode 100644 index 0000000..b01ea75 --- /dev/null +++ b/lib/privy/models/ethereum_sign_typed_data_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTypedDataRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the EVM `eth_signTypedData_v4` RPC. + # + # @return [Privy::Models::EthereumSignTypedDataRpcResponseData] + required :data, -> { Privy::EthereumSignTypedDataRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSignTypedDataRpcResponse::Method] + required :method_, enum: -> { Privy::EthereumSignTypedDataRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the EVM `eth_signTypedData_v4` RPC. + # + # @param data [Privy::Models::EthereumSignTypedDataRpcResponseData] Data returned by the EVM `eth_signTypedData_v4` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumSignTypedDataRpcResponse::Method] + + # @see Privy::Models::EthereumSignTypedDataRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TYPED_DATA_V4 = :eth_signTypedData_v4 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_typed_data_rpc_response_data.rb b/lib/privy/models/ethereum_sign_typed_data_rpc_response_data.rb new file mode 100644 index 0000000..c3fa7f0 --- /dev/null +++ b/lib/privy/models/ethereum_sign_typed_data_rpc_response_data.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignTypedDataRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::EthereumSignTypedDataRpcResponseData::Encoding] + required :encoding, enum: -> { Privy::EthereumSignTypedDataRpcResponseData::Encoding } + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!method initialize(encoding:, signature:) + # Data returned by the EVM `eth_signTypedData_v4` RPC. + # + # @param encoding [Symbol, Privy::Models::EthereumSignTypedDataRpcResponseData::Encoding] + # @param signature [String] + + # @see Privy::Models::EthereumSignTypedDataRpcResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + HEX = :hex + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_user_operation_rpc_input.rb b/lib/privy/models/ethereum_sign_user_operation_rpc_input.rb new file mode 100644 index 0000000..229f6c9 --- /dev/null +++ b/lib/privy/models/ethereum_sign_user_operation_rpc_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignUserOperationRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSignUserOperationRpcInput::Method] + required :method_, enum: -> { Privy::EthereumSignUserOperationRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the EVM `eth_signUserOperation` RPC. + # + # @return [Privy::Models::EthereumSignUserOperationRpcInputParams] + required :params, -> { Privy::EthereumSignUserOperationRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::EthereumSignUserOperationRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::EthereumSignUserOperationRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Executes an RPC method to hash and sign a UserOperation. + # + # @param method_ [Symbol, Privy::Models::EthereumSignUserOperationRpcInput::Method] + # + # @param params [Privy::Models::EthereumSignUserOperationRpcInputParams] Parameters for the EVM `eth_signUserOperation` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::EthereumSignUserOperationRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::EthereumSignUserOperationRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_USER_OPERATION = :eth_signUserOperation + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumSignUserOperationRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_user_operation_rpc_input_params.rb b/lib/privy/models/ethereum_sign_user_operation_rpc_input_params.rb new file mode 100644 index 0000000..41f2425 --- /dev/null +++ b/lib/privy/models/ethereum_sign_user_operation_rpc_input_params.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignUserOperationRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute chain_id + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer] + required :chain_id, union: -> { Privy::Quantity } + + # @!attribute contract + # + # @return [String] + required :contract, String + + # @!attribute user_operation + # An ERC-4337 user operation. + # + # @return [Privy::Models::UserOperationInput] + required :user_operation, -> { Privy::UserOperationInput } + + # @!method initialize(chain_id:, contract:, user_operation:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumSignUserOperationRpcInputParams} for more details. + # + # Parameters for the EVM `eth_signUserOperation` RPC. + # + # @param chain_id [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param contract [String] + # + # @param user_operation [Privy::Models::UserOperationInput] An ERC-4337 user operation. + end + end +end diff --git a/lib/privy/models/ethereum_sign_user_operation_rpc_response.rb b/lib/privy/models/ethereum_sign_user_operation_rpc_response.rb new file mode 100644 index 0000000..e17ef85 --- /dev/null +++ b/lib/privy/models/ethereum_sign_user_operation_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignUserOperationRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the EVM `eth_signUserOperation` RPC. + # + # @return [Privy::Models::EthereumSignUserOperationRpcResponseData] + required :data, -> { Privy::EthereumSignUserOperationRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::EthereumSignUserOperationRpcResponse::Method] + required :method_, enum: -> { Privy::EthereumSignUserOperationRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the EVM `eth_signUserOperation` RPC. + # + # @param data [Privy::Models::EthereumSignUserOperationRpcResponseData] Data returned by the EVM `eth_signUserOperation` RPC. + # + # @param method_ [Symbol, Privy::Models::EthereumSignUserOperationRpcResponse::Method] + + # @see Privy::Models::EthereumSignUserOperationRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_USER_OPERATION = :eth_signUserOperation + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_sign_user_operation_rpc_response_data.rb b/lib/privy/models/ethereum_sign_user_operation_rpc_response_data.rb new file mode 100644 index 0000000..22da921 --- /dev/null +++ b/lib/privy/models/ethereum_sign_user_operation_rpc_response_data.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumSignUserOperationRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::EthereumSignUserOperationRpcResponseData::Encoding] + required :encoding, enum: -> { Privy::EthereumSignUserOperationRpcResponseData::Encoding } + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!method initialize(encoding:, signature:) + # Data returned by the EVM `eth_signUserOperation` RPC. + # + # @param encoding [Symbol, Privy::Models::EthereumSignUserOperationRpcResponseData::Encoding] + # @param signature [String] + + # @see Privy::Models::EthereumSignUserOperationRpcResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + HEX = :hex + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_transaction_condition.rb b/lib/privy/models/ethereum_transaction_condition.rb new file mode 100644 index 0000000..4274ede --- /dev/null +++ b/lib/privy/models/ethereum_transaction_condition.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumTransactionCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::EthereumTransactionCondition::Field] + required :field, enum: -> { Privy::EthereumTransactionCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::EthereumTransactionCondition::FieldSource] + required :field_source, enum: -> { Privy::EthereumTransactionCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumTransactionCondition} for more details. + # + # The verbatim Ethereum transaction object in an eth_signTransaction or + # eth_sendTransaction request. + # + # @param field [Symbol, Privy::Models::EthereumTransactionCondition::Field] + # + # @param field_source [Symbol, Privy::Models::EthereumTransactionCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::EthereumTransactionCondition#field + module Field + extend Privy::Internal::Type::Enum + + TO = :to + VALUE = :value + CHAIN_ID = :chain_id + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumTransactionCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_TRANSACTION = :ethereum_transaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_typed_data_domain_condition.rb b/lib/privy/models/ethereum_typed_data_domain_condition.rb new file mode 100644 index 0000000..f66d5d6 --- /dev/null +++ b/lib/privy/models/ethereum_typed_data_domain_condition.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumTypedDataDomainCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::EthereumTypedDataDomainCondition::Field] + required :field, enum: -> { Privy::EthereumTypedDataDomainCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::EthereumTypedDataDomainCondition::FieldSource] + required :field_source, enum: -> { Privy::EthereumTypedDataDomainCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumTypedDataDomainCondition} for more details. + # + # Attributes from the signing domain that will verify the signature. + # + # @param field [Symbol, Privy::Models::EthereumTypedDataDomainCondition::Field] + # + # @param field_source [Symbol, Privy::Models::EthereumTypedDataDomainCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::EthereumTypedDataDomainCondition#field + module Field + extend Privy::Internal::Type::Enum + + CHAIN_ID = :chainId + CHAIN_ID_2 = :chain_id + VERIFYING_CONTRACT = :verifyingContract + VERIFYING_CONTRACT_2 = :verifying_contract + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumTypedDataDomainCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_TYPED_DATA_DOMAIN = :ethereum_typed_data_domain + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_typed_data_input.rb b/lib/privy/models/ethereum_typed_data_input.rb new file mode 100644 index 0000000..ffb8513 --- /dev/null +++ b/lib/privy/models/ethereum_typed_data_input.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumTypedDataInput < Privy::Internal::Type::BaseModel + # @!attribute domain + # The domain parameters for EIP-712 typed data signing. + # + # @return [Hash{Symbol=>Object}] + required :domain, Privy::Internal::Type::HashOf[Privy::Internal::Type::Unknown] + + # @!attribute message + # + # @return [Hash{Symbol=>Object}] + required :message, Privy::Internal::Type::HashOf[Privy::Internal::Type::Unknown] + + # @!attribute primary_type + # + # @return [String] + required :primary_type, String + + # @!attribute types + # The type definitions for EIP-712 typed data signing. + # + # @return [Hash{Symbol=>Array}] + required :types, + -> { Privy::Internal::Type::HashOf[Privy::Internal::Type::ArrayOf[Privy::TypedDataTypeFieldInput]] } + + # @!method initialize(domain:, message:, primary_type:, types:) + # EIP-712 typed data object. + # + # @param domain [Hash{Symbol=>Object}] The domain parameters for EIP-712 typed data signing. + # + # @param message [Hash{Symbol=>Object}] + # + # @param primary_type [String] + # + # @param types [Hash{Symbol=>Array}] The type definitions for EIP-712 typed data signing. + end + end +end diff --git a/lib/privy/models/ethereum_typed_data_message_condition.rb b/lib/privy/models/ethereum_typed_data_message_condition.rb new file mode 100644 index 0000000..928b754 --- /dev/null +++ b/lib/privy/models/ethereum_typed_data_message_condition.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumTypedDataMessageCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [String] + required :field, String + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::EthereumTypedDataMessageCondition::FieldSource] + required :field_source, enum: -> { Privy::EthereumTypedDataMessageCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute typed_data + # + # @return [Privy::Models::EthereumTypedDataMessageCondition::TypedData] + required :typed_data, -> { Privy::EthereumTypedDataMessageCondition::TypedData } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, typed_data:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumTypedDataMessageCondition} for more details. + # + # 'types' and 'primary_type' attributes of the TypedData JSON object defined in + # EIP-712. + # + # @param field [String] + # + # @param field_source [Symbol, Privy::Models::EthereumTypedDataMessageCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param typed_data [Privy::Models::EthereumTypedDataMessageCondition::TypedData] + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::EthereumTypedDataMessageCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_TYPED_DATA_MESSAGE = :ethereum_typed_data_message + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EthereumTypedDataMessageCondition#typed_data + class TypedData < Privy::Internal::Type::BaseModel + # @!attribute primary_type + # + # @return [String] + required :primary_type, String + + # @!attribute types + # The type definitions for EIP-712 typed data signing. + # + # @return [Hash{Symbol=>Array}] + required :types, + -> { Privy::Internal::Type::HashOf[Privy::Internal::Type::ArrayOf[Privy::TypedDataTypeFieldInput]] } + + # @!method initialize(primary_type:, types:) + # @param primary_type [String] + # + # @param types [Hash{Symbol=>Array}] The type definitions for EIP-712 typed data signing. + end + end + end +end diff --git a/lib/privy/models/ethereum_vault_details_input.rb b/lib/privy/models/ethereum_vault_details_input.rb new file mode 100644 index 0000000..9f02caf --- /dev/null +++ b/lib/privy/models/ethereum_vault_details_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumVaultDetailsInput < Privy::Internal::Type::BaseModel + # @!attribute vault_id + # The Privy vault ID. + # + # @return [String] + required :vault_id, String + + # @!method initialize(vault_id:) + # Input for fetching vault details. + # + # @param vault_id [String] The Privy vault ID. + end + end +end diff --git a/lib/privy/models/ethereum_vault_details_response.rb b/lib/privy/models/ethereum_vault_details_response.rb new file mode 100644 index 0000000..25a03ae --- /dev/null +++ b/lib/privy/models/ethereum_vault_details_response.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumVaultDetailsResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # Vault identifier. + # + # @return [String] + required :id, String + + # @!attribute app_apy + # Annual percentage yield earned by the app from fee wrapper fees, in basis + # points. Null when APY data is unavailable. + # + # @return [Float, nil] + required :app_apy, Float, nil?: true + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute available_liquidity_usd + # Assets available for instant withdrawal in USD. + # + # @return [Float, nil] + required :available_liquidity_usd, Float, nil?: true + + # @!attribute caip2 + # Chain identifier (e.g., eip155:8453). + # + # @return [String] + required :caip2, String + + # @!attribute name + # Human-readable vault name from the yield provider. + # + # @return [String] + required :name, String + + # @!attribute provider + # Supported yield/lending protocol providers. + # + # @return [Symbol, Privy::Models::EthereumYieldProvider] + required :provider, enum: -> { Privy::EthereumYieldProvider } + + # @!attribute tvl_usd + # Total value locked in USD. + # + # @return [Float, nil] + required :tvl_usd, Float, nil?: true + + # @!attribute user_apy + # Current annual percentage yield in basis points (e.g., 500 for 5%). 1 basis + # point = 0.01%. + # + # @return [Float, nil] + required :user_apy, Float, nil?: true + + # @!attribute vault_address + # On-chain vault contract address. + # + # @return [String] + required :vault_address, String + + # @!method initialize(id:, app_apy:, asset_address:, available_liquidity_usd:, caip2:, name:, provider:, tvl_usd:, user_apy:, vault_address:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumVaultDetailsResponse} for more details. + # + # Detailed vault information including current APY and liquidity. + # + # @param id [String] Vault identifier. + # + # @param app_apy [Float, nil] Annual percentage yield earned by the app from fee wrapper fees, in basis points + # + # @param asset_address [String] Underlying asset token address. + # + # @param available_liquidity_usd [Float, nil] Assets available for instant withdrawal in USD. + # + # @param caip2 [String] Chain identifier (e.g., eip155:8453). + # + # @param name [String] Human-readable vault name from the yield provider. + # + # @param provider [Symbol, Privy::Models::EthereumYieldProvider] Supported yield/lending protocol providers. + # + # @param tvl_usd [Float, nil] Total value locked in USD. + # + # @param user_apy [Float, nil] Current annual percentage yield in basis points (e.g., 500 for 5%). 1 basis poin + # + # @param vault_address [String] On-chain vault contract address. + end + end +end diff --git a/lib/privy/models/ethereum_vault_position.rb b/lib/privy/models/ethereum_vault_position.rb new file mode 100644 index 0000000..d4f3503 --- /dev/null +++ b/lib/privy/models/ethereum_vault_position.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumVaultPosition < Privy::Internal::Type::BaseModel + # @!attribute asset + # + # @return [Privy::Models::EthereumVaultPosition::Asset] + required :asset, -> { Privy::EthereumVaultPosition::Asset } + + # @!attribute assets_in_vault + # Current asset value in the vault (realtime from ERC4626), in smallest unit. + # + # @return [String] + required :assets_in_vault, String + + # @!attribute shares_in_vault + # Current vault shares held (realtime from ERC4626). + # + # @return [String] + required :shares_in_vault, String + + # @!attribute total_deposited + # Total amount deposited into the vault, in smallest unit. + # + # @return [String] + required :total_deposited, String + + # @!attribute total_withdrawn + # Total amount withdrawn from the vault, in smallest unit. + # + # @return [String] + required :total_withdrawn, String + + # @!method initialize(asset:, assets_in_vault:, shares_in_vault:, total_deposited:, total_withdrawn:) + # A user's position in a DeFi vault. + # + # @param asset [Privy::Models::EthereumVaultPosition::Asset] + # + # @param assets_in_vault [String] Current asset value in the vault (realtime from ERC4626), in smallest unit. + # + # @param shares_in_vault [String] Current vault shares held (realtime from ERC4626). + # + # @param total_deposited [String] Total amount deposited into the vault, in smallest unit. + # + # @param total_withdrawn [String] Total amount withdrawn from the vault, in smallest unit. + + # @see Privy::Models::EthereumVaultPosition#asset + class Asset < Privy::Internal::Type::BaseModel + # @!attribute address + # Token contract address. + # + # @return [String] + required :address, String + + # @!attribute symbol + # Token symbol (e.g., "USDC"). + # + # @return [String] + required :symbol, String + + # @!method initialize(address:, symbol:) + # @param address [String] Token contract address. + # + # @param symbol [String] Token symbol (e.g., "USDC"). + end + end + end +end diff --git a/lib/privy/models/ethereum_vault_response.rb b/lib/privy/models/ethereum_vault_response.rb new file mode 100644 index 0000000..fe7e687 --- /dev/null +++ b/lib/privy/models/ethereum_vault_response.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumVaultResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the vault. + # + # @return [String] + required :id, String + + # @!attribute asset_address + # The address of the underlying asset token (e.g., USDC). + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # The CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute created_at + # Unix timestamp of when the vault was created, in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute provider + # Supported yield/lending protocol providers. + # + # @return [Symbol, Privy::Models::EthereumYieldProvider] + required :provider, enum: -> { Privy::EthereumYieldProvider } + + # @!attribute underlying_vault_address + # The address of the underlying vault that the fee vault wraps. If this is not a + # fee vault, this equals vault_address. + # + # @return [String] + required :underlying_vault_address, String + + # @!attribute vault_address + # The on-chain address of the ERC-4626 vault contract. + # + # @return [String] + required :vault_address, String + + # @!method initialize(id:, asset_address:, caip2:, created_at:, provider:, underlying_vault_address:, vault_address:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumVaultResponse} for more details. + # + # A vault configuration for yield features. + # + # @param id [String] Unique identifier for the vault. + # + # @param asset_address [String] The address of the underlying asset token (e.g., USDC). + # + # @param caip2 [String] The CAIP-2 chain identifier. + # + # @param created_at [Float] Unix timestamp of when the vault was created, in milliseconds. + # + # @param provider [Symbol, Privy::Models::EthereumYieldProvider] Supported yield/lending protocol providers. + # + # @param underlying_vault_address [String] The address of the underlying vault that the fee vault wraps. If this is not a f + # + # @param vault_address [String] The on-chain address of the ERC-4626 vault contract. + end + end +end diff --git a/lib/privy/models/ethereum_yield_claim_id_input.rb b/lib/privy/models/ethereum_yield_claim_id_input.rb new file mode 100644 index 0000000..55cbac1 --- /dev/null +++ b/lib/privy/models/ethereum_yield_claim_id_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldClaimIDInput < Privy::Internal::Type::BaseModel + # @!attribute id + # The yield claim transaction ID. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # Input for fetching a yield reward claim by ID. + # + # @param id [String] The yield claim transaction ID. + end + end +end diff --git a/lib/privy/models/ethereum_yield_claim_input.rb b/lib/privy/models/ethereum_yield_claim_input.rb new file mode 100644 index 0000000..a25616f --- /dev/null +++ b/lib/privy/models/ethereum_yield_claim_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldClaimInput < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + # + # @return [String] + required :caip2, String + + # @!method initialize(caip2:) + # Input for claiming incentive rewards from vault participation. + # + # @param caip2 [String] An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + end + end +end diff --git a/lib/privy/models/ethereum_yield_claim_response.rb b/lib/privy/models/ethereum_yield_claim_response.rb new file mode 100644 index 0000000..22e118b --- /dev/null +++ b/lib/privy/models/ethereum_yield_claim_response.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldClaimResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # Privy transaction record ID for the claim operation. + # + # @return [String] + required :id, String + + # @!attribute caip2 + # An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + # + # @return [String] + required :caip2, String + + # @!attribute created_at + # Unix timestamp of when the claim was created, in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute rewards + # List of reward tokens claimed. + # + # @return [Array] + required :rewards, -> { Privy::Internal::Type::ArrayOf[Privy::EthereumYieldClaimReward] } + + # @!attribute status + # The current status of the claim transaction. + # + # @return [Symbol, Privy::Models::EthereumYieldClaimResponse::Status] + required :status, enum: -> { Privy::EthereumYieldClaimResponse::Status } + + # @!attribute updated_at + # Unix timestamp of when the claim was last updated, in milliseconds. + # + # @return [Float] + required :updated_at, Float + + # @!method initialize(id:, caip2:, created_at:, rewards:, status:, updated_at:) + # Response from a yield reward claim operation. + # + # @param id [String] Privy transaction record ID for the claim operation. + # + # @param caip2 [String] An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + # + # @param created_at [Float] Unix timestamp of when the claim was created, in milliseconds. + # + # @param rewards [Array] List of reward tokens claimed. + # + # @param status [Symbol, Privy::Models::EthereumYieldClaimResponse::Status] The current status of the claim transaction. + # + # @param updated_at [Float] Unix timestamp of when the claim was last updated, in milliseconds. + + # The current status of the claim transaction. + # + # @see Privy::Models::EthereumYieldClaimResponse#status + module Status + extend Privy::Internal::Type::Enum + + BROADCASTED = :broadcasted + CONFIRMED = :confirmed + EXECUTION_REVERTED = :execution_reverted + FAILED = :failed + REPLACED = :replaced + FINALIZED = :finalized + PROVIDER_ERROR = :provider_error + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/ethereum_yield_claim_reward.rb b/lib/privy/models/ethereum_yield_claim_reward.rb new file mode 100644 index 0000000..cb9d662 --- /dev/null +++ b/lib/privy/models/ethereum_yield_claim_reward.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldClaimReward < Privy::Internal::Type::BaseModel + # @!attribute amount + # Amount claimed in the smallest unit. + # + # @return [String] + required :amount, String + + # @!attribute token_address + # Reward token contract address. + # + # @return [String] + required :token_address, String + + # @!attribute token_symbol + # Reward token symbol (e.g., "MORPHO"). + # + # @return [String] + required :token_symbol, String + + # @!method initialize(amount:, token_address:, token_symbol:) + # A single reward token claimed from vault participation. + # + # @param amount [String] Amount claimed in the smallest unit. + # + # @param token_address [String] Reward token contract address. + # + # @param token_symbol [String] Reward token symbol (e.g., "MORPHO"). + end + end +end diff --git a/lib/privy/models/ethereum_yield_deposit_input.rb b/lib/privy/models/ethereum_yield_deposit_input.rb new file mode 100644 index 0000000..0124d2a --- /dev/null +++ b/lib/privy/models/ethereum_yield_deposit_input.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldDepositInput < Privy::Internal::Type::BaseModel + # @!attribute asset_amount + # The amount of the underlying asset to deposit, in the smallest unit (e.g., wei + # for ETH, 6 decimals for USDC). Must be a non-negative integer string. + # + # @return [String] + required :asset_amount, String + + # @!attribute vault_id + # The ID of the vault to deposit into. + # + # @return [String] + required :vault_id, String + + # @!method initialize(asset_amount:, vault_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumYieldDepositInput} for more details. + # + # Input for depositing assets into an ERC-4626 vault. + # + # @param asset_amount [String] The amount of the underlying asset to deposit, in the smallest unit (e.g., wei f + # + # @param vault_id [String] The ID of the vault to deposit into. + end + end +end diff --git a/lib/privy/models/ethereum_yield_position_response.rb b/lib/privy/models/ethereum_yield_position_response.rb new file mode 100644 index 0000000..05c824a --- /dev/null +++ b/lib/privy/models/ethereum_yield_position_response.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldPositionResponse < Privy::Internal::Type::BaseModel + # @!attribute asset + # + # @return [Privy::Models::EthereumYieldPositionResponse::Asset] + required :asset, -> { Privy::EthereumYieldPositionResponse::Asset } + + # @!attribute assets_in_vault + # Current asset value in the vault (realtime from ERC4626), in smallest unit. + # + # @return [String] + required :assets_in_vault, String + + # @!attribute shares_in_vault + # Current vault shares held (realtime from ERC4626). + # + # @return [String] + required :shares_in_vault, String + + # @!attribute total_deposited + # Total amount deposited into the vault, in smallest unit. + # + # @return [String] + required :total_deposited, String + + # @!attribute total_withdrawn + # Total amount withdrawn from the vault, in smallest unit. + # + # @return [String] + required :total_withdrawn, String + + # @!method initialize(asset:, assets_in_vault:, shares_in_vault:, total_deposited:, total_withdrawn:) + # A user's position in a yield vault. + # + # @param asset [Privy::Models::EthereumYieldPositionResponse::Asset] + # + # @param assets_in_vault [String] Current asset value in the vault (realtime from ERC4626), in smallest unit. + # + # @param shares_in_vault [String] Current vault shares held (realtime from ERC4626). + # + # @param total_deposited [String] Total amount deposited into the vault, in smallest unit. + # + # @param total_withdrawn [String] Total amount withdrawn from the vault, in smallest unit. + + # @see Privy::Models::EthereumYieldPositionResponse#asset + class Asset < Privy::Internal::Type::BaseModel + # @!attribute address + # Token contract address. + # + # @return [String] + required :address, String + + # @!attribute symbol + # Token symbol (e.g., "USDC"). + # + # @return [String] + required :symbol, String + + # @!method initialize(address:, symbol:) + # @param address [String] Token contract address. + # + # @param symbol [String] Token symbol (e.g., "USDC"). + end + end + end +end diff --git a/lib/privy/models/ethereum_yield_positions_input.rb b/lib/privy/models/ethereum_yield_positions_input.rb new file mode 100644 index 0000000..0345a88 --- /dev/null +++ b/lib/privy/models/ethereum_yield_positions_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldPositionsInput < Privy::Internal::Type::BaseModel + # @!attribute vault_id + # The vault ID to get position for. + # + # @return [String] + required :vault_id, String + + # @!method initialize(vault_id:) + # Input for fetching yield positions. + # + # @param vault_id [String] The vault ID to get position for. + end + end +end diff --git a/lib/privy/models/ethereum_yield_provider.rb b/lib/privy/models/ethereum_yield_provider.rb new file mode 100644 index 0000000..95c3cd0 --- /dev/null +++ b/lib/privy/models/ethereum_yield_provider.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Supported yield/lending protocol providers. + module EthereumYieldProvider + extend Privy::Internal::Type::Enum + + MORPHO = :morpho + AAVE = :aave + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/ethereum_yield_sweep_id_input.rb b/lib/privy/models/ethereum_yield_sweep_id_input.rb new file mode 100644 index 0000000..085fc29 --- /dev/null +++ b/lib/privy/models/ethereum_yield_sweep_id_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldSweepIDInput < Privy::Internal::Type::BaseModel + # @!attribute id + # The yield sweep ID. + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # Input for fetching a yield sweep by ID. + # + # @param id [String] The yield sweep ID. + end + end +end diff --git a/lib/privy/models/ethereum_yield_sweep_response.rb b/lib/privy/models/ethereum_yield_sweep_response.rb new file mode 100644 index 0000000..7712092 --- /dev/null +++ b/lib/privy/models/ethereum_yield_sweep_response.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldSweepResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique identifier for the yield sweep. + # + # @return [String] + required :id, String + + # @!attribute asset_amount + # The amount of underlying assets involved. Set after the sweep is confirmed + # on-chain. + # + # @return [String, nil] + required :asset_amount, String, nil?: true + + # @!attribute created_at + # Unix timestamp of when the sweep was created, in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute share_amount + # The amount of vault shares involved. Set after the sweep is confirmed on-chain. + # + # @return [String, nil] + required :share_amount, String, nil?: true + + # @!attribute status + # Status of a yield sweep. + # + # @return [Symbol, Privy::Models::EthereumYieldSweepStatus] + required :status, enum: -> { Privy::EthereumYieldSweepStatus } + + # @!attribute type + # Type of yield sweep. + # + # @return [Symbol, Privy::Models::EthereumYieldSweepType] + required :type, enum: -> { Privy::EthereumYieldSweepType } + + # @!attribute updated_at + # Unix timestamp of when the sweep was last updated, in milliseconds. + # + # @return [Float] + required :updated_at, Float + + # @!attribute vault_id + # The ID of the vault involved in the sweep. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the sweep. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(id:, asset_amount:, created_at:, share_amount:, status:, type:, updated_at:, vault_id:, wallet_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumYieldSweepResponse} for more details. + # + # A yield sweep record representing a deposit or withdrawal. + # + # @param id [String] Unique identifier for the yield sweep. + # + # @param asset_amount [String, nil] The amount of underlying assets involved. Set after the sweep is confirmed on-ch + # + # @param created_at [Float] Unix timestamp of when the sweep was created, in milliseconds. + # + # @param share_amount [String, nil] The amount of vault shares involved. Set after the sweep is confirmed on-chain. + # + # @param status [Symbol, Privy::Models::EthereumYieldSweepStatus] Status of a yield sweep. + # + # @param type [Symbol, Privy::Models::EthereumYieldSweepType] Type of yield sweep. + # + # @param updated_at [Float] Unix timestamp of when the sweep was last updated, in milliseconds. + # + # @param vault_id [String] The ID of the vault involved in the sweep. + # + # @param wallet_id [String] The ID of the wallet involved in the sweep. + end + end +end diff --git a/lib/privy/models/ethereum_yield_sweep_status.rb b/lib/privy/models/ethereum_yield_sweep_status.rb new file mode 100644 index 0000000..e15d586 --- /dev/null +++ b/lib/privy/models/ethereum_yield_sweep_status.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # Status of a yield sweep. + module EthereumYieldSweepStatus + extend Privy::Internal::Type::Enum + + PENDING = :pending + CONFIRMED = :confirmed + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/ethereum_yield_sweep_type.rb b/lib/privy/models/ethereum_yield_sweep_type.rb new file mode 100644 index 0000000..d335c36 --- /dev/null +++ b/lib/privy/models/ethereum_yield_sweep_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Type of yield sweep. + module EthereumYieldSweepType + extend Privy::Internal::Type::Enum + + DEPOSIT = :deposit + WITHDRAW = :withdraw + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/ethereum_yield_withdraw_input.rb b/lib/privy/models/ethereum_yield_withdraw_input.rb new file mode 100644 index 0000000..197f189 --- /dev/null +++ b/lib/privy/models/ethereum_yield_withdraw_input.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + class EthereumYieldWithdrawInput < Privy::Internal::Type::BaseModel + # @!attribute asset_amount + # The amount of the underlying asset to withdraw, in the smallest unit (e.g., wei + # for ETH, 6 decimals for USDC). Must be a non-negative integer string. + # + # @return [String] + required :asset_amount, String + + # @!attribute vault_id + # The ID of the vault to withdraw from. + # + # @return [String] + required :vault_id, String + + # @!method initialize(asset_amount:, vault_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::EthereumYieldWithdrawInput} for more details. + # + # Input for withdrawing assets from an ERC-4626 vault. + # + # @param asset_amount [String] The amount of the underlying asset to withdraw, in the smallest unit (e.g., wei + # + # @param vault_id [String] The ID of the vault to withdraw from. + end + end +end diff --git a/lib/privy/models/evm_caip_2_chain_id.rb b/lib/privy/models/evm_caip_2_chain_id.rb new file mode 100644 index 0000000..300dc60 --- /dev/null +++ b/lib/privy/models/evm_caip_2_chain_id.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + EvmCaip2ChainID = String + end +end diff --git a/lib/privy/models/evm_transaction_wallet_action_step.rb b/lib/privy/models/evm_transaction_wallet_action_step.rb new file mode 100644 index 0000000..62430e1 --- /dev/null +++ b/lib/privy/models/evm_transaction_wallet_action_step.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Privy + module Models + class EvmTransactionWalletActionStep < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # CAIP-2 chain identifier of the transaction, containing the chain ID. + # + # @return [String] + required :caip2, String + + # @!attribute status + # Status of an EVM step in a wallet action. + # + # @return [Symbol, Privy::Models::EvmWalletActionStepStatus] + required :status, enum: -> { Privy::EvmWalletActionStepStatus } + + # @!attribute transaction_hash + # The transaction hash for this step. May change while the step status is + # non-terminal. + # + # @return [String, nil] + required :transaction_hash, String, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::EvmTransactionWalletActionStep::Type] + required :type, enum: -> { Privy::EvmTransactionWalletActionStep::Type } + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!method initialize(caip2:, status:, transaction_hash:, type:, failure_reason: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EvmTransactionWalletActionStep} for more details. + # + # A wallet action step consisting of an EVM transaction. + # + # @param caip2 [String] CAIP-2 chain identifier of the transaction, containing the chain ID. + # + # @param status [Symbol, Privy::Models::EvmWalletActionStepStatus] Status of an EVM step in a wallet action. + # + # @param transaction_hash [String, nil] The transaction hash for this step. May change while the step status is non-term + # + # @param type [Symbol, Privy::Models::EvmTransactionWalletActionStep::Type] + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + + # @see Privy::Models::EvmTransactionWalletActionStep#type + module Type + extend Privy::Internal::Type::Enum + + EVM_TRANSACTION = :evm_transaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/evm_user_operation_wallet_action_step.rb b/lib/privy/models/evm_user_operation_wallet_action_step.rb new file mode 100644 index 0000000..ee136b0 --- /dev/null +++ b/lib/privy/models/evm_user_operation_wallet_action_step.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Privy + module Models + class EvmUserOperationWalletActionStep < Privy::Internal::Type::BaseModel + # @!attribute bundle_transaction_hash + # Transaction hash of the bundle in which this user operation was included. Null + # until included by a bundler. + # + # @return [String, nil] + required :bundle_transaction_hash, String, nil?: true + + # @!attribute caip2 + # CAIP-2 network identifier, containing the chain ID of the user operation. + # + # @return [String] + required :caip2, String + + # @!attribute entrypoint_version + # The entrypoint version of the user operation. + # + # @return [Symbol, Privy::Models::EvmUserOperationWalletActionStep::EntrypointVersion] + required :entrypoint_version, enum: -> { Privy::EvmUserOperationWalletActionStep::EntrypointVersion } + + # @!attribute status + # Status of an EVM step in a wallet action. + # + # @return [Symbol, Privy::Models::EvmWalletActionStepStatus] + required :status, enum: -> { Privy::EvmWalletActionStepStatus } + + # @!attribute type + # + # @return [Symbol, Privy::Models::EvmUserOperationWalletActionStep::Type] + required :type, enum: -> { Privy::EvmUserOperationWalletActionStep::Type } + + # @!attribute user_operation_hash + # The user operation hash for this step. May change while the step status is + # non-terminal. + # + # @return [String, nil] + required :user_operation_hash, String, nil?: true + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!method initialize(bundle_transaction_hash:, caip2:, entrypoint_version:, status:, type:, user_operation_hash:, failure_reason: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::EvmUserOperationWalletActionStep} for more details. + # + # A wallet action step consisting of an EVM user operation. + # + # @param bundle_transaction_hash [String, nil] Transaction hash of the bundle in which this user operation was included. Null u + # + # @param caip2 [String] CAIP-2 network identifier, containing the chain ID of the user operation. + # + # @param entrypoint_version [Symbol, Privy::Models::EvmUserOperationWalletActionStep::EntrypointVersion] The entrypoint version of the user operation. + # + # @param status [Symbol, Privy::Models::EvmWalletActionStepStatus] Status of an EVM step in a wallet action. + # + # @param type [Symbol, Privy::Models::EvmUserOperationWalletActionStep::Type] + # + # @param user_operation_hash [String, nil] The user operation hash for this step. May change while the step status is non-t + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + + # The entrypoint version of the user operation. + # + # @see Privy::Models::EvmUserOperationWalletActionStep#entrypoint_version + module EntrypointVersion + extend Privy::Internal::Type::Enum + + ENTRYPOINT_VERSION_0_6 = :"0.6" + ENTRYPOINT_VERSION_0_7 = :"0.7" + ENTRYPOINT_VERSION_0_8 = :"0.8" + ENTRYPOINT_VERSION_0_9 = :"0.9" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::EvmUserOperationWalletActionStep#type + module Type + extend Privy::Internal::Type::Enum + + EVM_USER_OPERATION = :evm_user_operation + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/evm_wallet_action_step_status.rb b/lib/privy/models/evm_wallet_action_step_status.rb new file mode 100644 index 0000000..395b845 --- /dev/null +++ b/lib/privy/models/evm_wallet_action_step_status.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + # Status of an EVM step in a wallet action. + module EvmWalletActionStepStatus + extend Privy::Internal::Type::Enum + + PREPARING = :preparing + QUEUED = :queued + PENDING = :pending + RETRYING = :retrying + CONFIRMED = :confirmed + REJECTED = :rejected + REVERTED = :reverted + REPLACED = :replaced + ABANDONED = :abandoned + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/export_private_key_rpc_input.rb b/lib/privy/models/export_private_key_rpc_input.rb new file mode 100644 index 0000000..8789e7b --- /dev/null +++ b/lib/privy/models/export_private_key_rpc_input.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class ExportPrivateKeyRpcInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::ExportPrivateKeyRpcInput::Method] + required :method_, enum: -> { Privy::ExportPrivateKeyRpcInput::Method }, api_name: :method + + # @!attribute params + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + # + # @return [Privy::Models::PrivateKeyExportInput] + required :params, -> { Privy::PrivateKeyExportInput } + + # @!method initialize(address:, method_:, params:) + # Exports the private key of the wallet. + # + # @param address [String] + # + # @param method_ [Symbol, Privy::Models::ExportPrivateKeyRpcInput::Method] + # + # @param params [Privy::Models::PrivateKeyExportInput] Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + + # @see Privy::Models::ExportPrivateKeyRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + EXPORT_PRIVATE_KEY = :exportPrivateKey + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/export_private_key_rpc_response.rb b/lib/privy/models/export_private_key_rpc_response.rb new file mode 100644 index 0000000..be9ba09 --- /dev/null +++ b/lib/privy/models/export_private_key_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class ExportPrivateKeyRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + # + # @return [Privy::Models::PrivateKeyExportInput] + required :data, -> { Privy::PrivateKeyExportInput } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::ExportPrivateKeyRpcResponse::Method] + required :method_, enum: -> { Privy::ExportPrivateKeyRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the `exportPrivateKey` RPC. + # + # @param data [Privy::Models::PrivateKeyExportInput] Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + # + # @param method_ [Symbol, Privy::Models::ExportPrivateKeyRpcResponse::Method] + + # @see Privy::Models::ExportPrivateKeyRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + EXPORT_PRIVATE_KEY = :exportPrivateKey + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/export_seed_phrase_rpc_input.rb b/lib/privy/models/export_seed_phrase_rpc_input.rb new file mode 100644 index 0000000..c8585ba --- /dev/null +++ b/lib/privy/models/export_seed_phrase_rpc_input.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class ExportSeedPhraseRpcInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::ExportSeedPhraseRpcInput::Method] + required :method_, enum: -> { Privy::ExportSeedPhraseRpcInput::Method }, api_name: :method + + # @!attribute params + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + # + # @return [Privy::Models::SeedPhraseExportInput] + required :params, -> { Privy::SeedPhraseExportInput } + + # @!method initialize(address:, method_:, params:) + # Exports the seed phrase of the wallet. + # + # @param address [String] + # + # @param method_ [Symbol, Privy::Models::ExportSeedPhraseRpcInput::Method] + # + # @param params [Privy::Models::SeedPhraseExportInput] Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + + # @see Privy::Models::ExportSeedPhraseRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + EXPORT_SEED_PHRASE = :exportSeedPhrase + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/export_seed_phrase_rpc_response.rb b/lib/privy/models/export_seed_phrase_rpc_response.rb new file mode 100644 index 0000000..0afb7f8 --- /dev/null +++ b/lib/privy/models/export_seed_phrase_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class ExportSeedPhraseRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Response containing HPKE-encrypted wallet data (private key or seed phrase). + # + # @return [Privy::Models::SeedPhraseExportResponse] + required :data, -> { Privy::SeedPhraseExportResponse } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::ExportSeedPhraseRpcResponse::Method] + required :method_, enum: -> { Privy::ExportSeedPhraseRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the `exportSeedPhrase` RPC. + # + # @param data [Privy::Models::SeedPhraseExportResponse] Response containing HPKE-encrypted wallet data (private key or seed phrase). + # + # @param method_ [Symbol, Privy::Models::ExportSeedPhraseRpcResponse::Method] + + # @see Privy::Models::ExportSeedPhraseRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + EXPORT_SEED_PHRASE = :exportSeedPhrase + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/export_type.rb b/lib/privy/models/export_type.rb new file mode 100644 index 0000000..52f68a6 --- /dev/null +++ b/lib/privy/models/export_type.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + module ExportType + extend Privy::Internal::Type::Enum + + DISPLAY = :display + CLIENT = :client + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/extended_chain_type.rb b/lib/privy/models/extended_chain_type.rb new file mode 100644 index 0000000..6fa64e5 --- /dev/null +++ b/lib/privy/models/extended_chain_type.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + # The wallet chain types that are not first class chains. + module ExtendedChainType + extend Privy::Internal::Type::Enum + + COSMOS = :cosmos + STELLAR = :stellar + SUI = :sui + APTOS = :aptos + MOVEMENT = :movement + TRON = :tron + BITCOIN_SEGWIT = :"bitcoin-segwit" + BITCOIN_TAPROOT = :"bitcoin-taproot" + PEARL = :pearl + NEAR = :near + TON = :ton + STARKNET = :starknet + SPARK = :spark + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/external_oauth_provider_id.rb b/lib/privy/models/external_oauth_provider_id.rb new file mode 100644 index 0000000..d76f886 --- /dev/null +++ b/lib/privy/models/external_oauth_provider_id.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + # The ID of an external OAuth provider. + module ExternalOAuthProviderID + extend Privy::Internal::Type::Enum + + GOOGLE = :google + DISCORD = :discord + TWITTER = :twitter + GITHUB = :github + SPOTIFY = :spotify + INSTAGRAM = :instagram + TIKTOK = :tiktok + LINKEDIN = :linkedin + APPLE = :apple + LINE = :line + TWITCH = :twitch + TELEGRAM = :telegram + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/external_transaction_wallet_action_step.rb b/lib/privy/models/external_transaction_wallet_action_step.rb new file mode 100644 index 0000000..3f1a597 --- /dev/null +++ b/lib/privy/models/external_transaction_wallet_action_step.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Privy + module Models + class ExternalTransactionWalletActionStep < Privy::Internal::Type::BaseModel + # @!attribute status + # Status of an external transaction step in a wallet action. + # + # @return [Symbol, Privy::Models::ExternalTransactionWalletActionStepStatus] + required :status, enum: -> { Privy::ExternalTransactionWalletActionStepStatus } + + # @!attribute type + # + # @return [Symbol, Privy::Models::ExternalTransactionWalletActionStep::Type] + required :type, enum: -> { Privy::ExternalTransactionWalletActionStep::Type } + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!method initialize(status:, type:, failure_reason: nil) + # A wallet action step representing a cross-chain/cross-asset fill by an external + # provider. + # + # @param status [Symbol, Privy::Models::ExternalTransactionWalletActionStepStatus] Status of an external transaction step in a wallet action. + # + # @param type [Symbol, Privy::Models::ExternalTransactionWalletActionStep::Type] + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + + # @see Privy::Models::ExternalTransactionWalletActionStep#type + module Type + extend Privy::Internal::Type::Enum + + EXTERNAL_TRANSACTION = :external_transaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/external_transaction_wallet_action_step_status.rb b/lib/privy/models/external_transaction_wallet_action_step_status.rb new file mode 100644 index 0000000..4dce2a7 --- /dev/null +++ b/lib/privy/models/external_transaction_wallet_action_step_status.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # Status of an external transaction step in a wallet action. + module ExternalTransactionWalletActionStepStatus + extend Privy::Internal::Type::Enum + + PREPARING = :preparing + QUEUED = :queued + PENDING = :pending + CONFIRMED = :confirmed + REJECTED = :rejected + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/failure_reason.rb b/lib/privy/models/failure_reason.rb new file mode 100644 index 0000000..9b16984 --- /dev/null +++ b/lib/privy/models/failure_reason.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class FailureReason < Privy::Internal::Type::BaseModel + # @!attribute message + # Human-readable failure message. + # + # @return [String] + required :message, String + + # @!attribute details + # Additional error details, if available. + # + # @return [Object, nil] + optional :details, Privy::Internal::Type::Unknown + + # @!method initialize(message:, details: nil) + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @param message [String] Human-readable failure message. + # + # @param details [Object] Additional error details, if available. + end + end +end diff --git a/lib/privy/models/farcaster_authenticate_input.rb b/lib/privy/models/farcaster_authenticate_input.rb new file mode 100644 index 0000000..76ca992 --- /dev/null +++ b/lib/privy/models/farcaster_authenticate_input.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterAuthenticateInput < Privy::Internal::Type::BaseModel + # @!attribute channel_token + # + # @return [String] + required :channel_token, String + + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(channel_token:, fid:, message:, signature:, mode: nil) + # Input for authenticating with Farcaster. + # + # @param channel_token [String] + # + # @param fid [Float] + # + # @param message [String] + # + # @param signature [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/farcaster_authenticate_request_body.rb b/lib/privy/models/farcaster_authenticate_request_body.rb new file mode 100644 index 0000000..d6b5bff --- /dev/null +++ b/lib/privy/models/farcaster_authenticate_request_body.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute channel_token + # + # @return [String] + required :channel_token, String + + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(channel_token:, fid:, message:, signature:, mode: nil) + # The request body for authenticating with Farcaster. + # + # @param channel_token [String] + # + # @param fid [Float] + # + # @param message [String] + # + # @param signature [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/farcaster_connect_init_response.rb b/lib/privy/models/farcaster_connect_init_response.rb new file mode 100644 index 0000000..cabc441 --- /dev/null +++ b/lib/privy/models/farcaster_connect_init_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterConnectInitResponse < Privy::Internal::Type::BaseModel + # @!attribute channel_token + # + # @return [String] + required :channel_token, String + + # @!attribute connect_uri + # + # @return [String] + required :connect_uri, String + + # @!method initialize(channel_token:, connect_uri:) + # Proxy for the Farcaster Connect init response as defined in FIP-11. + # + # @param channel_token [String] + # @param connect_uri [String] + end + end +end diff --git a/lib/privy/models/farcaster_connect_init_response_body.rb b/lib/privy/models/farcaster_connect_init_response_body.rb new file mode 100644 index 0000000..31ecec3 --- /dev/null +++ b/lib/privy/models/farcaster_connect_init_response_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterConnectInitResponseBody < Privy::Internal::Type::BaseModel + # @!attribute channel_token + # + # @return [String] + required :channel_token, String + + # @!attribute connect_uri + # + # @return [String] + required :connect_uri, String + + # @!method initialize(channel_token:, connect_uri:) + # The response body for initiating a Farcaster connection. + # + # @param channel_token [String] + # @param connect_uri [String] + end + end +end diff --git a/lib/privy/models/farcaster_connect_status_completed_response.rb b/lib/privy/models/farcaster_connect_status_completed_response.rb new file mode 100644 index 0000000..440797e --- /dev/null +++ b/lib/privy/models/farcaster_connect_status_completed_response.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterConnectStatusCompletedResponse < Privy::Internal::Type::BaseModel + # @!attribute bio + # + # @return [String] + required :bio, String + + # @!attribute display_name + # + # @return [String] + required :display_name, String + + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute pfp_url + # + # @return [String] + required :pfp_url, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute state + # + # @return [Symbol, Privy::Models::FarcasterConnectStatusCompletedResponse::State] + required :state, enum: -> { Privy::FarcasterConnectStatusCompletedResponse::State } + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(bio:, display_name:, fid:, message:, nonce:, pfp_url:, signature:, state:, username:) + # Proxy for the Farcaster Connect completed status response as defined in FIP-11. + # + # @param bio [String] + # @param display_name [String] + # @param fid [Float] + # @param message [String] + # @param nonce [String] + # @param pfp_url [String] + # @param signature [String] + # @param state [Symbol, Privy::Models::FarcasterConnectStatusCompletedResponse::State] + # @param username [String] + + # @see Privy::Models::FarcasterConnectStatusCompletedResponse#state + module State + extend Privy::Internal::Type::Enum + + COMPLETED = :completed + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_connect_status_completed_response_body.rb b/lib/privy/models/farcaster_connect_status_completed_response_body.rb new file mode 100644 index 0000000..7bd0360 --- /dev/null +++ b/lib/privy/models/farcaster_connect_status_completed_response_body.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterConnectStatusCompletedResponseBody < Privy::Internal::Type::BaseModel + # @!attribute bio + # + # @return [String] + required :bio, String + + # @!attribute display_name + # + # @return [String] + required :display_name, String + + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute pfp_url + # + # @return [String] + required :pfp_url, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute state + # + # @return [Symbol, Privy::Models::FarcasterConnectStatusCompletedResponseBody::State] + required :state, enum: -> { Privy::FarcasterConnectStatusCompletedResponseBody::State } + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(bio:, display_name:, fid:, message:, nonce:, pfp_url:, signature:, state:, username:) + # The response body for completing a Farcaster connection. + # + # @param bio [String] + # @param display_name [String] + # @param fid [Float] + # @param message [String] + # @param nonce [String] + # @param pfp_url [String] + # @param signature [String] + # @param state [Symbol, Privy::Models::FarcasterConnectStatusCompletedResponseBody::State] + # @param username [String] + + # @see Privy::Models::FarcasterConnectStatusCompletedResponseBody#state + module State + extend Privy::Internal::Type::Enum + + COMPLETED = :completed + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_connect_status_pending_response.rb b/lib/privy/models/farcaster_connect_status_pending_response.rb new file mode 100644 index 0000000..ef77cf0 --- /dev/null +++ b/lib/privy/models/farcaster_connect_status_pending_response.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterConnectStatusPendingResponse < Privy::Internal::Type::BaseModel + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute state + # + # @return [Symbol, Privy::Models::FarcasterConnectStatusPendingResponse::State] + required :state, enum: -> { Privy::FarcasterConnectStatusPendingResponse::State } + + # @!method initialize(nonce:, state:) + # Proxy for the Farcaster Connect pending status response as defined in FIP-11. + # + # @param nonce [String] + # @param state [Symbol, Privy::Models::FarcasterConnectStatusPendingResponse::State] + + # @see Privy::Models::FarcasterConnectStatusPendingResponse#state + module State + extend Privy::Internal::Type::Enum + + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_connect_status_pending_response_body.rb b/lib/privy/models/farcaster_connect_status_pending_response_body.rb new file mode 100644 index 0000000..c3ecba1 --- /dev/null +++ b/lib/privy/models/farcaster_connect_status_pending_response_body.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterConnectStatusPendingResponseBody < Privy::Internal::Type::BaseModel + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute state + # + # @return [Symbol, Privy::Models::FarcasterConnectStatusPendingResponseBody::State] + required :state, enum: -> { Privy::FarcasterConnectStatusPendingResponseBody::State } + + # @!method initialize(nonce:, state:) + # The response body for pending a Farcaster connection. + # + # @param nonce [String] + # @param state [Symbol, Privy::Models::FarcasterConnectStatusPendingResponseBody::State] + + # @see Privy::Models::FarcasterConnectStatusPendingResponseBody#state + module State + extend Privy::Internal::Type::Enum + + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_init_input.rb b/lib/privy/models/farcaster_init_input.rb new file mode 100644 index 0000000..8d256fb --- /dev/null +++ b/lib/privy/models/farcaster_init_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterInitInput < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute redirect_url + # + # @return [String, nil] + optional :redirect_url, String + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(token: nil, redirect_url: nil, relying_party: nil) + # Input for initiating a Farcaster connection. + # + # @param token [String] + # @param redirect_url [String] + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/farcaster_init_request_body.rb b/lib/privy/models/farcaster_init_request_body.rb new file mode 100644 index 0000000..506bb94 --- /dev/null +++ b/lib/privy/models/farcaster_init_request_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute redirect_url + # + # @return [String, nil] + optional :redirect_url, String + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(token: nil, redirect_url: nil, relying_party: nil) + # The request body for initiating a Farcaster connection. + # + # @param token [String] + # @param redirect_url [String] + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/farcaster_link_input.rb b/lib/privy/models/farcaster_link_input.rb new file mode 100644 index 0000000..d0b631b --- /dev/null +++ b/lib/privy/models/farcaster_link_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterLinkInput < Privy::Internal::Type::BaseModel + # @!attribute channel_token + # + # @return [String] + required :channel_token, String + + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!method initialize(channel_token:, fid:, message:, signature:) + # Input for linking a Farcaster account. + # + # @param channel_token [String] + # @param fid [Float] + # @param message [String] + # @param signature [String] + end + end +end diff --git a/lib/privy/models/farcaster_link_request_body.rb b/lib/privy/models/farcaster_link_request_body.rb new file mode 100644 index 0000000..5b4a743 --- /dev/null +++ b/lib/privy/models/farcaster_link_request_body.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute channel_token + # + # @return [String] + required :channel_token, String + + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!method initialize(channel_token:, fid:, message:, signature:) + # The request body for linking a Farcaster account. + # + # @param channel_token [String] + # @param fid [Float] + # @param message [String] + # @param signature [String] + end + end +end diff --git a/lib/privy/models/farcaster_signer_approved.rb b/lib/privy/models/farcaster_signer_approved.rb new file mode 100644 index 0000000..9704997 --- /dev/null +++ b/lib/privy/models/farcaster_signer_approved.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterSignerApproved < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [String] + required :fid, String + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::FarcasterSignerApproved::Status] + required :status, enum: -> { Privy::FarcasterSignerApproved::Status } + + # @!method initialize(fid:, public_key:, status:) + # A Farcaster signer response when the signer has been approved. + # + # @param fid [String] + # @param public_key [String] + # @param status [Symbol, Privy::Models::FarcasterSignerApproved::Status] + + # @see Privy::Models::FarcasterSignerApproved#status + module Status + extend Privy::Internal::Type::Enum + + APPROVED = :approved + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_signer_init_pending_approval.rb b/lib/privy/models/farcaster_signer_init_pending_approval.rb new file mode 100644 index 0000000..9f96c94 --- /dev/null +++ b/lib/privy/models/farcaster_signer_init_pending_approval.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterSignerInitPendingApproval < Privy::Internal::Type::BaseModel + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute signer_approval_url + # + # @return [String] + required :signer_approval_url, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::FarcasterSignerInitPendingApproval::Status] + required :status, enum: -> { Privy::FarcasterSignerInitPendingApproval::Status } + + # @!method initialize(public_key:, signer_approval_url:, status:) + # A Farcaster signer init response when the signer is pending approval. + # + # @param public_key [String] + # @param signer_approval_url [String] + # @param status [Symbol, Privy::Models::FarcasterSignerInitPendingApproval::Status] + + # @see Privy::Models::FarcasterSignerInitPendingApproval#status + module Status + extend Privy::Internal::Type::Enum + + PENDING_APPROVAL = :pending_approval + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_signer_init_request_body.rb b/lib/privy/models/farcaster_signer_init_request_body.rb new file mode 100644 index 0000000..e0ec8fe --- /dev/null +++ b/lib/privy/models/farcaster_signer_init_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterSignerInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute ed25519_public_key + # + # @return [String] + required :ed25519_public_key, String + + # @!attribute deadline + # + # @return [String, nil] + optional :deadline, String + + # @!method initialize(ed25519_public_key:, deadline: nil) + # The request body for initiating a Farcaster signer connection. + # + # @param ed25519_public_key [String] + # @param deadline [String] + end + end +end diff --git a/lib/privy/models/farcaster_signer_init_response_body.rb b/lib/privy/models/farcaster_signer_init_response_body.rb new file mode 100644 index 0000000..9c0c3c2 --- /dev/null +++ b/lib/privy/models/farcaster_signer_init_response_body.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + # The response body from initiating a Farcaster signer connection. + module FarcasterSignerInitResponseBody + extend Privy::Internal::Type::Union + + discriminator :status + + # A Farcaster signer init response when the signer is pending approval. + variant :pending_approval, -> { Privy::FarcasterSignerInitPendingApproval } + + # A Farcaster signer response when the signer has been approved. + variant :approved, -> { Privy::FarcasterSignerApproved } + + # A Farcaster signer response when the signer has been revoked. + variant :revoked, -> { Privy::FarcasterSignerRevoked } + + # @!method self.variants + # @return [Array(Privy::Models::FarcasterSignerInitPendingApproval, Privy::Models::FarcasterSignerApproved, Privy::Models::FarcasterSignerRevoked)] + end + end +end diff --git a/lib/privy/models/farcaster_signer_revoked.rb b/lib/privy/models/farcaster_signer_revoked.rb new file mode 100644 index 0000000..16487ff --- /dev/null +++ b/lib/privy/models/farcaster_signer_revoked.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterSignerRevoked < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [String] + required :fid, String + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::FarcasterSignerRevoked::Status] + required :status, enum: -> { Privy::FarcasterSignerRevoked::Status } + + # @!method initialize(fid:, public_key:, status:) + # A Farcaster signer response when the signer has been revoked. + # + # @param fid [String] + # @param public_key [String] + # @param status [Symbol, Privy::Models::FarcasterSignerRevoked::Status] + + # @see Privy::Models::FarcasterSignerRevoked#status + module Status + extend Privy::Internal::Type::Enum + + REVOKED = :revoked + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_signer_status_pending_approval.rb b/lib/privy/models/farcaster_signer_status_pending_approval.rb new file mode 100644 index 0000000..d608085 --- /dev/null +++ b/lib/privy/models/farcaster_signer_status_pending_approval.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterSignerStatusPendingApproval < Privy::Internal::Type::BaseModel + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::FarcasterSignerStatusPendingApproval::Status] + required :status, enum: -> { Privy::FarcasterSignerStatusPendingApproval::Status } + + # @!method initialize(public_key:, status:) + # A Farcaster signer status response when the signer is pending approval. + # + # @param public_key [String] + # @param status [Symbol, Privy::Models::FarcasterSignerStatusPendingApproval::Status] + + # @see Privy::Models::FarcasterSignerStatusPendingApproval#status + module Status + extend Privy::Internal::Type::Enum + + PENDING_APPROVAL = :pending_approval + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/farcaster_signer_status_response_body.rb b/lib/privy/models/farcaster_signer_status_response_body.rb new file mode 100644 index 0000000..cc76984 --- /dev/null +++ b/lib/privy/models/farcaster_signer_status_response_body.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + # The response body from checking the status of a Farcaster signer connection. + module FarcasterSignerStatusResponseBody + extend Privy::Internal::Type::Union + + discriminator :status + + # A Farcaster signer status response when the signer is pending approval. + variant :pending_approval, -> { Privy::FarcasterSignerStatusPendingApproval } + + # A Farcaster signer response when the signer has been approved. + variant :approved, -> { Privy::FarcasterSignerApproved } + + # A Farcaster signer response when the signer has been revoked. + variant :revoked, -> { Privy::FarcasterSignerRevoked } + + # @!method self.variants + # @return [Array(Privy::Models::FarcasterSignerStatusPendingApproval, Privy::Models::FarcasterSignerApproved, Privy::Models::FarcasterSignerRevoked)] + end + end +end diff --git a/lib/privy/models/farcaster_unlink_input.rb b/lib/privy/models/farcaster_unlink_input.rb new file mode 100644 index 0000000..b9aa2e6 --- /dev/null +++ b/lib/privy/models/farcaster_unlink_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterUnlinkInput < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!method initialize(fid:) + # Input for unlinking a Farcaster account. + # + # @param fid [Float] + end + end +end diff --git a/lib/privy/models/farcaster_unlink_request_body.rb b/lib/privy/models/farcaster_unlink_request_body.rb new file mode 100644 index 0000000..d417d99 --- /dev/null +++ b/lib/privy/models/farcaster_unlink_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterUnlinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!method initialize(fid:) + # The request body for unlinking a Farcaster account. + # + # @param fid [Float] + end + end +end diff --git a/lib/privy/models/farcaster_v_2_authenticate_input.rb b/lib/privy/models/farcaster_v_2_authenticate_input.rb new file mode 100644 index 0000000..0af4949 --- /dev/null +++ b/lib/privy/models/farcaster_v_2_authenticate_input.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterV2AuthenticateInput < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(fid:, message:, signature:, mode: nil) + # Input for authenticating a Farcaster V2 account. + # + # @param fid [Float] + # + # @param message [String] + # + # @param signature [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/farcaster_v_2_authenticate_request_body.rb b/lib/privy/models/farcaster_v_2_authenticate_request_body.rb new file mode 100644 index 0000000..0e37d62 --- /dev/null +++ b/lib/privy/models/farcaster_v_2_authenticate_request_body.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterV2AuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(fid:, message:, signature:, mode: nil) + # The request body for authenticating a Farcaster V2 account. + # + # @param fid [Float] + # + # @param message [String] + # + # @param signature [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/farcaster_v_2_init_input.rb b/lib/privy/models/farcaster_v_2_init_input.rb new file mode 100644 index 0000000..2109acd --- /dev/null +++ b/lib/privy/models/farcaster_v_2_init_input.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterV2InitInput < Privy::Internal::Type::BaseModel + # @!method initialize + # Input for initiating a Farcaster V2 connection. + end + end +end diff --git a/lib/privy/models/farcaster_v_2_init_request_body.rb b/lib/privy/models/farcaster_v_2_init_request_body.rb new file mode 100644 index 0000000..c92bfc0 --- /dev/null +++ b/lib/privy/models/farcaster_v_2_init_request_body.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterV2InitRequestBody < Privy::Internal::Type::BaseModel + # @!method initialize + # The request body for initiating a Farcaster V2 connection. + end + end +end diff --git a/lib/privy/models/farcaster_v_2_init_response.rb b/lib/privy/models/farcaster_v_2_init_response.rb new file mode 100644 index 0000000..504881f --- /dev/null +++ b/lib/privy/models/farcaster_v_2_init_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterV2InitResponse < Privy::Internal::Type::BaseModel + # @!attribute expires_at + # + # @return [String] + required :expires_at, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(expires_at:, nonce:) + # Response for initiating a Farcaster V2 connection. + # + # @param expires_at [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/farcaster_v_2_init_response_body.rb b/lib/privy/models/farcaster_v_2_init_response_body.rb new file mode 100644 index 0000000..6d4cee4 --- /dev/null +++ b/lib/privy/models/farcaster_v_2_init_response_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class FarcasterV2InitResponseBody < Privy::Internal::Type::BaseModel + # @!attribute expires_at + # + # @return [String] + required :expires_at, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(expires_at:, nonce:) + # The response body for initiating a Farcaster V2 connection. + # + # @param expires_at [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/fiat_amount.rb b/lib/privy/models/fiat_amount.rb new file mode 100644 index 0000000..3f0c06b --- /dev/null +++ b/lib/privy/models/fiat_amount.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + FiatAmount = String + end +end diff --git a/lib/privy/models/fiat_currency_code.rb b/lib/privy/models/fiat_currency_code.rb new file mode 100644 index 0000000..01763e7 --- /dev/null +++ b/lib/privy/models/fiat_currency_code.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + FiatCurrencyCode = String + end +end diff --git a/lib/privy/models/fiat_customer_response.rb b/lib/privy/models/fiat_customer_response.rb new file mode 100644 index 0000000..0bb7a68 --- /dev/null +++ b/lib/privy/models/fiat_customer_response.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # The response for getting a native onramp provider customer. + module FiatCustomerResponse + extend Privy::Internal::Type::Union + + discriminator :provider + + # The response for getting a native onramp provider customer. + variant :bridge, -> { Privy::BridgeFiatCustomerResponse } + + # The response for getting a native onramp provider customer. + variant :"bridge-sandbox", -> { Privy::BridgeSandboxFiatCustomerResponse } + + # @!method self.variants + # @return [Array(Privy::Models::BridgeFiatCustomerResponse, Privy::Models::BridgeSandboxFiatCustomerResponse)] + end + end +end diff --git a/lib/privy/models/fiat_onramp_destination.rb b/lib/privy/models/fiat_onramp_destination.rb new file mode 100644 index 0000000..9b61f2b --- /dev/null +++ b/lib/privy/models/fiat_onramp_destination.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Privy + module Models + class FiatOnrampDestination < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute asset + # Cryptocurrency symbol. Uppercase alphanumeric, 2-10 characters. + # + # @return [String] + required :asset, String + + # @!attribute chain + # A CAIP-2 chain identifier in namespace:reference format (e.g. "eip155:1" for + # Ethereum mainnet, "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" for Solana mainnet). + # + # @return [String] + required :chain, String + + # @!method initialize(address:, asset:, chain:) + # Some parameter documentations has been truncated, see + # {Privy::Models::FiatOnrampDestination} for more details. + # + # Destination cryptocurrency details for a fiat onramp quote request. + # + # @param address [String] + # + # @param asset [String] Cryptocurrency symbol. Uppercase alphanumeric, 2-10 characters. + # + # @param chain [String] A CAIP-2 chain identifier in namespace:reference format (e.g. "eip155:1" for Eth + end + end +end diff --git a/lib/privy/models/fiat_onramp_environment.rb b/lib/privy/models/fiat_onramp_environment.rb new file mode 100644 index 0000000..5d02fe0 --- /dev/null +++ b/lib/privy/models/fiat_onramp_environment.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Whether to use the sandbox or production environment for fiat onramp. + module FiatOnrampEnvironment + extend Privy::Internal::Type::Enum + + SANDBOX = :sandbox + PRODUCTION = :production + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/fiat_onramp_provider.rb b/lib/privy/models/fiat_onramp_provider.rb new file mode 100644 index 0000000..2a29a48 --- /dev/null +++ b/lib/privy/models/fiat_onramp_provider.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # The fiat onramp provider to use. + module FiatOnrampProvider + extend Privy::Internal::Type::Enum + + MELD = :meld + MELD_SANDBOX = :"meld-sandbox" + MOONPAY = :moonpay + MOONPAY_SANDBOX = :"moonpay-sandbox" + COINBASE = :coinbase + COINBASE_SANDBOX = :"coinbase-sandbox" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/fiat_onramp_provider_error.rb b/lib/privy/models/fiat_onramp_provider_error.rb new file mode 100644 index 0000000..00c3a10 --- /dev/null +++ b/lib/privy/models/fiat_onramp_provider_error.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class FiatOnrampProviderError < Privy::Internal::Type::BaseModel + # @!attribute error + # + # @return [String] + required :error, String + + # @!attribute provider + # The fiat onramp provider to use. + # + # @return [Symbol, Privy::Models::FiatOnrampProvider] + required :provider, enum: -> { Privy::FiatOnrampProvider } + + # @!method initialize(error:, provider:) + # An error from a specific fiat onramp provider when fetching quotes. + # + # @param error [String] + # + # @param provider [Symbol, Privy::Models::FiatOnrampProvider] The fiat onramp provider to use. + end + end +end diff --git a/lib/privy/models/fiat_onramp_quote.rb b/lib/privy/models/fiat_onramp_quote.rb new file mode 100644 index 0000000..a6a0975 --- /dev/null +++ b/lib/privy/models/fiat_onramp_quote.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class FiatOnrampQuote < Privy::Internal::Type::BaseModel + # @!attribute payment_method + # + # @return [String] + required :payment_method, String + + # @!attribute provider + # The fiat onramp provider to use. + # + # @return [Symbol, Privy::Models::FiatOnrampProvider] + required :provider, enum: -> { Privy::FiatOnrampProvider } + + # @!attribute destination_currency_code + # + # @return [String, nil] + optional :destination_currency_code, String, nil?: true + + # @!attribute source_amount + # + # @return [Float, nil] + optional :source_amount, Float, nil?: true + + # @!attribute source_currency_code + # + # @return [String, nil] + optional :source_currency_code, String, nil?: true + + # @!attribute sub_provider + # + # @return [String, nil] + optional :sub_provider, String, nil?: true + + # @!method initialize(payment_method:, provider:, destination_currency_code: nil, source_amount: nil, source_currency_code: nil, sub_provider: nil) + # A single fiat onramp quote from a provider. + # + # @param payment_method [String] + # + # @param provider [Symbol, Privy::Models::FiatOnrampProvider] The fiat onramp provider to use. + # + # @param destination_currency_code [String, nil] + # + # @param source_amount [Float, nil] + # + # @param source_currency_code [String, nil] + # + # @param sub_provider [String, nil] + end + end +end diff --git a/lib/privy/models/fiat_onramp_source.rb b/lib/privy/models/fiat_onramp_source.rb new file mode 100644 index 0000000..bf3ad4c --- /dev/null +++ b/lib/privy/models/fiat_onramp_source.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class FiatOnrampSource < Privy::Internal::Type::BaseModel + # @!attribute amount + # A positive decimal amount as a string (e.g. "100", "50.25", "0.001"). + # + # @return [String] + required :amount, String + + # @!attribute asset + # ISO 4217 fiat currency code. Three uppercase ASCII letters. + # + # @return [String] + required :asset, String + + # @!method initialize(amount:, asset:) + # Source currency details for a fiat onramp quote request. + # + # @param amount [String] A positive decimal amount as a string (e.g. "100", "50.25", "0.001"). + # + # @param asset [String] ISO 4217 fiat currency code. Three uppercase ASCII letters. + end + end +end diff --git a/lib/privy/models/fiat_onramp_transaction_status.rb b/lib/privy/models/fiat_onramp_transaction_status.rb new file mode 100644 index 0000000..8b8bb78 --- /dev/null +++ b/lib/privy/models/fiat_onramp_transaction_status.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # Normalized fiat onramp transaction status. + module FiatOnrampTransactionStatus + extend Privy::Internal::Type::Enum + + PENDING = :pending + PROCESSING = :processing + COMPLETED = :completed + FAILED = :failed + CANCELLED = :cancelled + REFUNDED = :refunded + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/fiat_virtual_account_request.rb b/lib/privy/models/fiat_virtual_account_request.rb new file mode 100644 index 0000000..026ffcc --- /dev/null +++ b/lib/privy/models/fiat_virtual_account_request.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # The request input for creating virtual account. + module FiatVirtualAccountRequest + extend Privy::Internal::Type::Union + + discriminator :provider + + # The request input for creating virtual account. + variant :bridge, -> { Privy::BridgeFiatVirtualAccountRequest } + + # The request input for creating virtual account. + variant :"bridge-sandbox", -> { Privy::BridgeSandboxFiatVirtualAccountRequest } + + # @!method self.variants + # @return [Array(Privy::Models::BridgeFiatVirtualAccountRequest, Privy::Models::BridgeSandboxFiatVirtualAccountRequest)] + end + end +end diff --git a/lib/privy/models/fiat_virtual_account_response.rb b/lib/privy/models/fiat_virtual_account_response.rb new file mode 100644 index 0000000..43c62b9 --- /dev/null +++ b/lib/privy/models/fiat_virtual_account_response.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # The response for creating virtual account. + module FiatVirtualAccountResponse + extend Privy::Internal::Type::Union + + discriminator :provider + + # The response for creating virtual account. + variant :bridge, -> { Privy::BridgeFiatVirtualAccountResponse } + + # The response for creating virtual account. + variant :"bridge-sandbox", -> { Privy::BridgeSandboxFiatVirtualAccountResponse } + + # @!method self.variants + # @return [Array(Privy::Models::BridgeFiatVirtualAccountResponse, Privy::Models::BridgeSandboxFiatVirtualAccountResponse)] + end + end +end diff --git a/lib/privy/models/first_class_chain_type.rb b/lib/privy/models/first_class_chain_type.rb new file mode 100644 index 0000000..f21858f --- /dev/null +++ b/lib/privy/models/first_class_chain_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The wallet chain types that offer first class support. + module FirstClassChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/funding_config_response_schema.rb b/lib/privy/models/funding_config_response_schema.rb new file mode 100644 index 0000000..5524823 --- /dev/null +++ b/lib/privy/models/funding_config_response_schema.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Models + class FundingConfigResponseSchema < Privy::Internal::Type::BaseModel + # @!attribute cross_chain_bridging_enabled + # + # @return [Boolean] + required :cross_chain_bridging_enabled, Privy::Internal::Type::Boolean + + # @!attribute default_recommended_amount + # + # @return [String] + required :default_recommended_amount, String + + # @!attribute default_recommended_currency + # A crypto currency identified by a CAIP-2 chain ID and optional asset. + # + # @return [Privy::Models::Currency] + required :default_recommended_currency, -> { Privy::Currency } + + # @!attribute methods_ + # + # @return [Array] + required :methods_, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::FundingMethodEnum] }, + api_name: :methods + + # @!attribute options + # + # @return [Array] + required :options, -> { Privy::Internal::Type::ArrayOf[Privy::FundingOption] } + + # @!attribute prompt_funding_on_wallet_creation + # + # @return [Boolean] + required :prompt_funding_on_wallet_creation, Privy::Internal::Type::Boolean + + # @!method initialize(cross_chain_bridging_enabled:, default_recommended_amount:, default_recommended_currency:, methods_:, options:, prompt_funding_on_wallet_creation:) + # Configuration for funding and on-ramp options. + # + # @param cross_chain_bridging_enabled [Boolean] + # + # @param default_recommended_amount [String] + # + # @param default_recommended_currency [Privy::Models::Currency] A crypto currency identified by a CAIP-2 chain ID and optional asset. + # + # @param methods_ [Array] + # + # @param options [Array] + # + # @param prompt_funding_on_wallet_creation [Boolean] + end + end +end diff --git a/lib/privy/models/funding_method_enum.rb b/lib/privy/models/funding_method_enum.rb new file mode 100644 index 0000000..12d4772 --- /dev/null +++ b/lib/privy/models/funding_method_enum.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # A funding method for on-ramp. + module FundingMethodEnum + extend Privy::Internal::Type::Enum + + MOONPAY = :moonpay + COINBASE_ONRAMP = :"coinbase-onramp" + EXTERNAL = :external + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/funding_option.rb b/lib/privy/models/funding_option.rb new file mode 100644 index 0000000..849326e --- /dev/null +++ b/lib/privy/models/funding_option.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class FundingOption < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [String] + required :method_, String, api_name: :method + + # @!attribute provider + # + # @return [String] + required :provider, String + + # @!method initialize(method_:, provider:) + # A funding option with method and provider. + # + # @param method_ [String] + # @param provider [String] + end + end +end diff --git a/lib/privy/models/funds_deposited_webhook_payload.rb b/lib/privy/models/funds_deposited_webhook_payload.rb new file mode 100644 index 0000000..8523bdc --- /dev/null +++ b/lib/privy/models/funds_deposited_webhook_payload.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +module Privy + module Models + class FundsDepositedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute amount + # The amount transferred, as a stringified bigint. + # + # @return [String] + required :amount, String + + # @!attribute asset + # An asset involved in a wallet transfer. + # + # @return [Privy::Models::WalletFundsNativeTokenAsset, Privy::Models::WalletFundsErc20Asset, Privy::Models::WalletFundsSplAsset, Privy::Models::WalletFundsSacAsset] + required :asset, union: -> { Privy::WalletFundsAsset } + + # @!attribute block + # + # @return [Privy::Models::FundsDepositedWebhookPayload::Block] + required :block, -> { Privy::FundsDepositedWebhookPayload::Block } + + # @!attribute caip2 + # The CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute idempotency_key + # A unique key for this event. + # + # @return [String] + required :idempotency_key, String + + # @!attribute recipient + # The recipient address. + # + # @return [String] + required :recipient, String + + # @!attribute sender + # The sender address. + # + # @return [String] + required :sender, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::FundsDepositedWebhookPayload::Type] + required :type, enum: -> { Privy::FundsDepositedWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute bridge_metadata + # Metadata about a Bridge transaction associated with a wallet event. + # + # @return [Privy::Models::BridgeCryptoDepositMetadata, Privy::Models::BridgeRefundMetadata, Privy::Models::BridgeFiatDepositMetadata, Privy::Models::BridgeCryptoTransferMetadata, Privy::Models::BridgeFiatTransferMetadata, Privy::Models::BridgeTransferRefundMetadata, Privy::Models::BridgeStaticMemoDepositMetadata, nil] + optional :bridge_metadata, union: -> { Privy::BridgeMetadata } + + # @!attribute transaction_fee + # The transaction fee paid, as a stringified bigint in the chain's native token. + # + # @return [String, nil] + optional :transaction_fee, String + + # @!method initialize(amount:, asset:, block:, caip2:, idempotency_key:, recipient:, sender:, transaction_hash:, type:, wallet_id:, bridge_metadata: nil, transaction_fee: nil) + # Payload for the wallet.funds_deposited webhook event. + # + # @param amount [String] The amount transferred, as a stringified bigint. + # + # @param asset [Privy::Models::WalletFundsNativeTokenAsset, Privy::Models::WalletFundsErc20Asset, Privy::Models::WalletFundsSplAsset, Privy::Models::WalletFundsSacAsset] An asset involved in a wallet transfer. + # + # @param block [Privy::Models::FundsDepositedWebhookPayload::Block] + # + # @param caip2 [String] The CAIP-2 chain identifier. + # + # @param idempotency_key [String] A unique key for this event. + # + # @param recipient [String] The recipient address. + # + # @param sender [String] The sender address. + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param type [Symbol, Privy::Models::FundsDepositedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet. + # + # @param bridge_metadata [Privy::Models::BridgeCryptoDepositMetadata, Privy::Models::BridgeRefundMetadata, Privy::Models::BridgeFiatDepositMetadata, Privy::Models::BridgeCryptoTransferMetadata, Privy::Models::BridgeFiatTransferMetadata, Privy::Models::BridgeTransferRefundMetadata, Privy::Models::BridgeStaticMemoDepositMetadata] Metadata about a Bridge transaction associated with a wallet event. + # + # @param transaction_fee [String] The transaction fee paid, as a stringified bigint in the chain's native token. + + # @see Privy::Models::FundsDepositedWebhookPayload#block + class Block < Privy::Internal::Type::BaseModel + # @!attribute number + # The block number. + # + # @return [Float] + required :number, Float + + # @!attribute timestamp + # The block timestamp. + # + # @return [Float] + required :timestamp, Float + + # @!method initialize(number:, timestamp:) + # @param number [Float] The block number. + # + # @param timestamp [Float] The block timestamp. + end + + # The type of webhook event. + # + # @see Privy::Models::FundsDepositedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_FUNDS_DEPOSITED = :"wallet.funds_deposited" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/funds_withdrawn_webhook_payload.rb b/lib/privy/models/funds_withdrawn_webhook_payload.rb new file mode 100644 index 0000000..08ef8e1 --- /dev/null +++ b/lib/privy/models/funds_withdrawn_webhook_payload.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +module Privy + module Models + class FundsWithdrawnWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute amount + # The amount transferred, as a stringified bigint. + # + # @return [String] + required :amount, String + + # @!attribute asset + # An asset involved in a wallet transfer. + # + # @return [Privy::Models::WalletFundsNativeTokenAsset, Privy::Models::WalletFundsErc20Asset, Privy::Models::WalletFundsSplAsset, Privy::Models::WalletFundsSacAsset] + required :asset, union: -> { Privy::WalletFundsAsset } + + # @!attribute block + # + # @return [Privy::Models::FundsWithdrawnWebhookPayload::Block] + required :block, -> { Privy::FundsWithdrawnWebhookPayload::Block } + + # @!attribute caip2 + # The CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute idempotency_key + # A unique key for this event. + # + # @return [String] + required :idempotency_key, String + + # @!attribute recipient + # The recipient address. + # + # @return [String] + required :recipient, String + + # @!attribute sender + # The sender address. + # + # @return [String] + required :sender, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::FundsWithdrawnWebhookPayload::Type] + required :type, enum: -> { Privy::FundsWithdrawnWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute transaction_fee + # The transaction fee paid, as a stringified bigint in the chain's native token. + # + # @return [String, nil] + optional :transaction_fee, String + + # @!method initialize(amount:, asset:, block:, caip2:, idempotency_key:, recipient:, sender:, transaction_hash:, type:, wallet_id:, transaction_fee: nil) + # Payload for the wallet.funds_withdrawn webhook event. + # + # @param amount [String] The amount transferred, as a stringified bigint. + # + # @param asset [Privy::Models::WalletFundsNativeTokenAsset, Privy::Models::WalletFundsErc20Asset, Privy::Models::WalletFundsSplAsset, Privy::Models::WalletFundsSacAsset] An asset involved in a wallet transfer. + # + # @param block [Privy::Models::FundsWithdrawnWebhookPayload::Block] + # + # @param caip2 [String] The CAIP-2 chain identifier. + # + # @param idempotency_key [String] A unique key for this event. + # + # @param recipient [String] The recipient address. + # + # @param sender [String] The sender address. + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param type [Symbol, Privy::Models::FundsWithdrawnWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet. + # + # @param transaction_fee [String] The transaction fee paid, as a stringified bigint in the chain's native token. + + # @see Privy::Models::FundsWithdrawnWebhookPayload#block + class Block < Privy::Internal::Type::BaseModel + # @!attribute number + # The block number. + # + # @return [Float] + required :number, Float + + # @!attribute timestamp + # The block timestamp. + # + # @return [Float] + required :timestamp, Float + + # @!method initialize(number:, timestamp:) + # @param number [Float] The block number. + # + # @param timestamp [Float] The block timestamp. + end + + # The type of webhook event. + # + # @see Privy::Models::FundsWithdrawnWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_FUNDS_WITHDRAWN = :"wallet.funds_withdrawn" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/gas_spend_currency.rb b/lib/privy/models/gas_spend_currency.rb new file mode 100644 index 0000000..c629dc9 --- /dev/null +++ b/lib/privy/models/gas_spend_currency.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Privy + module Models + # Currency for gas spend values. + module GasSpendCurrency + extend Privy::Internal::Type::Enum + + USD = :usd + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/gas_spend_request_body.rb b/lib/privy/models/gas_spend_request_body.rb new file mode 100644 index 0000000..e4ac67b --- /dev/null +++ b/lib/privy/models/gas_spend_request_body.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class GasSpendRequestBody < Privy::Internal::Type::BaseModel + # @!attribute end_timestamp + # Unix timestamp in milliseconds, exclusive. Must be greater than or equal to + # `start_timestamp`, and the range from `start_timestamp` to `end_timestamp` must + # not exceed 30 days. + # + # @return [Float] + required :end_timestamp, Float + + # @!attribute start_timestamp + # Unix timestamp in milliseconds, inclusive. Must be less than or equal to + # `end_timestamp`, and the range from `start_timestamp` to `end_timestamp` must + # not exceed 30 days. + # + # @return [Float] + required :start_timestamp, Float + + # @!attribute wallet_ids + # List of wallet IDs to query gas spend for. Maximum 100. + # + # @return [Array] + required :wallet_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(end_timestamp:, start_timestamp:, wallet_ids:) + # Some parameter documentations has been truncated, see + # {Privy::Models::GasSpendRequestBody} for more details. + # + # Query parameters for getting gas spend for a set of wallets. The time range from + # `start_timestamp` to `end_timestamp` must not exceed 30 days. + # + # @param end_timestamp [Float] Unix timestamp in milliseconds, exclusive. Must be greater than or equal to `sta + # + # @param start_timestamp [Float] Unix timestamp in milliseconds, inclusive. Must be less than or equal to `end_ti + # + # @param wallet_ids [Array] List of wallet IDs to query gas spend for. Maximum 100. + end + end +end diff --git a/lib/privy/models/gas_spend_response_body.rb b/lib/privy/models/gas_spend_response_body.rb new file mode 100644 index 0000000..7094e02 --- /dev/null +++ b/lib/privy/models/gas_spend_response_body.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Apps#get_gas_spend + class GasSpendResponseBody < Privy::Internal::Type::BaseModel + # @!attribute currency + # Currency for gas spend values. + # + # @return [Symbol, Privy::Models::GasSpendCurrency] + required :currency, enum: -> { Privy::GasSpendCurrency } + + # @!attribute value + # Total Privy credits charged as a decimal string. + # + # @return [String] + required :value, String + + # @!method initialize(currency:, value:) + # Aggregated Privy gas credits charged for a set of wallets over a time range. + # + # @param currency [Symbol, Privy::Models::GasSpendCurrency] Currency for gas spend values. + # + # @param value [String] Total Privy credits charged as a decimal string. + end + end +end diff --git a/lib/privy/models/gas_sponsorship_configuration.rb b/lib/privy/models/gas_sponsorship_configuration.rb new file mode 100644 index 0000000..ddcb3d1 --- /dev/null +++ b/lib/privy/models/gas_sponsorship_configuration.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class GasSponsorshipConfiguration < Privy::Internal::Type::BaseModel + # @!attribute configured_networks + # + # @return [Array] + required :configured_networks, Privy::Internal::Type::ArrayOf[String] + + # @!attribute require_app_secret + # + # @return [Boolean] + required :require_app_secret, Privy::Internal::Type::Boolean + + # @!attribute sponsorship_enabled + # + # @return [Boolean] + required :sponsorship_enabled, Privy::Internal::Type::Boolean + + # @!method initialize(configured_networks:, require_app_secret:, sponsorship_enabled:) + # Gas sponsorship configuration for an app. + # + # @param configured_networks [Array] + # @param require_app_secret [Boolean] + # @param sponsorship_enabled [Boolean] + end + end +end diff --git a/lib/privy/models/gas_sponsorship_configuration_input.rb b/lib/privy/models/gas_sponsorship_configuration_input.rb new file mode 100644 index 0000000..3d4a792 --- /dev/null +++ b/lib/privy/models/gas_sponsorship_configuration_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class GasSponsorshipConfigurationInput < Privy::Internal::Type::BaseModel + # @!attribute configured_networks + # + # @return [Array, nil] + optional :configured_networks, Privy::Internal::Type::ArrayOf[String] + + # @!attribute require_app_secret + # + # @return [Boolean, nil] + optional :require_app_secret, Privy::Internal::Type::Boolean + + # @!attribute sponsorship_enabled + # + # @return [Boolean, nil] + optional :sponsorship_enabled, Privy::Internal::Type::Boolean + + # @!method initialize(configured_networks: nil, require_app_secret: nil, sponsorship_enabled: nil) + # Input for configuring gas sponsorship settings for an app. + # + # @param configured_networks [Array] + # @param require_app_secret [Boolean] + # @param sponsorship_enabled [Boolean] + end + end +end diff --git a/lib/privy/models/get_by_wallet_address_request_body.rb b/lib/privy/models/get_by_wallet_address_request_body.rb new file mode 100644 index 0000000..b758921 --- /dev/null +++ b/lib/privy/models/get_by_wallet_address_request_body.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetByWalletAddressRequestBody < Privy::Internal::Type::BaseModel + # @!attribute address + # A blockchain wallet address (Ethereum or Solana). + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # Request body for looking up a wallet by its blockchain address. + # + # @param address [String] A blockchain wallet address (Ethereum or Solana). + end + end +end diff --git a/lib/privy/models/get_fiat_customer_request_input.rb b/lib/privy/models/get_fiat_customer_request_input.rb new file mode 100644 index 0000000..f651f23 --- /dev/null +++ b/lib/privy/models/get_fiat_customer_request_input.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetFiatCustomerRequestInput < Privy::Internal::Type::BaseModel + # @!attribute provider + # Valid set of onramp providers + # + # @return [Symbol, Privy::Models::OnrampProvider] + required :provider, enum: -> { Privy::OnrampProvider } + + # @!attribute kyc_redirect_url + # + # @return [String, nil] + optional :kyc_redirect_url, String + + # @!method initialize(provider:, kyc_redirect_url: nil) + # The request input for getting a native onramp provider customer. + # + # @param provider [Symbol, Privy::Models::OnrampProvider] Valid set of onramp providers + # + # @param kyc_redirect_url [String] + end + end +end diff --git a/lib/privy/models/get_fiat_onramp_quotes_input.rb b/lib/privy/models/get_fiat_onramp_quotes_input.rb new file mode 100644 index 0000000..6e44986 --- /dev/null +++ b/lib/privy/models/get_fiat_onramp_quotes_input.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetFiatOnrampQuotesInput < Privy::Internal::Type::BaseModel + # @!attribute destination + # Destination cryptocurrency details for a fiat onramp quote request. + # + # @return [Privy::Models::FiatOnrampDestination] + required :destination, -> { Privy::FiatOnrampDestination } + + # @!attribute environment + # Whether to use the sandbox or production environment for fiat onramp. + # + # @return [Symbol, Privy::Models::FiatOnrampEnvironment] + required :environment, enum: -> { Privy::FiatOnrampEnvironment } + + # @!attribute source + # Source currency details for a fiat onramp quote request. + # + # @return [Privy::Models::FiatOnrampSource] + required :source, -> { Privy::FiatOnrampSource } + + # @!method initialize(destination:, environment:, source:) + # The request input for getting fiat onramp quotes. + # + # @param destination [Privy::Models::FiatOnrampDestination] Destination cryptocurrency details for a fiat onramp quote request. + # + # @param environment [Symbol, Privy::Models::FiatOnrampEnvironment] Whether to use the sandbox or production environment for fiat onramp. + # + # @param source [Privy::Models::FiatOnrampSource] Source currency details for a fiat onramp quote request. + end + end +end diff --git a/lib/privy/models/get_fiat_onramp_quotes_response.rb b/lib/privy/models/get_fiat_onramp_quotes_response.rb new file mode 100644 index 0000000..d79b80c --- /dev/null +++ b/lib/privy/models/get_fiat_onramp_quotes_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetFiatOnrampQuotesResponse < Privy::Internal::Type::BaseModel + # @!attribute quotes + # + # @return [Array] + required :quotes, -> { Privy::Internal::Type::ArrayOf[Privy::FiatOnrampQuote] } + + # @!attribute provider_errors + # + # @return [Array, nil] + optional :provider_errors, -> { Privy::Internal::Type::ArrayOf[Privy::FiatOnrampProviderError] } + + # @!method initialize(quotes:, provider_errors: nil) + # The response containing fiat onramp quotes. + # + # @param quotes [Array] + # @param provider_errors [Array] + end + end +end diff --git a/lib/privy/models/get_fiat_onramp_transaction_status_input.rb b/lib/privy/models/get_fiat_onramp_transaction_status_input.rb new file mode 100644 index 0000000..37407ec --- /dev/null +++ b/lib/privy/models/get_fiat_onramp_transaction_status_input.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetFiatOnrampTransactionStatusInput < Privy::Internal::Type::BaseModel + # @!attribute provider + # The fiat onramp provider to use. + # + # @return [Symbol, Privy::Models::FiatOnrampProvider] + required :provider, enum: -> { Privy::FiatOnrampProvider } + + # @!attribute session_id + # + # @return [String] + required :session_id, String + + # @!method initialize(provider:, session_id:) + # The request input for checking a fiat onramp session status. + # + # @param provider [Symbol, Privy::Models::FiatOnrampProvider] The fiat onramp provider to use. + # + # @param session_id [String] + end + end +end diff --git a/lib/privy/models/get_fiat_onramp_transaction_status_response.rb b/lib/privy/models/get_fiat_onramp_transaction_status_response.rb new file mode 100644 index 0000000..7d8828c --- /dev/null +++ b/lib/privy/models/get_fiat_onramp_transaction_status_response.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetFiatOnrampTransactionStatusResponse < Privy::Internal::Type::BaseModel + # @!attribute raw_status + # + # @return [String] + required :raw_status, String + + # @!attribute session_id + # + # @return [String] + required :session_id, String + + # @!attribute status + # Normalized fiat onramp transaction status. + # + # @return [Symbol, Privy::Models::FiatOnrampTransactionStatus] + required :status, enum: -> { Privy::FiatOnrampTransactionStatus } + + # @!attribute transaction_id + # + # @return [String, nil] + optional :transaction_id, String + + # @!method initialize(raw_status:, session_id:, status:, transaction_id: nil) + # The response containing the fiat onramp session status. + # + # @param raw_status [String] + # + # @param session_id [String] + # + # @param status [Symbol, Privy::Models::FiatOnrampTransactionStatus] Normalized fiat onramp transaction status. + # + # @param transaction_id [String] + end + end +end diff --git a/lib/privy/models/get_fiat_onramp_url_input.rb b/lib/privy/models/get_fiat_onramp_url_input.rb new file mode 100644 index 0000000..f180202 --- /dev/null +++ b/lib/privy/models/get_fiat_onramp_url_input.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetFiatOnrampURLInput < Privy::Internal::Type::BaseModel + # @!attribute destination + # Destination cryptocurrency details for a fiat onramp quote request. + # + # @return [Privy::Models::FiatOnrampDestination] + required :destination, -> { Privy::FiatOnrampDestination } + + # @!attribute payment_method + # + # @return [String] + required :payment_method, String + + # @!attribute provider + # The fiat onramp provider to use. + # + # @return [Symbol, Privy::Models::FiatOnrampProvider] + required :provider, enum: -> { Privy::FiatOnrampProvider } + + # @!attribute source + # Source currency details for a fiat onramp quote request. + # + # @return [Privy::Models::FiatOnrampSource] + required :source, -> { Privy::FiatOnrampSource } + + # @!attribute redirect_url + # + # @return [String, nil] + optional :redirect_url, String + + # @!attribute sub_provider + # + # @return [String, nil] + optional :sub_provider, String + + # @!method initialize(destination:, payment_method:, provider:, source:, redirect_url: nil, sub_provider: nil) + # The request input for getting a fiat onramp provider session URL. + # + # @param destination [Privy::Models::FiatOnrampDestination] Destination cryptocurrency details for a fiat onramp quote request. + # + # @param payment_method [String] + # + # @param provider [Symbol, Privy::Models::FiatOnrampProvider] The fiat onramp provider to use. + # + # @param source [Privy::Models::FiatOnrampSource] Source currency details for a fiat onramp quote request. + # + # @param redirect_url [String] + # + # @param sub_provider [String] + end + end +end diff --git a/lib/privy/models/get_fiat_onramp_url_response.rb b/lib/privy/models/get_fiat_onramp_url_response.rb new file mode 100644 index 0000000..ff833c8 --- /dev/null +++ b/lib/privy/models/get_fiat_onramp_url_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class GetFiatOnrampURLResponse < Privy::Internal::Type::BaseModel + # @!attribute session_id + # + # @return [String] + required :session_id, String + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(session_id:, url:) + # The response containing a fiat onramp provider session URL. + # + # @param session_id [String] + # @param url [String] + end + end +end diff --git a/lib/privy/models/guest_authenticate_request_body.rb b/lib/privy/models/guest_authenticate_request_body.rb new file mode 100644 index 0000000..8aeaea4 --- /dev/null +++ b/lib/privy/models/guest_authenticate_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class GuestAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute guest_credential + # + # @return [String] + required :guest_credential, String + + # @!method initialize(guest_credential:) + # The request body for authenticating a guest. + # + # @param guest_credential [String] + end + end +end diff --git a/lib/privy/models/hd_init_input.rb b/lib/privy/models/hd_init_input.rb new file mode 100644 index 0000000..e64b362 --- /dev/null +++ b/lib/privy/models/hd_init_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class HDInitInput < Privy::Internal::Type::BaseModel + # @!attribute address + # The address of the wallet to import. + # + # @return [String] + required :address, String + + # @!attribute chain_type + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + # + # @return [Symbol, Privy::Models::WalletImportSupportedChains] + required :chain_type, enum: -> { Privy::WalletImportSupportedChains } + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute entropy_type + # The entropy type of the wallet to import. + # + # @return [Symbol, Privy::Models::HDInitInput::EntropyType] + required :entropy_type, enum: -> { Privy::HDInitInput::EntropyType } + + # @!attribute index + # The index of the wallet to import. + # + # @return [Integer] + required :index, Integer + + # @!method initialize(address:, chain_type:, encryption_type:, entropy_type:, index:) + # Some parameter documentations has been truncated, see + # {Privy::Models::HDInitInput} for more details. + # + # The input for HD wallets. + # + # @param address [String] The address of the wallet to import. + # + # @param chain_type [Symbol, Privy::Models::WalletImportSupportedChains] The chain type of the wallet to import. Currently supports `ethereum` and `solan + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param entropy_type [Symbol, Privy::Models::HDInitInput::EntropyType] The entropy type of the wallet to import. + # + # @param index [Integer] The index of the wallet to import. + + # The entropy type of the wallet to import. + # + # @see Privy::Models::HDInitInput#entropy_type + module EntropyType + extend Privy::Internal::Type::Enum + + HD = :hd + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/hd_path.rb b/lib/privy/models/hd_path.rb new file mode 100644 index 0000000..6588f98 --- /dev/null +++ b/lib/privy/models/hd_path.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + HDPath = String + end +end diff --git a/lib/privy/models/hd_submit_input.rb b/lib/privy/models/hd_submit_input.rb new file mode 100644 index 0000000..4cad808 --- /dev/null +++ b/lib/privy/models/hd_submit_input.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +module Privy + module Models + class HDSubmitInput < Privy::Internal::Type::BaseModel + # @!attribute address + # The address of the wallet to import. + # + # @return [String] + required :address, String + + # @!attribute chain_type + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + # + # @return [Symbol, Privy::Models::WalletImportSupportedChains] + required :chain_type, enum: -> { Privy::WalletImportSupportedChains } + + # @!attribute ciphertext + # The encrypted entropy of the wallet to import. + # + # @return [String] + required :ciphertext, String + + # @!attribute encapsulated_key + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption inside the TEE. + # + # @return [String] + required :encapsulated_key, String + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute entropy_type + # The entropy type of the wallet to import. + # + # @return [Symbol, Privy::Models::HDSubmitInput::EntropyType] + required :entropy_type, enum: -> { Privy::HDSubmitInput::EntropyType } + + # @!attribute index + # The index of the wallet to import. + # + # @return [Integer] + required :index, Integer + + # @!attribute hpke_config + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + # + # @return [Privy::Models::HpkeImportConfig, nil] + optional :hpke_config, -> { Privy::HpkeImportConfig } + + # @!method initialize(address:, chain_type:, ciphertext:, encapsulated_key:, encryption_type:, entropy_type:, index:, hpke_config: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::HDSubmitInput} for more details. + # + # The submission input for importing an HD wallet. + # + # @param address [String] The address of the wallet to import. + # + # @param chain_type [Symbol, Privy::Models::WalletImportSupportedChains] The chain type of the wallet to import. Currently supports `ethereum` and `solan + # + # @param ciphertext [String] The encrypted entropy of the wallet to import. + # + # @param encapsulated_key [String] The base64-encoded encapsulated key that was generated during encryption, for us + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param entropy_type [Symbol, Privy::Models::HDSubmitInput::EntropyType] The entropy type of the wallet to import. + # + # @param index [Integer] The index of the wallet to import. + # + # @param hpke_config [Privy::Models::HpkeImportConfig] Optional HPKE configuration for wallet import decryption. These parameters allow + + # The entropy type of the wallet to import. + # + # @see Privy::Models::HDSubmitInput#entropy_type + module EntropyType + extend Privy::Internal::Type::Enum + + HD = :hd + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/hex.rb b/lib/privy/models/hex.rb new file mode 100644 index 0000000..ecfadb8 --- /dev/null +++ b/lib/privy/models/hex.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + Hex = String + end +end diff --git a/lib/privy/models/hpke_aead_algorithm.rb b/lib/privy/models/hpke_aead_algorithm.rb new file mode 100644 index 0000000..4517ac4 --- /dev/null +++ b/lib/privy/models/hpke_aead_algorithm.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The AEAD algorithm used for HPKE encryption. + module HpkeAeadAlgorithm + extend Privy::Internal::Type::Enum + + CHACHA20_POLY1305 = :CHACHA20_POLY1305 + AES_GCM256 = :AES_GCM256 + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/hpke_encryption.rb b/lib/privy/models/hpke_encryption.rb new file mode 100644 index 0000000..2fcb232 --- /dev/null +++ b/lib/privy/models/hpke_encryption.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Privy + module Models + # The encryption type of the wallet to import. Currently only supports `HPKE`. + module HpkeEncryption + extend Privy::Internal::Type::Enum + + HPKE = :HPKE + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/hpke_import_config.rb b/lib/privy/models/hpke_import_config.rb new file mode 100644 index 0000000..ed791e4 --- /dev/null +++ b/lib/privy/models/hpke_import_config.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class HpkeImportConfig < Privy::Internal::Type::BaseModel + # @!attribute aad + # Additional Authenticated Data (AAD) used during encryption. Should be + # base64-encoded bytes. + # + # @return [String, nil] + optional :aad, String + + # @!attribute aead_algorithm + # The AEAD algorithm used for HPKE encryption. + # + # @return [Symbol, Privy::Models::HpkeAeadAlgorithm, nil] + optional :aead_algorithm, enum: -> { Privy::HpkeAeadAlgorithm } + + # @!attribute info + # Application-specific context information (INFO) used during HPKE encryption. + # Should be base64-encoded bytes. + # + # @return [String, nil] + optional :info, String + + # @!method initialize(aad: nil, aead_algorithm: nil, info: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::HpkeImportConfig} for more details. + # + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + # + # @param aad [String] Additional Authenticated Data (AAD) used during encryption. Should be base64-enc + # + # @param aead_algorithm [Symbol, Privy::Models::HpkeAeadAlgorithm] The AEAD algorithm used for HPKE encryption. + # + # @param info [String] Application-specific context information (INFO) used during HPKE encryption. Sho + end + end +end diff --git a/lib/privy/models/icloud_client_type.rb b/lib/privy/models/icloud_client_type.rb new file mode 100644 index 0000000..1ce4285 --- /dev/null +++ b/lib/privy/models/icloud_client_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The client type for iCloud recovery operations. + module ICloudClientType + extend Privy::Internal::Type::Enum + + WEB = :web + EXPO_IOS = :"expo-ios" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/intent_authorization.rb b/lib/privy/models/intent_authorization.rb new file mode 100644 index 0000000..bff4c24 --- /dev/null +++ b/lib/privy/models/intent_authorization.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class IntentAuthorization < Privy::Internal::Type::BaseModel + # @!attribute members + # Members in this authorization quorum + # + # @return [Array] + required :members, -> { Privy::Internal::Type::ArrayOf[union: Privy::IntentAuthorizationMember] } + + # @!attribute threshold + # Number of signatures required to satisfy this quorum + # + # @return [Float] + required :threshold, Float + + # @!attribute display_name + # Display name of the key quorum + # + # @return [String, nil] + optional :display_name, String + + # @!method initialize(members:, threshold:, display_name: nil) + # Authorization quorum for an intent + # + # @param members [Array] Members in this authorization quorum + # + # @param threshold [Float] Number of signatures required to satisfy this quorum + # + # @param display_name [String] Display name of the key quorum + end + end +end diff --git a/lib/privy/models/intent_authorization_key_quorum_member.rb b/lib/privy/models/intent_authorization_key_quorum_member.rb new file mode 100644 index 0000000..74f0c43 --- /dev/null +++ b/lib/privy/models/intent_authorization_key_quorum_member.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +module Privy + module Models + # A leaf member (user or key) of a nested key quorum in an intent authorization. + module IntentAuthorizationKeyQuorumMember + extend Privy::Internal::Type::Union + + variant -> { Privy::IntentAuthorizationKeyQuorumMember::UserMember } + + variant -> { Privy::IntentAuthorizationKeyQuorumMember::KeyMember } + + class UserMember < Privy::Internal::Type::BaseModel + # @!attribute signed_at + # Unix timestamp when this member signed, or null if not yet signed. + # + # @return [Float, nil] + required :signed_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember::Type] + required :type, enum: -> { Privy::IntentAuthorizationKeyQuorumMember::UserMember::Type } + + # @!attribute user_id + # User ID of the key quorum member + # + # @return [String] + required :user_id, String + + # @!method initialize(signed_at:, type:, user_id:) + # @param signed_at [Float, nil] Unix timestamp when this member signed, or null if not yet signed. + # + # @param type [Symbol, Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember::Type] + # + # @param user_id [String] User ID of the key quorum member + + # @see Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember#type + module Type + extend Privy::Internal::Type::Enum + + USER = :user + + # @!method self.values + # @return [Array] + end + end + + class KeyMember < Privy::Internal::Type::BaseModel + # @!attribute public_key + # Public key of the key quorum member + # + # @return [String] + required :public_key, String + + # @!attribute signed_at + # Unix timestamp when this member signed, or null if not yet signed. + # + # @return [Float, nil] + required :signed_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember::Type] + required :type, enum: -> { Privy::IntentAuthorizationKeyQuorumMember::KeyMember::Type } + + # @!method initialize(public_key:, signed_at:, type:) + # @param public_key [String] Public key of the key quorum member + # + # @param signed_at [Float, nil] Unix timestamp when this member signed, or null if not yet signed. + # + # @param type [Symbol, Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember::Type] + + # @see Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember#type + module Type + extend Privy::Internal::Type::Enum + + KEY = :key + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember, Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember)] + end + end +end diff --git a/lib/privy/models/intent_authorization_member.rb b/lib/privy/models/intent_authorization_member.rb new file mode 100644 index 0000000..e68cb1c --- /dev/null +++ b/lib/privy/models/intent_authorization_member.rb @@ -0,0 +1,152 @@ +# frozen_string_literal: true + +module Privy + module Models + # A member of an intent authorization quorum. Can be a user, key, or nested key + # quorum. + module IntentAuthorizationMember + extend Privy::Internal::Type::Union + + variant -> { Privy::IntentAuthorizationMember::UserMember } + + variant -> { Privy::IntentAuthorizationMember::KeyMember } + + variant -> { Privy::IntentAuthorizationMember::KeyQuorumMember } + + class UserMember < Privy::Internal::Type::BaseModel + # @!attribute signed_at + # Unix timestamp when this member signed, or null if not yet signed. + # + # @return [Float, nil] + required :signed_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::IntentAuthorizationMember::UserMember::Type] + required :type, enum: -> { Privy::IntentAuthorizationMember::UserMember::Type } + + # @!attribute user_id + # User ID of the key quorum member + # + # @return [String] + required :user_id, String + + # @!method initialize(signed_at:, type:, user_id:) + # @param signed_at [Float, nil] Unix timestamp when this member signed, or null if not yet signed. + # + # @param type [Symbol, Privy::Models::IntentAuthorizationMember::UserMember::Type] + # + # @param user_id [String] User ID of the key quorum member + + # @see Privy::Models::IntentAuthorizationMember::UserMember#type + module Type + extend Privy::Internal::Type::Enum + + USER = :user + + # @!method self.values + # @return [Array] + end + end + + class KeyMember < Privy::Internal::Type::BaseModel + # @!attribute public_key + # Public key of the key quorum member + # + # @return [String] + required :public_key, String + + # @!attribute signed_at + # Unix timestamp when this member signed, or null if not yet signed. + # + # @return [Float, nil] + required :signed_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::IntentAuthorizationMember::KeyMember::Type] + required :type, enum: -> { Privy::IntentAuthorizationMember::KeyMember::Type } + + # @!method initialize(public_key:, signed_at:, type:) + # @param public_key [String] Public key of the key quorum member + # + # @param signed_at [Float, nil] Unix timestamp when this member signed, or null if not yet signed. + # + # @param type [Symbol, Privy::Models::IntentAuthorizationMember::KeyMember::Type] + + # @see Privy::Models::IntentAuthorizationMember::KeyMember#type + module Type + extend Privy::Internal::Type::Enum + + KEY = :key + + # @!method self.values + # @return [Array] + end + end + + class KeyQuorumMember < Privy::Internal::Type::BaseModel + # @!attribute key_quorum_id + # ID of the child key quorum member + # + # @return [String] + required :key_quorum_id, String + + # @!attribute members + # Members of this child quorum + # + # @return [Array] + required :members, -> { Privy::Internal::Type::ArrayOf[union: Privy::IntentAuthorizationKeyQuorumMember] } + + # @!attribute threshold + # Number of signatures required from this child quorum + # + # @return [Float] + required :threshold, Float + + # @!attribute threshold_met + # Whether this child key quorum has met its signature threshold + # + # @return [Boolean] + required :threshold_met, Privy::Internal::Type::Boolean + + # @!attribute type + # + # @return [Symbol, Privy::Models::IntentAuthorizationMember::KeyQuorumMember::Type] + required :type, enum: -> { Privy::IntentAuthorizationMember::KeyQuorumMember::Type } + + # @!attribute display_name + # Display name for the child key quorum (if any) + # + # @return [String, nil] + optional :display_name, String + + # @!method initialize(key_quorum_id:, members:, threshold:, threshold_met:, type:, display_name: nil) + # @param key_quorum_id [String] ID of the child key quorum member + # + # @param members [Array] Members of this child quorum + # + # @param threshold [Float] Number of signatures required from this child quorum + # + # @param threshold_met [Boolean] Whether this child key quorum has met its signature threshold + # + # @param type [Symbol, Privy::Models::IntentAuthorizationMember::KeyQuorumMember::Type] + # + # @param display_name [String] Display name for the child key quorum (if any) + + # @see Privy::Models::IntentAuthorizationMember::KeyQuorumMember#type + module Type + extend Privy::Internal::Type::Enum + + KEY_QUORUM = :key_quorum + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Privy::Models::IntentAuthorizationMember::UserMember, Privy::Models::IntentAuthorizationMember::KeyMember, Privy::Models::IntentAuthorizationMember::KeyQuorumMember)] + end + end +end diff --git a/lib/privy/models/intent_authorized_webhook_payload.rb b/lib/privy/models/intent_authorized_webhook_payload.rb new file mode 100644 index 0000000..479c5c0 --- /dev/null +++ b/lib/privy/models/intent_authorized_webhook_payload.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +module Privy + module Models + class IntentAuthorizedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute authorized_at + # Unix timestamp when the authorization was recorded. + # + # @return [Float] + required :authorized_at, Float + + # @!attribute created_at + # Unix timestamp when the intent was created. + # + # @return [Float] + required :created_at, Float + + # @!attribute expires_at + # Unix timestamp when the intent expires. + # + # @return [Float] + required :expires_at, Float + + # @!attribute intent_id + # The unique ID of the intent. + # + # @return [String] + required :intent_id, String + + # @!attribute intent_type + # Type of intent. + # + # @return [Symbol, Privy::Models::IntentType] + required :intent_type, enum: -> { Privy::IntentType } + + # @!attribute member + # A leaf member (user or key) of a nested key quorum in an intent authorization. + # + # @return [Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember, Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember] + required :member, union: -> { Privy::IntentAuthorizationKeyQuorumMember } + + # @!attribute status + # The current status of the intent. + # + # @return [String] + required :status, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::IntentAuthorizedWebhookPayload::Type] + required :type, enum: -> { Privy::IntentAuthorizedWebhookPayload::Type } + + # @!attribute created_by_display_name + # Display name of the user who created the intent. + # + # @return [String, nil] + optional :created_by_display_name, String + + # @!attribute created_by_id + # The ID of the user who created the intent. + # + # @return [String, nil] + optional :created_by_id, String + + # @!method initialize(authorized_at:, created_at:, expires_at:, intent_id:, intent_type:, member:, status:, type:, created_by_display_name: nil, created_by_id: nil) + # Payload for the intent.authorized webhook event. + # + # @param authorized_at [Float] Unix timestamp when the authorization was recorded. + # + # @param created_at [Float] Unix timestamp when the intent was created. + # + # @param expires_at [Float] Unix timestamp when the intent expires. + # + # @param intent_id [String] The unique ID of the intent. + # + # @param intent_type [Symbol, Privy::Models::IntentType] Type of intent. + # + # @param member [Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember, Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember] A leaf member (user or key) of a nested key quorum in an intent authorization. + # + # @param status [String] The current status of the intent. + # + # @param type [Symbol, Privy::Models::IntentAuthorizedWebhookPayload::Type] The type of webhook event. + # + # @param created_by_display_name [String] Display name of the user who created the intent. + # + # @param created_by_id [String] The ID of the user who created the intent. + + # The type of webhook event. + # + # @see Privy::Models::IntentAuthorizedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + INTENT_AUTHORIZED = :"intent.authorized" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/intent_create_policy_rule_params.rb b/lib/privy/models/intent_create_policy_rule_params.rb new file mode 100644 index 0000000..dc46c54 --- /dev/null +++ b/lib/privy/models/intent_create_policy_rule_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#create_policy_rule + class IntentCreatePolicyRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # ID of the policy. + # + # @return [String] + required :policy_id, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentCreatePolicyRuleParams} for more details. + # + # @param policy_id [String] ID of the policy. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_created_webhook_payload.rb b/lib/privy/models/intent_created_webhook_payload.rb new file mode 100644 index 0000000..6591211 --- /dev/null +++ b/lib/privy/models/intent_created_webhook_payload.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Privy + module Models + class IntentCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute created_at + # Unix timestamp when the intent was created. + # + # @return [Float] + required :created_at, Float + + # @!attribute expires_at + # Unix timestamp when the intent expires. + # + # @return [Float] + required :expires_at, Float + + # @!attribute intent_id + # The unique ID of the intent. + # + # @return [String] + required :intent_id, String + + # @!attribute intent_type + # Type of intent. + # + # @return [Symbol, Privy::Models::IntentType] + required :intent_type, enum: -> { Privy::IntentType } + + # @!attribute status + # The current status of the intent. + # + # @return [String] + required :status, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::IntentCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::IntentCreatedWebhookPayload::Type } + + # @!attribute authorization_details + # Key quorums that can authorize this intent. + # + # @return [Array, nil] + optional :authorization_details, -> { Privy::Internal::Type::ArrayOf[Privy::IntentAuthorization] } + + # @!attribute created_by_display_name + # Display name of the user who created the intent. + # + # @return [String, nil] + optional :created_by_display_name, String + + # @!attribute created_by_id + # The ID of the user who created the intent. + # + # @return [String, nil] + optional :created_by_id, String + + # @!method initialize(created_at:, expires_at:, intent_id:, intent_type:, status:, type:, authorization_details: nil, created_by_display_name: nil, created_by_id: nil) + # Payload for the intent.created webhook event. + # + # @param created_at [Float] Unix timestamp when the intent was created. + # + # @param expires_at [Float] Unix timestamp when the intent expires. + # + # @param intent_id [String] The unique ID of the intent. + # + # @param intent_type [Symbol, Privy::Models::IntentType] Type of intent. + # + # @param status [String] The current status of the intent. + # + # @param type [Symbol, Privy::Models::IntentCreatedWebhookPayload::Type] The type of webhook event. + # + # @param authorization_details [Array] Key quorums that can authorize this intent. + # + # @param created_by_display_name [String] Display name of the user who created the intent. + # + # @param created_by_id [String] The ID of the user who created the intent. + + # The type of webhook event. + # + # @see Privy::Models::IntentCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + INTENT_CREATED = :"intent.created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/intent_creation_headers.rb b/lib/privy/models/intent_creation_headers.rb new file mode 100644 index 0000000..f50735a --- /dev/null +++ b/lib/privy/models/intent_creation_headers.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + class IntentCreationHeaders < Privy::Internal::Type::BaseModel + # @!attribute privy_app_id + # ID of your Privy app. + # + # @return [String] + required :privy_app_id, String, api_name: :"privy-app-id" + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String, api_name: :"privy-request-expiry" + + # @!method initialize(privy_app_id:, privy_request_expiry: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentCreationHeaders} for more details. + # + # Headers required to create an intent. + # + # @param privy_app_id [String] ID of your Privy app. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + end + end +end diff --git a/lib/privy/models/intent_delete_policy_rule_params.rb b/lib/privy/models/intent_delete_policy_rule_params.rb new file mode 100644 index 0000000..7d7a249 --- /dev/null +++ b/lib/privy/models/intent_delete_policy_rule_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#delete_policy_rule + class IntentDeletePolicyRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # ID of the policy. + # + # @return [String] + required :policy_id, String + + # @!attribute rule_id + # ID of the rule. + # + # @return [String] + required :rule_id, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, rule_id:, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentDeletePolicyRuleParams} for more details. + # + # @param policy_id [String] ID of the policy. + # + # @param rule_id [String] ID of the rule. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_executed_webhook_payload.rb b/lib/privy/models/intent_executed_webhook_payload.rb new file mode 100644 index 0000000..b42ce77 --- /dev/null +++ b/lib/privy/models/intent_executed_webhook_payload.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Privy + module Models + class IntentExecutedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_result + # Result of the successful intent execution. + # + # @return [Privy::Models::BaseActionResult] + required :action_result, -> { Privy::BaseActionResult } + + # @!attribute created_at + # Unix timestamp when the intent was created. + # + # @return [Float] + required :created_at, Float + + # @!attribute expires_at + # Unix timestamp when the intent expires. + # + # @return [Float] + required :expires_at, Float + + # @!attribute intent_id + # The unique ID of the intent. + # + # @return [String] + required :intent_id, String + + # @!attribute intent_type + # Type of intent. + # + # @return [Symbol, Privy::Models::IntentType] + required :intent_type, enum: -> { Privy::IntentType } + + # @!attribute status + # The current status of the intent. + # + # @return [String] + required :status, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::IntentExecutedWebhookPayload::Type] + required :type, enum: -> { Privy::IntentExecutedWebhookPayload::Type } + + # @!attribute created_by_display_name + # Display name of the user who created the intent. + # + # @return [String, nil] + optional :created_by_display_name, String + + # @!attribute created_by_id + # The ID of the user who created the intent. + # + # @return [String, nil] + optional :created_by_id, String + + # @!method initialize(action_result:, created_at:, expires_at:, intent_id:, intent_type:, status:, type:, created_by_display_name: nil, created_by_id: nil) + # Payload for the intent.executed webhook event. + # + # @param action_result [Privy::Models::BaseActionResult] Result of the successful intent execution. + # + # @param created_at [Float] Unix timestamp when the intent was created. + # + # @param expires_at [Float] Unix timestamp when the intent expires. + # + # @param intent_id [String] The unique ID of the intent. + # + # @param intent_type [Symbol, Privy::Models::IntentType] Type of intent. + # + # @param status [String] The current status of the intent. + # + # @param type [Symbol, Privy::Models::IntentExecutedWebhookPayload::Type] The type of webhook event. + # + # @param created_by_display_name [String] Display name of the user who created the intent. + # + # @param created_by_id [String] The ID of the user who created the intent. + + # The type of webhook event. + # + # @see Privy::Models::IntentExecutedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + INTENT_EXECUTED = :"intent.executed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/intent_failed_webhook_payload.rb b/lib/privy/models/intent_failed_webhook_payload.rb new file mode 100644 index 0000000..caa7733 --- /dev/null +++ b/lib/privy/models/intent_failed_webhook_payload.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Privy + module Models + class IntentFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_result + # Result of the failed intent execution. + # + # @return [Privy::Models::BaseActionResult] + required :action_result, -> { Privy::BaseActionResult } + + # @!attribute created_at + # Unix timestamp when the intent was created. + # + # @return [Float] + required :created_at, Float + + # @!attribute expires_at + # Unix timestamp when the intent expires. + # + # @return [Float] + required :expires_at, Float + + # @!attribute intent_id + # The unique ID of the intent. + # + # @return [String] + required :intent_id, String + + # @!attribute intent_type + # Type of intent. + # + # @return [Symbol, Privy::Models::IntentType] + required :intent_type, enum: -> { Privy::IntentType } + + # @!attribute status + # The current status of the intent. + # + # @return [String] + required :status, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::IntentFailedWebhookPayload::Type] + required :type, enum: -> { Privy::IntentFailedWebhookPayload::Type } + + # @!attribute created_by_display_name + # Display name of the user who created the intent. + # + # @return [String, nil] + optional :created_by_display_name, String + + # @!attribute created_by_id + # The ID of the user who created the intent. + # + # @return [String, nil] + optional :created_by_id, String + + # @!method initialize(action_result:, created_at:, expires_at:, intent_id:, intent_type:, status:, type:, created_by_display_name: nil, created_by_id: nil) + # Payload for the intent.failed webhook event. + # + # @param action_result [Privy::Models::BaseActionResult] Result of the failed intent execution. + # + # @param created_at [Float] Unix timestamp when the intent was created. + # + # @param expires_at [Float] Unix timestamp when the intent expires. + # + # @param intent_id [String] The unique ID of the intent. + # + # @param intent_type [Symbol, Privy::Models::IntentType] Type of intent. + # + # @param status [String] The current status of the intent. + # + # @param type [Symbol, Privy::Models::IntentFailedWebhookPayload::Type] The type of webhook event. + # + # @param created_by_display_name [String] Display name of the user who created the intent. + # + # @param created_by_id [String] The ID of the user who created the intent. + + # The type of webhook event. + # + # @see Privy::Models::IntentFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + INTENT_FAILED = :"intent.failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/intent_get_params.rb b/lib/privy/models/intent_get_params.rb new file mode 100644 index 0000000..be2cbcf --- /dev/null +++ b/lib/privy/models/intent_get_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#get + class IntentGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute intent_id + # ID of the intent. + # + # @return [String] + required :intent_id, String + + # @!method initialize(intent_id:, request_options: {}) + # @param intent_id [String] ID of the intent. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_list_params.rb b/lib/privy/models/intent_list_params.rb new file mode 100644 index 0000000..b5585fb --- /dev/null +++ b/lib/privy/models/intent_list_params.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#list + class IntentListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute created_by_id + # + # @return [String, nil] + optional :created_by_id, String + + # @!attribute current_user_has_signed + # + # @return [Symbol, Privy::Models::IntentListParams::CurrentUserHasSigned, nil] + optional :current_user_has_signed, enum: -> { Privy::IntentListParams::CurrentUserHasSigned } + + # @!attribute cursor + # + # @return [String, nil] + optional :cursor, String + + # @!attribute intent_type + # Type of intent. + # + # @return [Symbol, Privy::Models::IntentType, nil] + optional :intent_type, enum: -> { Privy::IntentType } + + # @!attribute limit + # + # @return [Float, nil] + optional :limit, Float, nil?: true + + # @!attribute pending_member_id + # + # @return [String, nil] + optional :pending_member_id, String + + # @!attribute resource_id + # + # @return [String, nil] + optional :resource_id, String + + # @!attribute sort_by + # + # @return [Symbol, Privy::Models::IntentListParams::SortBy, nil] + optional :sort_by, enum: -> { Privy::IntentListParams::SortBy } + + # @!attribute status + # Current status of an intent. + # + # @return [Symbol, Privy::Models::IntentStatus, nil] + optional :status, enum: -> { Privy::IntentStatus } + + # @!method initialize(created_by_id: nil, current_user_has_signed: nil, cursor: nil, intent_type: nil, limit: nil, pending_member_id: nil, resource_id: nil, sort_by: nil, status: nil, request_options: {}) + # @param created_by_id [String] + # + # @param current_user_has_signed [Symbol, Privy::Models::IntentListParams::CurrentUserHasSigned] + # + # @param cursor [String] + # + # @param intent_type [Symbol, Privy::Models::IntentType] Type of intent. + # + # @param limit [Float, nil] + # + # @param pending_member_id [String] + # + # @param resource_id [String] + # + # @param sort_by [Symbol, Privy::Models::IntentListParams::SortBy] + # + # @param status [Symbol, Privy::Models::IntentStatus] Current status of an intent. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + module CurrentUserHasSigned + extend Privy::Internal::Type::Enum + + TRUE = :true + FALSE = :false + + # @!method self.values + # @return [Array] + end + + module SortBy + extend Privy::Internal::Type::Enum + + CREATED_AT_DESC = :created_at_desc + EXPIRES_AT_ASC = :expires_at_asc + UPDATED_AT_DESC = :updated_at_desc + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/intent_rejected_webhook_payload.rb b/lib/privy/models/intent_rejected_webhook_payload.rb new file mode 100644 index 0000000..0377627 --- /dev/null +++ b/lib/privy/models/intent_rejected_webhook_payload.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Privy + module Models + class IntentRejectedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute created_at + # Unix timestamp when the intent was created. + # + # @return [Float] + required :created_at, Float + + # @!attribute expires_at + # Unix timestamp when the intent expires. + # + # @return [Float] + required :expires_at, Float + + # @!attribute intent_id + # The unique ID of the intent. + # + # @return [String] + required :intent_id, String + + # @!attribute intent_type + # Type of intent. + # + # @return [Symbol, Privy::Models::IntentType] + required :intent_type, enum: -> { Privy::IntentType } + + # @!attribute rejected_at + # Unix timestamp when the intent was rejected. + # + # @return [Float] + required :rejected_at, Float + + # @!attribute status + # The current status of the intent. + # + # @return [String] + required :status, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::IntentRejectedWebhookPayload::Type] + required :type, enum: -> { Privy::IntentRejectedWebhookPayload::Type } + + # @!attribute created_by_display_name + # Display name of the user who created the intent. + # + # @return [String, nil] + optional :created_by_display_name, String + + # @!attribute created_by_id + # The ID of the user who created the intent. + # + # @return [String, nil] + optional :created_by_id, String + + # @!method initialize(created_at:, expires_at:, intent_id:, intent_type:, rejected_at:, status:, type:, created_by_display_name: nil, created_by_id: nil) + # Payload for the intent.rejected webhook event. + # + # @param created_at [Float] Unix timestamp when the intent was created. + # + # @param expires_at [Float] Unix timestamp when the intent expires. + # + # @param intent_id [String] The unique ID of the intent. + # + # @param intent_type [Symbol, Privy::Models::IntentType] Type of intent. + # + # @param rejected_at [Float] Unix timestamp when the intent was rejected. + # + # @param status [String] The current status of the intent. + # + # @param type [Symbol, Privy::Models::IntentRejectedWebhookPayload::Type] The type of webhook event. + # + # @param created_by_display_name [String] Display name of the user who created the intent. + # + # @param created_by_id [String] The ID of the user who created the intent. + + # The type of webhook event. + # + # @see Privy::Models::IntentRejectedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + INTENT_REJECTED = :"intent.rejected" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/intent_response.rb b/lib/privy/models/intent_response.rb new file mode 100644 index 0000000..7d3e88b --- /dev/null +++ b/lib/privy/models/intent_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + # Response for an intent object + # + # @see Privy::Resources::Intents#list + module IntentResponse + extend Privy::Internal::Type::Union + + discriminator :intent_type + + # Response for an RPC intent + variant :RPC, -> { Privy::RpcIntentResponse } + + # Response for a transfer intent + variant :TRANSFER, -> { Privy::TransferIntentResponse } + + # Response for a wallet intent + variant :WALLET, -> { Privy::WalletIntentResponse } + + # Response for a policy intent + variant :POLICY, -> { Privy::PolicyIntentResponse } + + # Response for a rule intent + variant :RULE, -> { Privy::RuleIntentResponse } + + # Response for a key quorum intent + variant :KEY_QUORUM, -> { Privy::KeyQuorumIntentResponse } + + # @!method self.variants + # @return [Array(Privy::Models::RpcIntentResponse, Privy::Models::TransferIntentResponse, Privy::Models::WalletIntentResponse, Privy::Models::PolicyIntentResponse, Privy::Models::RuleIntentResponse, Privy::Models::KeyQuorumIntentResponse)] + end + end +end diff --git a/lib/privy/models/intent_rpc_params.rb b/lib/privy/models/intent_rpc_params.rb new file mode 100644 index 0000000..8f67a56 --- /dev/null +++ b/lib/privy/models/intent_rpc_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#rpc + class IntentRpcParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentRpcParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_status.rb b/lib/privy/models/intent_status.rb new file mode 100644 index 0000000..3304320 --- /dev/null +++ b/lib/privy/models/intent_status.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # Current status of an intent. + module IntentStatus + extend Privy::Internal::Type::Enum + + PENDING = :pending + EXECUTED = :executed + FAILED = :failed + EXPIRED = :expired + REJECTED = :rejected + DISMISSED = :dismissed + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/intent_transfer_params.rb b/lib/privy/models/intent_transfer_params.rb new file mode 100644 index 0000000..82dfb00 --- /dev/null +++ b/lib/privy/models/intent_transfer_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#transfer + class IntentTransferParams < Privy::Models::TransferRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentTransferParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_type.rb b/lib/privy/models/intent_type.rb new file mode 100644 index 0000000..8dca35d --- /dev/null +++ b/lib/privy/models/intent_type.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # Type of intent. + module IntentType + extend Privy::Internal::Type::Enum + + KEY_QUORUM = :KEY_QUORUM + POLICY = :POLICY + RULE = :RULE + RPC = :RPC + TRANSFER = :TRANSFER + WALLET = :WALLET + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/intent_update_key_quorum_params.rb b/lib/privy/models/intent_update_key_quorum_params.rb new file mode 100644 index 0000000..c53134b --- /dev/null +++ b/lib/privy/models/intent_update_key_quorum_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#update_key_quorum + class IntentUpdateKeyQuorumParams < Privy::Models::KeyQuorumUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute key_quorum_id + # ID of the key quorum. + # + # @return [String] + required :key_quorum_id, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(key_quorum_id:, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdateKeyQuorumParams} for more details. + # + # @param key_quorum_id [String] ID of the key quorum. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_update_policy_params.rb b/lib/privy/models/intent_update_policy_params.rb new file mode 100644 index 0000000..8d9d160 --- /dev/null +++ b/lib/privy/models/intent_update_policy_params.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#update_policy + class IntentUpdatePolicyParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # ID of the policy. + # + # @return [String] + required :policy_id, String + + # @!attribute name + # Name to assign to policy. + # + # @return [String, nil] + optional :name, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute rules + # + # @return [Array, nil] + optional :rules, -> { Privy::Internal::Type::ArrayOf[Privy::PolicyRuleRequestBody] } + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, name: nil, owner: nil, owner_id: nil, rules: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdatePolicyParams} for more details. + # + # @param policy_id [String] ID of the policy. + # + # @param name [String] Name to assign to policy. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param rules [Array] + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_update_policy_rule_params.rb b/lib/privy/models/intent_update_policy_rule_params.rb new file mode 100644 index 0000000..f646b60 --- /dev/null +++ b/lib/privy/models/intent_update_policy_rule_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#update_policy_rule + class IntentUpdatePolicyRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # ID of the policy. + # + # @return [String] + required :policy_id, String + + # @!attribute rule_id + # ID of the rule. + # + # @return [String] + required :rule_id, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, rule_id:, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdatePolicyRuleParams} for more details. + # + # @param policy_id [String] ID of the policy. + # + # @param rule_id [String] ID of the rule. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/intent_update_wallet_params.rb b/lib/privy/models/intent_update_wallet_params.rb new file mode 100644 index 0000000..078dcfc --- /dev/null +++ b/lib/privy/models/intent_update_wallet_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#update_wallet + class IntentUpdateWalletParams < Privy::Models::WalletUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdateWalletParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/key_quorum.rb b/lib/privy/models/key_quorum.rb new file mode 100644 index 0000000..e6e43a5 --- /dev/null +++ b/lib/privy/models/key_quorum.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::KeyQuorums#create + class KeyQuorum < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute authorization_keys + # + # @return [Array] + required :authorization_keys, -> { Privy::Internal::Type::ArrayOf[Privy::KeyQuorum::AuthorizationKey] } + + # @!attribute authorization_threshold + # + # @return [Float, nil] + required :authorization_threshold, Float, nil?: true + + # @!attribute display_name + # + # @return [String, nil] + required :display_name, String, nil?: true + + # @!attribute user_ids + # + # @return [Array, nil] + required :user_ids, Privy::Internal::Type::ArrayOf[String], nil?: true + + # @!attribute key_quorum_ids + # List of nested key quorum IDs that are members of this key quorum. + # + # @return [Array, nil] + optional :key_quorum_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(id:, authorization_keys:, authorization_threshold:, display_name:, user_ids:, key_quorum_ids: nil) + # A key quorum for authorizing wallet operations. + # + # @param id [String] + # + # @param authorization_keys [Array] + # + # @param authorization_threshold [Float, nil] + # + # @param display_name [String, nil] + # + # @param user_ids [Array, nil] + # + # @param key_quorum_ids [Array] List of nested key quorum IDs that are members of this key quorum. + + class AuthorizationKey < Privy::Internal::Type::BaseModel + # @!attribute display_name + # + # @return [String, nil] + required :display_name, String, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!method initialize(display_name:, public_key:) + # @param display_name [String, nil] + # @param public_key [String] + end + end + end +end diff --git a/lib/privy/models/key_quorum_authorization_headers.rb b/lib/privy/models/key_quorum_authorization_headers.rb new file mode 100644 index 0000000..ab37ec3 --- /dev/null +++ b/lib/privy/models/key_quorum_authorization_headers.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class KeyQuorumAuthorizationHeaders < Privy::Internal::Type::BaseModel + # @!attribute privy_app_id + # ID of your Privy app. + # + # @return [String] + required :privy_app_id, String, api_name: :"privy-app-id" + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String, api_name: :"privy-authorization-signature" + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String, api_name: :"privy-request-expiry" + + # @!method initialize(privy_app_id:, privy_authorization_signature: nil, privy_request_expiry: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumAuthorizationHeaders} for more details. + # + # Headers required to authorize modifications to key quorums. + # + # @param privy_app_id [String] ID of your Privy app. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + end + end +end diff --git a/lib/privy/models/key_quorum_create_params.rb b/lib/privy/models/key_quorum_create_params.rb new file mode 100644 index 0000000..20fd733 --- /dev/null +++ b/lib/privy/models/key_quorum_create_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::KeyQuorums#create + class KeyQuorumCreateParams < Privy::Models::KeyQuorumCreateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/key_quorum_create_request_body.rb b/lib/privy/models/key_quorum_create_request_body.rb new file mode 100644 index 0000000..0373688 --- /dev/null +++ b/lib/privy/models/key_quorum_create_request_body.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Privy + module Models + class KeyQuorumCreateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute authorization_threshold + # The number of keys that must sign for an action to be valid. Must be less than + # or equal to total number of key quorum members. + # + # @return [Float, nil] + optional :authorization_threshold, Float + + # @!attribute display_name + # + # @return [String, nil] + optional :display_name, String + + # @!attribute key_quorum_ids + # List of key quorum IDs that should be members of this key quorum. Key quorums + # can only be nested 1 level deep. At least one of `user_ids`, `public_keys`, or + # `key_quorum_ids` is required. + # + # @return [Array, nil] + optional :key_quorum_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute public_keys + # List of P-256 public keys of the keys that should be authorized to sign on the + # key quorum, in base64-encoded DER format. At least one of `user_ids`, + # `public_keys`, or `key_quorum_ids` is required. + # + # @return [Array, nil] + optional :public_keys, Privy::Internal::Type::ArrayOf[String] + + # @!attribute user_ids + # List of user IDs of the users that should be authorized to sign on the key + # quorum. At least one of `user_ids`, `public_keys`, or `key_quorum_ids` is + # required. + # + # @return [Array, nil] + optional :user_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(authorization_threshold: nil, display_name: nil, key_quorum_ids: nil, public_keys: nil, user_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumCreateRequestBody} for more details. + # + # Request input for creating a key quorum. At least one of `user_ids`, + # `public_keys`, or `key_quorum_ids` is required. + # + # @param authorization_threshold [Float] The number of keys that must sign for an action to be valid. Must be less than o + # + # @param display_name [String] + # + # @param key_quorum_ids [Array] List of key quorum IDs that should be members of this key quorum. Key quorums ca + # + # @param public_keys [Array] List of P-256 public keys of the keys that should be authorized to sign on the k + # + # @param user_ids [Array] List of user IDs of the users that should be authorized to sign on the key quoru + end + end +end diff --git a/lib/privy/models/key_quorum_delete_params.rb b/lib/privy/models/key_quorum_delete_params.rb new file mode 100644 index 0000000..fafbf5e --- /dev/null +++ b/lib/privy/models/key_quorum_delete_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::KeyQuorums#delete + class KeyQuorumDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute key_quorum_id + # A unique identifier for a key quorum. + # + # @return [String] + required :key_quorum_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(key_quorum_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumDeleteParams} for more details. + # + # @param key_quorum_id [String] A unique identifier for a key quorum. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/key_quorum_get_params.rb b/lib/privy/models/key_quorum_get_params.rb new file mode 100644 index 0000000..3c95cf4 --- /dev/null +++ b/lib/privy/models/key_quorum_get_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::KeyQuorums#get + class KeyQuorumGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute key_quorum_id + # A unique identifier for a key quorum. + # + # @return [String] + required :key_quorum_id, String + + # @!method initialize(key_quorum_id:, request_options: {}) + # @param key_quorum_id [String] A unique identifier for a key quorum. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/key_quorum_id.rb b/lib/privy/models/key_quorum_id.rb new file mode 100644 index 0000000..0c7fd19 --- /dev/null +++ b/lib/privy/models/key_quorum_id.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + KeyQuorumID = String + end +end diff --git a/lib/privy/models/key_quorum_intent_response.rb b/lib/privy/models/key_quorum_intent_response.rb new file mode 100644 index 0000000..9afe99b --- /dev/null +++ b/lib/privy/models/key_quorum_intent_response.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#update_key_quorum + class KeyQuorumIntentResponse < Privy::Models::BaseIntentResponse + # @!attribute intent_type + # + # @return [Symbol, Privy::Models::KeyQuorumIntentResponse::IntentType] + required :intent_type, enum: -> { Privy::KeyQuorumIntentResponse::IntentType } + + # @!attribute request_details + # The original key quorum update request that would be sent to the key quorum + # endpoint + # + # @return [Privy::Models::KeyQuorumIntentResponse::RequestDetails] + required :request_details, -> { Privy::KeyQuorumIntentResponse::RequestDetails } + + # @!attribute action_result + # Result of key quorum update execution (only present if status is 'executed' or + # 'failed') + # + # @return [Privy::Models::BaseActionResult, nil] + optional :action_result, -> { Privy::BaseActionResult } + + # @!attribute current_resource_data + # A key quorum for authorizing wallet operations. + # + # @return [Privy::Models::KeyQuorum, nil] + optional :current_resource_data, -> { Privy::KeyQuorum } + + # @!method initialize(intent_type:, request_details:, action_result: nil, current_resource_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumIntentResponse} for more details. + # + # Response for a key quorum intent + # + # @param intent_type [Symbol, Privy::Models::KeyQuorumIntentResponse::IntentType] + # + # @param request_details [Privy::Models::KeyQuorumIntentResponse::RequestDetails] The original key quorum update request that would be sent to the key quorum endp + # + # @param action_result [Privy::Models::BaseActionResult] Result of key quorum update execution (only present if status is 'executed' or ' + # + # @param current_resource_data [Privy::Models::KeyQuorum] A key quorum for authorizing wallet operations. + + module IntentType + extend Privy::Internal::Type::Enum + + KEY_QUORUM = :KEY_QUORUM + + # @!method self.values + # @return [Array] + end + + class RequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # Request input for updating an existing key quorum. At least one field must be + # provided. + # + # @return [Privy::Models::KeyQuorumUpdateRequestBody] + required :body, -> { Privy::KeyQuorumUpdateRequestBody } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::KeyQuorumIntentResponse::RequestDetails::Method] + required :method_, + enum: -> { + Privy::KeyQuorumIntentResponse::RequestDetails::Method + }, + api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumIntentResponse::RequestDetails} for more details. + # + # The original key quorum update request that would be sent to the key quorum + # endpoint + # + # @param body [Privy::Models::KeyQuorumUpdateRequestBody] Request input for updating an existing key quorum. At least one field must be pr + # + # @param method_ [Symbol, Privy::Models::KeyQuorumIntentResponse::RequestDetails::Method] + # + # @param url [String] + + # @see Privy::Models::KeyQuorumIntentResponse::RequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + PATCH = :PATCH + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/privy/models/key_quorum_update_params.rb b/lib/privy/models/key_quorum_update_params.rb new file mode 100644 index 0000000..fa87a2d --- /dev/null +++ b/lib/privy/models/key_quorum_update_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::KeyQuorums#update + class KeyQuorumUpdateParams < Privy::Models::KeyQuorumUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute key_quorum_id + # A unique identifier for a key quorum. + # + # @return [String] + required :key_quorum_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(key_quorum_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumUpdateParams} for more details. + # + # @param key_quorum_id [String] A unique identifier for a key quorum. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/key_quorum_update_request_body.rb b/lib/privy/models/key_quorum_update_request_body.rb new file mode 100644 index 0000000..7933b9a --- /dev/null +++ b/lib/privy/models/key_quorum_update_request_body.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Privy + module Models + class KeyQuorumUpdateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute authorization_threshold + # The number of keys that must sign for an action to be valid. Must be less than + # or equal to total number of key quorum members. + # + # @return [Float, nil] + optional :authorization_threshold, Float + + # @!attribute display_name + # + # @return [String, nil] + optional :display_name, String + + # @!attribute key_quorum_ids + # List of key quorum IDs that should be members of this key quorum. Key quorums + # can only be nested 1 level deep. + # + # @return [Array, nil] + optional :key_quorum_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute public_keys + # List of P-256 public keys of the keys that should be authorized to sign on the + # key quorum, in base64-encoded DER format. + # + # @return [Array, nil] + optional :public_keys, Privy::Internal::Type::ArrayOf[String] + + # @!attribute user_ids + # List of user IDs of the users that should be authorized to sign on the key + # quorum. + # + # @return [Array, nil] + optional :user_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(authorization_threshold: nil, display_name: nil, key_quorum_ids: nil, public_keys: nil, user_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumUpdateRequestBody} for more details. + # + # Request input for updating an existing key quorum. At least one field must be + # provided. + # + # @param authorization_threshold [Float] The number of keys that must sign for an action to be valid. Must be less than o + # + # @param display_name [String] + # + # @param key_quorum_ids [Array] List of key quorum IDs that should be members of this key quorum. Key quorums ca + # + # @param public_keys [Array] List of P-256 public keys of the keys that should be authorized to sign on the k + # + # @param user_ids [Array] List of user IDs of the users that should be authorized to sign on the key quoru + end + end +end diff --git a/lib/privy/models/kraken_embed_current_day_pnl.rb b/lib/privy/models/kraken_embed_current_day_pnl.rb new file mode 100644 index 0000000..8c04304 --- /dev/null +++ b/lib/privy/models/kraken_embed_current_day_pnl.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedCurrentDayPnl < Privy::Internal::Type::BaseModel + # @!attribute pnl + # + # @return [String] + required :pnl, String + + # @!attribute since + # + # @return [Time] + required :since, Time + + # @!method initialize(pnl:, since:) + # Current day profit and loss for a portfolio, calculated from the most recent + # available balance. + # + # @param pnl [String] + # @param since [Time] + end + end +end diff --git a/lib/privy/models/kraken_embed_get_asset_list_query_params_schema.rb b/lib/privy/models/kraken_embed_get_asset_list_query_params_schema.rb new file mode 100644 index 0000000..7cd5dad --- /dev/null +++ b/lib/privy/models/kraken_embed_get_asset_list_query_params_schema.rb @@ -0,0 +1,133 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedGetAssetListQueryParamsSchema < Privy::Internal::Type::BaseModel + # @!attribute filter_assets + # + # @return [Array, nil] + optional :filter_assets, Privy::Internal::Type::ArrayOf[String], api_name: :"filter[assets]" + + # @!attribute filter_platform_statuses + # + # @return [Array, nil] + optional :filter_platform_statuses, + -> { + Privy::Internal::Type::ArrayOf[union: Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus] + }, + api_name: :"filter[platform_statuses]" + + # @!attribute filter_tradable_only + # + # @return [Boolean, nil] + optional :filter_tradable_only, + Privy::Internal::Type::Boolean, + api_name: :"filter[tradable_only]", + nil?: true + + # @!attribute filter_user + # + # @return [String, nil] + optional :filter_user, String, api_name: :"filter[user]" + + # @!attribute lang + # + # @return [String, nil] + optional :lang, String + + # @!attribute page_number + # + # @return [Integer, nil] + optional :page_number, Integer, api_name: :"page[number]" + + # @!attribute page_size + # + # @return [Integer, nil] + optional :page_size, Integer, api_name: :"page[size]" + + # @!attribute quote + # + # @return [String, nil] + optional :quote, String + + # @!attribute sort + # + # @return [Symbol, Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::Sort, nil] + optional :sort, enum: -> { Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort } + + # @!method initialize(filter_assets: nil, filter_platform_statuses: nil, filter_tradable_only: nil, filter_user: nil, lang: nil, page_number: nil, page_size: nil, quote: nil, sort: nil) + # Query parameters for listing and filtering available assets. + # + # @param filter_assets [Array] + # @param filter_platform_statuses [Array] + # @param filter_tradable_only [Boolean, nil] + # @param filter_user [String] + # @param lang [String] + # @param page_number [Integer] + # @param page_size [Integer] + # @param quote [String] + # @param sort [Symbol, Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::Sort] + + module FilterPlatformStatus + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::ENABLED } + + variant const: -> { Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::DEPOSIT_ONLY } + + variant const: -> { Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::WITHDRAWAL_ONLY } + + variant const: -> { Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::FUNDING_TEMPORARILY_DISABLED } + + variant const: -> { Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::DISABLED } + + variant String + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::TaggedSymbol, String) } + end + + # @!group + + ENABLED = :enabled + DEPOSIT_ONLY = :deposit_only + WITHDRAWAL_ONLY = :withdrawal_only + FUNDING_TEMPORARILY_DISABLED = :funding_temporarily_disabled + DISABLED = :disabled + + # @!endgroup + end + + # @see Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema#sort + module Sort + extend Privy::Internal::Type::Enum + + TRENDING = :trending + MARKET_CAP_RANK = :market_cap_rank + MINUS_MARKET_CAP_RANK = :"-market_cap_rank" + SYMBOL = :symbol + MINUS_SYMBOL = :"-symbol" + NAME = :name + MINUS_NAME = :"-name" + CHANGE_PERCENT_1H = :change_percent_1h + MINUS_CHANGE_PERCENT_1_H = :"-change_percent_1h" + CHANGE_PERCENT_24H = :change_percent_24h + MINUS_CHANGE_PERCENT_24_H = :"-change_percent_24h" + CHANGE_PERCENT_7D = :change_percent_7d + MINUS_CHANGE_PERCENT_7_D = :"-change_percent_7d" + CHANGE_PERCENT_30D = :change_percent_30d + MINUS_CHANGE_PERCENT_30_D = :"-change_percent_30d" + CHANGE_PERCENT_1Y = :change_percent_1y + MINUS_CHANGE_PERCENT_1_Y = :"-change_percent_1y" + LISTING_DATE = :listing_date + MINUS_LISTING_DATE = :"-listing_date" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rb b/lib/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rb new file mode 100644 index 0000000..bbb11f7 --- /dev/null +++ b/lib/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedGetPortfolioDetailsQueryParamsSchema < Privy::Internal::Type::BaseModel + # @!attribute quote + # + # @return [String, nil] + optional :quote, String + + # @!method initialize(quote: nil) + # Query parameters for portfolio details endpoint. + # + # @param quote [String] + end + end +end diff --git a/lib/privy/models/kraken_embed_get_portfolio_summary_query_params.rb b/lib/privy/models/kraken_embed_get_portfolio_summary_query_params.rb new file mode 100644 index 0000000..fe1d78d --- /dev/null +++ b/lib/privy/models/kraken_embed_get_portfolio_summary_query_params.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedGetPortfolioSummaryQueryParams < Privy::Internal::Type::BaseModel + # @!attribute include_current_day_pnl + # + # @return [Symbol, Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl, nil] + optional :include_current_day_pnl, + enum: -> { Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl }, + api_name: :"include[current_day_pnl]" + + # @!attribute quote + # + # @return [String, nil] + optional :quote, String + + # @!method initialize(include_current_day_pnl: nil, quote: nil) + # Query parameters for getting a portfolio summary. + # + # @param include_current_day_pnl [Symbol, Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl] + # @param quote [String] + + # @see Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams#include_current_day_pnl + module IncludeCurrentDayPnl + extend Privy::Internal::Type::Enum + + TRUE = :true + FALSE = :false + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_get_portfolio_summary_response.rb b/lib/privy/models/kraken_embed_get_portfolio_summary_response.rb new file mode 100644 index 0000000..6122412 --- /dev/null +++ b/lib/privy/models/kraken_embed_get_portfolio_summary_response.rb @@ -0,0 +1,114 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedGetPortfolioSummaryResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # + # @return [Privy::Models::KrakenEmbedGetPortfolioSummaryResponse::Data] + required :data, -> { Privy::KrakenEmbedGetPortfolioSummaryResponse::Data } + + # @!method initialize(data:) + # High-level summary of a user's portfolio including total value, available + # balance, and unrealized P&L. + # + # @param data [Privy::Models::KrakenEmbedGetPortfolioSummaryResponse::Data] + + # @see Privy::Models::KrakenEmbedGetPortfolioSummaryResponse#data + class Data < Privy::Internal::Type::BaseModel + # @!attribute result + # + # @return [Privy::Models::KrakenEmbedGetPortfolioSummaryResponse::Data::Result, nil] + required :result, -> { Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result }, nil?: true + + # @!attribute error + # + # @return [Array, nil] + optional :error, Privy::Internal::Type::ArrayOf[String] + + # @!attribute errors + # + # @return [Array, nil] + optional :errors, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(result:, error: nil, errors: nil) + # @param result [Privy::Models::KrakenEmbedGetPortfolioSummaryResponse::Data::Result, nil] + # @param error [Array] + # @param errors [Array] + + # @see Privy::Models::KrakenEmbedGetPortfolioSummaryResponse::Data#result + class Result < Privy::Internal::Type::BaseModel + # @!attribute available_balance + # + # @return [String] + required :available_balance, String + + # @!attribute currency + # + # @return [String] + required :currency, String + + # @!attribute open_orders + # + # @return [String] + required :open_orders, String + + # @!attribute portfolio_value + # + # @return [String] + required :portfolio_value, String + + # @!attribute timestamp + # + # @return [Time] + required :timestamp, Time + + # @!attribute withheld_value + # + # @return [String] + required :withheld_value, String + + # @!attribute cost_basis + # + # @return [String, nil] + optional :cost_basis, String, nil?: true + + # @!attribute current_day_pnl + # Current day profit and loss for a portfolio, calculated from the most recent + # available balance. + # + # @return [Privy::Models::KrakenEmbedCurrentDayPnl, nil] + optional :current_day_pnl, -> { Privy::KrakenEmbedCurrentDayPnl }, nil?: true + + # @!attribute lots_upnl + # + # @return [String, nil] + optional :lots_upnl, String, nil?: true + + # @!method initialize(available_balance:, currency:, open_orders:, portfolio_value:, timestamp:, withheld_value:, cost_basis: nil, current_day_pnl: nil, lots_upnl: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::KrakenEmbedGetPortfolioSummaryResponse::Data::Result} for more + # details. + # + # @param available_balance [String] + # + # @param currency [String] + # + # @param open_orders [String] + # + # @param portfolio_value [String] + # + # @param timestamp [Time] + # + # @param withheld_value [String] + # + # @param cost_basis [String, nil] + # + # @param current_day_pnl [Privy::Models::KrakenEmbedCurrentDayPnl, nil] Current day profit and loss for a portfolio, calculated from the most recent ava + # + # @param lots_upnl [String, nil] + end + end + end + end +end diff --git a/lib/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rb b/lib/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rb new file mode 100644 index 0000000..f2efbe4 --- /dev/null +++ b/lib/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedGetPortfolioTransactionsQueryParamsSchema < Privy::Internal::Type::BaseModel + # @!attribute assets + # + # @return [Array, nil] + optional :assets, Privy::Internal::Type::ArrayOf[String] + + # @!attribute cursor + # + # @return [String, nil] + optional :cursor, String + + # @!attribute from_time + # + # @return [Time, nil] + optional :from_time, Time + + # @!attribute ids + # + # @return [Array, nil] + optional :ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute page_size + # + # @return [Integer, nil] + optional :page_size, Integer + + # @!attribute quote + # + # @return [String, nil] + optional :quote, String + + # @!attribute ref_ids + # + # @return [Array, nil] + optional :ref_ids, + -> { Privy::Internal::Type::ArrayOf[Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID] } + + # @!attribute sorting + # + # @return [Symbol, Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting, nil] + optional :sorting, enum: -> { Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting } + + # @!attribute statuses + # + # @return [Array, nil] + optional :statuses, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status] } + + # @!attribute types + # + # @return [Array, nil] + optional :types, + -> { Privy::Internal::Type::ArrayOf[enum: Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type] } + + # @!attribute until_time + # + # @return [Time, nil] + optional :until_time, Time + + # @!method initialize(assets: nil, cursor: nil, from_time: nil, ids: nil, page_size: nil, quote: nil, ref_ids: nil, sorting: nil, statuses: nil, types: nil, until_time: nil) + # Query parameters for filtering and paginating portfolio transactions. + # + # @param assets [Array] + # @param cursor [String] + # @param from_time [Time] + # @param ids [Array] + # @param page_size [Integer] + # @param quote [String] + # @param ref_ids [Array] + # @param sorting [Symbol, Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting] + # @param statuses [Array] + # @param types [Array] + # @param until_time [Time] + + class RefID < Privy::Internal::Type::BaseModel + # @!attribute ref_id + # + # @return [String] + required :ref_id, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type] + required :type, enum: -> { Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type } + + # @!method initialize(ref_id:, type:) + # @param ref_id [String] + # @param type [Symbol, Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type] + + # @see Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID#type + module Type + extend Privy::Internal::Type::Enum + + SIMPLE_ORDER_QUOTE = :simple_order_quote + SIMPLE_ORDER_QUOTE_FAILED = :simple_order_quote_failed + + # @!method self.values + # @return [Array] + end + end + + # @see Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema#sorting + module Sorting + extend Privy::Internal::Type::Enum + + DESCENDING = :descending + ASCENDING = :ascending + + # @!method self.values + # @return [Array] + end + + module Status + extend Privy::Internal::Type::Enum + + UNSPECIFIED = :unspecified + IN_PROGRESS = :in_progress + SUCCESSFUL = :successful + FAILED = :failed + + # @!method self.values + # @return [Array] + end + + module Type + extend Privy::Internal::Type::Enum + + SIMPLE_ORDER = :simple_order + SIMPLE_ORDER_FAILED = :simple_order_failed + EARN_REWARD = :earn_reward + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_get_quote_query_params.rb b/lib/privy/models/kraken_embed_get_quote_query_params.rb new file mode 100644 index 0000000..fadc2bd --- /dev/null +++ b/lib/privy/models/kraken_embed_get_quote_query_params.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedGetQuoteQueryParams < Privy::Internal::Type::BaseModel + # @!attribute user_id + # The ID of the Privy user. + # + # @return [String] + required :user_id, String + + # @!method initialize(user_id:) + # Query parameters for getting a quote status. + # + # @param user_id [String] The ID of the Privy user. + end + end +end diff --git a/lib/privy/models/kraken_embed_quote_cancelled_webhook_payload.rb b/lib/privy/models/kraken_embed_quote_cancelled_webhook_payload.rb new file mode 100644 index 0000000..539c35b --- /dev/null +++ b/lib/privy/models/kraken_embed_quote_cancelled_webhook_payload.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedQuoteCancelledWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute cancelled_at + # ISO 8601 timestamp of when the quote was cancelled. + # + # @return [String] + required :cancelled_at, String + + # @!attribute quote_id + # The ID of the cancelled quote. + # + # @return [String] + required :quote_id, String + + # @!attribute reason + # A human-readable description of why the quote was cancelled. Intended for + # display and logging purposes only. + # + # @return [String] + required :reason, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload::Type] + required :type, enum: -> { Privy::KrakenEmbedQuoteCancelledWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!method initialize(cancelled_at:, quote_id:, reason:, type:, user_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload} for more details. + # + # Payload for the kraken_embed.quote.cancelled webhook event. + # + # @param cancelled_at [String] ISO 8601 timestamp of when the quote was cancelled. + # + # @param quote_id [String] The ID of the cancelled quote. + # + # @param reason [String] A human-readable description of why the quote was cancelled. Intended for displa + # + # @param type [Symbol, Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + + # The type of webhook event. + # + # @see Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_QUOTE_CANCELLED = :"kraken_embed.quote.cancelled" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_quote_executed_webhook_payload.rb b/lib/privy/models/kraken_embed_quote_executed_webhook_payload.rb new file mode 100644 index 0000000..82e3024 --- /dev/null +++ b/lib/privy/models/kraken_embed_quote_executed_webhook_payload.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedQuoteExecutedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute executed_at + # ISO 8601 timestamp of when the quote was executed. + # + # @return [String] + required :executed_at, String + + # @!attribute quote_id + # The ID of the executed quote. + # + # @return [String] + required :quote_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload::Type] + required :type, enum: -> { Privy::KrakenEmbedQuoteExecutedWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!method initialize(executed_at:, quote_id:, type:, user_id:) + # Payload for the kraken_embed.quote_executed webhook event. + # + # @param executed_at [String] ISO 8601 timestamp of when the quote was executed. + # + # @param quote_id [String] The ID of the executed quote. + # + # @param type [Symbol, Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + + # The type of webhook event. + # + # @see Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_QUOTE_EXECUTED = :"kraken_embed.quote.executed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rb b/lib/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rb new file mode 100644 index 0000000..977edcd --- /dev/null +++ b/lib/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedQuoteExecutionFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute failed_at + # ISO 8601 timestamp of when the quote execution failed. + # + # @return [String] + required :failed_at, String + + # @!attribute quote_id + # The ID of the quote that failed to execute. + # + # @return [String] + required :quote_id, String + + # @!attribute reason + # A human-readable description of why the quote execution failed. Intended for + # display and logging purposes only. + # + # @return [String] + required :reason, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type] + required :type, enum: -> { Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!method initialize(failed_at:, quote_id:, reason:, type:, user_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload} for more details. + # + # Payload for the kraken_embed.quote.execution_failed webhook event. + # + # @param failed_at [String] ISO 8601 timestamp of when the quote execution failed. + # + # @param quote_id [String] The ID of the quote that failed to execute. + # + # @param reason [String] A human-readable description of why the quote execution failed. Intended for dis + # + # @param type [Symbol, Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + + # The type of webhook event. + # + # @see Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_QUOTE_EXECUTION_FAILED = :"kraken_embed.quote.execution_failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_user_closed_webhook_payload.rb b/lib/privy/models/kraken_embed_user_closed_webhook_payload.rb new file mode 100644 index 0000000..f20e236 --- /dev/null +++ b/lib/privy/models/kraken_embed_user_closed_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedUserClosedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute closed_at + # ISO 8601 timestamp of when the user was closed. + # + # @return [String] + required :closed_at, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::KrakenEmbedUserClosedWebhookPayload::Type] + required :type, enum: -> { Privy::KrakenEmbedUserClosedWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!method initialize(closed_at:, type:, user_id:) + # Payload for the kraken_embed.user.closed webhook event. + # + # @param closed_at [String] ISO 8601 timestamp of when the user was closed. + # + # @param type [Symbol, Privy::Models::KrakenEmbedUserClosedWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + + # The type of webhook event. + # + # @see Privy::Models::KrakenEmbedUserClosedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_USER_CLOSED = :"kraken_embed.user.closed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_user_disabled_webhook_payload.rb b/lib/privy/models/kraken_embed_user_disabled_webhook_payload.rb new file mode 100644 index 0000000..25f68d5 --- /dev/null +++ b/lib/privy/models/kraken_embed_user_disabled_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedUserDisabledWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute disabled_at + # ISO 8601 timestamp of when the user was disabled. + # + # @return [String] + required :disabled_at, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::KrakenEmbedUserDisabledWebhookPayload::Type] + required :type, enum: -> { Privy::KrakenEmbedUserDisabledWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!method initialize(disabled_at:, type:, user_id:) + # Payload for the kraken_embed.user.disabled webhook event. + # + # @param disabled_at [String] ISO 8601 timestamp of when the user was disabled. + # + # @param type [Symbol, Privy::Models::KrakenEmbedUserDisabledWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + + # The type of webhook event. + # + # @see Privy::Models::KrakenEmbedUserDisabledWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_USER_DISABLED = :"kraken_embed.user.disabled" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/kraken_embed_user_verified_webhook_payload.rb b/lib/privy/models/kraken_embed_user_verified_webhook_payload.rb new file mode 100644 index 0000000..aa1445d --- /dev/null +++ b/lib/privy/models/kraken_embed_user_verified_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class KrakenEmbedUserVerifiedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::KrakenEmbedUserVerifiedWebhookPayload::Type] + required :type, enum: -> { Privy::KrakenEmbedUserVerifiedWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!attribute verified_at + # ISO 8601 timestamp of when the user was verified. + # + # @return [String] + required :verified_at, String + + # @!method initialize(type:, user_id:, verified_at:) + # Payload for the kraken_embed.user.verified webhook event. + # + # @param type [Symbol, Privy::Models::KrakenEmbedUserVerifiedWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + # + # @param verified_at [String] ISO 8601 timestamp of when the user was verified. + + # The type of webhook event. + # + # @see Privy::Models::KrakenEmbedUserVerifiedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_USER_VERIFIED = :"kraken_embed.user.verified" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/link_jwt_input.rb b/lib/privy/models/link_jwt_input.rb new file mode 100644 index 0000000..7405029 --- /dev/null +++ b/lib/privy/models/link_jwt_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkJwtInput < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!method initialize(token: nil) + # Input for linking a custom JWT account. + # + # @param token [String] + end + end +end diff --git a/lib/privy/models/linked_account.rb b/lib/privy/models/linked_account.rb new file mode 100644 index 0000000..e1d192c --- /dev/null +++ b/lib/privy/models/linked_account.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +module Privy + module Models + # A linked account for the user. + module LinkedAccount + extend Privy::Internal::Type::Union + + # An email account linked to the user. + variant -> { Privy::LinkedAccountEmail } + + # A phone number account linked to the user. + variant -> { Privy::LinkedAccountPhone } + + # An Ethereum wallet account linked to the user. + variant -> { Privy::LinkedAccountEthereum } + + # A Solana wallet account linked to the user. + variant -> { Privy::LinkedAccountSolana } + + # A smart wallet account linked to the user. + variant -> { Privy::LinkedAccountSmartWallet } + + # An Ethereum embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountEthereumEmbeddedWallet } + + # A Solana embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountSolanaEmbeddedWallet } + + # A Bitcoin SegWit embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountBitcoinSegwitEmbeddedWallet } + + # A Bitcoin Taproot embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountBitcoinTaprootEmbeddedWallet } + + # A curve signing embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountCurveSigningEmbeddedWallet } + + # A Google OAuth account linked to the user. + variant -> { Privy::LinkedAccountGoogleOAuth } + + # A Twitter OAuth account linked to the user. + variant -> { Privy::LinkedAccountTwitterOAuth } + + # A Discord OAuth account linked to the user. + variant -> { Privy::LinkedAccountDiscordOAuth } + + # A GitHub OAuth account linked to the user. + variant -> { Privy::LinkedAccountGitHubOAuth } + + # A Spotify OAuth account linked to the user. + variant -> { Privy::LinkedAccountSpotifyOAuth } + + # An Instagram OAuth account linked to the user. + variant -> { Privy::LinkedAccountInstagramOAuth } + + # A TikTok OAuth account linked to the user. + variant -> { Privy::LinkedAccountTiktokOAuth } + + # A LINE OAuth account linked to the user. + variant -> { Privy::LinkedAccountLineOAuth } + + # A Twitch OAuth account linked to the user. + variant -> { Privy::LinkedAccountTwitchOAuth } + + # A LinkedIn OAuth account linked to the user. + variant -> { Privy::LinkedAccountLinkedInOAuth } + + # An Apple OAuth account linked to the user. + variant -> { Privy::LinkedAccountAppleOAuth } + + # A custom OAuth account linked to the user. + variant -> { Privy::LinkedAccountCustomOAuth } + + # A custom JWT account linked to the user. + variant -> { Privy::LinkedAccountCustomJwt } + + # A Farcaster account linked to the user. + variant -> { Privy::LinkedAccountFarcaster } + + # A passkey account linked to the user. + variant -> { Privy::LinkedAccountPasskey } + + # A Telegram account linked to the user. + variant -> { Privy::LinkedAccountTelegram } + + # A cross-app account linked to the user. + variant -> { Privy::LinkedAccountCrossApp } + + # An authorization key linked to the user. + variant -> { Privy::LinkedAccountAuthorizationKey } + + # @!method self.variants + # @return [Array(Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey)] + end + end +end diff --git a/lib/privy/models/linked_account_apple_input.rb b/lib/privy/models/linked_account_apple_input.rb new file mode 100644 index 0000000..43b8361 --- /dev/null +++ b/lib/privy/models/linked_account_apple_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountAppleInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :apple_oauth] + required :type, const: :apple_oauth + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!method initialize(subject:, email: nil, type: :apple_oauth) + # The payload for importing an Apple account. + # + # @param subject [String] + # @param email [String] + # @param type [Symbol, :apple_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_apple_oauth.rb b/lib/privy/models/linked_account_apple_oauth.rb new file mode 100644 index 0000000..ef79db5 --- /dev/null +++ b/lib/privy/models/linked_account_apple_oauth.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountAppleOAuth < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountAppleOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountAppleOAuth::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(email:, first_verified_at:, latest_verified_at:, subject:, type:, verified_at:) + # An Apple OAuth account linked to the user. + # + # @param email [String, nil] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountAppleOAuth::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountAppleOAuth#type + module Type + extend Privy::Internal::Type::Enum + + APPLE_OAUTH = :apple_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_authorization_key.rb b/lib/privy/models/linked_account_authorization_key.rb new file mode 100644 index 0000000..41447af --- /dev/null +++ b/lib/privy/models/linked_account_authorization_key.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountAuthorizationKey < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountAuthorizationKey::Type] + required :type, enum: -> { Privy::LinkedAccountAuthorizationKey::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(first_verified_at:, latest_verified_at:, public_key:, type:, verified_at:) + # An authorization key linked to the user. + # + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param public_key [String] + # @param type [Symbol, Privy::Models::LinkedAccountAuthorizationKey::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountAuthorizationKey#type + module Type + extend Privy::Internal::Type::Enum + + AUTHORIZATION_KEY = :authorization_key + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_base_wallet.rb b/lib/privy/models/linked_account_base_wallet.rb new file mode 100644 index 0000000..acd627e --- /dev/null +++ b/lib/privy/models/linked_account_base_wallet.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountBaseWallet < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountBaseWallet::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountBaseWallet::ChainType } + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountBaseWallet::Type] + required :type, enum: -> { Privy::LinkedAccountBaseWallet::Type } + + # @!method initialize(address:, chain_type:, type:) + # Base schema for wallet accounts linked to the user. + # + # @param address [String] + # @param chain_type [Symbol, Privy::Models::LinkedAccountBaseWallet::ChainType] + # @param type [Symbol, Privy::Models::LinkedAccountBaseWallet::Type] + + # @see Privy::Models::LinkedAccountBaseWallet#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA = :solana + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBaseWallet#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + SMART_WALLET = :smart_wallet + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rb b/lib/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rb new file mode 100644 index 0000000..1a5f82e --- /dev/null +++ b/lib/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountBitcoinSegwitEmbeddedWallet < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType } + + # @!attribute connector_type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType] + required :connector_type, enum: -> { Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType } + + # @!attribute delegated + # + # @return [Boolean] + required :delegated, Privy::Internal::Type::Boolean + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute imported + # + # @return [Boolean] + required :imported, Privy::Internal::Type::Boolean + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute recovery_method + # The method used to recover an embedded wallet account. + # + # @return [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] + required :recovery_method, enum: -> { Privy::EmbeddedWalletRecoveryMethod } + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::Type] + required :type, enum: -> { Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute wallet_client + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient] + required :wallet_client, enum: -> { Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient } + + # @!attribute wallet_client_type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType] + required :wallet_client_type, + enum: -> { Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType } + + # @!attribute wallet_index + # + # @return [Float] + required :wallet_index, Float + + # @!method initialize(id:, address:, chain_id:, chain_type:, connector_type:, delegated:, first_verified_at:, imported:, latest_verified_at:, public_key:, recovery_method:, type:, verified_at:, wallet_client:, wallet_client_type:, wallet_index:) + # A Bitcoin SegWit embedded wallet account linked to the user. + # + # @param id [String, nil] + # + # @param address [String] + # + # @param chain_id [String] + # + # @param chain_type [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType] + # + # @param connector_type [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType] + # + # @param delegated [Boolean] + # + # @param first_verified_at [Float, nil] + # + # @param imported [Boolean] + # + # @param latest_verified_at [Float, nil] + # + # @param public_key [String] + # + # @param recovery_method [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] The method used to recover an embedded wallet account. + # + # @param type [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::Type] + # + # @param verified_at [Float] + # + # @param wallet_client [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient] + # + # @param wallet_client_type [Symbol, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType] + # + # @param wallet_index [Float] + + # @see Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + BITCOIN_SEGWIT = :"bitcoin-segwit" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet#connector_type + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED = :embedded + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet#wallet_client + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet#wallet_client_type + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rb b/lib/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rb new file mode 100644 index 0000000..588a800 --- /dev/null +++ b/lib/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountBitcoinTaprootEmbeddedWallet < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType } + + # @!attribute connector_type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType] + required :connector_type, enum: -> { Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType } + + # @!attribute delegated + # + # @return [Boolean] + required :delegated, Privy::Internal::Type::Boolean + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute imported + # + # @return [Boolean] + required :imported, Privy::Internal::Type::Boolean + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute recovery_method + # The method used to recover an embedded wallet account. + # + # @return [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] + required :recovery_method, enum: -> { Privy::EmbeddedWalletRecoveryMethod } + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::Type] + required :type, enum: -> { Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute wallet_client + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient] + required :wallet_client, enum: -> { Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient } + + # @!attribute wallet_client_type + # + # @return [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType] + required :wallet_client_type, + enum: -> { Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType } + + # @!attribute wallet_index + # + # @return [Float] + required :wallet_index, Float + + # @!method initialize(id:, address:, chain_id:, chain_type:, connector_type:, delegated:, first_verified_at:, imported:, latest_verified_at:, public_key:, recovery_method:, type:, verified_at:, wallet_client:, wallet_client_type:, wallet_index:) + # A Bitcoin Taproot embedded wallet account linked to the user. + # + # @param id [String, nil] + # + # @param address [String] + # + # @param chain_id [String] + # + # @param chain_type [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType] + # + # @param connector_type [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType] + # + # @param delegated [Boolean] + # + # @param first_verified_at [Float, nil] + # + # @param imported [Boolean] + # + # @param latest_verified_at [Float, nil] + # + # @param public_key [String] + # + # @param recovery_method [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] The method used to recover an embedded wallet account. + # + # @param type [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::Type] + # + # @param verified_at [Float] + # + # @param wallet_client [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient] + # + # @param wallet_client_type [Symbol, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType] + # + # @param wallet_index [Float] + + # @see Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + BITCOIN_TAPROOT = :"bitcoin-taproot" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet#connector_type + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED = :embedded + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet#wallet_client + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet#wallet_client_type + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_cross_app.rb b/lib/privy/models/linked_account_cross_app.rb new file mode 100644 index 0000000..8879702 --- /dev/null +++ b/lib/privy/models/linked_account_cross_app.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountCrossApp < Privy::Internal::Type::BaseModel + # @!attribute embedded_wallets + # + # @return [Array] + required :embedded_wallets, -> { Privy::Internal::Type::ArrayOf[Privy::CrossAppEmbeddedWallet] } + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute provider_app_id + # + # @return [String] + required :provider_app_id, String + + # @!attribute smart_wallets + # + # @return [Array] + required :smart_wallets, -> { Privy::Internal::Type::ArrayOf[Privy::CrossAppSmartWallet] } + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountCrossApp::Type] + required :type, enum: -> { Privy::LinkedAccountCrossApp::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(embedded_wallets:, first_verified_at:, latest_verified_at:, provider_app_id:, smart_wallets:, subject:, type:, verified_at:) + # A cross-app account linked to the user. + # + # @param embedded_wallets [Array] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param provider_app_id [String] + # @param smart_wallets [Array] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountCrossApp::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountCrossApp#type + module Type + extend Privy::Internal::Type::Enum + + CROSS_APP = :cross_app + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_curve_signing_embedded_wallet.rb b/lib/privy/models/linked_account_curve_signing_embedded_wallet.rb new file mode 100644 index 0000000..6ba4314 --- /dev/null +++ b/lib/privy/models/linked_account_curve_signing_embedded_wallet.rb @@ -0,0 +1,165 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountCurveSigningEmbeddedWallet < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute chain_type + # The wallet chain types that support curve-based signing. + # + # @return [Symbol, Privy::Models::CurveSigningChainType] + required :chain_type, enum: -> { Privy::CurveSigningChainType } + + # @!attribute connector_type + # + # @return [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType] + required :connector_type, enum: -> { Privy::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType } + + # @!attribute delegated + # + # @return [Boolean] + required :delegated, Privy::Internal::Type::Boolean + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute imported + # + # @return [Boolean] + required :imported, Privy::Internal::Type::Boolean + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute recovery_method + # The method used to recover an embedded wallet account. + # + # @return [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] + required :recovery_method, enum: -> { Privy::EmbeddedWalletRecoveryMethod } + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::Type] + required :type, enum: -> { Privy::LinkedAccountCurveSigningEmbeddedWallet::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute wallet_client + # + # @return [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::WalletClient] + required :wallet_client, enum: -> { Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClient } + + # @!attribute wallet_client_type + # + # @return [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType] + required :wallet_client_type, + enum: -> { Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType } + + # @!attribute wallet_index + # + # @return [Float] + required :wallet_index, Float + + # @!method initialize(id:, address:, chain_id:, chain_type:, connector_type:, delegated:, first_verified_at:, imported:, latest_verified_at:, public_key:, recovery_method:, type:, verified_at:, wallet_client:, wallet_client_type:, wallet_index:) + # A curve signing embedded wallet account linked to the user. + # + # @param id [String, nil] + # + # @param address [String] + # + # @param chain_id [String] + # + # @param chain_type [Symbol, Privy::Models::CurveSigningChainType] The wallet chain types that support curve-based signing. + # + # @param connector_type [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType] + # + # @param delegated [Boolean] + # + # @param first_verified_at [Float, nil] + # + # @param imported [Boolean] + # + # @param latest_verified_at [Float, nil] + # + # @param public_key [String] + # + # @param recovery_method [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] The method used to recover an embedded wallet account. + # + # @param type [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::Type] + # + # @param verified_at [Float] + # + # @param wallet_client [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::WalletClient] + # + # @param wallet_client_type [Symbol, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType] + # + # @param wallet_index [Float] + + # @see Privy::Models::LinkedAccountCurveSigningEmbeddedWallet#connector_type + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED = :embedded + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountCurveSigningEmbeddedWallet#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountCurveSigningEmbeddedWallet#wallet_client + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountCurveSigningEmbeddedWallet#wallet_client_type + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_custom_jwt.rb b/lib/privy/models/linked_account_custom_jwt.rb new file mode 100644 index 0000000..86e687f --- /dev/null +++ b/lib/privy/models/linked_account_custom_jwt.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountCustomJwt < Privy::Internal::Type::BaseModel + # @!attribute custom_user_id + # + # @return [String] + required :custom_user_id, String + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountCustomJwt::Type] + required :type, enum: -> { Privy::LinkedAccountCustomJwt::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(custom_user_id:, first_verified_at:, latest_verified_at:, type:, verified_at:) + # A custom JWT account linked to the user. + # + # @param custom_user_id [String] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param type [Symbol, Privy::Models::LinkedAccountCustomJwt::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountCustomJwt#type + module Type + extend Privy::Internal::Type::Enum + + CUSTOM_AUTH = :custom_auth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_custom_jwt_input.rb b/lib/privy/models/linked_account_custom_jwt_input.rb new file mode 100644 index 0000000..8d46815 --- /dev/null +++ b/lib/privy/models/linked_account_custom_jwt_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountCustomJwtInput < Privy::Internal::Type::BaseModel + # @!attribute custom_user_id + # + # @return [String] + required :custom_user_id, String + + # @!attribute type + # + # @return [Symbol, :custom_auth] + required :type, const: :custom_auth + + # @!method initialize(custom_user_id:, type: :custom_auth) + # The payload for importing a Custom JWT account. + # + # @param custom_user_id [String] + # @param type [Symbol, :custom_auth] + end + end +end diff --git a/lib/privy/models/linked_account_custom_oauth.rb b/lib/privy/models/linked_account_custom_oauth.rb new file mode 100644 index 0000000..ab231ba --- /dev/null +++ b/lib/privy/models/linked_account_custom_oauth.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountCustomOAuth < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # The ID of a custom OAuth provider, set up for this app. Must start with + # "custom:". + # + # @return [String] + required :type, String + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute profile_picture_url + # + # @return [String, nil] + optional :profile_picture_url, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(first_verified_at:, latest_verified_at:, subject:, type:, verified_at:, email: nil, name: nil, profile_picture_url: nil, username: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::LinkedAccountCustomOAuth} for more details. + # + # A custom OAuth account linked to the user. + # + # @param first_verified_at [Float, nil] + # + # @param latest_verified_at [Float, nil] + # + # @param subject [String] + # + # @param type [String] The ID of a custom OAuth provider, set up for this app. Must start with "custom: + # + # @param verified_at [Float] + # + # @param email [String] + # + # @param name [String] + # + # @param profile_picture_url [String] + # + # @param username [String] + end + end +end diff --git a/lib/privy/models/linked_account_discord_input.rb b/lib/privy/models/linked_account_discord_input.rb new file mode 100644 index 0000000..ca407cb --- /dev/null +++ b/lib/privy/models/linked_account_discord_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountDiscordInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :discord_oauth] + required :type, const: :discord_oauth + + # @!attribute username + # + # @return [String] + required :username, String + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!method initialize(subject:, username:, email: nil, type: :discord_oauth) + # The payload for importing a Discord account. + # + # @param subject [String] + # @param username [String] + # @param email [String] + # @param type [Symbol, :discord_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_discord_oauth.rb b/lib/privy/models/linked_account_discord_oauth.rb new file mode 100644 index 0000000..39e49b4 --- /dev/null +++ b/lib/privy/models/linked_account_discord_oauth.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountDiscordOAuth < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountDiscordOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountDiscordOAuth::Type } + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(email:, first_verified_at:, latest_verified_at:, subject:, type:, username:, verified_at:) + # A Discord OAuth account linked to the user. + # + # @param email [String, nil] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountDiscordOAuth::Type] + # @param username [String, nil] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountDiscordOAuth#type + module Type + extend Privy::Internal::Type::Enum + + DISCORD_OAUTH = :discord_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_email.rb b/lib/privy/models/linked_account_email.rb new file mode 100644 index 0000000..324d85c --- /dev/null +++ b/lib/privy/models/linked_account_email.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountEmail < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountEmail::Type] + required :type, enum: -> { Privy::LinkedAccountEmail::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(address:, first_verified_at:, latest_verified_at:, type:, verified_at:) + # An email account linked to the user. + # + # @param address [String] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param type [Symbol, Privy::Models::LinkedAccountEmail::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountEmail#type + module Type + extend Privy::Internal::Type::Enum + + EMAIL = :email + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_email_input.rb b/lib/privy/models/linked_account_email_input.rb new file mode 100644 index 0000000..d0e1309 --- /dev/null +++ b/lib/privy/models/linked_account_email_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountEmailInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute type + # + # @return [Symbol, :email] + required :type, const: :email + + # @!method initialize(address:, type: :email) + # The payload for importing an email account. + # + # @param address [String] + # @param type [Symbol, :email] + end + end +end diff --git a/lib/privy/models/linked_account_embedded_wallet.rb b/lib/privy/models/linked_account_embedded_wallet.rb new file mode 100644 index 0000000..d1aba82 --- /dev/null +++ b/lib/privy/models/linked_account_embedded_wallet.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + module LinkedAccountEmbeddedWallet + extend Privy::Internal::Type::Union + + # An Ethereum embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountEthereumEmbeddedWallet } + + # A Solana embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountSolanaEmbeddedWallet } + + # A Bitcoin SegWit embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountBitcoinSegwitEmbeddedWallet } + + # A Bitcoin Taproot embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountBitcoinTaprootEmbeddedWallet } + + # A curve signing embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountCurveSigningEmbeddedWallet } + + # @!method self.variants + # @return [Array(Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet)] + end + end +end diff --git a/lib/privy/models/linked_account_embedded_wallet_with_id.rb b/lib/privy/models/linked_account_embedded_wallet_with_id.rb new file mode 100644 index 0000000..07206d2 --- /dev/null +++ b/lib/privy/models/linked_account_embedded_wallet_with_id.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +module Privy + module Models + # An embedded wallet account with an ID. + module LinkedAccountEmbeddedWalletWithID + extend Privy::Internal::Type::Union + + # An Ethereum embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet } + + # A Solana embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet } + + # A Bitcoin SegWit embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet } + + # A Bitcoin Taproot embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet } + + # A curve signing embedded wallet account linked to the user. + variant -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet } + + class LinkedAccountEthereumEmbeddedWallet < Privy::Models::LinkedAccountEthereumEmbeddedWallet + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute recovery_method + # + # @return [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod] + required :recovery_method, + enum: -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod } + + # @!method initialize(id:, recovery_method:) + # An Ethereum embedded wallet account linked to the user. + # + # @param id [String] + # @param recovery_method [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod] + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2 = :"privy-v2" + + # @!method self.values + # @return [Array] + end + end + + class LinkedAccountSolanaEmbeddedWallet < Privy::Models::LinkedAccountSolanaEmbeddedWallet + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute recovery_method + # + # @return [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod] + required :recovery_method, + enum: -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod } + + # @!method initialize(id:, recovery_method:) + # A Solana embedded wallet account linked to the user. + # + # @param id [String] + # @param recovery_method [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod] + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2 = :"privy-v2" + + # @!method self.values + # @return [Array] + end + end + + class LinkedAccountBitcoinSegwitEmbeddedWallet < Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute recovery_method + # + # @return [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod] + required :recovery_method, + enum: -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod } + + # @!method initialize(id:, recovery_method:) + # A Bitcoin SegWit embedded wallet account linked to the user. + # + # @param id [String] + # @param recovery_method [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod] + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2 = :"privy-v2" + + # @!method self.values + # @return [Array] + end + end + + class LinkedAccountBitcoinTaprootEmbeddedWallet < Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute recovery_method + # + # @return [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod] + required :recovery_method, + enum: -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod } + + # @!method initialize(id:, recovery_method:) + # A Bitcoin Taproot embedded wallet account linked to the user. + # + # @param id [String] + # @param recovery_method [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod] + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2 = :"privy-v2" + + # @!method self.values + # @return [Array] + end + end + + class LinkedAccountCurveSigningEmbeddedWallet < Privy::Models::LinkedAccountCurveSigningEmbeddedWallet + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute recovery_method + # + # @return [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod] + required :recovery_method, + enum: -> { Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod } + + # @!method initialize(id:, recovery_method:) + # A curve signing embedded wallet account linked to the user. + # + # @param id [String] + # @param recovery_method [Symbol, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod] + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2 = :"privy-v2" + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet)] + end + end +end diff --git a/lib/privy/models/linked_account_ethereum.rb b/lib/privy/models/linked_account_ethereum.rb new file mode 100644 index 0000000..4dbd5c8 --- /dev/null +++ b/lib/privy/models/linked_account_ethereum.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountEthereum < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountEthereum::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountEthereum::ChainType } + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountEthereum::Type] + required :type, enum: -> { Privy::LinkedAccountEthereum::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute wallet_client + # + # @return [Symbol, Privy::Models::LinkedAccountEthereum::WalletClient] + required :wallet_client, enum: -> { Privy::LinkedAccountEthereum::WalletClient } + + # @!attribute chain_id + # + # @return [String, nil] + optional :chain_id, String + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String + + # @!method initialize(address:, chain_type:, first_verified_at:, latest_verified_at:, type:, verified_at:, wallet_client:, chain_id: nil, connector_type: nil, wallet_client_type: nil) + # An Ethereum wallet account linked to the user. + # + # @param address [String] + # @param chain_type [Symbol, Privy::Models::LinkedAccountEthereum::ChainType] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param type [Symbol, Privy::Models::LinkedAccountEthereum::Type] + # @param verified_at [Float] + # @param wallet_client [Symbol, Privy::Models::LinkedAccountEthereum::WalletClient] + # @param chain_id [String] + # @param connector_type [String] + # @param wallet_client_type [String] + + # @see Privy::Models::LinkedAccountEthereum#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountEthereum#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountEthereum#wallet_client + module WalletClient + extend Privy::Internal::Type::Enum + + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_ethereum_embedded_wallet.rb b/lib/privy/models/linked_account_ethereum_embedded_wallet.rb new file mode 100644 index 0000000..4146669 --- /dev/null +++ b/lib/privy/models/linked_account_ethereum_embedded_wallet.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountEthereumEmbeddedWallet < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountEthereumEmbeddedWallet::ChainType } + + # @!attribute connector_type + # + # @return [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::ConnectorType] + required :connector_type, enum: -> { Privy::LinkedAccountEthereumEmbeddedWallet::ConnectorType } + + # @!attribute delegated + # + # @return [Boolean] + required :delegated, Privy::Internal::Type::Boolean + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute imported + # + # @return [Boolean] + required :imported, Privy::Internal::Type::Boolean + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute recovery_method + # The method used to recover an embedded wallet account. + # + # @return [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] + required :recovery_method, enum: -> { Privy::EmbeddedWalletRecoveryMethod } + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::Type] + required :type, enum: -> { Privy::LinkedAccountEthereumEmbeddedWallet::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute wallet_client + # + # @return [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::WalletClient] + required :wallet_client, enum: -> { Privy::LinkedAccountEthereumEmbeddedWallet::WalletClient } + + # @!attribute wallet_client_type + # + # @return [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::WalletClientType] + required :wallet_client_type, enum: -> { Privy::LinkedAccountEthereumEmbeddedWallet::WalletClientType } + + # @!attribute wallet_index + # + # @return [Float] + required :wallet_index, Float + + # @!method initialize(id:, address:, chain_id:, chain_type:, connector_type:, delegated:, first_verified_at:, imported:, latest_verified_at:, recovery_method:, type:, verified_at:, wallet_client:, wallet_client_type:, wallet_index:) + # An Ethereum embedded wallet account linked to the user. + # + # @param id [String, nil] + # + # @param address [String] + # + # @param chain_id [String] + # + # @param chain_type [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::ChainType] + # + # @param connector_type [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::ConnectorType] + # + # @param delegated [Boolean] + # + # @param first_verified_at [Float, nil] + # + # @param imported [Boolean] + # + # @param latest_verified_at [Float, nil] + # + # @param recovery_method [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] The method used to recover an embedded wallet account. + # + # @param type [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::Type] + # + # @param verified_at [Float] + # + # @param wallet_client [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::WalletClient] + # + # @param wallet_client_type [Symbol, Privy::Models::LinkedAccountEthereumEmbeddedWallet::WalletClientType] + # + # @param wallet_index [Float] + + # @see Privy::Models::LinkedAccountEthereumEmbeddedWallet#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountEthereumEmbeddedWallet#connector_type + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED = :embedded + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountEthereumEmbeddedWallet#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountEthereumEmbeddedWallet#wallet_client + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountEthereumEmbeddedWallet#wallet_client_type + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_farcaster.rb b/lib/privy/models/linked_account_farcaster.rb new file mode 100644 index 0000000..07c0917 --- /dev/null +++ b/lib/privy/models/linked_account_farcaster.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountFarcaster < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute owner_address + # + # @return [String] + required :owner_address, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountFarcaster::Type] + required :type, enum: -> { Privy::LinkedAccountFarcaster::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute bio + # + # @return [String, nil] + optional :bio, String + + # @!attribute display_name + # + # @return [String, nil] + optional :display_name, String + + # @!attribute homepage_url + # + # @return [String, nil] + optional :homepage_url, String + + # @!attribute profile_picture + # + # @return [String, nil] + optional :profile_picture, String + + # @!attribute profile_picture_url + # + # @return [String, nil] + optional :profile_picture_url, String + + # @!attribute signer_public_key + # + # @return [String, nil] + optional :signer_public_key, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(fid:, first_verified_at:, latest_verified_at:, owner_address:, type:, verified_at:, bio: nil, display_name: nil, homepage_url: nil, profile_picture: nil, profile_picture_url: nil, signer_public_key: nil, username: nil) + # A Farcaster account linked to the user. + # + # @param fid [Float] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param owner_address [String] + # @param type [Symbol, Privy::Models::LinkedAccountFarcaster::Type] + # @param verified_at [Float] + # @param bio [String] + # @param display_name [String] + # @param homepage_url [String] + # @param profile_picture [String] + # @param profile_picture_url [String] + # @param signer_public_key [String] + # @param username [String] + + # @see Privy::Models::LinkedAccountFarcaster#type + module Type + extend Privy::Internal::Type::Enum + + FARCASTER = :farcaster + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_farcaster_input.rb b/lib/privy/models/linked_account_farcaster_input.rb new file mode 100644 index 0000000..45b952e --- /dev/null +++ b/lib/privy/models/linked_account_farcaster_input.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountFarcasterInput < Privy::Internal::Type::BaseModel + # @!attribute fid + # + # @return [Integer] + required :fid, Integer + + # @!attribute owner_address + # + # @return [String] + required :owner_address, String + + # @!attribute type + # + # @return [Symbol, :farcaster] + required :type, const: :farcaster + + # @!attribute bio + # + # @return [String, nil] + optional :bio, String + + # @!attribute display_name + # + # @return [String, nil] + optional :display_name, String + + # @!attribute homepage_url + # + # @return [String, nil] + optional :homepage_url, String + + # @!attribute profile_picture_url + # + # @return [String, nil] + optional :profile_picture_url, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(fid:, owner_address:, bio: nil, display_name: nil, homepage_url: nil, profile_picture_url: nil, username: nil, type: :farcaster) + # The payload for importing a Farcaster account. + # + # @param fid [Integer] + # @param owner_address [String] + # @param bio [String] + # @param display_name [String] + # @param homepage_url [String] + # @param profile_picture_url [String] + # @param username [String] + # @param type [Symbol, :farcaster] + end + end +end diff --git a/lib/privy/models/linked_account_github_input.rb b/lib/privy/models/linked_account_github_input.rb new file mode 100644 index 0000000..c6e6a50 --- /dev/null +++ b/lib/privy/models/linked_account_github_input.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountGitHubInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :github_oauth] + required :type, const: :github_oauth + + # @!attribute username + # + # @return [String] + required :username, String + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(subject:, username:, email: nil, name: nil, type: :github_oauth) + # The payload for importing a Github account. + # + # @param subject [String] + # @param username [String] + # @param email [String] + # @param name [String] + # @param type [Symbol, :github_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_github_oauth.rb b/lib/privy/models/linked_account_github_oauth.rb new file mode 100644 index 0000000..4b4c904 --- /dev/null +++ b/lib/privy/models/linked_account_github_oauth.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountGitHubOAuth < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountGitHubOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountGitHubOAuth::Type } + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(email:, first_verified_at:, latest_verified_at:, name:, subject:, type:, username:, verified_at:) + # A GitHub OAuth account linked to the user. + # + # @param email [String, nil] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param name [String, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountGitHubOAuth::Type] + # @param username [String, nil] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountGitHubOAuth#type + module Type + extend Privy::Internal::Type::Enum + + GITHUB_OAUTH = :github_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_google_input.rb b/lib/privy/models/linked_account_google_input.rb new file mode 100644 index 0000000..c901ee1 --- /dev/null +++ b/lib/privy/models/linked_account_google_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountGoogleInput < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String] + required :email, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :google_oauth] + required :type, const: :google_oauth + + # @!method initialize(email:, name:, subject:, type: :google_oauth) + # The payload for importing a Google account. + # + # @param email [String] + # @param name [String] + # @param subject [String] + # @param type [Symbol, :google_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_google_oauth.rb b/lib/privy/models/linked_account_google_oauth.rb new file mode 100644 index 0000000..5bd44c3 --- /dev/null +++ b/lib/privy/models/linked_account_google_oauth.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountGoogleOAuth < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String] + required :email, String + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountGoogleOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountGoogleOAuth::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(email:, first_verified_at:, latest_verified_at:, name:, subject:, type:, verified_at:) + # A Google OAuth account linked to the user. + # + # @param email [String] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param name [String, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountGoogleOAuth::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountGoogleOAuth#type + module Type + extend Privy::Internal::Type::Enum + + GOOGLE_OAUTH = :google_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_input.rb b/lib/privy/models/linked_account_input.rb new file mode 100644 index 0000000..95f44c1 --- /dev/null +++ b/lib/privy/models/linked_account_input.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + # The input for adding a linked account to a user. + module LinkedAccountInput + extend Privy::Internal::Type::Union + + discriminator :type + + # The payload for importing a wallet account. + variant :wallet, -> { Privy::LinkedAccountWalletInput } + + # The payload for importing an email account. + variant :email, -> { Privy::LinkedAccountEmailInput } + + # The payload for importing a phone account. + variant :phone, -> { Privy::LinkedAccountPhoneInput } + + # The payload for importing a Google account. + variant :google_oauth, -> { Privy::LinkedAccountGoogleInput } + + # The payload for importing a Twitter account. + variant :twitter_oauth, -> { Privy::LinkedAccountTwitterInput } + + # The payload for importing a Discord account. + variant :discord_oauth, -> { Privy::LinkedAccountDiscordInput } + + # The payload for importing a Github account. + variant :github_oauth, -> { Privy::LinkedAccountGitHubInput } + + # The payload for importing a Spotify account. + variant :spotify_oauth, -> { Privy::LinkedAccountSpotifyInput } + + # The payload for importing an Instagram account. + variant :instagram_oauth, -> { Privy::LinkedAccountInstagramInput } + + # The payload for importing a Tiktok account. + variant :tiktok_oauth, -> { Privy::LinkedAccountTiktokInput } + + # The payload for importing a LINE account. + variant :line_oauth, -> { Privy::LinkedAccountLineInput } + + # The payload for importing a Twitch account. + variant :twitch_oauth, -> { Privy::LinkedAccountTwitchInput } + + # The payload for importing an Apple account. + variant :apple_oauth, -> { Privy::LinkedAccountAppleInput } + + # The payload for importing a LinkedIn account. + variant :linkedin_oauth, -> { Privy::LinkedAccountLinkedInInput } + + # The payload for importing a Farcaster account. + variant :farcaster, -> { Privy::LinkedAccountFarcasterInput } + + # The payload for importing a Telegram account. + variant :telegram, -> { Privy::LinkedAccountTelegramInput } + + # The payload for importing a Custom JWT account. + variant :custom_auth, -> { Privy::LinkedAccountCustomJwtInput } + + # The payload for importing a passkey account. + variant :passkey, -> { Privy::LinkedAccountPasskeyInput } + + # @!method self.variants + # @return [Array(Privy::Models::LinkedAccountWalletInput, Privy::Models::LinkedAccountEmailInput, Privy::Models::LinkedAccountPhoneInput, Privy::Models::LinkedAccountGoogleInput, Privy::Models::LinkedAccountTwitterInput, Privy::Models::LinkedAccountDiscordInput, Privy::Models::LinkedAccountGitHubInput, Privy::Models::LinkedAccountSpotifyInput, Privy::Models::LinkedAccountInstagramInput, Privy::Models::LinkedAccountTiktokInput, Privy::Models::LinkedAccountLineInput, Privy::Models::LinkedAccountTwitchInput, Privy::Models::LinkedAccountAppleInput, Privy::Models::LinkedAccountLinkedInInput, Privy::Models::LinkedAccountFarcasterInput, Privy::Models::LinkedAccountTelegramInput, Privy::Models::LinkedAccountCustomJwtInput, Privy::Models::LinkedAccountPasskeyInput)] + end + end +end diff --git a/lib/privy/models/linked_account_instagram_input.rb b/lib/privy/models/linked_account_instagram_input.rb new file mode 100644 index 0000000..bf016ec --- /dev/null +++ b/lib/privy/models/linked_account_instagram_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountInstagramInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :instagram_oauth] + required :type, const: :instagram_oauth + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(subject:, username:, type: :instagram_oauth) + # The payload for importing an Instagram account. + # + # @param subject [String] + # @param username [String] + # @param type [Symbol, :instagram_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_instagram_oauth.rb b/lib/privy/models/linked_account_instagram_oauth.rb new file mode 100644 index 0000000..27c90b0 --- /dev/null +++ b/lib/privy/models/linked_account_instagram_oauth.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountInstagramOAuth < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountInstagramOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountInstagramOAuth::Type } + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(first_verified_at:, latest_verified_at:, subject:, type:, username:, verified_at:) + # An Instagram OAuth account linked to the user. + # + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountInstagramOAuth::Type] + # @param username [String, nil] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountInstagramOAuth#type + module Type + extend Privy::Internal::Type::Enum + + INSTAGRAM_OAUTH = :instagram_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_line_input.rb b/lib/privy/models/linked_account_line_input.rb new file mode 100644 index 0000000..74a65e0 --- /dev/null +++ b/lib/privy/models/linked_account_line_input.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountLineInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :line_oauth] + required :type, const: :line_oauth + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute profile_picture_url + # + # @return [String, nil] + optional :profile_picture_url, String + + # @!method initialize(subject:, email: nil, name: nil, profile_picture_url: nil, type: :line_oauth) + # The payload for importing a LINE account. + # + # @param subject [String] + # @param email [String] + # @param name [String] + # @param profile_picture_url [String] + # @param type [Symbol, :line_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_line_oauth.rb b/lib/privy/models/linked_account_line_oauth.rb new file mode 100644 index 0000000..5d41122 --- /dev/null +++ b/lib/privy/models/linked_account_line_oauth.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountLineOAuth < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture_url + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountLineOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountLineOAuth::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(email:, first_verified_at:, latest_verified_at:, name:, profile_picture_url:, subject:, type:, verified_at:) + # A LINE OAuth account linked to the user. + # + # @param email [String, nil] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param name [String, nil] + # @param profile_picture_url [String, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountLineOAuth::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountLineOAuth#type + module Type + extend Privy::Internal::Type::Enum + + LINE_OAUTH = :line_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_linked_in_input.rb b/lib/privy/models/linked_account_linked_in_input.rb new file mode 100644 index 0000000..32deea7 --- /dev/null +++ b/lib/privy/models/linked_account_linked_in_input.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountLinkedInInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :linkedin_oauth] + required :type, const: :linkedin_oauth + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute vanity_name + # + # @return [String, nil] + optional :vanity_name, String, api_name: :vanityName + + # @!method initialize(subject:, email: nil, name: nil, vanity_name: nil, type: :linkedin_oauth) + # The payload for importing a LinkedIn account. + # + # @param subject [String] + # @param email [String] + # @param name [String] + # @param vanity_name [String] + # @param type [Symbol, :linkedin_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_linked_in_oauth.rb b/lib/privy/models/linked_account_linked_in_oauth.rb new file mode 100644 index 0000000..bff1de0 --- /dev/null +++ b/lib/privy/models/linked_account_linked_in_oauth.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountLinkedInOAuth < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountLinkedInOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountLinkedInOAuth::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute vanity_name + # + # @return [String, nil] + optional :vanity_name, String + + # @!method initialize(email:, first_verified_at:, latest_verified_at:, subject:, type:, verified_at:, name: nil, vanity_name: nil) + # A LinkedIn OAuth account linked to the user. + # + # @param email [String, nil] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountLinkedInOAuth::Type] + # @param verified_at [Float] + # @param name [String] + # @param vanity_name [String] + + # @see Privy::Models::LinkedAccountLinkedInOAuth#type + module Type + extend Privy::Internal::Type::Enum + + LINKEDIN_OAUTH = :linkedin_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_passkey.rb b/lib/privy/models/linked_account_passkey.rb new file mode 100644 index 0000000..6533bee --- /dev/null +++ b/lib/privy/models/linked_account_passkey.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountPasskey < Privy::Internal::Type::BaseModel + # @!attribute credential_id + # + # @return [String] + required :credential_id, String + + # @!attribute enrolled_in_mfa + # + # @return [Boolean] + required :enrolled_in_mfa, Privy::Internal::Type::Boolean + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountPasskey::Type] + required :type, enum: -> { Privy::LinkedAccountPasskey::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute authenticator_name + # + # @return [String, nil] + optional :authenticator_name, String + + # @!attribute created_with_browser + # + # @return [String, nil] + optional :created_with_browser, String + + # @!attribute created_with_device + # + # @return [String, nil] + optional :created_with_device, String + + # @!attribute created_with_os + # + # @return [String, nil] + optional :created_with_os, String + + # @!attribute public_key + # + # @return [String, nil] + optional :public_key, String + + # @!method initialize(credential_id:, enrolled_in_mfa:, first_verified_at:, latest_verified_at:, type:, verified_at:, authenticator_name: nil, created_with_browser: nil, created_with_device: nil, created_with_os: nil, public_key: nil) + # A passkey account linked to the user. + # + # @param credential_id [String] + # @param enrolled_in_mfa [Boolean] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param type [Symbol, Privy::Models::LinkedAccountPasskey::Type] + # @param verified_at [Float] + # @param authenticator_name [String] + # @param created_with_browser [String] + # @param created_with_device [String] + # @param created_with_os [String] + # @param public_key [String] + + # @see Privy::Models::LinkedAccountPasskey#type + module Type + extend Privy::Internal::Type::Enum + + PASSKEY = :passkey + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_passkey_input.rb b/lib/privy/models/linked_account_passkey_input.rb new file mode 100644 index 0000000..2733033 --- /dev/null +++ b/lib/privy/models/linked_account_passkey_input.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountPasskeyInput < Privy::Internal::Type::BaseModel + # @!attribute credential_device_type + # + # @return [Symbol, Privy::Models::LinkedAccountPasskeyInput::CredentialDeviceType] + required :credential_device_type, enum: -> { Privy::LinkedAccountPasskeyInput::CredentialDeviceType } + + # @!attribute credential_id + # + # @return [String] + required :credential_id, String + + # @!attribute credential_public_key + # + # @return [String] + required :credential_public_key, String + + # @!attribute credential_username + # + # @return [String] + required :credential_username, String + + # @!attribute type + # + # @return [Symbol, :passkey] + required :type, const: :passkey + + # @!method initialize(credential_device_type:, credential_id:, credential_public_key:, credential_username:, type: :passkey) + # The payload for importing a passkey account. + # + # @param credential_device_type [Symbol, Privy::Models::LinkedAccountPasskeyInput::CredentialDeviceType] + # @param credential_id [String] + # @param credential_public_key [String] + # @param credential_username [String] + # @param type [Symbol, :passkey] + + # @see Privy::Models::LinkedAccountPasskeyInput#credential_device_type + module CredentialDeviceType + extend Privy::Internal::Type::Enum + + SINGLE_DEVICE = :singleDevice + MULTI_DEVICE = :multiDevice + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_phone.rb b/lib/privy/models/linked_account_phone.rb new file mode 100644 index 0000000..e469be9 --- /dev/null +++ b/lib/privy/models/linked_account_phone.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountPhone < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountPhone::Type] + required :type, enum: -> { Privy::LinkedAccountPhone::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute number + # + # @return [String, nil] + optional :number, String + + # @!method initialize(first_verified_at:, latest_verified_at:, phone_number:, type:, verified_at:, number: nil) + # A phone number account linked to the user. + # + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param phone_number [String] + # @param type [Symbol, Privy::Models::LinkedAccountPhone::Type] + # @param verified_at [Float] + # @param number [String] + + # @see Privy::Models::LinkedAccountPhone#type + module Type + extend Privy::Internal::Type::Enum + + PHONE = :phone + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_phone_input.rb b/lib/privy/models/linked_account_phone_input.rb new file mode 100644 index 0000000..5f28e18 --- /dev/null +++ b/lib/privy/models/linked_account_phone_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountPhoneInput < Privy::Internal::Type::BaseModel + # @!attribute number + # + # @return [String] + required :number, String + + # @!attribute type + # + # @return [Symbol, :phone] + required :type, const: :phone + + # @!method initialize(number:, type: :phone) + # The payload for importing a phone account. + # + # @param number [String] + # @param type [Symbol, :phone] + end + end +end diff --git a/lib/privy/models/linked_account_smart_wallet.rb b/lib/privy/models/linked_account_smart_wallet.rb new file mode 100644 index 0000000..037e1d5 --- /dev/null +++ b/lib/privy/models/linked_account_smart_wallet.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountSmartWallet < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute smart_wallet_type + # The supported smart wallet providers. + # + # @return [Symbol, Privy::Models::SmartWalletType] + required :smart_wallet_type, enum: -> { Privy::SmartWalletType } + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountSmartWallet::Type] + required :type, enum: -> { Privy::LinkedAccountSmartWallet::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute smart_wallet_version + # + # @return [String, nil] + optional :smart_wallet_version, String + + # @!method initialize(address:, first_verified_at:, latest_verified_at:, smart_wallet_type:, type:, verified_at:, smart_wallet_version: nil) + # A smart wallet account linked to the user. + # + # @param address [String] + # + # @param first_verified_at [Float, nil] + # + # @param latest_verified_at [Float, nil] + # + # @param smart_wallet_type [Symbol, Privy::Models::SmartWalletType] The supported smart wallet providers. + # + # @param type [Symbol, Privy::Models::LinkedAccountSmartWallet::Type] + # + # @param verified_at [Float] + # + # @param smart_wallet_version [String] + + # @see Privy::Models::LinkedAccountSmartWallet#type + module Type + extend Privy::Internal::Type::Enum + + SMART_WALLET = :smart_wallet + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_solana.rb b/lib/privy/models/linked_account_solana.rb new file mode 100644 index 0000000..9af0dae --- /dev/null +++ b/lib/privy/models/linked_account_solana.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountSolana < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountSolana::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountSolana::ChainType } + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountSolana::Type] + required :type, enum: -> { Privy::LinkedAccountSolana::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute wallet_client + # + # @return [Symbol, Privy::Models::LinkedAccountSolana::WalletClient] + required :wallet_client, enum: -> { Privy::LinkedAccountSolana::WalletClient } + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String + + # @!method initialize(address:, chain_type:, first_verified_at:, latest_verified_at:, type:, verified_at:, wallet_client:, connector_type: nil, wallet_client_type: nil) + # A Solana wallet account linked to the user. + # + # @param address [String] + # @param chain_type [Symbol, Privy::Models::LinkedAccountSolana::ChainType] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param type [Symbol, Privy::Models::LinkedAccountSolana::Type] + # @param verified_at [Float] + # @param wallet_client [Symbol, Privy::Models::LinkedAccountSolana::WalletClient] + # @param connector_type [String] + # @param wallet_client_type [String] + + # @see Privy::Models::LinkedAccountSolana#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountSolana#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountSolana#wallet_client + module WalletClient + extend Privy::Internal::Type::Enum + + UNKNOWN = :unknown + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_solana_embedded_wallet.rb b/lib/privy/models/linked_account_solana_embedded_wallet.rb new file mode 100644 index 0000000..e901cea --- /dev/null +++ b/lib/privy/models/linked_account_solana_embedded_wallet.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountSolanaEmbeddedWallet < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String, nil] + required :id, String, nil?: true + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountSolanaEmbeddedWallet::ChainType } + + # @!attribute connector_type + # + # @return [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::ConnectorType] + required :connector_type, enum: -> { Privy::LinkedAccountSolanaEmbeddedWallet::ConnectorType } + + # @!attribute delegated + # + # @return [Boolean] + required :delegated, Privy::Internal::Type::Boolean + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute imported + # + # @return [Boolean] + required :imported, Privy::Internal::Type::Boolean + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute recovery_method + # The method used to recover an embedded wallet account. + # + # @return [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] + required :recovery_method, enum: -> { Privy::EmbeddedWalletRecoveryMethod } + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::Type] + required :type, enum: -> { Privy::LinkedAccountSolanaEmbeddedWallet::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute wallet_client + # + # @return [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::WalletClient] + required :wallet_client, enum: -> { Privy::LinkedAccountSolanaEmbeddedWallet::WalletClient } + + # @!attribute wallet_client_type + # + # @return [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::WalletClientType] + required :wallet_client_type, enum: -> { Privy::LinkedAccountSolanaEmbeddedWallet::WalletClientType } + + # @!attribute wallet_index + # + # @return [Float] + required :wallet_index, Float + + # @!method initialize(id:, address:, chain_id:, chain_type:, connector_type:, delegated:, first_verified_at:, imported:, latest_verified_at:, public_key:, recovery_method:, type:, verified_at:, wallet_client:, wallet_client_type:, wallet_index:) + # A Solana embedded wallet account linked to the user. + # + # @param id [String, nil] + # + # @param address [String] + # + # @param chain_id [String] + # + # @param chain_type [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::ChainType] + # + # @param connector_type [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::ConnectorType] + # + # @param delegated [Boolean] + # + # @param first_verified_at [Float, nil] + # + # @param imported [Boolean] + # + # @param latest_verified_at [Float, nil] + # + # @param public_key [String] + # + # @param recovery_method [Symbol, Privy::Models::EmbeddedWalletRecoveryMethod] The method used to recover an embedded wallet account. + # + # @param type [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::Type] + # + # @param verified_at [Float] + # + # @param wallet_client [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::WalletClient] + # + # @param wallet_client_type [Symbol, Privy::Models::LinkedAccountSolanaEmbeddedWallet::WalletClientType] + # + # @param wallet_index [Float] + + # @see Privy::Models::LinkedAccountSolanaEmbeddedWallet#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountSolanaEmbeddedWallet#connector_type + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED = :embedded + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountSolanaEmbeddedWallet#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountSolanaEmbeddedWallet#wallet_client + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::LinkedAccountSolanaEmbeddedWallet#wallet_client_type + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY = :privy + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_spotify_input.rb b/lib/privy/models/linked_account_spotify_input.rb new file mode 100644 index 0000000..b9e1757 --- /dev/null +++ b/lib/privy/models/linked_account_spotify_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountSpotifyInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :spotify_oauth] + required :type, const: :spotify_oauth + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!method initialize(subject:, email: nil, name: nil, type: :spotify_oauth) + # The payload for importing a Spotify account. + # + # @param subject [String] + # @param email [String] + # @param name [String] + # @param type [Symbol, :spotify_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_spotify_oauth.rb b/lib/privy/models/linked_account_spotify_oauth.rb new file mode 100644 index 0000000..ad709b3 --- /dev/null +++ b/lib/privy/models/linked_account_spotify_oauth.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountSpotifyOAuth < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String, nil] + required :email, String, nil?: true + + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountSpotifyOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountSpotifyOAuth::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(email:, first_verified_at:, latest_verified_at:, name:, subject:, type:, verified_at:) + # A Spotify OAuth account linked to the user. + # + # @param email [String, nil] + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param name [String, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountSpotifyOAuth::Type] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountSpotifyOAuth#type + module Type + extend Privy::Internal::Type::Enum + + SPOTIFY_OAUTH = :spotify_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_telegram.rb b/lib/privy/models/linked_account_telegram.rb new file mode 100644 index 0000000..a0337ed --- /dev/null +++ b/lib/privy/models/linked_account_telegram.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTelegram < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute telegram_user_id + # + # @return [String] + required :telegram_user_id, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountTelegram::Type] + required :type, enum: -> { Privy::LinkedAccountTelegram::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String, nil?: true + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String, nil?: true + + # @!attribute photo_url + # + # @return [String, nil] + optional :photo_url, String, nil?: true + + # @!attribute username + # + # @return [String, nil] + optional :username, String, nil?: true + + # @!method initialize(first_verified_at:, latest_verified_at:, telegram_user_id:, type:, verified_at:, first_name: nil, last_name: nil, photo_url: nil, username: nil) + # A Telegram account linked to the user. + # + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param telegram_user_id [String] + # @param type [Symbol, Privy::Models::LinkedAccountTelegram::Type] + # @param verified_at [Float] + # @param first_name [String, nil] + # @param last_name [String, nil] + # @param photo_url [String, nil] + # @param username [String, nil] + + # @see Privy::Models::LinkedAccountTelegram#type + module Type + extend Privy::Internal::Type::Enum + + TELEGRAM = :telegram + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_telegram_input.rb b/lib/privy/models/linked_account_telegram_input.rb new file mode 100644 index 0000000..f61711a --- /dev/null +++ b/lib/privy/models/linked_account_telegram_input.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTelegramInput < Privy::Internal::Type::BaseModel + # @!attribute telegram_user_id + # + # @return [String] + required :telegram_user_id, String + + # @!attribute type + # + # @return [Symbol, :telegram] + required :type, const: :telegram + + # @!attribute first_name + # + # @return [String, nil] + optional :first_name, String + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String + + # @!attribute photo_url + # + # @return [String, nil] + optional :photo_url, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(telegram_user_id:, first_name: nil, last_name: nil, photo_url: nil, username: nil, type: :telegram) + # The payload for importing a Telegram account. + # + # @param telegram_user_id [String] + # @param first_name [String] + # @param last_name [String] + # @param photo_url [String] + # @param username [String] + # @param type [Symbol, :telegram] + end + end +end diff --git a/lib/privy/models/linked_account_tiktok_input.rb b/lib/privy/models/linked_account_tiktok_input.rb new file mode 100644 index 0000000..4b49dab --- /dev/null +++ b/lib/privy/models/linked_account_tiktok_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTiktokInput < Privy::Internal::Type::BaseModel + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :tiktok_oauth] + required :type, const: :tiktok_oauth + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(name:, subject:, username:, type: :tiktok_oauth) + # The payload for importing a Tiktok account. + # + # @param name [String, nil] + # @param subject [String] + # @param username [String] + # @param type [Symbol, :tiktok_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_tiktok_oauth.rb b/lib/privy/models/linked_account_tiktok_oauth.rb new file mode 100644 index 0000000..499cd10 --- /dev/null +++ b/lib/privy/models/linked_account_tiktok_oauth.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTiktokOAuth < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountTiktokOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountTiktokOAuth::Type } + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(first_verified_at:, latest_verified_at:, name:, subject:, type:, username:, verified_at:) + # A TikTok OAuth account linked to the user. + # + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param name [String, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountTiktokOAuth::Type] + # @param username [String, nil] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountTiktokOAuth#type + module Type + extend Privy::Internal::Type::Enum + + TIKTOK_OAUTH = :tiktok_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_twitch_input.rb b/lib/privy/models/linked_account_twitch_input.rb new file mode 100644 index 0000000..47bbe9f --- /dev/null +++ b/lib/privy/models/linked_account_twitch_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTwitchInput < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :twitch_oauth] + required :type, const: :twitch_oauth + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(subject:, username: nil, type: :twitch_oauth) + # The payload for importing a Twitch account. + # + # @param subject [String] + # @param username [String] + # @param type [Symbol, :twitch_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_twitch_oauth.rb b/lib/privy/models/linked_account_twitch_oauth.rb new file mode 100644 index 0000000..4b57012 --- /dev/null +++ b/lib/privy/models/linked_account_twitch_oauth.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTwitchOAuth < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountTwitchOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountTwitchOAuth::Type } + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(first_verified_at:, latest_verified_at:, subject:, type:, username:, verified_at:) + # A Twitch OAuth account linked to the user. + # + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountTwitchOAuth::Type] + # @param username [String, nil] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountTwitchOAuth#type + module Type + extend Privy::Internal::Type::Enum + + TWITCH_OAUTH = :twitch_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_twitter_input.rb b/lib/privy/models/linked_account_twitter_input.rb new file mode 100644 index 0000000..0f3598f --- /dev/null +++ b/lib/privy/models/linked_account_twitter_input.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTwitterInput < Privy::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, :twitter_oauth] + required :type, const: :twitter_oauth + + # @!attribute username + # + # @return [String] + required :username, String + + # @!attribute profile_picture_url + # + # @return [String, nil] + optional :profile_picture_url, String + + # @!method initialize(name:, subject:, username:, profile_picture_url: nil, type: :twitter_oauth) + # The payload for importing a Twitter account. + # + # @param name [String] + # @param subject [String] + # @param username [String] + # @param profile_picture_url [String] + # @param type [Symbol, :twitter_oauth] + end + end +end diff --git a/lib/privy/models/linked_account_twitter_oauth.rb b/lib/privy/models/linked_account_twitter_oauth.rb new file mode 100644 index 0000000..e48a70b --- /dev/null +++ b/lib/privy/models/linked_account_twitter_oauth.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountTwitterOAuth < Privy::Internal::Type::BaseModel + # @!attribute first_verified_at + # + # @return [Float, nil] + required :first_verified_at, Float, nil?: true + + # @!attribute latest_verified_at + # + # @return [Float, nil] + required :latest_verified_at, Float, nil?: true + + # @!attribute name + # + # @return [String, nil] + required :name, String, nil?: true + + # @!attribute profile_picture_url + # + # @return [String, nil] + required :profile_picture_url, String, nil?: true + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::LinkedAccountTwitterOAuth::Type] + required :type, enum: -> { Privy::LinkedAccountTwitterOAuth::Type } + + # @!attribute username + # + # @return [String, nil] + required :username, String, nil?: true + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(first_verified_at:, latest_verified_at:, name:, profile_picture_url:, subject:, type:, username:, verified_at:) + # A Twitter OAuth account linked to the user. + # + # @param first_verified_at [Float, nil] + # @param latest_verified_at [Float, nil] + # @param name [String, nil] + # @param profile_picture_url [String, nil] + # @param subject [String] + # @param type [Symbol, Privy::Models::LinkedAccountTwitterOAuth::Type] + # @param username [String, nil] + # @param verified_at [Float] + + # @see Privy::Models::LinkedAccountTwitterOAuth#type + module Type + extend Privy::Internal::Type::Enum + + TWITTER_OAUTH = :twitter_oauth + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_account_type.rb b/lib/privy/models/linked_account_type.rb new file mode 100644 index 0000000..bfd7fbc --- /dev/null +++ b/lib/privy/models/linked_account_type.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Privy + module Models + # The possible types of linked accounts. + module LinkedAccountType + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::LinkedAccountType::EMAIL } + + variant const: -> { Privy::Models::LinkedAccountType::PHONE } + + variant const: -> { Privy::Models::LinkedAccountType::WALLET } + + variant const: -> { Privy::Models::LinkedAccountType::SMART_WALLET } + + variant const: -> { Privy::Models::LinkedAccountType::GOOGLE_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::TWITTER_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::DISCORD_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::GITHUB_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::SPOTIFY_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::INSTAGRAM_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::TIKTOK_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::LINE_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::TWITCH_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::LINKEDIN_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::APPLE_OAUTH } + + variant const: -> { Privy::Models::LinkedAccountType::CUSTOM_AUTH } + + variant const: -> { Privy::Models::LinkedAccountType::FARCASTER } + + variant const: -> { Privy::Models::LinkedAccountType::PASSKEY } + + variant const: -> { Privy::Models::LinkedAccountType::TELEGRAM } + + variant const: -> { Privy::Models::LinkedAccountType::CROSS_APP } + + variant const: -> { Privy::Models::LinkedAccountType::AUTHORIZATION_KEY } + + # The ID of a custom OAuth provider, set up for this app. Must start with "custom:". + variant -> { Privy::CustomOAuthProviderID } + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Privy::LinkedAccountType::TaggedSymbol, String) } + end + + # @!group + + EMAIL = :email + PHONE = :phone + WALLET = :wallet + SMART_WALLET = :smart_wallet + GOOGLE_OAUTH = :google_oauth + TWITTER_OAUTH = :twitter_oauth + DISCORD_OAUTH = :discord_oauth + GITHUB_OAUTH = :github_oauth + SPOTIFY_OAUTH = :spotify_oauth + INSTAGRAM_OAUTH = :instagram_oauth + TIKTOK_OAUTH = :tiktok_oauth + LINE_OAUTH = :line_oauth + TWITCH_OAUTH = :twitch_oauth + LINKEDIN_OAUTH = :linkedin_oauth + APPLE_OAUTH = :apple_oauth + CUSTOM_AUTH = :custom_auth + FARCASTER = :farcaster + PASSKEY = :passkey + TELEGRAM = :telegram + CROSS_APP = :cross_app + AUTHORIZATION_KEY = :authorization_key + + # @!endgroup + end + end +end diff --git a/lib/privy/models/linked_account_wallet_input.rb b/lib/privy/models/linked_account_wallet_input.rb new file mode 100644 index 0000000..9dd7a45 --- /dev/null +++ b/lib/privy/models/linked_account_wallet_input.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Models + class LinkedAccountWalletInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::LinkedAccountWalletInput::ChainType] + required :chain_type, enum: -> { Privy::LinkedAccountWalletInput::ChainType } + + # @!attribute type + # + # @return [Symbol, :wallet] + required :type, const: :wallet + + # @!method initialize(address:, chain_type:, type: :wallet) + # The payload for importing a wallet account. + # + # @param address [String] + # @param chain_type [Symbol, Privy::Models::LinkedAccountWalletInput::ChainType] + # @param type [Symbol, :wallet] + + # @see Privy::Models::LinkedAccountWalletInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/linked_mfa_method.rb b/lib/privy/models/linked_mfa_method.rb new file mode 100644 index 0000000..ac99ea8 --- /dev/null +++ b/lib/privy/models/linked_mfa_method.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + # A multi-factor authentication method linked to the user. + module LinkedMfaMethod + extend Privy::Internal::Type::Union + + discriminator :type + + # A SMS MFA method. + variant :sms, -> { Privy::SMSMfaMethod } + + # A TOTP MFA method. + variant :totp, -> { Privy::TotpMfaMethod } + + # A Passkey MFA method. + variant :passkey, -> { Privy::PasskeyMfaMethod } + + # @!method self.variants + # @return [Array(Privy::Models::SMSMfaMethod, Privy::Models::TotpMfaMethod, Privy::Models::PasskeyMfaMethod)] + end + end +end diff --git a/lib/privy/models/mfa_disabled_webhook_payload.rb b/lib/privy/models/mfa_disabled_webhook_payload.rb new file mode 100644 index 0000000..79f5979 --- /dev/null +++ b/lib/privy/models/mfa_disabled_webhook_payload.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaDisabledWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute method_ + # The MFA method that was disabled. + # + # @return [Symbol, Privy::Models::MfaDisabledWebhookPayload::Method] + required :method_, enum: -> { Privy::MfaDisabledWebhookPayload::Method }, api_name: :method + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::MfaDisabledWebhookPayload::Type] + required :type, enum: -> { Privy::MfaDisabledWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user who disabled MFA. + # + # @return [String] + required :user_id, String + + # @!method initialize(method_:, type:, user_id:) + # Payload for the mfa.disabled webhook event. + # + # @param method_ [Symbol, Privy::Models::MfaDisabledWebhookPayload::Method] The MFA method that was disabled. + # + # @param type [Symbol, Privy::Models::MfaDisabledWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user who disabled MFA. + + # The MFA method that was disabled. + # + # @see Privy::Models::MfaDisabledWebhookPayload#method_ + module Method + extend Privy::Internal::Type::Enum + + SMS = :sms + TOTP = :totp + PASSKEY = :passkey + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::MfaDisabledWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + MFA_DISABLED = :"mfa.disabled" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/mfa_enabled_webhook_payload.rb b/lib/privy/models/mfa_enabled_webhook_payload.rb new file mode 100644 index 0000000..a0ea675 --- /dev/null +++ b/lib/privy/models/mfa_enabled_webhook_payload.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaEnabledWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute method_ + # The MFA method that was enabled. + # + # @return [Symbol, Privy::Models::MfaEnabledWebhookPayload::Method] + required :method_, enum: -> { Privy::MfaEnabledWebhookPayload::Method }, api_name: :method + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::MfaEnabledWebhookPayload::Type] + required :type, enum: -> { Privy::MfaEnabledWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user who enabled MFA. + # + # @return [String] + required :user_id, String + + # @!method initialize(method_:, type:, user_id:) + # Payload for the mfa.enabled webhook event. + # + # @param method_ [Symbol, Privy::Models::MfaEnabledWebhookPayload::Method] The MFA method that was enabled. + # + # @param type [Symbol, Privy::Models::MfaEnabledWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user who enabled MFA. + + # The MFA method that was enabled. + # + # @see Privy::Models::MfaEnabledWebhookPayload#method_ + module Method + extend Privy::Internal::Type::Enum + + SMS = :sms + TOTP = :totp + PASSKEY = :passkey + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::MfaEnabledWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + MFA_ENABLED = :"mfa.enabled" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/mfa_passkey_enrollment_request_body.rb b/lib/privy/models/mfa_passkey_enrollment_request_body.rb new file mode 100644 index 0000000..5d09a8a --- /dev/null +++ b/lib/privy/models/mfa_passkey_enrollment_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaPasskeyEnrollmentRequestBody < Privy::Internal::Type::BaseModel + # @!attribute credential_ids + # + # @return [Array] + required :credential_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute remove_for_login + # + # @return [Boolean, nil] + optional :remove_for_login, Privy::Internal::Type::Boolean + + # @!method initialize(credential_ids:, remove_for_login: nil) + # The request body for enrolling a passkey MFA flow. + # + # @param credential_ids [Array] + # @param remove_for_login [Boolean] + end + end +end diff --git a/lib/privy/models/mfa_passkey_init_request_body.rb b/lib/privy/models/mfa_passkey_init_request_body.rb new file mode 100644 index 0000000..785df39 --- /dev/null +++ b/lib/privy/models/mfa_passkey_init_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaPasskeyInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(relying_party: nil) + # The request body for initiating a passkey MFA flow. + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/mfa_passkey_init_response_body.rb b/lib/privy/models/mfa_passkey_init_response_body.rb new file mode 100644 index 0000000..3b31657 --- /dev/null +++ b/lib/privy/models/mfa_passkey_init_response_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaPasskeyInitResponseBody < Privy::Internal::Type::BaseModel + # @!attribute options + # WebAuthn authentication options as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorVerifyOptions] + required :options, -> { Privy::PasskeyAuthenticatorVerifyOptions } + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(options:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::MfaPasskeyInitResponseBody} for more details. + # + # The response body for initializing a passkey MFA flow. + # + # @param options [Privy::Models::PasskeyAuthenticatorVerifyOptions] WebAuthn authentication options as defined by the Web Authentication specificati + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/mfa_passkey_verify_request_body.rb b/lib/privy/models/mfa_passkey_verify_request_body.rb new file mode 100644 index 0000000..8efefec --- /dev/null +++ b/lib/privy/models/mfa_passkey_verify_request_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaPasskeyVerifyRequestBody < Privy::Internal::Type::BaseModel + # @!attribute authenticator_response + # WebAuthn authentication response as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorVerifyResponse] + required :authenticator_response, -> { Privy::PasskeyAuthenticatorVerifyResponse } + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(authenticator_response:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::MfaPasskeyVerifyRequestBody} for more details. + # + # The request body for verifying a passkey MFA flow. + # + # @param authenticator_response [Privy::Models::PasskeyAuthenticatorVerifyResponse] WebAuthn authentication response as defined by the Web Authentication specificat + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/mfa_sms_enroll_request_body.rb b/lib/privy/models/mfa_sms_enroll_request_body.rb new file mode 100644 index 0000000..8087159 --- /dev/null +++ b/lib/privy/models/mfa_sms_enroll_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaSMSEnrollRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!method initialize(code:, phone_number:) + # The request body for enrolling a SMS MFA code. + # + # @param code [String] + # @param phone_number [String] + end + end +end diff --git a/lib/privy/models/mfa_sms_init_enroll_input.rb b/lib/privy/models/mfa_sms_init_enroll_input.rb new file mode 100644 index 0000000..ecec03b --- /dev/null +++ b/lib/privy/models/mfa_sms_init_enroll_input.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaSMSInitEnrollInput < Privy::Internal::Type::BaseModel + # @!attribute action + # + # @return [Symbol, Privy::Models::MfaSMSInitEnrollInput::Action] + required :action, enum: -> { Privy::MfaSMSInitEnrollInput::Action } + + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!method initialize(action:, phone_number:) + # Input for enrolling SMS MFA. + # + # @param action [Symbol, Privy::Models::MfaSMSInitEnrollInput::Action] + # @param phone_number [String] + + # @see Privy::Models::MfaSMSInitEnrollInput#action + module Action + extend Privy::Internal::Type::Enum + + ENROLL = :enroll + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/mfa_sms_init_request_body.rb b/lib/privy/models/mfa_sms_init_request_body.rb new file mode 100644 index 0000000..5f0b11c --- /dev/null +++ b/lib/privy/models/mfa_sms_init_request_body.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # The request body for initiating a SMS MFA flow. + module MfaSMSInitRequestBody + extend Privy::Internal::Type::Union + + # Input for verifying SMS MFA. + variant -> { Privy::MfaSMSInitVerifyInput } + + # Input for enrolling SMS MFA. + variant -> { Privy::MfaSMSInitEnrollInput } + + # @!method self.variants + # @return [Array(Privy::Models::MfaSMSInitVerifyInput, Privy::Models::MfaSMSInitEnrollInput)] + end + end +end diff --git a/lib/privy/models/mfa_sms_init_verify_input.rb b/lib/privy/models/mfa_sms_init_verify_input.rb new file mode 100644 index 0000000..d49e47d --- /dev/null +++ b/lib/privy/models/mfa_sms_init_verify_input.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaSMSInitVerifyInput < Privy::Internal::Type::BaseModel + # @!attribute action + # + # @return [Symbol, Privy::Models::MfaSMSInitVerifyInput::Action] + required :action, enum: -> { Privy::MfaSMSInitVerifyInput::Action } + + # @!method initialize(action:) + # Input for verifying SMS MFA. + # + # @param action [Symbol, Privy::Models::MfaSMSInitVerifyInput::Action] + + # @see Privy::Models::MfaSMSInitVerifyInput#action + module Action + extend Privy::Internal::Type::Enum + + VERIFY = :verify + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/mfa_sms_verify_request_body.rb b/lib/privy/models/mfa_sms_verify_request_body.rb new file mode 100644 index 0000000..8cc440f --- /dev/null +++ b/lib/privy/models/mfa_sms_verify_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaSMSVerifyRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!method initialize(code:) + # The request body for verifying a SMS MFA code. + # + # @param code [String] + end + end +end diff --git a/lib/privy/models/mfa_totp_init_response_body.rb b/lib/privy/models/mfa_totp_init_response_body.rb new file mode 100644 index 0000000..2321a6c --- /dev/null +++ b/lib/privy/models/mfa_totp_init_response_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaTotpInitResponseBody < Privy::Internal::Type::BaseModel + # @!attribute totp_auth_url + # + # @return [String] + required :totp_auth_url, String, api_name: :totpAuthUrl + + # @!attribute totp_secret + # + # @return [String] + required :totp_secret, String, api_name: :totpSecret + + # @!method initialize(totp_auth_url:, totp_secret:) + # The response body for initializing a TOTP MFA code. + # + # @param totp_auth_url [String] + # @param totp_secret [String] + end + end +end diff --git a/lib/privy/models/mfa_totp_input.rb b/lib/privy/models/mfa_totp_input.rb new file mode 100644 index 0000000..2c5fc3d --- /dev/null +++ b/lib/privy/models/mfa_totp_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaTotpInput < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!method initialize(code:) + # The input for verifying a TOTP MFA code. + # + # @param code [String] + end + end +end diff --git a/lib/privy/models/mfa_verify_response_body.rb b/lib/privy/models/mfa_verify_response_body.rb new file mode 100644 index 0000000..00e29e5 --- /dev/null +++ b/lib/privy/models/mfa_verify_response_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class MfaVerifyResponseBody < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String] + required :token, String + + # @!method initialize(token:) + # The response body for verifying a MFA code. + # + # @param token [String] + end + end +end diff --git a/lib/privy/models/moonpay_currency_code.rb b/lib/privy/models/moonpay_currency_code.rb new file mode 100644 index 0000000..5a4d2f3 --- /dev/null +++ b/lib/privy/models/moonpay_currency_code.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + # A Moonpay currency code for an Ethereum-compatible chain asset. + module MoonpayCurrencyCode + extend Privy::Internal::Type::Enum + + AVAX_CCHAIN = :AVAX_CCHAIN + CELO_CELO = :CELO_CELO + CUSD_CELO = :CUSD_CELO + DAI_ETHEREUM = :DAI_ETHEREUM + ETH_ETHEREUM = :ETH_ETHEREUM + ETH_ARBITRUM = :ETH_ARBITRUM + ETH_OPTIMISM = :ETH_OPTIMISM + ETH_POLYGON = :ETH_POLYGON + ETH_BASE = :ETH_BASE + FIL_FVM = :FIL_FVM + MATIC_ETHEREUM = :MATIC_ETHEREUM + MATIC_POLYGON = :MATIC_POLYGON + POL_POLYGON = :POL_POLYGON + POL_ETHEREUM = :POL_ETHEREUM + USDC_ETHEREUM = :USDC_ETHEREUM + USDC_ARBITRUM = :USDC_ARBITRUM + USDC_OPTIMISM = :USDC_OPTIMISM + USDC_POLYGON = :USDC_POLYGON + USDC_BASE = :USDC_BASE + USDC_CCHAIN = :USDC_CCHAIN + USDC_SOL = :USDC_SOL + USDT_ETHEREUM = :USDT_ETHEREUM + USDT_POLYGON = :USDT_POLYGON + WETH_POLYGON = :WETH_POLYGON + WBTC_ETHEREUM = :WBTC_ETHEREUM + BNB_BNB = :BNB_BNB + BNB_BSC = :BNB_BSC + MON_MON = :MON_MON + CELO = :CELO + CUSD = :CUSD + DAI = :DAI + ETH = :ETH + FIL = :FIL + MATIC = :MATIC + USDC = :USDC + USDT = :USDT + WETH = :WETH + WBTC = :WBTC + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/moonpay_fiat_on_ramp_ethereum_config.rb b/lib/privy/models/moonpay_fiat_on_ramp_ethereum_config.rb new file mode 100644 index 0000000..370f81e --- /dev/null +++ b/lib/privy/models/moonpay_fiat_on_ramp_ethereum_config.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Privy + module Models + class MoonpayFiatOnRampEthereumConfig < Privy::Internal::Type::BaseModel + # @!attribute currency_code + # A Moonpay currency code for an Ethereum-compatible chain asset. + # + # @return [Symbol, Privy::Models::MoonpayCurrencyCode, nil] + optional :currency_code, enum: -> { Privy::MoonpayCurrencyCode }, api_name: :currencyCode + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute payment_method + # A payment method supported by Moonpay on-ramp. + # + # @return [Symbol, Privy::Models::MoonpayPaymentMethod, nil] + optional :payment_method, enum: -> { Privy::MoonpayPaymentMethod }, api_name: :paymentMethod + + # @!attribute quote_currency_amount + # + # @return [Float, nil] + optional :quote_currency_amount, Float, api_name: :quoteCurrencyAmount + + # @!attribute ui_config + # UI configuration for the Moonpay on-ramp widget. + # + # @return [Privy::Models::MoonpayUiConfig, nil] + optional :ui_config, -> { Privy::MoonpayUiConfig }, api_name: :uiConfig + + # @!method initialize(currency_code: nil, email: nil, payment_method: nil, quote_currency_amount: nil, ui_config: nil) + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + # + # @param currency_code [Symbol, Privy::Models::MoonpayCurrencyCode] A Moonpay currency code for an Ethereum-compatible chain asset. + # + # @param email [String] + # + # @param payment_method [Symbol, Privy::Models::MoonpayPaymentMethod] A payment method supported by Moonpay on-ramp. + # + # @param quote_currency_amount [Float] + # + # @param ui_config [Privy::Models::MoonpayUiConfig] UI configuration for the Moonpay on-ramp widget. + end + end +end diff --git a/lib/privy/models/moonpay_fiat_on_ramp_ethereum_input.rb b/lib/privy/models/moonpay_fiat_on_ramp_ethereum_input.rb new file mode 100644 index 0000000..acc1e92 --- /dev/null +++ b/lib/privy/models/moonpay_fiat_on_ramp_ethereum_input.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class MoonpayFiatOnRampEthereumInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute config + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + # + # @return [Privy::Models::MoonpayFiatOnRampEthereumConfig] + required :config, -> { Privy::MoonpayFiatOnRampEthereumConfig } + + # @!method initialize(address:, config:) + # Input for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + # + # @param address [String] + # + # @param config [Privy::Models::MoonpayFiatOnRampEthereumConfig] Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + end + end +end diff --git a/lib/privy/models/moonpay_fiat_on_ramp_solana_config.rb b/lib/privy/models/moonpay_fiat_on_ramp_solana_config.rb new file mode 100644 index 0000000..1e98dc1 --- /dev/null +++ b/lib/privy/models/moonpay_fiat_on_ramp_solana_config.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +module Privy + module Models + class MoonpayFiatOnRampSolanaConfig < Privy::Internal::Type::BaseModel + # @!attribute currency_code + # A Moonpay currency code for a Solana asset. + # + # @return [Symbol, Privy::Models::MoonpaySolanaCurrencyCode, nil] + optional :currency_code, enum: -> { Privy::MoonpaySolanaCurrencyCode }, api_name: :currencyCode + + # @!attribute email + # + # @return [String, nil] + optional :email, String + + # @!attribute payment_method + # A payment method supported by Moonpay on-ramp. + # + # @return [Symbol, Privy::Models::MoonpayPaymentMethod, nil] + optional :payment_method, enum: -> { Privy::MoonpayPaymentMethod }, api_name: :paymentMethod + + # @!attribute quote_currency_amount + # + # @return [Float, nil] + optional :quote_currency_amount, Float, api_name: :quoteCurrencyAmount + + # @!attribute ui_config + # UI configuration for the Moonpay on-ramp widget. + # + # @return [Privy::Models::MoonpayUiConfig, nil] + optional :ui_config, -> { Privy::MoonpayUiConfig }, api_name: :uiConfig + + # @!method initialize(currency_code: nil, email: nil, payment_method: nil, quote_currency_amount: nil, ui_config: nil) + # Configuration for a Moonpay fiat on-ramp for Solana. + # + # @param currency_code [Symbol, Privy::Models::MoonpaySolanaCurrencyCode] A Moonpay currency code for a Solana asset. + # + # @param email [String] + # + # @param payment_method [Symbol, Privy::Models::MoonpayPaymentMethod] A payment method supported by Moonpay on-ramp. + # + # @param quote_currency_amount [Float] + # + # @param ui_config [Privy::Models::MoonpayUiConfig] UI configuration for the Moonpay on-ramp widget. + end + end +end diff --git a/lib/privy/models/moonpay_fiat_on_ramp_solana_input.rb b/lib/privy/models/moonpay_fiat_on_ramp_solana_input.rb new file mode 100644 index 0000000..64b98a6 --- /dev/null +++ b/lib/privy/models/moonpay_fiat_on_ramp_solana_input.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class MoonpayFiatOnRampSolanaInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute config + # Configuration for a Moonpay fiat on-ramp for Solana. + # + # @return [Privy::Models::MoonpayFiatOnRampSolanaConfig] + required :config, -> { Privy::MoonpayFiatOnRampSolanaConfig } + + # @!method initialize(address:, config:) + # Input for a Moonpay fiat on-ramp for Solana. + # + # @param address [String] + # + # @param config [Privy::Models::MoonpayFiatOnRampSolanaConfig] Configuration for a Moonpay fiat on-ramp for Solana. + end + end +end diff --git a/lib/privy/models/moonpay_on_ramp_sandbox_config.rb b/lib/privy/models/moonpay_on_ramp_sandbox_config.rb new file mode 100644 index 0000000..7465832 --- /dev/null +++ b/lib/privy/models/moonpay_on_ramp_sandbox_config.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class MoonpayOnRampSandboxConfig < Privy::Internal::Type::BaseModel + # @!attribute use_sandbox + # + # @return [Boolean, nil] + optional :use_sandbox, Privy::Internal::Type::Boolean, api_name: :useSandbox + + # @!method initialize(use_sandbox: nil) + # Sandbox configuration for a Moonpay on-ramp. + # + # @param use_sandbox [Boolean] + end + end +end diff --git a/lib/privy/models/moonpay_on_ramp_sign_input.rb b/lib/privy/models/moonpay_on_ramp_sign_input.rb new file mode 100644 index 0000000..2f72e5c --- /dev/null +++ b/lib/privy/models/moonpay_on_ramp_sign_input.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Privy + module Models + # The input for signing a Moonpay on-ramp. + module MoonpayOnRampSignInput + extend Privy::Internal::Type::Union + + # Sandbox configuration for a Moonpay on-ramp. + variant -> { Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampEthereumInput } + + # Sandbox configuration for a Moonpay on-ramp. + variant -> { Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampSolanaInput } + + class MoonpayFiatOnRampEthereumInput < Privy::Internal::Type::BaseModel + # @!attribute use_sandbox + # + # @return [Boolean, nil] + optional :use_sandbox, Privy::Internal::Type::Boolean, api_name: :useSandbox + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute config + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + # + # @return [Privy::Models::MoonpayFiatOnRampEthereumConfig] + required :config, -> { Privy::MoonpayFiatOnRampEthereumConfig } + + # @!method initialize(address:, config:, use_sandbox: nil) + # Sandbox configuration for a Moonpay on-ramp. + # + # @param address [String] + # + # @param config [Privy::Models::MoonpayFiatOnRampEthereumConfig] Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + # + # @param use_sandbox [Boolean] + end + + class MoonpayFiatOnRampSolanaInput < Privy::Internal::Type::BaseModel + # @!attribute use_sandbox + # + # @return [Boolean, nil] + optional :use_sandbox, Privy::Internal::Type::Boolean, api_name: :useSandbox + + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute config + # Configuration for a Moonpay fiat on-ramp for Solana. + # + # @return [Privy::Models::MoonpayFiatOnRampSolanaConfig] + required :config, -> { Privy::MoonpayFiatOnRampSolanaConfig } + + # @!method initialize(address:, config:, use_sandbox: nil) + # Sandbox configuration for a Moonpay on-ramp. + # + # @param address [String] + # + # @param config [Privy::Models::MoonpayFiatOnRampSolanaConfig] Configuration for a Moonpay fiat on-ramp for Solana. + # + # @param use_sandbox [Boolean] + end + + # @!method self.variants + # @return [Array(Privy::Models::MoonpayOnRampSignInput::MoonpayFiatOnRampEthereumInput, Privy::Models::MoonpayOnRampSignInput::MoonpayFiatOnRampSolanaInput)] + end + end +end diff --git a/lib/privy/models/moonpay_on_ramp_sign_response.rb b/lib/privy/models/moonpay_on_ramp_sign_response.rb new file mode 100644 index 0000000..94e7bd3 --- /dev/null +++ b/lib/privy/models/moonpay_on_ramp_sign_response.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class MoonpayOnRampSignResponse < Privy::Internal::Type::BaseModel + # @!attribute external_transaction_id + # + # @return [String] + required :external_transaction_id, String, api_name: :externalTransactionId + + # @!attribute signed_url + # + # @return [String] + required :signed_url, String, api_name: :signedUrl + + # @!method initialize(external_transaction_id:, signed_url:) + # The response from signing a Moonpay on-ramp. + # + # @param external_transaction_id [String] + # @param signed_url [String] + end + end +end diff --git a/lib/privy/models/moonpay_payment_method.rb b/lib/privy/models/moonpay_payment_method.rb new file mode 100644 index 0000000..10d5cf6 --- /dev/null +++ b/lib/privy/models/moonpay_payment_method.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + # A payment method supported by Moonpay on-ramp. + module MoonpayPaymentMethod + extend Privy::Internal::Type::Enum + + ACH_BANK_TRANSFER = :ach_bank_transfer + CREDIT_DEBIT_CARD = :credit_debit_card + GBP_BANK_TRANSFER = :gbp_bank_transfer + GBP_OPEN_BANKING_PAYMENT = :gbp_open_banking_payment + MOBILE_WALLET = :mobile_wallet + SEPA_BANK_TRANSFER = :sepa_bank_transfer + SEPA_OPEN_BANKING_PAYMENT = :sepa_open_banking_payment + PIX_INSTANT_PAYMENT = :pix_instant_payment + YELLOW_CARD_BANK_TRANSFER = :yellow_card_bank_transfer + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/moonpay_solana_currency_code.rb b/lib/privy/models/moonpay_solana_currency_code.rb new file mode 100644 index 0000000..7cb45d4 --- /dev/null +++ b/lib/privy/models/moonpay_solana_currency_code.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # A Moonpay currency code for a Solana asset. + module MoonpaySolanaCurrencyCode + extend Privy::Internal::Type::Enum + + SOL = :SOL + USDC_SOL = :USDC_SOL + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/moonpay_ui_config.rb b/lib/privy/models/moonpay_ui_config.rb new file mode 100644 index 0000000..629e677 --- /dev/null +++ b/lib/privy/models/moonpay_ui_config.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class MoonpayUiConfig < Privy::Internal::Type::BaseModel + # @!attribute accent_color + # + # @return [String, nil] + optional :accent_color, String, api_name: :accentColor + + # @!attribute theme + # The theme for the Moonpay on-ramp widget. + # + # @return [Symbol, Privy::Models::MoonpayUiTheme, nil] + optional :theme, enum: -> { Privy::MoonpayUiTheme } + + # @!method initialize(accent_color: nil, theme: nil) + # UI configuration for the Moonpay on-ramp widget. + # + # @param accent_color [String] + # + # @param theme [Symbol, Privy::Models::MoonpayUiTheme] The theme for the Moonpay on-ramp widget. + end + end +end diff --git a/lib/privy/models/moonpay_ui_theme.rb b/lib/privy/models/moonpay_ui_theme.rb new file mode 100644 index 0000000..1ec1945 --- /dev/null +++ b/lib/privy/models/moonpay_ui_theme.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The theme for the Moonpay on-ramp widget. + module MoonpayUiTheme + extend Privy::Internal::Type::Enum + + LIGHT = :light + DARK = :dark + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/named_token_transfer_source.rb b/lib/privy/models/named_token_transfer_source.rb new file mode 100644 index 0000000..d58a8ca --- /dev/null +++ b/lib/privy/models/named_token_transfer_source.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class NamedTokenTransferSource < Privy::Internal::Type::BaseModel + # @!attribute amount + # Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 + # USDC, "0.01" for 0.01 ETH). Not in the smallest on-chain unit (wei, lamports, + # etc.). + # + # @return [String] + required :amount, String + + # @!attribute asset + # The asset to transfer. Supported: 'usdc', 'usdb', 'usdt' (stablecoins), 'eth' + # (native Ethereum), 'sol' (native Solana). + # + # @return [String] + required :asset, String + + # @!attribute chain + # The blockchain network on which to perform the transfer. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and their + # respective testnets. + # + # @return [String] + required :chain, String + + # @!method initialize(amount:, asset:, chain:) + # Some parameter documentations has been truncated, see + # {Privy::Models::NamedTokenTransferSource} for more details. + # + # Source for a transfer identified by a named asset (e.g. "usdc", "eth"). Use this + # variant for first-class assets maintained by Privy. + # + # @param amount [String] Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 USDC + # + # @param asset [String] The asset to transfer. Supported: 'usdc', 'usdb', 'usdt' (stablecoins), 'eth' (n + # + # @param chain [String] The blockchain network on which to perform the transfer. Supported chains includ + end + end +end diff --git a/lib/privy/models/oauth_authenticate_recovery_response.rb b/lib/privy/models/oauth_authenticate_recovery_response.rb new file mode 100644 index 0000000..b6455de --- /dev/null +++ b/lib/privy/models/oauth_authenticate_recovery_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthAuthenticateRecoveryResponse < Privy::Internal::Type::BaseModel + # @!attribute access_token + # + # @return [String] + required :access_token, String + + # @!method initialize(access_token:) + # The response from authenticating with OAuth for recovery. + # + # @param access_token [String] + end + end +end diff --git a/lib/privy/models/oauth_authenticate_request_body.rb b/lib/privy/models/oauth_authenticate_request_body.rb new file mode 100644 index 0000000..455c668 --- /dev/null +++ b/lib/privy/models/oauth_authenticate_request_body.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute authorization_code + # + # @return [String] + required :authorization_code, String + + # @!attribute state_code + # + # @return [String] + required :state_code, String + + # @!attribute code_type + # The type of OAuth authorization code. + # + # @return [Symbol, Privy::Models::OAuthCodeType, nil] + optional :code_type, enum: -> { Privy::OAuthCodeType } + + # @!attribute code_verifier + # + # @return [String, nil] + optional :code_verifier, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(authorization_code:, state_code:, code_type: nil, code_verifier: nil, mode: nil) + # The request body for authenticating an OAuth account. + # + # @param authorization_code [String] + # + # @param state_code [String] + # + # @param code_type [Symbol, Privy::Models::OAuthCodeType] The type of OAuth authorization code. + # + # @param code_verifier [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/oauth_authorization_code_request_body.rb b/lib/privy/models/oauth_authorization_code_request_body.rb new file mode 100644 index 0000000..b9187ef --- /dev/null +++ b/lib/privy/models/oauth_authorization_code_request_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthAuthorizationCodeRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code_challenge + # + # @return [String] + required :code_challenge, String + + # @!attribute redirect_to + # + # @return [String] + required :redirect_to, String + + # @!attribute state + # + # @return [String] + required :state, String + + # @!method initialize(code_challenge:, redirect_to:, state:) + # The request body for getting an OAuth authorization code. + # + # @param code_challenge [String] + # @param redirect_to [String] + # @param state [String] + end + end +end diff --git a/lib/privy/models/oauth_callback_icloud_expo_input.rb b/lib/privy/models/oauth_callback_icloud_expo_input.rb new file mode 100644 index 0000000..1692f01 --- /dev/null +++ b/lib/privy/models/oauth_callback_icloud_expo_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthCallbackICloudExpoInput < Privy::Internal::Type::BaseModel + # @!attribute ck_web_auth_token + # + # @return [String] + required :ck_web_auth_token, String, api_name: :ckWebAuthToken + + # @!method initialize(ck_web_auth_token:) + # The input for the iCloud Expo OAuth callback. + # + # @param ck_web_auth_token [String] + end + end +end diff --git a/lib/privy/models/oauth_code_type.rb b/lib/privy/models/oauth_code_type.rb new file mode 100644 index 0000000..2cb6782 --- /dev/null +++ b/lib/privy/models/oauth_code_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Privy + module Models + # The type of OAuth authorization code. + module OAuthCodeType + extend Privy::Internal::Type::Enum + + RAW = :raw + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/oauth_init_icloud_recovery_input.rb b/lib/privy/models/oauth_init_icloud_recovery_input.rb new file mode 100644 index 0000000..baefc97 --- /dev/null +++ b/lib/privy/models/oauth_init_icloud_recovery_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthInitICloudRecoveryInput < Privy::Internal::Type::BaseModel + # @!attribute client_type + # The client type for iCloud recovery operations. + # + # @return [Symbol, Privy::Models::ICloudClientType] + required :client_type, enum: -> { Privy::ICloudClientType } + + # @!method initialize(client_type:) + # The input for initiating an iCloud OAuth recovery flow. + # + # @param client_type [Symbol, Privy::Models::ICloudClientType] The client type for iCloud recovery operations. + end + end +end diff --git a/lib/privy/models/oauth_init_recovery_input.rb b/lib/privy/models/oauth_init_recovery_input.rb new file mode 100644 index 0000000..9ec92c2 --- /dev/null +++ b/lib/privy/models/oauth_init_recovery_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthInitRecoveryInput < Privy::Internal::Type::BaseModel + # @!attribute redirect_to + # + # @return [String] + required :redirect_to, String + + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute code_challenge + # + # @return [String, nil] + optional :code_challenge, String + + # @!attribute state_code + # + # @return [String, nil] + optional :state_code, String + + # @!method initialize(redirect_to:, token: nil, code_challenge: nil, state_code: nil) + # The input for initiating an OAuth recovery flow. + # + # @param redirect_to [String] + # @param token [String] + # @param code_challenge [String] + # @param state_code [String] + end + end +end diff --git a/lib/privy/models/oauth_init_request_body.rb b/lib/privy/models/oauth_init_request_body.rb new file mode 100644 index 0000000..f356e07 --- /dev/null +++ b/lib/privy/models/oauth_init_request_body.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute provider + # The ID of an OAuth provider. + # + # @return [Symbol, Privy::Models::ExternalOAuthProviderID, String] + required :provider, union: -> { Privy::OAuthProviderID } + + # @!attribute redirect_to + # + # @return [String] + required :redirect_to, String + + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute code_challenge + # + # @return [String, nil] + optional :code_challenge, String + + # @!attribute state_code + # + # @return [String, nil] + optional :state_code, String + + # @!method initialize(provider:, redirect_to:, token: nil, code_challenge: nil, state_code: nil) + # The request body for initiating an OAuth ceremony. + # + # @param provider [Symbol, Privy::Models::ExternalOAuthProviderID, String] The ID of an OAuth provider. + # + # @param redirect_to [String] + # + # @param token [String] + # + # @param code_challenge [String] + # + # @param state_code [String] + end + end +end diff --git a/lib/privy/models/oauth_init_response_body.rb b/lib/privy/models/oauth_init_response_body.rb new file mode 100644 index 0000000..2d3978d --- /dev/null +++ b/lib/privy/models/oauth_init_response_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthInitResponseBody < Privy::Internal::Type::BaseModel + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(url:) + # The response for initiating an OAuth ceremony. + # + # @param url [String] + end + end +end diff --git a/lib/privy/models/oauth_link_request_body.rb b/lib/privy/models/oauth_link_request_body.rb new file mode 100644 index 0000000..768703e --- /dev/null +++ b/lib/privy/models/oauth_link_request_body.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute authorization_code + # + # @return [String] + required :authorization_code, String + + # @!attribute state_code + # + # @return [String] + required :state_code, String + + # @!attribute code_type + # The type of OAuth authorization code. + # + # @return [Symbol, Privy::Models::OAuthCodeType, nil] + optional :code_type, enum: -> { Privy::OAuthCodeType } + + # @!attribute code_verifier + # + # @return [String, nil] + optional :code_verifier, String + + # @!method initialize(authorization_code:, state_code:, code_type: nil, code_verifier: nil) + # The request body for linking an OAuth account. + # + # @param authorization_code [String] + # + # @param state_code [String] + # + # @param code_type [Symbol, Privy::Models::OAuthCodeType] The type of OAuth authorization code. + # + # @param code_verifier [String] + end + end +end diff --git a/lib/privy/models/oauth_link_response_body.rb b/lib/privy/models/oauth_link_response_body.rb new file mode 100644 index 0000000..4b23dd5 --- /dev/null +++ b/lib/privy/models/oauth_link_response_body.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthLinkResponseBody < Privy::Models::User + # @!attribute oauth_tokens + # OAuth tokens associated with the user. + # + # @return [Privy::Models::OAuthTokens, nil] + optional :oauth_tokens, -> { Privy::OAuthTokens } + + # @!method initialize(oauth_tokens: nil) + # The response for linking an OAuth account. + # + # @param oauth_tokens [Privy::Models::OAuthTokens] OAuth tokens associated with the user. + end + end +end diff --git a/lib/privy/models/oauth_provider_id.rb b/lib/privy/models/oauth_provider_id.rb new file mode 100644 index 0000000..e88bdc1 --- /dev/null +++ b/lib/privy/models/oauth_provider_id.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # The ID of an OAuth provider. + module OAuthProviderID + extend Privy::Internal::Type::Union + + # The ID of an external OAuth provider. + variant enum: -> { Privy::ExternalOAuthProviderID } + + # The ID of a Privy app as an OAuth provider. Must start with "privy:". + variant -> { Privy::PrivyOAuthProviderID } + + # @!method self.variants + # @return [Array(Symbol, Privy::Models::ExternalOAuthProviderID, String)] + end + end +end diff --git a/lib/privy/models/oauth_tokens.rb b/lib/privy/models/oauth_tokens.rb new file mode 100644 index 0000000..e88710d --- /dev/null +++ b/lib/privy/models/oauth_tokens.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthTokens < Privy::Internal::Type::BaseModel + # @!attribute access_token + # + # @return [String] + required :access_token, String + + # @!attribute provider + # + # @return [String] + required :provider, String + + # @!attribute access_token_expires_in_seconds + # + # @return [Float, nil] + optional :access_token_expires_in_seconds, Float + + # @!attribute refresh_token + # + # @return [String, nil] + optional :refresh_token, String + + # @!attribute refresh_token_expires_in_seconds + # + # @return [Float, nil] + optional :refresh_token_expires_in_seconds, Float + + # @!attribute scopes + # + # @return [Array, nil] + optional :scopes, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(access_token:, provider:, access_token_expires_in_seconds: nil, refresh_token: nil, refresh_token_expires_in_seconds: nil, scopes: nil) + # OAuth tokens associated with the user. + # + # @param access_token [String] + # @param provider [String] + # @param access_token_expires_in_seconds [Float] + # @param refresh_token [String] + # @param refresh_token_expires_in_seconds [Float] + # @param scopes [Array] + end + end +end diff --git a/lib/privy/models/oauth_transfer_request_body.rb b/lib/privy/models/oauth_transfer_request_body.rb new file mode 100644 index 0000000..0e32cab --- /dev/null +++ b/lib/privy/models/oauth_transfer_request_body.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthTransferRequestBody < Privy::Internal::Type::BaseModel + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute user_info + # User info for an OAuth transfer. + # + # @return [Privy::Models::OAuthTransferUserInfo] + required :user_info, -> { Privy::OAuthTransferUserInfo }, api_name: :userInfo + + # @!method initialize(nonce:, user_info:) + # The request body for transferring an OAuth account. + # + # @param nonce [String] + # + # @param user_info [Privy::Models::OAuthTransferUserInfo] User info for an OAuth transfer. + end + end +end diff --git a/lib/privy/models/oauth_transfer_user_info.rb b/lib/privy/models/oauth_transfer_user_info.rb new file mode 100644 index 0000000..fa0d4a0 --- /dev/null +++ b/lib/privy/models/oauth_transfer_user_info.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthTransferUserInfo < Privy::Internal::Type::BaseModel + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!attribute email + # + # @return [String, nil] + optional :email, String, nil?: true + + # @!attribute embedded_wallet_addresses + # + # @return [Array, nil] + optional :embedded_wallet_addresses, + Privy::Internal::Type::ArrayOf[String], + api_name: :embeddedWalletAddresses + + # @!attribute meta + # Metadata for an OAuth transfer user info. + # + # @return [Privy::Models::OAuthTransferUserInfoMeta, nil] + optional :meta, -> { Privy::OAuthTransferUserInfoMeta } + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute profile_picture_url + # + # @return [String, nil] + optional :profile_picture_url, String, api_name: :profilePictureUrl + + # @!attribute smart_wallet_addresses + # + # @return [Array, nil] + optional :smart_wallet_addresses, + Privy::Internal::Type::ArrayOf[String], + api_name: :smartWalletAddresses + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!attribute vanity_name + # + # @return [String, nil] + optional :vanity_name, String, api_name: :vanityName + + # @!method initialize(subject:, email: nil, embedded_wallet_addresses: nil, meta: nil, name: nil, profile_picture_url: nil, smart_wallet_addresses: nil, username: nil, vanity_name: nil) + # User info for an OAuth transfer. + # + # @param subject [String] + # + # @param email [String, nil] + # + # @param embedded_wallet_addresses [Array] + # + # @param meta [Privy::Models::OAuthTransferUserInfoMeta] Metadata for an OAuth transfer user info. + # + # @param name [String] + # + # @param profile_picture_url [String] + # + # @param smart_wallet_addresses [Array] + # + # @param username [String] + # + # @param vanity_name [String] + end + end +end diff --git a/lib/privy/models/oauth_transfer_user_info_meta.rb b/lib/privy/models/oauth_transfer_user_info_meta.rb new file mode 100644 index 0000000..5842e64 --- /dev/null +++ b/lib/privy/models/oauth_transfer_user_info_meta.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthTransferUserInfoMeta < Privy::Internal::Type::BaseModel + # @!attribute provider_app_id + # + # @return [String, nil] + optional :provider_app_id, String, api_name: :providerAppId + + # @!method initialize(provider_app_id: nil) + # Metadata for an OAuth transfer user info. + # + # @param provider_app_id [String] + end + end +end diff --git a/lib/privy/models/oauth_unlink_request_body.rb b/lib/privy/models/oauth_unlink_request_body.rb new file mode 100644 index 0000000..49457e7 --- /dev/null +++ b/lib/privy/models/oauth_unlink_request_body.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthUnlinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute provider + # The ID of an OAuth provider. + # + # @return [Symbol, Privy::Models::ExternalOAuthProviderID, String] + required :provider, union: -> { Privy::OAuthProviderID } + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!method initialize(provider:, subject:) + # The request body for unlinking an OAuth account. + # + # @param provider [Symbol, Privy::Models::ExternalOAuthProviderID, String] The ID of an OAuth provider. + # + # @param subject [String] + end + end +end diff --git a/lib/privy/models/oauth_verify_request_body.rb b/lib/privy/models/oauth_verify_request_body.rb new file mode 100644 index 0000000..c40c755 --- /dev/null +++ b/lib/privy/models/oauth_verify_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthVerifyRequestBody < Privy::Internal::Type::BaseModel + # @!attribute prat + # + # @return [String] + required :prat, String + + # @!method initialize(prat:) + # The request body for verifying a PRAT. + # + # @param prat [String] + end + end +end diff --git a/lib/privy/models/oauth_verify_response_body.rb b/lib/privy/models/oauth_verify_response_body.rb new file mode 100644 index 0000000..342e9a7 --- /dev/null +++ b/lib/privy/models/oauth_verify_response_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OAuthVerifyResponseBody < Privy::Internal::Type::BaseModel + # @!attribute verified + # + # @return [Boolean] + required :verified, Privy::Internal::Type::Boolean + + # @!method initialize(verified:) + # The response body when verifying a PRAT. + # + # @param verified [Boolean] + end + end +end diff --git a/lib/privy/models/onramp_provider.rb b/lib/privy/models/onramp_provider.rb new file mode 100644 index 0000000..5be5509 --- /dev/null +++ b/lib/privy/models/onramp_provider.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Valid set of onramp providers + module OnrampProvider + extend Privy::Internal::Type::Enum + + BRIDGE = :bridge + BRIDGE_SANDBOX = :"bridge-sandbox" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/optional_refresh_token_input.rb b/lib/privy/models/optional_refresh_token_input.rb new file mode 100644 index 0000000..63533c2 --- /dev/null +++ b/lib/privy/models/optional_refresh_token_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OptionalRefreshTokenInput < Privy::Internal::Type::BaseModel + # @!attribute refresh_token + # + # @return [String, nil] + optional :refresh_token, String + + # @!method initialize(refresh_token: nil) + # The input for refreshing a session or logging out. + # + # @param refresh_token [String] + end + end +end diff --git a/lib/privy/models/organization_secret_id_input.rb b/lib/privy/models/organization_secret_id_input.rb new file mode 100644 index 0000000..ebb7863 --- /dev/null +++ b/lib/privy/models/organization_secret_id_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class OrganizationSecretIDInput < Privy::Internal::Type::BaseModel + # @!attribute secret_id + # The organization secret ID. + # + # @return [String] + required :secret_id, String + + # @!method initialize(secret_id:) + # Request body for targeting a specific organization secret. + # + # @param secret_id [String] The organization secret ID. + end + end +end diff --git a/lib/privy/models/organization_secret_view.rb b/lib/privy/models/organization_secret_view.rb new file mode 100644 index 0000000..0671828 --- /dev/null +++ b/lib/privy/models/organization_secret_view.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Privy + module Models + class OrganizationSecretView < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique secret identifier + # + # @return [String] + required :id, String + + # @!attribute created_at + # ISO 8601 creation timestamp + # + # @return [String] + required :created_at, String + + # @!attribute last_four + # Last four characters of the secret + # + # @return [String] + required :last_four, String + + # @!attribute revoked_at + # ISO 8601 revocation timestamp, or null if active + # + # @return [String, nil] + required :revoked_at, String, nil?: true + + # @!attribute signing_public_key + # P-256 public key in PEM format for request signing, or null if not configured + # + # @return [String, nil] + required :signing_public_key, String, nil?: true + + # @!method initialize(id:, created_at:, last_four:, revoked_at:, signing_public_key:) + # View of an organization secret for list and management endpoints. + # + # @param id [String] Unique secret identifier + # + # @param created_at [String] ISO 8601 creation timestamp + # + # @param last_four [String] Last four characters of the secret + # + # @param revoked_at [String, nil] ISO 8601 revocation timestamp, or null if active + # + # @param signing_public_key [String, nil] P-256 public key in PEM format for request signing, or null if not configured + end + end +end diff --git a/lib/privy/models/organization_secrets_list_response.rb b/lib/privy/models/organization_secrets_list_response.rb new file mode 100644 index 0000000..442bf66 --- /dev/null +++ b/lib/privy/models/organization_secrets_list_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OrganizationSecretsListResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Privy::Internal::Type::ArrayOf[Privy::OrganizationSecretView] } + + # @!method initialize(data:) + # Response returned when listing organization secrets for an account. + # + # @param data [Array] + end + end +end diff --git a/lib/privy/models/output_with_previous_transaction_data.rb b/lib/privy/models/output_with_previous_transaction_data.rb new file mode 100644 index 0000000..bac73cf --- /dev/null +++ b/lib/privy/models/output_with_previous_transaction_data.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class OutputWithPreviousTransactionData < Privy::Internal::Type::BaseModel + # @!attribute previous_transaction_hash + # + # @return [String] + required :previous_transaction_hash, String + + # @!attribute previous_transaction_vout + # + # @return [Float] + required :previous_transaction_vout, Float + + # @!attribute output + # A Spark token output. + # + # @return [Privy::Models::TokenOutput, nil] + optional :output, -> { Privy::TokenOutput } + + # @!method initialize(previous_transaction_hash:, previous_transaction_vout:, output: nil) + # A Spark token output with its previous transaction data. + # + # @param previous_transaction_hash [String] + # + # @param previous_transaction_vout [Float] + # + # @param output [Privy::Models::TokenOutput] A Spark token output. + end + end +end diff --git a/lib/privy/models/owner_id_input.rb b/lib/privy/models/owner_id_input.rb new file mode 100644 index 0000000..5db7dac --- /dev/null +++ b/lib/privy/models/owner_id_input.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + OwnerIDInput = String + end +end diff --git a/lib/privy/models/owner_input.rb b/lib/privy/models/owner_input.rb new file mode 100644 index 0000000..070bc23 --- /dev/null +++ b/lib/privy/models/owner_input.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + module OwnerInput + extend Privy::Internal::Type::Union + + # Owner input specifying a Privy user ID. + variant -> { Privy::OwnerInputUser } + + # Owner input specifying a P-256 public key. + variant -> { Privy::OwnerInputPublicKey } + + # @!method self.variants + # @return [Array(Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey)] + end + end +end diff --git a/lib/privy/models/owner_input_public_key.rb b/lib/privy/models/owner_input_public_key.rb new file mode 100644 index 0000000..f30e852 --- /dev/null +++ b/lib/privy/models/owner_input_public_key.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class OwnerInputPublicKey < Privy::Internal::Type::BaseModel + # @!attribute public_key + # A P-256 (secp256r1) public key. + # + # @return [String] + required :public_key, String + + # @!method initialize(public_key:) + # Owner input specifying a P-256 public key. + # + # @param public_key [String] A P-256 (secp256r1) public key. + end + end +end diff --git a/lib/privy/models/owner_input_user.rb b/lib/privy/models/owner_input_user.rb new file mode 100644 index 0000000..0da8d61 --- /dev/null +++ b/lib/privy/models/owner_input_user.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class OwnerInputUser < Privy::Internal::Type::BaseModel + # @!attribute user_id + # + # @return [String] + required :user_id, String + + # @!method initialize(user_id:) + # Owner input specifying a Privy user ID. + # + # @param user_id [String] + end + end +end diff --git a/lib/privy/models/p_256_public_key.rb b/lib/privy/models/p_256_public_key.rb new file mode 100644 index 0000000..12e214e --- /dev/null +++ b/lib/privy/models/p_256_public_key.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + P256PublicKey = String + end +end diff --git a/lib/privy/models/passkey_assertion_response.rb b/lib/privy/models/passkey_assertion_response.rb new file mode 100644 index 0000000..bba4b8a --- /dev/null +++ b/lib/privy/models/passkey_assertion_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAssertionResponse < Privy::Internal::Type::BaseModel + # @!attribute authenticator_data + # + # @return [String] + required :authenticator_data, String + + # @!attribute client_data_json + # + # @return [String] + required :client_data_json, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute user_handle + # + # @return [String, nil] + optional :user_handle, String + + # @!method initialize(authenticator_data:, client_data_json:, signature:, user_handle: nil) + # The authenticator assertion response from a WebAuthn authentication ceremony. + # + # @param authenticator_data [String] + # @param client_data_json [String] + # @param signature [String] + # @param user_handle [String] + end + end +end diff --git a/lib/privy/models/passkey_attestation_response.rb b/lib/privy/models/passkey_attestation_response.rb new file mode 100644 index 0000000..3684b3d --- /dev/null +++ b/lib/privy/models/passkey_attestation_response.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAttestationResponse < Privy::Internal::Type::BaseModel + # @!attribute attestation_object + # + # @return [String] + required :attestation_object, String + + # @!attribute client_data_json + # + # @return [String] + required :client_data_json, String + + # @!attribute authenticator_data + # + # @return [String, nil] + optional :authenticator_data, String + + # @!attribute public_key + # + # @return [String, nil] + optional :public_key, String + + # @!attribute public_key_algorithm + # + # @return [Float, nil] + optional :public_key_algorithm, Float + + # @!attribute transports + # + # @return [Array, nil] + optional :transports, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(attestation_object:, client_data_json:, authenticator_data: nil, public_key: nil, public_key_algorithm: nil, transports: nil) + # The authenticator attestation response from a WebAuthn registration ceremony. + # + # @param attestation_object [String] + # @param client_data_json [String] + # @param authenticator_data [String] + # @param public_key [String] + # @param public_key_algorithm [Float] + # @param transports [Array] + end + end +end diff --git a/lib/privy/models/passkey_authenticate_input.rb b/lib/privy/models/passkey_authenticate_input.rb new file mode 100644 index 0000000..00845c0 --- /dev/null +++ b/lib/privy/models/passkey_authenticate_input.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAuthenticateInput < Privy::Internal::Type::BaseModel + # @!attribute authenticator_response + # WebAuthn authentication response as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorVerifyResponse] + required :authenticator_response, -> { Privy::PasskeyAuthenticatorVerifyResponse } + + # @!attribute challenge + # + # @return [String] + required :challenge, String + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(authenticator_response:, challenge:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PasskeyAuthenticateInput} for more details. + # + # Input for authenticating with a passkey. + # + # @param authenticator_response [Privy::Models::PasskeyAuthenticatorVerifyResponse] WebAuthn authentication response as defined by the Web Authentication specificat + # + # @param challenge [String] + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/passkey_authenticator_enrollment_options.rb b/lib/privy/models/passkey_authenticator_enrollment_options.rb new file mode 100644 index 0000000..3170f6e --- /dev/null +++ b/lib/privy/models/passkey_authenticator_enrollment_options.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAuthenticatorEnrollmentOptions < Privy::Internal::Type::BaseModel + # @!attribute challenge + # + # @return [String] + required :challenge, String + + # @!attribute pub_key_cred_params + # + # @return [Array] + required :pub_key_cred_params, -> { Privy::Internal::Type::ArrayOf[Privy::PasskeyPubKeyCredParam] } + + # @!attribute rp + # Relying party information for a WebAuthn ceremony. + # + # @return [Privy::Models::PasskeyRelyingParty] + required :rp, -> { Privy::PasskeyRelyingParty } + + # @!attribute user + # User entity for a WebAuthn registration ceremony. + # + # @return [Privy::Models::PasskeyUser] + required :user, -> { Privy::PasskeyUser } + + # @!attribute attestation + # + # @return [String, nil] + optional :attestation, String + + # @!attribute authenticator_selection + # Authenticator selection criteria for a WebAuthn registration ceremony. + # + # @return [Privy::Models::PasskeyAuthenticatorSelection, nil] + optional :authenticator_selection, -> { Privy::PasskeyAuthenticatorSelection } + + # @!attribute exclude_credentials + # + # @return [Array, nil] + optional :exclude_credentials, -> { Privy::Internal::Type::ArrayOf[Privy::PasskeyCredentialDescriptor] } + + # @!attribute extensions + # Extensions for a WebAuthn registration ceremony. + # + # @return [Privy::Models::PasskeyEnrollmentExtensions, nil] + optional :extensions, -> { Privy::PasskeyEnrollmentExtensions } + + # @!attribute timeout + # + # @return [Float, nil] + optional :timeout, Float + + # @!method initialize(challenge:, pub_key_cred_params:, rp:, user:, attestation: nil, authenticator_selection: nil, exclude_credentials: nil, extensions: nil, timeout: nil) + # WebAuthn registration options as defined by the Web Authentication + # specification. + # + # @param challenge [String] + # + # @param pub_key_cred_params [Array] + # + # @param rp [Privy::Models::PasskeyRelyingParty] Relying party information for a WebAuthn ceremony. + # + # @param user [Privy::Models::PasskeyUser] User entity for a WebAuthn registration ceremony. + # + # @param attestation [String] + # + # @param authenticator_selection [Privy::Models::PasskeyAuthenticatorSelection] Authenticator selection criteria for a WebAuthn registration ceremony. + # + # @param exclude_credentials [Array] + # + # @param extensions [Privy::Models::PasskeyEnrollmentExtensions] Extensions for a WebAuthn registration ceremony. + # + # @param timeout [Float] + end + end +end diff --git a/lib/privy/models/passkey_authenticator_enrollment_response.rb b/lib/privy/models/passkey_authenticator_enrollment_response.rb new file mode 100644 index 0000000..8db673b --- /dev/null +++ b/lib/privy/models/passkey_authenticator_enrollment_response.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAuthenticatorEnrollmentResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute client_extension_results + # Client extension results returned by the WebAuthn authenticator. + # + # @return [Privy::Models::PasskeyClientExtensionResults] + required :client_extension_results, -> { Privy::PasskeyClientExtensionResults } + + # @!attribute raw_id + # + # @return [String] + required :raw_id, String + + # @!attribute response + # The authenticator attestation response from a WebAuthn registration ceremony. + # + # @return [Privy::Models::PasskeyAttestationResponse] + required :response, -> { Privy::PasskeyAttestationResponse } + + # @!attribute type + # + # @return [Symbol, Privy::Models::PasskeyAuthenticatorEnrollmentResponse::Type] + required :type, enum: -> { Privy::PasskeyAuthenticatorEnrollmentResponse::Type } + + # @!attribute authenticator_attachment + # + # @return [String, nil] + optional :authenticator_attachment, String + + # @!method initialize(id:, client_extension_results:, raw_id:, response:, type:, authenticator_attachment: nil) + # WebAuthn registration response as defined by the Web Authentication + # specification. + # + # @param id [String] + # + # @param client_extension_results [Privy::Models::PasskeyClientExtensionResults] Client extension results returned by the WebAuthn authenticator. + # + # @param raw_id [String] + # + # @param response [Privy::Models::PasskeyAttestationResponse] The authenticator attestation response from a WebAuthn registration ceremony. + # + # @param type [Symbol, Privy::Models::PasskeyAuthenticatorEnrollmentResponse::Type] + # + # @param authenticator_attachment [String] + + # @see Privy::Models::PasskeyAuthenticatorEnrollmentResponse#type + module Type + extend Privy::Internal::Type::Enum + + PUBLIC_KEY = :"public-key" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/passkey_authenticator_selection.rb b/lib/privy/models/passkey_authenticator_selection.rb new file mode 100644 index 0000000..462d9de --- /dev/null +++ b/lib/privy/models/passkey_authenticator_selection.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAuthenticatorSelection < Privy::Internal::Type::BaseModel + # @!attribute authenticator_attachment + # + # @return [String, nil] + optional :authenticator_attachment, String + + # @!attribute require_resident_key + # + # @return [Boolean, nil] + optional :require_resident_key, Privy::Internal::Type::Boolean + + # @!attribute resident_key + # + # @return [String, nil] + optional :resident_key, String + + # @!attribute user_verification + # + # @return [String, nil] + optional :user_verification, String + + # @!method initialize(authenticator_attachment: nil, require_resident_key: nil, resident_key: nil, user_verification: nil) + # Authenticator selection criteria for a WebAuthn registration ceremony. + # + # @param authenticator_attachment [String] + # @param require_resident_key [Boolean] + # @param resident_key [String] + # @param user_verification [String] + end + end +end diff --git a/lib/privy/models/passkey_authenticator_verify_options.rb b/lib/privy/models/passkey_authenticator_verify_options.rb new file mode 100644 index 0000000..b8cde7b --- /dev/null +++ b/lib/privy/models/passkey_authenticator_verify_options.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAuthenticatorVerifyOptions < Privy::Internal::Type::BaseModel + # @!attribute challenge + # + # @return [String] + required :challenge, String + + # @!attribute allow_credentials + # + # @return [Array, nil] + optional :allow_credentials, -> { Privy::Internal::Type::ArrayOf[Privy::PasskeyCredentialDescriptor] } + + # @!attribute extensions + # Extensions for a WebAuthn authentication ceremony. + # + # @return [Privy::Models::PasskeyVerifyExtensions, nil] + optional :extensions, -> { Privy::PasskeyVerifyExtensions } + + # @!attribute rp_id + # + # @return [String, nil] + optional :rp_id, String + + # @!attribute timeout + # + # @return [Float, nil] + optional :timeout, Float + + # @!attribute user_verification + # + # @return [String, nil] + optional :user_verification, String + + # @!method initialize(challenge:, allow_credentials: nil, extensions: nil, rp_id: nil, timeout: nil, user_verification: nil) + # WebAuthn authentication options as defined by the Web Authentication + # specification. + # + # @param challenge [String] + # + # @param allow_credentials [Array] + # + # @param extensions [Privy::Models::PasskeyVerifyExtensions] Extensions for a WebAuthn authentication ceremony. + # + # @param rp_id [String] + # + # @param timeout [Float] + # + # @param user_verification [String] + end + end +end diff --git a/lib/privy/models/passkey_authenticator_verify_response.rb b/lib/privy/models/passkey_authenticator_verify_response.rb new file mode 100644 index 0000000..533a105 --- /dev/null +++ b/lib/privy/models/passkey_authenticator_verify_response.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyAuthenticatorVerifyResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute client_extension_results + # Client extension results returned by the WebAuthn authenticator. + # + # @return [Privy::Models::PasskeyClientExtensionResults] + required :client_extension_results, -> { Privy::PasskeyClientExtensionResults } + + # @!attribute raw_id + # + # @return [String] + required :raw_id, String + + # @!attribute response + # The authenticator assertion response from a WebAuthn authentication ceremony. + # + # @return [Privy::Models::PasskeyAssertionResponse] + required :response, -> { Privy::PasskeyAssertionResponse } + + # @!attribute type + # + # @return [Symbol, Privy::Models::PasskeyAuthenticatorVerifyResponse::Type] + required :type, enum: -> { Privy::PasskeyAuthenticatorVerifyResponse::Type } + + # @!attribute authenticator_attachment + # + # @return [String, nil] + optional :authenticator_attachment, String + + # @!method initialize(id:, client_extension_results:, raw_id:, response:, type:, authenticator_attachment: nil) + # WebAuthn authentication response as defined by the Web Authentication + # specification. + # + # @param id [String] + # + # @param client_extension_results [Privy::Models::PasskeyClientExtensionResults] Client extension results returned by the WebAuthn authenticator. + # + # @param raw_id [String] + # + # @param response [Privy::Models::PasskeyAssertionResponse] The authenticator assertion response from a WebAuthn authentication ceremony. + # + # @param type [Symbol, Privy::Models::PasskeyAuthenticatorVerifyResponse::Type] + # + # @param authenticator_attachment [String] + + # @see Privy::Models::PasskeyAuthenticatorVerifyResponse#type + module Type + extend Privy::Internal::Type::Enum + + PUBLIC_KEY = :"public-key" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/passkey_client_extension_results.rb b/lib/privy/models/passkey_client_extension_results.rb new file mode 100644 index 0000000..91f60dc --- /dev/null +++ b/lib/privy/models/passkey_client_extension_results.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyClientExtensionResults < Privy::Internal::Type::BaseModel + # @!attribute app_id + # + # @return [Boolean, nil] + optional :app_id, Privy::Internal::Type::Boolean + + # @!attribute cred_props + # The result of the WebAuthn credProps extension. + # + # @return [Privy::Models::PasskeyCredPropsResult, nil] + optional :cred_props, -> { Privy::PasskeyCredPropsResult } + + # @!attribute hmac_create_secret + # + # @return [Boolean, nil] + optional :hmac_create_secret, Privy::Internal::Type::Boolean + + # @!method initialize(app_id: nil, cred_props: nil, hmac_create_secret: nil) + # Client extension results returned by the WebAuthn authenticator. + # + # @param app_id [Boolean] + # + # @param cred_props [Privy::Models::PasskeyCredPropsResult] The result of the WebAuthn credProps extension. + # + # @param hmac_create_secret [Boolean] + end + end +end diff --git a/lib/privy/models/passkey_cred_props_result.rb b/lib/privy/models/passkey_cred_props_result.rb new file mode 100644 index 0000000..739123f --- /dev/null +++ b/lib/privy/models/passkey_cred_props_result.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyCredPropsResult < Privy::Internal::Type::BaseModel + # @!attribute rk + # + # @return [Boolean, nil] + optional :rk, Privy::Internal::Type::Boolean + + # @!method initialize(rk: nil) + # The result of the WebAuthn credProps extension. + # + # @param rk [Boolean] + end + end +end diff --git a/lib/privy/models/passkey_credential_descriptor.rb b/lib/privy/models/passkey_credential_descriptor.rb new file mode 100644 index 0000000..ffa0bd3 --- /dev/null +++ b/lib/privy/models/passkey_credential_descriptor.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyCredentialDescriptor < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute type + # + # @return [String] + required :type, String + + # @!attribute transports + # + # @return [Array, nil] + optional :transports, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(id:, type:, transports: nil) + # A WebAuthn credential descriptor identifying a specific public key credential. + # + # @param id [String] + # @param type [String] + # @param transports [Array] + end + end +end diff --git a/lib/privy/models/passkey_enrollment_extensions.rb b/lib/privy/models/passkey_enrollment_extensions.rb new file mode 100644 index 0000000..4fd6631 --- /dev/null +++ b/lib/privy/models/passkey_enrollment_extensions.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyEnrollmentExtensions < Privy::Internal::Type::BaseModel + # @!attribute app_id + # + # @return [String, nil] + optional :app_id, String + + # @!attribute cred_props + # The result of the WebAuthn credProps extension. + # + # @return [Privy::Models::PasskeyCredPropsResult, nil] + optional :cred_props, -> { Privy::PasskeyCredPropsResult } + + # @!attribute hmac_create_secret + # + # @return [Boolean, nil] + optional :hmac_create_secret, Privy::Internal::Type::Boolean + + # @!method initialize(app_id: nil, cred_props: nil, hmac_create_secret: nil) + # Extensions for a WebAuthn registration ceremony. + # + # @param app_id [String] + # + # @param cred_props [Privy::Models::PasskeyCredPropsResult] The result of the WebAuthn credProps extension. + # + # @param hmac_create_secret [Boolean] + end + end +end diff --git a/lib/privy/models/passkey_init_input.rb b/lib/privy/models/passkey_init_input.rb new file mode 100644 index 0000000..42f5bea --- /dev/null +++ b/lib/privy/models/passkey_init_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyInitInput < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(token: nil, relying_party: nil) + # Input for initiating a passkey ceremony. + # + # @param token [String] + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/passkey_link_input.rb b/lib/privy/models/passkey_link_input.rb new file mode 100644 index 0000000..c39488a --- /dev/null +++ b/lib/privy/models/passkey_link_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyLinkInput < Privy::Internal::Type::BaseModel + # @!attribute authenticator_response + # WebAuthn registration response as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorEnrollmentResponse] + required :authenticator_response, -> { Privy::PasskeyAuthenticatorEnrollmentResponse } + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(authenticator_response:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PasskeyLinkInput} for more details. + # + # Input for linking a passkey credential. + # + # @param authenticator_response [Privy::Models::PasskeyAuthenticatorEnrollmentResponse] WebAuthn registration response as defined by the Web Authentication specificatio + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/passkey_mfa_method.rb b/lib/privy/models/passkey_mfa_method.rb new file mode 100644 index 0000000..0a10bba --- /dev/null +++ b/lib/privy/models/passkey_mfa_method.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyMfaMethod < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::PasskeyMfaMethod::Type] + required :type, enum: -> { Privy::PasskeyMfaMethod::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(type:, verified_at:) + # A Passkey MFA method. + # + # @param type [Symbol, Privy::Models::PasskeyMfaMethod::Type] + # @param verified_at [Float] + + # @see Privy::Models::PasskeyMfaMethod#type + module Type + extend Privy::Internal::Type::Enum + + PASSKEY = :passkey + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/passkey_pub_key_cred_param.rb b/lib/privy/models/passkey_pub_key_cred_param.rb new file mode 100644 index 0000000..ea4c602 --- /dev/null +++ b/lib/privy/models/passkey_pub_key_cred_param.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyPubKeyCredParam < Privy::Internal::Type::BaseModel + # @!attribute alg + # + # @return [Float] + required :alg, Float + + # @!attribute type + # + # @return [Symbol, Privy::Models::PasskeyPubKeyCredParam::Type] + required :type, enum: -> { Privy::PasskeyPubKeyCredParam::Type } + + # @!method initialize(alg:, type:) + # A public key credential parameter specifying the algorithm and credential type. + # + # @param alg [Float] + # @param type [Symbol, Privy::Models::PasskeyPubKeyCredParam::Type] + + # @see Privy::Models::PasskeyPubKeyCredParam#type + module Type + extend Privy::Internal::Type::Enum + + PUBLIC_KEY = :"public-key" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/passkey_register_input.rb b/lib/privy/models/passkey_register_input.rb new file mode 100644 index 0000000..ba8d1a6 --- /dev/null +++ b/lib/privy/models/passkey_register_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyRegisterInput < Privy::Internal::Type::BaseModel + # @!attribute authenticator_response + # WebAuthn registration response as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorEnrollmentResponse] + required :authenticator_response, -> { Privy::PasskeyAuthenticatorEnrollmentResponse } + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(authenticator_response:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PasskeyRegisterInput} for more details. + # + # Input for registering a passkey credential. + # + # @param authenticator_response [Privy::Models::PasskeyAuthenticatorEnrollmentResponse] WebAuthn registration response as defined by the Web Authentication specificatio + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/passkey_relying_party.rb b/lib/privy/models/passkey_relying_party.rb new file mode 100644 index 0000000..36a5624 --- /dev/null +++ b/lib/privy/models/passkey_relying_party.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyRelyingParty < Privy::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!method initialize(name:, id: nil) + # Relying party information for a WebAuthn ceremony. + # + # @param name [String] + # @param id [String] + end + end +end diff --git a/lib/privy/models/passkey_user.rb b/lib/privy/models/passkey_user.rb new file mode 100644 index 0000000..b389da3 --- /dev/null +++ b/lib/privy/models/passkey_user.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyUser < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute display_name + # + # @return [String] + required :display_name, String + + # @!attribute name + # + # @return [String] + required :name, String + + # @!method initialize(id:, display_name:, name:) + # User entity for a WebAuthn registration ceremony. + # + # @param id [String] + # @param display_name [String] + # @param name [String] + end + end +end diff --git a/lib/privy/models/passkey_verify_extensions.rb b/lib/privy/models/passkey_verify_extensions.rb new file mode 100644 index 0000000..c03af39 --- /dev/null +++ b/lib/privy/models/passkey_verify_extensions.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasskeyVerifyExtensions < Privy::Internal::Type::BaseModel + # @!attribute app_id + # + # @return [String, nil] + optional :app_id, String + + # @!attribute cred_props + # + # @return [Boolean, nil] + optional :cred_props, Privy::Internal::Type::Boolean + + # @!attribute hmac_create_secret + # + # @return [Boolean, nil] + optional :hmac_create_secret, Privy::Internal::Type::Boolean + + # @!method initialize(app_id: nil, cred_props: nil, hmac_create_secret: nil) + # Extensions for a WebAuthn authentication ceremony. + # + # @param app_id [String] + # @param cred_props [Boolean] + # @param hmac_create_secret [Boolean] + end + end +end diff --git a/lib/privy/models/passwordless_authenticate_request_body.rb b/lib/privy/models/passwordless_authenticate_request_body.rb new file mode 100644 index 0000000..83ad993 --- /dev/null +++ b/lib/privy/models/passwordless_authenticate_request_body.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute email + # + # @return [String] + required :email, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(code:, email:, mode: nil) + # The request body for authenticating a passwordless account. + # + # @param code [String] + # + # @param email [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/passwordless_init_request_body.rb b/lib/privy/models/passwordless_init_request_body.rb new file mode 100644 index 0000000..9ae813d --- /dev/null +++ b/lib/privy/models/passwordless_init_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String] + required :email, String + + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!method initialize(email:, token: nil) + # The request body for initiating a passwordless ceremony. + # + # @param email [String] + # @param token [String] + end + end +end diff --git a/lib/privy/models/passwordless_link_request_body.rb b/lib/privy/models/passwordless_link_request_body.rb new file mode 100644 index 0000000..3c68925 --- /dev/null +++ b/lib/privy/models/passwordless_link_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute email + # + # @return [String] + required :email, String + + # @!method initialize(code:, email:) + # The request body for linking a passwordless account. + # + # @param code [String] + # @param email [String] + end + end +end diff --git a/lib/privy/models/passwordless_sms_authenticate_request_body.rb b/lib/privy/models/passwordless_sms_authenticate_request_body.rb new file mode 100644 index 0000000..be3887b --- /dev/null +++ b/lib/privy/models/passwordless_sms_authenticate_request_body.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessSMSAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!method initialize(code:, phone_number:, mode: nil) + # The request body for authenticating a passwordless sms account. + # + # @param code [String] + # + # @param phone_number [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + end + end +end diff --git a/lib/privy/models/passwordless_sms_init_request_body.rb b/lib/privy/models/passwordless_sms_init_request_body.rb new file mode 100644 index 0000000..bbbf221 --- /dev/null +++ b/lib/privy/models/passwordless_sms_init_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessSMSInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!method initialize(phone_number:, token: nil) + # The request body for initiating a passwordless sms ceremony. + # + # @param phone_number [String] + # @param token [String] + end + end +end diff --git a/lib/privy/models/passwordless_sms_link_request_body.rb b/lib/privy/models/passwordless_sms_link_request_body.rb new file mode 100644 index 0000000..e8dd57e --- /dev/null +++ b/lib/privy/models/passwordless_sms_link_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessSMSLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!method initialize(code:, phone_number:) + # The request body for linking a passwordless sms account. + # + # @param code [String] + # @param phone_number [String] + end + end +end diff --git a/lib/privy/models/passwordless_sms_transfer_request_body.rb b/lib/privy/models/passwordless_sms_transfer_request_body.rb new file mode 100644 index 0000000..f87fe75 --- /dev/null +++ b/lib/privy/models/passwordless_sms_transfer_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessSMSTransferRequestBody < Privy::Internal::Type::BaseModel + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!method initialize(nonce:, phone_number:) + # The request body for transferring a passwordless sms account. + # + # @param nonce [String] + # @param phone_number [String] + end + end +end diff --git a/lib/privy/models/passwordless_sms_unlink_request_body.rb b/lib/privy/models/passwordless_sms_unlink_request_body.rb new file mode 100644 index 0000000..301fa17 --- /dev/null +++ b/lib/privy/models/passwordless_sms_unlink_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessSMSUnlinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute phone_number + # + # @return [String] + required :phone_number, String, api_name: :phoneNumber + + # @!method initialize(phone_number:) + # The request body for unlinking a passwordless sms account. + # + # @param phone_number [String] + end + end +end diff --git a/lib/privy/models/passwordless_sms_update_request_body.rb b/lib/privy/models/passwordless_sms_update_request_body.rb new file mode 100644 index 0000000..6842c77 --- /dev/null +++ b/lib/privy/models/passwordless_sms_update_request_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessSMSUpdateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute new_phone_number + # + # @return [String] + required :new_phone_number, String + + # @!attribute old_phone_number + # + # @return [String] + required :old_phone_number, String + + # @!method initialize(code:, new_phone_number:, old_phone_number:) + # The request body for updating a passwordless sms account. + # + # @param code [String] + # @param new_phone_number [String] + # @param old_phone_number [String] + end + end +end diff --git a/lib/privy/models/passwordless_transfer_request_body.rb b/lib/privy/models/passwordless_transfer_request_body.rb new file mode 100644 index 0000000..5479579 --- /dev/null +++ b/lib/privy/models/passwordless_transfer_request_body.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessTransferRequestBody < Privy::Internal::Type::BaseModel + # @!attribute email + # + # @return [String] + required :email, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(email:, nonce:) + # The request body for transferring a passwordless account. + # + # @param email [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/passwordless_unlink_request_body.rb b/lib/privy/models/passwordless_unlink_request_body.rb new file mode 100644 index 0000000..2738908 --- /dev/null +++ b/lib/privy/models/passwordless_unlink_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessUnlinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # The request body for unlinking a passwordless account. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/passwordless_update_request_body.rb b/lib/privy/models/passwordless_update_request_body.rb new file mode 100644 index 0000000..1d2d9e0 --- /dev/null +++ b/lib/privy/models/passwordless_update_request_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class PasswordlessUpdateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute code + # + # @return [String] + required :code, String + + # @!attribute new_address + # + # @return [String] + required :new_address, String, api_name: :newAddress + + # @!attribute old_address + # + # @return [String] + required :old_address, String, api_name: :oldAddress + + # @!method initialize(code:, new_address:, old_address:) + # The request body for updating a passwordless account. + # + # @param code [String] + # @param new_address [String] + # @param old_address [String] + end + end +end diff --git a/lib/privy/models/patch_users_custom_metadata.rb b/lib/privy/models/patch_users_custom_metadata.rb new file mode 100644 index 0000000..0233007 --- /dev/null +++ b/lib/privy/models/patch_users_custom_metadata.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class PatchUsersCustomMetadata < Privy::Internal::Type::BaseModel + # @!attribute custom_metadata + # Custom metadata associated with the user. + # + # @return [Hash{Symbol=>String, Float, Boolean}] + required :custom_metadata, -> { Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem] } + + # @!method initialize(custom_metadata:) + # The payload for partially updating custom metadata on a user. + # + # @param custom_metadata [Hash{Symbol=>String, Float, Boolean}] Custom metadata associated with the user. + end + end +end diff --git a/lib/privy/models/phone_invite_input.rb b/lib/privy/models/phone_invite_input.rb new file mode 100644 index 0000000..acd7d45 --- /dev/null +++ b/lib/privy/models/phone_invite_input.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class PhoneInviteInput < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::PhoneInviteInput::Type] + required :type, enum: -> { Privy::PhoneInviteInput::Type } + + # @!attribute value + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Allowlist invite input for a phone number. + # + # @param type [Symbol, Privy::Models::PhoneInviteInput::Type] + # @param value [String] + + # @see Privy::Models::PhoneInviteInput#type + module Type + extend Privy::Internal::Type::Enum + + PHONE = :phone + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/policy.rb b/lib/privy/models/policy.rb new file mode 100644 index 0000000..0111a39 --- /dev/null +++ b/lib/privy/models/policy.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#create + class Policy < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique ID of the created policy. This will be the primary identifier when using + # the policy in the future. + # + # @return [String] + required :id, String + + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute created_at + # Unix timestamp of when the policy was created in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute name + # Name to assign to policy. + # + # @return [String] + required :name, String + + # @!attribute owner_id + # The key quorum ID of the owner of the policy. + # + # @return [String, nil] + required :owner_id, String, nil?: true + + # @!attribute rules + # + # @return [Array] + required :rules, -> { Privy::Internal::Type::ArrayOf[Privy::PolicyRuleResponse] } + + # @!attribute version + # Version of the policy. Currently, 1.0 is the only version. + # + # @return [Symbol, Privy::Models::Policy::Version] + required :version, enum: -> { Privy::Policy::Version } + + # @!method initialize(id:, chain_type:, created_at:, name:, owner_id:, rules:, version:) + # Some parameter documentations has been truncated, see {Privy::Models::Policy} + # for more details. + # + # A policy for controlling wallet operations. + # + # @param id [String] Unique ID of the created policy. This will be the primary identifier when using + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param created_at [Float] Unix timestamp of when the policy was created in milliseconds. + # + # @param name [String] Name to assign to policy. + # + # @param owner_id [String, nil] The key quorum ID of the owner of the policy. + # + # @param rules [Array] + # + # @param version [Symbol, Privy::Models::Policy::Version] Version of the policy. Currently, 1.0 is the only version. + + # Version of the policy. Currently, 1.0 is the only version. + # + # @see Privy::Models::Policy#version + module Version + extend Privy::Internal::Type::Enum + + VERSION_1_0 = :"1.0" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/policy_action.rb b/lib/privy/models/policy_action.rb new file mode 100644 index 0000000..3ee21ed --- /dev/null +++ b/lib/privy/models/policy_action.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The action to take when a policy rule matches. + module PolicyAction + extend Privy::Internal::Type::Enum + + ALLOW = :ALLOW + DENY = :DENY + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/policy_authorization_headers.rb b/lib/privy/models/policy_authorization_headers.rb new file mode 100644 index 0000000..d65e089 --- /dev/null +++ b/lib/privy/models/policy_authorization_headers.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class PolicyAuthorizationHeaders < Privy::Internal::Type::BaseModel + # @!attribute privy_app_id + # ID of your Privy app. + # + # @return [String] + required :privy_app_id, String, api_name: :"privy-app-id" + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String, api_name: :"privy-authorization-signature" + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String, api_name: :"privy-request-expiry" + + # @!method initialize(privy_app_id:, privy_authorization_signature: nil, privy_request_expiry: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyAuthorizationHeaders} for more details. + # + # Headers required to authorize modifications to policies. + # + # @param privy_app_id [String] ID of your Privy app. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + end + end +end diff --git a/lib/privy/models/policy_condition.rb b/lib/privy/models/policy_condition.rb new file mode 100644 index 0000000..7fde744 --- /dev/null +++ b/lib/privy/models/policy_condition.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Privy + module Models + # A condition that must be true for the rule action to be applied. + module PolicyCondition + extend Privy::Internal::Type::Union + + discriminator :field_source + + # The verbatim Ethereum transaction object in an eth_signTransaction or eth_sendTransaction request. + variant :ethereum_transaction, -> { Privy::EthereumTransactionCondition } + + # The decoded calldata in a smart contract interaction as the smart contract method's parameters. Note that 'ethereum_calldata' conditions must contain an abi parameter with the JSON ABI of the smart contract. + variant :ethereum_calldata, -> { Privy::EthereumCalldataCondition } + + # Attributes from the signing domain that will verify the signature. + variant :ethereum_typed_data_domain, -> { Privy::EthereumTypedDataDomainCondition } + + # 'types' and 'primary_type' attributes of the TypedData JSON object defined in EIP-712. + variant :ethereum_typed_data_message, -> { Privy::EthereumTypedDataMessageCondition } + + # Allowed contract addresses for eth_sign7702Authorization requests. + variant :ethereum_7702_authorization, -> { Privy::Ethereum7702AuthorizationCondition } + + # Solana Program attributes, enables allowlisting Solana Programs. + variant :solana_program_instruction, -> { Privy::SolanaProgramInstructionCondition } + + # Solana System Program attributes, including more granular Transfer instruction fields. + variant :solana_system_program_instruction, -> { Privy::SolanaSystemProgramInstructionCondition } + + # Solana Token Program attributes, including more granular TransferChecked instruction fields. + variant :solana_token_program_instruction, -> { Privy::SolanaTokenProgramInstructionCondition } + + # System attributes, including current unix timestamp (in seconds). + variant :system, -> { Privy::SystemCondition } + + # TRON transaction fields for TransferContract and TriggerSmartContract transaction types. + variant :tron_transaction, -> { Privy::TronTransactionCondition } + + # Decoded calldata from a TRON TriggerSmartContract interaction. + variant :tron_trigger_smart_contract_data, -> { Privy::TronCalldataCondition } + + # SUI transaction command attributes, enables allowlisting specific command types. Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and 'in' operators are supported. + variant :sui_transaction_command, -> { Privy::SuiTransactionCommandCondition } + + # SUI TransferObjects command attributes, including recipient and amount fields. + variant :sui_transfer_objects_command, -> { Privy::SuiTransferObjectsCommandCondition } + + # Condition on the original wallet action API request body fields. + variant :action_request_body, -> { Privy::ActionRequestBodyCondition } + + # Condition referencing an aggregation value. The field must start with "aggregation." followed by the aggregation ID. + variant :reference, -> { Privy::AggregationCondition } + + # @!method self.variants + # @return [Array(Privy::Models::EthereumTransactionCondition, Privy::Models::EthereumCalldataCondition, Privy::Models::EthereumTypedDataDomainCondition, Privy::Models::EthereumTypedDataMessageCondition, Privy::Models::Ethereum7702AuthorizationCondition, Privy::Models::SolanaProgramInstructionCondition, Privy::Models::SolanaSystemProgramInstructionCondition, Privy::Models::SolanaTokenProgramInstructionCondition, Privy::Models::SystemCondition, Privy::Models::TronTransactionCondition, Privy::Models::TronCalldataCondition, Privy::Models::SuiTransactionCommandCondition, Privy::Models::SuiTransferObjectsCommandCondition, Privy::Models::ActionRequestBodyCondition, Privy::Models::AggregationCondition)] + end + end +end diff --git a/lib/privy/models/policy_create_params.rb b/lib/privy/models/policy_create_params.rb new file mode 100644 index 0000000..2f5abc4 --- /dev/null +++ b/lib/privy/models/policy_create_params.rb @@ -0,0 +1,125 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#create + class PolicyCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute name + # Name to assign to policy. + # + # @return [String] + required :name, String + + # @!attribute rules + # + # @return [Array] + required :rules, -> { Privy::Internal::Type::ArrayOf[Privy::PolicyCreateParams::Rule] } + + # @!attribute version + # Version of the policy. Currently, 1.0 is the only version. + # + # @return [Symbol, Privy::Models::PolicyCreateParams::Version] + required :version, enum: -> { Privy::PolicyCreateParams::Version } + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!method initialize(chain_type:, name:, rules:, version:, owner: nil, owner_id: nil, privy_idempotency_key: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyCreateParams} for more details. + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param name [String] Name to assign to policy. + # + # @param rules [Array] + # + # @param version [Symbol, Privy::Models::PolicyCreateParams::Version] Version of the policy. Currently, 1.0 is the only version. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + class Rule < Privy::Internal::Type::BaseModel + # @!attribute action + # The action to take when a policy rule matches. + # + # @return [Symbol, Privy::Models::PolicyAction] + required :action, enum: -> { Privy::PolicyAction } + + # @!attribute conditions + # + # @return [Array] + required :conditions, -> { Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition] } + + # @!attribute method_ + # Method the rule applies to. + # + # @return [Symbol, Privy::Models::PolicyMethod] + required :method_, enum: -> { Privy::PolicyMethod }, api_name: :method + + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!method initialize(action:, conditions:, method_:, name:, id: nil) + # @param action [Symbol, Privy::Models::PolicyAction] The action to take when a policy rule matches. + # + # @param conditions [Array] + # + # @param method_ [Symbol, Privy::Models::PolicyMethod] Method the rule applies to. + # + # @param name [String] + # + # @param id [String] + end + + # Version of the policy. Currently, 1.0 is the only version. + module Version + extend Privy::Internal::Type::Enum + + VERSION_1_0 = :"1.0" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/policy_create_rule_params.rb b/lib/privy/models/policy_create_rule_params.rb new file mode 100644 index 0000000..506f8b7 --- /dev/null +++ b/lib/privy/models/policy_create_rule_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#create_rule + class PolicyCreateRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyCreateRuleParams} for more details. + # + # @param policy_id [String] + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/policy_delete_params.rb b/lib/privy/models/policy_delete_params.rb new file mode 100644 index 0000000..58299bd --- /dev/null +++ b/lib/privy/models/policy_delete_params.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#delete + class PolicyDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyDeleteParams} for more details. + # + # @param policy_id [String] + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/policy_delete_rule_params.rb b/lib/privy/models/policy_delete_rule_params.rb new file mode 100644 index 0000000..d12ac1c --- /dev/null +++ b/lib/privy/models/policy_delete_rule_params.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#delete_rule + class PolicyDeleteRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!attribute rule_id + # + # @return [String] + required :rule_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, rule_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyDeleteRuleParams} for more details. + # + # @param policy_id [String] + # + # @param rule_id [String] + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/policy_get_params.rb b/lib/privy/models/policy_get_params.rb new file mode 100644 index 0000000..610a5c4 --- /dev/null +++ b/lib/privy/models/policy_get_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#get + class PolicyGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!method initialize(policy_id:, request_options: {}) + # @param policy_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/policy_get_rule_params.rb b/lib/privy/models/policy_get_rule_params.rb new file mode 100644 index 0000000..c33c016 --- /dev/null +++ b/lib/privy/models/policy_get_rule_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#get_rule + class PolicyGetRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!attribute rule_id + # + # @return [String] + required :rule_id, String + + # @!method initialize(policy_id:, rule_id:, request_options: {}) + # @param policy_id [String] + # @param rule_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/policy_input.rb b/lib/privy/models/policy_input.rb new file mode 100644 index 0000000..7263d67 --- /dev/null +++ b/lib/privy/models/policy_input.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + PolicyInput = Privy::Internal::Type::ArrayOf[String] + end +end diff --git a/lib/privy/models/policy_intent_request_details.rb b/lib/privy/models/policy_intent_request_details.rb new file mode 100644 index 0000000..133aad6 --- /dev/null +++ b/lib/privy/models/policy_intent_request_details.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Privy + module Models + class PolicyIntentRequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # + # @return [Privy::Models::PolicyIntentRequestDetails::Body] + required :body, -> { Privy::PolicyIntentRequestDetails::Body } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::PolicyIntentRequestDetails::Method] + required :method_, enum: -> { Privy::PolicyIntentRequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # Request details for a policy intent. + # + # @param body [Privy::Models::PolicyIntentRequestDetails::Body] + # @param method_ [Symbol, Privy::Models::PolicyIntentRequestDetails::Method] + # @param url [String] + + # @see Privy::Models::PolicyIntentRequestDetails#body + class Body < Privy::Internal::Type::BaseModel + # @!attribute name + # Name to assign to policy. + # + # @return [String, nil] + optional :name, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute rules + # + # @return [Array, nil] + optional :rules, -> { Privy::Internal::Type::ArrayOf[Privy::PolicyRuleRequestBody] } + + # @!method initialize(name: nil, owner: nil, owner_id: nil, rules: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyIntentRequestDetails::Body} for more details. + # + # @param name [String] Name to assign to policy. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param rules [Array] + end + + # @see Privy::Models::PolicyIntentRequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + PATCH = :PATCH + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/policy_intent_response.rb b/lib/privy/models/policy_intent_response.rb new file mode 100644 index 0000000..7d09ecb --- /dev/null +++ b/lib/privy/models/policy_intent_response.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#update_policy + class PolicyIntentResponse < Privy::Models::BaseIntentResponse + # @!attribute intent_type + # + # @return [Symbol, Privy::Models::PolicyIntentResponse::IntentType] + required :intent_type, enum: -> { Privy::PolicyIntentResponse::IntentType } + + # @!attribute request_details + # The original policy update request that would be sent to the policy endpoint + # + # @return [Privy::Models::PolicyIntentResponse::RequestDetails] + required :request_details, -> { Privy::PolicyIntentResponse::RequestDetails } + + # @!attribute action_result + # Result of policy update execution (only present if status is 'executed' or + # 'failed') + # + # @return [Privy::Models::BaseActionResult, nil] + optional :action_result, -> { Privy::BaseActionResult } + + # @!attribute current_resource_data + # A policy for controlling wallet operations. + # + # @return [Privy::Models::Policy, nil] + optional :current_resource_data, -> { Privy::Policy } + + # @!method initialize(intent_type:, request_details:, action_result: nil, current_resource_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyIntentResponse} for more details. + # + # Response for a policy intent + # + # @param intent_type [Symbol, Privy::Models::PolicyIntentResponse::IntentType] + # + # @param request_details [Privy::Models::PolicyIntentResponse::RequestDetails] The original policy update request that would be sent to the policy endpoint + # + # @param action_result [Privy::Models::BaseActionResult] Result of policy update execution (only present if status is 'executed' or 'fail + # + # @param current_resource_data [Privy::Models::Policy] A policy for controlling wallet operations. + + module IntentType + extend Privy::Internal::Type::Enum + + POLICY = :POLICY + + # @!method self.values + # @return [Array] + end + + class RequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # + # @return [Privy::Models::PolicyIntentResponse::RequestDetails::Body] + required :body, -> { Privy::PolicyIntentResponse::RequestDetails::Body } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::PolicyIntentResponse::RequestDetails::Method] + required :method_, enum: -> { Privy::PolicyIntentResponse::RequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # The original policy update request that would be sent to the policy endpoint + # + # @param body [Privy::Models::PolicyIntentResponse::RequestDetails::Body] + # @param method_ [Symbol, Privy::Models::PolicyIntentResponse::RequestDetails::Method] + # @param url [String] + + # @see Privy::Models::PolicyIntentResponse::RequestDetails#body + class Body < Privy::Internal::Type::BaseModel + # @!attribute name + # Name to assign to policy. + # + # @return [String, nil] + optional :name, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute rules + # + # @return [Array, nil] + optional :rules, -> { Privy::Internal::Type::ArrayOf[Privy::PolicyRuleRequestBody] } + + # @!method initialize(name: nil, owner: nil, owner_id: nil, rules: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyIntentResponse::RequestDetails::Body} for more details. + # + # @param name [String] Name to assign to policy. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param rules [Array] + end + + # @see Privy::Models::PolicyIntentResponse::RequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + PATCH = :PATCH + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/privy/models/policy_method.rb b/lib/privy/models/policy_method.rb new file mode 100644 index 0000000..69a7636 --- /dev/null +++ b/lib/privy/models/policy_method.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + # Method the rule applies to. + module PolicyMethod + extend Privy::Internal::Type::Enum + + ETH_SEND_TRANSACTION = :eth_sendTransaction + ETH_SIGN_TRANSACTION = :eth_signTransaction + ETH_SIGN_USER_OPERATION = :eth_signUserOperation + ETH_SIGN_TYPED_DATA_V4 = :eth_signTypedData_v4 + ETH_SIGN7702_AUTHORIZATION = :eth_sign7702Authorization + WALLET_SEND_CALLS = :wallet_sendCalls + SIGN_TRANSACTION = :signTransaction + SIGN_AND_SEND_TRANSACTION = :signAndSendTransaction + EXPORT_PRIVATE_KEY = :exportPrivateKey + EXPORT_SEED_PHRASE = :exportSeedPhrase + SIGN_TRANSACTION_BYTES = :signTransactionBytes + EARN_DEPOSIT = :earn_deposit + EARN_WITHDRAW = :earn_withdraw + TRANSFER = :transfer + STAR = :* + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/policy_request_body.rb b/lib/privy/models/policy_request_body.rb new file mode 100644 index 0000000..f3e3fa6 --- /dev/null +++ b/lib/privy/models/policy_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class PolicyRequestBody < Privy::Internal::Type::BaseModel + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!method initialize(policy_id:) + # Unique ID of the policy to take actions on. + # + # @param policy_id [String] + end + end +end diff --git a/lib/privy/models/policy_rule_request_body.rb b/lib/privy/models/policy_rule_request_body.rb new file mode 100644 index 0000000..a4dc437 --- /dev/null +++ b/lib/privy/models/policy_rule_request_body.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Models + class PolicyRuleRequestBody < Privy::Internal::Type::BaseModel + # @!attribute action + # The action to take when a policy rule matches. + # + # @return [Symbol, Privy::Models::PolicyAction] + required :action, enum: -> { Privy::PolicyAction } + + # @!attribute conditions + # + # @return [Array] + required :conditions, -> { Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition] } + + # @!attribute method_ + # Method the rule applies to. + # + # @return [Symbol, Privy::Models::PolicyMethod] + required :method_, enum: -> { Privy::PolicyMethod }, api_name: :method + + # @!attribute name + # + # @return [String] + required :name, String + + # @!method initialize(action:, conditions:, method_:, name:) + # The rules that apply to each method the policy covers. + # + # @param action [Symbol, Privy::Models::PolicyAction] The action to take when a policy rule matches. + # + # @param conditions [Array] + # + # @param method_ [Symbol, Privy::Models::PolicyMethod] Method the rule applies to. + # + # @param name [String] + end + end +end diff --git a/lib/privy/models/policy_rule_request_params.rb b/lib/privy/models/policy_rule_request_params.rb new file mode 100644 index 0000000..d4a6841 --- /dev/null +++ b/lib/privy/models/policy_rule_request_params.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class PolicyRuleRequestParams < Privy::Internal::Type::BaseModel + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!attribute rule_id + # + # @return [String] + required :rule_id, String + + # @!method initialize(policy_id:, rule_id:) + # Unique IDs of the policy and the rule within the policy to take actions on. + # + # @param policy_id [String] + # @param rule_id [String] + end + end +end diff --git a/lib/privy/models/policy_rule_response.rb b/lib/privy/models/policy_rule_response.rb new file mode 100644 index 0000000..d45a80d --- /dev/null +++ b/lib/privy/models/policy_rule_response.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#create_rule + class PolicyRuleResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute action + # The action to take when a policy rule matches. + # + # @return [Symbol, Privy::Models::PolicyAction] + required :action, enum: -> { Privy::PolicyAction } + + # @!attribute conditions + # + # @return [Array] + required :conditions, -> { Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition] } + + # @!attribute method_ + # Method the rule applies to. + # + # @return [Symbol, Privy::Models::PolicyMethod] + required :method_, enum: -> { Privy::PolicyMethod }, api_name: :method + + # @!attribute name + # + # @return [String] + required :name, String + + # @!method initialize(id:, action:, conditions:, method_:, name:) + # A rule that defines the conditions and action to take if the conditions are + # true. + # + # @param id [String] + # + # @param action [Symbol, Privy::Models::PolicyAction] The action to take when a policy rule matches. + # + # @param conditions [Array] + # + # @param method_ [Symbol, Privy::Models::PolicyMethod] Method the rule applies to. + # + # @param name [String] + end + end +end diff --git a/lib/privy/models/policy_update_params.rb b/lib/privy/models/policy_update_params.rb new file mode 100644 index 0000000..f7ed811 --- /dev/null +++ b/lib/privy/models/policy_update_params.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#update + class PolicyUpdateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!attribute name + # Name to assign to policy. + # + # @return [String, nil] + optional :name, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute rules + # + # @return [Array, nil] + optional :rules, -> { Privy::Internal::Type::ArrayOf[Privy::PolicyRuleRequestBody] } + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, name: nil, owner: nil, owner_id: nil, rules: nil, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyUpdateParams} for more details. + # + # @param policy_id [String] + # + # @param name [String] Name to assign to policy. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param rules [Array] + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/policy_update_rule_params.rb b/lib/privy/models/policy_update_rule_params.rb new file mode 100644 index 0000000..443f952 --- /dev/null +++ b/lib/privy/models/policy_update_rule_params.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Policies#update_rule + class PolicyUpdateRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute policy_id + # + # @return [String] + required :policy_id, String + + # @!attribute rule_id + # + # @return [String] + required :rule_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(policy_id:, rule_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyUpdateRuleParams} for more details. + # + # @param policy_id [String] + # + # @param rule_id [String] + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/private_key_export_input.rb b/lib/privy/models/private_key_export_input.rb new file mode 100644 index 0000000..dcc212c --- /dev/null +++ b/lib/privy/models/private_key_export_input.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class PrivateKeyExportInput < Privy::Internal::Type::BaseModel + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute recipient_public_key + # The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) + # format. + # + # @return [String] + required :recipient_public_key, String + + # @!attribute export_seed_phrase + # + # @return [Boolean, nil] + optional :export_seed_phrase, Privy::Internal::Type::Boolean + + # @!attribute export_type + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + # + # @return [Symbol, Privy::Models::ExportType, nil] + optional :export_type, enum: -> { Privy::ExportType } + + # @!method initialize(encryption_type:, recipient_public_key:, export_seed_phrase: nil, export_type: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PrivateKeyExportInput} for more details. + # + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param recipient_public_key [String] The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) for + # + # @param export_seed_phrase [Boolean] + # + # @param export_type [Symbol, Privy::Models::ExportType] The export type. 'display' is for showing the key to the user in the UI, 'client + end + end +end diff --git a/lib/privy/models/private_key_export_response.rb b/lib/privy/models/private_key_export_response.rb new file mode 100644 index 0000000..a6ea648 --- /dev/null +++ b/lib/privy/models/private_key_export_response.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class PrivateKeyExportResponse < Privy::Internal::Type::BaseModel + # @!attribute ciphertext + # + # @return [String] + required :ciphertext, String + + # @!attribute encapsulated_key + # + # @return [String] + required :encapsulated_key, String + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!method initialize(ciphertext:, encapsulated_key:, encryption_type:) + # Response containing HPKE-encrypted wallet data (private key or seed phrase). + # + # @param ciphertext [String] + # + # @param encapsulated_key [String] + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + end + end +end diff --git a/lib/privy/models/private_key_export_webhook_payload.rb b/lib/privy/models/private_key_export_webhook_payload.rb new file mode 100644 index 0000000..891d4f4 --- /dev/null +++ b/lib/privy/models/private_key_export_webhook_payload.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Privy + module Models + class PrivateKeyExportWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::PrivateKeyExportWebhookPayload::Type] + required :type, enum: -> { Privy::PrivateKeyExportWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user who exported the key. + # + # @return [String] + required :user_id, String + + # @!attribute wallet_address + # The address of the wallet. + # + # @return [String] + required :wallet_address, String + + # @!attribute wallet_id + # The ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute export_source + # + # @return [Symbol, Privy::Models::PrivateKeyExportWebhookPayload::ExportSource, nil] + optional :export_source, enum: -> { Privy::PrivateKeyExportWebhookPayload::ExportSource } + + # @!method initialize(type:, user_id:, wallet_address:, wallet_id:, export_source: nil) + # Payload for the wallet.private_key_export webhook event. + # + # @param type [Symbol, Privy::Models::PrivateKeyExportWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user who exported the key. + # + # @param wallet_address [String] The address of the wallet. + # + # @param wallet_id [String] The ID of the wallet. + # + # @param export_source [Symbol, Privy::Models::PrivateKeyExportWebhookPayload::ExportSource] + + # The type of webhook event. + # + # @see Privy::Models::PrivateKeyExportWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_PRIVATE_KEY_EXPORT = :"wallet.private_key_export" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::PrivateKeyExportWebhookPayload#export_source + module ExportSource + extend Privy::Internal::Type::Enum + + DISPLAY = :display + CLIENT = :client + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/private_key_init_input.rb b/lib/privy/models/private_key_init_input.rb new file mode 100644 index 0000000..64b2773 --- /dev/null +++ b/lib/privy/models/private_key_init_input.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Models + class PrivateKeyInitInput < Privy::Internal::Type::BaseModel + # @!attribute address + # The address of the wallet to import. + # + # @return [String] + required :address, String + + # @!attribute chain_type + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + # + # @return [Symbol, Privy::Models::WalletImportSupportedChains] + required :chain_type, enum: -> { Privy::WalletImportSupportedChains } + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute entropy_type + # + # @return [Symbol, Privy::Models::PrivateKeyInitInput::EntropyType] + required :entropy_type, enum: -> { Privy::PrivateKeyInitInput::EntropyType } + + # @!method initialize(address:, chain_type:, encryption_type:, entropy_type:) + # Some parameter documentations has been truncated, see + # {Privy::Models::PrivateKeyInitInput} for more details. + # + # The input for private key wallets. + # + # @param address [String] The address of the wallet to import. + # + # @param chain_type [Symbol, Privy::Models::WalletImportSupportedChains] The chain type of the wallet to import. Currently supports `ethereum` and `solan + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param entropy_type [Symbol, Privy::Models::PrivateKeyInitInput::EntropyType] + + # @see Privy::Models::PrivateKeyInitInput#entropy_type + module EntropyType + extend Privy::Internal::Type::Enum + + PRIVATE_KEY = :"private-key" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/private_key_submit_input.rb b/lib/privy/models/private_key_submit_input.rb new file mode 100644 index 0000000..a9819bc --- /dev/null +++ b/lib/privy/models/private_key_submit_input.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +module Privy + module Models + class PrivateKeySubmitInput < Privy::Internal::Type::BaseModel + # @!attribute address + # The address of the wallet to import. + # + # @return [String] + required :address, String + + # @!attribute chain_type + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + # + # @return [Symbol, Privy::Models::WalletImportSupportedChains] + required :chain_type, enum: -> { Privy::WalletImportSupportedChains } + + # @!attribute ciphertext + # The encrypted entropy of the wallet to import. + # + # @return [String] + required :ciphertext, String + + # @!attribute encapsulated_key + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption inside the TEE. + # + # @return [String] + required :encapsulated_key, String + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute entropy_type + # + # @return [Symbol, Privy::Models::PrivateKeySubmitInput::EntropyType] + required :entropy_type, enum: -> { Privy::PrivateKeySubmitInput::EntropyType } + + # @!attribute hpke_config + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + # + # @return [Privy::Models::HpkeImportConfig, nil] + optional :hpke_config, -> { Privy::HpkeImportConfig } + + # @!method initialize(address:, chain_type:, ciphertext:, encapsulated_key:, encryption_type:, entropy_type:, hpke_config: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::PrivateKeySubmitInput} for more details. + # + # The submission input for importing a private key wallet. + # + # @param address [String] The address of the wallet to import. + # + # @param chain_type [Symbol, Privy::Models::WalletImportSupportedChains] The chain type of the wallet to import. Currently supports `ethereum` and `solan + # + # @param ciphertext [String] The encrypted entropy of the wallet to import. + # + # @param encapsulated_key [String] The base64-encoded encapsulated key that was generated during encryption, for us + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param entropy_type [Symbol, Privy::Models::PrivateKeySubmitInput::EntropyType] + # + # @param hpke_config [Privy::Models::HpkeImportConfig] Optional HPKE configuration for wallet import decryption. These parameters allow + + # @see Privy::Models::PrivateKeySubmitInput#entropy_type + module EntropyType + extend Privy::Internal::Type::Enum + + PRIVATE_KEY = :"private-key" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/privy_oauth_provider_id.rb b/lib/privy/models/privy_oauth_provider_id.rb new file mode 100644 index 0000000..0245f66 --- /dev/null +++ b/lib/privy/models/privy_oauth_provider_id.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + PrivyOAuthProviderID = String + end +end diff --git a/lib/privy/models/quantity.rb b/lib/privy/models/quantity.rb new file mode 100644 index 0000000..b9299a9 --- /dev/null +++ b/lib/privy/models/quantity.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + module Quantity + extend Privy::Internal::Type::Union + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 bytes). + variant -> { Privy::Hex } + + variant Integer + + # @!method self.variants + # @return [Array(String, Integer)] + end + end +end diff --git a/lib/privy/models/raw_sign_bytes_encoding.rb b/lib/privy/models/raw_sign_bytes_encoding.rb new file mode 100644 index 0000000..0cb5e2c --- /dev/null +++ b/lib/privy/models/raw_sign_bytes_encoding.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # Encoding scheme for bytes in the `raw_sign` RPC. + module RawSignBytesEncoding + extend Privy::Internal::Type::Enum + + UTF_8 = :"utf-8" + HEX = :hex + BASE64 = :base64 + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/raw_sign_bytes_hash_function.rb b/lib/privy/models/raw_sign_bytes_hash_function.rb new file mode 100644 index 0000000..feab73c --- /dev/null +++ b/lib/privy/models/raw_sign_bytes_hash_function.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # Hash function for bytes in the `raw_sign` RPC. + module RawSignBytesHashFunction + extend Privy::Internal::Type::Enum + + KECCAK256 = :keccak256 + SHA256 = :sha256 + BLAKE2B256 = :blake2b256 + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/raw_sign_bytes_params.rb b/lib/privy/models/raw_sign_bytes_params.rb new file mode 100644 index 0000000..537e729 --- /dev/null +++ b/lib/privy/models/raw_sign_bytes_params.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Privy + module Models + class RawSignBytesParams < Privy::Internal::Type::BaseModel + # @!attribute bytes + # The bytes to hash and sign. + # + # @return [String] + required :bytes, String + + # @!attribute encoding + # Encoding scheme for bytes in the `raw_sign` RPC. + # + # @return [Symbol, Privy::Models::RawSignBytesEncoding] + required :encoding, enum: -> { Privy::RawSignBytesEncoding } + + # @!attribute hash_function + # Hash function for bytes in the `raw_sign` RPC. + # + # @return [Symbol, Privy::Models::RawSignBytesHashFunction] + required :hash_function, enum: -> { Privy::RawSignBytesHashFunction } + + # @!method initialize(bytes:, encoding:, hash_function:) + # Parameters for hashing and signing bytes with the `raw_sign` RPC. + # + # @param bytes [String] The bytes to hash and sign. + # + # @param encoding [Symbol, Privy::Models::RawSignBytesEncoding] Encoding scheme for bytes in the `raw_sign` RPC. + # + # @param hash_function [Symbol, Privy::Models::RawSignBytesHashFunction] Hash function for bytes in the `raw_sign` RPC. + end + end +end diff --git a/lib/privy/models/raw_sign_hash_params.rb b/lib/privy/models/raw_sign_hash_params.rb new file mode 100644 index 0000000..ffcabfe --- /dev/null +++ b/lib/privy/models/raw_sign_hash_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + class RawSignHashParams < Privy::Internal::Type::BaseModel + # @!attribute hash_ + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :hash_, String, api_name: :hash + + # @!method initialize(hash_:) + # Some parameter documentations has been truncated, see + # {Privy::Models::RawSignHashParams} for more details. + # + # Parameters for signing a pre-computed hash with the `raw_sign` RPC. + # + # @param hash_ [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + end + end +end diff --git a/lib/privy/models/raw_sign_input.rb b/lib/privy/models/raw_sign_input.rb new file mode 100644 index 0000000..906f66f --- /dev/null +++ b/lib/privy/models/raw_sign_input.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + class RawSignInput < Privy::Internal::Type::BaseModel + # @!attribute params + # Parameters for the `raw_sign` RPC. + # + # @return [Privy::Models::RawSignHashParams, Privy::Models::RawSignBytesParams] + required :params, union: -> { Privy::RawSignInputParams } + + # @!method initialize(params:) + # Provide either `hash` (to sign a pre-computed hash) OR `bytes`, `encoding`, and + # `hash_function` (to hash and then sign). These options are mutually exclusive. + # + # @param params [Privy::Models::RawSignHashParams, Privy::Models::RawSignBytesParams] Parameters for the `raw_sign` RPC. + end + end +end diff --git a/lib/privy/models/raw_sign_input_params.rb b/lib/privy/models/raw_sign_input_params.rb new file mode 100644 index 0000000..e066fdc --- /dev/null +++ b/lib/privy/models/raw_sign_input_params.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # Parameters for the `raw_sign` RPC. + module RawSignInputParams + extend Privy::Internal::Type::Union + + # Parameters for signing a pre-computed hash with the `raw_sign` RPC. + variant -> { Privy::RawSignHashParams } + + # Parameters for hashing and signing bytes with the `raw_sign` RPC. + variant -> { Privy::RawSignBytesParams } + + # @!method self.variants + # @return [Array(Privy::Models::RawSignHashParams, Privy::Models::RawSignBytesParams)] + end + end +end diff --git a/lib/privy/models/raw_sign_response.rb b/lib/privy/models/raw_sign_response.rb new file mode 100644 index 0000000..16d4ec4 --- /dev/null +++ b/lib/privy/models/raw_sign_response.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#raw_sign + class RawSignResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the `raw_sign` RPC. + # + # @return [Privy::Models::RawSignResponseData] + required :data, -> { Privy::RawSignResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::RawSignResponse::Method] + required :method_, enum: -> { Privy::RawSignResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the `raw_sign` RPC. + # + # @param data [Privy::Models::RawSignResponseData] Data returned by the `raw_sign` RPC. + # + # @param method_ [Symbol, Privy::Models::RawSignResponse::Method] + + # @see Privy::Models::RawSignResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + RAW_SIGN = :raw_sign + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/raw_sign_response_data.rb b/lib/privy/models/raw_sign_response_data.rb new file mode 100644 index 0000000..dbd8b75 --- /dev/null +++ b/lib/privy/models/raw_sign_response_data.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class RawSignResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::RawSignResponseData::Encoding] + required :encoding, enum: -> { Privy::RawSignResponseData::Encoding } + + # @!attribute signature + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :signature, String + + # @!method initialize(encoding:, signature:) + # Some parameter documentations has been truncated, see + # {Privy::Models::RawSignResponseData} for more details. + # + # Data returned by the `raw_sign` RPC. + # + # @param encoding [Symbol, Privy::Models::RawSignResponseData::Encoding] + # + # @param signature [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + + # @see Privy::Models::RawSignResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + HEX = :hex + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/recipient_public_key.rb b/lib/privy/models/recipient_public_key.rb new file mode 100644 index 0000000..345630b --- /dev/null +++ b/lib/privy/models/recipient_public_key.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + RecipientPublicKey = String + end +end diff --git a/lib/privy/models/recovery_configuration_icloud_input.rb b/lib/privy/models/recovery_configuration_icloud_input.rb new file mode 100644 index 0000000..24729b1 --- /dev/null +++ b/lib/privy/models/recovery_configuration_icloud_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class RecoveryConfigurationICloudInput < Privy::Internal::Type::BaseModel + # @!attribute client_type + # The client type for iCloud recovery operations. + # + # @return [Symbol, Privy::Models::ICloudClientType] + required :client_type, enum: -> { Privy::ICloudClientType } + + # @!method initialize(client_type:) + # The input for getting the iCloud recovery configuration. + # + # @param client_type [Symbol, Privy::Models::ICloudClientType] The client type for iCloud recovery operations. + end + end +end diff --git a/lib/privy/models/recovery_configuration_icloud_response.rb b/lib/privy/models/recovery_configuration_icloud_response.rb new file mode 100644 index 0000000..28ef377 --- /dev/null +++ b/lib/privy/models/recovery_configuration_icloud_response.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class RecoveryConfigurationICloudResponse < Privy::Internal::Type::BaseModel + # @!attribute api_token + # + # @return [String] + required :api_token, String + + # @!attribute container_identifier + # + # @return [String] + required :container_identifier, String + + # @!attribute environment + # + # @return [String] + required :environment, String + + # @!method initialize(api_token:, container_identifier:, environment:) + # The response containing the iCloud recovery configuration. + # + # @param api_token [String] + # @param container_identifier [String] + # @param environment [String] + end + end +end diff --git a/lib/privy/models/recovery_key_material_input.rb b/lib/privy/models/recovery_key_material_input.rb new file mode 100644 index 0000000..2e45339 --- /dev/null +++ b/lib/privy/models/recovery_key_material_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class RecoveryKeyMaterialInput < Privy::Internal::Type::BaseModel + # @!attribute chain_type + # + # @return [String, nil] + optional :chain_type, String + + # @!method initialize(chain_type: nil) + # The input for getting the recovery key material. + # + # @param chain_type [String] + end + end +end diff --git a/lib/privy/models/recovery_key_material_response.rb b/lib/privy/models/recovery_key_material_response.rb new file mode 100644 index 0000000..d5ef70f --- /dev/null +++ b/lib/privy/models/recovery_key_material_response.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class RecoveryKeyMaterialResponse < Privy::Internal::Type::BaseModel + # @!attribute file_id + # + # @return [String] + required :file_id, String + + # @!attribute icloud_record_name + # + # @return [String] + required :icloud_record_name, String + + # @!attribute recovery_code + # + # @return [String] + required :recovery_code, String + + # @!attribute recovery_key + # + # @return [String] + required :recovery_key, String + + # @!attribute recovery_key_derivation_salt + # + # @return [String] + required :recovery_key_derivation_salt, String + + # @!attribute recovery_type + # The type of recovery mechanism used for wallet recovery. + # + # @return [Symbol, Privy::Models::RecoveryType] + required :recovery_type, enum: -> { Privy::RecoveryType } + + # @!method initialize(file_id:, icloud_record_name:, recovery_code:, recovery_key:, recovery_key_derivation_salt:, recovery_type:) + # The response containing the recovery key material. + # + # @param file_id [String] + # + # @param icloud_record_name [String] + # + # @param recovery_code [String] + # + # @param recovery_key [String] + # + # @param recovery_key_derivation_salt [String] + # + # @param recovery_type [Symbol, Privy::Models::RecoveryType] The type of recovery mechanism used for wallet recovery. + end + end +end diff --git a/lib/privy/models/recovery_type.rb b/lib/privy/models/recovery_type.rb new file mode 100644 index 0000000..9cd9157 --- /dev/null +++ b/lib/privy/models/recovery_type.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # The type of recovery mechanism used for wallet recovery. + module RecoveryType + extend Privy::Internal::Type::Enum + + USER_PASSCODE_DERIVED_RECOVERY_KEY = :user_passcode_derived_recovery_key + PRIVY_PASSCODE_DERIVED_RECOVERY_KEY = :privy_passcode_derived_recovery_key + PRIVY_GENERATED_RECOVERY_KEY = :privy_generated_recovery_key + GOOGLE_DRIVE_RECOVERY_SECRET = :google_drive_recovery_secret + ICLOUD_RECOVERY_SECRET = :icloud_recovery_secret + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/response_passkey_init_authenticate.rb b/lib/privy/models/response_passkey_init_authenticate.rb new file mode 100644 index 0000000..8e41b17 --- /dev/null +++ b/lib/privy/models/response_passkey_init_authenticate.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class ResponsePasskeyInitAuthenticate < Privy::Internal::Type::BaseModel + # @!attribute options + # WebAuthn authentication options as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorVerifyOptions] + required :options, -> { Privy::PasskeyAuthenticatorVerifyOptions } + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(options:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::ResponsePasskeyInitAuthenticate} for more details. + # + # Response for initiating a passkey authentication ceremony. + # + # @param options [Privy::Models::PasskeyAuthenticatorVerifyOptions] WebAuthn authentication options as defined by the Web Authentication specificati + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/response_passkey_init_link.rb b/lib/privy/models/response_passkey_init_link.rb new file mode 100644 index 0000000..7299173 --- /dev/null +++ b/lib/privy/models/response_passkey_init_link.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class ResponsePasskeyInitLink < Privy::Internal::Type::BaseModel + # @!attribute options + # WebAuthn registration options as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorEnrollmentOptions] + required :options, -> { Privy::PasskeyAuthenticatorEnrollmentOptions } + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(options:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::ResponsePasskeyInitLink} for more details. + # + # Response for initiating a passkey link ceremony. + # + # @param options [Privy::Models::PasskeyAuthenticatorEnrollmentOptions] WebAuthn registration options as defined by the Web Authentication specification + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/response_passkey_init_register.rb b/lib/privy/models/response_passkey_init_register.rb new file mode 100644 index 0000000..2812535 --- /dev/null +++ b/lib/privy/models/response_passkey_init_register.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class ResponsePasskeyInitRegister < Privy::Internal::Type::BaseModel + # @!attribute options + # WebAuthn registration options as defined by the Web Authentication + # specification. + # + # @return [Privy::Models::PasskeyAuthenticatorEnrollmentOptions] + required :options, -> { Privy::PasskeyAuthenticatorEnrollmentOptions } + + # @!attribute relying_party + # + # @return [String, nil] + optional :relying_party, String + + # @!method initialize(options:, relying_party: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::ResponsePasskeyInitRegister} for more details. + # + # Response for initiating a passkey registration ceremony. + # + # @param options [Privy::Models::PasskeyAuthenticatorEnrollmentOptions] WebAuthn registration options as defined by the Web Authentication specification + # + # @param relying_party [String] + end + end +end diff --git a/lib/privy/models/rpc_intent_request_details.rb b/lib/privy/models/rpc_intent_request_details.rb new file mode 100644 index 0000000..feff0f3 --- /dev/null +++ b/lib/privy/models/rpc_intent_request_details.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class RpcIntentRequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # Request body for wallet RPC operations, discriminated by method. + # + # @return [Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput, Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput, Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput, Privy::Models::ExportPrivateKeyRpcInput, Privy::Models::ExportSeedPhraseRpcInput] + required :body, union: -> { Privy::WalletRpcRequestBody } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::RpcIntentRequestDetails::Method] + required :method_, enum: -> { Privy::RpcIntentRequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # Request details for an RPC intent. + # + # @param body [Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput, Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput, Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput, Privy::Models::ExportPrivateKeyRpcInput, Privy::Models::ExportSeedPhraseRpcInput] Request body for wallet RPC operations, discriminated by method. + # + # @param method_ [Symbol, Privy::Models::RpcIntentRequestDetails::Method] + # + # @param url [String] + + # @see Privy::Models::RpcIntentRequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + POST = :POST + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/rpc_intent_response.rb b/lib/privy/models/rpc_intent_response.rb new file mode 100644 index 0000000..9977bcc --- /dev/null +++ b/lib/privy/models/rpc_intent_response.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#rpc + class RpcIntentResponse < Privy::Models::BaseIntentResponse + # @!attribute intent_type + # + # @return [Symbol, Privy::Models::RpcIntentResponse::IntentType] + required :intent_type, enum: -> { Privy::RpcIntentResponse::IntentType } + + # @!attribute request_details + # The original RPC request that would be sent to the wallet endpoint + # + # @return [Privy::Models::RpcIntentResponse::RequestDetails] + required :request_details, -> { Privy::RpcIntentResponse::RequestDetails } + + # @!attribute action_result + # Result of RPC execution (only present if status is 'executed' or 'failed') + # + # @return [Privy::Models::BaseActionResult, nil] + optional :action_result, -> { Privy::BaseActionResult } + + # @!attribute current_resource_data + # A wallet managed by Privy's wallet infrastructure. + # + # @return [Privy::Models::Wallet, nil] + optional :current_resource_data, -> { Privy::Wallet } + + # @!method initialize(intent_type:, request_details:, action_result: nil, current_resource_data: nil) + # Response for an RPC intent + # + # @param intent_type [Symbol, Privy::Models::RpcIntentResponse::IntentType] + # + # @param request_details [Privy::Models::RpcIntentResponse::RequestDetails] The original RPC request that would be sent to the wallet endpoint + # + # @param action_result [Privy::Models::BaseActionResult] Result of RPC execution (only present if status is 'executed' or 'failed') + # + # @param current_resource_data [Privy::Models::Wallet] A wallet managed by Privy's wallet infrastructure. + + module IntentType + extend Privy::Internal::Type::Enum + + RPC = :RPC + + # @!method self.values + # @return [Array] + end + + class RequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # Request body for wallet RPC operations, discriminated by method. + # + # @return [Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput, Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput, Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput, Privy::Models::ExportPrivateKeyRpcInput, Privy::Models::ExportSeedPhraseRpcInput] + required :body, union: -> { Privy::WalletRpcRequestBody } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::RpcIntentResponse::RequestDetails::Method] + required :method_, enum: -> { Privy::RpcIntentResponse::RequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # The original RPC request that would be sent to the wallet endpoint + # + # @param body [Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput, Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput, Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput, Privy::Models::ExportPrivateKeyRpcInput, Privy::Models::ExportSeedPhraseRpcInput] Request body for wallet RPC operations, discriminated by method. + # + # @param method_ [Symbol, Privy::Models::RpcIntentResponse::RequestDetails::Method] + # + # @param url [String] + + # @see Privy::Models::RpcIntentResponse::RequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + POST = :POST + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/privy/models/rule_intent_create_request_details.rb b/lib/privy/models/rule_intent_create_request_details.rb new file mode 100644 index 0000000..45544a1 --- /dev/null +++ b/lib/privy/models/rule_intent_create_request_details.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class RuleIntentCreateRequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # The rules that apply to each method the policy covers. + # + # @return [Privy::Models::PolicyRuleRequestBody] + required :body, -> { Privy::PolicyRuleRequestBody } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::RuleIntentCreateRequestDetails::Method] + required :method_, enum: -> { Privy::RuleIntentCreateRequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # Request details for creating a rule via intent. + # + # @param body [Privy::Models::PolicyRuleRequestBody] The rules that apply to each method the policy covers. + # + # @param method_ [Symbol, Privy::Models::RuleIntentCreateRequestDetails::Method] + # + # @param url [String] + + # @see Privy::Models::RuleIntentCreateRequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + POST = :POST + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/rule_intent_delete_request_details.rb b/lib/privy/models/rule_intent_delete_request_details.rb new file mode 100644 index 0000000..438b313 --- /dev/null +++ b/lib/privy/models/rule_intent_delete_request_details.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Privy + module Models + class RuleIntentDeleteRequestDetails < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::RuleIntentDeleteRequestDetails::Method] + required :method_, enum: -> { Privy::RuleIntentDeleteRequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!attribute body + # + # @return [Privy::Models::RuleIntentDeleteRequestDetails::Body, nil] + optional :body, -> { Privy::RuleIntentDeleteRequestDetails::Body } + + # @!method initialize(method_:, url:, body: nil) + # Request details for deleting a rule via intent. + # + # @param method_ [Symbol, Privy::Models::RuleIntentDeleteRequestDetails::Method] + # @param url [String] + # @param body [Privy::Models::RuleIntentDeleteRequestDetails::Body] + + # @see Privy::Models::RuleIntentDeleteRequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + DELETE = :DELETE + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::RuleIntentDeleteRequestDetails#body + class Body < Privy::Internal::Type::BaseModel + # @!method initialize + end + end + end +end diff --git a/lib/privy/models/rule_intent_request_details.rb b/lib/privy/models/rule_intent_request_details.rb new file mode 100644 index 0000000..74aa089 --- /dev/null +++ b/lib/privy/models/rule_intent_request_details.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + # The original rule request. Method is POST (create), PATCH (update), or DELETE + # (delete) + module RuleIntentRequestDetails + extend Privy::Internal::Type::Union + + discriminator :method + + # Request details for creating a rule via intent. + variant :POST, -> { Privy::RuleIntentCreateRequestDetails } + + # Request details for updating a rule via intent. + variant :PATCH, -> { Privy::RuleIntentUpdateRequestDetails } + + # Request details for deleting a rule via intent. + variant :DELETE, -> { Privy::RuleIntentDeleteRequestDetails } + + # @!method self.variants + # @return [Array(Privy::Models::RuleIntentCreateRequestDetails, Privy::Models::RuleIntentUpdateRequestDetails, Privy::Models::RuleIntentDeleteRequestDetails)] + end + end +end diff --git a/lib/privy/models/rule_intent_response.rb b/lib/privy/models/rule_intent_response.rb new file mode 100644 index 0000000..fddfe93 --- /dev/null +++ b/lib/privy/models/rule_intent_response.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#create_policy_rule + class RuleIntentResponse < Privy::Models::BaseIntentResponse + # @!attribute intent_type + # + # @return [Symbol, Privy::Models::RuleIntentResponse::IntentType] + required :intent_type, enum: -> { Privy::RuleIntentResponse::IntentType } + + # @!attribute request_details + # The original rule request. Method is POST (create), PATCH (update), or DELETE + # (delete) + # + # @return [Privy::Models::RuleIntentCreateRequestDetails, Privy::Models::RuleIntentUpdateRequestDetails, Privy::Models::RuleIntentDeleteRequestDetails] + required :request_details, union: -> { Privy::RuleIntentRequestDetails } + + # @!attribute action_result + # Result of rule execution (only present if status is 'executed' or 'failed') + # + # @return [Privy::Models::BaseActionResult, nil] + optional :action_result, -> { Privy::BaseActionResult } + + # @!attribute current_resource_data + # A rule that defines the conditions and action to take if the conditions are + # true. + # + # @return [Privy::Models::PolicyRuleResponse, nil] + optional :current_resource_data, -> { Privy::PolicyRuleResponse } + + # @!attribute policy + # A policy for controlling wallet operations. + # + # @return [Privy::Models::Policy, nil] + optional :policy, -> { Privy::Policy } + + # @!method initialize(intent_type:, request_details:, action_result: nil, current_resource_data: nil, policy: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::RuleIntentResponse} for more details. + # + # Response for a rule intent + # + # @param intent_type [Symbol, Privy::Models::RuleIntentResponse::IntentType] + # + # @param request_details [Privy::Models::RuleIntentCreateRequestDetails, Privy::Models::RuleIntentUpdateRequestDetails, Privy::Models::RuleIntentDeleteRequestDetails] The original rule request. Method is POST (create), PATCH (update), or DELETE (d + # + # @param action_result [Privy::Models::BaseActionResult] Result of rule execution (only present if status is 'executed' or 'failed') + # + # @param current_resource_data [Privy::Models::PolicyRuleResponse] A rule that defines the conditions and action to take if the conditions are true + # + # @param policy [Privy::Models::Policy] A policy for controlling wallet operations. + + module IntentType + extend Privy::Internal::Type::Enum + + RULE = :RULE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/rule_intent_update_request_details.rb b/lib/privy/models/rule_intent_update_request_details.rb new file mode 100644 index 0000000..efbfea5 --- /dev/null +++ b/lib/privy/models/rule_intent_update_request_details.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class RuleIntentUpdateRequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # The rules that apply to each method the policy covers. + # + # @return [Privy::Models::PolicyRuleRequestBody] + required :body, -> { Privy::PolicyRuleRequestBody } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::RuleIntentUpdateRequestDetails::Method] + required :method_, enum: -> { Privy::RuleIntentUpdateRequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # Request details for updating a rule via intent. + # + # @param body [Privy::Models::PolicyRuleRequestBody] The rules that apply to each method the policy covers. + # + # @param method_ [Symbol, Privy::Models::RuleIntentUpdateRequestDetails::Method] + # + # @param url [String] + + # @see Privy::Models::RuleIntentUpdateRequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + PATCH = :PATCH + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/seed_phrase_export_input.rb b/lib/privy/models/seed_phrase_export_input.rb new file mode 100644 index 0000000..a8fa42e --- /dev/null +++ b/lib/privy/models/seed_phrase_export_input.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class SeedPhraseExportInput < Privy::Internal::Type::BaseModel + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute recipient_public_key + # The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) + # format. + # + # @return [String] + required :recipient_public_key, String + + # @!attribute export_seed_phrase + # + # @return [Boolean, nil] + optional :export_seed_phrase, Privy::Internal::Type::Boolean + + # @!attribute export_type + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + # + # @return [Symbol, Privy::Models::ExportType, nil] + optional :export_type, enum: -> { Privy::ExportType } + + # @!method initialize(encryption_type:, recipient_public_key:, export_seed_phrase: nil, export_type: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::SeedPhraseExportInput} for more details. + # + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param recipient_public_key [String] The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) for + # + # @param export_seed_phrase [Boolean] + # + # @param export_type [Symbol, Privy::Models::ExportType] The export type. 'display' is for showing the key to the user in the UI, 'client + end + end +end diff --git a/lib/privy/models/seed_phrase_export_response.rb b/lib/privy/models/seed_phrase_export_response.rb new file mode 100644 index 0000000..9ae64ca --- /dev/null +++ b/lib/privy/models/seed_phrase_export_response.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Privy + module Models + class SeedPhraseExportResponse < Privy::Internal::Type::BaseModel + # @!attribute ciphertext + # + # @return [String] + required :ciphertext, String + + # @!attribute encapsulated_key + # + # @return [String] + required :encapsulated_key, String + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!method initialize(ciphertext:, encapsulated_key:, encryption_type:) + # Response containing HPKE-encrypted wallet data (private key or seed phrase). + # + # @param ciphertext [String] + # + # @param encapsulated_key [String] + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + end + end +end diff --git a/lib/privy/models/seed_phrase_export_webhook_payload.rb b/lib/privy/models/seed_phrase_export_webhook_payload.rb new file mode 100644 index 0000000..547b704 --- /dev/null +++ b/lib/privy/models/seed_phrase_export_webhook_payload.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Privy + module Models + class SeedPhraseExportWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::SeedPhraseExportWebhookPayload::Type] + required :type, enum: -> { Privy::SeedPhraseExportWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user who exported the seed phrase. + # + # @return [String] + required :user_id, String + + # @!attribute wallet_address + # The address of the wallet. + # + # @return [String] + required :wallet_address, String + + # @!attribute wallet_id + # The ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute export_source + # + # @return [Symbol, Privy::Models::SeedPhraseExportWebhookPayload::ExportSource, nil] + optional :export_source, enum: -> { Privy::SeedPhraseExportWebhookPayload::ExportSource } + + # @!method initialize(type:, user_id:, wallet_address:, wallet_id:, export_source: nil) + # Payload for the wallet.seed_phrase_export webhook event. + # + # @param type [Symbol, Privy::Models::SeedPhraseExportWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user who exported the seed phrase. + # + # @param wallet_address [String] The address of the wallet. + # + # @param wallet_id [String] The ID of the wallet. + # + # @param export_source [Symbol, Privy::Models::SeedPhraseExportWebhookPayload::ExportSource] + + # The type of webhook event. + # + # @see Privy::Models::SeedPhraseExportWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_SEED_PHRASE_EXPORT = :"wallet.seed_phrase_export" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SeedPhraseExportWebhookPayload#export_source + module ExportSource + extend Privy::Internal::Type::Enum + + DISPLAY = :display + CLIENT = :client + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/signing_algorithm.rb b/lib/privy/models/signing_algorithm.rb new file mode 100644 index 0000000..653de24 --- /dev/null +++ b/lib/privy/models/signing_algorithm.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # The signing algorithm used by the wallet. + module SigningAlgorithm + extend Privy::Internal::Type::Enum + + ECDSA = :ECDSA + ED_DSA = :EdDSA + SCHNORR = :Schnorr + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/siwe_address_input.rb b/lib/privy/models/siwe_address_input.rb new file mode 100644 index 0000000..43b2fa7 --- /dev/null +++ b/lib/privy/models/siwe_address_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweAddressInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # Input containing a SIWE wallet address. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/siwe_authenticate_request_body.rb b/lib/privy/models/siwe_authenticate_request_body.rb new file mode 100644 index 0000000..11853ff --- /dev/null +++ b/lib/privy/models/siwe_authenticate_request_body.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute chain_id + # + # @return [String, nil] + optional :chain_id, String, api_name: :chainId, nil?: true + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, chain_id: nil, connector_type: nil, mode: nil, wallet_client_type: nil) + # The request body for authenticating a SIWE ceremony. + # + # @param message [String] + # + # @param signature [String] + # + # @param chain_id [String, nil] + # + # @param connector_type [String, nil] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + # + # @param wallet_client_type [String, nil] + end + end +end diff --git a/lib/privy/models/siwe_init_input.rb b/lib/privy/models/siwe_init_input.rb new file mode 100644 index 0000000..6307ff1 --- /dev/null +++ b/lib/privy/models/siwe_init_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweInitInput < Privy::Internal::Type::BaseModel + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!method initialize(token: nil, address: nil) + # Input for initiating a SIWE ceremony. + # + # @param token [String] + # @param address [String] + end + end +end diff --git a/lib/privy/models/siwe_init_request_body.rb b/lib/privy/models/siwe_init_request_body.rb new file mode 100644 index 0000000..6fddd8c --- /dev/null +++ b/lib/privy/models/siwe_init_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # The request body for initiating a SIWE ceremony. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/siwe_init_response_body.rb b/lib/privy/models/siwe_init_response_body.rb new file mode 100644 index 0000000..a8ad3cb --- /dev/null +++ b/lib/privy/models/siwe_init_response_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweInitResponseBody < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute expires_at + # + # @return [String] + required :expires_at, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(address:, expires_at:, nonce:) + # The response body for initiating a SIWE ceremony. + # + # @param address [String] + # @param expires_at [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/siwe_input.rb b/lib/privy/models/siwe_input.rb new file mode 100644 index 0000000..625a9fd --- /dev/null +++ b/lib/privy/models/siwe_input.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweInput < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute chain_id + # + # @return [String, nil] + optional :chain_id, String, api_name: :chainId, nil?: true + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, chain_id: nil, connector_type: nil, wallet_client_type: nil) + # Input for a SIWE signing ceremony. + # + # @param message [String] + # @param signature [String] + # @param chain_id [String, nil] + # @param connector_type [String, nil] + # @param wallet_client_type [String, nil] + end + end +end diff --git a/lib/privy/models/siwe_link_request_body.rb b/lib/privy/models/siwe_link_request_body.rb new file mode 100644 index 0000000..088c5a0 --- /dev/null +++ b/lib/privy/models/siwe_link_request_body.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute chain_id + # + # @return [String, nil] + optional :chain_id, String, api_name: :chainId, nil?: true + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, chain_id: nil, connector_type: nil, wallet_client_type: nil) + # The request body for linking a SIWE ceremony. + # + # @param message [String] + # @param signature [String] + # @param chain_id [String, nil] + # @param connector_type [String, nil] + # @param wallet_client_type [String, nil] + end + end +end diff --git a/lib/privy/models/siwe_link_smart_wallet_request_body.rb b/lib/privy/models/siwe_link_smart_wallet_request_body.rb new file mode 100644 index 0000000..c05326a --- /dev/null +++ b/lib/privy/models/siwe_link_smart_wallet_request_body.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweLinkSmartWalletRequestBody < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute smart_wallet_type + # The supported smart wallet providers. + # + # @return [Symbol, Privy::Models::SmartWalletType] + required :smart_wallet_type, enum: -> { Privy::SmartWalletType } + + # @!attribute smart_wallet_version + # + # @return [String, nil] + optional :smart_wallet_version, String + + # @!method initialize(message:, signature:, smart_wallet_type:, smart_wallet_version: nil) + # The request body for linking a SIWE ceremony to a smart wallet. + # + # @param message [String] + # + # @param signature [String] + # + # @param smart_wallet_type [Symbol, Privy::Models::SmartWalletType] The supported smart wallet providers. + # + # @param smart_wallet_version [String] + end + end +end diff --git a/lib/privy/models/siwe_nonce.rb b/lib/privy/models/siwe_nonce.rb new file mode 100644 index 0000000..bb4ec9c --- /dev/null +++ b/lib/privy/models/siwe_nonce.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweNonce < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute expires_at + # + # @return [String] + required :expires_at, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(address:, expires_at:, nonce:) + # A SIWE nonce response. + # + # @param address [String] + # @param expires_at [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/siwe_unlink_request_body.rb b/lib/privy/models/siwe_unlink_request_body.rb new file mode 100644 index 0000000..5877b3f --- /dev/null +++ b/lib/privy/models/siwe_unlink_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiweUnlinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # The request body for unlinking a SIWE ceremony. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/siws_address_input.rb b/lib/privy/models/siws_address_input.rb new file mode 100644 index 0000000..a4b1013 --- /dev/null +++ b/lib/privy/models/siws_address_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsAddressInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # Input containing a SIWS wallet address. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/siws_authenticate_request_body.rb b/lib/privy/models/siws_authenticate_request_body.rb new file mode 100644 index 0000000..0653594 --- /dev/null +++ b/lib/privy/models/siws_authenticate_request_body.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute message_type + # + # @return [Symbol, Privy::Models::SiwsAuthenticateRequestBody::MessageType, nil] + optional :message_type, enum: -> { Privy::SiwsAuthenticateRequestBody::MessageType } + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, connector_type: nil, message_type: nil, mode: nil, wallet_client_type: nil) + # The request body for authenticating a SIWS ceremony. + # + # @param message [String] + # + # @param signature [String] + # + # @param connector_type [String, nil] + # + # @param message_type [Symbol, Privy::Models::SiwsAuthenticateRequestBody::MessageType] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + # + # @param wallet_client_type [String, nil] + + # @see Privy::Models::SiwsAuthenticateRequestBody#message_type + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION = :transaction + PLAIN = :plain + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/siws_init_input.rb b/lib/privy/models/siws_init_input.rb new file mode 100644 index 0000000..21b9d32 --- /dev/null +++ b/lib/privy/models/siws_init_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsInitInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute token + # + # @return [String, nil] + optional :token, String + + # @!method initialize(address:, token: nil) + # Input for initiating a SIWS ceremony. + # + # @param address [String] + # @param token [String] + end + end +end diff --git a/lib/privy/models/siws_init_request_body.rb b/lib/privy/models/siws_init_request_body.rb new file mode 100644 index 0000000..12ca271 --- /dev/null +++ b/lib/privy/models/siws_init_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsInitRequestBody < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # The request body for initiating a SIWS ceremony. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/siws_init_response_body.rb b/lib/privy/models/siws_init_response_body.rb new file mode 100644 index 0000000..f964f70 --- /dev/null +++ b/lib/privy/models/siws_init_response_body.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsInitResponseBody < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute expires_at + # + # @return [String] + required :expires_at, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(address:, expires_at:, nonce:) + # The response body for initiating a SIWS ceremony. + # + # @param address [String] + # @param expires_at [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/siws_input.rb b/lib/privy/models/siws_input.rb new file mode 100644 index 0000000..bb6cd71 --- /dev/null +++ b/lib/privy/models/siws_input.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsInput < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute message_type + # + # @return [Symbol, Privy::Models::SiwsInput::MessageType, nil] + optional :message_type, enum: -> { Privy::SiwsInput::MessageType } + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, connector_type: nil, message_type: nil, wallet_client_type: nil) + # Input for a SIWS signing ceremony. + # + # @param message [String] + # @param signature [String] + # @param connector_type [String, nil] + # @param message_type [Symbol, Privy::Models::SiwsInput::MessageType] + # @param wallet_client_type [String, nil] + + # @see Privy::Models::SiwsInput#message_type + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION = :transaction + PLAIN = :plain + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/siws_link_request_body.rb b/lib/privy/models/siws_link_request_body.rb new file mode 100644 index 0000000..e3909f5 --- /dev/null +++ b/lib/privy/models/siws_link_request_body.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute message_type + # + # @return [Symbol, Privy::Models::SiwsLinkRequestBody::MessageType, nil] + optional :message_type, enum: -> { Privy::SiwsLinkRequestBody::MessageType } + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(message:, signature:, connector_type: nil, message_type: nil, wallet_client_type: nil) + # The request body for linking a SIWS ceremony. + # + # @param message [String] + # @param signature [String] + # @param connector_type [String, nil] + # @param message_type [Symbol, Privy::Models::SiwsLinkRequestBody::MessageType] + # @param wallet_client_type [String, nil] + + # @see Privy::Models::SiwsLinkRequestBody#message_type + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION = :transaction + PLAIN = :plain + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/siws_nonce.rb b/lib/privy/models/siws_nonce.rb new file mode 100644 index 0000000..20fb3f1 --- /dev/null +++ b/lib/privy/models/siws_nonce.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsNonce < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute expires_at + # + # @return [String] + required :expires_at, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(address:, expires_at:, nonce:) + # A SIWS nonce response. + # + # @param address [String] + # @param expires_at [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/siws_unlink_request_body.rb b/lib/privy/models/siws_unlink_request_body.rb new file mode 100644 index 0000000..a7ca407 --- /dev/null +++ b/lib/privy/models/siws_unlink_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SiwsUnlinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # The request body for unlinking a SIWS ceremony. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/smart_wallet_configuration.rb b/lib/privy/models/smart_wallet_configuration.rb new file mode 100644 index 0000000..3a3b19d --- /dev/null +++ b/lib/privy/models/smart_wallet_configuration.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # The configuration object for smart wallets. + module SmartWalletConfiguration + extend Privy::Internal::Type::Union + + # A disabled smart wallet configuration. + variant -> { Privy::SmartWalletConfigurationDisabled } + + # An enabled smart wallet configuration. + variant -> { Privy::SmartWalletConfigurationEnabled } + + # @!method self.variants + # @return [Array(Privy::Models::SmartWalletConfigurationDisabled, Privy::Models::SmartWalletConfigurationEnabled)] + end + end +end diff --git a/lib/privy/models/smart_wallet_configuration_disabled.rb b/lib/privy/models/smart_wallet_configuration_disabled.rb new file mode 100644 index 0000000..f524767 --- /dev/null +++ b/lib/privy/models/smart_wallet_configuration_disabled.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + class SmartWalletConfigurationDisabled < Privy::Internal::Type::BaseModel + # @!attribute enabled + # + # @return [Boolean, Privy::Models::SmartWalletConfigurationDisabled::Enabled] + required :enabled, enum: -> { Privy::SmartWalletConfigurationDisabled::Enabled } + + # @!method initialize(enabled:) + # A disabled smart wallet configuration. + # + # @param enabled [Boolean, Privy::Models::SmartWalletConfigurationDisabled::Enabled] + + # @see Privy::Models::SmartWalletConfigurationDisabled#enabled + module Enabled + extend Privy::Internal::Type::Enum + + FALSE = false + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/smart_wallet_configuration_enabled.rb b/lib/privy/models/smart_wallet_configuration_enabled.rb new file mode 100644 index 0000000..e49e7f7 --- /dev/null +++ b/lib/privy/models/smart_wallet_configuration_enabled.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Privy + module Models + class SmartWalletConfigurationEnabled < Privy::Internal::Type::BaseModel + # @!attribute configured_networks + # + # @return [Array] + required :configured_networks, + -> { Privy::Internal::Type::ArrayOf[Privy::SmartWalletNetworkConfiguration] } + + # @!attribute enabled + # + # @return [Boolean, Privy::Models::SmartWalletConfigurationEnabled::Enabled] + required :enabled, enum: -> { Privy::SmartWalletConfigurationEnabled::Enabled } + + # @!attribute smart_wallet_type + # The supported smart wallet providers. + # + # @return [Symbol, Privy::Models::SmartWalletType] + required :smart_wallet_type, enum: -> { Privy::SmartWalletType } + + # @!attribute smart_wallet_version + # + # @return [String, nil] + optional :smart_wallet_version, String + + # @!method initialize(configured_networks:, enabled:, smart_wallet_type:, smart_wallet_version: nil) + # An enabled smart wallet configuration. + # + # @param configured_networks [Array] + # + # @param enabled [Boolean, Privy::Models::SmartWalletConfigurationEnabled::Enabled] + # + # @param smart_wallet_type [Symbol, Privy::Models::SmartWalletType] The supported smart wallet providers. + # + # @param smart_wallet_version [String] + + # @see Privy::Models::SmartWalletConfigurationEnabled#enabled + module Enabled + extend Privy::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/smart_wallet_configuration_input.rb b/lib/privy/models/smart_wallet_configuration_input.rb new file mode 100644 index 0000000..5d3625f --- /dev/null +++ b/lib/privy/models/smart_wallet_configuration_input.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # The input configuration object for smart wallets. + module SmartWalletConfigurationInput + extend Privy::Internal::Type::Union + + # A disabled smart wallet configuration. + variant -> { Privy::SmartWalletConfigurationDisabled } + + # An enabled smart wallet configuration input. + variant -> { Privy::SmartWalletConfigurationInputEnabled } + + # @!method self.variants + # @return [Array(Privy::Models::SmartWalletConfigurationDisabled, Privy::Models::SmartWalletConfigurationInputEnabled)] + end + end +end diff --git a/lib/privy/models/smart_wallet_configuration_input_enabled.rb b/lib/privy/models/smart_wallet_configuration_input_enabled.rb new file mode 100644 index 0000000..9943dbe --- /dev/null +++ b/lib/privy/models/smart_wallet_configuration_input_enabled.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Privy + module Models + class SmartWalletConfigurationInputEnabled < Privy::Internal::Type::BaseModel + # @!attribute configured_networks + # + # @return [Array] + required :configured_networks, + -> { Privy::Internal::Type::ArrayOf[Privy::SmartWalletNetworkConfigurationInput] } + + # @!attribute enabled + # + # @return [Boolean, Privy::Models::SmartWalletConfigurationInputEnabled::Enabled] + required :enabled, enum: -> { Privy::SmartWalletConfigurationInputEnabled::Enabled } + + # @!attribute smart_wallet_type + # The supported smart wallet providers. + # + # @return [Symbol, Privy::Models::SmartWalletType] + required :smart_wallet_type, enum: -> { Privy::SmartWalletType } + + # @!attribute smart_wallet_version + # + # @return [String, nil] + optional :smart_wallet_version, String, nil?: true + + # @!method initialize(configured_networks:, enabled:, smart_wallet_type:, smart_wallet_version: nil) + # An enabled smart wallet configuration input. + # + # @param configured_networks [Array] + # + # @param enabled [Boolean, Privy::Models::SmartWalletConfigurationInputEnabled::Enabled] + # + # @param smart_wallet_type [Symbol, Privy::Models::SmartWalletType] The supported smart wallet providers. + # + # @param smart_wallet_version [String, nil] + + # @see Privy::Models::SmartWalletConfigurationInputEnabled#enabled + module Enabled + extend Privy::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/smart_wallet_network_configuration.rb b/lib/privy/models/smart_wallet_network_configuration.rb new file mode 100644 index 0000000..38f8d45 --- /dev/null +++ b/lib/privy/models/smart_wallet_network_configuration.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class SmartWalletNetworkConfiguration < Privy::Internal::Type::BaseModel + # @!attribute bundler_url + # + # @return [String] + required :bundler_url, String + + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute chain_name + # + # @return [String, nil] + optional :chain_name, String + + # @!attribute paymaster_context + # The Alchemy paymaster context for a smart wallet network configuration. + # + # @return [Privy::Models::AlchemyPaymasterContext, nil] + optional :paymaster_context, -> { Privy::AlchemyPaymasterContext } + + # @!attribute paymaster_url + # + # @return [String, nil] + optional :paymaster_url, String + + # @!attribute rpc_url + # + # @return [String, nil] + optional :rpc_url, String + + # @!method initialize(bundler_url:, chain_id:, chain_name: nil, paymaster_context: nil, paymaster_url: nil, rpc_url: nil) + # Network configuration for a smart wallet. + # + # @param bundler_url [String] + # + # @param chain_id [String] + # + # @param chain_name [String] + # + # @param paymaster_context [Privy::Models::AlchemyPaymasterContext] The Alchemy paymaster context for a smart wallet network configuration. + # + # @param paymaster_url [String] + # + # @param rpc_url [String] + end + end +end diff --git a/lib/privy/models/smart_wallet_network_configuration_input.rb b/lib/privy/models/smart_wallet_network_configuration_input.rb new file mode 100644 index 0000000..7e64f46 --- /dev/null +++ b/lib/privy/models/smart_wallet_network_configuration_input.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class SmartWalletNetworkConfigurationInput < Privy::Internal::Type::BaseModel + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute bundler_url + # + # @return [String, nil] + optional :bundler_url, String + + # @!attribute chain_name + # + # @return [String, nil] + optional :chain_name, String + + # @!attribute paymaster_context + # The Alchemy paymaster context for a smart wallet network configuration. + # + # @return [Privy::Models::AlchemyPaymasterContext, nil] + optional :paymaster_context, -> { Privy::AlchemyPaymasterContext } + + # @!attribute paymaster_url + # + # @return [String, nil] + optional :paymaster_url, String + + # @!attribute rpc_url + # + # @return [String, nil] + optional :rpc_url, String + + # @!method initialize(chain_id:, bundler_url: nil, chain_name: nil, paymaster_context: nil, paymaster_url: nil, rpc_url: nil) + # Input for network configuration for a smart wallet. + # + # @param chain_id [String] + # + # @param bundler_url [String] + # + # @param chain_name [String] + # + # @param paymaster_context [Privy::Models::AlchemyPaymasterContext] The Alchemy paymaster context for a smart wallet network configuration. + # + # @param paymaster_url [String] + # + # @param rpc_url [String] + end + end +end diff --git a/lib/privy/models/smart_wallet_siwe_input.rb b/lib/privy/models/smart_wallet_siwe_input.rb new file mode 100644 index 0000000..3788827 --- /dev/null +++ b/lib/privy/models/smart_wallet_siwe_input.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class SmartWalletSiweInput < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute smart_wallet_type + # The supported smart wallet providers. + # + # @return [Symbol, Privy::Models::SmartWalletType] + required :smart_wallet_type, enum: -> { Privy::SmartWalletType } + + # @!attribute smart_wallet_version + # + # @return [String, nil] + optional :smart_wallet_version, String + + # @!method initialize(message:, signature:, smart_wallet_type:, smart_wallet_version: nil) + # Input for a smart wallet SIWE signing ceremony. + # + # @param message [String] + # + # @param signature [String] + # + # @param smart_wallet_type [Symbol, Privy::Models::SmartWalletType] The supported smart wallet providers. + # + # @param smart_wallet_version [String] + end + end +end diff --git a/lib/privy/models/smart_wallet_type.rb b/lib/privy/models/smart_wallet_type.rb new file mode 100644 index 0000000..9f53236 --- /dev/null +++ b/lib/privy/models/smart_wallet_type.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # The supported smart wallet providers. + module SmartWalletType + extend Privy::Internal::Type::Enum + + SAFE = :safe + KERNEL = :kernel + LIGHT_ACCOUNT = :light_account + BICONOMY = :biconomy + COINBASE_SMART_WALLET = :coinbase_smart_wallet + THIRDWEB = :thirdweb + NEXUS = :nexus + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/sms_mfa_method.rb b/lib/privy/models/sms_mfa_method.rb new file mode 100644 index 0000000..bd292e2 --- /dev/null +++ b/lib/privy/models/sms_mfa_method.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class SMSMfaMethod < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::SMSMfaMethod::Type] + required :type, enum: -> { Privy::SMSMfaMethod::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(type:, verified_at:) + # A SMS MFA method. + # + # @param type [Symbol, Privy::Models::SMSMfaMethod::Type] + # @param verified_at [Float] + + # @see Privy::Models::SMSMfaMethod#type + module Type + extend Privy::Internal::Type::Enum + + SMS = :sms + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_program_instruction_condition.rb b/lib/privy/models/solana_program_instruction_condition.rb new file mode 100644 index 0000000..042c3aa --- /dev/null +++ b/lib/privy/models/solana_program_instruction_condition.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaProgramInstructionCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::SolanaProgramInstructionCondition::Field] + required :field, enum: -> { Privy::SolanaProgramInstructionCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::SolanaProgramInstructionCondition::FieldSource] + required :field_source, enum: -> { Privy::SolanaProgramInstructionCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::SolanaProgramInstructionCondition} for more details. + # + # Solana Program attributes, enables allowlisting Solana Programs. + # + # @param field [Symbol, Privy::Models::SolanaProgramInstructionCondition::Field] + # + # @param field_source [Symbol, Privy::Models::SolanaProgramInstructionCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::SolanaProgramInstructionCondition#field + module Field + extend Privy::Internal::Type::Enum + + PROGRAM_ID = :programId + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SolanaProgramInstructionCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + SOLANA_PROGRAM_INSTRUCTION = :solana_program_instruction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_rpc_input.rb b/lib/privy/models/solana_rpc_input.rb new file mode 100644 index 0000000..0978744 --- /dev/null +++ b/lib/privy/models/solana_rpc_input.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + # Request body for Solana wallet RPC operations, discriminated by method. + module SolanaRpcInput + extend Privy::Internal::Type::Union + + discriminator :method + + # Executes the SVM `signTransaction` RPC to sign a transaction. + variant :signTransaction, -> { Privy::SolanaSignTransactionRpcInput } + + # Executes the SVM `signAndSendTransaction` RPC to sign and broadcast a transaction. + variant :signAndSendTransaction, -> { Privy::SolanaSignAndSendTransactionRpcInput } + + # Executes the SVM `signMessage` RPC to sign a message. + variant :signMessage, -> { Privy::SolanaSignMessageRpcInput } + + # @!method self.variants + # @return [Array(Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput)] + end + end +end diff --git a/lib/privy/models/solana_rpc_response.rb b/lib/privy/models/solana_rpc_response.rb new file mode 100644 index 0000000..a2acad4 --- /dev/null +++ b/lib/privy/models/solana_rpc_response.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Privy + module Models + # Response body for Solana wallet RPC operations, discriminated by method. + module SolanaRpcResponse + extend Privy::Internal::Type::Union + + discriminator :method + + # Response to the SVM `signMessage` RPC. + variant :signMessage, -> { Privy::SolanaSignMessageRpcResponse } + + # Response to the SVM `signTransaction` RPC. + variant :signTransaction, -> { Privy::SolanaSignTransactionRpcResponse } + + # Response to the SVM `signAndSendTransaction` RPC. + variant :signAndSendTransaction, -> { Privy::SolanaSignAndSendTransactionRpcResponse } + + # @!method self.variants + # @return [Array(Privy::Models::SolanaSignMessageRpcResponse, Privy::Models::SolanaSignTransactionRpcResponse, Privy::Models::SolanaSignAndSendTransactionRpcResponse)] + end + end +end diff --git a/lib/privy/models/solana_sign_and_send_transaction_rpc_input.rb b/lib/privy/models/solana_sign_and_send_transaction_rpc_input.rb new file mode 100644 index 0000000..e96064b --- /dev/null +++ b/lib/privy/models/solana_sign_and_send_transaction_rpc_input.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignAndSendTransactionRpcInput < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @return [String] + required :caip2, String + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcInput::Method] + required :method_, enum: -> { Privy::SolanaSignAndSendTransactionRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the SVM `signAndSendTransaction` RPC. + # + # @return [Privy::Models::SolanaSignAndSendTransactionRpcInputParams] + required :params, -> { Privy::SolanaSignAndSendTransactionRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::SolanaSignAndSendTransactionRpcInput::ChainType } + + # @!attribute optimistic_broadcast + # + # @return [Boolean, nil] + optional :optimistic_broadcast, Privy::Internal::Type::Boolean + + # @!attribute reference_id + # + # @return [String, nil] + optional :reference_id, String + + # @!attribute sponsor + # + # @return [Boolean, nil] + optional :sponsor, Privy::Internal::Type::Boolean + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(caip2:, method_:, params:, address: nil, chain_type: nil, optimistic_broadcast: nil, reference_id: nil, sponsor: nil, wallet_id: nil) + # Executes the SVM `signAndSendTransaction` RPC to sign and broadcast a + # transaction. + # + # @param caip2 [String] A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @param method_ [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcInput::Method] + # + # @param params [Privy::Models::SolanaSignAndSendTransactionRpcInputParams] Parameters for the SVM `signAndSendTransaction` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcInput::ChainType] + # + # @param optimistic_broadcast [Boolean] + # + # @param reference_id [String] + # + # @param sponsor [Boolean] + # + # @param wallet_id [String] + + # @see Privy::Models::SolanaSignAndSendTransactionRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_AND_SEND_TRANSACTION = :signAndSendTransaction + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SolanaSignAndSendTransactionRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_and_send_transaction_rpc_input_params.rb b/lib/privy/models/solana_sign_and_send_transaction_rpc_input_params.rb new file mode 100644 index 0000000..636c2b8 --- /dev/null +++ b/lib/privy/models/solana_sign_and_send_transaction_rpc_input_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignAndSendTransactionRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcInputParams::Encoding] + required :encoding, enum: -> { Privy::SolanaSignAndSendTransactionRpcInputParams::Encoding } + + # @!attribute transaction + # + # @return [String] + required :transaction, String + + # @!method initialize(encoding:, transaction:) + # Parameters for the SVM `signAndSendTransaction` RPC. + # + # @param encoding [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcInputParams::Encoding] + # @param transaction [String] + + # @see Privy::Models::SolanaSignAndSendTransactionRpcInputParams#encoding + module Encoding + extend Privy::Internal::Type::Enum + + BASE64 = :base64 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_and_send_transaction_rpc_response.rb b/lib/privy/models/solana_sign_and_send_transaction_rpc_response.rb new file mode 100644 index 0000000..a5983d9 --- /dev/null +++ b/lib/privy/models/solana_sign_and_send_transaction_rpc_response.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignAndSendTransactionRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the SVM `signAndSendTransaction` RPC. + # + # @return [Privy::Models::SolanaSignAndSendTransactionRpcResponseData] + required :data, -> { Privy::SolanaSignAndSendTransactionRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcResponse::Method] + required :method_, + enum: -> { + Privy::SolanaSignAndSendTransactionRpcResponse::Method + }, + api_name: :method + + # @!method initialize(data:, method_:) + # Response to the SVM `signAndSendTransaction` RPC. + # + # @param data [Privy::Models::SolanaSignAndSendTransactionRpcResponseData] Data returned by the SVM `signAndSendTransaction` RPC. + # + # @param method_ [Symbol, Privy::Models::SolanaSignAndSendTransactionRpcResponse::Method] + + # @see Privy::Models::SolanaSignAndSendTransactionRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_AND_SEND_TRANSACTION = :signAndSendTransaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_and_send_transaction_rpc_response_data.rb b/lib/privy/models/solana_sign_and_send_transaction_rpc_response_data.rb new file mode 100644 index 0000000..c4d75f5 --- /dev/null +++ b/lib/privy/models/solana_sign_and_send_transaction_rpc_response_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignAndSendTransactionRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @return [String] + required :caip2, String + + # @!attribute hash_ + # + # @return [String] + required :hash_, String, api_name: :hash + + # @!attribute reference_id + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!attribute signed_transaction + # + # @return [String, nil] + optional :signed_transaction, String + + # @!attribute transaction_id + # + # @return [String, nil] + optional :transaction_id, String + + # @!method initialize(caip2:, hash_:, reference_id: nil, signed_transaction: nil, transaction_id: nil) + # Data returned by the SVM `signAndSendTransaction` RPC. + # + # @param caip2 [String] A valid CAIP-2 chain ID (e.g. 'eip155:1'). + # + # @param hash_ [String] + # + # @param reference_id [String, nil] + # + # @param signed_transaction [String] + # + # @param transaction_id [String] + end + end +end diff --git a/lib/privy/models/solana_sign_message_rpc_input.rb b/lib/privy/models/solana_sign_message_rpc_input.rb new file mode 100644 index 0000000..ab0ba9c --- /dev/null +++ b/lib/privy/models/solana_sign_message_rpc_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignMessageRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SolanaSignMessageRpcInput::Method] + required :method_, enum: -> { Privy::SolanaSignMessageRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the SVM `signMessage` RPC. + # + # @return [Privy::Models::SolanaSignMessageRpcInputParams] + required :params, -> { Privy::SolanaSignMessageRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::SolanaSignMessageRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::SolanaSignMessageRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Executes the SVM `signMessage` RPC to sign a message. + # + # @param method_ [Symbol, Privy::Models::SolanaSignMessageRpcInput::Method] + # + # @param params [Privy::Models::SolanaSignMessageRpcInputParams] Parameters for the SVM `signMessage` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::SolanaSignMessageRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::SolanaSignMessageRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE = :signMessage + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SolanaSignMessageRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_message_rpc_input_params.rb b/lib/privy/models/solana_sign_message_rpc_input_params.rb new file mode 100644 index 0000000..ab97373 --- /dev/null +++ b/lib/privy/models/solana_sign_message_rpc_input_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignMessageRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::SolanaSignMessageRpcInputParams::Encoding] + required :encoding, enum: -> { Privy::SolanaSignMessageRpcInputParams::Encoding } + + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(encoding:, message:) + # Parameters for the SVM `signMessage` RPC. + # + # @param encoding [Symbol, Privy::Models::SolanaSignMessageRpcInputParams::Encoding] + # @param message [String] + + # @see Privy::Models::SolanaSignMessageRpcInputParams#encoding + module Encoding + extend Privy::Internal::Type::Enum + + BASE64 = :base64 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_message_rpc_response.rb b/lib/privy/models/solana_sign_message_rpc_response.rb new file mode 100644 index 0000000..81252ae --- /dev/null +++ b/lib/privy/models/solana_sign_message_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignMessageRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the SVM `signMessage` RPC. + # + # @return [Privy::Models::SolanaSignMessageRpcResponseData] + required :data, -> { Privy::SolanaSignMessageRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SolanaSignMessageRpcResponse::Method] + required :method_, enum: -> { Privy::SolanaSignMessageRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the SVM `signMessage` RPC. + # + # @param data [Privy::Models::SolanaSignMessageRpcResponseData] Data returned by the SVM `signMessage` RPC. + # + # @param method_ [Symbol, Privy::Models::SolanaSignMessageRpcResponse::Method] + + # @see Privy::Models::SolanaSignMessageRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE = :signMessage + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_message_rpc_response_data.rb b/lib/privy/models/solana_sign_message_rpc_response_data.rb new file mode 100644 index 0000000..d34b0bf --- /dev/null +++ b/lib/privy/models/solana_sign_message_rpc_response_data.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignMessageRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::SolanaSignMessageRpcResponseData::Encoding] + required :encoding, enum: -> { Privy::SolanaSignMessageRpcResponseData::Encoding } + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!method initialize(encoding:, signature:) + # Data returned by the SVM `signMessage` RPC. + # + # @param encoding [Symbol, Privy::Models::SolanaSignMessageRpcResponseData::Encoding] + # @param signature [String] + + # @see Privy::Models::SolanaSignMessageRpcResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + BASE64 = :base64 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_transaction_rpc_input.rb b/lib/privy/models/solana_sign_transaction_rpc_input.rb new file mode 100644 index 0000000..c2eaab3 --- /dev/null +++ b/lib/privy/models/solana_sign_transaction_rpc_input.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignTransactionRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SolanaSignTransactionRpcInput::Method] + required :method_, enum: -> { Privy::SolanaSignTransactionRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the SVM `signTransaction` RPC. + # + # @return [Privy::Models::SolanaSignTransactionRpcInputParams] + required :params, -> { Privy::SolanaSignTransactionRpcInputParams } + + # @!attribute address + # + # @return [String, nil] + optional :address, String + + # @!attribute chain_type + # + # @return [Symbol, Privy::Models::SolanaSignTransactionRpcInput::ChainType, nil] + optional :chain_type, enum: -> { Privy::SolanaSignTransactionRpcInput::ChainType } + + # @!attribute wallet_id + # + # @return [String, nil] + optional :wallet_id, String + + # @!method initialize(method_:, params:, address: nil, chain_type: nil, wallet_id: nil) + # Executes the SVM `signTransaction` RPC to sign a transaction. + # + # @param method_ [Symbol, Privy::Models::SolanaSignTransactionRpcInput::Method] + # + # @param params [Privy::Models::SolanaSignTransactionRpcInputParams] Parameters for the SVM `signTransaction` RPC. + # + # @param address [String] + # + # @param chain_type [Symbol, Privy::Models::SolanaSignTransactionRpcInput::ChainType] + # + # @param wallet_id [String] + + # @see Privy::Models::SolanaSignTransactionRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_TRANSACTION = :signTransaction + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SolanaSignTransactionRpcInput#chain_type + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_transaction_rpc_input_params.rb b/lib/privy/models/solana_sign_transaction_rpc_input_params.rb new file mode 100644 index 0000000..9b94803 --- /dev/null +++ b/lib/privy/models/solana_sign_transaction_rpc_input_params.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignTransactionRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::SolanaSignTransactionRpcInputParams::Encoding] + required :encoding, enum: -> { Privy::SolanaSignTransactionRpcInputParams::Encoding } + + # @!attribute transaction + # + # @return [String] + required :transaction, String + + # @!method initialize(encoding:, transaction:) + # Parameters for the SVM `signTransaction` RPC. + # + # @param encoding [Symbol, Privy::Models::SolanaSignTransactionRpcInputParams::Encoding] + # @param transaction [String] + + # @see Privy::Models::SolanaSignTransactionRpcInputParams#encoding + module Encoding + extend Privy::Internal::Type::Enum + + BASE64 = :base64 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_transaction_rpc_response.rb b/lib/privy/models/solana_sign_transaction_rpc_response.rb new file mode 100644 index 0000000..e0d0d94 --- /dev/null +++ b/lib/privy/models/solana_sign_transaction_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignTransactionRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # Data returned by the SVM `signTransaction` RPC. + # + # @return [Privy::Models::SolanaSignTransactionRpcResponseData] + required :data, -> { Privy::SolanaSignTransactionRpcResponseData } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SolanaSignTransactionRpcResponse::Method] + required :method_, enum: -> { Privy::SolanaSignTransactionRpcResponse::Method }, api_name: :method + + # @!method initialize(data:, method_:) + # Response to the SVM `signTransaction` RPC. + # + # @param data [Privy::Models::SolanaSignTransactionRpcResponseData] Data returned by the SVM `signTransaction` RPC. + # + # @param method_ [Symbol, Privy::Models::SolanaSignTransactionRpcResponse::Method] + + # @see Privy::Models::SolanaSignTransactionRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_TRANSACTION = :signTransaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_sign_transaction_rpc_response_data.rb b/lib/privy/models/solana_sign_transaction_rpc_response_data.rb new file mode 100644 index 0000000..417f70b --- /dev/null +++ b/lib/privy/models/solana_sign_transaction_rpc_response_data.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSignTransactionRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute encoding + # + # @return [Symbol, Privy::Models::SolanaSignTransactionRpcResponseData::Encoding] + required :encoding, enum: -> { Privy::SolanaSignTransactionRpcResponseData::Encoding } + + # @!attribute signed_transaction + # + # @return [String] + required :signed_transaction, String + + # @!method initialize(encoding:, signed_transaction:) + # Data returned by the SVM `signTransaction` RPC. + # + # @param encoding [Symbol, Privy::Models::SolanaSignTransactionRpcResponseData::Encoding] + # @param signed_transaction [String] + + # @see Privy::Models::SolanaSignTransactionRpcResponseData#encoding + module Encoding + extend Privy::Internal::Type::Enum + + BASE64 = :base64 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_system_program_instruction_condition.rb b/lib/privy/models/solana_system_program_instruction_condition.rb new file mode 100644 index 0000000..3be3b1e --- /dev/null +++ b/lib/privy/models/solana_system_program_instruction_condition.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaSystemProgramInstructionCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::SolanaSystemProgramInstructionCondition::Field] + required :field, enum: -> { Privy::SolanaSystemProgramInstructionCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::SolanaSystemProgramInstructionCondition::FieldSource] + required :field_source, enum: -> { Privy::SolanaSystemProgramInstructionCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::SolanaSystemProgramInstructionCondition} for more details. + # + # Solana System Program attributes, including more granular Transfer instruction + # fields. + # + # @param field [Symbol, Privy::Models::SolanaSystemProgramInstructionCondition::Field] + # + # @param field_source [Symbol, Privy::Models::SolanaSystemProgramInstructionCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::SolanaSystemProgramInstructionCondition#field + module Field + extend Privy::Internal::Type::Enum + + INSTRUCTION_NAME = :instructionName + TRANSFER_FROM = :"Transfer.from" + TRANSFER_TO = :"Transfer.to" + TRANSFER_LAMPORTS = :"Transfer.lamports" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SolanaSystemProgramInstructionCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + SOLANA_SYSTEM_PROGRAM_INSTRUCTION = :solana_system_program_instruction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_token_program_instruction_condition.rb b/lib/privy/models/solana_token_program_instruction_condition.rb new file mode 100644 index 0000000..4c7816a --- /dev/null +++ b/lib/privy/models/solana_token_program_instruction_condition.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Privy + module Models + class SolanaTokenProgramInstructionCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::SolanaTokenProgramInstructionCondition::Field] + required :field, enum: -> { Privy::SolanaTokenProgramInstructionCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::SolanaTokenProgramInstructionCondition::FieldSource] + required :field_source, enum: -> { Privy::SolanaTokenProgramInstructionCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::SolanaTokenProgramInstructionCondition} for more details. + # + # Solana Token Program attributes, including more granular TransferChecked + # instruction fields. + # + # @param field [Symbol, Privy::Models::SolanaTokenProgramInstructionCondition::Field] + # + # @param field_source [Symbol, Privy::Models::SolanaTokenProgramInstructionCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::SolanaTokenProgramInstructionCondition#field + module Field + extend Privy::Internal::Type::Enum + + INSTRUCTION_NAME = :instructionName + TRANSFER_SOURCE = :"Transfer.source" + TRANSFER_DESTINATION = :"Transfer.destination" + TRANSFER_AUTHORITY = :"Transfer.authority" + TRANSFER_AMOUNT = :"Transfer.amount" + TRANSFER_CHECKED_SOURCE = :"TransferChecked.source" + TRANSFER_CHECKED_DESTINATION = :"TransferChecked.destination" + TRANSFER_CHECKED_AUTHORITY = :"TransferChecked.authority" + TRANSFER_CHECKED_AMOUNT = :"TransferChecked.amount" + TRANSFER_CHECKED_MINT = :"TransferChecked.mint" + BURN_ACCOUNT = :"Burn.account" + BURN_MINT = :"Burn.mint" + BURN_AUTHORITY = :"Burn.authority" + BURN_AMOUNT = :"Burn.amount" + MINT_TO_MINT = :"MintTo.mint" + MINT_TO_ACCOUNT = :"MintTo.account" + MINT_TO_AUTHORITY = :"MintTo.authority" + MINT_TO_AMOUNT = :"MintTo.amount" + CLOSE_ACCOUNT_ACCOUNT = :"CloseAccount.account" + CLOSE_ACCOUNT_DESTINATION = :"CloseAccount.destination" + CLOSE_ACCOUNT_AUTHORITY = :"CloseAccount.authority" + INITIALIZE_ACCOUNT3_ACCOUNT = :"InitializeAccount3.account" + INITIALIZE_ACCOUNT3_MINT = :"InitializeAccount3.mint" + INITIALIZE_ACCOUNT3_OWNER = :"InitializeAccount3.owner" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SolanaTokenProgramInstructionCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + SOLANA_TOKEN_PROGRAM_INSTRUCTION = :solana_token_program_instruction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/solana_wallet_derivation_strategy.rb b/lib/privy/models/solana_wallet_derivation_strategy.rb new file mode 100644 index 0000000..32363e0 --- /dev/null +++ b/lib/privy/models/solana_wallet_derivation_strategy.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The derivation strategy used for Solana wallets. + module SolanaWalletDerivationStrategy + extend Privy::Internal::Type::Enum + + ENTROPY_TO_SEED = :ENTROPY_TO_SEED + ENTROPY_TO_MNEMONIC_TO_SEED = :ENTROPY_TO_MNEMONIC_TO_SEED + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/spark_balance.rb b/lib/privy/models/spark_balance.rb new file mode 100644 index 0000000..9c88605 --- /dev/null +++ b/lib/privy/models/spark_balance.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkBalance < Privy::Internal::Type::BaseModel + # @!attribute balance + # + # @return [String] + required :balance, String + + # @!attribute token_balances + # + # @return [Hash{Symbol=>Privy::Models::SparkTokenBalance}] + required :token_balances, -> { Privy::Internal::Type::HashOf[Privy::SparkTokenBalance] } + + # @!method initialize(balance:, token_balances:) + # The balance of a Spark wallet. + # + # @param balance [String] + # @param token_balances [Hash{Symbol=>Privy::Models::SparkTokenBalance}] + end + end +end diff --git a/lib/privy/models/spark_claim_static_deposit_rpc_input.rb b/lib/privy/models/spark_claim_static_deposit_rpc_input.rb new file mode 100644 index 0000000..36261be --- /dev/null +++ b/lib/privy/models/spark_claim_static_deposit_rpc_input.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkClaimStaticDepositRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkClaimStaticDepositRpcInput::Method] + required :method_, enum: -> { Privy::SparkClaimStaticDepositRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the Spark `claimStaticDeposit` RPC. + # + # @return [Privy::Models::SparkClaimStaticDepositRpcInputParams] + required :params, -> { Privy::SparkClaimStaticDepositRpcInputParams } + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, params:, network: nil) + # Claims a static deposit into the Spark wallet. + # + # @param method_ [Symbol, Privy::Models::SparkClaimStaticDepositRpcInput::Method] + # + # @param params [Privy::Models::SparkClaimStaticDepositRpcInputParams] Parameters for the Spark `claimStaticDeposit` RPC. + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkClaimStaticDepositRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + CLAIM_STATIC_DEPOSIT = :claimStaticDeposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_claim_static_deposit_rpc_input_params.rb b/lib/privy/models/spark_claim_static_deposit_rpc_input_params.rb new file mode 100644 index 0000000..3e9cd10 --- /dev/null +++ b/lib/privy/models/spark_claim_static_deposit_rpc_input_params.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkClaimStaticDepositRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute credit_amount_sats + # + # @return [Float] + required :credit_amount_sats, Float + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute transaction_id + # + # @return [String] + required :transaction_id, String + + # @!attribute output_index + # + # @return [Float, nil] + optional :output_index, Float + + # @!method initialize(credit_amount_sats:, signature:, transaction_id:, output_index: nil) + # Parameters for the Spark `claimStaticDeposit` RPC. + # + # @param credit_amount_sats [Float] + # @param signature [String] + # @param transaction_id [String] + # @param output_index [Float] + end + end +end diff --git a/lib/privy/models/spark_claim_static_deposit_rpc_response.rb b/lib/privy/models/spark_claim_static_deposit_rpc_response.rb new file mode 100644 index 0000000..1ca8cbd --- /dev/null +++ b/lib/privy/models/spark_claim_static_deposit_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkClaimStaticDepositRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkClaimStaticDepositRpcResponse::Method] + required :method_, enum: -> { Privy::SparkClaimStaticDepositRpcResponse::Method }, api_name: :method + + # @!attribute data + # Data returned by the Spark `claimStaticDeposit` RPC. + # + # @return [Privy::Models::SparkClaimStaticDepositRpcResponseData, nil] + optional :data, -> { Privy::SparkClaimStaticDepositRpcResponseData } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `claimStaticDeposit` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkClaimStaticDepositRpcResponse::Method] + # + # @param data [Privy::Models::SparkClaimStaticDepositRpcResponseData] Data returned by the Spark `claimStaticDeposit` RPC. + + # @see Privy::Models::SparkClaimStaticDepositRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + CLAIM_STATIC_DEPOSIT = :claimStaticDeposit + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_claim_static_deposit_rpc_response_data.rb b/lib/privy/models/spark_claim_static_deposit_rpc_response_data.rb new file mode 100644 index 0000000..a1cf8fb --- /dev/null +++ b/lib/privy/models/spark_claim_static_deposit_rpc_response_data.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkClaimStaticDepositRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute transfer_id + # + # @return [String] + required :transfer_id, String + + # @!method initialize(transfer_id:) + # Data returned by the Spark `claimStaticDeposit` RPC. + # + # @param transfer_id [String] + end + end +end diff --git a/lib/privy/models/spark_create_lightning_invoice_rpc_input.rb b/lib/privy/models/spark_create_lightning_invoice_rpc_input.rb new file mode 100644 index 0000000..2f6abc2 --- /dev/null +++ b/lib/privy/models/spark_create_lightning_invoice_rpc_input.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkCreateLightningInvoiceRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkCreateLightningInvoiceRpcInput::Method] + required :method_, enum: -> { Privy::SparkCreateLightningInvoiceRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the Spark `createLightningInvoice` RPC. + # + # @return [Privy::Models::SparkCreateLightningInvoiceRpcInputParams] + required :params, -> { Privy::SparkCreateLightningInvoiceRpcInputParams } + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, params:, network: nil) + # Creates a Lightning invoice for the Spark wallet. + # + # @param method_ [Symbol, Privy::Models::SparkCreateLightningInvoiceRpcInput::Method] + # + # @param params [Privy::Models::SparkCreateLightningInvoiceRpcInputParams] Parameters for the Spark `createLightningInvoice` RPC. + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkCreateLightningInvoiceRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + CREATE_LIGHTNING_INVOICE = :createLightningInvoice + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_create_lightning_invoice_rpc_input_params.rb b/lib/privy/models/spark_create_lightning_invoice_rpc_input_params.rb new file mode 100644 index 0000000..083be30 --- /dev/null +++ b/lib/privy/models/spark_create_lightning_invoice_rpc_input_params.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkCreateLightningInvoiceRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute amount_sats + # + # @return [Float] + required :amount_sats, Float + + # @!attribute description_hash + # + # @return [String, nil] + optional :description_hash, String + + # @!attribute expiry_seconds + # + # @return [Float, nil] + optional :expiry_seconds, Float + + # @!attribute include_spark_address + # + # @return [Boolean, nil] + optional :include_spark_address, Privy::Internal::Type::Boolean + + # @!attribute memo + # + # @return [String, nil] + optional :memo, String + + # @!attribute receiver_identity_pubkey + # + # @return [String, nil] + optional :receiver_identity_pubkey, String + + # @!method initialize(amount_sats:, description_hash: nil, expiry_seconds: nil, include_spark_address: nil, memo: nil, receiver_identity_pubkey: nil) + # Parameters for the Spark `createLightningInvoice` RPC. + # + # @param amount_sats [Float] + # @param description_hash [String] + # @param expiry_seconds [Float] + # @param include_spark_address [Boolean] + # @param memo [String] + # @param receiver_identity_pubkey [String] + end + end +end diff --git a/lib/privy/models/spark_create_lightning_invoice_rpc_response.rb b/lib/privy/models/spark_create_lightning_invoice_rpc_response.rb new file mode 100644 index 0000000..a7462ae --- /dev/null +++ b/lib/privy/models/spark_create_lightning_invoice_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkCreateLightningInvoiceRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkCreateLightningInvoiceRpcResponse::Method] + required :method_, enum: -> { Privy::SparkCreateLightningInvoiceRpcResponse::Method }, api_name: :method + + # @!attribute data + # A Spark Lightning receive request. + # + # @return [Privy::Models::SparkLightningReceiveRequest, nil] + optional :data, -> { Privy::SparkLightningReceiveRequest } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `createLightningInvoice` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkCreateLightningInvoiceRpcResponse::Method] + # + # @param data [Privy::Models::SparkLightningReceiveRequest] A Spark Lightning receive request. + + # @see Privy::Models::SparkCreateLightningInvoiceRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + CREATE_LIGHTNING_INVOICE = :createLightningInvoice + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_get_balance_rpc_input.rb b/lib/privy/models/spark_get_balance_rpc_input.rb new file mode 100644 index 0000000..faf5f07 --- /dev/null +++ b/lib/privy/models/spark_get_balance_rpc_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetBalanceRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkGetBalanceRpcInput::Method] + required :method_, enum: -> { Privy::SparkGetBalanceRpcInput::Method }, api_name: :method + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, network: nil) + # Gets the balance of the Spark wallet. + # + # @param method_ [Symbol, Privy::Models::SparkGetBalanceRpcInput::Method] + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkGetBalanceRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + GET_BALANCE = :getBalance + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_get_balance_rpc_response.rb b/lib/privy/models/spark_get_balance_rpc_response.rb new file mode 100644 index 0000000..a61e9c4 --- /dev/null +++ b/lib/privy/models/spark_get_balance_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetBalanceRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkGetBalanceRpcResponse::Method] + required :method_, enum: -> { Privy::SparkGetBalanceRpcResponse::Method }, api_name: :method + + # @!attribute data + # The balance of a Spark wallet. + # + # @return [Privy::Models::SparkBalance, nil] + optional :data, -> { Privy::SparkBalance } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `getBalance` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkGetBalanceRpcResponse::Method] + # + # @param data [Privy::Models::SparkBalance] The balance of a Spark wallet. + + # @see Privy::Models::SparkGetBalanceRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + GET_BALANCE = :getBalance + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rb b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rb new file mode 100644 index 0000000..ab71573 --- /dev/null +++ b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput::Method] + required :method_, + enum: -> { + Privy::SparkGetClaimStaticDepositQuoteRpcInput::Method + }, + api_name: :method + + # @!attribute params + # Parameters for the Spark `getClaimStaticDepositQuote` RPC. + # + # @return [Privy::Models::SparkGetClaimStaticDepositQuoteRpcInputParams] + required :params, -> { Privy::SparkGetClaimStaticDepositQuoteRpcInputParams } + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, params:, network: nil) + # Gets a quote for claiming a static deposit. + # + # @param method_ [Symbol, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput::Method] + # + # @param params [Privy::Models::SparkGetClaimStaticDepositQuoteRpcInputParams] Parameters for the Spark `getClaimStaticDepositQuote` RPC. + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + GET_CLAIM_STATIC_DEPOSIT_QUOTE = :getClaimStaticDepositQuote + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rb b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rb new file mode 100644 index 0000000..10cdf34 --- /dev/null +++ b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute transaction_id + # + # @return [String] + required :transaction_id, String + + # @!attribute output_index + # + # @return [Float, nil] + optional :output_index, Float + + # @!method initialize(transaction_id:, output_index: nil) + # Parameters for the Spark `getClaimStaticDepositQuote` RPC. + # + # @param transaction_id [String] + # @param output_index [Float] + end + end +end diff --git a/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rb b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rb new file mode 100644 index 0000000..43a4ac0 --- /dev/null +++ b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse::Method] + required :method_, + enum: -> { Privy::SparkGetClaimStaticDepositQuoteRpcResponse::Method }, + api_name: :method + + # @!attribute data + # Data returned by the Spark `getClaimStaticDepositQuote` RPC. + # + # @return [Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponseData, nil] + optional :data, -> { Privy::SparkGetClaimStaticDepositQuoteRpcResponseData } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `getClaimStaticDepositQuote` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse::Method] + # + # @param data [Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponseData] Data returned by the Spark `getClaimStaticDepositQuote` RPC. + + # @see Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + GET_CLAIM_STATIC_DEPOSIT_QUOTE = :getClaimStaticDepositQuote + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rb b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rb new file mode 100644 index 0000000..c71bb8f --- /dev/null +++ b/lib/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute credit_amount_sats + # + # @return [Float] + required :credit_amount_sats, Float + + # @!attribute network + # + # @return [String] + required :network, String + + # @!attribute output_index + # + # @return [Float] + required :output_index, Float + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute transaction_id + # + # @return [String] + required :transaction_id, String + + # @!method initialize(credit_amount_sats:, network:, output_index:, signature:, transaction_id:) + # Data returned by the Spark `getClaimStaticDepositQuote` RPC. + # + # @param credit_amount_sats [Float] + # @param network [String] + # @param output_index [Float] + # @param signature [String] + # @param transaction_id [String] + end + end +end diff --git a/lib/privy/models/spark_get_static_deposit_address_rpc_input.rb b/lib/privy/models/spark_get_static_deposit_address_rpc_input.rb new file mode 100644 index 0000000..1240e21 --- /dev/null +++ b/lib/privy/models/spark_get_static_deposit_address_rpc_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetStaticDepositAddressRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkGetStaticDepositAddressRpcInput::Method] + required :method_, enum: -> { Privy::SparkGetStaticDepositAddressRpcInput::Method }, api_name: :method + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, network: nil) + # Gets a static deposit address for the Spark wallet. + # + # @param method_ [Symbol, Privy::Models::SparkGetStaticDepositAddressRpcInput::Method] + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkGetStaticDepositAddressRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + GET_STATIC_DEPOSIT_ADDRESS = :getStaticDepositAddress + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_get_static_deposit_address_rpc_response.rb b/lib/privy/models/spark_get_static_deposit_address_rpc_response.rb new file mode 100644 index 0000000..3d2bca4 --- /dev/null +++ b/lib/privy/models/spark_get_static_deposit_address_rpc_response.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetStaticDepositAddressRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkGetStaticDepositAddressRpcResponse::Method] + required :method_, + enum: -> { + Privy::SparkGetStaticDepositAddressRpcResponse::Method + }, + api_name: :method + + # @!attribute data + # Data returned by the Spark `getStaticDepositAddress` RPC. + # + # @return [Privy::Models::SparkGetStaticDepositAddressRpcResponseData, nil] + optional :data, -> { Privy::SparkGetStaticDepositAddressRpcResponseData } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `getStaticDepositAddress` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkGetStaticDepositAddressRpcResponse::Method] + # + # @param data [Privy::Models::SparkGetStaticDepositAddressRpcResponseData] Data returned by the Spark `getStaticDepositAddress` RPC. + + # @see Privy::Models::SparkGetStaticDepositAddressRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + GET_STATIC_DEPOSIT_ADDRESS = :getStaticDepositAddress + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_get_static_deposit_address_rpc_response_data.rb b/lib/privy/models/spark_get_static_deposit_address_rpc_response_data.rb new file mode 100644 index 0000000..c80fa1d --- /dev/null +++ b/lib/privy/models/spark_get_static_deposit_address_rpc_response_data.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkGetStaticDepositAddressRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:) + # Data returned by the Spark `getStaticDepositAddress` RPC. + # + # @param address [String] + end + end +end diff --git a/lib/privy/models/spark_lightning_fee.rb b/lib/privy/models/spark_lightning_fee.rb new file mode 100644 index 0000000..e565149 --- /dev/null +++ b/lib/privy/models/spark_lightning_fee.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkLightningFee < Privy::Internal::Type::BaseModel + # @!attribute original_unit + # + # @return [String] + required :original_unit, String + + # @!attribute original_value + # + # @return [Float] + required :original_value, Float + + # @!method initialize(original_unit:, original_value:) + # The fee for a Spark Lightning payment. + # + # @param original_unit [String] + # @param original_value [Float] + end + end +end diff --git a/lib/privy/models/spark_lightning_receive_request.rb b/lib/privy/models/spark_lightning_receive_request.rb new file mode 100644 index 0000000..f399cdc --- /dev/null +++ b/lib/privy/models/spark_lightning_receive_request.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkLightningReceiveRequest < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [String] + required :created_at, String + + # @!attribute network + # + # @return [String] + required :network, String + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute typename + # + # @return [String] + required :typename, String + + # @!attribute updated_at + # + # @return [String] + required :updated_at, String + + # @!attribute invoice + # + # @return [Object, nil] + optional :invoice, Privy::Internal::Type::Unknown + + # @!attribute payment_preimage + # + # @return [String, nil] + optional :payment_preimage, String + + # @!attribute receiver_identity_public_key + # + # @return [String, nil] + optional :receiver_identity_public_key, String + + # @!attribute transfer + # + # @return [Object, nil] + optional :transfer, Privy::Internal::Type::Unknown + + # @!method initialize(id:, created_at:, network:, status:, typename:, updated_at:, invoice: nil, payment_preimage: nil, receiver_identity_public_key: nil, transfer: nil) + # A Spark Lightning receive request. + # + # @param id [String] + # @param created_at [String] + # @param network [String] + # @param status [String] + # @param typename [String] + # @param updated_at [String] + # @param invoice [Object] + # @param payment_preimage [String] + # @param receiver_identity_public_key [String] + # @param transfer [Object] + end + end +end diff --git a/lib/privy/models/spark_lightning_send_request.rb b/lib/privy/models/spark_lightning_send_request.rb new file mode 100644 index 0000000..9201d55 --- /dev/null +++ b/lib/privy/models/spark_lightning_send_request.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkLightningSendRequest < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [String] + required :created_at, String + + # @!attribute encoded_invoice + # + # @return [String] + required :encoded_invoice, String + + # @!attribute fee + # The fee for a Spark Lightning payment. + # + # @return [Privy::Models::SparkLightningFee] + required :fee, -> { Privy::SparkLightningFee } + + # @!attribute idempotency_key + # + # @return [String] + required :idempotency_key, String + + # @!attribute network + # + # @return [String] + required :network, String + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute typename + # + # @return [String] + required :typename, String + + # @!attribute updated_at + # + # @return [String] + required :updated_at, String + + # @!attribute payment_preimage + # + # @return [String, nil] + optional :payment_preimage, String + + # @!attribute transfer + # + # @return [Object, nil] + optional :transfer, Privy::Internal::Type::Unknown + + # @!method initialize(id:, created_at:, encoded_invoice:, fee:, idempotency_key:, network:, status:, typename:, updated_at:, payment_preimage: nil, transfer: nil) + # A Spark Lightning send request. + # + # @param id [String] + # + # @param created_at [String] + # + # @param encoded_invoice [String] + # + # @param fee [Privy::Models::SparkLightningFee] The fee for a Spark Lightning payment. + # + # @param idempotency_key [String] + # + # @param network [String] + # + # @param status [String] + # + # @param typename [String] + # + # @param updated_at [String] + # + # @param payment_preimage [String] + # + # @param transfer [Object] + end + end +end diff --git a/lib/privy/models/spark_network.rb b/lib/privy/models/spark_network.rb new file mode 100644 index 0000000..b5b8763 --- /dev/null +++ b/lib/privy/models/spark_network.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The Spark network. + module SparkNetwork + extend Privy::Internal::Type::Enum + + MAINNET = :MAINNET + REGTEST = :REGTEST + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/spark_output_selection_strategy.rb b/lib/privy/models/spark_output_selection_strategy.rb new file mode 100644 index 0000000..8969993 --- /dev/null +++ b/lib/privy/models/spark_output_selection_strategy.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # Strategy for selecting outputs in a Spark token transfer. + module SparkOutputSelectionStrategy + extend Privy::Internal::Type::Enum + + SMALL_FIRST = :SMALL_FIRST + LARGE_FIRST = :LARGE_FIRST + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/spark_pay_lightning_invoice_rpc_input.rb b/lib/privy/models/spark_pay_lightning_invoice_rpc_input.rb new file mode 100644 index 0000000..541db4f --- /dev/null +++ b/lib/privy/models/spark_pay_lightning_invoice_rpc_input.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkPayLightningInvoiceRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkPayLightningInvoiceRpcInput::Method] + required :method_, enum: -> { Privy::SparkPayLightningInvoiceRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the Spark `payLightningInvoice` RPC. + # + # @return [Privy::Models::SparkPayLightningInvoiceRpcInputParams] + required :params, -> { Privy::SparkPayLightningInvoiceRpcInputParams } + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, params:, network: nil) + # Pays a Lightning invoice from the Spark wallet. + # + # @param method_ [Symbol, Privy::Models::SparkPayLightningInvoiceRpcInput::Method] + # + # @param params [Privy::Models::SparkPayLightningInvoiceRpcInputParams] Parameters for the Spark `payLightningInvoice` RPC. + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkPayLightningInvoiceRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + PAY_LIGHTNING_INVOICE = :payLightningInvoice + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_pay_lightning_invoice_rpc_input_params.rb b/lib/privy/models/spark_pay_lightning_invoice_rpc_input_params.rb new file mode 100644 index 0000000..005f1f1 --- /dev/null +++ b/lib/privy/models/spark_pay_lightning_invoice_rpc_input_params.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkPayLightningInvoiceRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute invoice + # + # @return [String] + required :invoice, String + + # @!attribute max_fee_sats + # + # @return [Float] + required :max_fee_sats, Float + + # @!attribute amount_sats_to_send + # + # @return [Float, nil] + optional :amount_sats_to_send, Float + + # @!attribute prefer_spark + # + # @return [Boolean, nil] + optional :prefer_spark, Privy::Internal::Type::Boolean + + # @!method initialize(invoice:, max_fee_sats:, amount_sats_to_send: nil, prefer_spark: nil) + # Parameters for the Spark `payLightningInvoice` RPC. + # + # @param invoice [String] + # @param max_fee_sats [Float] + # @param amount_sats_to_send [Float] + # @param prefer_spark [Boolean] + end + end +end diff --git a/lib/privy/models/spark_pay_lightning_invoice_rpc_response.rb b/lib/privy/models/spark_pay_lightning_invoice_rpc_response.rb new file mode 100644 index 0000000..a0d64ec --- /dev/null +++ b/lib/privy/models/spark_pay_lightning_invoice_rpc_response.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkPayLightningInvoiceRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkPayLightningInvoiceRpcResponse::Method] + required :method_, enum: -> { Privy::SparkPayLightningInvoiceRpcResponse::Method }, api_name: :method + + # @!attribute data + # A Spark transfer. + # + # @return [Privy::Models::SparkTransfer, Privy::Models::SparkLightningSendRequest, nil] + optional :data, union: -> { Privy::SparkPayLightningInvoiceRpcResponse::Data } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `payLightningInvoice` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkPayLightningInvoiceRpcResponse::Method] + # + # @param data [Privy::Models::SparkTransfer, Privy::Models::SparkLightningSendRequest] A Spark transfer. + + # @see Privy::Models::SparkPayLightningInvoiceRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + PAY_LIGHTNING_INVOICE = :payLightningInvoice + + # @!method self.values + # @return [Array] + end + + # A Spark transfer. + # + # @see Privy::Models::SparkPayLightningInvoiceRpcResponse#data + module Data + extend Privy::Internal::Type::Union + + # A Spark transfer. + variant -> { Privy::SparkTransfer } + + # A Spark Lightning send request. + variant -> { Privy::SparkLightningSendRequest } + + # @!method self.variants + # @return [Array(Privy::Models::SparkTransfer, Privy::Models::SparkLightningSendRequest)] + end + end + end +end diff --git a/lib/privy/models/spark_rpc_input.rb b/lib/privy/models/spark_rpc_input.rb new file mode 100644 index 0000000..72aea8b --- /dev/null +++ b/lib/privy/models/spark_rpc_input.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + # Request body for Spark wallet RPC operations, discriminated by method. + module SparkRpcInput + extend Privy::Internal::Type::Union + + discriminator :method + + # Transfers satoshis to a Spark address. + variant :transfer, -> { Privy::SparkTransferRpcInput } + + # Gets the balance of the Spark wallet. + variant :getBalance, -> { Privy::SparkGetBalanceRpcInput } + + # Transfers tokens to a Spark address. + variant :transferTokens, -> { Privy::SparkTransferTokensRpcInput } + + # Gets a static deposit address for the Spark wallet. + variant :getStaticDepositAddress, -> { Privy::SparkGetStaticDepositAddressRpcInput } + + # Gets a quote for claiming a static deposit. + variant :getClaimStaticDepositQuote, -> { Privy::SparkGetClaimStaticDepositQuoteRpcInput } + + # Claims a static deposit into the Spark wallet. + variant :claimStaticDeposit, -> { Privy::SparkClaimStaticDepositRpcInput } + + # Creates a Lightning invoice for the Spark wallet. + variant :createLightningInvoice, -> { Privy::SparkCreateLightningInvoiceRpcInput } + + # Pays a Lightning invoice from the Spark wallet. + variant :payLightningInvoice, -> { Privy::SparkPayLightningInvoiceRpcInput } + + # Signs a message with the Spark identity key. + variant :signMessageWithIdentityKey, -> { Privy::SparkSignMessageWithIdentityKeyRpcInput } + + # @!method self.variants + # @return [Array(Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput)] + end + end +end diff --git a/lib/privy/models/spark_rpc_response.rb b/lib/privy/models/spark_rpc_response.rb new file mode 100644 index 0000000..fcf14bc --- /dev/null +++ b/lib/privy/models/spark_rpc_response.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + # Response body for Spark wallet RPC operations, discriminated by method. + module SparkRpcResponse + extend Privy::Internal::Type::Union + + discriminator :method + + # Response to the Spark `transfer` RPC. + variant :transfer, -> { Privy::SparkTransferRpcResponse } + + # Response to the Spark `getBalance` RPC. + variant :getBalance, -> { Privy::SparkGetBalanceRpcResponse } + + # Response to the Spark `transferTokens` RPC. + variant :transferTokens, -> { Privy::SparkTransferTokensRpcResponse } + + # Response to the Spark `getStaticDepositAddress` RPC. + variant :getStaticDepositAddress, -> { Privy::SparkGetStaticDepositAddressRpcResponse } + + # Response to the Spark `getClaimStaticDepositQuote` RPC. + variant :getClaimStaticDepositQuote, -> { Privy::SparkGetClaimStaticDepositQuoteRpcResponse } + + # Response to the Spark `claimStaticDeposit` RPC. + variant :claimStaticDeposit, -> { Privy::SparkClaimStaticDepositRpcResponse } + + # Response to the Spark `createLightningInvoice` RPC. + variant :createLightningInvoice, -> { Privy::SparkCreateLightningInvoiceRpcResponse } + + # Response to the Spark `payLightningInvoice` RPC. + variant :payLightningInvoice, -> { Privy::SparkPayLightningInvoiceRpcResponse } + + # Response to the Spark `signMessageWithIdentityKey` RPC. + variant :signMessageWithIdentityKey, -> { Privy::SparkSignMessageWithIdentityKeyRpcResponse } + + # @!method self.variants + # @return [Array(Privy::Models::SparkTransferRpcResponse, Privy::Models::SparkGetBalanceRpcResponse, Privy::Models::SparkTransferTokensRpcResponse, Privy::Models::SparkGetStaticDepositAddressRpcResponse, Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse, Privy::Models::SparkClaimStaticDepositRpcResponse, Privy::Models::SparkCreateLightningInvoiceRpcResponse, Privy::Models::SparkPayLightningInvoiceRpcResponse, Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse)] + end + end +end diff --git a/lib/privy/models/spark_sign_message_with_identity_key_rpc_input.rb b/lib/privy/models/spark_sign_message_with_identity_key_rpc_input.rb new file mode 100644 index 0000000..79e746b --- /dev/null +++ b/lib/privy/models/spark_sign_message_with_identity_key_rpc_input.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput::Method] + required :method_, + enum: -> { + Privy::SparkSignMessageWithIdentityKeyRpcInput::Method + }, + api_name: :method + + # @!attribute params + # Parameters for the Spark `signMessageWithIdentityKey` RPC. + # + # @return [Privy::Models::SparkSignMessageWithIdentityKeyRpcInputParams] + required :params, -> { Privy::SparkSignMessageWithIdentityKeyRpcInputParams } + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, params:, network: nil) + # Signs a message with the Spark identity key. + # + # @param method_ [Symbol, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput::Method] + # + # @param params [Privy::Models::SparkSignMessageWithIdentityKeyRpcInputParams] Parameters for the Spark `signMessageWithIdentityKey` RPC. + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkSignMessageWithIdentityKeyRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE_WITH_IDENTITY_KEY = :signMessageWithIdentityKey + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rb b/lib/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rb new file mode 100644 index 0000000..a01ec84 --- /dev/null +++ b/lib/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!attribute compact + # + # @return [Boolean, nil] + optional :compact, Privy::Internal::Type::Boolean + + # @!method initialize(message:, compact: nil) + # Parameters for the Spark `signMessageWithIdentityKey` RPC. + # + # @param message [String] + # @param compact [Boolean] + end + end +end diff --git a/lib/privy/models/spark_sign_message_with_identity_key_rpc_response.rb b/lib/privy/models/spark_sign_message_with_identity_key_rpc_response.rb new file mode 100644 index 0000000..fe94d30 --- /dev/null +++ b/lib/privy/models/spark_sign_message_with_identity_key_rpc_response.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse::Method] + required :method_, + enum: -> { Privy::SparkSignMessageWithIdentityKeyRpcResponse::Method }, + api_name: :method + + # @!attribute data + # Data returned by the Spark `signMessageWithIdentityKey` RPC. + # + # @return [Privy::Models::SparkSignMessageWithIdentityKeyRpcResponseData, nil] + optional :data, -> { Privy::SparkSignMessageWithIdentityKeyRpcResponseData } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `signMessageWithIdentityKey` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse::Method] + # + # @param data [Privy::Models::SparkSignMessageWithIdentityKeyRpcResponseData] Data returned by the Spark `signMessageWithIdentityKey` RPC. + + # @see Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE_WITH_IDENTITY_KEY = :signMessageWithIdentityKey + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rb b/lib/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rb new file mode 100644 index 0000000..8bf0fc7 --- /dev/null +++ b/lib/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!method initialize(signature:) + # Data returned by the Spark `signMessageWithIdentityKey` RPC. + # + # @param signature [String] + end + end +end diff --git a/lib/privy/models/spark_signing_keyshare.rb b/lib/privy/models/spark_signing_keyshare.rb new file mode 100644 index 0000000..2f14244 --- /dev/null +++ b/lib/privy/models/spark_signing_keyshare.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkSigningKeyshare < Privy::Internal::Type::BaseModel + # @!attribute owner_identifiers + # + # @return [Array] + required :owner_identifiers, Privy::Internal::Type::ArrayOf[String] + + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute public_shares + # + # @return [Hash{Symbol=>String}] + required :public_shares, Privy::Internal::Type::HashOf[String] + + # @!attribute threshold + # + # @return [Float] + required :threshold, Float + + # @!attribute updated_time + # + # @return [String] + required :updated_time, String + + # @!method initialize(owner_identifiers:, public_key:, public_shares:, threshold:, updated_time:) + # A Spark signing keyshare. + # + # @param owner_identifiers [Array] + # @param public_key [String] + # @param public_shares [Hash{Symbol=>String}] + # @param threshold [Float] + # @param updated_time [String] + end + end +end diff --git a/lib/privy/models/spark_token_balance.rb b/lib/privy/models/spark_token_balance.rb new file mode 100644 index 0000000..1100740 --- /dev/null +++ b/lib/privy/models/spark_token_balance.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTokenBalance < Privy::Internal::Type::BaseModel + # @!attribute balance + # + # @return [String] + required :balance, String + + # @!attribute token_metadata + # Metadata for a Spark user token. + # + # @return [Privy::Models::SparkUserTokenMetadata] + required :token_metadata, -> { Privy::SparkUserTokenMetadata } + + # @!method initialize(balance:, token_metadata:) + # Balance of a Spark token. + # + # @param balance [String] + # + # @param token_metadata [Privy::Models::SparkUserTokenMetadata] Metadata for a Spark user token. + end + end +end diff --git a/lib/privy/models/spark_transfer.rb b/lib/privy/models/spark_transfer.rb new file mode 100644 index 0000000..3c63b13 --- /dev/null +++ b/lib/privy/models/spark_transfer.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransfer < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute leaves + # + # @return [Array] + required :leaves, -> { Privy::Internal::Type::ArrayOf[Privy::SparkTransferLeaf] } + + # @!attribute receiver_identity_public_key + # + # @return [String] + required :receiver_identity_public_key, String + + # @!attribute sender_identity_public_key + # + # @return [String] + required :sender_identity_public_key, String + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute total_value + # + # @return [Float] + required :total_value, Float + + # @!attribute transfer_direction + # + # @return [String] + required :transfer_direction, String + + # @!attribute type + # + # @return [String] + required :type, String + + # @!attribute created_time + # + # @return [String, nil] + optional :created_time, String + + # @!attribute expiry_time + # + # @return [String, nil] + optional :expiry_time, String + + # @!attribute updated_time + # + # @return [String, nil] + optional :updated_time, String + + # @!method initialize(id:, leaves:, receiver_identity_public_key:, sender_identity_public_key:, status:, total_value:, transfer_direction:, type:, created_time: nil, expiry_time: nil, updated_time: nil) + # A Spark transfer. + # + # @param id [String] + # @param leaves [Array] + # @param receiver_identity_public_key [String] + # @param sender_identity_public_key [String] + # @param status [String] + # @param total_value [Float] + # @param transfer_direction [String] + # @param type [String] + # @param created_time [String] + # @param expiry_time [String] + # @param updated_time [String] + end + end +end diff --git a/lib/privy/models/spark_transfer_leaf.rb b/lib/privy/models/spark_transfer_leaf.rb new file mode 100644 index 0000000..8b47486 --- /dev/null +++ b/lib/privy/models/spark_transfer_leaf.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferLeaf < Privy::Internal::Type::BaseModel + # @!attribute intermediate_refund_tx + # + # @return [String] + required :intermediate_refund_tx, String + + # @!attribute secret_cipher + # + # @return [String] + required :secret_cipher, String + + # @!attribute signature + # + # @return [String] + required :signature, String + + # @!attribute leaf + # A Spark wallet leaf node. + # + # @return [Privy::Models::SparkWalletLeaf, nil] + optional :leaf, -> { Privy::SparkWalletLeaf } + + # @!method initialize(intermediate_refund_tx:, secret_cipher:, signature:, leaf: nil) + # A Spark transfer leaf. + # + # @param intermediate_refund_tx [String] + # + # @param secret_cipher [String] + # + # @param signature [String] + # + # @param leaf [Privy::Models::SparkWalletLeaf] A Spark wallet leaf node. + end + end +end diff --git a/lib/privy/models/spark_transfer_rpc_input.rb b/lib/privy/models/spark_transfer_rpc_input.rb new file mode 100644 index 0000000..1a194a3 --- /dev/null +++ b/lib/privy/models/spark_transfer_rpc_input.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkTransferRpcInput::Method] + required :method_, enum: -> { Privy::SparkTransferRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the Spark `transfer` RPC. + # + # @return [Privy::Models::SparkTransferRpcInputParams] + required :params, -> { Privy::SparkTransferRpcInputParams } + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, params:, network: nil) + # Transfers satoshis to a Spark address. + # + # @param method_ [Symbol, Privy::Models::SparkTransferRpcInput::Method] + # + # @param params [Privy::Models::SparkTransferRpcInputParams] Parameters for the Spark `transfer` RPC. + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkTransferRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + TRANSFER = :transfer + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_transfer_rpc_input_params.rb b/lib/privy/models/spark_transfer_rpc_input_params.rb new file mode 100644 index 0000000..b3b712b --- /dev/null +++ b/lib/privy/models/spark_transfer_rpc_input_params.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute amount_sats + # + # @return [Float] + required :amount_sats, Float + + # @!attribute receiver_spark_address + # + # @return [String] + required :receiver_spark_address, String + + # @!method initialize(amount_sats:, receiver_spark_address:) + # Parameters for the Spark `transfer` RPC. + # + # @param amount_sats [Float] + # @param receiver_spark_address [String] + end + end +end diff --git a/lib/privy/models/spark_transfer_rpc_response.rb b/lib/privy/models/spark_transfer_rpc_response.rb new file mode 100644 index 0000000..4dd8289 --- /dev/null +++ b/lib/privy/models/spark_transfer_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkTransferRpcResponse::Method] + required :method_, enum: -> { Privy::SparkTransferRpcResponse::Method }, api_name: :method + + # @!attribute data + # A Spark transfer. + # + # @return [Privy::Models::SparkTransfer, nil] + optional :data, -> { Privy::SparkTransfer } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `transfer` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkTransferRpcResponse::Method] + # + # @param data [Privy::Models::SparkTransfer] A Spark transfer. + + # @see Privy::Models::SparkTransferRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + TRANSFER = :transfer + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_transfer_tokens_rpc_input.rb b/lib/privy/models/spark_transfer_tokens_rpc_input.rb new file mode 100644 index 0000000..30c9afc --- /dev/null +++ b/lib/privy/models/spark_transfer_tokens_rpc_input.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferTokensRpcInput < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkTransferTokensRpcInput::Method] + required :method_, enum: -> { Privy::SparkTransferTokensRpcInput::Method }, api_name: :method + + # @!attribute params + # Parameters for the Spark `transferTokens` RPC. + # + # @return [Privy::Models::SparkTransferTokensRpcInputParams] + required :params, -> { Privy::SparkTransferTokensRpcInputParams } + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork, nil] + optional :network, enum: -> { Privy::SparkNetwork } + + # @!method initialize(method_:, params:, network: nil) + # Transfers tokens to a Spark address. + # + # @param method_ [Symbol, Privy::Models::SparkTransferTokensRpcInput::Method] + # + # @param params [Privy::Models::SparkTransferTokensRpcInputParams] Parameters for the Spark `transferTokens` RPC. + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + + # @see Privy::Models::SparkTransferTokensRpcInput#method_ + module Method + extend Privy::Internal::Type::Enum + + TRANSFER_TOKENS = :transferTokens + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_transfer_tokens_rpc_input_params.rb b/lib/privy/models/spark_transfer_tokens_rpc_input_params.rb new file mode 100644 index 0000000..cb585f7 --- /dev/null +++ b/lib/privy/models/spark_transfer_tokens_rpc_input_params.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferTokensRpcInputParams < Privy::Internal::Type::BaseModel + # @!attribute receiver_spark_address + # + # @return [String] + required :receiver_spark_address, String + + # @!attribute token_amount + # + # @return [Float] + required :token_amount, Float + + # @!attribute token_identifier + # + # @return [String] + required :token_identifier, String + + # @!attribute output_selection_strategy + # Strategy for selecting outputs in a Spark token transfer. + # + # @return [Symbol, Privy::Models::SparkOutputSelectionStrategy, nil] + optional :output_selection_strategy, enum: -> { Privy::SparkOutputSelectionStrategy } + + # @!attribute selected_outputs + # + # @return [Array, nil] + optional :selected_outputs, + -> { Privy::Internal::Type::ArrayOf[Privy::OutputWithPreviousTransactionData] } + + # @!method initialize(receiver_spark_address:, token_amount:, token_identifier:, output_selection_strategy: nil, selected_outputs: nil) + # Parameters for the Spark `transferTokens` RPC. + # + # @param receiver_spark_address [String] + # + # @param token_amount [Float] + # + # @param token_identifier [String] + # + # @param output_selection_strategy [Symbol, Privy::Models::SparkOutputSelectionStrategy] Strategy for selecting outputs in a Spark token transfer. + # + # @param selected_outputs [Array] + end + end +end diff --git a/lib/privy/models/spark_transfer_tokens_rpc_response.rb b/lib/privy/models/spark_transfer_tokens_rpc_response.rb new file mode 100644 index 0000000..f434ab3 --- /dev/null +++ b/lib/privy/models/spark_transfer_tokens_rpc_response.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferTokensRpcResponse < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [Symbol, Privy::Models::SparkTransferTokensRpcResponse::Method] + required :method_, enum: -> { Privy::SparkTransferTokensRpcResponse::Method }, api_name: :method + + # @!attribute data + # Data returned by the Spark `transferTokens` RPC. + # + # @return [Privy::Models::SparkTransferTokensRpcResponseData, nil] + optional :data, -> { Privy::SparkTransferTokensRpcResponseData } + + # @!method initialize(method_:, data: nil) + # Response to the Spark `transferTokens` RPC. + # + # @param method_ [Symbol, Privy::Models::SparkTransferTokensRpcResponse::Method] + # + # @param data [Privy::Models::SparkTransferTokensRpcResponseData] Data returned by the Spark `transferTokens` RPC. + + # @see Privy::Models::SparkTransferTokensRpcResponse#method_ + module Method + extend Privy::Internal::Type::Enum + + TRANSFER_TOKENS = :transferTokens + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/spark_transfer_tokens_rpc_response_data.rb b/lib/privy/models/spark_transfer_tokens_rpc_response_data.rb new file mode 100644 index 0000000..7c3deb6 --- /dev/null +++ b/lib/privy/models/spark_transfer_tokens_rpc_response_data.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkTransferTokensRpcResponseData < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # Data returned by the Spark `transferTokens` RPC. + # + # @param id [String] + end + end +end diff --git a/lib/privy/models/spark_user_token_metadata.rb b/lib/privy/models/spark_user_token_metadata.rb new file mode 100644 index 0000000..4e3ba92 --- /dev/null +++ b/lib/privy/models/spark_user_token_metadata.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkUserTokenMetadata < Privy::Internal::Type::BaseModel + # @!attribute decimals + # + # @return [Float] + required :decimals, Float + + # @!attribute max_supply + # + # @return [String] + required :max_supply, String + + # @!attribute raw_token_identifier + # + # @return [String] + required :raw_token_identifier, String + + # @!attribute token_name + # + # @return [String] + required :token_name, String + + # @!attribute token_public_key + # + # @return [String] + required :token_public_key, String + + # @!attribute token_ticker + # + # @return [String] + required :token_ticker, String + + # @!method initialize(decimals:, max_supply:, raw_token_identifier:, token_name:, token_public_key:, token_ticker:) + # Metadata for a Spark user token. + # + # @param decimals [Float] + # @param max_supply [String] + # @param raw_token_identifier [String] + # @param token_name [String] + # @param token_public_key [String] + # @param token_ticker [String] + end + end +end diff --git a/lib/privy/models/spark_wallet_leaf.rb b/lib/privy/models/spark_wallet_leaf.rb new file mode 100644 index 0000000..f62aa62 --- /dev/null +++ b/lib/privy/models/spark_wallet_leaf.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Privy + module Models + class SparkWalletLeaf < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute network + # The Spark network. + # + # @return [Symbol, Privy::Models::SparkNetwork] + required :network, enum: -> { Privy::SparkNetwork } + + # @!attribute node_tx + # + # @return [String] + required :node_tx, String + + # @!attribute owner_identity_public_key + # + # @return [String] + required :owner_identity_public_key, String + + # @!attribute refund_tx + # + # @return [String] + required :refund_tx, String + + # @!attribute status + # + # @return [String] + required :status, String + + # @!attribute tree_id + # + # @return [String] + required :tree_id, String + + # @!attribute value + # + # @return [Float] + required :value, Float + + # @!attribute verifying_public_key + # + # @return [String] + required :verifying_public_key, String + + # @!attribute vout + # + # @return [Float] + required :vout, Float + + # @!attribute parent_node_id + # + # @return [String, nil] + optional :parent_node_id, String + + # @!attribute signing_keyshare + # A Spark signing keyshare. + # + # @return [Privy::Models::SparkSigningKeyshare, nil] + optional :signing_keyshare, -> { Privy::SparkSigningKeyshare } + + # @!method initialize(id:, network:, node_tx:, owner_identity_public_key:, refund_tx:, status:, tree_id:, value:, verifying_public_key:, vout:, parent_node_id: nil, signing_keyshare: nil) + # A Spark wallet leaf node. + # + # @param id [String] + # + # @param network [Symbol, Privy::Models::SparkNetwork] The Spark network. + # + # @param node_tx [String] + # + # @param owner_identity_public_key [String] + # + # @param refund_tx [String] + # + # @param status [String] + # + # @param tree_id [String] + # + # @param value [Float] + # + # @param verifying_public_key [String] + # + # @param vout [Float] + # + # @param parent_node_id [String] + # + # @param signing_keyshare [Privy::Models::SparkSigningKeyshare] A Spark signing keyshare. + end + end +end diff --git a/lib/privy/models/success_response.rb b/lib/privy/models/success_response.rb new file mode 100644 index 0000000..3239285 --- /dev/null +++ b/lib/privy/models/success_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class SuccessResponse < Privy::Internal::Type::BaseModel + # @!attribute success + # + # @return [Boolean] + required :success, Privy::Internal::Type::Boolean + + # @!method initialize(success:) + # A simple success response. + # + # @param success [Boolean] + end + end +end diff --git a/lib/privy/models/sui_command_name.rb b/lib/privy/models/sui_command_name.rb new file mode 100644 index 0000000..9a1b3bb --- /dev/null +++ b/lib/privy/models/sui_command_name.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # SUI transaction commands allowlist for raw_sign endpoint policy evaluation + module SuiCommandName + extend Privy::Internal::Type::Enum + + TRANSFER_OBJECTS = :TransferObjects + SPLIT_COINS = :SplitCoins + MERGE_COINS = :MergeCoins + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/sui_transaction_command_condition.rb b/lib/privy/models/sui_transaction_command_condition.rb new file mode 100644 index 0000000..0125ae3 --- /dev/null +++ b/lib/privy/models/sui_transaction_command_condition.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Privy + module Models + class SuiTransactionCommandCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::SuiTransactionCommandCondition::Field] + required :field, enum: -> { Privy::SuiTransactionCommandCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::SuiTransactionCommandCondition::FieldSource] + required :field_source, enum: -> { Privy::SuiTransactionCommandCondition::FieldSource } + + # @!attribute operator + # Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are + # supported for command names. + # + # @return [Symbol, Privy::Models::SuiTransactionCommandOperator] + required :operator, enum: -> { Privy::SuiTransactionCommandOperator } + + # @!attribute value + # Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins', + # 'MergeCoins' + # + # @return [Symbol, Privy::Models::SuiCommandName, Array] + required :value, union: -> { Privy::SuiTransactionCommandCondition::Value } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::SuiTransactionCommandCondition} for more details. + # + # SUI transaction command attributes, enables allowlisting specific command types. + # Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and + # 'in' operators are supported. + # + # @param field [Symbol, Privy::Models::SuiTransactionCommandCondition::Field] + # + # @param field_source [Symbol, Privy::Models::SuiTransactionCommandCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::SuiTransactionCommandOperator] Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are s + # + # @param value [Symbol, Privy::Models::SuiCommandName, Array] Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins', 'Merg + + # @see Privy::Models::SuiTransactionCommandCondition#field + module Field + extend Privy::Internal::Type::Enum + + COMMAND_NAME = :commandName + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SuiTransactionCommandCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + SUI_TRANSACTION_COMMAND = :sui_transaction_command + + # @!method self.values + # @return [Array] + end + + # Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins', + # 'MergeCoins' + # + # @see Privy::Models::SuiTransactionCommandCondition#value + module Value + extend Privy::Internal::Type::Union + + # SUI transaction commands allowlist for raw_sign endpoint policy evaluation + variant enum: -> { Privy::SuiCommandName } + + variant -> { Privy::Models::SuiTransactionCommandCondition::Value::SuiCommandNameArray } + + # @!method self.variants + # @return [Array(Symbol, Privy::Models::SuiCommandName, Array)] + + # @type [Privy::Internal::Type::Converter] + SuiCommandNameArray = Privy::Internal::Type::ArrayOf[enum: -> { Privy::SuiCommandName }] + end + end + end +end diff --git a/lib/privy/models/sui_transaction_command_operator.rb b/lib/privy/models/sui_transaction_command_operator.rb new file mode 100644 index 0000000..74305ef --- /dev/null +++ b/lib/privy/models/sui_transaction_command_operator.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are + # supported for command names. + module SuiTransactionCommandOperator + extend Privy::Internal::Type::Enum + + EQ = :eq + IN = :in + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/sui_transfer_objects_command_condition.rb b/lib/privy/models/sui_transfer_objects_command_condition.rb new file mode 100644 index 0000000..018455d --- /dev/null +++ b/lib/privy/models/sui_transfer_objects_command_condition.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Privy + module Models + class SuiTransferObjectsCommandCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # Supported fields for SUI TransferObjects command conditions. Only 'recipient' + # and 'amount' are supported. + # + # @return [Symbol, Privy::Models::SuiTransferObjectsCommandField] + required :field, enum: -> { Privy::SuiTransferObjectsCommandField } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::SuiTransferObjectsCommandCondition::FieldSource] + required :field_source, enum: -> { Privy::SuiTransferObjectsCommandCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::SuiTransferObjectsCommandCondition} for more details. + # + # SUI TransferObjects command attributes, including recipient and amount fields. + # + # @param field [Symbol, Privy::Models::SuiTransferObjectsCommandField] Supported fields for SUI TransferObjects command conditions. Only 'recipient' an + # + # @param field_source [Symbol, Privy::Models::SuiTransferObjectsCommandCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::SuiTransferObjectsCommandCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + SUI_TRANSFER_OBJECTS_COMMAND = :sui_transfer_objects_command + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/sui_transfer_objects_command_field.rb b/lib/privy/models/sui_transfer_objects_command_field.rb new file mode 100644 index 0000000..3a3d21e --- /dev/null +++ b/lib/privy/models/sui_transfer_objects_command_field.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # Supported fields for SUI TransferObjects command conditions. Only 'recipient' + # and 'amount' are supported. + module SuiTransferObjectsCommandField + extend Privy::Internal::Type::Enum + + RECIPIENT = :recipient + AMOUNT = :amount + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/svm_transaction_wallet_action_step.rb b/lib/privy/models/svm_transaction_wallet_action_step.rb new file mode 100644 index 0000000..98b7eb7 --- /dev/null +++ b/lib/privy/models/svm_transaction_wallet_action_step.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Privy + module Models + class SvmTransactionWalletActionStep < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # CAIP-2 chain identifier for the Solana network. + # + # @return [String] + required :caip2, String + + # @!attribute status + # Status of an SVM step in a wallet action. + # + # @return [Symbol, Privy::Models::SvmWalletActionStepStatus] + required :status, enum: -> { Privy::SvmWalletActionStepStatus } + + # @!attribute transaction_signature + # The Solana transaction signature (base58-encoded). Null until broadcast. + # + # @return [String, nil] + required :transaction_signature, String, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::SvmTransactionWalletActionStep::Type] + required :type, enum: -> { Privy::SvmTransactionWalletActionStep::Type } + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!method initialize(caip2:, status:, transaction_signature:, type:, failure_reason: nil) + # A wallet action step consisting of an SVM (Solana) transaction. + # + # @param caip2 [String] CAIP-2 chain identifier for the Solana network. + # + # @param status [Symbol, Privy::Models::SvmWalletActionStepStatus] Status of an SVM step in a wallet action. + # + # @param transaction_signature [String, nil] The Solana transaction signature (base58-encoded). Null until broadcast. + # + # @param type [Symbol, Privy::Models::SvmTransactionWalletActionStep::Type] + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + + # @see Privy::Models::SvmTransactionWalletActionStep#type + module Type + extend Privy::Internal::Type::Enum + + SVM_TRANSACTION = :svm_transaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/svm_wallet_action_step_status.rb b/lib/privy/models/svm_wallet_action_step_status.rb new file mode 100644 index 0000000..defc161 --- /dev/null +++ b/lib/privy/models/svm_wallet_action_step_status.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # Status of an SVM step in a wallet action. + module SvmWalletActionStepStatus + extend Privy::Internal::Type::Enum + + PREPARING = :preparing + QUEUED = :queued + PENDING = :pending + CONFIRMED = :confirmed + FINALIZED = :finalized + REJECTED = :rejected + REVERTED = :reverted + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/swap_action_response.rb b/lib/privy/models/swap_action_response.rb new file mode 100644 index 0000000..e1cb0c7 --- /dev/null +++ b/lib/privy/models/swap_action_response.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module Privy + module Models + class SwapActionResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # The ID of the wallet action. + # + # @return [String] + required :id, String + + # @!attribute caip2 + # CAIP-2 chain identifier for the swap. + # + # @return [String] + required :caip2, String + + # @!attribute created_at + # ISO 8601 timestamp of when the wallet action was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute input_amount + # Exact base-unit amount of input token. Populated after on-chain confirmation. + # + # @return [String, nil] + required :input_amount, String, nil?: true + + # @!attribute input_token + # Token address or "native" for the token being sold. + # + # @return [String] + required :input_token, String + + # @!attribute output_amount + # Exact base-unit amount of output token. Populated after on-chain confirmation. + # + # @return [String, nil] + required :output_amount, String, nil?: true + + # @!attribute output_token + # Token address or "native" for the token being bought. + # + # @return [String] + required :output_token, String + + # @!attribute status + # Status of a wallet action. + # + # @return [Symbol, Privy::Models::WalletActionStatus] + required :status, enum: -> { Privy::WalletActionStatus } + + # @!attribute type + # + # @return [Symbol, Privy::Models::SwapActionResponse::Type] + required :type, enum: -> { Privy::SwapActionResponse::Type } + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!attribute steps + # The steps of the wallet action. Only returned if `?include=steps` is provided. + # + # @return [Array, nil] + optional :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!method initialize(id:, caip2:, created_at:, input_amount:, input_token:, output_amount:, output_token:, status:, type:, wallet_id:, failure_reason: nil, steps: nil) + # Response for a swap action. + # + # @param id [String] The ID of the wallet action. + # + # @param caip2 [String] CAIP-2 chain identifier for the swap. + # + # @param created_at [Time] ISO 8601 timestamp of when the wallet action was created. + # + # @param input_amount [String, nil] Exact base-unit amount of input token. Populated after on-chain confirmation. + # + # @param input_token [String] Token address or "native" for the token being sold. + # + # @param output_amount [String, nil] Exact base-unit amount of output token. Populated after on-chain confirmation. + # + # @param output_token [String] Token address or "native" for the token being bought. + # + # @param status [Symbol, Privy::Models::WalletActionStatus] Status of a wallet action. + # + # @param type [Symbol, Privy::Models::SwapActionResponse::Type] + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param steps [Array] The steps of the wallet action. Only returned if `?include=steps` is provided. + + # @see Privy::Models::SwapActionResponse#type + module Type + extend Privy::Internal::Type::Enum + + SWAP = :swap + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/swap_destination.rb b/lib/privy/models/swap_destination.rb new file mode 100644 index 0000000..85a541d --- /dev/null +++ b/lib/privy/models/swap_destination.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + class SwapDestination < Privy::Internal::Type::BaseModel + # @!attribute asset_address + # Token contract address to buy, or "native" for the chain's native token. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier for the destination. Must match source chain — + # cross-chain swaps are not yet supported. Defaults to source chain if omitted. + # + # @return [String, nil] + optional :caip2, String + + # @!method initialize(asset_address:, caip2: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::SwapDestination} for more details. + # + # The output side of a swap execution request. + # + # @param asset_address [String] Token contract address to buy, or "native" for the chain's native token. + # + # @param caip2 [String] CAIP-2 chain identifier for the destination. Must match source chain — cross-cha + end + end +end diff --git a/lib/privy/models/swap_quote_destination.rb b/lib/privy/models/swap_quote_destination.rb new file mode 100644 index 0000000..88e788d --- /dev/null +++ b/lib/privy/models/swap_quote_destination.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + class SwapQuoteDestination < Privy::Internal::Type::BaseModel + # @!attribute asset_address + # Token contract address to buy, or "native" for the chain's native token. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier for the destination. Must match source chain — + # cross-chain swaps are not yet supported. Defaults to source chain if omitted. + # + # @return [String, nil] + optional :caip2, String + + # @!method initialize(asset_address:, caip2: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::SwapQuoteDestination} for more details. + # + # The output side of a swap quote request. + # + # @param asset_address [String] Token contract address to buy, or "native" for the chain's native token. + # + # @param caip2 [String] CAIP-2 chain identifier for the destination. Must match source chain — cross-cha + end + end +end diff --git a/lib/privy/models/swap_quote_request_body.rb b/lib/privy/models/swap_quote_request_body.rb new file mode 100644 index 0000000..91fd354 --- /dev/null +++ b/lib/privy/models/swap_quote_request_body.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Privy + module Models + class SwapQuoteRequestBody < Privy::Internal::Type::BaseModel + # @!attribute base_amount + # Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + # + # @return [String] + required :base_amount, String + + # @!attribute destination + # The output side of a swap quote request. + # + # @return [Privy::Models::SwapQuoteDestination] + required :destination, -> { Privy::SwapQuoteDestination } + + # @!attribute source + # The input side of a swap request, including token and chain. + # + # @return [Privy::Models::SwapSource] + required :source, -> { Privy::SwapSource } + + # @!attribute amount_type + # Whether the amount refers to the input token or output token. + # + # @return [Symbol, Privy::Models::AmountType, nil] + optional :amount_type, enum: -> { Privy::AmountType } + + # @!attribute slippage_bps + # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, + # auto-slippage is used. + # + # @return [Float, nil] + optional :slippage_bps, Float + + # @!method initialize(base_amount:, destination:, source:, amount_type: nil, slippage_bps: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::SwapQuoteRequestBody} for more details. + # + # Input for requesting a token swap quote. + # + # @param base_amount [String] Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + # + # @param destination [Privy::Models::SwapQuoteDestination] The output side of a swap quote request. + # + # @param source [Privy::Models::SwapSource] The input side of a swap request, including token and chain. + # + # @param amount_type [Symbol, Privy::Models::AmountType] Whether the amount refers to the input token or output token. + # + # @param slippage_bps [Float] Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, auto + end + end +end diff --git a/lib/privy/models/swap_quote_response.rb b/lib/privy/models/swap_quote_response.rb new file mode 100644 index 0000000..8ced491 --- /dev/null +++ b/lib/privy/models/swap_quote_response.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +module Privy + module Models + class SwapQuoteResponse < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # Chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute est_output_amount + # Estimated amount of output token in base units. + # + # @return [String] + required :est_output_amount, String + + # @!attribute gas_estimate + # Estimated gas cost in base units of the native token. + # + # @return [String] + required :gas_estimate, String + + # @!attribute input_amount + # Amount of input token in base units. + # + # @return [String] + required :input_amount, String + + # @!attribute input_token + # Token address being sold. + # + # @return [String] + required :input_token, String + + # @!attribute minimum_output_amount + # Minimum output amount accounting for slippage, in base units. + # + # @return [String] + required :minimum_output_amount, String + + # @!attribute output_token + # Token address being bought. + # + # @return [String] + required :output_token, String + + # @!method initialize(caip2:, est_output_amount:, gas_estimate:, input_amount:, input_token:, minimum_output_amount:, output_token:) + # Pricing data for a token swap. + # + # @param caip2 [String] Chain identifier. + # + # @param est_output_amount [String] Estimated amount of output token in base units. + # + # @param gas_estimate [String] Estimated gas cost in base units of the native token. + # + # @param input_amount [String] Amount of input token in base units. + # + # @param input_token [String] Token address being sold. + # + # @param minimum_output_amount [String] Minimum output amount accounting for slippage, in base units. + # + # @param output_token [String] Token address being bought. + end + end +end diff --git a/lib/privy/models/swap_request_body.rb b/lib/privy/models/swap_request_body.rb new file mode 100644 index 0000000..23c0c03 --- /dev/null +++ b/lib/privy/models/swap_request_body.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Privy + module Models + class SwapRequestBody < Privy::Internal::Type::BaseModel + # @!attribute base_amount + # Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + # + # @return [String] + required :base_amount, String + + # @!attribute destination + # The output side of a swap execution request. + # + # @return [Privy::Models::SwapDestination] + required :destination, -> { Privy::SwapDestination } + + # @!attribute source + # The input side of a swap request, including token and chain. + # + # @return [Privy::Models::SwapSource] + required :source, -> { Privy::SwapSource } + + # @!attribute amount_type + # Whether the amount refers to the input token or output token. + # + # @return [Symbol, Privy::Models::AmountType, nil] + optional :amount_type, enum: -> { Privy::AmountType } + + # @!attribute slippage_bps + # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). + # + # @return [Float, nil] + optional :slippage_bps, Float + + # @!method initialize(base_amount:, destination:, source:, amount_type: nil, slippage_bps: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::SwapRequestBody} for more details. + # + # Input for executing a token swap. + # + # @param base_amount [String] Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + # + # @param destination [Privy::Models::SwapDestination] The output side of a swap execution request. + # + # @param source [Privy::Models::SwapSource] The input side of a swap request, including token and chain. + # + # @param amount_type [Symbol, Privy::Models::AmountType] Whether the amount refers to the input token or output token. + # + # @param slippage_bps [Float] Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). + end + end +end diff --git a/lib/privy/models/swap_source.rb b/lib/privy/models/swap_source.rb new file mode 100644 index 0000000..e371884 --- /dev/null +++ b/lib/privy/models/swap_source.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class SwapSource < Privy::Internal::Type::BaseModel + # @!attribute asset_address + # Token contract address to sell, or "native" for the chain's native token. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier (e.g., "eip155:1"). + # + # @return [String] + required :caip2, String + + # @!method initialize(asset_address:, caip2:) + # The input side of a swap request, including token and chain. + # + # @param asset_address [String] Token contract address to sell, or "native" for the chain's native token. + # + # @param caip2 [String] CAIP-2 chain identifier (e.g., "eip155:1"). + end + end +end diff --git a/lib/privy/models/system_condition.rb b/lib/privy/models/system_condition.rb new file mode 100644 index 0000000..c4d0ac9 --- /dev/null +++ b/lib/privy/models/system_condition.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + class SystemCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # + # @return [Symbol, Privy::Models::SystemCondition::Field] + required :field, enum: -> { Privy::SystemCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::SystemCondition::FieldSource] + required :field_source, enum: -> { Privy::SystemCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::SystemCondition} for more details. + # + # System attributes, including current unix timestamp (in seconds). + # + # @param field [Symbol, Privy::Models::SystemCondition::Field] + # + # @param field_source [Symbol, Privy::Models::SystemCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::SystemCondition#field + module Field + extend Privy::Internal::Type::Enum + + CURRENT_UNIX_TIMESTAMP = :current_unix_timestamp + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::SystemCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + SYSTEM = :system + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/telegram_auth_config_schema.rb b/lib/privy/models/telegram_auth_config_schema.rb new file mode 100644 index 0000000..574a121 --- /dev/null +++ b/lib/privy/models/telegram_auth_config_schema.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramAuthConfigSchema < Privy::Internal::Type::BaseModel + # @!attribute bot_id + # + # @return [String] + required :bot_id, String + + # @!attribute bot_name + # + # @return [String] + required :bot_name, String + + # @!attribute link_enabled + # + # @return [Boolean] + required :link_enabled, Privy::Internal::Type::Boolean + + # @!attribute seamless_auth_enabled + # + # @return [Boolean] + required :seamless_auth_enabled, Privy::Internal::Type::Boolean + + # @!method initialize(bot_id:, bot_name:, link_enabled:, seamless_auth_enabled:) + # Configuration for Telegram authentication. + # + # @param bot_id [String] + # @param bot_name [String] + # @param link_enabled [Boolean] + # @param seamless_auth_enabled [Boolean] + end + end +end diff --git a/lib/privy/models/telegram_auth_result.rb b/lib/privy/models/telegram_auth_result.rb new file mode 100644 index 0000000..b47377d --- /dev/null +++ b/lib/privy/models/telegram_auth_result.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramAuthResult < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [Float, nil] + required :id, Float, nil?: true + + # @!attribute auth_date + # + # @return [Float, nil] + required :auth_date, Float, nil?: true + + # @!attribute first_name + # + # @return [String] + required :first_name, String + + # @!attribute hash_ + # + # @return [String] + required :hash_, String, api_name: :hash + + # @!attribute last_name + # + # @return [String, nil] + optional :last_name, String + + # @!attribute photo_url + # + # @return [String, nil] + optional :photo_url, String + + # @!attribute username + # + # @return [String, nil] + optional :username, String + + # @!method initialize(id:, auth_date:, first_name:, hash_:, last_name: nil, photo_url: nil, username: nil) + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + # + # @param id [Float, nil] + # @param auth_date [Float, nil] + # @param first_name [String] + # @param hash_ [String] + # @param last_name [String] + # @param photo_url [String] + # @param username [String] + end + end +end diff --git a/lib/privy/models/telegram_authenticate_input.rb b/lib/privy/models/telegram_authenticate_input.rb new file mode 100644 index 0000000..334fa93 --- /dev/null +++ b/lib/privy/models/telegram_authenticate_input.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramAuthenticateInput < Privy::Internal::Type::BaseModel + # @!attribute captcha_token + # + # @return [String, nil] + optional :captcha_token, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!attribute telegram_auth_result + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + # + # @return [Privy::Models::TelegramAuthResult, nil] + optional :telegram_auth_result, -> { Privy::TelegramAuthResult } + + # @!attribute telegram_web_app_data + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + # + # @return [Privy::Models::TelegramWebAppData, nil] + optional :telegram_web_app_data, -> { Privy::TelegramWebAppData } + + # @!method initialize(captcha_token: nil, mode: nil, telegram_auth_result: nil, telegram_web_app_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TelegramAuthenticateInput} for more details. + # + # Input for authenticating with Telegram. + # + # @param captcha_token [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + # + # @param telegram_auth_result [Privy::Models::TelegramAuthResult] Auth result object returned by Telegram when a user authenticates using the logi + # + # @param telegram_web_app_data [Privy::Models::TelegramWebAppData] Auth result object returned by Telegram when a user authenticates using a mini a + end + end +end diff --git a/lib/privy/models/telegram_authenticate_request_body.rb b/lib/privy/models/telegram_authenticate_request_body.rb new file mode 100644 index 0000000..c325a42 --- /dev/null +++ b/lib/privy/models/telegram_authenticate_request_body.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute captcha_token + # + # @return [String, nil] + optional :captcha_token, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!attribute telegram_auth_result + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + # + # @return [Privy::Models::TelegramAuthResult, nil] + optional :telegram_auth_result, -> { Privy::TelegramAuthResult } + + # @!attribute telegram_web_app_data + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + # + # @return [Privy::Models::TelegramWebAppData, nil] + optional :telegram_web_app_data, -> { Privy::TelegramWebAppData } + + # @!method initialize(captcha_token: nil, mode: nil, telegram_auth_result: nil, telegram_web_app_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TelegramAuthenticateRequestBody} for more details. + # + # The request body for authenticating with Telegram. + # + # @param captcha_token [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + # + # @param telegram_auth_result [Privy::Models::TelegramAuthResult] Auth result object returned by Telegram when a user authenticates using the logi + # + # @param telegram_web_app_data [Privy::Models::TelegramWebAppData] Auth result object returned by Telegram when a user authenticates using a mini a + end + end +end diff --git a/lib/privy/models/telegram_link_request_body.rb b/lib/privy/models/telegram_link_request_body.rb new file mode 100644 index 0000000..439b1f3 --- /dev/null +++ b/lib/privy/models/telegram_link_request_body.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramLinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute captcha_token + # + # @return [String, nil] + optional :captcha_token, String + + # @!attribute mode + # Whether to allow sign-up during authentication. + # + # @return [Symbol, Privy::Models::AuthenticateModeOption, nil] + optional :mode, enum: -> { Privy::AuthenticateModeOption } + + # @!attribute telegram_auth_result + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + # + # @return [Privy::Models::TelegramAuthResult, nil] + optional :telegram_auth_result, -> { Privy::TelegramAuthResult } + + # @!attribute telegram_web_app_data + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + # + # @return [Privy::Models::TelegramWebAppData, nil] + optional :telegram_web_app_data, -> { Privy::TelegramWebAppData } + + # @!method initialize(captcha_token: nil, mode: nil, telegram_auth_result: nil, telegram_web_app_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TelegramLinkRequestBody} for more details. + # + # The request body for linking a Telegram account. + # + # @param captcha_token [String] + # + # @param mode [Symbol, Privy::Models::AuthenticateModeOption] Whether to allow sign-up during authentication. + # + # @param telegram_auth_result [Privy::Models::TelegramAuthResult] Auth result object returned by Telegram when a user authenticates using the logi + # + # @param telegram_web_app_data [Privy::Models::TelegramWebAppData] Auth result object returned by Telegram when a user authenticates using a mini a + end + end +end diff --git a/lib/privy/models/telegram_unlink_input.rb b/lib/privy/models/telegram_unlink_input.rb new file mode 100644 index 0000000..e981a6e --- /dev/null +++ b/lib/privy/models/telegram_unlink_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramUnlinkInput < Privy::Internal::Type::BaseModel + # @!attribute telegram_user_id + # + # @return [String] + required :telegram_user_id, String + + # @!method initialize(telegram_user_id:) + # Input for unlinking a Telegram account. + # + # @param telegram_user_id [String] + end + end +end diff --git a/lib/privy/models/telegram_unlink_request_body.rb b/lib/privy/models/telegram_unlink_request_body.rb new file mode 100644 index 0000000..2dbf2a4 --- /dev/null +++ b/lib/privy/models/telegram_unlink_request_body.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramUnlinkRequestBody < Privy::Internal::Type::BaseModel + # @!attribute telegram_user_id + # + # @return [String] + required :telegram_user_id, String + + # @!method initialize(telegram_user_id:) + # The request body for unlinking a Telegram account. + # + # @param telegram_user_id [String] + end + end +end diff --git a/lib/privy/models/telegram_web_app_data.rb b/lib/privy/models/telegram_web_app_data.rb new file mode 100644 index 0000000..d3f6bc9 --- /dev/null +++ b/lib/privy/models/telegram_web_app_data.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +module Privy + module Models + class TelegramWebAppData < Privy::Internal::Type::BaseModel + # @!attribute auth_date + # + # @return [Float, nil] + required :auth_date, Float, nil?: true + + # @!attribute hash_ + # + # @return [String] + required :hash_, String, api_name: :hash + + # @!attribute user + # + # @return [String] + required :user, String + + # @!attribute chat_instance + # + # @return [String, nil] + optional :chat_instance, String + + # @!attribute chat_type + # + # @return [String, nil] + optional :chat_type, String + + # @!attribute query_id + # + # @return [String, nil] + optional :query_id, String + + # @!attribute signature + # + # @return [String, nil] + optional :signature, String + + # @!attribute start_param + # + # @return [String, nil] + optional :start_param, String + + # @!method initialize(auth_date:, hash_:, user:, chat_instance: nil, chat_type: nil, query_id: nil, signature: nil, start_param: nil) + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + # + # @param auth_date [Float, nil] + # @param hash_ [String] + # @param user [String] + # @param chat_instance [String] + # @param chat_type [String] + # @param query_id [String] + # @param signature [String] + # @param start_param [String] + end + end +end diff --git a/lib/privy/models/tempo_aa_authorization.rb b/lib/privy/models/tempo_aa_authorization.rb new file mode 100644 index 0000000..e3e3c3e --- /dev/null +++ b/lib/privy/models/tempo_aa_authorization.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class TempoAaAuthorization < Privy::Internal::Type::BaseModel + # @!attribute chain_id + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer] + required :chain_id, union: -> { Privy::Quantity } + + # @!attribute contract + # + # @return [String] + required :contract, String + + # @!attribute nonce + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer] + required :nonce, union: -> { Privy::Quantity } + + # @!attribute signature + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :signature, String + + # @!method initialize(chain_id:, contract:, nonce:, signature:) + # Some parameter documentations has been truncated, see + # {Privy::Models::TempoAaAuthorization} for more details. + # + # An AA authorization for Tempo transactions with P256/WebAuthn signatures. + # + # @param chain_id [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param contract [String] + # + # @param nonce [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param signature [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + end + end +end diff --git a/lib/privy/models/tempo_call.rb b/lib/privy/models/tempo_call.rb new file mode 100644 index 0000000..bdab30f --- /dev/null +++ b/lib/privy/models/tempo_call.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Privy + module Models + class TempoCall < Privy::Internal::Type::BaseModel + # @!attribute to + # + # @return [String] + required :to, String + + # @!attribute data + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :data, String + + # @!attribute value + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :value, union: -> { Privy::Quantity } + + # @!method initialize(to:, data: nil, value: nil) + # Some parameter documentations has been truncated, see {Privy::Models::TempoCall} + # for more details. + # + # A single call within a Tempo batched transaction. + # + # @param to [String] + # + # @param data [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param value [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + end + end +end diff --git a/lib/privy/models/tempo_fee_payer_signature.rb b/lib/privy/models/tempo_fee_payer_signature.rb new file mode 100644 index 0000000..97a47a1 --- /dev/null +++ b/lib/privy/models/tempo_fee_payer_signature.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + class TempoFeePayerSignature < Privy::Internal::Type::BaseModel + # @!attribute r + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :r, String + + # @!attribute s + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :s, String + + # @!attribute y_parity + # + # @return [Float, Privy::Models::TempoFeePayerSignature::YParity] + required :y_parity, enum: -> { Privy::TempoFeePayerSignature::YParity } + + # @!method initialize(r:, s:, y_parity:) + # Some parameter documentations has been truncated, see + # {Privy::Models::TempoFeePayerSignature} for more details. + # + # A fee payer signature for sponsored Tempo transactions (secp256k1 only). + # + # @param r [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param s [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param y_parity [Float, Privy::Models::TempoFeePayerSignature::YParity] + + # @see Privy::Models::TempoFeePayerSignature#y_parity + module YParity + extend Privy::Internal::Type::Enum + + Y_PARITY_0 = 0 + Y_PARITY_1 = 1 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/test_account.rb b/lib/privy/models/test_account.rb new file mode 100644 index 0000000..14dbebd --- /dev/null +++ b/lib/privy/models/test_account.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class TestAccount < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # + # @return [String] + required :created_at, String + + # @!attribute email + # + # @return [String] + required :email, String + + # @!attribute otp_code + # + # @return [String] + required :otp_code, String + + # @!attribute phone_number + # + # @return [String] + required :phone_number, String + + # @!attribute updated_at + # + # @return [String] + required :updated_at, String + + # @!method initialize(id:, created_at:, email:, otp_code:, phone_number:, updated_at:) + # A test account for an app. + # + # @param id [String] + # @param created_at [String] + # @param email [String] + # @param otp_code [String] + # @param phone_number [String] + # @param updated_at [String] + end + end +end diff --git a/lib/privy/models/test_accounts_response.rb b/lib/privy/models/test_accounts_response.rb new file mode 100644 index 0000000..df0ac7b --- /dev/null +++ b/lib/privy/models/test_accounts_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Apps#get_test_credentials + class TestAccountsResponse < Privy::Internal::Type::BaseModel + # @!attribute data + # + # @return [Array] + required :data, -> { Privy::Internal::Type::ArrayOf[Privy::TestAccount] } + + # @!method initialize(data:) + # Response for listing test accounts for an app. + # + # @param data [Array] + end + end +end diff --git a/lib/privy/models/token_output.rb b/lib/privy/models/token_output.rb new file mode 100644 index 0000000..a5bd883 --- /dev/null +++ b/lib/privy/models/token_output.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +module Privy + module Models + class TokenOutput < Privy::Internal::Type::BaseModel + # @!attribute owner_public_key + # + # @return [String] + required :owner_public_key, String + + # @!attribute token_amount + # + # @return [String] + required :token_amount, String + + # @!attribute id + # + # @return [String, nil] + optional :id, String + + # @!attribute revocation_commitment + # + # @return [String, nil] + optional :revocation_commitment, String + + # @!attribute token_identifier + # + # @return [String, nil] + optional :token_identifier, String + + # @!attribute token_public_key + # + # @return [String, nil] + optional :token_public_key, String + + # @!attribute withdraw_bond_sats + # + # @return [Float, nil] + optional :withdraw_bond_sats, Float + + # @!attribute withdraw_relative_block_locktime + # + # @return [Float, nil] + optional :withdraw_relative_block_locktime, Float + + # @!method initialize(owner_public_key:, token_amount:, id: nil, revocation_commitment: nil, token_identifier: nil, token_public_key: nil, withdraw_bond_sats: nil, withdraw_relative_block_locktime: nil) + # A Spark token output. + # + # @param owner_public_key [String] + # @param token_amount [String] + # @param id [String] + # @param revocation_commitment [String] + # @param token_identifier [String] + # @param token_public_key [String] + # @param withdraw_bond_sats [Float] + # @param withdraw_relative_block_locktime [Float] + end + end +end diff --git a/lib/privy/models/token_transfer_destination.rb b/lib/privy/models/token_transfer_destination.rb new file mode 100644 index 0000000..44a4f35 --- /dev/null +++ b/lib/privy/models/token_transfer_destination.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Models + class TokenTransferDestination < Privy::Internal::Type::BaseModel + # @!attribute address + # Recipient address (hex for EVM, base58 for Solana) + # + # @return [String] + required :address, String + + # @!attribute asset + # The destination asset. Required for cross-asset transfers (e.g., source 'usdt' + # to destination 'usdc'). + # + # @return [String, nil] + optional :asset, String + + # @!attribute chain + # The destination blockchain network. Required for cross-chain transfers (e.g., + # source 'base' to destination 'arbitrum'). + # + # @return [String, nil] + optional :chain, String + + # @!method initialize(address:, asset: nil, chain: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TokenTransferDestination} for more details. + # + # The destination address for a token transfer. Optionally specify a different + # asset or chain for cross-asset or cross-chain transfers. + # + # @param address [String] Recipient address (hex for EVM, base58 for Solana) + # + # @param asset [String] The destination asset. Required for cross-asset transfers (e.g., source 'usdt' t + # + # @param chain [String] The destination blockchain network. Required for cross-chain transfers (e.g., so + end + end +end diff --git a/lib/privy/models/token_transfer_source.rb b/lib/privy/models/token_transfer_source.rb new file mode 100644 index 0000000..e442d52 --- /dev/null +++ b/lib/privy/models/token_transfer_source.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # The source asset, amount, and chain for a token transfer. Specify either `asset` + # (named) or `asset_address` (custom), not both. + module TokenTransferSource + extend Privy::Internal::Type::Union + + # Source for a transfer identified by a named asset (e.g. "usdc", "eth"). Use this variant for first-class assets maintained by Privy. + variant -> { Privy::NamedTokenTransferSource } + + # Source for a transfer identified by a token contract address (EVM) or mint address (Solana). Use this variant for tokens that are not first-class assets. + variant -> { Privy::CustomTokenTransferSource } + + # @!method self.variants + # @return [Array(Privy::Models::NamedTokenTransferSource, Privy::Models::CustomTokenTransferSource)] + end + end +end diff --git a/lib/privy/models/totp_mfa_method.rb b/lib/privy/models/totp_mfa_method.rb new file mode 100644 index 0000000..e3fc306 --- /dev/null +++ b/lib/privy/models/totp_mfa_method.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class TotpMfaMethod < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::TotpMfaMethod::Type] + required :type, enum: -> { Privy::TotpMfaMethod::Type } + + # @!attribute verified_at + # + # @return [Float] + required :verified_at, Float + + # @!method initialize(type:, verified_at:) + # A TOTP MFA method. + # + # @param type [Symbol, Privy::Models::TotpMfaMethod::Type] + # @param verified_at [Float] + + # @see Privy::Models::TotpMfaMethod#type + module Type + extend Privy::Internal::Type::Enum + + TOTP = :totp + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction.rb b/lib/privy/models/transaction.rb new file mode 100644 index 0000000..771e879 --- /dev/null +++ b/lib/privy/models/transaction.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Transactions#get + class Transaction < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute caip2 + # + # @return [String] + required :caip2, String + + # @!attribute created_at + # + # @return [Float] + required :created_at, Float + + # @!attribute status + # + # @return [Symbol, Privy::Models::Transaction::Status] + required :status, enum: -> { Privy::Transaction::Status } + + # @!attribute transaction_hash + # + # @return [String, nil] + required :transaction_hash, String, nil?: true + + # @!attribute wallet_id + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!attribute sponsored + # + # @return [Boolean, nil] + optional :sponsored, Privy::Internal::Type::Boolean + + # @!attribute user_operation_hash + # + # @return [String, nil] + optional :user_operation_hash, String + + # @!method initialize(id:, caip2:, created_at:, status:, transaction_hash:, wallet_id:, reference_id: nil, sponsored: nil, user_operation_hash: nil) + # A transaction from a Privy wallet. + # + # @param id [String] + # @param caip2 [String] + # @param created_at [Float] + # @param status [Symbol, Privy::Models::Transaction::Status] + # @param transaction_hash [String, nil] + # @param wallet_id [String] + # @param reference_id [String, nil] + # @param sponsored [Boolean] + # @param user_operation_hash [String] + + # @see Privy::Models::Transaction#status + module Status + extend Privy::Internal::Type::Enum + + BROADCASTED = :broadcasted + CONFIRMED = :confirmed + EXECUTION_REVERTED = :execution_reverted + FAILED = :failed + REPLACED = :replaced + FINALIZED = :finalized + PROVIDER_ERROR = :provider_error + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_broadcasted_webhook_payload.rb b/lib/privy/models/transaction_broadcasted_webhook_payload.rb new file mode 100644 index 0000000..04a6fc1 --- /dev/null +++ b/lib/privy/models/transaction_broadcasted_webhook_payload.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionBroadcastedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute transaction_id + # The Privy-assigned ID for this transaction. + # + # @return [String] + required :transaction_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::TransactionBroadcastedWebhookPayload::Type] + required :type, enum: -> { Privy::TransactionBroadcastedWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet that initiated the transaction. + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(caip2:, transaction_hash:, transaction_id:, type:, wallet_id:, reference_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransactionBroadcastedWebhookPayload} for more details. + # + # Payload for the transaction.broadcasted webhook event. + # + # @param caip2 [String] The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param transaction_id [String] The Privy-assigned ID for this transaction. + # + # @param type [Symbol, Privy::Models::TransactionBroadcastedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet that initiated the transaction. + # + # @param reference_id [String, nil] Developer-provided reference ID for transaction reconciliation, if one was provi + + # The type of webhook event. + # + # @see Privy::Models::TransactionBroadcastedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_BROADCASTED = :"transaction.broadcasted" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_confirmed_webhook_payload.rb b/lib/privy/models/transaction_confirmed_webhook_payload.rb new file mode 100644 index 0000000..78edd5e --- /dev/null +++ b/lib/privy/models/transaction_confirmed_webhook_payload.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute transaction_id + # The Privy-assigned ID for this transaction. + # + # @return [String] + required :transaction_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::TransactionConfirmedWebhookPayload::Type] + required :type, enum: -> { Privy::TransactionConfirmedWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet that initiated the transaction. + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(caip2:, transaction_hash:, transaction_id:, type:, wallet_id:, reference_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransactionConfirmedWebhookPayload} for more details. + # + # Payload for the transaction.confirmed webhook event. + # + # @param caip2 [String] The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param transaction_id [String] The Privy-assigned ID for this transaction. + # + # @param type [Symbol, Privy::Models::TransactionConfirmedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet that initiated the transaction. + # + # @param reference_id [String, nil] Developer-provided reference ID for transaction reconciliation, if one was provi + + # The type of webhook event. + # + # @see Privy::Models::TransactionConfirmedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_CONFIRMED = :"transaction.confirmed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_detail.rb b/lib/privy/models/transaction_detail.rb new file mode 100644 index 0000000..fa0995b --- /dev/null +++ b/lib/privy/models/transaction_detail.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # Details of a wallet transaction, varying by transaction type. + module TransactionDetail + extend Privy::Internal::Type::Union + + discriminator :type + + # Details for a sent transfer transaction. + variant :transfer_sent, -> { Privy::TransferSentTransactionDetail } + + # Details for a received transfer transaction. + variant :transfer_received, -> { Privy::TransferReceivedTransactionDetail } + + # @!method self.variants + # @return [Array(Privy::Models::TransferSentTransactionDetail, Privy::Models::TransferReceivedTransactionDetail)] + end + end +end diff --git a/lib/privy/models/transaction_execution_reverted_webhook_payload.rb b/lib/privy/models/transaction_execution_reverted_webhook_payload.rb new file mode 100644 index 0000000..c9209d7 --- /dev/null +++ b/lib/privy/models/transaction_execution_reverted_webhook_payload.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionExecutionRevertedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute transaction_id + # The Privy-assigned ID for this transaction. + # + # @return [String] + required :transaction_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::TransactionExecutionRevertedWebhookPayload::Type] + required :type, enum: -> { Privy::TransactionExecutionRevertedWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet that initiated the transaction. + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(caip2:, transaction_hash:, transaction_id:, type:, wallet_id:, reference_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransactionExecutionRevertedWebhookPayload} for more details. + # + # Payload for the transaction.execution_reverted webhook event. + # + # @param caip2 [String] The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param transaction_id [String] The Privy-assigned ID for this transaction. + # + # @param type [Symbol, Privy::Models::TransactionExecutionRevertedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet that initiated the transaction. + # + # @param reference_id [String, nil] Developer-provided reference ID for transaction reconciliation, if one was provi + + # The type of webhook event. + # + # @see Privy::Models::TransactionExecutionRevertedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_EXECUTION_REVERTED = :"transaction.execution_reverted" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_failed_webhook_payload.rb b/lib/privy/models/transaction_failed_webhook_payload.rb new file mode 100644 index 0000000..1d700c6 --- /dev/null +++ b/lib/privy/models/transaction_failed_webhook_payload.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute transaction_id + # The Privy-assigned ID for this transaction. + # + # @return [String] + required :transaction_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::TransactionFailedWebhookPayload::Type] + required :type, enum: -> { Privy::TransactionFailedWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet that initiated the transaction. + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(caip2:, transaction_hash:, transaction_id:, type:, wallet_id:, reference_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransactionFailedWebhookPayload} for more details. + # + # Payload for the transaction.failed webhook event. + # + # @param caip2 [String] The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param transaction_id [String] The Privy-assigned ID for this transaction. + # + # @param type [Symbol, Privy::Models::TransactionFailedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet that initiated the transaction. + # + # @param reference_id [String, nil] Developer-provided reference ID for transaction reconciliation, if one was provi + + # The type of webhook event. + # + # @see Privy::Models::TransactionFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_FAILED = :"transaction.failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_get_params.rb b/lib/privy/models/transaction_get_params.rb new file mode 100644 index 0000000..c3796c8 --- /dev/null +++ b/lib/privy/models/transaction_get_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Transactions#get + class TransactionGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute transaction_id + # ID of the transaction. + # + # @return [String] + required :transaction_id, String + + # @!method initialize(transaction_id:, request_options: {}) + # @param transaction_id [String] ID of the transaction. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/transaction_list.rb b/lib/privy/models/transaction_list.rb new file mode 100644 index 0000000..6373321 --- /dev/null +++ b/lib/privy/models/transaction_list.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionList < Privy::Internal::Type::BaseModel + # @!attribute transactions + # + # @return [Array] + required :transactions, -> { Privy::Internal::Type::ArrayOf[Privy::Transaction] } + + # @!method initialize(transactions:) + # A list of transactions. + # + # @param transactions [Array] + end + end +end diff --git a/lib/privy/models/transaction_provider_error_webhook_payload.rb b/lib/privy/models/transaction_provider_error_webhook_payload.rb new file mode 100644 index 0000000..7c8505d --- /dev/null +++ b/lib/privy/models/transaction_provider_error_webhook_payload.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionProviderErrorWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute transaction_id + # The Privy-assigned ID for this transaction. + # + # @return [String] + required :transaction_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::TransactionProviderErrorWebhookPayload::Type] + required :type, enum: -> { Privy::TransactionProviderErrorWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet that initiated the transaction. + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(caip2:, transaction_hash:, transaction_id:, type:, wallet_id:, reference_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransactionProviderErrorWebhookPayload} for more details. + # + # Payload for the transaction.provider_error webhook event. + # + # @param caip2 [String] The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param transaction_id [String] The Privy-assigned ID for this transaction. + # + # @param type [Symbol, Privy::Models::TransactionProviderErrorWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet that initiated the transaction. + # + # @param reference_id [String, nil] Developer-provided reference ID for transaction reconciliation, if one was provi + + # The type of webhook event. + # + # @see Privy::Models::TransactionProviderErrorWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_PROVIDER_ERROR = :"transaction.provider_error" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_replaced_webhook_payload.rb b/lib/privy/models/transaction_replaced_webhook_payload.rb new file mode 100644 index 0000000..eb94f15 --- /dev/null +++ b/lib/privy/models/transaction_replaced_webhook_payload.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionReplacedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute transaction_id + # The Privy-assigned ID for this transaction. + # + # @return [String] + required :transaction_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::TransactionReplacedWebhookPayload::Type] + required :type, enum: -> { Privy::TransactionReplacedWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet that initiated the transaction. + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(caip2:, transaction_hash:, transaction_id:, type:, wallet_id:, reference_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransactionReplacedWebhookPayload} for more details. + # + # Payload for the transaction.replaced webhook event. + # + # @param caip2 [String] The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param transaction_id [String] The Privy-assigned ID for this transaction. + # + # @param type [Symbol, Privy::Models::TransactionReplacedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet that initiated the transaction. + # + # @param reference_id [String, nil] Developer-provided reference ID for transaction reconciliation, if one was provi + + # The type of webhook event. + # + # @see Privy::Models::TransactionReplacedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_REPLACED = :"transaction.replaced" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_scanning_asset_diff.rb b/lib/privy/models/transaction_scanning_asset_diff.rb new file mode 100644 index 0000000..6b1bb4e --- /dev/null +++ b/lib/privy/models/transaction_scanning_asset_diff.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningAssetDiff < Privy::Internal::Type::BaseModel + # @!attribute asset + # Information about the moving asset in a transaction scan. + # + # @return [Privy::Models::TransactionScanningAssetInfo] + required :asset, -> { Privy::TransactionScanningAssetInfo } + + # @!attribute in_ + # + # @return [Array] + required :in_, + -> { + Privy::Internal::Type::ArrayOf[Privy::TransactionScanningAssetValue] + }, + api_name: :in + + # @!attribute out + # + # @return [Array] + required :out, -> { Privy::Internal::Type::ArrayOf[Privy::TransactionScanningAssetValue] } + + # @!method initialize(asset:, in_:, out:) + # An asset diff representing assets entering/leaving a wallet. + # + # @param asset [Privy::Models::TransactionScanningAssetInfo] Information about the moving asset in a transaction scan. + # + # @param in_ [Array] + # + # @param out [Array] + end + end +end diff --git a/lib/privy/models/transaction_scanning_asset_info.rb b/lib/privy/models/transaction_scanning_asset_info.rb new file mode 100644 index 0000000..7ba31f3 --- /dev/null +++ b/lib/privy/models/transaction_scanning_asset_info.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningAssetInfo < Privy::Internal::Type::BaseModel + # @!attribute decimals + # + # @return [Float, nil] + optional :decimals, Float + + # @!attribute logo_url + # + # @return [String, nil] + optional :logo_url, String + + # @!attribute name + # + # @return [String, nil] + optional :name, String + + # @!attribute symbol + # + # @return [String, nil] + optional :symbol, String + + # @!attribute type + # + # @return [String, nil] + optional :type, String + + # @!method initialize(decimals: nil, logo_url: nil, name: nil, symbol: nil, type: nil) + # Information about the moving asset in a transaction scan. + # + # @param decimals [Float] + # @param logo_url [String] + # @param name [String] + # @param symbol [String] + # @param type [String] + end + end +end diff --git a/lib/privy/models/transaction_scanning_asset_value.rb b/lib/privy/models/transaction_scanning_asset_value.rb new file mode 100644 index 0000000..b9788f5 --- /dev/null +++ b/lib/privy/models/transaction_scanning_asset_value.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningAssetValue < Privy::Internal::Type::BaseModel + # @!attribute usd_price + # + # @return [String, nil] + optional :usd_price, String + + # @!attribute value + # + # @return [String, nil] + optional :value, String + + # @!method initialize(usd_price: nil, value: nil) + # The value of an asset in a transaction scan result. + # + # @param usd_price [String] + # @param value [String] + end + end +end diff --git a/lib/privy/models/transaction_scanning_calldata.rb b/lib/privy/models/transaction_scanning_calldata.rb new file mode 100644 index 0000000..2f6683d --- /dev/null +++ b/lib/privy/models/transaction_scanning_calldata.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningCalldata < Privy::Internal::Type::BaseModel + # @!attribute function_selector + # + # @return [String] + required :function_selector, String + + # @!attribute function_declaration + # + # @return [String, nil] + optional :function_declaration, String + + # @!attribute function_signature + # + # @return [String, nil] + optional :function_signature, String + + # @!method initialize(function_selector:, function_declaration: nil, function_signature: nil) + # Decoded calldata from a scanned transaction. + # + # @param function_selector [String] + # @param function_declaration [String] + # @param function_signature [String] + end + end +end diff --git a/lib/privy/models/transaction_scanning_exposure.rb b/lib/privy/models/transaction_scanning_exposure.rb new file mode 100644 index 0000000..c6db2b5 --- /dev/null +++ b/lib/privy/models/transaction_scanning_exposure.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningExposure < Privy::Internal::Type::BaseModel + # @!attribute asset + # Information about the moving asset in a transaction scan. + # + # @return [Privy::Models::TransactionScanningAssetInfo] + required :asset, -> { Privy::TransactionScanningAssetInfo } + + # @!attribute spenders + # + # @return [Hash{Symbol=>Privy::Models::TransactionScanningAssetValue}] + required :spenders, -> { Privy::Internal::Type::HashOf[Privy::TransactionScanningAssetValue] } + + # @!method initialize(asset:, spenders:) + # An exposure representing assets approved to spend. + # + # @param asset [Privy::Models::TransactionScanningAssetInfo] Information about the moving asset in a transaction scan. + # + # @param spenders [Hash{Symbol=>Privy::Models::TransactionScanningAssetValue}] + end + end +end diff --git a/lib/privy/models/transaction_scanning_metadata.rb b/lib/privy/models/transaction_scanning_metadata.rb new file mode 100644 index 0000000..d9fc9fb --- /dev/null +++ b/lib/privy/models/transaction_scanning_metadata.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningMetadata < Privy::Internal::Type::BaseModel + # @!attribute domain + # + # @return [String] + required :domain, String + + # @!method initialize(domain:) + # Additional information for Blockaid to validate against. + # + # @param domain [String] + end + end +end diff --git a/lib/privy/models/transaction_scanning_params.rb b/lib/privy/models/transaction_scanning_params.rb new file mode 100644 index 0000000..a9ed38d --- /dev/null +++ b/lib/privy/models/transaction_scanning_params.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningParams < Privy::Internal::Type::BaseModel + # @!attribute block_tag + # + # @return [String, nil] + optional :block_tag, String + + # @!attribute calldata + # Decoded calldata from a scanned transaction. + # + # @return [Privy::Models::TransactionScanningCalldata, nil] + optional :calldata, -> { Privy::TransactionScanningCalldata } + + # @!attribute chain + # + # @return [String, nil] + optional :chain, String + + # @!attribute data + # + # @return [String, nil] + optional :data, String + + # @!attribute from + # + # @return [String, nil] + optional :from, String + + # @!attribute gas + # + # @return [String, nil] + optional :gas, String + + # @!attribute gas_price + # + # @return [String, nil] + optional :gas_price, String + + # @!attribute to + # + # @return [String, nil] + optional :to, String + + # @!attribute value + # + # @return [String, nil] + optional :value, String + + # @!method initialize(block_tag: nil, calldata: nil, chain: nil, data: nil, from: nil, gas: nil, gas_price: nil, to: nil, value: nil) + # The parameters of the scanned transaction. + # + # @param block_tag [String] + # + # @param calldata [Privy::Models::TransactionScanningCalldata] Decoded calldata from a scanned transaction. + # + # @param chain [String] + # + # @param data [String] + # + # @param from [String] + # + # @param gas [String] + # + # @param gas_price [String] + # + # @param to [String] + # + # @param value [String] + end + end +end diff --git a/lib/privy/models/transaction_scanning_request_body.rb b/lib/privy/models/transaction_scanning_request_body.rb new file mode 100644 index 0000000..fd48e78 --- /dev/null +++ b/lib/privy/models/transaction_scanning_request_body.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningRequestBody < Privy::Internal::Type::BaseModel + # @!attribute chain_id + # + # @return [String] + required :chain_id, String + + # @!attribute metadata + # Additional information for Blockaid to validate against. + # + # @return [Privy::Models::TransactionScanningMetadata] + required :metadata, -> { Privy::TransactionScanningMetadata } + + # @!attribute request + # Raw RPC request to execute with the wallet. + # + # @return [Privy::Models::TransactionScanningRpcRequest] + required :request, -> { Privy::TransactionScanningRpcRequest } + + # @!method initialize(chain_id:, metadata:, request:) + # The request body for scanning a transaction. + # + # @param chain_id [String] + # + # @param metadata [Privy::Models::TransactionScanningMetadata] Additional information for Blockaid to validate against. + # + # @param request [Privy::Models::TransactionScanningRpcRequest] Raw RPC request to execute with the wallet. + end + end +end diff --git a/lib/privy/models/transaction_scanning_response_body.rb b/lib/privy/models/transaction_scanning_response_body.rb new file mode 100644 index 0000000..45ff4d7 --- /dev/null +++ b/lib/privy/models/transaction_scanning_response_body.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningResponseBody < Privy::Internal::Type::BaseModel + # @!attribute simulation + # The simulation result from a transaction scan. + # + # @return [Privy::Models::TransactionScanningSimulationErrorResult, Privy::Models::TransactionScanningSimulationSuccessResult] + required :simulation, union: -> { Privy::TransactionScanningSimulationResult } + + # @!attribute validation + # The validation result from a transaction scan. + # + # @return [Privy::Models::TransactionScanningValidationErrorResult, Privy::Models::TransactionScanningValidationSuccessResult] + required :validation, union: -> { Privy::TransactionScanningValidationResult } + + # @!method initialize(simulation:, validation:) + # The response from scanning a transaction. + # + # @param simulation [Privy::Models::TransactionScanningSimulationErrorResult, Privy::Models::TransactionScanningSimulationSuccessResult] The simulation result from a transaction scan. + # + # @param validation [Privy::Models::TransactionScanningValidationErrorResult, Privy::Models::TransactionScanningValidationSuccessResult] The validation result from a transaction scan. + end + end +end diff --git a/lib/privy/models/transaction_scanning_rpc_request.rb b/lib/privy/models/transaction_scanning_rpc_request.rb new file mode 100644 index 0000000..3310eb6 --- /dev/null +++ b/lib/privy/models/transaction_scanning_rpc_request.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningRpcRequest < Privy::Internal::Type::BaseModel + # @!attribute method_ + # + # @return [String] + required :method_, String, api_name: :method + + # @!attribute params + # + # @return [Array] + required :params, Privy::Internal::Type::ArrayOf[Privy::Internal::Type::Unknown] + + # @!method initialize(method_:, params:) + # Raw RPC request to execute with the wallet. + # + # @param method_ [String] + # @param params [Array] + end + end +end diff --git a/lib/privy/models/transaction_scanning_simulation_error_result.rb b/lib/privy/models/transaction_scanning_simulation_error_result.rb new file mode 100644 index 0000000..e3cacdb --- /dev/null +++ b/lib/privy/models/transaction_scanning_simulation_error_result.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningSimulationErrorResult < Privy::Internal::Type::BaseModel + # @!attribute error + # + # @return [String] + required :error, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::TransactionScanningSimulationErrorResult::Status] + required :status, enum: -> { Privy::TransactionScanningSimulationErrorResult::Status } + + # @!method initialize(error:, status:) + # A failed simulation result from a transaction scan. + # + # @param error [String] + # @param status [Symbol, Privy::Models::TransactionScanningSimulationErrorResult::Status] + + # @see Privy::Models::TransactionScanningSimulationErrorResult#status + module Status + extend Privy::Internal::Type::Enum + + ERROR = :Error + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_scanning_simulation_result.rb b/lib/privy/models/transaction_scanning_simulation_result.rb new file mode 100644 index 0000000..7a2fd1e --- /dev/null +++ b/lib/privy/models/transaction_scanning_simulation_result.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # The simulation result from a transaction scan. + module TransactionScanningSimulationResult + extend Privy::Internal::Type::Union + + discriminator :status + + # A failed simulation result from a transaction scan. + variant :Error, -> { Privy::TransactionScanningSimulationErrorResult } + + # A successful simulation result from a transaction scan. + variant :Success, -> { Privy::TransactionScanningSimulationSuccessResult } + + # @!method self.variants + # @return [Array(Privy::Models::TransactionScanningSimulationErrorResult, Privy::Models::TransactionScanningSimulationSuccessResult)] + end + end +end diff --git a/lib/privy/models/transaction_scanning_simulation_success_result.rb b/lib/privy/models/transaction_scanning_simulation_success_result.rb new file mode 100644 index 0000000..dc6b033 --- /dev/null +++ b/lib/privy/models/transaction_scanning_simulation_success_result.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningSimulationSuccessResult < Privy::Internal::Type::BaseModel + # @!attribute assets_diffs + # + # @return [Array] + required :assets_diffs, -> { Privy::Internal::Type::ArrayOf[Privy::TransactionScanningAssetDiff] } + + # @!attribute exposures + # + # @return [Array] + required :exposures, -> { Privy::Internal::Type::ArrayOf[Privy::TransactionScanningExposure] } + + # @!attribute status + # + # @return [Symbol, Privy::Models::TransactionScanningSimulationSuccessResult::Status] + required :status, enum: -> { Privy::TransactionScanningSimulationSuccessResult::Status } + + # @!attribute params + # The parameters of the scanned transaction. + # + # @return [Privy::Models::TransactionScanningParams, nil] + optional :params, -> { Privy::TransactionScanningParams } + + # @!method initialize(assets_diffs:, exposures:, status:, params: nil) + # A successful simulation result from a transaction scan. + # + # @param assets_diffs [Array] + # + # @param exposures [Array] + # + # @param status [Symbol, Privy::Models::TransactionScanningSimulationSuccessResult::Status] + # + # @param params [Privy::Models::TransactionScanningParams] The parameters of the scanned transaction. + + # @see Privy::Models::TransactionScanningSimulationSuccessResult#status + module Status + extend Privy::Internal::Type::Enum + + SUCCESS = :Success + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_scanning_validation_error_result.rb b/lib/privy/models/transaction_scanning_validation_error_result.rb new file mode 100644 index 0000000..89e2451 --- /dev/null +++ b/lib/privy/models/transaction_scanning_validation_error_result.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningValidationErrorResult < Privy::Internal::Type::BaseModel + # @!attribute error + # + # @return [String] + required :error, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::TransactionScanningValidationErrorResult::Status] + required :status, enum: -> { Privy::TransactionScanningValidationErrorResult::Status } + + # @!method initialize(error:, status:) + # A failed validation result from a transaction scan. + # + # @param error [String] + # @param status [Symbol, Privy::Models::TransactionScanningValidationErrorResult::Status] + + # @see Privy::Models::TransactionScanningValidationErrorResult#status + module Status + extend Privy::Internal::Type::Enum + + ERROR = :Error + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_scanning_validation_result.rb b/lib/privy/models/transaction_scanning_validation_result.rb new file mode 100644 index 0000000..047435c --- /dev/null +++ b/lib/privy/models/transaction_scanning_validation_result.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # The validation result from a transaction scan. + module TransactionScanningValidationResult + extend Privy::Internal::Type::Union + + discriminator :status + + # A failed validation result from a transaction scan. + variant :Error, -> { Privy::TransactionScanningValidationErrorResult } + + # A successful validation result from a transaction scan. + variant :Success, -> { Privy::TransactionScanningValidationSuccessResult } + + # @!method self.variants + # @return [Array(Privy::Models::TransactionScanningValidationErrorResult, Privy::Models::TransactionScanningValidationSuccessResult)] + end + end +end diff --git a/lib/privy/models/transaction_scanning_validation_success_result.rb b/lib/privy/models/transaction_scanning_validation_success_result.rb new file mode 100644 index 0000000..ff98b61 --- /dev/null +++ b/lib/privy/models/transaction_scanning_validation_success_result.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionScanningValidationSuccessResult < Privy::Internal::Type::BaseModel + # @!attribute result_type + # + # @return [String] + required :result_type, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::TransactionScanningValidationSuccessResult::Status] + required :status, enum: -> { Privy::TransactionScanningValidationSuccessResult::Status } + + # @!method initialize(result_type:, status:) + # A successful validation result from a transaction scan. + # + # @param result_type [String] + # @param status [Symbol, Privy::Models::TransactionScanningValidationSuccessResult::Status] + + # @see Privy::Models::TransactionScanningValidationSuccessResult#status + module Status + extend Privy::Internal::Type::Enum + + SUCCESS = :Success + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_still_pending_webhook_payload.rb b/lib/privy/models/transaction_still_pending_webhook_payload.rb new file mode 100644 index 0000000..6731e2a --- /dev/null +++ b/lib/privy/models/transaction_still_pending_webhook_payload.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransactionStillPendingWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @return [String] + required :caip2, String + + # @!attribute transaction_hash + # The blockchain transaction hash. + # + # @return [String] + required :transaction_hash, String + + # @!attribute transaction_id + # The Privy-assigned ID for this transaction. + # + # @return [String] + required :transaction_id, String + + # @!attribute transaction_request + # An unsigned standard Ethereum transaction object. Supports EVM transaction types + # 0, 1, 2, and 4. + # + # @return [Privy::Models::UnsignedStandardEthereumTransaction] + required :transaction_request, -> { Privy::UnsignedStandardEthereumTransaction } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::TransactionStillPendingWebhookPayload::Type] + required :type, enum: -> { Privy::TransactionStillPendingWebhookPayload::Type } + + # @!attribute wallet_id + # The ID of the wallet that initiated the transaction. + # + # @return [String] + required :wallet_id, String + + # @!attribute reference_id + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + # + # @return [String, nil] + optional :reference_id, String, nil?: true + + # @!method initialize(caip2:, transaction_hash:, transaction_id:, transaction_request:, type:, wallet_id:, reference_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransactionStillPendingWebhookPayload} for more details. + # + # Payload for the transaction.still_pending webhook event. + # + # @param caip2 [String] The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + # + # @param transaction_hash [String] The blockchain transaction hash. + # + # @param transaction_id [String] The Privy-assigned ID for this transaction. + # + # @param transaction_request [Privy::Models::UnsignedStandardEthereumTransaction] An unsigned standard Ethereum transaction object. Supports EVM transaction types + # + # @param type [Symbol, Privy::Models::TransactionStillPendingWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] The ID of the wallet that initiated the transaction. + # + # @param reference_id [String, nil] Developer-provided reference ID for transaction reconciliation, if one was provi + + # The type of webhook event. + # + # @see Privy::Models::TransactionStillPendingWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_STILL_PENDING = :"transaction.still_pending" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transaction_token_address_input.rb b/lib/privy/models/transaction_token_address_input.rb new file mode 100644 index 0000000..388a19e --- /dev/null +++ b/lib/privy/models/transaction_token_address_input.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module Privy + module Models + TransactionTokenAddressInput = String + end +end diff --git a/lib/privy/models/transfer_action_response.rb b/lib/privy/models/transfer_action_response.rb new file mode 100644 index 0000000..92d218e --- /dev/null +++ b/lib/privy/models/transfer_action_response.rb @@ -0,0 +1,155 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferActionResponse < Privy::Internal::Type::BaseModel + # @!attribute id + # The ID of the wallet action. + # + # @return [String] + required :id, String + + # @!attribute created_at + # ISO 8601 timestamp of when the wallet action was created. + # + # @return [Time] + required :created_at, Time + + # @!attribute destination_address + # Recipient address. + # + # @return [String] + required :destination_address, String + + # @!attribute source_chain + # Chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :source_chain, String + + # @!attribute status + # Status of a wallet action. + # + # @return [Symbol, Privy::Models::WalletActionStatus] + required :status, enum: -> { Privy::WalletActionStatus } + + # @!attribute type + # + # @return [Symbol, Privy::Models::TransferActionResponse::Type] + required :type, enum: -> { Privy::TransferActionResponse::Type } + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute destination_amount + # Amount received on the destination chain. Populated immediately for exact_output + # transfers, or after fill confirmation for exact_input transfers. + # + # @return [String, nil] + optional :destination_amount, String + + # @!attribute destination_asset + # Destination asset for cross-asset transfers. Omitted for same-asset transfers. + # + # @return [String, nil] + optional :destination_asset, String + + # @!attribute destination_chain + # Destination chain for cross-chain transfers. Omitted for same-chain transfers. + # + # @return [String, nil] + optional :destination_chain, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason, nil] + optional :failure_reason, -> { Privy::FailureReason } + + # @!attribute source_amount + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + # + # @return [String, nil] + optional :source_amount, String + + # @!attribute source_asset + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + # + # @return [String, nil] + optional :source_asset, String + + # @!attribute source_asset_address + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + # + # @return [String, nil] + optional :source_asset_address, String + + # @!attribute source_asset_decimals + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + # + # @return [Integer, nil] + optional :source_asset_decimals, Integer + + # @!attribute steps + # The steps of the wallet action. Only returned if `?include=steps` is provided. + # + # @return [Array, nil] + optional :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!method initialize(id:, created_at:, destination_address:, source_chain:, status:, type:, wallet_id:, destination_amount: nil, destination_asset: nil, destination_chain: nil, failure_reason: nil, source_amount: nil, source_asset: nil, source_asset_address: nil, source_asset_decimals: nil, steps: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransferActionResponse} for more details. + # + # Response for a transfer action. + # + # @param id [String] The ID of the wallet action. + # + # @param created_at [Time] ISO 8601 timestamp of when the wallet action was created. + # + # @param destination_address [String] Recipient address. + # + # @param source_chain [String] Chain name (e.g. "base", "ethereum"). + # + # @param status [Symbol, Privy::Models::WalletActionStatus] Status of a wallet action. + # + # @param type [Symbol, Privy::Models::TransferActionResponse::Type] + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param destination_amount [String] Amount received on the destination chain. Populated immediately for exact_output + # + # @param destination_asset [String] Destination asset for cross-asset transfers. Omitted for same-asset transfers. + # + # @param destination_chain [String] Destination chain for cross-chain transfers. Omitted for same-chain transfers. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param source_amount [String] Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output c + # + # @param source_asset [String] Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated w + # + # @param source_asset_address [String] Token contract address (EVM) or mint address (Solana). Present when the transfer + # + # @param source_asset_decimals [Integer] Number of decimals for the transferred token. Present when the transfer was init + # + # @param steps [Array] The steps of the wallet action. Only returned if `?include=steps` is provided. + + # @see Privy::Models::TransferActionResponse#type + module Type + extend Privy::Internal::Type::Enum + + TRANSFER = :transfer + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transfer_farcaster_input.rb b/lib/privy/models/transfer_farcaster_input.rb new file mode 100644 index 0000000..afdd8eb --- /dev/null +++ b/lib/privy/models/transfer_farcaster_input.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferFarcasterInput < Privy::Internal::Type::BaseModel + # @!attribute farcaster_embedded_address + # + # @return [String] + required :farcaster_embedded_address, String + + # @!attribute farcaster_id + # + # @return [String] + required :farcaster_id, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!method initialize(farcaster_embedded_address:, farcaster_id:, nonce:) + # Input for transferring a Farcaster account. + # + # @param farcaster_embedded_address [String] + # @param farcaster_id [String] + # @param nonce [String] + end + end +end diff --git a/lib/privy/models/transfer_intent_request_details.rb b/lib/privy/models/transfer_intent_request_details.rb new file mode 100644 index 0000000..8d9e1ad --- /dev/null +++ b/lib/privy/models/transfer_intent_request_details.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferIntentRequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # Request body for initiating a sponsored token transfer from an embedded wallet. + # + # @return [Privy::Models::TransferRequestBody] + required :body, -> { Privy::TransferRequestBody } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::TransferIntentRequestDetails::Method] + required :method_, enum: -> { Privy::TransferIntentRequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # Request details for a transfer intent. + # + # @param body [Privy::Models::TransferRequestBody] Request body for initiating a sponsored token transfer from an embedded wallet. + # + # @param method_ [Symbol, Privy::Models::TransferIntentRequestDetails::Method] + # + # @param url [String] + + # @see Privy::Models::TransferIntentRequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + POST = :POST + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transfer_intent_response.rb b/lib/privy/models/transfer_intent_response.rb new file mode 100644 index 0000000..1840ba6 --- /dev/null +++ b/lib/privy/models/transfer_intent_response.rb @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#transfer + class TransferIntentResponse < Privy::Models::BaseIntentResponse + # @!attribute intent_type + # + # @return [Symbol, Privy::Models::TransferIntentResponse::IntentType] + required :intent_type, enum: -> { Privy::TransferIntentResponse::IntentType } + + # @!attribute request_details + # The original transfer request that would be sent to the wallet transfer endpoint + # + # @return [Privy::Models::TransferIntentResponse::RequestDetails] + required :request_details, -> { Privy::TransferIntentResponse::RequestDetails } + + # @!attribute action_result + # Result of transfer execution (only present if intent status is 'executed' or + # 'failed') + # + # @return [Privy::Models::BaseActionResult, nil] + optional :action_result, -> { Privy::BaseActionResult } + + # @!attribute current_resource_data + # A wallet managed by Privy's wallet infrastructure. + # + # @return [Privy::Models::Wallet, nil] + optional :current_resource_data, -> { Privy::Wallet } + + # @!method initialize(intent_type:, request_details:, action_result: nil, current_resource_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransferIntentResponse} for more details. + # + # Response for a transfer intent + # + # @param intent_type [Symbol, Privy::Models::TransferIntentResponse::IntentType] + # + # @param request_details [Privy::Models::TransferIntentResponse::RequestDetails] The original transfer request that would be sent to the wallet transfer endpoint + # + # @param action_result [Privy::Models::BaseActionResult] Result of transfer execution (only present if intent status is 'executed' or 'fa + # + # @param current_resource_data [Privy::Models::Wallet] A wallet managed by Privy's wallet infrastructure. + + module IntentType + extend Privy::Internal::Type::Enum + + TRANSFER = :TRANSFER + + # @!method self.values + # @return [Array] + end + + class RequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # Request body for initiating a sponsored token transfer from an embedded wallet. + # + # @return [Privy::Models::TransferRequestBody] + required :body, -> { Privy::TransferRequestBody } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::TransferIntentResponse::RequestDetails::Method] + required :method_, + enum: -> { + Privy::TransferIntentResponse::RequestDetails::Method + }, + api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # The original transfer request that would be sent to the wallet transfer endpoint + # + # @param body [Privy::Models::TransferRequestBody] Request body for initiating a sponsored token transfer from an embedded wallet. + # + # @param method_ [Symbol, Privy::Models::TransferIntentResponse::RequestDetails::Method] + # + # @param url [String] + + # @see Privy::Models::TransferIntentResponse::RequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + POST = :POST + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/privy/models/transfer_received_transaction_detail.rb b/lib/privy/models/transfer_received_transaction_detail.rb new file mode 100644 index 0000000..4435325 --- /dev/null +++ b/lib/privy/models/transfer_received_transaction_detail.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferReceivedTransactionDetail < Privy::Internal::Type::BaseModel + # @!attribute asset + # + # @return [Symbol, String, Privy::Models::TransferReceivedTransactionDetail::Asset] + required :asset, union: -> { Privy::TransferReceivedTransactionDetail::Asset } + + # @!attribute chain + # + # @return [Symbol, Privy::Models::TransferReceivedTransactionDetail::Chain] + required :chain, enum: -> { Privy::TransferReceivedTransactionDetail::Chain } + + # @!attribute display_values + # + # @return [Hash{Symbol=>String}] + required :display_values, Privy::Internal::Type::HashOf[String] + + # @!attribute raw_value + # + # @return [String] + required :raw_value, String + + # @!attribute raw_value_decimals + # + # @return [Float] + required :raw_value_decimals, Float + + # @!attribute recipient + # + # @return [String] + required :recipient, String + + # @!attribute recipient_privy_user_id + # + # @return [String, nil] + required :recipient_privy_user_id, String, nil?: true + + # @!attribute sender + # + # @return [String] + required :sender, String + + # @!attribute sender_privy_user_id + # + # @return [String, nil] + required :sender_privy_user_id, String, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::TransferReceivedTransactionDetail::Type] + required :type, enum: -> { Privy::TransferReceivedTransactionDetail::Type } + + # @!method initialize(asset:, chain:, display_values:, raw_value:, raw_value_decimals:, recipient:, recipient_privy_user_id:, sender:, sender_privy_user_id:, type:) + # Details for a received transfer transaction. + # + # @param asset [Symbol, String, Privy::Models::TransferReceivedTransactionDetail::Asset] + # @param chain [Symbol, Privy::Models::TransferReceivedTransactionDetail::Chain] + # @param display_values [Hash{Symbol=>String}] + # @param raw_value [String] + # @param raw_value_decimals [Float] + # @param recipient [String] + # @param recipient_privy_user_id [String, nil] + # @param sender [String] + # @param sender_privy_user_id [String, nil] + # @param type [Symbol, Privy::Models::TransferReceivedTransactionDetail::Type] + + # @see Privy::Models::TransferReceivedTransactionDetail#asset + module Asset + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::USDC } + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::USDC_E } + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::ETH } + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::POL } + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::USDT } + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::EURC } + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::USDB } + + variant const: -> { Privy::Models::TransferReceivedTransactionDetail::Asset::SOL } + + variant String + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol, String) } + end + + # @!group + + USDC = :usdc + USDC_E = :"usdc.e" + ETH = :eth + POL = :pol + USDT = :usdt + EURC = :eurc + USDB = :usdb + SOL = :sol + + # @!endgroup + end + + # @see Privy::Models::TransferReceivedTransactionDetail#chain + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + ARBITRUM = :arbitrum + BASE = :base + TEMPO = :tempo + LINEA = :linea + OPTIMISM = :optimism + POLYGON = :polygon + SOLANA = :solana + ZKSYNC_ERA = :zksync_era + SEPOLIA = :sepolia + ARBITRUM_SEPOLIA = :arbitrum_sepolia + BASE_SEPOLIA = :base_sepolia + LINEA_TESTNET = :linea_testnet + OPTIMISM_SEPOLIA = :optimism_sepolia + POLYGON_AMOY = :polygon_amoy + SOLANA_DEVNET = :solana_devnet + SOLANA_TESTNET = :solana_testnet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::TransferReceivedTransactionDetail#type + module Type + extend Privy::Internal::Type::Enum + + TRANSFER_RECEIVED = :transfer_received + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transfer_request_body.rb b/lib/privy/models/transfer_request_body.rb new file mode 100644 index 0000000..88cd4ea --- /dev/null +++ b/lib/privy/models/transfer_request_body.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferRequestBody < Privy::Internal::Type::BaseModel + # @!attribute destination + # The destination address for a token transfer. Optionally specify a different + # asset or chain for cross-asset or cross-chain transfers. + # + # @return [Privy::Models::TokenTransferDestination] + required :destination, -> { Privy::TokenTransferDestination } + + # @!attribute source + # The source asset, amount, and chain for a token transfer. Specify either `asset` + # (named) or `asset_address` (custom), not both. + # + # @return [Privy::Models::NamedTokenTransferSource, Privy::Models::CustomTokenTransferSource] + required :source, union: -> { Privy::TokenTransferSource } + + # @!attribute amount_type + # Whether the amount refers to the input token or output token. + # + # @return [Symbol, Privy::Models::AmountType, nil] + optional :amount_type, enum: -> { Privy::AmountType } + + # @!attribute slippage_bps + # Maximum allowed slippage in basis points (1 bps = 0.01%). + # + # @return [Integer, nil] + optional :slippage_bps, Integer + + # @!method initialize(destination:, source:, amount_type: nil, slippage_bps: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransferRequestBody} for more details. + # + # Request body for initiating a sponsored token transfer from an embedded wallet. + # + # @param destination [Privy::Models::TokenTransferDestination] The destination address for a token transfer. Optionally specify a different ass + # + # @param source [Privy::Models::NamedTokenTransferSource, Privy::Models::CustomTokenTransferSource] The source asset, amount, and chain for a token transfer. Specify either `asset` + # + # @param amount_type [Symbol, Privy::Models::AmountType] Whether the amount refers to the input token or output token. + # + # @param slippage_bps [Integer] Maximum allowed slippage in basis points (1 bps = 0.01%). + end + end +end diff --git a/lib/privy/models/transfer_sent_transaction_detail.rb b/lib/privy/models/transfer_sent_transaction_detail.rb new file mode 100644 index 0000000..62184e5 --- /dev/null +++ b/lib/privy/models/transfer_sent_transaction_detail.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferSentTransactionDetail < Privy::Internal::Type::BaseModel + # @!attribute asset + # + # @return [Symbol, String, Privy::Models::TransferSentTransactionDetail::Asset] + required :asset, union: -> { Privy::TransferSentTransactionDetail::Asset } + + # @!attribute chain + # + # @return [Symbol, Privy::Models::TransferSentTransactionDetail::Chain] + required :chain, enum: -> { Privy::TransferSentTransactionDetail::Chain } + + # @!attribute display_values + # + # @return [Hash{Symbol=>String}] + required :display_values, Privy::Internal::Type::HashOf[String] + + # @!attribute raw_value + # + # @return [String] + required :raw_value, String + + # @!attribute raw_value_decimals + # + # @return [Float] + required :raw_value_decimals, Float + + # @!attribute recipient + # + # @return [String] + required :recipient, String + + # @!attribute recipient_privy_user_id + # + # @return [String, nil] + required :recipient_privy_user_id, String, nil?: true + + # @!attribute sender + # + # @return [String] + required :sender, String + + # @!attribute sender_privy_user_id + # + # @return [String, nil] + required :sender_privy_user_id, String, nil?: true + + # @!attribute type + # + # @return [Symbol, Privy::Models::TransferSentTransactionDetail::Type] + required :type, enum: -> { Privy::TransferSentTransactionDetail::Type } + + # @!method initialize(asset:, chain:, display_values:, raw_value:, raw_value_decimals:, recipient:, recipient_privy_user_id:, sender:, sender_privy_user_id:, type:) + # Details for a sent transfer transaction. + # + # @param asset [Symbol, String, Privy::Models::TransferSentTransactionDetail::Asset] + # @param chain [Symbol, Privy::Models::TransferSentTransactionDetail::Chain] + # @param display_values [Hash{Symbol=>String}] + # @param raw_value [String] + # @param raw_value_decimals [Float] + # @param recipient [String] + # @param recipient_privy_user_id [String, nil] + # @param sender [String] + # @param sender_privy_user_id [String, nil] + # @param type [Symbol, Privy::Models::TransferSentTransactionDetail::Type] + + # @see Privy::Models::TransferSentTransactionDetail#asset + module Asset + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::USDC } + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::USDC_E } + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::ETH } + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::POL } + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::USDT } + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::EURC } + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::USDB } + + variant const: -> { Privy::Models::TransferSentTransactionDetail::Asset::SOL } + + variant String + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Privy::TransferSentTransactionDetail::Asset::TaggedSymbol, String) } + end + + # @!group + + USDC = :usdc + USDC_E = :"usdc.e" + ETH = :eth + POL = :pol + USDT = :usdt + EURC = :eurc + USDB = :usdb + SOL = :sol + + # @!endgroup + end + + # @see Privy::Models::TransferSentTransactionDetail#chain + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + ARBITRUM = :arbitrum + BASE = :base + TEMPO = :tempo + LINEA = :linea + OPTIMISM = :optimism + POLYGON = :polygon + SOLANA = :solana + ZKSYNC_ERA = :zksync_era + SEPOLIA = :sepolia + ARBITRUM_SEPOLIA = :arbitrum_sepolia + BASE_SEPOLIA = :base_sepolia + LINEA_TESTNET = :linea_testnet + OPTIMISM_SEPOLIA = :optimism_sepolia + POLYGON_AMOY = :polygon_amoy + SOLANA_DEVNET = :solana_devnet + SOLANA_TESTNET = :solana_testnet + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::TransferSentTransactionDetail#type + module Type + extend Privy::Internal::Type::Enum + + TRANSFER_SENT = :transfer_sent + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/transfer_siwe_input.rb b/lib/privy/models/transfer_siwe_input.rb new file mode 100644 index 0000000..498b755 --- /dev/null +++ b/lib/privy/models/transfer_siwe_input.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferSiweInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute chain_id + # + # @return [String, nil] + optional :chain_id, String, api_name: :chainId, nil?: true + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(address:, nonce:, chain_id: nil, connector_type: nil, wallet_client_type: nil) + # Input for transferring a SIWE account. + # + # @param address [String] + # @param nonce [String] + # @param chain_id [String, nil] + # @param connector_type [String, nil] + # @param wallet_client_type [String, nil] + end + end +end diff --git a/lib/privy/models/transfer_siws_input.rb b/lib/privy/models/transfer_siws_input.rb new file mode 100644 index 0000000..176b4f5 --- /dev/null +++ b/lib/privy/models/transfer_siws_input.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferSiwsInput < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute connector_type + # + # @return [String, nil] + optional :connector_type, String, api_name: :connectorType, nil?: true + + # @!attribute wallet_client_type + # + # @return [String, nil] + optional :wallet_client_type, String, api_name: :walletClientType, nil?: true + + # @!method initialize(address:, nonce:, connector_type: nil, wallet_client_type: nil) + # Input for transferring a SIWS account. + # + # @param address [String] + # @param nonce [String] + # @param connector_type [String, nil] + # @param wallet_client_type [String, nil] + end + end +end diff --git a/lib/privy/models/transfer_telegram_input.rb b/lib/privy/models/transfer_telegram_input.rb new file mode 100644 index 0000000..96e6c42 --- /dev/null +++ b/lib/privy/models/transfer_telegram_input.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Privy + module Models + class TransferTelegramInput < Privy::Internal::Type::BaseModel + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute telegram_auth_result + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + # + # @return [Privy::Models::TelegramAuthResult, nil] + optional :telegram_auth_result, -> { Privy::TelegramAuthResult } + + # @!attribute telegram_web_app_data + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + # + # @return [Privy::Models::TelegramWebAppData, nil] + optional :telegram_web_app_data, -> { Privy::TelegramWebAppData } + + # @!method initialize(nonce:, telegram_auth_result: nil, telegram_web_app_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::TransferTelegramInput} for more details. + # + # Input for transferring a Telegram account. + # + # @param nonce [String] + # + # @param telegram_auth_result [Privy::Models::TelegramAuthResult] Auth result object returned by Telegram when a user authenticates using the logi + # + # @param telegram_web_app_data [Privy::Models::TelegramWebAppData] Auth result object returned by Telegram when a user authenticates using a mini a + end + end +end diff --git a/lib/privy/models/tron_calldata_condition.rb b/lib/privy/models/tron_calldata_condition.rb new file mode 100644 index 0000000..0dc405e --- /dev/null +++ b/lib/privy/models/tron_calldata_condition.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +module Privy + module Models + class TronCalldataCondition < Privy::Internal::Type::BaseModel + # @!attribute abi + # A Solidity ABI definition for decoding smart contract calldata. + # + # @return [Array] + required :abi, -> { Privy::Internal::Type::ArrayOf[Privy::AbiSchemaItem] } + + # @!attribute field + # + # @return [String] + required :field, String + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::TronCalldataCondition::FieldSource] + required :field_source, enum: -> { Privy::TronCalldataCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(abi:, field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::TronCalldataCondition} for more details. + # + # Decoded calldata from a TRON TriggerSmartContract interaction. + # + # @param abi [Array] A Solidity ABI definition for decoding smart contract calldata. + # + # @param field [String] + # + # @param field_source [Symbol, Privy::Models::TronCalldataCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # @see Privy::Models::TronCalldataCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + TRON_TRIGGER_SMART_CONTRACT_DATA = :tron_trigger_smart_contract_data + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/tron_transaction_condition.rb b/lib/privy/models/tron_transaction_condition.rb new file mode 100644 index 0000000..2f265c2 --- /dev/null +++ b/lib/privy/models/tron_transaction_condition.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +module Privy + module Models + class TronTransactionCondition < Privy::Internal::Type::BaseModel + # @!attribute field + # Supported TRON transaction fields in format "TransactionType.field_name" + # + # @return [Symbol, Privy::Models::TronTransactionCondition::Field] + required :field, enum: -> { Privy::TronTransactionCondition::Field } + + # @!attribute field_source + # + # @return [Symbol, Privy::Models::TronTransactionCondition::FieldSource] + required :field_source, enum: -> { Privy::TronTransactionCondition::FieldSource } + + # @!attribute operator + # Operator to use for policy conditions. + # + # @return [Symbol, Privy::Models::ConditionOperator] + required :operator, enum: -> { Privy::ConditionOperator } + + # @!attribute value + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + # + # @return [String, Array] + required :value, union: -> { Privy::ConditionValue } + + # @!method initialize(field:, field_source:, operator:, value:) + # Some parameter documentations has been truncated, see + # {Privy::Models::TronTransactionCondition} for more details. + # + # TRON transaction fields for TransferContract and TriggerSmartContract + # transaction types. + # + # @param field [Symbol, Privy::Models::TronTransactionCondition::Field] Supported TRON transaction fields in format "TransactionType.field_name" + # + # @param field_source [Symbol, Privy::Models::TronTransactionCondition::FieldSource] + # + # @param operator [Symbol, Privy::Models::ConditionOperator] Operator to use for policy conditions. + # + # @param value [String, Array] Value to compare against in a policy condition. Can be a single string or an arr + + # Supported TRON transaction fields in format "TransactionType.field_name" + # + # @see Privy::Models::TronTransactionCondition#field + module Field + extend Privy::Internal::Type::Enum + + TRANSFER_CONTRACT_TO_ADDRESS = :"TransferContract.to_address" + TRANSFER_CONTRACT_AMOUNT = :"TransferContract.amount" + TRIGGER_SMART_CONTRACT_CONTRACT_ADDRESS = :"TriggerSmartContract.contract_address" + TRIGGER_SMART_CONTRACT_CALL_VALUE = :"TriggerSmartContract.call_value" + TRIGGER_SMART_CONTRACT_TOKEN_ID = :"TriggerSmartContract.token_id" + TRIGGER_SMART_CONTRACT_CALL_TOKEN_VALUE = :"TriggerSmartContract.call_token_value" + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::TronTransactionCondition#field_source + module FieldSource + extend Privy::Internal::Type::Enum + + TRON_TRANSACTION = :tron_transaction + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/typed_data_domain_input_params.rb b/lib/privy/models/typed_data_domain_input_params.rb new file mode 100644 index 0000000..d660c72 --- /dev/null +++ b/lib/privy/models/typed_data_domain_input_params.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + TypedDataDomainInputParams = Privy::Internal::Type::HashOf[Privy::Internal::Type::Unknown] + end +end diff --git a/lib/privy/models/typed_data_type_field_input.rb b/lib/privy/models/typed_data_type_field_input.rb new file mode 100644 index 0000000..206e9bb --- /dev/null +++ b/lib/privy/models/typed_data_type_field_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class TypedDataTypeFieldInput < Privy::Internal::Type::BaseModel + # @!attribute name + # + # @return [String] + required :name, String + + # @!attribute type + # + # @return [String] + required :type, String + + # @!method initialize(name:, type:) + # A single field definition in an EIP-712 typed data type. + # + # @param name [String] + # @param type [String] + end + end +end diff --git a/lib/privy/models/typed_data_types_input_params.rb b/lib/privy/models/typed_data_types_input_params.rb new file mode 100644 index 0000000..d058917 --- /dev/null +++ b/lib/privy/models/typed_data_types_input_params.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + TypedDataTypesInputParams = + Privy::Internal::Type::HashOf[-> { Privy::Internal::Type::ArrayOf[Privy::TypedDataTypeFieldInput] }] + end +end diff --git a/lib/privy/models/unlink_passkey_input.rb b/lib/privy/models/unlink_passkey_input.rb new file mode 100644 index 0000000..5542999 --- /dev/null +++ b/lib/privy/models/unlink_passkey_input.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Privy + module Models + class UnlinkPasskeyInput < Privy::Internal::Type::BaseModel + # @!attribute credential_id + # + # @return [String] + required :credential_id, String + + # @!attribute remove_as_mfa + # + # @return [Boolean, nil] + optional :remove_as_mfa, Privy::Internal::Type::Boolean + + # @!method initialize(credential_id:, remove_as_mfa: nil) + # Input for unlinking a passkey credential. + # + # @param credential_id [String] + # @param remove_as_mfa [Boolean] + end + end +end diff --git a/lib/privy/models/unsafe_unwrap_webhook_event.rb b/lib/privy/models/unsafe_unwrap_webhook_event.rb new file mode 100644 index 0000000..eb6e2fa --- /dev/null +++ b/lib/privy/models/unsafe_unwrap_webhook_event.rb @@ -0,0 +1,174 @@ +# frozen_string_literal: true + +module Privy + module Models + # Payload for the intent.authorized webhook event. + module UnsafeUnwrapWebhookEvent + extend Privy::Internal::Type::Union + + discriminator :type + + # Payload for the intent.authorized webhook event. + variant :"intent.authorized", -> { Privy::IntentAuthorizedWebhookPayload } + + # Payload for the intent.created webhook event. + variant :"intent.created", -> { Privy::IntentCreatedWebhookPayload } + + # Payload for the intent.executed webhook event. + variant :"intent.executed", -> { Privy::IntentExecutedWebhookPayload } + + # Payload for the intent.failed webhook event. + variant :"intent.failed", -> { Privy::IntentFailedWebhookPayload } + + # Payload for the intent.rejected webhook event. + variant :"intent.rejected", -> { Privy::IntentRejectedWebhookPayload } + + # Payload for the mfa.disabled webhook event. + variant :"mfa.disabled", -> { Privy::MfaDisabledWebhookPayload } + + # Payload for the mfa.enabled webhook event. + variant :"mfa.enabled", -> { Privy::MfaEnabledWebhookPayload } + + # Payload for the transaction.broadcasted webhook event. + variant :"transaction.broadcasted", -> { Privy::TransactionBroadcastedWebhookPayload } + + # Payload for the transaction.confirmed webhook event. + variant :"transaction.confirmed", -> { Privy::TransactionConfirmedWebhookPayload } + + # Payload for the transaction.execution_reverted webhook event. + variant :"transaction.execution_reverted", -> { Privy::TransactionExecutionRevertedWebhookPayload } + + # Payload for the transaction.failed webhook event. + variant :"transaction.failed", -> { Privy::TransactionFailedWebhookPayload } + + # Payload for the transaction.provider_error webhook event. + variant :"transaction.provider_error", -> { Privy::TransactionProviderErrorWebhookPayload } + + # Payload for the transaction.replaced webhook event. + variant :"transaction.replaced", -> { Privy::TransactionReplacedWebhookPayload } + + # Payload for the transaction.still_pending webhook event. + variant :"transaction.still_pending", -> { Privy::TransactionStillPendingWebhookPayload } + + # Payload for the user.authenticated webhook event. + variant :"user.authenticated", -> { Privy::UserAuthenticatedWebhookPayload } + + # Payload for the user.created webhook event. + variant :"user.created", -> { Privy::UserCreatedWebhookPayload } + + # Payload for the user.linked_account webhook event. + variant :"user.linked_account", -> { Privy::UserLinkedAccountWebhookPayload } + + # Payload for the user.transferred_account webhook event. + variant :"user.transferred_account", -> { Privy::UserTransferredAccountWebhookPayload } + + # Payload for the user.unlinked_account webhook event. + variant :"user.unlinked_account", -> { Privy::UserUnlinkedAccountWebhookPayload } + + # Payload for the user.updated_account webhook event. + variant :"user.updated_account", -> { Privy::UserUpdatedAccountWebhookPayload } + + # Payload for the user.wallet_created webhook event. + variant :"user.wallet_created", -> { Privy::UserWalletCreatedWebhookPayload } + + # Payload for the user_operation.completed webhook event. + variant :"user_operation.completed", -> { Privy::UserOperationCompletedWebhookPayload } + + # Payload for the wallet.funds_deposited webhook event. + variant :"wallet.funds_deposited", -> { Privy::FundsDepositedWebhookPayload } + + # Payload for the wallet.funds_withdrawn webhook event. + variant :"wallet.funds_withdrawn", -> { Privy::FundsWithdrawnWebhookPayload } + + # Payload for the wallet.private_key_export webhook event. + variant :"wallet.private_key_export", -> { Privy::PrivateKeyExportWebhookPayload } + + # Payload for the wallet.recovered webhook event. + variant :"wallet.recovered", -> { Privy::WalletRecoveredWebhookPayload } + + # Payload for the wallet.recovery_setup webhook event. + variant :"wallet.recovery_setup", -> { Privy::WalletRecoverySetupWebhookPayload } + + # Payload for the wallet_action.earn_deposit.created webhook event. + variant :"wallet_action.earn_deposit.created", -> { Privy::WalletActionEarnDepositCreatedWebhookPayload } + + # Payload for the wallet_action.earn_deposit.failed webhook event. + variant :"wallet_action.earn_deposit.failed", -> { Privy::WalletActionEarnDepositFailedWebhookPayload } + + # Payload for the wallet_action.earn_deposit.rejected webhook event. + variant :"wallet_action.earn_deposit.rejected", + -> { Privy::WalletActionEarnDepositRejectedWebhookPayload } + + # Payload for the wallet_action.earn_deposit.succeeded webhook event. + variant :"wallet_action.earn_deposit.succeeded", + -> { Privy::WalletActionEarnDepositSucceededWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.created webhook event. + variant :"wallet_action.earn_incentive_claim.created", + -> { Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.failed webhook event. + variant :"wallet_action.earn_incentive_claim.failed", + -> { Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.rejected webhook event. + variant :"wallet_action.earn_incentive_claim.rejected", + -> { Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.succeeded webhook event. + variant :"wallet_action.earn_incentive_claim.succeeded", + -> { Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.created webhook event. + variant :"wallet_action.earn_withdraw.created", + -> { Privy::WalletActionEarnWithdrawCreatedWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.failed webhook event. + variant :"wallet_action.earn_withdraw.failed", -> { Privy::WalletActionEarnWithdrawFailedWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.rejected webhook event. + variant :"wallet_action.earn_withdraw.rejected", + -> { Privy::WalletActionEarnWithdrawRejectedWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.succeeded webhook event. + variant :"wallet_action.earn_withdraw.succeeded", + -> { Privy::WalletActionEarnWithdrawSucceededWebhookPayload } + + # Payload for the wallet_action.swap.created webhook event. + variant :"wallet_action.swap.created", -> { Privy::WalletActionSwapCreatedWebhookPayload } + + # Payload for the wallet_action.swap.failed webhook event. + variant :"wallet_action.swap.failed", -> { Privy::WalletActionSwapFailedWebhookPayload } + + # Payload for the wallet_action.swap.rejected webhook event. + variant :"wallet_action.swap.rejected", -> { Privy::WalletActionSwapRejectedWebhookPayload } + + # Payload for the wallet_action.swap.succeeded webhook event. + variant :"wallet_action.swap.succeeded", -> { Privy::WalletActionSwapSucceededWebhookPayload } + + # Payload for the wallet_action.transfer.created webhook event. + variant :"wallet_action.transfer.created", -> { Privy::WalletActionTransferCreatedWebhookPayload } + + # Payload for the wallet_action.transfer.failed webhook event. + variant :"wallet_action.transfer.failed", -> { Privy::WalletActionTransferFailedWebhookPayload } + + # Payload for the wallet_action.transfer.rejected webhook event. + variant :"wallet_action.transfer.rejected", -> { Privy::WalletActionTransferRejectedWebhookPayload } + + # Payload for the wallet_action.transfer.succeeded webhook event. + variant :"wallet_action.transfer.succeeded", -> { Privy::WalletActionTransferSucceededWebhookPayload } + + # Payload for the yield.claim.confirmed webhook event. + variant :"yield.claim.confirmed", -> { Privy::YieldClaimConfirmedWebhookPayload } + + # Payload for the yield.deposit.confirmed webhook event. + variant :"yield.deposit.confirmed", -> { Privy::YieldDepositConfirmedWebhookPayload } + + # Payload for the yield.withdraw.confirmed webhook event. + variant :"yield.withdraw.confirmed", -> { Privy::YieldWithdrawConfirmedWebhookPayload } + + # @!method self.variants + # @return [Array(Privy::Models::IntentAuthorizedWebhookPayload, Privy::Models::IntentCreatedWebhookPayload, Privy::Models::IntentExecutedWebhookPayload, Privy::Models::IntentFailedWebhookPayload, Privy::Models::IntentRejectedWebhookPayload, Privy::Models::MfaDisabledWebhookPayload, Privy::Models::MfaEnabledWebhookPayload, Privy::Models::TransactionBroadcastedWebhookPayload, Privy::Models::TransactionConfirmedWebhookPayload, Privy::Models::TransactionExecutionRevertedWebhookPayload, Privy::Models::TransactionFailedWebhookPayload, Privy::Models::TransactionProviderErrorWebhookPayload, Privy::Models::TransactionReplacedWebhookPayload, Privy::Models::TransactionStillPendingWebhookPayload, Privy::Models::UserAuthenticatedWebhookPayload, Privy::Models::UserCreatedWebhookPayload, Privy::Models::UserLinkedAccountWebhookPayload, Privy::Models::UserTransferredAccountWebhookPayload, Privy::Models::UserUnlinkedAccountWebhookPayload, Privy::Models::UserUpdatedAccountWebhookPayload, Privy::Models::UserWalletCreatedWebhookPayload, Privy::Models::UserOperationCompletedWebhookPayload, Privy::Models::FundsDepositedWebhookPayload, Privy::Models::FundsWithdrawnWebhookPayload, Privy::Models::PrivateKeyExportWebhookPayload, Privy::Models::WalletRecoveredWebhookPayload, Privy::Models::WalletRecoverySetupWebhookPayload, Privy::Models::WalletActionEarnDepositCreatedWebhookPayload, Privy::Models::WalletActionEarnDepositFailedWebhookPayload, Privy::Models::WalletActionEarnDepositRejectedWebhookPayload, Privy::Models::WalletActionEarnDepositSucceededWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload, Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload, Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload, Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload, Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload, Privy::Models::WalletActionSwapCreatedWebhookPayload, Privy::Models::WalletActionSwapFailedWebhookPayload, Privy::Models::WalletActionSwapRejectedWebhookPayload, Privy::Models::WalletActionSwapSucceededWebhookPayload, Privy::Models::WalletActionTransferCreatedWebhookPayload, Privy::Models::WalletActionTransferFailedWebhookPayload, Privy::Models::WalletActionTransferRejectedWebhookPayload, Privy::Models::WalletActionTransferSucceededWebhookPayload, Privy::Models::YieldClaimConfirmedWebhookPayload, Privy::Models::YieldDepositConfirmedWebhookPayload, Privy::Models::YieldWithdrawConfirmedWebhookPayload)] + end + end +end diff --git a/lib/privy/models/unsigned_ethereum_transaction.rb b/lib/privy/models/unsigned_ethereum_transaction.rb new file mode 100644 index 0000000..4bb0ceb --- /dev/null +++ b/lib/privy/models/unsigned_ethereum_transaction.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + module UnsignedEthereumTransaction + extend Privy::Internal::Type::Union + + # An unsigned standard Ethereum transaction object. Supports EVM transaction types 0, 1, 2, and 4. + variant -> { Privy::UnsignedStandardEthereumTransaction } + + # An unsigned Tempo transaction (type 118) with batched calls. + variant -> { Privy::UnsignedTempoTransaction } + + # @!method self.variants + # @return [Array(Privy::Models::UnsignedStandardEthereumTransaction, Privy::Models::UnsignedTempoTransaction)] + end + end +end diff --git a/lib/privy/models/unsigned_standard_ethereum_transaction.rb b/lib/privy/models/unsigned_standard_ethereum_transaction.rb new file mode 100644 index 0000000..2775c54 --- /dev/null +++ b/lib/privy/models/unsigned_standard_ethereum_transaction.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +module Privy + module Models + class UnsignedStandardEthereumTransaction < Privy::Internal::Type::BaseModel + # @!attribute authorization_list + # + # @return [Array, nil] + optional :authorization_list, -> { Privy::Internal::Type::ArrayOf[Privy::EthereumSign7702Authorization] } + + # @!attribute chain_id + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :chain_id, union: -> { Privy::Quantity } + + # @!attribute data + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :data, String + + # @!attribute from + # + # @return [String, nil] + optional :from, String + + # @!attribute gas_limit + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :gas_limit, union: -> { Privy::Quantity } + + # @!attribute gas_price + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :gas_price, union: -> { Privy::Quantity } + + # @!attribute max_fee_per_gas + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :max_fee_per_gas, union: -> { Privy::Quantity } + + # @!attribute max_priority_fee_per_gas + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :max_priority_fee_per_gas, union: -> { Privy::Quantity } + + # @!attribute nonce + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :nonce, union: -> { Privy::Quantity } + + # @!attribute to + # + # @return [String, nil] + optional :to, String + + # @!attribute type + # + # @return [Float, Privy::Models::UnsignedStandardEthereumTransaction::Type, nil] + optional :type, enum: -> { Privy::UnsignedStandardEthereumTransaction::Type } + + # @!attribute value + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :value, union: -> { Privy::Quantity } + + # @!method initialize(authorization_list: nil, chain_id: nil, data: nil, from: nil, gas_limit: nil, gas_price: nil, max_fee_per_gas: nil, max_priority_fee_per_gas: nil, nonce: nil, to: nil, type: nil, value: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::UnsignedStandardEthereumTransaction} for more details. + # + # An unsigned standard Ethereum transaction object. Supports EVM transaction types + # 0, 1, 2, and 4. + # + # @param authorization_list [Array] + # + # @param chain_id [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param data [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param from [String] + # + # @param gas_limit [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param gas_price [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param max_fee_per_gas [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param max_priority_fee_per_gas [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param nonce [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param to [String] + # + # @param type [Float, Privy::Models::UnsignedStandardEthereumTransaction::Type] + # + # @param value [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + + # @see Privy::Models::UnsignedStandardEthereumTransaction#type + module Type + extend Privy::Internal::Type::Enum + + TYPE_0 = 0 + TYPE_1 = 1 + TYPE_2 = 2 + TYPE_4 = 4 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/unsigned_tempo_transaction.rb b/lib/privy/models/unsigned_tempo_transaction.rb new file mode 100644 index 0000000..5a5ac56 --- /dev/null +++ b/lib/privy/models/unsigned_tempo_transaction.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Privy + module Models + class UnsignedTempoTransaction < Privy::Internal::Type::BaseModel + # @!attribute calls + # + # @return [Array] + required :calls, -> { Privy::Internal::Type::ArrayOf[Privy::TempoCall] } + + # @!attribute type + # + # @return [Float, Privy::Models::UnsignedTempoTransaction::Type] + required :type, enum: -> { Privy::UnsignedTempoTransaction::Type } + + # @!attribute aa_authorization_list + # + # @return [Array, nil] + optional :aa_authorization_list, -> { Privy::Internal::Type::ArrayOf[Privy::TempoAaAuthorization] } + + # @!attribute access_list + # + # @return [Array, nil] + optional :access_list, -> { Privy::Internal::Type::ArrayOf[Privy::UnsignedTempoTransaction::AccessList] } + + # @!attribute chain_id + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :chain_id, union: -> { Privy::Quantity } + + # @!attribute fee_payer_signature + # A fee payer signature for sponsored Tempo transactions (secp256k1 only). + # + # @return [Privy::Models::TempoFeePayerSignature, nil] + optional :fee_payer_signature, -> { Privy::TempoFeePayerSignature } + + # @!attribute fee_token + # + # @return [String, nil] + optional :fee_token, String + + # @!attribute from + # + # @return [String, nil] + optional :from, String + + # @!attribute gas_limit + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :gas_limit, union: -> { Privy::Quantity } + + # @!attribute max_fee_per_gas + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :max_fee_per_gas, union: -> { Privy::Quantity } + + # @!attribute max_priority_fee_per_gas + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :max_priority_fee_per_gas, union: -> { Privy::Quantity } + + # @!attribute nonce + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :nonce, union: -> { Privy::Quantity } + + # @!attribute nonce_key + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :nonce_key, union: -> { Privy::Quantity } + + # @!attribute valid_after + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :valid_after, union: -> { Privy::Quantity } + + # @!attribute valid_before + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + # + # @return [String, Integer, nil] + optional :valid_before, union: -> { Privy::Quantity } + + # @!method initialize(calls:, type:, aa_authorization_list: nil, access_list: nil, chain_id: nil, fee_payer_signature: nil, fee_token: nil, from: nil, gas_limit: nil, max_fee_per_gas: nil, max_priority_fee_per_gas: nil, nonce: nil, nonce_key: nil, valid_after: nil, valid_before: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::UnsignedTempoTransaction} for more details. + # + # An unsigned Tempo transaction (type 118) with batched calls. + # + # @param calls [Array] + # + # @param type [Float, Privy::Models::UnsignedTempoTransaction::Type] + # + # @param aa_authorization_list [Array] + # + # @param access_list [Array] + # + # @param chain_id [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param fee_payer_signature [Privy::Models::TempoFeePayerSignature] A fee payer signature for sponsored Tempo transactions (secp256k1 only). + # + # @param fee_token [String] + # + # @param from [String] + # + # @param gas_limit [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param max_fee_per_gas [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param max_priority_fee_per_gas [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param nonce [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param nonce_key [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param valid_after [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + # + # @param valid_before [String, Integer] A quantity value that can be either a hex string starting with '0x' or a non-neg + + # @see Privy::Models::UnsignedTempoTransaction#type + module Type + extend Privy::Internal::Type::Enum + + TYPE_118 = 118 + + # @!method self.values + # @return [Array] + end + + class AccessList < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute storage_keys + # + # @return [Array] + required :storage_keys, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(address:, storage_keys:) + # @param address [String] + # @param storage_keys [Array] + end + end + end +end diff --git a/lib/privy/models/update_account_from_wallet_ids_input.rb b/lib/privy/models/update_account_from_wallet_ids_input.rb new file mode 100644 index 0000000..cb6ffb6 --- /dev/null +++ b/lib/privy/models/update_account_from_wallet_ids_input.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + class UpdateAccountFromWalletIDsInput < Privy::Internal::Type::BaseModel + # @!attribute wallet_ids + # IDs for wallets to include in this account. + # + # @return [Array] + required :wallet_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute display_name + # An optional display name for the account. + # + # @return [String, nil] + optional :display_name, String + + # @!method initialize(wallet_ids:, display_name: nil) + # Input for updating a digital asset account by adding existing wallets with a + # `wallet_ids` parameter. + # + # @param wallet_ids [Array] IDs for wallets to include in this account. + # + # @param display_name [String] An optional display name for the account. + end + end +end diff --git a/lib/privy/models/update_account_from_wallets_configuration_input.rb b/lib/privy/models/update_account_from_wallets_configuration_input.rb new file mode 100644 index 0000000..3a9703a --- /dev/null +++ b/lib/privy/models/update_account_from_wallets_configuration_input.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Privy + module Models + class UpdateAccountFromWalletsConfigurationInput < Privy::Internal::Type::BaseModel + # @!attribute display_name + # An optional display name for the account. + # + # @return [String, nil] + optional :display_name, String + + # @!attribute wallets_configuration + # Configuration for the wallets on this account. + # + # @return [Array, nil] + optional :wallets_configuration, + -> { Privy::Internal::Type::ArrayOf[Privy::AccountWalletConfigurationItem] } + + # @!method initialize(display_name: nil, wallets_configuration: nil) + # Input for updating a digital asset account with a `wallets_configuration` + # specification. + # + # @param display_name [String] An optional display name for the account. + # + # @param wallets_configuration [Array] Configuration for the wallets on this account. + end + end +end diff --git a/lib/privy/models/update_account_input.rb b/lib/privy/models/update_account_input.rb new file mode 100644 index 0000000..786e501 --- /dev/null +++ b/lib/privy/models/update_account_input.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # Input for updating a digital asset account. + module UpdateAccountInput + extend Privy::Internal::Type::Union + + # Input for updating a digital asset account with a `wallets_configuration` specification. + variant -> { Privy::UpdateAccountFromWalletsConfigurationInput } + + # Input for updating a digital asset account by adding existing wallets with a `wallet_ids` parameter. + variant -> { Privy::UpdateAccountFromWalletIDsInput } + + # @!method self.variants + # @return [Array(Privy::Models::UpdateAccountFromWalletsConfigurationInput, Privy::Models::UpdateAccountFromWalletIDsInput)] + end + end +end diff --git a/lib/privy/models/update_condition_set_request_body.rb b/lib/privy/models/update_condition_set_request_body.rb new file mode 100644 index 0000000..1c69b32 --- /dev/null +++ b/lib/privy/models/update_condition_set_request_body.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Models + class UpdateConditionSetRequestBody < Privy::Internal::Type::BaseModel + # @!attribute name + # Name to assign to condition set. + # + # @return [String, nil] + optional :name, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!method initialize(name: nil, owner: nil, owner_id: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::UpdateConditionSetRequestBody} for more details. + # + # Request body for updating a condition set. At least one field must be provided. + # `owner` and `owner_id` are mutually exclusive. + # + # @param name [String] Name to assign to condition set. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + end + end +end diff --git a/lib/privy/models/update_organization_secret_signing_key_input.rb b/lib/privy/models/update_organization_secret_signing_key_input.rb new file mode 100644 index 0000000..60bb715 --- /dev/null +++ b/lib/privy/models/update_organization_secret_signing_key_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class UpdateOrganizationSecretSigningKeyInput < Privy::Models::OrganizationSecretIDInput + # @!attribute signing_public_key + # P-256 public key in PEM format, or null to clear the configured signing key. + # + # @return [String, nil] + required :signing_public_key, String, nil?: true + + # @!method initialize(signing_public_key:) + # Request body for updating the signing public key on an organization secret. + # + # @param signing_public_key [String, nil] P-256 public key in PEM format, or null to clear the configured signing key. + end + end +end diff --git a/lib/privy/models/user.rb b/lib/privy/models/user.rb new file mode 100644 index 0000000..60de230 --- /dev/null +++ b/lib/privy/models/user.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#create + class User < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!attribute created_at + # Unix timestamp of when the user was created in seconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute has_accepted_terms + # Indicates if the user has accepted the terms of service. + # + # @return [Boolean] + required :has_accepted_terms, Privy::Internal::Type::Boolean + + # @!attribute is_guest + # Indicates if the user is a guest account user. + # + # @return [Boolean] + required :is_guest, Privy::Internal::Type::Boolean + + # @!attribute linked_accounts + # + # @return [Array] + required :linked_accounts, -> { Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount] } + + # @!attribute mfa_methods + # + # @return [Array] + required :mfa_methods, -> { Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod] } + + # @!attribute custom_metadata + # Custom metadata associated with the user. + # + # @return [Hash{Symbol=>String, Float, Boolean}, nil] + optional :custom_metadata, -> { Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem] } + + # @!method initialize(id:, created_at:, has_accepted_terms:, is_guest:, linked_accounts:, mfa_methods:, custom_metadata: nil) + # A Privy user object. + # + # @param id [String] + # + # @param created_at [Float] Unix timestamp of when the user was created in seconds. + # + # @param has_accepted_terms [Boolean] Indicates if the user has accepted the terms of service. + # + # @param is_guest [Boolean] Indicates if the user is a guest account user. + # + # @param linked_accounts [Array] + # + # @param mfa_methods [Array] + # + # @param custom_metadata [Hash{Symbol=>String, Float, Boolean}] Custom metadata associated with the user. + end + end +end diff --git a/lib/privy/models/user_authenticated_webhook_payload.rb b/lib/privy/models/user_authenticated_webhook_payload.rb new file mode 100644 index 0000000..c892d1f --- /dev/null +++ b/lib/privy/models/user_authenticated_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserAuthenticatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute account + # A linked account for the user. + # + # @return [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] + required :account, union: -> { Privy::LinkedAccount } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserAuthenticatedWebhookPayload::Type] + required :type, enum: -> { Privy::UserAuthenticatedWebhookPayload::Type } + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!method initialize(account:, type:, user:) + # Payload for the user.authenticated webhook event. + # + # @param account [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] A linked account for the user. + # + # @param type [Symbol, Privy::Models::UserAuthenticatedWebhookPayload::Type] The type of webhook event. + # + # @param user [Privy::Models::User] A Privy user object. + + # The type of webhook event. + # + # @see Privy::Models::UserAuthenticatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_AUTHENTICATED = :"user.authenticated" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_batch_create_input.rb b/lib/privy/models/user_batch_create_input.rb new file mode 100644 index 0000000..5fff02b --- /dev/null +++ b/lib/privy/models/user_batch_create_input.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserBatchCreateInput < Privy::Internal::Type::BaseModel + # @!attribute users + # + # @return [Array] + required :users, -> { Privy::Internal::Type::ArrayOf[Privy::UserBatchCreateInput::User] } + + # @!method initialize(users:) + # The payload for batch creating users. + # + # @param users [Array] + + class User < Privy::Internal::Type::BaseModel + # @!attribute linked_accounts + # + # @return [Array] + required :linked_accounts, -> { Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccountInput] } + + # @!attribute create_embedded_wallet + # + # @return [Boolean, nil] + optional :create_embedded_wallet, Privy::Internal::Type::Boolean + + # @!attribute create_ethereum_smart_wallet + # + # @return [Boolean, nil] + optional :create_ethereum_smart_wallet, Privy::Internal::Type::Boolean + + # @!attribute create_ethereum_wallet + # + # @return [Boolean, nil] + optional :create_ethereum_wallet, Privy::Internal::Type::Boolean + + # @!attribute create_n_embedded_wallets + # + # @return [Float, nil] + optional :create_n_embedded_wallets, Float + + # @!attribute create_n_ethereum_wallets + # + # @return [Float, nil] + optional :create_n_ethereum_wallets, Float + + # @!attribute create_solana_wallet + # + # @return [Boolean, nil] + optional :create_solana_wallet, Privy::Internal::Type::Boolean + + # @!attribute custom_metadata + # Custom metadata associated with the user. + # + # @return [Hash{Symbol=>String, Float, Boolean}, nil] + optional :custom_metadata, -> { Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem] } + + # @!attribute wallets + # Wallets to create. + # + # @return [Array, nil] + optional :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::WalletCreationInput] } + + # @!method initialize(linked_accounts:, create_embedded_wallet: nil, create_ethereum_smart_wallet: nil, create_ethereum_wallet: nil, create_n_embedded_wallets: nil, create_n_ethereum_wallets: nil, create_solana_wallet: nil, custom_metadata: nil, wallets: nil) + # @param linked_accounts [Array] + # + # @param create_embedded_wallet [Boolean] + # + # @param create_ethereum_smart_wallet [Boolean] + # + # @param create_ethereum_wallet [Boolean] + # + # @param create_n_embedded_wallets [Float] + # + # @param create_n_ethereum_wallets [Float] + # + # @param create_solana_wallet [Boolean] + # + # @param custom_metadata [Hash{Symbol=>String, Float, Boolean}] Custom metadata associated with the user. + # + # @param wallets [Array] Wallets to create. + end + end + end +end diff --git a/lib/privy/models/user_create_params.rb b/lib/privy/models/user_create_params.rb new file mode 100644 index 0000000..8649ba0 --- /dev/null +++ b/lib/privy/models/user_create_params.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#create + class UserCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute linked_accounts + # + # @return [Array] + required :linked_accounts, -> { Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccountInput] } + + # @!attribute custom_metadata + # Custom metadata associated with the user. + # + # @return [Hash{Symbol=>String, Float, Boolean}, nil] + optional :custom_metadata, -> { Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem] } + + # @!attribute wallets + # Wallets to create for the user. + # + # @return [Array, nil] + optional :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::UserCreateParams::Wallet] } + + # @!method initialize(linked_accounts:, custom_metadata: nil, wallets: nil, request_options: {}) + # @param linked_accounts [Array] + # + # @param custom_metadata [Hash{Symbol=>String, Float, Boolean}] Custom metadata associated with the user. + # + # @param wallets [Array] Wallets to create for the user. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + class Wallet < Privy::Internal::Type::BaseModel + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, + -> { Privy::Internal::Type::ArrayOf[Privy::UserCreateParams::Wallet::AdditionalSigner] } + + # @!attribute create_smart_wallet + # Create a smart wallet with this wallet as the signer. Only supported for wallets + # with `chain_type: "ethereum"`. + # + # @return [Boolean, nil] + optional :create_smart_wallet, Privy::Internal::Type::Boolean + + # @!attribute policy_ids + # Policy IDs to enforce on the wallet. Currently, only one policy is supported per + # wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(chain_type:, additional_signers: nil, create_smart_wallet: nil, policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::UserCreateParams::Wallet} for more details. + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param create_smart_wallet [Boolean] Create a smart wallet with this wallet as the signer. Only supported for wallets + # + # @param policy_ids [Array] Policy IDs to enforce on the wallet. Currently, only one policy is supported per + + class AdditionalSigner < Privy::Internal::Type::BaseModel + # @!attribute signer_id + # A unique identifier for a key quorum. + # + # @return [String] + required :signer_id, String + + # @!attribute override_policy_ids + # The array of policy IDs that will be applied to wallet requests. If specified, + # this will override the base policy IDs set on the wallet. Currently, only one + # policy is supported per signer. + # + # @return [Array, nil] + optional :override_policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(signer_id:, override_policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::UserCreateParams::Wallet::AdditionalSigner} for more details. + # + # @param signer_id [String] A unique identifier for a key quorum. + # + # @param override_policy_ids [Array] The array of policy IDs that will be applied to wallet requests. If specified, t + end + end + end + end +end diff --git a/lib/privy/models/user_created_webhook_payload.rb b/lib/privy/models/user_created_webhook_payload.rb new file mode 100644 index 0000000..feff469 --- /dev/null +++ b/lib/privy/models/user_created_webhook_payload.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::UserCreatedWebhookPayload::Type } + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!method initialize(type:, user:) + # Payload for the user.created webhook event. + # + # @param type [Symbol, Privy::Models::UserCreatedWebhookPayload::Type] The type of webhook event. + # + # @param user [Privy::Models::User] A Privy user object. + + # The type of webhook event. + # + # @see Privy::Models::UserCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_CREATED = :"user.created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_delete_params.rb b/lib/privy/models/user_delete_params.rb new file mode 100644 index 0000000..a433842 --- /dev/null +++ b/lib/privy/models/user_delete_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#delete + class UserDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute user_id + # ID of the user. + # + # @return [String] + required :user_id, String + + # @!method initialize(user_id:, request_options: {}) + # @param user_id [String] ID of the user. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_custom_auth_id_params.rb b/lib/privy/models/user_get_by_custom_auth_id_params.rb new file mode 100644 index 0000000..e973de1 --- /dev/null +++ b/lib/privy/models/user_get_by_custom_auth_id_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_custom_auth_id + class UserGetByCustomAuthIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute custom_user_id + # + # @return [String] + required :custom_user_id, String + + # @!method initialize(custom_user_id:, request_options: {}) + # @param custom_user_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_discord_username_params.rb b/lib/privy/models/user_get_by_discord_username_params.rb new file mode 100644 index 0000000..d03099b --- /dev/null +++ b/lib/privy/models/user_get_by_discord_username_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_discord_username + class UserGetByDiscordUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(username:, request_options: {}) + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_email_address_params.rb b/lib/privy/models/user_get_by_email_address_params.rb new file mode 100644 index 0000000..a6ed230 --- /dev/null +++ b/lib/privy/models/user_get_by_email_address_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_email_address + class UserGetByEmailAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:, request_options: {}) + # @param address [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_farcaster_id_params.rb b/lib/privy/models/user_get_by_farcaster_id_params.rb new file mode 100644 index 0000000..c2aac65 --- /dev/null +++ b/lib/privy/models/user_get_by_farcaster_id_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_farcaster_id + class UserGetByFarcasterIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute fid + # + # @return [Float] + required :fid, Float + + # @!method initialize(fid:, request_options: {}) + # @param fid [Float] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_github_username_params.rb b/lib/privy/models/user_get_by_github_username_params.rb new file mode 100644 index 0000000..814e818 --- /dev/null +++ b/lib/privy/models/user_get_by_github_username_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_github_username + class UserGetByGitHubUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(username:, request_options: {}) + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_phone_number_params.rb b/lib/privy/models/user_get_by_phone_number_params.rb new file mode 100644 index 0000000..4adeb2b --- /dev/null +++ b/lib/privy/models/user_get_by_phone_number_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_phone_number + class UserGetByPhoneNumberParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute number + # + # @return [String] + required :number, String + + # @!method initialize(number:, request_options: {}) + # @param number [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_smart_wallet_address_params.rb b/lib/privy/models/user_get_by_smart_wallet_address_params.rb new file mode 100644 index 0000000..ee343c4 --- /dev/null +++ b/lib/privy/models/user_get_by_smart_wallet_address_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_smart_wallet_address + class UserGetBySmartWalletAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:, request_options: {}) + # @param address [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_telegram_user_id_params.rb b/lib/privy/models/user_get_by_telegram_user_id_params.rb new file mode 100644 index 0000000..c11cc43 --- /dev/null +++ b/lib/privy/models/user_get_by_telegram_user_id_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_telegram_user_id + class UserGetByTelegramUserIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute telegram_user_id + # + # @return [String] + required :telegram_user_id, String + + # @!method initialize(telegram_user_id:, request_options: {}) + # @param telegram_user_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_telegram_username_params.rb b/lib/privy/models/user_get_by_telegram_username_params.rb new file mode 100644 index 0000000..d18651b --- /dev/null +++ b/lib/privy/models/user_get_by_telegram_username_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_telegram_username + class UserGetByTelegramUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(username:, request_options: {}) + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_twitter_subject_params.rb b/lib/privy/models/user_get_by_twitter_subject_params.rb new file mode 100644 index 0000000..54f756c --- /dev/null +++ b/lib/privy/models/user_get_by_twitter_subject_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_twitter_subject + class UserGetByTwitterSubjectParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute subject + # + # @return [String] + required :subject, String + + # @!method initialize(subject:, request_options: {}) + # @param subject [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_twitter_username_params.rb b/lib/privy/models/user_get_by_twitter_username_params.rb new file mode 100644 index 0000000..064ddf2 --- /dev/null +++ b/lib/privy/models/user_get_by_twitter_username_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_twitter_username + class UserGetByTwitterUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute username + # + # @return [String] + required :username, String + + # @!method initialize(username:, request_options: {}) + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_by_wallet_address_params.rb b/lib/privy/models/user_get_by_wallet_address_params.rb new file mode 100644 index 0000000..71c9f8c --- /dev/null +++ b/lib/privy/models/user_get_by_wallet_address_params.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get_by_wallet_address + class UserGetByWalletAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute address + # + # @return [String] + required :address, String + + # @!method initialize(address:, request_options: {}) + # @param address [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_get_params.rb b/lib/privy/models/user_get_params.rb new file mode 100644 index 0000000..3b05677 --- /dev/null +++ b/lib/privy/models/user_get_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#get + class UserGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute user_id + # User ID + # + # @return [String] + required :user_id, String + + # @!method initialize(user_id:, request_options: {}) + # @param user_id [String] User ID + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_invite_input.rb b/lib/privy/models/user_invite_input.rb new file mode 100644 index 0000000..b49f50e --- /dev/null +++ b/lib/privy/models/user_invite_input.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + # Input for adding or removing an allowlist entry. Discriminated by type. + module UserInviteInput + extend Privy::Internal::Type::Union + + discriminator :type + + # Allowlist invite input for an email address. + variant :email, -> { Privy::EmailInviteInput } + + # Allowlist invite input for an email domain. + variant :emailDomain, -> { Privy::EmailDomainInviteInput } + + # Allowlist invite input for a wallet address. + variant :wallet, -> { Privy::WalletInviteInput } + + # Allowlist invite input for a phone number. + variant :phone, -> { Privy::PhoneInviteInput } + + # @!method self.variants + # @return [Array(Privy::Models::EmailInviteInput, Privy::Models::EmailDomainInviteInput, Privy::Models::WalletInviteInput, Privy::Models::PhoneInviteInput)] + end + end +end diff --git a/lib/privy/models/user_linked_account_webhook_payload.rb b/lib/privy/models/user_linked_account_webhook_payload.rb new file mode 100644 index 0000000..075afd1 --- /dev/null +++ b/lib/privy/models/user_linked_account_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserLinkedAccountWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute account + # A linked account for the user. + # + # @return [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] + required :account, union: -> { Privy::LinkedAccount } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserLinkedAccountWebhookPayload::Type] + required :type, enum: -> { Privy::UserLinkedAccountWebhookPayload::Type } + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!method initialize(account:, type:, user:) + # Payload for the user.linked_account webhook event. + # + # @param account [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] A linked account for the user. + # + # @param type [Symbol, Privy::Models::UserLinkedAccountWebhookPayload::Type] The type of webhook event. + # + # @param user [Privy::Models::User] A Privy user object. + + # The type of webhook event. + # + # @see Privy::Models::UserLinkedAccountWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_LINKED_ACCOUNT = :"user.linked_account" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_list_params.rb b/lib/privy/models/user_list_params.rb new file mode 100644 index 0000000..c07d8e7 --- /dev/null +++ b/lib/privy/models/user_list_params.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#list + class UserListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute cursor + # + # @return [String, nil] + optional :cursor, String + + # @!attribute limit + # + # @return [Float, nil] + optional :limit, Float, nil?: true + + # @!method initialize(cursor: nil, limit: nil, request_options: {}) + # @param cursor [String] + # @param limit [Float, nil] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_operation_completed_webhook_payload.rb b/lib/privy/models/user_operation_completed_webhook_payload.rb new file mode 100644 index 0000000..ebfd08c --- /dev/null +++ b/lib/privy/models/user_operation_completed_webhook_payload.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserOperationCompletedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute actual_gas_cost + # + # @return [String] + required :actual_gas_cost, String + + # @!attribute actual_gas_used + # + # @return [String] + required :actual_gas_used, String + + # @!attribute block_number + # + # @return [Float] + required :block_number, Float + + # @!attribute caip2 + # + # @return [String] + required :caip2, String + + # @!attribute log_index + # + # @return [Float] + required :log_index, Float + + # @!attribute nonce + # + # @return [String] + required :nonce, String + + # @!attribute paymaster + # + # @return [String, nil] + required :paymaster, String, nil?: true + + # @!attribute sender + # + # @return [String] + required :sender, String + + # @!attribute success + # + # @return [Boolean] + required :success, Privy::Internal::Type::Boolean + + # @!attribute transaction_hash + # + # @return [String] + required :transaction_hash, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserOperationCompletedWebhookPayload::Type] + required :type, enum: -> { Privy::UserOperationCompletedWebhookPayload::Type } + + # @!attribute user_op_hash + # + # @return [String] + required :user_op_hash, String + + # @!method initialize(actual_gas_cost:, actual_gas_used:, block_number:, caip2:, log_index:, nonce:, paymaster:, sender:, success:, transaction_hash:, type:, user_op_hash:) + # Payload for the user_operation.completed webhook event. + # + # @param actual_gas_cost [String] + # + # @param actual_gas_used [String] + # + # @param block_number [Float] + # + # @param caip2 [String] + # + # @param log_index [Float] + # + # @param nonce [String] + # + # @param paymaster [String, nil] + # + # @param sender [String] + # + # @param success [Boolean] + # + # @param transaction_hash [String] + # + # @param type [Symbol, Privy::Models::UserOperationCompletedWebhookPayload::Type] The type of webhook event. + # + # @param user_op_hash [String] + + # The type of webhook event. + # + # @see Privy::Models::UserOperationCompletedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_OPERATION_COMPLETED = :"user_operation.completed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_operation_input.rb b/lib/privy/models/user_operation_input.rb new file mode 100644 index 0000000..9830de6 --- /dev/null +++ b/lib/privy/models/user_operation_input.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserOperationInput < Privy::Internal::Type::BaseModel + # @!attribute call_data + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :call_data, String + + # @!attribute call_gas_limit + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :call_gas_limit, String + + # @!attribute max_fee_per_gas + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :max_fee_per_gas, String + + # @!attribute max_priority_fee_per_gas + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :max_priority_fee_per_gas, String + + # @!attribute nonce + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :nonce, String + + # @!attribute pre_verification_gas + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :pre_verification_gas, String + + # @!attribute sender + # + # @return [String] + required :sender, String + + # @!attribute verification_gas_limit + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String] + required :verification_gas_limit, String + + # @!attribute paymaster + # + # @return [String, nil] + optional :paymaster, String + + # @!attribute paymaster_data + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :paymaster_data, String + + # @!attribute paymaster_post_op_gas_limit + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :paymaster_post_op_gas_limit, String + + # @!attribute paymaster_verification_gas_limit + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + # + # @return [String, nil] + optional :paymaster_verification_gas_limit, String + + # @!method initialize(call_data:, call_gas_limit:, max_fee_per_gas:, max_priority_fee_per_gas:, nonce:, pre_verification_gas:, sender:, verification_gas_limit:, paymaster: nil, paymaster_data: nil, paymaster_post_op_gas_limit: nil, paymaster_verification_gas_limit: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::UserOperationInput} for more details. + # + # An ERC-4337 user operation. + # + # @param call_data [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param call_gas_limit [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param max_fee_per_gas [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param max_priority_fee_per_gas [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param nonce [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param pre_verification_gas [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param sender [String] + # + # @param verification_gas_limit [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param paymaster [String] + # + # @param paymaster_data [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param paymaster_post_op_gas_limit [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + # + # @param paymaster_verification_gas_limit [String] A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 byt + end + end +end diff --git a/lib/privy/models/user_owned_recovery_option.rb b/lib/privy/models/user_owned_recovery_option.rb new file mode 100644 index 0000000..12e3adf --- /dev/null +++ b/lib/privy/models/user_owned_recovery_option.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # A user-owned recovery option for embedded wallets. + module UserOwnedRecoveryOption + extend Privy::Internal::Type::Enum + + USER_PASSCODE = :"user-passcode" + GOOGLE_DRIVE = :"google-drive" + ICLOUD = :icloud + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/user_pregenerate_wallets_params.rb b/lib/privy/models/user_pregenerate_wallets_params.rb new file mode 100644 index 0000000..6ef2bdb --- /dev/null +++ b/lib/privy/models/user_pregenerate_wallets_params.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#pregenerate_wallets + class UserPregenerateWalletsParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute user_id + # ID of the user. + # + # @return [String] + required :user_id, String + + # @!attribute wallets + # + # @return [Array] + required :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::WalletCreationInput] } + + # @!method initialize(user_id:, wallets:, request_options: {}) + # @param user_id [String] ID of the user. + # + # @param wallets [Array] + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_search_params.rb b/lib/privy/models/user_search_params.rb new file mode 100644 index 0000000..eff06de --- /dev/null +++ b/lib/privy/models/user_search_params.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#search + class UserSearchParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute body + # + # @return [Privy::Models::UserSearchParams::Body::SearchTerm, Privy::Models::UserSearchParams::Body::UnionMember1] + required :body, union: -> { Privy::UserSearchParams::Body } + + # @!method initialize(body:, request_options: {}) + # @param body [Privy::Models::UserSearchParams::Body::SearchTerm, Privy::Models::UserSearchParams::Body::UnionMember1] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + module Body + extend Privy::Internal::Type::Union + + variant -> { Privy::UserSearchParams::Body::SearchTerm } + + variant -> { Privy::UserSearchParams::Body::UnionMember1 } + + class SearchTerm < Privy::Internal::Type::BaseModel + # @!attribute search_term + # + # @return [String] + required :search_term, String, api_name: :searchTerm + + # @!method initialize(search_term:) + # @param search_term [String] + end + + class UnionMember1 < Privy::Internal::Type::BaseModel + # @!attribute emails + # + # @return [Array] + required :emails, Privy::Internal::Type::ArrayOf[String] + + # @!attribute phone_numbers + # + # @return [Array] + required :phone_numbers, Privy::Internal::Type::ArrayOf[String], api_name: :phoneNumbers + + # @!attribute wallet_addresses + # + # @return [Array] + required :wallet_addresses, Privy::Internal::Type::ArrayOf[String], api_name: :walletAddresses + + # @!method initialize(emails:, phone_numbers:, wallet_addresses:) + # @param emails [Array] + # @param phone_numbers [Array] + # @param wallet_addresses [Array] + end + + # @!method self.variants + # @return [Array(Privy::Models::UserSearchParams::Body::SearchTerm, Privy::Models::UserSearchParams::Body::UnionMember1)] + end + end + end +end diff --git a/lib/privy/models/user_set_custom_metadata_params.rb b/lib/privy/models/user_set_custom_metadata_params.rb new file mode 100644 index 0000000..f11cccb --- /dev/null +++ b/lib/privy/models/user_set_custom_metadata_params.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#set_custom_metadata + class UserSetCustomMetadataParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute user_id + # ID of the user. + # + # @return [String] + required :user_id, String + + # @!attribute custom_metadata + # Custom metadata associated with the user. + # + # @return [Hash{Symbol=>String, Float, Boolean}] + required :custom_metadata, -> { Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem] } + + # @!method initialize(user_id:, custom_metadata:, request_options: {}) + # @param user_id [String] ID of the user. + # + # @param custom_metadata [Hash{Symbol=>String, Float, Boolean}] Custom metadata associated with the user. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_transferred_account_webhook_payload.rb b/lib/privy/models/user_transferred_account_webhook_payload.rb new file mode 100644 index 0000000..ab769cc --- /dev/null +++ b/lib/privy/models/user_transferred_account_webhook_payload.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserTransferredAccountWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute account + # A linked account for the user. + # + # @return [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] + required :account, union: -> { Privy::LinkedAccount } + + # @!attribute deleted_user + # + # @return [Boolean, Privy::Models::UserTransferredAccountWebhookPayload::DeletedUser] + required :deleted_user, + enum: -> { Privy::UserTransferredAccountWebhookPayload::DeletedUser }, + api_name: :deletedUser + + # @!attribute from_user + # + # @return [Privy::Models::UserTransferredAccountWebhookPayload::FromUser] + required :from_user, -> { Privy::UserTransferredAccountWebhookPayload::FromUser }, api_name: :fromUser + + # @!attribute to_user + # A Privy user object. + # + # @return [Privy::Models::User] + required :to_user, -> { Privy::User }, api_name: :toUser + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserTransferredAccountWebhookPayload::Type] + required :type, enum: -> { Privy::UserTransferredAccountWebhookPayload::Type } + + # @!method initialize(account:, deleted_user:, from_user:, to_user:, type:) + # Payload for the user.transferred_account webhook event. + # + # @param account [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] A linked account for the user. + # + # @param deleted_user [Boolean, Privy::Models::UserTransferredAccountWebhookPayload::DeletedUser] + # + # @param from_user [Privy::Models::UserTransferredAccountWebhookPayload::FromUser] + # + # @param to_user [Privy::Models::User] A Privy user object. + # + # @param type [Symbol, Privy::Models::UserTransferredAccountWebhookPayload::Type] The type of webhook event. + + # @see Privy::Models::UserTransferredAccountWebhookPayload#deleted_user + module DeletedUser + extend Privy::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + + # @see Privy::Models::UserTransferredAccountWebhookPayload#from_user + class FromUser < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # @param id [String] + end + + # The type of webhook event. + # + # @see Privy::Models::UserTransferredAccountWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_TRANSFERRED_ACCOUNT = :"user.transferred_account" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_unlink_linked_account_params.rb b/lib/privy/models/user_unlink_linked_account_params.rb new file mode 100644 index 0000000..3e5869e --- /dev/null +++ b/lib/privy/models/user_unlink_linked_account_params.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Users#unlink_linked_account + class UserUnlinkLinkedAccountParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute user_id + # ID of the user. + # + # @return [String] + required :user_id, String + + # @!attribute handle + # + # @return [String] + required :handle, String + + # @!attribute type + # The possible types of linked accounts. + # + # @return [Symbol, String, Privy::Models::LinkedAccountType] + required :type, union: -> { Privy::LinkedAccountType } + + # @!attribute provider + # + # @return [String, nil] + optional :provider, String + + # @!method initialize(user_id:, handle:, type:, provider: nil, request_options: {}) + # @param user_id [String] ID of the user. + # + # @param handle [String] + # + # @param type [Symbol, String, Privy::Models::LinkedAccountType] The possible types of linked accounts. + # + # @param provider [String] + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/user_unlinked_account_webhook_payload.rb b/lib/privy/models/user_unlinked_account_webhook_payload.rb new file mode 100644 index 0000000..56476ba --- /dev/null +++ b/lib/privy/models/user_unlinked_account_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserUnlinkedAccountWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute account + # A linked account for the user. + # + # @return [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] + required :account, union: -> { Privy::LinkedAccount } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserUnlinkedAccountWebhookPayload::Type] + required :type, enum: -> { Privy::UserUnlinkedAccountWebhookPayload::Type } + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!method initialize(account:, type:, user:) + # Payload for the user.unlinked_account webhook event. + # + # @param account [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] A linked account for the user. + # + # @param type [Symbol, Privy::Models::UserUnlinkedAccountWebhookPayload::Type] The type of webhook event. + # + # @param user [Privy::Models::User] A Privy user object. + + # The type of webhook event. + # + # @see Privy::Models::UserUnlinkedAccountWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_UNLINKED_ACCOUNT = :"user.unlinked_account" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_updated_account_webhook_payload.rb b/lib/privy/models/user_updated_account_webhook_payload.rb new file mode 100644 index 0000000..ec785d4 --- /dev/null +++ b/lib/privy/models/user_updated_account_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserUpdatedAccountWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute account + # A linked account for the user. + # + # @return [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] + required :account, union: -> { Privy::LinkedAccount } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserUpdatedAccountWebhookPayload::Type] + required :type, enum: -> { Privy::UserUpdatedAccountWebhookPayload::Type } + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!method initialize(account:, type:, user:) + # Payload for the user.updated_account webhook event. + # + # @param account [Privy::Models::LinkedAccountEmail, Privy::Models::LinkedAccountPhone, Privy::Models::LinkedAccountEthereum, Privy::Models::LinkedAccountSolana, Privy::Models::LinkedAccountSmartWallet, Privy::Models::LinkedAccountEthereumEmbeddedWallet, Privy::Models::LinkedAccountSolanaEmbeddedWallet, Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet, Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet, Privy::Models::LinkedAccountCurveSigningEmbeddedWallet, Privy::Models::LinkedAccountGoogleOAuth, Privy::Models::LinkedAccountTwitterOAuth, Privy::Models::LinkedAccountDiscordOAuth, Privy::Models::LinkedAccountGitHubOAuth, Privy::Models::LinkedAccountSpotifyOAuth, Privy::Models::LinkedAccountInstagramOAuth, Privy::Models::LinkedAccountTiktokOAuth, Privy::Models::LinkedAccountLineOAuth, Privy::Models::LinkedAccountTwitchOAuth, Privy::Models::LinkedAccountLinkedInOAuth, Privy::Models::LinkedAccountAppleOAuth, Privy::Models::LinkedAccountCustomOAuth, Privy::Models::LinkedAccountCustomJwt, Privy::Models::LinkedAccountFarcaster, Privy::Models::LinkedAccountPasskey, Privy::Models::LinkedAccountTelegram, Privy::Models::LinkedAccountCrossApp, Privy::Models::LinkedAccountAuthorizationKey] A linked account for the user. + # + # @param type [Symbol, Privy::Models::UserUpdatedAccountWebhookPayload::Type] The type of webhook event. + # + # @param user [Privy::Models::User] A Privy user object. + + # The type of webhook event. + # + # @see Privy::Models::UserUpdatedAccountWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_UPDATED_ACCOUNT = :"user.updated_account" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_wallet_created_webhook_payload.rb b/lib/privy/models/user_wallet_created_webhook_payload.rb new file mode 100644 index 0000000..5a97d69 --- /dev/null +++ b/lib/privy/models/user_wallet_created_webhook_payload.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserWalletCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::UserWalletCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::UserWalletCreatedWebhookPayload::Type } + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!attribute wallet + # Base schema for wallet accounts linked to the user. + # + # @return [Privy::Models::LinkedAccountBaseWallet] + required :wallet, -> { Privy::LinkedAccountBaseWallet } + + # @!method initialize(type:, user:, wallet:) + # Payload for the user.wallet_created webhook event. + # + # @param type [Symbol, Privy::Models::UserWalletCreatedWebhookPayload::Type] The type of webhook event. + # + # @param user [Privy::Models::User] A Privy user object. + # + # @param wallet [Privy::Models::LinkedAccountBaseWallet] Base schema for wallet accounts linked to the user. + + # The type of webhook event. + # + # @see Privy::Models::UserWalletCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + USER_WALLET_CREATED = :"user.wallet_created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/user_with_identity_token.rb b/lib/privy/models/user_with_identity_token.rb new file mode 100644 index 0000000..599ca01 --- /dev/null +++ b/lib/privy/models/user_with_identity_token.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + class UserWithIdentityToken < Privy::Internal::Type::BaseModel + # @!attribute identity_token + # + # @return [String, nil] + required :identity_token, String, nil?: true + + # @!attribute user + # A Privy user object. + # + # @return [Privy::Models::User] + required :user, -> { Privy::User } + + # @!method initialize(identity_token:, user:) + # The user object along their identity token. + # + # @param identity_token [String, nil] + # + # @param user [Privy::Models::User] A Privy user object. + end + end +end diff --git a/lib/privy/models/wallet.rb b/lib/privy/models/wallet.rb new file mode 100644 index 0000000..1d5b8ff --- /dev/null +++ b/lib/privy/models/wallet.rb @@ -0,0 +1,131 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#create + class Wallet < Privy::Internal::Type::BaseModel + # @!attribute id + # Unique ID of the wallet. This will be the primary identifier when using the + # wallet in the future. + # + # @return [String] + required :id, String + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array] + required :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem] } + + # @!attribute address + # Address of the wallet. + # + # @return [String] + required :address, String + + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute created_at + # Unix timestamp of when the wallet was created in milliseconds. + # + # @return [Float] + required :created_at, Float + + # @!attribute exported_at + # Unix timestamp of when the wallet was exported in milliseconds, if the wallet + # was exported. + # + # @return [Float, nil] + required :exported_at, Float, nil?: true + + # @!attribute imported_at + # Unix timestamp of when the wallet was imported in milliseconds, if the wallet + # was imported. + # + # @return [Float, nil] + required :imported_at, Float, nil?: true + + # @!attribute owner_id + # The key quorum ID of the owner of the wallet. + # + # @return [String, nil] + required :owner_id, String, nil?: true + + # @!attribute policy_ids + # List of policy IDs for policies that are enforced on the wallet. + # + # @return [Array] + required :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute authorization_threshold + # The number of keys that must sign for an action to be valid. + # + # @return [Float, nil] + optional :authorization_threshold, Float + + # @!attribute custody + # Information about the custodian managing this wallet. + # + # @return [Privy::Models::WalletCustodian, nil] + optional :custody, -> { Privy::WalletCustodian } + + # @!attribute display_name + # A human-readable label for the wallet. + # + # @return [String, nil] + optional :display_name, String + + # @!attribute external_id + # A customer-provided identifier for mapping to external systems. Write-once, set + # only at creation. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute public_key + # The compressed, raw public key for the wallet along the chain cryptographic + # curve. + # + # @return [String, nil] + optional :public_key, String + + # @!method initialize(id:, additional_signers:, address:, chain_type:, created_at:, exported_at:, imported_at:, owner_id:, policy_ids:, authorization_threshold: nil, custody: nil, display_name: nil, external_id: nil, public_key: nil) + # Some parameter documentations has been truncated, see {Privy::Models::Wallet} + # for more details. + # + # A wallet managed by Privy's wallet infrastructure. + # + # @param id [String] Unique ID of the wallet. This will be the primary identifier when using the wall + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param address [String] Address of the wallet. + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param created_at [Float] Unix timestamp of when the wallet was created in milliseconds. + # + # @param exported_at [Float, nil] Unix timestamp of when the wallet was exported in milliseconds, if the wallet wa + # + # @param imported_at [Float, nil] Unix timestamp of when the wallet was imported in milliseconds, if the wallet wa + # + # @param owner_id [String, nil] The key quorum ID of the owner of the wallet. + # + # @param policy_ids [Array] List of policy IDs for policies that are enforced on the wallet. + # + # @param authorization_threshold [Float] The number of keys that must sign for an action to be valid. + # + # @param custody [Privy::Models::WalletCustodian] Information about the custodian managing this wallet. + # + # @param display_name [String] A human-readable label for the wallet. + # + # @param external_id [String] A customer-provided identifier for mapping to external systems. Write-once, set + # + # @param public_key [String] The compressed, raw public key for the wallet along the chain cryptographic curv + end + end +end diff --git a/lib/privy/models/wallet_action_earn_deposit_created_webhook_payload.rb b/lib/privy/models/wallet_action_earn_deposit_created_webhook_payload.rb new file mode 100644 index 0000000..7a048dd --- /dev/null +++ b/lib/privy/models/wallet_action_earn_deposit_created_webhook_payload.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnDepositCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute raw_amount + # Base-unit amount of asset deposited (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnDepositCreatedWebhookPayload::Status } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnDepositCreatedWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, raw_amount:, status:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnDepositCreatedWebhookPayload} for more details. + # + # Payload for the wallet_action.earn_deposit.created webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param raw_amount [String] Base-unit amount of asset deposited (e.g. "1500000"). + # + # @param status [Symbol, Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::Status] The status of the wallet action. + # + # @param type [Symbol, Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnDepositCreatedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnDepositCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_CREATED = :"wallet_action.earn_deposit.created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rb b/lib/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rb new file mode 100644 index 0000000..acc1b7b --- /dev/null +++ b/lib/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnDepositFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute raw_amount + # Base-unit amount of asset deposited (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositFailedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnDepositFailedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositFailedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnDepositFailedWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, failure_reason:, raw_amount:, status:, steps:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnDepositFailedWebhookPayload} for more details. + # + # Payload for the wallet_action.earn_deposit.failed webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param raw_amount [String] Base-unit amount of asset deposited (e.g. "1500000"). + # + # @param status [Symbol, Privy::Models::WalletActionEarnDepositFailedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action. Completed steps will have transaction hashes; th + # + # @param type [Symbol, Privy::Models::WalletActionEarnDepositFailedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnDepositFailedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + FAILED = :failed + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnDepositFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_FAILED = :"wallet_action.earn_deposit.failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rb b/lib/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rb new file mode 100644 index 0000000..d58a1fb --- /dev/null +++ b/lib/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rb @@ -0,0 +1,160 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnDepositRejectedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute raw_amount + # Base-unit amount of asset deposited (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnDepositRejectedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action at the time of rejection. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnDepositRejectedWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, failure_reason:, raw_amount:, status:, steps:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnDepositRejectedWebhookPayload} for more details. + # + # Payload for the wallet_action.earn_deposit.rejected webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param raw_amount [String] Base-unit amount of asset deposited (e.g. "1500000"). + # + # @param status [Symbol, Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action at the time of rejection. + # + # @param type [Symbol, Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnDepositRejectedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + REJECTED = :rejected + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnDepositRejectedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_REJECTED = :"wallet_action.earn_deposit.rejected" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rb b/lib/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rb new file mode 100644 index 0000000..2b2ae9f --- /dev/null +++ b/lib/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnDepositSucceededWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute raw_amount + # Base-unit amount of asset deposited (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute share_amount + # Vault shares received in base units. + # + # @return [String] + required :share_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnDepositSucceededWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action, including transaction hashes. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnDepositSucceededWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, raw_amount:, share_amount:, status:, steps:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnDepositSucceededWebhookPayload} for more + # details. + # + # Payload for the wallet_action.earn_deposit.succeeded webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param raw_amount [String] Base-unit amount of asset deposited (e.g. "1500000"). + # + # @param share_amount [String] Vault shares received in base units. + # + # @param status [Symbol, Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action, including transaction hashes. + # + # @param type [Symbol, Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnDepositSucceededWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED = :succeeded + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnDepositSucceededWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_SUCCEEDED = :"wallet_action.earn_deposit.succeeded" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rb b/lib/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rb new file mode 100644 index 0000000..a30f9d0 --- /dev/null +++ b/lib/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnIncentiveClaimCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute chain + # EVM chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :chain, String + + # @!attribute rewards + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @return [Array, nil] + required :rewards, + -> { + Privy::Internal::Type::ArrayOf[Privy::EarnIncetiveClaimRewardEntry] + }, + nil?: true + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, chain:, rewards:, status:, type:, wallet_action_id:, wallet_id:) + # Payload for the wallet_action.earn_incentive_claim.created webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param chain [String] EVM chain name (e.g. "base", "ethereum"). + # + # @param rewards [Array, nil] Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @param status [Symbol, Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status] The status of the wallet action. + # + # @param type [Symbol, Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_CREATED = :"wallet_action.earn_incentive_claim.created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rb b/lib/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rb new file mode 100644 index 0000000..cfcd6ac --- /dev/null +++ b/lib/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnIncentiveClaimFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute chain + # EVM chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :chain, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute rewards + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @return [Array, nil] + required :rewards, + -> { + Privy::Internal::Type::ArrayOf[Privy::EarnIncetiveClaimRewardEntry] + }, + nil?: true + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, chain:, failure_reason:, rewards:, status:, steps:, type:, wallet_action_id:, wallet_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload} for more + # details. + # + # Payload for the wallet_action.earn_incentive_claim.failed webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param chain [String] EVM chain name (e.g. "base", "ethereum"). + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param rewards [Array, nil] Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @param status [Symbol, Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action. Completed steps will have transaction hashes; th + # + # @param type [Symbol, Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + FAILED = :failed + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_FAILED = :"wallet_action.earn_incentive_claim.failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rb b/lib/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rb new file mode 100644 index 0000000..1c7cc28 --- /dev/null +++ b/lib/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnIncentiveClaimRejectedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute chain + # EVM chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :chain, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute rewards + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @return [Array, nil] + required :rewards, + -> { + Privy::Internal::Type::ArrayOf[Privy::EarnIncetiveClaimRewardEntry] + }, + nil?: true + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action at the time of rejection. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, chain:, failure_reason:, rewards:, status:, steps:, type:, wallet_action_id:, wallet_id:) + # Payload for the wallet_action.earn_incentive_claim.rejected webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param chain [String] EVM chain name (e.g. "base", "ethereum"). + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param rewards [Array, nil] Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @param status [Symbol, Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action at the time of rejection. + # + # @param type [Symbol, Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + REJECTED = :rejected + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_REJECTED = :"wallet_action.earn_incentive_claim.rejected" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rb b/lib/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rb new file mode 100644 index 0000000..daa2d58 --- /dev/null +++ b/lib/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnIncentiveClaimSucceededWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute chain + # EVM chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :chain, String + + # @!attribute rewards + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @return [Array, nil] + required :rewards, + -> { + Privy::Internal::Type::ArrayOf[Privy::EarnIncetiveClaimRewardEntry] + }, + nil?: true + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action, including transaction hashes. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, chain:, rewards:, status:, steps:, type:, wallet_action_id:, wallet_id:) + # Payload for the wallet_action.earn_incentive_claim.succeeded webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param chain [String] EVM chain name (e.g. "base", "ethereum"). + # + # @param rewards [Array, nil] Claimed reward tokens. Populated after the preparation step fetches from Merkl. + # + # @param status [Symbol, Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action, including transaction hashes. + # + # @param type [Symbol, Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED = :succeeded + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_SUCCEEDED = :"wallet_action.earn_incentive_claim.succeeded" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rb b/lib/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rb new file mode 100644 index 0000000..e9c1770 --- /dev/null +++ b/lib/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnWithdrawCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute raw_amount + # Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Status } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, raw_amount:, status:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload} for more details. + # + # Payload for the wallet_action.earn_withdraw.created webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param raw_amount [String] Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @param status [Symbol, Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::Status] The status of the wallet action. + # + # @param type [Symbol, Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_CREATED = :"wallet_action.earn_withdraw.created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rb b/lib/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rb new file mode 100644 index 0000000..0dcbe18 --- /dev/null +++ b/lib/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnWithdrawFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute raw_amount + # Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnWithdrawFailedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnWithdrawFailedWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, failure_reason:, raw_amount:, status:, steps:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload} for more details. + # + # Payload for the wallet_action.earn_withdraw.failed webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param raw_amount [String] Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @param status [Symbol, Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action. Completed steps will have transaction hashes; th + # + # @param type [Symbol, Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + FAILED = :failed + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_FAILED = :"wallet_action.earn_withdraw.failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rb b/lib/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rb new file mode 100644 index 0000000..c4ab730 --- /dev/null +++ b/lib/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnWithdrawRejectedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute raw_amount + # Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action at the time of rejection. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, failure_reason:, raw_amount:, status:, steps:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload} for more + # details. + # + # Payload for the wallet_action.earn_withdraw.rejected webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param raw_amount [String] Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @param status [Symbol, Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action at the time of rejection. + # + # @param type [Symbol, Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + REJECTED = :rejected + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_REJECTED = :"wallet_action.earn_withdraw.rejected" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rb b/lib/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rb new file mode 100644 index 0000000..b56ea42 --- /dev/null +++ b/lib/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rb @@ -0,0 +1,161 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionEarnWithdrawSucceededWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute asset_address + # Underlying asset token address. + # + # @return [String] + required :asset_address, String + + # @!attribute caip2 + # CAIP-2 chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute raw_amount + # Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @return [String] + required :raw_amount, String + + # @!attribute share_amount + # Vault shares burned in base units. + # + # @return [String] + required :share_amount, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action, including transaction hashes. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Type } + + # @!attribute vault_address + # ERC-4626 vault contract address. + # + # @return [String] + required :vault_address, String + + # @!attribute vault_id + # The vault ID. + # + # @return [String] + required :vault_id, String + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute amount + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + # + # @return [String, nil] + optional :amount, String + + # @!attribute asset + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + # + # @return [String, nil] + optional :asset, String + + # @!attribute decimals + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + # + # @return [Integer, nil] + optional :decimals, Integer + + # @!method initialize(action_type:, asset_address:, caip2:, raw_amount:, share_amount:, status:, steps:, type:, vault_address:, vault_id:, wallet_action_id:, wallet_id:, amount: nil, asset: nil, decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload} for more + # details. + # + # Payload for the wallet_action.earn_withdraw.succeeded webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param asset_address [String] Underlying asset token address. + # + # @param caip2 [String] CAIP-2 chain identifier. + # + # @param raw_amount [String] Base-unit amount of asset withdrawn (e.g. "1500000"). + # + # @param share_amount [String] Vault shares burned in base units. + # + # @param status [Symbol, Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action, including transaction hashes. + # + # @param type [Symbol, Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] ERC-4626 vault contract address. + # + # @param vault_id [String] The vault ID. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param amount [String] Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # + # @param asset [String] Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in t + # + # @param decimals [Integer] Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED = :succeeded + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_SUCCEEDED = :"wallet_action.earn_withdraw.succeeded" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_response.rb b/lib/privy/models/wallet_action_response.rb new file mode 100644 index 0000000..cdd6633 --- /dev/null +++ b/lib/privy/models/wallet_action_response.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Privy + module Models + # Response for a wallet action, discriminated on type. + module WalletActionResponse + extend Privy::Internal::Type::Union + + discriminator :type + + # Response for a swap action. + variant :swap, -> { Privy::SwapActionResponse } + + # Response for a transfer action. + variant :transfer, -> { Privy::TransferActionResponse } + + # Response for an earn deposit action. + variant :earn_deposit, -> { Privy::EarnDepositActionResponse } + + # Response for an earn withdraw action. + variant :earn_withdraw, -> { Privy::EarnWithdrawActionResponse } + + # Response for an earn incentive claim action. + variant :earn_incentive_claim, -> { Privy::EarnIncentiveClaimActionResponse } + + # @!method self.variants + # @return [Array(Privy::Models::SwapActionResponse, Privy::Models::TransferActionResponse, Privy::Models::EarnDepositActionResponse, Privy::Models::EarnWithdrawActionResponse, Privy::Models::EarnIncentiveClaimActionResponse)] + end + end +end diff --git a/lib/privy/models/wallet_action_status.rb b/lib/privy/models/wallet_action_status.rb new file mode 100644 index 0000000..6860fdb --- /dev/null +++ b/lib/privy/models/wallet_action_status.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + # Status of a wallet action. + module WalletActionStatus + extend Privy::Internal::Type::Enum + + PENDING = :pending + SUCCEEDED = :succeeded + REJECTED = :rejected + FAILED = :failed + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_action_step.rb b/lib/privy/models/wallet_action_step.rb new file mode 100644 index 0000000..e6d63e1 --- /dev/null +++ b/lib/privy/models/wallet_action_step.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + # A step within a wallet action, representing a single onchain action. + module WalletActionStep + extend Privy::Internal::Type::Union + + discriminator :type + + # A wallet action step consisting of an EVM transaction. + variant :evm_transaction, -> { Privy::EvmTransactionWalletActionStep } + + # A wallet action step consisting of an EVM user operation. + variant :evm_user_operation, -> { Privy::EvmUserOperationWalletActionStep } + + # A wallet action step consisting of an SVM (Solana) transaction. + variant :svm_transaction, -> { Privy::SvmTransactionWalletActionStep } + + # A wallet action step representing a cross-chain/cross-asset fill by an external provider. + variant :external_transaction, -> { Privy::ExternalTransactionWalletActionStep } + + # @!method self.variants + # @return [Array(Privy::Models::EvmTransactionWalletActionStep, Privy::Models::EvmUserOperationWalletActionStep, Privy::Models::SvmTransactionWalletActionStep, Privy::Models::ExternalTransactionWalletActionStep)] + end + end +end diff --git a/lib/privy/models/wallet_action_step_type.rb b/lib/privy/models/wallet_action_step_type.rb new file mode 100644 index 0000000..f678a7d --- /dev/null +++ b/lib/privy/models/wallet_action_step_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + # Type of a wallet action step. + module WalletActionStepType + extend Privy::Internal::Type::Enum + + EVM_TRANSACTION = :evm_transaction + EVM_USER_OPERATION = :evm_user_operation + SVM_TRANSACTION = :svm_transaction + EXTERNAL_TRANSACTION = :external_transaction + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_action_swap_created_webhook_payload.rb b/lib/privy/models/wallet_action_swap_created_webhook_payload.rb new file mode 100644 index 0000000..f29158b --- /dev/null +++ b/lib/privy/models/wallet_action_swap_created_webhook_payload.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionSwapCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute caip2 + # Chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute input_amount + # Amount of input token in base units. Populated after on-chain confirmation. + # + # @return [String, nil] + required :input_amount, String, nil?: true + + # @!attribute input_token + # Token address being sold. + # + # @return [String] + required :input_token, String + + # @!attribute output_token + # Token address being bought. + # + # @return [String] + required :output_token, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionSwapCreatedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionSwapCreatedWebhookPayload::Status } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionSwapCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionSwapCreatedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, caip2:, input_amount:, input_token:, output_token:, status:, type:, wallet_action_id:, wallet_id:) + # Payload for the wallet_action.swap.created webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param caip2 [String] Chain identifier. + # + # @param input_amount [String, nil] Amount of input token in base units. Populated after on-chain confirmation. + # + # @param input_token [String] Token address being sold. + # + # @param output_token [String] Token address being bought. + # + # @param status [Symbol, Privy::Models::WalletActionSwapCreatedWebhookPayload::Status] The status of the wallet action. + # + # @param type [Symbol, Privy::Models::WalletActionSwapCreatedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionSwapCreatedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionSwapCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_CREATED = :"wallet_action.swap.created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_swap_failed_webhook_payload.rb b/lib/privy/models/wallet_action_swap_failed_webhook_payload.rb new file mode 100644 index 0000000..af39d99 --- /dev/null +++ b/lib/privy/models/wallet_action_swap_failed_webhook_payload.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionSwapFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute caip2 + # Chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute input_amount + # Amount of input token in base units. Populated after on-chain confirmation. + # + # @return [String, nil] + required :input_amount, String, nil?: true + + # @!attribute input_token + # Token address being sold. + # + # @return [String] + required :input_token, String + + # @!attribute output_token + # Token address being bought. + # + # @return [String] + required :output_token, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionSwapFailedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionSwapFailedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionSwapFailedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionSwapFailedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, caip2:, failure_reason:, input_amount:, input_token:, output_token:, status:, steps:, type:, wallet_action_id:, wallet_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionSwapFailedWebhookPayload} for more details. + # + # Payload for the wallet_action.swap.failed webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param caip2 [String] Chain identifier. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param input_amount [String, nil] Amount of input token in base units. Populated after on-chain confirmation. + # + # @param input_token [String] Token address being sold. + # + # @param output_token [String] Token address being bought. + # + # @param status [Symbol, Privy::Models::WalletActionSwapFailedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action. Completed steps will have transaction hashes; th + # + # @param type [Symbol, Privy::Models::WalletActionSwapFailedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionSwapFailedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + FAILED = :failed + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionSwapFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_FAILED = :"wallet_action.swap.failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_swap_rejected_webhook_payload.rb b/lib/privy/models/wallet_action_swap_rejected_webhook_payload.rb new file mode 100644 index 0000000..2df6b80 --- /dev/null +++ b/lib/privy/models/wallet_action_swap_rejected_webhook_payload.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionSwapRejectedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute caip2 + # Chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute input_amount + # Amount of input token in base units. Populated after on-chain confirmation. + # + # @return [String, nil] + required :input_amount, String, nil?: true + + # @!attribute input_token + # Token address being sold. + # + # @return [String] + required :input_token, String + + # @!attribute output_token + # Token address being bought. + # + # @return [String] + required :output_token, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionSwapRejectedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionSwapRejectedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action at the time of rejection. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionSwapRejectedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionSwapRejectedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, caip2:, failure_reason:, input_amount:, input_token:, output_token:, status:, steps:, type:, wallet_action_id:, wallet_id:) + # Payload for the wallet_action.swap.rejected webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param caip2 [String] Chain identifier. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param input_amount [String, nil] Amount of input token in base units. Populated after on-chain confirmation. + # + # @param input_token [String] Token address being sold. + # + # @param output_token [String] Token address being bought. + # + # @param status [Symbol, Privy::Models::WalletActionSwapRejectedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action at the time of rejection. + # + # @param type [Symbol, Privy::Models::WalletActionSwapRejectedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionSwapRejectedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + REJECTED = :rejected + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionSwapRejectedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_REJECTED = :"wallet_action.swap.rejected" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_swap_succeeded_webhook_payload.rb b/lib/privy/models/wallet_action_swap_succeeded_webhook_payload.rb new file mode 100644 index 0000000..ecadace --- /dev/null +++ b/lib/privy/models/wallet_action_swap_succeeded_webhook_payload.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionSwapSucceededWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute caip2 + # Chain identifier. + # + # @return [String] + required :caip2, String + + # @!attribute input_amount + # Amount of input token in base units. Populated after on-chain confirmation. + # + # @return [String, nil] + required :input_amount, String, nil?: true + + # @!attribute input_token + # Token address being sold. + # + # @return [String] + required :input_token, String + + # @!attribute output_amount + # Amount of output token received, in base units. Populated after on-chain + # confirmation. + # + # @return [String, nil] + required :output_amount, String, nil?: true + + # @!attribute output_token + # Token address being bought. + # + # @return [String] + required :output_token, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionSwapSucceededWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionSwapSucceededWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action, including transaction hashes. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionSwapSucceededWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionSwapSucceededWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(action_type:, caip2:, input_amount:, input_token:, output_amount:, output_token:, status:, steps:, type:, wallet_action_id:, wallet_id:) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionSwapSucceededWebhookPayload} for more details. + # + # Payload for the wallet_action.swap.succeeded webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param caip2 [String] Chain identifier. + # + # @param input_amount [String, nil] Amount of input token in base units. Populated after on-chain confirmation. + # + # @param input_token [String] Token address being sold. + # + # @param output_amount [String, nil] Amount of output token received, in base units. Populated after on-chain confirm + # + # @param output_token [String] Token address being bought. + # + # @param status [Symbol, Privy::Models::WalletActionSwapSucceededWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action, including transaction hashes. + # + # @param type [Symbol, Privy::Models::WalletActionSwapSucceededWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionSwapSucceededWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED = :succeeded + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionSwapSucceededWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_SUCCEEDED = :"wallet_action.swap.succeeded" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_transfer_created_webhook_payload.rb b/lib/privy/models/wallet_action_transfer_created_webhook_payload.rb new file mode 100644 index 0000000..db65eef --- /dev/null +++ b/lib/privy/models/wallet_action_transfer_created_webhook_payload.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionTransferCreatedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute destination_address + # Recipient address. + # + # @return [String] + required :destination_address, String + + # @!attribute source_chain + # Chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :source_chain, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionTransferCreatedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionTransferCreatedWebhookPayload::Status } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionTransferCreatedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionTransferCreatedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute source_amount + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + # + # @return [String, nil] + optional :source_amount, String + + # @!attribute source_asset + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + # + # @return [String, nil] + optional :source_asset, String + + # @!attribute source_asset_address + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + # + # @return [String, nil] + optional :source_asset_address, String + + # @!attribute source_asset_decimals + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + # + # @return [Integer, nil] + optional :source_asset_decimals, Integer + + # @!method initialize(action_type:, destination_address:, source_chain:, status:, type:, wallet_action_id:, wallet_id:, source_amount: nil, source_asset: nil, source_asset_address: nil, source_asset_decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionTransferCreatedWebhookPayload} for more details. + # + # Payload for the wallet_action.transfer.created webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param destination_address [String] Recipient address. + # + # @param source_chain [String] Chain name (e.g. "base", "ethereum"). + # + # @param status [Symbol, Privy::Models::WalletActionTransferCreatedWebhookPayload::Status] The status of the wallet action. + # + # @param type [Symbol, Privy::Models::WalletActionTransferCreatedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param source_amount [String] Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output c + # + # @param source_asset [String] Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated w + # + # @param source_asset_address [String] Token contract address (EVM) or mint address (Solana). Present when the transfer + # + # @param source_asset_decimals [Integer] Number of decimals for the transferred token. Present when the transfer was init + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionTransferCreatedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + PENDING = :pending + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionTransferCreatedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_CREATED = :"wallet_action.transfer.created" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_transfer_failed_webhook_payload.rb b/lib/privy/models/wallet_action_transfer_failed_webhook_payload.rb new file mode 100644 index 0000000..dcd53cb --- /dev/null +++ b/lib/privy/models/wallet_action_transfer_failed_webhook_payload.rb @@ -0,0 +1,146 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionTransferFailedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute destination_address + # Recipient address. + # + # @return [String] + required :destination_address, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute source_chain + # Chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :source_chain, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionTransferFailedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionTransferFailedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionTransferFailedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionTransferFailedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute source_amount + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + # + # @return [String, nil] + optional :source_amount, String + + # @!attribute source_asset + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + # + # @return [String, nil] + optional :source_asset, String + + # @!attribute source_asset_address + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + # + # @return [String, nil] + optional :source_asset_address, String + + # @!attribute source_asset_decimals + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + # + # @return [Integer, nil] + optional :source_asset_decimals, Integer + + # @!method initialize(action_type:, destination_address:, failure_reason:, source_chain:, status:, steps:, type:, wallet_action_id:, wallet_id:, source_amount: nil, source_asset: nil, source_asset_address: nil, source_asset_decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionTransferFailedWebhookPayload} for more details. + # + # Payload for the wallet_action.transfer.failed webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param destination_address [String] Recipient address. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param source_chain [String] Chain name (e.g. "base", "ethereum"). + # + # @param status [Symbol, Privy::Models::WalletActionTransferFailedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action. Completed steps will have transaction hashes; th + # + # @param type [Symbol, Privy::Models::WalletActionTransferFailedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param source_amount [String] Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output c + # + # @param source_asset [String] Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated w + # + # @param source_asset_address [String] Token contract address (EVM) or mint address (Solana). Present when the transfer + # + # @param source_asset_decimals [Integer] Number of decimals for the transferred token. Present when the transfer was init + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionTransferFailedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + FAILED = :failed + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionTransferFailedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_FAILED = :"wallet_action.transfer.failed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_transfer_rejected_webhook_payload.rb b/lib/privy/models/wallet_action_transfer_rejected_webhook_payload.rb new file mode 100644 index 0000000..84429c3 --- /dev/null +++ b/lib/privy/models/wallet_action_transfer_rejected_webhook_payload.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionTransferRejectedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute destination_address + # Recipient address. + # + # @return [String] + required :destination_address, String + + # @!attribute failure_reason + # A description of why a wallet action (or a step within a wallet action) failed. + # + # @return [Privy::Models::FailureReason] + required :failure_reason, -> { Privy::FailureReason } + + # @!attribute source_chain + # Chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :source_chain, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionTransferRejectedWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionTransferRejectedWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action at the time of rejection. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionTransferRejectedWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionTransferRejectedWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute source_amount + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + # + # @return [String, nil] + optional :source_amount, String + + # @!attribute source_asset + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + # + # @return [String, nil] + optional :source_asset, String + + # @!attribute source_asset_address + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + # + # @return [String, nil] + optional :source_asset_address, String + + # @!attribute source_asset_decimals + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + # + # @return [Integer, nil] + optional :source_asset_decimals, Integer + + # @!method initialize(action_type:, destination_address:, failure_reason:, source_chain:, status:, steps:, type:, wallet_action_id:, wallet_id:, source_amount: nil, source_asset: nil, source_asset_address: nil, source_asset_decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionTransferRejectedWebhookPayload} for more details. + # + # Payload for the wallet_action.transfer.rejected webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param destination_address [String] Recipient address. + # + # @param failure_reason [Privy::Models::FailureReason] A description of why a wallet action (or a step within a wallet action) failed. + # + # @param source_chain [String] Chain name (e.g. "base", "ethereum"). + # + # @param status [Symbol, Privy::Models::WalletActionTransferRejectedWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action at the time of rejection. + # + # @param type [Symbol, Privy::Models::WalletActionTransferRejectedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param source_amount [String] Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output c + # + # @param source_asset [String] Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated w + # + # @param source_asset_address [String] Token contract address (EVM) or mint address (Solana). Present when the transfer + # + # @param source_asset_decimals [Integer] Number of decimals for the transferred token. Present when the transfer was init + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionTransferRejectedWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + REJECTED = :rejected + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionTransferRejectedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_REJECTED = :"wallet_action.transfer.rejected" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_transfer_succeeded_webhook_payload.rb b/lib/privy/models/wallet_action_transfer_succeeded_webhook_payload.rb new file mode 100644 index 0000000..678e602 --- /dev/null +++ b/lib/privy/models/wallet_action_transfer_succeeded_webhook_payload.rb @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletActionTransferSucceededWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute action_type + # Type of wallet action + # + # @return [Symbol, Privy::Models::WalletActionType] + required :action_type, enum: -> { Privy::WalletActionType } + + # @!attribute destination_address + # Recipient address. + # + # @return [String] + required :destination_address, String + + # @!attribute source_chain + # Chain name (e.g. "base", "ethereum"). + # + # @return [String] + required :source_chain, String + + # @!attribute status + # The status of the wallet action. + # + # @return [Symbol, Privy::Models::WalletActionTransferSucceededWebhookPayload::Status] + required :status, enum: -> { Privy::WalletActionTransferSucceededWebhookPayload::Status } + + # @!attribute steps + # The steps of the wallet action, including transaction hashes. + # + # @return [Array] + required :steps, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep] } + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletActionTransferSucceededWebhookPayload::Type] + required :type, enum: -> { Privy::WalletActionTransferSucceededWebhookPayload::Type } + + # @!attribute wallet_action_id + # The ID of the wallet action. + # + # @return [String] + required :wallet_action_id, String + + # @!attribute wallet_id + # The ID of the wallet involved in the action. + # + # @return [String] + required :wallet_id, String + + # @!attribute source_amount + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + # + # @return [String, nil] + optional :source_amount, String + + # @!attribute source_asset + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + # + # @return [String, nil] + optional :source_asset, String + + # @!attribute source_asset_address + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + # + # @return [String, nil] + optional :source_asset_address, String + + # @!attribute source_asset_decimals + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + # + # @return [Integer, nil] + optional :source_asset_decimals, Integer + + # @!method initialize(action_type:, destination_address:, source_chain:, status:, steps:, type:, wallet_action_id:, wallet_id:, source_amount: nil, source_asset: nil, source_asset_address: nil, source_asset_decimals: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletActionTransferSucceededWebhookPayload} for more details. + # + # Payload for the wallet_action.transfer.succeeded webhook event. + # + # @param action_type [Symbol, Privy::Models::WalletActionType] Type of wallet action + # + # @param destination_address [String] Recipient address. + # + # @param source_chain [String] Chain name (e.g. "base", "ethereum"). + # + # @param status [Symbol, Privy::Models::WalletActionTransferSucceededWebhookPayload::Status] The status of the wallet action. + # + # @param steps [Array] The steps of the wallet action, including transaction hashes. + # + # @param type [Symbol, Privy::Models::WalletActionTransferSucceededWebhookPayload::Type] The type of webhook event. + # + # @param wallet_action_id [String] The ID of the wallet action. + # + # @param wallet_id [String] The ID of the wallet involved in the action. + # + # @param source_amount [String] Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output c + # + # @param source_asset [String] Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated w + # + # @param source_asset_address [String] Token contract address (EVM) or mint address (Solana). Present when the transfer + # + # @param source_asset_decimals [Integer] Number of decimals for the transferred token. Present when the transfer was init + + # The status of the wallet action. + # + # @see Privy::Models::WalletActionTransferSucceededWebhookPayload#status + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED = :succeeded + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletActionTransferSucceededWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_SUCCEEDED = :"wallet_action.transfer.succeeded" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_action_type.rb b/lib/privy/models/wallet_action_type.rb new file mode 100644 index 0000000..f0de96f --- /dev/null +++ b/lib/privy/models/wallet_action_type.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Privy + module Models + # Type of wallet action + module WalletActionType + extend Privy::Internal::Type::Enum + + SWAP = :swap + TRANSFER = :transfer + EARN_DEPOSIT = :earn_deposit + EARN_WITHDRAW = :earn_withdraw + EARN_INCENTIVE_CLAIM = :earn_incentive_claim + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_additional_signer.rb b/lib/privy/models/wallet_additional_signer.rb new file mode 100644 index 0000000..d4c3b87 --- /dev/null +++ b/lib/privy/models/wallet_additional_signer.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +module Privy + module Models + # @type [Privy::Internal::Type::Converter] + WalletAdditionalSigner = Privy::Internal::Type::ArrayOf[-> { Privy::WalletAdditionalSignerItem }] + end +end diff --git a/lib/privy/models/wallet_additional_signer_item.rb b/lib/privy/models/wallet_additional_signer_item.rb new file mode 100644 index 0000000..402e42c --- /dev/null +++ b/lib/privy/models/wallet_additional_signer_item.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletAdditionalSignerItem < Privy::Internal::Type::BaseModel + # @!attribute signer_id + # A unique identifier for a key quorum. + # + # @return [String] + required :signer_id, String + + # @!attribute override_policy_ids + # An optional list of up to one policy ID to enforce on the wallet. + # + # @return [Array, nil] + optional :override_policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(signer_id:, override_policy_ids: nil) + # A single additional signer on a wallet, with an optional policy override. + # + # @param signer_id [String] A unique identifier for a key quorum. + # + # @param override_policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + end + end +end diff --git a/lib/privy/models/wallet_api_register_authorization_key_input.rb b/lib/privy/models/wallet_api_register_authorization_key_input.rb new file mode 100644 index 0000000..5c99f8a --- /dev/null +++ b/lib/privy/models/wallet_api_register_authorization_key_input.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletAPIRegisterAuthorizationKeyInput < Privy::Internal::Type::BaseModel + # @!attribute public_key + # + # @return [String] + required :public_key, String + + # @!attribute display_name + # + # @return [String, nil] + optional :display_name, String + + # @!attribute role + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + # + # @return [Symbol, Privy::Models::AuthorizationKeyRole, nil] + optional :role, enum: -> { Privy::AuthorizationKeyRole }, nil?: true + + # @!method initialize(public_key:, display_name: nil, role: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletAPIRegisterAuthorizationKeyInput} for more details. + # + # Input for registering or updating an application public signing key for + # API-based wallet actions. + # + # @param public_key [String] + # + # @param display_name [String] + # + # @param role [Symbol, Privy::Models::AuthorizationKeyRole, nil] The role of an authorization key, controlling what actions it can authorize on a + end + end +end diff --git a/lib/privy/models/wallet_api_revoke_authorization_key_input.rb b/lib/privy/models/wallet_api_revoke_authorization_key_input.rb new file mode 100644 index 0000000..0d83347 --- /dev/null +++ b/lib/privy/models/wallet_api_revoke_authorization_key_input.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletAPIRevokeAuthorizationKeyInput < Privy::Internal::Type::BaseModel + # @!attribute id + # + # @return [String] + required :id, String + + # @!method initialize(id:) + # Input for revoking an application authorization key. + # + # @param id [String] + end + end +end diff --git a/lib/privy/models/wallet_asset.rb b/lib/privy/models/wallet_asset.rb new file mode 100644 index 0000000..4c60338 --- /dev/null +++ b/lib/privy/models/wallet_asset.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # A named asset supported across all chains. + module WalletAsset + extend Privy::Internal::Type::Enum + + USDC = :usdc + USDC_E = :"usdc.e" + ETH = :eth + POL = :pol + USDT = :usdt + EURC = :eurc + USDB = :usdb + SOL = :sol + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_authenticate_request_body.rb b/lib/privy/models/wallet_authenticate_request_body.rb new file mode 100644 index 0000000..6411bf9 --- /dev/null +++ b/lib/privy/models/wallet_authenticate_request_body.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletAuthenticateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute encryption_type + # The encryption type for the authentication response. Currently only supports + # HPKE. + # + # @return [Symbol, Privy::Models::WalletAuthenticateRequestBody::EncryptionType] + required :encryption_type, enum: -> { Privy::WalletAuthenticateRequestBody::EncryptionType } + + # @!attribute recipient_public_key + # The public key of your ECDH keypair, in base64-encoded, SPKI-format, whose + # private key will be able to decrypt the session key. + # + # @return [String] + required :recipient_public_key, String + + # @!attribute user_jwt + # The user's JWT, to be used to authenticate the user. + # + # @return [String] + required :user_jwt, String + + # @!method initialize(encryption_type:, recipient_public_key:, user_jwt:) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletAuthenticateRequestBody} for more details. + # + # Request body for wallet authentication with HPKE-encrypted response. + # + # @param encryption_type [Symbol, Privy::Models::WalletAuthenticateRequestBody::EncryptionType] The encryption type for the authentication response. Currently only supports HPK + # + # @param recipient_public_key [String] The public key of your ECDH keypair, in base64-encoded, SPKI-format, whose priva + # + # @param user_jwt [String] The user's JWT, to be used to authenticate the user. + + # The encryption type for the authentication response. Currently only supports + # HPKE. + # + # @see Privy::Models::WalletAuthenticateRequestBody#encryption_type + module EncryptionType + extend Privy::Internal::Type::Enum + + HPKE = :HPKE + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_authenticate_with_jwt_params.rb b/lib/privy/models/wallet_authenticate_with_jwt_params.rb new file mode 100644 index 0000000..545aa2f --- /dev/null +++ b/lib/privy/models/wallet_authenticate_with_jwt_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#authenticate_with_jwt + class WalletAuthenticateWithJwtParams < Privy::Models::WalletAuthenticateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_authenticate_with_jwt_response.rb b/lib/privy/models/wallet_authenticate_with_jwt_response.rb new file mode 100644 index 0000000..dd7808c --- /dev/null +++ b/lib/privy/models/wallet_authenticate_with_jwt_response.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +module Privy + module Models + # The response from authenticating a wallet, containing an authorization key and + # wallet data. + # + # @see Privy::Resources::Wallets#authenticate_with_jwt + module WalletAuthenticateWithJwtResponse + extend Privy::Internal::Type::Union + + variant -> { Privy::WalletAuthenticateWithJwtResponse::WithEncryption } + + variant -> { Privy::WalletAuthenticateWithJwtResponse::WithoutEncryption } + + class WithEncryption < Privy::Internal::Type::BaseModel + # @!attribute encrypted_authorization_key + # The encrypted authorization key data. + # + # @return [Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey] + required :encrypted_authorization_key, + -> { Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey } + + # @!attribute expires_at + # The expiration time of the authorization key in milliseconds since the epoch. + # + # @return [Float] + required :expires_at, Float + + # @!attribute wallets + # + # @return [Array] + required :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::Wallet] } + + # @!method initialize(encrypted_authorization_key:, expires_at:, wallets:) + # @param encrypted_authorization_key [Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey] The encrypted authorization key data. + # + # @param expires_at [Float] The expiration time of the authorization key in milliseconds since the epoch. + # + # @param wallets [Array] + + # @see Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption#encrypted_authorization_key + class EncryptedAuthorizationKey < Privy::Internal::Type::BaseModel + # @!attribute ciphertext + # The encrypted authorization key corresponding to the user's current + # authentication session. + # + # @return [String] + required :ciphertext, String + + # @!attribute encapsulated_key + # Base64-encoded ephemeral public key used in the HPKE encryption process. + # Required for decryption. + # + # @return [String] + required :encapsulated_key, String + + # @!attribute encryption_type + # The encryption type used. Currently only supports HPKE. + # + # @return [Symbol, Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType] + required :encryption_type, + enum: -> { Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType } + + # @!method initialize(ciphertext:, encapsulated_key:, encryption_type:) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey} + # for more details. + # + # The encrypted authorization key data. + # + # @param ciphertext [String] The encrypted authorization key corresponding to the user's current authenticati + # + # @param encapsulated_key [String] Base64-encoded ephemeral public key used in the HPKE encryption process. Require + # + # @param encryption_type [Symbol, Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType] The encryption type used. Currently only supports HPKE. + + # The encryption type used. Currently only supports HPKE. + # + # @see Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey#encryption_type + module EncryptionType + extend Privy::Internal::Type::Enum + + HPKE = :HPKE + + # @!method self.values + # @return [Array] + end + end + end + + class WithoutEncryption < Privy::Internal::Type::BaseModel + # @!attribute authorization_key + # The raw authorization key data. + # + # @return [String] + required :authorization_key, String + + # @!attribute expires_at + # The expiration time of the authorization key in milliseconds since the epoch. + # + # @return [Float] + required :expires_at, Float + + # @!attribute wallets + # + # @return [Array] + required :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::Wallet] } + + # @!method initialize(authorization_key:, expires_at:, wallets:) + # @param authorization_key [String] The raw authorization key data. + # + # @param expires_at [Float] The expiration time of the authorization key in milliseconds since the epoch. + # + # @param wallets [Array] + end + + # @!method self.variants + # @return [Array(Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption, Privy::Models::WalletAuthenticateWithJwtResponse::WithoutEncryption)] + end + end +end diff --git a/lib/privy/models/wallet_authorization_headers.rb b/lib/privy/models/wallet_authorization_headers.rb new file mode 100644 index 0000000..1361617 --- /dev/null +++ b/lib/privy/models/wallet_authorization_headers.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletAuthorizationHeaders < Privy::Internal::Type::BaseModel + # @!attribute privy_app_id + # ID of your Privy app. + # + # @return [String] + required :privy_app_id, String, api_name: :"privy-app-id" + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String, api_name: :"privy-authorization-signature" + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String, api_name: :"privy-request-expiry" + + # @!method initialize(privy_app_id:, privy_authorization_signature: nil, privy_request_expiry: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletAuthorizationHeaders} for more details. + # + # Headers required to authorize wallet operations. + # + # @param privy_app_id [String] ID of your Privy app. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + end + end +end diff --git a/lib/privy/models/wallet_batch_create_input.rb b/lib/privy/models/wallet_batch_create_input.rb new file mode 100644 index 0000000..0d25a5e --- /dev/null +++ b/lib/privy/models/wallet_batch_create_input.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletBatchCreateInput < Privy::Internal::Type::BaseModel + # @!attribute wallets + # Array of wallet creation requests. Minimum 1, maximum 100. + # + # @return [Array] + required :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::WalletBatchItemInput] } + + # @!method initialize(wallets:) + # Request body for batch wallet creation. + # + # @param wallets [Array] Array of wallet creation requests. Minimum 1, maximum 100. + end + end +end diff --git a/lib/privy/models/wallet_batch_create_response.rb b/lib/privy/models/wallet_batch_create_response.rb new file mode 100644 index 0000000..9f8a8c8 --- /dev/null +++ b/lib/privy/models/wallet_batch_create_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletBatchCreateResponse < Privy::Internal::Type::BaseModel + # @!attribute results + # Array of results for each wallet creation request, in the same order as input. + # + # @return [Array] + required :results, -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletBatchCreateResult] } + + # @!method initialize(results:) + # Response for a batch wallet creation request. + # + # @param results [Array] Array of results for each wallet creation request, in the same order as input. + end + end +end diff --git a/lib/privy/models/wallet_batch_create_result.rb b/lib/privy/models/wallet_batch_create_result.rb new file mode 100644 index 0000000..65cd66e --- /dev/null +++ b/lib/privy/models/wallet_batch_create_result.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +module Privy + module Models + # A single result from a batch wallet creation operation. + module WalletBatchCreateResult + extend Privy::Internal::Type::Union + + # A successful wallet creation result within a batch operation. + variant -> { Privy::WalletBatchCreateResult::WalletBatchCreateSuccess } + + # A failed wallet creation result within a batch operation. + variant -> { Privy::WalletBatchCreateResult::WalletBatchCreateFailure } + + class WalletBatchCreateSuccess < Privy::Internal::Type::BaseModel + # @!attribute index + # The index of the wallet in the original request array. + # + # @return [Float] + required :index, Float + + # @!attribute success + # + # @return [Boolean, Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess::Success] + required :success, enum: -> { Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::Success } + + # @!attribute wallet + # A wallet managed by Privy's wallet infrastructure. + # + # @return [Privy::Models::Wallet] + required :wallet, -> { Privy::Wallet } + + # @!method initialize(index:, success:, wallet:) + # A successful wallet creation result within a batch operation. + # + # @param index [Float] The index of the wallet in the original request array. + # + # @param success [Boolean, Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess::Success] + # + # @param wallet [Privy::Models::Wallet] A wallet managed by Privy's wallet infrastructure. + + # @see Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess#success + module Success + extend Privy::Internal::Type::Enum + + TRUE = true + + # @!method self.values + # @return [Array] + end + end + + class WalletBatchCreateFailure < Privy::Internal::Type::BaseModel + # @!attribute code + # A PrivyErrorCode string identifying the error type (e.g., "invalid_data", + # "resource_conflict"). + # + # @return [String] + required :code, String + + # @!attribute error + # A human-readable error message with details about what went wrong. + # + # @return [String] + required :error, String + + # @!attribute index + # The index of the wallet in the original request array. + # + # @return [Float] + required :index, Float + + # @!attribute success + # + # @return [Boolean, Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure::Success] + required :success, enum: -> { Privy::WalletBatchCreateResult::WalletBatchCreateFailure::Success } + + # @!method initialize(code:, error:, index:, success:) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure} for more + # details. + # + # A failed wallet creation result within a batch operation. + # + # @param code [String] A PrivyErrorCode string identifying the error type (e.g., "invalid_data", "resou + # + # @param error [String] A human-readable error message with details about what went wrong. + # + # @param index [Float] The index of the wallet in the original request array. + # + # @param success [Boolean, Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure::Success] + + # @see Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure#success + module Success + extend Privy::Internal::Type::Enum + + FALSE = false + + # @!method self.values + # @return [Array] + end + end + + # @!method self.variants + # @return [Array(Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess, Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure)] + end + end +end diff --git a/lib/privy/models/wallet_batch_item_input.rb b/lib/privy/models/wallet_batch_item_input.rb new file mode 100644 index 0000000..68dbcc5 --- /dev/null +++ b/lib/privy/models/wallet_batch_item_input.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletBatchItemInput < Privy::Internal::Type::BaseModel + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::AdditionalSignerItemInput] } + + # @!attribute display_name + # A human-readable label for the wallet. + # + # @return [String, nil] + optional :display_name, String + + # @!attribute external_id + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute policy_ids + # List of policy IDs for policies that should be enforced on the wallet. + # Currently, only one policy is supported per wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(chain_type:, additional_signers: nil, display_name: nil, external_id: nil, owner: nil, owner_id: nil, policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletBatchItemInput} for more details. + # + # Input for a single wallet in a batch creation request. + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param display_name [String] A human-readable label for the wallet. + # + # @param external_id [String] A customer-provided identifier for mapping to external systems. URL-safe charact + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param policy_ids [Array] List of policy IDs for policies that should be enforced on the wallet. Currently + end + end +end diff --git a/lib/privy/models/wallet_chain_type.rb b/lib/privy/models/wallet_chain_type.rb new file mode 100644 index 0000000..43ad989 --- /dev/null +++ b/lib/privy/models/wallet_chain_type.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +module Privy + module Models + # The wallet chain types. + module WalletChainType + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + SOLANA = :solana + COSMOS = :cosmos + STELLAR = :stellar + SUI = :sui + APTOS = :aptos + MOVEMENT = :movement + TRON = :tron + BITCOIN_SEGWIT = :"bitcoin-segwit" + BITCOIN_TAPROOT = :"bitcoin-taproot" + PEARL = :pearl + NEAR = :near + TON = :ton + STARKNET = :starknet + SPARK = :spark + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_create_params.rb b/lib/privy/models/wallet_create_params.rb new file mode 100644 index 0000000..b725885 --- /dev/null +++ b/lib/privy/models/wallet_create_params.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#create + class WalletCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::AdditionalSignerItemInput] } + + # @!attribute display_name + # A human-readable label for the wallet. + # + # @return [String, nil] + optional :display_name, String + + # @!attribute external_id + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute policy_ids + # An optional list of up to one policy ID to enforce on the wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!method initialize(chain_type:, additional_signers: nil, display_name: nil, external_id: nil, owner: nil, owner_id: nil, policy_ids: nil, privy_idempotency_key: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletCreateParams} for more details. + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param display_name [String] A human-readable label for the wallet. + # + # @param external_id [String] A customer-provided identifier for mapping to external systems. URL-safe charact + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_create_wallets_with_recovery_params.rb b/lib/privy/models/wallet_create_wallets_with_recovery_params.rb new file mode 100644 index 0000000..4c66223 --- /dev/null +++ b/lib/privy/models/wallet_create_wallets_with_recovery_params.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#create_wallets_with_recovery + class WalletCreateWalletsWithRecoveryParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute primary_signer + # + # @return [Privy::Models::WalletCreateWalletsWithRecoveryParams::PrimarySigner] + required :primary_signer, -> { Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner } + + # @!attribute recovery_user + # + # @return [Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser] + required :recovery_user, -> { Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser } + + # @!attribute wallets + # + # @return [Array] + required :wallets, + -> { Privy::Internal::Type::ArrayOf[Privy::WalletCreateWalletsWithRecoveryParams::Wallet] } + + # @!method initialize(primary_signer:, recovery_user:, wallets:, request_options: {}) + # @param primary_signer [Privy::Models::WalletCreateWalletsWithRecoveryParams::PrimarySigner] + # @param recovery_user [Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser] + # @param wallets [Array] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + class PrimarySigner < Privy::Internal::Type::BaseModel + # @!attribute subject_id + # The JWT subject ID of the user. + # + # @return [String] + required :subject_id, String + + # @!method initialize(subject_id:) + # @param subject_id [String] The JWT subject ID of the user. + end + + class RecoveryUser < Privy::Internal::Type::BaseModel + # @!attribute linked_accounts + # + # @return [Array] + required :linked_accounts, + -> { Privy::Internal::Type::ArrayOf[union: Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser::LinkedAccount] } + + # @!method initialize(linked_accounts:) + # @param linked_accounts [Array] + + # The payload for importing an email account. + module LinkedAccount + extend Privy::Internal::Type::Union + + discriminator :type + + # The payload for importing an email account. + variant :email, -> { Privy::LinkedAccountEmailInput } + + # The payload for importing a Custom JWT account. + variant :custom_auth, -> { Privy::LinkedAccountCustomJwtInput } + + # @!method self.variants + # @return [Array(Privy::Models::LinkedAccountEmailInput, Privy::Models::LinkedAccountCustomJwtInput)] + end + end + + class Wallet < Privy::Internal::Type::BaseModel + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute display_name + # A human-readable label for the wallet. + # + # @return [String, nil] + optional :display_name, String + + # @!attribute external_id + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute policy_ids + # An optional list of up to one policy ID to enforce on the wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(chain_type:, display_name: nil, external_id: nil, policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletCreateWalletsWithRecoveryParams::Wallet} for more details. + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param display_name [String] A human-readable label for the wallet. + # + # @param external_id [String] A customer-provided identifier for mapping to external systems. URL-safe charact + # + # @param policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + end + end + end +end diff --git a/lib/privy/models/wallet_create_wallets_with_recovery_response.rb b/lib/privy/models/wallet_create_wallets_with_recovery_response.rb new file mode 100644 index 0000000..4a113d5 --- /dev/null +++ b/lib/privy/models/wallet_create_wallets_with_recovery_response.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#create_wallets_with_recovery + class WalletCreateWalletsWithRecoveryResponse < Privy::Internal::Type::BaseModel + # @!attribute recovery_user_id + # The ID of the created user. + # + # @return [String] + required :recovery_user_id, String + + # @!attribute wallets + # The wallets that were created. + # + # @return [Array] + required :wallets, -> { Privy::Internal::Type::ArrayOf[Privy::Wallet] } + + # @!method initialize(recovery_user_id:, wallets:) + # The response from creating wallets with an associated recovery user. + # + # @param recovery_user_id [String] The ID of the created user. + # + # @param wallets [Array] The wallets that were created. + end + end +end diff --git a/lib/privy/models/wallet_creation_additional_signer_item.rb b/lib/privy/models/wallet_creation_additional_signer_item.rb new file mode 100644 index 0000000..cd757ea --- /dev/null +++ b/lib/privy/models/wallet_creation_additional_signer_item.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletCreationAdditionalSignerItem < Privy::Internal::Type::BaseModel + # @!attribute signer_id + # A unique identifier for a key quorum. + # + # @return [String] + required :signer_id, String + + # @!attribute override_policy_ids + # The array of policy IDs that will be applied to wallet requests. If specified, + # this will override the base policy IDs set on the wallet. Currently, only one + # policy is supported per signer. + # + # @return [Array, nil] + optional :override_policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(signer_id:, override_policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletCreationAdditionalSignerItem} for more details. + # + # An additional signer configuration for a wallet. + # + # @param signer_id [String] A unique identifier for a key quorum. + # + # @param override_policy_ids [Array] The array of policy IDs that will be applied to wallet requests. If specified, t + end + end +end diff --git a/lib/privy/models/wallet_creation_input.rb b/lib/privy/models/wallet_creation_input.rb new file mode 100644 index 0000000..b975d47 --- /dev/null +++ b/lib/privy/models/wallet_creation_input.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletCreationInput < Privy::Internal::Type::BaseModel + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType] + required :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, + -> { Privy::Internal::Type::ArrayOf[Privy::WalletCreationAdditionalSignerItem] } + + # @!attribute create_smart_wallet + # Create a smart wallet with this wallet as the signer. Only supported for wallets + # with `chain_type: "ethereum"`. + # + # @return [Boolean, nil] + optional :create_smart_wallet, Privy::Internal::Type::Boolean + + # @!attribute policy_ids + # Policy IDs to enforce on the wallet. Currently, only one policy is supported per + # wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(chain_type:, additional_signers: nil, create_smart_wallet: nil, policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletCreationInput} for more details. + # + # The fields on wallet creation that can be specified when creating a + # user-controlled embedded server wallet. + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param create_smart_wallet [Boolean] Create a smart wallet with this wallet as the signer. Only supported for wallets + # + # @param policy_ids [Array] Policy IDs to enforce on the wallet. Currently, only one policy is supported per + end + end +end diff --git a/lib/privy/models/wallet_custodian.rb b/lib/privy/models/wallet_custodian.rb new file mode 100644 index 0000000..e8f60ca --- /dev/null +++ b/lib/privy/models/wallet_custodian.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletCustodian < Privy::Internal::Type::BaseModel + # @!attribute provider + # The custodian responsible for the wallet. + # + # @return [String] + required :provider, String + + # @!attribute provider_user_id + # The resource ID of the beneficiary of the custodial wallet. + # + # @return [String] + required :provider_user_id, String + + # @!method initialize(provider:, provider_user_id:) + # Information about the custodian managing this wallet. + # + # @param provider [String] The custodian responsible for the wallet. + # + # @param provider_user_id [String] The resource ID of the beneficiary of the custodial wallet. + end + end +end diff --git a/lib/privy/models/wallet_entropy_type.rb b/lib/privy/models/wallet_entropy_type.rb new file mode 100644 index 0000000..cf3df86 --- /dev/null +++ b/lib/privy/models/wallet_entropy_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Privy + module Models + # The entropy type of the wallet. + module WalletEntropyType + extend Privy::Internal::Type::Enum + + HD = :hd + PRIVATE_KEY = :"private-key" + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_ethereum_asset.rb b/lib/privy/models/wallet_ethereum_asset.rb new file mode 100644 index 0000000..928d2a7 --- /dev/null +++ b/lib/privy/models/wallet_ethereum_asset.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Models + # A named asset on Ethereum-compatible chains. + module WalletEthereumAsset + extend Privy::Internal::Type::Enum + + USDC = :usdc + USDC_E = :"usdc.e" + ETH = :eth + POL = :pol + USDT = :usdt + EURC = :eurc + USDB = :usdb + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_export_params.rb b/lib/privy/models/wallet_export_params.rb new file mode 100644 index 0000000..646fe0e --- /dev/null +++ b/lib/privy/models/wallet_export_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#export + class WalletExportParams < Privy::Models::WalletExportRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletExportParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_export_request_body.rb b/lib/privy/models/wallet_export_request_body.rb new file mode 100644 index 0000000..9285269 --- /dev/null +++ b/lib/privy/models/wallet_export_request_body.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletExportRequestBody < Privy::Internal::Type::BaseModel + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute recipient_public_key + # The base64-encoded encryption public key to encrypt the wallet private key with. + # + # @return [String] + required :recipient_public_key, String + + # @!attribute export_seed_phrase + # + # @return [Boolean, nil] + optional :export_seed_phrase, Privy::Internal::Type::Boolean + + # @!method initialize(encryption_type:, recipient_public_key:, export_seed_phrase: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletExportRequestBody} for more details. + # + # Request body for exporting a wallet private key. + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param recipient_public_key [String] The base64-encoded encryption public key to encrypt the wallet private key with. + # + # @param export_seed_phrase [Boolean] + end + end +end diff --git a/lib/privy/models/wallet_export_response_body.rb b/lib/privy/models/wallet_export_response_body.rb new file mode 100644 index 0000000..c1dc102 --- /dev/null +++ b/lib/privy/models/wallet_export_response_body.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#export + class WalletExportResponseBody < Privy::Internal::Type::BaseModel + # @!attribute ciphertext + # The encrypted private key. + # + # @return [String] + required :ciphertext, String + + # @!attribute encapsulated_key + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption. + # + # @return [String] + required :encapsulated_key, String + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!method initialize(ciphertext:, encapsulated_key:, encryption_type:) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletExportResponseBody} for more details. + # + # Response body containing the encrypted wallet private key. + # + # @param ciphertext [String] The encrypted private key. + # + # @param encapsulated_key [String] The base64-encoded encapsulated key that was generated during encryption, for us + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + end + end +end diff --git a/lib/privy/models/wallet_funds_asset.rb b/lib/privy/models/wallet_funds_asset.rb new file mode 100644 index 0000000..dce52cd --- /dev/null +++ b/lib/privy/models/wallet_funds_asset.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Privy + module Models + # An asset involved in a wallet transfer. + module WalletFundsAsset + extend Privy::Internal::Type::Union + + discriminator :type + + # A native token asset (e.g. ETH, SOL). + variant :"native-token", -> { Privy::WalletFundsNativeTokenAsset } + + # An ERC-20 token asset. + variant :erc20, -> { Privy::WalletFundsErc20Asset } + + # A Solana SPL token asset. + variant :spl, -> { Privy::WalletFundsSplAsset } + + # A Stellar Asset Contract (SAC) asset. + variant :sac, -> { Privy::WalletFundsSacAsset } + + # @!method self.variants + # @return [Array(Privy::Models::WalletFundsNativeTokenAsset, Privy::Models::WalletFundsErc20Asset, Privy::Models::WalletFundsSplAsset, Privy::Models::WalletFundsSacAsset)] + end + end +end diff --git a/lib/privy/models/wallet_funds_erc_20_asset.rb b/lib/privy/models/wallet_funds_erc_20_asset.rb new file mode 100644 index 0000000..74ea597 --- /dev/null +++ b/lib/privy/models/wallet_funds_erc_20_asset.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletFundsErc20Asset < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::WalletFundsErc20Asset::Type] + required :type, enum: -> { Privy::WalletFundsErc20Asset::Type } + + # @!method initialize(address:, type:) + # An ERC-20 token asset. + # + # @param address [String] + # @param type [Symbol, Privy::Models::WalletFundsErc20Asset::Type] + + # @see Privy::Models::WalletFundsErc20Asset#type + module Type + extend Privy::Internal::Type::Enum + + ERC20 = :erc20 + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_funds_native_token_asset.rb b/lib/privy/models/wallet_funds_native_token_asset.rb new file mode 100644 index 0000000..c62f13b --- /dev/null +++ b/lib/privy/models/wallet_funds_native_token_asset.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletFundsNativeTokenAsset < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [nil] + required :address, NilClass + + # @!attribute type + # + # @return [Symbol, Privy::Models::WalletFundsNativeTokenAsset::Type] + required :type, enum: -> { Privy::WalletFundsNativeTokenAsset::Type } + + # @!method initialize(address:, type:) + # A native token asset (e.g. ETH, SOL). + # + # @param address [nil] + # @param type [Symbol, Privy::Models::WalletFundsNativeTokenAsset::Type] + + # @see Privy::Models::WalletFundsNativeTokenAsset#type + module Type + extend Privy::Internal::Type::Enum + + NATIVE_TOKEN = :"native-token" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_funds_sac_asset.rb b/lib/privy/models/wallet_funds_sac_asset.rb new file mode 100644 index 0000000..f20ec53 --- /dev/null +++ b/lib/privy/models/wallet_funds_sac_asset.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletFundsSacAsset < Privy::Internal::Type::BaseModel + # @!attribute address + # + # @return [String] + required :address, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::WalletFundsSacAsset::Type] + required :type, enum: -> { Privy::WalletFundsSacAsset::Type } + + # @!method initialize(address:, type:) + # A Stellar Asset Contract (SAC) asset. + # + # @param address [String] + # @param type [Symbol, Privy::Models::WalletFundsSacAsset::Type] + + # @see Privy::Models::WalletFundsSacAsset#type + module Type + extend Privy::Internal::Type::Enum + + SAC = :sac + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_funds_spl_asset.rb b/lib/privy/models/wallet_funds_spl_asset.rb new file mode 100644 index 0000000..cd7aa67 --- /dev/null +++ b/lib/privy/models/wallet_funds_spl_asset.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletFundsSplAsset < Privy::Internal::Type::BaseModel + # @!attribute mint + # + # @return [String] + required :mint, String + + # @!attribute type + # + # @return [Symbol, Privy::Models::WalletFundsSplAsset::Type] + required :type, enum: -> { Privy::WalletFundsSplAsset::Type } + + # @!method initialize(mint:, type:) + # A Solana SPL token asset. + # + # @param mint [String] + # @param type [Symbol, Privy::Models::WalletFundsSplAsset::Type] + + # @see Privy::Models::WalletFundsSplAsset#type + module Type + extend Privy::Internal::Type::Enum + + SPL = :spl + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_get_params.rb b/lib/privy/models/wallet_get_params.rb new file mode 100644 index 0000000..ae99847 --- /dev/null +++ b/lib/privy/models/wallet_get_params.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#get + class WalletGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(wallet_id:, request_options: {}) + # @param wallet_id [String] ID of the wallet. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_get_wallet_by_address_params.rb b/lib/privy/models/wallet_get_wallet_by_address_params.rb new file mode 100644 index 0000000..fa1d719 --- /dev/null +++ b/lib/privy/models/wallet_get_wallet_by_address_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#get_wallet_by_address + class WalletGetWalletByAddressParams < Privy::Models::GetByWalletAddressRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_import_init_response.rb b/lib/privy/models/wallet_import_init_response.rb new file mode 100644 index 0000000..f1a2724 --- /dev/null +++ b/lib/privy/models/wallet_import_init_response.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletImportInitResponse < Privy::Internal::Type::BaseModel + # @!attribute encryption_public_key + # + # @return [String] + required :encryption_public_key, String + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!attribute import_id + # + # @return [String, nil] + optional :import_id, String + + # @!method initialize(encryption_public_key:, encryption_type:, import_id: nil) + # Response from initializing a wallet import, containing the encryption public + # key. + # + # @param encryption_public_key [String] + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @param import_id [String] + end + end +end diff --git a/lib/privy/models/wallet_import_supported_chains.rb b/lib/privy/models/wallet_import_supported_chains.rb new file mode 100644 index 0000000..d41c6bf --- /dev/null +++ b/lib/privy/models/wallet_import_supported_chains.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + module WalletImportSupportedChains + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + SOLANA = :solana + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_import_supported_entropy_types.rb b/lib/privy/models/wallet_import_supported_entropy_types.rb new file mode 100644 index 0000000..c4cd47a --- /dev/null +++ b/lib/privy/models/wallet_import_supported_entropy_types.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + # The entropy type of the wallet to import. Supports `private-key` for raw private + # keys and `hd` for HD wallet seed phrases. + module WalletImportSupportedEntropyTypes + extend Privy::Internal::Type::Enum + + PRIVATE_KEY = :"private-key" + HD = :hd + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_init_import_params.rb b/lib/privy/models/wallet_init_import_params.rb new file mode 100644 index 0000000..f26c979 --- /dev/null +++ b/lib/privy/models/wallet_init_import_params.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#_init_import + class WalletInitImportParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute body + # The input for HD wallets. + # + # @return [Privy::Models::HDInitInput, Privy::Models::PrivateKeyInitInput] + required :body, union: -> { Privy::WalletInitImportParams::Body } + + # @!method initialize(body:, request_options: {}) + # @param body [Privy::Models::HDInitInput, Privy::Models::PrivateKeyInitInput] The input for HD wallets. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + # The input for HD wallets. + module Body + extend Privy::Internal::Type::Union + + discriminator :entropy_type + + # The input for HD wallets. + variant :hd, -> { Privy::HDInitInput } + + # The input for private key wallets. + variant :"private-key", -> { Privy::PrivateKeyInitInput } + + # @!method self.variants + # @return [Array(Privy::Models::HDInitInput, Privy::Models::PrivateKeyInitInput)] + end + end + end +end diff --git a/lib/privy/models/wallet_init_import_response.rb b/lib/privy/models/wallet_init_import_response.rb new file mode 100644 index 0000000..2bc97eb --- /dev/null +++ b/lib/privy/models/wallet_init_import_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#_init_import + class WalletInitImportResponse < Privy::Internal::Type::BaseModel + # @!attribute encryption_public_key + # The base64-encoded encryption public key to encrypt the wallet entropy with. + # + # @return [String] + required :encryption_public_key, String + + # @!attribute encryption_type + # The encryption type of the wallet to import. Currently only supports `HPKE`. + # + # @return [Symbol, Privy::Models::HpkeEncryption] + required :encryption_type, enum: -> { Privy::HpkeEncryption } + + # @!method initialize(encryption_public_key:, encryption_type:) + # @param encryption_public_key [String] The base64-encoded encryption public key to encrypt the wallet entropy with. + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] The encryption type of the wallet to import. Currently only supports `HPKE`. + end + end +end diff --git a/lib/privy/models/wallet_intent_response.rb b/lib/privy/models/wallet_intent_response.rb new file mode 100644 index 0000000..8079a16 --- /dev/null +++ b/lib/privy/models/wallet_intent_response.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Intents#update_wallet + class WalletIntentResponse < Privy::Models::BaseIntentResponse + # @!attribute intent_type + # + # @return [Symbol, Privy::Models::WalletIntentResponse::IntentType] + required :intent_type, enum: -> { Privy::WalletIntentResponse::IntentType } + + # @!attribute request_details + # The original wallet update request that would be sent to the wallet endpoint + # + # @return [Privy::Models::WalletIntentResponse::RequestDetails] + required :request_details, -> { Privy::WalletIntentResponse::RequestDetails } + + # @!attribute action_result + # Result of wallet update execution (only present if status is 'executed' or + # 'failed') + # + # @return [Privy::Models::BaseActionResult, nil] + optional :action_result, -> { Privy::BaseActionResult } + + # @!attribute current_resource_data + # A wallet managed by Privy's wallet infrastructure. + # + # @return [Privy::Models::Wallet, nil] + optional :current_resource_data, -> { Privy::Wallet } + + # @!method initialize(intent_type:, request_details:, action_result: nil, current_resource_data: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletIntentResponse} for more details. + # + # Response for a wallet intent + # + # @param intent_type [Symbol, Privy::Models::WalletIntentResponse::IntentType] + # + # @param request_details [Privy::Models::WalletIntentResponse::RequestDetails] The original wallet update request that would be sent to the wallet endpoint + # + # @param action_result [Privy::Models::BaseActionResult] Result of wallet update execution (only present if status is 'executed' or 'fail + # + # @param current_resource_data [Privy::Models::Wallet] A wallet managed by Privy's wallet infrastructure. + + module IntentType + extend Privy::Internal::Type::Enum + + WALLET = :WALLET + + # @!method self.values + # @return [Array] + end + + class RequestDetails < Privy::Internal::Type::BaseModel + # @!attribute body + # + # @return [Privy::Models::WalletIntentResponse::RequestDetails::Body] + required :body, -> { Privy::WalletIntentResponse::RequestDetails::Body } + + # @!attribute method_ + # + # @return [Symbol, Privy::Models::WalletIntentResponse::RequestDetails::Method] + required :method_, enum: -> { Privy::WalletIntentResponse::RequestDetails::Method }, api_name: :method + + # @!attribute url + # + # @return [String] + required :url, String + + # @!method initialize(body:, method_:, url:) + # The original wallet update request that would be sent to the wallet endpoint + # + # @param body [Privy::Models::WalletIntentResponse::RequestDetails::Body] + # @param method_ [Symbol, Privy::Models::WalletIntentResponse::RequestDetails::Method] + # @param url [String] + + # @see Privy::Models::WalletIntentResponse::RequestDetails#body + class Body < Privy::Internal::Type::BaseModel + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::AdditionalSignerItemInput] } + + # @!attribute authorization_key_ids + # + # @return [Array, nil] + optional :authorization_key_ids, Privy::Internal::Type::ArrayOf[String] + + # @!attribute authorization_threshold + # + # @return [Float, nil] + optional :authorization_threshold, Float + + # @!attribute display_name + # + # @return [String, nil] + optional :display_name, String, nil?: true + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute policy_ids + # An optional list of up to one policy ID to enforce on the wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(additional_signers: nil, authorization_key_ids: nil, authorization_threshold: nil, display_name: nil, owner: nil, owner_id: nil, policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletIntentResponse::RequestDetails::Body} for more details. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param authorization_key_ids [Array] + # + # @param authorization_threshold [Float] + # + # @param display_name [String, nil] + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + end + + # @see Privy::Models::WalletIntentResponse::RequestDetails#method_ + module Method + extend Privy::Internal::Type::Enum + + PATCH = :PATCH + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/privy/models/wallet_invite_input.rb b/lib/privy/models/wallet_invite_input.rb new file mode 100644 index 0000000..7ddebb3 --- /dev/null +++ b/lib/privy/models/wallet_invite_input.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletInviteInput < Privy::Internal::Type::BaseModel + # @!attribute type + # + # @return [Symbol, Privy::Models::WalletInviteInput::Type] + required :type, enum: -> { Privy::WalletInviteInput::Type } + + # @!attribute value + # + # @return [String] + required :value, String + + # @!method initialize(type:, value:) + # Allowlist invite input for a wallet address. + # + # @param type [Symbol, Privy::Models::WalletInviteInput::Type] + # @param value [String] + + # @see Privy::Models::WalletInviteInput#type + module Type + extend Privy::Internal::Type::Enum + + WALLET = :wallet + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_list_params.rb b/lib/privy/models/wallet_list_params.rb new file mode 100644 index 0000000..c31549e --- /dev/null +++ b/lib/privy/models/wallet_list_params.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#list + class WalletListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute authorization_key + # Filter wallets by authorization public key. Returns wallets owned by key quorums + # that include the specified P-256 public key (base64-encoded DER format). Cannot + # be used together with user_id. + # + # @return [String, nil] + optional :authorization_key, String + + # @!attribute chain_type + # The wallet chain types. + # + # @return [Symbol, Privy::Models::WalletChainType, nil] + optional :chain_type, enum: -> { Privy::WalletChainType } + + # @!attribute cursor + # + # @return [String, nil] + optional :cursor, String + + # @!attribute external_id + # Filter wallets by external ID. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute limit + # + # @return [Float, nil] + optional :limit, Float, nil?: true + + # @!attribute user_id + # Filter wallets by user ID. Cannot be used together with authorization_key. + # + # @return [String, nil] + optional :user_id, String + + # @!method initialize(authorization_key: nil, chain_type: nil, cursor: nil, external_id: nil, limit: nil, user_id: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletListParams} for more details. + # + # @param authorization_key [String] Filter wallets by authorization public key. Returns wallets owned by key quorums + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param cursor [String] + # + # @param external_id [String] Filter wallets by external ID. + # + # @param limit [Float, nil] + # + # @param user_id [String] Filter wallets by user ID. Cannot be used together with authorization_key. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_raw_sign_params.rb b/lib/privy/models/wallet_raw_sign_params.rb new file mode 100644 index 0000000..738272c --- /dev/null +++ b/lib/privy/models/wallet_raw_sign_params.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#raw_sign + class WalletRawSignParams < Privy::Models::RawSignInput + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletRawSignParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_recovered_webhook_payload.rb b/lib/privy/models/wallet_recovered_webhook_payload.rb new file mode 100644 index 0000000..c7de89c --- /dev/null +++ b/lib/privy/models/wallet_recovered_webhook_payload.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletRecoveredWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletRecoveredWebhookPayload::Type] + required :type, enum: -> { Privy::WalletRecoveredWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!attribute wallet_address + # The address of the wallet. + # + # @return [String] + required :wallet_address, String + + # @!attribute wallet_id + # The ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(type:, user_id:, wallet_address:, wallet_id:) + # Payload for the wallet.recovered webhook event. + # + # @param type [Symbol, Privy::Models::WalletRecoveredWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + # + # @param wallet_address [String] The address of the wallet. + # + # @param wallet_id [String] The ID of the wallet. + + # The type of webhook event. + # + # @see Privy::Models::WalletRecoveredWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_RECOVERED = :"wallet.recovered" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_recovery_setup_webhook_payload.rb b/lib/privy/models/wallet_recovery_setup_webhook_payload.rb new file mode 100644 index 0000000..93bcb8a --- /dev/null +++ b/lib/privy/models/wallet_recovery_setup_webhook_payload.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletRecoverySetupWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute method_ + # The recovery method that was set up. + # + # @return [Symbol, Privy::Models::WalletRecoverySetupWebhookPayload::Method] + required :method_, enum: -> { Privy::WalletRecoverySetupWebhookPayload::Method }, api_name: :method + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::WalletRecoverySetupWebhookPayload::Type] + required :type, enum: -> { Privy::WalletRecoverySetupWebhookPayload::Type } + + # @!attribute user_id + # The ID of the user. + # + # @return [String] + required :user_id, String + + # @!attribute wallet_address + # The address of the wallet. + # + # @return [String] + required :wallet_address, String + + # @!attribute wallet_id + # The ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!method initialize(method_:, type:, user_id:, wallet_address:, wallet_id:) + # Payload for the wallet.recovery_setup webhook event. + # + # @param method_ [Symbol, Privy::Models::WalletRecoverySetupWebhookPayload::Method] The recovery method that was set up. + # + # @param type [Symbol, Privy::Models::WalletRecoverySetupWebhookPayload::Type] The type of webhook event. + # + # @param user_id [String] The ID of the user. + # + # @param wallet_address [String] The address of the wallet. + # + # @param wallet_id [String] The ID of the wallet. + + # The recovery method that was set up. + # + # @see Privy::Models::WalletRecoverySetupWebhookPayload#method_ + module Method + extend Privy::Internal::Type::Enum + + USER_PASSCODE_DERIVED_RECOVERY_KEY = :user_passcode_derived_recovery_key + PRIVY_PASSCODE_DERIVED_RECOVERY_KEY = :privy_passcode_derived_recovery_key + PRIVY_GENERATED_RECOVERY_KEY = :privy_generated_recovery_key + GOOGLE_DRIVE_RECOVERY_SECRET = :google_drive_recovery_secret + ICLOUD_RECOVERY_SECRET = :icloud_recovery_secret + RECOVERY_ENCRYPTION_KEY = :recovery_encryption_key + + # @!method self.values + # @return [Array] + end + + # The type of webhook event. + # + # @see Privy::Models::WalletRecoverySetupWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + WALLET_RECOVERY_SETUP = :"wallet.recovery_setup" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/wallet_revoke_response.rb b/lib/privy/models/wallet_revoke_response.rb new file mode 100644 index 0000000..33c073b --- /dev/null +++ b/lib/privy/models/wallet_revoke_response.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletRevokeResponse < Privy::Internal::Type::BaseModel + # @!attribute message + # + # @return [String] + required :message, String + + # @!method initialize(message:) + # The response body from revoking a wallet delegation. + # + # @param message [String] + end + end +end diff --git a/lib/privy/models/wallet_rpc_params.rb b/lib/privy/models/wallet_rpc_params.rb new file mode 100644 index 0000000..3702a51 --- /dev/null +++ b/lib/privy/models/wallet_rpc_params.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#rpc + class WalletRpcParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletRpcParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_rpc_request_body.rb b/lib/privy/models/wallet_rpc_request_body.rb new file mode 100644 index 0000000..e0c9906 --- /dev/null +++ b/lib/privy/models/wallet_rpc_request_body.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module Privy + module Models + # Request body for wallet RPC operations, discriminated by method. + module WalletRpcRequestBody + extend Privy::Internal::Type::Union + + discriminator :method + + # Executes the EVM `eth_signTransaction` RPC to sign a transaction. + variant :eth_signTransaction, -> { Privy::EthereumSignTransactionRpcInput } + + # Executes the EVM `eth_sendTransaction` RPC to sign and broadcast a transaction. + variant :eth_sendTransaction, -> { Privy::EthereumSendTransactionRpcInput } + + # Executes the EVM `personal_sign` RPC (EIP-191) to sign a message. + variant :personal_sign, -> { Privy::EthereumPersonalSignRpcInput } + + # Executes the EVM `eth_signTypedData_v4` RPC (EIP-712) to sign a typed data object. + variant :eth_signTypedData_v4, -> { Privy::EthereumSignTypedDataRpcInput } + + # Signs a raw hash on the secp256k1 curve. + variant :secp256k1_sign, -> { Privy::EthereumSecp256k1SignRpcInput } + + # Signs an EIP-7702 authorization. + variant :eth_sign7702Authorization, -> { Privy::EthereumSign7702AuthorizationRpcInput } + + # Executes an RPC method to hash and sign a UserOperation. + variant :eth_signUserOperation, -> { Privy::EthereumSignUserOperationRpcInput } + + # Executes the `wallet_sendCalls` RPC (EIP-5792) to batch multiple calls into a single atomic transaction. + variant :wallet_sendCalls, -> { Privy::EthereumSendCallsRpcInput } + + # Executes the SVM `signTransaction` RPC to sign a transaction. + variant :signTransaction, -> { Privy::SolanaSignTransactionRpcInput } + + # Executes the SVM `signAndSendTransaction` RPC to sign and broadcast a transaction. + variant :signAndSendTransaction, -> { Privy::SolanaSignAndSendTransactionRpcInput } + + # Executes the SVM `signMessage` RPC to sign a message. + variant :signMessage, -> { Privy::SolanaSignMessageRpcInput } + + # Transfers satoshis to a Spark address. + variant :transfer, -> { Privy::SparkTransferRpcInput } + + # Gets the balance of the Spark wallet. + variant :getBalance, -> { Privy::SparkGetBalanceRpcInput } + + # Transfers tokens to a Spark address. + variant :transferTokens, -> { Privy::SparkTransferTokensRpcInput } + + # Gets a static deposit address for the Spark wallet. + variant :getStaticDepositAddress, -> { Privy::SparkGetStaticDepositAddressRpcInput } + + # Gets a quote for claiming a static deposit. + variant :getClaimStaticDepositQuote, -> { Privy::SparkGetClaimStaticDepositQuoteRpcInput } + + # Claims a static deposit into the Spark wallet. + variant :claimStaticDeposit, -> { Privy::SparkClaimStaticDepositRpcInput } + + # Creates a Lightning invoice for the Spark wallet. + variant :createLightningInvoice, -> { Privy::SparkCreateLightningInvoiceRpcInput } + + # Pays a Lightning invoice from the Spark wallet. + variant :payLightningInvoice, -> { Privy::SparkPayLightningInvoiceRpcInput } + + # Signs a message with the Spark identity key. + variant :signMessageWithIdentityKey, -> { Privy::SparkSignMessageWithIdentityKeyRpcInput } + + # Exports the private key of the wallet. + variant :exportPrivateKey, -> { Privy::ExportPrivateKeyRpcInput } + + # Exports the seed phrase of the wallet. + variant :exportSeedPhrase, -> { Privy::ExportSeedPhraseRpcInput } + + # @!method self.variants + # @return [Array(Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput, Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput, Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput, Privy::Models::ExportPrivateKeyRpcInput, Privy::Models::ExportSeedPhraseRpcInput)] + end + end +end diff --git a/lib/privy/models/wallet_rpc_response.rb b/lib/privy/models/wallet_rpc_response.rb new file mode 100644 index 0000000..290fdef --- /dev/null +++ b/lib/privy/models/wallet_rpc_response.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +module Privy + module Models + # Response body for wallet RPC operations, discriminated by method. + # + # @see Privy::Resources::Wallets#rpc + module WalletRpcResponse + extend Privy::Internal::Type::Union + + discriminator :method + + # Response to the EVM `personal_sign` RPC. + variant :personal_sign, -> { Privy::EthereumPersonalSignRpcResponse } + + # Response to the EVM `eth_signTypedData_v4` RPC. + variant :eth_signTypedData_v4, -> { Privy::EthereumSignTypedDataRpcResponse } + + # Response to the EVM `eth_signTransaction` RPC. + variant :eth_signTransaction, -> { Privy::EthereumSignTransactionRpcResponse } + + # Response to the EVM `eth_sendTransaction` RPC. + variant :eth_sendTransaction, -> { Privy::EthereumSendTransactionRpcResponse } + + # Response to the EVM `eth_signUserOperation` RPC. + variant :eth_signUserOperation, -> { Privy::EthereumSignUserOperationRpcResponse } + + # Response to the EVM `eth_sign7702Authorization` RPC. + variant :eth_sign7702Authorization, -> { Privy::EthereumSign7702AuthorizationRpcResponse } + + # Response to the EVM `secp256k1_sign` RPC. + variant :secp256k1_sign, -> { Privy::EthereumSecp256k1SignRpcResponse } + + # Response to the `wallet_sendCalls` RPC. + variant :wallet_sendCalls, -> { Privy::EthereumSendCallsRpcResponse } + + # Response to the SVM `signMessage` RPC. + variant :signMessage, -> { Privy::SolanaSignMessageRpcResponse } + + # Response to the SVM `signTransaction` RPC. + variant :signTransaction, -> { Privy::SolanaSignTransactionRpcResponse } + + # Response to the SVM `signAndSendTransaction` RPC. + variant :signAndSendTransaction, -> { Privy::SolanaSignAndSendTransactionRpcResponse } + + # Response to the Spark `transfer` RPC. + variant :transfer, -> { Privy::SparkTransferRpcResponse } + + # Response to the Spark `getBalance` RPC. + variant :getBalance, -> { Privy::SparkGetBalanceRpcResponse } + + # Response to the Spark `transferTokens` RPC. + variant :transferTokens, -> { Privy::SparkTransferTokensRpcResponse } + + # Response to the Spark `getStaticDepositAddress` RPC. + variant :getStaticDepositAddress, -> { Privy::SparkGetStaticDepositAddressRpcResponse } + + # Response to the Spark `getClaimStaticDepositQuote` RPC. + variant :getClaimStaticDepositQuote, -> { Privy::SparkGetClaimStaticDepositQuoteRpcResponse } + + # Response to the Spark `claimStaticDeposit` RPC. + variant :claimStaticDeposit, -> { Privy::SparkClaimStaticDepositRpcResponse } + + # Response to the Spark `createLightningInvoice` RPC. + variant :createLightningInvoice, -> { Privy::SparkCreateLightningInvoiceRpcResponse } + + # Response to the Spark `payLightningInvoice` RPC. + variant :payLightningInvoice, -> { Privy::SparkPayLightningInvoiceRpcResponse } + + # Response to the Spark `signMessageWithIdentityKey` RPC. + variant :signMessageWithIdentityKey, -> { Privy::SparkSignMessageWithIdentityKeyRpcResponse } + + # Response to the `exportPrivateKey` RPC. + variant :exportPrivateKey, -> { Privy::ExportPrivateKeyRpcResponse } + + # Response to the `exportSeedPhrase` RPC. + variant :exportSeedPhrase, -> { Privy::ExportSeedPhraseRpcResponse } + + # @!method self.variants + # @return [Array(Privy::Models::EthereumPersonalSignRpcResponse, Privy::Models::EthereumSignTypedDataRpcResponse, Privy::Models::EthereumSignTransactionRpcResponse, Privy::Models::EthereumSendTransactionRpcResponse, Privy::Models::EthereumSignUserOperationRpcResponse, Privy::Models::EthereumSign7702AuthorizationRpcResponse, Privy::Models::EthereumSecp256k1SignRpcResponse, Privy::Models::EthereumSendCallsRpcResponse, Privy::Models::SolanaSignMessageRpcResponse, Privy::Models::SolanaSignTransactionRpcResponse, Privy::Models::SolanaSignAndSendTransactionRpcResponse, Privy::Models::SparkTransferRpcResponse, Privy::Models::SparkGetBalanceRpcResponse, Privy::Models::SparkTransferTokensRpcResponse, Privy::Models::SparkGetStaticDepositAddressRpcResponse, Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse, Privy::Models::SparkClaimStaticDepositRpcResponse, Privy::Models::SparkCreateLightningInvoiceRpcResponse, Privy::Models::SparkPayLightningInvoiceRpcResponse, Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse, Privy::Models::ExportPrivateKeyRpcResponse, Privy::Models::ExportSeedPhraseRpcResponse)] + end + end +end diff --git a/lib/privy/models/wallet_solana_asset.rb b/lib/privy/models/wallet_solana_asset.rb new file mode 100644 index 0000000..206a024 --- /dev/null +++ b/lib/privy/models/wallet_solana_asset.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + module Models + # A named asset on Solana. + module WalletSolanaAsset + extend Privy::Internal::Type::Enum + + SOL = :sol + USDC = :usdc + EURC = :eurc + USDB = :usdb + + # @!method self.values + # @return [Array] + end + end +end diff --git a/lib/privy/models/wallet_submit_import_params.rb b/lib/privy/models/wallet_submit_import_params.rb new file mode 100644 index 0000000..33ee218 --- /dev/null +++ b/lib/privy/models/wallet_submit_import_params.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#_submit_import + class WalletSubmitImportParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet + # The submission input for importing an HD wallet. + # + # @return [Privy::Models::HDSubmitInput, Privy::Models::PrivateKeySubmitInput] + required :wallet, union: -> { Privy::WalletSubmitImportParams::Wallet } + + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::AdditionalSignerItemInput] } + + # @!attribute display_name + # A human-readable label for the wallet. + # + # @return [String, nil] + optional :display_name, String + + # @!attribute external_id + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + # + # @return [String, nil] + optional :external_id, String + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute policy_ids + # An optional list of up to one policy ID to enforce on the wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(wallet:, additional_signers: nil, display_name: nil, external_id: nil, owner: nil, owner_id: nil, policy_ids: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletSubmitImportParams} for more details. + # + # @param wallet [Privy::Models::HDSubmitInput, Privy::Models::PrivateKeySubmitInput] The submission input for importing an HD wallet. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param display_name [String] A human-readable label for the wallet. + # + # @param external_id [String] A customer-provided identifier for mapping to external systems. URL-safe charact + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + # The submission input for importing an HD wallet. + module Wallet + extend Privy::Internal::Type::Union + + discriminator :entropy_type + + # The submission input for importing an HD wallet. + variant :hd, -> { Privy::HDSubmitInput } + + # The submission input for importing a private key wallet. + variant :"private-key", -> { Privy::PrivateKeySubmitInput } + + # @!method self.variants + # @return [Array(Privy::Models::HDSubmitInput, Privy::Models::PrivateKeySubmitInput)] + end + end + end +end diff --git a/lib/privy/models/wallet_transfer_params.rb b/lib/privy/models/wallet_transfer_params.rb new file mode 100644 index 0000000..e049b4a --- /dev/null +++ b/lib/privy/models/wallet_transfer_params.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#_transfer + class WalletTransferParams < Privy::Models::TransferRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletTransferParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_update_params.rb b/lib/privy/models/wallet_update_params.rb new file mode 100644 index 0000000..5e2294c --- /dev/null +++ b/lib/privy/models/wallet_update_params.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Wallets#update + class WalletUpdateParams < Privy::Models::WalletUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletUpdateParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/wallet_update_request_body.rb b/lib/privy/models/wallet_update_request_body.rb new file mode 100644 index 0000000..8c74449 --- /dev/null +++ b/lib/privy/models/wallet_update_request_body.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +module Privy + module Models + class WalletUpdateRequestBody < Privy::Internal::Type::BaseModel + # @!attribute additional_signers + # Additional signers for the wallet. + # + # @return [Array, nil] + optional :additional_signers, -> { Privy::Internal::Type::ArrayOf[Privy::AdditionalSignerItemInput] } + + # @!attribute display_name + # A human-readable label for the wallet. Set to null to clear. + # + # @return [String, nil] + optional :display_name, String, nil?: true + + # @!attribute owner + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + # + # @return [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] + optional :owner, union: -> { Privy::OwnerInput }, nil?: true + + # @!attribute owner_id + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + # + # @return [String, nil] + optional :owner_id, String, nil?: true + + # @!attribute policy_ids + # New policy IDs to enforce on the wallet. Currently, only one policy is supported + # per wallet. + # + # @return [Array, nil] + optional :policy_ids, Privy::Internal::Type::ArrayOf[String] + + # @!method initialize(additional_signers: nil, display_name: nil, owner: nil, owner_id: nil, policy_ids: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletUpdateRequestBody} for more details. + # + # Request body for updating a wallet. `owner` and `owner_id` are mutually + # exclusive. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param display_name [String, nil] A human-readable label for the wallet. Set to null to clear. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param policy_ids [Array] New policy IDs to enforce on the wallet. Currently, only one policy is supported + end + end +end diff --git a/lib/privy/models/wallets/balance_get_params.rb b/lib/privy/models/wallets/balance_get_params.rb new file mode 100644 index 0000000..23017ee --- /dev/null +++ b/lib/privy/models/wallets/balance_get_params.rb @@ -0,0 +1,247 @@ +# frozen_string_literal: true + +module Privy + module Models + module Wallets + # @see Privy::Resources::Wallets::Balance#get + class BalanceGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute token + # The token contract address(es) to query in format "chain:address" (e.g., + # "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" or + # "solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"). Cannot be used together + # with `asset`/`chain` or with `include_currency`. + # + # @return [String, Array, nil] + optional :token, union: -> { Privy::Wallets::BalanceGetParams::Token } + + # @!attribute asset + # Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # the query. Cannot be used with `token`. + # + # @return [Symbol, Array, Privy::Models::Wallets::BalanceGetParams::Asset, nil] + optional :asset, union: -> { Privy::Wallets::BalanceGetParams::Asset } + + # @!attribute chain + # Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with + # `asset`. Cannot be used with `token`. + # + # @return [Symbol, Array, Privy::Models::Wallets::BalanceGetParams::Chain, nil] + optional :chain, union: -> { Privy::Wallets::BalanceGetParams::Chain } + + # @!attribute include_currency + # If set, balances are converted to the specified fiat currency. Not supported + # when `token` is provided. + # + # @return [Symbol, Privy::Models::Wallets::BalanceGetParams::IncludeCurrency, nil] + optional :include_currency, enum: -> { Privy::Wallets::BalanceGetParams::IncludeCurrency } + + # @!method initialize(wallet_id:, token: nil, asset: nil, chain: nil, include_currency: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::BalanceGetParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param token [String, Array] The token contract address(es) to query in format "chain:address" (e.g., "base:0 + # + # @param asset [Symbol, Array, Privy::Models::Wallets::BalanceGetParams::Asset] Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # + # @param chain [Symbol, Array, Privy::Models::Wallets::BalanceGetParams::Chain] Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with ` + # + # @param include_currency [Symbol, Privy::Models::Wallets::BalanceGetParams::IncludeCurrency] If set, balances are converted to the specified fiat currency. Not supported whe + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + # The token contract address(es) to query in format "chain:address" (e.g., + # "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" or + # "solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"). Cannot be used together + # with `asset`/`chain` or with `include_currency`. + module Token + extend Privy::Internal::Type::Union + + variant String + + variant -> { Privy::Models::Wallets::BalanceGetParams::Token::StringArray } + + # @!method self.variants + # @return [Array(String, Array)] + + # @type [Privy::Internal::Type::Converter] + StringArray = Privy::Internal::Type::ArrayOf[String] + end + + # Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # the query. Cannot be used with `token`. + module Asset + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::USDC } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::USDC_E } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::ETH } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::POL } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::USDT } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::EURC } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::USDB } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Asset::SOL } + + variant -> { Privy::Models::Wallets::BalanceGetParams::Asset::WalletAssetArray } + + # @!method self.variants + # @return [Array(Symbol, Array)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol, T::Array[Privy::WalletAsset::TaggedSymbol]) } + end + + # @!group + + USDC = :usdc + USDC_E = :"usdc.e" + ETH = :eth + POL = :pol + USDT = :usdt + EURC = :eurc + USDB = :usdb + SOL = :sol + + # @!endgroup + + # @type [Privy::Internal::Type::Converter] + WalletAssetArray = Privy::Internal::Type::ArrayOf[enum: -> { Privy::WalletAsset }] + end + + # Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with + # `asset`. Cannot be used with `token`. + module Chain + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::ETHEREUM } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::ARBITRUM } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::BASE } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::TEMPO } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::LINEA } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::OPTIMISM } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::POLYGON } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::SOLANA } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::ZKSYNC_ERA } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::SEPOLIA } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::ARBITRUM_SEPOLIA } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::BASE_SEPOLIA } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::LINEA_TESTNET } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::OPTIMISM_SEPOLIA } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::POLYGON_AMOY } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::SOLANA_DEVNET } + + variant const: -> { Privy::Models::Wallets::BalanceGetParams::Chain::SOLANA_TESTNET } + + variant -> { Privy::Models::Wallets::BalanceGetParams::Chain::UnionMember1Array } + + module UnionMember1 + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + ARBITRUM = :arbitrum + BASE = :base + TEMPO = :tempo + LINEA = :linea + OPTIMISM = :optimism + POLYGON = :polygon + SOLANA = :solana + ZKSYNC_ERA = :zksync_era + SEPOLIA = :sepolia + ARBITRUM_SEPOLIA = :arbitrum_sepolia + BASE_SEPOLIA = :base_sepolia + LINEA_TESTNET = :linea_testnet + OPTIMISM_SEPOLIA = :optimism_sepolia + POLYGON_AMOY = :polygon_amoy + SOLANA_DEVNET = :solana_devnet + SOLANA_TESTNET = :solana_testnet + + # @!method self.values + # @return [Array] + end + + # @!method self.variants + # @return [Array(Symbol, Array)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol, + T::Array[Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol] + ) + end + end + + # @!group + + ETHEREUM = :ethereum + ARBITRUM = :arbitrum + BASE = :base + TEMPO = :tempo + LINEA = :linea + OPTIMISM = :optimism + POLYGON = :polygon + SOLANA = :solana + ZKSYNC_ERA = :zksync_era + SEPOLIA = :sepolia + ARBITRUM_SEPOLIA = :arbitrum_sepolia + BASE_SEPOLIA = :base_sepolia + LINEA_TESTNET = :linea_testnet + OPTIMISM_SEPOLIA = :optimism_sepolia + POLYGON_AMOY = :polygon_amoy + SOLANA_DEVNET = :solana_devnet + SOLANA_TESTNET = :solana_testnet + + # @!endgroup + + # @type [Privy::Internal::Type::Converter] + UnionMember1Array = + Privy::Internal::Type::ArrayOf[enum: -> { Privy::Wallets::BalanceGetParams::Chain::UnionMember1 }] + end + + # If set, balances are converted to the specified fiat currency. Not supported + # when `token` is provided. + module IncludeCurrency + extend Privy::Internal::Type::Enum + + USD = :usd + EUR = :eur + + # @!method self.values + # @return [Array] + end + end + end + end +end diff --git a/lib/privy/models/wallets/balance_get_response.rb b/lib/privy/models/wallets/balance_get_response.rb new file mode 100644 index 0000000..99224ea --- /dev/null +++ b/lib/privy/models/wallets/balance_get_response.rb @@ -0,0 +1,122 @@ +# frozen_string_literal: true + +module Privy + module Models + module Wallets + # @see Privy::Resources::Wallets::Balance#get + class BalanceGetResponse < Privy::Internal::Type::BaseModel + # @!attribute balances + # + # @return [Array] + required :balances, + -> { Privy::Internal::Type::ArrayOf[Privy::Models::Wallets::BalanceGetResponse::Balance] } + + # @!method initialize(balances:) + # @param balances [Array] + + class Balance < Privy::Internal::Type::BaseModel + # @!attribute asset + # + # @return [Symbol, String, Privy::Models::Wallets::BalanceGetResponse::Balance::Asset] + required :asset, union: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset } + + # @!attribute chain + # + # @return [Symbol, Privy::Models::Wallets::BalanceGetResponse::Balance::Chain] + required :chain, enum: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Chain } + + # @!attribute display_values + # + # @return [Hash{Symbol=>String}] + required :display_values, Privy::Internal::Type::HashOf[String] + + # @!attribute raw_value + # + # @return [String] + required :raw_value, String + + # @!attribute raw_value_decimals + # + # @return [Float] + required :raw_value_decimals, Float + + # @!method initialize(asset:, chain:, display_values:, raw_value:, raw_value_decimals:) + # @param asset [Symbol, String, Privy::Models::Wallets::BalanceGetResponse::Balance::Asset] + # @param chain [Symbol, Privy::Models::Wallets::BalanceGetResponse::Balance::Chain] + # @param display_values [Hash{Symbol=>String}] + # @param raw_value [String] + # @param raw_value_decimals [Float] + + # @see Privy::Models::Wallets::BalanceGetResponse::Balance#asset + module Asset + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDC } + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDC_E } + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::ETH } + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::POL } + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDT } + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::EURC } + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::USDB } + + variant const: -> { Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::SOL } + + variant String + + # @!method self.variants + # @return [Array(Symbol, String)] + + define_sorbet_constant!(:Variants) do + T.type_alias { T.any(Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol, String) } + end + + # @!group + + USDC = :usdc + USDC_E = :"usdc.e" + ETH = :eth + POL = :pol + USDT = :usdt + EURC = :eurc + USDB = :usdb + SOL = :sol + + # @!endgroup + end + + # @see Privy::Models::Wallets::BalanceGetResponse::Balance#chain + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + ARBITRUM = :arbitrum + BASE = :base + TEMPO = :tempo + LINEA = :linea + OPTIMISM = :optimism + POLYGON = :polygon + SOLANA = :solana + ZKSYNC_ERA = :zksync_era + SEPOLIA = :sepolia + ARBITRUM_SEPOLIA = :arbitrum_sepolia + BASE_SEPOLIA = :base_sepolia + LINEA_TESTNET = :linea_testnet + OPTIMISM_SEPOLIA = :optimism_sepolia + POLYGON_AMOY = :polygon_amoy + SOLANA_DEVNET = :solana_devnet + SOLANA_TESTNET = :solana_testnet + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/privy/models/wallets/earn/ethereum/incentive_claim_params.rb b/lib/privy/models/wallets/earn/ethereum/incentive_claim_params.rb new file mode 100644 index 0000000..9bd301b --- /dev/null +++ b/lib/privy/models/wallets/earn/ethereum/incentive_claim_params.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +module Privy + module Models + module Wallets + module Earn + module Ethereum + # @see Privy::Resources::Wallets::Earn::Ethereum::Incentive#_claim + class IncentiveClaimParams < Privy::Models::EarnIncentiveClaimRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::Earn::Ethereum::IncentiveClaimParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end + end +end diff --git a/lib/privy/models/wallets/earn/ethereum_deposit_params.rb b/lib/privy/models/wallets/earn/ethereum_deposit_params.rb new file mode 100644 index 0000000..e9bf5f0 --- /dev/null +++ b/lib/privy/models/wallets/earn/ethereum_deposit_params.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Privy + module Models + module Wallets + module Earn + # @see Privy::Resources::Wallets::Earn::Ethereum#_deposit + class EthereumDepositParams < Privy::Models::EarnDepositRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::Earn::EthereumDepositParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/privy/models/wallets/earn/ethereum_withdraw_params.rb b/lib/privy/models/wallets/earn/ethereum_withdraw_params.rb new file mode 100644 index 0000000..72112ac --- /dev/null +++ b/lib/privy/models/wallets/earn/ethereum_withdraw_params.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +module Privy + module Models + module Wallets + module Earn + # @see Privy::Resources::Wallets::Earn::Ethereum#_withdraw + class EthereumWithdrawParams < Privy::Models::EarnWithdrawRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String + + # @!attribute privy_idempotency_key + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + # + # @return [String, nil] + optional :privy_idempotency_key, String + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String + + # @!method initialize(wallet_id:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::Earn::EthereumWithdrawParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_idempotency_key [String] Idempotency keys ensure API requests are executed only once within a 24-hour win + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end + end + end +end diff --git a/lib/privy/models/wallets/transaction_get_params.rb b/lib/privy/models/wallets/transaction_get_params.rb new file mode 100644 index 0000000..e8da044 --- /dev/null +++ b/lib/privy/models/wallets/transaction_get_params.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +module Privy + module Models + module Wallets + # @see Privy::Resources::Wallets::Transactions#get + class TransactionGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!attribute wallet_id + # ID of the wallet. + # + # @return [String] + required :wallet_id, String + + # @!attribute chain + # + # @return [Symbol, Privy::Models::Wallets::TransactionGetParams::Chain] + required :chain, enum: -> { Privy::Wallets::TransactionGetParams::Chain } + + # @!attribute token + # Exactly one of `token` or `asset` is required. Cannot be used together with + # `asset`. + # + # @return [String, Array, nil] + optional :token, union: -> { Privy::Wallets::TransactionGetParams::Token } + + # @!attribute asset + # Exactly one of `asset` or `token` is required. Cannot be used together with + # `token`. + # + # @return [Symbol, Array, Privy::Models::Wallets::TransactionGetParams::Asset, nil] + optional :asset, union: -> { Privy::Wallets::TransactionGetParams::Asset } + + # @!attribute cursor + # + # @return [String, nil] + optional :cursor, String + + # @!attribute limit + # + # @return [Float, nil] + optional :limit, Float, nil?: true + + # @!attribute tx_hash + # + # @return [String, nil] + optional :tx_hash, String + + # @!method initialize(wallet_id:, chain:, token: nil, asset: nil, cursor: nil, limit: nil, tx_hash: nil, request_options: {}) + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::TransactionGetParams} for more details. + # + # @param wallet_id [String] ID of the wallet. + # + # @param chain [Symbol, Privy::Models::Wallets::TransactionGetParams::Chain] + # + # @param token [String, Array] Exactly one of `token` or `asset` is required. Cannot be used together with `ass + # + # @param asset [Symbol, Array, Privy::Models::Wallets::TransactionGetParams::Asset] Exactly one of `asset` or `token` is required. Cannot be used together with `tok + # + # @param cursor [String] + # + # @param limit [Float, nil] + # + # @param tx_hash [String] + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM = :ethereum + ARBITRUM = :arbitrum + BASE = :base + TEMPO = :tempo + LINEA = :linea + OPTIMISM = :optimism + POLYGON = :polygon + SOLANA = :solana + SEPOLIA = :sepolia + + # @!method self.values + # @return [Array] + end + + # Exactly one of `token` or `asset` is required. Cannot be used together with + # `asset`. + module Token + extend Privy::Internal::Type::Union + + # Token contract address (EVM: 0x-prefixed hex) or mint address (Solana: base58), used to filter wallet transactions. + variant -> { Privy::TransactionTokenAddressInput } + + variant -> { Privy::Models::Wallets::TransactionGetParams::Token::TransactionTokenAddressInputArray } + + # @!method self.variants + # @return [Array(String, Array)] + + # @type [Privy::Internal::Type::Converter] + TransactionTokenAddressInputArray = Privy::Internal::Type::ArrayOf[String] + end + + # Exactly one of `asset` or `token` is required. Cannot be used together with + # `token`. + module Asset + extend Privy::Internal::Type::Union + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::USDC } + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::USDC_E } + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::ETH } + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::POL } + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::USDT } + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::EURC } + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::USDB } + + variant const: -> { Privy::Models::Wallets::TransactionGetParams::Asset::SOL } + + variant -> { Privy::Models::Wallets::TransactionGetParams::Asset::WalletAssetArray } + + # @!method self.variants + # @return [Array(Symbol, Array)] + + define_sorbet_constant!(:Variants) do + T.type_alias do + T.any( + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol, + T::Array[Privy::WalletAsset::TaggedSymbol] + ) + end + end + + # @!group + + USDC = :usdc + USDC_E = :"usdc.e" + ETH = :eth + POL = :pol + USDT = :usdt + EURC = :eurc + USDB = :usdb + SOL = :sol + + # @!endgroup + + # @type [Privy::Internal::Type::Converter] + WalletAssetArray = Privy::Internal::Type::ArrayOf[enum: -> { Privy::WalletAsset }] + end + end + end + end +end diff --git a/lib/privy/models/wallets/transaction_get_response.rb b/lib/privy/models/wallets/transaction_get_response.rb new file mode 100644 index 0000000..84baaaf --- /dev/null +++ b/lib/privy/models/wallets/transaction_get_response.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +module Privy + module Models + module Wallets + # @see Privy::Resources::Wallets::Transactions#get + class TransactionGetResponse < Privy::Internal::Type::BaseModel + # @!attribute next_cursor + # + # @return [String, nil] + required :next_cursor, String, nil?: true + + # @!attribute transactions + # + # @return [Array] + required :transactions, + -> { Privy::Internal::Type::ArrayOf[Privy::Models::Wallets::TransactionGetResponse::Transaction] } + + # @!method initialize(next_cursor:, transactions:) + # @param next_cursor [String, nil] + # @param transactions [Array] + + class Transaction < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # + # @return [String] + required :caip2, String + + # @!attribute created_at + # + # @return [Float] + required :created_at, Float + + # @!attribute details + # Details of a wallet transaction, varying by transaction type. + # + # @return [Privy::Models::Wallets::TransactionGetResponse::Transaction::Details] + required :details, -> { Privy::Models::Wallets::TransactionGetResponse::Transaction::Details } + + # @!attribute privy_transaction_id + # + # @return [String] + required :privy_transaction_id, String + + # @!attribute status + # + # @return [Symbol, Privy::Models::Wallets::TransactionGetResponse::Transaction::Status] + required :status, enum: -> { Privy::Models::Wallets::TransactionGetResponse::Transaction::Status } + + # @!attribute transaction_hash + # + # @return [String, nil] + required :transaction_hash, String, nil?: true + + # @!attribute wallet_id + # + # @return [String] + required :wallet_id, String + + # @!attribute sponsored + # + # @return [Boolean, nil] + optional :sponsored, Privy::Internal::Type::Boolean + + # @!attribute user_operation_hash + # + # @return [String, nil] + optional :user_operation_hash, String + + # @!method initialize(caip2:, created_at:, details:, privy_transaction_id:, status:, transaction_hash:, wallet_id:, sponsored: nil, user_operation_hash: nil) + # @param caip2 [String] + # + # @param created_at [Float] + # + # @param details [Privy::Models::Wallets::TransactionGetResponse::Transaction::Details] Details of a wallet transaction, varying by transaction type. + # + # @param privy_transaction_id [String] + # + # @param status [Symbol, Privy::Models::Wallets::TransactionGetResponse::Transaction::Status] + # + # @param transaction_hash [String, nil] + # + # @param wallet_id [String] + # + # @param sponsored [Boolean] + # + # @param user_operation_hash [String] + + # @see Privy::Models::Wallets::TransactionGetResponse::Transaction#details + class Details < Privy::Internal::Type::BaseModel + # @!method initialize + # Details of a wallet transaction, varying by transaction type. + end + + # @see Privy::Models::Wallets::TransactionGetResponse::Transaction#status + module Status + extend Privy::Internal::Type::Enum + + BROADCASTED = :broadcasted + CONFIRMED = :confirmed + EXECUTION_REVERTED = :execution_reverted + FAILED = :failed + REPLACED = :replaced + FINALIZED = :finalized + PROVIDER_ERROR = :provider_error + PENDING = :pending + + # @!method self.values + # @return [Array] + end + end + end + end + end +end diff --git a/lib/privy/models/webhook_payload.rb b/lib/privy/models/webhook_payload.rb new file mode 100644 index 0000000..b8efdfa --- /dev/null +++ b/lib/privy/models/webhook_payload.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +module Privy + module Models + # Union of all webhook payload schemas. + module WebhookPayload + extend Privy::Internal::Type::Union + + # Payload for the user.created webhook event. + variant -> { Privy::UserCreatedWebhookPayload } + + # Payload for the user.authenticated webhook event. + variant -> { Privy::UserAuthenticatedWebhookPayload } + + # Payload for the user.linked_account webhook event. + variant -> { Privy::UserLinkedAccountWebhookPayload } + + # Payload for the user.unlinked_account webhook event. + variant -> { Privy::UserUnlinkedAccountWebhookPayload } + + # Payload for the user.updated_account webhook event. + variant -> { Privy::UserUpdatedAccountWebhookPayload } + + # Payload for the user.transferred_account webhook event. + variant -> { Privy::UserTransferredAccountWebhookPayload } + + # Payload for the user.wallet_created webhook event. + variant -> { Privy::UserWalletCreatedWebhookPayload } + + # Payload for the transaction.broadcasted webhook event. + variant -> { Privy::TransactionBroadcastedWebhookPayload } + + # Payload for the transaction.confirmed webhook event. + variant -> { Privy::TransactionConfirmedWebhookPayload } + + # Payload for the transaction.execution_reverted webhook event. + variant -> { Privy::TransactionExecutionRevertedWebhookPayload } + + # Payload for the transaction.still_pending webhook event. + variant -> { Privy::TransactionStillPendingWebhookPayload } + + # Payload for the transaction.failed webhook event. + variant -> { Privy::TransactionFailedWebhookPayload } + + # Payload for the transaction.replaced webhook event. + variant -> { Privy::TransactionReplacedWebhookPayload } + + # Payload for the transaction.provider_error webhook event. + variant -> { Privy::TransactionProviderErrorWebhookPayload } + + # Payload for the wallet.funds_deposited webhook event. + variant -> { Privy::FundsDepositedWebhookPayload } + + # Payload for the wallet.funds_withdrawn webhook event. + variant -> { Privy::FundsWithdrawnWebhookPayload } + + # Payload for the wallet.private_key_export webhook event. + variant -> { Privy::PrivateKeyExportWebhookPayload } + + # Payload for the wallet.seed_phrase_export webhook event. + variant -> { Privy::SeedPhraseExportWebhookPayload } + + # Payload for the wallet.recovery_setup webhook event. + variant -> { Privy::WalletRecoverySetupWebhookPayload } + + # Payload for the wallet.recovered webhook event. + variant -> { Privy::WalletRecoveredWebhookPayload } + + # Payload for the mfa.enabled webhook event. + variant -> { Privy::MfaEnabledWebhookPayload } + + # Payload for the mfa.disabled webhook event. + variant -> { Privy::MfaDisabledWebhookPayload } + + # Payload for the yield.deposit.confirmed webhook event. + variant -> { Privy::YieldDepositConfirmedWebhookPayload } + + # Payload for the yield.withdraw.confirmed webhook event. + variant -> { Privy::YieldWithdrawConfirmedWebhookPayload } + + # Payload for the yield.claim.confirmed webhook event. + variant -> { Privy::YieldClaimConfirmedWebhookPayload } + + # Payload for the user_operation.completed webhook event. + variant -> { Privy::UserOperationCompletedWebhookPayload } + + # Payload for the intent.created webhook event. + variant -> { Privy::IntentCreatedWebhookPayload } + + # Payload for the intent.authorized webhook event. + variant -> { Privy::IntentAuthorizedWebhookPayload } + + # Payload for the intent.rejected webhook event. + variant -> { Privy::IntentRejectedWebhookPayload } + + # Payload for the intent.executed webhook event. + variant -> { Privy::IntentExecutedWebhookPayload } + + # Payload for the intent.failed webhook event. + variant -> { Privy::IntentFailedWebhookPayload } + + # Payload for the wallet_action.swap.created webhook event. + variant -> { Privy::WalletActionSwapCreatedWebhookPayload } + + # Payload for the wallet_action.swap.succeeded webhook event. + variant -> { Privy::WalletActionSwapSucceededWebhookPayload } + + # Payload for the wallet_action.swap.rejected webhook event. + variant -> { Privy::WalletActionSwapRejectedWebhookPayload } + + # Payload for the wallet_action.swap.failed webhook event. + variant -> { Privy::WalletActionSwapFailedWebhookPayload } + + # Payload for the wallet_action.transfer.created webhook event. + variant -> { Privy::WalletActionTransferCreatedWebhookPayload } + + # Payload for the wallet_action.transfer.succeeded webhook event. + variant -> { Privy::WalletActionTransferSucceededWebhookPayload } + + # Payload for the wallet_action.transfer.rejected webhook event. + variant -> { Privy::WalletActionTransferRejectedWebhookPayload } + + # Payload for the wallet_action.transfer.failed webhook event. + variant -> { Privy::WalletActionTransferFailedWebhookPayload } + + # Payload for the wallet_action.earn_deposit.created webhook event. + variant -> { Privy::WalletActionEarnDepositCreatedWebhookPayload } + + # Payload for the wallet_action.earn_deposit.succeeded webhook event. + variant -> { Privy::WalletActionEarnDepositSucceededWebhookPayload } + + # Payload for the wallet_action.earn_deposit.rejected webhook event. + variant -> { Privy::WalletActionEarnDepositRejectedWebhookPayload } + + # Payload for the wallet_action.earn_deposit.failed webhook event. + variant -> { Privy::WalletActionEarnDepositFailedWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.created webhook event. + variant -> { Privy::WalletActionEarnWithdrawCreatedWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.succeeded webhook event. + variant -> { Privy::WalletActionEarnWithdrawSucceededWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.rejected webhook event. + variant -> { Privy::WalletActionEarnWithdrawRejectedWebhookPayload } + + # Payload for the wallet_action.earn_withdraw.failed webhook event. + variant -> { Privy::WalletActionEarnWithdrawFailedWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.created webhook event. + variant -> { Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.succeeded webhook event. + variant -> { Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.rejected webhook event. + variant -> { Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload } + + # Payload for the wallet_action.earn_incentive_claim.failed webhook event. + variant -> { Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload } + + # @!method self.variants + # @return [Array(Privy::Models::UserCreatedWebhookPayload, Privy::Models::UserAuthenticatedWebhookPayload, Privy::Models::UserLinkedAccountWebhookPayload, Privy::Models::UserUnlinkedAccountWebhookPayload, Privy::Models::UserUpdatedAccountWebhookPayload, Privy::Models::UserTransferredAccountWebhookPayload, Privy::Models::UserWalletCreatedWebhookPayload, Privy::Models::TransactionBroadcastedWebhookPayload, Privy::Models::TransactionConfirmedWebhookPayload, Privy::Models::TransactionExecutionRevertedWebhookPayload, Privy::Models::TransactionStillPendingWebhookPayload, Privy::Models::TransactionFailedWebhookPayload, Privy::Models::TransactionReplacedWebhookPayload, Privy::Models::TransactionProviderErrorWebhookPayload, Privy::Models::FundsDepositedWebhookPayload, Privy::Models::FundsWithdrawnWebhookPayload, Privy::Models::PrivateKeyExportWebhookPayload, Privy::Models::SeedPhraseExportWebhookPayload, Privy::Models::WalletRecoverySetupWebhookPayload, Privy::Models::WalletRecoveredWebhookPayload, Privy::Models::MfaEnabledWebhookPayload, Privy::Models::MfaDisabledWebhookPayload, Privy::Models::YieldDepositConfirmedWebhookPayload, Privy::Models::YieldWithdrawConfirmedWebhookPayload, Privy::Models::YieldClaimConfirmedWebhookPayload, Privy::Models::UserOperationCompletedWebhookPayload, Privy::Models::IntentCreatedWebhookPayload, Privy::Models::IntentAuthorizedWebhookPayload, Privy::Models::IntentRejectedWebhookPayload, Privy::Models::IntentExecutedWebhookPayload, Privy::Models::IntentFailedWebhookPayload, Privy::Models::WalletActionSwapCreatedWebhookPayload, Privy::Models::WalletActionSwapSucceededWebhookPayload, Privy::Models::WalletActionSwapRejectedWebhookPayload, Privy::Models::WalletActionSwapFailedWebhookPayload, Privy::Models::WalletActionTransferCreatedWebhookPayload, Privy::Models::WalletActionTransferSucceededWebhookPayload, Privy::Models::WalletActionTransferRejectedWebhookPayload, Privy::Models::WalletActionTransferFailedWebhookPayload, Privy::Models::WalletActionEarnDepositCreatedWebhookPayload, Privy::Models::WalletActionEarnDepositSucceededWebhookPayload, Privy::Models::WalletActionEarnDepositRejectedWebhookPayload, Privy::Models::WalletActionEarnDepositFailedWebhookPayload, Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload, Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload, Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload, Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload)] + end + end +end diff --git a/lib/privy/models/webhook_unsafe_unwrap_params.rb b/lib/privy/models/webhook_unsafe_unwrap_params.rb new file mode 100644 index 0000000..91e8d6c --- /dev/null +++ b/lib/privy/models/webhook_unsafe_unwrap_params.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Models + # @see Privy::Resources::Webhooks#unsafe_unwrap + class WebhookUnsafeUnwrapParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + # @!method initialize(request_options: {}) + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}] + end + end +end diff --git a/lib/privy/models/yield_authorization_headers.rb b/lib/privy/models/yield_authorization_headers.rb new file mode 100644 index 0000000..eb63b18 --- /dev/null +++ b/lib/privy/models/yield_authorization_headers.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +module Privy + module Models + class YieldAuthorizationHeaders < Privy::Internal::Type::BaseModel + # @!attribute privy_app_id + # ID of your Privy app. + # + # @return [String] + required :privy_app_id, String, api_name: :"privy-app-id" + + # @!attribute privy_authorization_signature + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + # + # @return [String, nil] + optional :privy_authorization_signature, String, api_name: :"privy-authorization-signature" + + # @!attribute privy_request_expiry + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + # + # @return [String, nil] + optional :privy_request_expiry, String, api_name: :"privy-request-expiry" + + # @!method initialize(privy_app_id:, privy_authorization_signature: nil, privy_request_expiry: nil) + # Some parameter documentations has been truncated, see + # {Privy::Models::YieldAuthorizationHeaders} for more details. + # + # Headers required to authorize yield operations. + # + # @param privy_app_id [String] ID of your Privy app. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + end + end +end diff --git a/lib/privy/models/yield_claim_confirmed_webhook_payload.rb b/lib/privy/models/yield_claim_confirmed_webhook_payload.rb new file mode 100644 index 0000000..4d3aba2 --- /dev/null +++ b/lib/privy/models/yield_claim_confirmed_webhook_payload.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +module Privy + module Models + class YieldClaimConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute caip2 + # + # @return [String] + required :caip2, String + + # @!attribute rewards + # + # @return [Array] + required :rewards, -> { Privy::Internal::Type::ArrayOf[Privy::YieldClaimConfirmedWebhookPayload::Reward] } + + # @!attribute transaction_id + # + # @return [String] + required :transaction_id, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::YieldClaimConfirmedWebhookPayload::Type] + required :type, enum: -> { Privy::YieldClaimConfirmedWebhookPayload::Type } + + # @!attribute wallet_id + # + # @return [String] + required :wallet_id, String + + # @!method initialize(caip2:, rewards:, transaction_id:, type:, wallet_id:) + # Payload for the yield.claim.confirmed webhook event. + # + # @param caip2 [String] + # + # @param rewards [Array] + # + # @param transaction_id [String] + # + # @param type [Symbol, Privy::Models::YieldClaimConfirmedWebhookPayload::Type] The type of webhook event. + # + # @param wallet_id [String] + + class Reward < Privy::Internal::Type::BaseModel + # @!attribute amount + # + # @return [String] + required :amount, String + + # @!attribute token_address + # + # @return [String] + required :token_address, String + + # @!attribute token_symbol + # + # @return [String] + required :token_symbol, String + + # @!method initialize(amount:, token_address:, token_symbol:) + # @param amount [String] + # @param token_address [String] + # @param token_symbol [String] + end + + # The type of webhook event. + # + # @see Privy::Models::YieldClaimConfirmedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + YIELD_CLAIM_CONFIRMED = :"yield.claim.confirmed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/yield_deposit_confirmed_webhook_payload.rb b/lib/privy/models/yield_deposit_confirmed_webhook_payload.rb new file mode 100644 index 0000000..292825a --- /dev/null +++ b/lib/privy/models/yield_deposit_confirmed_webhook_payload.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +module Privy + module Models + class YieldDepositConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute assets + # + # @return [String] + required :assets, String + + # @!attribute caip2 + # + # @return [String] + required :caip2, String + + # @!attribute owner + # + # @return [String] + required :owner, String + + # @!attribute sender + # + # @return [String] + required :sender, String + + # @!attribute shares + # + # @return [String] + required :shares, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::YieldDepositConfirmedWebhookPayload::Type] + required :type, enum: -> { Privy::YieldDepositConfirmedWebhookPayload::Type } + + # @!attribute vault_address + # + # @return [String] + required :vault_address, String + + # @!method initialize(assets:, caip2:, owner:, sender:, shares:, type:, vault_address:) + # Payload for the yield.deposit.confirmed webhook event. + # + # @param assets [String] + # + # @param caip2 [String] + # + # @param owner [String] + # + # @param sender [String] + # + # @param shares [String] + # + # @param type [Symbol, Privy::Models::YieldDepositConfirmedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] + + # The type of webhook event. + # + # @see Privy::Models::YieldDepositConfirmedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + YIELD_DEPOSIT_CONFIRMED = :"yield.deposit.confirmed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/models/yield_withdraw_confirmed_webhook_payload.rb b/lib/privy/models/yield_withdraw_confirmed_webhook_payload.rb new file mode 100644 index 0000000..e009d4a --- /dev/null +++ b/lib/privy/models/yield_withdraw_confirmed_webhook_payload.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +module Privy + module Models + class YieldWithdrawConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + # @!attribute assets + # + # @return [String] + required :assets, String + + # @!attribute caip2 + # + # @return [String] + required :caip2, String + + # @!attribute owner + # + # @return [String] + required :owner, String + + # @!attribute receiver + # + # @return [String] + required :receiver, String + + # @!attribute sender + # + # @return [String] + required :sender, String + + # @!attribute shares + # + # @return [String] + required :shares, String + + # @!attribute type + # The type of webhook event. + # + # @return [Symbol, Privy::Models::YieldWithdrawConfirmedWebhookPayload::Type] + required :type, enum: -> { Privy::YieldWithdrawConfirmedWebhookPayload::Type } + + # @!attribute vault_address + # + # @return [String] + required :vault_address, String + + # @!method initialize(assets:, caip2:, owner:, receiver:, sender:, shares:, type:, vault_address:) + # Payload for the yield.withdraw.confirmed webhook event. + # + # @param assets [String] + # + # @param caip2 [String] + # + # @param owner [String] + # + # @param receiver [String] + # + # @param sender [String] + # + # @param shares [String] + # + # @param type [Symbol, Privy::Models::YieldWithdrawConfirmedWebhookPayload::Type] The type of webhook event. + # + # @param vault_address [String] + + # The type of webhook event. + # + # @see Privy::Models::YieldWithdrawConfirmedWebhookPayload#type + module Type + extend Privy::Internal::Type::Enum + + YIELD_WITHDRAW_CONFIRMED = :"yield.withdraw.confirmed" + + # @!method self.values + # @return [Array] + end + end + end +end diff --git a/lib/privy/public_api/privy_client.rb b/lib/privy/public_api/privy_client.rb new file mode 100644 index 0000000..76212b5 --- /dev/null +++ b/lib/privy/public_api/privy_client.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +module Privy + class PrivyClient + # 15 minutes. Used when a caller doesn't pass `request_expiry:` and the + # client's PrivyRequestExpiryOptions doesn't override `default_ms`. + DEFAULT_REQUEST_EXPIRY_MS = 15 * 60 * 1_000 + + attr_reader :app_id, :app_secret + + # @api private + attr_reader :api + + # Service accessors. + attr_reader :wallets, :users, :policies, :key_quorums, :jwt_exchange + + # @return [Privy::PrivyRequestExpiryOptions] + attr_reader :request_expiry_options + + def initialize( + app_id: ENV["PRIVY_APP_ID"], + app_secret: ENV["PRIVY_APP_SECRET"], + environment: nil, + base_url: ENV["PRIVY_API_BASE_URL"], + max_retries: Privy::Client::DEFAULT_MAX_RETRIES, + timeout: Privy::Client::DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: Privy::Client::DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: Privy::Client::DEFAULT_MAX_RETRY_DELAY, + request_expiry: Privy::PrivyRequestExpiryOptions.build, + authorization_key_cache_max_capacity: Privy::JwtExchangeService::DEFAULT_CACHE_MAX_CAPACITY + ) + @app_id = app_id + @app_secret = app_secret + @request_expiry_options = request_expiry + + @api = Privy::Client.new( + app_id: app_id, + app_secret: app_secret, + environment: environment, + base_url: base_url, + max_retries: max_retries, + timeout: timeout, + initial_retry_delay: initial_retry_delay, + max_retry_delay: max_retry_delay + ) + + @wallets = Privy::Services::Wallets.new(client: @api, privy_client: self) + @users = Privy::Services::Users.new(client: @api, privy_client: self) + @policies = Privy::Services::Policies.new(client: @api, privy_client: self) + @key_quorums = Privy::Services::KeyQuorums.new(client: @api, privy_client: self) + @jwt_exchange = Privy::JwtExchangeService.new( + wallets_resource: @api.wallets, + cache_max_capacity: authorization_key_cache_max_capacity + ) + end + + # Resolves the absolute Unix-ms timestamp to send as `privy-request-expiry`. + # + # Precedence: + # 1. Explicit per-call value (caller wins, even over `disabled: true`). + # 2. `disabled: true` -> nil (no header sent). + # 3. `request_expiry_options.default_ms` (offset from now). + # 4. {DEFAULT_REQUEST_EXPIRY_MS} (15 minutes from now). + # + # @param override_absolute_ms [Integer, nil] Absolute Unix-ms timestamp from caller. + # @return [Integer, nil] + def compute_request_expiry(override_absolute_ms = nil) + return override_absolute_ms unless override_absolute_ms.nil? + return nil if @request_expiry_options.disabled + + Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + + (@request_expiry_options.default_ms || DEFAULT_REQUEST_EXPIRY_MS) + end + end +end diff --git a/lib/privy/public_api/privy_request_expiry_options.rb b/lib/privy/public_api/privy_request_expiry_options.rb new file mode 100644 index 0000000..c2339a4 --- /dev/null +++ b/lib/privy/public_api/privy_request_expiry_options.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Privy + # Configures request-expiry behavior on Privy::PrivyClient. + # + # @!attribute [r] default_ms + # @return [Integer, nil] Default expiry duration in milliseconds-from-now used when a + # caller does not pass `request_expiry:` explicitly. `nil` falls back to + # {Privy::PrivyClient::DEFAULT_REQUEST_EXPIRY_MS} (15 minutes). + # @!attribute [r] disabled + # @return [Boolean] When true, no `privy-request-expiry` header is auto-set. An + # explicit per-call `request_expiry:` value still wins over this flag. + PrivyRequestExpiryOptions = Data.define(:default_ms, :disabled) do + def self.build(default_ms: nil, disabled: false) + new(default_ms: default_ms, disabled: disabled) + end + end +end diff --git a/lib/privy/public_api/services/key_quorums.rb b/lib/privy/public_api/services/key_quorums.rb new file mode 100644 index 0000000..2ae6db9 --- /dev/null +++ b/lib/privy/public_api/services/key_quorums.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +module Privy + module Services + class KeyQuorums < Privy::Resources::KeyQuorums + attr_reader :privy_client + + def initialize(client:, privy_client:) + super(client: client) + @privy_client = privy_client + end + + # Create a new key quorum. + # + # @example Create a 2-of-2 key quorum + # client.key_quorums.create(key_quorum_create_params: { + # public_keys: [key1_public, key2_public], + # display_name: "2 of 2 Key Quorum", + # authorization_threshold: 2 + # }) + # + # @param key_quorum_create_params [Hash] Body parameters for key quorum creation. + # @option key_quorum_create_params [Array, nil] :public_keys P-256 public keys to authorize. + # @option key_quorum_create_params [Array, nil] :user_ids User IDs to authorize. + # @option key_quorum_create_params [Array, nil] :key_quorum_ids Nested key quorum IDs. + # @option key_quorum_create_params [Integer, nil] :authorization_threshold Number of keys required to sign. + # @option key_quorum_create_params [String, nil] :display_name Human-readable label. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::KeyQuorum] + def create(key_quorum_create_params:, request_options: nil) + super(key_quorum_create_params.merge(request_options: request_options)) + end + + # Update a key quorum by key quorum ID. + # + # @example Update authorization threshold to 1-of-2 + # client.key_quorums.update("key-quorum-id", + # key_quorum_update_params: {authorization_threshold: 1}, + # authorization_context: ctx) + # + # @param key_quorum_id [String] ID of the key quorum to update. + # @param key_quorum_update_params [Hash] Body parameters for the update. + # @option key_quorum_update_params [Integer, nil] :authorization_threshold Number of keys required to sign. + # @option key_quorum_update_params [String, nil] :display_name Human-readable label. + # @option key_quorum_update_params [Array, nil] :public_keys P-256 public keys to authorize. + # @option key_quorum_update_params [Array, nil] :user_ids User IDs to authorize. + # @option key_quorum_update_params [Array, nil] :key_quorum_ids Nested key quorum IDs. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for signing. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::KeyQuorum] + def update(key_quorum_id, key_quorum_update_params:, authorization_context: nil, request_expiry: nil, request_options: nil) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :patch, + url: Privy::Authorization.signed_url(privy_client, "v1/key_quorums/#{key_quorum_id}"), + body: key_quorum_update_params, + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = key_quorum_update_params.merge(request_options: request_options) + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(key_quorum_id, combined_params) + end + + # Delete a key quorum by key quorum ID. + # + # @example Delete a key quorum with authorization + # client.key_quorums.delete("key-quorum-id", authorization_context: ctx) + # + # @param key_quorum_id [String] ID of the key quorum to delete. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for signing. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::SuccessResponse] + def delete(key_quorum_id, authorization_context: nil, request_expiry: nil, request_options: nil) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :delete, + url: Privy::Authorization.signed_url(privy_client, "v1/key_quorums/#{key_quorum_id}"), + body: "", + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = {request_options: request_options} + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(key_quorum_id, combined_params) + end + end + end +end diff --git a/lib/privy/public_api/services/policies.rb b/lib/privy/public_api/services/policies.rb new file mode 100644 index 0000000..a0ca68a --- /dev/null +++ b/lib/privy/public_api/services/policies.rb @@ -0,0 +1,245 @@ +# frozen_string_literal: true + +module Privy + module Services + class Policies < Privy::Resources::Policies + attr_reader :privy_client + + def initialize(client:, privy_client:) + super(client: client) + @privy_client = privy_client + end + + # Create a new policy with rules for a given chain type. + # + # @example Create a policy restricting ETH transfer value + # client.policies.create(policy_create_params: { + # version: "1.0", + # name: "Native token transfer maximums", + # chain_type: "ethereum", + # rules: [{ + # name: "Restrict ETH transfers to a maximum value", + # method: "eth_sendTransaction", + # action: "ALLOW", + # conditions: [{ + # field_source: "ethereum_transaction", + # field: "value", + # operator: "lte", + # value: "0x2386F26FC10000" + # }] + # }] + # }) + # + # @param policy_create_params [Hash] Body parameters for policy creation. + # @option policy_create_params [String] :version Policy version (required, e.g. "1.0"). + # @option policy_create_params [String] :name Name to assign to the policy (required). + # @option policy_create_params [String] :chain_type Chain type the policy applies to (required). + # @option policy_create_params [Array] :rules Array of rule objects (required). + # @option policy_create_params [Hash, nil] :owner Owner specified as {user_id:} or {public_key:}. + # @option policy_create_params [String, nil] :owner_id Key quorum ID to set as owner. + # @param idempotency_key [String, nil] Ensures the request is executed only once. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::Policy] + def create(policy_create_params:, idempotency_key: nil, request_options: nil) + combined_params = policy_create_params.merge(request_options: request_options) + combined_params[:privy_idempotency_key] = idempotency_key if idempotency_key + super(combined_params) + end + + # Update a policy by policy ID. + # + # @example Update policy owner to a P-256 key + # client.policies.update("policy-id", policy_update_params: { + # owner: {public_key: base64_p256_public_key} + # }) + # + # @example Remove policy owner (requires authorization) + # client.policies.update("policy-id", policy_update_params: { + # owner: nil + # }, authorization_context: ctx) + # + # @param policy_id [String] ID of the policy to update. + # @param policy_update_params [Hash] Body parameters for the update. + # @option policy_update_params [String, nil] :name New name for the policy. + # @option policy_update_params [Hash, nil] :owner New owner specified as {user_id:} or {public_key:}. Set to nil to remove. + # @option policy_update_params [String, nil] :owner_id Key quorum ID to set as owner. + # @option policy_update_params [Array, nil] :rules New rules for the policy. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned policies. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::Policy] + def update(policy_id, policy_update_params:, authorization_context: nil, request_expiry: nil, request_options: nil) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :patch, + url: Privy::Authorization.signed_url(privy_client, "v1/policies/#{policy_id}"), + body: policy_update_params, + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = policy_update_params.merge(request_options: request_options) + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(policy_id, combined_params) + end + + # Delete a policy by policy ID. + # + # @example Delete an ownerless policy + # client.policies.delete("policy-id") + # + # @example Delete an owned policy (requires authorization) + # client.policies.delete("policy-id", authorization_context: ctx) + # + # @param policy_id [String] ID of the policy to delete. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned policies. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::SuccessResponse] + def delete(policy_id, authorization_context: nil, request_expiry: nil, request_options: nil) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :delete, + url: Privy::Authorization.signed_url(privy_client, "v1/policies/#{policy_id}"), + body: "", + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = {request_options: request_options} + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(policy_id, combined_params) + end + + # Create a new rule for a policy. + # + # @example Add an allowlist rule to a policy + # client.policies.create_rule("policy-id", policy_create_rule_params: { + # name: "Allow transfers to known address", + # method: "eth_sendTransaction", + # action: "ALLOW", + # conditions: [{ + # field_source: "ethereum_transaction", + # field: "to", + # operator: "eq", + # value: "0x0000000000000000000000000000000000000001" + # }] + # }, authorization_context: ctx) + # + # @param policy_id [String] ID of the policy to add the rule to. + # @param policy_create_rule_params [Hash] Body parameters for rule creation. + # @option policy_create_rule_params [String] :name Rule name (required). + # @option policy_create_rule_params [String] :method RPC method the rule applies to (required). + # @option policy_create_rule_params [String] :action Action when the rule matches ("ALLOW" or "DENY", required). + # @option policy_create_rule_params [Array] :conditions Array of condition objects (required). + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned policies. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::PolicyRuleResponse] + def create_rule(policy_id, policy_create_rule_params:, authorization_context: nil, request_expiry: nil, request_options: nil) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :post, + url: Privy::Authorization.signed_url(privy_client, "v1/policies/#{policy_id}/rules"), + body: policy_create_rule_params, + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = policy_create_rule_params.merge(request_options: request_options) + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(policy_id, combined_params) + end + + # Update a rule by policy ID and rule ID. + # + # @example Update a rule's action to DENY + # client.policies.update_rule("rule-id", policy_id: "policy-id", + # policy_update_rule_params: { + # name: "Updated rule", + # method: "eth_sendTransaction", + # action: "DENY", + # conditions: [{ + # field_source: "ethereum_transaction", + # field: "to", + # operator: "eq", + # value: "0x0000000000000000000000000000000000000001" + # }] + # }, authorization_context: ctx) + # + # @param rule_id [String] ID of the rule to update. + # @param policy_id [String] ID of the policy the rule belongs to. + # @param policy_update_rule_params [Hash] Body parameters for the rule update. + # @option policy_update_rule_params [String] :name Rule name (required). + # @option policy_update_rule_params [String] :method RPC method the rule applies to (required). + # @option policy_update_rule_params [String] :action Action when the rule matches ("ALLOW" or "DENY", required). + # @option policy_update_rule_params [Array] :conditions Array of condition objects (required). + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned policies. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::PolicyRuleResponse] + def update_rule( + rule_id, + policy_id:, + policy_update_rule_params:, + authorization_context: nil, + request_expiry: nil, + request_options: nil + ) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :patch, + url: Privy::Authorization.signed_url(privy_client, "v1/policies/#{policy_id}/rules/#{rule_id}"), + body: policy_update_rule_params, + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = policy_update_rule_params.merge( + policy_id: policy_id, + request_options: request_options + ) + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(rule_id, combined_params) + end + + # Delete a rule by policy ID and rule ID. + # + # @example Delete a rule from a policy + # client.policies.delete_rule("rule-id", policy_id: "policy-id", + # authorization_context: ctx) + # + # @param rule_id [String] ID of the rule to delete. + # @param policy_id [String] ID of the policy the rule belongs to. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned policies. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::SuccessResponse] + def delete_rule(rule_id, policy_id:, authorization_context: nil, request_expiry: nil, request_options: nil) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :delete, + url: Privy::Authorization.signed_url(privy_client, "v1/policies/#{policy_id}/rules/#{rule_id}"), + body: "", + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = {policy_id: policy_id, request_options: request_options} + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(rule_id, combined_params) + end + end + end +end diff --git a/lib/privy/public_api/services/users.rb b/lib/privy/public_api/services/users.rb new file mode 100644 index 0000000..cd7b442 --- /dev/null +++ b/lib/privy/public_api/services/users.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Privy + module Services + class Users < Privy::Resources::Users + attr_reader :privy_client + + def initialize(client:, privy_client:) + super(client: client) + @privy_client = privy_client + end + + # Create a new user with linked accounts. Optionally pre-generate embedded wallets + # for the user. + # + # @example Create a user from an email address + # client.users.create(user_create_params: { + # linked_accounts: [{address: "tom.bombadill@privy.io", type: :email}] + # }) + # + # @example Create a user with custom metadata and a pregenerated Ethereum wallet + # client.users.create(user_create_params: { + # linked_accounts: [{address: "tom.bombadill@privy.io", type: :email}], + # custom_metadata: {plan: "pro"}, + # wallets: [{chain_type: :ethereum}] + # }) + # + # @param user_create_params [Hash] Body parameters for user creation. + # @option user_create_params [Array] :linked_accounts Linked accounts to associate with the user (required). + # @option user_create_params [Hash{Symbol=>String, Float, Boolean}, nil] :custom_metadata Custom metadata associated with the user. + # @option user_create_params [Array, nil] :wallets Wallets to pregenerate for the user. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::User] + def create(user_create_params:, request_options: nil) + super(user_create_params.merge(request_options: request_options)) + end + end + end +end diff --git a/lib/privy/public_api/services/wallets.rb b/lib/privy/public_api/services/wallets.rb new file mode 100644 index 0000000..3234d50 --- /dev/null +++ b/lib/privy/public_api/services/wallets.rb @@ -0,0 +1,226 @@ +# frozen_string_literal: true + +module Privy + module Services + class Wallets < Privy::Resources::Wallets + attr_reader :privy_client + + def initialize(client:, privy_client:) + super(client: client) + @privy_client = privy_client + end + + # Create a new wallet on the requested chain and for the requested owner. + # + # @example Create an ownerless Ethereum wallet + # client.wallets.create(wallet_create_params: {chain_type: :ethereum}) + # + # @example Create a wallet with a P-256 key owner + # client.wallets.create(wallet_create_params: { + # chain_type: :ethereum, + # owner: {public_key: base64_p256_public_key} + # }) + # + # @param wallet_create_params [Hash] Body parameters for wallet creation. + # @option wallet_create_params [Symbol] :chain_type The wallet chain type (required). + # @option wallet_create_params [Hash, nil] :owner Owner specified as {user_id:} or {public_key:}. + # @option wallet_create_params [String, nil] :owner_id Key quorum ID to set as owner. + # @option wallet_create_params [Array, nil] :policy_ids Up to one policy ID to enforce. + # @option wallet_create_params [String, nil] :display_name A human-readable label for the wallet. + # @option wallet_create_params [String, nil] :external_id Customer-provided identifier for external mapping. + # @option wallet_create_params [Array, nil] :additional_signers Additional signers for the wallet. + # @param idempotency_key [String, nil] Ensures the request is executed only once. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::Wallet] + def create(wallet_create_params:, idempotency_key: nil, request_options: nil) + combined_params = wallet_create_params.merge(request_options: request_options) + combined_params[:privy_idempotency_key] = idempotency_key if idempotency_key + super(combined_params) + end + + # Update a wallet's policies or authorization key configuration. + # + # @example Update wallet policies + # client.wallets.update("wallet-id", wallet_update_params: { + # policy_ids: ["policy-id"] + # }, authorization_context: ctx) + # + # @param wallet_id [String] ID of the wallet to update. + # @param wallet_update_params [Hash] Body parameters for the update. + # @option wallet_update_params [Hash, nil] :owner New owner specified as {user_id:} or {public_key:}. + # @option wallet_update_params [String, nil] :owner_id Key quorum ID to set as owner. + # @option wallet_update_params [Array, nil] :policy_ids New policy IDs to enforce on the wallet. + # @option wallet_update_params [String, nil] :display_name A human-readable label for the wallet. Set to nil to clear. + # @option wallet_update_params [Array, nil] :additional_signers Additional signers for the wallet. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned wallets. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::Wallet] + def update(wallet_id, wallet_update_params:, authorization_context: nil, request_expiry: nil, request_options: nil) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :patch, + url: Privy::Authorization.signed_url(privy_client, "v1/wallets/#{wallet_id}"), + body: wallet_update_params, + authorization_context: authorization_context, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = wallet_update_params.merge(request_options: request_options) + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(wallet_id, combined_params) + end + + # Sign a message or transaction with a wallet by wallet ID. + # + # @example Personal sign on an ownerless wallet + # client.wallets.rpc("wallet-id", wallet_rpc_request_body: { + # method: "personal_sign", + # chain_type: "ethereum", + # params: {message: "hello", encoding: "utf-8"} + # }) + # + # @example Sign a transaction with authorization + # client.wallets.rpc("wallet-id", wallet_rpc_request_body: { + # method: "eth_signTransaction", + # chain_type: "ethereum", + # params: {transaction: {to: "0x...", value: "0x0", chain_id: 1}} + # }, authorization_context: ctx) + # + # @param wallet_id [String] ID of the wallet. + # @param wallet_rpc_request_body [Hash] The RPC request body, discriminated by :method. + # @option wallet_rpc_request_body [String] :method The RPC method name (e.g. "personal_sign", "eth_signTransaction"). + # @option wallet_rpc_request_body [String] :chain_type The chain type (e.g. "ethereum", "solana"). + # @option wallet_rpc_request_body [Hash] :params Method-specific parameters. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned wallets. + # @param idempotency_key [String, nil] Ensures the request is executed only once. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::WalletRpcResponse] + def rpc( + wallet_id, + wallet_rpc_request_body:, + authorization_context: nil, + idempotency_key: nil, + request_expiry: nil, + request_options: nil + ) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :post, + url: Privy::Authorization.signed_url(privy_client, "v1/wallets/#{wallet_id}/rpc"), + body: wallet_rpc_request_body, + authorization_context: authorization_context, + idempotency_key: idempotency_key, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = {wallet_rpc_request_body: wallet_rpc_request_body, request_options: request_options} + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(wallet_id, combined_params) + end + + # Sign a hash or raw bytes with a wallet by wallet ID. + # + # @example Sign a pre-computed hash + # client.wallets.raw_sign("wallet-id", raw_sign_input: { + # params: {hash: "0x1234...abcdef"} + # }) + # + # @example Sign raw bytes with a hash function + # client.wallets.raw_sign("wallet-id", raw_sign_input: { + # params: {bytes: "0a0234ea...", encoding: "hex", hash_function: "sha256"} + # }, authorization_context: ctx) + # + # @param wallet_id [String] ID of the wallet to sign with. + # @param raw_sign_input [Hash] Body parameters for the raw_sign operation (RawSignInput shape). + # @option raw_sign_input [Hash] :params The signing parameters (required). Either {hash:} or {bytes:, encoding:, hash_function:}. + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned wallets. + # @param idempotency_key [String, nil] Ensures the request is executed only once. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::RawSignResponse] + def raw_sign( + wallet_id, + raw_sign_input:, + authorization_context: nil, + idempotency_key: nil, + request_expiry: nil, + request_options: nil + ) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :post, + url: Privy::Authorization.signed_url(privy_client, "v1/wallets/#{wallet_id}/raw_sign"), + body: raw_sign_input, + authorization_context: authorization_context, + idempotency_key: idempotency_key, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = raw_sign_input.merge(request_options: request_options) + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + super(wallet_id, combined_params) + end + + # Transfer tokens from a wallet to a destination address. + # + # @example Transfer USDC on Base + # client.wallets.transfer("wallet-id", wallet_transfer_params: { + # source: {asset: "usdc", amount: "10.5", chain: "base"}, + # destination: {address: "0xB00F...28a2"} + # }) + # + # @example Cross-asset transfer with slippage + # client.wallets.transfer("wallet-id", wallet_transfer_params: { + # source: {asset: "usdc", amount: "10.5", chain: "base"}, + # destination: {address: "0xB00F...28a2", asset: "usdt", chain: "ethereum"}, + # amount_type: "exact_input", + # slippage_bps: 100 + # }, authorization_context: ctx) + # + # @param wallet_id [String] ID of the wallet to transfer from. + # @param wallet_transfer_params [Hash] Body parameters for the transfer operation. + # @option wallet_transfer_params [Hash] :source Source asset, amount, and chain (required). + # @option wallet_transfer_params [Hash] :destination Destination address, and optionally asset and chain (required). + # @option wallet_transfer_params [String] :amount_type Whether amount refers to input or output token ("exact_input" or "exact_output"). + # @option wallet_transfer_params [Integer] :slippage_bps Maximum allowed slippage in basis points (1 bps = 0.01%). + # @param authorization_context [Privy::Authorization::AuthorizationContext, nil] Authorization context for owned wallets. + # @param idempotency_key [String, nil] Ensures the request is executed only once. + # @param request_expiry [Integer, nil] Absolute Unix-ms timestamp at which the + # request expires. Defaults to the value computed by the client's + # PrivyRequestExpiryOptions. + # @param request_options [Privy::RequestOptions, Hash, nil] Transport-level config (timeouts, retries). + # + # @return [Privy::Models::TransferActionResponse] + def transfer( + wallet_id, + wallet_transfer_params:, + authorization_context: nil, + idempotency_key: nil, + request_expiry: nil, + request_options: nil + ) + prepared = Privy::Authorization.prepare_request( + privy_client, + method: :post, + url: Privy::Authorization.signed_url(privy_client, "v1/wallets/#{wallet_id}/transfer"), + body: wallet_transfer_params, + authorization_context: authorization_context, + idempotency_key: idempotency_key, + request_expiry: privy_client.compute_request_expiry(request_expiry) + ) + combined_params = wallet_transfer_params.merge(request_options: request_options) + Privy::Authorization.merge_prepared_headers!(combined_params, prepared.headers) + _transfer(wallet_id, combined_params) + end + end + end +end diff --git a/lib/privy/request_options.rb b/lib/privy/request_options.rb new file mode 100644 index 0000000..79e6f24 --- /dev/null +++ b/lib/privy/request_options.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +module Privy + # Specify HTTP behaviour to use for a specific request. These options supplement + # or override those provided at the client level. + # + # When making a request, you can pass an actual {RequestOptions} instance, or + # simply pass a Hash with symbol keys matching the attributes on this class. + class RequestOptions < Privy::Internal::Type::BaseModel + # @api private + # + # @param opts [Privy::RequestOptions, Hash{Symbol=>Object}] + # + # @raise [ArgumentError] + def self.validate!(opts) + case opts + in Privy::RequestOptions | Hash + opts.to_h.each_key do |k| + unless fields.include?(k) + raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}") + end + end + else + raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}") + end + end + + # @!attribute idempotency_key + # Idempotency key to send with request and all associated retries. Will only be + # sent for write requests. + # + # @return [String, nil] + optional :idempotency_key, String + + # @!attribute extra_query + # Extra query params to send with the request. These are `.merge`’d into any + # `query` given at the client level. + # + # @return [Hash{String=>Array, String, nil}, nil] + optional :extra_query, Privy::Internal::Type::HashOf[Privy::Internal::Type::ArrayOf[String]] + + # @!attribute extra_headers + # Extra headers to send with the request. These are `.merged`’d into any + # `extra_headers` given at the client level. + # + # @return [Hash{String=>String, nil}, nil] + optional :extra_headers, Privy::Internal::Type::HashOf[String, nil?: true] + + # @!attribute extra_body + # Extra data to send with the request. These are deep merged into any data + # generated as part of the normal request. + # + # @return [Object, nil] + optional :extra_body, Privy::Internal::Type::HashOf[Privy::Internal::Type::Unknown] + + # @!attribute max_retries + # Maximum number of retries to attempt after a failed initial request. + # + # @return [Integer, nil] + optional :max_retries, Integer + + # @!attribute timeout + # Request timeout in seconds. + # + # @return [Float, nil] + optional :timeout, Float + + # @!method initialize(values = {}) + # Returns a new instance of RequestOptions. + # + # @param values [Hash{Symbol=>Object}] + + define_sorbet_constant!(:OrHash) do + T.type_alias { T.any(Privy::RequestOptions, Privy::Internal::AnyHash) } + end + end +end diff --git a/lib/privy/resources/accounts.rb b/lib/privy/resources/accounts.rb new file mode 100644 index 0000000..4060813 --- /dev/null +++ b/lib/privy/resources/accounts.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Accounts + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/aggregations.rb b/lib/privy/resources/aggregations.rb new file mode 100644 index 0000000..b371df7 --- /dev/null +++ b/lib/privy/resources/aggregations.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Aggregations + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/analytics.rb b/lib/privy/resources/analytics.rb new file mode 100644 index 0000000..cac6df0 --- /dev/null +++ b/lib/privy/resources/analytics.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Analytics + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/apps.rb b/lib/privy/resources/apps.rb new file mode 100644 index 0000000..c2b9475 --- /dev/null +++ b/lib/privy/resources/apps.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +module Privy + module Resources + # Operations related to app settings and allowlist management + class Apps + # Operations related to app settings and allowlist management + # @return [Privy::Resources::Apps::Allowlist] + attr_reader :allowlist + + # Get the settings and configuration for an app. + # + # @overload get(app_id, request_options: {}) + # + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::AppResponse] + # + # @see Privy::Models::AppGetParams + def get(app_id, params = {}) + @client.request( + method: :get, + path: ["v1/apps/%1$s", app_id], + model: Privy::AppResponse, + options: params[:request_options] + ) + end + + # Get aggregated Privy gas credits charged for a set of wallets over a time range. + # Maximum 100 wallet IDs and 30-day range per request. + # + # @overload get_gas_spend(end_timestamp:, start_timestamp:, wallet_ids:, request_options: {}) + # + # @param end_timestamp [Float] + # @param start_timestamp [Float] + # @param wallet_ids [Array] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::GasSpendResponseBody] + # + # @see Privy::Models::AppGetGasSpendParams + def get_gas_spend(params) + parsed, options = Privy::AppGetGasSpendParams.dump_request(params) + query = Privy::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/apps/gas_spend", + query: query, + model: Privy::GasSpendResponseBody, + options: options + ) + end + + # Get the test accounts and credentials for an app. + # + # @overload get_test_credentials(app_id, request_options: {}) + # + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::TestAccountsResponse] + # + # @see Privy::Models::AppGetTestCredentialsParams + def get_test_credentials(app_id, params = {}) + @client.request( + method: :get, + path: ["v1/apps/%1$s/test_credentials", app_id], + model: Privy::TestAccountsResponse, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + @allowlist = Privy::Resources::Apps::Allowlist.new(client: client) + end + end + end +end diff --git a/lib/privy/resources/apps/allowlist.rb b/lib/privy/resources/apps/allowlist.rb new file mode 100644 index 0000000..d5f3bf4 --- /dev/null +++ b/lib/privy/resources/apps/allowlist.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Apps + # Operations related to app settings and allowlist management + class Allowlist + # Add a new entry to the allowlist for an app. The allowlist must be enabled. + # + # @overload create(app_id, user_invite_input:, request_options: {}) + # + # @param app_id [String] The ID of the app. + # + # @param user_invite_input [Privy::Models::EmailInviteInput, Privy::Models::EmailDomainInviteInput, Privy::Models::WalletInviteInput, Privy::Models::PhoneInviteInput] Input for adding or removing an allowlist entry. Discriminated by type. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::AllowlistEntry] + # + # @see Privy::Models::Apps::AllowlistCreateParams + def create(app_id, params) + parsed, options = Privy::Apps::AllowlistCreateParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/apps/%1$s/allowlist", app_id], + body: parsed[:user_invite_input], + model: Privy::AllowlistEntry, + options: options + ) + end + + # Get all allowlist entries for an app. Returns the list of users allowed to + # access the app when the allowlist is enabled. + # + # @overload list(app_id, request_options: {}) + # + # @param app_id [String] The ID of the app. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Array] + # + # @see Privy::Models::Apps::AllowlistListParams + def list(app_id, params = {}) + @client.request( + method: :get, + path: ["v1/apps/%1$s/allowlist", app_id], + model: Privy::Internal::Type::ArrayOf[Privy::AllowlistEntry], + options: params[:request_options] + ) + end + + # Remove an entry from the allowlist for an app. The allowlist must be enabled. + # + # @overload delete(app_id, user_invite_input:, request_options: {}) + # + # @param app_id [String] The ID of the app. + # + # @param user_invite_input [Privy::Models::EmailInviteInput, Privy::Models::EmailDomainInviteInput, Privy::Models::WalletInviteInput, Privy::Models::PhoneInviteInput] Input for adding or removing an allowlist entry. Discriminated by type. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::AllowlistDeletionResponse] + # + # @see Privy::Models::Apps::AllowlistDeleteParams + def delete(app_id, params) + parsed, options = Privy::Apps::AllowlistDeleteParams.dump_request(params) + @client.request( + method: :delete, + path: ["v1/apps/%1$s/allowlist", app_id], + body: parsed[:user_invite_input], + model: Privy::AllowlistDeletionResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/privy/resources/client_auth.rb b/lib/privy/resources/client_auth.rb new file mode 100644 index 0000000..067aa65 --- /dev/null +++ b/lib/privy/resources/client_auth.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class ClientAuth + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/cross_app.rb b/lib/privy/resources/cross_app.rb new file mode 100644 index 0000000..35a5651 --- /dev/null +++ b/lib/privy/resources/cross_app.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class CrossApp + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/embedded_wallets.rb b/lib/privy/resources/embedded_wallets.rb new file mode 100644 index 0000000..ca578c3 --- /dev/null +++ b/lib/privy/resources/embedded_wallets.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class EmbeddedWallets + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/funding.rb b/lib/privy/resources/funding.rb new file mode 100644 index 0000000..d93434b --- /dev/null +++ b/lib/privy/resources/funding.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Funding + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/intents.rb b/lib/privy/resources/intents.rb new file mode 100644 index 0000000..247984b --- /dev/null +++ b/lib/privy/resources/intents.rb @@ -0,0 +1,379 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Intents + # List intents for an app. Returns a paginated list of intents with their current + # status and details. + # + # @overload list(created_by_id: nil, current_user_has_signed: nil, cursor: nil, intent_type: nil, limit: nil, pending_member_id: nil, resource_id: nil, sort_by: nil, status: nil, request_options: {}) + # + # @param created_by_id [String] + # + # @param current_user_has_signed [Symbol, Privy::Models::IntentListParams::CurrentUserHasSigned] + # + # @param cursor [String] + # + # @param intent_type [Symbol, Privy::Models::IntentType] Type of intent. + # + # @param limit [Float, nil] + # + # @param pending_member_id [String] + # + # @param resource_id [String] + # + # @param sort_by [Symbol, Privy::Models::IntentListParams::SortBy] + # + # @param status [Symbol, Privy::Models::IntentStatus] Current status of an intent. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Internal::Cursor] + # + # @see Privy::Models::IntentListParams + def list(params = {}) + parsed, options = Privy::IntentListParams.dump_request(params) + query = Privy::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/intents", + query: query, + page: Privy::Internal::Cursor, + model: Privy::IntentResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentCreatePolicyRuleParams} for more details. + # + # Create an intent to add a rule to a policy. The intent must be authorized by the + # policy owner before it can be executed. + # + # @overload create_policy_rule(policy_id, action:, conditions:, method_:, name:, privy_request_expiry: nil, request_options: {}) + # + # @param policy_id [String] Path param: ID of the policy. + # + # @param action [Symbol, Privy::Models::PolicyAction] Body param: The action to take when a policy rule matches. + # + # @param conditions [Array] Body param + # + # @param method_ [Symbol, Privy::Models::PolicyMethod] Body param: Method the rule applies to. + # + # @param name [String] Body param + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::RuleIntentResponse] + # + # @see Privy::Models::IntentCreatePolicyRuleParams + def create_policy_rule(policy_id, params) + parsed, options = Privy::IntentCreatePolicyRuleParams.dump_request(params) + header_params = {privy_request_expiry: "privy-request-expiry"} + @client.request( + method: :post, + path: ["v1/intents/policies/%1$s/rules", policy_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::RuleIntentResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentDeletePolicyRuleParams} for more details. + # + # Create an intent to delete a rule from a policy. The intent must be authorized + # by the policy owner before it can be executed. + # + # @overload delete_policy_rule(rule_id, policy_id:, privy_request_expiry: nil, request_options: {}) + # + # @param rule_id [String] Path param: ID of the rule. + # + # @param policy_id [String] Path param: ID of the policy. + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::RuleIntentResponse] + # + # @see Privy::Models::IntentDeletePolicyRuleParams + def delete_policy_rule(rule_id, params) + parsed, options = Privy::IntentDeletePolicyRuleParams.dump_request(params) + policy_id = + parsed.delete(:policy_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/intents/policies/%1$s/rules/%2$s", policy_id, rule_id], + headers: parsed.transform_keys(privy_request_expiry: "privy-request-expiry"), + model: Privy::RuleIntentResponse, + options: options + ) + end + + # Retrieve an intent by ID. Returns the intent details including its current + # status, authorization details, and execution result if applicable. + # + # @overload get(intent_id, request_options: {}) + # + # @param intent_id [String] ID of the intent. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::RpcIntentResponse, Privy::Models::TransferIntentResponse, Privy::Models::WalletIntentResponse, Privy::Models::PolicyIntentResponse, Privy::Models::RuleIntentResponse, Privy::Models::KeyQuorumIntentResponse] + # + # @see Privy::Models::IntentGetParams + def get(intent_id, params = {}) + @client.request( + method: :get, + path: ["v1/intents/%1$s", intent_id], + model: Privy::IntentResponse, + options: params[:request_options] + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentRpcParams} for more details. + # + # Create an intent to execute an RPC method on a wallet. The intent must be + # authorized by either the wallet owner or signers before it can be executed. + # + # @overload rpc(wallet_id, wallet_rpc_request_body:, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param wallet_rpc_request_body [Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput, Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput, Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput, Privy::Models::ExportPrivateKeyRpcInput, Privy::Models::ExportSeedPhraseRpcInput] Body param: Request body for wallet RPC operations, discriminated by method. + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::RpcIntentResponse] + # + # @see Privy::Models::IntentRpcParams + def rpc(wallet_id, params) + parsed, options = Privy::IntentRpcParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/intents/wallets/%1$s/rpc", wallet_id], + headers: parsed.except(:wallet_rpc_request_body).transform_keys(privy_request_expiry: "privy-request-expiry"), + body: parsed[:wallet_rpc_request_body], + model: Privy::RpcIntentResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentTransferParams} for more details. + # + # Create an intent to execute a token transfer via a wallet. The intent must be + # authorized by either the wallet owner or signers before it can be executed. + # + # @overload transfer(wallet_id, destination:, source:, amount_type: nil, slippage_bps: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param destination [Privy::Models::TokenTransferDestination] Body param: The destination address for a token transfer. Optionally specify a d + # + # @param source [Privy::Models::NamedTokenTransferSource, Privy::Models::CustomTokenTransferSource] Body param: The source asset, amount, and chain for a token transfer. Specify ei + # + # @param amount_type [Symbol, Privy::Models::AmountType] Body param: Whether the amount refers to the input token or output token. + # + # @param slippage_bps [Integer] Body param: Maximum allowed slippage in basis points (1 bps = 0.01%). + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::TransferIntentResponse] + # + # @see Privy::Models::IntentTransferParams + def transfer(wallet_id, params) + parsed, options = Privy::IntentTransferParams.dump_request(params) + header_params = {privy_request_expiry: "privy-request-expiry"} + @client.request( + method: :post, + path: ["v1/intents/wallets/%1$s/transfer", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::TransferIntentResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdateKeyQuorumParams} for more details. + # + # Create an intent to update a key quorum. The intent must be authorized by the + # key quorum members before it can be executed. + # + # @overload update_key_quorum(key_quorum_id, authorization_threshold: nil, display_name: nil, key_quorum_ids: nil, public_keys: nil, user_ids: nil, privy_request_expiry: nil, request_options: {}) + # + # @param key_quorum_id [String] Path param: ID of the key quorum. + # + # @param authorization_threshold [Float] Body param: The number of keys that must sign for an action to be valid. Must be + # + # @param display_name [String] Body param + # + # @param key_quorum_ids [Array] Body param: List of key quorum IDs that should be members of this key quorum. Ke + # + # @param public_keys [Array] Body param: List of P-256 public keys of the keys that should be authorized to s + # + # @param user_ids [Array] Body param: List of user IDs of the users that should be authorized to sign on t + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::KeyQuorumIntentResponse] + # + # @see Privy::Models::IntentUpdateKeyQuorumParams + def update_key_quorum(key_quorum_id, params = {}) + parsed, options = Privy::IntentUpdateKeyQuorumParams.dump_request(params) + header_params = {privy_request_expiry: "privy-request-expiry"} + @client.request( + method: :patch, + path: ["v1/intents/key_quorums/%1$s", key_quorum_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::KeyQuorumIntentResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdatePolicyParams} for more details. + # + # Create an intent to update a policy. The intent must be authorized by the policy + # owner before it can be executed. + # + # @overload update_policy(policy_id, name: nil, owner: nil, owner_id: nil, rules: nil, privy_request_expiry: nil, request_options: {}) + # + # @param policy_id [String] Path param: ID of the policy. + # + # @param name [String] Body param: Name to assign to policy. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] Body param: The owner of the resource, specified as a Privy user ID, a P-256 pub + # + # @param owner_id [String, nil] Body param: The key quorum ID to set as the owner of the resource. If you provid + # + # @param rules [Array] Body param + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::PolicyIntentResponse] + # + # @see Privy::Models::IntentUpdatePolicyParams + def update_policy(policy_id, params = {}) + parsed, options = Privy::IntentUpdatePolicyParams.dump_request(params) + header_params = {privy_request_expiry: "privy-request-expiry"} + @client.request( + method: :patch, + path: ["v1/intents/policies/%1$s", policy_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::PolicyIntentResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdatePolicyRuleParams} for more details. + # + # Create an intent to update a rule on a policy. The intent must be authorized by + # the policy owner before it can be executed. + # + # @overload update_policy_rule(rule_id, policy_id:, action:, conditions:, method_:, name:, privy_request_expiry: nil, request_options: {}) + # + # @param rule_id [String] Path param: ID of the rule. + # + # @param policy_id [String] Path param: ID of the policy. + # + # @param action [Symbol, Privy::Models::PolicyAction] Body param: The action to take when a policy rule matches. + # + # @param conditions [Array] Body param + # + # @param method_ [Symbol, Privy::Models::PolicyMethod] Body param: Method the rule applies to. + # + # @param name [String] Body param + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::RuleIntentResponse] + # + # @see Privy::Models::IntentUpdatePolicyRuleParams + def update_policy_rule(rule_id, params) + parsed, options = Privy::IntentUpdatePolicyRuleParams.dump_request(params) + policy_id = + parsed.delete(:policy_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + header_params = {privy_request_expiry: "privy-request-expiry"} + @client.request( + method: :patch, + path: ["v1/intents/policies/%1$s/rules/%2$s", policy_id, rule_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::RuleIntentResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::IntentUpdateWalletParams} for more details. + # + # Create an intent to update a wallet. The intent must be authorized by the wallet + # owner before it can be executed. + # + # @overload update_wallet(wallet_id, additional_signers: nil, display_name: nil, owner: nil, owner_id: nil, policy_ids: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param additional_signers [Array] Body param: Additional signers for the wallet. + # + # @param display_name [String, nil] Body param: A human-readable label for the wallet. Set to null to clear. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] Body param: The owner of the resource, specified as a Privy user ID, a P-256 pub + # + # @param owner_id [String, nil] Body param: The key quorum ID to set as the owner of the resource. If you provid + # + # @param policy_ids [Array] Body param: New policy IDs to enforce on the wallet. Currently, only one policy + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::WalletIntentResponse] + # + # @see Privy::Models::IntentUpdateWalletParams + def update_wallet(wallet_id, params = {}) + parsed, options = Privy::IntentUpdateWalletParams.dump_request(params) + header_params = {privy_request_expiry: "privy-request-expiry"} + @client.request( + method: :patch, + path: ["v1/intents/wallets/%1$s", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::WalletIntentResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/key_quorums.rb b/lib/privy/resources/key_quorums.rb new file mode 100644 index 0000000..bbfaf92 --- /dev/null +++ b/lib/privy/resources/key_quorums.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +module Privy + module Resources + # Operations related to key quorums + class KeyQuorums + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumCreateParams} for more details. + # + # Create a new key quorum. + # + # @overload create(authorization_threshold: nil, display_name: nil, key_quorum_ids: nil, public_keys: nil, user_ids: nil, request_options: {}) + # + # @param authorization_threshold [Float] The number of keys that must sign for an action to be valid. Must be less than o + # + # @param display_name [String] + # + # @param key_quorum_ids [Array] List of key quorum IDs that should be members of this key quorum. Key quorums ca + # + # @param public_keys [Array] List of P-256 public keys of the keys that should be authorized to sign on the k + # + # @param user_ids [Array] List of user IDs of the users that should be authorized to sign on the key quoru + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::KeyQuorum] + # + # @see Privy::Models::KeyQuorumCreateParams + def create(params = {}) + parsed, options = Privy::KeyQuorumCreateParams.dump_request(params) + @client.request( + method: :post, + path: "v1/key_quorums", + body: parsed, + model: Privy::KeyQuorum, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumUpdateParams} for more details. + # + # Update a key quorum by key quorum ID. + # + # @overload update(key_quorum_id, authorization_threshold: nil, display_name: nil, key_quorum_ids: nil, public_keys: nil, user_ids: nil, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param key_quorum_id [String] Path param: A unique identifier for a key quorum. + # + # @param authorization_threshold [Float] Body param: The number of keys that must sign for an action to be valid. Must be + # + # @param display_name [String] Body param + # + # @param key_quorum_ids [Array] Body param: List of key quorum IDs that should be members of this key quorum. Ke + # + # @param public_keys [Array] Body param: List of P-256 public keys of the keys that should be authorized to s + # + # @param user_ids [Array] Body param: List of user IDs of the users that should be authorized to sign on t + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::KeyQuorum] + # + # @see Privy::Models::KeyQuorumUpdateParams + def update(key_quorum_id, params = {}) + parsed, options = Privy::KeyQuorumUpdateParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :patch, + path: ["v1/key_quorums/%1$s", key_quorum_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::KeyQuorum, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::KeyQuorumDeleteParams} for more details. + # + # Delete a key quorum by key quorum ID. + # + # @overload delete(key_quorum_id, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param key_quorum_id [String] A unique identifier for a key quorum. + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::SuccessResponse] + # + # @see Privy::Models::KeyQuorumDeleteParams + def delete(key_quorum_id, params = {}) + parsed, options = Privy::KeyQuorumDeleteParams.dump_request(params) + @client.request( + method: :delete, + path: ["v1/key_quorums/%1$s", key_quorum_id], + headers: parsed.transform_keys( + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + ), + model: Privy::SuccessResponse, + options: options + ) + end + + # Get a key quorum by ID. + # + # @overload get(key_quorum_id, request_options: {}) + # + # @param key_quorum_id [String] A unique identifier for a key quorum. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::KeyQuorum] + # + # @see Privy::Models::KeyQuorumGetParams + def get(key_quorum_id, params = {}) + @client.request( + method: :get, + path: ["v1/key_quorums/%1$s", key_quorum_id], + model: Privy::KeyQuorum, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/kraken_embed.rb b/lib/privy/resources/kraken_embed.rb new file mode 100644 index 0000000..5688583 --- /dev/null +++ b/lib/privy/resources/kraken_embed.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class KrakenEmbed + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/organizations.rb b/lib/privy/resources/organizations.rb new file mode 100644 index 0000000..774c94d --- /dev/null +++ b/lib/privy/resources/organizations.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Organizations + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/policies.rb b/lib/privy/resources/policies.rb new file mode 100644 index 0000000..7a22cc8 --- /dev/null +++ b/lib/privy/resources/policies.rb @@ -0,0 +1,303 @@ +# frozen_string_literal: true + +module Privy + module Resources + # Operations related to policies + class Policies + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyCreateParams} for more details. + # + # Create a new policy. + # + # @overload create(chain_type:, name:, rules:, version:, owner: nil, owner_id: nil, privy_idempotency_key: nil, request_options: {}) + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] Body param: The wallet chain types. + # + # @param name [String] Body param: Name to assign to policy. + # + # @param rules [Array] Body param + # + # @param version [Symbol, Privy::Models::PolicyCreateParams::Version] Body param: Version of the policy. Currently, 1.0 is the only version. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] Body param: The owner of the resource, specified as a Privy user ID, a P-256 pub + # + # @param owner_id [String, nil] Body param: The key quorum ID to set as the owner of the resource. If you provid + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Policy] + # + # @see Privy::Models::PolicyCreateParams + def create(params) + parsed, options = Privy::PolicyCreateParams.dump_request(params) + header_params = {privy_idempotency_key: "privy-idempotency-key"} + @client.request( + method: :post, + path: "v1/policies", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::Policy, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyUpdateParams} for more details. + # + # Update a policy by policy ID. + # + # @overload update(policy_id, name: nil, owner: nil, owner_id: nil, rules: nil, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param policy_id [String] Path param + # + # @param name [String] Body param: Name to assign to policy. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] Body param: The owner of the resource, specified as a Privy user ID, a P-256 pub + # + # @param owner_id [String, nil] Body param: The key quorum ID to set as the owner of the resource. If you provid + # + # @param rules [Array] Body param + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Policy] + # + # @see Privy::Models::PolicyUpdateParams + def update(policy_id, params = {}) + parsed, options = Privy::PolicyUpdateParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :patch, + path: ["v1/policies/%1$s", policy_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::Policy, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyDeleteParams} for more details. + # + # Delete a policy by policy ID. + # + # @overload delete(policy_id, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param policy_id [String] + # + # @param privy_authorization_signature [String] Request authorization signature. If multiple signatures are required, they shoul + # + # @param privy_request_expiry [String] Request expiry. Value is a Unix timestamp in milliseconds representing the deadl + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::SuccessResponse] + # + # @see Privy::Models::PolicyDeleteParams + def delete(policy_id, params = {}) + parsed, options = Privy::PolicyDeleteParams.dump_request(params) + @client.request( + method: :delete, + path: ["v1/policies/%1$s", policy_id], + headers: parsed.transform_keys( + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + ), + model: Privy::SuccessResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyCreateRuleParams} for more details. + # + # Create a new rule for a policy. + # + # @overload create_rule(policy_id, action:, conditions:, method_:, name:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param policy_id [String] Path param + # + # @param action [Symbol, Privy::Models::PolicyAction] Body param: The action to take when a policy rule matches. + # + # @param conditions [Array] Body param + # + # @param method_ [Symbol, Privy::Models::PolicyMethod] Body param: Method the rule applies to. + # + # @param name [String] Body param + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::PolicyRuleResponse] + # + # @see Privy::Models::PolicyCreateRuleParams + def create_rule(policy_id, params) + parsed, options = Privy::PolicyCreateRuleParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :post, + path: ["v1/policies/%1$s/rules", policy_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::PolicyRuleResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyDeleteRuleParams} for more details. + # + # Delete a rule by policy ID and rule ID. + # + # @overload delete_rule(rule_id, policy_id:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param rule_id [String] Path param + # + # @param policy_id [String] Path param + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::SuccessResponse] + # + # @see Privy::Models::PolicyDeleteRuleParams + def delete_rule(rule_id, params) + parsed, options = Privy::PolicyDeleteRuleParams.dump_request(params) + policy_id = + parsed.delete(:policy_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :delete, + path: ["v1/policies/%1$s/rules/%2$s", policy_id, rule_id], + headers: parsed.transform_keys( + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + ), + model: Privy::SuccessResponse, + options: options + ) + end + + # Get a policy by policy ID. + # + # @overload get(policy_id, request_options: {}) + # + # @param policy_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Policy] + # + # @see Privy::Models::PolicyGetParams + def get(policy_id, params = {}) + @client.request( + method: :get, + path: ["v1/policies/%1$s", policy_id], + model: Privy::Policy, + options: params[:request_options] + ) + end + + # Get a rule by policy ID and rule ID. + # + # @overload get_rule(rule_id, policy_id:, request_options: {}) + # + # @param rule_id [String] + # @param policy_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::PolicyRuleResponse] + # + # @see Privy::Models::PolicyGetRuleParams + def get_rule(rule_id, params) + parsed, options = Privy::PolicyGetRuleParams.dump_request(params) + policy_id = + parsed.delete(:policy_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + @client.request( + method: :get, + path: ["v1/policies/%1$s/rules/%2$s", policy_id, rule_id], + model: Privy::PolicyRuleResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::PolicyUpdateRuleParams} for more details. + # + # Update a rule by policy ID and rule ID. + # + # @overload update_rule(rule_id, policy_id:, action:, conditions:, method_:, name:, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param rule_id [String] Path param + # + # @param policy_id [String] Path param + # + # @param action [Symbol, Privy::Models::PolicyAction] Body param: The action to take when a policy rule matches. + # + # @param conditions [Array] Body param + # + # @param method_ [Symbol, Privy::Models::PolicyMethod] Body param: Method the rule applies to. + # + # @param name [String] Body param + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::PolicyRuleResponse] + # + # @see Privy::Models::PolicyUpdateRuleParams + def update_rule(rule_id, params) + parsed, options = Privy::PolicyUpdateRuleParams.dump_request(params) + policy_id = + parsed.delete(:policy_id) do + raise ArgumentError.new("missing required path argument #{_1}") + end + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :patch, + path: ["v1/policies/%1$s/rules/%2$s", policy_id, rule_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::PolicyRuleResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/shared.rb b/lib/privy/resources/shared.rb new file mode 100644 index 0000000..bc27b9e --- /dev/null +++ b/lib/privy/resources/shared.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Shared + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/swaps.rb b/lib/privy/resources/swaps.rb new file mode 100644 index 0000000..5319bf8 --- /dev/null +++ b/lib/privy/resources/swaps.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Swaps + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/transactions.rb b/lib/privy/resources/transactions.rb new file mode 100644 index 0000000..7a332c8 --- /dev/null +++ b/lib/privy/resources/transactions.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +module Privy + module Resources + # Operations related to transactions + class Transactions + # Get a transaction by transaction ID. + # + # @overload get(transaction_id, request_options: {}) + # + # @param transaction_id [String] ID of the transaction. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Transaction] + # + # @see Privy::Models::TransactionGetParams + def get(transaction_id, params = {}) + @client.request( + method: :get, + path: ["v1/transactions/%1$s", transaction_id], + model: Privy::Transaction, + options: params[:request_options] + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/users.rb b/lib/privy/resources/users.rb new file mode 100644 index 0000000..832a957 --- /dev/null +++ b/lib/privy/resources/users.rb @@ -0,0 +1,449 @@ +# frozen_string_literal: true + +module Privy + module Resources + # Operations related to users + class Users + # Create a new user with linked accounts. Optionally pre-generate embedded wallets + # for the user. + # + # @overload create(linked_accounts:, custom_metadata: nil, wallets: nil, request_options: {}) + # + # @param linked_accounts [Array] + # + # @param custom_metadata [Hash{Symbol=>String, Float, Boolean}] Custom metadata associated with the user. + # + # @param wallets [Array] Wallets to create for the user. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserCreateParams + def create(params) + parsed, options = Privy::UserCreateParams.dump_request(params) + @client.request(method: :post, path: "v1/users", body: parsed, model: Privy::User, options: options) + end + + # Get all users in your app. + # + # @overload list(cursor: nil, limit: nil, request_options: {}) + # + # @param cursor [String] + # @param limit [Float, nil] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Internal::Cursor] + # + # @see Privy::Models::UserListParams + def list(params = {}) + parsed, options = Privy::UserListParams.dump_request(params) + query = Privy::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/users", + query: query, + page: Privy::Internal::Cursor, + model: Privy::User, + options: options + ) + end + + # Delete a user by user ID. + # + # @overload delete(user_id, request_options: {}) + # + # @param user_id [String] ID of the user. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [nil] + # + # @see Privy::Models::UserDeleteParams + def delete(user_id, params = {}) + @client.request( + method: :delete, + path: ["v1/users/%1$s", user_id], + model: NilClass, + options: params[:request_options] + ) + end + + # Get a user by user ID. + # + # @overload get(user_id, request_options: {}) + # + # @param user_id [String] User ID + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetParams + def get(user_id, params = {}) + @client.request( + method: :get, + path: ["v1/users/%1$s", user_id], + model: Privy::User, + options: params[:request_options] + ) + end + + # Looks up a user by their custom auth ID. + # + # @overload get_by_custom_auth_id(custom_user_id:, request_options: {}) + # + # @param custom_user_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByCustomAuthIDParams + def get_by_custom_auth_id(params) + parsed, options = Privy::UserGetByCustomAuthIDParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/custom_auth/id", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their Discord username. + # + # @overload get_by_discord_username(username:, request_options: {}) + # + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByDiscordUsernameParams + def get_by_discord_username(params) + parsed, options = Privy::UserGetByDiscordUsernameParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/discord/username", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their email address. + # + # @overload get_by_email_address(address:, request_options: {}) + # + # @param address [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByEmailAddressParams + def get_by_email_address(params) + parsed, options = Privy::UserGetByEmailAddressParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/email/address", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their Farcaster ID. + # + # @overload get_by_farcaster_id(fid:, request_options: {}) + # + # @param fid [Float] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByFarcasterIDParams + def get_by_farcaster_id(params) + parsed, options = Privy::UserGetByFarcasterIDParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/farcaster/fid", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their Github username. + # + # @overload get_by_github_username(username:, request_options: {}) + # + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByGitHubUsernameParams + def get_by_github_username(params) + parsed, options = Privy::UserGetByGitHubUsernameParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/github/username", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their phone number. + # + # @overload get_by_phone_number(number:, request_options: {}) + # + # @param number [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByPhoneNumberParams + def get_by_phone_number(params) + parsed, options = Privy::UserGetByPhoneNumberParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/phone/number", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their smart wallet address. + # + # @overload get_by_smart_wallet_address(address:, request_options: {}) + # + # @param address [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetBySmartWalletAddressParams + def get_by_smart_wallet_address(params) + parsed, options = Privy::UserGetBySmartWalletAddressParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/smart_wallet/address", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their Telegram user ID. + # + # @overload get_by_telegram_user_id(telegram_user_id:, request_options: {}) + # + # @param telegram_user_id [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByTelegramUserIDParams + def get_by_telegram_user_id(params) + parsed, options = Privy::UserGetByTelegramUserIDParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/telegram/telegram_user_id", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their Telegram username. + # + # @overload get_by_telegram_username(username:, request_options: {}) + # + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByTelegramUsernameParams + def get_by_telegram_username(params) + parsed, options = Privy::UserGetByTelegramUsernameParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/telegram/username", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their Twitter subject. + # + # @overload get_by_twitter_subject(subject:, request_options: {}) + # + # @param subject [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByTwitterSubjectParams + def get_by_twitter_subject(params) + parsed, options = Privy::UserGetByTwitterSubjectParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/twitter/subject", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their Twitter username. + # + # @overload get_by_twitter_username(username:, request_options: {}) + # + # @param username [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByTwitterUsernameParams + def get_by_twitter_username(params) + parsed, options = Privy::UserGetByTwitterUsernameParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/twitter/username", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Looks up a user by their wallet address. + # + # @overload get_by_wallet_address(address:, request_options: {}) + # + # @param address [String] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserGetByWalletAddressParams + def get_by_wallet_address(params) + parsed, options = Privy::UserGetByWalletAddressParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/wallet/address", + body: parsed, + model: Privy::User, + options: options + ) + end + + # Creates an embedded wallet for an existing user. + # + # @overload pregenerate_wallets(user_id, wallets:, request_options: {}) + # + # @param user_id [String] ID of the user. + # + # @param wallets [Array] + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserPregenerateWalletsParams + def pregenerate_wallets(user_id, params) + parsed, options = Privy::UserPregenerateWalletsParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/users/%1$s/wallets", user_id], + body: parsed, + model: Privy::User, + options: options + ) + end + + # Search users by search term, emails, phone numbers, or wallet addresses. + # + # @overload search(body:, request_options: {}) + # + # @param body [Privy::Models::UserSearchParams::Body::SearchTerm, Privy::Models::UserSearchParams::Body::UnionMember1] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserSearchParams + def search(params) + parsed, options = Privy::UserSearchParams.dump_request(params) + @client.request( + method: :post, + path: "v1/users/search", + body: parsed[:body], + model: Privy::User, + options: options + ) + end + + # Adds custom metadata to a user by user ID. + # + # @overload set_custom_metadata(user_id, custom_metadata:, request_options: {}) + # + # @param user_id [String] ID of the user. + # + # @param custom_metadata [Hash{Symbol=>String, Float, Boolean}] Custom metadata associated with the user. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserSetCustomMetadataParams + def set_custom_metadata(user_id, params) + parsed, options = Privy::UserSetCustomMetadataParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/users/%1$s/custom_metadata", user_id], + body: parsed, + model: Privy::User, + options: options + ) + end + + # Unlinks a user linked account. + # + # @overload unlink_linked_account(user_id, handle:, type:, provider: nil, request_options: {}) + # + # @param user_id [String] ID of the user. + # + # @param handle [String] + # + # @param type [Symbol, String, Privy::Models::LinkedAccountType] The possible types of linked accounts. + # + # @param provider [String] + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::User] + # + # @see Privy::Models::UserUnlinkLinkedAccountParams + def unlink_linked_account(user_id, params) + parsed, options = Privy::UserUnlinkLinkedAccountParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/users/%1$s/accounts/unlink", user_id], + body: parsed, + model: Privy::User, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/wallet_actions.rb b/lib/privy/resources/wallet_actions.rb new file mode 100644 index 0000000..fed3436 --- /dev/null +++ b/lib/privy/resources/wallet_actions.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class WalletActions + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/wallets.rb b/lib/privy/resources/wallets.rb new file mode 100644 index 0000000..b257f0d --- /dev/null +++ b/lib/privy/resources/wallets.rb @@ -0,0 +1,471 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Wallets + # @return [Privy::Resources::Wallets::Earn] + attr_reader :earn + + # Operations related to wallets + # @return [Privy::Resources::Wallets::Transactions] + attr_reader :transactions + + # Operations related to wallets + # @return [Privy::Resources::Wallets::Balance] + attr_reader :balance + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletCreateParams} for more details. + # + # Creates a new wallet on the requested chain and for the requested owner. + # + # @overload create(chain_type:, additional_signers: nil, display_name: nil, external_id: nil, owner: nil, owner_id: nil, policy_ids: nil, privy_idempotency_key: nil, request_options: {}) + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] Body param: The wallet chain types. + # + # @param additional_signers [Array] Body param: Additional signers for the wallet. + # + # @param display_name [String] Body param: A human-readable label for the wallet. + # + # @param external_id [String] Body param: A customer-provided identifier for mapping to external systems. URL- + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] Body param: The owner of the resource, specified as a Privy user ID, a P-256 pub + # + # @param owner_id [String, nil] Body param: The key quorum ID to set as the owner of the resource. If you provid + # + # @param policy_ids [Array] Body param: An optional list of up to one policy ID to enforce on the wallet. + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Wallet] + # + # @see Privy::Models::WalletCreateParams + def create(params) + parsed, options = Privy::WalletCreateParams.dump_request(params) + header_params = {privy_idempotency_key: "privy-idempotency-key"} + @client.request( + method: :post, + path: "v1/wallets", + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::Wallet, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletUpdateParams} for more details. + # + # Update a wallet's policies or authorization key configuration. + # + # @overload update(wallet_id, additional_signers: nil, display_name: nil, owner: nil, owner_id: nil, policy_ids: nil, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param additional_signers [Array] Body param: Additional signers for the wallet. + # + # @param display_name [String, nil] Body param: A human-readable label for the wallet. Set to null to clear. + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] Body param: The owner of the resource, specified as a Privy user ID, a P-256 pub + # + # @param owner_id [String, nil] Body param: The key quorum ID to set as the owner of the resource. If you provid + # + # @param policy_ids [Array] Body param: New policy IDs to enforce on the wallet. Currently, only one policy + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Wallet] + # + # @see Privy::Models::WalletUpdateParams + def update(wallet_id, params = {}) + parsed, options = Privy::WalletUpdateParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :patch, + path: ["v1/wallets/%1$s", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::Wallet, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletListParams} for more details. + # + # Get all wallets in your app. + # + # @overload list(authorization_key: nil, chain_type: nil, cursor: nil, external_id: nil, limit: nil, user_id: nil, request_options: {}) + # + # @param authorization_key [String] Filter wallets by authorization public key. Returns wallets owned by key quorums + # + # @param chain_type [Symbol, Privy::Models::WalletChainType] The wallet chain types. + # + # @param cursor [String] + # + # @param external_id [String] Filter wallets by external ID. + # + # @param limit [Float, nil] + # + # @param user_id [String] Filter wallets by user ID. Cannot be used together with authorization_key. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Internal::Cursor] + # + # @see Privy::Models::WalletListParams + def list(params = {}) + parsed, options = Privy::WalletListParams.dump_request(params) + query = Privy::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: "v1/wallets", + query: query, + page: Privy::Internal::Cursor, + model: Privy::Wallet, + options: options + ) + end + + # Initialize a wallet import. Complete by submitting the import. + # + # @overload _init_import(body:, request_options: {}) + # + # @param body [Privy::Models::HDInitInput, Privy::Models::PrivateKeyInitInput] The input for HD wallets. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::WalletInitImportResponse] + # + # @see Privy::Models::WalletInitImportParams + def _init_import(params) + parsed, options = Privy::WalletInitImportParams.dump_request(params) + @client.request( + method: :post, + path: "v1/wallets/import/init", + body: parsed[:body], + model: Privy::Models::WalletInitImportResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletSubmitImportParams} for more details. + # + # Submit a wallet import request. + # + # @overload _submit_import(wallet:, additional_signers: nil, display_name: nil, external_id: nil, owner: nil, owner_id: nil, policy_ids: nil, request_options: {}) + # + # @param wallet [Privy::Models::HDSubmitInput, Privy::Models::PrivateKeySubmitInput] The submission input for importing an HD wallet. + # + # @param additional_signers [Array] Additional signers for the wallet. + # + # @param display_name [String] A human-readable label for the wallet. + # + # @param external_id [String] A customer-provided identifier for mapping to external systems. URL-safe charact + # + # @param owner [Privy::Models::OwnerInputUser, Privy::Models::OwnerInputPublicKey, nil] The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # + # @param owner_id [String, nil] The key quorum ID to set as the owner of the resource. If you provide this, do n + # + # @param policy_ids [Array] An optional list of up to one policy ID to enforce on the wallet. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Wallet] + # + # @see Privy::Models::WalletSubmitImportParams + def _submit_import(params) + parsed, options = Privy::WalletSubmitImportParams.dump_request(params) + @client.request( + method: :post, + path: "v1/wallets/import/submit", + body: parsed, + model: Privy::Wallet, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletTransferParams} for more details. + # + # Transfer tokens from a wallet to a destination address. + # + # @overload _transfer(wallet_id, destination:, source:, amount_type: nil, slippage_bps: nil, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param destination [Privy::Models::TokenTransferDestination] Body param: The destination address for a token transfer. Optionally specify a d + # + # @param source [Privy::Models::NamedTokenTransferSource, Privy::Models::CustomTokenTransferSource] Body param: The source asset, amount, and chain for a token transfer. Specify ei + # + # @param amount_type [Symbol, Privy::Models::AmountType] Body param: Whether the amount refers to the input token or output token. + # + # @param slippage_bps [Integer] Body param: Maximum allowed slippage in basis points (1 bps = 0.01%). + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::TransferActionResponse] + # + # @see Privy::Models::WalletTransferParams + def _transfer(wallet_id, params) + parsed, options = Privy::WalletTransferParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_idempotency_key: "privy-idempotency-key", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :post, + path: ["v1/wallets/%1$s/transfer", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::TransferActionResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletAuthenticateWithJwtParams} for more details. + # + # Obtain a session key to enable wallet access. + # + # @overload authenticate_with_jwt(encryption_type:, recipient_public_key:, user_jwt:, request_options: {}) + # + # @param encryption_type [Symbol, Privy::Models::WalletAuthenticateRequestBody::EncryptionType] The encryption type for the authentication response. Currently only supports HPK + # + # @param recipient_public_key [String] The public key of your ECDH keypair, in base64-encoded, SPKI-format, whose priva + # + # @param user_jwt [String] The user's JWT, to be used to authenticate the user. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption, Privy::Models::WalletAuthenticateWithJwtResponse::WithoutEncryption] + # + # @see Privy::Models::WalletAuthenticateWithJwtParams + def authenticate_with_jwt(params) + parsed, options = Privy::WalletAuthenticateWithJwtParams.dump_request(params) + @client.request( + method: :post, + path: "v1/wallets/authenticate", + body: parsed, + model: Privy::WalletAuthenticateWithJwtResponse, + options: options + ) + end + + # @deprecated + # + # Create wallets with an associated recovery user. + # + # @overload create_wallets_with_recovery(primary_signer:, recovery_user:, wallets:, request_options: {}) + # + # @param primary_signer [Privy::Models::WalletCreateWalletsWithRecoveryParams::PrimarySigner] + # @param recovery_user [Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser] + # @param wallets [Array] + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::WalletCreateWalletsWithRecoveryResponse] + # + # @see Privy::Models::WalletCreateWalletsWithRecoveryParams + def create_wallets_with_recovery(params) + parsed, options = Privy::WalletCreateWalletsWithRecoveryParams.dump_request(params) + @client.request( + method: :post, + path: "v1/wallets_with_recovery", + body: parsed, + model: Privy::WalletCreateWalletsWithRecoveryResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletExportParams} for more details. + # + # Export a wallet's private key + # + # @overload export(wallet_id, encryption_type:, recipient_public_key:, export_seed_phrase: nil, privy_authorization_signature: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param encryption_type [Symbol, Privy::Models::HpkeEncryption] Body param: The encryption type of the wallet to import. Currently only supports + # + # @param recipient_public_key [String] Body param: The base64-encoded encryption public key to encrypt the wallet priva + # + # @param export_seed_phrase [Boolean] Body param + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::WalletExportResponseBody] + # + # @see Privy::Models::WalletExportParams + def export(wallet_id, params) + parsed, options = Privy::WalletExportParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :post, + path: ["v1/wallets/%1$s/export", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::WalletExportResponseBody, + options: options + ) + end + + # Get a wallet by wallet ID. + # + # @overload get(wallet_id, request_options: {}) + # + # @param wallet_id [String] ID of the wallet. + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Wallet] + # + # @see Privy::Models::WalletGetParams + def get(wallet_id, params = {}) + @client.request( + method: :get, + path: ["v1/wallets/%1$s", wallet_id], + model: Privy::Wallet, + options: params[:request_options] + ) + end + + # Look up a wallet by its blockchain address. Returns the wallet object if found. + # + # @overload get_wallet_by_address(address:, request_options: {}) + # + # @param address [String] A blockchain wallet address (Ethereum or Solana). + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Wallet] + # + # @see Privy::Models::WalletGetWalletByAddressParams + def get_wallet_by_address(params) + parsed, options = Privy::WalletGetWalletByAddressParams.dump_request(params) + @client.request( + method: :post, + path: "v1/wallets/address", + body: parsed, + model: Privy::Wallet, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletRawSignParams} for more details. + # + # Sign a message with a wallet by wallet ID. + # + # @overload raw_sign(wallet_id, params:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param params [Privy::Models::RawSignHashParams, Privy::Models::RawSignBytesParams] Body param: Parameters for the `raw_sign` RPC. + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::RawSignResponse] + # + # @see Privy::Models::WalletRawSignParams + def raw_sign(wallet_id, params) + parsed, options = Privy::WalletRawSignParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_idempotency_key: "privy-idempotency-key", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :post, + path: ["v1/wallets/%1$s/raw_sign", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::RawSignResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::WalletRpcParams} for more details. + # + # Sign a message or transaction with a wallet by wallet ID. + # + # @overload rpc(wallet_id, wallet_rpc_request_body:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param wallet_rpc_request_body [Privy::Models::EthereumSignTransactionRpcInput, Privy::Models::EthereumSendTransactionRpcInput, Privy::Models::EthereumPersonalSignRpcInput, Privy::Models::EthereumSignTypedDataRpcInput, Privy::Models::EthereumSecp256k1SignRpcInput, Privy::Models::EthereumSign7702AuthorizationRpcInput, Privy::Models::EthereumSignUserOperationRpcInput, Privy::Models::EthereumSendCallsRpcInput, Privy::Models::SolanaSignTransactionRpcInput, Privy::Models::SolanaSignAndSendTransactionRpcInput, Privy::Models::SolanaSignMessageRpcInput, Privy::Models::SparkTransferRpcInput, Privy::Models::SparkGetBalanceRpcInput, Privy::Models::SparkTransferTokensRpcInput, Privy::Models::SparkGetStaticDepositAddressRpcInput, Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput, Privy::Models::SparkClaimStaticDepositRpcInput, Privy::Models::SparkCreateLightningInvoiceRpcInput, Privy::Models::SparkPayLightningInvoiceRpcInput, Privy::Models::SparkSignMessageWithIdentityKeyRpcInput, Privy::Models::ExportPrivateKeyRpcInput, Privy::Models::ExportSeedPhraseRpcInput] Body param: Request body for wallet RPC operations, discriminated by method. + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::EthereumPersonalSignRpcResponse, Privy::Models::EthereumSignTypedDataRpcResponse, Privy::Models::EthereumSignTransactionRpcResponse, Privy::Models::EthereumSendTransactionRpcResponse, Privy::Models::EthereumSignUserOperationRpcResponse, Privy::Models::EthereumSign7702AuthorizationRpcResponse, Privy::Models::EthereumSecp256k1SignRpcResponse, Privy::Models::EthereumSendCallsRpcResponse, Privy::Models::SolanaSignMessageRpcResponse, Privy::Models::SolanaSignTransactionRpcResponse, Privy::Models::SolanaSignAndSendTransactionRpcResponse, Privy::Models::SparkTransferRpcResponse, Privy::Models::SparkGetBalanceRpcResponse, Privy::Models::SparkTransferTokensRpcResponse, Privy::Models::SparkGetStaticDepositAddressRpcResponse, Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse, Privy::Models::SparkClaimStaticDepositRpcResponse, Privy::Models::SparkCreateLightningInvoiceRpcResponse, Privy::Models::SparkPayLightningInvoiceRpcResponse, Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse, Privy::Models::ExportPrivateKeyRpcResponse, Privy::Models::ExportSeedPhraseRpcResponse] + # + # @see Privy::Models::WalletRpcParams + def rpc(wallet_id, params) + parsed, options = Privy::WalletRpcParams.dump_request(params) + @client.request( + method: :post, + path: ["v1/wallets/%1$s/rpc", wallet_id], + headers: parsed.except(:wallet_rpc_request_body).transform_keys( + privy_authorization_signature: "privy-authorization-signature", + privy_idempotency_key: "privy-idempotency-key", + privy_request_expiry: "privy-request-expiry" + ), + body: parsed[:wallet_rpc_request_body], + model: Privy::WalletRpcResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + @earn = Privy::Resources::Wallets::Earn.new(client: client) + @transactions = Privy::Resources::Wallets::Transactions.new(client: client) + @balance = Privy::Resources::Wallets::Balance.new(client: client) + end + end + end +end diff --git a/lib/privy/resources/wallets/balance.rb b/lib/privy/resources/wallets/balance.rb new file mode 100644 index 0000000..a5308cb --- /dev/null +++ b/lib/privy/resources/wallets/balance.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Wallets + # Operations related to wallets + class Balance + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::BalanceGetParams} for more details. + # + # Get the balance of a wallet by wallet ID. + # + # @overload get(wallet_id, token: nil, asset: nil, chain: nil, include_currency: nil, request_options: {}) + # + # @param wallet_id [String] ID of the wallet. + # + # @param token [String, Array] The token contract address(es) to query in format "chain:address" (e.g., "base:0 + # + # @param asset [Symbol, Array, Privy::Models::Wallets::BalanceGetParams::Asset] Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # + # @param chain [Symbol, Array, Privy::Models::Wallets::BalanceGetParams::Chain] Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with ` + # + # @param include_currency [Symbol, Privy::Models::Wallets::BalanceGetParams::IncludeCurrency] If set, balances are converted to the specified fiat currency. Not supported whe + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Wallets::BalanceGetResponse] + # + # @see Privy::Models::Wallets::BalanceGetParams + def get(wallet_id, params = {}) + parsed, options = Privy::Wallets::BalanceGetParams.dump_request(params) + query = Privy::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/wallets/%1$s/balance", wallet_id], + query: query, + model: Privy::Models::Wallets::BalanceGetResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/privy/resources/wallets/earn.rb b/lib/privy/resources/wallets/earn.rb new file mode 100644 index 0000000..56e81a4 --- /dev/null +++ b/lib/privy/resources/wallets/earn.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Wallets + class Earn + # Operations related to wallet actions + # @return [Privy::Resources::Wallets::Earn::Ethereum] + attr_reader :ethereum + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + @ethereum = Privy::Resources::Wallets::Earn::Ethereum.new(client: client) + end + end + end + end +end diff --git a/lib/privy/resources/wallets/earn/ethereum.rb b/lib/privy/resources/wallets/earn/ethereum.rb new file mode 100644 index 0000000..4fd56a4 --- /dev/null +++ b/lib/privy/resources/wallets/earn/ethereum.rb @@ -0,0 +1,112 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Wallets + class Earn + # Operations related to wallet actions + class Ethereum + # Operations related to wallet actions + # @return [Privy::Resources::Wallets::Earn::Ethereum::Incentive] + attr_reader :incentive + + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::Earn::EthereumDepositParams} for more details. + # + # Deposit assets into an ERC-4626 vault. + # + # @overload _deposit(wallet_id, vault_id:, amount: nil, raw_amount: nil, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param vault_id [String] Body param: The ID of the vault to deposit into. + # + # @param amount [String] Body param: Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). + # + # @param raw_amount [String] Body param: Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::EarnDepositActionResponse] + # + # @see Privy::Models::Wallets::Earn::EthereumDepositParams + def _deposit(wallet_id, params) + parsed, options = Privy::Wallets::Earn::EthereumDepositParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_idempotency_key: "privy-idempotency-key", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :post, + path: ["v1/wallets/%1$s/earn/ethereum/deposit", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::EarnDepositActionResponse, + options: options + ) + end + + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::Earn::EthereumWithdrawParams} for more details. + # + # Withdraw assets from an ERC-4626 vault. + # + # @overload _withdraw(wallet_id, vault_id:, amount: nil, raw_amount: nil, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param vault_id [String] Body param: The ID of the vault to withdraw from. + # + # @param amount [String] Body param: Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). + # + # @param raw_amount [String] Body param: Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC wit + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::EarnWithdrawActionResponse] + # + # @see Privy::Models::Wallets::Earn::EthereumWithdrawParams + def _withdraw(wallet_id, params) + parsed, options = Privy::Wallets::Earn::EthereumWithdrawParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_idempotency_key: "privy-idempotency-key", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :post, + path: ["v1/wallets/%1$s/earn/ethereum/withdraw", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::EarnWithdrawActionResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + @incentive = Privy::Resources::Wallets::Earn::Ethereum::Incentive.new(client: client) + end + end + end + end + end +end diff --git a/lib/privy/resources/wallets/earn/ethereum/incentive.rb b/lib/privy/resources/wallets/earn/ethereum/incentive.rb new file mode 100644 index 0000000..b35893a --- /dev/null +++ b/lib/privy/resources/wallets/earn/ethereum/incentive.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Wallets + class Earn + class Ethereum + # Operations related to wallet actions + class Incentive + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::Earn::Ethereum::IncentiveClaimParams} for more details. + # + # Claim incentive rewards for a wallet. + # + # @overload _claim(wallet_id, chain:, privy_authorization_signature: nil, privy_idempotency_key: nil, privy_request_expiry: nil, request_options: {}) + # + # @param wallet_id [String] Path param: ID of the wallet. + # + # @param chain [String] Body param: The blockchain network on which to perform the incentive claim. Supp + # + # @param privy_authorization_signature [String] Header param: Request authorization signature. If multiple signatures are requir + # + # @param privy_idempotency_key [String] Header param: Idempotency keys ensure API requests are executed only once within + # + # @param privy_request_expiry [String] Header param: Request expiry. Value is a Unix timestamp in milliseconds represen + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::EarnIncentiveClaimActionResponse] + # + # @see Privy::Models::Wallets::Earn::Ethereum::IncentiveClaimParams + def _claim(wallet_id, params) + parsed, options = Privy::Wallets::Earn::Ethereum::IncentiveClaimParams.dump_request(params) + header_params = + { + privy_authorization_signature: "privy-authorization-signature", + privy_idempotency_key: "privy-idempotency-key", + privy_request_expiry: "privy-request-expiry" + } + @client.request( + method: :post, + path: ["v1/wallets/%1$s/earn/ethereum/incentive/claim", wallet_id], + headers: parsed.slice(*header_params.keys).transform_keys(header_params), + body: parsed.except(*header_params.keys), + model: Privy::EarnIncentiveClaimActionResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end + end + end + end +end diff --git a/lib/privy/resources/wallets/transactions.rb b/lib/privy/resources/wallets/transactions.rb new file mode 100644 index 0000000..49d6b29 --- /dev/null +++ b/lib/privy/resources/wallets/transactions.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Wallets + # Operations related to wallets + class Transactions + # Some parameter documentations has been truncated, see + # {Privy::Models::Wallets::TransactionGetParams} for more details. + # + # Get incoming and outgoing transactions of a wallet by wallet ID. + # + # @overload get(wallet_id, chain:, token: nil, asset: nil, cursor: nil, limit: nil, tx_hash: nil, request_options: {}) + # + # @param wallet_id [String] ID of the wallet. + # + # @param chain [Symbol, Privy::Models::Wallets::TransactionGetParams::Chain] + # + # @param token [String, Array] Exactly one of `token` or `asset` is required. Cannot be used together with `ass + # + # @param asset [Symbol, Array, Privy::Models::Wallets::TransactionGetParams::Asset] Exactly one of `asset` or `token` is required. Cannot be used together with `tok + # + # @param cursor [String] + # + # @param limit [Float, nil] + # + # @param tx_hash [String] + # + # @param request_options [Privy::RequestOptions, Hash{Symbol=>Object}, nil] + # + # @return [Privy::Models::Wallets::TransactionGetResponse] + # + # @see Privy::Models::Wallets::TransactionGetParams + def get(wallet_id, params) + parsed, options = Privy::Wallets::TransactionGetParams.dump_request(params) + query = Privy::Internal::Util.encode_query_params(parsed) + @client.request( + method: :get, + path: ["v1/wallets/%1$s/transactions", wallet_id], + query: query, + model: Privy::Models::Wallets::TransactionGetResponse, + options: options + ) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end + end +end diff --git a/lib/privy/resources/webhooks.rb b/lib/privy/resources/webhooks.rb new file mode 100644 index 0000000..4cc0e04 --- /dev/null +++ b/lib/privy/resources/webhooks.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Webhooks + # @param payload [String] The raw webhook payload as a string + # + # @return [Privy::Models::IntentAuthorizedWebhookPayload, Privy::Models::IntentCreatedWebhookPayload, Privy::Models::IntentExecutedWebhookPayload, Privy::Models::IntentFailedWebhookPayload, Privy::Models::IntentRejectedWebhookPayload, Privy::Models::MfaDisabledWebhookPayload, Privy::Models::MfaEnabledWebhookPayload, Privy::Models::TransactionBroadcastedWebhookPayload, Privy::Models::TransactionConfirmedWebhookPayload, Privy::Models::TransactionExecutionRevertedWebhookPayload, Privy::Models::TransactionFailedWebhookPayload, Privy::Models::TransactionProviderErrorWebhookPayload, Privy::Models::TransactionReplacedWebhookPayload, Privy::Models::TransactionStillPendingWebhookPayload, Privy::Models::UserAuthenticatedWebhookPayload, Privy::Models::UserCreatedWebhookPayload, Privy::Models::UserLinkedAccountWebhookPayload, Privy::Models::UserTransferredAccountWebhookPayload, Privy::Models::UserUnlinkedAccountWebhookPayload, Privy::Models::UserUpdatedAccountWebhookPayload, Privy::Models::UserWalletCreatedWebhookPayload, Privy::Models::UserOperationCompletedWebhookPayload, Privy::Models::FundsDepositedWebhookPayload, Privy::Models::FundsWithdrawnWebhookPayload, Privy::Models::PrivateKeyExportWebhookPayload, Privy::Models::WalletRecoveredWebhookPayload, Privy::Models::WalletRecoverySetupWebhookPayload, Privy::Models::WalletActionEarnDepositCreatedWebhookPayload, Privy::Models::WalletActionEarnDepositFailedWebhookPayload, Privy::Models::WalletActionEarnDepositRejectedWebhookPayload, Privy::Models::WalletActionEarnDepositSucceededWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload, Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload, Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload, Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload, Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload, Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload, Privy::Models::WalletActionSwapCreatedWebhookPayload, Privy::Models::WalletActionSwapFailedWebhookPayload, Privy::Models::WalletActionSwapRejectedWebhookPayload, Privy::Models::WalletActionSwapSucceededWebhookPayload, Privy::Models::WalletActionTransferCreatedWebhookPayload, Privy::Models::WalletActionTransferFailedWebhookPayload, Privy::Models::WalletActionTransferRejectedWebhookPayload, Privy::Models::WalletActionTransferSucceededWebhookPayload, Privy::Models::YieldClaimConfirmedWebhookPayload, Privy::Models::YieldDepositConfirmedWebhookPayload, Privy::Models::YieldWithdrawConfirmedWebhookPayload] + def unsafe_unwrap(payload) + parsed = JSON.parse(payload, symbolize_names: true) + Privy::Internal::Type::Converter.coerce(Privy::Models::UnsafeUnwrapWebhookEvent, parsed) + end + + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/resources/yield_.rb b/lib/privy/resources/yield_.rb new file mode 100644 index 0000000..a44f340 --- /dev/null +++ b/lib/privy/resources/yield_.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Privy + module Resources + class Yield + # @api private + # + # @param client [Privy::Client] + def initialize(client:) + @client = client + end + end + end +end diff --git a/lib/privy/version.rb b/lib/privy/version.rb new file mode 100644 index 0000000..7ddd1a3 --- /dev/null +++ b/lib/privy/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +module Privy + VERSION = "0.1.0" +end diff --git a/manifest.yaml b/manifest.yaml new file mode 100644 index 0000000..a1fd74a --- /dev/null +++ b/manifest.yaml @@ -0,0 +1,17 @@ +dependencies: + - English + - base64 + - cgi + - date + - erb + - etc + - json + - net/http + - openssl + - pathname + - rbconfig + - securerandom + - set + - stringio + - time + - uri diff --git a/privy.gemspec b/privy.gemspec new file mode 100644 index 0000000..3454891 --- /dev/null +++ b/privy.gemspec @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require_relative "lib/privy/version" + +Gem::Specification.new do |s| + s.name = "privy_ruby" + s.version = Privy::VERSION + s.summary = "Ruby library to access the Privy API API" + s.authors = ["Privy API"] + s.email = "support@privy.io" + s.homepage = "https://gemdocs.org/gems/privy_ruby" + s.metadata["homepage_uri"] = s.homepage + s.metadata["source_code_uri"] = "https://github.com/privy-io/ruby-sdk" + s.metadata["rubygems_mfa_required"] = false.to_s + s.required_ruby_version = ">= 3.2.0" + + s.files = Dir[ + "lib/**/*.rb", + "rbi/**/*.rbi", + "sig/**/*.rbs", + "manifest.yaml", + "SECURITY.md", + "CHANGELOG.md", + ".ignore" + ] + s.extra_rdoc_files = ["README.md"] + s.add_dependency "cgi" + s.add_dependency "connection_pool" + s.add_dependency "hpke" +end diff --git a/rbi/privy/client.rbi b/rbi/privy/client.rbi new file mode 100644 index 0000000..a7dc93c --- /dev/null +++ b/rbi/privy/client.rbi @@ -0,0 +1,139 @@ +# typed: strong + +module Privy + class Client < Privy::Internal::Transport::BaseClient + DEFAULT_MAX_RETRIES = 2 + + DEFAULT_TIMEOUT_IN_SECONDS = T.let(60.0, Float) + + DEFAULT_INITIAL_RETRY_DELAY = T.let(0.5, Float) + + DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) + + ENVIRONMENTS = + T.let( + { + production: "https://api.privy.io", + staging: "https://api.staging.privy.io" + }, + T::Hash[Symbol, String] + ) + + # App secret authentication. + sig { returns(String) } + attr_reader :app_id + + # App secret authentication. + sig { returns(String) } + attr_reader :app_secret + + sig { returns(Privy::Resources::Wallets) } + attr_reader :wallets + + # Operations related to users + sig { returns(Privy::Resources::Users) } + attr_reader :users + + # Operations related to policies + sig { returns(Privy::Resources::Policies) } + attr_reader :policies + + # Operations related to transactions + sig { returns(Privy::Resources::Transactions) } + attr_reader :transactions + + # Operations related to key quorums + sig { returns(Privy::Resources::KeyQuorums) } + attr_reader :key_quorums + + sig { returns(Privy::Resources::Intents) } + attr_reader :intents + + # Operations related to app settings and allowlist management + sig { returns(Privy::Resources::Apps) } + attr_reader :apps + + sig { returns(Privy::Resources::Webhooks) } + attr_reader :webhooks + + sig { returns(Privy::Resources::Accounts) } + attr_reader :accounts + + sig { returns(Privy::Resources::Aggregations) } + attr_reader :aggregations + + sig { returns(Privy::Resources::EmbeddedWallets) } + attr_reader :embedded_wallets + + sig { returns(Privy::Resources::Analytics) } + attr_reader :analytics + + sig { returns(Privy::Resources::ClientAuth) } + attr_reader :client_auth + + sig { returns(Privy::Resources::Funding) } + attr_reader :funding + + sig { returns(Privy::Resources::Organizations) } + attr_reader :organizations + + sig { returns(Privy::Resources::CrossApp) } + attr_reader :cross_app + + sig { returns(Privy::Resources::Shared) } + attr_reader :shared + + sig { returns(Privy::Resources::WalletActions) } + attr_reader :wallet_actions + + sig { returns(Privy::Resources::Yield) } + attr_reader :yield_ + + sig { returns(Privy::Resources::KrakenEmbed) } + attr_reader :kraken_embed + + sig { returns(Privy::Resources::Swaps) } + attr_reader :swaps + + # @api private + sig { override.returns(T::Hash[String, String]) } + private def auth_headers + end + + # Creates and returns a new client for interacting with the API. + sig do + params( + app_id: T.nilable(String), + app_secret: T.nilable(String), + environment: T.nilable(T.any(Symbol, String)), + base_url: T.nilable(String), + max_retries: Integer, + timeout: Float, + initial_retry_delay: Float, + max_retry_delay: Float + ).returns(T.attached_class) + end + def self.new( + # App secret authentication. Defaults to `ENV["PRIVY_APP_ID"]` + app_id: ENV["PRIVY_APP_ID"], + # App secret authentication. Defaults to `ENV["PRIVY_APP_SECRET"]` + app_secret: ENV["PRIVY_APP_SECRET"], + # Specifies the environment to use for the API. + # + # Each environment maps to a different base URL: + # + # - `production` corresponds to `https://api.privy.io` + # - `staging` corresponds to `https://api.staging.privy.io` + environment: nil, + # Override the default base URL for the API, e.g., + # `"https://api.example.com/v2/"`. Defaults to `ENV["PRIVY_API_BASE_URL"]` + base_url: ENV["PRIVY_API_BASE_URL"], + # Max number of retries to attempt after a failed retryable request. + max_retries: Privy::Client::DEFAULT_MAX_RETRIES, + timeout: Privy::Client::DEFAULT_TIMEOUT_IN_SECONDS, + initial_retry_delay: Privy::Client::DEFAULT_INITIAL_RETRY_DELAY, + max_retry_delay: Privy::Client::DEFAULT_MAX_RETRY_DELAY + ) + end + end +end diff --git a/rbi/privy/errors.rbi b/rbi/privy/errors.rbi new file mode 100644 index 0000000..92043da --- /dev/null +++ b/rbi/privy/errors.rbi @@ -0,0 +1,205 @@ +# typed: strong + +module Privy + module Errors + class Error < StandardError + sig { returns(T.nilable(StandardError)) } + attr_accessor :cause + end + + class ConversionError < Privy::Errors::Error + sig { returns(T.nilable(StandardError)) } + def cause + end + + # @api private + sig do + params( + on: T::Class[StandardError], + method: Symbol, + target: T.anything, + value: T.anything, + cause: T.nilable(StandardError) + ).returns(T.attached_class) + end + def self.new(on:, method:, target:, value:, cause: nil) + end + end + + class APIError < Privy::Errors::Error + sig { returns(URI::Generic) } + attr_accessor :url + + sig { returns(T.nilable(Integer)) } + attr_accessor :status + + sig { returns(T.nilable(T::Hash[String, String])) } + attr_accessor :headers + + sig { returns(T.nilable(T.anything)) } + attr_accessor :body + + # @api private + sig do + params( + url: URI::Generic, + status: T.nilable(Integer), + headers: T.nilable(T::Hash[String, String]), + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + url:, + status: nil, + headers: nil, + body: nil, + request: nil, + response: nil, + message: nil + ) + end + end + + class APIConnectionError < Privy::Errors::APIError + sig { returns(NilClass) } + attr_accessor :status + + sig { returns(NilClass) } + attr_accessor :body + + # @api private + sig do + params( + url: URI::Generic, + status: NilClass, + headers: T.nilable(T::Hash[String, String]), + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + url:, + status: nil, + headers: nil, + body: nil, + request: nil, + response: nil, + message: "Connection error." + ) + end + end + + class APITimeoutError < Privy::Errors::APIConnectionError + # @api private + sig do + params( + url: URI::Generic, + status: NilClass, + headers: T.nilable(T::Hash[String, String]), + body: NilClass, + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + url:, + status: nil, + headers: nil, + body: nil, + request: nil, + response: nil, + message: "Request timed out." + ) + end + end + + class APIStatusError < Privy::Errors::APIError + # @api private + sig do + params( + url: URI::Generic, + status: Integer, + headers: T.nilable(T::Hash[String, String]), + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).returns(T.attached_class) + end + def self.for( + url:, + status:, + headers:, + body:, + request:, + response:, + message: nil + ) + end + + sig { returns(Integer) } + attr_accessor :status + + # @api private + sig do + params( + url: URI::Generic, + status: Integer, + headers: T.nilable(T::Hash[String, String]), + body: T.nilable(Object), + request: NilClass, + response: NilClass, + message: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + url:, + status:, + headers:, + body:, + request:, + response:, + message: nil + ) + end + end + + class BadRequestError < Privy::Errors::APIStatusError + HTTP_STATUS = 400 + end + + class AuthenticationError < Privy::Errors::APIStatusError + HTTP_STATUS = 401 + end + + class PermissionDeniedError < Privy::Errors::APIStatusError + HTTP_STATUS = 403 + end + + class NotFoundError < Privy::Errors::APIStatusError + HTTP_STATUS = 404 + end + + class ConflictError < Privy::Errors::APIStatusError + HTTP_STATUS = 409 + end + + class UnprocessableEntityError < Privy::Errors::APIStatusError + HTTP_STATUS = 422 + end + + class RateLimitError < Privy::Errors::APIStatusError + HTTP_STATUS = 429 + end + + class InternalServerError < Privy::Errors::APIStatusError + HTTP_STATUS = T.let((500..), T::Range[Integer]) + end + end +end diff --git a/rbi/privy/file_part.rbi b/rbi/privy/file_part.rbi new file mode 100644 index 0000000..cfc8011 --- /dev/null +++ b/rbi/privy/file_part.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + class FilePart + sig { returns(T.any(Pathname, StringIO, IO, String)) } + attr_reader :content + + sig { returns(T.nilable(String)) } + attr_reader :content_type + + sig { returns(T.nilable(String)) } + attr_reader :filename + + # @api private + sig { returns(String) } + private def read + end + + sig { params(a: T.anything).returns(String) } + def to_json(*a) + end + + sig { params(a: T.anything).returns(String) } + def to_yaml(*a) + end + + sig do + params( + content: T.any(Pathname, StringIO, IO, String), + filename: T.nilable(T.any(Pathname, String)), + content_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(content, filename: nil, content_type: nil) + end + end +end diff --git a/rbi/privy/internal.rbi b/rbi/privy/internal.rbi new file mode 100644 index 0000000..328844a --- /dev/null +++ b/rbi/privy/internal.rbi @@ -0,0 +1,16 @@ +# typed: strong + +module Privy + module Internal + extend Privy::Internal::Util::SorbetRuntimeSupport + + # Due to the current WIP status of Shapes support in Sorbet, types referencing + # this alias might be refined in the future. + AnyHash = T.type_alias { T::Hash[Symbol, T.anything] } + + FileInput = + T.type_alias { T.any(Pathname, StringIO, IO, String, Privy::FilePart) } + + OMIT = T.let(Object.new.freeze, T.anything) + end +end diff --git a/rbi/privy/internal/cursor.rbi b/rbi/privy/internal/cursor.rbi new file mode 100644 index 0000000..71dd6d7 --- /dev/null +++ b/rbi/privy/internal/cursor.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Internal + class Cursor + include Privy::Internal::Type::BasePage + + Elem = type_member + + sig { returns(T.nilable(T::Array[Elem])) } + attr_accessor :data + + sig { returns(String) } + attr_accessor :next_cursor + + # @api private + sig { returns(String) } + def inspect + end + end + end +end diff --git a/rbi/privy/internal/transport/base_client.rbi b/rbi/privy/internal/transport/base_client.rbi new file mode 100644 index 0000000..61b5268 --- /dev/null +++ b/rbi/privy/internal/transport/base_client.rbi @@ -0,0 +1,297 @@ +# typed: strong + +module Privy + module Internal + module Transport + # @api private + class BaseClient + extend Privy::Internal::Util::SorbetRuntimeSupport + + abstract! + + RequestComponents = + T.type_alias do + { + method: Symbol, + path: T.any(String, T::Array[String]), + query: + T.nilable( + T::Hash[String, T.nilable(T.any(T::Array[String], String))] + ), + headers: + T.nilable( + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ] + ), + body: T.nilable(T.anything), + unwrap: + T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), + page: + T.nilable( + T::Class[ + Privy::Internal::Type::BasePage[ + Privy::Internal::Type::BaseModel + ] + ] + ), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Privy::Internal::Type::Converter::Input), + options: T.nilable(Privy::RequestOptions::OrHash) + } + end + + RequestInput = + T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + max_retries: Integer, + timeout: Float + } + end + + # from whatwg fetch spec + MAX_REDIRECTS = 20 + + PLATFORM_HEADERS = T::Hash[String, String] + + class << self + # @api private + sig do + params( + req: Privy::Internal::Transport::BaseClient::RequestComponents + ).void + end + def validate!(req) + end + + # @api private + sig do + params(status: Integer, headers: T::Hash[String, String]).returns( + T::Boolean + ) + end + def should_retry?(status, headers:) + end + + # @api private + sig do + params( + request: Privy::Internal::Transport::BaseClient::RequestInput, + status: Integer, + response_headers: T::Hash[String, String] + ).returns(Privy::Internal::Transport::BaseClient::RequestInput) + end + def follow_redirect(request, status:, response_headers:) + end + + # @api private + sig do + params( + status: T.any(Integer, Privy::Errors::APIConnectionError), + stream: T.nilable(T::Enumerable[String]) + ).void + end + def reap_connection!(status, stream:) + end + end + + sig { returns(URI::Generic) } + attr_reader :base_url + + sig { returns(Float) } + attr_reader :timeout + + sig { returns(Integer) } + attr_reader :max_retries + + sig { returns(Float) } + attr_reader :initial_retry_delay + + sig { returns(Float) } + attr_reader :max_retry_delay + + sig { returns(T::Hash[String, String]) } + attr_reader :headers + + sig { returns(T.nilable(String)) } + attr_reader :idempotency_header + + # @api private + sig { returns(Privy::Internal::Transport::PooledNetRequester) } + attr_reader :requester + + # @api private + sig do + params( + base_url: String, + timeout: Float, + max_retries: Integer, + initial_retry_delay: Float, + max_retry_delay: Float, + headers: + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ], + idempotency_header: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + base_url:, + timeout: 0.0, + max_retries: 0, + initial_retry_delay: 0.0, + max_retry_delay: 0.0, + headers: {}, + idempotency_header: nil + ) + end + + # @api private + sig { overridable.returns(T::Hash[String, String]) } + private def auth_headers + end + + # @api private + sig { returns(String) } + private def user_agent + end + + # @api private + sig { returns(String) } + private def generate_idempotency_key + end + + # @api private + sig do + overridable + .params( + req: Privy::Internal::Transport::BaseClient::RequestComponents, + opts: Privy::Internal::AnyHash + ) + .returns(Privy::Internal::Transport::BaseClient::RequestInput) + end + private def build_request(req, opts) + end + + # @api private + sig do + params( + headers: T::Hash[String, String], + retry_count: Integer + ).returns(Float) + end + private def retry_delay(headers, retry_count:) + end + + # @api private + sig do + params( + request: Privy::Internal::Transport::BaseClient::RequestInput, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: T::Boolean + ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + def send_request( + request, + redirect_count:, + retry_count:, + send_retry_header: + ) + end + + # Execute the request specified by `req`. This is the method that all resource + # methods call into. + # + # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: Privy::Internal::Type::Unknown, options: {}) + sig do + params( + method: Symbol, + path: T.any(String, T::Array[String]), + query: + T.nilable( + T::Hash[String, T.nilable(T.any(T::Array[String], String))] + ), + headers: + T.nilable( + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ] + ), + body: T.nilable(T.anything), + unwrap: + T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), + page: + T.nilable( + T::Class[ + Privy::Internal::Type::BasePage[ + Privy::Internal::Type::BaseModel + ] + ] + ), + stream: T.nilable(T::Class[T.anything]), + model: T.nilable(Privy::Internal::Type::Converter::Input), + options: T.nilable(Privy::RequestOptions::OrHash) + ).returns(T.anything) + end + def request( + method, + path, + query: {}, + headers: {}, + body: nil, + unwrap: nil, + page: nil, + stream: nil, + model: Privy::Internal::Type::Unknown, + options: {} + ) + end + + # @api private + sig { returns(String) } + def inspect + end + end + end + end +end diff --git a/rbi/privy/internal/transport/pooled_net_requester.rbi b/rbi/privy/internal/transport/pooled_net_requester.rbi new file mode 100644 index 0000000..f2cdcf6 --- /dev/null +++ b/rbi/privy/internal/transport/pooled_net_requester.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Internal + module Transport + # @api private + class PooledNetRequester + extend Privy::Internal::Util::SorbetRuntimeSupport + + Request = + T.type_alias do + { + method: Symbol, + url: URI::Generic, + headers: T::Hash[String, String], + body: T.anything, + deadline: Float + } + end + + # from the golang stdlib + # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 + KEEP_ALIVE_TIMEOUT = 30 + + DEFAULT_MAX_CONNECTIONS = T.let(T.unsafe(nil), Integer) + + class << self + # @api private + sig do + params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns( + Net::HTTP + ) + end + def connect(cert_store:, url:) + end + + # @api private + sig { params(conn: Net::HTTP, deadline: Float).void } + def calibrate_socket_timeout(conn, deadline) + end + + # @api private + sig do + params( + request: Privy::Internal::Transport::PooledNetRequester::Request, + blk: T.proc.params(arg0: String).void + ).returns([Net::HTTPGenericRequest, T.proc.void]) + end + def build_request(request, &blk) + end + end + + # @api private + sig do + params( + url: URI::Generic, + deadline: Float, + blk: T.proc.params(arg0: Net::HTTP).void + ).void + end + private def with_pool(url, deadline:, &blk) + end + + # @api private + sig do + params( + request: Privy::Internal::Transport::PooledNetRequester::Request + ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) + end + def execute(request) + end + + # @api private + sig { params(size: Integer).returns(T.attached_class) } + def self.new( + size: Privy::Internal::Transport::PooledNetRequester::DEFAULT_MAX_CONNECTIONS + ) + end + end + end + end +end diff --git a/rbi/privy/internal/type/array_of.rbi b/rbi/privy/internal/type/array_of.rbi new file mode 100644 index 0000000..2b229dd --- /dev/null +++ b/rbi/privy/internal/type/array_of.rbi @@ -0,0 +1,104 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + # + # Array of items of a given type. + class ArrayOf + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + abstract! + + Elem = type_member(:out) + + sig do + params( + type_info: + T.any( + Privy::Internal::AnyHash, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: Privy::Internal::AnyHash + ).returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig { returns(Integer) } + def hash + end + + # @api private + sig do + override + .params( + value: T.any(T::Array[T.anything], T.anything), + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.any(T::Array[T.anything], T.anything), + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.any(T::Array[T.anything], T.anything)) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + + # @api private + sig { returns(Elem) } + protected def item_type + end + + # @api private + sig { returns(T::Boolean) } + protected def nilable? + end + + # @api private + sig do + params( + type_info: + T.any( + Privy::Internal::AnyHash, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: Privy::Internal::AnyHash + ).void + end + def initialize(type_info, spec = {}) + end + + # @api private + sig { params(depth: Integer).returns(String) } + def inspect(depth: 0) + end + end + end + end +end diff --git a/rbi/privy/internal/type/base_model.rbi b/rbi/privy/internal/type/base_model.rbi new file mode 100644 index 0000000..cb58be5 --- /dev/null +++ b/rbi/privy/internal/type/base_model.rbi @@ -0,0 +1,299 @@ +# typed: strong + +module Privy + module Internal + module Type + class BaseModel + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + abstract! + + KnownField = + T.type_alias do + { + mode: T.nilable(Symbol), + required: T::Boolean, + nilable: T::Boolean + } + end + + OrHash = + T.type_alias do + T.any(Privy::Internal::Type::BaseModel, Privy::Internal::AnyHash) + end + + class << self + # @api private + # + # Assumes superclass fields are totally defined before fields are accessed / + # defined on subclasses. + sig { params(child: Privy::Internal::Type::BaseModel).void } + def inherited(child) + end + + # @api private + sig do + returns( + T::Hash[ + Symbol, + T.all( + Privy::Internal::Type::BaseModel::KnownField, + { + type_fn: + T.proc.returns(Privy::Internal::Type::Converter::Input) + } + ) + ] + ) + end + def known_fields + end + + # @api private + sig do + returns( + T::Hash[ + Symbol, + T.all( + Privy::Internal::Type::BaseModel::KnownField, + { type: Privy::Internal::Type::Converter::Input } + ) + ] + ) + end + def fields + end + + # @api private + sig do + params( + name_sym: Symbol, + required: T::Boolean, + type_info: + T.any( + { + const: + T.nilable( + T.any(NilClass, T::Boolean, Integer, Float, Symbol) + ), + enum: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ), + api_name: Symbol, + nil?: T::Boolean + }, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: Privy::Internal::AnyHash + ).void + end + private def add_field(name_sym, required:, type_info:, spec:) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: + T.any( + Privy::Internal::AnyHash, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: Privy::Internal::AnyHash + ).void + end + def required(name_sym, type_info, spec = {}) + end + + # @api private + sig do + params( + name_sym: Symbol, + type_info: + T.any( + Privy::Internal::AnyHash, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: Privy::Internal::AnyHash + ).void + end + def optional(name_sym, type_info, spec = {}) + end + + # @api private + # + # `request_only` attributes not excluded from `.#coerce` when receiving responses + # even if well behaved servers should not send them + sig { params(blk: T.proc.void).void } + private def request_only(&blk) + end + + # @api private + # + # `response_only` attributes are omitted from `.#dump` when making requests + sig { params(blk: T.proc.void).void } + private def response_only(&blk) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig { returns(Integer) } + def hash + end + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig { returns(Integer) } + def hash + end + + class << self + # @api private + sig do + override + .params( + value: + T.any( + Privy::Internal::Type::BaseModel, + T::Hash[T.anything, T.anything], + T.anything + ), + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.any(T.attached_class, T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.any(T.attached_class, T.anything), + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.any(T::Hash[T.anything, T.anything], T.anything)) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + end + + class << self + # @api private + sig do + params( + model: Privy::Internal::Type::BaseModel, + convert: T::Boolean + ).returns(Privy::Internal::AnyHash) + end + def recursively_to_h(model, convert:) + end + end + + # Returns the raw value associated with the given key, if found. Otherwise, nil is + # returned. + # + # It is valid to lookup keys that are not in the API spec, for example to access + # undocumented features. This method does not parse response data into + # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. + sig { params(key: Symbol).returns(T.nilable(T.anything)) } + def [](key) + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + sig { overridable.returns(Privy::Internal::AnyHash) } + def to_h + end + + # Returns a Hash of the data underlying this object. O(1) + # + # Keys are Symbols and values are the raw values from the response. The return + # value indicates which values were ever set on the object. i.e. there will be a + # key in this hash if they ever were, even if the set value was nil. + # + # This method is not recursive. The returned value is shared by the object, so it + # should not be mutated. + sig { overridable.returns(Privy::Internal::AnyHash) } + def to_hash + end + + # In addition to the behaviour of `#to_h`, this method will recursively call + # `#to_h` on nested models. + sig { overridable.returns(Privy::Internal::AnyHash) } + def deep_to_h + end + + sig do + params(keys: T.nilable(T::Array[Symbol])).returns( + Privy::Internal::AnyHash + ) + end + def deconstruct_keys(keys) + end + + sig { params(a: T.anything).returns(String) } + def to_json(*a) + end + + sig { params(a: T.anything).returns(String) } + def to_yaml(*a) + end + + # Create a new instance of a model. + sig do + params( + data: + T.any( + T::Hash[Symbol, T.anything], + Privy::Internal::Type::BaseModel + ) + ).returns(T.attached_class) + end + def self.new(data = {}) + end + + class << self + # @api private + sig { params(depth: Integer).returns(String) } + def inspect(depth: 0) + end + end + + sig { returns(String) } + def to_s + end + + # @api private + sig { returns(String) } + def inspect + end + end + end + end +end diff --git a/rbi/privy/internal/type/base_page.rbi b/rbi/privy/internal/type/base_page.rbi new file mode 100644 index 0000000..ee44311 --- /dev/null +++ b/rbi/privy/internal/type/base_page.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + # + # This module provides a base implementation for paginated responses in the SDK. + module BasePage + Elem = type_member(:out) + + sig { overridable.returns(T::Boolean) } + def next_page? + end + + sig { overridable.returns(T.self_type) } + def next_page + end + + sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } + def auto_paging_each(&blk) + end + + sig { returns(T::Enumerable[Elem]) } + def to_enum + end + + # @api private + sig do + params( + client: Privy::Internal::Transport::BaseClient, + req: Privy::Internal::Transport::BaseClient::RequestComponents, + headers: T::Hash[String, String], + page_data: T.anything + ).void + end + def initialize(client:, req:, headers:, page_data:) + end + end + end + end +end diff --git a/rbi/privy/internal/type/boolean.rbi b/rbi/privy/internal/type/boolean.rbi new file mode 100644 index 0000000..907088b --- /dev/null +++ b/rbi/privy/internal/type/boolean.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + # + # Ruby has no Boolean class; this is something for models to refer to. + class Boolean + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + abstract! + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + class << self + # @api private + # + # Coerce value to Boolean if possible, otherwise return the original value. + sig do + override + .params( + value: T.any(T::Boolean, T.anything), + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.any(T::Boolean, T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.any(T::Boolean, T.anything), + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.any(T::Boolean, T.anything)) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + end + end + end + end +end diff --git a/rbi/privy/internal/type/converter.rbi b/rbi/privy/internal/type/converter.rbi new file mode 100644 index 0000000..0e55a4c --- /dev/null +++ b/rbi/privy/internal/type/converter.rbi @@ -0,0 +1,204 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + module Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + Input = + T.type_alias do + T.any(Privy::Internal::Type::Converter, T::Class[T.anything]) + end + + CoerceState = + T.type_alias do + { + translate_names: T::Boolean, + strictness: T::Boolean, + exactness: { + yes: Integer, + no: Integer, + maybe: Integer + }, + error: T::Class[StandardError], + branched: Integer + } + end + + DumpState = T.type_alias { { can_retry: T::Boolean } } + + # @api private + sig do + overridable + .params( + value: T.anything, + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig do + overridable + .params( + value: T.anything, + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.anything) + end + def dump(value, state:) + end + + # @api private + sig { params(depth: Integer).returns(String) } + def inspect(depth: 0) + end + + class << self + # @api private + sig do + params( + spec: + T.any( + { + const: + T.nilable( + T.any(NilClass, T::Boolean, Integer, Float, Symbol) + ), + enum: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ) + }, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ) + ).returns(T.proc.returns(T.anything)) + end + def self.type_info(spec) + end + + # @api private + sig do + params( + type_info: + T.any( + { + const: + T.nilable( + T.any(NilClass, T::Boolean, Integer, Float, Symbol) + ), + enum: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ) + }, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: + T.any( + { + const: + T.nilable( + T.any(NilClass, T::Boolean, Integer, Float, Symbol) + ), + enum: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ), + union: + T.nilable( + T.proc.returns(Privy::Internal::Type::Converter::Input) + ) + }, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ) + ).returns(Privy::Internal::AnyHash) + end + def self.meta_info(type_info, spec) + end + + # @api private + sig do + params(translate_names: T::Boolean).returns( + Privy::Internal::Type::Converter::CoerceState + ) + end + def self.new_coerce_state(translate_names: true) + end + + # @api private + # + # Based on `target`, transform `value` into `target`, to the extent possible: + # + # 1. if the given `value` conforms to `target` already, return the given `value` + # 2. if it's possible and safe to convert the given `value` to `target`, then the + # converted value + # 3. otherwise, the given `value` unaltered + # + # The coercion process is subject to improvement between minor release versions. + # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode + sig do + params( + target: Privy::Internal::Type::Converter::Input, + value: T.anything, + state: Privy::Internal::Type::Converter::CoerceState + ).returns(T.anything) + end + def self.coerce( + target, + value, + # The `strictness` is one of `true`, `false`. This informs the coercion strategy + # when we have to decide between multiple possible conversion targets: + # + # - `true`: the conversion must be exact, with minimum coercion. + # - `false`: the conversion can be approximate, with some coercion. + # + # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For + # any given conversion attempt, the exactness will be updated based on how closely + # the value recursively matches the target type: + # + # - `yes`: the value can be converted to the target type with minimum coercion. + # - `maybe`: the value can be converted to the target type with some reasonable + # coercion. + # - `no`: the value cannot be converted to the target type. + # + # See implementation below for more details. + state: Privy::Internal::Type::Converter.new_coerce_state + ) + end + + # @api private + sig do + params( + target: Privy::Internal::Type::Converter::Input, + value: T.anything, + state: Privy::Internal::Type::Converter::DumpState + ).returns(T.anything) + end + def self.dump(target, value, state: { can_retry: true }) + end + + # @api private + sig { params(target: T.anything, depth: Integer).returns(String) } + def self.inspect(target, depth:) + end + end + end + end + end +end diff --git a/rbi/privy/internal/type/enum.rbi b/rbi/privy/internal/type/enum.rbi new file mode 100644 index 0000000..c8f41b1 --- /dev/null +++ b/rbi/privy/internal/type/enum.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + # + # A value from among a specified list of options. OpenAPI enum values map to Ruby + # values in the SDK as follows: + # + # 1. boolean => true | false + # 2. integer => Integer + # 3. float => Float + # 4. string => Symbol + # + # We can therefore convert string values to Symbols, but can't convert other + # values safely. + module Enum + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + # All of the valid Symbol values for this enum. + sig do + overridable.returns( + T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)] + ) + end + def values + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig { returns(Integer) } + def hash + end + + # @api private + # + # Unlike with primitives, `Enum` additionally validates that the value is a member + # of the enum. + sig do + override + .params( + value: T.any(String, Symbol, T.anything), + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.any(Symbol, T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.any(Symbol, T.anything), + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.any(Symbol, T.anything)) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + + # @api private + sig { params(depth: Integer).returns(String) } + def inspect(depth: 0) + end + end + end + end +end diff --git a/rbi/privy/internal/type/file_input.rbi b/rbi/privy/internal/type/file_input.rbi new file mode 100644 index 0000000..cb1240a --- /dev/null +++ b/rbi/privy/internal/type/file_input.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + # + # Either `Pathname` or `StringIO`, or `IO`, or `Privy::Internal::Type::FileInput`. + # + # Note: when `IO` is used, all retries are disabled, since many IO` streams are + # not rewindable. + class FileInput + extend Privy::Internal::Type::Converter + + abstract! + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + class << self + # @api private + sig do + override + .params( + value: T.any(StringIO, String, T.anything), + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.any(StringIO, T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.any(Pathname, StringIO, IO, String, T.anything), + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.any(Pathname, StringIO, IO, String, T.anything)) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + end + end + end + end +end diff --git a/rbi/privy/internal/type/hash_of.rbi b/rbi/privy/internal/type/hash_of.rbi new file mode 100644 index 0000000..29486c7 --- /dev/null +++ b/rbi/privy/internal/type/hash_of.rbi @@ -0,0 +1,104 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + # + # Hash of items of a given type. + class HashOf + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + abstract! + + Elem = type_member(:out) + + sig do + params( + type_info: + T.any( + Privy::Internal::AnyHash, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: Privy::Internal::AnyHash + ).returns(T.attached_class) + end + def self.[](type_info, spec = {}) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig { returns(Integer) } + def hash + end + + # @api private + sig do + override + .params( + value: T.any(T::Hash[T.anything, T.anything], T.anything), + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.any(Privy::Internal::AnyHash, T.anything)) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.any(T::Hash[T.anything, T.anything], T.anything), + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.any(Privy::Internal::AnyHash, T.anything)) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + + # @api private + sig { returns(Elem) } + protected def item_type + end + + # @api private + sig { returns(T::Boolean) } + protected def nilable? + end + + # @api private + sig do + params( + type_info: + T.any( + Privy::Internal::AnyHash, + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::Type::Converter::Input + ), + spec: Privy::Internal::AnyHash + ).void + end + def initialize(type_info, spec = {}) + end + + # @api private + sig { params(depth: Integer).returns(String) } + def inspect(depth: 0) + end + end + end + end +end diff --git a/rbi/privy/internal/type/request_parameters.rbi b/rbi/privy/internal/type/request_parameters.rbi new file mode 100644 index 0000000..95c659f --- /dev/null +++ b/rbi/privy/internal/type/request_parameters.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + module RequestParameters + # Options to specify HTTP behaviour for this request. + sig { returns(Privy::RequestOptions) } + attr_reader :request_options + + sig { params(request_options: Privy::RequestOptions::OrHash).void } + attr_writer :request_options + + # @api private + module Converter + # @api private + sig do + params(params: T.anything).returns( + [T.anything, Privy::Internal::AnyHash] + ) + end + def dump_request(params) + end + end + end + end + end +end diff --git a/rbi/privy/internal/type/union.rbi b/rbi/privy/internal/type/union.rbi new file mode 100644 index 0000000..504baba --- /dev/null +++ b/rbi/privy/internal/type/union.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + module Union + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + # @api private + # + # All of the specified variant info for this union. + sig do + returns( + T::Array[ + [ + T.nilable(Symbol), + T.proc.returns(Privy::Internal::Type::Converter::Input), + Privy::Internal::AnyHash + ] + ] + ) + end + private def known_variants + end + + # @api private + sig do + returns( + T::Array[[T.nilable(Symbol), T.anything, Privy::Internal::AnyHash]] + ) + end + protected def derefed_variants + end + + # All of the specified variants for this union. + sig { overridable.returns(T::Array[T.anything]) } + def variants + end + + # @api private + sig { params(property: Symbol).void } + private def discriminator(property) + end + + # @api private + sig do + params( + key: + T.any( + Symbol, + Privy::Internal::AnyHash, + T.proc.returns(T.anything), + T.anything + ), + spec: + T.any( + Privy::Internal::AnyHash, + T.proc.returns(T.anything), + T.anything + ) + ).void + end + private def variant(key, spec = nil) + end + + # @api private + sig { params(value: T.anything).returns(T.nilable(T.anything)) } + private def resolve_variant(value) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def ==(other) + end + + sig { returns(Integer) } + def hash + end + + # @api private + # + # Tries to efficiently coerce the given value to one of the known variants. + # + # If the value cannot match any of the known variants, the coercion is considered + # non-viable and returns the original value. + sig do + override + .params( + value: T.anything, + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.anything, + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.anything) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + + # @api private + sig { params(depth: Integer).returns(String) } + def inspect(depth: 0) + end + end + end + end +end diff --git a/rbi/privy/internal/type/unknown.rbi b/rbi/privy/internal/type/unknown.rbi new file mode 100644 index 0000000..14dac57 --- /dev/null +++ b/rbi/privy/internal/type/unknown.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Internal + module Type + # @api private + # + # When we don't know what to expect for the value. + class Unknown + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + abstract! + + sig { params(other: T.anything).returns(T::Boolean) } + def self.===(other) + end + + sig { params(other: T.anything).returns(T::Boolean) } + def self.==(other) + end + + class << self + # @api private + # + # No coercion needed for Unknown type. + sig do + override + .params( + value: T.anything, + state: Privy::Internal::Type::Converter::CoerceState + ) + .returns(T.anything) + end + def coerce(value, state:) + end + + # @api private + sig do + override + .params( + value: T.anything, + state: Privy::Internal::Type::Converter::DumpState + ) + .returns(T.anything) + end + def dump(value, state:) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + end + end + end + end +end diff --git a/rbi/privy/internal/util.rbi b/rbi/privy/internal/util.rbi new file mode 100644 index 0000000..2e1db6b --- /dev/null +++ b/rbi/privy/internal/util.rbi @@ -0,0 +1,506 @@ +# typed: strong + +module Privy + module Internal + # @api private + module Util + extend Privy::Internal::Util::SorbetRuntimeSupport + + # @api private + sig { returns(Float) } + def self.monotonic_secs + end + + # @api private + sig do + params(ns: T.any(Module, T::Class[T.anything])).returns( + T::Enumerable[T.any(Module, T::Class[T.anything])] + ) + end + def self.walk_namespaces(ns) + end + + class << self + # @api private + sig { returns(String) } + def arch + end + + # @api private + sig { returns(String) } + def os + end + end + + class << self + # @api private + sig { params(input: T.anything).returns(T::Boolean) } + def primitive?(input) + end + + # @api private + sig do + params(input: T.any(String, T::Boolean)).returns( + T.any(T::Boolean, T.anything) + ) + end + def coerce_boolean(input) + end + + # @api private + sig do + params(input: T.any(String, T::Boolean)).returns( + T.nilable(T::Boolean) + ) + end + def coerce_boolean!(input) + end + + # @api private + sig do + params(input: T.any(String, Integer)).returns( + T.any(Integer, T.anything) + ) + end + def coerce_integer(input) + end + + # @api private + sig do + params(input: T.any(String, Integer, Float)).returns( + T.any(Float, T.anything) + ) + end + def coerce_float(input) + end + + # @api private + sig do + params(input: T.anything).returns( + T.any(T::Hash[T.anything, T.anything], T.anything) + ) + end + def coerce_hash(input) + end + + # @api private + sig do + params(input: T.anything).returns( + T.nilable(T::Hash[T.anything, T.anything]) + ) + end + def coerce_hash!(input) + end + end + + class << self + # @api private + sig do + params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns( + T.anything + ) + end + private def deep_merge_lr(lhs, rhs, concat: false) + end + + # @api private + # + # Recursively merge one hash with another. If the values at a given key are not + # both hashes, just take the new value. + sig do + params( + values: T::Array[T.anything], + sentinel: T.nilable(T.anything), + concat: T::Boolean + ).returns(T.anything) + end + def deep_merge( + *values, + # the value to return if no values are provided. + sentinel: nil, + # whether to merge sequences by concatenation. + concat: false + ) + end + + # @api private + sig do + params( + data: + T.any(Privy::Internal::AnyHash, T::Array[T.anything], T.anything), + pick: + T.nilable( + T.any( + Symbol, + Integer, + T::Array[T.any(Symbol, Integer)], + T.proc.params(arg0: T.anything).returns(T.anything) + ) + ), + blk: T.nilable(T.proc.returns(T.anything)) + ).returns(T.nilable(T.anything)) + end + def dig(data, pick, &blk) + end + end + + # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 + RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp) + + class << self + # @api private + sig { params(uri: URI::Generic).returns(String) } + def uri_origin(uri) + end + + # @api private + sig { params(path: T.any(String, Integer)).returns(String) } + def encode_path(path) + end + + # @api private + sig { params(path: T.any(String, T::Array[String])).returns(String) } + def interpolate_path(path) + end + end + + class << self + # @api private + sig do + params(query: T.nilable(String)).returns( + T::Hash[String, T::Array[String]] + ) + end + def decode_query(query) + end + + # @api private + sig do + params( + query: + T.nilable( + T::Hash[String, T.nilable(T.any(T::Array[String], String))] + ) + ).returns(T.nilable(String)) + end + def encode_query(query) + end + end + + ParsedUri = + T.type_alias do + { + scheme: T.nilable(String), + host: T.nilable(String), + port: T.nilable(Integer), + path: T.nilable(String), + query: T::Hash[String, T::Array[String]] + } + end + + class << self + # @api private + sig do + params(url: T.any(URI::Generic, String)).returns( + Privy::Internal::Util::ParsedUri + ) + end + def parse_uri(url) + end + + # @api private + sig do + params(parsed: Privy::Internal::Util::ParsedUri).returns(URI::Generic) + end + def unparse_uri(parsed) + end + + # @api private + sig do + params( + lhs: Privy::Internal::Util::ParsedUri, + rhs: Privy::Internal::Util::ParsedUri + ).returns(URI::Generic) + end + def join_parsed_uri(lhs, rhs) + end + end + + class << self + # @api private + sig do + params( + headers: + T::Hash[ + String, + T.nilable( + T.any( + String, + Integer, + T::Array[T.nilable(T.any(String, Integer))] + ) + ) + ] + ).returns(T::Hash[String, String]) + end + def normalized_headers(*headers) + end + end + + # @api private + # + # An adapter that satisfies the IO interface required by `::IO.copy_stream` + class ReadIOAdapter + # @api private + sig { returns(T.nilable(T::Boolean)) } + def close? + end + + # @api private + sig { void } + def close + end + + # @api private + sig { params(max_len: T.nilable(Integer)).returns(String) } + private def read_enum(max_len) + end + + # @api private + sig do + params( + max_len: T.nilable(Integer), + out_string: T.nilable(String) + ).returns(T.nilable(String)) + end + def read(max_len = nil, out_string = nil) + end + + # @api private + sig do + params( + src: T.any(String, Pathname, StringIO, T::Enumerable[String]), + blk: T.proc.params(arg0: String).void + ).returns(T.attached_class) + end + def self.new(src, &blk) + end + end + + class << self + sig do + params(blk: T.proc.params(y: Enumerator::Yielder).void).returns( + T::Enumerable[String] + ) + end + def writable_enum(&blk) + end + end + + JSON_CONTENT = + T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp) + JSONL_CONTENT = + T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp) + + class << self + # @api private + sig do + params(query: Privy::Internal::AnyHash).returns( + Privy::Internal::AnyHash + ) + end + def encode_query_params(query) + end + + # @api private + sig do + params( + collection: Privy::Internal::AnyHash, + key: String, + element: T.anything + ).void + end + private def write_query_param_element!(collection, key, element) + end + + # @api private + sig do + params( + y: Enumerator::Yielder, + val: T.anything, + closing: T::Array[T.proc.void], + content_type: T.nilable(String) + ).void + end + private def write_multipart_content( + y, + val:, + closing:, + content_type: nil + ) + end + + # @api private + sig do + params( + y: Enumerator::Yielder, + boundary: String, + key: T.any(Symbol, String), + val: T.anything, + closing: T::Array[T.proc.void] + ).void + end + private def write_multipart_chunk(y, boundary:, key:, val:, closing:) + end + + # @api private + # + # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content + sig do + params(body: T.anything).returns([String, T::Enumerable[String]]) + end + private def encode_multipart_streaming(body) + end + + # @api private + sig do + params(headers: T::Hash[String, String], body: T.anything).returns( + T.anything + ) + end + def encode_content(headers, body) + end + + # @api private + # + # https://www.iana.org/assignments/character-sets/character-sets.xhtml + sig { params(content_type: String, text: String).void } + def force_charset!(content_type, text:) + end + + # @api private + # + # Assumes each chunk in stream has `Encoding::BINARY`. + sig do + params( + headers: T::Hash[String, String], + stream: T::Enumerable[String], + suppress_error: T::Boolean + ).returns(T.anything) + end + def decode_content(headers, stream:, suppress_error: false) + end + end + + class << self + # @api private + # + # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html + sig do + params( + enum: T::Enumerable[T.anything], + external: T::Boolean, + close: T.proc.void + ).returns(T::Enumerable[T.anything]) + end + def fused_enum(enum, external: false, &close) + end + + # @api private + sig { params(enum: T.nilable(T::Enumerable[T.anything])).void } + def close_fused!(enum) + end + + # @api private + sig do + params( + enum: T.nilable(T::Enumerable[T.anything]), + blk: T.proc.params(arg0: Enumerator::Yielder).void + ).returns(T::Enumerable[T.anything]) + end + def chain_fused(enum, &blk) + end + end + + ServerSentEvent = + T.type_alias do + { + event: T.nilable(String), + data: T.nilable(String), + id: T.nilable(String), + retry: T.nilable(Integer) + } + end + + class << self + # @api private + # + # Assumes Strings have been forced into having `Encoding::BINARY`. + # + # This decoder is responsible for reassembling lines split across multiple + # fragments. + sig do + params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) + end + def decode_lines(enum) + end + + # @api private + # + # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream + # + # Assumes that `lines` has been decoded with `#decode_lines`. + sig do + params(lines: T::Enumerable[String]).returns( + T::Enumerable[Privy::Internal::Util::ServerSentEvent] + ) + end + def decode_sse(lines) + end + end + + # @api private + module SorbetRuntimeSupport + class MissingSorbetRuntimeError < ::RuntimeError + end + + # @api private + sig { returns(T::Hash[Symbol, T.anything]) } + private def sorbet_runtime_constants + end + + # @api private + sig { params(name: Symbol).void } + def const_missing(name) + end + + # @api private + sig { params(name: Symbol).returns(T::Boolean) } + def sorbet_constant_defined?(name) + end + + # @api private + sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void } + def define_sorbet_constant!(name, &blk) + end + + # @api private + sig { returns(T.anything) } + def to_sorbet_type + end + + class << self + # @api private + sig do + params( + type: + T.any(Privy::Internal::Util::SorbetRuntimeSupport, T.anything) + ).returns(T.anything) + end + def to_sorbet_type(type) + end + end + end + end + end +end diff --git a/rbi/privy/models.rbi b/rbi/privy/models.rbi new file mode 100644 index 0000000..8a91c87 --- /dev/null +++ b/rbi/privy/models.rbi @@ -0,0 +1,1894 @@ +# typed: strong + +module Privy + AbiParameter = Privy::Models::AbiParameter + + AbiSchema = T.let(Privy::Models::AbiSchema, Privy::Internal::Type::Converter) + + AbiSchemaItem = Privy::Models::AbiSchemaItem + + AccountBalanceParams = Privy::Models::AccountBalanceParams + + AccountBalanceResponse = Privy::Models::AccountBalanceResponse + + AccountDisplayName = Privy::Models::AccountDisplayName + + AccountResponse = Privy::Models::AccountResponse + + AccountsDashboardListResponse = Privy::Models::AccountsDashboardListResponse + + AccountsListResponse = Privy::Models::AccountsListResponse + + AccountWallet = Privy::Models::AccountWallet + + AccountWalletConfigurationItem = Privy::Models::AccountWalletConfigurationItem + + AccountWalletIDs = + T.let(Privy::Models::AccountWalletIDs, Privy::Internal::Type::Converter) + + AccountWalletsConfiguration = + T.let( + Privy::Models::AccountWalletsConfiguration, + Privy::Internal::Type::Converter + ) + + ActionRequestBodyCondition = Privy::Models::ActionRequestBodyCondition + + AdditionalSignerInput = + T.let( + Privy::Models::AdditionalSignerInput, + Privy::Internal::Type::Converter + ) + + AdditionalSignerItemInput = Privy::Models::AdditionalSignerItemInput + + Address = Privy::Models::Address + + Aggregation = Privy::Models::Aggregation + + AggregationCondition = Privy::Models::AggregationCondition + + AggregationGroupBy = Privy::Models::AggregationGroupBy + + AggregationInput = Privy::Models::AggregationInput + + AggregationMethod = Privy::Models::AggregationMethod + + AggregationMetric = Privy::Models::AggregationMetric + + AggregationWindow = Privy::Models::AggregationWindow + + AlchemyPaymasterContext = Privy::Models::AlchemyPaymasterContext + + AllowlistDeletionResponse = Privy::Models::AllowlistDeletionResponse + + AllowlistEntry = Privy::Models::AllowlistEntry + + AmountType = Privy::Models::AmountType + + AnalyticsEventInput = Privy::Models::AnalyticsEventInput + + AppGetGasSpendParams = Privy::Models::AppGetGasSpendParams + + AppGetParams = Privy::Models::AppGetParams + + AppGetTestCredentialsParams = Privy::Models::AppGetTestCredentialsParams + + AppResponse = Privy::Models::AppResponse + + Apps = Privy::Models::Apps + + AssetAccountWithBalance = Privy::Models::AssetAccountWithBalance + + AuthenticatedUser = Privy::Models::AuthenticatedUser + + AuthenticateJwtInput = Privy::Models::AuthenticateJwtInput + + AuthenticateMode = Privy::Models::AuthenticateMode + + AuthenticateModeOption = Privy::Models::AuthenticateModeOption + + AuthenticateSiweInput = Privy::Models::AuthenticateSiweInput + + AuthenticateSiwsInput = Privy::Models::AuthenticateSiwsInput + + AuthorizationKeyDashboardResponse = + Privy::Models::AuthorizationKeyDashboardResponse + + AuthorizationKeyResponse = Privy::Models::AuthorizationKeyResponse + + AuthorizationKeyRole = Privy::Models::AuthorizationKeyRole + + BalanceAsset = Privy::Models::BalanceAsset + + BalanceAssetByChain = Privy::Models::BalanceAssetByChain + + BalanceResponse = Privy::Models::BalanceResponse + + BaseActionResult = Privy::Models::BaseActionResult + + BaseIntentResponse = Privy::Models::BaseIntentResponse + + BridgeBrlFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions + + BridgeCryptoDepositMetadata = Privy::Models::BridgeCryptoDepositMetadata + + BridgeCryptoTransferMetadata = Privy::Models::BridgeCryptoTransferMetadata + + BridgeDestinationAsset = Privy::Models::BridgeDestinationAsset + + BridgeEurFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions + + BridgeFiatCustomerResponse = Privy::Models::BridgeFiatCustomerResponse + + BridgeFiatDepositMetadata = Privy::Models::BridgeFiatDepositMetadata + + BridgeFiatRejectionReason = Privy::Models::BridgeFiatRejectionReason + + BridgeFiatTransferMetadata = Privy::Models::BridgeFiatTransferMetadata + + BridgeFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeFiatVirtualAccountDepositInstructions + + BridgeFiatVirtualAccountDestination = + Privy::Models::BridgeFiatVirtualAccountDestination + + BridgeFiatVirtualAccountRequest = + Privy::Models::BridgeFiatVirtualAccountRequest + + BridgeFiatVirtualAccountResponse = + Privy::Models::BridgeFiatVirtualAccountResponse + + BridgeFiatVirtualAccountSource = Privy::Models::BridgeFiatVirtualAccountSource + + BridgeGbpFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions + + BridgeMetadata = Privy::Models::BridgeMetadata + + BridgeMxnFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions + + BridgeOnrampProvider = Privy::Models::BridgeOnrampProvider + + BridgeRefundMetadata = Privy::Models::BridgeRefundMetadata + + BridgeSandboxFiatCustomerResponse = + Privy::Models::BridgeSandboxFiatCustomerResponse + + BridgeSandboxFiatVirtualAccountRequest = + Privy::Models::BridgeSandboxFiatVirtualAccountRequest + + BridgeSandboxFiatVirtualAccountResponse = + Privy::Models::BridgeSandboxFiatVirtualAccountResponse + + BridgeSourceAsset = Privy::Models::BridgeSourceAsset + + BridgeStaticMemoDepositMetadata = + Privy::Models::BridgeStaticMemoDepositMetadata + + BridgeTransferRefundMetadata = Privy::Models::BridgeTransferRefundMetadata + + BridgeUsdFiatVirtualAccountDepositInstructions = + Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions + + Caip2 = Privy::Models::Caip2 + + Caip2ChainID = Privy::Models::Caip2ChainID + + CoinbaseBlockchain = Privy::Models::CoinbaseBlockchain + + CoinbaseEthereumAsset = Privy::Models::CoinbaseEthereumAsset + + CoinbaseOnRampEthereumAddress = Privy::Models::CoinbaseOnRampEthereumAddress + + CoinbaseOnRampInitEthereumInput = + Privy::Models::CoinbaseOnRampInitEthereumInput + + CoinbaseOnRampInitInput = Privy::Models::CoinbaseOnRampInitInput + + CoinbaseOnRampInitResponse = Privy::Models::CoinbaseOnRampInitResponse + + CoinbaseOnRampInitSolanaInput = Privy::Models::CoinbaseOnRampInitSolanaInput + + CoinbaseOnRampSolanaAddress = Privy::Models::CoinbaseOnRampSolanaAddress + + CoinbaseOnRampStatus = Privy::Models::CoinbaseOnRampStatus + + CoinbaseOnRampStatusResponse = Privy::Models::CoinbaseOnRampStatusResponse + + CoinbaseSolanaAsset = Privy::Models::CoinbaseSolanaAsset + + ConditionOperator = Privy::Models::ConditionOperator + + ConditionSet = Privy::Models::ConditionSet + + ConditionSetAuthorizationHeaders = + Privy::Models::ConditionSetAuthorizationHeaders + + ConditionSetItem = Privy::Models::ConditionSetItem + + ConditionSetItemRequestParams = Privy::Models::ConditionSetItemRequestParams + + ConditionSetItems = + T.let(Privy::Models::ConditionSetItems, Privy::Internal::Type::Converter) + + ConditionSetItemsRequestBody = + T.let( + Privy::Models::ConditionSetItemsRequestBody, + Privy::Internal::Type::Converter + ) + + ConditionSetItemsResponse = Privy::Models::ConditionSetItemsResponse + + ConditionSetItemValueInput = Privy::Models::ConditionSetItemValueInput + + ConditionSetRequestBody = Privy::Models::ConditionSetRequestBody + + ConditionSetRequestParams = Privy::Models::ConditionSetRequestParams + + ConditionValue = Privy::Models::ConditionValue + + CreateAccountFromWalletIDsInput = + Privy::Models::CreateAccountFromWalletIDsInput + + CreateAccountFromWalletsConfigurationInput = + Privy::Models::CreateAccountFromWalletsConfigurationInput + + CreateAccountInput = Privy::Models::CreateAccountInput + + CreateOrganizationSecretResponse = + Privy::Models::CreateOrganizationSecretResponse + + CreateOrUpdateFiatCustomerRequestInput = + Privy::Models::CreateOrUpdateFiatCustomerRequestInput + + CrossAppConnection = Privy::Models::CrossAppConnection + + CrossAppConnectionsResponse = Privy::Models::CrossAppConnectionsResponse + + CrossAppEmbeddedWallet = Privy::Models::CrossAppEmbeddedWallet + + CrossAppSmartWallet = Privy::Models::CrossAppSmartWallet + + CryptoCurrencyCode = Privy::Models::CryptoCurrencyCode + + Currency = Privy::Models::Currency + + CurrencyAmount = Privy::Models::CurrencyAmount + + CurrencyAsset = Privy::Models::CurrencyAsset + + CurveSigningChainType = Privy::Models::CurveSigningChainType + + CurveType = Privy::Models::CurveType + + CustodialWallet = Privy::Models::CustodialWallet + + CustodialWalletChainType = Privy::Models::CustodialWalletChainType + + CustodialWalletCreateInput = Privy::Models::CustodialWalletCreateInput + + CustodialWalletProvider = Privy::Models::CustodialWalletProvider + + CustomJwtAuthenticateRequestBody = + Privy::Models::CustomJwtAuthenticateRequestBody + + CustomJwtLinkRequestBody = Privy::Models::CustomJwtLinkRequestBody + + CustomMetadata = + T.let(Privy::Models::CustomMetadata, Privy::Internal::Type::Converter) + + CustomMetadataItem = Privy::Models::CustomMetadataItem + + CustomOAuthProviderID = Privy::Models::CustomOAuthProviderID + + CustomTokenTransferSource = Privy::Models::CustomTokenTransferSource + + EarnAsset = Privy::Models::EarnAsset + + EarnDepositActionResponse = Privy::Models::EarnDepositActionResponse + + EarnDepositRequestBody = Privy::Models::EarnDepositRequestBody + + EarnIncentiveClaimActionResponse = + Privy::Models::EarnIncentiveClaimActionResponse + + EarnIncentiveClaimRequestBody = Privy::Models::EarnIncentiveClaimRequestBody + + EarnIncetiveClaimRewardEntry = Privy::Models::EarnIncetiveClaimRewardEntry + + EarnWithdrawActionResponse = Privy::Models::EarnWithdrawActionResponse + + EarnWithdrawRequestBody = Privy::Models::EarnWithdrawRequestBody + + EmailDomain = Privy::Models::EmailDomain + + EmailDomainInviteInput = Privy::Models::EmailDomainInviteInput + + EmailInviteInput = Privy::Models::EmailInviteInput + + EmbeddedWalletChainConfig = Privy::Models::EmbeddedWalletChainConfig + + EmbeddedWalletConfigSchema = Privy::Models::EmbeddedWalletConfigSchema + + EmbeddedWalletCreateOnLogin = Privy::Models::EmbeddedWalletCreateOnLogin + + EmbeddedWalletCreationInput = Privy::Models::EmbeddedWalletCreationInput + + EmbeddedWalletInputSchema = Privy::Models::EmbeddedWalletInputSchema + + EmbeddedWalletMode = Privy::Models::EmbeddedWalletMode + + EmbeddedWalletRecoveryMethod = Privy::Models::EmbeddedWalletRecoveryMethod + + Ethereum7702AuthorizationCondition = + Privy::Models::Ethereum7702AuthorizationCondition + + EthereumCalldataCondition = Privy::Models::EthereumCalldataCondition + + EthereumEarnPositionQuery = Privy::Models::EthereumEarnPositionQuery + + EthereumEarnPositionResponse = Privy::Models::EthereumEarnPositionResponse + + EthereumEarnProvider = Privy::Models::EthereumEarnProvider + + EthereumEarnVaultDetailsResponse = + Privy::Models::EthereumEarnVaultDetailsResponse + + EthereumPersonalSignRpcInput = Privy::Models::EthereumPersonalSignRpcInput + + EthereumPersonalSignRpcInputParams = + Privy::Models::EthereumPersonalSignRpcInputParams + + EthereumPersonalSignRpcResponse = + Privy::Models::EthereumPersonalSignRpcResponse + + EthereumPersonalSignRpcResponseData = + Privy::Models::EthereumPersonalSignRpcResponseData + + EthereumRpcInput = Privy::Models::EthereumRpcInput + + EthereumRpcResponse = Privy::Models::EthereumRpcResponse + + EthereumSecp256k1SignRpcInput = Privy::Models::EthereumSecp256k1SignRpcInput + + EthereumSecp256k1SignRpcInputParams = + Privy::Models::EthereumSecp256k1SignRpcInputParams + + EthereumSecp256k1SignRpcResponse = + Privy::Models::EthereumSecp256k1SignRpcResponse + + EthereumSecp256k1SignRpcResponseData = + Privy::Models::EthereumSecp256k1SignRpcResponseData + + EthereumSendCallsCall = Privy::Models::EthereumSendCallsCall + + EthereumSendCallsRpcInput = Privy::Models::EthereumSendCallsRpcInput + + EthereumSendCallsRpcInputParams = + Privy::Models::EthereumSendCallsRpcInputParams + + EthereumSendCallsRpcResponse = Privy::Models::EthereumSendCallsRpcResponse + + EthereumSendCallsRpcResponseData = + Privy::Models::EthereumSendCallsRpcResponseData + + EthereumSendTransactionRpcInput = + Privy::Models::EthereumSendTransactionRpcInput + + EthereumSendTransactionRpcInputParams = + Privy::Models::EthereumSendTransactionRpcInputParams + + EthereumSendTransactionRpcResponse = + Privy::Models::EthereumSendTransactionRpcResponse + + EthereumSendTransactionRpcResponseData = + Privy::Models::EthereumSendTransactionRpcResponseData + + EthereumSign7702Authorization = Privy::Models::EthereumSign7702Authorization + + EthereumSign7702AuthorizationRpcInput = + Privy::Models::EthereumSign7702AuthorizationRpcInput + + EthereumSign7702AuthorizationRpcInputParams = + Privy::Models::EthereumSign7702AuthorizationRpcInputParams + + EthereumSign7702AuthorizationRpcResponse = + Privy::Models::EthereumSign7702AuthorizationRpcResponse + + EthereumSign7702AuthorizationRpcResponseData = + Privy::Models::EthereumSign7702AuthorizationRpcResponseData + + EthereumSignTransactionRpcInput = + Privy::Models::EthereumSignTransactionRpcInput + + EthereumSignTransactionRpcInputParams = + Privy::Models::EthereumSignTransactionRpcInputParams + + EthereumSignTransactionRpcResponse = + Privy::Models::EthereumSignTransactionRpcResponse + + EthereumSignTransactionRpcResponseData = + Privy::Models::EthereumSignTransactionRpcResponseData + + EthereumSignTypedDataRpcInput = Privy::Models::EthereumSignTypedDataRpcInput + + EthereumSignTypedDataRpcInputParams = + Privy::Models::EthereumSignTypedDataRpcInputParams + + EthereumSignTypedDataRpcResponse = + Privy::Models::EthereumSignTypedDataRpcResponse + + EthereumSignTypedDataRpcResponseData = + Privy::Models::EthereumSignTypedDataRpcResponseData + + EthereumSignUserOperationRpcInput = + Privy::Models::EthereumSignUserOperationRpcInput + + EthereumSignUserOperationRpcInputParams = + Privy::Models::EthereumSignUserOperationRpcInputParams + + EthereumSignUserOperationRpcResponse = + Privy::Models::EthereumSignUserOperationRpcResponse + + EthereumSignUserOperationRpcResponseData = + Privy::Models::EthereumSignUserOperationRpcResponseData + + EthereumTransactionCondition = Privy::Models::EthereumTransactionCondition + + EthereumTypedDataDomainCondition = + Privy::Models::EthereumTypedDataDomainCondition + + EthereumTypedDataInput = Privy::Models::EthereumTypedDataInput + + EthereumTypedDataMessageCondition = + Privy::Models::EthereumTypedDataMessageCondition + + EthereumVaultDetailsInput = Privy::Models::EthereumVaultDetailsInput + + EthereumVaultDetailsResponse = Privy::Models::EthereumVaultDetailsResponse + + EthereumVaultPosition = Privy::Models::EthereumVaultPosition + + EthereumVaultResponse = Privy::Models::EthereumVaultResponse + + EthereumYieldClaimIDInput = Privy::Models::EthereumYieldClaimIDInput + + EthereumYieldClaimInput = Privy::Models::EthereumYieldClaimInput + + EthereumYieldClaimResponse = Privy::Models::EthereumYieldClaimResponse + + EthereumYieldClaimReward = Privy::Models::EthereumYieldClaimReward + + EthereumYieldDepositInput = Privy::Models::EthereumYieldDepositInput + + EthereumYieldPositionResponse = Privy::Models::EthereumYieldPositionResponse + + EthereumYieldPositionsInput = Privy::Models::EthereumYieldPositionsInput + + EthereumYieldProvider = Privy::Models::EthereumYieldProvider + + EthereumYieldSweepIDInput = Privy::Models::EthereumYieldSweepIDInput + + EthereumYieldSweepResponse = Privy::Models::EthereumYieldSweepResponse + + EthereumYieldSweepStatus = Privy::Models::EthereumYieldSweepStatus + + EthereumYieldSweepType = Privy::Models::EthereumYieldSweepType + + EthereumYieldWithdrawInput = Privy::Models::EthereumYieldWithdrawInput + + EvmCaip2ChainID = Privy::Models::EvmCaip2ChainID + + EvmTransactionWalletActionStep = Privy::Models::EvmTransactionWalletActionStep + + EvmUserOperationWalletActionStep = + Privy::Models::EvmUserOperationWalletActionStep + + EvmWalletActionStepStatus = Privy::Models::EvmWalletActionStepStatus + + ExportPrivateKeyRpcInput = Privy::Models::ExportPrivateKeyRpcInput + + ExportPrivateKeyRpcResponse = Privy::Models::ExportPrivateKeyRpcResponse + + ExportSeedPhraseRpcInput = Privy::Models::ExportSeedPhraseRpcInput + + ExportSeedPhraseRpcResponse = Privy::Models::ExportSeedPhraseRpcResponse + + ExportType = Privy::Models::ExportType + + ExtendedChainType = Privy::Models::ExtendedChainType + + ExternalOAuthProviderID = Privy::Models::ExternalOAuthProviderID + + ExternalTransactionWalletActionStep = + Privy::Models::ExternalTransactionWalletActionStep + + ExternalTransactionWalletActionStepStatus = + Privy::Models::ExternalTransactionWalletActionStepStatus + + FailureReason = Privy::Models::FailureReason + + FarcasterAuthenticateInput = Privy::Models::FarcasterAuthenticateInput + + FarcasterAuthenticateRequestBody = + Privy::Models::FarcasterAuthenticateRequestBody + + FarcasterConnectInitResponse = Privy::Models::FarcasterConnectInitResponse + + FarcasterConnectInitResponseBody = + Privy::Models::FarcasterConnectInitResponseBody + + FarcasterConnectStatusCompletedResponse = + Privy::Models::FarcasterConnectStatusCompletedResponse + + FarcasterConnectStatusCompletedResponseBody = + Privy::Models::FarcasterConnectStatusCompletedResponseBody + + FarcasterConnectStatusPendingResponse = + Privy::Models::FarcasterConnectStatusPendingResponse + + FarcasterConnectStatusPendingResponseBody = + Privy::Models::FarcasterConnectStatusPendingResponseBody + + FarcasterInitInput = Privy::Models::FarcasterInitInput + + FarcasterInitRequestBody = Privy::Models::FarcasterInitRequestBody + + FarcasterLinkInput = Privy::Models::FarcasterLinkInput + + FarcasterLinkRequestBody = Privy::Models::FarcasterLinkRequestBody + + FarcasterSignerApproved = Privy::Models::FarcasterSignerApproved + + FarcasterSignerInitPendingApproval = + Privy::Models::FarcasterSignerInitPendingApproval + + FarcasterSignerInitRequestBody = Privy::Models::FarcasterSignerInitRequestBody + + FarcasterSignerInitResponseBody = + Privy::Models::FarcasterSignerInitResponseBody + + FarcasterSignerRevoked = Privy::Models::FarcasterSignerRevoked + + FarcasterSignerStatusPendingApproval = + Privy::Models::FarcasterSignerStatusPendingApproval + + FarcasterSignerStatusResponseBody = + Privy::Models::FarcasterSignerStatusResponseBody + + FarcasterUnlinkInput = Privy::Models::FarcasterUnlinkInput + + FarcasterUnlinkRequestBody = Privy::Models::FarcasterUnlinkRequestBody + + FarcasterV2AuthenticateInput = Privy::Models::FarcasterV2AuthenticateInput + + FarcasterV2AuthenticateRequestBody = + Privy::Models::FarcasterV2AuthenticateRequestBody + + FarcasterV2InitInput = Privy::Models::FarcasterV2InitInput + + FarcasterV2InitRequestBody = Privy::Models::FarcasterV2InitRequestBody + + FarcasterV2InitResponse = Privy::Models::FarcasterV2InitResponse + + FarcasterV2InitResponseBody = Privy::Models::FarcasterV2InitResponseBody + + FiatAmount = Privy::Models::FiatAmount + + FiatCurrencyCode = Privy::Models::FiatCurrencyCode + + FiatCustomerResponse = Privy::Models::FiatCustomerResponse + + FiatOnrampDestination = Privy::Models::FiatOnrampDestination + + FiatOnrampEnvironment = Privy::Models::FiatOnrampEnvironment + + FiatOnrampProvider = Privy::Models::FiatOnrampProvider + + FiatOnrampProviderError = Privy::Models::FiatOnrampProviderError + + FiatOnrampQuote = Privy::Models::FiatOnrampQuote + + FiatOnrampSource = Privy::Models::FiatOnrampSource + + FiatOnrampTransactionStatus = Privy::Models::FiatOnrampTransactionStatus + + FiatVirtualAccountRequest = Privy::Models::FiatVirtualAccountRequest + + FiatVirtualAccountResponse = Privy::Models::FiatVirtualAccountResponse + + FirstClassChainType = Privy::Models::FirstClassChainType + + FundingConfigResponseSchema = Privy::Models::FundingConfigResponseSchema + + FundingMethodEnum = Privy::Models::FundingMethodEnum + + FundingOption = Privy::Models::FundingOption + + FundsDepositedWebhookPayload = Privy::Models::FundsDepositedWebhookPayload + + FundsWithdrawnWebhookPayload = Privy::Models::FundsWithdrawnWebhookPayload + + GasSpendCurrency = Privy::Models::GasSpendCurrency + + GasSpendRequestBody = Privy::Models::GasSpendRequestBody + + GasSpendResponseBody = Privy::Models::GasSpendResponseBody + + GasSponsorshipConfiguration = Privy::Models::GasSponsorshipConfiguration + + GasSponsorshipConfigurationInput = + Privy::Models::GasSponsorshipConfigurationInput + + GetByWalletAddressRequestBody = Privy::Models::GetByWalletAddressRequestBody + + GetFiatCustomerRequestInput = Privy::Models::GetFiatCustomerRequestInput + + GetFiatOnrampQuotesInput = Privy::Models::GetFiatOnrampQuotesInput + + GetFiatOnrampQuotesResponse = Privy::Models::GetFiatOnrampQuotesResponse + + GetFiatOnrampTransactionStatusInput = + Privy::Models::GetFiatOnrampTransactionStatusInput + + GetFiatOnrampTransactionStatusResponse = + Privy::Models::GetFiatOnrampTransactionStatusResponse + + GetFiatOnrampURLInput = Privy::Models::GetFiatOnrampURLInput + + GetFiatOnrampURLResponse = Privy::Models::GetFiatOnrampURLResponse + + GuestAuthenticateRequestBody = Privy::Models::GuestAuthenticateRequestBody + + HDInitInput = Privy::Models::HDInitInput + + HDPath = Privy::Models::HDPath + + HDSubmitInput = Privy::Models::HDSubmitInput + + Hex = Privy::Models::Hex + + HpkeAeadAlgorithm = Privy::Models::HpkeAeadAlgorithm + + HpkeEncryption = Privy::Models::HpkeEncryption + + HpkeImportConfig = Privy::Models::HpkeImportConfig + + ICloudClientType = Privy::Models::ICloudClientType + + IntentAuthorization = Privy::Models::IntentAuthorization + + IntentAuthorizationKeyQuorumMember = + Privy::Models::IntentAuthorizationKeyQuorumMember + + IntentAuthorizationMember = Privy::Models::IntentAuthorizationMember + + IntentAuthorizedWebhookPayload = Privy::Models::IntentAuthorizedWebhookPayload + + IntentCreatedWebhookPayload = Privy::Models::IntentCreatedWebhookPayload + + IntentCreatePolicyRuleParams = Privy::Models::IntentCreatePolicyRuleParams + + IntentCreationHeaders = Privy::Models::IntentCreationHeaders + + IntentDeletePolicyRuleParams = Privy::Models::IntentDeletePolicyRuleParams + + IntentExecutedWebhookPayload = Privy::Models::IntentExecutedWebhookPayload + + IntentFailedWebhookPayload = Privy::Models::IntentFailedWebhookPayload + + IntentGetParams = Privy::Models::IntentGetParams + + IntentListParams = Privy::Models::IntentListParams + + IntentRejectedWebhookPayload = Privy::Models::IntentRejectedWebhookPayload + + IntentResponse = Privy::Models::IntentResponse + + IntentRpcParams = Privy::Models::IntentRpcParams + + IntentStatus = Privy::Models::IntentStatus + + IntentTransferParams = Privy::Models::IntentTransferParams + + IntentType = Privy::Models::IntentType + + IntentUpdateKeyQuorumParams = Privy::Models::IntentUpdateKeyQuorumParams + + IntentUpdatePolicyParams = Privy::Models::IntentUpdatePolicyParams + + IntentUpdatePolicyRuleParams = Privy::Models::IntentUpdatePolicyRuleParams + + IntentUpdateWalletParams = Privy::Models::IntentUpdateWalletParams + + KeyQuorum = Privy::Models::KeyQuorum + + KeyQuorumAuthorizationHeaders = Privy::Models::KeyQuorumAuthorizationHeaders + + KeyQuorumCreateParams = Privy::Models::KeyQuorumCreateParams + + KeyQuorumCreateRequestBody = Privy::Models::KeyQuorumCreateRequestBody + + KeyQuorumDeleteParams = Privy::Models::KeyQuorumDeleteParams + + KeyQuorumGetParams = Privy::Models::KeyQuorumGetParams + + KeyQuorumID = Privy::Models::KeyQuorumID + + KeyQuorumIntentResponse = Privy::Models::KeyQuorumIntentResponse + + KeyQuorumUpdateParams = Privy::Models::KeyQuorumUpdateParams + + KeyQuorumUpdateRequestBody = Privy::Models::KeyQuorumUpdateRequestBody + + KrakenEmbedCurrentDayPnl = Privy::Models::KrakenEmbedCurrentDayPnl + + KrakenEmbedGetAssetListQueryParamsSchema = + Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema + + KrakenEmbedGetPortfolioDetailsQueryParamsSchema = + Privy::Models::KrakenEmbedGetPortfolioDetailsQueryParamsSchema + + KrakenEmbedGetPortfolioSummaryQueryParams = + Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams + + KrakenEmbedGetPortfolioSummaryResponse = + Privy::Models::KrakenEmbedGetPortfolioSummaryResponse + + KrakenEmbedGetPortfolioTransactionsQueryParamsSchema = + Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema + + KrakenEmbedGetQuoteQueryParams = Privy::Models::KrakenEmbedGetQuoteQueryParams + + KrakenEmbedQuoteCancelledWebhookPayload = + Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload + + KrakenEmbedQuoteExecutedWebhookPayload = + Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload + + KrakenEmbedQuoteExecutionFailedWebhookPayload = + Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload + + KrakenEmbedUserClosedWebhookPayload = + Privy::Models::KrakenEmbedUserClosedWebhookPayload + + KrakenEmbedUserDisabledWebhookPayload = + Privy::Models::KrakenEmbedUserDisabledWebhookPayload + + KrakenEmbedUserVerifiedWebhookPayload = + Privy::Models::KrakenEmbedUserVerifiedWebhookPayload + + LinkedAccount = Privy::Models::LinkedAccount + + LinkedAccountAppleInput = Privy::Models::LinkedAccountAppleInput + + LinkedAccountAppleOAuth = Privy::Models::LinkedAccountAppleOAuth + + LinkedAccountAuthorizationKey = Privy::Models::LinkedAccountAuthorizationKey + + LinkedAccountBaseWallet = Privy::Models::LinkedAccountBaseWallet + + LinkedAccountBitcoinSegwitEmbeddedWallet = + Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet + + LinkedAccountBitcoinTaprootEmbeddedWallet = + Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet + + LinkedAccountCrossApp = Privy::Models::LinkedAccountCrossApp + + LinkedAccountCurveSigningEmbeddedWallet = + Privy::Models::LinkedAccountCurveSigningEmbeddedWallet + + LinkedAccountCustomJwt = Privy::Models::LinkedAccountCustomJwt + + LinkedAccountCustomJwtInput = Privy::Models::LinkedAccountCustomJwtInput + + LinkedAccountCustomOAuth = Privy::Models::LinkedAccountCustomOAuth + + LinkedAccountDiscordInput = Privy::Models::LinkedAccountDiscordInput + + LinkedAccountDiscordOAuth = Privy::Models::LinkedAccountDiscordOAuth + + LinkedAccountEmail = Privy::Models::LinkedAccountEmail + + LinkedAccountEmailInput = Privy::Models::LinkedAccountEmailInput + + LinkedAccountEmbeddedWallet = Privy::Models::LinkedAccountEmbeddedWallet + + LinkedAccountEmbeddedWalletWithID = + Privy::Models::LinkedAccountEmbeddedWalletWithID + + LinkedAccountEthereum = Privy::Models::LinkedAccountEthereum + + LinkedAccountEthereumEmbeddedWallet = + Privy::Models::LinkedAccountEthereumEmbeddedWallet + + LinkedAccountFarcaster = Privy::Models::LinkedAccountFarcaster + + LinkedAccountFarcasterInput = Privy::Models::LinkedAccountFarcasterInput + + LinkedAccountGitHubInput = Privy::Models::LinkedAccountGitHubInput + + LinkedAccountGitHubOAuth = Privy::Models::LinkedAccountGitHubOAuth + + LinkedAccountGoogleInput = Privy::Models::LinkedAccountGoogleInput + + LinkedAccountGoogleOAuth = Privy::Models::LinkedAccountGoogleOAuth + + LinkedAccountInput = Privy::Models::LinkedAccountInput + + LinkedAccountInstagramInput = Privy::Models::LinkedAccountInstagramInput + + LinkedAccountInstagramOAuth = Privy::Models::LinkedAccountInstagramOAuth + + LinkedAccountLineInput = Privy::Models::LinkedAccountLineInput + + LinkedAccountLineOAuth = Privy::Models::LinkedAccountLineOAuth + + LinkedAccountLinkedInInput = Privy::Models::LinkedAccountLinkedInInput + + LinkedAccountLinkedInOAuth = Privy::Models::LinkedAccountLinkedInOAuth + + LinkedAccountPasskey = Privy::Models::LinkedAccountPasskey + + LinkedAccountPasskeyInput = Privy::Models::LinkedAccountPasskeyInput + + LinkedAccountPhone = Privy::Models::LinkedAccountPhone + + LinkedAccountPhoneInput = Privy::Models::LinkedAccountPhoneInput + + LinkedAccountSmartWallet = Privy::Models::LinkedAccountSmartWallet + + LinkedAccountSolana = Privy::Models::LinkedAccountSolana + + LinkedAccountSolanaEmbeddedWallet = + Privy::Models::LinkedAccountSolanaEmbeddedWallet + + LinkedAccountSpotifyInput = Privy::Models::LinkedAccountSpotifyInput + + LinkedAccountSpotifyOAuth = Privy::Models::LinkedAccountSpotifyOAuth + + LinkedAccountTelegram = Privy::Models::LinkedAccountTelegram + + LinkedAccountTelegramInput = Privy::Models::LinkedAccountTelegramInput + + LinkedAccountTiktokInput = Privy::Models::LinkedAccountTiktokInput + + LinkedAccountTiktokOAuth = Privy::Models::LinkedAccountTiktokOAuth + + LinkedAccountTwitchInput = Privy::Models::LinkedAccountTwitchInput + + LinkedAccountTwitchOAuth = Privy::Models::LinkedAccountTwitchOAuth + + LinkedAccountTwitterInput = Privy::Models::LinkedAccountTwitterInput + + LinkedAccountTwitterOAuth = Privy::Models::LinkedAccountTwitterOAuth + + LinkedAccountType = Privy::Models::LinkedAccountType + + LinkedAccountWalletInput = Privy::Models::LinkedAccountWalletInput + + LinkedMfaMethod = Privy::Models::LinkedMfaMethod + + LinkJwtInput = Privy::Models::LinkJwtInput + + MfaDisabledWebhookPayload = Privy::Models::MfaDisabledWebhookPayload + + MfaEnabledWebhookPayload = Privy::Models::MfaEnabledWebhookPayload + + MfaPasskeyEnrollmentRequestBody = + Privy::Models::MfaPasskeyEnrollmentRequestBody + + MfaPasskeyInitRequestBody = Privy::Models::MfaPasskeyInitRequestBody + + MfaPasskeyInitResponseBody = Privy::Models::MfaPasskeyInitResponseBody + + MfaPasskeyVerifyRequestBody = Privy::Models::MfaPasskeyVerifyRequestBody + + MfaSMSEnrollRequestBody = Privy::Models::MfaSMSEnrollRequestBody + + MfaSMSInitEnrollInput = Privy::Models::MfaSMSInitEnrollInput + + MfaSMSInitRequestBody = Privy::Models::MfaSMSInitRequestBody + + MfaSMSInitVerifyInput = Privy::Models::MfaSMSInitVerifyInput + + MfaSMSVerifyRequestBody = Privy::Models::MfaSMSVerifyRequestBody + + MfaTotpInitResponseBody = Privy::Models::MfaTotpInitResponseBody + + MfaTotpInput = Privy::Models::MfaTotpInput + + MfaVerifyResponseBody = Privy::Models::MfaVerifyResponseBody + + MoonpayCurrencyCode = Privy::Models::MoonpayCurrencyCode + + MoonpayFiatOnRampEthereumConfig = + Privy::Models::MoonpayFiatOnRampEthereumConfig + + MoonpayFiatOnRampEthereumInput = Privy::Models::MoonpayFiatOnRampEthereumInput + + MoonpayFiatOnRampSolanaConfig = Privy::Models::MoonpayFiatOnRampSolanaConfig + + MoonpayFiatOnRampSolanaInput = Privy::Models::MoonpayFiatOnRampSolanaInput + + MoonpayOnRampSandboxConfig = Privy::Models::MoonpayOnRampSandboxConfig + + MoonpayOnRampSignInput = Privy::Models::MoonpayOnRampSignInput + + MoonpayOnRampSignResponse = Privy::Models::MoonpayOnRampSignResponse + + MoonpayPaymentMethod = Privy::Models::MoonpayPaymentMethod + + MoonpaySolanaCurrencyCode = Privy::Models::MoonpaySolanaCurrencyCode + + MoonpayUiConfig = Privy::Models::MoonpayUiConfig + + MoonpayUiTheme = Privy::Models::MoonpayUiTheme + + NamedTokenTransferSource = Privy::Models::NamedTokenTransferSource + + OAuthAuthenticateRecoveryResponse = + Privy::Models::OAuthAuthenticateRecoveryResponse + + OAuthAuthenticateRequestBody = Privy::Models::OAuthAuthenticateRequestBody + + OAuthAuthorizationCodeRequestBody = + Privy::Models::OAuthAuthorizationCodeRequestBody + + OAuthCallbackICloudExpoInput = Privy::Models::OAuthCallbackICloudExpoInput + + OAuthCodeType = Privy::Models::OAuthCodeType + + OAuthInitICloudRecoveryInput = Privy::Models::OAuthInitICloudRecoveryInput + + OAuthInitRecoveryInput = Privy::Models::OAuthInitRecoveryInput + + OAuthInitRequestBody = Privy::Models::OAuthInitRequestBody + + OAuthInitResponseBody = Privy::Models::OAuthInitResponseBody + + OAuthLinkRequestBody = Privy::Models::OAuthLinkRequestBody + + OAuthLinkResponseBody = Privy::Models::OAuthLinkResponseBody + + OAuthProviderID = Privy::Models::OAuthProviderID + + OAuthTokens = Privy::Models::OAuthTokens + + OAuthTransferRequestBody = Privy::Models::OAuthTransferRequestBody + + OAuthTransferUserInfo = Privy::Models::OAuthTransferUserInfo + + OAuthTransferUserInfoMeta = Privy::Models::OAuthTransferUserInfoMeta + + OAuthUnlinkRequestBody = Privy::Models::OAuthUnlinkRequestBody + + OAuthVerifyRequestBody = Privy::Models::OAuthVerifyRequestBody + + OAuthVerifyResponseBody = Privy::Models::OAuthVerifyResponseBody + + OnrampProvider = Privy::Models::OnrampProvider + + OptionalRefreshTokenInput = Privy::Models::OptionalRefreshTokenInput + + OrganizationSecretIDInput = Privy::Models::OrganizationSecretIDInput + + OrganizationSecretsListResponse = + Privy::Models::OrganizationSecretsListResponse + + OrganizationSecretView = Privy::Models::OrganizationSecretView + + OutputWithPreviousTransactionData = + Privy::Models::OutputWithPreviousTransactionData + + OwnerIDInput = Privy::Models::OwnerIDInput + + OwnerInput = Privy::Models::OwnerInput + + OwnerInputPublicKey = Privy::Models::OwnerInputPublicKey + + OwnerInputUser = Privy::Models::OwnerInputUser + + P256PublicKey = Privy::Models::P256PublicKey + + PasskeyAssertionResponse = Privy::Models::PasskeyAssertionResponse + + PasskeyAttestationResponse = Privy::Models::PasskeyAttestationResponse + + PasskeyAuthenticateInput = Privy::Models::PasskeyAuthenticateInput + + PasskeyAuthenticatorEnrollmentOptions = + Privy::Models::PasskeyAuthenticatorEnrollmentOptions + + PasskeyAuthenticatorEnrollmentResponse = + Privy::Models::PasskeyAuthenticatorEnrollmentResponse + + PasskeyAuthenticatorSelection = Privy::Models::PasskeyAuthenticatorSelection + + PasskeyAuthenticatorVerifyOptions = + Privy::Models::PasskeyAuthenticatorVerifyOptions + + PasskeyAuthenticatorVerifyResponse = + Privy::Models::PasskeyAuthenticatorVerifyResponse + + PasskeyClientExtensionResults = Privy::Models::PasskeyClientExtensionResults + + PasskeyCredentialDescriptor = Privy::Models::PasskeyCredentialDescriptor + + PasskeyCredPropsResult = Privy::Models::PasskeyCredPropsResult + + PasskeyEnrollmentExtensions = Privy::Models::PasskeyEnrollmentExtensions + + PasskeyInitInput = Privy::Models::PasskeyInitInput + + PasskeyLinkInput = Privy::Models::PasskeyLinkInput + + PasskeyMfaMethod = Privy::Models::PasskeyMfaMethod + + PasskeyPubKeyCredParam = Privy::Models::PasskeyPubKeyCredParam + + PasskeyRegisterInput = Privy::Models::PasskeyRegisterInput + + PasskeyRelyingParty = Privy::Models::PasskeyRelyingParty + + PasskeyUser = Privy::Models::PasskeyUser + + PasskeyVerifyExtensions = Privy::Models::PasskeyVerifyExtensions + + PasswordlessAuthenticateRequestBody = + Privy::Models::PasswordlessAuthenticateRequestBody + + PasswordlessInitRequestBody = Privy::Models::PasswordlessInitRequestBody + + PasswordlessLinkRequestBody = Privy::Models::PasswordlessLinkRequestBody + + PasswordlessSMSAuthenticateRequestBody = + Privy::Models::PasswordlessSMSAuthenticateRequestBody + + PasswordlessSMSInitRequestBody = Privy::Models::PasswordlessSMSInitRequestBody + + PasswordlessSMSLinkRequestBody = Privy::Models::PasswordlessSMSLinkRequestBody + + PasswordlessSMSTransferRequestBody = + Privy::Models::PasswordlessSMSTransferRequestBody + + PasswordlessSMSUnlinkRequestBody = + Privy::Models::PasswordlessSMSUnlinkRequestBody + + PasswordlessSMSUpdateRequestBody = + Privy::Models::PasswordlessSMSUpdateRequestBody + + PasswordlessTransferRequestBody = + Privy::Models::PasswordlessTransferRequestBody + + PasswordlessUnlinkRequestBody = Privy::Models::PasswordlessUnlinkRequestBody + + PasswordlessUpdateRequestBody = Privy::Models::PasswordlessUpdateRequestBody + + PatchUsersCustomMetadata = Privy::Models::PatchUsersCustomMetadata + + PhoneInviteInput = Privy::Models::PhoneInviteInput + + Policy = Privy::Models::Policy + + PolicyAction = Privy::Models::PolicyAction + + PolicyAuthorizationHeaders = Privy::Models::PolicyAuthorizationHeaders + + PolicyCondition = Privy::Models::PolicyCondition + + PolicyCreateParams = Privy::Models::PolicyCreateParams + + PolicyCreateRuleParams = Privy::Models::PolicyCreateRuleParams + + PolicyDeleteParams = Privy::Models::PolicyDeleteParams + + PolicyDeleteRuleParams = Privy::Models::PolicyDeleteRuleParams + + PolicyGetParams = Privy::Models::PolicyGetParams + + PolicyGetRuleParams = Privy::Models::PolicyGetRuleParams + + PolicyInput = + T.let(Privy::Models::PolicyInput, Privy::Internal::Type::Converter) + + PolicyIntentRequestDetails = Privy::Models::PolicyIntentRequestDetails + + PolicyIntentResponse = Privy::Models::PolicyIntentResponse + + PolicyMethod = Privy::Models::PolicyMethod + + PolicyRequestBody = Privy::Models::PolicyRequestBody + + PolicyRuleRequestBody = Privy::Models::PolicyRuleRequestBody + + PolicyRuleRequestParams = Privy::Models::PolicyRuleRequestParams + + PolicyRuleResponse = Privy::Models::PolicyRuleResponse + + PolicyUpdateParams = Privy::Models::PolicyUpdateParams + + PolicyUpdateRuleParams = Privy::Models::PolicyUpdateRuleParams + + PrivateKeyExportInput = Privy::Models::PrivateKeyExportInput + + PrivateKeyExportResponse = Privy::Models::PrivateKeyExportResponse + + PrivateKeyExportWebhookPayload = Privy::Models::PrivateKeyExportWebhookPayload + + PrivateKeyInitInput = Privy::Models::PrivateKeyInitInput + + PrivateKeySubmitInput = Privy::Models::PrivateKeySubmitInput + + PrivyOAuthProviderID = Privy::Models::PrivyOAuthProviderID + + Quantity = Privy::Models::Quantity + + RawSignBytesEncoding = Privy::Models::RawSignBytesEncoding + + RawSignBytesHashFunction = Privy::Models::RawSignBytesHashFunction + + RawSignBytesParams = Privy::Models::RawSignBytesParams + + RawSignHashParams = Privy::Models::RawSignHashParams + + RawSignInput = Privy::Models::RawSignInput + + RawSignInputParams = Privy::Models::RawSignInputParams + + RawSignResponse = Privy::Models::RawSignResponse + + RawSignResponseData = Privy::Models::RawSignResponseData + + RecipientPublicKey = Privy::Models::RecipientPublicKey + + RecoveryConfigurationICloudInput = + Privy::Models::RecoveryConfigurationICloudInput + + RecoveryConfigurationICloudResponse = + Privy::Models::RecoveryConfigurationICloudResponse + + RecoveryKeyMaterialInput = Privy::Models::RecoveryKeyMaterialInput + + RecoveryKeyMaterialResponse = Privy::Models::RecoveryKeyMaterialResponse + + RecoveryType = Privy::Models::RecoveryType + + ResponsePasskeyInitAuthenticate = + Privy::Models::ResponsePasskeyInitAuthenticate + + ResponsePasskeyInitLink = Privy::Models::ResponsePasskeyInitLink + + ResponsePasskeyInitRegister = Privy::Models::ResponsePasskeyInitRegister + + RpcIntentRequestDetails = Privy::Models::RpcIntentRequestDetails + + RpcIntentResponse = Privy::Models::RpcIntentResponse + + RuleIntentCreateRequestDetails = Privy::Models::RuleIntentCreateRequestDetails + + RuleIntentDeleteRequestDetails = Privy::Models::RuleIntentDeleteRequestDetails + + RuleIntentRequestDetails = Privy::Models::RuleIntentRequestDetails + + RuleIntentResponse = Privy::Models::RuleIntentResponse + + RuleIntentUpdateRequestDetails = Privy::Models::RuleIntentUpdateRequestDetails + + SeedPhraseExportInput = Privy::Models::SeedPhraseExportInput + + SeedPhraseExportResponse = Privy::Models::SeedPhraseExportResponse + + SeedPhraseExportWebhookPayload = Privy::Models::SeedPhraseExportWebhookPayload + + SigningAlgorithm = Privy::Models::SigningAlgorithm + + SiweAddressInput = Privy::Models::SiweAddressInput + + SiweAuthenticateRequestBody = Privy::Models::SiweAuthenticateRequestBody + + SiweInitInput = Privy::Models::SiweInitInput + + SiweInitRequestBody = Privy::Models::SiweInitRequestBody + + SiweInitResponseBody = Privy::Models::SiweInitResponseBody + + SiweInput = Privy::Models::SiweInput + + SiweLinkRequestBody = Privy::Models::SiweLinkRequestBody + + SiweLinkSmartWalletRequestBody = Privy::Models::SiweLinkSmartWalletRequestBody + + SiweNonce = Privy::Models::SiweNonce + + SiweUnlinkRequestBody = Privy::Models::SiweUnlinkRequestBody + + SiwsAddressInput = Privy::Models::SiwsAddressInput + + SiwsAuthenticateRequestBody = Privy::Models::SiwsAuthenticateRequestBody + + SiwsInitInput = Privy::Models::SiwsInitInput + + SiwsInitRequestBody = Privy::Models::SiwsInitRequestBody + + SiwsInitResponseBody = Privy::Models::SiwsInitResponseBody + + SiwsInput = Privy::Models::SiwsInput + + SiwsLinkRequestBody = Privy::Models::SiwsLinkRequestBody + + SiwsNonce = Privy::Models::SiwsNonce + + SiwsUnlinkRequestBody = Privy::Models::SiwsUnlinkRequestBody + + SmartWalletConfiguration = Privy::Models::SmartWalletConfiguration + + SmartWalletConfigurationDisabled = + Privy::Models::SmartWalletConfigurationDisabled + + SmartWalletConfigurationEnabled = + Privy::Models::SmartWalletConfigurationEnabled + + SmartWalletConfigurationInput = Privy::Models::SmartWalletConfigurationInput + + SmartWalletConfigurationInputEnabled = + Privy::Models::SmartWalletConfigurationInputEnabled + + SmartWalletNetworkConfiguration = + Privy::Models::SmartWalletNetworkConfiguration + + SmartWalletNetworkConfigurationInput = + Privy::Models::SmartWalletNetworkConfigurationInput + + SmartWalletSiweInput = Privy::Models::SmartWalletSiweInput + + SmartWalletType = Privy::Models::SmartWalletType + + SMSMfaMethod = Privy::Models::SMSMfaMethod + + SolanaProgramInstructionCondition = + Privy::Models::SolanaProgramInstructionCondition + + SolanaRpcInput = Privy::Models::SolanaRpcInput + + SolanaRpcResponse = Privy::Models::SolanaRpcResponse + + SolanaSignAndSendTransactionRpcInput = + Privy::Models::SolanaSignAndSendTransactionRpcInput + + SolanaSignAndSendTransactionRpcInputParams = + Privy::Models::SolanaSignAndSendTransactionRpcInputParams + + SolanaSignAndSendTransactionRpcResponse = + Privy::Models::SolanaSignAndSendTransactionRpcResponse + + SolanaSignAndSendTransactionRpcResponseData = + Privy::Models::SolanaSignAndSendTransactionRpcResponseData + + SolanaSignMessageRpcInput = Privy::Models::SolanaSignMessageRpcInput + + SolanaSignMessageRpcInputParams = + Privy::Models::SolanaSignMessageRpcInputParams + + SolanaSignMessageRpcResponse = Privy::Models::SolanaSignMessageRpcResponse + + SolanaSignMessageRpcResponseData = + Privy::Models::SolanaSignMessageRpcResponseData + + SolanaSignTransactionRpcInput = Privy::Models::SolanaSignTransactionRpcInput + + SolanaSignTransactionRpcInputParams = + Privy::Models::SolanaSignTransactionRpcInputParams + + SolanaSignTransactionRpcResponse = + Privy::Models::SolanaSignTransactionRpcResponse + + SolanaSignTransactionRpcResponseData = + Privy::Models::SolanaSignTransactionRpcResponseData + + SolanaSystemProgramInstructionCondition = + Privy::Models::SolanaSystemProgramInstructionCondition + + SolanaTokenProgramInstructionCondition = + Privy::Models::SolanaTokenProgramInstructionCondition + + SolanaWalletDerivationStrategy = Privy::Models::SolanaWalletDerivationStrategy + + SparkBalance = Privy::Models::SparkBalance + + SparkClaimStaticDepositRpcInput = + Privy::Models::SparkClaimStaticDepositRpcInput + + SparkClaimStaticDepositRpcInputParams = + Privy::Models::SparkClaimStaticDepositRpcInputParams + + SparkClaimStaticDepositRpcResponse = + Privy::Models::SparkClaimStaticDepositRpcResponse + + SparkClaimStaticDepositRpcResponseData = + Privy::Models::SparkClaimStaticDepositRpcResponseData + + SparkCreateLightningInvoiceRpcInput = + Privy::Models::SparkCreateLightningInvoiceRpcInput + + SparkCreateLightningInvoiceRpcInputParams = + Privy::Models::SparkCreateLightningInvoiceRpcInputParams + + SparkCreateLightningInvoiceRpcResponse = + Privy::Models::SparkCreateLightningInvoiceRpcResponse + + SparkGetBalanceRpcInput = Privy::Models::SparkGetBalanceRpcInput + + SparkGetBalanceRpcResponse = Privy::Models::SparkGetBalanceRpcResponse + + SparkGetClaimStaticDepositQuoteRpcInput = + Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput + + SparkGetClaimStaticDepositQuoteRpcInputParams = + Privy::Models::SparkGetClaimStaticDepositQuoteRpcInputParams + + SparkGetClaimStaticDepositQuoteRpcResponse = + Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse + + SparkGetClaimStaticDepositQuoteRpcResponseData = + Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponseData + + SparkGetStaticDepositAddressRpcInput = + Privy::Models::SparkGetStaticDepositAddressRpcInput + + SparkGetStaticDepositAddressRpcResponse = + Privy::Models::SparkGetStaticDepositAddressRpcResponse + + SparkGetStaticDepositAddressRpcResponseData = + Privy::Models::SparkGetStaticDepositAddressRpcResponseData + + SparkLightningFee = Privy::Models::SparkLightningFee + + SparkLightningReceiveRequest = Privy::Models::SparkLightningReceiveRequest + + SparkLightningSendRequest = Privy::Models::SparkLightningSendRequest + + SparkNetwork = Privy::Models::SparkNetwork + + SparkOutputSelectionStrategy = Privy::Models::SparkOutputSelectionStrategy + + SparkPayLightningInvoiceRpcInput = + Privy::Models::SparkPayLightningInvoiceRpcInput + + SparkPayLightningInvoiceRpcInputParams = + Privy::Models::SparkPayLightningInvoiceRpcInputParams + + SparkPayLightningInvoiceRpcResponse = + Privy::Models::SparkPayLightningInvoiceRpcResponse + + SparkRpcInput = Privy::Models::SparkRpcInput + + SparkRpcResponse = Privy::Models::SparkRpcResponse + + SparkSigningKeyshare = Privy::Models::SparkSigningKeyshare + + SparkSignMessageWithIdentityKeyRpcInput = + Privy::Models::SparkSignMessageWithIdentityKeyRpcInput + + SparkSignMessageWithIdentityKeyRpcInputParams = + Privy::Models::SparkSignMessageWithIdentityKeyRpcInputParams + + SparkSignMessageWithIdentityKeyRpcResponse = + Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse + + SparkSignMessageWithIdentityKeyRpcResponseData = + Privy::Models::SparkSignMessageWithIdentityKeyRpcResponseData + + SparkTokenBalance = Privy::Models::SparkTokenBalance + + SparkTransfer = Privy::Models::SparkTransfer + + SparkTransferLeaf = Privy::Models::SparkTransferLeaf + + SparkTransferRpcInput = Privy::Models::SparkTransferRpcInput + + SparkTransferRpcInputParams = Privy::Models::SparkTransferRpcInputParams + + SparkTransferRpcResponse = Privy::Models::SparkTransferRpcResponse + + SparkTransferTokensRpcInput = Privy::Models::SparkTransferTokensRpcInput + + SparkTransferTokensRpcInputParams = + Privy::Models::SparkTransferTokensRpcInputParams + + SparkTransferTokensRpcResponse = Privy::Models::SparkTransferTokensRpcResponse + + SparkTransferTokensRpcResponseData = + Privy::Models::SparkTransferTokensRpcResponseData + + SparkUserTokenMetadata = Privy::Models::SparkUserTokenMetadata + + SparkWalletLeaf = Privy::Models::SparkWalletLeaf + + SuccessResponse = Privy::Models::SuccessResponse + + SuiCommandName = Privy::Models::SuiCommandName + + SuiTransactionCommandCondition = Privy::Models::SuiTransactionCommandCondition + + SuiTransactionCommandOperator = Privy::Models::SuiTransactionCommandOperator + + SuiTransferObjectsCommandCondition = + Privy::Models::SuiTransferObjectsCommandCondition + + SuiTransferObjectsCommandField = Privy::Models::SuiTransferObjectsCommandField + + SvmTransactionWalletActionStep = Privy::Models::SvmTransactionWalletActionStep + + SvmWalletActionStepStatus = Privy::Models::SvmWalletActionStepStatus + + SwapActionResponse = Privy::Models::SwapActionResponse + + SwapDestination = Privy::Models::SwapDestination + + SwapQuoteDestination = Privy::Models::SwapQuoteDestination + + SwapQuoteRequestBody = Privy::Models::SwapQuoteRequestBody + + SwapQuoteResponse = Privy::Models::SwapQuoteResponse + + SwapRequestBody = Privy::Models::SwapRequestBody + + SwapSource = Privy::Models::SwapSource + + SystemCondition = Privy::Models::SystemCondition + + TelegramAuthConfigSchema = Privy::Models::TelegramAuthConfigSchema + + TelegramAuthenticateInput = Privy::Models::TelegramAuthenticateInput + + TelegramAuthenticateRequestBody = + Privy::Models::TelegramAuthenticateRequestBody + + TelegramAuthResult = Privy::Models::TelegramAuthResult + + TelegramLinkRequestBody = Privy::Models::TelegramLinkRequestBody + + TelegramUnlinkInput = Privy::Models::TelegramUnlinkInput + + TelegramUnlinkRequestBody = Privy::Models::TelegramUnlinkRequestBody + + TelegramWebAppData = Privy::Models::TelegramWebAppData + + TempoAaAuthorization = Privy::Models::TempoAaAuthorization + + TempoCall = Privy::Models::TempoCall + + TempoFeePayerSignature = Privy::Models::TempoFeePayerSignature + + TestAccount = Privy::Models::TestAccount + + TestAccountsResponse = Privy::Models::TestAccountsResponse + + TokenOutput = Privy::Models::TokenOutput + + TokenTransferDestination = Privy::Models::TokenTransferDestination + + TokenTransferSource = Privy::Models::TokenTransferSource + + TotpMfaMethod = Privy::Models::TotpMfaMethod + + Transaction = Privy::Models::Transaction + + TransactionBroadcastedWebhookPayload = + Privy::Models::TransactionBroadcastedWebhookPayload + + TransactionConfirmedWebhookPayload = + Privy::Models::TransactionConfirmedWebhookPayload + + TransactionDetail = Privy::Models::TransactionDetail + + TransactionExecutionRevertedWebhookPayload = + Privy::Models::TransactionExecutionRevertedWebhookPayload + + TransactionFailedWebhookPayload = + Privy::Models::TransactionFailedWebhookPayload + + TransactionGetParams = Privy::Models::TransactionGetParams + + TransactionList = Privy::Models::TransactionList + + TransactionProviderErrorWebhookPayload = + Privy::Models::TransactionProviderErrorWebhookPayload + + TransactionReplacedWebhookPayload = + Privy::Models::TransactionReplacedWebhookPayload + + TransactionScanningAssetDiff = Privy::Models::TransactionScanningAssetDiff + + TransactionScanningAssetInfo = Privy::Models::TransactionScanningAssetInfo + + TransactionScanningAssetValue = Privy::Models::TransactionScanningAssetValue + + TransactionScanningCalldata = Privy::Models::TransactionScanningCalldata + + TransactionScanningExposure = Privy::Models::TransactionScanningExposure + + TransactionScanningMetadata = Privy::Models::TransactionScanningMetadata + + TransactionScanningParams = Privy::Models::TransactionScanningParams + + TransactionScanningRequestBody = Privy::Models::TransactionScanningRequestBody + + TransactionScanningResponseBody = + Privy::Models::TransactionScanningResponseBody + + TransactionScanningRpcRequest = Privy::Models::TransactionScanningRpcRequest + + TransactionScanningSimulationErrorResult = + Privy::Models::TransactionScanningSimulationErrorResult + + TransactionScanningSimulationResult = + Privy::Models::TransactionScanningSimulationResult + + TransactionScanningSimulationSuccessResult = + Privy::Models::TransactionScanningSimulationSuccessResult + + TransactionScanningValidationErrorResult = + Privy::Models::TransactionScanningValidationErrorResult + + TransactionScanningValidationResult = + Privy::Models::TransactionScanningValidationResult + + TransactionScanningValidationSuccessResult = + Privy::Models::TransactionScanningValidationSuccessResult + + TransactionStillPendingWebhookPayload = + Privy::Models::TransactionStillPendingWebhookPayload + + TransactionTokenAddressInput = Privy::Models::TransactionTokenAddressInput + + TransferActionResponse = Privy::Models::TransferActionResponse + + TransferFarcasterInput = Privy::Models::TransferFarcasterInput + + TransferIntentRequestDetails = Privy::Models::TransferIntentRequestDetails + + TransferIntentResponse = Privy::Models::TransferIntentResponse + + TransferReceivedTransactionDetail = + Privy::Models::TransferReceivedTransactionDetail + + TransferRequestBody = Privy::Models::TransferRequestBody + + TransferSentTransactionDetail = Privy::Models::TransferSentTransactionDetail + + TransferSiweInput = Privy::Models::TransferSiweInput + + TransferSiwsInput = Privy::Models::TransferSiwsInput + + TransferTelegramInput = Privy::Models::TransferTelegramInput + + TronCalldataCondition = Privy::Models::TronCalldataCondition + + TronTransactionCondition = Privy::Models::TronTransactionCondition + + TypedDataDomainInputParams = + T.let( + Privy::Models::TypedDataDomainInputParams, + Privy::Internal::Type::Converter + ) + + TypedDataTypeFieldInput = Privy::Models::TypedDataTypeFieldInput + + TypedDataTypesInputParams = + T.let( + Privy::Models::TypedDataTypesInputParams, + Privy::Internal::Type::Converter + ) + + UnlinkPasskeyInput = Privy::Models::UnlinkPasskeyInput + + UnsafeUnwrapWebhookEvent = Privy::Models::UnsafeUnwrapWebhookEvent + + UnsignedEthereumTransaction = Privy::Models::UnsignedEthereumTransaction + + UnsignedStandardEthereumTransaction = + Privy::Models::UnsignedStandardEthereumTransaction + + UnsignedTempoTransaction = Privy::Models::UnsignedTempoTransaction + + UpdateAccountFromWalletIDsInput = + Privy::Models::UpdateAccountFromWalletIDsInput + + UpdateAccountFromWalletsConfigurationInput = + Privy::Models::UpdateAccountFromWalletsConfigurationInput + + UpdateAccountInput = Privy::Models::UpdateAccountInput + + UpdateConditionSetRequestBody = Privy::Models::UpdateConditionSetRequestBody + + UpdateOrganizationSecretSigningKeyInput = + Privy::Models::UpdateOrganizationSecretSigningKeyInput + + User = Privy::Models::User + + UserAuthenticatedWebhookPayload = + Privy::Models::UserAuthenticatedWebhookPayload + + UserBatchCreateInput = Privy::Models::UserBatchCreateInput + + UserCreatedWebhookPayload = Privy::Models::UserCreatedWebhookPayload + + UserCreateParams = Privy::Models::UserCreateParams + + UserDeleteParams = Privy::Models::UserDeleteParams + + UserGetByCustomAuthIDParams = Privy::Models::UserGetByCustomAuthIDParams + + UserGetByDiscordUsernameParams = Privy::Models::UserGetByDiscordUsernameParams + + UserGetByEmailAddressParams = Privy::Models::UserGetByEmailAddressParams + + UserGetByFarcasterIDParams = Privy::Models::UserGetByFarcasterIDParams + + UserGetByGitHubUsernameParams = Privy::Models::UserGetByGitHubUsernameParams + + UserGetByPhoneNumberParams = Privy::Models::UserGetByPhoneNumberParams + + UserGetBySmartWalletAddressParams = + Privy::Models::UserGetBySmartWalletAddressParams + + UserGetByTelegramUserIDParams = Privy::Models::UserGetByTelegramUserIDParams + + UserGetByTelegramUsernameParams = + Privy::Models::UserGetByTelegramUsernameParams + + UserGetByTwitterSubjectParams = Privy::Models::UserGetByTwitterSubjectParams + + UserGetByTwitterUsernameParams = Privy::Models::UserGetByTwitterUsernameParams + + UserGetByWalletAddressParams = Privy::Models::UserGetByWalletAddressParams + + UserGetParams = Privy::Models::UserGetParams + + UserInviteInput = Privy::Models::UserInviteInput + + UserLinkedAccountWebhookPayload = + Privy::Models::UserLinkedAccountWebhookPayload + + UserListParams = Privy::Models::UserListParams + + UserOperationCompletedWebhookPayload = + Privy::Models::UserOperationCompletedWebhookPayload + + UserOperationInput = Privy::Models::UserOperationInput + + UserOwnedRecoveryOption = Privy::Models::UserOwnedRecoveryOption + + UserPregenerateWalletsParams = Privy::Models::UserPregenerateWalletsParams + + UserSearchParams = Privy::Models::UserSearchParams + + UserSetCustomMetadataParams = Privy::Models::UserSetCustomMetadataParams + + UserTransferredAccountWebhookPayload = + Privy::Models::UserTransferredAccountWebhookPayload + + UserUnlinkedAccountWebhookPayload = + Privy::Models::UserUnlinkedAccountWebhookPayload + + UserUnlinkLinkedAccountParams = Privy::Models::UserUnlinkLinkedAccountParams + + UserUpdatedAccountWebhookPayload = + Privy::Models::UserUpdatedAccountWebhookPayload + + UserWalletCreatedWebhookPayload = + Privy::Models::UserWalletCreatedWebhookPayload + + UserWithIdentityToken = Privy::Models::UserWithIdentityToken + + Wallet = Privy::Models::Wallet + + WalletActionEarnDepositCreatedWebhookPayload = + Privy::Models::WalletActionEarnDepositCreatedWebhookPayload + + WalletActionEarnDepositFailedWebhookPayload = + Privy::Models::WalletActionEarnDepositFailedWebhookPayload + + WalletActionEarnDepositRejectedWebhookPayload = + Privy::Models::WalletActionEarnDepositRejectedWebhookPayload + + WalletActionEarnDepositSucceededWebhookPayload = + Privy::Models::WalletActionEarnDepositSucceededWebhookPayload + + WalletActionEarnIncentiveClaimCreatedWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload + + WalletActionEarnIncentiveClaimFailedWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload + + WalletActionEarnIncentiveClaimRejectedWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload + + WalletActionEarnIncentiveClaimSucceededWebhookPayload = + Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload + + WalletActionEarnWithdrawCreatedWebhookPayload = + Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload + + WalletActionEarnWithdrawFailedWebhookPayload = + Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload + + WalletActionEarnWithdrawRejectedWebhookPayload = + Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload + + WalletActionEarnWithdrawSucceededWebhookPayload = + Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload + + WalletActionResponse = Privy::Models::WalletActionResponse + + WalletActionStatus = Privy::Models::WalletActionStatus + + WalletActionStep = Privy::Models::WalletActionStep + + WalletActionStepType = Privy::Models::WalletActionStepType + + WalletActionSwapCreatedWebhookPayload = + Privy::Models::WalletActionSwapCreatedWebhookPayload + + WalletActionSwapFailedWebhookPayload = + Privy::Models::WalletActionSwapFailedWebhookPayload + + WalletActionSwapRejectedWebhookPayload = + Privy::Models::WalletActionSwapRejectedWebhookPayload + + WalletActionSwapSucceededWebhookPayload = + Privy::Models::WalletActionSwapSucceededWebhookPayload + + WalletActionTransferCreatedWebhookPayload = + Privy::Models::WalletActionTransferCreatedWebhookPayload + + WalletActionTransferFailedWebhookPayload = + Privy::Models::WalletActionTransferFailedWebhookPayload + + WalletActionTransferRejectedWebhookPayload = + Privy::Models::WalletActionTransferRejectedWebhookPayload + + WalletActionTransferSucceededWebhookPayload = + Privy::Models::WalletActionTransferSucceededWebhookPayload + + WalletActionType = Privy::Models::WalletActionType + + WalletAdditionalSigner = + T.let( + Privy::Models::WalletAdditionalSigner, + Privy::Internal::Type::Converter + ) + + WalletAdditionalSignerItem = Privy::Models::WalletAdditionalSignerItem + + WalletAPIRegisterAuthorizationKeyInput = + Privy::Models::WalletAPIRegisterAuthorizationKeyInput + + WalletAPIRevokeAuthorizationKeyInput = + Privy::Models::WalletAPIRevokeAuthorizationKeyInput + + WalletAsset = Privy::Models::WalletAsset + + WalletAuthenticateRequestBody = Privy::Models::WalletAuthenticateRequestBody + + WalletAuthenticateWithJwtParams = + Privy::Models::WalletAuthenticateWithJwtParams + + WalletAuthenticateWithJwtResponse = + Privy::Models::WalletAuthenticateWithJwtResponse + + WalletAuthorizationHeaders = Privy::Models::WalletAuthorizationHeaders + + WalletBatchCreateInput = Privy::Models::WalletBatchCreateInput + + WalletBatchCreateResponse = Privy::Models::WalletBatchCreateResponse + + WalletBatchCreateResult = Privy::Models::WalletBatchCreateResult + + WalletBatchItemInput = Privy::Models::WalletBatchItemInput + + WalletChainType = Privy::Models::WalletChainType + + WalletCreateParams = Privy::Models::WalletCreateParams + + WalletCreateWalletsWithRecoveryParams = + Privy::Models::WalletCreateWalletsWithRecoveryParams + + WalletCreateWalletsWithRecoveryResponse = + Privy::Models::WalletCreateWalletsWithRecoveryResponse + + WalletCreationAdditionalSignerItem = + Privy::Models::WalletCreationAdditionalSignerItem + + WalletCreationInput = Privy::Models::WalletCreationInput + + WalletCustodian = Privy::Models::WalletCustodian + + WalletEntropyType = Privy::Models::WalletEntropyType + + WalletEthereumAsset = Privy::Models::WalletEthereumAsset + + WalletExportParams = Privy::Models::WalletExportParams + + WalletExportRequestBody = Privy::Models::WalletExportRequestBody + + WalletExportResponseBody = Privy::Models::WalletExportResponseBody + + WalletFundsAsset = Privy::Models::WalletFundsAsset + + WalletFundsErc20Asset = Privy::Models::WalletFundsErc20Asset + + WalletFundsNativeTokenAsset = Privy::Models::WalletFundsNativeTokenAsset + + WalletFundsSacAsset = Privy::Models::WalletFundsSacAsset + + WalletFundsSplAsset = Privy::Models::WalletFundsSplAsset + + WalletGetParams = Privy::Models::WalletGetParams + + WalletGetWalletByAddressParams = Privy::Models::WalletGetWalletByAddressParams + + WalletImportInitResponse = Privy::Models::WalletImportInitResponse + + WalletImportSupportedChains = Privy::Models::WalletImportSupportedChains + + WalletImportSupportedEntropyTypes = + Privy::Models::WalletImportSupportedEntropyTypes + + WalletInitImportParams = Privy::Models::WalletInitImportParams + + WalletIntentResponse = Privy::Models::WalletIntentResponse + + WalletInviteInput = Privy::Models::WalletInviteInput + + WalletListParams = Privy::Models::WalletListParams + + WalletRawSignParams = Privy::Models::WalletRawSignParams + + WalletRecoveredWebhookPayload = Privy::Models::WalletRecoveredWebhookPayload + + WalletRecoverySetupWebhookPayload = + Privy::Models::WalletRecoverySetupWebhookPayload + + WalletRevokeResponse = Privy::Models::WalletRevokeResponse + + WalletRpcParams = Privy::Models::WalletRpcParams + + WalletRpcRequestBody = Privy::Models::WalletRpcRequestBody + + WalletRpcResponse = Privy::Models::WalletRpcResponse + + Wallets = Privy::Models::Wallets + + WalletSolanaAsset = Privy::Models::WalletSolanaAsset + + WalletSubmitImportParams = Privy::Models::WalletSubmitImportParams + + WalletTransferParams = Privy::Models::WalletTransferParams + + WalletUpdateParams = Privy::Models::WalletUpdateParams + + WalletUpdateRequestBody = Privy::Models::WalletUpdateRequestBody + + WebhookPayload = Privy::Models::WebhookPayload + + WebhookUnsafeUnwrapParams = Privy::Models::WebhookUnsafeUnwrapParams + + YieldAuthorizationHeaders = Privy::Models::YieldAuthorizationHeaders + + YieldClaimConfirmedWebhookPayload = + Privy::Models::YieldClaimConfirmedWebhookPayload + + YieldDepositConfirmedWebhookPayload = + Privy::Models::YieldDepositConfirmedWebhookPayload + + YieldWithdrawConfirmedWebhookPayload = + Privy::Models::YieldWithdrawConfirmedWebhookPayload +end diff --git a/rbi/privy/models/abi_parameter.rbi b/rbi/privy/models/abi_parameter.rbi new file mode 100644 index 0000000..bc86539 --- /dev/null +++ b/rbi/privy/models/abi_parameter.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Privy + module Models + class AbiParameter < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::AbiParameter, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :type + + sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) } + attr_reader :components + + sig { params(components: T::Array[T::Hash[Symbol, T.anything]]).void } + attr_writer :components + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :indexed + + sig { params(indexed: T::Boolean).void } + attr_writer :indexed + + sig { returns(T.nilable(String)) } + attr_reader :internal_type + + sig { params(internal_type: String).void } + attr_writer :internal_type + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # A parameter in a Solidity ABI function or event definition. + sig do + params( + type: String, + components: T::Array[T::Hash[Symbol, T.anything]], + indexed: T::Boolean, + internal_type: String, + name: String + ).returns(T.attached_class) + end + def self.new( + type:, + components: nil, + indexed: nil, + internal_type: nil, + name: nil + ) + end + + sig do + override.returns( + { + type: String, + components: T::Array[T::Hash[Symbol, T.anything]], + indexed: T::Boolean, + internal_type: String, + name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/abi_schema.rbi b/rbi/privy/models/abi_schema.rbi new file mode 100644 index 0000000..5589f33 --- /dev/null +++ b/rbi/privy/models/abi_schema.rbi @@ -0,0 +1,139 @@ +# typed: strong + +module Privy + module Models + class AbiSchemaItem < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::AbiSchemaItem, Privy::Internal::AnyHash) } + + sig { returns(Privy::AbiSchemaItem::Type::OrSymbol) } + attr_accessor :type + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :anonymous + + sig { params(anonymous: T::Boolean).void } + attr_writer :anonymous + + sig { returns(T.nilable(T::Array[Privy::AbiParameter])) } + attr_reader :inputs + + sig { params(inputs: T::Array[Privy::AbiParameter::OrHash]).void } + attr_writer :inputs + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(T::Array[Privy::AbiParameter])) } + attr_reader :outputs + + sig { params(outputs: T::Array[Privy::AbiParameter::OrHash]).void } + attr_writer :outputs + + sig do + returns(T.nilable(Privy::AbiSchemaItem::StateMutability::OrSymbol)) + end + attr_reader :state_mutability + + sig do + params( + state_mutability: Privy::AbiSchemaItem::StateMutability::OrSymbol + ).void + end + attr_writer :state_mutability + + sig do + params( + type: Privy::AbiSchemaItem::Type::OrSymbol, + anonymous: T::Boolean, + inputs: T::Array[Privy::AbiParameter::OrHash], + name: String, + outputs: T::Array[Privy::AbiParameter::OrHash], + state_mutability: Privy::AbiSchemaItem::StateMutability::OrSymbol + ).returns(T.attached_class) + end + def self.new( + type:, + anonymous: nil, + inputs: nil, + name: nil, + outputs: nil, + state_mutability: nil + ) + end + + sig do + override.returns( + { + type: Privy::AbiSchemaItem::Type::OrSymbol, + anonymous: T::Boolean, + inputs: T::Array[Privy::AbiParameter], + name: String, + outputs: T::Array[Privy::AbiParameter], + state_mutability: Privy::AbiSchemaItem::StateMutability::OrSymbol + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::AbiSchemaItem::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TYPE_FUNCTION = + T.let(:function, Privy::AbiSchemaItem::Type::TaggedSymbol) + TYPE_CONSTRUCTOR = + T.let(:constructor, Privy::AbiSchemaItem::Type::TaggedSymbol) + TYPE_EVENT = T.let(:event, Privy::AbiSchemaItem::Type::TaggedSymbol) + TYPE_FALLBACK = + T.let(:fallback, Privy::AbiSchemaItem::Type::TaggedSymbol) + TYPE_RECEIVE = T.let(:receive, Privy::AbiSchemaItem::Type::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::AbiSchemaItem::Type::TaggedSymbol]) + end + def self.values + end + end + + module StateMutability + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::AbiSchemaItem::StateMutability) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PURE = T.let(:pure, Privy::AbiSchemaItem::StateMutability::TaggedSymbol) + VIEW = T.let(:view, Privy::AbiSchemaItem::StateMutability::TaggedSymbol) + NONPAYABLE = + T.let( + :nonpayable, + Privy::AbiSchemaItem::StateMutability::TaggedSymbol + ) + PAYABLE = + T.let(:payable, Privy::AbiSchemaItem::StateMutability::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::AbiSchemaItem::StateMutability::TaggedSymbol] + ) + end + def self.values + end + end + end + + AbiSchema = + T.let( + Privy::Internal::Type::ArrayOf[Privy::AbiSchemaItem], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/account_balance_params.rbi b/rbi/privy/models/account_balance_params.rbi new file mode 100644 index 0000000..899c04a --- /dev/null +++ b/rbi/privy/models/account_balance_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class AccountBalanceParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AccountBalanceParams, Privy::Internal::AnyHash) + end + + # When set to true, returns balances from testnet chains instead of mainnets. + sig do + returns(T.nilable(Privy::AccountBalanceParams::TestnetMode::OrSymbol)) + end + attr_reader :testnet_mode + + sig do + params( + testnet_mode: Privy::AccountBalanceParams::TestnetMode::OrSymbol + ).void + end + attr_writer :testnet_mode + + # Query parameters for the account balance endpoint. + sig do + params( + testnet_mode: Privy::AccountBalanceParams::TestnetMode::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # When set to true, returns balances from testnet chains instead of mainnets. + testnet_mode: nil + ) + end + + sig do + override.returns( + { testnet_mode: Privy::AccountBalanceParams::TestnetMode::OrSymbol } + ) + end + def to_hash + end + + # When set to true, returns balances from testnet chains instead of mainnets. + module TestnetMode + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::AccountBalanceParams::TestnetMode) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let(:true, Privy::AccountBalanceParams::TestnetMode::TaggedSymbol) + FALSE = + T.let(:false, Privy::AccountBalanceParams::TestnetMode::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::AccountBalanceParams::TestnetMode::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/account_balance_response.rbi b/rbi/privy/models/account_balance_response.rbi new file mode 100644 index 0000000..c4954dd --- /dev/null +++ b/rbi/privy/models/account_balance_response.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Privy + module Models + class AccountBalanceResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AccountBalanceResponse, Privy::Internal::AnyHash) + end + + # The individual asset balances, each computed across all supported chains. + sig { returns(T::Array[Privy::BalanceAsset]) } + attr_accessor :assets + + # A monetary value with its currency denomination. + sig { returns(Privy::CurrencyAmount) } + attr_reader :total + + sig { params(total: Privy::CurrencyAmount::OrHash).void } + attr_writer :total + + # Individual asset balances per chain. + sig { returns(T.nilable(T::Array[Privy::BalanceAssetByChain])) } + attr_reader :assets_by_chain + + sig do + params( + assets_by_chain: T::Array[Privy::BalanceAssetByChain::OrHash] + ).void + end + attr_writer :assets_by_chain + + # The balance of a digital asset account, aggregated across all wallets and + # supported chains. + sig do + params( + assets: T::Array[Privy::BalanceAsset::OrHash], + total: Privy::CurrencyAmount::OrHash, + assets_by_chain: T::Array[Privy::BalanceAssetByChain::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The individual asset balances, each computed across all supported chains. + assets:, + # A monetary value with its currency denomination. + total:, + # Individual asset balances per chain. + assets_by_chain: nil + ) + end + + sig do + override.returns( + { + assets: T::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + assets_by_chain: T::Array[Privy::BalanceAssetByChain] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/account_display_name.rbi b/rbi/privy/models/account_display_name.rbi new file mode 100644 index 0000000..b2dc790 --- /dev/null +++ b/rbi/privy/models/account_display_name.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + AccountDisplayName = String + end +end diff --git a/rbi/privy/models/account_response.rbi b/rbi/privy/models/account_response.rbi new file mode 100644 index 0000000..4924336 --- /dev/null +++ b/rbi/privy/models/account_response.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Privy + module Models + class AccountResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::AccountResponse, Privy::Internal::AnyHash) } + + # The account ID. + sig { returns(String) } + attr_accessor :id + + # An optional display name for the account. + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + # The wallets belonging to this account. + sig { returns(T::Array[Privy::AccountWallet]) } + attr_accessor :wallets + + # A digital asset account that groups wallets under a single entity. + sig do + params( + id: String, + display_name: T.nilable(String), + wallets: T::Array[Privy::AccountWallet::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The account ID. + id:, + # An optional display name for the account. + display_name:, + # The wallets belonging to this account. + wallets: + ) + end + + sig do + override.returns( + { + id: String, + display_name: T.nilable(String), + wallets: T::Array[Privy::AccountWallet] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/account_wallet.rbi b/rbi/privy/models/account_wallet.rbi new file mode 100644 index 0000000..b766b8c --- /dev/null +++ b/rbi/privy/models/account_wallet.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class AccountWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::AccountWallet, Privy::Internal::AnyHash) } + + # The wallet ID. + sig { returns(String) } + attr_accessor :id + + # The on-chain address of the wallet. + sig { returns(String) } + attr_accessor :address + + # The wallet chain types that offer first class support. + sig { returns(Privy::FirstClassChainType::OrSymbol) } + attr_accessor :chain_type + + # Information about the custodian managing this wallet. + sig { returns(T.nilable(Privy::WalletCustodian)) } + attr_reader :custody + + sig { params(custody: Privy::WalletCustodian::OrHash).void } + attr_writer :custody + + # A wallet belonging to a digital asset account. + sig do + params( + id: String, + address: String, + chain_type: Privy::FirstClassChainType::OrSymbol, + custody: Privy::WalletCustodian::OrHash + ).returns(T.attached_class) + end + def self.new( + # The wallet ID. + id:, + # The on-chain address of the wallet. + address:, + # The wallet chain types that offer first class support. + chain_type:, + # Information about the custodian managing this wallet. + custody: nil + ) + end + + sig do + override.returns( + { + id: String, + address: String, + chain_type: Privy::FirstClassChainType::OrSymbol, + custody: Privy::WalletCustodian + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/account_wallet_configuration_item.rbi b/rbi/privy/models/account_wallet_configuration_item.rbi new file mode 100644 index 0000000..1443927 --- /dev/null +++ b/rbi/privy/models/account_wallet_configuration_item.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class AccountWalletConfigurationItem < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AccountWalletConfigurationItem, Privy::Internal::AnyHash) + end + + # The wallet chain types that offer first class support. + sig { returns(Privy::FirstClassChainType::OrSymbol) } + attr_accessor :chain_type + + # Information about the custodian managing this wallet. + sig { returns(T.nilable(Privy::WalletCustodian)) } + attr_reader :custody + + sig { params(custody: Privy::WalletCustodian::OrHash).void } + attr_writer :custody + + # Configuration for a wallet to create within an account. + sig do + params( + chain_type: Privy::FirstClassChainType::OrSymbol, + custody: Privy::WalletCustodian::OrHash + ).returns(T.attached_class) + end + def self.new( + # The wallet chain types that offer first class support. + chain_type:, + # Information about the custodian managing this wallet. + custody: nil + ) + end + + sig do + override.returns( + { + chain_type: Privy::FirstClassChainType::OrSymbol, + custody: Privy::WalletCustodian + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/account_wallet_ids.rbi b/rbi/privy/models/account_wallet_ids.rbi new file mode 100644 index 0000000..7435e1a --- /dev/null +++ b/rbi/privy/models/account_wallet_ids.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + AccountWalletIDs = + T.let( + Privy::Internal::Type::ArrayOf[String], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/account_wallets_configuration.rbi b/rbi/privy/models/account_wallets_configuration.rbi new file mode 100644 index 0000000..83a0196 --- /dev/null +++ b/rbi/privy/models/account_wallets_configuration.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + AccountWalletsConfiguration = + T.let( + Privy::Internal::Type::ArrayOf[Privy::AccountWalletConfigurationItem], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/accounts_dashboard_list_response.rbi b/rbi/privy/models/accounts_dashboard_list_response.rbi new file mode 100644 index 0000000..43e3c06 --- /dev/null +++ b/rbi/privy/models/accounts_dashboard_list_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class AccountsDashboardListResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AccountsDashboardListResponse, Privy::Internal::AnyHash) + end + + # The list of accounts, with balances included for dashboard display. + sig { returns(T::Array[Privy::AssetAccountWithBalance]) } + attr_accessor :data + + # Cursor for fetching the next page of results, or null if no more results. + sig { returns(T.nilable(String)) } + attr_accessor :next_cursor + + # Paginated list of digital asset accounts for the dashboard. + sig do + params( + data: T::Array[Privy::AssetAccountWithBalance::OrHash], + next_cursor: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The list of accounts, with balances included for dashboard display. + data:, + # Cursor for fetching the next page of results, or null if no more results. + next_cursor: + ) + end + + sig do + override.returns( + { + data: T::Array[Privy::AssetAccountWithBalance], + next_cursor: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/accounts_list_response.rbi b/rbi/privy/models/accounts_list_response.rbi new file mode 100644 index 0000000..f3870d7 --- /dev/null +++ b/rbi/privy/models/accounts_list_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class AccountsListResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AccountsListResponse, Privy::Internal::AnyHash) + end + + # The list of accounts. + sig { returns(T::Array[Privy::AccountResponse]) } + attr_accessor :data + + # Cursor for fetching the next page of results, or null if no more results. + sig { returns(T.nilable(String)) } + attr_accessor :next_cursor + + # Paginated list of digital asset accounts. + sig do + params( + data: T::Array[Privy::AccountResponse::OrHash], + next_cursor: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The list of accounts. + data:, + # Cursor for fetching the next page of results, or null if no more results. + next_cursor: + ) + end + + sig do + override.returns( + { + data: T::Array[Privy::AccountResponse], + next_cursor: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/action_request_body_condition.rbi b/rbi/privy/models/action_request_body_condition.rbi new file mode 100644 index 0000000..26e41ee --- /dev/null +++ b/rbi/privy/models/action_request_body_condition.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module Privy + module Models + class ActionRequestBodyCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ActionRequestBodyCondition, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :field + + sig { returns(Privy::ActionRequestBodyCondition::FieldSource::OrSymbol) } + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Condition on the original wallet action API request body fields. + sig do + params( + field: String, + field_source: + Privy::ActionRequestBodyCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: String, + field_source: + Privy::ActionRequestBodyCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::ActionRequestBodyCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACTION_REQUEST_BODY = + T.let( + :action_request_body, + Privy::ActionRequestBodyCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::ActionRequestBodyCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/additional_signer_input.rbi b/rbi/privy/models/additional_signer_input.rbi new file mode 100644 index 0000000..06d2d57 --- /dev/null +++ b/rbi/privy/models/additional_signer_input.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + AdditionalSignerInput = + T.let( + Privy::Internal::Type::ArrayOf[Privy::AdditionalSignerItemInput], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/additional_signer_item_input.rbi b/rbi/privy/models/additional_signer_item_input.rbi new file mode 100644 index 0000000..e4bd8a1 --- /dev/null +++ b/rbi/privy/models/additional_signer_item_input.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class AdditionalSignerItemInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AdditionalSignerItemInput, Privy::Internal::AnyHash) + end + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :signer_id + + # An optional list of up to one policy ID to enforce on the wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :override_policy_ids + + sig { params(override_policy_ids: T::Array[String]).void } + attr_writer :override_policy_ids + + # A single additional signer for a wallet, with an optional policy override. + sig do + params( + signer_id: String, + override_policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for a key quorum. + signer_id:, + # An optional list of up to one policy ID to enforce on the wallet. + override_policy_ids: nil + ) + end + + sig do + override.returns( + { signer_id: String, override_policy_ids: T::Array[String] } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/address.rbi b/rbi/privy/models/address.rbi new file mode 100644 index 0000000..bf903c8 --- /dev/null +++ b/rbi/privy/models/address.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + Address = String + end +end diff --git a/rbi/privy/models/aggregation.rbi b/rbi/privy/models/aggregation.rbi new file mode 100644 index 0000000..84c9aa2 --- /dev/null +++ b/rbi/privy/models/aggregation.rbi @@ -0,0 +1,199 @@ +# typed: strong + +module Privy + module Models + class Aggregation < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::Aggregation, Privy::Internal::AnyHash) } + + # Unique ID of the aggregation. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp of when the aggregation was created in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # The RPC method this aggregation applies to. + sig { returns(Privy::AggregationMethod::OrSymbol) } + attr_accessor :method_ + + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + sig { returns(Privy::AggregationMetric) } + attr_reader :metric + + sig { params(metric: Privy::AggregationMetric::OrHash).void } + attr_writer :metric + + # The name of the aggregation. + sig { returns(String) } + attr_accessor :name + + # The key quorum ID of the owner of the aggregation. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # The time window configuration for an aggregation. + sig { returns(Privy::AggregationWindow) } + attr_reader :window + + sig { params(window: Privy::AggregationWindow::OrHash).void } + attr_writer :window + + # Optional conditions to filter events before aggregation. + sig do + returns( + T.nilable( + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ] + ) + ) + end + attr_reader :conditions + + sig do + params( + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ] + ).void + end + attr_writer :conditions + + # Optional grouping configuration for bucketing metrics. + sig { returns(T.nilable(T::Array[Privy::AggregationGroupBy])) } + attr_reader :group_by + + sig { params(group_by: T::Array[Privy::AggregationGroupBy::OrHash]).void } + attr_writer :group_by + + # An aggregation that measures and tracks metrics over a period of time. + sig do + params( + id: String, + created_at: Float, + method_: Privy::AggregationMethod::OrSymbol, + metric: Privy::AggregationMetric::OrHash, + name: String, + owner_id: T.nilable(String), + window: Privy::AggregationWindow::OrHash, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + group_by: T::Array[Privy::AggregationGroupBy::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Unique ID of the aggregation. + id:, + # Unix timestamp of when the aggregation was created in milliseconds. + created_at:, + # The RPC method this aggregation applies to. + method_:, + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + metric:, + # The name of the aggregation. + name:, + # The key quorum ID of the owner of the aggregation. + owner_id:, + # The time window configuration for an aggregation. + window:, + # Optional conditions to filter events before aggregation. + conditions: nil, + # Optional grouping configuration for bucketing metrics. + group_by: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Float, + method_: Privy::AggregationMethod::OrSymbol, + metric: Privy::AggregationMetric, + name: String, + owner_id: T.nilable(String), + window: Privy::AggregationWindow, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ], + group_by: T::Array[Privy::AggregationGroupBy] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/aggregation_condition.rbi b/rbi/privy/models/aggregation_condition.rbi new file mode 100644 index 0000000..9ea24d1 --- /dev/null +++ b/rbi/privy/models/aggregation_condition.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Privy + module Models + class AggregationCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AggregationCondition, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :field + + sig { returns(Privy::AggregationCondition::FieldSource::OrSymbol) } + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Condition referencing an aggregation value. The field must start with + # "aggregation." followed by the aggregation ID. + sig do + params( + field: String, + field_source: Privy::AggregationCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: String, + field_source: Privy::AggregationCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::AggregationCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REFERENCE = + T.let( + :reference, + Privy::AggregationCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::AggregationCondition::FieldSource::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/aggregation_group_by.rbi b/rbi/privy/models/aggregation_group_by.rbi new file mode 100644 index 0000000..d9add44 --- /dev/null +++ b/rbi/privy/models/aggregation_group_by.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class AggregationGroupBy < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AggregationGroupBy, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :field + + sig { returns(String) } + attr_accessor :field_source + + # A Solidity ABI definition for decoding smart contract calldata. + sig { returns(T.nilable(T::Array[Privy::AbiSchemaItem])) } + attr_reader :abi + + sig { params(abi: T::Array[Privy::AbiSchemaItem::OrHash]).void } + attr_writer :abi + + # A grouping configuration for an aggregation. Maximum of 2 group_by fields + # allowed. + sig do + params( + field: String, + field_source: String, + abi: T::Array[Privy::AbiSchemaItem::OrHash] + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # A Solidity ABI definition for decoding smart contract calldata. + abi: nil + ) + end + + sig do + override.returns( + { + field: String, + field_source: String, + abi: T::Array[Privy::AbiSchemaItem] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/aggregation_input.rbi b/rbi/privy/models/aggregation_input.rbi new file mode 100644 index 0000000..4cf343a --- /dev/null +++ b/rbi/privy/models/aggregation_input.rbi @@ -0,0 +1,210 @@ +# typed: strong + +module Privy + module Models + class AggregationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AggregationInput, Privy::Internal::AnyHash) + end + + # The RPC method this aggregation applies to. + sig { returns(Privy::AggregationMethod::OrSymbol) } + attr_accessor :method_ + + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + sig { returns(Privy::AggregationMetric) } + attr_reader :metric + + sig { params(metric: Privy::AggregationMetric::OrHash).void } + attr_writer :metric + + # The name of the aggregation. + sig { returns(String) } + attr_accessor :name + + # The time window configuration for an aggregation. + sig { returns(Privy::AggregationWindow) } + attr_reader :window + + sig { params(window: Privy::AggregationWindow::OrHash).void } + attr_writer :window + + # Optional conditions to filter events before aggregation. + sig do + returns( + T.nilable( + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ] + ) + ) + end + attr_reader :conditions + + sig do + params( + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ] + ).void + end + attr_writer :conditions + + # Optional grouping configuration for bucketing metrics. + sig { returns(T.nilable(T::Array[Privy::AggregationGroupBy])) } + attr_reader :group_by + + sig { params(group_by: T::Array[Privy::AggregationGroupBy::OrHash]).void } + attr_writer :group_by + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # Input for creating an aggregation. + sig do + params( + method_: Privy::AggregationMethod::OrSymbol, + metric: Privy::AggregationMetric::OrHash, + name: String, + window: Privy::AggregationWindow::OrHash, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + group_by: T::Array[Privy::AggregationGroupBy::OrHash], + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The RPC method this aggregation applies to. + method_:, + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + metric:, + # The name of the aggregation. + name:, + # The time window configuration for an aggregation. + window:, + # Optional conditions to filter events before aggregation. + conditions: nil, + # Optional grouping configuration for bucketing metrics. + group_by: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::AggregationMethod::OrSymbol, + metric: Privy::AggregationMetric, + name: String, + window: Privy::AggregationWindow, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ], + group_by: T::Array[Privy::AggregationGroupBy], + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/aggregation_method.rbi b/rbi/privy/models/aggregation_method.rbi new file mode 100644 index 0000000..ee7e445 --- /dev/null +++ b/rbi/privy/models/aggregation_method.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # The RPC method this aggregation applies to. + module AggregationMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::AggregationMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN_TRANSACTION = + T.let(:eth_signTransaction, Privy::AggregationMethod::TaggedSymbol) + ETH_SIGN_USER_OPERATION = + T.let(:eth_signUserOperation, Privy::AggregationMethod::TaggedSymbol) + + sig { override.returns(T::Array[Privy::AggregationMethod::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/aggregation_metric.rbi b/rbi/privy/models/aggregation_metric.rbi new file mode 100644 index 0000000..6def74e --- /dev/null +++ b/rbi/privy/models/aggregation_metric.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class AggregationMetric < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AggregationMetric, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :field + + sig { returns(String) } + attr_accessor :field_source + + # The aggregation function to apply. + sig { returns(Privy::AggregationMetric::Function::OrSymbol) } + attr_accessor :function + + # A Solidity ABI definition for decoding smart contract calldata. + sig { returns(T.nilable(T::Array[Privy::AbiSchemaItem])) } + attr_reader :abi + + sig { params(abi: T::Array[Privy::AbiSchemaItem::OrHash]).void } + attr_writer :abi + + # The metric configuration for an aggregation, defining what field/field_source to + # measure and the aggregation function to apply. + sig do + params( + field: String, + field_source: String, + function: Privy::AggregationMetric::Function::OrSymbol, + abi: T::Array[Privy::AbiSchemaItem::OrHash] + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # The aggregation function to apply. + function:, + # A Solidity ABI definition for decoding smart contract calldata. + abi: nil + ) + end + + sig do + override.returns( + { + field: String, + field_source: String, + function: Privy::AggregationMetric::Function::OrSymbol, + abi: T::Array[Privy::AbiSchemaItem] + } + ) + end + def to_hash + end + + # The aggregation function to apply. + module Function + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::AggregationMetric::Function) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUM = T.let(:sum, Privy::AggregationMetric::Function::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::AggregationMetric::Function::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/aggregation_window.rbi b/rbi/privy/models/aggregation_window.rbi new file mode 100644 index 0000000..4e62d5c --- /dev/null +++ b/rbi/privy/models/aggregation_window.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class AggregationWindow < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AggregationWindow, Privy::Internal::AnyHash) + end + + # Duration of the rolling window in seconds (1-72 hours). + sig { returns(Integer) } + attr_accessor :seconds + + sig { returns(Privy::AggregationWindow::Type::OrSymbol) } + attr_accessor :type + + # The time window configuration for an aggregation. + sig do + params( + seconds: Integer, + type: Privy::AggregationWindow::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Duration of the rolling window in seconds (1-72 hours). + seconds:, + type: + ) + end + + sig do + override.returns( + { seconds: Integer, type: Privy::AggregationWindow::Type::OrSymbol } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::AggregationWindow::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ROLLING = T.let(:rolling, Privy::AggregationWindow::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::AggregationWindow::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/alchemy_paymaster_context.rbi b/rbi/privy/models/alchemy_paymaster_context.rbi new file mode 100644 index 0000000..8eab41d --- /dev/null +++ b/rbi/privy/models/alchemy_paymaster_context.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class AlchemyPaymasterContext < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AlchemyPaymasterContext, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + # The Alchemy paymaster context for a smart wallet network configuration. + sig { params(policy_id: String).returns(T.attached_class) } + def self.new(policy_id:) + end + + sig { override.returns({ policy_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/allowlist_deletion_response.rbi b/rbi/privy/models/allowlist_deletion_response.rbi new file mode 100644 index 0000000..ae63300 --- /dev/null +++ b/rbi/privy/models/allowlist_deletion_response.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class AllowlistDeletionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AllowlistDeletionResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + # Confirmation response for deleting an allowlist entry. + sig { params(message: String).returns(T.attached_class) } + def self.new(message:) + end + + sig { override.returns({ message: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/allowlist_entry.rbi b/rbi/privy/models/allowlist_entry.rbi new file mode 100644 index 0000000..5ed0173 --- /dev/null +++ b/rbi/privy/models/allowlist_entry.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Privy + module Models + class AllowlistEntry < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::AllowlistEntry, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(Float)) } + attr_accessor :accepted_at + + sig { returns(String) } + attr_accessor :app_id + + sig { returns(String) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + # An allowlist entry for an app. + sig do + params( + id: String, + accepted_at: T.nilable(Float), + app_id: String, + type: String, + value: String + ).returns(T.attached_class) + end + def self.new(id:, accepted_at:, app_id:, type:, value:) + end + + sig do + override.returns( + { + id: String, + accepted_at: T.nilable(Float), + app_id: String, + type: String, + value: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/amount_type.rbi b/rbi/privy/models/amount_type.rbi new file mode 100644 index 0000000..2b9bcb1 --- /dev/null +++ b/rbi/privy/models/amount_type.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Privy + module Models + # Whether the amount refers to the input token or output token. + module AmountType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::AmountType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXACT_INPUT = T.let(:exact_input, Privy::AmountType::TaggedSymbol) + EXACT_OUTPUT = T.let(:exact_output, Privy::AmountType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::AmountType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/analytics_event_input.rbi b/rbi/privy/models/analytics_event_input.rbi new file mode 100644 index 0000000..d846afd --- /dev/null +++ b/rbi/privy/models/analytics_event_input.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Models + class AnalyticsEventInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AnalyticsEventInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :event_name + + sig { returns(T.nilable(String)) } + attr_reader :client_id + + sig { params(client_id: String).void } + attr_writer :client_id + + sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } + attr_reader :payload + + sig { params(payload: T::Hash[Symbol, T.anything]).void } + attr_writer :payload + + # The input for capturing an analytics event. + sig do + params( + event_name: String, + client_id: String, + payload: T::Hash[Symbol, T.anything] + ).returns(T.attached_class) + end + def self.new(event_name:, client_id: nil, payload: nil) + end + + sig do + override.returns( + { + event_name: String, + client_id: String, + payload: T::Hash[Symbol, T.anything] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/app_get_gas_spend_params.rbi b/rbi/privy/models/app_get_gas_spend_params.rbi new file mode 100644 index 0000000..cc7ffc6 --- /dev/null +++ b/rbi/privy/models/app_get_gas_spend_params.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Privy + module Models + class AppGetGasSpendParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::AppGetGasSpendParams, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :end_timestamp + + sig { returns(Float) } + attr_accessor :start_timestamp + + sig { returns(T::Array[String]) } + attr_accessor :wallet_ids + + sig do + params( + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: T::Array[String], + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + end_timestamp:, + start_timestamp:, + wallet_ids:, + request_options: {} + ) + end + + sig do + override.returns( + { + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: T::Array[String], + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/app_get_params.rbi b/rbi/privy/models/app_get_params.rbi new file mode 100644 index 0000000..2ee833d --- /dev/null +++ b/rbi/privy/models/app_get_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class AppGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::AppGetParams, Privy::Internal::AnyHash) } + + # The ID of the app. + sig { returns(String) } + attr_accessor :app_id + + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the app. + app_id:, + request_options: {} + ) + end + + sig do + override.returns( + { app_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/app_get_test_credentials_params.rbi b/rbi/privy/models/app_get_test_credentials_params.rbi new file mode 100644 index 0000000..32f80c5 --- /dev/null +++ b/rbi/privy/models/app_get_test_credentials_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Privy + module Models + class AppGetTestCredentialsParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::AppGetTestCredentialsParams, Privy::Internal::AnyHash) + end + + # The ID of the app. + sig { returns(String) } + attr_accessor :app_id + + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the app. + app_id:, + request_options: {} + ) + end + + sig do + override.returns( + { app_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/app_response.rbi b/rbi/privy/models/app_response.rbi new file mode 100644 index 0000000..20901fa --- /dev/null +++ b/rbi/privy/models/app_response.rbi @@ -0,0 +1,600 @@ +# typed: strong + +module Privy + module Models + class AppResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::AppResponse, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T.nilable(String)) } + attr_accessor :accent_color + + sig { returns(T::Array[String]) } + attr_accessor :allowed_domains + + sig { returns(T::Array[String]) } + attr_accessor :allowed_native_app_ids + + sig { returns(T::Array[String]) } + attr_accessor :allowed_native_app_url_schemes + + sig { returns(Privy::AppResponse::AllowlistConfig) } + attr_reader :allowlist_config + + sig do + params( + allowlist_config: Privy::AppResponse::AllowlistConfig::OrHash + ).void + end + attr_writer :allowlist_config + + sig { returns(T::Boolean) } + attr_accessor :allowlist_enabled + + sig { returns(T::Boolean) } + attr_accessor :apple_oauth + + sig { returns(T::Boolean) } + attr_accessor :captcha_enabled + + sig { returns(T.nilable(String)) } + attr_accessor :custom_api_url + + sig { returns(T::Boolean) } + attr_accessor :custom_jwt_auth + + sig { returns(T::Array[Privy::AppResponse::CustomOAuthProvider]) } + attr_accessor :custom_oauth_providers + + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + sig { returns(Privy::AppResponse::DataClassification::TaggedSymbol) } + attr_accessor :data_classification + + sig { returns(T::Boolean) } + attr_accessor :disable_plus_emails + + sig { returns(T::Boolean) } + attr_accessor :discord_oauth + + sig { returns(T::Boolean) } + attr_accessor :email_auth + + # Configuration for embedded wallets including the mode. + sig { returns(Privy::EmbeddedWalletConfigSchema) } + attr_reader :embedded_wallet_config + + sig do + params( + embedded_wallet_config: Privy::EmbeddedWalletConfigSchema::OrHash + ).void + end + attr_writer :embedded_wallet_config + + sig do + returns( + T.nilable(Privy::AppResponse::EnabledCaptchaProvider::TaggedSymbol) + ) + end + attr_accessor :enabled_captcha_provider + + sig { returns(T::Boolean) } + attr_accessor :enforce_wallet_uis + + sig { returns(T::Boolean) } + attr_accessor :farcaster_auth + + sig { returns(T::Boolean) } + attr_accessor :farcaster_link_wallets_enabled + + sig { returns(T::Boolean) } + attr_accessor :fiat_on_ramp_enabled + + sig { returns(T::Boolean) } + attr_accessor :github_oauth + + sig { returns(T::Boolean) } + attr_accessor :google_oauth + + sig { returns(T::Boolean) } + attr_accessor :guest_auth + + sig { returns(T.nilable(String)) } + attr_accessor :icon_url + + sig { returns(T::Boolean) } + attr_accessor :instagram_oauth + + sig { returns(T::Boolean) } + attr_accessor :legacy_wallet_ui_config + + sig { returns(T::Boolean) } + attr_accessor :line_oauth + + sig { returns(T::Boolean) } + attr_accessor :linkedin_oauth + + sig { returns(T.nilable(String)) } + attr_accessor :logo_url + + sig { returns(T.nilable(Float)) } + attr_accessor :max_linked_wallets_per_user + + sig { returns(T::Array[Privy::AppResponse::MfaMethod::TaggedSymbol]) } + attr_accessor :mfa_methods + + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Boolean) } + attr_accessor :passkey_auth + + sig { returns(T::Boolean) } + attr_accessor :passkeys_for_signup_enabled + + sig { returns(T.nilable(String)) } + attr_accessor :privacy_policy_url + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :require_users_accept_terms + + sig { returns(T::Boolean) } + attr_accessor :show_wallet_login_first + + # The configuration object for smart wallets. + sig { returns(Privy::SmartWalletConfiguration::Variants) } + attr_accessor :smart_wallet_config + + sig { returns(T::Boolean) } + attr_accessor :sms_auth + + sig { returns(T::Boolean) } + attr_accessor :solana_wallet_auth + + sig { returns(T::Boolean) } + attr_accessor :spotify_oauth + + sig { returns(T::Boolean) } + attr_accessor :telegram_auth + + sig { returns(T::Boolean) } + attr_accessor :telegram_oauth + + sig { returns(T.nilable(String)) } + attr_accessor :terms_and_conditions_url + + sig { returns(String) } + attr_accessor :theme + + sig { returns(T::Boolean) } + attr_accessor :tiktok_oauth + + sig { returns(T::Boolean) } + attr_accessor :twitch_oauth + + sig { returns(T::Boolean) } + attr_accessor :twitter_oauth + + sig { returns(T::Boolean) } + attr_accessor :twitter_oauth_on_mobile_enabled + + sig { returns(String) } + attr_accessor :verification_key + + sig { returns(T::Boolean) } + attr_accessor :wallet_auth + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_connect_cloud_project_id + + sig { returns(T::Boolean) } + attr_accessor :whatsapp_enabled + + sig { returns(T.nilable(String)) } + attr_reader :captcha_site_key + + sig { params(captcha_site_key: String).void } + attr_writer :captcha_site_key + + # Configuration for funding and on-ramp options. + sig { returns(T.nilable(Privy::FundingConfigResponseSchema)) } + attr_reader :funding_config + + sig do + params(funding_config: Privy::FundingConfigResponseSchema::OrHash).void + end + attr_writer :funding_config + + # Configuration for Telegram authentication. + sig { returns(T.nilable(Privy::TelegramAuthConfigSchema)) } + attr_reader :telegram_auth_config + + sig do + params( + telegram_auth_config: Privy::TelegramAuthConfigSchema::OrHash + ).void + end + attr_writer :telegram_auth_config + + # The response for getting an app. + sig do + params( + id: String, + accent_color: T.nilable(String), + allowed_domains: T::Array[String], + allowed_native_app_ids: T::Array[String], + allowed_native_app_url_schemes: T::Array[String], + allowlist_config: Privy::AppResponse::AllowlistConfig::OrHash, + allowlist_enabled: T::Boolean, + apple_oauth: T::Boolean, + captcha_enabled: T::Boolean, + custom_api_url: T.nilable(String), + custom_jwt_auth: T::Boolean, + custom_oauth_providers: + T::Array[Privy::AppResponse::CustomOAuthProvider::OrHash], + data_classification: Privy::AppResponse::DataClassification::OrSymbol, + disable_plus_emails: T::Boolean, + discord_oauth: T::Boolean, + email_auth: T::Boolean, + embedded_wallet_config: Privy::EmbeddedWalletConfigSchema::OrHash, + enabled_captcha_provider: + T.nilable(Privy::AppResponse::EnabledCaptchaProvider::OrSymbol), + enforce_wallet_uis: T::Boolean, + farcaster_auth: T::Boolean, + farcaster_link_wallets_enabled: T::Boolean, + fiat_on_ramp_enabled: T::Boolean, + github_oauth: T::Boolean, + google_oauth: T::Boolean, + guest_auth: T::Boolean, + icon_url: T.nilable(String), + instagram_oauth: T::Boolean, + legacy_wallet_ui_config: T::Boolean, + line_oauth: T::Boolean, + linkedin_oauth: T::Boolean, + logo_url: T.nilable(String), + max_linked_wallets_per_user: T.nilable(Float), + mfa_methods: T::Array[Privy::AppResponse::MfaMethod::OrSymbol], + name: String, + passkey_auth: T::Boolean, + passkeys_for_signup_enabled: T::Boolean, + privacy_policy_url: T.nilable(String), + require_users_accept_terms: T.nilable(T::Boolean), + show_wallet_login_first: T::Boolean, + smart_wallet_config: + T.any( + Privy::SmartWalletConfigurationDisabled::OrHash, + Privy::SmartWalletConfigurationEnabled::OrHash + ), + sms_auth: T::Boolean, + solana_wallet_auth: T::Boolean, + spotify_oauth: T::Boolean, + telegram_auth: T::Boolean, + telegram_oauth: T::Boolean, + terms_and_conditions_url: T.nilable(String), + theme: String, + tiktok_oauth: T::Boolean, + twitch_oauth: T::Boolean, + twitter_oauth: T::Boolean, + twitter_oauth_on_mobile_enabled: T::Boolean, + verification_key: String, + wallet_auth: T::Boolean, + wallet_connect_cloud_project_id: T.nilable(String), + whatsapp_enabled: T::Boolean, + captcha_site_key: String, + funding_config: Privy::FundingConfigResponseSchema::OrHash, + telegram_auth_config: Privy::TelegramAuthConfigSchema::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + accent_color:, + allowed_domains:, + allowed_native_app_ids:, + allowed_native_app_url_schemes:, + allowlist_config:, + allowlist_enabled:, + apple_oauth:, + captcha_enabled:, + custom_api_url:, + custom_jwt_auth:, + custom_oauth_providers:, + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + data_classification:, + disable_plus_emails:, + discord_oauth:, + email_auth:, + # Configuration for embedded wallets including the mode. + embedded_wallet_config:, + enabled_captcha_provider:, + enforce_wallet_uis:, + farcaster_auth:, + farcaster_link_wallets_enabled:, + fiat_on_ramp_enabled:, + github_oauth:, + google_oauth:, + guest_auth:, + icon_url:, + instagram_oauth:, + legacy_wallet_ui_config:, + line_oauth:, + linkedin_oauth:, + logo_url:, + max_linked_wallets_per_user:, + mfa_methods:, + name:, + passkey_auth:, + passkeys_for_signup_enabled:, + privacy_policy_url:, + require_users_accept_terms:, + show_wallet_login_first:, + # The configuration object for smart wallets. + smart_wallet_config:, + sms_auth:, + solana_wallet_auth:, + spotify_oauth:, + telegram_auth:, + telegram_oauth:, + terms_and_conditions_url:, + theme:, + tiktok_oauth:, + twitch_oauth:, + twitter_oauth:, + twitter_oauth_on_mobile_enabled:, + verification_key:, + wallet_auth:, + wallet_connect_cloud_project_id:, + whatsapp_enabled:, + captcha_site_key: nil, + # Configuration for funding and on-ramp options. + funding_config: nil, + # Configuration for Telegram authentication. + telegram_auth_config: nil + ) + end + + sig do + override.returns( + { + id: String, + accent_color: T.nilable(String), + allowed_domains: T::Array[String], + allowed_native_app_ids: T::Array[String], + allowed_native_app_url_schemes: T::Array[String], + allowlist_config: Privy::AppResponse::AllowlistConfig, + allowlist_enabled: T::Boolean, + apple_oauth: T::Boolean, + captcha_enabled: T::Boolean, + custom_api_url: T.nilable(String), + custom_jwt_auth: T::Boolean, + custom_oauth_providers: + T::Array[Privy::AppResponse::CustomOAuthProvider], + data_classification: + Privy::AppResponse::DataClassification::TaggedSymbol, + disable_plus_emails: T::Boolean, + discord_oauth: T::Boolean, + email_auth: T::Boolean, + embedded_wallet_config: Privy::EmbeddedWalletConfigSchema, + enabled_captcha_provider: + T.nilable( + Privy::AppResponse::EnabledCaptchaProvider::TaggedSymbol + ), + enforce_wallet_uis: T::Boolean, + farcaster_auth: T::Boolean, + farcaster_link_wallets_enabled: T::Boolean, + fiat_on_ramp_enabled: T::Boolean, + github_oauth: T::Boolean, + google_oauth: T::Boolean, + guest_auth: T::Boolean, + icon_url: T.nilable(String), + instagram_oauth: T::Boolean, + legacy_wallet_ui_config: T::Boolean, + line_oauth: T::Boolean, + linkedin_oauth: T::Boolean, + logo_url: T.nilable(String), + max_linked_wallets_per_user: T.nilable(Float), + mfa_methods: T::Array[Privy::AppResponse::MfaMethod::TaggedSymbol], + name: String, + passkey_auth: T::Boolean, + passkeys_for_signup_enabled: T::Boolean, + privacy_policy_url: T.nilable(String), + require_users_accept_terms: T.nilable(T::Boolean), + show_wallet_login_first: T::Boolean, + smart_wallet_config: Privy::SmartWalletConfiguration::Variants, + sms_auth: T::Boolean, + solana_wallet_auth: T::Boolean, + spotify_oauth: T::Boolean, + telegram_auth: T::Boolean, + telegram_oauth: T::Boolean, + terms_and_conditions_url: T.nilable(String), + theme: String, + tiktok_oauth: T::Boolean, + twitch_oauth: T::Boolean, + twitter_oauth: T::Boolean, + twitter_oauth_on_mobile_enabled: T::Boolean, + verification_key: String, + wallet_auth: T::Boolean, + wallet_connect_cloud_project_id: T.nilable(String), + whatsapp_enabled: T::Boolean, + captcha_site_key: String, + funding_config: Privy::FundingConfigResponseSchema, + telegram_auth_config: Privy::TelegramAuthConfigSchema + } + ) + end + def to_hash + end + + class AllowlistConfig < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AppResponse::AllowlistConfig, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :cta_link + + sig { returns(T.nilable(String)) } + attr_accessor :cta_text + + sig { returns(T.nilable(String)) } + attr_accessor :error_detail + + sig { returns(T.nilable(String)) } + attr_accessor :error_title + + sig do + params( + cta_link: T.nilable(String), + cta_text: T.nilable(String), + error_detail: T.nilable(String), + error_title: T.nilable(String) + ).returns(T.attached_class) + end + def self.new(cta_link:, cta_text:, error_detail:, error_title:) + end + + sig do + override.returns( + { + cta_link: T.nilable(String), + cta_text: T.nilable(String), + error_detail: T.nilable(String), + error_title: T.nilable(String) + } + ) + end + def to_hash + end + end + + class CustomOAuthProvider < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::AppResponse::CustomOAuthProvider, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :enabled + + # The ID of a custom OAuth provider, set up for this app. Must start with + # "custom:". + sig { returns(String) } + attr_accessor :provider + + sig { returns(String) } + attr_accessor :provider_display_name + + sig { returns(String) } + attr_accessor :provider_icon_url + + sig do + params( + enabled: T::Boolean, + provider: String, + provider_display_name: String, + provider_icon_url: String + ).returns(T.attached_class) + end + def self.new( + enabled:, + # The ID of a custom OAuth provider, set up for this app. Must start with + # "custom:". + provider:, + provider_display_name:, + provider_icon_url: + ) + end + + sig do + override.returns( + { + enabled: T::Boolean, + provider: String, + provider_display_name: String, + provider_icon_url: String + } + ) + end + def to_hash + end + end + + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + module DataClassification + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::AppResponse::DataClassification) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PUBLIC = + T.let(:public, Privy::AppResponse::DataClassification::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::AppResponse::DataClassification::TaggedSymbol] + ) + end + def self.values + end + end + + module EnabledCaptchaProvider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::AppResponse::EnabledCaptchaProvider) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TURNSTILE = + T.let( + :turnstile, + Privy::AppResponse::EnabledCaptchaProvider::TaggedSymbol + ) + HCAPTCHA = + T.let( + :hcaptcha, + Privy::AppResponse::EnabledCaptchaProvider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::AppResponse::EnabledCaptchaProvider::TaggedSymbol] + ) + end + def self.values + end + end + + module MfaMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::AppResponse::MfaMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = T.let(:sms, Privy::AppResponse::MfaMethod::TaggedSymbol) + TOTP = T.let(:totp, Privy::AppResponse::MfaMethod::TaggedSymbol) + PASSKEY = T.let(:passkey, Privy::AppResponse::MfaMethod::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::AppResponse::MfaMethod::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/apps/allowlist_create_params.rbi b/rbi/privy/models/apps/allowlist_create_params.rbi new file mode 100644 index 0000000..36c6afd --- /dev/null +++ b/rbi/privy/models/apps/allowlist_create_params.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + module Apps + class AllowlistCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::Apps::AllowlistCreateParams, Privy::Internal::AnyHash) + end + + # The ID of the app. + sig { returns(String) } + attr_accessor :app_id + + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the app. + app_id:, + request_options: {} + ) + end + + sig do + override.returns( + { app_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/apps/allowlist_delete_params.rbi b/rbi/privy/models/apps/allowlist_delete_params.rbi new file mode 100644 index 0000000..3366ab8 --- /dev/null +++ b/rbi/privy/models/apps/allowlist_delete_params.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + module Apps + class AllowlistDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::Apps::AllowlistDeleteParams, Privy::Internal::AnyHash) + end + + # The ID of the app. + sig { returns(String) } + attr_accessor :app_id + + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the app. + app_id:, + request_options: {} + ) + end + + sig do + override.returns( + { app_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/apps/allowlist_list_params.rbi b/rbi/privy/models/apps/allowlist_list_params.rbi new file mode 100644 index 0000000..4b66ba0 --- /dev/null +++ b/rbi/privy/models/apps/allowlist_list_params.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + module Apps + class AllowlistListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::Apps::AllowlistListParams, Privy::Internal::AnyHash) + end + + # The ID of the app. + sig { returns(String) } + attr_accessor :app_id + + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The ID of the app. + app_id:, + request_options: {} + ) + end + + sig do + override.returns( + { app_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/apps/allowlist_list_response.rbi b/rbi/privy/models/apps/allowlist_list_response.rbi new file mode 100644 index 0000000..3037280 --- /dev/null +++ b/rbi/privy/models/apps/allowlist_list_response.rbi @@ -0,0 +1,13 @@ +# typed: strong + +module Privy + module Models + module Apps + AllowlistListResponse = + T.let( + Privy::Internal::Type::ArrayOf[Privy::AllowlistEntry], + Privy::Internal::Type::Converter + ) + end + end +end diff --git a/rbi/privy/models/asset_account_with_balance.rbi b/rbi/privy/models/asset_account_with_balance.rbi new file mode 100644 index 0000000..799cf82 --- /dev/null +++ b/rbi/privy/models/asset_account_with_balance.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class AssetAccountWithBalance < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AssetAccountWithBalance, Privy::Internal::AnyHash) + end + + # The account ID. + sig { returns(String) } + attr_accessor :id + + # Balances for an asset account or wallet + sig { returns(Privy::BalanceResponse) } + attr_reader :balance + + sig { params(balance: Privy::BalanceResponse::OrHash).void } + attr_writer :balance + + # An optional display name for the account. + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + # The wallets belonging to this account. + sig { returns(T::Array[Privy::AccountWallet]) } + attr_accessor :wallets + + # A digital asset account with its aggregated balance across all wallets and + # chains. + sig do + params( + id: String, + balance: Privy::BalanceResponse::OrHash, + display_name: T.nilable(String), + wallets: T::Array[Privy::AccountWallet::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The account ID. + id:, + # Balances for an asset account or wallet + balance:, + # An optional display name for the account. + display_name:, + # The wallets belonging to this account. + wallets: + ) + end + + sig do + override.returns( + { + id: String, + balance: Privy::BalanceResponse, + display_name: T.nilable(String), + wallets: T::Array[Privy::AccountWallet] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/authenticate_jwt_input.rbi b/rbi/privy/models/authenticate_jwt_input.rbi new file mode 100644 index 0000000..db4b8b2 --- /dev/null +++ b/rbi/privy/models/authenticate_jwt_input.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Privy + module Models + class AuthenticateJwtInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AuthenticateJwtInput, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # Input for authenticating with a custom JWT. + sig do + params( + token: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + token: nil, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { token: String, mode: Privy::AuthenticateModeOption::OrSymbol } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/authenticate_mode.rbi b/rbi/privy/models/authenticate_mode.rbi new file mode 100644 index 0000000..e03373d --- /dev/null +++ b/rbi/privy/models/authenticate_mode.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + module Models + class AuthenticateMode < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AuthenticateMode, Privy::Internal::AnyHash) + end + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # The authentication mode settings for the ceremony. + sig do + params(mode: Privy::AuthenticateModeOption::OrSymbol).returns( + T.attached_class + ) + end + def self.new( + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns({ mode: Privy::AuthenticateModeOption::OrSymbol }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/authenticate_mode_option.rbi b/rbi/privy/models/authenticate_mode_option.rbi new file mode 100644 index 0000000..45f1377 --- /dev/null +++ b/rbi/privy/models/authenticate_mode_option.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Privy + module Models + # Whether to allow sign-up during authentication. + module AuthenticateModeOption + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::AuthenticateModeOption) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NO_SIGNUP = + T.let(:"no-signup", Privy::AuthenticateModeOption::TaggedSymbol) + LOGIN_OR_SIGN_UP = + T.let(:"login-or-sign-up", Privy::AuthenticateModeOption::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::AuthenticateModeOption::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/authenticate_siwe_input.rbi b/rbi/privy/models/authenticate_siwe_input.rbi new file mode 100644 index 0000000..89a1d6a --- /dev/null +++ b/rbi/privy/models/authenticate_siwe_input.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class AuthenticateSiweInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AuthenticateSiweInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :chain_id + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # Input for authenticating a SIWE ceremony. + sig do + params( + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + chain_id: nil, + connector_type: nil, + # Whether to allow sign-up during authentication. + mode: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/authenticate_siws_input.rbi b/rbi/privy/models/authenticate_siws_input.rbi new file mode 100644 index 0000000..cfedf13 --- /dev/null +++ b/rbi/privy/models/authenticate_siws_input.rbi @@ -0,0 +1,106 @@ +# typed: strong + +module Privy + module Models + class AuthenticateSiwsInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AuthenticateSiwsInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig do + returns(T.nilable(Privy::AuthenticateSiwsInput::MessageType::OrSymbol)) + end + attr_reader :message_type + + sig do + params( + message_type: Privy::AuthenticateSiwsInput::MessageType::OrSymbol + ).void + end + attr_writer :message_type + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # Input for authenticating a SIWS ceremony. + sig do + params( + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: Privy::AuthenticateSiwsInput::MessageType::OrSymbol, + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + connector_type: nil, + message_type: nil, + # Whether to allow sign-up during authentication. + mode: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: Privy::AuthenticateSiwsInput::MessageType::OrSymbol, + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + + module MessageType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::AuthenticateSiwsInput::MessageType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION = + T.let( + :transaction, + Privy::AuthenticateSiwsInput::MessageType::TaggedSymbol + ) + PLAIN = + T.let(:plain, Privy::AuthenticateSiwsInput::MessageType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::AuthenticateSiwsInput::MessageType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/authenticated_user.rbi b/rbi/privy/models/authenticated_user.rbi new file mode 100644 index 0000000..972865f --- /dev/null +++ b/rbi/privy/models/authenticated_user.rbi @@ -0,0 +1,135 @@ +# typed: strong + +module Privy + module Models + class AuthenticatedUser < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AuthenticatedUser, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :token + + sig { returns(T.nilable(String)) } + attr_accessor :privy_access_token + + sig { returns(T.nilable(String)) } + attr_accessor :refresh_token + + # Instructs the client on how to handle tokens received + sig { returns(Privy::AuthenticatedUser::SessionUpdateAction::OrSymbol) } + attr_accessor :session_update_action + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + sig { returns(T.nilable(String)) } + attr_reader :identity_token + + sig { params(identity_token: String).void } + attr_writer :identity_token + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_new_user + + sig { params(is_new_user: T::Boolean).void } + attr_writer :is_new_user + + # OAuth tokens associated with the user. + sig { returns(T.nilable(Privy::OAuthTokens)) } + attr_reader :oauth_tokens + + sig { params(oauth_tokens: Privy::OAuthTokens::OrHash).void } + attr_writer :oauth_tokens + + # The authenticated user. + sig do + params( + token: T.nilable(String), + privy_access_token: T.nilable(String), + refresh_token: T.nilable(String), + session_update_action: + Privy::AuthenticatedUser::SessionUpdateAction::OrSymbol, + user: Privy::User::OrHash, + identity_token: String, + is_new_user: T::Boolean, + oauth_tokens: Privy::OAuthTokens::OrHash + ).returns(T.attached_class) + end + def self.new( + token:, + privy_access_token:, + refresh_token:, + # Instructs the client on how to handle tokens received + session_update_action:, + # A Privy user object. + user:, + identity_token: nil, + is_new_user: nil, + # OAuth tokens associated with the user. + oauth_tokens: nil + ) + end + + sig do + override.returns( + { + token: T.nilable(String), + privy_access_token: T.nilable(String), + refresh_token: T.nilable(String), + session_update_action: + Privy::AuthenticatedUser::SessionUpdateAction::OrSymbol, + user: Privy::User, + identity_token: String, + is_new_user: T::Boolean, + oauth_tokens: Privy::OAuthTokens + } + ) + end + def to_hash + end + + # Instructs the client on how to handle tokens received + module SessionUpdateAction + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::AuthenticatedUser::SessionUpdateAction) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SET = + T.let( + :set, + Privy::AuthenticatedUser::SessionUpdateAction::TaggedSymbol + ) + IGNORE = + T.let( + :ignore, + Privy::AuthenticatedUser::SessionUpdateAction::TaggedSymbol + ) + CLEAR = + T.let( + :clear, + Privy::AuthenticatedUser::SessionUpdateAction::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::AuthenticatedUser::SessionUpdateAction::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/authorization_key_dashboard_response.rbi b/rbi/privy/models/authorization_key_dashboard_response.rbi new file mode 100644 index 0000000..d83c962 --- /dev/null +++ b/rbi/privy/models/authorization_key_dashboard_response.rbi @@ -0,0 +1,68 @@ +# typed: strong + +module Privy + module Models + class AuthorizationKeyDashboardResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::AuthorizationKeyDashboardResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + sig { returns(String) } + attr_accessor :public_key + + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + sig { returns(T.nilable(Privy::AuthorizationKeyRole::OrSymbol)) } + attr_accessor :role + + # Dashboard response for a wallet authorization key (includes role, which is an + # internal-only concept). + sig do + params( + id: String, + created_at: Float, + display_name: T.nilable(String), + public_key: String, + role: T.nilable(Privy::AuthorizationKeyRole::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + display_name:, + public_key:, + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + role: + ) + end + + sig do + override.returns( + { + id: String, + created_at: Float, + display_name: T.nilable(String), + public_key: String, + role: T.nilable(Privy::AuthorizationKeyRole::OrSymbol) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/authorization_key_response.rbi b/rbi/privy/models/authorization_key_response.rbi new file mode 100644 index 0000000..3ecc32c --- /dev/null +++ b/rbi/privy/models/authorization_key_response.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class AuthorizationKeyResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::AuthorizationKeyResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(Float) } + attr_accessor :created_at + + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + sig { returns(String) } + attr_accessor :public_key + + # Public-facing response for a wallet authorization key. + sig do + params( + id: String, + created_at: Float, + display_name: T.nilable(String), + public_key: String + ).returns(T.attached_class) + end + def self.new(id:, created_at:, display_name:, public_key:) + end + + sig do + override.returns( + { + id: String, + created_at: Float, + display_name: T.nilable(String), + public_key: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/authorization_key_role.rbi b/rbi/privy/models/authorization_key_role.rbi new file mode 100644 index 0000000..826d0a7 --- /dev/null +++ b/rbi/privy/models/authorization_key_role.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Privy + module Models + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + module AuthorizationKeyRole + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::AuthorizationKeyRole) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ROOT = T.let(:root, Privy::AuthorizationKeyRole::TaggedSymbol) + MANAGER = T.let(:manager, Privy::AuthorizationKeyRole::TaggedSymbol) + DELEGATED_ACTIONS = + T.let(:"delegated-actions", Privy::AuthorizationKeyRole::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::AuthorizationKeyRole::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/balance_asset.rbi b/rbi/privy/models/balance_asset.rbi new file mode 100644 index 0000000..b5490cc --- /dev/null +++ b/rbi/privy/models/balance_asset.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class BalanceAsset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::BalanceAsset, Privy::Internal::AnyHash) } + + # The amount of the asset held, denominated in the unit of the asset itself, with + # 1 decimal of precision. + sig { returns(String) } + attr_accessor :amount + + # A monetary value with its currency denomination. + sig { returns(Privy::CurrencyAmount) } + attr_reader :price + + sig { params(price: Privy::CurrencyAmount::OrHash).void } + attr_writer :price + + # The symbol of the asset (e.g. USDC, ETH). + sig { returns(String) } + attr_accessor :symbol + + # A single asset entry in a balance, representing holdings across all supported + # chains. + sig do + params( + amount: String, + price: Privy::CurrencyAmount::OrHash, + symbol: String + ).returns(T.attached_class) + end + def self.new( + # The amount of the asset held, denominated in the unit of the asset itself, with + # 1 decimal of precision. + amount:, + # A monetary value with its currency denomination. + price:, + # The symbol of the asset (e.g. USDC, ETH). + symbol: + ) + end + + sig do + override.returns( + { amount: String, price: Privy::CurrencyAmount, symbol: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/balance_asset_by_chain.rbi b/rbi/privy/models/balance_asset_by_chain.rbi new file mode 100644 index 0000000..6e6d57d --- /dev/null +++ b/rbi/privy/models/balance_asset_by_chain.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module Privy + module Models + class BalanceAssetByChain < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BalanceAssetByChain, Privy::Internal::AnyHash) + end + + # The amount of the asset held on this chain, denominated in the unit of the asset + # itself. + sig { returns(String) } + attr_accessor :amount + + # The CAIP-2 chain identifier (e.g. eip155:8453). + sig { returns(String) } + attr_accessor :chain_id + + # A monetary value with its currency denomination. + sig { returns(Privy::CurrencyAmount) } + attr_reader :price + + sig { params(price: Privy::CurrencyAmount::OrHash).void } + attr_writer :price + + # The symbol of the asset (e.g. USDC, ETH). + sig { returns(String) } + attr_accessor :symbol + + # A single asset entry scoped to a specific chain. + sig do + params( + amount: String, + chain_id: String, + price: Privy::CurrencyAmount::OrHash, + symbol: String + ).returns(T.attached_class) + end + def self.new( + # The amount of the asset held on this chain, denominated in the unit of the asset + # itself. + amount:, + # The CAIP-2 chain identifier (e.g. eip155:8453). + chain_id:, + # A monetary value with its currency denomination. + price:, + # The symbol of the asset (e.g. USDC, ETH). + symbol: + ) + end + + sig do + override.returns( + { + amount: String, + chain_id: String, + price: Privy::CurrencyAmount, + symbol: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/balance_response.rbi b/rbi/privy/models/balance_response.rbi new file mode 100644 index 0000000..7fb4d62 --- /dev/null +++ b/rbi/privy/models/balance_response.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Privy + module Models + class BalanceResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::BalanceResponse, Privy::Internal::AnyHash) } + + # The individual asset balances, each computed across all supported chains. + sig { returns(T::Array[Privy::BalanceAsset]) } + attr_accessor :assets + + # A monetary value with its currency denomination. + sig { returns(Privy::CurrencyAmount) } + attr_reader :total + + sig { params(total: Privy::CurrencyAmount::OrHash).void } + attr_writer :total + + # Individual asset balances per chain. + sig { returns(T.nilable(T::Array[Privy::BalanceAssetByChain])) } + attr_reader :assets_by_chain + + sig do + params( + assets_by_chain: T::Array[Privy::BalanceAssetByChain::OrHash] + ).void + end + attr_writer :assets_by_chain + + # Balances for an asset account or wallet + sig do + params( + assets: T::Array[Privy::BalanceAsset::OrHash], + total: Privy::CurrencyAmount::OrHash, + assets_by_chain: T::Array[Privy::BalanceAssetByChain::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The individual asset balances, each computed across all supported chains. + assets:, + # A monetary value with its currency denomination. + total:, + # Individual asset balances per chain. + assets_by_chain: nil + ) + end + + sig do + override.returns( + { + assets: T::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + assets_by_chain: T::Array[Privy::BalanceAssetByChain] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/base_action_result.rbi b/rbi/privy/models/base_action_result.rbi new file mode 100644 index 0000000..d4fb6e7 --- /dev/null +++ b/rbi/privy/models/base_action_result.rbi @@ -0,0 +1,68 @@ +# typed: strong + +module Privy + module Models + class BaseActionResult < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BaseActionResult, Privy::Internal::AnyHash) + end + + # Unix timestamp when the action was executed + sig { returns(Float) } + attr_accessor :executed_at + + # HTTP status code from the action execution + sig { returns(Float) } + attr_accessor :status_code + + # Display name of the key quorum that authorized execution + sig { returns(T.nilable(String)) } + attr_reader :authorized_by_display_name + + sig { params(authorized_by_display_name: String).void } + attr_writer :authorized_by_display_name + + # ID of the key quorum that authorized execution + sig { returns(T.nilable(String)) } + attr_reader :authorized_by_id + + sig { params(authorized_by_id: String).void } + attr_writer :authorized_by_id + + # Common fields for intent action execution results. + sig do + params( + executed_at: Float, + status_code: Float, + authorized_by_display_name: String, + authorized_by_id: String + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp when the action was executed + executed_at:, + # HTTP status code from the action execution + status_code:, + # Display name of the key quorum that authorized execution + authorized_by_display_name: nil, + # ID of the key quorum that authorized execution + authorized_by_id: nil + ) + end + + sig do + override.returns( + { + executed_at: Float, + status_code: Float, + authorized_by_display_name: String, + authorized_by_id: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/base_intent_response.rbi b/rbi/privy/models/base_intent_response.rbi new file mode 100644 index 0000000..d678455 --- /dev/null +++ b/rbi/privy/models/base_intent_response.rbi @@ -0,0 +1,144 @@ +# typed: strong + +module Privy + module Models + class BaseIntentResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BaseIntentResponse, Privy::Internal::AnyHash) + end + + # Detailed authorization information including key quorum members, thresholds, and + # signature status + sig { returns(T::Array[Privy::IntentAuthorization]) } + attr_accessor :authorization_details + + # Unix timestamp when the intent was created + sig { returns(Float) } + attr_accessor :created_at + + # Display name of the user who created the intent + sig { returns(String) } + attr_accessor :created_by_display_name + + # Whether this intent has a custom expiry time set by the client. If false, the + # intent expires after a default duration. + sig { returns(T::Boolean) } + attr_accessor :custom_expiry + + # Unix timestamp when the intent expires + sig { returns(Float) } + attr_accessor :expires_at + + # Unique ID for the intent + sig { returns(String) } + attr_accessor :intent_id + + # ID of the resource being modified (wallet_id, policy_id, etc) + sig { returns(String) } + attr_accessor :resource_id + + # Current status of an intent. + sig { returns(Privy::IntentStatus::TaggedSymbol) } + attr_accessor :status + + # ID of the user who created the intent. If undefined, the intent was created + # using the app secret + sig { returns(T.nilable(String)) } + attr_reader :created_by_id + + sig { params(created_by_id: String).void } + attr_writer :created_by_id + + # Human-readable reason for dismissal, present when status is 'dismissed' + sig { returns(T.nilable(String)) } + attr_reader :dismissal_reason + + sig { params(dismissal_reason: String).void } + attr_writer :dismissal_reason + + # Unix timestamp when the intent was dismissed, present when status is 'dismissed' + sig { returns(T.nilable(Float)) } + attr_reader :dismissed_at + + sig { params(dismissed_at: Float).void } + attr_writer :dismissed_at + + # Unix timestamp when the intent was rejected, present when status is 'rejected' + sig { returns(T.nilable(Float)) } + attr_reader :rejected_at + + sig { params(rejected_at: Float).void } + attr_writer :rejected_at + + # Common fields shared by all intent response types. + sig do + params( + authorization_details: T::Array[Privy::IntentAuthorization::OrHash], + created_at: Float, + created_by_display_name: String, + custom_expiry: T::Boolean, + expires_at: Float, + intent_id: String, + resource_id: String, + status: Privy::IntentStatus::OrSymbol, + created_by_id: String, + dismissal_reason: String, + dismissed_at: Float, + rejected_at: Float + ).returns(T.attached_class) + end + def self.new( + # Detailed authorization information including key quorum members, thresholds, and + # signature status + authorization_details:, + # Unix timestamp when the intent was created + created_at:, + # Display name of the user who created the intent + created_by_display_name:, + # Whether this intent has a custom expiry time set by the client. If false, the + # intent expires after a default duration. + custom_expiry:, + # Unix timestamp when the intent expires + expires_at:, + # Unique ID for the intent + intent_id:, + # ID of the resource being modified (wallet_id, policy_id, etc) + resource_id:, + # Current status of an intent. + status:, + # ID of the user who created the intent. If undefined, the intent was created + # using the app secret + created_by_id: nil, + # Human-readable reason for dismissal, present when status is 'dismissed' + dismissal_reason: nil, + # Unix timestamp when the intent was dismissed, present when status is 'dismissed' + dismissed_at: nil, + # Unix timestamp when the intent was rejected, present when status is 'rejected' + rejected_at: nil + ) + end + + sig do + override.returns( + { + authorization_details: T::Array[Privy::IntentAuthorization], + created_at: Float, + created_by_display_name: String, + custom_expiry: T::Boolean, + expires_at: Float, + intent_id: String, + resource_id: String, + status: Privy::IntentStatus::TaggedSymbol, + created_by_id: String, + dismissal_reason: String, + dismissed_at: Float, + rejected_at: Float + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rbi b/rbi/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rbi new file mode 100644 index 0000000..f026c65 --- /dev/null +++ b/rbi/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rbi @@ -0,0 +1,145 @@ +# typed: strong + +module Privy + module Models + class BridgeBrlFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeBrlFiatVirtualAccountDepositInstructions, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_name + + sig do + returns( + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::Asset::OrSymbol + ) + end + attr_accessor :asset + + sig { returns(String) } + attr_accessor :bank_address + + sig { returns(String) } + attr_accessor :bank_name + + sig { returns(String) } + attr_accessor :br_code + + sig do + returns( + T::Array[ + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ) + end + attr_accessor :payment_rails + + # The deposit instructions for a virtual account. + sig do + params( + account_holder_name: String, + asset: + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + br_code: String, + payment_rails: + T::Array[ + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ).returns(T.attached_class) + end + def self.new( + account_holder_name:, + asset:, + bank_address:, + bank_name:, + br_code:, + payment_rails: + ) + end + + sig do + override.returns( + { + account_holder_name: String, + asset: + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + br_code: String, + payment_rails: + T::Array[ + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::Asset + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRL = + T.let( + :brl, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ] + ) + end + def self.values + end + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::PaymentRail + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PIX = + T.let( + :pix, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_crypto_deposit_metadata.rbi b/rbi/privy/models/bridge_crypto_deposit_metadata.rbi new file mode 100644 index 0000000..598c7da --- /dev/null +++ b/rbi/privy/models/bridge_crypto_deposit_metadata.rbi @@ -0,0 +1,118 @@ +# typed: strong + +module Privy + module Models + class BridgeCryptoDepositMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeCryptoDepositMetadata, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :drain_id + + # The crypto address of the liquidation address that received the deposit. + sig { returns(String) } + attr_accessor :liquidation_address + + sig { returns(String) } + attr_accessor :liquidation_address_id + + sig { returns(Privy::BridgeCryptoDepositMetadata::Method::TaggedSymbol) } + attr_accessor :method_ + + # The address that sent the deposit. + sig { returns(String) } + attr_accessor :source_wallet_address + + sig { returns(Privy::BridgeCryptoDepositMetadata::Type::TaggedSymbol) } + attr_accessor :type + + # Bridge metadata for a crypto deposit via liquidation address. + sig do + params( + drain_id: String, + liquidation_address: String, + liquidation_address_id: String, + method_: Privy::BridgeCryptoDepositMetadata::Method::OrSymbol, + source_wallet_address: String, + type: Privy::BridgeCryptoDepositMetadata::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + drain_id:, + # The crypto address of the liquidation address that received the deposit. + liquidation_address:, + liquidation_address_id:, + method_:, + # The address that sent the deposit. + source_wallet_address:, + type: + ) + end + + sig do + override.returns( + { + drain_id: String, + liquidation_address: String, + liquidation_address_id: String, + method_: Privy::BridgeCryptoDepositMetadata::Method::TaggedSymbol, + source_wallet_address: String, + type: Privy::BridgeCryptoDepositMetadata::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeCryptoDepositMetadata::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIQUIDATION_ADDRESS = + T.let( + :liquidation_address, + Privy::BridgeCryptoDepositMetadata::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeCryptoDepositMetadata::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeCryptoDepositMetadata::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CRYPTO_DEPOSIT = + T.let( + :crypto_deposit, + Privy::BridgeCryptoDepositMetadata::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeCryptoDepositMetadata::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_crypto_transfer_metadata.rbi b/rbi/privy/models/bridge_crypto_transfer_metadata.rbi new file mode 100644 index 0000000..4998e2b --- /dev/null +++ b/rbi/privy/models/bridge_crypto_transfer_metadata.rbi @@ -0,0 +1,104 @@ +# typed: strong + +module Privy + module Models + class BridgeCryptoTransferMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeCryptoTransferMetadata, Privy::Internal::AnyHash) + end + + sig { returns(Privy::BridgeCryptoTransferMetadata::Method::TaggedSymbol) } + attr_accessor :method_ + + # The wallet address that sent the transfer. + sig { returns(String) } + attr_accessor :source_wallet_address + + sig { returns(String) } + attr_accessor :transfer_id + + sig { returns(Privy::BridgeCryptoTransferMetadata::Type::TaggedSymbol) } + attr_accessor :type + + # Bridge metadata for a crypto deposit via transfer. + sig do + params( + method_: Privy::BridgeCryptoTransferMetadata::Method::OrSymbol, + source_wallet_address: String, + transfer_id: String, + type: Privy::BridgeCryptoTransferMetadata::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # The wallet address that sent the transfer. + source_wallet_address:, + transfer_id:, + type: + ) + end + + sig do + override.returns( + { + method_: Privy::BridgeCryptoTransferMetadata::Method::TaggedSymbol, + source_wallet_address: String, + transfer_id: String, + type: Privy::BridgeCryptoTransferMetadata::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeCryptoTransferMetadata::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = + T.let( + :transfer, + Privy::BridgeCryptoTransferMetadata::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeCryptoTransferMetadata::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeCryptoTransferMetadata::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CRYPTO_DEPOSIT = + T.let( + :crypto_deposit, + Privy::BridgeCryptoTransferMetadata::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeCryptoTransferMetadata::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_destination_asset.rbi b/rbi/privy/models/bridge_destination_asset.rbi new file mode 100644 index 0000000..b2f4230 --- /dev/null +++ b/rbi/privy/models/bridge_destination_asset.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + module BridgeDestinationAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::BridgeDestinationAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDB = T.let(:usdb, Privy::BridgeDestinationAsset::TaggedSymbol) + USDC = T.let(:usdc, Privy::BridgeDestinationAsset::TaggedSymbol) + USDT = T.let(:usdt, Privy::BridgeDestinationAsset::TaggedSymbol) + DAI = T.let(:dai, Privy::BridgeDestinationAsset::TaggedSymbol) + PYUSD = T.let(:pyusd, Privy::BridgeDestinationAsset::TaggedSymbol) + EURC = T.let(:eurc, Privy::BridgeDestinationAsset::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::BridgeDestinationAsset::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rbi b/rbi/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rbi new file mode 100644 index 0000000..6e08178 --- /dev/null +++ b/rbi/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rbi @@ -0,0 +1,151 @@ +# typed: strong + +module Privy + module Models + class BridgeEurFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeEurFiatVirtualAccountDepositInstructions, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_name + + sig do + returns( + Privy::BridgeEurFiatVirtualAccountDepositInstructions::Asset::OrSymbol + ) + end + attr_accessor :asset + + sig { returns(String) } + attr_accessor :bank_address + + sig { returns(String) } + attr_accessor :bank_name + + sig { returns(String) } + attr_accessor :bic + + sig { returns(String) } + attr_accessor :iban + + sig do + returns( + T::Array[ + Privy::BridgeEurFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ) + end + attr_accessor :payment_rails + + # The deposit instructions for a virtual account. + sig do + params( + account_holder_name: String, + asset: + Privy::BridgeEurFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + bic: String, + iban: String, + payment_rails: + T::Array[ + Privy::BridgeEurFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ).returns(T.attached_class) + end + def self.new( + account_holder_name:, + asset:, + bank_address:, + bank_name:, + bic:, + iban:, + payment_rails: + ) + end + + sig do + override.returns( + { + account_holder_name: String, + asset: + Privy::BridgeEurFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + bic: String, + iban: String, + payment_rails: + T::Array[ + Privy::BridgeEurFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeEurFiatVirtualAccountDepositInstructions::Asset + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EUR = + T.let( + :eur, + Privy::BridgeEurFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeEurFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ] + ) + end + def self.values + end + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeEurFiatVirtualAccountDepositInstructions::PaymentRail + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SEPA = + T.let( + :sepa, + Privy::BridgeEurFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeEurFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_customer_response.rbi b/rbi/privy/models/bridge_fiat_customer_response.rbi new file mode 100644 index 0000000..a37662e --- /dev/null +++ b/rbi/privy/models/bridge_fiat_customer_response.rbi @@ -0,0 +1,166 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatCustomerResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeFiatCustomerResponse, Privy::Internal::AnyHash) + end + + sig { returns(T::Boolean) } + attr_accessor :has_accepted_terms + + sig { returns(Privy::BridgeFiatCustomerResponse::Provider::OrSymbol) } + attr_accessor :provider + + # Status of the KYC verification process. + sig { returns(Privy::BridgeFiatCustomerResponse::Status::OrSymbol) } + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_reader :kyc_url + + sig { params(kyc_url: String).void } + attr_writer :kyc_url + + sig { returns(T.nilable(T::Array[Privy::BridgeFiatRejectionReason])) } + attr_reader :rejection_reasons + + sig do + params( + rejection_reasons: T::Array[Privy::BridgeFiatRejectionReason::OrHash] + ).void + end + attr_writer :rejection_reasons + + # The response for getting a native onramp provider customer. + sig do + params( + has_accepted_terms: T::Boolean, + provider: Privy::BridgeFiatCustomerResponse::Provider::OrSymbol, + status: Privy::BridgeFiatCustomerResponse::Status::OrSymbol, + kyc_url: String, + rejection_reasons: T::Array[Privy::BridgeFiatRejectionReason::OrHash] + ).returns(T.attached_class) + end + def self.new( + has_accepted_terms:, + provider:, + # Status of the KYC verification process. + status:, + kyc_url: nil, + rejection_reasons: nil + ) + end + + sig do + override.returns( + { + has_accepted_terms: T::Boolean, + provider: Privy::BridgeFiatCustomerResponse::Provider::OrSymbol, + status: Privy::BridgeFiatCustomerResponse::Status::OrSymbol, + kyc_url: String, + rejection_reasons: T::Array[Privy::BridgeFiatRejectionReason] + } + ) + end + def to_hash + end + + module Provider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeFiatCustomerResponse::Provider) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE = + T.let( + :bridge, + Privy::BridgeFiatCustomerResponse::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeFiatCustomerResponse::Provider::TaggedSymbol] + ) + end + def self.values + end + end + + # Status of the KYC verification process. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeFiatCustomerResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_FOUND = + T.let( + :not_found, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + ACTIVE = + T.let( + :active, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + AWAITING_QUESTIONNAIRE = + T.let( + :awaiting_questionnaire, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + AWAITING_UBO = + T.let( + :awaiting_ubo, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + INCOMPLETE = + T.let( + :incomplete, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + NOT_STARTED = + T.let( + :not_started, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + OFFBOARDED = + T.let( + :offboarded, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + PAUSED = + T.let( + :paused, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + UNDER_REVIEW = + T.let( + :under_review, + Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeFiatCustomerResponse::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_deposit_metadata.rbi b/rbi/privy/models/bridge_fiat_deposit_metadata.rbi new file mode 100644 index 0000000..908321b --- /dev/null +++ b/rbi/privy/models/bridge_fiat_deposit_metadata.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatDepositMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeFiatDepositMetadata, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :activity_id + + sig { returns(Privy::BridgeFiatDepositMetadata::Method::TaggedSymbol) } + attr_accessor :method_ + + sig { returns(Privy::BridgeFiatDepositMetadata::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :virtual_account_id + + # Bridge metadata for a fiat deposit via virtual account. + sig do + params( + activity_id: String, + method_: Privy::BridgeFiatDepositMetadata::Method::OrSymbol, + type: Privy::BridgeFiatDepositMetadata::Type::OrSymbol, + virtual_account_id: String + ).returns(T.attached_class) + end + def self.new(activity_id:, method_:, type:, virtual_account_id:) + end + + sig do + override.returns( + { + activity_id: String, + method_: Privy::BridgeFiatDepositMetadata::Method::TaggedSymbol, + type: Privy::BridgeFiatDepositMetadata::Type::TaggedSymbol, + virtual_account_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeFiatDepositMetadata::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VIRTUAL_ACCOUNT = + T.let( + :virtual_account, + Privy::BridgeFiatDepositMetadata::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeFiatDepositMetadata::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::BridgeFiatDepositMetadata::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIAT_DEPOSIT = + T.let( + :fiat_deposit, + Privy::BridgeFiatDepositMetadata::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeFiatDepositMetadata::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_rejection_reason.rbi b/rbi/privy/models/bridge_fiat_rejection_reason.rbi new file mode 100644 index 0000000..1f1c45b --- /dev/null +++ b/rbi/privy/models/bridge_fiat_rejection_reason.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatRejectionReason < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeFiatRejectionReason, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :reason + + # A rejection reason for a customer KYC verification. + sig { params(reason: String).returns(T.attached_class) } + def self.new(reason:) + end + + sig { override.returns({ reason: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_transfer_metadata.rbi b/rbi/privy/models/bridge_fiat_transfer_metadata.rbi new file mode 100644 index 0000000..cc83ce3 --- /dev/null +++ b/rbi/privy/models/bridge_fiat_transfer_metadata.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatTransferMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeFiatTransferMetadata, Privy::Internal::AnyHash) + end + + sig { returns(Privy::BridgeFiatTransferMetadata::Method::TaggedSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :transfer_id + + sig { returns(Privy::BridgeFiatTransferMetadata::Type::TaggedSymbol) } + attr_accessor :type + + # Bridge metadata for a fiat deposit via transfer. + sig do + params( + method_: Privy::BridgeFiatTransferMetadata::Method::OrSymbol, + transfer_id: String, + type: Privy::BridgeFiatTransferMetadata::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(method_:, transfer_id:, type:) + end + + sig do + override.returns( + { + method_: Privy::BridgeFiatTransferMetadata::Method::TaggedSymbol, + transfer_id: String, + type: Privy::BridgeFiatTransferMetadata::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeFiatTransferMetadata::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = + T.let( + :transfer, + Privy::BridgeFiatTransferMetadata::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeFiatTransferMetadata::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeFiatTransferMetadata::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIAT_DEPOSIT = + T.let( + :fiat_deposit, + Privy::BridgeFiatTransferMetadata::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeFiatTransferMetadata::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_virtual_account_deposit_instructions.rbi b/rbi/privy/models/bridge_fiat_virtual_account_deposit_instructions.rbi new file mode 100644 index 0000000..4ea64a1 --- /dev/null +++ b/rbi/privy/models/bridge_fiat_virtual_account_deposit_instructions.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + # The deposit instructions for a virtual account. + module BridgeFiatVirtualAccountDepositInstructions + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions, + Privy::BridgeEurFiatVirtualAccountDepositInstructions, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions + ) + end + + sig do + override.returns( + T::Array[Privy::BridgeFiatVirtualAccountDepositInstructions::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_virtual_account_destination.rbi b/rbi/privy/models/bridge_fiat_virtual_account_destination.rbi new file mode 100644 index 0000000..e8a9cc9 --- /dev/null +++ b/rbi/privy/models/bridge_fiat_virtual_account_destination.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatVirtualAccountDestination < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeFiatVirtualAccountDestination, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::BridgeDestinationAsset::OrSymbol) } + attr_accessor :asset + + sig { returns(String) } + attr_accessor :chain + + sig do + params( + address: String, + asset: Privy::BridgeDestinationAsset::OrSymbol, + chain: String + ).returns(T.attached_class) + end + def self.new(address:, asset:, chain:) + end + + sig do + override.returns( + { + address: String, + asset: Privy::BridgeDestinationAsset::OrSymbol, + chain: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_virtual_account_request.rbi b/rbi/privy/models/bridge_fiat_virtual_account_request.rbi new file mode 100644 index 0000000..f78fede --- /dev/null +++ b/rbi/privy/models/bridge_fiat_virtual_account_request.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatVirtualAccountRequest < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeFiatVirtualAccountRequest, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::BridgeFiatVirtualAccountDestination) } + attr_reader :destination + + sig do + params( + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash + ).void + end + attr_writer :destination + + sig do + returns(Privy::BridgeFiatVirtualAccountRequest::Provider::OrSymbol) + end + attr_accessor :provider + + sig { returns(Privy::BridgeFiatVirtualAccountSource) } + attr_reader :source + + sig { params(source: Privy::BridgeFiatVirtualAccountSource::OrHash).void } + attr_writer :source + + # The request input for creating virtual account. + sig do + params( + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash, + provider: Privy::BridgeFiatVirtualAccountRequest::Provider::OrSymbol, + source: Privy::BridgeFiatVirtualAccountSource::OrHash + ).returns(T.attached_class) + end + def self.new(destination:, provider:, source:) + end + + sig do + override.returns( + { + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: + Privy::BridgeFiatVirtualAccountRequest::Provider::OrSymbol, + source: Privy::BridgeFiatVirtualAccountSource + } + ) + end + def to_hash + end + + module Provider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeFiatVirtualAccountRequest::Provider) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE = + T.let( + :bridge, + Privy::BridgeFiatVirtualAccountRequest::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeFiatVirtualAccountRequest::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_virtual_account_response.rbi b/rbi/privy/models/bridge_fiat_virtual_account_response.rbi new file mode 100644 index 0000000..36d71d4 --- /dev/null +++ b/rbi/privy/models/bridge_fiat_virtual_account_response.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatVirtualAccountResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeFiatVirtualAccountResponse, + Privy::Internal::AnyHash + ) + end + + # The deposit instructions for a virtual account. + sig do + returns( + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions, + Privy::BridgeEurFiatVirtualAccountDepositInstructions, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions + ) + ) + end + attr_accessor :deposit_instructions + + sig { returns(Privy::BridgeFiatVirtualAccountDestination) } + attr_reader :destination + + sig do + params( + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash + ).void + end + attr_writer :destination + + sig do + returns(Privy::BridgeFiatVirtualAccountResponse::Provider::OrSymbol) + end + attr_accessor :provider + + sig { returns(String) } + attr_accessor :status + + # The response for creating virtual account. + sig do + params( + deposit_instructions: + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeEurFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::OrHash + ), + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash, + provider: Privy::BridgeFiatVirtualAccountResponse::Provider::OrSymbol, + status: String + ).returns(T.attached_class) + end + def self.new( + # The deposit instructions for a virtual account. + deposit_instructions:, + destination:, + provider:, + status: + ) + end + + sig do + override.returns( + { + deposit_instructions: + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions, + Privy::BridgeEurFiatVirtualAccountDepositInstructions, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions + ), + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: + Privy::BridgeFiatVirtualAccountResponse::Provider::OrSymbol, + status: String + } + ) + end + def to_hash + end + + module Provider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeFiatVirtualAccountResponse::Provider) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE = + T.let( + :bridge, + Privy::BridgeFiatVirtualAccountResponse::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeFiatVirtualAccountResponse::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_fiat_virtual_account_source.rbi b/rbi/privy/models/bridge_fiat_virtual_account_source.rbi new file mode 100644 index 0000000..df4dc46 --- /dev/null +++ b/rbi/privy/models/bridge_fiat_virtual_account_source.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class BridgeFiatVirtualAccountSource < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeFiatVirtualAccountSource, Privy::Internal::AnyHash) + end + + sig { returns(Privy::BridgeSourceAsset::OrSymbol) } + attr_accessor :asset + + sig do + params(asset: Privy::BridgeSourceAsset::OrSymbol).returns( + T.attached_class + ) + end + def self.new(asset:) + end + + sig { override.returns({ asset: Privy::BridgeSourceAsset::OrSymbol }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rbi b/rbi/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rbi new file mode 100644 index 0000000..1a0ee5c --- /dev/null +++ b/rbi/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rbi @@ -0,0 +1,151 @@ +# typed: strong + +module Privy + module Models + class BridgeGbpFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeGbpFiatVirtualAccountDepositInstructions, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_name + + sig { returns(String) } + attr_accessor :account_number + + sig do + returns( + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::Asset::OrSymbol + ) + end + attr_accessor :asset + + sig { returns(String) } + attr_accessor :bank_address + + sig { returns(String) } + attr_accessor :bank_name + + sig do + returns( + T::Array[ + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ) + end + attr_accessor :payment_rails + + sig { returns(String) } + attr_accessor :sort_code + + # The deposit instructions for a virtual account. + sig do + params( + account_holder_name: String, + account_number: String, + asset: + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + payment_rails: + T::Array[ + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ], + sort_code: String + ).returns(T.attached_class) + end + def self.new( + account_holder_name:, + account_number:, + asset:, + bank_address:, + bank_name:, + payment_rails:, + sort_code: + ) + end + + sig do + override.returns( + { + account_holder_name: String, + account_number: String, + asset: + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + payment_rails: + T::Array[ + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ], + sort_code: String + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::Asset + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GBP = + T.let( + :gbp, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ] + ) + end + def self.values + end + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::PaymentRail + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FASTER_PAYMENTS = + T.let( + :faster_payments, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_metadata.rbi b/rbi/privy/models/bridge_metadata.rbi new file mode 100644 index 0000000..4c96446 --- /dev/null +++ b/rbi/privy/models/bridge_metadata.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # Metadata about a Bridge transaction associated with a wallet event. + module BridgeMetadata + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::BridgeCryptoDepositMetadata, + Privy::BridgeRefundMetadata, + Privy::BridgeFiatDepositMetadata, + Privy::BridgeCryptoTransferMetadata, + Privy::BridgeFiatTransferMetadata, + Privy::BridgeTransferRefundMetadata, + Privy::BridgeStaticMemoDepositMetadata + ) + end + + sig { override.returns(T::Array[Privy::BridgeMetadata::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rbi b/rbi/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rbi new file mode 100644 index 0000000..d9d28bc --- /dev/null +++ b/rbi/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rbi @@ -0,0 +1,145 @@ +# typed: strong + +module Privy + module Models + class BridgeMxnFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeMxnFiatVirtualAccountDepositInstructions, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :account_holder_name + + sig do + returns( + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::Asset::OrSymbol + ) + end + attr_accessor :asset + + sig { returns(String) } + attr_accessor :bank_address + + sig { returns(String) } + attr_accessor :bank_name + + sig { returns(String) } + attr_accessor :clabe + + sig do + returns( + T::Array[ + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ) + end + attr_accessor :payment_rails + + # The deposit instructions for a virtual account. + sig do + params( + account_holder_name: String, + asset: + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + clabe: String, + payment_rails: + T::Array[ + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ).returns(T.attached_class) + end + def self.new( + account_holder_name:, + asset:, + bank_address:, + bank_name:, + clabe:, + payment_rails: + ) + end + + sig do + override.returns( + { + account_holder_name: String, + asset: + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_address: String, + bank_name: String, + clabe: String, + payment_rails: + T::Array[ + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::Asset + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MXN = + T.let( + :mxn, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ] + ) + end + def self.values + end + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::PaymentRail + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SPEI = + T.let( + :spei, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_onramp_provider.rbi b/rbi/privy/models/bridge_onramp_provider.rbi new file mode 100644 index 0000000..2317486 --- /dev/null +++ b/rbi/privy/models/bridge_onramp_provider.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Bridge provider variant — production or sandbox. + module BridgeOnrampProvider + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::BridgeOnrampProvider) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE = T.let(:bridge, Privy::BridgeOnrampProvider::TaggedSymbol) + BRIDGE_SANDBOX = + T.let(:"bridge-sandbox", Privy::BridgeOnrampProvider::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::BridgeOnrampProvider::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/bridge_refund_metadata.rbi b/rbi/privy/models/bridge_refund_metadata.rbi new file mode 100644 index 0000000..c74204a --- /dev/null +++ b/rbi/privy/models/bridge_refund_metadata.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module Privy + module Models + class BridgeRefundMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeRefundMetadata, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :drain_id + + sig { returns(String) } + attr_accessor :liquidation_address_id + + sig { returns(Privy::BridgeRefundMetadata::Method::TaggedSymbol) } + attr_accessor :method_ + + # The original deposit transaction hash that triggered the failed drain. + sig { returns(String) } + attr_accessor :original_transaction_hash + + sig { returns(Privy::BridgeRefundMetadata::Type::TaggedSymbol) } + attr_accessor :type + + # Bridge metadata for a refund via liquidation address. + sig do + params( + drain_id: String, + liquidation_address_id: String, + method_: Privy::BridgeRefundMetadata::Method::OrSymbol, + original_transaction_hash: String, + type: Privy::BridgeRefundMetadata::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + drain_id:, + liquidation_address_id:, + method_:, + # The original deposit transaction hash that triggered the failed drain. + original_transaction_hash:, + type: + ) + end + + sig do + override.returns( + { + drain_id: String, + liquidation_address_id: String, + method_: Privy::BridgeRefundMetadata::Method::TaggedSymbol, + original_transaction_hash: String, + type: Privy::BridgeRefundMetadata::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::BridgeRefundMetadata::Method) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIQUIDATION_ADDRESS = + T.let( + :liquidation_address, + Privy::BridgeRefundMetadata::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeRefundMetadata::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::BridgeRefundMetadata::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REFUND = T.let(:refund, Privy::BridgeRefundMetadata::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::BridgeRefundMetadata::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_sandbox_fiat_customer_response.rbi b/rbi/privy/models/bridge_sandbox_fiat_customer_response.rbi new file mode 100644 index 0000000..e4122f6 --- /dev/null +++ b/rbi/privy/models/bridge_sandbox_fiat_customer_response.rbi @@ -0,0 +1,179 @@ +# typed: strong + +module Privy + module Models + class BridgeSandboxFiatCustomerResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeSandboxFiatCustomerResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :has_accepted_terms + + sig do + returns(Privy::BridgeSandboxFiatCustomerResponse::Provider::OrSymbol) + end + attr_accessor :provider + + # Status of the KYC verification process. + sig do + returns(Privy::BridgeSandboxFiatCustomerResponse::Status::OrSymbol) + end + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_reader :kyc_url + + sig { params(kyc_url: String).void } + attr_writer :kyc_url + + sig { returns(T.nilable(T::Array[Privy::BridgeFiatRejectionReason])) } + attr_reader :rejection_reasons + + sig do + params( + rejection_reasons: T::Array[Privy::BridgeFiatRejectionReason::OrHash] + ).void + end + attr_writer :rejection_reasons + + # The response for getting a native onramp provider customer. + sig do + params( + has_accepted_terms: T::Boolean, + provider: + Privy::BridgeSandboxFiatCustomerResponse::Provider::OrSymbol, + status: Privy::BridgeSandboxFiatCustomerResponse::Status::OrSymbol, + kyc_url: String, + rejection_reasons: T::Array[Privy::BridgeFiatRejectionReason::OrHash] + ).returns(T.attached_class) + end + def self.new( + has_accepted_terms:, + provider:, + # Status of the KYC verification process. + status:, + kyc_url: nil, + rejection_reasons: nil + ) + end + + sig do + override.returns( + { + has_accepted_terms: T::Boolean, + provider: + Privy::BridgeSandboxFiatCustomerResponse::Provider::OrSymbol, + status: Privy::BridgeSandboxFiatCustomerResponse::Status::OrSymbol, + kyc_url: String, + rejection_reasons: T::Array[Privy::BridgeFiatRejectionReason] + } + ) + end + def to_hash + end + + module Provider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeSandboxFiatCustomerResponse::Provider) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE_SANDBOX = + T.let( + :"bridge-sandbox", + Privy::BridgeSandboxFiatCustomerResponse::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeSandboxFiatCustomerResponse::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Status of the KYC verification process. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeSandboxFiatCustomerResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NOT_FOUND = + T.let( + :not_found, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + ACTIVE = + T.let( + :active, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + AWAITING_QUESTIONNAIRE = + T.let( + :awaiting_questionnaire, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + AWAITING_UBO = + T.let( + :awaiting_ubo, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + INCOMPLETE = + T.let( + :incomplete, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + NOT_STARTED = + T.let( + :not_started, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + OFFBOARDED = + T.let( + :offboarded, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + PAUSED = + T.let( + :paused, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + UNDER_REVIEW = + T.let( + :under_review, + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeSandboxFiatCustomerResponse::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_sandbox_fiat_virtual_account_request.rbi b/rbi/privy/models/bridge_sandbox_fiat_virtual_account_request.rbi new file mode 100644 index 0000000..191fde3 --- /dev/null +++ b/rbi/privy/models/bridge_sandbox_fiat_virtual_account_request.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Privy + module Models + class BridgeSandboxFiatVirtualAccountRequest < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeSandboxFiatVirtualAccountRequest, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::BridgeFiatVirtualAccountDestination) } + attr_reader :destination + + sig do + params( + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash + ).void + end + attr_writer :destination + + sig do + returns( + Privy::BridgeSandboxFiatVirtualAccountRequest::Provider::OrSymbol + ) + end + attr_accessor :provider + + sig { returns(Privy::BridgeFiatVirtualAccountSource) } + attr_reader :source + + sig { params(source: Privy::BridgeFiatVirtualAccountSource::OrHash).void } + attr_writer :source + + # The request input for creating virtual account. + sig do + params( + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash, + provider: + Privy::BridgeSandboxFiatVirtualAccountRequest::Provider::OrSymbol, + source: Privy::BridgeFiatVirtualAccountSource::OrHash + ).returns(T.attached_class) + end + def self.new(destination:, provider:, source:) + end + + sig do + override.returns( + { + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: + Privy::BridgeSandboxFiatVirtualAccountRequest::Provider::OrSymbol, + source: Privy::BridgeFiatVirtualAccountSource + } + ) + end + def to_hash + end + + module Provider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeSandboxFiatVirtualAccountRequest::Provider + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE_SANDBOX = + T.let( + :"bridge-sandbox", + Privy::BridgeSandboxFiatVirtualAccountRequest::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeSandboxFiatVirtualAccountRequest::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_sandbox_fiat_virtual_account_response.rbi b/rbi/privy/models/bridge_sandbox_fiat_virtual_account_response.rbi new file mode 100644 index 0000000..13a2ae4 --- /dev/null +++ b/rbi/privy/models/bridge_sandbox_fiat_virtual_account_response.rbi @@ -0,0 +1,125 @@ +# typed: strong + +module Privy + module Models + class BridgeSandboxFiatVirtualAccountResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeSandboxFiatVirtualAccountResponse, + Privy::Internal::AnyHash + ) + end + + # The deposit instructions for a virtual account. + sig do + returns( + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions, + Privy::BridgeEurFiatVirtualAccountDepositInstructions, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions + ) + ) + end + attr_accessor :deposit_instructions + + sig { returns(Privy::BridgeFiatVirtualAccountDestination) } + attr_reader :destination + + sig do + params( + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash + ).void + end + attr_writer :destination + + sig do + returns( + Privy::BridgeSandboxFiatVirtualAccountResponse::Provider::OrSymbol + ) + end + attr_accessor :provider + + sig { returns(String) } + attr_accessor :status + + # The response for creating virtual account. + sig do + params( + deposit_instructions: + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeEurFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions::OrHash, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions::OrHash + ), + destination: Privy::BridgeFiatVirtualAccountDestination::OrHash, + provider: + Privy::BridgeSandboxFiatVirtualAccountResponse::Provider::OrSymbol, + status: String + ).returns(T.attached_class) + end + def self.new( + # The deposit instructions for a virtual account. + deposit_instructions:, + destination:, + provider:, + status: + ) + end + + sig do + override.returns( + { + deposit_instructions: + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions, + Privy::BridgeEurFiatVirtualAccountDepositInstructions, + Privy::BridgeMxnFiatVirtualAccountDepositInstructions, + Privy::BridgeBrlFiatVirtualAccountDepositInstructions, + Privy::BridgeGbpFiatVirtualAccountDepositInstructions + ), + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: + Privy::BridgeSandboxFiatVirtualAccountResponse::Provider::OrSymbol, + status: String + } + ) + end + def to_hash + end + + module Provider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeSandboxFiatVirtualAccountResponse::Provider + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE_SANDBOX = + T.let( + :"bridge-sandbox", + Privy::BridgeSandboxFiatVirtualAccountResponse::Provider::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeSandboxFiatVirtualAccountResponse::Provider::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_source_asset.rbi b/rbi/privy/models/bridge_source_asset.rbi new file mode 100644 index 0000000..b83e11d --- /dev/null +++ b/rbi/privy/models/bridge_source_asset.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + module BridgeSourceAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::BridgeSourceAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USD = T.let(:usd, Privy::BridgeSourceAsset::TaggedSymbol) + EUR = T.let(:eur, Privy::BridgeSourceAsset::TaggedSymbol) + MXN = T.let(:mxn, Privy::BridgeSourceAsset::TaggedSymbol) + BRL = T.let(:brl, Privy::BridgeSourceAsset::TaggedSymbol) + GBP = T.let(:gbp, Privy::BridgeSourceAsset::TaggedSymbol) + + sig { override.returns(T::Array[Privy::BridgeSourceAsset::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/bridge_static_memo_deposit_metadata.rbi b/rbi/privy/models/bridge_static_memo_deposit_metadata.rbi new file mode 100644 index 0000000..0765410 --- /dev/null +++ b/rbi/privy/models/bridge_static_memo_deposit_metadata.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module Privy + module Models + class BridgeStaticMemoDepositMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeStaticMemoDepositMetadata, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::BridgeStaticMemoDepositMetadata::Method::TaggedSymbol) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :static_memo_event_id + + sig { returns(String) } + attr_accessor :static_memo_id + + sig do + returns(Privy::BridgeStaticMemoDepositMetadata::Type::TaggedSymbol) + end + attr_accessor :type + + # Bridge metadata for a fiat deposit via static memo. + sig do + params( + method_: Privy::BridgeStaticMemoDepositMetadata::Method::OrSymbol, + static_memo_event_id: String, + static_memo_id: String, + type: Privy::BridgeStaticMemoDepositMetadata::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(method_:, static_memo_event_id:, static_memo_id:, type:) + end + + sig do + override.returns( + { + method_: + Privy::BridgeStaticMemoDepositMetadata::Method::TaggedSymbol, + static_memo_event_id: String, + static_memo_id: String, + type: Privy::BridgeStaticMemoDepositMetadata::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeStaticMemoDepositMetadata::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + STATIC_MEMO = + T.let( + :static_memo, + Privy::BridgeStaticMemoDepositMetadata::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeStaticMemoDepositMetadata::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeStaticMemoDepositMetadata::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FIAT_DEPOSIT = + T.let( + :fiat_deposit, + Privy::BridgeStaticMemoDepositMetadata::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeStaticMemoDepositMetadata::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_transfer_refund_metadata.rbi b/rbi/privy/models/bridge_transfer_refund_metadata.rbi new file mode 100644 index 0000000..d62084d --- /dev/null +++ b/rbi/privy/models/bridge_transfer_refund_metadata.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module Privy + module Models + class BridgeTransferRefundMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::BridgeTransferRefundMetadata, Privy::Internal::AnyHash) + end + + sig { returns(Privy::BridgeTransferRefundMetadata::Method::TaggedSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :transfer_id + + sig { returns(Privy::BridgeTransferRefundMetadata::Type::TaggedSymbol) } + attr_accessor :type + + # The original transfer transaction hash (if available). + sig { returns(T.nilable(String)) } + attr_reader :original_transaction_hash + + sig { params(original_transaction_hash: String).void } + attr_writer :original_transaction_hash + + # Bridge metadata for a transfer refund. + sig do + params( + method_: Privy::BridgeTransferRefundMetadata::Method::OrSymbol, + transfer_id: String, + type: Privy::BridgeTransferRefundMetadata::Type::OrSymbol, + original_transaction_hash: String + ).returns(T.attached_class) + end + def self.new( + method_:, + transfer_id:, + type:, + # The original transfer transaction hash (if available). + original_transaction_hash: nil + ) + end + + sig do + override.returns( + { + method_: Privy::BridgeTransferRefundMetadata::Method::TaggedSymbol, + transfer_id: String, + type: Privy::BridgeTransferRefundMetadata::Type::TaggedSymbol, + original_transaction_hash: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeTransferRefundMetadata::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = + T.let( + :transfer, + Privy::BridgeTransferRefundMetadata::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeTransferRefundMetadata::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::BridgeTransferRefundMetadata::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REFUND = + T.let( + :refund, + Privy::BridgeTransferRefundMetadata::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::BridgeTransferRefundMetadata::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rbi b/rbi/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rbi new file mode 100644 index 0000000..3549152 --- /dev/null +++ b/rbi/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rbi @@ -0,0 +1,162 @@ +# typed: strong + +module Privy + module Models + class BridgeUsdFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::Asset::OrSymbol + ) + end + attr_accessor :asset + + sig { returns(String) } + attr_accessor :bank_account_number + + sig { returns(String) } + attr_accessor :bank_address + + sig { returns(String) } + attr_accessor :bank_beneficiary_address + + sig { returns(String) } + attr_accessor :bank_beneficiary_name + + sig { returns(String) } + attr_accessor :bank_name + + sig { returns(String) } + attr_accessor :bank_routing_number + + sig do + returns( + T::Array[ + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ) + end + attr_accessor :payment_rails + + # The deposit instructions for a virtual account. + sig do + params( + asset: + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_account_number: String, + bank_address: String, + bank_beneficiary_address: String, + bank_beneficiary_name: String, + bank_name: String, + bank_routing_number: String, + payment_rails: + T::Array[ + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + ).returns(T.attached_class) + end + def self.new( + asset:, + bank_account_number:, + bank_address:, + bank_beneficiary_address:, + bank_beneficiary_name:, + bank_name:, + bank_routing_number:, + payment_rails: + ) + end + + sig do + override.returns( + { + asset: + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::Asset::OrSymbol, + bank_account_number: String, + bank_address: String, + bank_beneficiary_address: String, + bank_beneficiary_name: String, + bank_name: String, + bank_routing_number: String, + payment_rails: + T::Array[ + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail::OrSymbol + ] + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::Asset + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USD = + T.let( + :usd, + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::Asset::TaggedSymbol + ] + ) + end + def self.values + end + end + + module PaymentRail + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_PUSH = + T.let( + :ach_push, + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ) + WIRE = + T.let( + :wire, + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::BridgeUsdFiatVirtualAccountDepositInstructions::PaymentRail::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/caip_2.rbi b/rbi/privy/models/caip_2.rbi new file mode 100644 index 0000000..7cd1705 --- /dev/null +++ b/rbi/privy/models/caip_2.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + Caip2 = String + end +end diff --git a/rbi/privy/models/caip_2_chain_id.rbi b/rbi/privy/models/caip_2_chain_id.rbi new file mode 100644 index 0000000..5bdb554 --- /dev/null +++ b/rbi/privy/models/caip_2_chain_id.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + Caip2ChainID = String + end +end diff --git a/rbi/privy/models/coinbase_blockchain.rbi b/rbi/privy/models/coinbase_blockchain.rbi new file mode 100644 index 0000000..b3ee693 --- /dev/null +++ b/rbi/privy/models/coinbase_blockchain.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + # A blockchain supported by Coinbase on-ramp. + module CoinbaseBlockchain + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::CoinbaseBlockchain) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = T.let(:ethereum, Privy::CoinbaseBlockchain::TaggedSymbol) + BITCOIN = T.let(:bitcoin, Privy::CoinbaseBlockchain::TaggedSymbol) + BASE = T.let(:base, Privy::CoinbaseBlockchain::TaggedSymbol) + AVACCHAIN = T.let(:avacchain, Privy::CoinbaseBlockchain::TaggedSymbol) + OPTIMISM = T.let(:optimism, Privy::CoinbaseBlockchain::TaggedSymbol) + SOLANA = T.let(:solana, Privy::CoinbaseBlockchain::TaggedSymbol) + POLYGON = T.let(:polygon, Privy::CoinbaseBlockchain::TaggedSymbol) + ARBITRUM = T.let(:arbitrum, Privy::CoinbaseBlockchain::TaggedSymbol) + STELLAR = T.let(:stellar, Privy::CoinbaseBlockchain::TaggedSymbol) + MONAD = T.let(:monad, Privy::CoinbaseBlockchain::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::CoinbaseBlockchain::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/coinbase_ethereum_asset.rbi b/rbi/privy/models/coinbase_ethereum_asset.rbi new file mode 100644 index 0000000..3f82aca --- /dev/null +++ b/rbi/privy/models/coinbase_ethereum_asset.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # An Ethereum asset supported by Coinbase on-ramp. + module CoinbaseEthereumAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::CoinbaseEthereumAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH = T.let(:eth, Privy::CoinbaseEthereumAsset::TaggedSymbol) + ETH_2 = T.let(:ETH, Privy::CoinbaseEthereumAsset::TaggedSymbol) + USDC = T.let(:USDC, Privy::CoinbaseEthereumAsset::TaggedSymbol) + POL = T.let(:POL, Privy::CoinbaseEthereumAsset::TaggedSymbol) + MON = T.let(:MON, Privy::CoinbaseEthereumAsset::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::CoinbaseEthereumAsset::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_ethereum_address.rbi b/rbi/privy/models/coinbase_on_ramp_ethereum_address.rbi new file mode 100644 index 0000000..0fe7bf6 --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_ethereum_address.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Privy + module Models + class CoinbaseOnRampEthereumAddress < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CoinbaseOnRampEthereumAddress, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(T::Array[Privy::CoinbaseBlockchain::OrSymbol]) } + attr_accessor :blockchains + + # An Ethereum address with supported blockchains for Coinbase on-ramp. + sig do + params( + address: String, + blockchains: T::Array[Privy::CoinbaseBlockchain::OrSymbol] + ).returns(T.attached_class) + end + def self.new(address:, blockchains:) + end + + sig do + override.returns( + { + address: String, + blockchains: T::Array[Privy::CoinbaseBlockchain::OrSymbol] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_init_ethereum_input.rbi b/rbi/privy/models/coinbase_on_ramp_init_ethereum_input.rbi new file mode 100644 index 0000000..fc5e80d --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_init_ethereum_input.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class CoinbaseOnRampInitEthereumInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::CoinbaseOnRampInitEthereumInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[Privy::CoinbaseOnRampEthereumAddress]) } + attr_accessor :addresses + + sig do + returns(T.nilable(T::Array[Privy::CoinbaseEthereumAsset::OrSymbol])) + end + attr_reader :assets + + sig do + params(assets: T::Array[Privy::CoinbaseEthereumAsset::OrSymbol]).void + end + attr_writer :assets + + # Input for initializing a Coinbase on-ramp session for Ethereum. + sig do + params( + addresses: T::Array[Privy::CoinbaseOnRampEthereumAddress::OrHash], + assets: T::Array[Privy::CoinbaseEthereumAsset::OrSymbol] + ).returns(T.attached_class) + end + def self.new(addresses:, assets: nil) + end + + sig do + override.returns( + { + addresses: T::Array[Privy::CoinbaseOnRampEthereumAddress], + assets: T::Array[Privy::CoinbaseEthereumAsset::OrSymbol] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_init_input.rbi b/rbi/privy/models/coinbase_on_ramp_init_input.rbi new file mode 100644 index 0000000..7fcde7e --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_init_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # The input for initializing a Coinbase on-ramp session. + module CoinbaseOnRampInitInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::CoinbaseOnRampInitEthereumInput, + Privy::CoinbaseOnRampInitSolanaInput + ) + end + + sig do + override.returns(T::Array[Privy::CoinbaseOnRampInitInput::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_init_response.rbi b/rbi/privy/models/coinbase_on_ramp_init_response.rbi new file mode 100644 index 0000000..a7ef2b3 --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_init_response.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class CoinbaseOnRampInitResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CoinbaseOnRampInitResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :app_id + + sig { returns(String) } + attr_accessor :channel_id + + sig { returns(String) } + attr_accessor :partner_user_id + + sig { returns(String) } + attr_accessor :session_token + + # The response from initializing a Coinbase on-ramp session. + sig do + params( + app_id: String, + channel_id: String, + partner_user_id: String, + session_token: String + ).returns(T.attached_class) + end + def self.new(app_id:, channel_id:, partner_user_id:, session_token:) + end + + sig do + override.returns( + { + app_id: String, + channel_id: String, + partner_user_id: String, + session_token: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_init_solana_input.rbi b/rbi/privy/models/coinbase_on_ramp_init_solana_input.rbi new file mode 100644 index 0000000..52781a4 --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_init_solana_input.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class CoinbaseOnRampInitSolanaInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CoinbaseOnRampInitSolanaInput, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[Privy::CoinbaseOnRampSolanaAddress]) } + attr_accessor :addresses + + sig { returns(T.nilable(T::Array[Privy::CoinbaseSolanaAsset::OrSymbol])) } + attr_reader :assets + + sig do + params(assets: T::Array[Privy::CoinbaseSolanaAsset::OrSymbol]).void + end + attr_writer :assets + + # Input for initializing a Coinbase on-ramp session for Solana. + sig do + params( + addresses: T::Array[Privy::CoinbaseOnRampSolanaAddress::OrHash], + assets: T::Array[Privy::CoinbaseSolanaAsset::OrSymbol] + ).returns(T.attached_class) + end + def self.new(addresses:, assets: nil) + end + + sig do + override.returns( + { + addresses: T::Array[Privy::CoinbaseOnRampSolanaAddress], + assets: T::Array[Privy::CoinbaseSolanaAsset::OrSymbol] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_solana_address.rbi b/rbi/privy/models/coinbase_on_ramp_solana_address.rbi new file mode 100644 index 0000000..9929cba --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_solana_address.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Privy + module Models + class CoinbaseOnRampSolanaAddress < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CoinbaseOnRampSolanaAddress, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(T::Array[Privy::CoinbaseBlockchain::OrSymbol]) } + attr_accessor :blockchains + + # A Solana address with supported blockchains for Coinbase on-ramp. + sig do + params( + address: String, + blockchains: T::Array[Privy::CoinbaseBlockchain::OrSymbol] + ).returns(T.attached_class) + end + def self.new(address:, blockchains:) + end + + sig do + override.returns( + { + address: String, + blockchains: T::Array[Privy::CoinbaseBlockchain::OrSymbol] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_status.rbi b/rbi/privy/models/coinbase_on_ramp_status.rbi new file mode 100644 index 0000000..6a21553 --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_status.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Status of a Coinbase on-ramp session. + module CoinbaseOnRampStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::CoinbaseOnRampStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:pending, Privy::CoinbaseOnRampStatus::TaggedSymbol) + SUCCESS = T.let(:success, Privy::CoinbaseOnRampStatus::TaggedSymbol) + FAILURE = T.let(:failure, Privy::CoinbaseOnRampStatus::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::CoinbaseOnRampStatus::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/coinbase_on_ramp_status_response.rbi b/rbi/privy/models/coinbase_on_ramp_status_response.rbi new file mode 100644 index 0000000..0d584dc --- /dev/null +++ b/rbi/privy/models/coinbase_on_ramp_status_response.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class CoinbaseOnRampStatusResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CoinbaseOnRampStatusResponse, Privy::Internal::AnyHash) + end + + # Status of a Coinbase on-ramp session. + sig { returns(Privy::CoinbaseOnRampStatus::OrSymbol) } + attr_accessor :status + + # The response for getting the status of a Coinbase on-ramp session. + sig do + params(status: Privy::CoinbaseOnRampStatus::OrSymbol).returns( + T.attached_class + ) + end + def self.new( + # Status of a Coinbase on-ramp session. + status: + ) + end + + sig do + override.returns({ status: Privy::CoinbaseOnRampStatus::OrSymbol }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/coinbase_solana_asset.rbi b/rbi/privy/models/coinbase_solana_asset.rbi new file mode 100644 index 0000000..c0103ec --- /dev/null +++ b/rbi/privy/models/coinbase_solana_asset.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # A Solana asset supported by Coinbase on-ramp. + module CoinbaseSolanaAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::CoinbaseSolanaAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOL = T.let(:SOL, Privy::CoinbaseSolanaAsset::TaggedSymbol) + USDC = T.let(:USDC, Privy::CoinbaseSolanaAsset::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::CoinbaseSolanaAsset::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/condition_operator.rbi b/rbi/privy/models/condition_operator.rbi new file mode 100644 index 0000000..561d718 --- /dev/null +++ b/rbi/privy/models/condition_operator.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # Operator to use for policy conditions. + module ConditionOperator + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::ConditionOperator) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EQ = T.let(:eq, Privy::ConditionOperator::TaggedSymbol) + GT = T.let(:gt, Privy::ConditionOperator::TaggedSymbol) + GTE = T.let(:gte, Privy::ConditionOperator::TaggedSymbol) + LT = T.let(:lt, Privy::ConditionOperator::TaggedSymbol) + LTE = T.let(:lte, Privy::ConditionOperator::TaggedSymbol) + IN = T.let(:in, Privy::ConditionOperator::TaggedSymbol) + IN_CONDITION_SET = + T.let(:in_condition_set, Privy::ConditionOperator::TaggedSymbol) + + sig { override.returns(T::Array[Privy::ConditionOperator::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/condition_set.rbi b/rbi/privy/models/condition_set.rbi new file mode 100644 index 0000000..93d7c84 --- /dev/null +++ b/rbi/privy/models/condition_set.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + class ConditionSet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::ConditionSet, Privy::Internal::AnyHash) } + + # Unique ID of the created condition set. This will be the primary identifier when + # using the condition set in the future. + sig { returns(String) } + attr_accessor :id + + # Unix timestamp of when the condition set was created in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # Name of the condition set. + sig { returns(String) } + attr_accessor :name + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :owner_id + + # A condition set for grouping related condition values. + sig do + params( + id: String, + created_at: Float, + name: String, + owner_id: String + ).returns(T.attached_class) + end + def self.new( + # Unique ID of the created condition set. This will be the primary identifier when + # using the condition set in the future. + id:, + # Unix timestamp of when the condition set was created in milliseconds. + created_at:, + # Name of the condition set. + name:, + # A unique identifier for a key quorum. + owner_id: + ) + end + + sig do + override.returns( + { id: String, created_at: Float, name: String, owner_id: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_set_authorization_headers.rbi b/rbi/privy/models/condition_set_authorization_headers.rbi new file mode 100644 index 0000000..e842c0a --- /dev/null +++ b/rbi/privy/models/condition_set_authorization_headers.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module Privy + module Models + class ConditionSetAuthorizationHeaders < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::ConditionSetAuthorizationHeaders, + Privy::Internal::AnyHash + ) + end + + # ID of your Privy app. + sig { returns(String) } + attr_accessor :privy_app_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + # Headers required to authorize modifications to condition sets. + sig do + params( + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + ).returns(T.attached_class) + end + def self.new( + # ID of your Privy app. + privy_app_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil + ) + end + + sig do + override.returns( + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_set_item.rbi b/rbi/privy/models/condition_set_item.rbi new file mode 100644 index 0000000..d28dd81 --- /dev/null +++ b/rbi/privy/models/condition_set_item.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Privy + module Models + class ConditionSetItem < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ConditionSetItem, Privy::Internal::AnyHash) + end + + # Unique ID of the created condition set item. + sig { returns(String) } + attr_accessor :id + + # Unique ID of the condition set this item belongs to. + sig { returns(String) } + attr_accessor :condition_set_id + + # Unix timestamp of when the condition set item was created in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # The value stored in this condition set item. + sig { returns(String) } + attr_accessor :value + + # A single item in a condition set. + sig do + params( + id: String, + condition_set_id: String, + created_at: Float, + value: String + ).returns(T.attached_class) + end + def self.new( + # Unique ID of the created condition set item. + id:, + # Unique ID of the condition set this item belongs to. + condition_set_id:, + # Unix timestamp of when the condition set item was created in milliseconds. + created_at:, + # The value stored in this condition set item. + value: + ) + end + + sig do + override.returns( + { + id: String, + condition_set_id: String, + created_at: Float, + value: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_set_item_request_params.rbi b/rbi/privy/models/condition_set_item_request_params.rbi new file mode 100644 index 0000000..085c39b --- /dev/null +++ b/rbi/privy/models/condition_set_item_request_params.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + class ConditionSetItemRequestParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ConditionSetItemRequestParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :condition_set_id + + sig { returns(String) } + attr_accessor :condition_set_item_id + + # Unique IDs of the condition set and the condition set item within the condition + # set to take actions on. + sig do + params(condition_set_id: String, condition_set_item_id: String).returns( + T.attached_class + ) + end + def self.new(condition_set_id:, condition_set_item_id:) + end + + sig do + override.returns( + { condition_set_id: String, condition_set_item_id: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_set_item_value_input.rbi b/rbi/privy/models/condition_set_item_value_input.rbi new file mode 100644 index 0000000..e5cf4de --- /dev/null +++ b/rbi/privy/models/condition_set_item_value_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class ConditionSetItemValueInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ConditionSetItemValueInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :value + + # A single value to add to a condition set. + sig { params(value: String).returns(T.attached_class) } + def self.new(value:) + end + + sig { override.returns({ value: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_set_items.rbi b/rbi/privy/models/condition_set_items.rbi new file mode 100644 index 0000000..a908e70 --- /dev/null +++ b/rbi/privy/models/condition_set_items.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + ConditionSetItems = + T.let( + Privy::Internal::Type::ArrayOf[Privy::ConditionSetItem], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/condition_set_items_request_body.rbi b/rbi/privy/models/condition_set_items_request_body.rbi new file mode 100644 index 0000000..8f7fe51 --- /dev/null +++ b/rbi/privy/models/condition_set_items_request_body.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + ConditionSetItemsRequestBody = + T.let( + Privy::Internal::Type::ArrayOf[Privy::ConditionSetItemValueInput], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/condition_set_items_response.rbi b/rbi/privy/models/condition_set_items_response.rbi new file mode 100644 index 0000000..05bf948 --- /dev/null +++ b/rbi/privy/models/condition_set_items_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class ConditionSetItemsResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ConditionSetItemsResponse, Privy::Internal::AnyHash) + end + + # List of condition set items. + sig { returns(T::Array[Privy::ConditionSetItem]) } + attr_accessor :items + + # Cursor for pagination. Null if there are no more items. + sig { returns(T.nilable(String)) } + attr_accessor :next_cursor + + # Paginated list of condition set items. + sig do + params( + items: T::Array[Privy::ConditionSetItem::OrHash], + next_cursor: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # List of condition set items. + items:, + # Cursor for pagination. Null if there are no more items. + next_cursor: + ) + end + + sig do + override.returns( + { + items: T::Array[Privy::ConditionSetItem], + next_cursor: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_set_request_body.rbi b/rbi/privy/models/condition_set_request_body.rbi new file mode 100644 index 0000000..65b79e0 --- /dev/null +++ b/rbi/privy/models/condition_set_request_body.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Privy + module Models + class ConditionSetRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ConditionSetRequestBody, Privy::Internal::AnyHash) + end + + # Name to assign to condition set. + sig { returns(String) } + attr_accessor :name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # Request body for creating a condition set. Exactly one of `owner` or `owner_id` + # is required. + sig do + params( + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Name to assign to condition set. + name:, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil + ) + end + + sig do + override.returns( + { + name: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_set_request_params.rbi b/rbi/privy/models/condition_set_request_params.rbi new file mode 100644 index 0000000..2ba6127 --- /dev/null +++ b/rbi/privy/models/condition_set_request_params.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class ConditionSetRequestParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ConditionSetRequestParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :condition_set_id + + # Unique ID of the condition set to take actions on. + sig { params(condition_set_id: String).returns(T.attached_class) } + def self.new(condition_set_id:) + end + + sig { override.returns({ condition_set_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/condition_value.rbi b/rbi/privy/models/condition_value.rbi new file mode 100644 index 0000000..36fe4c1 --- /dev/null +++ b/rbi/privy/models/condition_value.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + module ConditionValue + extend Privy::Internal::Type::Union + + Variants = T.type_alias { T.any(String, T::Array[String]) } + + sig { override.returns(T::Array[Privy::ConditionValue::Variants]) } + def self.variants + end + + StringArray = + T.let( + Privy::Internal::Type::ArrayOf[String], + Privy::Internal::Type::Converter + ) + end + end +end diff --git a/rbi/privy/models/create_account_from_wallet_ids_input.rbi b/rbi/privy/models/create_account_from_wallet_ids_input.rbi new file mode 100644 index 0000000..94ff243 --- /dev/null +++ b/rbi/privy/models/create_account_from_wallet_ids_input.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Privy + module Models + class CreateAccountFromWalletIDsInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::CreateAccountFromWalletIDsInput, + Privy::Internal::AnyHash + ) + end + + # IDs for wallets to include in this account. + sig { returns(T::Array[String]) } + attr_accessor :wallet_ids + + # An optional display name for the account. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # Input for creating a digital asset account from existing wallets with a + # `wallet_ids` parameter. + sig do + params(wallet_ids: T::Array[String], display_name: String).returns( + T.attached_class + ) + end + def self.new( + # IDs for wallets to include in this account. + wallet_ids:, + # An optional display name for the account. + display_name: nil + ) + end + + sig do + override.returns({ wallet_ids: T::Array[String], display_name: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/create_account_from_wallets_configuration_input.rbi b/rbi/privy/models/create_account_from_wallets_configuration_input.rbi new file mode 100644 index 0000000..6c8cfee --- /dev/null +++ b/rbi/privy/models/create_account_from_wallets_configuration_input.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Privy + module Models + class CreateAccountFromWalletsConfigurationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::CreateAccountFromWalletsConfigurationInput, + Privy::Internal::AnyHash + ) + end + + # Configuration for the wallets on this account. + sig { returns(T::Array[Privy::AccountWalletConfigurationItem]) } + attr_accessor :wallets_configuration + + # An optional display name for the account. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # Input for creating a digital asset account from new wallets with a + # `wallets_configuration` specification. + sig do + params( + wallets_configuration: + T::Array[Privy::AccountWalletConfigurationItem::OrHash], + display_name: String + ).returns(T.attached_class) + end + def self.new( + # Configuration for the wallets on this account. + wallets_configuration:, + # An optional display name for the account. + display_name: nil + ) + end + + sig do + override.returns( + { + wallets_configuration: + T::Array[Privy::AccountWalletConfigurationItem], + display_name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/create_account_input.rbi b/rbi/privy/models/create_account_input.rbi new file mode 100644 index 0000000..d342747 --- /dev/null +++ b/rbi/privy/models/create_account_input.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # Input for creating a digital asset account. + module CreateAccountInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::CreateAccountFromWalletsConfigurationInput, + Privy::CreateAccountFromWalletIDsInput + ) + end + + sig { override.returns(T::Array[Privy::CreateAccountInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/create_or_update_fiat_customer_request_input.rbi b/rbi/privy/models/create_or_update_fiat_customer_request_input.rbi new file mode 100644 index 0000000..64cd7b7 --- /dev/null +++ b/rbi/privy/models/create_or_update_fiat_customer_request_input.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class CreateOrUpdateFiatCustomerRequestInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::CreateOrUpdateFiatCustomerRequestInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Boolean) } + attr_accessor :has_accepted_terms + + # Valid set of onramp providers + sig { returns(Privy::OnrampProvider::OrSymbol) } + attr_accessor :provider + + sig { returns(T.nilable(String)) } + attr_reader :kyc_redirect_url + + sig { params(kyc_redirect_url: String).void } + attr_writer :kyc_redirect_url + + # The request input for creating (or updating) a native onramp provider customer. + sig do + params( + has_accepted_terms: T::Boolean, + provider: Privy::OnrampProvider::OrSymbol, + kyc_redirect_url: String + ).returns(T.attached_class) + end + def self.new( + has_accepted_terms:, + # Valid set of onramp providers + provider:, + kyc_redirect_url: nil + ) + end + + sig do + override.returns( + { + has_accepted_terms: T::Boolean, + provider: Privy::OnrampProvider::OrSymbol, + kyc_redirect_url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/create_organization_secret_response.rbi b/rbi/privy/models/create_organization_secret_response.rbi new file mode 100644 index 0000000..6da9eb5 --- /dev/null +++ b/rbi/privy/models/create_organization_secret_response.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Privy + module Models + class CreateOrganizationSecretResponse < Privy::Models::OrganizationSecretView + OrHash = + T.type_alias do + T.any( + Privy::CreateOrganizationSecretResponse, + Privy::Internal::AnyHash + ) + end + + # The plaintext organization secret. Returned only at creation time. + sig { returns(String) } + attr_accessor :organization_secret + + # Response returned when creating a new organization secret. + sig { params(organization_secret: String).returns(T.attached_class) } + def self.new( + # The plaintext organization secret. Returned only at creation time. + organization_secret: + ) + end + + sig { override.returns({ organization_secret: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/cross_app_connection.rbi b/rbi/privy/models/cross_app_connection.rbi new file mode 100644 index 0000000..9954f94 --- /dev/null +++ b/rbi/privy/models/cross_app_connection.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Privy + module Models + class CrossAppConnection < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CrossAppConnection, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :provider_app_custom_api_url + + sig { returns(T.nilable(String)) } + attr_accessor :provider_app_custom_auth_authorize_url + + sig { returns(T.nilable(String)) } + attr_accessor :provider_app_custom_auth_transact_url + + sig { returns(T.nilable(String)) } + attr_accessor :provider_app_icon_url + + sig { returns(String) } + attr_accessor :provider_app_id + + sig { returns(String) } + attr_accessor :provider_app_name + + sig { returns(T::Boolean) } + attr_accessor :read_only + + # A cross-app connection definition + sig do + params( + provider_app_custom_api_url: T.nilable(String), + provider_app_custom_auth_authorize_url: T.nilable(String), + provider_app_custom_auth_transact_url: T.nilable(String), + provider_app_icon_url: T.nilable(String), + provider_app_id: String, + provider_app_name: String, + read_only: T::Boolean + ).returns(T.attached_class) + end + def self.new( + provider_app_custom_api_url:, + provider_app_custom_auth_authorize_url:, + provider_app_custom_auth_transact_url:, + provider_app_icon_url:, + provider_app_id:, + provider_app_name:, + read_only: + ) + end + + sig do + override.returns( + { + provider_app_custom_api_url: T.nilable(String), + provider_app_custom_auth_authorize_url: T.nilable(String), + provider_app_custom_auth_transact_url: T.nilable(String), + provider_app_icon_url: T.nilable(String), + provider_app_id: String, + provider_app_name: String, + read_only: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/cross_app_connections_response.rbi b/rbi/privy/models/cross_app_connections_response.rbi new file mode 100644 index 0000000..fa6cb3f --- /dev/null +++ b/rbi/privy/models/cross_app_connections_response.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module Privy + module Models + class CrossAppConnectionsResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CrossAppConnectionsResponse, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[Privy::CrossAppConnection]) } + attr_accessor :connections + + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + sig do + returns( + Privy::CrossAppConnectionsResponse::DataClassification::OrSymbol + ) + end + attr_accessor :data_classification + + # The response for getting the list of cross-app connections. + sig do + params( + connections: T::Array[Privy::CrossAppConnection::OrHash], + data_classification: + Privy::CrossAppConnectionsResponse::DataClassification::OrSymbol + ).returns(T.attached_class) + end + def self.new( + connections:, + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + data_classification: + ) + end + + sig do + override.returns( + { + connections: T::Array[Privy::CrossAppConnection], + data_classification: + Privy::CrossAppConnectionsResponse::DataClassification::OrSymbol + } + ) + end + def to_hash + end + + # Indicates that this response contains only publicly accessible data, not a + # privileged resource + module DataClassification + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::CrossAppConnectionsResponse::DataClassification + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PUBLIC = + T.let( + :public, + Privy::CrossAppConnectionsResponse::DataClassification::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::CrossAppConnectionsResponse::DataClassification::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/cross_app_embedded_wallet.rbi b/rbi/privy/models/cross_app_embedded_wallet.rbi new file mode 100644 index 0000000..6ffbc89 --- /dev/null +++ b/rbi/privy/models/cross_app_embedded_wallet.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class CrossAppEmbeddedWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CrossAppEmbeddedWallet, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # An embedded wallet associated with a cross-app account. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/cross_app_smart_wallet.rbi b/rbi/privy/models/cross_app_smart_wallet.rbi new file mode 100644 index 0000000..48604ed --- /dev/null +++ b/rbi/privy/models/cross_app_smart_wallet.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class CrossAppSmartWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CrossAppSmartWallet, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # A smart wallet associated with a cross-app account. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/crypto_currency_code.rbi b/rbi/privy/models/crypto_currency_code.rbi new file mode 100644 index 0000000..589ea6f --- /dev/null +++ b/rbi/privy/models/crypto_currency_code.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + CryptoCurrencyCode = String + end +end diff --git a/rbi/privy/models/currency.rbi b/rbi/privy/models/currency.rbi new file mode 100644 index 0000000..fae1312 --- /dev/null +++ b/rbi/privy/models/currency.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + class Currency < Privy::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Privy::Currency, Privy::Internal::AnyHash) } + + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + sig { returns(String) } + attr_accessor :chain + + # A currency asset type. + sig { returns(T.nilable(Privy::CurrencyAsset::TaggedSymbol)) } + attr_reader :asset + + sig { params(asset: Privy::CurrencyAsset::OrSymbol).void } + attr_writer :asset + + # A crypto currency identified by a CAIP-2 chain ID and optional asset. + sig do + params(chain: String, asset: Privy::CurrencyAsset::OrSymbol).returns( + T.attached_class + ) + end + def self.new( + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + chain:, + # A currency asset type. + asset: nil + ) + end + + sig do + override.returns( + { chain: String, asset: Privy::CurrencyAsset::TaggedSymbol } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/currency_amount.rbi b/rbi/privy/models/currency_amount.rbi new file mode 100644 index 0000000..afbc688 --- /dev/null +++ b/rbi/privy/models/currency_amount.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class CurrencyAmount < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::CurrencyAmount, Privy::Internal::AnyHash) } + + # Currency code + sig { returns(Privy::CurrencyAmount::Currency::OrSymbol) } + attr_accessor :currency + + # The monetary value as a string. + sig { returns(String) } + attr_accessor :value + + # A monetary value with its currency denomination. + sig do + params( + currency: Privy::CurrencyAmount::Currency::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # Currency code + currency:, + # The monetary value as a string. + value: + ) + end + + sig do + override.returns( + { currency: Privy::CurrencyAmount::Currency::OrSymbol, value: String } + ) + end + def to_hash + end + + # Currency code + module Currency + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::CurrencyAmount::Currency) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USD = T.let(:usd, Privy::CurrencyAmount::Currency::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::CurrencyAmount::Currency::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/currency_asset.rbi b/rbi/privy/models/currency_asset.rbi new file mode 100644 index 0000000..0471f6b --- /dev/null +++ b/rbi/privy/models/currency_asset.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + # A currency asset type. + module CurrencyAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::CurrencyAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NATIVE_CURRENCY = + T.let(:"native-currency", Privy::CurrencyAsset::TaggedSymbol) + USDC = T.let(:USDC, Privy::CurrencyAsset::TaggedSymbol) + + sig { override.returns(T::Array[Privy::CurrencyAsset::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/curve_signing_chain_type.rbi b/rbi/privy/models/curve_signing_chain_type.rbi new file mode 100644 index 0000000..b4be675 --- /dev/null +++ b/rbi/privy/models/curve_signing_chain_type.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + # The wallet chain types that support curve-based signing. + module CurveSigningChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::CurveSigningChainType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COSMOS = T.let(:cosmos, Privy::CurveSigningChainType::TaggedSymbol) + STELLAR = T.let(:stellar, Privy::CurveSigningChainType::TaggedSymbol) + SUI = T.let(:sui, Privy::CurveSigningChainType::TaggedSymbol) + APTOS = T.let(:aptos, Privy::CurveSigningChainType::TaggedSymbol) + MOVEMENT = T.let(:movement, Privy::CurveSigningChainType::TaggedSymbol) + TRON = T.let(:tron, Privy::CurveSigningChainType::TaggedSymbol) + BITCOIN_SEGWIT = + T.let(:"bitcoin-segwit", Privy::CurveSigningChainType::TaggedSymbol) + BITCOIN_TAPROOT = + T.let(:"bitcoin-taproot", Privy::CurveSigningChainType::TaggedSymbol) + PEARL = T.let(:pearl, Privy::CurveSigningChainType::TaggedSymbol) + NEAR = T.let(:near, Privy::CurveSigningChainType::TaggedSymbol) + TON = T.let(:ton, Privy::CurveSigningChainType::TaggedSymbol) + STARKNET = T.let(:starknet, Privy::CurveSigningChainType::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::CurveSigningChainType::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/curve_type.rbi b/rbi/privy/models/curve_type.rbi new file mode 100644 index 0000000..ae41c0f --- /dev/null +++ b/rbi/privy/models/curve_type.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + # The cryptographic curve type used by the wallet. + module CurveType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::CurveType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SECP256K1 = T.let(:secp256k1, Privy::CurveType::TaggedSymbol) + ED25519 = T.let(:ed25519, Privy::CurveType::TaggedSymbol) + STARKNET = T.let(:starknet, Privy::CurveType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::CurveType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/custodial_wallet.rbi b/rbi/privy/models/custodial_wallet.rbi new file mode 100644 index 0000000..833da73 --- /dev/null +++ b/rbi/privy/models/custodial_wallet.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Privy + module Models + class CustodialWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::CustodialWallet, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :address + + # The chain type of the custodial wallet. + sig { returns(Privy::CustodialWalletChainType::OrSymbol) } + attr_accessor :chain_type + + # Information about the custodian managing this wallet. + sig { returns(Privy::WalletCustodian) } + attr_reader :custody + + sig { params(custody: Privy::WalletCustodian::OrHash).void } + attr_writer :custody + + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # Additional signers for the wallet. + sig { returns(T.nilable(T::Array[Privy::WalletAdditionalSignerItem])) } + attr_reader :additional_signers + + sig do + params( + additional_signers: + T::Array[Privy::WalletAdditionalSignerItem::OrHash] + ).void + end + attr_writer :additional_signers + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + # Information about a custodial wallet. + sig do + params( + id: String, + address: String, + chain_type: Privy::CustodialWalletChainType::OrSymbol, + custody: Privy::WalletCustodian::OrHash, + owner_id: T.nilable(String), + additional_signers: + T::Array[Privy::WalletAdditionalSignerItem::OrHash], + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + id:, + address:, + # The chain type of the custodial wallet. + chain_type:, + # Information about the custodian managing this wallet. + custody:, + owner_id:, + # Additional signers for the wallet. + additional_signers: nil, + policy_ids: nil + ) + end + + sig do + override.returns( + { + id: String, + address: String, + chain_type: Privy::CustodialWalletChainType::OrSymbol, + custody: Privy::WalletCustodian, + owner_id: T.nilable(String), + additional_signers: T::Array[Privy::WalletAdditionalSignerItem], + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/custodial_wallet_chain_type.rbi b/rbi/privy/models/custodial_wallet_chain_type.rbi new file mode 100644 index 0000000..280848b --- /dev/null +++ b/rbi/privy/models/custodial_wallet_chain_type.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Privy + module Models + # The chain type of the custodial wallet. + module CustodialWalletChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::CustodialWalletChainType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = T.let(:ethereum, Privy::CustodialWalletChainType::TaggedSymbol) + SOLANA = T.let(:solana, Privy::CustodialWalletChainType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::CustodialWalletChainType::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/custodial_wallet_create_input.rbi b/rbi/privy/models/custodial_wallet_create_input.rbi new file mode 100644 index 0000000..e688b80 --- /dev/null +++ b/rbi/privy/models/custodial_wallet_create_input.rbi @@ -0,0 +1,106 @@ +# typed: strong + +module Privy + module Models + class CustodialWalletCreateInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CustodialWalletCreateInput, Privy::Internal::AnyHash) + end + + # The chain type of the custodial wallet. + sig { returns(Privy::CustodialWalletChainType::OrSymbol) } + attr_accessor :chain_type + + # The provider of the custodial wallet. + sig { returns(Privy::CustodialWalletProvider::OrSymbol) } + attr_accessor :provider + + # The resource ID of the beneficiary of the custodial wallet, given by the + # licensing provider. + sig { returns(String) } + attr_accessor :provider_user_id + + # Additional signers for the wallet. + sig { returns(T.nilable(T::Array[Privy::AdditionalSignerItemInput])) } + attr_reader :additional_signers + + sig do + params( + additional_signers: T::Array[Privy::AdditionalSignerItemInput::OrHash] + ).void + end + attr_writer :additional_signers + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # An optional list of up to one policy ID to enforce on the wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + # The input for creating a custodial wallet. + sig do + params( + chain_type: Privy::CustodialWalletChainType::OrSymbol, + provider: Privy::CustodialWalletProvider::OrSymbol, + provider_user_id: String, + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The chain type of the custodial wallet. + chain_type:, + # The provider of the custodial wallet. + provider:, + # The resource ID of the beneficiary of the custodial wallet, given by the + # licensing provider. + provider_user_id:, + # Additional signers for the wallet. + additional_signers: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # An optional list of up to one policy ID to enforce on the wallet. + policy_ids: nil + ) + end + + sig do + override.returns( + { + chain_type: Privy::CustodialWalletChainType::OrSymbol, + provider: Privy::CustodialWalletProvider::OrSymbol, + provider_user_id: String, + additional_signers: T::Array[Privy::AdditionalSignerItemInput], + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/custodial_wallet_provider.rbi b/rbi/privy/models/custodial_wallet_provider.rbi new file mode 100644 index 0000000..785658a --- /dev/null +++ b/rbi/privy/models/custodial_wallet_provider.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # The provider of the custodial wallet. + module CustodialWalletProvider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::CustodialWalletProvider) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE = T.let(:bridge, Privy::CustodialWalletProvider::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::CustodialWalletProvider::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/custom_jwt_authenticate_request_body.rbi b/rbi/privy/models/custom_jwt_authenticate_request_body.rbi new file mode 100644 index 0000000..e848a7c --- /dev/null +++ b/rbi/privy/models/custom_jwt_authenticate_request_body.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Models + class CustomJwtAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::CustomJwtAuthenticateRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # The request body for authenticating with a custom JWT. + sig do + params( + token: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + token: nil, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { token: String, mode: Privy::AuthenticateModeOption::OrSymbol } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/custom_jwt_link_request_body.rbi b/rbi/privy/models/custom_jwt_link_request_body.rbi new file mode 100644 index 0000000..46f4ccf --- /dev/null +++ b/rbi/privy/models/custom_jwt_link_request_body.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class CustomJwtLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CustomJwtLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The request body for linking a custom JWT account. + sig { params(token: String).returns(T.attached_class) } + def self.new(token: nil) + end + + sig { override.returns({ token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/custom_metadata.rbi b/rbi/privy/models/custom_metadata.rbi new file mode 100644 index 0000000..822ddf3 --- /dev/null +++ b/rbi/privy/models/custom_metadata.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + module CustomMetadataItem + extend Privy::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Float, T::Boolean) } + + sig { override.returns(T::Array[Privy::CustomMetadataItem::Variants]) } + def self.variants + end + end + + CustomMetadata = + T.let( + Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/custom_oauth_provider_id.rbi b/rbi/privy/models/custom_oauth_provider_id.rbi new file mode 100644 index 0000000..7b9823f --- /dev/null +++ b/rbi/privy/models/custom_oauth_provider_id.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + CustomOAuthProviderID = String + end +end diff --git a/rbi/privy/models/custom_token_transfer_source.rbi b/rbi/privy/models/custom_token_transfer_source.rbi new file mode 100644 index 0000000..4c69acb --- /dev/null +++ b/rbi/privy/models/custom_token_transfer_source.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class CustomTokenTransferSource < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::CustomTokenTransferSource, Privy::Internal::AnyHash) + end + + # Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 + # USDC, "0.01" for 0.01 ETH). Not in the smallest on-chain unit (wei, lamports, + # etc.). + sig { returns(String) } + attr_accessor :amount + + # The token contract address (EVM) or mint address (Solana) of the asset to + # transfer. + sig { returns(String) } + attr_accessor :asset_address + + # The blockchain network on which to perform the transfer. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and their + # respective testnets. + sig { returns(String) } + attr_accessor :chain + + # Source for a transfer identified by a token contract address (EVM) or mint + # address (Solana). Use this variant for tokens that are not first-class assets. + sig do + params(amount: String, asset_address: String, chain: String).returns( + T.attached_class + ) + end + def self.new( + # Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 + # USDC, "0.01" for 0.01 ETH). Not in the smallest on-chain unit (wei, lamports, + # etc.). + amount:, + # The token contract address (EVM) or mint address (Solana) of the asset to + # transfer. + asset_address:, + # The blockchain network on which to perform the transfer. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and their + # respective testnets. + chain: + ) + end + + sig do + override.returns( + { amount: String, asset_address: String, chain: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/earn_asset.rbi b/rbi/privy/models/earn_asset.rbi new file mode 100644 index 0000000..91a9561 --- /dev/null +++ b/rbi/privy/models/earn_asset.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class EarnAsset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::EarnAsset, Privy::Internal::AnyHash) } + + # Token contract address. + sig { returns(String) } + attr_accessor :address + + # Number of decimals for the asset (e.g. 6 for USDC). + sig { returns(Integer) } + attr_accessor :decimals + + # Lowercase token symbol (e.g. "usdc"). + sig { returns(String) } + attr_accessor :symbol + + # Asset metadata for an earn vault position. + sig do + params(address: String, decimals: Integer, symbol: String).returns( + T.attached_class + ) + end + def self.new( + # Token contract address. + address:, + # Number of decimals for the asset (e.g. 6 for USDC). + decimals:, + # Lowercase token symbol (e.g. "usdc"). + symbol: + ) + end + + sig do + override.returns({ address: String, decimals: Integer, symbol: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/earn_deposit_action_response.rbi b/rbi/privy/models/earn_deposit_action_response.rbi new file mode 100644 index 0000000..4e2bc47 --- /dev/null +++ b/rbi/privy/models/earn_deposit_action_response.rbi @@ -0,0 +1,219 @@ +# typed: strong + +module Privy + module Models + class EarnDepositActionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EarnDepositActionResponse, Privy::Internal::AnyHash) + end + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :id + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # ISO 8601 timestamp of when the wallet action was created. + sig { returns(Time) } + attr_accessor :created_at + + # Base-unit amount of asset deposited (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # Vault shares received in base units. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :share_amount + + # Status of a wallet action. + sig { returns(Privy::WalletActionStatus::TaggedSymbol) } + attr_accessor :status + + sig { returns(Privy::EarnDepositActionResponse::Type::TaggedSymbol) } + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # The steps of the wallet action. Only returned if `?include=steps` is provided. + sig { returns(T.nilable(T::Array[Privy::WalletActionStep::Variants])) } + attr_reader :steps + + sig do + params( + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).void + end + attr_writer :steps + + # Response for an earn deposit action. + sig do + params( + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: T.nilable(String), + status: Privy::WalletActionStatus::OrSymbol, + type: Privy::EarnDepositActionResponse::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason::OrHash, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # The ID of the wallet action. + id:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # ISO 8601 timestamp of when the wallet action was created. + created_at:, + # Base-unit amount of asset deposited (e.g. "1500000"). + raw_amount:, + # Vault shares received in base units. Populated after on-chain confirmation. + share_amount:, + # Status of a wallet action. + status:, + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil, + # The steps of the wallet action. Only returned if `?include=steps` is provided. + steps: nil + ) + end + + sig do + override.returns( + { + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: T.nilable(String), + status: Privy::WalletActionStatus::TaggedSymbol, + type: Privy::EarnDepositActionResponse::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason, + steps: T::Array[Privy::WalletActionStep::Variants] + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EarnDepositActionResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EARN_DEPOSIT = + T.let( + :earn_deposit, + Privy::EarnDepositActionResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EarnDepositActionResponse::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/earn_deposit_request_body.rbi b/rbi/privy/models/earn_deposit_request_body.rbi new file mode 100644 index 0000000..2cfde40 --- /dev/null +++ b/rbi/privy/models/earn_deposit_request_body.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class EarnDepositRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EarnDepositRequestBody, Privy::Internal::AnyHash) + end + + # The ID of the vault to deposit into. + sig { returns(String) } + attr_accessor :vault_id + + # Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one + # of `amount` or `raw_amount` must be provided. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6 + # decimals). Exactly one of `amount` or `raw_amount` must be provided. + sig { returns(T.nilable(String)) } + attr_reader :raw_amount + + sig { params(raw_amount: String).void } + attr_writer :raw_amount + + # Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or + # `raw_amount` must be provided. + sig do + params(vault_id: String, amount: String, raw_amount: String).returns( + T.attached_class + ) + end + def self.new( + # The ID of the vault to deposit into. + vault_id:, + # Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one + # of `amount` or `raw_amount` must be provided. + amount: nil, + # Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6 + # decimals). Exactly one of `amount` or `raw_amount` must be provided. + raw_amount: nil + ) + end + + sig do + override.returns( + { vault_id: String, amount: String, raw_amount: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/earn_incentive_claim_action_response.rbi b/rbi/privy/models/earn_incentive_claim_action_response.rbi new file mode 100644 index 0000000..64a4258 --- /dev/null +++ b/rbi/privy/models/earn_incentive_claim_action_response.rbi @@ -0,0 +1,158 @@ +# typed: strong + +module Privy + module Models + class EarnIncentiveClaimActionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EarnIncentiveClaimActionResponse, + Privy::Internal::AnyHash + ) + end + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :id + + # EVM chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :chain + + # ISO 8601 timestamp of when the wallet action was created. + sig { returns(Time) } + attr_accessor :created_at + + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + sig { returns(T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry])) } + attr_accessor :rewards + + # Status of a wallet action. + sig { returns(Privy::WalletActionStatus::TaggedSymbol) } + attr_accessor :status + + sig do + returns(Privy::EarnIncentiveClaimActionResponse::Type::TaggedSymbol) + end + attr_accessor :type + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # The steps of the wallet action. Only returned if `?include=steps` is provided. + sig { returns(T.nilable(T::Array[Privy::WalletActionStep::Variants])) } + attr_reader :steps + + sig do + params( + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).void + end + attr_writer :steps + + # Response for an earn incentive claim action. + sig do + params( + id: String, + chain: String, + created_at: Time, + rewards: + T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry::OrHash]), + status: Privy::WalletActionStatus::OrSymbol, + type: Privy::EarnIncentiveClaimActionResponse::Type::OrSymbol, + wallet_id: String, + failure_reason: Privy::FailureReason::OrHash, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # The ID of the wallet action. + id:, + # EVM chain name (e.g. "base", "ethereum"). + chain:, + # ISO 8601 timestamp of when the wallet action was created. + created_at:, + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + rewards:, + # Status of a wallet action. + status:, + type:, + # The ID of the wallet involved in the action. + wallet_id:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil, + # The steps of the wallet action. Only returned if `?include=steps` is provided. + steps: nil + ) + end + + sig do + override.returns( + { + id: String, + chain: String, + created_at: Time, + rewards: T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry]), + status: Privy::WalletActionStatus::TaggedSymbol, + type: Privy::EarnIncentiveClaimActionResponse::Type::TaggedSymbol, + wallet_id: String, + failure_reason: Privy::FailureReason, + steps: T::Array[Privy::WalletActionStep::Variants] + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EarnIncentiveClaimActionResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EARN_INCENTIVE_CLAIM = + T.let( + :earn_incentive_claim, + Privy::EarnIncentiveClaimActionResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EarnIncentiveClaimActionResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/earn_incentive_claim_request_body.rbi b/rbi/privy/models/earn_incentive_claim_request_body.rbi new file mode 100644 index 0000000..0cc0599 --- /dev/null +++ b/rbi/privy/models/earn_incentive_claim_request_body.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Privy + module Models + class EarnIncentiveClaimRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EarnIncentiveClaimRequestBody, Privy::Internal::AnyHash) + end + + # The blockchain network on which to perform the incentive claim. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along + # with their respective testnets. + sig { returns(String) } + attr_accessor :chain + + # Input for claiming incentive rewards. + sig { params(chain: String).returns(T.attached_class) } + def self.new( + # The blockchain network on which to perform the incentive claim. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along + # with their respective testnets. + chain: + ) + end + + sig { override.returns({ chain: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/earn_incetive_claim_reward_entry.rbi b/rbi/privy/models/earn_incetive_claim_reward_entry.rbi new file mode 100644 index 0000000..fd51825 --- /dev/null +++ b/rbi/privy/models/earn_incetive_claim_reward_entry.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Privy + module Models + class EarnIncetiveClaimRewardEntry < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EarnIncetiveClaimRewardEntry, Privy::Internal::AnyHash) + end + + # Claimable amount in base units. + sig { returns(String) } + attr_accessor :amount + + # Address of the reward token. + sig { returns(String) } + attr_accessor :token_address + + # Symbol of the reward token (e.g. "MORPHO"). + sig { returns(String) } + attr_accessor :token_symbol + + # Number of decimal places for the reward token. + sig { returns(T.nilable(Integer)) } + attr_reader :token_decimals + + sig { params(token_decimals: Integer).void } + attr_writer :token_decimals + + # A specific reward token and amount associated with an earn incentive claim. + sig do + params( + amount: String, + token_address: String, + token_symbol: String, + token_decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Claimable amount in base units. + amount:, + # Address of the reward token. + token_address:, + # Symbol of the reward token (e.g. "MORPHO"). + token_symbol:, + # Number of decimal places for the reward token. + token_decimals: nil + ) + end + + sig do + override.returns( + { + amount: String, + token_address: String, + token_symbol: String, + token_decimals: Integer + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/earn_withdraw_action_response.rbi b/rbi/privy/models/earn_withdraw_action_response.rbi new file mode 100644 index 0000000..06185d1 --- /dev/null +++ b/rbi/privy/models/earn_withdraw_action_response.rbi @@ -0,0 +1,221 @@ +# typed: strong + +module Privy + module Models + class EarnWithdrawActionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EarnWithdrawActionResponse, Privy::Internal::AnyHash) + end + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :id + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # ISO 8601 timestamp of when the wallet action was created. + sig { returns(Time) } + attr_accessor :created_at + + # Base-unit amount of asset withdrawn (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # Vault shares burned in base units. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :share_amount + + # Status of a wallet action. + sig { returns(Privy::WalletActionStatus::TaggedSymbol) } + attr_accessor :status + + sig { returns(Privy::EarnWithdrawActionResponse::Type::TaggedSymbol) } + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # The steps of the wallet action. Only returned if `?include=steps` is provided. + sig { returns(T.nilable(T::Array[Privy::WalletActionStep::Variants])) } + attr_reader :steps + + sig do + params( + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).void + end + attr_writer :steps + + # Response for an earn withdraw action. + sig do + params( + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: T.nilable(String), + status: Privy::WalletActionStatus::OrSymbol, + type: Privy::EarnWithdrawActionResponse::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason::OrHash, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # The ID of the wallet action. + id:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # ISO 8601 timestamp of when the wallet action was created. + created_at:, + # Base-unit amount of asset withdrawn (e.g. "1500000"). + raw_amount:, + # Vault shares burned in base units. Populated after on-chain confirmation. + share_amount:, + # Status of a wallet action. + status:, + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil, + # The steps of the wallet action. Only returned if `?include=steps` is provided. + steps: nil + ) + end + + sig do + override.returns( + { + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: T.nilable(String), + status: Privy::WalletActionStatus::TaggedSymbol, + type: Privy::EarnWithdrawActionResponse::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason, + steps: T::Array[Privy::WalletActionStep::Variants] + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EarnWithdrawActionResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EARN_WITHDRAW = + T.let( + :earn_withdraw, + Privy::EarnWithdrawActionResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EarnWithdrawActionResponse::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/earn_withdraw_request_body.rbi b/rbi/privy/models/earn_withdraw_request_body.rbi new file mode 100644 index 0000000..1019e73 --- /dev/null +++ b/rbi/privy/models/earn_withdraw_request_body.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class EarnWithdrawRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EarnWithdrawRequestBody, Privy::Internal::AnyHash) + end + + # The ID of the vault to withdraw from. + sig { returns(String) } + attr_accessor :vault_id + + # Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one + # of `amount` or `raw_amount` must be provided. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6 + # decimals). Exactly one of `amount` or `raw_amount` must be provided. + sig { returns(T.nilable(String)) } + attr_reader :raw_amount + + sig { params(raw_amount: String).void } + attr_writer :raw_amount + + # Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or + # `raw_amount` must be provided. + sig do + params(vault_id: String, amount: String, raw_amount: String).returns( + T.attached_class + ) + end + def self.new( + # The ID of the vault to withdraw from. + vault_id:, + # Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one + # of `amount` or `raw_amount` must be provided. + amount: nil, + # Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6 + # decimals). Exactly one of `amount` or `raw_amount` must be provided. + raw_amount: nil + ) + end + + sig do + override.returns( + { vault_id: String, amount: String, raw_amount: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/email_domain.rbi b/rbi/privy/models/email_domain.rbi new file mode 100644 index 0000000..5754f88 --- /dev/null +++ b/rbi/privy/models/email_domain.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + EmailDomain = String + end +end diff --git a/rbi/privy/models/email_domain_invite_input.rbi b/rbi/privy/models/email_domain_invite_input.rbi new file mode 100644 index 0000000..c7097c8 --- /dev/null +++ b/rbi/privy/models/email_domain_invite_input.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class EmailDomainInviteInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EmailDomainInviteInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EmailDomainInviteInput::Type::OrSymbol) } + attr_accessor :type + + # An email domain. + sig { returns(String) } + attr_accessor :value + + # Allowlist invite input for an email domain. + sig do + params( + type: Privy::EmailDomainInviteInput::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + type:, + # An email domain. + value: + ) + end + + sig do + override.returns( + { type: Privy::EmailDomainInviteInput::Type::OrSymbol, value: String } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EmailDomainInviteInput::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL_DOMAIN = + T.let(:emailDomain, Privy::EmailDomainInviteInput::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::EmailDomainInviteInput::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/email_invite_input.rbi b/rbi/privy/models/email_invite_input.rbi new file mode 100644 index 0000000..2ca7c43 --- /dev/null +++ b/rbi/privy/models/email_invite_input.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class EmailInviteInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EmailInviteInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EmailInviteInput::Type::OrSymbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + # Allowlist invite input for an email address. + sig do + params( + type: Privy::EmailInviteInput::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new(type:, value:) + end + + sig do + override.returns( + { type: Privy::EmailInviteInput::Type::OrSymbol, value: String } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EmailInviteInput::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL = T.let(:email, Privy::EmailInviteInput::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::EmailInviteInput::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/embedded_wallet_chain_config.rbi b/rbi/privy/models/embedded_wallet_chain_config.rbi new file mode 100644 index 0000000..24be2ff --- /dev/null +++ b/rbi/privy/models/embedded_wallet_chain_config.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + class EmbeddedWalletChainConfig < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EmbeddedWalletChainConfig, Privy::Internal::AnyHash) + end + + # Whether to create embedded wallets on login. + sig { returns(Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol) } + attr_accessor :create_on_login + + # Chain-specific configuration for embedded wallets. + sig do + params( + create_on_login: Privy::EmbeddedWalletCreateOnLogin::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Whether to create embedded wallets on login. + create_on_login: + ) + end + + sig do + override.returns( + { create_on_login: Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/embedded_wallet_config_schema.rbi b/rbi/privy/models/embedded_wallet_config_schema.rbi new file mode 100644 index 0000000..5596b46 --- /dev/null +++ b/rbi/privy/models/embedded_wallet_config_schema.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class EmbeddedWalletConfigSchema < Privy::Models::EmbeddedWalletInputSchema + OrHash = + T.type_alias do + T.any(Privy::EmbeddedWalletConfigSchema, Privy::Internal::AnyHash) + end + + # The mode for embedded wallets. + sig { returns(Privy::EmbeddedWalletMode::TaggedSymbol) } + attr_accessor :mode + + # Configuration for embedded wallets including the mode. + sig do + params(mode: Privy::EmbeddedWalletMode::OrSymbol).returns( + T.attached_class + ) + end + def self.new( + # The mode for embedded wallets. + mode: + ) + end + + sig do + override.returns({ mode: Privy::EmbeddedWalletMode::TaggedSymbol }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/embedded_wallet_create_on_login.rbi b/rbi/privy/models/embedded_wallet_create_on_login.rbi new file mode 100644 index 0000000..80104dd --- /dev/null +++ b/rbi/privy/models/embedded_wallet_create_on_login.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Privy + module Models + # Whether to create embedded wallets on login. + module EmbeddedWalletCreateOnLogin + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EmbeddedWalletCreateOnLogin) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USERS_WITHOUT_WALLETS = + T.let( + :"users-without-wallets", + Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol + ) + ALL_USERS = + T.let(:"all-users", Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol) + OFF = T.let(:off, Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/embedded_wallet_creation_input.rbi b/rbi/privy/models/embedded_wallet_creation_input.rbi new file mode 100644 index 0000000..4a5df19 --- /dev/null +++ b/rbi/privy/models/embedded_wallet_creation_input.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class EmbeddedWalletCreationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EmbeddedWalletCreationInput, Privy::Internal::AnyHash) + end + + # Wallets to create. + sig { returns(T.nilable(T::Array[Privy::WalletCreationInput])) } + attr_reader :wallets + + sig { params(wallets: T::Array[Privy::WalletCreationInput::OrHash]).void } + attr_writer :wallets + + # The fields describing embedded wallet creation, used for user import and + # embedded wallet generation. + sig do + params(wallets: T::Array[Privy::WalletCreationInput::OrHash]).returns( + T.attached_class + ) + end + def self.new( + # Wallets to create. + wallets: nil + ) + end + + sig do + override.returns({ wallets: T::Array[Privy::WalletCreationInput] }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/embedded_wallet_input_schema.rbi b/rbi/privy/models/embedded_wallet_input_schema.rbi new file mode 100644 index 0000000..5545da9 --- /dev/null +++ b/rbi/privy/models/embedded_wallet_input_schema.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class EmbeddedWalletInputSchema < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EmbeddedWalletInputSchema, Privy::Internal::AnyHash) + end + + # Whether to create embedded wallets on login. + sig { returns(Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol) } + attr_accessor :create_on_login + + # Chain-specific configuration for embedded wallets. + sig { returns(Privy::EmbeddedWalletChainConfig) } + attr_reader :ethereum + + sig { params(ethereum: Privy::EmbeddedWalletChainConfig::OrHash).void } + attr_writer :ethereum + + # Chain-specific configuration for embedded wallets. + sig { returns(Privy::EmbeddedWalletChainConfig) } + attr_reader :solana + + sig { params(solana: Privy::EmbeddedWalletChainConfig::OrHash).void } + attr_writer :solana + + sig { returns(T::Array[Privy::UserOwnedRecoveryOption::TaggedSymbol]) } + attr_accessor :user_owned_recovery_options + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_user_owned_recovery_on_create + + sig { params(require_user_owned_recovery_on_create: T::Boolean).void } + attr_writer :require_user_owned_recovery_on_create + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_user_password_on_create + + sig { params(require_user_password_on_create: T::Boolean).void } + attr_writer :require_user_password_on_create + + # Input configuration for embedded wallets. + sig do + params( + create_on_login: Privy::EmbeddedWalletCreateOnLogin::OrSymbol, + ethereum: Privy::EmbeddedWalletChainConfig::OrHash, + solana: Privy::EmbeddedWalletChainConfig::OrHash, + user_owned_recovery_options: + T::Array[Privy::UserOwnedRecoveryOption::OrSymbol], + require_user_owned_recovery_on_create: T::Boolean, + require_user_password_on_create: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # Whether to create embedded wallets on login. + create_on_login:, + # Chain-specific configuration for embedded wallets. + ethereum:, + # Chain-specific configuration for embedded wallets. + solana:, + user_owned_recovery_options:, + require_user_owned_recovery_on_create: nil, + require_user_password_on_create: nil + ) + end + + sig do + override.returns( + { + create_on_login: Privy::EmbeddedWalletCreateOnLogin::TaggedSymbol, + ethereum: Privy::EmbeddedWalletChainConfig, + solana: Privy::EmbeddedWalletChainConfig, + user_owned_recovery_options: + T::Array[Privy::UserOwnedRecoveryOption::TaggedSymbol], + require_user_owned_recovery_on_create: T::Boolean, + require_user_password_on_create: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/embedded_wallet_mode.rbi b/rbi/privy/models/embedded_wallet_mode.rbi new file mode 100644 index 0000000..ae51ea6 --- /dev/null +++ b/rbi/privy/models/embedded_wallet_mode.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + # The mode for embedded wallets. + module EmbeddedWalletMode + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::EmbeddedWalletMode) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LEGACY_EMBEDDED_WALLETS_ONLY = + T.let( + :"legacy-embedded-wallets-only", + Privy::EmbeddedWalletMode::TaggedSymbol + ) + USER_CONTROLLED_SERVER_WALLETS_ONLY = + T.let( + :"user-controlled-server-wallets-only", + Privy::EmbeddedWalletMode::TaggedSymbol + ) + + sig do + override.returns(T::Array[Privy::EmbeddedWalletMode::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/embedded_wallet_recovery_method.rbi b/rbi/privy/models/embedded_wallet_recovery_method.rbi new file mode 100644 index 0000000..fceb55a --- /dev/null +++ b/rbi/privy/models/embedded_wallet_recovery_method.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + # The method used to recover an embedded wallet account. + module EmbeddedWalletRecoveryMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EmbeddedWalletRecoveryMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = T.let(:privy, Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) + USER_PASSCODE = + T.let( + :"user-passcode", + Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol + ) + GOOGLE_DRIVE = + T.let( + :"google-drive", + Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol + ) + ICLOUD = T.let(:icloud, Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) + RECOVERY_ENCRYPTION_KEY = + T.let( + :"recovery-encryption-key", + Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol + ) + PRIVY_V2 = + T.let(:"privy-v2", Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/ethereum_7702_authorization_condition.rbi b/rbi/privy/models/ethereum_7702_authorization_condition.rbi new file mode 100644 index 0000000..7306b85 --- /dev/null +++ b/rbi/privy/models/ethereum_7702_authorization_condition.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module Privy + module Models + class Ethereum7702AuthorizationCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::Ethereum7702AuthorizationCondition, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::Ethereum7702AuthorizationCondition::Field::OrSymbol) + end + attr_accessor :field + + sig do + returns( + Privy::Ethereum7702AuthorizationCondition::FieldSource::OrSymbol + ) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Allowed contract addresses for eth_sign7702Authorization requests. + sig do + params( + field: Privy::Ethereum7702AuthorizationCondition::Field::OrSymbol, + field_source: + Privy::Ethereum7702AuthorizationCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: Privy::Ethereum7702AuthorizationCondition::Field::OrSymbol, + field_source: + Privy::Ethereum7702AuthorizationCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::Ethereum7702AuthorizationCondition::Field) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CONTRACT = + T.let( + :contract, + Privy::Ethereum7702AuthorizationCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::Ethereum7702AuthorizationCondition::Field::TaggedSymbol + ] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::Ethereum7702AuthorizationCondition::FieldSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM_7702_AUTHORIZATION = + T.let( + :ethereum_7702_authorization, + Privy::Ethereum7702AuthorizationCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::Ethereum7702AuthorizationCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_calldata_condition.rbi b/rbi/privy/models/ethereum_calldata_condition.rbi new file mode 100644 index 0000000..f753abb --- /dev/null +++ b/rbi/privy/models/ethereum_calldata_condition.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Privy + module Models + class EthereumCalldataCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumCalldataCondition, Privy::Internal::AnyHash) + end + + # A Solidity ABI definition for decoding smart contract calldata. + sig { returns(T::Array[Privy::AbiSchemaItem]) } + attr_accessor :abi + + sig { returns(String) } + attr_accessor :field + + sig { returns(Privy::EthereumCalldataCondition::FieldSource::OrSymbol) } + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # The decoded calldata in a smart contract interaction as the smart contract + # method's parameters. Note that 'ethereum_calldata' conditions must contain an + # abi parameter with the JSON ABI of the smart contract. + sig do + params( + abi: T::Array[Privy::AbiSchemaItem::OrHash], + field: String, + field_source: Privy::EthereumCalldataCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + # A Solidity ABI definition for decoding smart contract calldata. + abi:, + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + abi: T::Array[Privy::AbiSchemaItem], + field: String, + field_source: + Privy::EthereumCalldataCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumCalldataCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM_CALLDATA = + T.let( + :ethereum_calldata, + Privy::EthereumCalldataCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumCalldataCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_earn_position_query.rbi b/rbi/privy/models/ethereum_earn_position_query.rbi new file mode 100644 index 0000000..0a0c43c --- /dev/null +++ b/rbi/privy/models/ethereum_earn_position_query.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class EthereumEarnPositionQuery < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumEarnPositionQuery, Privy::Internal::AnyHash) + end + + # The vault ID to get position for. + sig { returns(String) } + attr_accessor :vault_id + + # Query parameters for fetching an earn vault position. + sig { params(vault_id: String).returns(T.attached_class) } + def self.new( + # The vault ID to get position for. + vault_id: + ) + end + + sig { override.returns({ vault_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_earn_position_response.rbi b/rbi/privy/models/ethereum_earn_position_response.rbi new file mode 100644 index 0000000..5c3cd7c --- /dev/null +++ b/rbi/privy/models/ethereum_earn_position_response.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Privy + module Models + class EthereumEarnPositionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumEarnPositionResponse, Privy::Internal::AnyHash) + end + + # Asset metadata for an earn vault position. + sig { returns(Privy::EarnAsset) } + attr_reader :asset + + sig { params(asset: Privy::EarnAsset::OrHash).void } + attr_writer :asset + + # Current asset value in the vault (realtime from ERC-4626), in smallest unit. + sig { returns(String) } + attr_accessor :assets_in_vault + + # Current vault shares held (realtime from ERC-4626). + sig { returns(String) } + attr_accessor :shares_in_vault + + # Total amount deposited into the vault, in smallest unit. + sig { returns(String) } + attr_accessor :total_deposited + + # Total amount withdrawn from the vault, in smallest unit. + sig { returns(String) } + attr_accessor :total_withdrawn + + # A wallet's position in an earn vault. + sig do + params( + asset: Privy::EarnAsset::OrHash, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + ).returns(T.attached_class) + end + def self.new( + # Asset metadata for an earn vault position. + asset:, + # Current asset value in the vault (realtime from ERC-4626), in smallest unit. + assets_in_vault:, + # Current vault shares held (realtime from ERC-4626). + shares_in_vault:, + # Total amount deposited into the vault, in smallest unit. + total_deposited:, + # Total amount withdrawn from the vault, in smallest unit. + total_withdrawn: + ) + end + + sig do + override.returns( + { + asset: Privy::EarnAsset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_earn_provider.rbi b/rbi/privy/models/ethereum_earn_provider.rbi new file mode 100644 index 0000000..fd5803d --- /dev/null +++ b/rbi/privy/models/ethereum_earn_provider.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # Supported earn provider protocols. + module EthereumEarnProvider + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::EthereumEarnProvider) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MORPHO = T.let(:morpho, Privy::EthereumEarnProvider::TaggedSymbol) + AAVE = T.let(:aave, Privy::EthereumEarnProvider::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::EthereumEarnProvider::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/ethereum_earn_vault_details_response.rbi b/rbi/privy/models/ethereum_earn_vault_details_response.rbi new file mode 100644 index 0000000..5f1b7b6 --- /dev/null +++ b/rbi/privy/models/ethereum_earn_vault_details_response.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module Privy + module Models + class EthereumEarnVaultDetailsResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumEarnVaultDetailsResponse, + Privy::Internal::AnyHash + ) + end + + # Vault identifier. + sig { returns(String) } + attr_accessor :id + + # Annual percentage yield earned by the app from fee wrapper fees, in basis + # points. + sig { returns(T.nilable(Float)) } + attr_accessor :app_apy + + # Asset metadata for an earn vault position. + sig { returns(Privy::EarnAsset) } + attr_reader :asset + + sig { params(asset: Privy::EarnAsset::OrHash).void } + attr_writer :asset + + # Available liquidity in USD. + sig { returns(T.nilable(Float)) } + attr_accessor :available_liquidity_usd + + # CAIP-2 chain identifier (e.g. "eip155:8453"). + sig { returns(String) } + attr_accessor :caip2 + + # Human-readable vault name from the yield provider. + sig { returns(String) } + attr_accessor :name + + # Supported earn provider protocols. + sig { returns(Privy::EthereumEarnProvider::OrSymbol) } + attr_accessor :provider + + # Total value locked in USD. + sig { returns(T.nilable(Float)) } + attr_accessor :tvl_usd + + # Current annual percentage yield in basis points (e.g. 500 for 5%). 1 basis point + # = 0.01%. + sig { returns(T.nilable(Float)) } + attr_accessor :user_apy + + # Onchain vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # Detailed vault information including current APY, liquidity, and asset metadata. + sig do + params( + id: String, + app_apy: T.nilable(Float), + asset: Privy::EarnAsset::OrHash, + available_liquidity_usd: T.nilable(Float), + caip2: String, + name: String, + provider: Privy::EthereumEarnProvider::OrSymbol, + tvl_usd: T.nilable(Float), + user_apy: T.nilable(Float), + vault_address: String + ).returns(T.attached_class) + end + def self.new( + # Vault identifier. + id:, + # Annual percentage yield earned by the app from fee wrapper fees, in basis + # points. + app_apy:, + # Asset metadata for an earn vault position. + asset:, + # Available liquidity in USD. + available_liquidity_usd:, + # CAIP-2 chain identifier (e.g. "eip155:8453"). + caip2:, + # Human-readable vault name from the yield provider. + name:, + # Supported earn provider protocols. + provider:, + # Total value locked in USD. + tvl_usd:, + # Current annual percentage yield in basis points (e.g. 500 for 5%). 1 basis point + # = 0.01%. + user_apy:, + # Onchain vault contract address. + vault_address: + ) + end + + sig do + override.returns( + { + id: String, + app_apy: T.nilable(Float), + asset: Privy::EarnAsset, + available_liquidity_usd: T.nilable(Float), + caip2: String, + name: String, + provider: Privy::EthereumEarnProvider::OrSymbol, + tvl_usd: T.nilable(Float), + user_apy: T.nilable(Float), + vault_address: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_personal_sign_rpc_input.rbi b/rbi/privy/models/ethereum_personal_sign_rpc_input.rbi new file mode 100644 index 0000000..b759bf5 --- /dev/null +++ b/rbi/privy/models/ethereum_personal_sign_rpc_input.rbi @@ -0,0 +1,135 @@ +# typed: strong + +module Privy + module Models + class EthereumPersonalSignRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumPersonalSignRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EthereumPersonalSignRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the EVM `personal_sign` RPC. + sig { returns(Privy::EthereumPersonalSignRpcInputParams) } + attr_reader :params + + sig do + params(params: Privy::EthereumPersonalSignRpcInputParams::OrHash).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::EthereumPersonalSignRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: Privy::EthereumPersonalSignRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the EVM `personal_sign` RPC (EIP-191) to sign a message. + sig do + params( + method_: Privy::EthereumPersonalSignRpcInput::Method::OrSymbol, + params: Privy::EthereumPersonalSignRpcInputParams::OrHash, + address: String, + chain_type: Privy::EthereumPersonalSignRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the EVM `personal_sign` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::EthereumPersonalSignRpcInput::Method::OrSymbol, + params: Privy::EthereumPersonalSignRpcInputParams, + address: String, + chain_type: + Privy::EthereumPersonalSignRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumPersonalSignRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PERSONAL_SIGN = + T.let( + :personal_sign, + Privy::EthereumPersonalSignRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumPersonalSignRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumPersonalSignRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumPersonalSignRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumPersonalSignRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_personal_sign_rpc_input_params.rbi b/rbi/privy/models/ethereum_personal_sign_rpc_input_params.rbi new file mode 100644 index 0000000..75c70ca --- /dev/null +++ b/rbi/privy/models/ethereum_personal_sign_rpc_input_params.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class EthereumPersonalSignRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumPersonalSignRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::EthereumPersonalSignRpcInputParams::Encoding::OrSymbol) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :message + + # Parameters for the EVM `personal_sign` RPC. + sig do + params( + encoding: + Privy::EthereumPersonalSignRpcInputParams::Encoding::OrSymbol, + message: String + ).returns(T.attached_class) + end + def self.new(encoding:, message:) + end + + sig do + override.returns( + { + encoding: + Privy::EthereumPersonalSignRpcInputParams::Encoding::OrSymbol, + message: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumPersonalSignRpcInputParams::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UTF_8 = + T.let( + :"utf-8", + Privy::EthereumPersonalSignRpcInputParams::Encoding::TaggedSymbol + ) + HEX = + T.let( + :hex, + Privy::EthereumPersonalSignRpcInputParams::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumPersonalSignRpcInputParams::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_personal_sign_rpc_response.rbi b/rbi/privy/models/ethereum_personal_sign_rpc_response.rbi new file mode 100644 index 0000000..35672c1 --- /dev/null +++ b/rbi/privy/models/ethereum_personal_sign_rpc_response.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class EthereumPersonalSignRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumPersonalSignRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the EVM `personal_sign` RPC. + sig { returns(Privy::EthereumPersonalSignRpcResponseData) } + attr_reader :data + + sig do + params(data: Privy::EthereumPersonalSignRpcResponseData::OrHash).void + end + attr_writer :data + + sig do + returns(Privy::EthereumPersonalSignRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Response to the EVM `personal_sign` RPC. + sig do + params( + data: Privy::EthereumPersonalSignRpcResponseData::OrHash, + method_: Privy::EthereumPersonalSignRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the EVM `personal_sign` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumPersonalSignRpcResponseData, + method_: + Privy::EthereumPersonalSignRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumPersonalSignRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PERSONAL_SIGN = + T.let( + :personal_sign, + Privy::EthereumPersonalSignRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumPersonalSignRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_personal_sign_rpc_response_data.rbi b/rbi/privy/models/ethereum_personal_sign_rpc_response_data.rbi new file mode 100644 index 0000000..fa53b03 --- /dev/null +++ b/rbi/privy/models/ethereum_personal_sign_rpc_response_data.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Privy + module Models + class EthereumPersonalSignRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumPersonalSignRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::EthereumPersonalSignRpcResponseData::Encoding::TaggedSymbol + ) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :signature + + # Data returned by the EVM `personal_sign` RPC. + sig do + params( + encoding: + Privy::EthereumPersonalSignRpcResponseData::Encoding::OrSymbol, + signature: String + ).returns(T.attached_class) + end + def self.new(encoding:, signature:) + end + + sig do + override.returns( + { + encoding: + Privy::EthereumPersonalSignRpcResponseData::Encoding::TaggedSymbol, + signature: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumPersonalSignRpcResponseData::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEX = + T.let( + :hex, + Privy::EthereumPersonalSignRpcResponseData::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumPersonalSignRpcResponseData::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_rpc_input.rbi b/rbi/privy/models/ethereum_rpc_input.rbi new file mode 100644 index 0000000..f36843e --- /dev/null +++ b/rbi/privy/models/ethereum_rpc_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + # Request body for Ethereum wallet RPC operations, discriminated by method. + module EthereumRpcInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::EthereumSignTransactionRpcInput, + Privy::EthereumSendTransactionRpcInput, + Privy::EthereumPersonalSignRpcInput, + Privy::EthereumSignTypedDataRpcInput, + Privy::EthereumSecp256k1SignRpcInput, + Privy::EthereumSign7702AuthorizationRpcInput, + Privy::EthereumSignUserOperationRpcInput, + Privy::EthereumSendCallsRpcInput + ) + end + + sig { override.returns(T::Array[Privy::EthereumRpcInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/ethereum_rpc_response.rbi b/rbi/privy/models/ethereum_rpc_response.rbi new file mode 100644 index 0000000..35cc9fd --- /dev/null +++ b/rbi/privy/models/ethereum_rpc_response.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + # Response body for Ethereum wallet RPC operations, discriminated by method. + module EthereumRpcResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::EthereumPersonalSignRpcResponse, + Privy::EthereumSignTypedDataRpcResponse, + Privy::EthereumSignTransactionRpcResponse, + Privy::EthereumSendTransactionRpcResponse, + Privy::EthereumSignUserOperationRpcResponse, + Privy::EthereumSign7702AuthorizationRpcResponse, + Privy::EthereumSecp256k1SignRpcResponse, + Privy::EthereumSendCallsRpcResponse + ) + end + + sig { override.returns(T::Array[Privy::EthereumRpcResponse::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_input.rbi b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_input.rbi new file mode 100644 index 0000000..8cdd0fc --- /dev/null +++ b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_input.rbi @@ -0,0 +1,135 @@ +# typed: strong + +module Privy + module Models + class EthereumSecp256k1SignRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumSecp256k1SignRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EthereumSecp256k1SignRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the EVM `secp256k1_sign` RPC. + sig { returns(Privy::EthereumSecp256k1SignRpcInputParams) } + attr_reader :params + + sig do + params(params: Privy::EthereumSecp256k1SignRpcInputParams::OrHash).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::EthereumSecp256k1SignRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: Privy::EthereumSecp256k1SignRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Signs a raw hash on the secp256k1 curve. + sig do + params( + method_: Privy::EthereumSecp256k1SignRpcInput::Method::OrSymbol, + params: Privy::EthereumSecp256k1SignRpcInputParams::OrHash, + address: String, + chain_type: Privy::EthereumSecp256k1SignRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the EVM `secp256k1_sign` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::EthereumSecp256k1SignRpcInput::Method::OrSymbol, + params: Privy::EthereumSecp256k1SignRpcInputParams, + address: String, + chain_type: + Privy::EthereumSecp256k1SignRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSecp256k1SignRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SECP256K1_SIGN = + T.let( + :secp256k1_sign, + Privy::EthereumSecp256k1SignRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumSecp256k1SignRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSecp256k1SignRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumSecp256k1SignRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSecp256k1SignRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rbi b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rbi new file mode 100644 index 0000000..104bbd9 --- /dev/null +++ b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class EthereumSecp256k1SignRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSecp256k1SignRpcInputParams, + Privy::Internal::AnyHash + ) + end + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :hash_ + + # Parameters for the EVM `secp256k1_sign` RPC. + sig { params(hash_: String).returns(T.attached_class) } + def self.new( + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + hash_: + ) + end + + sig { override.returns({ hash_: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_response.rbi b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_response.rbi new file mode 100644 index 0000000..6cf60bc --- /dev/null +++ b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_response.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class EthereumSecp256k1SignRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSecp256k1SignRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the EVM `secp256k1_sign` RPC. + sig { returns(Privy::EthereumSecp256k1SignRpcResponseData) } + attr_reader :data + + sig do + params(data: Privy::EthereumSecp256k1SignRpcResponseData::OrHash).void + end + attr_writer :data + + sig do + returns(Privy::EthereumSecp256k1SignRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Response to the EVM `secp256k1_sign` RPC. + sig do + params( + data: Privy::EthereumSecp256k1SignRpcResponseData::OrHash, + method_: Privy::EthereumSecp256k1SignRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the EVM `secp256k1_sign` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumSecp256k1SignRpcResponseData, + method_: + Privy::EthereumSecp256k1SignRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSecp256k1SignRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SECP256K1_SIGN = + T.let( + :secp256k1_sign, + Privy::EthereumSecp256k1SignRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSecp256k1SignRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rbi b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rbi new file mode 100644 index 0000000..535b9b9 --- /dev/null +++ b/rbi/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class EthereumSecp256k1SignRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSecp256k1SignRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::EthereumSecp256k1SignRpcResponseData::Encoding::TaggedSymbol + ) + end + attr_accessor :encoding + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :signature + + # Data returned by the EVM `secp256k1_sign` RPC. + sig do + params( + encoding: + Privy::EthereumSecp256k1SignRpcResponseData::Encoding::OrSymbol, + signature: String + ).returns(T.attached_class) + end + def self.new( + encoding:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + signature: + ) + end + + sig do + override.returns( + { + encoding: + Privy::EthereumSecp256k1SignRpcResponseData::Encoding::TaggedSymbol, + signature: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSecp256k1SignRpcResponseData::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEX = + T.let( + :hex, + Privy::EthereumSecp256k1SignRpcResponseData::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSecp256k1SignRpcResponseData::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_calls_call.rbi b/rbi/privy/models/ethereum_send_calls_call.rbi new file mode 100644 index 0000000..1cbebef --- /dev/null +++ b/rbi/privy/models/ethereum_send_calls_call.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class EthereumSendCallsCall < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumSendCallsCall, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :to + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :data + + sig { params(data: String).void } + attr_writer :data + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :value + + sig { params(value: Privy::Quantity::Variants).void } + attr_writer :value + + # A single call within a batched wallet_sendCalls request. + sig do + params( + to: String, + data: String, + value: Privy::Quantity::Variants + ).returns(T.attached_class) + end + def self.new( + to:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + data: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + value: nil + ) + end + + sig do + override.returns( + { to: String, data: String, value: Privy::Quantity::Variants } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_calls_rpc_input.rbi b/rbi/privy/models/ethereum_send_calls_rpc_input.rbi new file mode 100644 index 0000000..0aba453 --- /dev/null +++ b/rbi/privy/models/ethereum_send_calls_rpc_input.rbi @@ -0,0 +1,163 @@ +# typed: strong + +module Privy + module Models + class EthereumSendCallsRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumSendCallsRpcInput, Privy::Internal::AnyHash) + end + + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(Privy::EthereumSendCallsRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the `wallet_sendCalls` RPC. + sig { returns(Privy::EthereumSendCallsRpcInputParams) } + attr_reader :params + + sig do + params(params: Privy::EthereumSendCallsRpcInputParams::OrHash).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::EthereumSendCallsRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: Privy::EthereumSendCallsRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :experimental_data_suffix + + sig { params(experimental_data_suffix: String).void } + attr_writer :experimental_data_suffix + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :sponsor + + sig { params(sponsor: T::Boolean).void } + attr_writer :sponsor + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the `wallet_sendCalls` RPC (EIP-5792) to batch multiple calls into a + # single atomic transaction. + sig do + params( + caip2: String, + method_: Privy::EthereumSendCallsRpcInput::Method::OrSymbol, + params: Privy::EthereumSendCallsRpcInputParams::OrHash, + address: String, + chain_type: Privy::EthereumSendCallsRpcInput::ChainType::OrSymbol, + experimental_data_suffix: String, + sponsor: T::Boolean, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + caip2:, + method_:, + # Parameters for the `wallet_sendCalls` RPC. + params:, + address: nil, + chain_type: nil, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + experimental_data_suffix: nil, + sponsor: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + method_: Privy::EthereumSendCallsRpcInput::Method::OrSymbol, + params: Privy::EthereumSendCallsRpcInputParams, + address: String, + chain_type: Privy::EthereumSendCallsRpcInput::ChainType::OrSymbol, + experimental_data_suffix: String, + sponsor: T::Boolean, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSendCallsRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_SEND_CALLS = + T.let( + :wallet_sendCalls, + Privy::EthereumSendCallsRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumSendCallsRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSendCallsRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumSendCallsRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumSendCallsRpcInput::ChainType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_calls_rpc_input_params.rbi b/rbi/privy/models/ethereum_send_calls_rpc_input_params.rbi new file mode 100644 index 0000000..1ff96f4 --- /dev/null +++ b/rbi/privy/models/ethereum_send_calls_rpc_input_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class EthereumSendCallsRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSendCallsRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[Privy::EthereumSendCallsCall]) } + attr_accessor :calls + + # Parameters for the `wallet_sendCalls` RPC. + sig do + params(calls: T::Array[Privy::EthereumSendCallsCall::OrHash]).returns( + T.attached_class + ) + end + def self.new(calls:) + end + + sig do + override.returns({ calls: T::Array[Privy::EthereumSendCallsCall] }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_calls_rpc_response.rbi b/rbi/privy/models/ethereum_send_calls_rpc_response.rbi new file mode 100644 index 0000000..e17a089 --- /dev/null +++ b/rbi/privy/models/ethereum_send_calls_rpc_response.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class EthereumSendCallsRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumSendCallsRpcResponse, Privy::Internal::AnyHash) + end + + # Data returned by the `wallet_sendCalls` RPC. + sig { returns(Privy::EthereumSendCallsRpcResponseData) } + attr_reader :data + + sig { params(data: Privy::EthereumSendCallsRpcResponseData::OrHash).void } + attr_writer :data + + sig { returns(Privy::EthereumSendCallsRpcResponse::Method::TaggedSymbol) } + attr_accessor :method_ + + # Response to the `wallet_sendCalls` RPC. + sig do + params( + data: Privy::EthereumSendCallsRpcResponseData::OrHash, + method_: Privy::EthereumSendCallsRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the `wallet_sendCalls` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumSendCallsRpcResponseData, + method_: Privy::EthereumSendCallsRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSendCallsRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_SEND_CALLS = + T.let( + :wallet_sendCalls, + Privy::EthereumSendCallsRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumSendCallsRpcResponse::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_calls_rpc_response_data.rbi b/rbi/privy/models/ethereum_send_calls_rpc_response_data.rbi new file mode 100644 index 0000000..c2f7d5e --- /dev/null +++ b/rbi/privy/models/ethereum_send_calls_rpc_response_data.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + module Models + class EthereumSendCallsRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSendCallsRpcResponseData, + Privy::Internal::AnyHash + ) + end + + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(String) } + attr_accessor :transaction_id + + # Data returned by the `wallet_sendCalls` RPC. + sig do + params(caip2: String, transaction_id: String).returns(T.attached_class) + end + def self.new( + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + caip2:, + transaction_id: + ) + end + + sig { override.returns({ caip2: String, transaction_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_transaction_rpc_input.rbi b/rbi/privy/models/ethereum_send_transaction_rpc_input.rbi new file mode 100644 index 0000000..8186fc1 --- /dev/null +++ b/rbi/privy/models/ethereum_send_transaction_rpc_input.rbi @@ -0,0 +1,183 @@ +# typed: strong + +module Privy + module Models + class EthereumSendTransactionRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSendTransactionRpcInput, + Privy::Internal::AnyHash + ) + end + + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(Privy::EthereumSendTransactionRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the EVM `eth_sendTransaction` RPC. + sig { returns(Privy::EthereumSendTransactionRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::EthereumSendTransactionRpcInputParams::OrHash + ).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::EthereumSendTransactionRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: + Privy::EthereumSendTransactionRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :experimental_data_suffix + + sig { params(experimental_data_suffix: String).void } + attr_writer :experimental_data_suffix + + sig { returns(T.nilable(String)) } + attr_reader :reference_id + + sig { params(reference_id: String).void } + attr_writer :reference_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :sponsor + + sig { params(sponsor: T::Boolean).void } + attr_writer :sponsor + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the EVM `eth_sendTransaction` RPC to sign and broadcast a transaction. + sig do + params( + caip2: String, + method_: Privy::EthereumSendTransactionRpcInput::Method::OrSymbol, + params: Privy::EthereumSendTransactionRpcInputParams::OrHash, + address: String, + chain_type: + Privy::EthereumSendTransactionRpcInput::ChainType::OrSymbol, + experimental_data_suffix: String, + reference_id: String, + sponsor: T::Boolean, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + caip2:, + method_:, + # Parameters for the EVM `eth_sendTransaction` RPC. + params:, + address: nil, + chain_type: nil, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + experimental_data_suffix: nil, + reference_id: nil, + sponsor: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + method_: Privy::EthereumSendTransactionRpcInput::Method::OrSymbol, + params: Privy::EthereumSendTransactionRpcInputParams, + address: String, + chain_type: + Privy::EthereumSendTransactionRpcInput::ChainType::OrSymbol, + experimental_data_suffix: String, + reference_id: String, + sponsor: T::Boolean, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSendTransactionRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SEND_TRANSACTION = + T.let( + :eth_sendTransaction, + Privy::EthereumSendTransactionRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSendTransactionRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSendTransactionRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumSendTransactionRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSendTransactionRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_transaction_rpc_input_params.rbi b/rbi/privy/models/ethereum_send_transaction_rpc_input_params.rbi new file mode 100644 index 0000000..eee4cd5 --- /dev/null +++ b/rbi/privy/models/ethereum_send_transaction_rpc_input_params.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class EthereumSendTransactionRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSendTransactionRpcInputParams, + Privy::Internal::AnyHash + ) + end + + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + sig do + returns( + T.any( + Privy::UnsignedStandardEthereumTransaction, + Privy::UnsignedTempoTransaction + ) + ) + end + attr_accessor :transaction + + # Parameters for the EVM `eth_sendTransaction` RPC. + sig do + params( + transaction: + T.any( + Privy::UnsignedStandardEthereumTransaction::OrHash, + Privy::UnsignedTempoTransaction::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + transaction: + ) + end + + sig do + override.returns( + { + transaction: + T.any( + Privy::UnsignedStandardEthereumTransaction, + Privy::UnsignedTempoTransaction + ) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_transaction_rpc_response.rbi b/rbi/privy/models/ethereum_send_transaction_rpc_response.rbi new file mode 100644 index 0000000..de9a5ab --- /dev/null +++ b/rbi/privy/models/ethereum_send_transaction_rpc_response.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class EthereumSendTransactionRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSendTransactionRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the EVM `eth_sendTransaction` RPC. + sig { returns(Privy::EthereumSendTransactionRpcResponseData) } + attr_reader :data + + sig do + params(data: Privy::EthereumSendTransactionRpcResponseData::OrHash).void + end + attr_writer :data + + sig do + returns(Privy::EthereumSendTransactionRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Response to the EVM `eth_sendTransaction` RPC. + sig do + params( + data: Privy::EthereumSendTransactionRpcResponseData::OrHash, + method_: Privy::EthereumSendTransactionRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the EVM `eth_sendTransaction` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumSendTransactionRpcResponseData, + method_: + Privy::EthereumSendTransactionRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSendTransactionRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SEND_TRANSACTION = + T.let( + :eth_sendTransaction, + Privy::EthereumSendTransactionRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSendTransactionRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_send_transaction_rpc_response_data.rbi b/rbi/privy/models/ethereum_send_transaction_rpc_response_data.rbi new file mode 100644 index 0000000..871fab7 --- /dev/null +++ b/rbi/privy/models/ethereum_send_transaction_rpc_response_data.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Privy + module Models + class EthereumSendTransactionRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSendTransactionRpcResponseData, + Privy::Internal::AnyHash + ) + end + + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(String) } + attr_accessor :hash_ + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + + sig { params(transaction_id: String).void } + attr_writer :transaction_id + + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + sig { returns(T.nilable(Privy::UnsignedEthereumTransaction::Variants)) } + attr_reader :transaction_request + + sig do + params( + transaction_request: + T.any( + Privy::UnsignedStandardEthereumTransaction::OrHash, + Privy::UnsignedTempoTransaction::OrHash + ) + ).void + end + attr_writer :transaction_request + + sig { returns(T.nilable(String)) } + attr_reader :user_operation_hash + + sig { params(user_operation_hash: String).void } + attr_writer :user_operation_hash + + # Data returned by the EVM `eth_sendTransaction` RPC. + sig do + params( + caip2: String, + hash_: String, + reference_id: T.nilable(String), + transaction_id: String, + transaction_request: + T.any( + Privy::UnsignedStandardEthereumTransaction::OrHash, + Privy::UnsignedTempoTransaction::OrHash + ), + user_operation_hash: String + ).returns(T.attached_class) + end + def self.new( + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + caip2:, + hash_:, + reference_id: nil, + transaction_id: nil, + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + transaction_request: nil, + user_operation_hash: nil + ) + end + + sig do + override.returns( + { + caip2: String, + hash_: String, + reference_id: T.nilable(String), + transaction_id: String, + transaction_request: Privy::UnsignedEthereumTransaction::Variants, + user_operation_hash: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_7702_authorization.rbi b/rbi/privy/models/ethereum_sign_7702_authorization.rbi new file mode 100644 index 0000000..c3f76ad --- /dev/null +++ b/rbi/privy/models/ethereum_sign_7702_authorization.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module Privy + module Models + class EthereumSign7702Authorization < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumSign7702Authorization, Privy::Internal::AnyHash) + end + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(Privy::Quantity::Variants) } + attr_accessor :chain_id + + sig { returns(String) } + attr_accessor :contract + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(Privy::Quantity::Variants) } + attr_accessor :nonce + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :r + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :s + + sig { returns(Float) } + attr_accessor :y_parity + + # A signed EIP-7702 authorization that delegates code execution to a contract + # address. + sig do + params( + chain_id: Privy::Quantity::Variants, + contract: String, + nonce: Privy::Quantity::Variants, + r: String, + s: String, + y_parity: Float + ).returns(T.attached_class) + end + def self.new( + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + chain_id:, + contract:, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + nonce:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + r:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + s:, + y_parity: + ) + end + + sig do + override.returns( + { + chain_id: Privy::Quantity::Variants, + contract: String, + nonce: Privy::Quantity::Variants, + r: String, + s: String, + y_parity: Float + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_7702_authorization_rpc_input.rbi b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_input.rbi new file mode 100644 index 0000000..1f692d9 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_input.rbi @@ -0,0 +1,153 @@ +# typed: strong + +module Privy + module Models + class EthereumSign7702AuthorizationRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSign7702AuthorizationRpcInput, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::EthereumSign7702AuthorizationRpcInput::Method::OrSymbol) + end + attr_accessor :method_ + + # Parameters for the EVM `eth_sign7702Authorization` RPC. + sig { returns(Privy::EthereumSign7702AuthorizationRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::EthereumSign7702AuthorizationRpcInputParams::OrHash + ).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable( + Privy::EthereumSign7702AuthorizationRpcInput::ChainType::OrSymbol + ) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: + Privy::EthereumSign7702AuthorizationRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Signs an EIP-7702 authorization. + sig do + params( + method_: + Privy::EthereumSign7702AuthorizationRpcInput::Method::OrSymbol, + params: Privy::EthereumSign7702AuthorizationRpcInputParams::OrHash, + address: String, + chain_type: + Privy::EthereumSign7702AuthorizationRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the EVM `eth_sign7702Authorization` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::EthereumSign7702AuthorizationRpcInput::Method::OrSymbol, + params: Privy::EthereumSign7702AuthorizationRpcInputParams, + address: String, + chain_type: + Privy::EthereumSign7702AuthorizationRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSign7702AuthorizationRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN7702_AUTHORIZATION = + T.let( + :eth_sign7702Authorization, + Privy::EthereumSign7702AuthorizationRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSign7702AuthorizationRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::EthereumSign7702AuthorizationRpcInput::ChainType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumSign7702AuthorizationRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSign7702AuthorizationRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rbi b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rbi new file mode 100644 index 0000000..b9d4873 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rbi @@ -0,0 +1,113 @@ +# typed: strong + +module Privy + module Models + class EthereumSign7702AuthorizationRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSign7702AuthorizationRpcInputParams, + Privy::Internal::AnyHash + ) + end + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(Privy::Quantity::Variants) } + attr_accessor :chain_id + + sig { returns(String) } + attr_accessor :contract + + sig do + returns( + T.nilable( + Privy::EthereumSign7702AuthorizationRpcInputParams::Executor::OrSymbol + ) + ) + end + attr_reader :executor + + sig do + params( + executor: + Privy::EthereumSign7702AuthorizationRpcInputParams::Executor::OrSymbol + ).void + end + attr_writer :executor + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :nonce + + sig { params(nonce: Privy::Quantity::Variants).void } + attr_writer :nonce + + # Parameters for the EVM `eth_sign7702Authorization` RPC. + sig do + params( + chain_id: Privy::Quantity::Variants, + contract: String, + executor: + Privy::EthereumSign7702AuthorizationRpcInputParams::Executor::OrSymbol, + nonce: Privy::Quantity::Variants + ).returns(T.attached_class) + end + def self.new( + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + chain_id:, + contract:, + executor: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + nonce: nil + ) + end + + sig do + override.returns( + { + chain_id: Privy::Quantity::Variants, + contract: String, + executor: + Privy::EthereumSign7702AuthorizationRpcInputParams::Executor::OrSymbol, + nonce: Privy::Quantity::Variants + } + ) + end + def to_hash + end + + module Executor + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::EthereumSign7702AuthorizationRpcInputParams::Executor + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SELF = + T.let( + :self, + Privy::EthereumSign7702AuthorizationRpcInputParams::Executor::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSign7702AuthorizationRpcInputParams::Executor::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_7702_authorization_rpc_response.rbi b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_response.rbi new file mode 100644 index 0000000..8250d5b --- /dev/null +++ b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_response.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Privy + module Models + class EthereumSign7702AuthorizationRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSign7702AuthorizationRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the EVM `eth_sign7702Authorization` RPC. + sig { returns(Privy::EthereumSign7702AuthorizationRpcResponseData) } + attr_reader :data + + sig do + params( + data: Privy::EthereumSign7702AuthorizationRpcResponseData::OrHash + ).void + end + attr_writer :data + + sig do + returns( + Privy::EthereumSign7702AuthorizationRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # Response to the EVM `eth_sign7702Authorization` RPC. + sig do + params( + data: Privy::EthereumSign7702AuthorizationRpcResponseData::OrHash, + method_: + Privy::EthereumSign7702AuthorizationRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the EVM `eth_sign7702Authorization` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumSign7702AuthorizationRpcResponseData, + method_: + Privy::EthereumSign7702AuthorizationRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::EthereumSign7702AuthorizationRpcResponse::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN7702_AUTHORIZATION = + T.let( + :eth_sign7702Authorization, + Privy::EthereumSign7702AuthorizationRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSign7702AuthorizationRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rbi b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rbi new file mode 100644 index 0000000..94d2547 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class EthereumSign7702AuthorizationRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSign7702AuthorizationRpcResponseData, + Privy::Internal::AnyHash + ) + end + + # A signed EIP-7702 authorization that delegates code execution to a contract + # address. + sig { returns(Privy::EthereumSign7702Authorization) } + attr_reader :authorization + + sig do + params(authorization: Privy::EthereumSign7702Authorization::OrHash).void + end + attr_writer :authorization + + # Data returned by the EVM `eth_sign7702Authorization` RPC. + sig do + params( + authorization: Privy::EthereumSign7702Authorization::OrHash + ).returns(T.attached_class) + end + def self.new( + # A signed EIP-7702 authorization that delegates code execution to a contract + # address. + authorization: + ) + end + + sig do + override.returns( + { authorization: Privy::EthereumSign7702Authorization } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_transaction_rpc_input.rbi b/rbi/privy/models/ethereum_sign_transaction_rpc_input.rbi new file mode 100644 index 0000000..f2a63c8 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_transaction_rpc_input.rbi @@ -0,0 +1,144 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTransactionRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignTransactionRpcInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::EthereumSignTransactionRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the EVM `eth_signTransaction` RPC. + sig { returns(Privy::EthereumSignTransactionRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::EthereumSignTransactionRpcInputParams::OrHash + ).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::EthereumSignTransactionRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: + Privy::EthereumSignTransactionRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the EVM `eth_signTransaction` RPC to sign a transaction. + sig do + params( + method_: Privy::EthereumSignTransactionRpcInput::Method::OrSymbol, + params: Privy::EthereumSignTransactionRpcInputParams::OrHash, + address: String, + chain_type: + Privy::EthereumSignTransactionRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the EVM `eth_signTransaction` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::EthereumSignTransactionRpcInput::Method::OrSymbol, + params: Privy::EthereumSignTransactionRpcInputParams, + address: String, + chain_type: + Privy::EthereumSignTransactionRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignTransactionRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN_TRANSACTION = + T.let( + :eth_signTransaction, + Privy::EthereumSignTransactionRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignTransactionRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignTransactionRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumSignTransactionRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignTransactionRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_transaction_rpc_input_params.rbi b/rbi/privy/models/ethereum_sign_transaction_rpc_input_params.rbi new file mode 100644 index 0000000..c82fe26 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_transaction_rpc_input_params.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTransactionRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignTransactionRpcInputParams, + Privy::Internal::AnyHash + ) + end + + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + sig do + returns( + T.any( + Privy::UnsignedStandardEthereumTransaction, + Privy::UnsignedTempoTransaction + ) + ) + end + attr_accessor :transaction + + # Parameters for the EVM `eth_signTransaction` RPC. + sig do + params( + transaction: + T.any( + Privy::UnsignedStandardEthereumTransaction::OrHash, + Privy::UnsignedTempoTransaction::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + transaction: + ) + end + + sig do + override.returns( + { + transaction: + T.any( + Privy::UnsignedStandardEthereumTransaction, + Privy::UnsignedTempoTransaction + ) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_transaction_rpc_response.rbi b/rbi/privy/models/ethereum_sign_transaction_rpc_response.rbi new file mode 100644 index 0000000..f764194 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_transaction_rpc_response.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTransactionRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignTransactionRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the EVM `eth_signTransaction` RPC. + sig { returns(Privy::EthereumSignTransactionRpcResponseData) } + attr_reader :data + + sig do + params(data: Privy::EthereumSignTransactionRpcResponseData::OrHash).void + end + attr_writer :data + + sig do + returns(Privy::EthereumSignTransactionRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Response to the EVM `eth_signTransaction` RPC. + sig do + params( + data: Privy::EthereumSignTransactionRpcResponseData::OrHash, + method_: Privy::EthereumSignTransactionRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the EVM `eth_signTransaction` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumSignTransactionRpcResponseData, + method_: + Privy::EthereumSignTransactionRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignTransactionRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN_TRANSACTION = + T.let( + :eth_signTransaction, + Privy::EthereumSignTransactionRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignTransactionRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_transaction_rpc_response_data.rbi b/rbi/privy/models/ethereum_sign_transaction_rpc_response_data.rbi new file mode 100644 index 0000000..baace20 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_transaction_rpc_response_data.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTransactionRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignTransactionRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::EthereumSignTransactionRpcResponseData::Encoding::TaggedSymbol + ) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :signed_transaction + + # Data returned by the EVM `eth_signTransaction` RPC. + sig do + params( + encoding: + Privy::EthereumSignTransactionRpcResponseData::Encoding::OrSymbol, + signed_transaction: String + ).returns(T.attached_class) + end + def self.new(encoding:, signed_transaction:) + end + + sig do + override.returns( + { + encoding: + Privy::EthereumSignTransactionRpcResponseData::Encoding::TaggedSymbol, + signed_transaction: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::EthereumSignTransactionRpcResponseData::Encoding + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RLP = + T.let( + :rlp, + Privy::EthereumSignTransactionRpcResponseData::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignTransactionRpcResponseData::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_typed_data_rpc_input.rbi b/rbi/privy/models/ethereum_sign_typed_data_rpc_input.rbi new file mode 100644 index 0000000..ed9d820 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_typed_data_rpc_input.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTypedDataRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumSignTypedDataRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EthereumSignTypedDataRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the EVM `eth_signTypedData_v4` RPC. + sig { returns(Privy::EthereumSignTypedDataRpcInputParams) } + attr_reader :params + + sig do + params(params: Privy::EthereumSignTypedDataRpcInputParams::OrHash).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::EthereumSignTypedDataRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: Privy::EthereumSignTypedDataRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the EVM `eth_signTypedData_v4` RPC (EIP-712) to sign a typed data + # object. + sig do + params( + method_: Privy::EthereumSignTypedDataRpcInput::Method::OrSymbol, + params: Privy::EthereumSignTypedDataRpcInputParams::OrHash, + address: String, + chain_type: Privy::EthereumSignTypedDataRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the EVM `eth_signTypedData_v4` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::EthereumSignTypedDataRpcInput::Method::OrSymbol, + params: Privy::EthereumSignTypedDataRpcInputParams, + address: String, + chain_type: + Privy::EthereumSignTypedDataRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignTypedDataRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN_TYPED_DATA_V4 = + T.let( + :eth_signTypedData_v4, + Privy::EthereumSignTypedDataRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumSignTypedDataRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignTypedDataRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumSignTypedDataRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignTypedDataRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_typed_data_rpc_input_params.rbi b/rbi/privy/models/ethereum_sign_typed_data_rpc_input_params.rbi new file mode 100644 index 0000000..83b93f0 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_typed_data_rpc_input_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTypedDataRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignTypedDataRpcInputParams, + Privy::Internal::AnyHash + ) + end + + # EIP-712 typed data object. + sig { returns(Privy::EthereumTypedDataInput) } + attr_reader :typed_data + + sig { params(typed_data: Privy::EthereumTypedDataInput::OrHash).void } + attr_writer :typed_data + + # Parameters for the EVM `eth_signTypedData_v4` RPC. + sig do + params(typed_data: Privy::EthereumTypedDataInput::OrHash).returns( + T.attached_class + ) + end + def self.new( + # EIP-712 typed data object. + typed_data: + ) + end + + sig { override.returns({ typed_data: Privy::EthereumTypedDataInput }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_typed_data_rpc_response.rbi b/rbi/privy/models/ethereum_sign_typed_data_rpc_response.rbi new file mode 100644 index 0000000..2996e8b --- /dev/null +++ b/rbi/privy/models/ethereum_sign_typed_data_rpc_response.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTypedDataRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignTypedDataRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the EVM `eth_signTypedData_v4` RPC. + sig { returns(Privy::EthereumSignTypedDataRpcResponseData) } + attr_reader :data + + sig do + params(data: Privy::EthereumSignTypedDataRpcResponseData::OrHash).void + end + attr_writer :data + + sig do + returns(Privy::EthereumSignTypedDataRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Response to the EVM `eth_signTypedData_v4` RPC. + sig do + params( + data: Privy::EthereumSignTypedDataRpcResponseData::OrHash, + method_: Privy::EthereumSignTypedDataRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the EVM `eth_signTypedData_v4` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumSignTypedDataRpcResponseData, + method_: + Privy::EthereumSignTypedDataRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignTypedDataRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN_TYPED_DATA_V4 = + T.let( + :eth_signTypedData_v4, + Privy::EthereumSignTypedDataRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignTypedDataRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_typed_data_rpc_response_data.rbi b/rbi/privy/models/ethereum_sign_typed_data_rpc_response_data.rbi new file mode 100644 index 0000000..8c59989 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_typed_data_rpc_response_data.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Privy + module Models + class EthereumSignTypedDataRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignTypedDataRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::EthereumSignTypedDataRpcResponseData::Encoding::TaggedSymbol + ) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :signature + + # Data returned by the EVM `eth_signTypedData_v4` RPC. + sig do + params( + encoding: + Privy::EthereumSignTypedDataRpcResponseData::Encoding::OrSymbol, + signature: String + ).returns(T.attached_class) + end + def self.new(encoding:, signature:) + end + + sig do + override.returns( + { + encoding: + Privy::EthereumSignTypedDataRpcResponseData::Encoding::TaggedSymbol, + signature: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignTypedDataRpcResponseData::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEX = + T.let( + :hex, + Privy::EthereumSignTypedDataRpcResponseData::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignTypedDataRpcResponseData::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_user_operation_rpc_input.rbi b/rbi/privy/models/ethereum_sign_user_operation_rpc_input.rbi new file mode 100644 index 0000000..a979e7b --- /dev/null +++ b/rbi/privy/models/ethereum_sign_user_operation_rpc_input.rbi @@ -0,0 +1,148 @@ +# typed: strong + +module Privy + module Models + class EthereumSignUserOperationRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignUserOperationRpcInput, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::EthereumSignUserOperationRpcInput::Method::OrSymbol) + end + attr_accessor :method_ + + # Parameters for the EVM `eth_signUserOperation` RPC. + sig { returns(Privy::EthereumSignUserOperationRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::EthereumSignUserOperationRpcInputParams::OrHash + ).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable( + Privy::EthereumSignUserOperationRpcInput::ChainType::OrSymbol + ) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: + Privy::EthereumSignUserOperationRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes an RPC method to hash and sign a UserOperation. + sig do + params( + method_: Privy::EthereumSignUserOperationRpcInput::Method::OrSymbol, + params: Privy::EthereumSignUserOperationRpcInputParams::OrHash, + address: String, + chain_type: + Privy::EthereumSignUserOperationRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the EVM `eth_signUserOperation` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::EthereumSignUserOperationRpcInput::Method::OrSymbol, + params: Privy::EthereumSignUserOperationRpcInputParams, + address: String, + chain_type: + Privy::EthereumSignUserOperationRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignUserOperationRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN_USER_OPERATION = + T.let( + :eth_signUserOperation, + Privy::EthereumSignUserOperationRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignUserOperationRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignUserOperationRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::EthereumSignUserOperationRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignUserOperationRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_user_operation_rpc_input_params.rbi b/rbi/privy/models/ethereum_sign_user_operation_rpc_input_params.rbi new file mode 100644 index 0000000..1de8769 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_user_operation_rpc_input_params.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class EthereumSignUserOperationRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignUserOperationRpcInputParams, + Privy::Internal::AnyHash + ) + end + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(Privy::Quantity::Variants) } + attr_accessor :chain_id + + sig { returns(String) } + attr_accessor :contract + + # An ERC-4337 user operation. + sig { returns(Privy::UserOperationInput) } + attr_reader :user_operation + + sig { params(user_operation: Privy::UserOperationInput::OrHash).void } + attr_writer :user_operation + + # Parameters for the EVM `eth_signUserOperation` RPC. + sig do + params( + chain_id: Privy::Quantity::Variants, + contract: String, + user_operation: Privy::UserOperationInput::OrHash + ).returns(T.attached_class) + end + def self.new( + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + chain_id:, + contract:, + # An ERC-4337 user operation. + user_operation: + ) + end + + sig do + override.returns( + { + chain_id: Privy::Quantity::Variants, + contract: String, + user_operation: Privy::UserOperationInput + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_user_operation_rpc_response.rbi b/rbi/privy/models/ethereum_sign_user_operation_rpc_response.rbi new file mode 100644 index 0000000..5ab222f --- /dev/null +++ b/rbi/privy/models/ethereum_sign_user_operation_rpc_response.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Privy + module Models + class EthereumSignUserOperationRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignUserOperationRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the EVM `eth_signUserOperation` RPC. + sig { returns(Privy::EthereumSignUserOperationRpcResponseData) } + attr_reader :data + + sig do + params( + data: Privy::EthereumSignUserOperationRpcResponseData::OrHash + ).void + end + attr_writer :data + + sig do + returns( + Privy::EthereumSignUserOperationRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # Response to the EVM `eth_signUserOperation` RPC. + sig do + params( + data: Privy::EthereumSignUserOperationRpcResponseData::OrHash, + method_: Privy::EthereumSignUserOperationRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the EVM `eth_signUserOperation` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::EthereumSignUserOperationRpcResponseData, + method_: + Privy::EthereumSignUserOperationRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumSignUserOperationRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SIGN_USER_OPERATION = + T.let( + :eth_signUserOperation, + Privy::EthereumSignUserOperationRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignUserOperationRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_sign_user_operation_rpc_response_data.rbi b/rbi/privy/models/ethereum_sign_user_operation_rpc_response_data.rbi new file mode 100644 index 0000000..5d58ab0 --- /dev/null +++ b/rbi/privy/models/ethereum_sign_user_operation_rpc_response_data.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class EthereumSignUserOperationRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumSignUserOperationRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::EthereumSignUserOperationRpcResponseData::Encoding::TaggedSymbol + ) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :signature + + # Data returned by the EVM `eth_signUserOperation` RPC. + sig do + params( + encoding: + Privy::EthereumSignUserOperationRpcResponseData::Encoding::OrSymbol, + signature: String + ).returns(T.attached_class) + end + def self.new(encoding:, signature:) + end + + sig do + override.returns( + { + encoding: + Privy::EthereumSignUserOperationRpcResponseData::Encoding::TaggedSymbol, + signature: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::EthereumSignUserOperationRpcResponseData::Encoding + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEX = + T.let( + :hex, + Privy::EthereumSignUserOperationRpcResponseData::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumSignUserOperationRpcResponseData::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_transaction_condition.rbi b/rbi/privy/models/ethereum_transaction_condition.rbi new file mode 100644 index 0000000..8d5bd7c --- /dev/null +++ b/rbi/privy/models/ethereum_transaction_condition.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Privy + module Models + class EthereumTransactionCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumTransactionCondition, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EthereumTransactionCondition::Field::OrSymbol) } + attr_accessor :field + + sig do + returns(Privy::EthereumTransactionCondition::FieldSource::OrSymbol) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # The verbatim Ethereum transaction object in an eth_signTransaction or + # eth_sendTransaction request. + sig do + params( + field: Privy::EthereumTransactionCondition::Field::OrSymbol, + field_source: + Privy::EthereumTransactionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: Privy::EthereumTransactionCondition::Field::OrSymbol, + field_source: + Privy::EthereumTransactionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumTransactionCondition::Field) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TO = + T.let(:to, Privy::EthereumTransactionCondition::Field::TaggedSymbol) + VALUE = + T.let( + :value, + Privy::EthereumTransactionCondition::Field::TaggedSymbol + ) + CHAIN_ID = + T.let( + :chain_id, + Privy::EthereumTransactionCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumTransactionCondition::Field::TaggedSymbol] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumTransactionCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM_TRANSACTION = + T.let( + :ethereum_transaction, + Privy::EthereumTransactionCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumTransactionCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_typed_data_domain_condition.rbi b/rbi/privy/models/ethereum_typed_data_domain_condition.rbi new file mode 100644 index 0000000..1a4f4d8 --- /dev/null +++ b/rbi/privy/models/ethereum_typed_data_domain_condition.rbi @@ -0,0 +1,134 @@ +# typed: strong + +module Privy + module Models + class EthereumTypedDataDomainCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumTypedDataDomainCondition, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::EthereumTypedDataDomainCondition::Field::OrSymbol) } + attr_accessor :field + + sig do + returns(Privy::EthereumTypedDataDomainCondition::FieldSource::OrSymbol) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Attributes from the signing domain that will verify the signature. + sig do + params( + field: Privy::EthereumTypedDataDomainCondition::Field::OrSymbol, + field_source: + Privy::EthereumTypedDataDomainCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: Privy::EthereumTypedDataDomainCondition::Field::OrSymbol, + field_source: + Privy::EthereumTypedDataDomainCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumTypedDataDomainCondition::Field) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHAIN_ID = + T.let( + :chainId, + Privy::EthereumTypedDataDomainCondition::Field::TaggedSymbol + ) + CHAIN_ID_2 = + T.let( + :chain_id, + Privy::EthereumTypedDataDomainCondition::Field::TaggedSymbol + ) + VERIFYING_CONTRACT = + T.let( + :verifyingContract, + Privy::EthereumTypedDataDomainCondition::Field::TaggedSymbol + ) + VERIFYING_CONTRACT_2 = + T.let( + :verifying_contract, + Privy::EthereumTypedDataDomainCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumTypedDataDomainCondition::Field::TaggedSymbol + ] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumTypedDataDomainCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM_TYPED_DATA_DOMAIN = + T.let( + :ethereum_typed_data_domain, + Privy::EthereumTypedDataDomainCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumTypedDataDomainCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_typed_data_input.rbi b/rbi/privy/models/ethereum_typed_data_input.rbi new file mode 100644 index 0000000..5e59cf7 --- /dev/null +++ b/rbi/privy/models/ethereum_typed_data_input.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class EthereumTypedDataInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumTypedDataInput, Privy::Internal::AnyHash) + end + + # The domain parameters for EIP-712 typed data signing. + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :domain + + sig { returns(T::Hash[Symbol, T.anything]) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :primary_type + + # The type definitions for EIP-712 typed data signing. + sig { returns(T::Hash[Symbol, T::Array[Privy::TypedDataTypeFieldInput]]) } + attr_accessor :types + + # EIP-712 typed data object. + sig do + params( + domain: T::Hash[Symbol, T.anything], + message: T::Hash[Symbol, T.anything], + primary_type: String, + types: + T::Hash[Symbol, T::Array[Privy::TypedDataTypeFieldInput::OrHash]] + ).returns(T.attached_class) + end + def self.new( + # The domain parameters for EIP-712 typed data signing. + domain:, + message:, + primary_type:, + # The type definitions for EIP-712 typed data signing. + types: + ) + end + + sig do + override.returns( + { + domain: T::Hash[Symbol, T.anything], + message: T::Hash[Symbol, T.anything], + primary_type: String, + types: T::Hash[Symbol, T::Array[Privy::TypedDataTypeFieldInput]] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_typed_data_message_condition.rbi b/rbi/privy/models/ethereum_typed_data_message_condition.rbi new file mode 100644 index 0000000..65b89df --- /dev/null +++ b/rbi/privy/models/ethereum_typed_data_message_condition.rbi @@ -0,0 +1,153 @@ +# typed: strong + +module Privy + module Models + class EthereumTypedDataMessageCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumTypedDataMessageCondition, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :field + + sig do + returns(Privy::EthereumTypedDataMessageCondition::FieldSource::OrSymbol) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + sig { returns(Privy::EthereumTypedDataMessageCondition::TypedData) } + attr_reader :typed_data + + sig do + params( + typed_data: + Privy::EthereumTypedDataMessageCondition::TypedData::OrHash + ).void + end + attr_writer :typed_data + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # 'types' and 'primary_type' attributes of the TypedData JSON object defined in + # EIP-712. + sig do + params( + field: String, + field_source: + Privy::EthereumTypedDataMessageCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + typed_data: + Privy::EthereumTypedDataMessageCondition::TypedData::OrHash, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + typed_data:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: String, + field_source: + Privy::EthereumTypedDataMessageCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + typed_data: Privy::EthereumTypedDataMessageCondition::TypedData, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumTypedDataMessageCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM_TYPED_DATA_MESSAGE = + T.let( + :ethereum_typed_data_message, + Privy::EthereumTypedDataMessageCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EthereumTypedDataMessageCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + + class TypedData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumTypedDataMessageCondition::TypedData, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :primary_type + + # The type definitions for EIP-712 typed data signing. + sig do + returns(T::Hash[Symbol, T::Array[Privy::TypedDataTypeFieldInput]]) + end + attr_accessor :types + + sig do + params( + primary_type: String, + types: + T::Hash[Symbol, T::Array[Privy::TypedDataTypeFieldInput::OrHash]] + ).returns(T.attached_class) + end + def self.new( + primary_type:, + # The type definitions for EIP-712 typed data signing. + types: + ) + end + + sig do + override.returns( + { + primary_type: String, + types: T::Hash[Symbol, T::Array[Privy::TypedDataTypeFieldInput]] + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_vault_details_input.rbi b/rbi/privy/models/ethereum_vault_details_input.rbi new file mode 100644 index 0000000..b8b3a21 --- /dev/null +++ b/rbi/privy/models/ethereum_vault_details_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class EthereumVaultDetailsInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumVaultDetailsInput, Privy::Internal::AnyHash) + end + + # The Privy vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # Input for fetching vault details. + sig { params(vault_id: String).returns(T.attached_class) } + def self.new( + # The Privy vault ID. + vault_id: + ) + end + + sig { override.returns({ vault_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_vault_details_response.rbi b/rbi/privy/models/ethereum_vault_details_response.rbi new file mode 100644 index 0000000..0de5c7b --- /dev/null +++ b/rbi/privy/models/ethereum_vault_details_response.rbi @@ -0,0 +1,114 @@ +# typed: strong + +module Privy + module Models + class EthereumVaultDetailsResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumVaultDetailsResponse, Privy::Internal::AnyHash) + end + + # Vault identifier. + sig { returns(String) } + attr_accessor :id + + # Annual percentage yield earned by the app from fee wrapper fees, in basis + # points. Null when APY data is unavailable. + sig { returns(T.nilable(Float)) } + attr_accessor :app_apy + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # Assets available for instant withdrawal in USD. + sig { returns(T.nilable(Float)) } + attr_accessor :available_liquidity_usd + + # Chain identifier (e.g., eip155:8453). + sig { returns(String) } + attr_accessor :caip2 + + # Human-readable vault name from the yield provider. + sig { returns(String) } + attr_accessor :name + + # Supported yield/lending protocol providers. + sig { returns(Privy::EthereumYieldProvider::OrSymbol) } + attr_accessor :provider + + # Total value locked in USD. + sig { returns(T.nilable(Float)) } + attr_accessor :tvl_usd + + # Current annual percentage yield in basis points (e.g., 500 for 5%). 1 basis + # point = 0.01%. + sig { returns(T.nilable(Float)) } + attr_accessor :user_apy + + # On-chain vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # Detailed vault information including current APY and liquidity. + sig do + params( + id: String, + app_apy: T.nilable(Float), + asset_address: String, + available_liquidity_usd: T.nilable(Float), + caip2: String, + name: String, + provider: Privy::EthereumYieldProvider::OrSymbol, + tvl_usd: T.nilable(Float), + user_apy: T.nilable(Float), + vault_address: String + ).returns(T.attached_class) + end + def self.new( + # Vault identifier. + id:, + # Annual percentage yield earned by the app from fee wrapper fees, in basis + # points. Null when APY data is unavailable. + app_apy:, + # Underlying asset token address. + asset_address:, + # Assets available for instant withdrawal in USD. + available_liquidity_usd:, + # Chain identifier (e.g., eip155:8453). + caip2:, + # Human-readable vault name from the yield provider. + name:, + # Supported yield/lending protocol providers. + provider:, + # Total value locked in USD. + tvl_usd:, + # Current annual percentage yield in basis points (e.g., 500 for 5%). 1 basis + # point = 0.01%. + user_apy:, + # On-chain vault contract address. + vault_address: + ) + end + + sig do + override.returns( + { + id: String, + app_apy: T.nilable(Float), + asset_address: String, + available_liquidity_usd: T.nilable(Float), + caip2: String, + name: String, + provider: Privy::EthereumYieldProvider::OrSymbol, + tvl_usd: T.nilable(Float), + user_apy: T.nilable(Float), + vault_address: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_vault_position.rbi b/rbi/privy/models/ethereum_vault_position.rbi new file mode 100644 index 0000000..5c5897c --- /dev/null +++ b/rbi/privy/models/ethereum_vault_position.rbi @@ -0,0 +1,101 @@ +# typed: strong + +module Privy + module Models + class EthereumVaultPosition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumVaultPosition, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EthereumVaultPosition::Asset) } + attr_reader :asset + + sig { params(asset: Privy::EthereumVaultPosition::Asset::OrHash).void } + attr_writer :asset + + # Current asset value in the vault (realtime from ERC4626), in smallest unit. + sig { returns(String) } + attr_accessor :assets_in_vault + + # Current vault shares held (realtime from ERC4626). + sig { returns(String) } + attr_accessor :shares_in_vault + + # Total amount deposited into the vault, in smallest unit. + sig { returns(String) } + attr_accessor :total_deposited + + # Total amount withdrawn from the vault, in smallest unit. + sig { returns(String) } + attr_accessor :total_withdrawn + + # A user's position in a DeFi vault. + sig do + params( + asset: Privy::EthereumVaultPosition::Asset::OrHash, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + ).returns(T.attached_class) + end + def self.new( + asset:, + # Current asset value in the vault (realtime from ERC4626), in smallest unit. + assets_in_vault:, + # Current vault shares held (realtime from ERC4626). + shares_in_vault:, + # Total amount deposited into the vault, in smallest unit. + total_deposited:, + # Total amount withdrawn from the vault, in smallest unit. + total_withdrawn: + ) + end + + sig do + override.returns( + { + asset: Privy::EthereumVaultPosition::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + ) + end + def to_hash + end + + class Asset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumVaultPosition::Asset, Privy::Internal::AnyHash) + end + + # Token contract address. + sig { returns(String) } + attr_accessor :address + + # Token symbol (e.g., "USDC"). + sig { returns(String) } + attr_accessor :symbol + + sig do + params(address: String, symbol: String).returns(T.attached_class) + end + def self.new( + # Token contract address. + address:, + # Token symbol (e.g., "USDC"). + symbol: + ) + end + + sig { override.returns({ address: String, symbol: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_vault_response.rbi b/rbi/privy/models/ethereum_vault_response.rbi new file mode 100644 index 0000000..f6d97a7 --- /dev/null +++ b/rbi/privy/models/ethereum_vault_response.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module Privy + module Models + class EthereumVaultResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumVaultResponse, Privy::Internal::AnyHash) + end + + # Unique identifier for the vault. + sig { returns(String) } + attr_accessor :id + + # The address of the underlying asset token (e.g., USDC). + sig { returns(String) } + attr_accessor :asset_address + + # The CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Unix timestamp of when the vault was created, in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # Supported yield/lending protocol providers. + sig { returns(Privy::EthereumYieldProvider::OrSymbol) } + attr_accessor :provider + + # The address of the underlying vault that the fee vault wraps. If this is not a + # fee vault, this equals vault_address. + sig { returns(String) } + attr_accessor :underlying_vault_address + + # The on-chain address of the ERC-4626 vault contract. + sig { returns(String) } + attr_accessor :vault_address + + # A vault configuration for yield features. + sig do + params( + id: String, + asset_address: String, + caip2: String, + created_at: Float, + provider: Privy::EthereumYieldProvider::OrSymbol, + underlying_vault_address: String, + vault_address: String + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the vault. + id:, + # The address of the underlying asset token (e.g., USDC). + asset_address:, + # The CAIP-2 chain identifier. + caip2:, + # Unix timestamp of when the vault was created, in milliseconds. + created_at:, + # Supported yield/lending protocol providers. + provider:, + # The address of the underlying vault that the fee vault wraps. If this is not a + # fee vault, this equals vault_address. + underlying_vault_address:, + # The on-chain address of the ERC-4626 vault contract. + vault_address: + ) + end + + sig do + override.returns( + { + id: String, + asset_address: String, + caip2: String, + created_at: Float, + provider: Privy::EthereumYieldProvider::OrSymbol, + underlying_vault_address: String, + vault_address: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_claim_id_input.rbi b/rbi/privy/models/ethereum_yield_claim_id_input.rbi new file mode 100644 index 0000000..72a64ba --- /dev/null +++ b/rbi/privy/models/ethereum_yield_claim_id_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldClaimIDInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldClaimIDInput, Privy::Internal::AnyHash) + end + + # The yield claim transaction ID. + sig { returns(String) } + attr_accessor :id + + # Input for fetching a yield reward claim by ID. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The yield claim transaction ID. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_claim_input.rbi b/rbi/privy/models/ethereum_yield_claim_input.rbi new file mode 100644 index 0000000..ef0c671 --- /dev/null +++ b/rbi/privy/models/ethereum_yield_claim_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldClaimInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldClaimInput, Privy::Internal::AnyHash) + end + + # An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + sig { returns(String) } + attr_accessor :caip2 + + # Input for claiming incentive rewards from vault participation. + sig { params(caip2: String).returns(T.attached_class) } + def self.new( + # An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + caip2: + ) + end + + sig { override.returns({ caip2: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_claim_response.rbi b/rbi/privy/models/ethereum_yield_claim_response.rbi new file mode 100644 index 0000000..aa943be --- /dev/null +++ b/rbi/privy/models/ethereum_yield_claim_response.rbi @@ -0,0 +1,138 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldClaimResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldClaimResponse, Privy::Internal::AnyHash) + end + + # Privy transaction record ID for the claim operation. + sig { returns(String) } + attr_accessor :id + + # An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + sig { returns(String) } + attr_accessor :caip2 + + # Unix timestamp of when the claim was created, in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # List of reward tokens claimed. + sig { returns(T::Array[Privy::EthereumYieldClaimReward]) } + attr_accessor :rewards + + # The current status of the claim transaction. + sig { returns(Privy::EthereumYieldClaimResponse::Status::OrSymbol) } + attr_accessor :status + + # Unix timestamp of when the claim was last updated, in milliseconds. + sig { returns(Float) } + attr_accessor :updated_at + + # Response from a yield reward claim operation. + sig do + params( + id: String, + caip2: String, + created_at: Float, + rewards: T::Array[Privy::EthereumYieldClaimReward::OrHash], + status: Privy::EthereumYieldClaimResponse::Status::OrSymbol, + updated_at: Float + ).returns(T.attached_class) + end + def self.new( + # Privy transaction record ID for the claim operation. + id:, + # An EVM CAIP-2 chain identifier (e.g., "eip155:8453" for Base). + caip2:, + # Unix timestamp of when the claim was created, in milliseconds. + created_at:, + # List of reward tokens claimed. + rewards:, + # The current status of the claim transaction. + status:, + # Unix timestamp of when the claim was last updated, in milliseconds. + updated_at: + ) + end + + sig do + override.returns( + { + id: String, + caip2: String, + created_at: Float, + rewards: T::Array[Privy::EthereumYieldClaimReward], + status: Privy::EthereumYieldClaimResponse::Status::OrSymbol, + updated_at: Float + } + ) + end + def to_hash + end + + # The current status of the claim transaction. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EthereumYieldClaimResponse::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BROADCASTED = + T.let( + :broadcasted, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + CONFIRMED = + T.let( + :confirmed, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + EXECUTION_REVERTED = + T.let( + :execution_reverted, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + REPLACED = + T.let( + :replaced, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + FINALIZED = + T.let( + :finalized, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + PROVIDER_ERROR = + T.let( + :provider_error, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + Privy::EthereumYieldClaimResponse::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EthereumYieldClaimResponse::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_claim_reward.rbi b/rbi/privy/models/ethereum_yield_claim_reward.rbi new file mode 100644 index 0000000..b20fe05 --- /dev/null +++ b/rbi/privy/models/ethereum_yield_claim_reward.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldClaimReward < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldClaimReward, Privy::Internal::AnyHash) + end + + # Amount claimed in the smallest unit. + sig { returns(String) } + attr_accessor :amount + + # Reward token contract address. + sig { returns(String) } + attr_accessor :token_address + + # Reward token symbol (e.g., "MORPHO"). + sig { returns(String) } + attr_accessor :token_symbol + + # A single reward token claimed from vault participation. + sig do + params( + amount: String, + token_address: String, + token_symbol: String + ).returns(T.attached_class) + end + def self.new( + # Amount claimed in the smallest unit. + amount:, + # Reward token contract address. + token_address:, + # Reward token symbol (e.g., "MORPHO"). + token_symbol: + ) + end + + sig do + override.returns( + { amount: String, token_address: String, token_symbol: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_deposit_input.rbi b/rbi/privy/models/ethereum_yield_deposit_input.rbi new file mode 100644 index 0000000..cdf2e2b --- /dev/null +++ b/rbi/privy/models/ethereum_yield_deposit_input.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldDepositInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldDepositInput, Privy::Internal::AnyHash) + end + + # The amount of the underlying asset to deposit, in the smallest unit (e.g., wei + # for ETH, 6 decimals for USDC). Must be a non-negative integer string. + sig { returns(String) } + attr_accessor :asset_amount + + # The ID of the vault to deposit into. + sig { returns(String) } + attr_accessor :vault_id + + # Input for depositing assets into an ERC-4626 vault. + sig do + params(asset_amount: String, vault_id: String).returns(T.attached_class) + end + def self.new( + # The amount of the underlying asset to deposit, in the smallest unit (e.g., wei + # for ETH, 6 decimals for USDC). Must be a non-negative integer string. + asset_amount:, + # The ID of the vault to deposit into. + vault_id: + ) + end + + sig { override.returns({ asset_amount: String, vault_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_position_response.rbi b/rbi/privy/models/ethereum_yield_position_response.rbi new file mode 100644 index 0000000..1e8855f --- /dev/null +++ b/rbi/privy/models/ethereum_yield_position_response.rbi @@ -0,0 +1,106 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldPositionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldPositionResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::EthereumYieldPositionResponse::Asset) } + attr_reader :asset + + sig do + params(asset: Privy::EthereumYieldPositionResponse::Asset::OrHash).void + end + attr_writer :asset + + # Current asset value in the vault (realtime from ERC4626), in smallest unit. + sig { returns(String) } + attr_accessor :assets_in_vault + + # Current vault shares held (realtime from ERC4626). + sig { returns(String) } + attr_accessor :shares_in_vault + + # Total amount deposited into the vault, in smallest unit. + sig { returns(String) } + attr_accessor :total_deposited + + # Total amount withdrawn from the vault, in smallest unit. + sig { returns(String) } + attr_accessor :total_withdrawn + + # A user's position in a yield vault. + sig do + params( + asset: Privy::EthereumYieldPositionResponse::Asset::OrHash, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + ).returns(T.attached_class) + end + def self.new( + asset:, + # Current asset value in the vault (realtime from ERC4626), in smallest unit. + assets_in_vault:, + # Current vault shares held (realtime from ERC4626). + shares_in_vault:, + # Total amount deposited into the vault, in smallest unit. + total_deposited:, + # Total amount withdrawn from the vault, in smallest unit. + total_withdrawn: + ) + end + + sig do + override.returns( + { + asset: Privy::EthereumYieldPositionResponse::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + ) + end + def to_hash + end + + class Asset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EthereumYieldPositionResponse::Asset, + Privy::Internal::AnyHash + ) + end + + # Token contract address. + sig { returns(String) } + attr_accessor :address + + # Token symbol (e.g., "USDC"). + sig { returns(String) } + attr_accessor :symbol + + sig do + params(address: String, symbol: String).returns(T.attached_class) + end + def self.new( + # Token contract address. + address:, + # Token symbol (e.g., "USDC"). + symbol: + ) + end + + sig { override.returns({ address: String, symbol: String }) } + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_positions_input.rbi b/rbi/privy/models/ethereum_yield_positions_input.rbi new file mode 100644 index 0000000..ce24f2d --- /dev/null +++ b/rbi/privy/models/ethereum_yield_positions_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldPositionsInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldPositionsInput, Privy::Internal::AnyHash) + end + + # The vault ID to get position for. + sig { returns(String) } + attr_accessor :vault_id + + # Input for fetching yield positions. + sig { params(vault_id: String).returns(T.attached_class) } + def self.new( + # The vault ID to get position for. + vault_id: + ) + end + + sig { override.returns({ vault_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_provider.rbi b/rbi/privy/models/ethereum_yield_provider.rbi new file mode 100644 index 0000000..f625757 --- /dev/null +++ b/rbi/privy/models/ethereum_yield_provider.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Supported yield/lending protocol providers. + module EthereumYieldProvider + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EthereumYieldProvider) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MORPHO = T.let(:morpho, Privy::EthereumYieldProvider::TaggedSymbol) + AAVE = T.let(:aave, Privy::EthereumYieldProvider::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::EthereumYieldProvider::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_sweep_id_input.rbi b/rbi/privy/models/ethereum_yield_sweep_id_input.rbi new file mode 100644 index 0000000..2fb3f84 --- /dev/null +++ b/rbi/privy/models/ethereum_yield_sweep_id_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldSweepIDInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldSweepIDInput, Privy::Internal::AnyHash) + end + + # The yield sweep ID. + sig { returns(String) } + attr_accessor :id + + # Input for fetching a yield sweep by ID. + sig { params(id: String).returns(T.attached_class) } + def self.new( + # The yield sweep ID. + id: + ) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_sweep_response.rbi b/rbi/privy/models/ethereum_yield_sweep_response.rbi new file mode 100644 index 0000000..2110547 --- /dev/null +++ b/rbi/privy/models/ethereum_yield_sweep_response.rbi @@ -0,0 +1,104 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldSweepResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldSweepResponse, Privy::Internal::AnyHash) + end + + # Unique identifier for the yield sweep. + sig { returns(String) } + attr_accessor :id + + # The amount of underlying assets involved. Set after the sweep is confirmed + # on-chain. + sig { returns(T.nilable(String)) } + attr_accessor :asset_amount + + # Unix timestamp of when the sweep was created, in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # The amount of vault shares involved. Set after the sweep is confirmed on-chain. + sig { returns(T.nilable(String)) } + attr_accessor :share_amount + + # Status of a yield sweep. + sig { returns(Privy::EthereumYieldSweepStatus::OrSymbol) } + attr_accessor :status + + # Type of yield sweep. + sig { returns(Privy::EthereumYieldSweepType::OrSymbol) } + attr_accessor :type + + # Unix timestamp of when the sweep was last updated, in milliseconds. + sig { returns(Float) } + attr_accessor :updated_at + + # The ID of the vault involved in the sweep. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet involved in the sweep. + sig { returns(String) } + attr_accessor :wallet_id + + # A yield sweep record representing a deposit or withdrawal. + sig do + params( + id: String, + asset_amount: T.nilable(String), + created_at: Float, + share_amount: T.nilable(String), + status: Privy::EthereumYieldSweepStatus::OrSymbol, + type: Privy::EthereumYieldSweepType::OrSymbol, + updated_at: Float, + vault_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Unique identifier for the yield sweep. + id:, + # The amount of underlying assets involved. Set after the sweep is confirmed + # on-chain. + asset_amount:, + # Unix timestamp of when the sweep was created, in milliseconds. + created_at:, + # The amount of vault shares involved. Set after the sweep is confirmed on-chain. + share_amount:, + # Status of a yield sweep. + status:, + # Type of yield sweep. + type:, + # Unix timestamp of when the sweep was last updated, in milliseconds. + updated_at:, + # The ID of the vault involved in the sweep. + vault_id:, + # The ID of the wallet involved in the sweep. + wallet_id: + ) + end + + sig do + override.returns( + { + id: String, + asset_amount: T.nilable(String), + created_at: Float, + share_amount: T.nilable(String), + status: Privy::EthereumYieldSweepStatus::OrSymbol, + type: Privy::EthereumYieldSweepType::OrSymbol, + updated_at: Float, + vault_id: String, + wallet_id: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_sweep_status.rbi b/rbi/privy/models/ethereum_yield_sweep_status.rbi new file mode 100644 index 0000000..e48a68b --- /dev/null +++ b/rbi/privy/models/ethereum_yield_sweep_status.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # Status of a yield sweep. + module EthereumYieldSweepStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EthereumYieldSweepStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:pending, Privy::EthereumYieldSweepStatus::TaggedSymbol) + CONFIRMED = + T.let(:confirmed, Privy::EthereumYieldSweepStatus::TaggedSymbol) + FAILED = T.let(:failed, Privy::EthereumYieldSweepStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::EthereumYieldSweepStatus::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_sweep_type.rbi b/rbi/privy/models/ethereum_yield_sweep_type.rbi new file mode 100644 index 0000000..06cd560 --- /dev/null +++ b/rbi/privy/models/ethereum_yield_sweep_type.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Type of yield sweep. + module EthereumYieldSweepType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EthereumYieldSweepType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DEPOSIT = T.let(:deposit, Privy::EthereumYieldSweepType::TaggedSymbol) + WITHDRAW = T.let(:withdraw, Privy::EthereumYieldSweepType::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::EthereumYieldSweepType::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/ethereum_yield_withdraw_input.rbi b/rbi/privy/models/ethereum_yield_withdraw_input.rbi new file mode 100644 index 0000000..9ee10d0 --- /dev/null +++ b/rbi/privy/models/ethereum_yield_withdraw_input.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class EthereumYieldWithdrawInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EthereumYieldWithdrawInput, Privy::Internal::AnyHash) + end + + # The amount of the underlying asset to withdraw, in the smallest unit (e.g., wei + # for ETH, 6 decimals for USDC). Must be a non-negative integer string. + sig { returns(String) } + attr_accessor :asset_amount + + # The ID of the vault to withdraw from. + sig { returns(String) } + attr_accessor :vault_id + + # Input for withdrawing assets from an ERC-4626 vault. + sig do + params(asset_amount: String, vault_id: String).returns(T.attached_class) + end + def self.new( + # The amount of the underlying asset to withdraw, in the smallest unit (e.g., wei + # for ETH, 6 decimals for USDC). Must be a non-negative integer string. + asset_amount:, + # The ID of the vault to withdraw from. + vault_id: + ) + end + + sig { override.returns({ asset_amount: String, vault_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/evm_caip_2_chain_id.rbi b/rbi/privy/models/evm_caip_2_chain_id.rbi new file mode 100644 index 0000000..25a87e8 --- /dev/null +++ b/rbi/privy/models/evm_caip_2_chain_id.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + EvmCaip2ChainID = String + end +end diff --git a/rbi/privy/models/evm_transaction_wallet_action_step.rbi b/rbi/privy/models/evm_transaction_wallet_action_step.rbi new file mode 100644 index 0000000..203c90e --- /dev/null +++ b/rbi/privy/models/evm_transaction_wallet_action_step.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Privy + module Models + class EvmTransactionWalletActionStep < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::EvmTransactionWalletActionStep, Privy::Internal::AnyHash) + end + + # CAIP-2 chain identifier of the transaction, containing the chain ID. + sig { returns(String) } + attr_accessor :caip2 + + # Status of an EVM step in a wallet action. + sig { returns(Privy::EvmWalletActionStepStatus::TaggedSymbol) } + attr_accessor :status + + # The transaction hash for this step. May change while the step status is + # non-terminal. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_hash + + sig { returns(Privy::EvmTransactionWalletActionStep::Type::TaggedSymbol) } + attr_accessor :type + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # A wallet action step consisting of an EVM transaction. + sig do + params( + caip2: String, + status: Privy::EvmWalletActionStepStatus::OrSymbol, + transaction_hash: T.nilable(String), + type: Privy::EvmTransactionWalletActionStep::Type::OrSymbol, + failure_reason: Privy::FailureReason::OrHash + ).returns(T.attached_class) + end + def self.new( + # CAIP-2 chain identifier of the transaction, containing the chain ID. + caip2:, + # Status of an EVM step in a wallet action. + status:, + # The transaction hash for this step. May change while the step status is + # non-terminal. + transaction_hash:, + type:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil + ) + end + + sig do + override.returns( + { + caip2: String, + status: Privy::EvmWalletActionStepStatus::TaggedSymbol, + transaction_hash: T.nilable(String), + type: Privy::EvmTransactionWalletActionStep::Type::TaggedSymbol, + failure_reason: Privy::FailureReason + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EvmTransactionWalletActionStep::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EVM_TRANSACTION = + T.let( + :evm_transaction, + Privy::EvmTransactionWalletActionStep::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::EvmTransactionWalletActionStep::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/evm_user_operation_wallet_action_step.rbi b/rbi/privy/models/evm_user_operation_wallet_action_step.rbi new file mode 100644 index 0000000..5c5103e --- /dev/null +++ b/rbi/privy/models/evm_user_operation_wallet_action_step.rbi @@ -0,0 +1,173 @@ +# typed: strong + +module Privy + module Models + class EvmUserOperationWalletActionStep < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::EvmUserOperationWalletActionStep, + Privy::Internal::AnyHash + ) + end + + # Transaction hash of the bundle in which this user operation was included. Null + # until included by a bundler. + sig { returns(T.nilable(String)) } + attr_accessor :bundle_transaction_hash + + # CAIP-2 network identifier, containing the chain ID of the user operation. + sig { returns(String) } + attr_accessor :caip2 + + # The entrypoint version of the user operation. + sig do + returns( + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::TaggedSymbol + ) + end + attr_accessor :entrypoint_version + + # Status of an EVM step in a wallet action. + sig { returns(Privy::EvmWalletActionStepStatus::TaggedSymbol) } + attr_accessor :status + + sig do + returns(Privy::EvmUserOperationWalletActionStep::Type::TaggedSymbol) + end + attr_accessor :type + + # The user operation hash for this step. May change while the step status is + # non-terminal. + sig { returns(T.nilable(String)) } + attr_accessor :user_operation_hash + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # A wallet action step consisting of an EVM user operation. + sig do + params( + bundle_transaction_hash: T.nilable(String), + caip2: String, + entrypoint_version: + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::OrSymbol, + status: Privy::EvmWalletActionStepStatus::OrSymbol, + type: Privy::EvmUserOperationWalletActionStep::Type::OrSymbol, + user_operation_hash: T.nilable(String), + failure_reason: Privy::FailureReason::OrHash + ).returns(T.attached_class) + end + def self.new( + # Transaction hash of the bundle in which this user operation was included. Null + # until included by a bundler. + bundle_transaction_hash:, + # CAIP-2 network identifier, containing the chain ID of the user operation. + caip2:, + # The entrypoint version of the user operation. + entrypoint_version:, + # Status of an EVM step in a wallet action. + status:, + type:, + # The user operation hash for this step. May change while the step status is + # non-terminal. + user_operation_hash:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil + ) + end + + sig do + override.returns( + { + bundle_transaction_hash: T.nilable(String), + caip2: String, + entrypoint_version: + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::TaggedSymbol, + status: Privy::EvmWalletActionStepStatus::TaggedSymbol, + type: Privy::EvmUserOperationWalletActionStep::Type::TaggedSymbol, + user_operation_hash: T.nilable(String), + failure_reason: Privy::FailureReason + } + ) + end + def to_hash + end + + # The entrypoint version of the user operation. + module EntrypointVersion + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::EvmUserOperationWalletActionStep::EntrypointVersion + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENTRYPOINT_VERSION_0_6 = + T.let( + :"0.6", + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::TaggedSymbol + ) + ENTRYPOINT_VERSION_0_7 = + T.let( + :"0.7", + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::TaggedSymbol + ) + ENTRYPOINT_VERSION_0_8 = + T.let( + :"0.8", + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::TaggedSymbol + ) + ENTRYPOINT_VERSION_0_9 = + T.let( + :"0.9", + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EvmUserOperationWalletActionStep::EntrypointVersion::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::EvmUserOperationWalletActionStep::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EVM_USER_OPERATION = + T.let( + :evm_user_operation, + Privy::EvmUserOperationWalletActionStep::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::EvmUserOperationWalletActionStep::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/evm_wallet_action_step_status.rbi b/rbi/privy/models/evm_wallet_action_step_status.rbi new file mode 100644 index 0000000..113d184 --- /dev/null +++ b/rbi/privy/models/evm_wallet_action_step_status.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Privy + module Models + # Status of an EVM step in a wallet action. + module EvmWalletActionStepStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::EvmWalletActionStepStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PREPARING = + T.let(:preparing, Privy::EvmWalletActionStepStatus::TaggedSymbol) + QUEUED = T.let(:queued, Privy::EvmWalletActionStepStatus::TaggedSymbol) + PENDING = T.let(:pending, Privy::EvmWalletActionStepStatus::TaggedSymbol) + RETRYING = + T.let(:retrying, Privy::EvmWalletActionStepStatus::TaggedSymbol) + CONFIRMED = + T.let(:confirmed, Privy::EvmWalletActionStepStatus::TaggedSymbol) + REJECTED = + T.let(:rejected, Privy::EvmWalletActionStepStatus::TaggedSymbol) + REVERTED = + T.let(:reverted, Privy::EvmWalletActionStepStatus::TaggedSymbol) + REPLACED = + T.let(:replaced, Privy::EvmWalletActionStepStatus::TaggedSymbol) + ABANDONED = + T.let(:abandoned, Privy::EvmWalletActionStepStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::EvmWalletActionStepStatus::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/export_private_key_rpc_input.rbi b/rbi/privy/models/export_private_key_rpc_input.rbi new file mode 100644 index 0000000..605768b --- /dev/null +++ b/rbi/privy/models/export_private_key_rpc_input.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class ExportPrivateKeyRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ExportPrivateKeyRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::ExportPrivateKeyRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + sig { returns(Privy::PrivateKeyExportInput) } + attr_reader :params + + sig { params(params: Privy::PrivateKeyExportInput::OrHash).void } + attr_writer :params + + # Exports the private key of the wallet. + sig do + params( + address: String, + method_: Privy::ExportPrivateKeyRpcInput::Method::OrSymbol, + params: Privy::PrivateKeyExportInput::OrHash + ).returns(T.attached_class) + end + def self.new( + address:, + method_:, + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + params: + ) + end + + sig do + override.returns( + { + address: String, + method_: Privy::ExportPrivateKeyRpcInput::Method::OrSymbol, + params: Privy::PrivateKeyExportInput + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::ExportPrivateKeyRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXPORT_PRIVATE_KEY = + T.let( + :exportPrivateKey, + Privy::ExportPrivateKeyRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::ExportPrivateKeyRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/export_private_key_rpc_response.rbi b/rbi/privy/models/export_private_key_rpc_response.rbi new file mode 100644 index 0000000..977b694 --- /dev/null +++ b/rbi/privy/models/export_private_key_rpc_response.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class ExportPrivateKeyRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ExportPrivateKeyRpcResponse, Privy::Internal::AnyHash) + end + + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + sig { returns(Privy::PrivateKeyExportInput) } + attr_reader :data + + sig { params(data: Privy::PrivateKeyExportInput::OrHash).void } + attr_writer :data + + sig { returns(Privy::ExportPrivateKeyRpcResponse::Method::TaggedSymbol) } + attr_accessor :method_ + + # Response to the `exportPrivateKey` RPC. + sig do + params( + data: Privy::PrivateKeyExportInput::OrHash, + method_: Privy::ExportPrivateKeyRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::PrivateKeyExportInput, + method_: Privy::ExportPrivateKeyRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::ExportPrivateKeyRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXPORT_PRIVATE_KEY = + T.let( + :exportPrivateKey, + Privy::ExportPrivateKeyRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::ExportPrivateKeyRpcResponse::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/export_seed_phrase_rpc_input.rbi b/rbi/privy/models/export_seed_phrase_rpc_input.rbi new file mode 100644 index 0000000..7971c3d --- /dev/null +++ b/rbi/privy/models/export_seed_phrase_rpc_input.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class ExportSeedPhraseRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ExportSeedPhraseRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::ExportSeedPhraseRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + sig { returns(Privy::SeedPhraseExportInput) } + attr_reader :params + + sig { params(params: Privy::SeedPhraseExportInput::OrHash).void } + attr_writer :params + + # Exports the seed phrase of the wallet. + sig do + params( + address: String, + method_: Privy::ExportSeedPhraseRpcInput::Method::OrSymbol, + params: Privy::SeedPhraseExportInput::OrHash + ).returns(T.attached_class) + end + def self.new( + address:, + method_:, + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + params: + ) + end + + sig do + override.returns( + { + address: String, + method_: Privy::ExportSeedPhraseRpcInput::Method::OrSymbol, + params: Privy::SeedPhraseExportInput + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::ExportSeedPhraseRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXPORT_SEED_PHRASE = + T.let( + :exportSeedPhrase, + Privy::ExportSeedPhraseRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::ExportSeedPhraseRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/export_seed_phrase_rpc_response.rbi b/rbi/privy/models/export_seed_phrase_rpc_response.rbi new file mode 100644 index 0000000..c7b6628 --- /dev/null +++ b/rbi/privy/models/export_seed_phrase_rpc_response.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class ExportSeedPhraseRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ExportSeedPhraseRpcResponse, Privy::Internal::AnyHash) + end + + # Response containing HPKE-encrypted wallet data (private key or seed phrase). + sig { returns(Privy::SeedPhraseExportResponse) } + attr_reader :data + + sig { params(data: Privy::SeedPhraseExportResponse::OrHash).void } + attr_writer :data + + sig { returns(Privy::ExportSeedPhraseRpcResponse::Method::TaggedSymbol) } + attr_accessor :method_ + + # Response to the `exportSeedPhrase` RPC. + sig do + params( + data: Privy::SeedPhraseExportResponse::OrHash, + method_: Privy::ExportSeedPhraseRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Response containing HPKE-encrypted wallet data (private key or seed phrase). + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::SeedPhraseExportResponse, + method_: Privy::ExportSeedPhraseRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::ExportSeedPhraseRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXPORT_SEED_PHRASE = + T.let( + :exportSeedPhrase, + Privy::ExportSeedPhraseRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::ExportSeedPhraseRpcResponse::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/export_type.rbi b/rbi/privy/models/export_type.rbi new file mode 100644 index 0000000..2f629b4 --- /dev/null +++ b/rbi/privy/models/export_type.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + module ExportType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::ExportType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DISPLAY = T.let(:display, Privy::ExportType::TaggedSymbol) + CLIENT = T.let(:client, Privy::ExportType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::ExportType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/extended_chain_type.rbi b/rbi/privy/models/extended_chain_type.rbi new file mode 100644 index 0000000..8e8ed9b --- /dev/null +++ b/rbi/privy/models/extended_chain_type.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + # The wallet chain types that are not first class chains. + module ExtendedChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::ExtendedChainType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COSMOS = T.let(:cosmos, Privy::ExtendedChainType::TaggedSymbol) + STELLAR = T.let(:stellar, Privy::ExtendedChainType::TaggedSymbol) + SUI = T.let(:sui, Privy::ExtendedChainType::TaggedSymbol) + APTOS = T.let(:aptos, Privy::ExtendedChainType::TaggedSymbol) + MOVEMENT = T.let(:movement, Privy::ExtendedChainType::TaggedSymbol) + TRON = T.let(:tron, Privy::ExtendedChainType::TaggedSymbol) + BITCOIN_SEGWIT = + T.let(:"bitcoin-segwit", Privy::ExtendedChainType::TaggedSymbol) + BITCOIN_TAPROOT = + T.let(:"bitcoin-taproot", Privy::ExtendedChainType::TaggedSymbol) + PEARL = T.let(:pearl, Privy::ExtendedChainType::TaggedSymbol) + NEAR = T.let(:near, Privy::ExtendedChainType::TaggedSymbol) + TON = T.let(:ton, Privy::ExtendedChainType::TaggedSymbol) + STARKNET = T.let(:starknet, Privy::ExtendedChainType::TaggedSymbol) + SPARK = T.let(:spark, Privy::ExtendedChainType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::ExtendedChainType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/external_oauth_provider_id.rbi b/rbi/privy/models/external_oauth_provider_id.rbi new file mode 100644 index 0000000..46ea62f --- /dev/null +++ b/rbi/privy/models/external_oauth_provider_id.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + # The ID of an external OAuth provider. + module ExternalOAuthProviderID + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::ExternalOAuthProviderID) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GOOGLE = T.let(:google, Privy::ExternalOAuthProviderID::TaggedSymbol) + DISCORD = T.let(:discord, Privy::ExternalOAuthProviderID::TaggedSymbol) + TWITTER = T.let(:twitter, Privy::ExternalOAuthProviderID::TaggedSymbol) + GITHUB = T.let(:github, Privy::ExternalOAuthProviderID::TaggedSymbol) + SPOTIFY = T.let(:spotify, Privy::ExternalOAuthProviderID::TaggedSymbol) + INSTAGRAM = + T.let(:instagram, Privy::ExternalOAuthProviderID::TaggedSymbol) + TIKTOK = T.let(:tiktok, Privy::ExternalOAuthProviderID::TaggedSymbol) + LINKEDIN = T.let(:linkedin, Privy::ExternalOAuthProviderID::TaggedSymbol) + APPLE = T.let(:apple, Privy::ExternalOAuthProviderID::TaggedSymbol) + LINE = T.let(:line, Privy::ExternalOAuthProviderID::TaggedSymbol) + TWITCH = T.let(:twitch, Privy::ExternalOAuthProviderID::TaggedSymbol) + TELEGRAM = T.let(:telegram, Privy::ExternalOAuthProviderID::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::ExternalOAuthProviderID::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/external_transaction_wallet_action_step.rbi b/rbi/privy/models/external_transaction_wallet_action_step.rbi new file mode 100644 index 0000000..a82f98d --- /dev/null +++ b/rbi/privy/models/external_transaction_wallet_action_step.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Privy + module Models + class ExternalTransactionWalletActionStep < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::ExternalTransactionWalletActionStep, + Privy::Internal::AnyHash + ) + end + + # Status of an external transaction step in a wallet action. + sig do + returns(Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol) + end + attr_accessor :status + + sig do + returns(Privy::ExternalTransactionWalletActionStep::Type::TaggedSymbol) + end + attr_accessor :type + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # A wallet action step representing a cross-chain/cross-asset fill by an external + # provider. + sig do + params( + status: Privy::ExternalTransactionWalletActionStepStatus::OrSymbol, + type: Privy::ExternalTransactionWalletActionStep::Type::OrSymbol, + failure_reason: Privy::FailureReason::OrHash + ).returns(T.attached_class) + end + def self.new( + # Status of an external transaction step in a wallet action. + status:, + type:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil + ) + end + + sig do + override.returns( + { + status: + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol, + type: + Privy::ExternalTransactionWalletActionStep::Type::TaggedSymbol, + failure_reason: Privy::FailureReason + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::ExternalTransactionWalletActionStep::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EXTERNAL_TRANSACTION = + T.let( + :external_transaction, + Privy::ExternalTransactionWalletActionStep::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::ExternalTransactionWalletActionStep::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/external_transaction_wallet_action_step_status.rbi b/rbi/privy/models/external_transaction_wallet_action_step_status.rbi new file mode 100644 index 0000000..cd3584f --- /dev/null +++ b/rbi/privy/models/external_transaction_wallet_action_step_status.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + # Status of an external transaction step in a wallet action. + module ExternalTransactionWalletActionStepStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::ExternalTransactionWalletActionStepStatus) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PREPARING = + T.let( + :preparing, + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol + ) + QUEUED = + T.let( + :queued, + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol + ) + PENDING = + T.let( + :pending, + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol + ) + CONFIRMED = + T.let( + :confirmed, + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol + ) + REJECTED = + T.let( + :rejected, + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::ExternalTransactionWalletActionStepStatus::TaggedSymbol + ] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/failure_reason.rbi b/rbi/privy/models/failure_reason.rbi new file mode 100644 index 0000000..ba58d94 --- /dev/null +++ b/rbi/privy/models/failure_reason.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + module Models + class FailureReason < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::FailureReason, Privy::Internal::AnyHash) } + + # Human-readable failure message. + sig { returns(String) } + attr_accessor :message + + # Additional error details, if available. + sig { returns(T.nilable(T.anything)) } + attr_reader :details + + sig { params(details: T.anything).void } + attr_writer :details + + # A description of why a wallet action (or a step within a wallet action) failed. + sig do + params(message: String, details: T.anything).returns(T.attached_class) + end + def self.new( + # Human-readable failure message. + message:, + # Additional error details, if available. + details: nil + ) + end + + sig { override.returns({ message: String, details: T.anything }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_authenticate_input.rbi b/rbi/privy/models/farcaster_authenticate_input.rbi new file mode 100644 index 0000000..48ee0fe --- /dev/null +++ b/rbi/privy/models/farcaster_authenticate_input.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Privy + module Models + class FarcasterAuthenticateInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterAuthenticateInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :channel_token + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # Input for authenticating with Farcaster. + sig do + params( + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + channel_token:, + fid:, + message:, + signature:, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_authenticate_request_body.rbi b/rbi/privy/models/farcaster_authenticate_request_body.rbi new file mode 100644 index 0000000..ceab2c4 --- /dev/null +++ b/rbi/privy/models/farcaster_authenticate_request_body.rbi @@ -0,0 +1,68 @@ +# typed: strong + +module Privy + module Models + class FarcasterAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterAuthenticateRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :channel_token + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # The request body for authenticating with Farcaster. + sig do + params( + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + channel_token:, + fid:, + message:, + signature:, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_connect_init_response.rbi b/rbi/privy/models/farcaster_connect_init_response.rbi new file mode 100644 index 0000000..d5e3428 --- /dev/null +++ b/rbi/privy/models/farcaster_connect_init_response.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Privy + module Models + class FarcasterConnectInitResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterConnectInitResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :channel_token + + sig { returns(String) } + attr_accessor :connect_uri + + # Proxy for the Farcaster Connect init response as defined in FIP-11. + sig do + params(channel_token: String, connect_uri: String).returns( + T.attached_class + ) + end + def self.new(channel_token:, connect_uri:) + end + + sig { override.returns({ channel_token: String, connect_uri: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_connect_init_response_body.rbi b/rbi/privy/models/farcaster_connect_init_response_body.rbi new file mode 100644 index 0000000..1f97ff2 --- /dev/null +++ b/rbi/privy/models/farcaster_connect_init_response_body.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class FarcasterConnectInitResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterConnectInitResponseBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :channel_token + + sig { returns(String) } + attr_accessor :connect_uri + + # The response body for initiating a Farcaster connection. + sig do + params(channel_token: String, connect_uri: String).returns( + T.attached_class + ) + end + def self.new(channel_token:, connect_uri:) + end + + sig { override.returns({ channel_token: String, connect_uri: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_connect_status_completed_response.rbi b/rbi/privy/models/farcaster_connect_status_completed_response.rbi new file mode 100644 index 0000000..acedd25 --- /dev/null +++ b/rbi/privy/models/farcaster_connect_status_completed_response.rbi @@ -0,0 +1,117 @@ +# typed: strong + +module Privy + module Models + class FarcasterConnectStatusCompletedResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterConnectStatusCompletedResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :bio + + sig { returns(String) } + attr_accessor :display_name + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :nonce + + sig { returns(String) } + attr_accessor :pfp_url + + sig { returns(String) } + attr_accessor :signature + + sig do + returns(Privy::FarcasterConnectStatusCompletedResponse::State::OrSymbol) + end + attr_accessor :state + + sig { returns(String) } + attr_accessor :username + + # Proxy for the Farcaster Connect completed status response as defined in FIP-11. + sig do + params( + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: + Privy::FarcasterConnectStatusCompletedResponse::State::OrSymbol, + username: String + ).returns(T.attached_class) + end + def self.new( + bio:, + display_name:, + fid:, + message:, + nonce:, + pfp_url:, + signature:, + state:, + username: + ) + end + + sig do + override.returns( + { + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: + Privy::FarcasterConnectStatusCompletedResponse::State::OrSymbol, + username: String + } + ) + end + def to_hash + end + + module State + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::FarcasterConnectStatusCompletedResponse::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPLETED = + T.let( + :completed, + Privy::FarcasterConnectStatusCompletedResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::FarcasterConnectStatusCompletedResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_connect_status_completed_response_body.rbi b/rbi/privy/models/farcaster_connect_status_completed_response_body.rbi new file mode 100644 index 0000000..3a39552 --- /dev/null +++ b/rbi/privy/models/farcaster_connect_status_completed_response_body.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Privy + module Models + class FarcasterConnectStatusCompletedResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterConnectStatusCompletedResponseBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :bio + + sig { returns(String) } + attr_accessor :display_name + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :nonce + + sig { returns(String) } + attr_accessor :pfp_url + + sig { returns(String) } + attr_accessor :signature + + sig do + returns( + Privy::FarcasterConnectStatusCompletedResponseBody::State::OrSymbol + ) + end + attr_accessor :state + + sig { returns(String) } + attr_accessor :username + + # The response body for completing a Farcaster connection. + sig do + params( + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: + Privy::FarcasterConnectStatusCompletedResponseBody::State::OrSymbol, + username: String + ).returns(T.attached_class) + end + def self.new( + bio:, + display_name:, + fid:, + message:, + nonce:, + pfp_url:, + signature:, + state:, + username: + ) + end + + sig do + override.returns( + { + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: + Privy::FarcasterConnectStatusCompletedResponseBody::State::OrSymbol, + username: String + } + ) + end + def to_hash + end + + module State + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::FarcasterConnectStatusCompletedResponseBody::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMPLETED = + T.let( + :completed, + Privy::FarcasterConnectStatusCompletedResponseBody::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::FarcasterConnectStatusCompletedResponseBody::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_connect_status_pending_response.rbi b/rbi/privy/models/farcaster_connect_status_pending_response.rbi new file mode 100644 index 0000000..d160ca4 --- /dev/null +++ b/rbi/privy/models/farcaster_connect_status_pending_response.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Privy + module Models + class FarcasterConnectStatusPendingResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterConnectStatusPendingResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :nonce + + sig do + returns(Privy::FarcasterConnectStatusPendingResponse::State::OrSymbol) + end + attr_accessor :state + + # Proxy for the Farcaster Connect pending status response as defined in FIP-11. + sig do + params( + nonce: String, + state: Privy::FarcasterConnectStatusPendingResponse::State::OrSymbol + ).returns(T.attached_class) + end + def self.new(nonce:, state:) + end + + sig do + override.returns( + { + nonce: String, + state: Privy::FarcasterConnectStatusPendingResponse::State::OrSymbol + } + ) + end + def to_hash + end + + module State + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::FarcasterConnectStatusPendingResponse::State) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Privy::FarcasterConnectStatusPendingResponse::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::FarcasterConnectStatusPendingResponse::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_connect_status_pending_response_body.rbi b/rbi/privy/models/farcaster_connect_status_pending_response_body.rbi new file mode 100644 index 0000000..a5645dc --- /dev/null +++ b/rbi/privy/models/farcaster_connect_status_pending_response_body.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class FarcasterConnectStatusPendingResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterConnectStatusPendingResponseBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :nonce + + sig do + returns( + Privy::FarcasterConnectStatusPendingResponseBody::State::OrSymbol + ) + end + attr_accessor :state + + # The response body for pending a Farcaster connection. + sig do + params( + nonce: String, + state: + Privy::FarcasterConnectStatusPendingResponseBody::State::OrSymbol + ).returns(T.attached_class) + end + def self.new(nonce:, state:) + end + + sig do + override.returns( + { + nonce: String, + state: + Privy::FarcasterConnectStatusPendingResponseBody::State::OrSymbol + } + ) + end + def to_hash + end + + module State + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::FarcasterConnectStatusPendingResponseBody::State + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Privy::FarcasterConnectStatusPendingResponseBody::State::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::FarcasterConnectStatusPendingResponseBody::State::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_init_input.rbi b/rbi/privy/models/farcaster_init_input.rbi new file mode 100644 index 0000000..bd057f6 --- /dev/null +++ b/rbi/privy/models/farcaster_init_input.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class FarcasterInitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterInitInput, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :redirect_url + + sig { params(redirect_url: String).void } + attr_writer :redirect_url + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Input for initiating a Farcaster connection. + sig do + params( + token: String, + redirect_url: String, + relying_party: String + ).returns(T.attached_class) + end + def self.new(token: nil, redirect_url: nil, relying_party: nil) + end + + sig do + override.returns( + { token: String, redirect_url: String, relying_party: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_init_request_body.rbi b/rbi/privy/models/farcaster_init_request_body.rbi new file mode 100644 index 0000000..36857c5 --- /dev/null +++ b/rbi/privy/models/farcaster_init_request_body.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class FarcasterInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterInitRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :redirect_url + + sig { params(redirect_url: String).void } + attr_writer :redirect_url + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # The request body for initiating a Farcaster connection. + sig do + params( + token: String, + redirect_url: String, + relying_party: String + ).returns(T.attached_class) + end + def self.new(token: nil, redirect_url: nil, relying_party: nil) + end + + sig do + override.returns( + { token: String, redirect_url: String, relying_party: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_link_input.rbi b/rbi/privy/models/farcaster_link_input.rbi new file mode 100644 index 0000000..3f135b3 --- /dev/null +++ b/rbi/privy/models/farcaster_link_input.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class FarcasterLinkInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterLinkInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :channel_token + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # Input for linking a Farcaster account. + sig do + params( + channel_token: String, + fid: Float, + message: String, + signature: String + ).returns(T.attached_class) + end + def self.new(channel_token:, fid:, message:, signature:) + end + + sig do + override.returns( + { + channel_token: String, + fid: Float, + message: String, + signature: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_link_request_body.rbi b/rbi/privy/models/farcaster_link_request_body.rbi new file mode 100644 index 0000000..d59d698 --- /dev/null +++ b/rbi/privy/models/farcaster_link_request_body.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class FarcasterLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :channel_token + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # The request body for linking a Farcaster account. + sig do + params( + channel_token: String, + fid: Float, + message: String, + signature: String + ).returns(T.attached_class) + end + def self.new(channel_token:, fid:, message:, signature:) + end + + sig do + override.returns( + { + channel_token: String, + fid: Float, + message: String, + signature: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_signer_approved.rbi b/rbi/privy/models/farcaster_signer_approved.rbi new file mode 100644 index 0000000..0bba02f --- /dev/null +++ b/rbi/privy/models/farcaster_signer_approved.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class FarcasterSignerApproved < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterSignerApproved, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :public_key + + sig { returns(Privy::FarcasterSignerApproved::Status::OrSymbol) } + attr_accessor :status + + # A Farcaster signer response when the signer has been approved. + sig do + params( + fid: String, + public_key: String, + status: Privy::FarcasterSignerApproved::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(fid:, public_key:, status:) + end + + sig do + override.returns( + { + fid: String, + public_key: String, + status: Privy::FarcasterSignerApproved::Status::OrSymbol + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::FarcasterSignerApproved::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPROVED = + T.let(:approved, Privy::FarcasterSignerApproved::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::FarcasterSignerApproved::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_signer_init_pending_approval.rbi b/rbi/privy/models/farcaster_signer_init_pending_approval.rbi new file mode 100644 index 0000000..cfde972 --- /dev/null +++ b/rbi/privy/models/farcaster_signer_init_pending_approval.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module Privy + module Models + class FarcasterSignerInitPendingApproval < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterSignerInitPendingApproval, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :public_key + + sig { returns(String) } + attr_accessor :signer_approval_url + + sig do + returns(Privy::FarcasterSignerInitPendingApproval::Status::OrSymbol) + end + attr_accessor :status + + # A Farcaster signer init response when the signer is pending approval. + sig do + params( + public_key: String, + signer_approval_url: String, + status: Privy::FarcasterSignerInitPendingApproval::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(public_key:, signer_approval_url:, status:) + end + + sig do + override.returns( + { + public_key: String, + signer_approval_url: String, + status: Privy::FarcasterSignerInitPendingApproval::Status::OrSymbol + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::FarcasterSignerInitPendingApproval::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING_APPROVAL = + T.let( + :pending_approval, + Privy::FarcasterSignerInitPendingApproval::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::FarcasterSignerInitPendingApproval::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_signer_init_request_body.rbi b/rbi/privy/models/farcaster_signer_init_request_body.rbi new file mode 100644 index 0000000..7ead079 --- /dev/null +++ b/rbi/privy/models/farcaster_signer_init_request_body.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class FarcasterSignerInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterSignerInitRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :ed25519_public_key + + sig { returns(T.nilable(String)) } + attr_reader :deadline + + sig { params(deadline: String).void } + attr_writer :deadline + + # The request body for initiating a Farcaster signer connection. + sig do + params(ed25519_public_key: String, deadline: String).returns( + T.attached_class + ) + end + def self.new(ed25519_public_key:, deadline: nil) + end + + sig { override.returns({ ed25519_public_key: String, deadline: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_signer_init_response_body.rbi b/rbi/privy/models/farcaster_signer_init_response_body.rbi new file mode 100644 index 0000000..6ef7a1b --- /dev/null +++ b/rbi/privy/models/farcaster_signer_init_response_body.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # The response body from initiating a Farcaster signer connection. + module FarcasterSignerInitResponseBody + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::FarcasterSignerInitPendingApproval, + Privy::FarcasterSignerApproved, + Privy::FarcasterSignerRevoked + ) + end + + sig do + override.returns( + T::Array[Privy::FarcasterSignerInitResponseBody::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/farcaster_signer_revoked.rbi b/rbi/privy/models/farcaster_signer_revoked.rbi new file mode 100644 index 0000000..ad30ed4 --- /dev/null +++ b/rbi/privy/models/farcaster_signer_revoked.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class FarcasterSignerRevoked < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterSignerRevoked, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :public_key + + sig { returns(Privy::FarcasterSignerRevoked::Status::OrSymbol) } + attr_accessor :status + + # A Farcaster signer response when the signer has been revoked. + sig do + params( + fid: String, + public_key: String, + status: Privy::FarcasterSignerRevoked::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(fid:, public_key:, status:) + end + + sig do + override.returns( + { + fid: String, + public_key: String, + status: Privy::FarcasterSignerRevoked::Status::OrSymbol + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::FarcasterSignerRevoked::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REVOKED = + T.let(:revoked, Privy::FarcasterSignerRevoked::Status::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::FarcasterSignerRevoked::Status::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_signer_status_pending_approval.rbi b/rbi/privy/models/farcaster_signer_status_pending_approval.rbi new file mode 100644 index 0000000..ad3e403 --- /dev/null +++ b/rbi/privy/models/farcaster_signer_status_pending_approval.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class FarcasterSignerStatusPendingApproval < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterSignerStatusPendingApproval, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :public_key + + sig do + returns(Privy::FarcasterSignerStatusPendingApproval::Status::OrSymbol) + end + attr_accessor :status + + # A Farcaster signer status response when the signer is pending approval. + sig do + params( + public_key: String, + status: Privy::FarcasterSignerStatusPendingApproval::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(public_key:, status:) + end + + sig do + override.returns( + { + public_key: String, + status: + Privy::FarcasterSignerStatusPendingApproval::Status::OrSymbol + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::FarcasterSignerStatusPendingApproval::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING_APPROVAL = + T.let( + :pending_approval, + Privy::FarcasterSignerStatusPendingApproval::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::FarcasterSignerStatusPendingApproval::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/farcaster_signer_status_response_body.rbi b/rbi/privy/models/farcaster_signer_status_response_body.rbi new file mode 100644 index 0000000..b1c59f8 --- /dev/null +++ b/rbi/privy/models/farcaster_signer_status_response_body.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # The response body from checking the status of a Farcaster signer connection. + module FarcasterSignerStatusResponseBody + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::FarcasterSignerStatusPendingApproval, + Privy::FarcasterSignerApproved, + Privy::FarcasterSignerRevoked + ) + end + + sig do + override.returns( + T::Array[Privy::FarcasterSignerStatusResponseBody::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/farcaster_unlink_input.rbi b/rbi/privy/models/farcaster_unlink_input.rbi new file mode 100644 index 0000000..bcceb23 --- /dev/null +++ b/rbi/privy/models/farcaster_unlink_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class FarcasterUnlinkInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterUnlinkInput, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :fid + + # Input for unlinking a Farcaster account. + sig { params(fid: Float).returns(T.attached_class) } + def self.new(fid:) + end + + sig { override.returns({ fid: Float }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_unlink_request_body.rbi b/rbi/privy/models/farcaster_unlink_request_body.rbi new file mode 100644 index 0000000..b4e8eb8 --- /dev/null +++ b/rbi/privy/models/farcaster_unlink_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class FarcasterUnlinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterUnlinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :fid + + # The request body for unlinking a Farcaster account. + sig { params(fid: Float).returns(T.attached_class) } + def self.new(fid:) + end + + sig { override.returns({ fid: Float }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_v_2_authenticate_input.rbi b/rbi/privy/models/farcaster_v_2_authenticate_input.rbi new file mode 100644 index 0000000..26c49d5 --- /dev/null +++ b/rbi/privy/models/farcaster_v_2_authenticate_input.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class FarcasterV2AuthenticateInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterV2AuthenticateInput, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # Input for authenticating a Farcaster V2 account. + sig do + params( + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + fid:, + message:, + signature:, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_v_2_authenticate_request_body.rbi b/rbi/privy/models/farcaster_v_2_authenticate_request_body.rbi new file mode 100644 index 0000000..d74f68c --- /dev/null +++ b/rbi/privy/models/farcaster_v_2_authenticate_request_body.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Privy + module Models + class FarcasterV2AuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FarcasterV2AuthenticateRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # The request body for authenticating a Farcaster V2 account. + sig do + params( + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + fid:, + message:, + signature:, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { + fid: Float, + message: String, + signature: String, + mode: Privy::AuthenticateModeOption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_v_2_init_input.rbi b/rbi/privy/models/farcaster_v_2_init_input.rbi new file mode 100644 index 0000000..8782b3f --- /dev/null +++ b/rbi/privy/models/farcaster_v_2_init_input.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + class FarcasterV2InitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterV2InitInput, Privy::Internal::AnyHash) + end + + # Input for initiating a Farcaster V2 connection. + sig { returns(T.attached_class) } + def self.new + end + + sig { override.returns({}) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_v_2_init_request_body.rbi b/rbi/privy/models/farcaster_v_2_init_request_body.rbi new file mode 100644 index 0000000..93cd3e7 --- /dev/null +++ b/rbi/privy/models/farcaster_v_2_init_request_body.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + class FarcasterV2InitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterV2InitRequestBody, Privy::Internal::AnyHash) + end + + # The request body for initiating a Farcaster V2 connection. + sig { returns(T.attached_class) } + def self.new + end + + sig { override.returns({}) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_v_2_init_response.rbi b/rbi/privy/models/farcaster_v_2_init_response.rbi new file mode 100644 index 0000000..f188c1c --- /dev/null +++ b/rbi/privy/models/farcaster_v_2_init_response.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + class FarcasterV2InitResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterV2InitResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :nonce + + # Response for initiating a Farcaster V2 connection. + sig do + params(expires_at: String, nonce: String).returns(T.attached_class) + end + def self.new(expires_at:, nonce:) + end + + sig { override.returns({ expires_at: String, nonce: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/farcaster_v_2_init_response_body.rbi b/rbi/privy/models/farcaster_v_2_init_response_body.rbi new file mode 100644 index 0000000..d6871f0 --- /dev/null +++ b/rbi/privy/models/farcaster_v_2_init_response_body.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + class FarcasterV2InitResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FarcasterV2InitResponseBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :nonce + + # The response body for initiating a Farcaster V2 connection. + sig do + params(expires_at: String, nonce: String).returns(T.attached_class) + end + def self.new(expires_at:, nonce:) + end + + sig { override.returns({ expires_at: String, nonce: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/fiat_amount.rbi b/rbi/privy/models/fiat_amount.rbi new file mode 100644 index 0000000..fd9c476 --- /dev/null +++ b/rbi/privy/models/fiat_amount.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + FiatAmount = String + end +end diff --git a/rbi/privy/models/fiat_currency_code.rbi b/rbi/privy/models/fiat_currency_code.rbi new file mode 100644 index 0000000..db0da87 --- /dev/null +++ b/rbi/privy/models/fiat_currency_code.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + FiatCurrencyCode = String + end +end diff --git a/rbi/privy/models/fiat_customer_response.rbi b/rbi/privy/models/fiat_customer_response.rbi new file mode 100644 index 0000000..3d00299 --- /dev/null +++ b/rbi/privy/models/fiat_customer_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # The response for getting a native onramp provider customer. + module FiatCustomerResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::BridgeFiatCustomerResponse, + Privy::BridgeSandboxFiatCustomerResponse + ) + end + + sig { override.returns(T::Array[Privy::FiatCustomerResponse::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/fiat_onramp_destination.rbi b/rbi/privy/models/fiat_onramp_destination.rbi new file mode 100644 index 0000000..8cab9ae --- /dev/null +++ b/rbi/privy/models/fiat_onramp_destination.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class FiatOnrampDestination < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FiatOnrampDestination, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # Cryptocurrency symbol. Uppercase alphanumeric, 2-10 characters. + sig { returns(String) } + attr_accessor :asset + + # A CAIP-2 chain identifier in namespace:reference format (e.g. "eip155:1" for + # Ethereum mainnet, "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" for Solana mainnet). + sig { returns(String) } + attr_accessor :chain + + # Destination cryptocurrency details for a fiat onramp quote request. + sig do + params(address: String, asset: String, chain: String).returns( + T.attached_class + ) + end + def self.new( + address:, + # Cryptocurrency symbol. Uppercase alphanumeric, 2-10 characters. + asset:, + # A CAIP-2 chain identifier in namespace:reference format (e.g. "eip155:1" for + # Ethereum mainnet, "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" for Solana mainnet). + chain: + ) + end + + sig do + override.returns({ address: String, asset: String, chain: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/fiat_onramp_environment.rbi b/rbi/privy/models/fiat_onramp_environment.rbi new file mode 100644 index 0000000..d057597 --- /dev/null +++ b/rbi/privy/models/fiat_onramp_environment.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # Whether to use the sandbox or production environment for fiat onramp. + module FiatOnrampEnvironment + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::FiatOnrampEnvironment) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SANDBOX = T.let(:sandbox, Privy::FiatOnrampEnvironment::TaggedSymbol) + PRODUCTION = + T.let(:production, Privy::FiatOnrampEnvironment::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::FiatOnrampEnvironment::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/fiat_onramp_provider.rbi b/rbi/privy/models/fiat_onramp_provider.rbi new file mode 100644 index 0000000..2a472d3 --- /dev/null +++ b/rbi/privy/models/fiat_onramp_provider.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + # The fiat onramp provider to use. + module FiatOnrampProvider + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::FiatOnrampProvider) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MELD = T.let(:meld, Privy::FiatOnrampProvider::TaggedSymbol) + MELD_SANDBOX = + T.let(:"meld-sandbox", Privy::FiatOnrampProvider::TaggedSymbol) + MOONPAY = T.let(:moonpay, Privy::FiatOnrampProvider::TaggedSymbol) + MOONPAY_SANDBOX = + T.let(:"moonpay-sandbox", Privy::FiatOnrampProvider::TaggedSymbol) + COINBASE = T.let(:coinbase, Privy::FiatOnrampProvider::TaggedSymbol) + COINBASE_SANDBOX = + T.let(:"coinbase-sandbox", Privy::FiatOnrampProvider::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::FiatOnrampProvider::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/fiat_onramp_provider_error.rbi b/rbi/privy/models/fiat_onramp_provider_error.rbi new file mode 100644 index 0000000..ec85d14 --- /dev/null +++ b/rbi/privy/models/fiat_onramp_provider_error.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Privy + module Models + class FiatOnrampProviderError < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FiatOnrampProviderError, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :error + + # The fiat onramp provider to use. + sig { returns(Privy::FiatOnrampProvider::OrSymbol) } + attr_accessor :provider + + # An error from a specific fiat onramp provider when fetching quotes. + sig do + params( + error: String, + provider: Privy::FiatOnrampProvider::OrSymbol + ).returns(T.attached_class) + end + def self.new( + error:, + # The fiat onramp provider to use. + provider: + ) + end + + sig do + override.returns( + { error: String, provider: Privy::FiatOnrampProvider::OrSymbol } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/fiat_onramp_quote.rbi b/rbi/privy/models/fiat_onramp_quote.rbi new file mode 100644 index 0000000..51c3c8a --- /dev/null +++ b/rbi/privy/models/fiat_onramp_quote.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class FiatOnrampQuote < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::FiatOnrampQuote, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :payment_method + + # The fiat onramp provider to use. + sig { returns(Privy::FiatOnrampProvider::OrSymbol) } + attr_accessor :provider + + sig { returns(T.nilable(String)) } + attr_accessor :destination_currency_code + + sig { returns(T.nilable(Float)) } + attr_accessor :source_amount + + sig { returns(T.nilable(String)) } + attr_accessor :source_currency_code + + sig { returns(T.nilable(String)) } + attr_accessor :sub_provider + + # A single fiat onramp quote from a provider. + sig do + params( + payment_method: String, + provider: Privy::FiatOnrampProvider::OrSymbol, + destination_currency_code: T.nilable(String), + source_amount: T.nilable(Float), + source_currency_code: T.nilable(String), + sub_provider: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + payment_method:, + # The fiat onramp provider to use. + provider:, + destination_currency_code: nil, + source_amount: nil, + source_currency_code: nil, + sub_provider: nil + ) + end + + sig do + override.returns( + { + payment_method: String, + provider: Privy::FiatOnrampProvider::OrSymbol, + destination_currency_code: T.nilable(String), + source_amount: T.nilable(Float), + source_currency_code: T.nilable(String), + sub_provider: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/fiat_onramp_source.rbi b/rbi/privy/models/fiat_onramp_source.rbi new file mode 100644 index 0000000..e216956 --- /dev/null +++ b/rbi/privy/models/fiat_onramp_source.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class FiatOnrampSource < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FiatOnrampSource, Privy::Internal::AnyHash) + end + + # A positive decimal amount as a string (e.g. "100", "50.25", "0.001"). + sig { returns(String) } + attr_accessor :amount + + # ISO 4217 fiat currency code. Three uppercase ASCII letters. + sig { returns(String) } + attr_accessor :asset + + # Source currency details for a fiat onramp quote request. + sig { params(amount: String, asset: String).returns(T.attached_class) } + def self.new( + # A positive decimal amount as a string (e.g. "100", "50.25", "0.001"). + amount:, + # ISO 4217 fiat currency code. Three uppercase ASCII letters. + asset: + ) + end + + sig { override.returns({ amount: String, asset: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/fiat_onramp_transaction_status.rbi b/rbi/privy/models/fiat_onramp_transaction_status.rbi new file mode 100644 index 0000000..3647d07 --- /dev/null +++ b/rbi/privy/models/fiat_onramp_transaction_status.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + # Normalized fiat onramp transaction status. + module FiatOnrampTransactionStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::FiatOnrampTransactionStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let(:pending, Privy::FiatOnrampTransactionStatus::TaggedSymbol) + PROCESSING = + T.let(:processing, Privy::FiatOnrampTransactionStatus::TaggedSymbol) + COMPLETED = + T.let(:completed, Privy::FiatOnrampTransactionStatus::TaggedSymbol) + FAILED = T.let(:failed, Privy::FiatOnrampTransactionStatus::TaggedSymbol) + CANCELLED = + T.let(:cancelled, Privy::FiatOnrampTransactionStatus::TaggedSymbol) + REFUNDED = + T.let(:refunded, Privy::FiatOnrampTransactionStatus::TaggedSymbol) + UNKNOWN = + T.let(:unknown, Privy::FiatOnrampTransactionStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::FiatOnrampTransactionStatus::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/fiat_virtual_account_request.rbi b/rbi/privy/models/fiat_virtual_account_request.rbi new file mode 100644 index 0000000..a85d803 --- /dev/null +++ b/rbi/privy/models/fiat_virtual_account_request.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # The request input for creating virtual account. + module FiatVirtualAccountRequest + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::BridgeFiatVirtualAccountRequest, + Privy::BridgeSandboxFiatVirtualAccountRequest + ) + end + + sig do + override.returns(T::Array[Privy::FiatVirtualAccountRequest::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/fiat_virtual_account_response.rbi b/rbi/privy/models/fiat_virtual_account_response.rbi new file mode 100644 index 0000000..524397a --- /dev/null +++ b/rbi/privy/models/fiat_virtual_account_response.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # The response for creating virtual account. + module FiatVirtualAccountResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::BridgeFiatVirtualAccountResponse, + Privy::BridgeSandboxFiatVirtualAccountResponse + ) + end + + sig do + override.returns(T::Array[Privy::FiatVirtualAccountResponse::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/first_class_chain_type.rbi b/rbi/privy/models/first_class_chain_type.rbi new file mode 100644 index 0000000..8863582 --- /dev/null +++ b/rbi/privy/models/first_class_chain_type.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # The wallet chain types that offer first class support. + module FirstClassChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::FirstClassChainType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = T.let(:ethereum, Privy::FirstClassChainType::TaggedSymbol) + SOLANA = T.let(:solana, Privy::FirstClassChainType::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::FirstClassChainType::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/funding_config_response_schema.rbi b/rbi/privy/models/funding_config_response_schema.rbi new file mode 100644 index 0000000..f399550 --- /dev/null +++ b/rbi/privy/models/funding_config_response_schema.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class FundingConfigResponseSchema < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FundingConfigResponseSchema, Privy::Internal::AnyHash) + end + + sig { returns(T::Boolean) } + attr_accessor :cross_chain_bridging_enabled + + sig { returns(String) } + attr_accessor :default_recommended_amount + + # A crypto currency identified by a CAIP-2 chain ID and optional asset. + sig { returns(Privy::Currency) } + attr_reader :default_recommended_currency + + sig { params(default_recommended_currency: Privy::Currency::OrHash).void } + attr_writer :default_recommended_currency + + sig { returns(T::Array[Privy::FundingMethodEnum::TaggedSymbol]) } + attr_accessor :methods_ + + sig { returns(T::Array[Privy::FundingOption]) } + attr_accessor :options + + sig { returns(T::Boolean) } + attr_accessor :prompt_funding_on_wallet_creation + + # Configuration for funding and on-ramp options. + sig do + params( + cross_chain_bridging_enabled: T::Boolean, + default_recommended_amount: String, + default_recommended_currency: Privy::Currency::OrHash, + methods_: T::Array[Privy::FundingMethodEnum::OrSymbol], + options: T::Array[Privy::FundingOption::OrHash], + prompt_funding_on_wallet_creation: T::Boolean + ).returns(T.attached_class) + end + def self.new( + cross_chain_bridging_enabled:, + default_recommended_amount:, + # A crypto currency identified by a CAIP-2 chain ID and optional asset. + default_recommended_currency:, + methods_:, + options:, + prompt_funding_on_wallet_creation: + ) + end + + sig do + override.returns( + { + cross_chain_bridging_enabled: T::Boolean, + default_recommended_amount: String, + default_recommended_currency: Privy::Currency, + methods_: T::Array[Privy::FundingMethodEnum::TaggedSymbol], + options: T::Array[Privy::FundingOption], + prompt_funding_on_wallet_creation: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/funding_method_enum.rbi b/rbi/privy/models/funding_method_enum.rbi new file mode 100644 index 0000000..974d48d --- /dev/null +++ b/rbi/privy/models/funding_method_enum.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # A funding method for on-ramp. + module FundingMethodEnum + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::FundingMethodEnum) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MOONPAY = T.let(:moonpay, Privy::FundingMethodEnum::TaggedSymbol) + COINBASE_ONRAMP = + T.let(:"coinbase-onramp", Privy::FundingMethodEnum::TaggedSymbol) + EXTERNAL = T.let(:external, Privy::FundingMethodEnum::TaggedSymbol) + + sig { override.returns(T::Array[Privy::FundingMethodEnum::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/funding_option.rbi b/rbi/privy/models/funding_option.rbi new file mode 100644 index 0000000..038c49e --- /dev/null +++ b/rbi/privy/models/funding_option.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class FundingOption < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::FundingOption, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :provider + + # A funding option with method and provider. + sig do + params(method_: String, provider: String).returns(T.attached_class) + end + def self.new(method_:, provider:) + end + + sig { override.returns({ method_: String, provider: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/funds_deposited_webhook_payload.rbi b/rbi/privy/models/funds_deposited_webhook_payload.rbi new file mode 100644 index 0000000..f4b08e3 --- /dev/null +++ b/rbi/privy/models/funds_deposited_webhook_payload.rbi @@ -0,0 +1,221 @@ +# typed: strong + +module Privy + module Models + class FundsDepositedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FundsDepositedWebhookPayload, Privy::Internal::AnyHash) + end + + # The amount transferred, as a stringified bigint. + sig { returns(String) } + attr_accessor :amount + + # An asset involved in a wallet transfer. + sig { returns(Privy::WalletFundsAsset::Variants) } + attr_accessor :asset + + sig { returns(Privy::FundsDepositedWebhookPayload::Block) } + attr_reader :block + + sig do + params(block: Privy::FundsDepositedWebhookPayload::Block::OrHash).void + end + attr_writer :block + + # The CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A unique key for this event. + sig { returns(String) } + attr_accessor :idempotency_key + + # The recipient address. + sig { returns(String) } + attr_accessor :recipient + + # The sender address. + sig { returns(String) } + attr_accessor :sender + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The type of webhook event. + sig { returns(Privy::FundsDepositedWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # The ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Metadata about a Bridge transaction associated with a wallet event. + sig { returns(T.nilable(Privy::BridgeMetadata::Variants)) } + attr_reader :bridge_metadata + + sig do + params( + bridge_metadata: + T.any( + Privy::BridgeCryptoDepositMetadata::OrHash, + Privy::BridgeRefundMetadata::OrHash, + Privy::BridgeFiatDepositMetadata::OrHash, + Privy::BridgeCryptoTransferMetadata::OrHash, + Privy::BridgeFiatTransferMetadata::OrHash, + Privy::BridgeTransferRefundMetadata::OrHash, + Privy::BridgeStaticMemoDepositMetadata::OrHash + ) + ).void + end + attr_writer :bridge_metadata + + # The transaction fee paid, as a stringified bigint in the chain's native token. + sig { returns(T.nilable(String)) } + attr_reader :transaction_fee + + sig { params(transaction_fee: String).void } + attr_writer :transaction_fee + + # Payload for the wallet.funds_deposited webhook event. + sig do + params( + amount: String, + asset: + T.any( + Privy::WalletFundsNativeTokenAsset::OrHash, + Privy::WalletFundsErc20Asset::OrHash, + Privy::WalletFundsSplAsset::OrHash, + Privy::WalletFundsSacAsset::OrHash + ), + block: Privy::FundsDepositedWebhookPayload::Block::OrHash, + caip2: String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::FundsDepositedWebhookPayload::Type::OrSymbol, + wallet_id: String, + bridge_metadata: + T.any( + Privy::BridgeCryptoDepositMetadata::OrHash, + Privy::BridgeRefundMetadata::OrHash, + Privy::BridgeFiatDepositMetadata::OrHash, + Privy::BridgeCryptoTransferMetadata::OrHash, + Privy::BridgeFiatTransferMetadata::OrHash, + Privy::BridgeTransferRefundMetadata::OrHash, + Privy::BridgeStaticMemoDepositMetadata::OrHash + ), + transaction_fee: String + ).returns(T.attached_class) + end + def self.new( + # The amount transferred, as a stringified bigint. + amount:, + # An asset involved in a wallet transfer. + asset:, + block:, + # The CAIP-2 chain identifier. + caip2:, + # A unique key for this event. + idempotency_key:, + # The recipient address. + recipient:, + # The sender address. + sender:, + # The blockchain transaction hash. + transaction_hash:, + # The type of webhook event. + type:, + # The ID of the wallet. + wallet_id:, + # Metadata about a Bridge transaction associated with a wallet event. + bridge_metadata: nil, + # The transaction fee paid, as a stringified bigint in the chain's native token. + transaction_fee: nil + ) + end + + sig do + override.returns( + { + amount: String, + asset: Privy::WalletFundsAsset::Variants, + block: Privy::FundsDepositedWebhookPayload::Block, + caip2: String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::FundsDepositedWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + bridge_metadata: Privy::BridgeMetadata::Variants, + transaction_fee: String + } + ) + end + def to_hash + end + + class Block < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FundsDepositedWebhookPayload::Block, + Privy::Internal::AnyHash + ) + end + + # The block number. + sig { returns(Float) } + attr_accessor :number + + # The block timestamp. + sig { returns(Float) } + attr_accessor :timestamp + + sig do + params(number: Float, timestamp: Float).returns(T.attached_class) + end + def self.new( + # The block number. + number:, + # The block timestamp. + timestamp: + ) + end + + sig { override.returns({ number: Float, timestamp: Float }) } + def to_hash + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::FundsDepositedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_FUNDS_DEPOSITED = + T.let( + :"wallet.funds_deposited", + Privy::FundsDepositedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::FundsDepositedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/funds_withdrawn_webhook_payload.rbi b/rbi/privy/models/funds_withdrawn_webhook_payload.rbi new file mode 100644 index 0000000..6e908af --- /dev/null +++ b/rbi/privy/models/funds_withdrawn_webhook_payload.rbi @@ -0,0 +1,188 @@ +# typed: strong + +module Privy + module Models + class FundsWithdrawnWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::FundsWithdrawnWebhookPayload, Privy::Internal::AnyHash) + end + + # The amount transferred, as a stringified bigint. + sig { returns(String) } + attr_accessor :amount + + # An asset involved in a wallet transfer. + sig { returns(Privy::WalletFundsAsset::Variants) } + attr_accessor :asset + + sig { returns(Privy::FundsWithdrawnWebhookPayload::Block) } + attr_reader :block + + sig do + params(block: Privy::FundsWithdrawnWebhookPayload::Block::OrHash).void + end + attr_writer :block + + # The CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A unique key for this event. + sig { returns(String) } + attr_accessor :idempotency_key + + # The recipient address. + sig { returns(String) } + attr_accessor :recipient + + # The sender address. + sig { returns(String) } + attr_accessor :sender + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The type of webhook event. + sig { returns(Privy::FundsWithdrawnWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # The ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # The transaction fee paid, as a stringified bigint in the chain's native token. + sig { returns(T.nilable(String)) } + attr_reader :transaction_fee + + sig { params(transaction_fee: String).void } + attr_writer :transaction_fee + + # Payload for the wallet.funds_withdrawn webhook event. + sig do + params( + amount: String, + asset: + T.any( + Privy::WalletFundsNativeTokenAsset::OrHash, + Privy::WalletFundsErc20Asset::OrHash, + Privy::WalletFundsSplAsset::OrHash, + Privy::WalletFundsSacAsset::OrHash + ), + block: Privy::FundsWithdrawnWebhookPayload::Block::OrHash, + caip2: String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::FundsWithdrawnWebhookPayload::Type::OrSymbol, + wallet_id: String, + transaction_fee: String + ).returns(T.attached_class) + end + def self.new( + # The amount transferred, as a stringified bigint. + amount:, + # An asset involved in a wallet transfer. + asset:, + block:, + # The CAIP-2 chain identifier. + caip2:, + # A unique key for this event. + idempotency_key:, + # The recipient address. + recipient:, + # The sender address. + sender:, + # The blockchain transaction hash. + transaction_hash:, + # The type of webhook event. + type:, + # The ID of the wallet. + wallet_id:, + # The transaction fee paid, as a stringified bigint in the chain's native token. + transaction_fee: nil + ) + end + + sig do + override.returns( + { + amount: String, + asset: Privy::WalletFundsAsset::Variants, + block: Privy::FundsWithdrawnWebhookPayload::Block, + caip2: String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::FundsWithdrawnWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + transaction_fee: String + } + ) + end + def to_hash + end + + class Block < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::FundsWithdrawnWebhookPayload::Block, + Privy::Internal::AnyHash + ) + end + + # The block number. + sig { returns(Float) } + attr_accessor :number + + # The block timestamp. + sig { returns(Float) } + attr_accessor :timestamp + + sig do + params(number: Float, timestamp: Float).returns(T.attached_class) + end + def self.new( + # The block number. + number:, + # The block timestamp. + timestamp: + ) + end + + sig { override.returns({ number: Float, timestamp: Float }) } + def to_hash + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::FundsWithdrawnWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_FUNDS_WITHDRAWN = + T.let( + :"wallet.funds_withdrawn", + Privy::FundsWithdrawnWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::FundsWithdrawnWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/gas_spend_currency.rbi b/rbi/privy/models/gas_spend_currency.rbi new file mode 100644 index 0000000..9a8cd1a --- /dev/null +++ b/rbi/privy/models/gas_spend_currency.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Privy + module Models + # Currency for gas spend values. + module GasSpendCurrency + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::GasSpendCurrency) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USD = T.let(:usd, Privy::GasSpendCurrency::TaggedSymbol) + + sig { override.returns(T::Array[Privy::GasSpendCurrency::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/gas_spend_request_body.rbi b/rbi/privy/models/gas_spend_request_body.rbi new file mode 100644 index 0000000..76d06dd --- /dev/null +++ b/rbi/privy/models/gas_spend_request_body.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class GasSpendRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GasSpendRequestBody, Privy::Internal::AnyHash) + end + + # Unix timestamp in milliseconds, exclusive. Must be greater than or equal to + # `start_timestamp`, and the range from `start_timestamp` to `end_timestamp` must + # not exceed 30 days. + sig { returns(Float) } + attr_accessor :end_timestamp + + # Unix timestamp in milliseconds, inclusive. Must be less than or equal to + # `end_timestamp`, and the range from `start_timestamp` to `end_timestamp` must + # not exceed 30 days. + sig { returns(Float) } + attr_accessor :start_timestamp + + # List of wallet IDs to query gas spend for. Maximum 100. + sig { returns(T::Array[String]) } + attr_accessor :wallet_ids + + # Query parameters for getting gas spend for a set of wallets. The time range from + # `start_timestamp` to `end_timestamp` must not exceed 30 days. + sig do + params( + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp in milliseconds, exclusive. Must be greater than or equal to + # `start_timestamp`, and the range from `start_timestamp` to `end_timestamp` must + # not exceed 30 days. + end_timestamp:, + # Unix timestamp in milliseconds, inclusive. Must be less than or equal to + # `end_timestamp`, and the range from `start_timestamp` to `end_timestamp` must + # not exceed 30 days. + start_timestamp:, + # List of wallet IDs to query gas spend for. Maximum 100. + wallet_ids: + ) + end + + sig do + override.returns( + { + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/gas_spend_response_body.rbi b/rbi/privy/models/gas_spend_response_body.rbi new file mode 100644 index 0000000..27926a5 --- /dev/null +++ b/rbi/privy/models/gas_spend_response_body.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Privy + module Models + class GasSpendResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GasSpendResponseBody, Privy::Internal::AnyHash) + end + + # Currency for gas spend values. + sig { returns(Privy::GasSpendCurrency::TaggedSymbol) } + attr_accessor :currency + + # Total Privy credits charged as a decimal string. + sig { returns(String) } + attr_accessor :value + + # Aggregated Privy gas credits charged for a set of wallets over a time range. + sig do + params( + currency: Privy::GasSpendCurrency::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new( + # Currency for gas spend values. + currency:, + # Total Privy credits charged as a decimal string. + value: + ) + end + + sig do + override.returns( + { currency: Privy::GasSpendCurrency::TaggedSymbol, value: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/gas_sponsorship_configuration.rbi b/rbi/privy/models/gas_sponsorship_configuration.rbi new file mode 100644 index 0000000..9f1c0a1 --- /dev/null +++ b/rbi/privy/models/gas_sponsorship_configuration.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Privy + module Models + class GasSponsorshipConfiguration < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GasSponsorshipConfiguration, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[String]) } + attr_accessor :configured_networks + + sig { returns(T::Boolean) } + attr_accessor :require_app_secret + + sig { returns(T::Boolean) } + attr_accessor :sponsorship_enabled + + # Gas sponsorship configuration for an app. + sig do + params( + configured_networks: T::Array[String], + require_app_secret: T::Boolean, + sponsorship_enabled: T::Boolean + ).returns(T.attached_class) + end + def self.new( + configured_networks:, + require_app_secret:, + sponsorship_enabled: + ) + end + + sig do + override.returns( + { + configured_networks: T::Array[String], + require_app_secret: T::Boolean, + sponsorship_enabled: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/gas_sponsorship_configuration_input.rbi b/rbi/privy/models/gas_sponsorship_configuration_input.rbi new file mode 100644 index 0000000..c323ee7 --- /dev/null +++ b/rbi/privy/models/gas_sponsorship_configuration_input.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class GasSponsorshipConfigurationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::GasSponsorshipConfigurationInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :configured_networks + + sig { params(configured_networks: T::Array[String]).void } + attr_writer :configured_networks + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_app_secret + + sig { params(require_app_secret: T::Boolean).void } + attr_writer :require_app_secret + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :sponsorship_enabled + + sig { params(sponsorship_enabled: T::Boolean).void } + attr_writer :sponsorship_enabled + + # Input for configuring gas sponsorship settings for an app. + sig do + params( + configured_networks: T::Array[String], + require_app_secret: T::Boolean, + sponsorship_enabled: T::Boolean + ).returns(T.attached_class) + end + def self.new( + configured_networks: nil, + require_app_secret: nil, + sponsorship_enabled: nil + ) + end + + sig do + override.returns( + { + configured_networks: T::Array[String], + require_app_secret: T::Boolean, + sponsorship_enabled: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_by_wallet_address_request_body.rbi b/rbi/privy/models/get_by_wallet_address_request_body.rbi new file mode 100644 index 0000000..4ae4dbd --- /dev/null +++ b/rbi/privy/models/get_by_wallet_address_request_body.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class GetByWalletAddressRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GetByWalletAddressRequestBody, Privy::Internal::AnyHash) + end + + # A blockchain wallet address (Ethereum or Solana). + sig { returns(String) } + attr_accessor :address + + # Request body for looking up a wallet by its blockchain address. + sig { params(address: String).returns(T.attached_class) } + def self.new( + # A blockchain wallet address (Ethereum or Solana). + address: + ) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_fiat_customer_request_input.rbi b/rbi/privy/models/get_fiat_customer_request_input.rbi new file mode 100644 index 0000000..4b56e9a --- /dev/null +++ b/rbi/privy/models/get_fiat_customer_request_input.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Privy + module Models + class GetFiatCustomerRequestInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GetFiatCustomerRequestInput, Privy::Internal::AnyHash) + end + + # Valid set of onramp providers + sig { returns(Privy::OnrampProvider::OrSymbol) } + attr_accessor :provider + + sig { returns(T.nilable(String)) } + attr_reader :kyc_redirect_url + + sig { params(kyc_redirect_url: String).void } + attr_writer :kyc_redirect_url + + # The request input for getting a native onramp provider customer. + sig do + params( + provider: Privy::OnrampProvider::OrSymbol, + kyc_redirect_url: String + ).returns(T.attached_class) + end + def self.new( + # Valid set of onramp providers + provider:, + kyc_redirect_url: nil + ) + end + + sig do + override.returns( + { + provider: Privy::OnrampProvider::OrSymbol, + kyc_redirect_url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_fiat_onramp_quotes_input.rbi b/rbi/privy/models/get_fiat_onramp_quotes_input.rbi new file mode 100644 index 0000000..770a939 --- /dev/null +++ b/rbi/privy/models/get_fiat_onramp_quotes_input.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class GetFiatOnrampQuotesInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GetFiatOnrampQuotesInput, Privy::Internal::AnyHash) + end + + # Destination cryptocurrency details for a fiat onramp quote request. + sig { returns(Privy::FiatOnrampDestination) } + attr_reader :destination + + sig { params(destination: Privy::FiatOnrampDestination::OrHash).void } + attr_writer :destination + + # Whether to use the sandbox or production environment for fiat onramp. + sig { returns(Privy::FiatOnrampEnvironment::OrSymbol) } + attr_accessor :environment + + # Source currency details for a fiat onramp quote request. + sig { returns(Privy::FiatOnrampSource) } + attr_reader :source + + sig { params(source: Privy::FiatOnrampSource::OrHash).void } + attr_writer :source + + # The request input for getting fiat onramp quotes. + sig do + params( + destination: Privy::FiatOnrampDestination::OrHash, + environment: Privy::FiatOnrampEnvironment::OrSymbol, + source: Privy::FiatOnrampSource::OrHash + ).returns(T.attached_class) + end + def self.new( + # Destination cryptocurrency details for a fiat onramp quote request. + destination:, + # Whether to use the sandbox or production environment for fiat onramp. + environment:, + # Source currency details for a fiat onramp quote request. + source: + ) + end + + sig do + override.returns( + { + destination: Privy::FiatOnrampDestination, + environment: Privy::FiatOnrampEnvironment::OrSymbol, + source: Privy::FiatOnrampSource + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_fiat_onramp_quotes_response.rbi b/rbi/privy/models/get_fiat_onramp_quotes_response.rbi new file mode 100644 index 0000000..f04de08 --- /dev/null +++ b/rbi/privy/models/get_fiat_onramp_quotes_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class GetFiatOnrampQuotesResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GetFiatOnrampQuotesResponse, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[Privy::FiatOnrampQuote]) } + attr_accessor :quotes + + sig { returns(T.nilable(T::Array[Privy::FiatOnrampProviderError])) } + attr_reader :provider_errors + + sig do + params( + provider_errors: T::Array[Privy::FiatOnrampProviderError::OrHash] + ).void + end + attr_writer :provider_errors + + # The response containing fiat onramp quotes. + sig do + params( + quotes: T::Array[Privy::FiatOnrampQuote::OrHash], + provider_errors: T::Array[Privy::FiatOnrampProviderError::OrHash] + ).returns(T.attached_class) + end + def self.new(quotes:, provider_errors: nil) + end + + sig do + override.returns( + { + quotes: T::Array[Privy::FiatOnrampQuote], + provider_errors: T::Array[Privy::FiatOnrampProviderError] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_fiat_onramp_transaction_status_input.rbi b/rbi/privy/models/get_fiat_onramp_transaction_status_input.rbi new file mode 100644 index 0000000..842af4a --- /dev/null +++ b/rbi/privy/models/get_fiat_onramp_transaction_status_input.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class GetFiatOnrampTransactionStatusInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::GetFiatOnrampTransactionStatusInput, + Privy::Internal::AnyHash + ) + end + + # The fiat onramp provider to use. + sig { returns(Privy::FiatOnrampProvider::OrSymbol) } + attr_accessor :provider + + sig { returns(String) } + attr_accessor :session_id + + # The request input for checking a fiat onramp session status. + sig do + params( + provider: Privy::FiatOnrampProvider::OrSymbol, + session_id: String + ).returns(T.attached_class) + end + def self.new( + # The fiat onramp provider to use. + provider:, + session_id: + ) + end + + sig do + override.returns( + { provider: Privy::FiatOnrampProvider::OrSymbol, session_id: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_fiat_onramp_transaction_status_response.rbi b/rbi/privy/models/get_fiat_onramp_transaction_status_response.rbi new file mode 100644 index 0000000..ce43764 --- /dev/null +++ b/rbi/privy/models/get_fiat_onramp_transaction_status_response.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Privy + module Models + class GetFiatOnrampTransactionStatusResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::GetFiatOnrampTransactionStatusResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :raw_status + + sig { returns(String) } + attr_accessor :session_id + + # Normalized fiat onramp transaction status. + sig { returns(Privy::FiatOnrampTransactionStatus::OrSymbol) } + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + + sig { params(transaction_id: String).void } + attr_writer :transaction_id + + # The response containing the fiat onramp session status. + sig do + params( + raw_status: String, + session_id: String, + status: Privy::FiatOnrampTransactionStatus::OrSymbol, + transaction_id: String + ).returns(T.attached_class) + end + def self.new( + raw_status:, + session_id:, + # Normalized fiat onramp transaction status. + status:, + transaction_id: nil + ) + end + + sig do + override.returns( + { + raw_status: String, + session_id: String, + status: Privy::FiatOnrampTransactionStatus::OrSymbol, + transaction_id: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_fiat_onramp_url_input.rbi b/rbi/privy/models/get_fiat_onramp_url_input.rbi new file mode 100644 index 0000000..9e6890d --- /dev/null +++ b/rbi/privy/models/get_fiat_onramp_url_input.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Privy + module Models + class GetFiatOnrampURLInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GetFiatOnrampURLInput, Privy::Internal::AnyHash) + end + + # Destination cryptocurrency details for a fiat onramp quote request. + sig { returns(Privy::FiatOnrampDestination) } + attr_reader :destination + + sig { params(destination: Privy::FiatOnrampDestination::OrHash).void } + attr_writer :destination + + sig { returns(String) } + attr_accessor :payment_method + + # The fiat onramp provider to use. + sig { returns(Privy::FiatOnrampProvider::OrSymbol) } + attr_accessor :provider + + # Source currency details for a fiat onramp quote request. + sig { returns(Privy::FiatOnrampSource) } + attr_reader :source + + sig { params(source: Privy::FiatOnrampSource::OrHash).void } + attr_writer :source + + sig { returns(T.nilable(String)) } + attr_reader :redirect_url + + sig { params(redirect_url: String).void } + attr_writer :redirect_url + + sig { returns(T.nilable(String)) } + attr_reader :sub_provider + + sig { params(sub_provider: String).void } + attr_writer :sub_provider + + # The request input for getting a fiat onramp provider session URL. + sig do + params( + destination: Privy::FiatOnrampDestination::OrHash, + payment_method: String, + provider: Privy::FiatOnrampProvider::OrSymbol, + source: Privy::FiatOnrampSource::OrHash, + redirect_url: String, + sub_provider: String + ).returns(T.attached_class) + end + def self.new( + # Destination cryptocurrency details for a fiat onramp quote request. + destination:, + payment_method:, + # The fiat onramp provider to use. + provider:, + # Source currency details for a fiat onramp quote request. + source:, + redirect_url: nil, + sub_provider: nil + ) + end + + sig do + override.returns( + { + destination: Privy::FiatOnrampDestination, + payment_method: String, + provider: Privy::FiatOnrampProvider::OrSymbol, + source: Privy::FiatOnrampSource, + redirect_url: String, + sub_provider: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/get_fiat_onramp_url_response.rbi b/rbi/privy/models/get_fiat_onramp_url_response.rbi new file mode 100644 index 0000000..36e5a4e --- /dev/null +++ b/rbi/privy/models/get_fiat_onramp_url_response.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class GetFiatOnrampURLResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GetFiatOnrampURLResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :session_id + + sig { returns(String) } + attr_accessor :url + + # The response containing a fiat onramp provider session URL. + sig { params(session_id: String, url: String).returns(T.attached_class) } + def self.new(session_id:, url:) + end + + sig { override.returns({ session_id: String, url: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/guest_authenticate_request_body.rbi b/rbi/privy/models/guest_authenticate_request_body.rbi new file mode 100644 index 0000000..9b72adc --- /dev/null +++ b/rbi/privy/models/guest_authenticate_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class GuestAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::GuestAuthenticateRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :guest_credential + + # The request body for authenticating a guest. + sig { params(guest_credential: String).returns(T.attached_class) } + def self.new(guest_credential:) + end + + sig { override.returns({ guest_credential: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/hd_init_input.rbi b/rbi/privy/models/hd_init_input.rbi new file mode 100644 index 0000000..5630eb3 --- /dev/null +++ b/rbi/privy/models/hd_init_input.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Privy + module Models + class HDInitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::HDInitInput, Privy::Internal::AnyHash) } + + # The address of the wallet to import. + sig { returns(String) } + attr_accessor :address + + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + sig { returns(Privy::WalletImportSupportedChains::OrSymbol) } + attr_accessor :chain_type + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + # The entropy type of the wallet to import. + sig { returns(Privy::HDInitInput::EntropyType::OrSymbol) } + attr_accessor :entropy_type + + # The index of the wallet to import. + sig { returns(Integer) } + attr_accessor :index + + # The input for HD wallets. + sig do + params( + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::HDInitInput::EntropyType::OrSymbol, + index: Integer + ).returns(T.attached_class) + end + def self.new( + # The address of the wallet to import. + address:, + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + chain_type:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + # The entropy type of the wallet to import. + entropy_type:, + # The index of the wallet to import. + index: + ) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::HDInitInput::EntropyType::OrSymbol, + index: Integer + } + ) + end + def to_hash + end + + # The entropy type of the wallet to import. + module EntropyType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::HDInitInput::EntropyType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HD = T.let(:hd, Privy::HDInitInput::EntropyType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::HDInitInput::EntropyType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/hd_path.rbi b/rbi/privy/models/hd_path.rbi new file mode 100644 index 0000000..2f30b6e --- /dev/null +++ b/rbi/privy/models/hd_path.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + HDPath = String + end +end diff --git a/rbi/privy/models/hd_submit_input.rbi b/rbi/privy/models/hd_submit_input.rbi new file mode 100644 index 0000000..927ae5b --- /dev/null +++ b/rbi/privy/models/hd_submit_input.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Privy + module Models + class HDSubmitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::HDSubmitInput, Privy::Internal::AnyHash) } + + # The address of the wallet to import. + sig { returns(String) } + attr_accessor :address + + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + sig { returns(Privy::WalletImportSupportedChains::OrSymbol) } + attr_accessor :chain_type + + # The encrypted entropy of the wallet to import. + sig { returns(String) } + attr_accessor :ciphertext + + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption inside the TEE. + sig { returns(String) } + attr_accessor :encapsulated_key + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + # The entropy type of the wallet to import. + sig { returns(Privy::HDSubmitInput::EntropyType::OrSymbol) } + attr_accessor :entropy_type + + # The index of the wallet to import. + sig { returns(Integer) } + attr_accessor :index + + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + sig { returns(T.nilable(Privy::HpkeImportConfig)) } + attr_reader :hpke_config + + sig { params(hpke_config: Privy::HpkeImportConfig::OrHash).void } + attr_writer :hpke_config + + # The submission input for importing an HD wallet. + sig do + params( + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::HDSubmitInput::EntropyType::OrSymbol, + index: Integer, + hpke_config: Privy::HpkeImportConfig::OrHash + ).returns(T.attached_class) + end + def self.new( + # The address of the wallet to import. + address:, + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + chain_type:, + # The encrypted entropy of the wallet to import. + ciphertext:, + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption inside the TEE. + encapsulated_key:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + # The entropy type of the wallet to import. + entropy_type:, + # The index of the wallet to import. + index:, + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + hpke_config: nil + ) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::HDSubmitInput::EntropyType::OrSymbol, + index: Integer, + hpke_config: Privy::HpkeImportConfig + } + ) + end + def to_hash + end + + # The entropy type of the wallet to import. + module EntropyType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::HDSubmitInput::EntropyType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HD = T.let(:hd, Privy::HDSubmitInput::EntropyType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::HDSubmitInput::EntropyType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/hex.rbi b/rbi/privy/models/hex.rbi new file mode 100644 index 0000000..039bd28 --- /dev/null +++ b/rbi/privy/models/hex.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + Hex = String + end +end diff --git a/rbi/privy/models/hpke_aead_algorithm.rbi b/rbi/privy/models/hpke_aead_algorithm.rbi new file mode 100644 index 0000000..b05e09f --- /dev/null +++ b/rbi/privy/models/hpke_aead_algorithm.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + # The AEAD algorithm used for HPKE encryption. + module HpkeAeadAlgorithm + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::HpkeAeadAlgorithm) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CHACHA20_POLY1305 = + T.let(:CHACHA20_POLY1305, Privy::HpkeAeadAlgorithm::TaggedSymbol) + AES_GCM256 = T.let(:AES_GCM256, Privy::HpkeAeadAlgorithm::TaggedSymbol) + + sig { override.returns(T::Array[Privy::HpkeAeadAlgorithm::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/hpke_encryption.rbi b/rbi/privy/models/hpke_encryption.rbi new file mode 100644 index 0000000..6092482 --- /dev/null +++ b/rbi/privy/models/hpke_encryption.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Privy + module Models + # The encryption type of the wallet to import. Currently only supports `HPKE`. + module HpkeEncryption + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::HpkeEncryption) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HPKE = T.let(:HPKE, Privy::HpkeEncryption::TaggedSymbol) + + sig { override.returns(T::Array[Privy::HpkeEncryption::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/hpke_import_config.rbi b/rbi/privy/models/hpke_import_config.rbi new file mode 100644 index 0000000..6964d50 --- /dev/null +++ b/rbi/privy/models/hpke_import_config.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class HpkeImportConfig < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::HpkeImportConfig, Privy::Internal::AnyHash) + end + + # Additional Authenticated Data (AAD) used during encryption. Should be + # base64-encoded bytes. + sig { returns(T.nilable(String)) } + attr_reader :aad + + sig { params(aad: String).void } + attr_writer :aad + + # The AEAD algorithm used for HPKE encryption. + sig { returns(T.nilable(Privy::HpkeAeadAlgorithm::OrSymbol)) } + attr_reader :aead_algorithm + + sig { params(aead_algorithm: Privy::HpkeAeadAlgorithm::OrSymbol).void } + attr_writer :aead_algorithm + + # Application-specific context information (INFO) used during HPKE encryption. + # Should be base64-encoded bytes. + sig { returns(T.nilable(String)) } + attr_reader :info + + sig { params(info: String).void } + attr_writer :info + + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + sig do + params( + aad: String, + aead_algorithm: Privy::HpkeAeadAlgorithm::OrSymbol, + info: String + ).returns(T.attached_class) + end + def self.new( + # Additional Authenticated Data (AAD) used during encryption. Should be + # base64-encoded bytes. + aad: nil, + # The AEAD algorithm used for HPKE encryption. + aead_algorithm: nil, + # Application-specific context information (INFO) used during HPKE encryption. + # Should be base64-encoded bytes. + info: nil + ) + end + + sig do + override.returns( + { + aad: String, + aead_algorithm: Privy::HpkeAeadAlgorithm::OrSymbol, + info: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/icloud_client_type.rbi b/rbi/privy/models/icloud_client_type.rbi new file mode 100644 index 0000000..c4e3e98 --- /dev/null +++ b/rbi/privy/models/icloud_client_type.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Privy + module Models + # The client type for iCloud recovery operations. + module ICloudClientType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::ICloudClientType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WEB = T.let(:web, Privy::ICloudClientType::TaggedSymbol) + EXPO_IOS = T.let(:"expo-ios", Privy::ICloudClientType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::ICloudClientType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/intent_authorization.rbi b/rbi/privy/models/intent_authorization.rbi new file mode 100644 index 0000000..0ffdfe7 --- /dev/null +++ b/rbi/privy/models/intent_authorization.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class IntentAuthorization < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::IntentAuthorization, Privy::Internal::AnyHash) + end + + # Members in this authorization quorum + sig { returns(T::Array[Privy::IntentAuthorizationMember::Variants]) } + attr_accessor :members + + # Number of signatures required to satisfy this quorum + sig { returns(Float) } + attr_accessor :threshold + + # Display name of the key quorum + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # Authorization quorum for an intent + sig do + params( + members: + T::Array[ + T.any( + Privy::IntentAuthorizationMember::UserMember::OrHash, + Privy::IntentAuthorizationMember::KeyMember::OrHash, + Privy::IntentAuthorizationMember::KeyQuorumMember::OrHash + ) + ], + threshold: Float, + display_name: String + ).returns(T.attached_class) + end + def self.new( + # Members in this authorization quorum + members:, + # Number of signatures required to satisfy this quorum + threshold:, + # Display name of the key quorum + display_name: nil + ) + end + + sig do + override.returns( + { + members: T::Array[Privy::IntentAuthorizationMember::Variants], + threshold: Float, + display_name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_authorization_key_quorum_member.rbi b/rbi/privy/models/intent_authorization_key_quorum_member.rbi new file mode 100644 index 0000000..3400f12 --- /dev/null +++ b/rbi/privy/models/intent_authorization_key_quorum_member.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Privy + module Models + # A leaf member (user or key) of a nested key quorum in an intent authorization. + module IntentAuthorizationKeyQuorumMember + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::IntentAuthorizationKeyQuorumMember::UserMember, + Privy::IntentAuthorizationKeyQuorumMember::KeyMember + ) + end + + class UserMember < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::IntentAuthorizationKeyQuorumMember::UserMember, + Privy::Internal::AnyHash + ) + end + + # Unix timestamp when this member signed, or null if not yet signed. + sig { returns(T.nilable(Float)) } + attr_accessor :signed_at + + sig do + returns( + Privy::IntentAuthorizationKeyQuorumMember::UserMember::Type::TaggedSymbol + ) + end + attr_accessor :type + + # User ID of the key quorum member + sig { returns(String) } + attr_accessor :user_id + + sig do + params( + signed_at: T.nilable(Float), + type: + Privy::IntentAuthorizationKeyQuorumMember::UserMember::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp when this member signed, or null if not yet signed. + signed_at:, + type:, + # User ID of the key quorum member + user_id: + ) + end + + sig do + override.returns( + { + signed_at: T.nilable(Float), + type: + Privy::IntentAuthorizationKeyQuorumMember::UserMember::Type::TaggedSymbol, + user_id: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::IntentAuthorizationKeyQuorumMember::UserMember::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + Privy::IntentAuthorizationKeyQuorumMember::UserMember::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::IntentAuthorizationKeyQuorumMember::UserMember::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class KeyMember < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::IntentAuthorizationKeyQuorumMember::KeyMember, + Privy::Internal::AnyHash + ) + end + + # Public key of the key quorum member + sig { returns(String) } + attr_accessor :public_key + + # Unix timestamp when this member signed, or null if not yet signed. + sig { returns(T.nilable(Float)) } + attr_accessor :signed_at + + sig do + returns( + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + public_key: String, + signed_at: T.nilable(Float), + type: + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Public key of the key quorum member + public_key:, + # Unix timestamp when this member signed, or null if not yet signed. + signed_at:, + type: + ) + end + + sig do + override.returns( + { + public_key: String, + signed_at: T.nilable(Float), + type: + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KEY = + T.let( + :key, + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Privy::IntentAuthorizationKeyQuorumMember::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/intent_authorization_member.rbi b/rbi/privy/models/intent_authorization_member.rbi new file mode 100644 index 0000000..aa76faa --- /dev/null +++ b/rbi/privy/models/intent_authorization_member.rbi @@ -0,0 +1,306 @@ +# typed: strong + +module Privy + module Models + # A member of an intent authorization quorum. Can be a user, key, or nested key + # quorum. + module IntentAuthorizationMember + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::IntentAuthorizationMember::UserMember, + Privy::IntentAuthorizationMember::KeyMember, + Privy::IntentAuthorizationMember::KeyQuorumMember + ) + end + + class UserMember < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::IntentAuthorizationMember::UserMember, + Privy::Internal::AnyHash + ) + end + + # Unix timestamp when this member signed, or null if not yet signed. + sig { returns(T.nilable(Float)) } + attr_accessor :signed_at + + sig do + returns( + Privy::IntentAuthorizationMember::UserMember::Type::TaggedSymbol + ) + end + attr_accessor :type + + # User ID of the key quorum member + sig { returns(String) } + attr_accessor :user_id + + sig do + params( + signed_at: T.nilable(Float), + type: Privy::IntentAuthorizationMember::UserMember::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp when this member signed, or null if not yet signed. + signed_at:, + type:, + # User ID of the key quorum member + user_id: + ) + end + + sig do + override.returns( + { + signed_at: T.nilable(Float), + type: + Privy::IntentAuthorizationMember::UserMember::Type::TaggedSymbol, + user_id: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentAuthorizationMember::UserMember::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER = + T.let( + :user, + Privy::IntentAuthorizationMember::UserMember::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::IntentAuthorizationMember::UserMember::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class KeyMember < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::IntentAuthorizationMember::KeyMember, + Privy::Internal::AnyHash + ) + end + + # Public key of the key quorum member + sig { returns(String) } + attr_accessor :public_key + + # Unix timestamp when this member signed, or null if not yet signed. + sig { returns(T.nilable(Float)) } + attr_accessor :signed_at + + sig do + returns( + Privy::IntentAuthorizationMember::KeyMember::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig do + params( + public_key: String, + signed_at: T.nilable(Float), + type: Privy::IntentAuthorizationMember::KeyMember::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Public key of the key quorum member + public_key:, + # Unix timestamp when this member signed, or null if not yet signed. + signed_at:, + type: + ) + end + + sig do + override.returns( + { + public_key: String, + signed_at: T.nilable(Float), + type: + Privy::IntentAuthorizationMember::KeyMember::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentAuthorizationMember::KeyMember::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KEY = + T.let( + :key, + Privy::IntentAuthorizationMember::KeyMember::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::IntentAuthorizationMember::KeyMember::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class KeyQuorumMember < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::IntentAuthorizationMember::KeyQuorumMember, + Privy::Internal::AnyHash + ) + end + + # ID of the child key quorum member + sig { returns(String) } + attr_accessor :key_quorum_id + + # Members of this child quorum + sig do + returns(T::Array[Privy::IntentAuthorizationKeyQuorumMember::Variants]) + end + attr_accessor :members + + # Number of signatures required from this child quorum + sig { returns(Float) } + attr_accessor :threshold + + # Whether this child key quorum has met its signature threshold + sig { returns(T::Boolean) } + attr_accessor :threshold_met + + sig do + returns( + Privy::IntentAuthorizationMember::KeyQuorumMember::Type::TaggedSymbol + ) + end + attr_accessor :type + + # Display name for the child key quorum (if any) + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + sig do + params( + key_quorum_id: String, + members: + T::Array[ + T.any( + Privy::IntentAuthorizationKeyQuorumMember::UserMember::OrHash, + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::OrHash + ) + ], + threshold: Float, + threshold_met: T::Boolean, + type: + Privy::IntentAuthorizationMember::KeyQuorumMember::Type::OrSymbol, + display_name: String + ).returns(T.attached_class) + end + def self.new( + # ID of the child key quorum member + key_quorum_id:, + # Members of this child quorum + members:, + # Number of signatures required from this child quorum + threshold:, + # Whether this child key quorum has met its signature threshold + threshold_met:, + type:, + # Display name for the child key quorum (if any) + display_name: nil + ) + end + + sig do + override.returns( + { + key_quorum_id: String, + members: + T::Array[Privy::IntentAuthorizationKeyQuorumMember::Variants], + threshold: Float, + threshold_met: T::Boolean, + type: + Privy::IntentAuthorizationMember::KeyQuorumMember::Type::TaggedSymbol, + display_name: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::IntentAuthorizationMember::KeyQuorumMember::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KEY_QUORUM = + T.let( + :key_quorum, + Privy::IntentAuthorizationMember::KeyQuorumMember::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::IntentAuthorizationMember::KeyQuorumMember::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns(T::Array[Privy::IntentAuthorizationMember::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/intent_authorized_webhook_payload.rbi b/rbi/privy/models/intent_authorized_webhook_payload.rbi new file mode 100644 index 0000000..f88dd5d --- /dev/null +++ b/rbi/privy/models/intent_authorized_webhook_payload.rbi @@ -0,0 +1,145 @@ +# typed: strong + +module Privy + module Models + class IntentAuthorizedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::IntentAuthorizedWebhookPayload, Privy::Internal::AnyHash) + end + + # Unix timestamp when the authorization was recorded. + sig { returns(Float) } + attr_accessor :authorized_at + + # Unix timestamp when the intent was created. + sig { returns(Float) } + attr_accessor :created_at + + # Unix timestamp when the intent expires. + sig { returns(Float) } + attr_accessor :expires_at + + # The unique ID of the intent. + sig { returns(String) } + attr_accessor :intent_id + + # Type of intent. + sig { returns(Privy::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # A leaf member (user or key) of a nested key quorum in an intent authorization. + sig { returns(Privy::IntentAuthorizationKeyQuorumMember::Variants) } + attr_accessor :member + + # The current status of the intent. + sig { returns(String) } + attr_accessor :status + + # The type of webhook event. + sig { returns(Privy::IntentAuthorizedWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # Display name of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_display_name + + sig { params(created_by_display_name: String).void } + attr_writer :created_by_display_name + + # The ID of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_id + + sig { params(created_by_id: String).void } + attr_writer :created_by_id + + # Payload for the intent.authorized webhook event. + sig do + params( + authorized_at: Float, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::OrSymbol, + member: + T.any( + Privy::IntentAuthorizationKeyQuorumMember::UserMember::OrHash, + Privy::IntentAuthorizationKeyQuorumMember::KeyMember::OrHash + ), + status: String, + type: Privy::IntentAuthorizedWebhookPayload::Type::OrSymbol, + created_by_display_name: String, + created_by_id: String + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp when the authorization was recorded. + authorized_at:, + # Unix timestamp when the intent was created. + created_at:, + # Unix timestamp when the intent expires. + expires_at:, + # The unique ID of the intent. + intent_id:, + # Type of intent. + intent_type:, + # A leaf member (user or key) of a nested key quorum in an intent authorization. + member:, + # The current status of the intent. + status:, + # The type of webhook event. + type:, + # Display name of the user who created the intent. + created_by_display_name: nil, + # The ID of the user who created the intent. + created_by_id: nil + ) + end + + sig do + override.returns( + { + authorized_at: Float, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::TaggedSymbol, + member: Privy::IntentAuthorizationKeyQuorumMember::Variants, + status: String, + type: Privy::IntentAuthorizedWebhookPayload::Type::TaggedSymbol, + created_by_display_name: String, + created_by_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentAuthorizedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTENT_AUTHORIZED = + T.let( + :"intent.authorized", + Privy::IntentAuthorizedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::IntentAuthorizedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/intent_create_policy_rule_params.rbi b/rbi/privy/models/intent_create_policy_rule_params.rbi new file mode 100644 index 0000000..ad8c766 --- /dev/null +++ b/rbi/privy/models/intent_create_policy_rule_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class IntentCreatePolicyRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentCreatePolicyRuleParams, Privy::Internal::AnyHash) + end + + # ID of the policy. + sig { returns(String) } + attr_accessor :policy_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the policy. + policy_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_created_webhook_payload.rbi b/rbi/privy/models/intent_created_webhook_payload.rbi new file mode 100644 index 0000000..ec32e12 --- /dev/null +++ b/rbi/privy/models/intent_created_webhook_payload.rbi @@ -0,0 +1,140 @@ +# typed: strong + +module Privy + module Models + class IntentCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::IntentCreatedWebhookPayload, Privy::Internal::AnyHash) + end + + # Unix timestamp when the intent was created. + sig { returns(Float) } + attr_accessor :created_at + + # Unix timestamp when the intent expires. + sig { returns(Float) } + attr_accessor :expires_at + + # The unique ID of the intent. + sig { returns(String) } + attr_accessor :intent_id + + # Type of intent. + sig { returns(Privy::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The current status of the intent. + sig { returns(String) } + attr_accessor :status + + # The type of webhook event. + sig { returns(Privy::IntentCreatedWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # Key quorums that can authorize this intent. + sig { returns(T.nilable(T::Array[Privy::IntentAuthorization])) } + attr_reader :authorization_details + + sig do + params( + authorization_details: T::Array[Privy::IntentAuthorization::OrHash] + ).void + end + attr_writer :authorization_details + + # Display name of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_display_name + + sig { params(created_by_display_name: String).void } + attr_writer :created_by_display_name + + # The ID of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_id + + sig { params(created_by_id: String).void } + attr_writer :created_by_id + + # Payload for the intent.created webhook event. + sig do + params( + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::OrSymbol, + status: String, + type: Privy::IntentCreatedWebhookPayload::Type::OrSymbol, + authorization_details: T::Array[Privy::IntentAuthorization::OrHash], + created_by_display_name: String, + created_by_id: String + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp when the intent was created. + created_at:, + # Unix timestamp when the intent expires. + expires_at:, + # The unique ID of the intent. + intent_id:, + # Type of intent. + intent_type:, + # The current status of the intent. + status:, + # The type of webhook event. + type:, + # Key quorums that can authorize this intent. + authorization_details: nil, + # Display name of the user who created the intent. + created_by_display_name: nil, + # The ID of the user who created the intent. + created_by_id: nil + ) + end + + sig do + override.returns( + { + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::TaggedSymbol, + status: String, + type: Privy::IntentCreatedWebhookPayload::Type::TaggedSymbol, + authorization_details: T::Array[Privy::IntentAuthorization], + created_by_display_name: String, + created_by_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentCreatedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTENT_CREATED = + T.let( + :"intent.created", + Privy::IntentCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::IntentCreatedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/intent_creation_headers.rbi b/rbi/privy/models/intent_creation_headers.rbi new file mode 100644 index 0000000..a499ef1 --- /dev/null +++ b/rbi/privy/models/intent_creation_headers.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module Privy + module Models + class IntentCreationHeaders < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::IntentCreationHeaders, Privy::Internal::AnyHash) + end + + # ID of your Privy app. + sig { returns(String) } + attr_accessor :privy_app_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + # Headers required to create an intent. + sig do + params(privy_app_id: String, privy_request_expiry: String).returns( + T.attached_class + ) + end + def self.new( + # ID of your Privy app. + privy_app_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil + ) + end + + sig do + override.returns({ privy_app_id: String, privy_request_expiry: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_delete_policy_rule_params.rbi b/rbi/privy/models/intent_delete_policy_rule_params.rbi new file mode 100644 index 0000000..df75c1c --- /dev/null +++ b/rbi/privy/models/intent_delete_policy_rule_params.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class IntentDeletePolicyRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentDeletePolicyRuleParams, Privy::Internal::AnyHash) + end + + # ID of the policy. + sig { returns(String) } + attr_accessor :policy_id + + # ID of the rule. + sig { returns(String) } + attr_accessor :rule_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + rule_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the policy. + policy_id:, + # ID of the rule. + rule_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + rule_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_executed_webhook_payload.rbi b/rbi/privy/models/intent_executed_webhook_payload.rbi new file mode 100644 index 0000000..6f28098 --- /dev/null +++ b/rbi/privy/models/intent_executed_webhook_payload.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Privy + module Models + class IntentExecutedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::IntentExecutedWebhookPayload, Privy::Internal::AnyHash) + end + + # Result of the successful intent execution. + sig { returns(Privy::BaseActionResult) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # Unix timestamp when the intent was created. + sig { returns(Float) } + attr_accessor :created_at + + # Unix timestamp when the intent expires. + sig { returns(Float) } + attr_accessor :expires_at + + # The unique ID of the intent. + sig { returns(String) } + attr_accessor :intent_id + + # Type of intent. + sig { returns(Privy::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The current status of the intent. + sig { returns(String) } + attr_accessor :status + + # The type of webhook event. + sig { returns(Privy::IntentExecutedWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # Display name of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_display_name + + sig { params(created_by_display_name: String).void } + attr_writer :created_by_display_name + + # The ID of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_id + + sig { params(created_by_id: String).void } + attr_writer :created_by_id + + # Payload for the intent.executed webhook event. + sig do + params( + action_result: Privy::BaseActionResult::OrHash, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::OrSymbol, + status: String, + type: Privy::IntentExecutedWebhookPayload::Type::OrSymbol, + created_by_display_name: String, + created_by_id: String + ).returns(T.attached_class) + end + def self.new( + # Result of the successful intent execution. + action_result:, + # Unix timestamp when the intent was created. + created_at:, + # Unix timestamp when the intent expires. + expires_at:, + # The unique ID of the intent. + intent_id:, + # Type of intent. + intent_type:, + # The current status of the intent. + status:, + # The type of webhook event. + type:, + # Display name of the user who created the intent. + created_by_display_name: nil, + # The ID of the user who created the intent. + created_by_id: nil + ) + end + + sig do + override.returns( + { + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::TaggedSymbol, + status: String, + type: Privy::IntentExecutedWebhookPayload::Type::TaggedSymbol, + created_by_display_name: String, + created_by_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentExecutedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTENT_EXECUTED = + T.let( + :"intent.executed", + Privy::IntentExecutedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::IntentExecutedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/intent_failed_webhook_payload.rbi b/rbi/privy/models/intent_failed_webhook_payload.rbi new file mode 100644 index 0000000..728e173 --- /dev/null +++ b/rbi/privy/models/intent_failed_webhook_payload.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Privy + module Models + class IntentFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::IntentFailedWebhookPayload, Privy::Internal::AnyHash) + end + + # Result of the failed intent execution. + sig { returns(Privy::BaseActionResult) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # Unix timestamp when the intent was created. + sig { returns(Float) } + attr_accessor :created_at + + # Unix timestamp when the intent expires. + sig { returns(Float) } + attr_accessor :expires_at + + # The unique ID of the intent. + sig { returns(String) } + attr_accessor :intent_id + + # Type of intent. + sig { returns(Privy::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The current status of the intent. + sig { returns(String) } + attr_accessor :status + + # The type of webhook event. + sig { returns(Privy::IntentFailedWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # Display name of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_display_name + + sig { params(created_by_display_name: String).void } + attr_writer :created_by_display_name + + # The ID of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_id + + sig { params(created_by_id: String).void } + attr_writer :created_by_id + + # Payload for the intent.failed webhook event. + sig do + params( + action_result: Privy::BaseActionResult::OrHash, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::OrSymbol, + status: String, + type: Privy::IntentFailedWebhookPayload::Type::OrSymbol, + created_by_display_name: String, + created_by_id: String + ).returns(T.attached_class) + end + def self.new( + # Result of the failed intent execution. + action_result:, + # Unix timestamp when the intent was created. + created_at:, + # Unix timestamp when the intent expires. + expires_at:, + # The unique ID of the intent. + intent_id:, + # Type of intent. + intent_type:, + # The current status of the intent. + status:, + # The type of webhook event. + type:, + # Display name of the user who created the intent. + created_by_display_name: nil, + # The ID of the user who created the intent. + created_by_id: nil + ) + end + + sig do + override.returns( + { + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::TaggedSymbol, + status: String, + type: Privy::IntentFailedWebhookPayload::Type::TaggedSymbol, + created_by_display_name: String, + created_by_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentFailedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTENT_FAILED = + T.let( + :"intent.failed", + Privy::IntentFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::IntentFailedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/intent_get_params.rbi b/rbi/privy/models/intent_get_params.rbi new file mode 100644 index 0000000..744c0c9 --- /dev/null +++ b/rbi/privy/models/intent_get_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class IntentGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::IntentGetParams, Privy::Internal::AnyHash) } + + # ID of the intent. + sig { returns(String) } + attr_accessor :intent_id + + sig do + params( + intent_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the intent. + intent_id:, + request_options: {} + ) + end + + sig do + override.returns( + { intent_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_list_params.rbi b/rbi/privy/models/intent_list_params.rbi new file mode 100644 index 0000000..ad1e86f --- /dev/null +++ b/rbi/privy/models/intent_list_params.rbi @@ -0,0 +1,182 @@ +# typed: strong + +module Privy + module Models + class IntentListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentListParams, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :created_by_id + + sig { params(created_by_id: String).void } + attr_writer :created_by_id + + sig do + returns( + T.nilable(Privy::IntentListParams::CurrentUserHasSigned::OrSymbol) + ) + end + attr_reader :current_user_has_signed + + sig do + params( + current_user_has_signed: + Privy::IntentListParams::CurrentUserHasSigned::OrSymbol + ).void + end + attr_writer :current_user_has_signed + + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + # Type of intent. + sig { returns(T.nilable(Privy::IntentType::OrSymbol)) } + attr_reader :intent_type + + sig { params(intent_type: Privy::IntentType::OrSymbol).void } + attr_writer :intent_type + + sig { returns(T.nilable(Float)) } + attr_accessor :limit + + sig { returns(T.nilable(String)) } + attr_reader :pending_member_id + + sig { params(pending_member_id: String).void } + attr_writer :pending_member_id + + sig { returns(T.nilable(String)) } + attr_reader :resource_id + + sig { params(resource_id: String).void } + attr_writer :resource_id + + sig { returns(T.nilable(Privy::IntentListParams::SortBy::OrSymbol)) } + attr_reader :sort_by + + sig { params(sort_by: Privy::IntentListParams::SortBy::OrSymbol).void } + attr_writer :sort_by + + # Current status of an intent. + sig { returns(T.nilable(Privy::IntentStatus::OrSymbol)) } + attr_reader :status + + sig { params(status: Privy::IntentStatus::OrSymbol).void } + attr_writer :status + + sig do + params( + created_by_id: String, + current_user_has_signed: + Privy::IntentListParams::CurrentUserHasSigned::OrSymbol, + cursor: String, + intent_type: Privy::IntentType::OrSymbol, + limit: T.nilable(Float), + pending_member_id: String, + resource_id: String, + sort_by: Privy::IntentListParams::SortBy::OrSymbol, + status: Privy::IntentStatus::OrSymbol, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + created_by_id: nil, + current_user_has_signed: nil, + cursor: nil, + # Type of intent. + intent_type: nil, + limit: nil, + pending_member_id: nil, + resource_id: nil, + sort_by: nil, + # Current status of an intent. + status: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + created_by_id: String, + current_user_has_signed: + Privy::IntentListParams::CurrentUserHasSigned::OrSymbol, + cursor: String, + intent_type: Privy::IntentType::OrSymbol, + limit: T.nilable(Float), + pending_member_id: String, + resource_id: String, + sort_by: Privy::IntentListParams::SortBy::OrSymbol, + status: Privy::IntentStatus::OrSymbol, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + module CurrentUserHasSigned + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentListParams::CurrentUserHasSigned) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + Privy::IntentListParams::CurrentUserHasSigned::TaggedSymbol + ) + FALSE = + T.let( + :false, + Privy::IntentListParams::CurrentUserHasSigned::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::IntentListParams::CurrentUserHasSigned::TaggedSymbol + ] + ) + end + def self.values + end + end + + module SortBy + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::IntentListParams::SortBy) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATED_AT_DESC = + T.let(:created_at_desc, Privy::IntentListParams::SortBy::TaggedSymbol) + EXPIRES_AT_ASC = + T.let(:expires_at_asc, Privy::IntentListParams::SortBy::TaggedSymbol) + UPDATED_AT_DESC = + T.let(:updated_at_desc, Privy::IntentListParams::SortBy::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::IntentListParams::SortBy::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/intent_rejected_webhook_payload.rbi b/rbi/privy/models/intent_rejected_webhook_payload.rbi new file mode 100644 index 0000000..271a947 --- /dev/null +++ b/rbi/privy/models/intent_rejected_webhook_payload.rbi @@ -0,0 +1,133 @@ +# typed: strong + +module Privy + module Models + class IntentRejectedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::IntentRejectedWebhookPayload, Privy::Internal::AnyHash) + end + + # Unix timestamp when the intent was created. + sig { returns(Float) } + attr_accessor :created_at + + # Unix timestamp when the intent expires. + sig { returns(Float) } + attr_accessor :expires_at + + # The unique ID of the intent. + sig { returns(String) } + attr_accessor :intent_id + + # Type of intent. + sig { returns(Privy::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # Unix timestamp when the intent was rejected. + sig { returns(Float) } + attr_accessor :rejected_at + + # The current status of the intent. + sig { returns(String) } + attr_accessor :status + + # The type of webhook event. + sig { returns(Privy::IntentRejectedWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # Display name of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_display_name + + sig { params(created_by_display_name: String).void } + attr_writer :created_by_display_name + + # The ID of the user who created the intent. + sig { returns(T.nilable(String)) } + attr_reader :created_by_id + + sig { params(created_by_id: String).void } + attr_writer :created_by_id + + # Payload for the intent.rejected webhook event. + sig do + params( + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::OrSymbol, + rejected_at: Float, + status: String, + type: Privy::IntentRejectedWebhookPayload::Type::OrSymbol, + created_by_display_name: String, + created_by_id: String + ).returns(T.attached_class) + end + def self.new( + # Unix timestamp when the intent was created. + created_at:, + # Unix timestamp when the intent expires. + expires_at:, + # The unique ID of the intent. + intent_id:, + # Type of intent. + intent_type:, + # Unix timestamp when the intent was rejected. + rejected_at:, + # The current status of the intent. + status:, + # The type of webhook event. + type:, + # Display name of the user who created the intent. + created_by_display_name: nil, + # The ID of the user who created the intent. + created_by_id: nil + ) + end + + sig do + override.returns( + { + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::IntentType::TaggedSymbol, + rejected_at: Float, + status: String, + type: Privy::IntentRejectedWebhookPayload::Type::TaggedSymbol, + created_by_display_name: String, + created_by_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::IntentRejectedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INTENT_REJECTED = + T.let( + :"intent.rejected", + Privy::IntentRejectedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::IntentRejectedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/intent_response.rbi b/rbi/privy/models/intent_response.rbi new file mode 100644 index 0000000..36b5058 --- /dev/null +++ b/rbi/privy/models/intent_response.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # Response for an intent object + module IntentResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::RpcIntentResponse, + Privy::TransferIntentResponse, + Privy::WalletIntentResponse, + Privy::PolicyIntentResponse, + Privy::RuleIntentResponse, + Privy::KeyQuorumIntentResponse + ) + end + + sig { override.returns(T::Array[Privy::IntentResponse::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/intent_rpc_params.rbi b/rbi/privy/models/intent_rpc_params.rbi new file mode 100644 index 0000000..36f01b3 --- /dev/null +++ b/rbi/privy/models/intent_rpc_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class IntentRpcParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::IntentRpcParams, Privy::Internal::AnyHash) } + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_status.rbi b/rbi/privy/models/intent_status.rbi new file mode 100644 index 0000000..cd49f5a --- /dev/null +++ b/rbi/privy/models/intent_status.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # Current status of an intent. + module IntentStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::IntentStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:pending, Privy::IntentStatus::TaggedSymbol) + EXECUTED = T.let(:executed, Privy::IntentStatus::TaggedSymbol) + FAILED = T.let(:failed, Privy::IntentStatus::TaggedSymbol) + EXPIRED = T.let(:expired, Privy::IntentStatus::TaggedSymbol) + REJECTED = T.let(:rejected, Privy::IntentStatus::TaggedSymbol) + DISMISSED = T.let(:dismissed, Privy::IntentStatus::TaggedSymbol) + + sig { override.returns(T::Array[Privy::IntentStatus::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/intent_transfer_params.rbi b/rbi/privy/models/intent_transfer_params.rbi new file mode 100644 index 0000000..96987bb --- /dev/null +++ b/rbi/privy/models/intent_transfer_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class IntentTransferParams < Privy::Models::TransferRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentTransferParams, Privy::Internal::AnyHash) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_type.rbi b/rbi/privy/models/intent_type.rbi new file mode 100644 index 0000000..63b1b25 --- /dev/null +++ b/rbi/privy/models/intent_type.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # Type of intent. + module IntentType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::IntentType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KEY_QUORUM = T.let(:KEY_QUORUM, Privy::IntentType::TaggedSymbol) + POLICY = T.let(:POLICY, Privy::IntentType::TaggedSymbol) + RULE = T.let(:RULE, Privy::IntentType::TaggedSymbol) + RPC = T.let(:RPC, Privy::IntentType::TaggedSymbol) + TRANSFER = T.let(:TRANSFER, Privy::IntentType::TaggedSymbol) + WALLET = T.let(:WALLET, Privy::IntentType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::IntentType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/intent_update_key_quorum_params.rbi b/rbi/privy/models/intent_update_key_quorum_params.rbi new file mode 100644 index 0000000..75273ae --- /dev/null +++ b/rbi/privy/models/intent_update_key_quorum_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class IntentUpdateKeyQuorumParams < Privy::Models::KeyQuorumUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentUpdateKeyQuorumParams, Privy::Internal::AnyHash) + end + + # ID of the key quorum. + sig { returns(String) } + attr_accessor :key_quorum_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + key_quorum_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the key quorum. + key_quorum_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + key_quorum_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_update_policy_params.rbi b/rbi/privy/models/intent_update_policy_params.rbi new file mode 100644 index 0000000..bf907e1 --- /dev/null +++ b/rbi/privy/models/intent_update_policy_params.rbi @@ -0,0 +1,109 @@ +# typed: strong + +module Privy + module Models + class IntentUpdatePolicyParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentUpdatePolicyParams, Privy::Internal::AnyHash) + end + + # ID of the policy. + sig { returns(String) } + attr_accessor :policy_id + + # Name to assign to policy. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + sig { returns(T.nilable(T::Array[Privy::PolicyRuleRequestBody])) } + attr_reader :rules + + sig { params(rules: T::Array[Privy::PolicyRuleRequestBody::OrHash]).void } + attr_writer :rules + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody::OrHash], + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the policy. + policy_id:, + # Name to assign to policy. + name: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + rules: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + name: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody], + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_update_policy_rule_params.rbi b/rbi/privy/models/intent_update_policy_rule_params.rbi new file mode 100644 index 0000000..e4fdc4c --- /dev/null +++ b/rbi/privy/models/intent_update_policy_rule_params.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class IntentUpdatePolicyRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentUpdatePolicyRuleParams, Privy::Internal::AnyHash) + end + + # ID of the policy. + sig { returns(String) } + attr_accessor :policy_id + + # ID of the rule. + sig { returns(String) } + attr_accessor :rule_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + rule_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the policy. + policy_id:, + # ID of the rule. + rule_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + rule_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/intent_update_wallet_params.rbi b/rbi/privy/models/intent_update_wallet_params.rbi new file mode 100644 index 0000000..2a6dc5f --- /dev/null +++ b/rbi/privy/models/intent_update_wallet_params.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class IntentUpdateWalletParams < Privy::Models::WalletUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::IntentUpdateWalletParams, Privy::Internal::AnyHash) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/key_quorum.rbi b/rbi/privy/models/key_quorum.rbi new file mode 100644 index 0000000..bb907b4 --- /dev/null +++ b/rbi/privy/models/key_quorum.rbi @@ -0,0 +1,99 @@ +# typed: strong + +module Privy + module Models + class KeyQuorum < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::KeyQuorum, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T::Array[Privy::KeyQuorum::AuthorizationKey]) } + attr_accessor :authorization_keys + + sig { returns(T.nilable(Float)) } + attr_accessor :authorization_threshold + + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :user_ids + + # List of nested key quorum IDs that are members of this key quorum. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :key_quorum_ids + + sig { params(key_quorum_ids: T::Array[String]).void } + attr_writer :key_quorum_ids + + # A key quorum for authorizing wallet operations. + sig do + params( + id: String, + authorization_keys: + T::Array[Privy::KeyQuorum::AuthorizationKey::OrHash], + authorization_threshold: T.nilable(Float), + display_name: T.nilable(String), + user_ids: T.nilable(T::Array[String]), + key_quorum_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + id:, + authorization_keys:, + authorization_threshold:, + display_name:, + user_ids:, + # List of nested key quorum IDs that are members of this key quorum. + key_quorum_ids: nil + ) + end + + sig do + override.returns( + { + id: String, + authorization_keys: T::Array[Privy::KeyQuorum::AuthorizationKey], + authorization_threshold: T.nilable(Float), + display_name: T.nilable(String), + user_ids: T.nilable(T::Array[String]), + key_quorum_ids: T::Array[String] + } + ) + end + def to_hash + end + + class AuthorizationKey < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::KeyQuorum::AuthorizationKey, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + sig { returns(String) } + attr_accessor :public_key + + sig do + params(display_name: T.nilable(String), public_key: String).returns( + T.attached_class + ) + end + def self.new(display_name:, public_key:) + end + + sig do + override.returns( + { display_name: T.nilable(String), public_key: String } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/key_quorum_authorization_headers.rbi b/rbi/privy/models/key_quorum_authorization_headers.rbi new file mode 100644 index 0000000..ac14056 --- /dev/null +++ b/rbi/privy/models/key_quorum_authorization_headers.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumAuthorizationHeaders < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumAuthorizationHeaders, Privy::Internal::AnyHash) + end + + # ID of your Privy app. + sig { returns(String) } + attr_accessor :privy_app_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + # Headers required to authorize modifications to key quorums. + sig do + params( + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + ).returns(T.attached_class) + end + def self.new( + # ID of your Privy app. + privy_app_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil + ) + end + + sig do + override.returns( + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/key_quorum_create_params.rbi b/rbi/privy/models/key_quorum_create_params.rbi new file mode 100644 index 0000000..54931fe --- /dev/null +++ b/rbi/privy/models/key_quorum_create_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumCreateParams < Privy::Models::KeyQuorumCreateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumCreateParams, Privy::Internal::AnyHash) + end + + sig do + params(request_options: Privy::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Privy::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/key_quorum_create_request_body.rbi b/rbi/privy/models/key_quorum_create_request_body.rbi new file mode 100644 index 0000000..15ebc35 --- /dev/null +++ b/rbi/privy/models/key_quorum_create_request_body.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumCreateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumCreateRequestBody, Privy::Internal::AnyHash) + end + + # The number of keys that must sign for an action to be valid. Must be less than + # or equal to total number of key quorum members. + sig { returns(T.nilable(Float)) } + attr_reader :authorization_threshold + + sig { params(authorization_threshold: Float).void } + attr_writer :authorization_threshold + + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # List of key quorum IDs that should be members of this key quorum. Key quorums + # can only be nested 1 level deep. At least one of `user_ids`, `public_keys`, or + # `key_quorum_ids` is required. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :key_quorum_ids + + sig { params(key_quorum_ids: T::Array[String]).void } + attr_writer :key_quorum_ids + + # List of P-256 public keys of the keys that should be authorized to sign on the + # key quorum, in base64-encoded DER format. At least one of `user_ids`, + # `public_keys`, or `key_quorum_ids` is required. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :public_keys + + sig { params(public_keys: T::Array[String]).void } + attr_writer :public_keys + + # List of user IDs of the users that should be authorized to sign on the key + # quorum. At least one of `user_ids`, `public_keys`, or `key_quorum_ids` is + # required. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :user_ids + + sig { params(user_ids: T::Array[String]).void } + attr_writer :user_ids + + # Request input for creating a key quorum. At least one of `user_ids`, + # `public_keys`, or `key_quorum_ids` is required. + sig do + params( + authorization_threshold: Float, + display_name: String, + key_quorum_ids: T::Array[String], + public_keys: T::Array[String], + user_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The number of keys that must sign for an action to be valid. Must be less than + # or equal to total number of key quorum members. + authorization_threshold: nil, + display_name: nil, + # List of key quorum IDs that should be members of this key quorum. Key quorums + # can only be nested 1 level deep. At least one of `user_ids`, `public_keys`, or + # `key_quorum_ids` is required. + key_quorum_ids: nil, + # List of P-256 public keys of the keys that should be authorized to sign on the + # key quorum, in base64-encoded DER format. At least one of `user_ids`, + # `public_keys`, or `key_quorum_ids` is required. + public_keys: nil, + # List of user IDs of the users that should be authorized to sign on the key + # quorum. At least one of `user_ids`, `public_keys`, or `key_quorum_ids` is + # required. + user_ids: nil + ) + end + + sig do + override.returns( + { + authorization_threshold: Float, + display_name: String, + key_quorum_ids: T::Array[String], + public_keys: T::Array[String], + user_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/key_quorum_delete_params.rbi b/rbi/privy/models/key_quorum_delete_params.rbi new file mode 100644 index 0000000..691d581 --- /dev/null +++ b/rbi/privy/models/key_quorum_delete_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumDeleteParams, Privy::Internal::AnyHash) + end + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :key_quorum_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for a key quorum. + key_quorum_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/key_quorum_get_params.rbi b/rbi/privy/models/key_quorum_get_params.rbi new file mode 100644 index 0000000..1432807 --- /dev/null +++ b/rbi/privy/models/key_quorum_get_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumGetParams, Privy::Internal::AnyHash) + end + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :key_quorum_id + + sig do + params( + key_quorum_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for a key quorum. + key_quorum_id:, + request_options: {} + ) + end + + sig do + override.returns( + { key_quorum_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/key_quorum_id.rbi b/rbi/privy/models/key_quorum_id.rbi new file mode 100644 index 0000000..21d37e2 --- /dev/null +++ b/rbi/privy/models/key_quorum_id.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + KeyQuorumID = String + end +end diff --git a/rbi/privy/models/key_quorum_intent_response.rbi b/rbi/privy/models/key_quorum_intent_response.rbi new file mode 100644 index 0000000..23d2b75 --- /dev/null +++ b/rbi/privy/models/key_quorum_intent_response.rbi @@ -0,0 +1,193 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumIntentResponse < Privy::Models::BaseIntentResponse + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumIntentResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::KeyQuorumIntentResponse::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The original key quorum update request that would be sent to the key quorum + # endpoint + sig { returns(Privy::KeyQuorumIntentResponse::RequestDetails) } + attr_reader :request_details + + sig do + params( + request_details: + Privy::KeyQuorumIntentResponse::RequestDetails::OrHash + ).void + end + attr_writer :request_details + + # Result of key quorum update execution (only present if status is 'executed' or + # 'failed') + sig { returns(T.nilable(Privy::BaseActionResult)) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # A key quorum for authorizing wallet operations. + sig { returns(T.nilable(Privy::KeyQuorum)) } + attr_reader :current_resource_data + + sig { params(current_resource_data: Privy::KeyQuorum::OrHash).void } + attr_writer :current_resource_data + + # Response for a key quorum intent + sig do + params( + intent_type: Privy::KeyQuorumIntentResponse::IntentType::OrSymbol, + request_details: + Privy::KeyQuorumIntentResponse::RequestDetails::OrHash, + action_result: Privy::BaseActionResult::OrHash, + current_resource_data: Privy::KeyQuorum::OrHash + ).returns(T.attached_class) + end + def self.new( + intent_type:, + # The original key quorum update request that would be sent to the key quorum + # endpoint + request_details:, + # Result of key quorum update execution (only present if status is 'executed' or + # 'failed') + action_result: nil, + # A key quorum for authorizing wallet operations. + current_resource_data: nil + ) + end + + sig do + override.returns( + { + intent_type: + Privy::KeyQuorumIntentResponse::IntentType::TaggedSymbol, + request_details: Privy::KeyQuorumIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::KeyQuorum + } + ) + end + def to_hash + end + + module IntentType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::KeyQuorumIntentResponse::IntentType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KEY_QUORUM = + T.let( + :KEY_QUORUM, + Privy::KeyQuorumIntentResponse::IntentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::KeyQuorumIntentResponse::IntentType::TaggedSymbol] + ) + end + def self.values + end + end + + class RequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KeyQuorumIntentResponse::RequestDetails, + Privy::Internal::AnyHash + ) + end + + # Request input for updating an existing key quorum. At least one field must be + # provided. + sig { returns(Privy::KeyQuorumUpdateRequestBody) } + attr_reader :body + + sig { params(body: Privy::KeyQuorumUpdateRequestBody::OrHash).void } + attr_writer :body + + sig do + returns( + Privy::KeyQuorumIntentResponse::RequestDetails::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # The original key quorum update request that would be sent to the key quorum + # endpoint + sig do + params( + body: Privy::KeyQuorumUpdateRequestBody::OrHash, + method_: + Privy::KeyQuorumIntentResponse::RequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # Request input for updating an existing key quorum. At least one field must be + # provided. + body:, + method_:, + url: + ) + end + + sig do + override.returns( + { + body: Privy::KeyQuorumUpdateRequestBody, + method_: + Privy::KeyQuorumIntentResponse::RequestDetails::Method::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KeyQuorumIntentResponse::RequestDetails::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PATCH = + T.let( + :PATCH, + Privy::KeyQuorumIntentResponse::RequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KeyQuorumIntentResponse::RequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/privy/models/key_quorum_update_params.rbi b/rbi/privy/models/key_quorum_update_params.rbi new file mode 100644 index 0000000..5fa97f5 --- /dev/null +++ b/rbi/privy/models/key_quorum_update_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumUpdateParams < Privy::Models::KeyQuorumUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumUpdateParams, Privy::Internal::AnyHash) + end + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :key_quorum_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for a key quorum. + key_quorum_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/key_quorum_update_request_body.rbi b/rbi/privy/models/key_quorum_update_request_body.rbi new file mode 100644 index 0000000..49d2ec5 --- /dev/null +++ b/rbi/privy/models/key_quorum_update_request_body.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Privy + module Models + class KeyQuorumUpdateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::KeyQuorumUpdateRequestBody, Privy::Internal::AnyHash) + end + + # The number of keys that must sign for an action to be valid. Must be less than + # or equal to total number of key quorum members. + sig { returns(T.nilable(Float)) } + attr_reader :authorization_threshold + + sig { params(authorization_threshold: Float).void } + attr_writer :authorization_threshold + + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # List of key quorum IDs that should be members of this key quorum. Key quorums + # can only be nested 1 level deep. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :key_quorum_ids + + sig { params(key_quorum_ids: T::Array[String]).void } + attr_writer :key_quorum_ids + + # List of P-256 public keys of the keys that should be authorized to sign on the + # key quorum, in base64-encoded DER format. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :public_keys + + sig { params(public_keys: T::Array[String]).void } + attr_writer :public_keys + + # List of user IDs of the users that should be authorized to sign on the key + # quorum. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :user_ids + + sig { params(user_ids: T::Array[String]).void } + attr_writer :user_ids + + # Request input for updating an existing key quorum. At least one field must be + # provided. + sig do + params( + authorization_threshold: Float, + display_name: String, + key_quorum_ids: T::Array[String], + public_keys: T::Array[String], + user_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The number of keys that must sign for an action to be valid. Must be less than + # or equal to total number of key quorum members. + authorization_threshold: nil, + display_name: nil, + # List of key quorum IDs that should be members of this key quorum. Key quorums + # can only be nested 1 level deep. + key_quorum_ids: nil, + # List of P-256 public keys of the keys that should be authorized to sign on the + # key quorum, in base64-encoded DER format. + public_keys: nil, + # List of user IDs of the users that should be authorized to sign on the key + # quorum. + user_ids: nil + ) + end + + sig do + override.returns( + { + authorization_threshold: Float, + display_name: String, + key_quorum_ids: T::Array[String], + public_keys: T::Array[String], + user_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_current_day_pnl.rbi b/rbi/privy/models/kraken_embed_current_day_pnl.rbi new file mode 100644 index 0000000..44c0fc5 --- /dev/null +++ b/rbi/privy/models/kraken_embed_current_day_pnl.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedCurrentDayPnl < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::KrakenEmbedCurrentDayPnl, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :pnl + + sig { returns(Time) } + attr_accessor :since + + # Current day profit and loss for a portfolio, calculated from the most recent + # available balance. + sig { params(pnl: String, since: Time).returns(T.attached_class) } + def self.new(pnl:, since:) + end + + sig { override.returns({ pnl: String, since: Time }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_get_asset_list_query_params_schema.rbi b/rbi/privy/models/kraken_embed_get_asset_list_query_params_schema.rbi new file mode 100644 index 0000000..2b1a320 --- /dev/null +++ b/rbi/privy/models/kraken_embed_get_asset_list_query_params_schema.rbi @@ -0,0 +1,328 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedGetAssetListQueryParamsSchema < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetAssetListQueryParamsSchema, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :filter_assets + + sig { params(filter_assets: T::Array[String]).void } + attr_writer :filter_assets + + sig do + returns( + T.nilable( + T::Array[ + T.any( + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::OrSymbol, + String + ) + ] + ) + ) + end + attr_reader :filter_platform_statuses + + sig do + params( + filter_platform_statuses: + T::Array[ + T.any( + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::OrSymbol, + String + ) + ] + ).void + end + attr_writer :filter_platform_statuses + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :filter_tradable_only + + sig { returns(T.nilable(String)) } + attr_reader :filter_user + + sig { params(filter_user: String).void } + attr_writer :filter_user + + sig { returns(T.nilable(String)) } + attr_reader :lang + + sig { params(lang: String).void } + attr_writer :lang + + sig { returns(T.nilable(Integer)) } + attr_reader :page_number + + sig { params(page_number: Integer).void } + attr_writer :page_number + + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + sig { returns(T.nilable(String)) } + attr_reader :quote + + sig { params(quote: String).void } + attr_writer :quote + + sig do + returns( + T.nilable( + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::OrSymbol + ) + ) + end + attr_reader :sort + + sig do + params( + sort: Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::OrSymbol + ).void + end + attr_writer :sort + + # Query parameters for listing and filtering available assets. + sig do + params( + filter_assets: T::Array[String], + filter_platform_statuses: + T::Array[ + T.any( + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::OrSymbol, + String + ) + ], + filter_tradable_only: T.nilable(T::Boolean), + filter_user: String, + lang: String, + page_number: Integer, + page_size: Integer, + quote: String, + sort: Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::OrSymbol + ).returns(T.attached_class) + end + def self.new( + filter_assets: nil, + filter_platform_statuses: nil, + filter_tradable_only: nil, + filter_user: nil, + lang: nil, + page_number: nil, + page_size: nil, + quote: nil, + sort: nil + ) + end + + sig do + override.returns( + { + filter_assets: T::Array[String], + filter_platform_statuses: + T::Array[ + T.any( + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::OrSymbol, + String + ) + ], + filter_tradable_only: T.nilable(T::Boolean), + filter_user: String, + lang: String, + page_number: Integer, + page_size: Integer, + quote: String, + sort: + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::OrSymbol + } + ) + end + def to_hash + end + + module FilterPlatformStatus + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::TaggedSymbol, + String + ) + end + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENABLED = + T.let( + :enabled, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::TaggedSymbol + ) + DEPOSIT_ONLY = + T.let( + :deposit_only, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::TaggedSymbol + ) + WITHDRAWAL_ONLY = + T.let( + :withdrawal_only, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::TaggedSymbol + ) + FUNDING_TEMPORARILY_DISABLED = + T.let( + :funding_temporarily_disabled, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::TaggedSymbol + ) + DISABLED = + T.let( + :disabled, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::FilterPlatformStatus::TaggedSymbol + ) + end + + module Sort + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRENDING = + T.let( + :trending, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MARKET_CAP_RANK = + T.let( + :market_cap_rank, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_MARKET_CAP_RANK = + T.let( + :"-market_cap_rank", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + SYMBOL = + T.let( + :symbol, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_SYMBOL = + T.let( + :"-symbol", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + NAME = + T.let( + :name, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_NAME = + T.let( + :"-name", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + CHANGE_PERCENT_1H = + T.let( + :change_percent_1h, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_CHANGE_PERCENT_1_H = + T.let( + :"-change_percent_1h", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + CHANGE_PERCENT_24H = + T.let( + :change_percent_24h, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_CHANGE_PERCENT_24_H = + T.let( + :"-change_percent_24h", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + CHANGE_PERCENT_7D = + T.let( + :change_percent_7d, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_CHANGE_PERCENT_7_D = + T.let( + :"-change_percent_7d", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + CHANGE_PERCENT_30D = + T.let( + :change_percent_30d, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_CHANGE_PERCENT_30_D = + T.let( + :"-change_percent_30d", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + CHANGE_PERCENT_1Y = + T.let( + :change_percent_1y, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_CHANGE_PERCENT_1_Y = + T.let( + :"-change_percent_1y", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + LISTING_DATE = + T.let( + :listing_date, + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + MINUS_LISTING_DATE = + T.let( + :"-listing_date", + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedGetAssetListQueryParamsSchema::Sort::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rbi b/rbi/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rbi new file mode 100644 index 0000000..07730cb --- /dev/null +++ b/rbi/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedGetPortfolioDetailsQueryParamsSchema < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetPortfolioDetailsQueryParamsSchema, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :quote + + sig { params(quote: String).void } + attr_writer :quote + + # Query parameters for portfolio details endpoint. + sig { params(quote: String).returns(T.attached_class) } + def self.new(quote: nil) + end + + sig { override.returns({ quote: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_get_portfolio_summary_query_params.rbi b/rbi/privy/models/kraken_embed_get_portfolio_summary_query_params.rbi new file mode 100644 index 0000000..e2ac96e --- /dev/null +++ b/rbi/privy/models/kraken_embed_get_portfolio_summary_query_params.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedGetPortfolioSummaryQueryParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetPortfolioSummaryQueryParams, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl::OrSymbol + ) + ) + end + attr_reader :include_current_day_pnl + + sig do + params( + include_current_day_pnl: + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl::OrSymbol + ).void + end + attr_writer :include_current_day_pnl + + sig { returns(T.nilable(String)) } + attr_reader :quote + + sig { params(quote: String).void } + attr_writer :quote + + # Query parameters for getting a portfolio summary. + sig do + params( + include_current_day_pnl: + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl::OrSymbol, + quote: String + ).returns(T.attached_class) + end + def self.new(include_current_day_pnl: nil, quote: nil) + end + + sig do + override.returns( + { + include_current_day_pnl: + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl::OrSymbol, + quote: String + } + ) + end + def to_hash + end + + module IncludeCurrentDayPnl + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRUE = + T.let( + :true, + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl::TaggedSymbol + ) + FALSE = + T.let( + :false, + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedGetPortfolioSummaryQueryParams::IncludeCurrentDayPnl::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_get_portfolio_summary_response.rbi b/rbi/privy/models/kraken_embed_get_portfolio_summary_response.rbi new file mode 100644 index 0000000..cb3f727 --- /dev/null +++ b/rbi/privy/models/kraken_embed_get_portfolio_summary_response.rbi @@ -0,0 +1,206 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedGetPortfolioSummaryResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetPortfolioSummaryResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::KrakenEmbedGetPortfolioSummaryResponse::Data) } + attr_reader :data + + sig do + params( + data: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::OrHash + ).void + end + attr_writer :data + + # High-level summary of a user's portfolio including total value, available + # balance, and unrealized P&L. + sig do + params( + data: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::OrHash + ).returns(T.attached_class) + end + def self.new(data:) + end + + sig do + override.returns( + { data: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data } + ) + end + def to_hash + end + + class Data < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetPortfolioSummaryResponse::Data, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + T.nilable( + Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result + ) + ) + end + attr_reader :result + + sig do + params( + result: + T.nilable( + Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result::OrHash + ) + ).void + end + attr_writer :result + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :error + + sig { params(error: T::Array[String]).void } + attr_writer :error + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :errors + + sig { params(errors: T::Array[String]).void } + attr_writer :errors + + sig do + params( + result: + T.nilable( + Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result::OrHash + ), + error: T::Array[String], + errors: T::Array[String] + ).returns(T.attached_class) + end + def self.new(result:, error: nil, errors: nil) + end + + sig do + override.returns( + { + result: + T.nilable( + Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result + ), + error: T::Array[String], + errors: T::Array[String] + } + ) + end + def to_hash + end + + class Result < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :available_balance + + sig { returns(String) } + attr_accessor :currency + + sig { returns(String) } + attr_accessor :open_orders + + sig { returns(String) } + attr_accessor :portfolio_value + + sig { returns(Time) } + attr_accessor :timestamp + + sig { returns(String) } + attr_accessor :withheld_value + + sig { returns(T.nilable(String)) } + attr_accessor :cost_basis + + # Current day profit and loss for a portfolio, calculated from the most recent + # available balance. + sig { returns(T.nilable(Privy::KrakenEmbedCurrentDayPnl)) } + attr_reader :current_day_pnl + + sig do + params( + current_day_pnl: + T.nilable(Privy::KrakenEmbedCurrentDayPnl::OrHash) + ).void + end + attr_writer :current_day_pnl + + sig { returns(T.nilable(String)) } + attr_accessor :lots_upnl + + sig do + params( + available_balance: String, + currency: String, + open_orders: String, + portfolio_value: String, + timestamp: Time, + withheld_value: String, + cost_basis: T.nilable(String), + current_day_pnl: + T.nilable(Privy::KrakenEmbedCurrentDayPnl::OrHash), + lots_upnl: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + available_balance:, + currency:, + open_orders:, + portfolio_value:, + timestamp:, + withheld_value:, + cost_basis: nil, + # Current day profit and loss for a portfolio, calculated from the most recent + # available balance. + current_day_pnl: nil, + lots_upnl: nil + ) + end + + sig do + override.returns( + { + available_balance: String, + currency: String, + open_orders: String, + portfolio_value: String, + timestamp: Time, + withheld_value: String, + cost_basis: T.nilable(String), + current_day_pnl: T.nilable(Privy::KrakenEmbedCurrentDayPnl), + lots_upnl: T.nilable(String) + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rbi b/rbi/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rbi new file mode 100644 index 0000000..6fc7527 --- /dev/null +++ b/rbi/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rbi @@ -0,0 +1,401 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedGetPortfolioTransactionsQueryParamsSchema < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :assets + + sig { params(assets: T::Array[String]).void } + attr_writer :assets + + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + sig { returns(T.nilable(Time)) } + attr_reader :from_time + + sig { params(from_time: Time).void } + attr_writer :from_time + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :ids + + sig { params(ids: T::Array[String]).void } + attr_writer :ids + + sig { returns(T.nilable(Integer)) } + attr_reader :page_size + + sig { params(page_size: Integer).void } + attr_writer :page_size + + sig { returns(T.nilable(String)) } + attr_reader :quote + + sig { params(quote: String).void } + attr_writer :quote + + sig do + returns( + T.nilable( + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID + ] + ) + ) + end + attr_reader :ref_ids + + sig do + params( + ref_ids: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::OrHash + ] + ).void + end + attr_writer :ref_ids + + sig do + returns( + T.nilable( + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting::OrSymbol + ) + ) + end + attr_reader :sorting + + sig do + params( + sorting: + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting::OrSymbol + ).void + end + attr_writer :sorting + + sig do + returns( + T.nilable( + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::OrSymbol + ] + ) + ) + end + attr_reader :statuses + + sig do + params( + statuses: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::OrSymbol + ] + ).void + end + attr_writer :statuses + + sig do + returns( + T.nilable( + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::OrSymbol + ] + ) + ) + end + attr_reader :types + + sig do + params( + types: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::OrSymbol + ] + ).void + end + attr_writer :types + + sig { returns(T.nilable(Time)) } + attr_reader :until_time + + sig { params(until_time: Time).void } + attr_writer :until_time + + # Query parameters for filtering and paginating portfolio transactions. + sig do + params( + assets: T::Array[String], + cursor: String, + from_time: Time, + ids: T::Array[String], + page_size: Integer, + quote: String, + ref_ids: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::OrHash + ], + sorting: + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting::OrSymbol, + statuses: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::OrSymbol + ], + types: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::OrSymbol + ], + until_time: Time + ).returns(T.attached_class) + end + def self.new( + assets: nil, + cursor: nil, + from_time: nil, + ids: nil, + page_size: nil, + quote: nil, + ref_ids: nil, + sorting: nil, + statuses: nil, + types: nil, + until_time: nil + ) + end + + sig do + override.returns( + { + assets: T::Array[String], + cursor: String, + from_time: Time, + ids: T::Array[String], + page_size: Integer, + quote: String, + ref_ids: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID + ], + sorting: + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting::OrSymbol, + statuses: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::OrSymbol + ], + types: + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::OrSymbol + ], + until_time: Time + } + ) + end + def to_hash + end + + class RefID < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :ref_id + + sig do + returns( + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type::OrSymbol + ) + end + attr_accessor :type + + sig do + params( + ref_id: String, + type: + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(ref_id:, type:) + end + + sig do + override.returns( + { + ref_id: String, + type: + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type::OrSymbol + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIMPLE_ORDER_QUOTE = + T.let( + :simple_order_quote, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type::TaggedSymbol + ) + SIMPLE_ORDER_QUOTE_FAILED = + T.let( + :simple_order_quote_failed, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + module Sorting + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DESCENDING = + T.let( + :descending, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting::TaggedSymbol + ) + ASCENDING = + T.let( + :ascending, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Sorting::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UNSPECIFIED = + T.let( + :unspecified, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::TaggedSymbol + ) + IN_PROGRESS = + T.let( + :in_progress, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::TaggedSymbol + ) + SUCCESSFUL = + T.let( + :successful, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIMPLE_ORDER = + T.let( + :simple_order, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::TaggedSymbol + ) + SIMPLE_ORDER_FAILED = + T.let( + :simple_order_failed, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::TaggedSymbol + ) + EARN_REWARD = + T.let( + :earn_reward, + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_get_quote_query_params.rbi b/rbi/privy/models/kraken_embed_get_quote_query_params.rbi new file mode 100644 index 0000000..7e0e8e5 --- /dev/null +++ b/rbi/privy/models/kraken_embed_get_quote_query_params.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedGetQuoteQueryParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::KrakenEmbedGetQuoteQueryParams, Privy::Internal::AnyHash) + end + + # The ID of the Privy user. + sig { returns(String) } + attr_accessor :user_id + + # Query parameters for getting a quote status. + sig { params(user_id: String).returns(T.attached_class) } + def self.new( + # The ID of the Privy user. + user_id: + ) + end + + sig { override.returns({ user_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_quote_cancelled_webhook_payload.rbi b/rbi/privy/models/kraken_embed_quote_cancelled_webhook_payload.rbi new file mode 100644 index 0000000..09625c6 --- /dev/null +++ b/rbi/privy/models/kraken_embed_quote_cancelled_webhook_payload.rbi @@ -0,0 +1,105 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedQuoteCancelledWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedQuoteCancelledWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # ISO 8601 timestamp of when the quote was cancelled. + sig { returns(String) } + attr_accessor :cancelled_at + + # The ID of the cancelled quote. + sig { returns(String) } + attr_accessor :quote_id + + # A human-readable description of why the quote was cancelled. Intended for + # display and logging purposes only. + sig { returns(String) } + attr_accessor :reason + + # The type of webhook event. + sig do + returns(Privy::KrakenEmbedQuoteCancelledWebhookPayload::Type::OrSymbol) + end + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # Payload for the kraken_embed.quote.cancelled webhook event. + sig do + params( + cancelled_at: String, + quote_id: String, + reason: String, + type: Privy::KrakenEmbedQuoteCancelledWebhookPayload::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # ISO 8601 timestamp of when the quote was cancelled. + cancelled_at:, + # The ID of the cancelled quote. + quote_id:, + # A human-readable description of why the quote was cancelled. Intended for + # display and logging purposes only. + reason:, + # The type of webhook event. + type:, + # The ID of the user. + user_id: + ) + end + + sig do + override.returns( + { + cancelled_at: String, + quote_id: String, + reason: String, + type: + Privy::KrakenEmbedQuoteCancelledWebhookPayload::Type::OrSymbol, + user_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::KrakenEmbedQuoteCancelledWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KRAKEN_EMBED_QUOTE_CANCELLED = + T.let( + :"kraken_embed.quote.cancelled", + Privy::KrakenEmbedQuoteCancelledWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedQuoteCancelledWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_quote_executed_webhook_payload.rbi b/rbi/privy/models/kraken_embed_quote_executed_webhook_payload.rbi new file mode 100644 index 0000000..85c8217 --- /dev/null +++ b/rbi/privy/models/kraken_embed_quote_executed_webhook_payload.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedQuoteExecutedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedQuoteExecutedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # ISO 8601 timestamp of when the quote was executed. + sig { returns(String) } + attr_accessor :executed_at + + # The ID of the executed quote. + sig { returns(String) } + attr_accessor :quote_id + + # The type of webhook event. + sig do + returns(Privy::KrakenEmbedQuoteExecutedWebhookPayload::Type::OrSymbol) + end + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # Payload for the kraken_embed.quote_executed webhook event. + sig do + params( + executed_at: String, + quote_id: String, + type: Privy::KrakenEmbedQuoteExecutedWebhookPayload::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # ISO 8601 timestamp of when the quote was executed. + executed_at:, + # The ID of the executed quote. + quote_id:, + # The type of webhook event. + type:, + # The ID of the user. + user_id: + ) + end + + sig do + override.returns( + { + executed_at: String, + quote_id: String, + type: Privy::KrakenEmbedQuoteExecutedWebhookPayload::Type::OrSymbol, + user_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::KrakenEmbedQuoteExecutedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KRAKEN_EMBED_QUOTE_EXECUTED = + T.let( + :"kraken_embed.quote.executed", + Privy::KrakenEmbedQuoteExecutedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedQuoteExecutedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rbi b/rbi/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rbi new file mode 100644 index 0000000..dcce61a --- /dev/null +++ b/rbi/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rbi @@ -0,0 +1,111 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedQuoteExecutionFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # ISO 8601 timestamp of when the quote execution failed. + sig { returns(String) } + attr_accessor :failed_at + + # The ID of the quote that failed to execute. + sig { returns(String) } + attr_accessor :quote_id + + # A human-readable description of why the quote execution failed. Intended for + # display and logging purposes only. + sig { returns(String) } + attr_accessor :reason + + # The type of webhook event. + sig do + returns( + Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type::OrSymbol + ) + end + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # Payload for the kraken_embed.quote.execution_failed webhook event. + sig do + params( + failed_at: String, + quote_id: String, + reason: String, + type: + Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # ISO 8601 timestamp of when the quote execution failed. + failed_at:, + # The ID of the quote that failed to execute. + quote_id:, + # A human-readable description of why the quote execution failed. Intended for + # display and logging purposes only. + reason:, + # The type of webhook event. + type:, + # The ID of the user. + user_id: + ) + end + + sig do + override.returns( + { + failed_at: String, + quote_id: String, + reason: String, + type: + Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type::OrSymbol, + user_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KRAKEN_EMBED_QUOTE_EXECUTION_FAILED = + T.let( + :"kraken_embed.quote.execution_failed", + Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedQuoteExecutionFailedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_user_closed_webhook_payload.rbi b/rbi/privy/models/kraken_embed_user_closed_webhook_payload.rbi new file mode 100644 index 0000000..7d76255 --- /dev/null +++ b/rbi/privy/models/kraken_embed_user_closed_webhook_payload.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedUserClosedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedUserClosedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # ISO 8601 timestamp of when the user was closed. + sig { returns(String) } + attr_accessor :closed_at + + # The type of webhook event. + sig do + returns(Privy::KrakenEmbedUserClosedWebhookPayload::Type::OrSymbol) + end + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # Payload for the kraken_embed.user.closed webhook event. + sig do + params( + closed_at: String, + type: Privy::KrakenEmbedUserClosedWebhookPayload::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # ISO 8601 timestamp of when the user was closed. + closed_at:, + # The type of webhook event. + type:, + # The ID of the user. + user_id: + ) + end + + sig do + override.returns( + { + closed_at: String, + type: Privy::KrakenEmbedUserClosedWebhookPayload::Type::OrSymbol, + user_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::KrakenEmbedUserClosedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KRAKEN_EMBED_USER_CLOSED = + T.let( + :"kraken_embed.user.closed", + Privy::KrakenEmbedUserClosedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedUserClosedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_user_disabled_webhook_payload.rbi b/rbi/privy/models/kraken_embed_user_disabled_webhook_payload.rbi new file mode 100644 index 0000000..ebb483c --- /dev/null +++ b/rbi/privy/models/kraken_embed_user_disabled_webhook_payload.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedUserDisabledWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedUserDisabledWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # ISO 8601 timestamp of when the user was disabled. + sig { returns(String) } + attr_accessor :disabled_at + + # The type of webhook event. + sig do + returns(Privy::KrakenEmbedUserDisabledWebhookPayload::Type::OrSymbol) + end + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # Payload for the kraken_embed.user.disabled webhook event. + sig do + params( + disabled_at: String, + type: Privy::KrakenEmbedUserDisabledWebhookPayload::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # ISO 8601 timestamp of when the user was disabled. + disabled_at:, + # The type of webhook event. + type:, + # The ID of the user. + user_id: + ) + end + + sig do + override.returns( + { + disabled_at: String, + type: Privy::KrakenEmbedUserDisabledWebhookPayload::Type::OrSymbol, + user_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::KrakenEmbedUserDisabledWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KRAKEN_EMBED_USER_DISABLED = + T.let( + :"kraken_embed.user.disabled", + Privy::KrakenEmbedUserDisabledWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedUserDisabledWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/kraken_embed_user_verified_webhook_payload.rbi b/rbi/privy/models/kraken_embed_user_verified_webhook_payload.rbi new file mode 100644 index 0000000..3a2dc60 --- /dev/null +++ b/rbi/privy/models/kraken_embed_user_verified_webhook_payload.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class KrakenEmbedUserVerifiedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::KrakenEmbedUserVerifiedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The type of webhook event. + sig do + returns(Privy::KrakenEmbedUserVerifiedWebhookPayload::Type::OrSymbol) + end + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # ISO 8601 timestamp of when the user was verified. + sig { returns(String) } + attr_accessor :verified_at + + # Payload for the kraken_embed.user.verified webhook event. + sig do + params( + type: Privy::KrakenEmbedUserVerifiedWebhookPayload::Type::OrSymbol, + user_id: String, + verified_at: String + ).returns(T.attached_class) + end + def self.new( + # The type of webhook event. + type:, + # The ID of the user. + user_id:, + # ISO 8601 timestamp of when the user was verified. + verified_at: + ) + end + + sig do + override.returns( + { + type: Privy::KrakenEmbedUserVerifiedWebhookPayload::Type::OrSymbol, + user_id: String, + verified_at: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::KrakenEmbedUserVerifiedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KRAKEN_EMBED_USER_VERIFIED = + T.let( + :"kraken_embed.user.verified", + Privy::KrakenEmbedUserVerifiedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::KrakenEmbedUserVerifiedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/link_jwt_input.rbi b/rbi/privy/models/link_jwt_input.rbi new file mode 100644 index 0000000..16c4e11 --- /dev/null +++ b/rbi/privy/models/link_jwt_input.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Privy + module Models + class LinkJwtInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::LinkJwtInput, Privy::Internal::AnyHash) } + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Input for linking a custom JWT account. + sig { params(token: String).returns(T.attached_class) } + def self.new(token: nil) + end + + sig { override.returns({ token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account.rbi b/rbi/privy/models/linked_account.rbi new file mode 100644 index 0000000..26fee69 --- /dev/null +++ b/rbi/privy/models/linked_account.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Privy + module Models + # A linked account for the user. + module LinkedAccount + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::LinkedAccountEmail, + Privy::LinkedAccountPhone, + Privy::LinkedAccountEthereum, + Privy::LinkedAccountSolana, + Privy::LinkedAccountSmartWallet, + Privy::LinkedAccountEthereumEmbeddedWallet, + Privy::LinkedAccountSolanaEmbeddedWallet, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet, + Privy::LinkedAccountCurveSigningEmbeddedWallet, + Privy::LinkedAccountGoogleOAuth, + Privy::LinkedAccountTwitterOAuth, + Privy::LinkedAccountDiscordOAuth, + Privy::LinkedAccountGitHubOAuth, + Privy::LinkedAccountSpotifyOAuth, + Privy::LinkedAccountInstagramOAuth, + Privy::LinkedAccountTiktokOAuth, + Privy::LinkedAccountLineOAuth, + Privy::LinkedAccountTwitchOAuth, + Privy::LinkedAccountLinkedInOAuth, + Privy::LinkedAccountAppleOAuth, + Privy::LinkedAccountCustomOAuth, + Privy::LinkedAccountCustomJwt, + Privy::LinkedAccountFarcaster, + Privy::LinkedAccountPasskey, + Privy::LinkedAccountTelegram, + Privy::LinkedAccountCrossApp, + Privy::LinkedAccountAuthorizationKey + ) + end + + sig { override.returns(T::Array[Privy::LinkedAccount::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/linked_account_apple_input.rbi b/rbi/privy/models/linked_account_apple_input.rbi new file mode 100644 index 0000000..9f324ab --- /dev/null +++ b/rbi/privy/models/linked_account_apple_input.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountAppleInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountAppleInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The payload for importing an Apple account. + sig do + params(subject: String, email: String, type: Symbol).returns( + T.attached_class + ) + end + def self.new(subject:, email: nil, type: :apple_oauth) + end + + sig { override.returns({ subject: String, type: Symbol, email: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_apple_oauth.rbi b/rbi/privy/models/linked_account_apple_oauth.rbi new file mode 100644 index 0000000..ebb9930 --- /dev/null +++ b/rbi/privy/models/linked_account_apple_oauth.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountAppleOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountAppleOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountAppleOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # An Apple OAuth account linked to the user. + sig do + params( + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountAppleOAuth::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + email:, + first_verified_at:, + latest_verified_at:, + subject:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountAppleOAuth::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountAppleOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + APPLE_OAUTH = + T.let( + :apple_oauth, + Privy::LinkedAccountAppleOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountAppleOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_authorization_key.rbi b/rbi/privy/models/linked_account_authorization_key.rbi new file mode 100644 index 0000000..60ea87e --- /dev/null +++ b/rbi/privy/models/linked_account_authorization_key.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountAuthorizationKey < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountAuthorizationKey, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :public_key + + sig { returns(Privy::LinkedAccountAuthorizationKey::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # An authorization key linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + public_key: String, + type: Privy::LinkedAccountAuthorizationKey::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + public_key:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + public_key: String, + type: Privy::LinkedAccountAuthorizationKey::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountAuthorizationKey::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AUTHORIZATION_KEY = + T.let( + :authorization_key, + Privy::LinkedAccountAuthorizationKey::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountAuthorizationKey::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_base_wallet.rbi b/rbi/privy/models/linked_account_base_wallet.rbi new file mode 100644 index 0000000..8d038f2 --- /dev/null +++ b/rbi/privy/models/linked_account_base_wallet.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountBaseWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountBaseWallet, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::LinkedAccountBaseWallet::ChainType::TaggedSymbol) } + attr_accessor :chain_type + + sig { returns(Privy::LinkedAccountBaseWallet::Type::TaggedSymbol) } + attr_accessor :type + + # Base schema for wallet accounts linked to the user. + sig do + params( + address: String, + chain_type: Privy::LinkedAccountBaseWallet::ChainType::OrSymbol, + type: Privy::LinkedAccountBaseWallet::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(address:, chain_type:, type:) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::LinkedAccountBaseWallet::ChainType::TaggedSymbol, + type: Privy::LinkedAccountBaseWallet::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountBaseWallet::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA = + T.let( + :solana, + Privy::LinkedAccountBaseWallet::ChainType::TaggedSymbol + ) + ETHEREUM = + T.let( + :ethereum, + Privy::LinkedAccountBaseWallet::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountBaseWallet::ChainType::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountBaseWallet::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let(:wallet, Privy::LinkedAccountBaseWallet::Type::TaggedSymbol) + SMART_WALLET = + T.let( + :smart_wallet, + Privy::LinkedAccountBaseWallet::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountBaseWallet::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rbi b/rbi/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rbi new file mode 100644 index 0000000..a6df693 --- /dev/null +++ b/rbi/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rbi @@ -0,0 +1,302 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountBitcoinSegwitEmbeddedWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :chain_id + + sig do + returns( + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType::TaggedSymbol + ) + end + attr_accessor :chain_type + + sig do + returns( + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType::TaggedSymbol + ) + end + attr_accessor :connector_type + + sig { returns(T::Boolean) } + attr_accessor :delegated + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T::Boolean) } + attr_accessor :imported + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :public_key + + # The method used to recover an embedded wallet account. + sig { returns(Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) } + attr_accessor :recovery_method + + sig do + returns( + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig do + returns( + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient::TaggedSymbol + ) + end + attr_accessor :wallet_client + + sig do + returns( + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType::TaggedSymbol + ) + end + attr_accessor :wallet_client_type + + sig { returns(Float) } + attr_accessor :wallet_index + + # A Bitcoin SegWit embedded wallet account linked to the user. + sig do + params( + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType::OrSymbol, + connector_type: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType::OrSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::OrSymbol, + type: Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::Type::OrSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient::OrSymbol, + wallet_client_type: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType::OrSymbol, + wallet_index: Float + ).returns(T.attached_class) + end + def self.new( + id:, + address:, + chain_id:, + chain_type:, + connector_type:, + delegated:, + first_verified_at:, + imported:, + latest_verified_at:, + public_key:, + # The method used to recover an embedded wallet account. + recovery_method:, + type:, + verified_at:, + wallet_client:, + wallet_client_type:, + wallet_index: + ) + end + + sig do + override.returns( + { + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType::TaggedSymbol, + connector_type: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType::TaggedSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol, + type: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::Type::TaggedSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient::TaggedSymbol, + wallet_client_type: + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType::TaggedSymbol, + wallet_index: Float + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BITCOIN_SEGWIT = + T.let( + :"bitcoin-segwit", + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ConnectorType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMBEDDED = + T.let( + :embedded, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::ConnectorType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let( + :wallet, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClient + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClient::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClientType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::WalletClientType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rbi b/rbi/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rbi new file mode 100644 index 0000000..ff0caa1 --- /dev/null +++ b/rbi/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rbi @@ -0,0 +1,306 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountBitcoinTaprootEmbeddedWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :chain_id + + sig do + returns( + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType::TaggedSymbol + ) + end + attr_accessor :chain_type + + sig do + returns( + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType::TaggedSymbol + ) + end + attr_accessor :connector_type + + sig { returns(T::Boolean) } + attr_accessor :delegated + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T::Boolean) } + attr_accessor :imported + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :public_key + + # The method used to recover an embedded wallet account. + sig { returns(Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) } + attr_accessor :recovery_method + + sig do + returns( + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig do + returns( + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient::TaggedSymbol + ) + end + attr_accessor :wallet_client + + sig do + returns( + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType::TaggedSymbol + ) + end + attr_accessor :wallet_client_type + + sig { returns(Float) } + attr_accessor :wallet_index + + # A Bitcoin Taproot embedded wallet account linked to the user. + sig do + params( + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType::OrSymbol, + connector_type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType::OrSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::OrSymbol, + type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::Type::OrSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient::OrSymbol, + wallet_client_type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType::OrSymbol, + wallet_index: Float + ).returns(T.attached_class) + end + def self.new( + id:, + address:, + chain_id:, + chain_type:, + connector_type:, + delegated:, + first_verified_at:, + imported:, + latest_verified_at:, + public_key:, + # The method used to recover an embedded wallet account. + recovery_method:, + type:, + verified_at:, + wallet_client:, + wallet_client_type:, + wallet_index: + ) + end + + sig do + override.returns( + { + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType::TaggedSymbol, + connector_type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType::TaggedSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol, + type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::Type::TaggedSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient::TaggedSymbol, + wallet_client_type: + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType::TaggedSymbol, + wallet_index: Float + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BITCOIN_TAPROOT = + T.let( + :"bitcoin-taproot", + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ConnectorType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMBEDDED = + T.let( + :embedded, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::ConnectorType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let( + :wallet, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClient + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClient::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClientType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::WalletClientType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_cross_app.rbi b/rbi/privy/models/linked_account_cross_app.rbi new file mode 100644 index 0000000..f4f7860 --- /dev/null +++ b/rbi/privy/models/linked_account_cross_app.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountCrossApp < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountCrossApp, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[Privy::CrossAppEmbeddedWallet]) } + attr_accessor :embedded_wallets + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :provider_app_id + + sig { returns(T::Array[Privy::CrossAppSmartWallet]) } + attr_accessor :smart_wallets + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountCrossApp::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A cross-app account linked to the user. + sig do + params( + embedded_wallets: T::Array[Privy::CrossAppEmbeddedWallet::OrHash], + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + provider_app_id: String, + smart_wallets: T::Array[Privy::CrossAppSmartWallet::OrHash], + subject: String, + type: Privy::LinkedAccountCrossApp::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + embedded_wallets:, + first_verified_at:, + latest_verified_at:, + provider_app_id:, + smart_wallets:, + subject:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + embedded_wallets: T::Array[Privy::CrossAppEmbeddedWallet], + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + provider_app_id: String, + smart_wallets: T::Array[Privy::CrossAppSmartWallet], + subject: String, + type: Privy::LinkedAccountCrossApp::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountCrossApp::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CROSS_APP = + T.let(:cross_app, Privy::LinkedAccountCrossApp::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountCrossApp::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_curve_signing_embedded_wallet.rbi b/rbi/privy/models/linked_account_curve_signing_embedded_wallet.rbi new file mode 100644 index 0000000..a6fe712 --- /dev/null +++ b/rbi/privy/models/linked_account_curve_signing_embedded_wallet.rbi @@ -0,0 +1,269 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountCurveSigningEmbeddedWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountCurveSigningEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :chain_id + + # The wallet chain types that support curve-based signing. + sig { returns(Privy::CurveSigningChainType::TaggedSymbol) } + attr_accessor :chain_type + + sig do + returns( + Privy::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType::TaggedSymbol + ) + end + attr_accessor :connector_type + + sig { returns(T::Boolean) } + attr_accessor :delegated + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T::Boolean) } + attr_accessor :imported + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :public_key + + # The method used to recover an embedded wallet account. + sig { returns(Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) } + attr_accessor :recovery_method + + sig do + returns( + Privy::LinkedAccountCurveSigningEmbeddedWallet::Type::TaggedSymbol + ) + end + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig do + returns( + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClient::TaggedSymbol + ) + end + attr_accessor :wallet_client + + sig do + returns( + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType::TaggedSymbol + ) + end + attr_accessor :wallet_client_type + + sig { returns(Float) } + attr_accessor :wallet_index + + # A curve signing embedded wallet account linked to the user. + sig do + params( + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: Privy::CurveSigningChainType::OrSymbol, + connector_type: + Privy::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType::OrSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::OrSymbol, + type: Privy::LinkedAccountCurveSigningEmbeddedWallet::Type::OrSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClient::OrSymbol, + wallet_client_type: + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType::OrSymbol, + wallet_index: Float + ).returns(T.attached_class) + end + def self.new( + id:, + address:, + chain_id:, + # The wallet chain types that support curve-based signing. + chain_type:, + connector_type:, + delegated:, + first_verified_at:, + imported:, + latest_verified_at:, + public_key:, + # The method used to recover an embedded wallet account. + recovery_method:, + type:, + verified_at:, + wallet_client:, + wallet_client_type:, + wallet_index: + ) + end + + sig do + override.returns( + { + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: Privy::CurveSigningChainType::TaggedSymbol, + connector_type: + Privy::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType::TaggedSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol, + type: + Privy::LinkedAccountCurveSigningEmbeddedWallet::Type::TaggedSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClient::TaggedSymbol, + wallet_client_type: + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType::TaggedSymbol, + wallet_index: Float + } + ) + end + def to_hash + end + + module ConnectorType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMBEDDED = + T.let( + :embedded, + Privy::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountCurveSigningEmbeddedWallet::ConnectorType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountCurveSigningEmbeddedWallet::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let( + :wallet, + Privy::LinkedAccountCurveSigningEmbeddedWallet::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountCurveSigningEmbeddedWallet::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClient + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClient + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClient::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClient::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClientType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountCurveSigningEmbeddedWallet::WalletClientType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_custom_jwt.rbi b/rbi/privy/models/linked_account_custom_jwt.rbi new file mode 100644 index 0000000..0052d76 --- /dev/null +++ b/rbi/privy/models/linked_account_custom_jwt.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountCustomJwt < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountCustomJwt, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :custom_user_id + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(Privy::LinkedAccountCustomJwt::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A custom JWT account linked to the user. + sig do + params( + custom_user_id: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountCustomJwt::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + custom_user_id:, + first_verified_at:, + latest_verified_at:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + custom_user_id: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountCustomJwt::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountCustomJwt::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CUSTOM_AUTH = + T.let(:custom_auth, Privy::LinkedAccountCustomJwt::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountCustomJwt::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_custom_jwt_input.rbi b/rbi/privy/models/linked_account_custom_jwt_input.rbi new file mode 100644 index 0000000..989f6c9 --- /dev/null +++ b/rbi/privy/models/linked_account_custom_jwt_input.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountCustomJwtInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountCustomJwtInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :custom_user_id + + sig { returns(Symbol) } + attr_accessor :type + + # The payload for importing a Custom JWT account. + sig do + params(custom_user_id: String, type: Symbol).returns(T.attached_class) + end + def self.new(custom_user_id:, type: :custom_auth) + end + + sig { override.returns({ custom_user_id: String, type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_custom_oauth.rbi b/rbi/privy/models/linked_account_custom_oauth.rbi new file mode 100644 index 0000000..f24e6fb --- /dev/null +++ b/rbi/privy/models/linked_account_custom_oauth.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountCustomOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountCustomOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :subject + + # The ID of a custom OAuth provider, set up for this app. Must start with + # "custom:". + sig { returns(String) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture_url + + sig { params(profile_picture_url: String).void } + attr_writer :profile_picture_url + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # A custom OAuth account linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: String, + verified_at: Float, + email: String, + name: String, + profile_picture_url: String, + username: String + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + subject:, + # The ID of a custom OAuth provider, set up for this app. Must start with + # "custom:". + type:, + verified_at:, + email: nil, + name: nil, + profile_picture_url: nil, + username: nil + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: String, + verified_at: Float, + email: String, + name: String, + profile_picture_url: String, + username: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_discord_input.rbi b/rbi/privy/models/linked_account_discord_input.rbi new file mode 100644 index 0000000..5d58932 --- /dev/null +++ b/rbi/privy/models/linked_account_discord_input.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountDiscordInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountDiscordInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :username + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # The payload for importing a Discord account. + sig do + params( + subject: String, + username: String, + email: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new(subject:, username:, email: nil, type: :discord_oauth) + end + + sig do + override.returns( + { subject: String, type: Symbol, username: String, email: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_discord_oauth.rbi b/rbi/privy/models/linked_account_discord_oauth.rbi new file mode 100644 index 0000000..94ae4c4 --- /dev/null +++ b/rbi/privy/models/linked_account_discord_oauth.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountDiscordOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountDiscordOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountDiscordOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig { returns(Float) } + attr_accessor :verified_at + + # A Discord OAuth account linked to the user. + sig do + params( + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountDiscordOAuth::Type::OrSymbol, + username: T.nilable(String), + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + email:, + first_verified_at:, + latest_verified_at:, + subject:, + type:, + username:, + verified_at: + ) + end + + sig do + override.returns( + { + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountDiscordOAuth::Type::TaggedSymbol, + username: T.nilable(String), + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountDiscordOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DISCORD_OAUTH = + T.let( + :discord_oauth, + Privy::LinkedAccountDiscordOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountDiscordOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_email.rbi b/rbi/privy/models/linked_account_email.rbi new file mode 100644 index 0000000..e4980bf --- /dev/null +++ b/rbi/privy/models/linked_account_email.rbi @@ -0,0 +1,78 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountEmail < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountEmail, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(Privy::LinkedAccountEmail::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # An email account linked to the user. + sig do + params( + address: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountEmail::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + address:, + first_verified_at:, + latest_verified_at:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + address: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountEmail::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountEmail::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL = T.let(:email, Privy::LinkedAccountEmail::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountEmail::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_email_input.rbi b/rbi/privy/models/linked_account_email_input.rbi new file mode 100644 index 0000000..972edc2 --- /dev/null +++ b/rbi/privy/models/linked_account_email_input.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountEmailInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountEmailInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Symbol) } + attr_accessor :type + + # The payload for importing an email account. + sig { params(address: String, type: Symbol).returns(T.attached_class) } + def self.new(address:, type: :email) + end + + sig { override.returns({ address: String, type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_embedded_wallet.rbi b/rbi/privy/models/linked_account_embedded_wallet.rbi new file mode 100644 index 0000000..f5a5f4c --- /dev/null +++ b/rbi/privy/models/linked_account_embedded_wallet.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + module LinkedAccountEmbeddedWallet + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::LinkedAccountEthereumEmbeddedWallet, + Privy::LinkedAccountSolanaEmbeddedWallet, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet, + Privy::LinkedAccountCurveSigningEmbeddedWallet + ) + end + + sig do + override.returns(T::Array[Privy::LinkedAccountEmbeddedWallet::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/linked_account_embedded_wallet_with_id.rbi b/rbi/privy/models/linked_account_embedded_wallet_with_id.rbi new file mode 100644 index 0000000..df94109 --- /dev/null +++ b/rbi/privy/models/linked_account_embedded_wallet_with_id.rbi @@ -0,0 +1,389 @@ +# typed: strong + +module Privy + module Models + # An embedded wallet account with an ID. + module LinkedAccountEmbeddedWalletWithID + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet + ) + end + + class LinkedAccountEthereumEmbeddedWallet < Privy::Models::LinkedAccountEthereumEmbeddedWallet + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod::OrSymbol + ) + end + attr_accessor :recovery_method + + # An Ethereum embedded wallet account linked to the user. + sig do + params( + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, recovery_method:) + end + + sig do + override.returns( + { + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod::OrSymbol + } + ) + end + def to_hash + end + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY_V2 = + T.let( + :"privy-v2", + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::RecoveryMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LinkedAccountSolanaEmbeddedWallet < Privy::Models::LinkedAccountSolanaEmbeddedWallet + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod::OrSymbol + ) + end + attr_accessor :recovery_method + + # A Solana embedded wallet account linked to the user. + sig do + params( + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, recovery_method:) + end + + sig do + override.returns( + { + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod::OrSymbol + } + ) + end + def to_hash + end + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY_V2 = + T.let( + :"privy-v2", + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::RecoveryMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LinkedAccountBitcoinSegwitEmbeddedWallet < Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod::OrSymbol + ) + end + attr_accessor :recovery_method + + # A Bitcoin SegWit embedded wallet account linked to the user. + sig do + params( + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, recovery_method:) + end + + sig do + override.returns( + { + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod::OrSymbol + } + ) + end + def to_hash + end + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY_V2 = + T.let( + :"privy-v2", + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::RecoveryMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LinkedAccountBitcoinTaprootEmbeddedWallet < Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod::OrSymbol + ) + end + attr_accessor :recovery_method + + # A Bitcoin Taproot embedded wallet account linked to the user. + sig do + params( + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, recovery_method:) + end + + sig do + override.returns( + { + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod::OrSymbol + } + ) + end + def to_hash + end + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY_V2 = + T.let( + :"privy-v2", + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::RecoveryMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + class LinkedAccountCurveSigningEmbeddedWallet < Privy::Models::LinkedAccountCurveSigningEmbeddedWallet + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig do + returns( + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod::OrSymbol + ) + end + attr_accessor :recovery_method + + # A curve signing embedded wallet account linked to the user. + sig do + params( + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod::OrSymbol + ).returns(T.attached_class) + end + def self.new(id:, recovery_method:) + end + + sig do + override.returns( + { + id: String, + recovery_method: + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod::OrSymbol + } + ) + end + def to_hash + end + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY_V2 = + T.let( + :"privy-v2", + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::RecoveryMethod::TaggedSymbol + ] + ) + end + def self.values + end + end + end + + sig do + override.returns( + T::Array[Privy::LinkedAccountEmbeddedWalletWithID::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/linked_account_ethereum.rbi b/rbi/privy/models/linked_account_ethereum.rbi new file mode 100644 index 0000000..0906ca7 --- /dev/null +++ b/rbi/privy/models/linked_account_ethereum.rbi @@ -0,0 +1,167 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountEthereum < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountEthereum, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::LinkedAccountEthereum::ChainType::TaggedSymbol) } + attr_accessor :chain_type + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(Privy::LinkedAccountEthereum::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(Privy::LinkedAccountEthereum::WalletClient::TaggedSymbol) } + attr_accessor :wallet_client + + sig { returns(T.nilable(String)) } + attr_reader :chain_id + + sig { params(chain_id: String).void } + attr_writer :chain_id + + sig { returns(T.nilable(String)) } + attr_reader :connector_type + + sig { params(connector_type: String).void } + attr_writer :connector_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_client_type + + sig { params(wallet_client_type: String).void } + attr_writer :wallet_client_type + + # An Ethereum wallet account linked to the user. + sig do + params( + address: String, + chain_type: Privy::LinkedAccountEthereum::ChainType::OrSymbol, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountEthereum::Type::OrSymbol, + verified_at: Float, + wallet_client: Privy::LinkedAccountEthereum::WalletClient::OrSymbol, + chain_id: String, + connector_type: String, + wallet_client_type: String + ).returns(T.attached_class) + end + def self.new( + address:, + chain_type:, + first_verified_at:, + latest_verified_at:, + type:, + verified_at:, + wallet_client:, + chain_id: nil, + connector_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::LinkedAccountEthereum::ChainType::TaggedSymbol, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountEthereum::Type::TaggedSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountEthereum::WalletClient::TaggedSymbol, + chain_id: String, + connector_type: String, + wallet_client_type: String + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountEthereum::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::LinkedAccountEthereum::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountEthereum::ChainType::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountEthereum::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let(:wallet, Privy::LinkedAccountEthereum::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountEthereum::Type::TaggedSymbol] + ) + end + def self.values + end + end + + module WalletClient + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountEthereum::WalletClient) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UNKNOWN = + T.let( + :unknown, + Privy::LinkedAccountEthereum::WalletClient::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountEthereum::WalletClient::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_ethereum_embedded_wallet.rbi b/rbi/privy/models/linked_account_ethereum_embedded_wallet.rbi new file mode 100644 index 0000000..6b0b35e --- /dev/null +++ b/rbi/privy/models/linked_account_ethereum_embedded_wallet.rbi @@ -0,0 +1,291 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountEthereumEmbeddedWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountEthereumEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :chain_id + + sig do + returns( + Privy::LinkedAccountEthereumEmbeddedWallet::ChainType::TaggedSymbol + ) + end + attr_accessor :chain_type + + sig do + returns( + Privy::LinkedAccountEthereumEmbeddedWallet::ConnectorType::TaggedSymbol + ) + end + attr_accessor :connector_type + + sig { returns(T::Boolean) } + attr_accessor :delegated + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T::Boolean) } + attr_accessor :imported + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + # The method used to recover an embedded wallet account. + sig { returns(Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) } + attr_accessor :recovery_method + + sig do + returns(Privy::LinkedAccountEthereumEmbeddedWallet::Type::TaggedSymbol) + end + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig do + returns( + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClient::TaggedSymbol + ) + end + attr_accessor :wallet_client + + sig do + returns( + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClientType::TaggedSymbol + ) + end + attr_accessor :wallet_client_type + + sig { returns(Float) } + attr_accessor :wallet_index + + # An Ethereum embedded wallet account linked to the user. + sig do + params( + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountEthereumEmbeddedWallet::ChainType::OrSymbol, + connector_type: + Privy::LinkedAccountEthereumEmbeddedWallet::ConnectorType::OrSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + recovery_method: Privy::EmbeddedWalletRecoveryMethod::OrSymbol, + type: Privy::LinkedAccountEthereumEmbeddedWallet::Type::OrSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClient::OrSymbol, + wallet_client_type: + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClientType::OrSymbol, + wallet_index: Float + ).returns(T.attached_class) + end + def self.new( + id:, + address:, + chain_id:, + chain_type:, + connector_type:, + delegated:, + first_verified_at:, + imported:, + latest_verified_at:, + # The method used to recover an embedded wallet account. + recovery_method:, + type:, + verified_at:, + wallet_client:, + wallet_client_type:, + wallet_index: + ) + end + + sig do + override.returns( + { + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountEthereumEmbeddedWallet::ChainType::TaggedSymbol, + connector_type: + Privy::LinkedAccountEthereumEmbeddedWallet::ConnectorType::TaggedSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + recovery_method: Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol, + type: + Privy::LinkedAccountEthereumEmbeddedWallet::Type::TaggedSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClient::TaggedSymbol, + wallet_client_type: + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClientType::TaggedSymbol, + wallet_index: Float + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountEthereumEmbeddedWallet::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::LinkedAccountEthereumEmbeddedWallet::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEthereumEmbeddedWallet::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ConnectorType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEthereumEmbeddedWallet::ConnectorType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMBEDDED = + T.let( + :embedded, + Privy::LinkedAccountEthereumEmbeddedWallet::ConnectorType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEthereumEmbeddedWallet::ConnectorType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountEthereumEmbeddedWallet::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let( + :wallet, + Privy::LinkedAccountEthereumEmbeddedWallet::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEthereumEmbeddedWallet::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClient + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClient + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClient::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClient::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClientType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClientType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClientType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountEthereumEmbeddedWallet::WalletClientType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_farcaster.rbi b/rbi/privy/models/linked_account_farcaster.rbi new file mode 100644 index 0000000..376d1df --- /dev/null +++ b/rbi/privy/models/linked_account_farcaster.rbi @@ -0,0 +1,148 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountFarcaster < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountFarcaster, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :fid + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :owner_address + + sig { returns(Privy::LinkedAccountFarcaster::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(T.nilable(String)) } + attr_reader :bio + + sig { params(bio: String).void } + attr_writer :bio + + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + sig { returns(T.nilable(String)) } + attr_reader :homepage_url + + sig { params(homepage_url: String).void } + attr_writer :homepage_url + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture + + sig { params(profile_picture: String).void } + attr_writer :profile_picture + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture_url + + sig { params(profile_picture_url: String).void } + attr_writer :profile_picture_url + + sig { returns(T.nilable(String)) } + attr_reader :signer_public_key + + sig { params(signer_public_key: String).void } + attr_writer :signer_public_key + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # A Farcaster account linked to the user. + sig do + params( + fid: Float, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + owner_address: String, + type: Privy::LinkedAccountFarcaster::Type::OrSymbol, + verified_at: Float, + bio: String, + display_name: String, + homepage_url: String, + profile_picture: String, + profile_picture_url: String, + signer_public_key: String, + username: String + ).returns(T.attached_class) + end + def self.new( + fid:, + first_verified_at:, + latest_verified_at:, + owner_address:, + type:, + verified_at:, + bio: nil, + display_name: nil, + homepage_url: nil, + profile_picture: nil, + profile_picture_url: nil, + signer_public_key: nil, + username: nil + ) + end + + sig do + override.returns( + { + fid: Float, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + owner_address: String, + type: Privy::LinkedAccountFarcaster::Type::TaggedSymbol, + verified_at: Float, + bio: String, + display_name: String, + homepage_url: String, + profile_picture: String, + profile_picture_url: String, + signer_public_key: String, + username: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountFarcaster::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FARCASTER = + T.let(:farcaster, Privy::LinkedAccountFarcaster::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountFarcaster::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_farcaster_input.rbi b/rbi/privy/models/linked_account_farcaster_input.rbi new file mode 100644 index 0000000..599728b --- /dev/null +++ b/rbi/privy/models/linked_account_farcaster_input.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountFarcasterInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountFarcasterInput, Privy::Internal::AnyHash) + end + + sig { returns(Integer) } + attr_accessor :fid + + sig { returns(String) } + attr_accessor :owner_address + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :bio + + sig { params(bio: String).void } + attr_writer :bio + + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + sig { returns(T.nilable(String)) } + attr_reader :homepage_url + + sig { params(homepage_url: String).void } + attr_writer :homepage_url + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture_url + + sig { params(profile_picture_url: String).void } + attr_writer :profile_picture_url + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # The payload for importing a Farcaster account. + sig do + params( + fid: Integer, + owner_address: String, + bio: String, + display_name: String, + homepage_url: String, + profile_picture_url: String, + username: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + fid:, + owner_address:, + bio: nil, + display_name: nil, + homepage_url: nil, + profile_picture_url: nil, + username: nil, + type: :farcaster + ) + end + + sig do + override.returns( + { + fid: Integer, + owner_address: String, + type: Symbol, + bio: String, + display_name: String, + homepage_url: String, + profile_picture_url: String, + username: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_github_input.rbi b/rbi/privy/models/linked_account_github_input.rbi new file mode 100644 index 0000000..a3505c1 --- /dev/null +++ b/rbi/privy/models/linked_account_github_input.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountGitHubInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountGitHubInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :username + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The payload for importing a Github account. + sig do + params( + subject: String, + username: String, + email: String, + name: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + subject:, + username:, + email: nil, + name: nil, + type: :github_oauth + ) + end + + sig do + override.returns( + { + subject: String, + type: Symbol, + username: String, + email: String, + name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_github_oauth.rbi b/rbi/privy/models/linked_account_github_oauth.rbi new file mode 100644 index 0000000..47b2a0f --- /dev/null +++ b/rbi/privy/models/linked_account_github_oauth.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountGitHubOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountGitHubOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountGitHubOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig { returns(Float) } + attr_accessor :verified_at + + # A GitHub OAuth account linked to the user. + sig do + params( + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountGitHubOAuth::Type::OrSymbol, + username: T.nilable(String), + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + email:, + first_verified_at:, + latest_verified_at:, + name:, + subject:, + type:, + username:, + verified_at: + ) + end + + sig do + override.returns( + { + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountGitHubOAuth::Type::TaggedSymbol, + username: T.nilable(String), + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountGitHubOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GITHUB_OAUTH = + T.let( + :github_oauth, + Privy::LinkedAccountGitHubOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountGitHubOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_google_input.rbi b/rbi/privy/models/linked_account_google_input.rbi new file mode 100644 index 0000000..d0c15ca --- /dev/null +++ b/rbi/privy/models/linked_account_google_input.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountGoogleInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountGoogleInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :email + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + # The payload for importing a Google account. + sig do + params( + email: String, + name: String, + subject: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new(email:, name:, subject:, type: :google_oauth) + end + + sig do + override.returns( + { email: String, name: String, subject: String, type: Symbol } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_google_oauth.rbi b/rbi/privy/models/linked_account_google_oauth.rbi new file mode 100644 index 0000000..e0ac931 --- /dev/null +++ b/rbi/privy/models/linked_account_google_oauth.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountGoogleOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountGoogleOAuth, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :email + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountGoogleOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A Google OAuth account linked to the user. + sig do + params( + email: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountGoogleOAuth::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + email:, + first_verified_at:, + latest_verified_at:, + name:, + subject:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + email: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountGoogleOAuth::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountGoogleOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GOOGLE_OAUTH = + T.let( + :google_oauth, + Privy::LinkedAccountGoogleOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountGoogleOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_input.rbi b/rbi/privy/models/linked_account_input.rbi new file mode 100644 index 0000000..81ff2bb --- /dev/null +++ b/rbi/privy/models/linked_account_input.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + # The input for adding a linked account to a user. + module LinkedAccountInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::LinkedAccountWalletInput, + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountPhoneInput, + Privy::LinkedAccountGoogleInput, + Privy::LinkedAccountTwitterInput, + Privy::LinkedAccountDiscordInput, + Privy::LinkedAccountGitHubInput, + Privy::LinkedAccountSpotifyInput, + Privy::LinkedAccountInstagramInput, + Privy::LinkedAccountTiktokInput, + Privy::LinkedAccountLineInput, + Privy::LinkedAccountTwitchInput, + Privy::LinkedAccountAppleInput, + Privy::LinkedAccountLinkedInInput, + Privy::LinkedAccountFarcasterInput, + Privy::LinkedAccountTelegramInput, + Privy::LinkedAccountCustomJwtInput, + Privy::LinkedAccountPasskeyInput + ) + end + + sig { override.returns(T::Array[Privy::LinkedAccountInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/linked_account_instagram_input.rbi b/rbi/privy/models/linked_account_instagram_input.rbi new file mode 100644 index 0000000..82a5de6 --- /dev/null +++ b/rbi/privy/models/linked_account_instagram_input.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountInstagramInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountInstagramInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :username + + # The payload for importing an Instagram account. + sig do + params(subject: String, username: String, type: Symbol).returns( + T.attached_class + ) + end + def self.new(subject:, username:, type: :instagram_oauth) + end + + sig do + override.returns({ subject: String, type: Symbol, username: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_instagram_oauth.rbi b/rbi/privy/models/linked_account_instagram_oauth.rbi new file mode 100644 index 0000000..4169a35 --- /dev/null +++ b/rbi/privy/models/linked_account_instagram_oauth.rbi @@ -0,0 +1,90 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountInstagramOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountInstagramOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountInstagramOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig { returns(Float) } + attr_accessor :verified_at + + # An Instagram OAuth account linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountInstagramOAuth::Type::OrSymbol, + username: T.nilable(String), + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + subject:, + type:, + username:, + verified_at: + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountInstagramOAuth::Type::TaggedSymbol, + username: T.nilable(String), + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountInstagramOAuth::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INSTAGRAM_OAUTH = + T.let( + :instagram_oauth, + Privy::LinkedAccountInstagramOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountInstagramOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_line_input.rbi b/rbi/privy/models/linked_account_line_input.rbi new file mode 100644 index 0000000..b4d47c1 --- /dev/null +++ b/rbi/privy/models/linked_account_line_input.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountLineInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountLineInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture_url + + sig { params(profile_picture_url: String).void } + attr_writer :profile_picture_url + + # The payload for importing a LINE account. + sig do + params( + subject: String, + email: String, + name: String, + profile_picture_url: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + subject:, + email: nil, + name: nil, + profile_picture_url: nil, + type: :line_oauth + ) + end + + sig do + override.returns( + { + subject: String, + type: Symbol, + email: String, + name: String, + profile_picture_url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_line_oauth.rbi b/rbi/privy/models/linked_account_line_oauth.rbi new file mode 100644 index 0000000..b1ce3ea --- /dev/null +++ b/rbi/privy/models/linked_account_line_oauth.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountLineOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountLineOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountLineOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A LINE OAuth account linked to the user. + sig do + params( + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + profile_picture_url: T.nilable(String), + subject: String, + type: Privy::LinkedAccountLineOAuth::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + email:, + first_verified_at:, + latest_verified_at:, + name:, + profile_picture_url:, + subject:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + profile_picture_url: T.nilable(String), + subject: String, + type: Privy::LinkedAccountLineOAuth::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountLineOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LINE_OAUTH = + T.let(:line_oauth, Privy::LinkedAccountLineOAuth::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountLineOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_linked_in_input.rbi b/rbi/privy/models/linked_account_linked_in_input.rbi new file mode 100644 index 0000000..479b49c --- /dev/null +++ b/rbi/privy/models/linked_account_linked_in_input.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountLinkedInInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountLinkedInInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :vanity_name + + sig { params(vanity_name: String).void } + attr_writer :vanity_name + + # The payload for importing a LinkedIn account. + sig do + params( + subject: String, + email: String, + name: String, + vanity_name: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + subject:, + email: nil, + name: nil, + vanity_name: nil, + type: :linkedin_oauth + ) + end + + sig do + override.returns( + { + subject: String, + type: Symbol, + email: String, + name: String, + vanity_name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_linked_in_oauth.rbi b/rbi/privy/models/linked_account_linked_in_oauth.rbi new file mode 100644 index 0000000..57ac772 --- /dev/null +++ b/rbi/privy/models/linked_account_linked_in_oauth.rbi @@ -0,0 +1,108 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountLinkedInOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountLinkedInOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountLinkedInOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :vanity_name + + sig { params(vanity_name: String).void } + attr_writer :vanity_name + + # A LinkedIn OAuth account linked to the user. + sig do + params( + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountLinkedInOAuth::Type::OrSymbol, + verified_at: Float, + name: String, + vanity_name: String + ).returns(T.attached_class) + end + def self.new( + email:, + first_verified_at:, + latest_verified_at:, + subject:, + type:, + verified_at:, + name: nil, + vanity_name: nil + ) + end + + sig do + override.returns( + { + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountLinkedInOAuth::Type::TaggedSymbol, + verified_at: Float, + name: String, + vanity_name: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountLinkedInOAuth::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LINKEDIN_OAUTH = + T.let( + :linkedin_oauth, + Privy::LinkedAccountLinkedInOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountLinkedInOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_passkey.rbi b/rbi/privy/models/linked_account_passkey.rbi new file mode 100644 index 0000000..2b3e674 --- /dev/null +++ b/rbi/privy/models/linked_account_passkey.rbi @@ -0,0 +1,130 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountPasskey < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountPasskey, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :credential_id + + sig { returns(T::Boolean) } + attr_accessor :enrolled_in_mfa + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(Privy::LinkedAccountPasskey::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(T.nilable(String)) } + attr_reader :authenticator_name + + sig { params(authenticator_name: String).void } + attr_writer :authenticator_name + + sig { returns(T.nilable(String)) } + attr_reader :created_with_browser + + sig { params(created_with_browser: String).void } + attr_writer :created_with_browser + + sig { returns(T.nilable(String)) } + attr_reader :created_with_device + + sig { params(created_with_device: String).void } + attr_writer :created_with_device + + sig { returns(T.nilable(String)) } + attr_reader :created_with_os + + sig { params(created_with_os: String).void } + attr_writer :created_with_os + + sig { returns(T.nilable(String)) } + attr_reader :public_key + + sig { params(public_key: String).void } + attr_writer :public_key + + # A passkey account linked to the user. + sig do + params( + credential_id: String, + enrolled_in_mfa: T::Boolean, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountPasskey::Type::OrSymbol, + verified_at: Float, + authenticator_name: String, + created_with_browser: String, + created_with_device: String, + created_with_os: String, + public_key: String + ).returns(T.attached_class) + end + def self.new( + credential_id:, + enrolled_in_mfa:, + first_verified_at:, + latest_verified_at:, + type:, + verified_at:, + authenticator_name: nil, + created_with_browser: nil, + created_with_device: nil, + created_with_os: nil, + public_key: nil + ) + end + + sig do + override.returns( + { + credential_id: String, + enrolled_in_mfa: T::Boolean, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountPasskey::Type::TaggedSymbol, + verified_at: Float, + authenticator_name: String, + created_with_browser: String, + created_with_device: String, + created_with_os: String, + public_key: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountPasskey::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PASSKEY = + T.let(:passkey, Privy::LinkedAccountPasskey::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountPasskey::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_passkey_input.rbi b/rbi/privy/models/linked_account_passkey_input.rbi new file mode 100644 index 0000000..7f9b8ac --- /dev/null +++ b/rbi/privy/models/linked_account_passkey_input.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountPasskeyInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountPasskeyInput, Privy::Internal::AnyHash) + end + + sig do + returns( + Privy::LinkedAccountPasskeyInput::CredentialDeviceType::OrSymbol + ) + end + attr_accessor :credential_device_type + + sig { returns(String) } + attr_accessor :credential_id + + sig { returns(String) } + attr_accessor :credential_public_key + + sig { returns(String) } + attr_accessor :credential_username + + sig { returns(Symbol) } + attr_accessor :type + + # The payload for importing a passkey account. + sig do + params( + credential_device_type: + Privy::LinkedAccountPasskeyInput::CredentialDeviceType::OrSymbol, + credential_id: String, + credential_public_key: String, + credential_username: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + credential_device_type:, + credential_id:, + credential_public_key:, + credential_username:, + type: :passkey + ) + end + + sig do + override.returns( + { + credential_device_type: + Privy::LinkedAccountPasskeyInput::CredentialDeviceType::OrSymbol, + credential_id: String, + credential_public_key: String, + credential_username: String, + type: Symbol + } + ) + end + def to_hash + end + + module CredentialDeviceType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountPasskeyInput::CredentialDeviceType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SINGLE_DEVICE = + T.let( + :singleDevice, + Privy::LinkedAccountPasskeyInput::CredentialDeviceType::TaggedSymbol + ) + MULTI_DEVICE = + T.let( + :multiDevice, + Privy::LinkedAccountPasskeyInput::CredentialDeviceType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountPasskeyInput::CredentialDeviceType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_phone.rbi b/rbi/privy/models/linked_account_phone.rbi new file mode 100644 index 0000000..9f5ef16 --- /dev/null +++ b/rbi/privy/models/linked_account_phone.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountPhone < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountPhone, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :phone_number + + sig { returns(Privy::LinkedAccountPhone::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(T.nilable(String)) } + attr_reader :number + + sig { params(number: String).void } + attr_writer :number + + # A phone number account linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + phone_number: String, + type: Privy::LinkedAccountPhone::Type::OrSymbol, + verified_at: Float, + number: String + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + phone_number:, + type:, + verified_at:, + number: nil + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + phone_number: String, + type: Privy::LinkedAccountPhone::Type::TaggedSymbol, + verified_at: Float, + number: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountPhone::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PHONE = T.let(:phone, Privy::LinkedAccountPhone::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountPhone::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_phone_input.rbi b/rbi/privy/models/linked_account_phone_input.rbi new file mode 100644 index 0000000..c059b47 --- /dev/null +++ b/rbi/privy/models/linked_account_phone_input.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountPhoneInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountPhoneInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :number + + sig { returns(Symbol) } + attr_accessor :type + + # The payload for importing a phone account. + sig { params(number: String, type: Symbol).returns(T.attached_class) } + def self.new(number:, type: :phone) + end + + sig { override.returns({ number: String, type: Symbol }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_smart_wallet.rbi b/rbi/privy/models/linked_account_smart_wallet.rbi new file mode 100644 index 0000000..d787401 --- /dev/null +++ b/rbi/privy/models/linked_account_smart_wallet.rbi @@ -0,0 +1,99 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountSmartWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountSmartWallet, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + # The supported smart wallet providers. + sig { returns(Privy::SmartWalletType::TaggedSymbol) } + attr_accessor :smart_wallet_type + + sig { returns(Privy::LinkedAccountSmartWallet::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(T.nilable(String)) } + attr_reader :smart_wallet_version + + sig { params(smart_wallet_version: String).void } + attr_writer :smart_wallet_version + + # A smart wallet account linked to the user. + sig do + params( + address: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + type: Privy::LinkedAccountSmartWallet::Type::OrSymbol, + verified_at: Float, + smart_wallet_version: String + ).returns(T.attached_class) + end + def self.new( + address:, + first_verified_at:, + latest_verified_at:, + # The supported smart wallet providers. + smart_wallet_type:, + type:, + verified_at:, + smart_wallet_version: nil + ) + end + + sig do + override.returns( + { + address: String, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + smart_wallet_type: Privy::SmartWalletType::TaggedSymbol, + type: Privy::LinkedAccountSmartWallet::Type::TaggedSymbol, + verified_at: Float, + smart_wallet_version: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountSmartWallet::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMART_WALLET = + T.let( + :smart_wallet, + Privy::LinkedAccountSmartWallet::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountSmartWallet::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_solana.rbi b/rbi/privy/models/linked_account_solana.rbi new file mode 100644 index 0000000..4293c94 --- /dev/null +++ b/rbi/privy/models/linked_account_solana.rbi @@ -0,0 +1,152 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountSolana < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountSolana, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::LinkedAccountSolana::ChainType::TaggedSymbol) } + attr_accessor :chain_type + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(Privy::LinkedAccountSolana::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(Privy::LinkedAccountSolana::WalletClient::TaggedSymbol) } + attr_accessor :wallet_client + + sig { returns(T.nilable(String)) } + attr_reader :connector_type + + sig { params(connector_type: String).void } + attr_writer :connector_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_client_type + + sig { params(wallet_client_type: String).void } + attr_writer :wallet_client_type + + # A Solana wallet account linked to the user. + sig do + params( + address: String, + chain_type: Privy::LinkedAccountSolana::ChainType::OrSymbol, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountSolana::Type::OrSymbol, + verified_at: Float, + wallet_client: Privy::LinkedAccountSolana::WalletClient::OrSymbol, + connector_type: String, + wallet_client_type: String + ).returns(T.attached_class) + end + def self.new( + address:, + chain_type:, + first_verified_at:, + latest_verified_at:, + type:, + verified_at:, + wallet_client:, + connector_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::LinkedAccountSolana::ChainType::TaggedSymbol, + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + type: Privy::LinkedAccountSolana::Type::TaggedSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountSolana::WalletClient::TaggedSymbol, + connector_type: String, + wallet_client_type: String + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountSolana::ChainType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA = + T.let(:solana, Privy::LinkedAccountSolana::ChainType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountSolana::ChainType::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountSolana::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = T.let(:wallet, Privy::LinkedAccountSolana::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountSolana::Type::TaggedSymbol] + ) + end + def self.values + end + end + + module WalletClient + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountSolana::WalletClient) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UNKNOWN = + T.let( + :unknown, + Privy::LinkedAccountSolana::WalletClient::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountSolana::WalletClient::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_solana_embedded_wallet.rbi b/rbi/privy/models/linked_account_solana_embedded_wallet.rbi new file mode 100644 index 0000000..2697833 --- /dev/null +++ b/rbi/privy/models/linked_account_solana_embedded_wallet.rbi @@ -0,0 +1,296 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountSolanaEmbeddedWallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::LinkedAccountSolanaEmbeddedWallet, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :chain_id + + sig do + returns( + Privy::LinkedAccountSolanaEmbeddedWallet::ChainType::TaggedSymbol + ) + end + attr_accessor :chain_type + + sig do + returns( + Privy::LinkedAccountSolanaEmbeddedWallet::ConnectorType::TaggedSymbol + ) + end + attr_accessor :connector_type + + sig { returns(T::Boolean) } + attr_accessor :delegated + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T::Boolean) } + attr_accessor :imported + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :public_key + + # The method used to recover an embedded wallet account. + sig { returns(Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol) } + attr_accessor :recovery_method + + sig do + returns(Privy::LinkedAccountSolanaEmbeddedWallet::Type::TaggedSymbol) + end + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig do + returns( + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClient::TaggedSymbol + ) + end + attr_accessor :wallet_client + + sig do + returns( + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClientType::TaggedSymbol + ) + end + attr_accessor :wallet_client_type + + sig { returns(Float) } + attr_accessor :wallet_index + + # A Solana embedded wallet account linked to the user. + sig do + params( + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountSolanaEmbeddedWallet::ChainType::OrSymbol, + connector_type: + Privy::LinkedAccountSolanaEmbeddedWallet::ConnectorType::OrSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::OrSymbol, + type: Privy::LinkedAccountSolanaEmbeddedWallet::Type::OrSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClient::OrSymbol, + wallet_client_type: + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClientType::OrSymbol, + wallet_index: Float + ).returns(T.attached_class) + end + def self.new( + id:, + address:, + chain_id:, + chain_type:, + connector_type:, + delegated:, + first_verified_at:, + imported:, + latest_verified_at:, + public_key:, + # The method used to recover an embedded wallet account. + recovery_method:, + type:, + verified_at:, + wallet_client:, + wallet_client_type:, + wallet_index: + ) + end + + sig do + override.returns( + { + id: T.nilable(String), + address: String, + chain_id: String, + chain_type: + Privy::LinkedAccountSolanaEmbeddedWallet::ChainType::TaggedSymbol, + connector_type: + Privy::LinkedAccountSolanaEmbeddedWallet::ConnectorType::TaggedSymbol, + delegated: T::Boolean, + first_verified_at: T.nilable(Float), + imported: T::Boolean, + latest_verified_at: T.nilable(Float), + public_key: String, + recovery_method: Privy::EmbeddedWalletRecoveryMethod::TaggedSymbol, + type: Privy::LinkedAccountSolanaEmbeddedWallet::Type::TaggedSymbol, + verified_at: Float, + wallet_client: + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClient::TaggedSymbol, + wallet_client_type: + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClientType::TaggedSymbol, + wallet_index: Float + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountSolanaEmbeddedWallet::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA = + T.let( + :solana, + Privy::LinkedAccountSolanaEmbeddedWallet::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountSolanaEmbeddedWallet::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ConnectorType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountSolanaEmbeddedWallet::ConnectorType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMBEDDED = + T.let( + :embedded, + Privy::LinkedAccountSolanaEmbeddedWallet::ConnectorType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountSolanaEmbeddedWallet::ConnectorType::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountSolanaEmbeddedWallet::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let( + :wallet, + Privy::LinkedAccountSolanaEmbeddedWallet::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountSolanaEmbeddedWallet::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClient + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClient + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClient::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClient::TaggedSymbol + ] + ) + end + def self.values + end + end + + module WalletClientType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClientType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVY = + T.let( + :privy, + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClientType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::LinkedAccountSolanaEmbeddedWallet::WalletClientType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_spotify_input.rbi b/rbi/privy/models/linked_account_spotify_input.rbi new file mode 100644 index 0000000..2049fc5 --- /dev/null +++ b/rbi/privy/models/linked_account_spotify_input.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountSpotifyInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountSpotifyInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The payload for importing a Spotify account. + sig do + params( + subject: String, + email: String, + name: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new(subject:, email: nil, name: nil, type: :spotify_oauth) + end + + sig do + override.returns( + { subject: String, type: Symbol, email: String, name: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_spotify_oauth.rbi b/rbi/privy/models/linked_account_spotify_oauth.rbi new file mode 100644 index 0000000..69ad1c5 --- /dev/null +++ b/rbi/privy/models/linked_account_spotify_oauth.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountSpotifyOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountSpotifyOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountSpotifyOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A Spotify OAuth account linked to the user. + sig do + params( + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountSpotifyOAuth::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + email:, + first_verified_at:, + latest_verified_at:, + name:, + subject:, + type:, + verified_at: + ) + end + + sig do + override.returns( + { + email: T.nilable(String), + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountSpotifyOAuth::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountSpotifyOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SPOTIFY_OAUTH = + T.let( + :spotify_oauth, + Privy::LinkedAccountSpotifyOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountSpotifyOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_telegram.rbi b/rbi/privy/models/linked_account_telegram.rbi new file mode 100644 index 0000000..7618f34 --- /dev/null +++ b/rbi/privy/models/linked_account_telegram.rbi @@ -0,0 +1,103 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTelegram < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTelegram, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :telegram_user_id + + sig { returns(Privy::LinkedAccountTelegram::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + sig { returns(T.nilable(String)) } + attr_accessor :first_name + + sig { returns(T.nilable(String)) } + attr_accessor :last_name + + sig { returns(T.nilable(String)) } + attr_accessor :photo_url + + sig { returns(T.nilable(String)) } + attr_accessor :username + + # A Telegram account linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + telegram_user_id: String, + type: Privy::LinkedAccountTelegram::Type::OrSymbol, + verified_at: Float, + first_name: T.nilable(String), + last_name: T.nilable(String), + photo_url: T.nilable(String), + username: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + telegram_user_id:, + type:, + verified_at:, + first_name: nil, + last_name: nil, + photo_url: nil, + username: nil + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + telegram_user_id: String, + type: Privy::LinkedAccountTelegram::Type::TaggedSymbol, + verified_at: Float, + first_name: T.nilable(String), + last_name: T.nilable(String), + photo_url: T.nilable(String), + username: T.nilable(String) + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountTelegram::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TELEGRAM = + T.let(:telegram, Privy::LinkedAccountTelegram::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::LinkedAccountTelegram::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_telegram_input.rbi b/rbi/privy/models/linked_account_telegram_input.rbi new file mode 100644 index 0000000..6b3c5de --- /dev/null +++ b/rbi/privy/models/linked_account_telegram_input.rbi @@ -0,0 +1,78 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTelegramInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTelegramInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :telegram_user_id + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :first_name + + sig { params(first_name: String).void } + attr_writer :first_name + + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + sig { returns(T.nilable(String)) } + attr_reader :photo_url + + sig { params(photo_url: String).void } + attr_writer :photo_url + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # The payload for importing a Telegram account. + sig do + params( + telegram_user_id: String, + first_name: String, + last_name: String, + photo_url: String, + username: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + telegram_user_id:, + first_name: nil, + last_name: nil, + photo_url: nil, + username: nil, + type: :telegram + ) + end + + sig do + override.returns( + { + telegram_user_id: String, + type: Symbol, + first_name: String, + last_name: String, + photo_url: String, + username: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_tiktok_input.rbi b/rbi/privy/models/linked_account_tiktok_input.rbi new file mode 100644 index 0000000..7a72c29 --- /dev/null +++ b/rbi/privy/models/linked_account_tiktok_input.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTiktokInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTiktokInput, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :username + + # The payload for importing a Tiktok account. + sig do + params( + name: T.nilable(String), + subject: String, + username: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new(name:, subject:, username:, type: :tiktok_oauth) + end + + sig do + override.returns( + { + name: T.nilable(String), + subject: String, + type: Symbol, + username: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_tiktok_oauth.rbi b/rbi/privy/models/linked_account_tiktok_oauth.rbi new file mode 100644 index 0000000..5558bf6 --- /dev/null +++ b/rbi/privy/models/linked_account_tiktok_oauth.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTiktokOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTiktokOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountTiktokOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig { returns(Float) } + attr_accessor :verified_at + + # A TikTok OAuth account linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountTiktokOAuth::Type::OrSymbol, + username: T.nilable(String), + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + name:, + subject:, + type:, + username:, + verified_at: + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + subject: String, + type: Privy::LinkedAccountTiktokOAuth::Type::TaggedSymbol, + username: T.nilable(String), + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountTiktokOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TIKTOK_OAUTH = + T.let( + :tiktok_oauth, + Privy::LinkedAccountTiktokOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountTiktokOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_twitch_input.rbi b/rbi/privy/models/linked_account_twitch_input.rbi new file mode 100644 index 0000000..6d70bdc --- /dev/null +++ b/rbi/privy/models/linked_account_twitch_input.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTwitchInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTwitchInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # The payload for importing a Twitch account. + sig do + params(subject: String, username: String, type: Symbol).returns( + T.attached_class + ) + end + def self.new(subject:, username: nil, type: :twitch_oauth) + end + + sig do + override.returns({ subject: String, type: Symbol, username: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_twitch_oauth.rbi b/rbi/privy/models/linked_account_twitch_oauth.rbi new file mode 100644 index 0000000..b8d12d4 --- /dev/null +++ b/rbi/privy/models/linked_account_twitch_oauth.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTwitchOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTwitchOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountTwitchOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig { returns(Float) } + attr_accessor :verified_at + + # A Twitch OAuth account linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountTwitchOAuth::Type::OrSymbol, + username: T.nilable(String), + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + subject:, + type:, + username:, + verified_at: + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + subject: String, + type: Privy::LinkedAccountTwitchOAuth::Type::TaggedSymbol, + username: T.nilable(String), + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountTwitchOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWITCH_OAUTH = + T.let( + :twitch_oauth, + Privy::LinkedAccountTwitchOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountTwitchOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_twitter_input.rbi b/rbi/privy/models/linked_account_twitter_input.rbi new file mode 100644 index 0000000..e39623f --- /dev/null +++ b/rbi/privy/models/linked_account_twitter_input.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTwitterInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTwitterInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Symbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :username + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture_url + + sig { params(profile_picture_url: String).void } + attr_writer :profile_picture_url + + # The payload for importing a Twitter account. + sig do + params( + name: String, + subject: String, + username: String, + profile_picture_url: String, + type: Symbol + ).returns(T.attached_class) + end + def self.new( + name:, + subject:, + username:, + profile_picture_url: nil, + type: :twitter_oauth + ) + end + + sig do + override.returns( + { + name: String, + subject: String, + type: Symbol, + username: String, + profile_picture_url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/linked_account_twitter_oauth.rbi b/rbi/privy/models/linked_account_twitter_oauth.rbi new file mode 100644 index 0000000..e31d998 --- /dev/null +++ b/rbi/privy/models/linked_account_twitter_oauth.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountTwitterOAuth < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountTwitterOAuth, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :first_verified_at + + sig { returns(T.nilable(Float)) } + attr_accessor :latest_verified_at + + sig { returns(T.nilable(String)) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_accessor :profile_picture_url + + sig { returns(String) } + attr_accessor :subject + + sig { returns(Privy::LinkedAccountTwitterOAuth::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_accessor :username + + sig { returns(Float) } + attr_accessor :verified_at + + # A Twitter OAuth account linked to the user. + sig do + params( + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + profile_picture_url: T.nilable(String), + subject: String, + type: Privy::LinkedAccountTwitterOAuth::Type::OrSymbol, + username: T.nilable(String), + verified_at: Float + ).returns(T.attached_class) + end + def self.new( + first_verified_at:, + latest_verified_at:, + name:, + profile_picture_url:, + subject:, + type:, + username:, + verified_at: + ) + end + + sig do + override.returns( + { + first_verified_at: T.nilable(Float), + latest_verified_at: T.nilable(Float), + name: T.nilable(String), + profile_picture_url: T.nilable(String), + subject: String, + type: Privy::LinkedAccountTwitterOAuth::Type::TaggedSymbol, + username: T.nilable(String), + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::LinkedAccountTwitterOAuth::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TWITTER_OAUTH = + T.let( + :twitter_oauth, + Privy::LinkedAccountTwitterOAuth::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountTwitterOAuth::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_account_type.rbi b/rbi/privy/models/linked_account_type.rbi new file mode 100644 index 0000000..2d4f7eb --- /dev/null +++ b/rbi/privy/models/linked_account_type.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Privy + module Models + # The possible types of linked accounts. + module LinkedAccountType + extend Privy::Internal::Type::Union + + Variants = + T.type_alias { T.any(Privy::LinkedAccountType::TaggedSymbol, String) } + + sig { override.returns(T::Array[Privy::LinkedAccountType::Variants]) } + def self.variants + end + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::LinkedAccountType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EMAIL = T.let(:email, Privy::LinkedAccountType::TaggedSymbol) + PHONE = T.let(:phone, Privy::LinkedAccountType::TaggedSymbol) + WALLET = T.let(:wallet, Privy::LinkedAccountType::TaggedSymbol) + SMART_WALLET = + T.let(:smart_wallet, Privy::LinkedAccountType::TaggedSymbol) + GOOGLE_OAUTH = + T.let(:google_oauth, Privy::LinkedAccountType::TaggedSymbol) + TWITTER_OAUTH = + T.let(:twitter_oauth, Privy::LinkedAccountType::TaggedSymbol) + DISCORD_OAUTH = + T.let(:discord_oauth, Privy::LinkedAccountType::TaggedSymbol) + GITHUB_OAUTH = + T.let(:github_oauth, Privy::LinkedAccountType::TaggedSymbol) + SPOTIFY_OAUTH = + T.let(:spotify_oauth, Privy::LinkedAccountType::TaggedSymbol) + INSTAGRAM_OAUTH = + T.let(:instagram_oauth, Privy::LinkedAccountType::TaggedSymbol) + TIKTOK_OAUTH = + T.let(:tiktok_oauth, Privy::LinkedAccountType::TaggedSymbol) + LINE_OAUTH = T.let(:line_oauth, Privy::LinkedAccountType::TaggedSymbol) + TWITCH_OAUTH = + T.let(:twitch_oauth, Privy::LinkedAccountType::TaggedSymbol) + LINKEDIN_OAUTH = + T.let(:linkedin_oauth, Privy::LinkedAccountType::TaggedSymbol) + APPLE_OAUTH = T.let(:apple_oauth, Privy::LinkedAccountType::TaggedSymbol) + CUSTOM_AUTH = T.let(:custom_auth, Privy::LinkedAccountType::TaggedSymbol) + FARCASTER = T.let(:farcaster, Privy::LinkedAccountType::TaggedSymbol) + PASSKEY = T.let(:passkey, Privy::LinkedAccountType::TaggedSymbol) + TELEGRAM = T.let(:telegram, Privy::LinkedAccountType::TaggedSymbol) + CROSS_APP = T.let(:cross_app, Privy::LinkedAccountType::TaggedSymbol) + AUTHORIZATION_KEY = + T.let(:authorization_key, Privy::LinkedAccountType::TaggedSymbol) + end + end +end diff --git a/rbi/privy/models/linked_account_wallet_input.rbi b/rbi/privy/models/linked_account_wallet_input.rbi new file mode 100644 index 0000000..efa14f8 --- /dev/null +++ b/rbi/privy/models/linked_account_wallet_input.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Privy + module Models + class LinkedAccountWalletInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::LinkedAccountWalletInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::LinkedAccountWalletInput::ChainType::OrSymbol) } + attr_accessor :chain_type + + sig { returns(Symbol) } + attr_accessor :type + + # The payload for importing a wallet account. + sig do + params( + address: String, + chain_type: Privy::LinkedAccountWalletInput::ChainType::OrSymbol, + type: Symbol + ).returns(T.attached_class) + end + def self.new(address:, chain_type:, type: :wallet) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::LinkedAccountWalletInput::ChainType::OrSymbol, + type: Symbol + } + ) + end + def to_hash + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::LinkedAccountWalletInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::LinkedAccountWalletInput::ChainType::TaggedSymbol + ) + SOLANA = + T.let( + :solana, + Privy::LinkedAccountWalletInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::LinkedAccountWalletInput::ChainType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/linked_mfa_method.rbi b/rbi/privy/models/linked_mfa_method.rbi new file mode 100644 index 0000000..4957c35 --- /dev/null +++ b/rbi/privy/models/linked_mfa_method.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # A multi-factor authentication method linked to the user. + module LinkedMfaMethod + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SMSMfaMethod, + Privy::TotpMfaMethod, + Privy::PasskeyMfaMethod + ) + end + + sig { override.returns(T::Array[Privy::LinkedMfaMethod::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/mfa_disabled_webhook_payload.rbi b/rbi/privy/models/mfa_disabled_webhook_payload.rbi new file mode 100644 index 0000000..4ce6053 --- /dev/null +++ b/rbi/privy/models/mfa_disabled_webhook_payload.rbi @@ -0,0 +1,106 @@ +# typed: strong + +module Privy + module Models + class MfaDisabledWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaDisabledWebhookPayload, Privy::Internal::AnyHash) + end + + # The MFA method that was disabled. + sig { returns(Privy::MfaDisabledWebhookPayload::Method::TaggedSymbol) } + attr_accessor :method_ + + # The type of webhook event. + sig { returns(Privy::MfaDisabledWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # The ID of the user who disabled MFA. + sig { returns(String) } + attr_accessor :user_id + + # Payload for the mfa.disabled webhook event. + sig do + params( + method_: Privy::MfaDisabledWebhookPayload::Method::OrSymbol, + type: Privy::MfaDisabledWebhookPayload::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # The MFA method that was disabled. + method_:, + # The type of webhook event. + type:, + # The ID of the user who disabled MFA. + user_id: + ) + end + + sig do + override.returns( + { + method_: Privy::MfaDisabledWebhookPayload::Method::TaggedSymbol, + type: Privy::MfaDisabledWebhookPayload::Type::TaggedSymbol, + user_id: String + } + ) + end + def to_hash + end + + # The MFA method that was disabled. + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::MfaDisabledWebhookPayload::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = + T.let(:sms, Privy::MfaDisabledWebhookPayload::Method::TaggedSymbol) + TOTP = + T.let(:totp, Privy::MfaDisabledWebhookPayload::Method::TaggedSymbol) + PASSKEY = + T.let( + :passkey, + Privy::MfaDisabledWebhookPayload::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::MfaDisabledWebhookPayload::Method::TaggedSymbol] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::MfaDisabledWebhookPayload::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MFA_DISABLED = + T.let( + :"mfa.disabled", + Privy::MfaDisabledWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::MfaDisabledWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/mfa_enabled_webhook_payload.rbi b/rbi/privy/models/mfa_enabled_webhook_payload.rbi new file mode 100644 index 0000000..49dcb53 --- /dev/null +++ b/rbi/privy/models/mfa_enabled_webhook_payload.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module Privy + module Models + class MfaEnabledWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaEnabledWebhookPayload, Privy::Internal::AnyHash) + end + + # The MFA method that was enabled. + sig { returns(Privy::MfaEnabledWebhookPayload::Method::TaggedSymbol) } + attr_accessor :method_ + + # The type of webhook event. + sig { returns(Privy::MfaEnabledWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # The ID of the user who enabled MFA. + sig { returns(String) } + attr_accessor :user_id + + # Payload for the mfa.enabled webhook event. + sig do + params( + method_: Privy::MfaEnabledWebhookPayload::Method::OrSymbol, + type: Privy::MfaEnabledWebhookPayload::Type::OrSymbol, + user_id: String + ).returns(T.attached_class) + end + def self.new( + # The MFA method that was enabled. + method_:, + # The type of webhook event. + type:, + # The ID of the user who enabled MFA. + user_id: + ) + end + + sig do + override.returns( + { + method_: Privy::MfaEnabledWebhookPayload::Method::TaggedSymbol, + type: Privy::MfaEnabledWebhookPayload::Type::TaggedSymbol, + user_id: String + } + ) + end + def to_hash + end + + # The MFA method that was enabled. + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::MfaEnabledWebhookPayload::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = T.let(:sms, Privy::MfaEnabledWebhookPayload::Method::TaggedSymbol) + TOTP = + T.let(:totp, Privy::MfaEnabledWebhookPayload::Method::TaggedSymbol) + PASSKEY = + T.let(:passkey, Privy::MfaEnabledWebhookPayload::Method::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::MfaEnabledWebhookPayload::Method::TaggedSymbol] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::MfaEnabledWebhookPayload::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MFA_ENABLED = + T.let( + :"mfa.enabled", + Privy::MfaEnabledWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::MfaEnabledWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/mfa_passkey_enrollment_request_body.rbi b/rbi/privy/models/mfa_passkey_enrollment_request_body.rbi new file mode 100644 index 0000000..f6b89ed --- /dev/null +++ b/rbi/privy/models/mfa_passkey_enrollment_request_body.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + class MfaPasskeyEnrollmentRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::MfaPasskeyEnrollmentRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[String]) } + attr_accessor :credential_ids + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :remove_for_login + + sig { params(remove_for_login: T::Boolean).void } + attr_writer :remove_for_login + + # The request body for enrolling a passkey MFA flow. + sig do + params( + credential_ids: T::Array[String], + remove_for_login: T::Boolean + ).returns(T.attached_class) + end + def self.new(credential_ids:, remove_for_login: nil) + end + + sig do + override.returns( + { credential_ids: T::Array[String], remove_for_login: T::Boolean } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_passkey_init_request_body.rbi b/rbi/privy/models/mfa_passkey_init_request_body.rbi new file mode 100644 index 0000000..48bb300 --- /dev/null +++ b/rbi/privy/models/mfa_passkey_init_request_body.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class MfaPasskeyInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaPasskeyInitRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # The request body for initiating a passkey MFA flow. + sig { params(relying_party: String).returns(T.attached_class) } + def self.new(relying_party: nil) + end + + sig { override.returns({ relying_party: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_passkey_init_response_body.rbi b/rbi/privy/models/mfa_passkey_init_response_body.rbi new file mode 100644 index 0000000..ab39d16 --- /dev/null +++ b/rbi/privy/models/mfa_passkey_init_response_body.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class MfaPasskeyInitResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaPasskeyInitResponseBody, Privy::Internal::AnyHash) + end + + # WebAuthn authentication options as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorVerifyOptions) } + attr_reader :options + + sig do + params(options: Privy::PasskeyAuthenticatorVerifyOptions::OrHash).void + end + attr_writer :options + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # The response body for initializing a passkey MFA flow. + sig do + params( + options: Privy::PasskeyAuthenticatorVerifyOptions::OrHash, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn authentication options as defined by the Web Authentication + # specification. + options:, + relying_party: nil + ) + end + + sig do + override.returns( + { + options: Privy::PasskeyAuthenticatorVerifyOptions, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_passkey_verify_request_body.rbi b/rbi/privy/models/mfa_passkey_verify_request_body.rbi new file mode 100644 index 0000000..f4b259f --- /dev/null +++ b/rbi/privy/models/mfa_passkey_verify_request_body.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class MfaPasskeyVerifyRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaPasskeyVerifyRequestBody, Privy::Internal::AnyHash) + end + + # WebAuthn authentication response as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorVerifyResponse) } + attr_reader :authenticator_response + + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorVerifyResponse::OrHash + ).void + end + attr_writer :authenticator_response + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # The request body for verifying a passkey MFA flow. + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorVerifyResponse::OrHash, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn authentication response as defined by the Web Authentication + # specification. + authenticator_response:, + relying_party: nil + ) + end + + sig do + override.returns( + { + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_sms_enroll_request_body.rbi b/rbi/privy/models/mfa_sms_enroll_request_body.rbi new file mode 100644 index 0000000..849b084 --- /dev/null +++ b/rbi/privy/models/mfa_sms_enroll_request_body.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + class MfaSMSEnrollRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaSMSEnrollRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :phone_number + + # The request body for enrolling a SMS MFA code. + sig do + params(code: String, phone_number: String).returns(T.attached_class) + end + def self.new(code:, phone_number:) + end + + sig { override.returns({ code: String, phone_number: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_sms_init_enroll_input.rbi b/rbi/privy/models/mfa_sms_init_enroll_input.rbi new file mode 100644 index 0000000..60a3dd2 --- /dev/null +++ b/rbi/privy/models/mfa_sms_init_enroll_input.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class MfaSMSInitEnrollInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaSMSInitEnrollInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::MfaSMSInitEnrollInput::Action::OrSymbol) } + attr_accessor :action + + sig { returns(String) } + attr_accessor :phone_number + + # Input for enrolling SMS MFA. + sig do + params( + action: Privy::MfaSMSInitEnrollInput::Action::OrSymbol, + phone_number: String + ).returns(T.attached_class) + end + def self.new(action:, phone_number:) + end + + sig do + override.returns( + { + action: Privy::MfaSMSInitEnrollInput::Action::OrSymbol, + phone_number: String + } + ) + end + def to_hash + end + + module Action + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::MfaSMSInitEnrollInput::Action) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENROLL = + T.let(:enroll, Privy::MfaSMSInitEnrollInput::Action::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::MfaSMSInitEnrollInput::Action::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/mfa_sms_init_request_body.rbi b/rbi/privy/models/mfa_sms_init_request_body.rbi new file mode 100644 index 0000000..9b08087 --- /dev/null +++ b/rbi/privy/models/mfa_sms_init_request_body.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Privy + module Models + # The request body for initiating a SMS MFA flow. + module MfaSMSInitRequestBody + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any(Privy::MfaSMSInitVerifyInput, Privy::MfaSMSInitEnrollInput) + end + + sig { override.returns(T::Array[Privy::MfaSMSInitRequestBody::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/mfa_sms_init_verify_input.rbi b/rbi/privy/models/mfa_sms_init_verify_input.rbi new file mode 100644 index 0000000..976ed41 --- /dev/null +++ b/rbi/privy/models/mfa_sms_init_verify_input.rbi @@ -0,0 +1,51 @@ +# typed: strong + +module Privy + module Models + class MfaSMSInitVerifyInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaSMSInitVerifyInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::MfaSMSInitVerifyInput::Action::OrSymbol) } + attr_accessor :action + + # Input for verifying SMS MFA. + sig do + params(action: Privy::MfaSMSInitVerifyInput::Action::OrSymbol).returns( + T.attached_class + ) + end + def self.new(action:) + end + + sig do + override.returns( + { action: Privy::MfaSMSInitVerifyInput::Action::OrSymbol } + ) + end + def to_hash + end + + module Action + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::MfaSMSInitVerifyInput::Action) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VERIFY = + T.let(:verify, Privy::MfaSMSInitVerifyInput::Action::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::MfaSMSInitVerifyInput::Action::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/mfa_sms_verify_request_body.rbi b/rbi/privy/models/mfa_sms_verify_request_body.rbi new file mode 100644 index 0000000..7f29fb5 --- /dev/null +++ b/rbi/privy/models/mfa_sms_verify_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class MfaSMSVerifyRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaSMSVerifyRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :code + + # The request body for verifying a SMS MFA code. + sig { params(code: String).returns(T.attached_class) } + def self.new(code:) + end + + sig { override.returns({ code: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_totp_init_response_body.rbi b/rbi/privy/models/mfa_totp_init_response_body.rbi new file mode 100644 index 0000000..c818b3f --- /dev/null +++ b/rbi/privy/models/mfa_totp_init_response_body.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Privy + module Models + class MfaTotpInitResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaTotpInitResponseBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :totp_auth_url + + sig { returns(String) } + attr_accessor :totp_secret + + # The response body for initializing a TOTP MFA code. + sig do + params(totp_auth_url: String, totp_secret: String).returns( + T.attached_class + ) + end + def self.new(totp_auth_url:, totp_secret:) + end + + sig { override.returns({ totp_auth_url: String, totp_secret: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_totp_input.rbi b/rbi/privy/models/mfa_totp_input.rbi new file mode 100644 index 0000000..cffae08 --- /dev/null +++ b/rbi/privy/models/mfa_totp_input.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + class MfaTotpInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::MfaTotpInput, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :code + + # The input for verifying a TOTP MFA code. + sig { params(code: String).returns(T.attached_class) } + def self.new(code:) + end + + sig { override.returns({ code: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/mfa_verify_response_body.rbi b/rbi/privy/models/mfa_verify_response_body.rbi new file mode 100644 index 0000000..d5f7ea3 --- /dev/null +++ b/rbi/privy/models/mfa_verify_response_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class MfaVerifyResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MfaVerifyResponseBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :token + + # The response body for verifying a MFA code. + sig { params(token: String).returns(T.attached_class) } + def self.new(token:) + end + + sig { override.returns({ token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_currency_code.rbi b/rbi/privy/models/moonpay_currency_code.rbi new file mode 100644 index 0000000..d08305b --- /dev/null +++ b/rbi/privy/models/moonpay_currency_code.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + # A Moonpay currency code for an Ethereum-compatible chain asset. + module MoonpayCurrencyCode + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::MoonpayCurrencyCode) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + AVAX_CCHAIN = + T.let(:AVAX_CCHAIN, Privy::MoonpayCurrencyCode::TaggedSymbol) + CELO_CELO = T.let(:CELO_CELO, Privy::MoonpayCurrencyCode::TaggedSymbol) + CUSD_CELO = T.let(:CUSD_CELO, Privy::MoonpayCurrencyCode::TaggedSymbol) + DAI_ETHEREUM = + T.let(:DAI_ETHEREUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + ETH_ETHEREUM = + T.let(:ETH_ETHEREUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + ETH_ARBITRUM = + T.let(:ETH_ARBITRUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + ETH_OPTIMISM = + T.let(:ETH_OPTIMISM, Privy::MoonpayCurrencyCode::TaggedSymbol) + ETH_POLYGON = + T.let(:ETH_POLYGON, Privy::MoonpayCurrencyCode::TaggedSymbol) + ETH_BASE = T.let(:ETH_BASE, Privy::MoonpayCurrencyCode::TaggedSymbol) + FIL_FVM = T.let(:FIL_FVM, Privy::MoonpayCurrencyCode::TaggedSymbol) + MATIC_ETHEREUM = + T.let(:MATIC_ETHEREUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + MATIC_POLYGON = + T.let(:MATIC_POLYGON, Privy::MoonpayCurrencyCode::TaggedSymbol) + POL_POLYGON = + T.let(:POL_POLYGON, Privy::MoonpayCurrencyCode::TaggedSymbol) + POL_ETHEREUM = + T.let(:POL_ETHEREUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC_ETHEREUM = + T.let(:USDC_ETHEREUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC_ARBITRUM = + T.let(:USDC_ARBITRUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC_OPTIMISM = + T.let(:USDC_OPTIMISM, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC_POLYGON = + T.let(:USDC_POLYGON, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC_BASE = T.let(:USDC_BASE, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC_CCHAIN = + T.let(:USDC_CCHAIN, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC_SOL = T.let(:USDC_SOL, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDT_ETHEREUM = + T.let(:USDT_ETHEREUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDT_POLYGON = + T.let(:USDT_POLYGON, Privy::MoonpayCurrencyCode::TaggedSymbol) + WETH_POLYGON = + T.let(:WETH_POLYGON, Privy::MoonpayCurrencyCode::TaggedSymbol) + WBTC_ETHEREUM = + T.let(:WBTC_ETHEREUM, Privy::MoonpayCurrencyCode::TaggedSymbol) + BNB_BNB = T.let(:BNB_BNB, Privy::MoonpayCurrencyCode::TaggedSymbol) + BNB_BSC = T.let(:BNB_BSC, Privy::MoonpayCurrencyCode::TaggedSymbol) + MON_MON = T.let(:MON_MON, Privy::MoonpayCurrencyCode::TaggedSymbol) + CELO = T.let(:CELO, Privy::MoonpayCurrencyCode::TaggedSymbol) + CUSD = T.let(:CUSD, Privy::MoonpayCurrencyCode::TaggedSymbol) + DAI = T.let(:DAI, Privy::MoonpayCurrencyCode::TaggedSymbol) + ETH = T.let(:ETH, Privy::MoonpayCurrencyCode::TaggedSymbol) + FIL = T.let(:FIL, Privy::MoonpayCurrencyCode::TaggedSymbol) + MATIC = T.let(:MATIC, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDC = T.let(:USDC, Privy::MoonpayCurrencyCode::TaggedSymbol) + USDT = T.let(:USDT, Privy::MoonpayCurrencyCode::TaggedSymbol) + WETH = T.let(:WETH, Privy::MoonpayCurrencyCode::TaggedSymbol) + WBTC = T.let(:WBTC, Privy::MoonpayCurrencyCode::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::MoonpayCurrencyCode::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/moonpay_fiat_on_ramp_ethereum_config.rbi b/rbi/privy/models/moonpay_fiat_on_ramp_ethereum_config.rbi new file mode 100644 index 0000000..ce80b6d --- /dev/null +++ b/rbi/privy/models/moonpay_fiat_on_ramp_ethereum_config.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Privy + module Models + class MoonpayFiatOnRampEthereumConfig < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::MoonpayFiatOnRampEthereumConfig, + Privy::Internal::AnyHash + ) + end + + # A Moonpay currency code for an Ethereum-compatible chain asset. + sig { returns(T.nilable(Privy::MoonpayCurrencyCode::OrSymbol)) } + attr_reader :currency_code + + sig { params(currency_code: Privy::MoonpayCurrencyCode::OrSymbol).void } + attr_writer :currency_code + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # A payment method supported by Moonpay on-ramp. + sig { returns(T.nilable(Privy::MoonpayPaymentMethod::OrSymbol)) } + attr_reader :payment_method + + sig { params(payment_method: Privy::MoonpayPaymentMethod::OrSymbol).void } + attr_writer :payment_method + + sig { returns(T.nilable(Float)) } + attr_reader :quote_currency_amount + + sig { params(quote_currency_amount: Float).void } + attr_writer :quote_currency_amount + + # UI configuration for the Moonpay on-ramp widget. + sig { returns(T.nilable(Privy::MoonpayUiConfig)) } + attr_reader :ui_config + + sig { params(ui_config: Privy::MoonpayUiConfig::OrHash).void } + attr_writer :ui_config + + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + sig do + params( + currency_code: Privy::MoonpayCurrencyCode::OrSymbol, + email: String, + payment_method: Privy::MoonpayPaymentMethod::OrSymbol, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig::OrHash + ).returns(T.attached_class) + end + def self.new( + # A Moonpay currency code for an Ethereum-compatible chain asset. + currency_code: nil, + email: nil, + # A payment method supported by Moonpay on-ramp. + payment_method: nil, + quote_currency_amount: nil, + # UI configuration for the Moonpay on-ramp widget. + ui_config: nil + ) + end + + sig do + override.returns( + { + currency_code: Privy::MoonpayCurrencyCode::OrSymbol, + email: String, + payment_method: Privy::MoonpayPaymentMethod::OrSymbol, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_fiat_on_ramp_ethereum_input.rbi b/rbi/privy/models/moonpay_fiat_on_ramp_ethereum_input.rbi new file mode 100644 index 0000000..7cff163 --- /dev/null +++ b/rbi/privy/models/moonpay_fiat_on_ramp_ethereum_input.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class MoonpayFiatOnRampEthereumInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MoonpayFiatOnRampEthereumInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + sig { returns(Privy::MoonpayFiatOnRampEthereumConfig) } + attr_reader :config + + sig do + params(config: Privy::MoonpayFiatOnRampEthereumConfig::OrHash).void + end + attr_writer :config + + # Input for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + sig do + params( + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig::OrHash + ).returns(T.attached_class) + end + def self.new( + address:, + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + config: + ) + end + + sig do + override.returns( + { address: String, config: Privy::MoonpayFiatOnRampEthereumConfig } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_fiat_on_ramp_solana_config.rbi b/rbi/privy/models/moonpay_fiat_on_ramp_solana_config.rbi new file mode 100644 index 0000000..3c5619c --- /dev/null +++ b/rbi/privy/models/moonpay_fiat_on_ramp_solana_config.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module Privy + module Models + class MoonpayFiatOnRampSolanaConfig < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MoonpayFiatOnRampSolanaConfig, Privy::Internal::AnyHash) + end + + # A Moonpay currency code for a Solana asset. + sig { returns(T.nilable(Privy::MoonpaySolanaCurrencyCode::OrSymbol)) } + attr_reader :currency_code + + sig do + params(currency_code: Privy::MoonpaySolanaCurrencyCode::OrSymbol).void + end + attr_writer :currency_code + + sig { returns(T.nilable(String)) } + attr_reader :email + + sig { params(email: String).void } + attr_writer :email + + # A payment method supported by Moonpay on-ramp. + sig { returns(T.nilable(Privy::MoonpayPaymentMethod::OrSymbol)) } + attr_reader :payment_method + + sig { params(payment_method: Privy::MoonpayPaymentMethod::OrSymbol).void } + attr_writer :payment_method + + sig { returns(T.nilable(Float)) } + attr_reader :quote_currency_amount + + sig { params(quote_currency_amount: Float).void } + attr_writer :quote_currency_amount + + # UI configuration for the Moonpay on-ramp widget. + sig { returns(T.nilable(Privy::MoonpayUiConfig)) } + attr_reader :ui_config + + sig { params(ui_config: Privy::MoonpayUiConfig::OrHash).void } + attr_writer :ui_config + + # Configuration for a Moonpay fiat on-ramp for Solana. + sig do + params( + currency_code: Privy::MoonpaySolanaCurrencyCode::OrSymbol, + email: String, + payment_method: Privy::MoonpayPaymentMethod::OrSymbol, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig::OrHash + ).returns(T.attached_class) + end + def self.new( + # A Moonpay currency code for a Solana asset. + currency_code: nil, + email: nil, + # A payment method supported by Moonpay on-ramp. + payment_method: nil, + quote_currency_amount: nil, + # UI configuration for the Moonpay on-ramp widget. + ui_config: nil + ) + end + + sig do + override.returns( + { + currency_code: Privy::MoonpaySolanaCurrencyCode::OrSymbol, + email: String, + payment_method: Privy::MoonpayPaymentMethod::OrSymbol, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_fiat_on_ramp_solana_input.rbi b/rbi/privy/models/moonpay_fiat_on_ramp_solana_input.rbi new file mode 100644 index 0000000..8185aa3 --- /dev/null +++ b/rbi/privy/models/moonpay_fiat_on_ramp_solana_input.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class MoonpayFiatOnRampSolanaInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MoonpayFiatOnRampSolanaInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # Configuration for a Moonpay fiat on-ramp for Solana. + sig { returns(Privy::MoonpayFiatOnRampSolanaConfig) } + attr_reader :config + + sig { params(config: Privy::MoonpayFiatOnRampSolanaConfig::OrHash).void } + attr_writer :config + + # Input for a Moonpay fiat on-ramp for Solana. + sig do + params( + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig::OrHash + ).returns(T.attached_class) + end + def self.new( + address:, + # Configuration for a Moonpay fiat on-ramp for Solana. + config: + ) + end + + sig do + override.returns( + { address: String, config: Privy::MoonpayFiatOnRampSolanaConfig } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_on_ramp_sandbox_config.rbi b/rbi/privy/models/moonpay_on_ramp_sandbox_config.rbi new file mode 100644 index 0000000..9e9cb67 --- /dev/null +++ b/rbi/privy/models/moonpay_on_ramp_sandbox_config.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class MoonpayOnRampSandboxConfig < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MoonpayOnRampSandboxConfig, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_sandbox + + sig { params(use_sandbox: T::Boolean).void } + attr_writer :use_sandbox + + # Sandbox configuration for a Moonpay on-ramp. + sig { params(use_sandbox: T::Boolean).returns(T.attached_class) } + def self.new(use_sandbox: nil) + end + + sig { override.returns({ use_sandbox: T::Boolean }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_on_ramp_sign_input.rbi b/rbi/privy/models/moonpay_on_ramp_sign_input.rbi new file mode 100644 index 0000000..5642dce --- /dev/null +++ b/rbi/privy/models/moonpay_on_ramp_sign_input.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Privy + module Models + # The input for signing a Moonpay on-ramp. + module MoonpayOnRampSignInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampEthereumInput, + Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampSolanaInput + ) + end + + class MoonpayFiatOnRampEthereumInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampEthereumInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_sandbox + + sig { params(use_sandbox: T::Boolean).void } + attr_writer :use_sandbox + + sig { returns(String) } + attr_accessor :address + + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + sig { returns(Privy::MoonpayFiatOnRampEthereumConfig) } + attr_reader :config + + sig do + params(config: Privy::MoonpayFiatOnRampEthereumConfig::OrHash).void + end + attr_writer :config + + # Sandbox configuration for a Moonpay on-ramp. + sig do + params( + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig::OrHash, + use_sandbox: T::Boolean + ).returns(T.attached_class) + end + def self.new( + address:, + # Configuration for a Moonpay fiat on-ramp for an Ethereum-compatible chain. + config:, + use_sandbox: nil + ) + end + + sig do + override.returns( + { + use_sandbox: T::Boolean, + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig + } + ) + end + def to_hash + end + end + + class MoonpayFiatOnRampSolanaInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampSolanaInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_sandbox + + sig { params(use_sandbox: T::Boolean).void } + attr_writer :use_sandbox + + sig { returns(String) } + attr_accessor :address + + # Configuration for a Moonpay fiat on-ramp for Solana. + sig { returns(Privy::MoonpayFiatOnRampSolanaConfig) } + attr_reader :config + + sig do + params(config: Privy::MoonpayFiatOnRampSolanaConfig::OrHash).void + end + attr_writer :config + + # Sandbox configuration for a Moonpay on-ramp. + sig do + params( + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig::OrHash, + use_sandbox: T::Boolean + ).returns(T.attached_class) + end + def self.new( + address:, + # Configuration for a Moonpay fiat on-ramp for Solana. + config:, + use_sandbox: nil + ) + end + + sig do + override.returns( + { + use_sandbox: T::Boolean, + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig + } + ) + end + def to_hash + end + end + + sig do + override.returns(T::Array[Privy::MoonpayOnRampSignInput::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/moonpay_on_ramp_sign_response.rbi b/rbi/privy/models/moonpay_on_ramp_sign_response.rbi new file mode 100644 index 0000000..54e86f1 --- /dev/null +++ b/rbi/privy/models/moonpay_on_ramp_sign_response.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class MoonpayOnRampSignResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::MoonpayOnRampSignResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :external_transaction_id + + sig { returns(String) } + attr_accessor :signed_url + + # The response from signing a Moonpay on-ramp. + sig do + params(external_transaction_id: String, signed_url: String).returns( + T.attached_class + ) + end + def self.new(external_transaction_id:, signed_url:) + end + + sig do + override.returns( + { external_transaction_id: String, signed_url: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_payment_method.rbi b/rbi/privy/models/moonpay_payment_method.rbi new file mode 100644 index 0000000..3e4ed07 --- /dev/null +++ b/rbi/privy/models/moonpay_payment_method.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Privy + module Models + # A payment method supported by Moonpay on-ramp. + module MoonpayPaymentMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::MoonpayPaymentMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ACH_BANK_TRANSFER = + T.let(:ach_bank_transfer, Privy::MoonpayPaymentMethod::TaggedSymbol) + CREDIT_DEBIT_CARD = + T.let(:credit_debit_card, Privy::MoonpayPaymentMethod::TaggedSymbol) + GBP_BANK_TRANSFER = + T.let(:gbp_bank_transfer, Privy::MoonpayPaymentMethod::TaggedSymbol) + GBP_OPEN_BANKING_PAYMENT = + T.let( + :gbp_open_banking_payment, + Privy::MoonpayPaymentMethod::TaggedSymbol + ) + MOBILE_WALLET = + T.let(:mobile_wallet, Privy::MoonpayPaymentMethod::TaggedSymbol) + SEPA_BANK_TRANSFER = + T.let(:sepa_bank_transfer, Privy::MoonpayPaymentMethod::TaggedSymbol) + SEPA_OPEN_BANKING_PAYMENT = + T.let( + :sepa_open_banking_payment, + Privy::MoonpayPaymentMethod::TaggedSymbol + ) + PIX_INSTANT_PAYMENT = + T.let(:pix_instant_payment, Privy::MoonpayPaymentMethod::TaggedSymbol) + YELLOW_CARD_BANK_TRANSFER = + T.let( + :yellow_card_bank_transfer, + Privy::MoonpayPaymentMethod::TaggedSymbol + ) + + sig do + override.returns(T::Array[Privy::MoonpayPaymentMethod::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/moonpay_solana_currency_code.rbi b/rbi/privy/models/moonpay_solana_currency_code.rbi new file mode 100644 index 0000000..14809d4 --- /dev/null +++ b/rbi/privy/models/moonpay_solana_currency_code.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # A Moonpay currency code for a Solana asset. + module MoonpaySolanaCurrencyCode + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::MoonpaySolanaCurrencyCode) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOL = T.let(:SOL, Privy::MoonpaySolanaCurrencyCode::TaggedSymbol) + USDC_SOL = + T.let(:USDC_SOL, Privy::MoonpaySolanaCurrencyCode::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::MoonpaySolanaCurrencyCode::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/moonpay_ui_config.rbi b/rbi/privy/models/moonpay_ui_config.rbi new file mode 100644 index 0000000..cb9fb7b --- /dev/null +++ b/rbi/privy/models/moonpay_ui_config.rbi @@ -0,0 +1,45 @@ +# typed: strong + +module Privy + module Models + class MoonpayUiConfig < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::MoonpayUiConfig, Privy::Internal::AnyHash) } + + sig { returns(T.nilable(String)) } + attr_reader :accent_color + + sig { params(accent_color: String).void } + attr_writer :accent_color + + # The theme for the Moonpay on-ramp widget. + sig { returns(T.nilable(Privy::MoonpayUiTheme::OrSymbol)) } + attr_reader :theme + + sig { params(theme: Privy::MoonpayUiTheme::OrSymbol).void } + attr_writer :theme + + # UI configuration for the Moonpay on-ramp widget. + sig do + params( + accent_color: String, + theme: Privy::MoonpayUiTheme::OrSymbol + ).returns(T.attached_class) + end + def self.new( + accent_color: nil, + # The theme for the Moonpay on-ramp widget. + theme: nil + ) + end + + sig do + override.returns( + { accent_color: String, theme: Privy::MoonpayUiTheme::OrSymbol } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/moonpay_ui_theme.rbi b/rbi/privy/models/moonpay_ui_theme.rbi new file mode 100644 index 0000000..c86eb4e --- /dev/null +++ b/rbi/privy/models/moonpay_ui_theme.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Privy + module Models + # The theme for the Moonpay on-ramp widget. + module MoonpayUiTheme + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::MoonpayUiTheme) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + LIGHT = T.let(:light, Privy::MoonpayUiTheme::TaggedSymbol) + DARK = T.let(:dark, Privy::MoonpayUiTheme::TaggedSymbol) + + sig { override.returns(T::Array[Privy::MoonpayUiTheme::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/named_token_transfer_source.rbi b/rbi/privy/models/named_token_transfer_source.rbi new file mode 100644 index 0000000..35bb49b --- /dev/null +++ b/rbi/privy/models/named_token_transfer_source.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Privy + module Models + class NamedTokenTransferSource < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::NamedTokenTransferSource, Privy::Internal::AnyHash) + end + + # Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 + # USDC, "0.01" for 0.01 ETH). Not in the smallest on-chain unit (wei, lamports, + # etc.). + sig { returns(String) } + attr_accessor :amount + + # The asset to transfer. Supported: 'usdc', 'usdb', 'usdt' (stablecoins), 'eth' + # (native Ethereum), 'sol' (native Solana). + sig { returns(String) } + attr_accessor :asset + + # The blockchain network on which to perform the transfer. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and their + # respective testnets. + sig { returns(String) } + attr_accessor :chain + + # Source for a transfer identified by a named asset (e.g. "usdc", "eth"). Use this + # variant for first-class assets maintained by Privy. + sig do + params(amount: String, asset: String, chain: String).returns( + T.attached_class + ) + end + def self.new( + # Amount as a decimal string in the token's standard unit (e.g. "1.5" for 1.5 + # USDC, "0.01" for 0.01 ETH). Not in the smallest on-chain unit (wei, lamports, + # etc.). + amount:, + # The asset to transfer. Supported: 'usdc', 'usdb', 'usdt' (stablecoins), 'eth' + # (native Ethereum), 'sol' (native Solana). + asset:, + # The blockchain network on which to perform the transfer. Supported chains + # include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and their + # respective testnets. + chain: + ) + end + + sig { override.returns({ amount: String, asset: String, chain: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_authenticate_recovery_response.rbi b/rbi/privy/models/oauth_authenticate_recovery_response.rbi new file mode 100644 index 0000000..2c1e83a --- /dev/null +++ b/rbi/privy/models/oauth_authenticate_recovery_response.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class OAuthAuthenticateRecoveryResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::OAuthAuthenticateRecoveryResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :access_token + + # The response from authenticating with OAuth for recovery. + sig { params(access_token: String).returns(T.attached_class) } + def self.new(access_token:) + end + + sig { override.returns({ access_token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_authenticate_request_body.rbi b/rbi/privy/models/oauth_authenticate_request_body.rbi new file mode 100644 index 0000000..3657e11 --- /dev/null +++ b/rbi/privy/models/oauth_authenticate_request_body.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Privy + module Models + class OAuthAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthAuthenticateRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :authorization_code + + sig { returns(String) } + attr_accessor :state_code + + # The type of OAuth authorization code. + sig { returns(T.nilable(Privy::OAuthCodeType::OrSymbol)) } + attr_reader :code_type + + sig { params(code_type: Privy::OAuthCodeType::OrSymbol).void } + attr_writer :code_type + + sig { returns(T.nilable(String)) } + attr_reader :code_verifier + + sig { params(code_verifier: String).void } + attr_writer :code_verifier + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # The request body for authenticating an OAuth account. + sig do + params( + authorization_code: String, + state_code: String, + code_type: Privy::OAuthCodeType::OrSymbol, + code_verifier: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + authorization_code:, + state_code:, + # The type of OAuth authorization code. + code_type: nil, + code_verifier: nil, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { + authorization_code: String, + state_code: String, + code_type: Privy::OAuthCodeType::OrSymbol, + code_verifier: String, + mode: Privy::AuthenticateModeOption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_authorization_code_request_body.rbi b/rbi/privy/models/oauth_authorization_code_request_body.rbi new file mode 100644 index 0000000..5306224 --- /dev/null +++ b/rbi/privy/models/oauth_authorization_code_request_body.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Privy + module Models + class OAuthAuthorizationCodeRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::OAuthAuthorizationCodeRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code_challenge + + sig { returns(String) } + attr_accessor :redirect_to + + sig { returns(String) } + attr_accessor :state + + # The request body for getting an OAuth authorization code. + sig do + params( + code_challenge: String, + redirect_to: String, + state: String + ).returns(T.attached_class) + end + def self.new(code_challenge:, redirect_to:, state:) + end + + sig do + override.returns( + { code_challenge: String, redirect_to: String, state: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_callback_icloud_expo_input.rbi b/rbi/privy/models/oauth_callback_icloud_expo_input.rbi new file mode 100644 index 0000000..658608b --- /dev/null +++ b/rbi/privy/models/oauth_callback_icloud_expo_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class OAuthCallbackICloudExpoInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthCallbackICloudExpoInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :ck_web_auth_token + + # The input for the iCloud Expo OAuth callback. + sig { params(ck_web_auth_token: String).returns(T.attached_class) } + def self.new(ck_web_auth_token:) + end + + sig { override.returns({ ck_web_auth_token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_code_type.rbi b/rbi/privy/models/oauth_code_type.rbi new file mode 100644 index 0000000..a546ccf --- /dev/null +++ b/rbi/privy/models/oauth_code_type.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Privy + module Models + # The type of OAuth authorization code. + module OAuthCodeType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::OAuthCodeType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RAW = T.let(:raw, Privy::OAuthCodeType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::OAuthCodeType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/oauth_init_icloud_recovery_input.rbi b/rbi/privy/models/oauth_init_icloud_recovery_input.rbi new file mode 100644 index 0000000..f3f336b --- /dev/null +++ b/rbi/privy/models/oauth_init_icloud_recovery_input.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class OAuthInitICloudRecoveryInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthInitICloudRecoveryInput, Privy::Internal::AnyHash) + end + + # The client type for iCloud recovery operations. + sig { returns(Privy::ICloudClientType::OrSymbol) } + attr_accessor :client_type + + # The input for initiating an iCloud OAuth recovery flow. + sig do + params(client_type: Privy::ICloudClientType::OrSymbol).returns( + T.attached_class + ) + end + def self.new( + # The client type for iCloud recovery operations. + client_type: + ) + end + + sig do + override.returns({ client_type: Privy::ICloudClientType::OrSymbol }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_init_recovery_input.rbi b/rbi/privy/models/oauth_init_recovery_input.rbi new file mode 100644 index 0000000..b64b4be --- /dev/null +++ b/rbi/privy/models/oauth_init_recovery_input.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class OAuthInitRecoveryInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthInitRecoveryInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :redirect_to + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :code_challenge + + sig { params(code_challenge: String).void } + attr_writer :code_challenge + + sig { returns(T.nilable(String)) } + attr_reader :state_code + + sig { params(state_code: String).void } + attr_writer :state_code + + # The input for initiating an OAuth recovery flow. + sig do + params( + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + ).returns(T.attached_class) + end + def self.new( + redirect_to:, + token: nil, + code_challenge: nil, + state_code: nil + ) + end + + sig do + override.returns( + { + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_init_request_body.rbi b/rbi/privy/models/oauth_init_request_body.rbi new file mode 100644 index 0000000..df5882a --- /dev/null +++ b/rbi/privy/models/oauth_init_request_body.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class OAuthInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthInitRequestBody, Privy::Internal::AnyHash) + end + + # The ID of an OAuth provider. + sig { returns(T.any(Privy::ExternalOAuthProviderID::OrSymbol, String)) } + attr_accessor :provider + + sig { returns(String) } + attr_accessor :redirect_to + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :code_challenge + + sig { params(code_challenge: String).void } + attr_writer :code_challenge + + sig { returns(T.nilable(String)) } + attr_reader :state_code + + sig { params(state_code: String).void } + attr_writer :state_code + + # The request body for initiating an OAuth ceremony. + sig do + params( + provider: T.any(Privy::ExternalOAuthProviderID::OrSymbol, String), + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + ).returns(T.attached_class) + end + def self.new( + # The ID of an OAuth provider. + provider:, + redirect_to:, + token: nil, + code_challenge: nil, + state_code: nil + ) + end + + sig do + override.returns( + { + provider: T.any(Privy::ExternalOAuthProviderID::OrSymbol, String), + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_init_response_body.rbi b/rbi/privy/models/oauth_init_response_body.rbi new file mode 100644 index 0000000..5eecac7 --- /dev/null +++ b/rbi/privy/models/oauth_init_response_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class OAuthInitResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthInitResponseBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :url + + # The response for initiating an OAuth ceremony. + sig { params(url: String).returns(T.attached_class) } + def self.new(url:) + end + + sig { override.returns({ url: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_link_request_body.rbi b/rbi/privy/models/oauth_link_request_body.rbi new file mode 100644 index 0000000..25fdd15 --- /dev/null +++ b/rbi/privy/models/oauth_link_request_body.rbi @@ -0,0 +1,62 @@ +# typed: strong + +module Privy + module Models + class OAuthLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :authorization_code + + sig { returns(String) } + attr_accessor :state_code + + # The type of OAuth authorization code. + sig { returns(T.nilable(Privy::OAuthCodeType::OrSymbol)) } + attr_reader :code_type + + sig { params(code_type: Privy::OAuthCodeType::OrSymbol).void } + attr_writer :code_type + + sig { returns(T.nilable(String)) } + attr_reader :code_verifier + + sig { params(code_verifier: String).void } + attr_writer :code_verifier + + # The request body for linking an OAuth account. + sig do + params( + authorization_code: String, + state_code: String, + code_type: Privy::OAuthCodeType::OrSymbol, + code_verifier: String + ).returns(T.attached_class) + end + def self.new( + authorization_code:, + state_code:, + # The type of OAuth authorization code. + code_type: nil, + code_verifier: nil + ) + end + + sig do + override.returns( + { + authorization_code: String, + state_code: String, + code_type: Privy::OAuthCodeType::OrSymbol, + code_verifier: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_link_response_body.rbi b/rbi/privy/models/oauth_link_response_body.rbi new file mode 100644 index 0000000..f646b99 --- /dev/null +++ b/rbi/privy/models/oauth_link_response_body.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class OAuthLinkResponseBody < Privy::Models::User + OrHash = + T.type_alias do + T.any(Privy::OAuthLinkResponseBody, Privy::Internal::AnyHash) + end + + # OAuth tokens associated with the user. + sig { returns(T.nilable(Privy::OAuthTokens)) } + attr_reader :oauth_tokens + + sig { params(oauth_tokens: Privy::OAuthTokens::OrHash).void } + attr_writer :oauth_tokens + + # The response for linking an OAuth account. + sig do + params(oauth_tokens: Privy::OAuthTokens::OrHash).returns( + T.attached_class + ) + end + def self.new( + # OAuth tokens associated with the user. + oauth_tokens: nil + ) + end + + sig { override.returns({ oauth_tokens: Privy::OAuthTokens }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_provider_id.rbi b/rbi/privy/models/oauth_provider_id.rbi new file mode 100644 index 0000000..f44807b --- /dev/null +++ b/rbi/privy/models/oauth_provider_id.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Privy + module Models + # The ID of an OAuth provider. + module OAuthProviderID + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any(Privy::ExternalOAuthProviderID::TaggedSymbol, String) + end + + sig { override.returns(T::Array[Privy::OAuthProviderID::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/oauth_tokens.rbi b/rbi/privy/models/oauth_tokens.rbi new file mode 100644 index 0000000..dc797c6 --- /dev/null +++ b/rbi/privy/models/oauth_tokens.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module Privy + module Models + class OAuthTokens < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::OAuthTokens, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :access_token + + sig { returns(String) } + attr_accessor :provider + + sig { returns(T.nilable(Float)) } + attr_reader :access_token_expires_in_seconds + + sig { params(access_token_expires_in_seconds: Float).void } + attr_writer :access_token_expires_in_seconds + + sig { returns(T.nilable(String)) } + attr_reader :refresh_token + + sig { params(refresh_token: String).void } + attr_writer :refresh_token + + sig { returns(T.nilable(Float)) } + attr_reader :refresh_token_expires_in_seconds + + sig { params(refresh_token_expires_in_seconds: Float).void } + attr_writer :refresh_token_expires_in_seconds + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :scopes + + sig { params(scopes: T::Array[String]).void } + attr_writer :scopes + + # OAuth tokens associated with the user. + sig do + params( + access_token: String, + provider: String, + access_token_expires_in_seconds: Float, + refresh_token: String, + refresh_token_expires_in_seconds: Float, + scopes: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + access_token:, + provider:, + access_token_expires_in_seconds: nil, + refresh_token: nil, + refresh_token_expires_in_seconds: nil, + scopes: nil + ) + end + + sig do + override.returns( + { + access_token: String, + provider: String, + access_token_expires_in_seconds: Float, + refresh_token: String, + refresh_token_expires_in_seconds: Float, + scopes: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_transfer_request_body.rbi b/rbi/privy/models/oauth_transfer_request_body.rbi new file mode 100644 index 0000000..b9eb6f8 --- /dev/null +++ b/rbi/privy/models/oauth_transfer_request_body.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class OAuthTransferRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthTransferRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :nonce + + # User info for an OAuth transfer. + sig { returns(Privy::OAuthTransferUserInfo) } + attr_reader :user_info + + sig { params(user_info: Privy::OAuthTransferUserInfo::OrHash).void } + attr_writer :user_info + + # The request body for transferring an OAuth account. + sig do + params( + nonce: String, + user_info: Privy::OAuthTransferUserInfo::OrHash + ).returns(T.attached_class) + end + def self.new( + nonce:, + # User info for an OAuth transfer. + user_info: + ) + end + + sig do + override.returns( + { nonce: String, user_info: Privy::OAuthTransferUserInfo } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_transfer_user_info.rbi b/rbi/privy/models/oauth_transfer_user_info.rbi new file mode 100644 index 0000000..6f9050c --- /dev/null +++ b/rbi/privy/models/oauth_transfer_user_info.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module Privy + module Models + class OAuthTransferUserInfo < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthTransferUserInfo, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig { returns(T.nilable(String)) } + attr_accessor :email + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :embedded_wallet_addresses + + sig { params(embedded_wallet_addresses: T::Array[String]).void } + attr_writer :embedded_wallet_addresses + + # Metadata for an OAuth transfer user info. + sig { returns(T.nilable(Privy::OAuthTransferUserInfoMeta)) } + attr_reader :meta + + sig { params(meta: Privy::OAuthTransferUserInfoMeta::OrHash).void } + attr_writer :meta + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :profile_picture_url + + sig { params(profile_picture_url: String).void } + attr_writer :profile_picture_url + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :smart_wallet_addresses + + sig { params(smart_wallet_addresses: T::Array[String]).void } + attr_writer :smart_wallet_addresses + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + sig { returns(T.nilable(String)) } + attr_reader :vanity_name + + sig { params(vanity_name: String).void } + attr_writer :vanity_name + + # User info for an OAuth transfer. + sig do + params( + subject: String, + email: T.nilable(String), + embedded_wallet_addresses: T::Array[String], + meta: Privy::OAuthTransferUserInfoMeta::OrHash, + name: String, + profile_picture_url: String, + smart_wallet_addresses: T::Array[String], + username: String, + vanity_name: String + ).returns(T.attached_class) + end + def self.new( + subject:, + email: nil, + embedded_wallet_addresses: nil, + # Metadata for an OAuth transfer user info. + meta: nil, + name: nil, + profile_picture_url: nil, + smart_wallet_addresses: nil, + username: nil, + vanity_name: nil + ) + end + + sig do + override.returns( + { + subject: String, + email: T.nilable(String), + embedded_wallet_addresses: T::Array[String], + meta: Privy::OAuthTransferUserInfoMeta, + name: String, + profile_picture_url: String, + smart_wallet_addresses: T::Array[String], + username: String, + vanity_name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_transfer_user_info_meta.rbi b/rbi/privy/models/oauth_transfer_user_info_meta.rbi new file mode 100644 index 0000000..4c26990 --- /dev/null +++ b/rbi/privy/models/oauth_transfer_user_info_meta.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class OAuthTransferUserInfoMeta < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthTransferUserInfoMeta, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :provider_app_id + + sig { params(provider_app_id: String).void } + attr_writer :provider_app_id + + # Metadata for an OAuth transfer user info. + sig { params(provider_app_id: String).returns(T.attached_class) } + def self.new(provider_app_id: nil) + end + + sig { override.returns({ provider_app_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_unlink_request_body.rbi b/rbi/privy/models/oauth_unlink_request_body.rbi new file mode 100644 index 0000000..c65e590 --- /dev/null +++ b/rbi/privy/models/oauth_unlink_request_body.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class OAuthUnlinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthUnlinkRequestBody, Privy::Internal::AnyHash) + end + + # The ID of an OAuth provider. + sig { returns(T.any(Privy::ExternalOAuthProviderID::OrSymbol, String)) } + attr_accessor :provider + + sig { returns(String) } + attr_accessor :subject + + # The request body for unlinking an OAuth account. + sig do + params( + provider: T.any(Privy::ExternalOAuthProviderID::OrSymbol, String), + subject: String + ).returns(T.attached_class) + end + def self.new( + # The ID of an OAuth provider. + provider:, + subject: + ) + end + + sig do + override.returns( + { + provider: T.any(Privy::ExternalOAuthProviderID::OrSymbol, String), + subject: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_verify_request_body.rbi b/rbi/privy/models/oauth_verify_request_body.rbi new file mode 100644 index 0000000..d9ddff8 --- /dev/null +++ b/rbi/privy/models/oauth_verify_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class OAuthVerifyRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthVerifyRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :prat + + # The request body for verifying a PRAT. + sig { params(prat: String).returns(T.attached_class) } + def self.new(prat:) + end + + sig { override.returns({ prat: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/oauth_verify_response_body.rbi b/rbi/privy/models/oauth_verify_response_body.rbi new file mode 100644 index 0000000..fed7a38 --- /dev/null +++ b/rbi/privy/models/oauth_verify_response_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class OAuthVerifyResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OAuthVerifyResponseBody, Privy::Internal::AnyHash) + end + + sig { returns(T::Boolean) } + attr_accessor :verified + + # The response body when verifying a PRAT. + sig { params(verified: T::Boolean).returns(T.attached_class) } + def self.new(verified:) + end + + sig { override.returns({ verified: T::Boolean }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/onramp_provider.rbi b/rbi/privy/models/onramp_provider.rbi new file mode 100644 index 0000000..73d0807 --- /dev/null +++ b/rbi/privy/models/onramp_provider.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + # Valid set of onramp providers + module OnrampProvider + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::OnrampProvider) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BRIDGE = T.let(:bridge, Privy::OnrampProvider::TaggedSymbol) + BRIDGE_SANDBOX = + T.let(:"bridge-sandbox", Privy::OnrampProvider::TaggedSymbol) + + sig { override.returns(T::Array[Privy::OnrampProvider::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/optional_refresh_token_input.rbi b/rbi/privy/models/optional_refresh_token_input.rbi new file mode 100644 index 0000000..0f8ed76 --- /dev/null +++ b/rbi/privy/models/optional_refresh_token_input.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class OptionalRefreshTokenInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OptionalRefreshTokenInput, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :refresh_token + + sig { params(refresh_token: String).void } + attr_writer :refresh_token + + # The input for refreshing a session or logging out. + sig { params(refresh_token: String).returns(T.attached_class) } + def self.new(refresh_token: nil) + end + + sig { override.returns({ refresh_token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/organization_secret_id_input.rbi b/rbi/privy/models/organization_secret_id_input.rbi new file mode 100644 index 0000000..95b6b3d --- /dev/null +++ b/rbi/privy/models/organization_secret_id_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class OrganizationSecretIDInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OrganizationSecretIDInput, Privy::Internal::AnyHash) + end + + # The organization secret ID. + sig { returns(String) } + attr_accessor :secret_id + + # Request body for targeting a specific organization secret. + sig { params(secret_id: String).returns(T.attached_class) } + def self.new( + # The organization secret ID. + secret_id: + ) + end + + sig { override.returns({ secret_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/organization_secret_view.rbi b/rbi/privy/models/organization_secret_view.rbi new file mode 100644 index 0000000..aa87d37 --- /dev/null +++ b/rbi/privy/models/organization_secret_view.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Privy + module Models + class OrganizationSecretView < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OrganizationSecretView, Privy::Internal::AnyHash) + end + + # Unique secret identifier + sig { returns(String) } + attr_accessor :id + + # ISO 8601 creation timestamp + sig { returns(String) } + attr_accessor :created_at + + # Last four characters of the secret + sig { returns(String) } + attr_accessor :last_four + + # ISO 8601 revocation timestamp, or null if active + sig { returns(T.nilable(String)) } + attr_accessor :revoked_at + + # P-256 public key in PEM format for request signing, or null if not configured + sig { returns(T.nilable(String)) } + attr_accessor :signing_public_key + + # View of an organization secret for list and management endpoints. + sig do + params( + id: String, + created_at: String, + last_four: String, + revoked_at: T.nilable(String), + signing_public_key: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Unique secret identifier + id:, + # ISO 8601 creation timestamp + created_at:, + # Last four characters of the secret + last_four:, + # ISO 8601 revocation timestamp, or null if active + revoked_at:, + # P-256 public key in PEM format for request signing, or null if not configured + signing_public_key: + ) + end + + sig do + override.returns( + { + id: String, + created_at: String, + last_four: String, + revoked_at: T.nilable(String), + signing_public_key: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/organization_secrets_list_response.rbi b/rbi/privy/models/organization_secrets_list_response.rbi new file mode 100644 index 0000000..43052cf --- /dev/null +++ b/rbi/privy/models/organization_secrets_list_response.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class OrganizationSecretsListResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::OrganizationSecretsListResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[Privy::OrganizationSecretView]) } + attr_accessor :data + + # Response returned when listing organization secrets for an account. + sig do + params(data: T::Array[Privy::OrganizationSecretView::OrHash]).returns( + T.attached_class + ) + end + def self.new(data:) + end + + sig do + override.returns({ data: T::Array[Privy::OrganizationSecretView] }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/output_with_previous_transaction_data.rbi b/rbi/privy/models/output_with_previous_transaction_data.rbi new file mode 100644 index 0000000..a10f4d9 --- /dev/null +++ b/rbi/privy/models/output_with_previous_transaction_data.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class OutputWithPreviousTransactionData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::OutputWithPreviousTransactionData, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :previous_transaction_hash + + sig { returns(Float) } + attr_accessor :previous_transaction_vout + + # A Spark token output. + sig { returns(T.nilable(Privy::TokenOutput)) } + attr_reader :output + + sig { params(output: Privy::TokenOutput::OrHash).void } + attr_writer :output + + # A Spark token output with its previous transaction data. + sig do + params( + previous_transaction_hash: String, + previous_transaction_vout: Float, + output: Privy::TokenOutput::OrHash + ).returns(T.attached_class) + end + def self.new( + previous_transaction_hash:, + previous_transaction_vout:, + # A Spark token output. + output: nil + ) + end + + sig do + override.returns( + { + previous_transaction_hash: String, + previous_transaction_vout: Float, + output: Privy::TokenOutput + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/owner_id_input.rbi b/rbi/privy/models/owner_id_input.rbi new file mode 100644 index 0000000..00bd87c --- /dev/null +++ b/rbi/privy/models/owner_id_input.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + OwnerIDInput = String + end +end diff --git a/rbi/privy/models/owner_input.rbi b/rbi/privy/models/owner_input.rbi new file mode 100644 index 0000000..5f792e6 --- /dev/null +++ b/rbi/privy/models/owner_input.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Privy + module Models + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + module OwnerInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + end + + sig { override.returns(T::Array[Privy::OwnerInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/owner_input_public_key.rbi b/rbi/privy/models/owner_input_public_key.rbi new file mode 100644 index 0000000..851bfd2 --- /dev/null +++ b/rbi/privy/models/owner_input_public_key.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class OwnerInputPublicKey < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::OwnerInputPublicKey, Privy::Internal::AnyHash) + end + + # A P-256 (secp256r1) public key. + sig { returns(String) } + attr_accessor :public_key + + # Owner input specifying a P-256 public key. + sig { params(public_key: String).returns(T.attached_class) } + def self.new( + # A P-256 (secp256r1) public key. + public_key: + ) + end + + sig { override.returns({ public_key: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/owner_input_user.rbi b/rbi/privy/models/owner_input_user.rbi new file mode 100644 index 0000000..64f59ea --- /dev/null +++ b/rbi/privy/models/owner_input_user.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + class OwnerInputUser < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::OwnerInputUser, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :user_id + + # Owner input specifying a Privy user ID. + sig { params(user_id: String).returns(T.attached_class) } + def self.new(user_id:) + end + + sig { override.returns({ user_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/p_256_public_key.rbi b/rbi/privy/models/p_256_public_key.rbi new file mode 100644 index 0000000..27eaef5 --- /dev/null +++ b/rbi/privy/models/p_256_public_key.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + P256PublicKey = String + end +end diff --git a/rbi/privy/models/passkey_assertion_response.rbi b/rbi/privy/models/passkey_assertion_response.rbi new file mode 100644 index 0000000..9fc9ce4 --- /dev/null +++ b/rbi/privy/models/passkey_assertion_response.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + class PasskeyAssertionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyAssertionResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :authenticator_data + + sig { returns(String) } + attr_accessor :client_data_json + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_reader :user_handle + + sig { params(user_handle: String).void } + attr_writer :user_handle + + # The authenticator assertion response from a WebAuthn authentication ceremony. + sig do + params( + authenticator_data: String, + client_data_json: String, + signature: String, + user_handle: String + ).returns(T.attached_class) + end + def self.new( + authenticator_data:, + client_data_json:, + signature:, + user_handle: nil + ) + end + + sig do + override.returns( + { + authenticator_data: String, + client_data_json: String, + signature: String, + user_handle: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_attestation_response.rbi b/rbi/privy/models/passkey_attestation_response.rbi new file mode 100644 index 0000000..bf21779 --- /dev/null +++ b/rbi/privy/models/passkey_attestation_response.rbi @@ -0,0 +1,78 @@ +# typed: strong + +module Privy + module Models + class PasskeyAttestationResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyAttestationResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :attestation_object + + sig { returns(String) } + attr_accessor :client_data_json + + sig { returns(T.nilable(String)) } + attr_reader :authenticator_data + + sig { params(authenticator_data: String).void } + attr_writer :authenticator_data + + sig { returns(T.nilable(String)) } + attr_reader :public_key + + sig { params(public_key: String).void } + attr_writer :public_key + + sig { returns(T.nilable(Float)) } + attr_reader :public_key_algorithm + + sig { params(public_key_algorithm: Float).void } + attr_writer :public_key_algorithm + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :transports + + sig { params(transports: T::Array[String]).void } + attr_writer :transports + + # The authenticator attestation response from a WebAuthn registration ceremony. + sig do + params( + attestation_object: String, + client_data_json: String, + authenticator_data: String, + public_key: String, + public_key_algorithm: Float, + transports: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + attestation_object:, + client_data_json:, + authenticator_data: nil, + public_key: nil, + public_key_algorithm: nil, + transports: nil + ) + end + + sig do + override.returns( + { + attestation_object: String, + client_data_json: String, + authenticator_data: String, + public_key: String, + public_key_algorithm: Float, + transports: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_authenticate_input.rbi b/rbi/privy/models/passkey_authenticate_input.rbi new file mode 100644 index 0000000..430816f --- /dev/null +++ b/rbi/privy/models/passkey_authenticate_input.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class PasskeyAuthenticateInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyAuthenticateInput, Privy::Internal::AnyHash) + end + + # WebAuthn authentication response as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorVerifyResponse) } + attr_reader :authenticator_response + + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorVerifyResponse::OrHash + ).void + end + attr_writer :authenticator_response + + sig { returns(String) } + attr_accessor :challenge + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Input for authenticating with a passkey. + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorVerifyResponse::OrHash, + challenge: String, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn authentication response as defined by the Web Authentication + # specification. + authenticator_response:, + challenge:, + relying_party: nil + ) + end + + sig do + override.returns( + { + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + challenge: String, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_authenticator_enrollment_options.rbi b/rbi/privy/models/passkey_authenticator_enrollment_options.rbi new file mode 100644 index 0000000..ffa9da6 --- /dev/null +++ b/rbi/privy/models/passkey_authenticator_enrollment_options.rbi @@ -0,0 +1,129 @@ +# typed: strong + +module Privy + module Models + class PasskeyAuthenticatorEnrollmentOptions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasskeyAuthenticatorEnrollmentOptions, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :challenge + + sig { returns(T::Array[Privy::PasskeyPubKeyCredParam]) } + attr_accessor :pub_key_cred_params + + # Relying party information for a WebAuthn ceremony. + sig { returns(Privy::PasskeyRelyingParty) } + attr_reader :rp + + sig { params(rp: Privy::PasskeyRelyingParty::OrHash).void } + attr_writer :rp + + # User entity for a WebAuthn registration ceremony. + sig { returns(Privy::PasskeyUser) } + attr_reader :user + + sig { params(user: Privy::PasskeyUser::OrHash).void } + attr_writer :user + + sig { returns(T.nilable(String)) } + attr_reader :attestation + + sig { params(attestation: String).void } + attr_writer :attestation + + # Authenticator selection criteria for a WebAuthn registration ceremony. + sig { returns(T.nilable(Privy::PasskeyAuthenticatorSelection)) } + attr_reader :authenticator_selection + + sig do + params( + authenticator_selection: Privy::PasskeyAuthenticatorSelection::OrHash + ).void + end + attr_writer :authenticator_selection + + sig { returns(T.nilable(T::Array[Privy::PasskeyCredentialDescriptor])) } + attr_reader :exclude_credentials + + sig do + params( + exclude_credentials: + T::Array[Privy::PasskeyCredentialDescriptor::OrHash] + ).void + end + attr_writer :exclude_credentials + + # Extensions for a WebAuthn registration ceremony. + sig { returns(T.nilable(Privy::PasskeyEnrollmentExtensions)) } + attr_reader :extensions + + sig do + params(extensions: Privy::PasskeyEnrollmentExtensions::OrHash).void + end + attr_writer :extensions + + sig { returns(T.nilable(Float)) } + attr_reader :timeout + + sig { params(timeout: Float).void } + attr_writer :timeout + + # WebAuthn registration options as defined by the Web Authentication + # specification. + sig do + params( + challenge: String, + pub_key_cred_params: T::Array[Privy::PasskeyPubKeyCredParam::OrHash], + rp: Privy::PasskeyRelyingParty::OrHash, + user: Privy::PasskeyUser::OrHash, + attestation: String, + authenticator_selection: Privy::PasskeyAuthenticatorSelection::OrHash, + exclude_credentials: + T::Array[Privy::PasskeyCredentialDescriptor::OrHash], + extensions: Privy::PasskeyEnrollmentExtensions::OrHash, + timeout: Float + ).returns(T.attached_class) + end + def self.new( + challenge:, + pub_key_cred_params:, + # Relying party information for a WebAuthn ceremony. + rp:, + # User entity for a WebAuthn registration ceremony. + user:, + attestation: nil, + # Authenticator selection criteria for a WebAuthn registration ceremony. + authenticator_selection: nil, + exclude_credentials: nil, + # Extensions for a WebAuthn registration ceremony. + extensions: nil, + timeout: nil + ) + end + + sig do + override.returns( + { + challenge: String, + pub_key_cred_params: T::Array[Privy::PasskeyPubKeyCredParam], + rp: Privy::PasskeyRelyingParty, + user: Privy::PasskeyUser, + attestation: String, + authenticator_selection: Privy::PasskeyAuthenticatorSelection, + exclude_credentials: T::Array[Privy::PasskeyCredentialDescriptor], + extensions: Privy::PasskeyEnrollmentExtensions, + timeout: Float + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_authenticator_enrollment_response.rbi b/rbi/privy/models/passkey_authenticator_enrollment_response.rbi new file mode 100644 index 0000000..7aa2745 --- /dev/null +++ b/rbi/privy/models/passkey_authenticator_enrollment_response.rbi @@ -0,0 +1,116 @@ +# typed: strong + +module Privy + module Models + class PasskeyAuthenticatorEnrollmentResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasskeyAuthenticatorEnrollmentResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Client extension results returned by the WebAuthn authenticator. + sig { returns(Privy::PasskeyClientExtensionResults) } + attr_reader :client_extension_results + + sig do + params( + client_extension_results: Privy::PasskeyClientExtensionResults::OrHash + ).void + end + attr_writer :client_extension_results + + sig { returns(String) } + attr_accessor :raw_id + + # The authenticator attestation response from a WebAuthn registration ceremony. + sig { returns(Privy::PasskeyAttestationResponse) } + attr_reader :response + + sig { params(response: Privy::PasskeyAttestationResponse::OrHash).void } + attr_writer :response + + sig do + returns(Privy::PasskeyAuthenticatorEnrollmentResponse::Type::OrSymbol) + end + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :authenticator_attachment + + sig { params(authenticator_attachment: String).void } + attr_writer :authenticator_attachment + + # WebAuthn registration response as defined by the Web Authentication + # specification. + sig do + params( + id: String, + client_extension_results: + Privy::PasskeyClientExtensionResults::OrHash, + raw_id: String, + response: Privy::PasskeyAttestationResponse::OrHash, + type: Privy::PasskeyAuthenticatorEnrollmentResponse::Type::OrSymbol, + authenticator_attachment: String + ).returns(T.attached_class) + end + def self.new( + id:, + # Client extension results returned by the WebAuthn authenticator. + client_extension_results:, + raw_id:, + # The authenticator attestation response from a WebAuthn registration ceremony. + response:, + type:, + authenticator_attachment: nil + ) + end + + sig do + override.returns( + { + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAttestationResponse, + type: Privy::PasskeyAuthenticatorEnrollmentResponse::Type::OrSymbol, + authenticator_attachment: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PasskeyAuthenticatorEnrollmentResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PUBLIC_KEY = + T.let( + :"public-key", + Privy::PasskeyAuthenticatorEnrollmentResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::PasskeyAuthenticatorEnrollmentResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/passkey_authenticator_selection.rbi b/rbi/privy/models/passkey_authenticator_selection.rbi new file mode 100644 index 0000000..0385433 --- /dev/null +++ b/rbi/privy/models/passkey_authenticator_selection.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class PasskeyAuthenticatorSelection < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyAuthenticatorSelection, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :authenticator_attachment + + sig { params(authenticator_attachment: String).void } + attr_writer :authenticator_attachment + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_resident_key + + sig { params(require_resident_key: T::Boolean).void } + attr_writer :require_resident_key + + sig { returns(T.nilable(String)) } + attr_reader :resident_key + + sig { params(resident_key: String).void } + attr_writer :resident_key + + sig { returns(T.nilable(String)) } + attr_reader :user_verification + + sig { params(user_verification: String).void } + attr_writer :user_verification + + # Authenticator selection criteria for a WebAuthn registration ceremony. + sig do + params( + authenticator_attachment: String, + require_resident_key: T::Boolean, + resident_key: String, + user_verification: String + ).returns(T.attached_class) + end + def self.new( + authenticator_attachment: nil, + require_resident_key: nil, + resident_key: nil, + user_verification: nil + ) + end + + sig do + override.returns( + { + authenticator_attachment: String, + require_resident_key: T::Boolean, + resident_key: String, + user_verification: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_authenticator_verify_options.rbi b/rbi/privy/models/passkey_authenticator_verify_options.rbi new file mode 100644 index 0000000..bbc3fb1 --- /dev/null +++ b/rbi/privy/models/passkey_authenticator_verify_options.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module Privy + module Models + class PasskeyAuthenticatorVerifyOptions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasskeyAuthenticatorVerifyOptions, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :challenge + + sig { returns(T.nilable(T::Array[Privy::PasskeyCredentialDescriptor])) } + attr_reader :allow_credentials + + sig do + params( + allow_credentials: + T::Array[Privy::PasskeyCredentialDescriptor::OrHash] + ).void + end + attr_writer :allow_credentials + + # Extensions for a WebAuthn authentication ceremony. + sig { returns(T.nilable(Privy::PasskeyVerifyExtensions)) } + attr_reader :extensions + + sig { params(extensions: Privy::PasskeyVerifyExtensions::OrHash).void } + attr_writer :extensions + + sig { returns(T.nilable(String)) } + attr_reader :rp_id + + sig { params(rp_id: String).void } + attr_writer :rp_id + + sig { returns(T.nilable(Float)) } + attr_reader :timeout + + sig { params(timeout: Float).void } + attr_writer :timeout + + sig { returns(T.nilable(String)) } + attr_reader :user_verification + + sig { params(user_verification: String).void } + attr_writer :user_verification + + # WebAuthn authentication options as defined by the Web Authentication + # specification. + sig do + params( + challenge: String, + allow_credentials: + T::Array[Privy::PasskeyCredentialDescriptor::OrHash], + extensions: Privy::PasskeyVerifyExtensions::OrHash, + rp_id: String, + timeout: Float, + user_verification: String + ).returns(T.attached_class) + end + def self.new( + challenge:, + allow_credentials: nil, + # Extensions for a WebAuthn authentication ceremony. + extensions: nil, + rp_id: nil, + timeout: nil, + user_verification: nil + ) + end + + sig do + override.returns( + { + challenge: String, + allow_credentials: T::Array[Privy::PasskeyCredentialDescriptor], + extensions: Privy::PasskeyVerifyExtensions, + rp_id: String, + timeout: Float, + user_verification: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_authenticator_verify_response.rbi b/rbi/privy/models/passkey_authenticator_verify_response.rbi new file mode 100644 index 0000000..64aa121 --- /dev/null +++ b/rbi/privy/models/passkey_authenticator_verify_response.rbi @@ -0,0 +1,114 @@ +# typed: strong + +module Privy + module Models + class PasskeyAuthenticatorVerifyResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasskeyAuthenticatorVerifyResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Client extension results returned by the WebAuthn authenticator. + sig { returns(Privy::PasskeyClientExtensionResults) } + attr_reader :client_extension_results + + sig do + params( + client_extension_results: Privy::PasskeyClientExtensionResults::OrHash + ).void + end + attr_writer :client_extension_results + + sig { returns(String) } + attr_accessor :raw_id + + # The authenticator assertion response from a WebAuthn authentication ceremony. + sig { returns(Privy::PasskeyAssertionResponse) } + attr_reader :response + + sig { params(response: Privy::PasskeyAssertionResponse::OrHash).void } + attr_writer :response + + sig { returns(Privy::PasskeyAuthenticatorVerifyResponse::Type::OrSymbol) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :authenticator_attachment + + sig { params(authenticator_attachment: String).void } + attr_writer :authenticator_attachment + + # WebAuthn authentication response as defined by the Web Authentication + # specification. + sig do + params( + id: String, + client_extension_results: + Privy::PasskeyClientExtensionResults::OrHash, + raw_id: String, + response: Privy::PasskeyAssertionResponse::OrHash, + type: Privy::PasskeyAuthenticatorVerifyResponse::Type::OrSymbol, + authenticator_attachment: String + ).returns(T.attached_class) + end + def self.new( + id:, + # Client extension results returned by the WebAuthn authenticator. + client_extension_results:, + raw_id:, + # The authenticator assertion response from a WebAuthn authentication ceremony. + response:, + type:, + authenticator_attachment: nil + ) + end + + sig do + override.returns( + { + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAssertionResponse, + type: Privy::PasskeyAuthenticatorVerifyResponse::Type::OrSymbol, + authenticator_attachment: String + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PasskeyAuthenticatorVerifyResponse::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PUBLIC_KEY = + T.let( + :"public-key", + Privy::PasskeyAuthenticatorVerifyResponse::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::PasskeyAuthenticatorVerifyResponse::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/passkey_client_extension_results.rbi b/rbi/privy/models/passkey_client_extension_results.rbi new file mode 100644 index 0000000..59a16bc --- /dev/null +++ b/rbi/privy/models/passkey_client_extension_results.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class PasskeyClientExtensionResults < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyClientExtensionResults, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :app_id + + sig { params(app_id: T::Boolean).void } + attr_writer :app_id + + # The result of the WebAuthn credProps extension. + sig { returns(T.nilable(Privy::PasskeyCredPropsResult)) } + attr_reader :cred_props + + sig { params(cred_props: Privy::PasskeyCredPropsResult::OrHash).void } + attr_writer :cred_props + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hmac_create_secret + + sig { params(hmac_create_secret: T::Boolean).void } + attr_writer :hmac_create_secret + + # Client extension results returned by the WebAuthn authenticator. + sig do + params( + app_id: T::Boolean, + cred_props: Privy::PasskeyCredPropsResult::OrHash, + hmac_create_secret: T::Boolean + ).returns(T.attached_class) + end + def self.new( + app_id: nil, + # The result of the WebAuthn credProps extension. + cred_props: nil, + hmac_create_secret: nil + ) + end + + sig do + override.returns( + { + app_id: T::Boolean, + cred_props: Privy::PasskeyCredPropsResult, + hmac_create_secret: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_cred_props_result.rbi b/rbi/privy/models/passkey_cred_props_result.rbi new file mode 100644 index 0000000..6b56a67 --- /dev/null +++ b/rbi/privy/models/passkey_cred_props_result.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class PasskeyCredPropsResult < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyCredPropsResult, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :rk + + sig { params(rk: T::Boolean).void } + attr_writer :rk + + # The result of the WebAuthn credProps extension. + sig { params(rk: T::Boolean).returns(T.attached_class) } + def self.new(rk: nil) + end + + sig { override.returns({ rk: T::Boolean }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_credential_descriptor.rbi b/rbi/privy/models/passkey_credential_descriptor.rbi new file mode 100644 index 0000000..53187fd --- /dev/null +++ b/rbi/privy/models/passkey_credential_descriptor.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Privy + module Models + class PasskeyCredentialDescriptor < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyCredentialDescriptor, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :type + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :transports + + sig { params(transports: T::Array[String]).void } + attr_writer :transports + + # A WebAuthn credential descriptor identifying a specific public key credential. + sig do + params(id: String, type: String, transports: T::Array[String]).returns( + T.attached_class + ) + end + def self.new(id:, type:, transports: nil) + end + + sig do + override.returns( + { id: String, type: String, transports: T::Array[String] } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_enrollment_extensions.rbi b/rbi/privy/models/passkey_enrollment_extensions.rbi new file mode 100644 index 0000000..b700502 --- /dev/null +++ b/rbi/privy/models/passkey_enrollment_extensions.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class PasskeyEnrollmentExtensions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyEnrollmentExtensions, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :app_id + + sig { params(app_id: String).void } + attr_writer :app_id + + # The result of the WebAuthn credProps extension. + sig { returns(T.nilable(Privy::PasskeyCredPropsResult)) } + attr_reader :cred_props + + sig { params(cred_props: Privy::PasskeyCredPropsResult::OrHash).void } + attr_writer :cred_props + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hmac_create_secret + + sig { params(hmac_create_secret: T::Boolean).void } + attr_writer :hmac_create_secret + + # Extensions for a WebAuthn registration ceremony. + sig do + params( + app_id: String, + cred_props: Privy::PasskeyCredPropsResult::OrHash, + hmac_create_secret: T::Boolean + ).returns(T.attached_class) + end + def self.new( + app_id: nil, + # The result of the WebAuthn credProps extension. + cred_props: nil, + hmac_create_secret: nil + ) + end + + sig do + override.returns( + { + app_id: String, + cred_props: Privy::PasskeyCredPropsResult, + hmac_create_secret: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_init_input.rbi b/rbi/privy/models/passkey_init_input.rbi new file mode 100644 index 0000000..1463ccb --- /dev/null +++ b/rbi/privy/models/passkey_init_input.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class PasskeyInitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyInitInput, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Input for initiating a passkey ceremony. + sig do + params(token: String, relying_party: String).returns(T.attached_class) + end + def self.new(token: nil, relying_party: nil) + end + + sig { override.returns({ token: String, relying_party: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_link_input.rbi b/rbi/privy/models/passkey_link_input.rbi new file mode 100644 index 0000000..a2e8b9c --- /dev/null +++ b/rbi/privy/models/passkey_link_input.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class PasskeyLinkInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyLinkInput, Privy::Internal::AnyHash) + end + + # WebAuthn registration response as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorEnrollmentResponse) } + attr_reader :authenticator_response + + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorEnrollmentResponse::OrHash + ).void + end + attr_writer :authenticator_response + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Input for linking a passkey credential. + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorEnrollmentResponse::OrHash, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn registration response as defined by the Web Authentication + # specification. + authenticator_response:, + relying_party: nil + ) + end + + sig do + override.returns( + { + authenticator_response: + Privy::PasskeyAuthenticatorEnrollmentResponse, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_mfa_method.rbi b/rbi/privy/models/passkey_mfa_method.rbi new file mode 100644 index 0000000..46aaf47 --- /dev/null +++ b/rbi/privy/models/passkey_mfa_method.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + class PasskeyMfaMethod < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyMfaMethod, Privy::Internal::AnyHash) + end + + sig { returns(Privy::PasskeyMfaMethod::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A Passkey MFA method. + sig do + params( + type: Privy::PasskeyMfaMethod::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new(type:, verified_at:) + end + + sig do + override.returns( + { + type: Privy::PasskeyMfaMethod::Type::TaggedSymbol, + verified_at: Float + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::PasskeyMfaMethod::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PASSKEY = T.let(:passkey, Privy::PasskeyMfaMethod::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::PasskeyMfaMethod::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/passkey_pub_key_cred_param.rbi b/rbi/privy/models/passkey_pub_key_cred_param.rbi new file mode 100644 index 0000000..fbd001f --- /dev/null +++ b/rbi/privy/models/passkey_pub_key_cred_param.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class PasskeyPubKeyCredParam < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyPubKeyCredParam, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :alg + + sig { returns(Privy::PasskeyPubKeyCredParam::Type::OrSymbol) } + attr_accessor :type + + # A public key credential parameter specifying the algorithm and credential type. + sig do + params( + alg: Float, + type: Privy::PasskeyPubKeyCredParam::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(alg:, type:) + end + + sig do + override.returns( + { alg: Float, type: Privy::PasskeyPubKeyCredParam::Type::OrSymbol } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::PasskeyPubKeyCredParam::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PUBLIC_KEY = + T.let( + :"public-key", + Privy::PasskeyPubKeyCredParam::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::PasskeyPubKeyCredParam::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/passkey_register_input.rbi b/rbi/privy/models/passkey_register_input.rbi new file mode 100644 index 0000000..0172367 --- /dev/null +++ b/rbi/privy/models/passkey_register_input.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class PasskeyRegisterInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyRegisterInput, Privy::Internal::AnyHash) + end + + # WebAuthn registration response as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorEnrollmentResponse) } + attr_reader :authenticator_response + + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorEnrollmentResponse::OrHash + ).void + end + attr_writer :authenticator_response + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Input for registering a passkey credential. + sig do + params( + authenticator_response: + Privy::PasskeyAuthenticatorEnrollmentResponse::OrHash, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn registration response as defined by the Web Authentication + # specification. + authenticator_response:, + relying_party: nil + ) + end + + sig do + override.returns( + { + authenticator_response: + Privy::PasskeyAuthenticatorEnrollmentResponse, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_relying_party.rbi b/rbi/privy/models/passkey_relying_party.rbi new file mode 100644 index 0000000..0d9c51a --- /dev/null +++ b/rbi/privy/models/passkey_relying_party.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + class PasskeyRelyingParty < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyRelyingParty, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + # Relying party information for a WebAuthn ceremony. + sig { params(name: String, id: String).returns(T.attached_class) } + def self.new(name:, id: nil) + end + + sig { override.returns({ name: String, id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_user.rbi b/rbi/privy/models/passkey_user.rbi new file mode 100644 index 0000000..f112d6b --- /dev/null +++ b/rbi/privy/models/passkey_user.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class PasskeyUser < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::PasskeyUser, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :display_name + + sig { returns(String) } + attr_accessor :name + + # User entity for a WebAuthn registration ceremony. + sig do + params(id: String, display_name: String, name: String).returns( + T.attached_class + ) + end + def self.new(id:, display_name:, name:) + end + + sig do + override.returns({ id: String, display_name: String, name: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passkey_verify_extensions.rbi b/rbi/privy/models/passkey_verify_extensions.rbi new file mode 100644 index 0000000..1f2918a --- /dev/null +++ b/rbi/privy/models/passkey_verify_extensions.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Privy + module Models + class PasskeyVerifyExtensions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasskeyVerifyExtensions, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :app_id + + sig { params(app_id: String).void } + attr_writer :app_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :cred_props + + sig { params(cred_props: T::Boolean).void } + attr_writer :cred_props + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :hmac_create_secret + + sig { params(hmac_create_secret: T::Boolean).void } + attr_writer :hmac_create_secret + + # Extensions for a WebAuthn authentication ceremony. + sig do + params( + app_id: String, + cred_props: T::Boolean, + hmac_create_secret: T::Boolean + ).returns(T.attached_class) + end + def self.new(app_id: nil, cred_props: nil, hmac_create_secret: nil) + end + + sig do + override.returns( + { + app_id: String, + cred_props: T::Boolean, + hmac_create_secret: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_authenticate_request_body.rbi b/rbi/privy/models/passwordless_authenticate_request_body.rbi new file mode 100644 index 0000000..42094a5 --- /dev/null +++ b/rbi/privy/models/passwordless_authenticate_request_body.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class PasswordlessAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasswordlessAuthenticateRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :email + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # The request body for authenticating a passwordless account. + sig do + params( + code: String, + email: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + code:, + email:, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { + code: String, + email: String, + mode: Privy::AuthenticateModeOption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_init_request_body.rbi b/rbi/privy/models/passwordless_init_request_body.rbi new file mode 100644 index 0000000..782a006 --- /dev/null +++ b/rbi/privy/models/passwordless_init_request_body.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + class PasswordlessInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasswordlessInitRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :email + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The request body for initiating a passwordless ceremony. + sig { params(email: String, token: String).returns(T.attached_class) } + def self.new(email:, token: nil) + end + + sig { override.returns({ email: String, token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_link_request_body.rbi b/rbi/privy/models/passwordless_link_request_body.rbi new file mode 100644 index 0000000..ad5001a --- /dev/null +++ b/rbi/privy/models/passwordless_link_request_body.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class PasswordlessLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasswordlessLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :email + + # The request body for linking a passwordless account. + sig { params(code: String, email: String).returns(T.attached_class) } + def self.new(code:, email:) + end + + sig { override.returns({ code: String, email: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_sms_authenticate_request_body.rbi b/rbi/privy/models/passwordless_sms_authenticate_request_body.rbi new file mode 100644 index 0000000..8baf3d9 --- /dev/null +++ b/rbi/privy/models/passwordless_sms_authenticate_request_body.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class PasswordlessSMSAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasswordlessSMSAuthenticateRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :phone_number + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # The request body for authenticating a passwordless sms account. + sig do + params( + code: String, + phone_number: String, + mode: Privy::AuthenticateModeOption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + code:, + phone_number:, + # Whether to allow sign-up during authentication. + mode: nil + ) + end + + sig do + override.returns( + { + code: String, + phone_number: String, + mode: Privy::AuthenticateModeOption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_sms_init_request_body.rbi b/rbi/privy/models/passwordless_sms_init_request_body.rbi new file mode 100644 index 0000000..eace020 --- /dev/null +++ b/rbi/privy/models/passwordless_sms_init_request_body.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Privy + module Models + class PasswordlessSMSInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasswordlessSMSInitRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :phone_number + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # The request body for initiating a passwordless sms ceremony. + sig do + params(phone_number: String, token: String).returns(T.attached_class) + end + def self.new(phone_number:, token: nil) + end + + sig { override.returns({ phone_number: String, token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_sms_link_request_body.rbi b/rbi/privy/models/passwordless_sms_link_request_body.rbi new file mode 100644 index 0000000..e54c073 --- /dev/null +++ b/rbi/privy/models/passwordless_sms_link_request_body.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + class PasswordlessSMSLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasswordlessSMSLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :phone_number + + # The request body for linking a passwordless sms account. + sig do + params(code: String, phone_number: String).returns(T.attached_class) + end + def self.new(code:, phone_number:) + end + + sig { override.returns({ code: String, phone_number: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_sms_transfer_request_body.rbi b/rbi/privy/models/passwordless_sms_transfer_request_body.rbi new file mode 100644 index 0000000..acc1cdf --- /dev/null +++ b/rbi/privy/models/passwordless_sms_transfer_request_body.rbi @@ -0,0 +1,32 @@ +# typed: strong + +module Privy + module Models + class PasswordlessSMSTransferRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasswordlessSMSTransferRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :nonce + + sig { returns(String) } + attr_accessor :phone_number + + # The request body for transferring a passwordless sms account. + sig do + params(nonce: String, phone_number: String).returns(T.attached_class) + end + def self.new(nonce:, phone_number:) + end + + sig { override.returns({ nonce: String, phone_number: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_sms_unlink_request_body.rbi b/rbi/privy/models/passwordless_sms_unlink_request_body.rbi new file mode 100644 index 0000000..654e19f --- /dev/null +++ b/rbi/privy/models/passwordless_sms_unlink_request_body.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class PasswordlessSMSUnlinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasswordlessSMSUnlinkRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :phone_number + + # The request body for unlinking a passwordless sms account. + sig { params(phone_number: String).returns(T.attached_class) } + def self.new(phone_number:) + end + + sig { override.returns({ phone_number: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_sms_update_request_body.rbi b/rbi/privy/models/passwordless_sms_update_request_body.rbi new file mode 100644 index 0000000..6de9392 --- /dev/null +++ b/rbi/privy/models/passwordless_sms_update_request_body.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Privy + module Models + class PasswordlessSMSUpdateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasswordlessSMSUpdateRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :new_phone_number + + sig { returns(String) } + attr_accessor :old_phone_number + + # The request body for updating a passwordless sms account. + sig do + params( + code: String, + new_phone_number: String, + old_phone_number: String + ).returns(T.attached_class) + end + def self.new(code:, new_phone_number:, old_phone_number:) + end + + sig do + override.returns( + { code: String, new_phone_number: String, old_phone_number: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_transfer_request_body.rbi b/rbi/privy/models/passwordless_transfer_request_body.rbi new file mode 100644 index 0000000..e6c6d25 --- /dev/null +++ b/rbi/privy/models/passwordless_transfer_request_body.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + class PasswordlessTransferRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PasswordlessTransferRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :email + + sig { returns(String) } + attr_accessor :nonce + + # The request body for transferring a passwordless account. + sig { params(email: String, nonce: String).returns(T.attached_class) } + def self.new(email:, nonce:) + end + + sig { override.returns({ email: String, nonce: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_unlink_request_body.rbi b/rbi/privy/models/passwordless_unlink_request_body.rbi new file mode 100644 index 0000000..11d2a32 --- /dev/null +++ b/rbi/privy/models/passwordless_unlink_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class PasswordlessUnlinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasswordlessUnlinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # The request body for unlinking a passwordless account. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/passwordless_update_request_body.rbi b/rbi/privy/models/passwordless_update_request_body.rbi new file mode 100644 index 0000000..4cc0674 --- /dev/null +++ b/rbi/privy/models/passwordless_update_request_body.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class PasswordlessUpdateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PasswordlessUpdateRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :code + + sig { returns(String) } + attr_accessor :new_address + + sig { returns(String) } + attr_accessor :old_address + + # The request body for updating a passwordless account. + sig do + params(code: String, new_address: String, old_address: String).returns( + T.attached_class + ) + end + def self.new(code:, new_address:, old_address:) + end + + sig do + override.returns( + { code: String, new_address: String, old_address: String } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/patch_users_custom_metadata.rbi b/rbi/privy/models/patch_users_custom_metadata.rbi new file mode 100644 index 0000000..81c0683 --- /dev/null +++ b/rbi/privy/models/patch_users_custom_metadata.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Privy + module Models + class PatchUsersCustomMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PatchUsersCustomMetadata, Privy::Internal::AnyHash) + end + + # Custom metadata associated with the user. + sig { returns(T::Hash[Symbol, Privy::CustomMetadataItem::Variants]) } + attr_accessor :custom_metadata + + # The payload for partially updating custom metadata on a user. + sig do + params( + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants] + ).returns(T.attached_class) + end + def self.new( + # Custom metadata associated with the user. + custom_metadata: + ) + end + + sig do + override.returns( + { + custom_metadata: + T::Hash[Symbol, Privy::CustomMetadataItem::Variants] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/phone_invite_input.rbi b/rbi/privy/models/phone_invite_input.rbi new file mode 100644 index 0000000..5cf5fc5 --- /dev/null +++ b/rbi/privy/models/phone_invite_input.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class PhoneInviteInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PhoneInviteInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::PhoneInviteInput::Type::OrSymbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + # Allowlist invite input for a phone number. + sig do + params( + type: Privy::PhoneInviteInput::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new(type:, value:) + end + + sig do + override.returns( + { type: Privy::PhoneInviteInput::Type::OrSymbol, value: String } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::PhoneInviteInput::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PHONE = T.let(:phone, Privy::PhoneInviteInput::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::PhoneInviteInput::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/policy.rbi b/rbi/privy/models/policy.rbi new file mode 100644 index 0000000..a0b9fb0 --- /dev/null +++ b/rbi/privy/models/policy.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Privy + module Models + class Policy < Privy::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Privy::Policy, Privy::Internal::AnyHash) } + + # Unique ID of the created policy. This will be the primary identifier when using + # the policy in the future. + sig { returns(String) } + attr_accessor :id + + # The wallet chain types. + sig { returns(Privy::WalletChainType::TaggedSymbol) } + attr_accessor :chain_type + + # Unix timestamp of when the policy was created in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # Name to assign to policy. + sig { returns(String) } + attr_accessor :name + + # The key quorum ID of the owner of the policy. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + sig { returns(T::Array[Privy::PolicyRuleResponse]) } + attr_accessor :rules + + # Version of the policy. Currently, 1.0 is the only version. + sig { returns(Privy::Policy::Version::TaggedSymbol) } + attr_accessor :version + + # A policy for controlling wallet operations. + sig do + params( + id: String, + chain_type: Privy::WalletChainType::OrSymbol, + created_at: Float, + name: String, + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleResponse::OrHash], + version: Privy::Policy::Version::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Unique ID of the created policy. This will be the primary identifier when using + # the policy in the future. + id:, + # The wallet chain types. + chain_type:, + # Unix timestamp of when the policy was created in milliseconds. + created_at:, + # Name to assign to policy. + name:, + # The key quorum ID of the owner of the policy. + owner_id:, + rules:, + # Version of the policy. Currently, 1.0 is the only version. + version: + ) + end + + sig do + override.returns( + { + id: String, + chain_type: Privy::WalletChainType::TaggedSymbol, + created_at: Float, + name: String, + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleResponse], + version: Privy::Policy::Version::TaggedSymbol + } + ) + end + def to_hash + end + + # Version of the policy. Currently, 1.0 is the only version. + module Version + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::Policy::Version) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VERSION_1_0 = T.let(:"1.0", Privy::Policy::Version::TaggedSymbol) + + sig { override.returns(T::Array[Privy::Policy::Version::TaggedSymbol]) } + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/policy_action.rbi b/rbi/privy/models/policy_action.rbi new file mode 100644 index 0000000..8299741 --- /dev/null +++ b/rbi/privy/models/policy_action.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Privy + module Models + # The action to take when a policy rule matches. + module PolicyAction + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::PolicyAction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ALLOW = T.let(:ALLOW, Privy::PolicyAction::TaggedSymbol) + DENY = T.let(:DENY, Privy::PolicyAction::TaggedSymbol) + + sig { override.returns(T::Array[Privy::PolicyAction::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/policy_authorization_headers.rbi b/rbi/privy/models/policy_authorization_headers.rbi new file mode 100644 index 0000000..a049e37 --- /dev/null +++ b/rbi/privy/models/policy_authorization_headers.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class PolicyAuthorizationHeaders < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PolicyAuthorizationHeaders, Privy::Internal::AnyHash) + end + + # ID of your Privy app. + sig { returns(String) } + attr_accessor :privy_app_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + # Headers required to authorize modifications to policies. + sig do + params( + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + ).returns(T.attached_class) + end + def self.new( + # ID of your Privy app. + privy_app_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil + ) + end + + sig do + override.returns( + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_condition.rbi b/rbi/privy/models/policy_condition.rbi new file mode 100644 index 0000000..a696948 --- /dev/null +++ b/rbi/privy/models/policy_condition.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + # A condition that must be true for the rule action to be applied. + module PolicyCondition + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + end + + sig { override.returns(T::Array[Privy::PolicyCondition::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/policy_create_params.rbi b/rbi/privy/models/policy_create_params.rbi new file mode 100644 index 0000000..0058393 --- /dev/null +++ b/rbi/privy/models/policy_create_params.rbi @@ -0,0 +1,252 @@ +# typed: strong + +module Privy + module Models + class PolicyCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::PolicyCreateParams, Privy::Internal::AnyHash) + end + + # The wallet chain types. + sig { returns(Privy::WalletChainType::OrSymbol) } + attr_accessor :chain_type + + # Name to assign to policy. + sig { returns(String) } + attr_accessor :name + + sig { returns(T::Array[Privy::PolicyCreateParams::Rule]) } + attr_accessor :rules + + # Version of the policy. Currently, 1.0 is the only version. + sig { returns(Privy::PolicyCreateParams::Version::OrSymbol) } + attr_accessor :version + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + name: String, + rules: T::Array[Privy::PolicyCreateParams::Rule::OrHash], + version: Privy::PolicyCreateParams::Version::OrSymbol, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + privy_idempotency_key: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The wallet chain types. + chain_type:, + # Name to assign to policy. + name:, + rules:, + # Version of the policy. Currently, 1.0 is the only version. + version:, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + chain_type: Privy::WalletChainType::OrSymbol, + name: String, + rules: T::Array[Privy::PolicyCreateParams::Rule], + version: Privy::PolicyCreateParams::Version::OrSymbol, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + privy_idempotency_key: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + class Rule < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PolicyCreateParams::Rule, Privy::Internal::AnyHash) + end + + # The action to take when a policy rule matches. + sig { returns(Privy::PolicyAction::OrSymbol) } + attr_accessor :action + + sig do + returns( + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ] + ) + end + attr_accessor :conditions + + # Method the rule applies to. + sig { returns(Privy::PolicyMethod::OrSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :name + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig do + params( + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String, + id: String + ).returns(T.attached_class) + end + def self.new( + # The action to take when a policy rule matches. + action:, + conditions:, + # Method the rule applies to. + method_:, + name:, + id: nil + ) + end + + sig do + override.returns( + { + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String, + id: String + } + ) + end + def to_hash + end + end + + # Version of the policy. Currently, 1.0 is the only version. + module Version + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::PolicyCreateParams::Version) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + VERSION_1_0 = + T.let(:"1.0", Privy::PolicyCreateParams::Version::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::PolicyCreateParams::Version::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/policy_create_rule_params.rbi b/rbi/privy/models/policy_create_rule_params.rbi new file mode 100644 index 0000000..dc034da --- /dev/null +++ b/rbi/privy/models/policy_create_rule_params.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module Privy + module Models + class PolicyCreateRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::PolicyCreateRuleParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + policy_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_delete_params.rbi b/rbi/privy/models/policy_delete_params.rbi new file mode 100644 index 0000000..3d6480c --- /dev/null +++ b/rbi/privy/models/policy_delete_params.rbi @@ -0,0 +1,67 @@ +# typed: strong + +module Privy + module Models + class PolicyDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::PolicyDeleteParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + policy_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_delete_rule_params.rbi b/rbi/privy/models/policy_delete_rule_params.rbi new file mode 100644 index 0000000..d1cbfb2 --- /dev/null +++ b/rbi/privy/models/policy_delete_rule_params.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Privy + module Models + class PolicyDeleteRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::PolicyDeleteRuleParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + sig { returns(String) } + attr_accessor :rule_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + policy_id:, + rule_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_get_params.rbi b/rbi/privy/models/policy_get_params.rbi new file mode 100644 index 0000000..bfffccf --- /dev/null +++ b/rbi/privy/models/policy_get_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class PolicyGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::PolicyGetParams, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :policy_id + + sig do + params( + policy_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(policy_id:, request_options: {}) + end + + sig do + override.returns( + { policy_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_get_rule_params.rbi b/rbi/privy/models/policy_get_rule_params.rbi new file mode 100644 index 0000000..57dfbec --- /dev/null +++ b/rbi/privy/models/policy_get_rule_params.rbi @@ -0,0 +1,43 @@ +# typed: strong + +module Privy + module Models + class PolicyGetRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::PolicyGetRuleParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + sig { returns(String) } + attr_accessor :rule_id + + sig do + params( + policy_id: String, + rule_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(policy_id:, rule_id:, request_options: {}) + end + + sig do + override.returns( + { + policy_id: String, + rule_id: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_input.rbi b/rbi/privy/models/policy_input.rbi new file mode 100644 index 0000000..05ecb11 --- /dev/null +++ b/rbi/privy/models/policy_input.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + PolicyInput = + T.let( + Privy::Internal::Type::ArrayOf[String], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/policy_intent_request_details.rbi b/rbi/privy/models/policy_intent_request_details.rbi new file mode 100644 index 0000000..b12d1a8 --- /dev/null +++ b/rbi/privy/models/policy_intent_request_details.rbi @@ -0,0 +1,150 @@ +# typed: strong + +module Privy + module Models + class PolicyIntentRequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PolicyIntentRequestDetails, Privy::Internal::AnyHash) + end + + sig { returns(Privy::PolicyIntentRequestDetails::Body) } + attr_reader :body + + sig { params(body: Privy::PolicyIntentRequestDetails::Body::OrHash).void } + attr_writer :body + + sig { returns(Privy::PolicyIntentRequestDetails::Method::OrSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # Request details for a policy intent. + sig do + params( + body: Privy::PolicyIntentRequestDetails::Body::OrHash, + method_: Privy::PolicyIntentRequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new(body:, method_:, url:) + end + + sig do + override.returns( + { + body: Privy::PolicyIntentRequestDetails::Body, + method_: Privy::PolicyIntentRequestDetails::Method::OrSymbol, + url: String + } + ) + end + def to_hash + end + + class Body < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PolicyIntentRequestDetails::Body, + Privy::Internal::AnyHash + ) + end + + # Name to assign to policy. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + sig { returns(T.nilable(T::Array[Privy::PolicyRuleRequestBody])) } + attr_reader :rules + + sig do + params(rules: T::Array[Privy::PolicyRuleRequestBody::OrHash]).void + end + attr_writer :rules + + sig do + params( + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Name to assign to policy. + name: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + rules: nil + ) + end + + sig do + override.returns( + { + name: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody] + } + ) + end + def to_hash + end + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PolicyIntentRequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PATCH = + T.let(:PATCH, Privy::PolicyIntentRequestDetails::Method::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::PolicyIntentRequestDetails::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/policy_intent_response.rbi b/rbi/privy/models/policy_intent_response.rbi new file mode 100644 index 0000000..ce868e1 --- /dev/null +++ b/rbi/privy/models/policy_intent_response.rbi @@ -0,0 +1,252 @@ +# typed: strong + +module Privy + module Models + class PolicyIntentResponse < Privy::Models::BaseIntentResponse + OrHash = + T.type_alias do + T.any(Privy::PolicyIntentResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::PolicyIntentResponse::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The original policy update request that would be sent to the policy endpoint + sig { returns(Privy::PolicyIntentResponse::RequestDetails) } + attr_reader :request_details + + sig do + params( + request_details: Privy::PolicyIntentResponse::RequestDetails::OrHash + ).void + end + attr_writer :request_details + + # Result of policy update execution (only present if status is 'executed' or + # 'failed') + sig { returns(T.nilable(Privy::BaseActionResult)) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # A policy for controlling wallet operations. + sig { returns(T.nilable(Privy::Policy)) } + attr_reader :current_resource_data + + sig { params(current_resource_data: Privy::Policy::OrHash).void } + attr_writer :current_resource_data + + # Response for a policy intent + sig do + params( + intent_type: Privy::PolicyIntentResponse::IntentType::OrSymbol, + request_details: Privy::PolicyIntentResponse::RequestDetails::OrHash, + action_result: Privy::BaseActionResult::OrHash, + current_resource_data: Privy::Policy::OrHash + ).returns(T.attached_class) + end + def self.new( + intent_type:, + # The original policy update request that would be sent to the policy endpoint + request_details:, + # Result of policy update execution (only present if status is 'executed' or + # 'failed') + action_result: nil, + # A policy for controlling wallet operations. + current_resource_data: nil + ) + end + + sig do + override.returns( + { + intent_type: Privy::PolicyIntentResponse::IntentType::TaggedSymbol, + request_details: Privy::PolicyIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Policy + } + ) + end + def to_hash + end + + module IntentType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PolicyIntentResponse::IntentType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POLICY = + T.let(:POLICY, Privy::PolicyIntentResponse::IntentType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::PolicyIntentResponse::IntentType::TaggedSymbol] + ) + end + def self.values + end + end + + class RequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PolicyIntentResponse::RequestDetails, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::PolicyIntentResponse::RequestDetails::Body) } + attr_reader :body + + sig do + params( + body: Privy::PolicyIntentResponse::RequestDetails::Body::OrHash + ).void + end + attr_writer :body + + sig do + returns( + Privy::PolicyIntentResponse::RequestDetails::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # The original policy update request that would be sent to the policy endpoint + sig do + params( + body: Privy::PolicyIntentResponse::RequestDetails::Body::OrHash, + method_: + Privy::PolicyIntentResponse::RequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new(body:, method_:, url:) + end + + sig do + override.returns( + { + body: Privy::PolicyIntentResponse::RequestDetails::Body, + method_: + Privy::PolicyIntentResponse::RequestDetails::Method::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + class Body < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::PolicyIntentResponse::RequestDetails::Body, + Privy::Internal::AnyHash + ) + end + + # Name to assign to policy. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig { returns(T.nilable(Privy::OwnerInput::Variants)) } + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + sig { returns(T.nilable(T::Array[Privy::PolicyRuleRequestBody])) } + attr_reader :rules + + sig do + params(rules: T::Array[Privy::PolicyRuleRequestBody::OrHash]).void + end + attr_writer :rules + + sig do + params( + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Name to assign to policy. + name: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + rules: nil + ) + end + + sig do + override.returns( + { + name: String, + owner: T.nilable(Privy::OwnerInput::Variants), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody] + } + ) + end + def to_hash + end + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PolicyIntentResponse::RequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PATCH = + T.let( + :PATCH, + Privy::PolicyIntentResponse::RequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::PolicyIntentResponse::RequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/privy/models/policy_method.rbi b/rbi/privy/models/policy_method.rbi new file mode 100644 index 0000000..11814ed --- /dev/null +++ b/rbi/privy/models/policy_method.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + # Method the rule applies to. + module PolicyMethod + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::PolicyMethod) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETH_SEND_TRANSACTION = + T.let(:eth_sendTransaction, Privy::PolicyMethod::TaggedSymbol) + ETH_SIGN_TRANSACTION = + T.let(:eth_signTransaction, Privy::PolicyMethod::TaggedSymbol) + ETH_SIGN_USER_OPERATION = + T.let(:eth_signUserOperation, Privy::PolicyMethod::TaggedSymbol) + ETH_SIGN_TYPED_DATA_V4 = + T.let(:eth_signTypedData_v4, Privy::PolicyMethod::TaggedSymbol) + ETH_SIGN7702_AUTHORIZATION = + T.let(:eth_sign7702Authorization, Privy::PolicyMethod::TaggedSymbol) + WALLET_SEND_CALLS = + T.let(:wallet_sendCalls, Privy::PolicyMethod::TaggedSymbol) + SIGN_TRANSACTION = + T.let(:signTransaction, Privy::PolicyMethod::TaggedSymbol) + SIGN_AND_SEND_TRANSACTION = + T.let(:signAndSendTransaction, Privy::PolicyMethod::TaggedSymbol) + EXPORT_PRIVATE_KEY = + T.let(:exportPrivateKey, Privy::PolicyMethod::TaggedSymbol) + EXPORT_SEED_PHRASE = + T.let(:exportSeedPhrase, Privy::PolicyMethod::TaggedSymbol) + SIGN_TRANSACTION_BYTES = + T.let(:signTransactionBytes, Privy::PolicyMethod::TaggedSymbol) + EARN_DEPOSIT = T.let(:earn_deposit, Privy::PolicyMethod::TaggedSymbol) + EARN_WITHDRAW = T.let(:earn_withdraw, Privy::PolicyMethod::TaggedSymbol) + TRANSFER = T.let(:transfer, Privy::PolicyMethod::TaggedSymbol) + STAR = T.let(:"*", Privy::PolicyMethod::TaggedSymbol) + + sig { override.returns(T::Array[Privy::PolicyMethod::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/policy_request_body.rbi b/rbi/privy/models/policy_request_body.rbi new file mode 100644 index 0000000..c63f1f3 --- /dev/null +++ b/rbi/privy/models/policy_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class PolicyRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PolicyRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + # Unique ID of the policy to take actions on. + sig { params(policy_id: String).returns(T.attached_class) } + def self.new(policy_id:) + end + + sig { override.returns({ policy_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_rule_request_body.rbi b/rbi/privy/models/policy_rule_request_body.rbi new file mode 100644 index 0000000..cd50c41 --- /dev/null +++ b/rbi/privy/models/policy_rule_request_body.rbi @@ -0,0 +1,118 @@ +# typed: strong + +module Privy + module Models + class PolicyRuleRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PolicyRuleRequestBody, Privy::Internal::AnyHash) + end + + # The action to take when a policy rule matches. + sig { returns(Privy::PolicyAction::OrSymbol) } + attr_accessor :action + + sig do + returns( + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ] + ) + end + attr_accessor :conditions + + # Method the rule applies to. + sig { returns(Privy::PolicyMethod::OrSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :name + + # The rules that apply to each method the policy covers. + sig do + params( + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String + ).returns(T.attached_class) + end + def self.new( + # The action to take when a policy rule matches. + action:, + conditions:, + # Method the rule applies to. + method_:, + name: + ) + end + + sig do + override.returns( + { + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition, + Privy::EthereumCalldataCondition, + Privy::EthereumTypedDataDomainCondition, + Privy::EthereumTypedDataMessageCondition, + Privy::Ethereum7702AuthorizationCondition, + Privy::SolanaProgramInstructionCondition, + Privy::SolanaSystemProgramInstructionCondition, + Privy::SolanaTokenProgramInstructionCondition, + Privy::SystemCondition, + Privy::TronTransactionCondition, + Privy::TronCalldataCondition, + Privy::SuiTransactionCommandCondition, + Privy::SuiTransferObjectsCommandCondition, + Privy::ActionRequestBodyCondition, + Privy::AggregationCondition + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_rule_request_params.rbi b/rbi/privy/models/policy_rule_request_params.rbi new file mode 100644 index 0000000..c74a00a --- /dev/null +++ b/rbi/privy/models/policy_rule_request_params.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + class PolicyRuleRequestParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PolicyRuleRequestParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + sig { returns(String) } + attr_accessor :rule_id + + # Unique IDs of the policy and the rule within the policy to take actions on. + sig do + params(policy_id: String, rule_id: String).returns(T.attached_class) + end + def self.new(policy_id:, rule_id:) + end + + sig { override.returns({ policy_id: String, rule_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_rule_response.rbi b/rbi/privy/models/policy_rule_response.rbi new file mode 100644 index 0000000..3e31be0 --- /dev/null +++ b/rbi/privy/models/policy_rule_response.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Privy + module Models + class PolicyRuleResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PolicyRuleResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + # The action to take when a policy rule matches. + sig { returns(Privy::PolicyAction::TaggedSymbol) } + attr_accessor :action + + sig { returns(T::Array[Privy::PolicyCondition::Variants]) } + attr_accessor :conditions + + # Method the rule applies to. + sig { returns(Privy::PolicyMethod::TaggedSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :name + + # A rule that defines the conditions and action to take if the conditions are + # true. + sig do + params( + id: String, + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String + ).returns(T.attached_class) + end + def self.new( + id:, + # The action to take when a policy rule matches. + action:, + conditions:, + # Method the rule applies to. + method_:, + name: + ) + end + + sig do + override.returns( + { + id: String, + action: Privy::PolicyAction::TaggedSymbol, + conditions: T::Array[Privy::PolicyCondition::Variants], + method_: Privy::PolicyMethod::TaggedSymbol, + name: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_update_params.rbi b/rbi/privy/models/policy_update_params.rbi new file mode 100644 index 0000000..30ebf6c --- /dev/null +++ b/rbi/privy/models/policy_update_params.rbi @@ -0,0 +1,120 @@ +# typed: strong + +module Privy + module Models + class PolicyUpdateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::PolicyUpdateParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + # Name to assign to policy. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + sig { returns(T.nilable(T::Array[Privy::PolicyRuleRequestBody])) } + attr_reader :rules + + sig { params(rules: T::Array[Privy::PolicyRuleRequestBody::OrHash]).void } + attr_writer :rules + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody::OrHash], + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + policy_id:, + # Name to assign to policy. + name: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + rules: nil, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + name: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody], + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/policy_update_rule_params.rbi b/rbi/privy/models/policy_update_rule_params.rbi new file mode 100644 index 0000000..c44ac18 --- /dev/null +++ b/rbi/privy/models/policy_update_rule_params.rbi @@ -0,0 +1,73 @@ +# typed: strong + +module Privy + module Models + class PolicyUpdateRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::PolicyUpdateRuleParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :policy_id + + sig { returns(String) } + attr_accessor :rule_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + policy_id:, + rule_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/private_key_export_input.rbi b/rbi/privy/models/private_key_export_input.rbi new file mode 100644 index 0000000..f1bab5d --- /dev/null +++ b/rbi/privy/models/private_key_export_input.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Privy + module Models + class PrivateKeyExportInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PrivateKeyExportInput, Privy::Internal::AnyHash) + end + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + # The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) + # format. + sig { returns(String) } + attr_accessor :recipient_public_key + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :export_seed_phrase + + sig { params(export_seed_phrase: T::Boolean).void } + attr_writer :export_seed_phrase + + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + sig { returns(T.nilable(Privy::ExportType::OrSymbol)) } + attr_reader :export_type + + sig { params(export_type: Privy::ExportType::OrSymbol).void } + attr_writer :export_type + + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + sig do + params( + encryption_type: Privy::HpkeEncryption::OrSymbol, + recipient_public_key: String, + export_seed_phrase: T::Boolean, + export_type: Privy::ExportType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + # The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) + # format. + recipient_public_key:, + export_seed_phrase: nil, + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + export_type: nil + ) + end + + sig do + override.returns( + { + encryption_type: Privy::HpkeEncryption::OrSymbol, + recipient_public_key: String, + export_seed_phrase: T::Boolean, + export_type: Privy::ExportType::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/private_key_export_response.rbi b/rbi/privy/models/private_key_export_response.rbi new file mode 100644 index 0000000..0896747 --- /dev/null +++ b/rbi/privy/models/private_key_export_response.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Models + class PrivateKeyExportResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PrivateKeyExportResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :ciphertext + + sig { returns(String) } + attr_accessor :encapsulated_key + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + # Response containing HPKE-encrypted wallet data (private key or seed phrase). + sig do + params( + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + ciphertext:, + encapsulated_key:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type: + ) + end + + sig do + override.returns( + { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/private_key_export_webhook_payload.rbi b/rbi/privy/models/private_key_export_webhook_payload.rbi new file mode 100644 index 0000000..9536ec6 --- /dev/null +++ b/rbi/privy/models/private_key_export_webhook_payload.rbi @@ -0,0 +1,140 @@ +# typed: strong + +module Privy + module Models + class PrivateKeyExportWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PrivateKeyExportWebhookPayload, Privy::Internal::AnyHash) + end + + # The type of webhook event. + sig { returns(Privy::PrivateKeyExportWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # The ID of the user who exported the key. + sig { returns(String) } + attr_accessor :user_id + + # The address of the wallet. + sig { returns(String) } + attr_accessor :wallet_address + + # The ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + sig do + returns( + T.nilable( + Privy::PrivateKeyExportWebhookPayload::ExportSource::TaggedSymbol + ) + ) + end + attr_reader :export_source + + sig do + params( + export_source: + Privy::PrivateKeyExportWebhookPayload::ExportSource::OrSymbol + ).void + end + attr_writer :export_source + + # Payload for the wallet.private_key_export webhook event. + sig do + params( + type: Privy::PrivateKeyExportWebhookPayload::Type::OrSymbol, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: + Privy::PrivateKeyExportWebhookPayload::ExportSource::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The type of webhook event. + type:, + # The ID of the user who exported the key. + user_id:, + # The address of the wallet. + wallet_address:, + # The ID of the wallet. + wallet_id:, + export_source: nil + ) + end + + sig do + override.returns( + { + type: Privy::PrivateKeyExportWebhookPayload::Type::TaggedSymbol, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: + Privy::PrivateKeyExportWebhookPayload::ExportSource::TaggedSymbol + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PrivateKeyExportWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_PRIVATE_KEY_EXPORT = + T.let( + :"wallet.private_key_export", + Privy::PrivateKeyExportWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::PrivateKeyExportWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + + module ExportSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PrivateKeyExportWebhookPayload::ExportSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DISPLAY = + T.let( + :display, + Privy::PrivateKeyExportWebhookPayload::ExportSource::TaggedSymbol + ) + CLIENT = + T.let( + :client, + Privy::PrivateKeyExportWebhookPayload::ExportSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::PrivateKeyExportWebhookPayload::ExportSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/private_key_init_input.rbi b/rbi/privy/models/private_key_init_input.rbi new file mode 100644 index 0000000..0940835 --- /dev/null +++ b/rbi/privy/models/private_key_init_input.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class PrivateKeyInitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PrivateKeyInitInput, Privy::Internal::AnyHash) + end + + # The address of the wallet to import. + sig { returns(String) } + attr_accessor :address + + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + sig { returns(Privy::WalletImportSupportedChains::OrSymbol) } + attr_accessor :chain_type + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + sig { returns(Privy::PrivateKeyInitInput::EntropyType::OrSymbol) } + attr_accessor :entropy_type + + # The input for private key wallets. + sig do + params( + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::PrivateKeyInitInput::EntropyType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The address of the wallet to import. + address:, + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + chain_type:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + entropy_type: + ) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::PrivateKeyInitInput::EntropyType::OrSymbol + } + ) + end + def to_hash + end + + module EntropyType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PrivateKeyInitInput::EntropyType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVATE_KEY = + T.let( + :"private-key", + Privy::PrivateKeyInitInput::EntropyType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::PrivateKeyInitInput::EntropyType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/private_key_submit_input.rbi b/rbi/privy/models/private_key_submit_input.rbi new file mode 100644 index 0000000..41075f6 --- /dev/null +++ b/rbi/privy/models/private_key_submit_input.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Privy + module Models + class PrivateKeySubmitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::PrivateKeySubmitInput, Privy::Internal::AnyHash) + end + + # The address of the wallet to import. + sig { returns(String) } + attr_accessor :address + + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + sig { returns(Privy::WalletImportSupportedChains::OrSymbol) } + attr_accessor :chain_type + + # The encrypted entropy of the wallet to import. + sig { returns(String) } + attr_accessor :ciphertext + + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption inside the TEE. + sig { returns(String) } + attr_accessor :encapsulated_key + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + sig { returns(Privy::PrivateKeySubmitInput::EntropyType::OrSymbol) } + attr_accessor :entropy_type + + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + sig { returns(T.nilable(Privy::HpkeImportConfig)) } + attr_reader :hpke_config + + sig { params(hpke_config: Privy::HpkeImportConfig::OrHash).void } + attr_writer :hpke_config + + # The submission input for importing a private key wallet. + sig do + params( + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::PrivateKeySubmitInput::EntropyType::OrSymbol, + hpke_config: Privy::HpkeImportConfig::OrHash + ).returns(T.attached_class) + end + def self.new( + # The address of the wallet to import. + address:, + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + chain_type:, + # The encrypted entropy of the wallet to import. + ciphertext:, + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption inside the TEE. + encapsulated_key:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + entropy_type:, + # Optional HPKE configuration for wallet import decryption. These parameters allow + # importing wallets encrypted by external providers that use different HPKE + # configurations. + hpke_config: nil + ) + end + + sig do + override.returns( + { + address: String, + chain_type: Privy::WalletImportSupportedChains::OrSymbol, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol, + entropy_type: Privy::PrivateKeySubmitInput::EntropyType::OrSymbol, + hpke_config: Privy::HpkeImportConfig + } + ) + end + def to_hash + end + + module EntropyType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::PrivateKeySubmitInput::EntropyType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVATE_KEY = + T.let( + :"private-key", + Privy::PrivateKeySubmitInput::EntropyType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::PrivateKeySubmitInput::EntropyType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/privy_oauth_provider_id.rbi b/rbi/privy/models/privy_oauth_provider_id.rbi new file mode 100644 index 0000000..b68d8ba --- /dev/null +++ b/rbi/privy/models/privy_oauth_provider_id.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + PrivyOAuthProviderID = String + end +end diff --git a/rbi/privy/models/quantity.rbi b/rbi/privy/models/quantity.rbi new file mode 100644 index 0000000..8a8116c --- /dev/null +++ b/rbi/privy/models/quantity.rbi @@ -0,0 +1,17 @@ +# typed: strong + +module Privy + module Models + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + module Quantity + extend Privy::Internal::Type::Union + + Variants = T.type_alias { T.any(String, Integer) } + + sig { override.returns(T::Array[Privy::Quantity::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/raw_sign_bytes_encoding.rbi b/rbi/privy/models/raw_sign_bytes_encoding.rbi new file mode 100644 index 0000000..b4eaa5e --- /dev/null +++ b/rbi/privy/models/raw_sign_bytes_encoding.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Encoding scheme for bytes in the `raw_sign` RPC. + module RawSignBytesEncoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::RawSignBytesEncoding) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + UTF_8 = T.let(:"utf-8", Privy::RawSignBytesEncoding::TaggedSymbol) + HEX = T.let(:hex, Privy::RawSignBytesEncoding::TaggedSymbol) + BASE64 = T.let(:base64, Privy::RawSignBytesEncoding::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::RawSignBytesEncoding::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/raw_sign_bytes_hash_function.rbi b/rbi/privy/models/raw_sign_bytes_hash_function.rbi new file mode 100644 index 0000000..1f74c86 --- /dev/null +++ b/rbi/privy/models/raw_sign_bytes_hash_function.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + # Hash function for bytes in the `raw_sign` RPC. + module RawSignBytesHashFunction + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::RawSignBytesHashFunction) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + KECCAK256 = + T.let(:keccak256, Privy::RawSignBytesHashFunction::TaggedSymbol) + SHA256 = T.let(:sha256, Privy::RawSignBytesHashFunction::TaggedSymbol) + BLAKE2B256 = + T.let(:blake2b256, Privy::RawSignBytesHashFunction::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::RawSignBytesHashFunction::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/raw_sign_bytes_params.rbi b/rbi/privy/models/raw_sign_bytes_params.rbi new file mode 100644 index 0000000..7bd811b --- /dev/null +++ b/rbi/privy/models/raw_sign_bytes_params.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class RawSignBytesParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RawSignBytesParams, Privy::Internal::AnyHash) + end + + # The bytes to hash and sign. + sig { returns(String) } + attr_accessor :bytes + + # Encoding scheme for bytes in the `raw_sign` RPC. + sig { returns(Privy::RawSignBytesEncoding::OrSymbol) } + attr_accessor :encoding + + # Hash function for bytes in the `raw_sign` RPC. + sig { returns(Privy::RawSignBytesHashFunction::OrSymbol) } + attr_accessor :hash_function + + # Parameters for hashing and signing bytes with the `raw_sign` RPC. + sig do + params( + bytes: String, + encoding: Privy::RawSignBytesEncoding::OrSymbol, + hash_function: Privy::RawSignBytesHashFunction::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The bytes to hash and sign. + bytes:, + # Encoding scheme for bytes in the `raw_sign` RPC. + encoding:, + # Hash function for bytes in the `raw_sign` RPC. + hash_function: + ) + end + + sig do + override.returns( + { + bytes: String, + encoding: Privy::RawSignBytesEncoding::OrSymbol, + hash_function: Privy::RawSignBytesHashFunction::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/raw_sign_hash_params.rbi b/rbi/privy/models/raw_sign_hash_params.rbi new file mode 100644 index 0000000..d50154c --- /dev/null +++ b/rbi/privy/models/raw_sign_hash_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + class RawSignHashParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RawSignHashParams, Privy::Internal::AnyHash) + end + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :hash_ + + # Parameters for signing a pre-computed hash with the `raw_sign` RPC. + sig { params(hash_: String).returns(T.attached_class) } + def self.new( + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + hash_: + ) + end + + sig { override.returns({ hash_: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/raw_sign_input.rbi b/rbi/privy/models/raw_sign_input.rbi new file mode 100644 index 0000000..59f5f7b --- /dev/null +++ b/rbi/privy/models/raw_sign_input.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Privy + module Models + class RawSignInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::RawSignInput, Privy::Internal::AnyHash) } + + # Parameters for the `raw_sign` RPC. + sig do + returns(T.any(Privy::RawSignHashParams, Privy::RawSignBytesParams)) + end + attr_accessor :params + + # Provide either `hash` (to sign a pre-computed hash) OR `bytes`, `encoding`, and + # `hash_function` (to hash and then sign). These options are mutually exclusive. + sig do + params( + params: + T.any( + Privy::RawSignHashParams::OrHash, + Privy::RawSignBytesParams::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # Parameters for the `raw_sign` RPC. + params: + ) + end + + sig do + override.returns( + { params: T.any(Privy::RawSignHashParams, Privy::RawSignBytesParams) } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/raw_sign_input_params.rbi b/rbi/privy/models/raw_sign_input_params.rbi new file mode 100644 index 0000000..33ff72f --- /dev/null +++ b/rbi/privy/models/raw_sign_input_params.rbi @@ -0,0 +1,19 @@ +# typed: strong + +module Privy + module Models + # Parameters for the `raw_sign` RPC. + module RawSignInputParams + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any(Privy::RawSignHashParams, Privy::RawSignBytesParams) + end + + sig { override.returns(T::Array[Privy::RawSignInputParams::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/raw_sign_response.rbi b/rbi/privy/models/raw_sign_response.rbi new file mode 100644 index 0000000..12c5460 --- /dev/null +++ b/rbi/privy/models/raw_sign_response.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class RawSignResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::RawSignResponse, Privy::Internal::AnyHash) } + + # Data returned by the `raw_sign` RPC. + sig { returns(Privy::RawSignResponseData) } + attr_reader :data + + sig { params(data: Privy::RawSignResponseData::OrHash).void } + attr_writer :data + + sig { returns(Privy::RawSignResponse::Method::TaggedSymbol) } + attr_accessor :method_ + + # Response to the `raw_sign` RPC. + sig do + params( + data: Privy::RawSignResponseData::OrHash, + method_: Privy::RawSignResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the `raw_sign` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::RawSignResponseData, + method_: Privy::RawSignResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::RawSignResponse::Method) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RAW_SIGN = + T.let(:raw_sign, Privy::RawSignResponse::Method::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::RawSignResponse::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/raw_sign_response_data.rbi b/rbi/privy/models/raw_sign_response_data.rbi new file mode 100644 index 0000000..728cf26 --- /dev/null +++ b/rbi/privy/models/raw_sign_response_data.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class RawSignResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RawSignResponseData, Privy::Internal::AnyHash) + end + + sig { returns(Privy::RawSignResponseData::Encoding::TaggedSymbol) } + attr_accessor :encoding + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :signature + + # Data returned by the `raw_sign` RPC. + sig do + params( + encoding: Privy::RawSignResponseData::Encoding::OrSymbol, + signature: String + ).returns(T.attached_class) + end + def self.new( + encoding:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + signature: + ) + end + + sig do + override.returns( + { + encoding: Privy::RawSignResponseData::Encoding::TaggedSymbol, + signature: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::RawSignResponseData::Encoding) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HEX = T.let(:hex, Privy::RawSignResponseData::Encoding::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::RawSignResponseData::Encoding::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/recipient_public_key.rbi b/rbi/privy/models/recipient_public_key.rbi new file mode 100644 index 0000000..21a7e30 --- /dev/null +++ b/rbi/privy/models/recipient_public_key.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + RecipientPublicKey = String + end +end diff --git a/rbi/privy/models/recovery_configuration_icloud_input.rbi b/rbi/privy/models/recovery_configuration_icloud_input.rbi new file mode 100644 index 0000000..2e183c6 --- /dev/null +++ b/rbi/privy/models/recovery_configuration_icloud_input.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + module Models + class RecoveryConfigurationICloudInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::RecoveryConfigurationICloudInput, + Privy::Internal::AnyHash + ) + end + + # The client type for iCloud recovery operations. + sig { returns(Privy::ICloudClientType::OrSymbol) } + attr_accessor :client_type + + # The input for getting the iCloud recovery configuration. + sig do + params(client_type: Privy::ICloudClientType::OrSymbol).returns( + T.attached_class + ) + end + def self.new( + # The client type for iCloud recovery operations. + client_type: + ) + end + + sig do + override.returns({ client_type: Privy::ICloudClientType::OrSymbol }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/recovery_configuration_icloud_response.rbi b/rbi/privy/models/recovery_configuration_icloud_response.rbi new file mode 100644 index 0000000..5f63ec7 --- /dev/null +++ b/rbi/privy/models/recovery_configuration_icloud_response.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Privy + module Models + class RecoveryConfigurationICloudResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::RecoveryConfigurationICloudResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :api_token + + sig { returns(String) } + attr_accessor :container_identifier + + sig { returns(String) } + attr_accessor :environment + + # The response containing the iCloud recovery configuration. + sig do + params( + api_token: String, + container_identifier: String, + environment: String + ).returns(T.attached_class) + end + def self.new(api_token:, container_identifier:, environment:) + end + + sig do + override.returns( + { + api_token: String, + container_identifier: String, + environment: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/recovery_key_material_input.rbi b/rbi/privy/models/recovery_key_material_input.rbi new file mode 100644 index 0000000..aa20bff --- /dev/null +++ b/rbi/privy/models/recovery_key_material_input.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class RecoveryKeyMaterialInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RecoveryKeyMaterialInput, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :chain_type + + sig { params(chain_type: String).void } + attr_writer :chain_type + + # The input for getting the recovery key material. + sig { params(chain_type: String).returns(T.attached_class) } + def self.new(chain_type: nil) + end + + sig { override.returns({ chain_type: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/recovery_key_material_response.rbi b/rbi/privy/models/recovery_key_material_response.rbi new file mode 100644 index 0000000..542d390 --- /dev/null +++ b/rbi/privy/models/recovery_key_material_response.rbi @@ -0,0 +1,68 @@ +# typed: strong + +module Privy + module Models + class RecoveryKeyMaterialResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RecoveryKeyMaterialResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :file_id + + sig { returns(String) } + attr_accessor :icloud_record_name + + sig { returns(String) } + attr_accessor :recovery_code + + sig { returns(String) } + attr_accessor :recovery_key + + sig { returns(String) } + attr_accessor :recovery_key_derivation_salt + + # The type of recovery mechanism used for wallet recovery. + sig { returns(Privy::RecoveryType::OrSymbol) } + attr_accessor :recovery_type + + # The response containing the recovery key material. + sig do + params( + file_id: String, + icloud_record_name: String, + recovery_code: String, + recovery_key: String, + recovery_key_derivation_salt: String, + recovery_type: Privy::RecoveryType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + file_id:, + icloud_record_name:, + recovery_code:, + recovery_key:, + recovery_key_derivation_salt:, + # The type of recovery mechanism used for wallet recovery. + recovery_type: + ) + end + + sig do + override.returns( + { + file_id: String, + icloud_record_name: String, + recovery_code: String, + recovery_key: String, + recovery_key_derivation_salt: String, + recovery_type: Privy::RecoveryType::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/recovery_type.rbi b/rbi/privy/models/recovery_type.rbi new file mode 100644 index 0000000..2ab7001 --- /dev/null +++ b/rbi/privy/models/recovery_type.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + # The type of recovery mechanism used for wallet recovery. + module RecoveryType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::RecoveryType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_PASSCODE_DERIVED_RECOVERY_KEY = + T.let( + :user_passcode_derived_recovery_key, + Privy::RecoveryType::TaggedSymbol + ) + PRIVY_PASSCODE_DERIVED_RECOVERY_KEY = + T.let( + :privy_passcode_derived_recovery_key, + Privy::RecoveryType::TaggedSymbol + ) + PRIVY_GENERATED_RECOVERY_KEY = + T.let(:privy_generated_recovery_key, Privy::RecoveryType::TaggedSymbol) + GOOGLE_DRIVE_RECOVERY_SECRET = + T.let(:google_drive_recovery_secret, Privy::RecoveryType::TaggedSymbol) + ICLOUD_RECOVERY_SECRET = + T.let(:icloud_recovery_secret, Privy::RecoveryType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::RecoveryType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/response_passkey_init_authenticate.rbi b/rbi/privy/models/response_passkey_init_authenticate.rbi new file mode 100644 index 0000000..7fb88f8 --- /dev/null +++ b/rbi/privy/models/response_passkey_init_authenticate.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + class ResponsePasskeyInitAuthenticate < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::ResponsePasskeyInitAuthenticate, + Privy::Internal::AnyHash + ) + end + + # WebAuthn authentication options as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorVerifyOptions) } + attr_reader :options + + sig do + params(options: Privy::PasskeyAuthenticatorVerifyOptions::OrHash).void + end + attr_writer :options + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Response for initiating a passkey authentication ceremony. + sig do + params( + options: Privy::PasskeyAuthenticatorVerifyOptions::OrHash, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn authentication options as defined by the Web Authentication + # specification. + options:, + relying_party: nil + ) + end + + sig do + override.returns( + { + options: Privy::PasskeyAuthenticatorVerifyOptions, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/response_passkey_init_link.rbi b/rbi/privy/models/response_passkey_init_link.rbi new file mode 100644 index 0000000..002a46e --- /dev/null +++ b/rbi/privy/models/response_passkey_init_link.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class ResponsePasskeyInitLink < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ResponsePasskeyInitLink, Privy::Internal::AnyHash) + end + + # WebAuthn registration options as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorEnrollmentOptions) } + attr_reader :options + + sig do + params( + options: Privy::PasskeyAuthenticatorEnrollmentOptions::OrHash + ).void + end + attr_writer :options + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Response for initiating a passkey link ceremony. + sig do + params( + options: Privy::PasskeyAuthenticatorEnrollmentOptions::OrHash, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn registration options as defined by the Web Authentication + # specification. + options:, + relying_party: nil + ) + end + + sig do + override.returns( + { + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/response_passkey_init_register.rbi b/rbi/privy/models/response_passkey_init_register.rbi new file mode 100644 index 0000000..3cd5cd8 --- /dev/null +++ b/rbi/privy/models/response_passkey_init_register.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class ResponsePasskeyInitRegister < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::ResponsePasskeyInitRegister, Privy::Internal::AnyHash) + end + + # WebAuthn registration options as defined by the Web Authentication + # specification. + sig { returns(Privy::PasskeyAuthenticatorEnrollmentOptions) } + attr_reader :options + + sig do + params( + options: Privy::PasskeyAuthenticatorEnrollmentOptions::OrHash + ).void + end + attr_writer :options + + sig { returns(T.nilable(String)) } + attr_reader :relying_party + + sig { params(relying_party: String).void } + attr_writer :relying_party + + # Response for initiating a passkey registration ceremony. + sig do + params( + options: Privy::PasskeyAuthenticatorEnrollmentOptions::OrHash, + relying_party: String + ).returns(T.attached_class) + end + def self.new( + # WebAuthn registration options as defined by the Web Authentication + # specification. + options:, + relying_party: nil + ) + end + + sig do + override.returns( + { + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + relying_party: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/rpc_intent_request_details.rbi b/rbi/privy/models/rpc_intent_request_details.rbi new file mode 100644 index 0000000..659580c --- /dev/null +++ b/rbi/privy/models/rpc_intent_request_details.rbi @@ -0,0 +1,144 @@ +# typed: strong + +module Privy + module Models + class RpcIntentRequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RpcIntentRequestDetails, Privy::Internal::AnyHash) + end + + # Request body for wallet RPC operations, discriminated by method. + sig do + returns( + T.any( + Privy::EthereumSignTransactionRpcInput, + Privy::EthereumSendTransactionRpcInput, + Privy::EthereumPersonalSignRpcInput, + Privy::EthereumSignTypedDataRpcInput, + Privy::EthereumSecp256k1SignRpcInput, + Privy::EthereumSign7702AuthorizationRpcInput, + Privy::EthereumSignUserOperationRpcInput, + Privy::EthereumSendCallsRpcInput, + Privy::SolanaSignTransactionRpcInput, + Privy::SolanaSignAndSendTransactionRpcInput, + Privy::SolanaSignMessageRpcInput, + Privy::SparkTransferRpcInput, + Privy::SparkGetBalanceRpcInput, + Privy::SparkTransferTokensRpcInput, + Privy::SparkGetStaticDepositAddressRpcInput, + Privy::SparkGetClaimStaticDepositQuoteRpcInput, + Privy::SparkClaimStaticDepositRpcInput, + Privy::SparkCreateLightningInvoiceRpcInput, + Privy::SparkPayLightningInvoiceRpcInput, + Privy::SparkSignMessageWithIdentityKeyRpcInput, + Privy::ExportPrivateKeyRpcInput, + Privy::ExportSeedPhraseRpcInput + ) + ) + end + attr_accessor :body + + sig { returns(Privy::RpcIntentRequestDetails::Method::OrSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # Request details for an RPC intent. + sig do + params( + body: + T.any( + Privy::EthereumSignTransactionRpcInput::OrHash, + Privy::EthereumSendTransactionRpcInput::OrHash, + Privy::EthereumPersonalSignRpcInput::OrHash, + Privy::EthereumSignTypedDataRpcInput::OrHash, + Privy::EthereumSecp256k1SignRpcInput::OrHash, + Privy::EthereumSign7702AuthorizationRpcInput::OrHash, + Privy::EthereumSignUserOperationRpcInput::OrHash, + Privy::EthereumSendCallsRpcInput::OrHash, + Privy::SolanaSignTransactionRpcInput::OrHash, + Privy::SolanaSignAndSendTransactionRpcInput::OrHash, + Privy::SolanaSignMessageRpcInput::OrHash, + Privy::SparkTransferRpcInput::OrHash, + Privy::SparkGetBalanceRpcInput::OrHash, + Privy::SparkTransferTokensRpcInput::OrHash, + Privy::SparkGetStaticDepositAddressRpcInput::OrHash, + Privy::SparkGetClaimStaticDepositQuoteRpcInput::OrHash, + Privy::SparkClaimStaticDepositRpcInput::OrHash, + Privy::SparkCreateLightningInvoiceRpcInput::OrHash, + Privy::SparkPayLightningInvoiceRpcInput::OrHash, + Privy::SparkSignMessageWithIdentityKeyRpcInput::OrHash, + Privy::ExportPrivateKeyRpcInput::OrHash, + Privy::ExportSeedPhraseRpcInput::OrHash + ), + method_: Privy::RpcIntentRequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # Request body for wallet RPC operations, discriminated by method. + body:, + method_:, + url: + ) + end + + sig do + override.returns( + { + body: + T.any( + Privy::EthereumSignTransactionRpcInput, + Privy::EthereumSendTransactionRpcInput, + Privy::EthereumPersonalSignRpcInput, + Privy::EthereumSignTypedDataRpcInput, + Privy::EthereumSecp256k1SignRpcInput, + Privy::EthereumSign7702AuthorizationRpcInput, + Privy::EthereumSignUserOperationRpcInput, + Privy::EthereumSendCallsRpcInput, + Privy::SolanaSignTransactionRpcInput, + Privy::SolanaSignAndSendTransactionRpcInput, + Privy::SolanaSignMessageRpcInput, + Privy::SparkTransferRpcInput, + Privy::SparkGetBalanceRpcInput, + Privy::SparkTransferTokensRpcInput, + Privy::SparkGetStaticDepositAddressRpcInput, + Privy::SparkGetClaimStaticDepositQuoteRpcInput, + Privy::SparkClaimStaticDepositRpcInput, + Privy::SparkCreateLightningInvoiceRpcInput, + Privy::SparkPayLightningInvoiceRpcInput, + Privy::SparkSignMessageWithIdentityKeyRpcInput, + Privy::ExportPrivateKeyRpcInput, + Privy::ExportSeedPhraseRpcInput + ), + method_: Privy::RpcIntentRequestDetails::Method::OrSymbol, + url: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::RpcIntentRequestDetails::Method) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POST = + T.let(:POST, Privy::RpcIntentRequestDetails::Method::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::RpcIntentRequestDetails::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/rpc_intent_response.rbi b/rbi/privy/models/rpc_intent_response.rbi new file mode 100644 index 0000000..b2f7e65 --- /dev/null +++ b/rbi/privy/models/rpc_intent_response.rbi @@ -0,0 +1,194 @@ +# typed: strong + +module Privy + module Models + class RpcIntentResponse < Privy::Models::BaseIntentResponse + OrHash = + T.type_alias do + T.any(Privy::RpcIntentResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::RpcIntentResponse::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The original RPC request that would be sent to the wallet endpoint + sig { returns(Privy::RpcIntentResponse::RequestDetails) } + attr_reader :request_details + + sig do + params( + request_details: Privy::RpcIntentResponse::RequestDetails::OrHash + ).void + end + attr_writer :request_details + + # Result of RPC execution (only present if status is 'executed' or 'failed') + sig { returns(T.nilable(Privy::BaseActionResult)) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # A wallet managed by Privy's wallet infrastructure. + sig { returns(T.nilable(Privy::Wallet)) } + attr_reader :current_resource_data + + sig { params(current_resource_data: Privy::Wallet::OrHash).void } + attr_writer :current_resource_data + + # Response for an RPC intent + sig do + params( + intent_type: Privy::RpcIntentResponse::IntentType::OrSymbol, + request_details: Privy::RpcIntentResponse::RequestDetails::OrHash, + action_result: Privy::BaseActionResult::OrHash, + current_resource_data: Privy::Wallet::OrHash + ).returns(T.attached_class) + end + def self.new( + intent_type:, + # The original RPC request that would be sent to the wallet endpoint + request_details:, + # Result of RPC execution (only present if status is 'executed' or 'failed') + action_result: nil, + # A wallet managed by Privy's wallet infrastructure. + current_resource_data: nil + ) + end + + sig do + override.returns( + { + intent_type: Privy::RpcIntentResponse::IntentType::TaggedSymbol, + request_details: Privy::RpcIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + ) + end + def to_hash + end + + module IntentType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::RpcIntentResponse::IntentType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RPC = T.let(:RPC, Privy::RpcIntentResponse::IntentType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::RpcIntentResponse::IntentType::TaggedSymbol] + ) + end + def self.values + end + end + + class RequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::RpcIntentResponse::RequestDetails, + Privy::Internal::AnyHash + ) + end + + # Request body for wallet RPC operations, discriminated by method. + sig { returns(Privy::WalletRpcRequestBody::Variants) } + attr_accessor :body + + sig do + returns( + Privy::RpcIntentResponse::RequestDetails::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # The original RPC request that would be sent to the wallet endpoint + sig do + params( + body: + T.any( + Privy::EthereumSignTransactionRpcInput::OrHash, + Privy::EthereumSendTransactionRpcInput::OrHash, + Privy::EthereumPersonalSignRpcInput::OrHash, + Privy::EthereumSignTypedDataRpcInput::OrHash, + Privy::EthereumSecp256k1SignRpcInput::OrHash, + Privy::EthereumSign7702AuthorizationRpcInput::OrHash, + Privy::EthereumSignUserOperationRpcInput::OrHash, + Privy::EthereumSendCallsRpcInput::OrHash, + Privy::SolanaSignTransactionRpcInput::OrHash, + Privy::SolanaSignAndSendTransactionRpcInput::OrHash, + Privy::SolanaSignMessageRpcInput::OrHash, + Privy::SparkTransferRpcInput::OrHash, + Privy::SparkGetBalanceRpcInput::OrHash, + Privy::SparkTransferTokensRpcInput::OrHash, + Privy::SparkGetStaticDepositAddressRpcInput::OrHash, + Privy::SparkGetClaimStaticDepositQuoteRpcInput::OrHash, + Privy::SparkClaimStaticDepositRpcInput::OrHash, + Privy::SparkCreateLightningInvoiceRpcInput::OrHash, + Privy::SparkPayLightningInvoiceRpcInput::OrHash, + Privy::SparkSignMessageWithIdentityKeyRpcInput::OrHash, + Privy::ExportPrivateKeyRpcInput::OrHash, + Privy::ExportSeedPhraseRpcInput::OrHash + ), + method_: Privy::RpcIntentResponse::RequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # Request body for wallet RPC operations, discriminated by method. + body:, + method_:, + url: + ) + end + + sig do + override.returns( + { + body: Privy::WalletRpcRequestBody::Variants, + method_: + Privy::RpcIntentResponse::RequestDetails::Method::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::RpcIntentResponse::RequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POST = + T.let( + :POST, + Privy::RpcIntentResponse::RequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::RpcIntentResponse::RequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/privy/models/rule_intent_create_request_details.rbi b/rbi/privy/models/rule_intent_create_request_details.rbi new file mode 100644 index 0000000..8ee312a --- /dev/null +++ b/rbi/privy/models/rule_intent_create_request_details.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Models + class RuleIntentCreateRequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RuleIntentCreateRequestDetails, Privy::Internal::AnyHash) + end + + # The rules that apply to each method the policy covers. + sig { returns(Privy::PolicyRuleRequestBody) } + attr_reader :body + + sig { params(body: Privy::PolicyRuleRequestBody::OrHash).void } + attr_writer :body + + sig do + returns(Privy::RuleIntentCreateRequestDetails::Method::TaggedSymbol) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # Request details for creating a rule via intent. + sig do + params( + body: Privy::PolicyRuleRequestBody::OrHash, + method_: Privy::RuleIntentCreateRequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # The rules that apply to each method the policy covers. + body:, + method_:, + url: + ) + end + + sig do + override.returns( + { + body: Privy::PolicyRuleRequestBody, + method_: + Privy::RuleIntentCreateRequestDetails::Method::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::RuleIntentCreateRequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POST = + T.let( + :POST, + Privy::RuleIntentCreateRequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::RuleIntentCreateRequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/rule_intent_delete_request_details.rbi b/rbi/privy/models/rule_intent_delete_request_details.rbi new file mode 100644 index 0000000..4b59f82 --- /dev/null +++ b/rbi/privy/models/rule_intent_delete_request_details.rbi @@ -0,0 +1,96 @@ +# typed: strong + +module Privy + module Models + class RuleIntentDeleteRequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RuleIntentDeleteRequestDetails, Privy::Internal::AnyHash) + end + + sig do + returns(Privy::RuleIntentDeleteRequestDetails::Method::TaggedSymbol) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + sig { returns(T.nilable(Privy::RuleIntentDeleteRequestDetails::Body)) } + attr_reader :body + + sig do + params(body: Privy::RuleIntentDeleteRequestDetails::Body::OrHash).void + end + attr_writer :body + + # Request details for deleting a rule via intent. + sig do + params( + method_: Privy::RuleIntentDeleteRequestDetails::Method::OrSymbol, + url: String, + body: Privy::RuleIntentDeleteRequestDetails::Body::OrHash + ).returns(T.attached_class) + end + def self.new(method_:, url:, body: nil) + end + + sig do + override.returns( + { + method_: + Privy::RuleIntentDeleteRequestDetails::Method::TaggedSymbol, + url: String, + body: Privy::RuleIntentDeleteRequestDetails::Body + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::RuleIntentDeleteRequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DELETE = + T.let( + :DELETE, + Privy::RuleIntentDeleteRequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::RuleIntentDeleteRequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + class Body < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::RuleIntentDeleteRequestDetails::Body, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.attached_class) } + def self.new + end + + sig { override.returns({}) } + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/rule_intent_request_details.rbi b/rbi/privy/models/rule_intent_request_details.rbi new file mode 100644 index 0000000..c069177 --- /dev/null +++ b/rbi/privy/models/rule_intent_request_details.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # The original rule request. Method is POST (create), PATCH (update), or DELETE + # (delete) + module RuleIntentRequestDetails + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::RuleIntentCreateRequestDetails, + Privy::RuleIntentUpdateRequestDetails, + Privy::RuleIntentDeleteRequestDetails + ) + end + + sig do + override.returns(T::Array[Privy::RuleIntentRequestDetails::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/rule_intent_response.rbi b/rbi/privy/models/rule_intent_response.rbi new file mode 100644 index 0000000..efff2df --- /dev/null +++ b/rbi/privy/models/rule_intent_response.rbi @@ -0,0 +1,106 @@ +# typed: strong + +module Privy + module Models + class RuleIntentResponse < Privy::Models::BaseIntentResponse + OrHash = + T.type_alias do + T.any(Privy::RuleIntentResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::RuleIntentResponse::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The original rule request. Method is POST (create), PATCH (update), or DELETE + # (delete) + sig { returns(Privy::RuleIntentRequestDetails::Variants) } + attr_accessor :request_details + + # Result of rule execution (only present if status is 'executed' or 'failed') + sig { returns(T.nilable(Privy::BaseActionResult)) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # A rule that defines the conditions and action to take if the conditions are + # true. + sig { returns(T.nilable(Privy::PolicyRuleResponse)) } + attr_reader :current_resource_data + + sig do + params(current_resource_data: Privy::PolicyRuleResponse::OrHash).void + end + attr_writer :current_resource_data + + # A policy for controlling wallet operations. + sig { returns(T.nilable(Privy::Policy)) } + attr_reader :policy + + sig { params(policy: Privy::Policy::OrHash).void } + attr_writer :policy + + # Response for a rule intent + sig do + params( + intent_type: Privy::RuleIntentResponse::IntentType::OrSymbol, + request_details: + T.any( + Privy::RuleIntentCreateRequestDetails::OrHash, + Privy::RuleIntentUpdateRequestDetails::OrHash, + Privy::RuleIntentDeleteRequestDetails::OrHash + ), + action_result: Privy::BaseActionResult::OrHash, + current_resource_data: Privy::PolicyRuleResponse::OrHash, + policy: Privy::Policy::OrHash + ).returns(T.attached_class) + end + def self.new( + intent_type:, + # The original rule request. Method is POST (create), PATCH (update), or DELETE + # (delete) + request_details:, + # Result of rule execution (only present if status is 'executed' or 'failed') + action_result: nil, + # A rule that defines the conditions and action to take if the conditions are + # true. + current_resource_data: nil, + # A policy for controlling wallet operations. + policy: nil + ) + end + + sig do + override.returns( + { + intent_type: Privy::RuleIntentResponse::IntentType::TaggedSymbol, + request_details: Privy::RuleIntentRequestDetails::Variants, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::PolicyRuleResponse, + policy: Privy::Policy + } + ) + end + def to_hash + end + + module IntentType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::RuleIntentResponse::IntentType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RULE = T.let(:RULE, Privy::RuleIntentResponse::IntentType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::RuleIntentResponse::IntentType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/rule_intent_update_request_details.rbi b/rbi/privy/models/rule_intent_update_request_details.rbi new file mode 100644 index 0000000..5ad3ccf --- /dev/null +++ b/rbi/privy/models/rule_intent_update_request_details.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Models + class RuleIntentUpdateRequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::RuleIntentUpdateRequestDetails, Privy::Internal::AnyHash) + end + + # The rules that apply to each method the policy covers. + sig { returns(Privy::PolicyRuleRequestBody) } + attr_reader :body + + sig { params(body: Privy::PolicyRuleRequestBody::OrHash).void } + attr_writer :body + + sig do + returns(Privy::RuleIntentUpdateRequestDetails::Method::TaggedSymbol) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # Request details for updating a rule via intent. + sig do + params( + body: Privy::PolicyRuleRequestBody::OrHash, + method_: Privy::RuleIntentUpdateRequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # The rules that apply to each method the policy covers. + body:, + method_:, + url: + ) + end + + sig do + override.returns( + { + body: Privy::PolicyRuleRequestBody, + method_: + Privy::RuleIntentUpdateRequestDetails::Method::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::RuleIntentUpdateRequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PATCH = + T.let( + :PATCH, + Privy::RuleIntentUpdateRequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::RuleIntentUpdateRequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/seed_phrase_export_input.rbi b/rbi/privy/models/seed_phrase_export_input.rbi new file mode 100644 index 0000000..843635c --- /dev/null +++ b/rbi/privy/models/seed_phrase_export_input.rbi @@ -0,0 +1,70 @@ +# typed: strong + +module Privy + module Models + class SeedPhraseExportInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SeedPhraseExportInput, Privy::Internal::AnyHash) + end + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + # The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) + # format. + sig { returns(String) } + attr_accessor :recipient_public_key + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :export_seed_phrase + + sig { params(export_seed_phrase: T::Boolean).void } + attr_writer :export_seed_phrase + + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + sig { returns(T.nilable(Privy::ExportType::OrSymbol)) } + attr_reader :export_type + + sig { params(export_type: Privy::ExportType::OrSymbol).void } + attr_writer :export_type + + # Input for exporting a wallet (private key or seed phrase) with HPKE encryption. + sig do + params( + encryption_type: Privy::HpkeEncryption::OrSymbol, + recipient_public_key: String, + export_seed_phrase: T::Boolean, + export_type: Privy::ExportType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + # The recipient public key for HPKE encryption, in PEM or DER (base64-encoded) + # format. + recipient_public_key:, + export_seed_phrase: nil, + # The export type. 'display' is for showing the key to the user in the UI, + # 'client' is for exporting to the client application. + export_type: nil + ) + end + + sig do + override.returns( + { + encryption_type: Privy::HpkeEncryption::OrSymbol, + recipient_public_key: String, + export_seed_phrase: T::Boolean, + export_type: Privy::ExportType::OrSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/seed_phrase_export_response.rbi b/rbi/privy/models/seed_phrase_export_response.rbi new file mode 100644 index 0000000..eec13ef --- /dev/null +++ b/rbi/privy/models/seed_phrase_export_response.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Models + class SeedPhraseExportResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SeedPhraseExportResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :ciphertext + + sig { returns(String) } + attr_accessor :encapsulated_key + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::TaggedSymbol) } + attr_accessor :encryption_type + + # Response containing HPKE-encrypted wallet data (private key or seed phrase). + sig do + params( + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + ciphertext:, + encapsulated_key:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type: + ) + end + + sig do + override.returns( + { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::TaggedSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/seed_phrase_export_webhook_payload.rbi b/rbi/privy/models/seed_phrase_export_webhook_payload.rbi new file mode 100644 index 0000000..e8916d2 --- /dev/null +++ b/rbi/privy/models/seed_phrase_export_webhook_payload.rbi @@ -0,0 +1,140 @@ +# typed: strong + +module Privy + module Models + class SeedPhraseExportWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SeedPhraseExportWebhookPayload, Privy::Internal::AnyHash) + end + + # The type of webhook event. + sig { returns(Privy::SeedPhraseExportWebhookPayload::Type::OrSymbol) } + attr_accessor :type + + # The ID of the user who exported the seed phrase. + sig { returns(String) } + attr_accessor :user_id + + # The address of the wallet. + sig { returns(String) } + attr_accessor :wallet_address + + # The ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + sig do + returns( + T.nilable( + Privy::SeedPhraseExportWebhookPayload::ExportSource::OrSymbol + ) + ) + end + attr_reader :export_source + + sig do + params( + export_source: + Privy::SeedPhraseExportWebhookPayload::ExportSource::OrSymbol + ).void + end + attr_writer :export_source + + # Payload for the wallet.seed_phrase_export webhook event. + sig do + params( + type: Privy::SeedPhraseExportWebhookPayload::Type::OrSymbol, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: + Privy::SeedPhraseExportWebhookPayload::ExportSource::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The type of webhook event. + type:, + # The ID of the user who exported the seed phrase. + user_id:, + # The address of the wallet. + wallet_address:, + # The ID of the wallet. + wallet_id:, + export_source: nil + ) + end + + sig do + override.returns( + { + type: Privy::SeedPhraseExportWebhookPayload::Type::OrSymbol, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: + Privy::SeedPhraseExportWebhookPayload::ExportSource::OrSymbol + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SeedPhraseExportWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_SEED_PHRASE_EXPORT = + T.let( + :"wallet.seed_phrase_export", + Privy::SeedPhraseExportWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SeedPhraseExportWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + + module ExportSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SeedPhraseExportWebhookPayload::ExportSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + DISPLAY = + T.let( + :display, + Privy::SeedPhraseExportWebhookPayload::ExportSource::TaggedSymbol + ) + CLIENT = + T.let( + :client, + Privy::SeedPhraseExportWebhookPayload::ExportSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SeedPhraseExportWebhookPayload::ExportSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/signing_algorithm.rbi b/rbi/privy/models/signing_algorithm.rbi new file mode 100644 index 0000000..8d6ea70 --- /dev/null +++ b/rbi/privy/models/signing_algorithm.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + # The signing algorithm used by the wallet. + module SigningAlgorithm + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::SigningAlgorithm) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ECDSA = T.let(:ECDSA, Privy::SigningAlgorithm::TaggedSymbol) + ED_DSA = T.let(:EdDSA, Privy::SigningAlgorithm::TaggedSymbol) + SCHNORR = T.let(:Schnorr, Privy::SigningAlgorithm::TaggedSymbol) + + sig { override.returns(T::Array[Privy::SigningAlgorithm::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/siwe_address_input.rbi b/rbi/privy/models/siwe_address_input.rbi new file mode 100644 index 0000000..76a51c4 --- /dev/null +++ b/rbi/privy/models/siwe_address_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class SiweAddressInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiweAddressInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # Input containing a SIWE wallet address. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_authenticate_request_body.rbi b/rbi/privy/models/siwe_authenticate_request_body.rbi new file mode 100644 index 0000000..ff5d5c5 --- /dev/null +++ b/rbi/privy/models/siwe_authenticate_request_body.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class SiweAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiweAuthenticateRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :chain_id + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # The request body for authenticating a SIWE ceremony. + sig do + params( + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + chain_id: nil, + connector_type: nil, + # Whether to allow sign-up during authentication. + mode: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_init_input.rbi b/rbi/privy/models/siwe_init_input.rbi new file mode 100644 index 0000000..bc3a34d --- /dev/null +++ b/rbi/privy/models/siwe_init_input.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Privy + module Models + class SiweInitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SiweInitInput, Privy::Internal::AnyHash) } + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + # Input for initiating a SIWE ceremony. + sig { params(token: String, address: String).returns(T.attached_class) } + def self.new(token: nil, address: nil) + end + + sig { override.returns({ token: String, address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_init_request_body.rbi b/rbi/privy/models/siwe_init_request_body.rbi new file mode 100644 index 0000000..241c0c3 --- /dev/null +++ b/rbi/privy/models/siwe_init_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class SiweInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiweInitRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # The request body for initiating a SIWE ceremony. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_init_response_body.rbi b/rbi/privy/models/siwe_init_response_body.rbi new file mode 100644 index 0000000..962ad1b --- /dev/null +++ b/rbi/privy/models/siwe_init_response_body.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + class SiweInitResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiweInitResponseBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :nonce + + # The response body for initiating a SIWE ceremony. + sig do + params(address: String, expires_at: String, nonce: String).returns( + T.attached_class + ) + end + def self.new(address:, expires_at:, nonce:) + end + + sig do + override.returns({ address: String, expires_at: String, nonce: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_input.rbi b/rbi/privy/models/siwe_input.rbi new file mode 100644 index 0000000..5e07da0 --- /dev/null +++ b/rbi/privy/models/siwe_input.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class SiweInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SiweInput, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :chain_id + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # Input for a SIWE signing ceremony. + sig do + params( + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + chain_id: nil, + connector_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_link_request_body.rbi b/rbi/privy/models/siwe_link_request_body.rbi new file mode 100644 index 0000000..8b021ed --- /dev/null +++ b/rbi/privy/models/siwe_link_request_body.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class SiweLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiweLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :chain_id + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # The request body for linking a SIWE ceremony. + sig do + params( + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + chain_id: nil, + connector_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_link_smart_wallet_request_body.rbi b/rbi/privy/models/siwe_link_smart_wallet_request_body.rbi new file mode 100644 index 0000000..bc825ca --- /dev/null +++ b/rbi/privy/models/siwe_link_smart_wallet_request_body.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class SiweLinkSmartWalletRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiweLinkSmartWalletRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # The supported smart wallet providers. + sig { returns(Privy::SmartWalletType::OrSymbol) } + attr_accessor :smart_wallet_type + + sig { returns(T.nilable(String)) } + attr_reader :smart_wallet_version + + sig { params(smart_wallet_version: String).void } + attr_writer :smart_wallet_version + + # The request body for linking a SIWE ceremony to a smart wallet. + sig do + params( + message: String, + signature: String, + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + smart_wallet_version: String + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + # The supported smart wallet providers. + smart_wallet_type:, + smart_wallet_version: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + smart_wallet_version: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_nonce.rbi b/rbi/privy/models/siwe_nonce.rbi new file mode 100644 index 0000000..4eaf064 --- /dev/null +++ b/rbi/privy/models/siwe_nonce.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class SiweNonce < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SiweNonce, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :nonce + + # A SIWE nonce response. + sig do + params(address: String, expires_at: String, nonce: String).returns( + T.attached_class + ) + end + def self.new(address:, expires_at:, nonce:) + end + + sig do + override.returns({ address: String, expires_at: String, nonce: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siwe_unlink_request_body.rbi b/rbi/privy/models/siwe_unlink_request_body.rbi new file mode 100644 index 0000000..93e5778 --- /dev/null +++ b/rbi/privy/models/siwe_unlink_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class SiweUnlinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiweUnlinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # The request body for unlinking a SIWE ceremony. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siws_address_input.rbi b/rbi/privy/models/siws_address_input.rbi new file mode 100644 index 0000000..c8120b3 --- /dev/null +++ b/rbi/privy/models/siws_address_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class SiwsAddressInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiwsAddressInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # Input containing a SIWS wallet address. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siws_authenticate_request_body.rbi b/rbi/privy/models/siws_authenticate_request_body.rbi new file mode 100644 index 0000000..06ede86 --- /dev/null +++ b/rbi/privy/models/siws_authenticate_request_body.rbi @@ -0,0 +1,116 @@ +# typed: strong + +module Privy + module Models + class SiwsAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiwsAuthenticateRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig do + returns( + T.nilable(Privy::SiwsAuthenticateRequestBody::MessageType::OrSymbol) + ) + end + attr_reader :message_type + + sig do + params( + message_type: + Privy::SiwsAuthenticateRequestBody::MessageType::OrSymbol + ).void + end + attr_writer :message_type + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # The request body for authenticating a SIWS ceremony. + sig do + params( + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: + Privy::SiwsAuthenticateRequestBody::MessageType::OrSymbol, + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + connector_type: nil, + message_type: nil, + # Whether to allow sign-up during authentication. + mode: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: + Privy::SiwsAuthenticateRequestBody::MessageType::OrSymbol, + mode: Privy::AuthenticateModeOption::OrSymbol, + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + + module MessageType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SiwsAuthenticateRequestBody::MessageType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION = + T.let( + :transaction, + Privy::SiwsAuthenticateRequestBody::MessageType::TaggedSymbol + ) + PLAIN = + T.let( + :plain, + Privy::SiwsAuthenticateRequestBody::MessageType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SiwsAuthenticateRequestBody::MessageType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/siws_init_input.rbi b/rbi/privy/models/siws_init_input.rbi new file mode 100644 index 0000000..999be62 --- /dev/null +++ b/rbi/privy/models/siws_init_input.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class SiwsInitInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SiwsInitInput, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :address + + sig { returns(T.nilable(String)) } + attr_reader :token + + sig { params(token: String).void } + attr_writer :token + + # Input for initiating a SIWS ceremony. + sig { params(address: String, token: String).returns(T.attached_class) } + def self.new(address:, token: nil) + end + + sig { override.returns({ address: String, token: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siws_init_request_body.rbi b/rbi/privy/models/siws_init_request_body.rbi new file mode 100644 index 0000000..82881d8 --- /dev/null +++ b/rbi/privy/models/siws_init_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class SiwsInitRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiwsInitRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # The request body for initiating a SIWS ceremony. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siws_init_response_body.rbi b/rbi/privy/models/siws_init_response_body.rbi new file mode 100644 index 0000000..b61fa03 --- /dev/null +++ b/rbi/privy/models/siws_init_response_body.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + class SiwsInitResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiwsInitResponseBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :nonce + + # The response body for initiating a SIWS ceremony. + sig do + params(address: String, expires_at: String, nonce: String).returns( + T.attached_class + ) + end + def self.new(address:, expires_at:, nonce:) + end + + sig do + override.returns({ address: String, expires_at: String, nonce: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siws_input.rbi b/rbi/privy/models/siws_input.rbi new file mode 100644 index 0000000..b7a2096 --- /dev/null +++ b/rbi/privy/models/siws_input.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class SiwsInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SiwsInput, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig { returns(T.nilable(Privy::SiwsInput::MessageType::OrSymbol)) } + attr_reader :message_type + + sig { params(message_type: Privy::SiwsInput::MessageType::OrSymbol).void } + attr_writer :message_type + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # Input for a SIWS signing ceremony. + sig do + params( + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: Privy::SiwsInput::MessageType::OrSymbol, + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + connector_type: nil, + message_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: Privy::SiwsInput::MessageType::OrSymbol, + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + + module MessageType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SiwsInput::MessageType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION = + T.let(:transaction, Privy::SiwsInput::MessageType::TaggedSymbol) + PLAIN = T.let(:plain, Privy::SiwsInput::MessageType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SiwsInput::MessageType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/siws_link_request_body.rbi b/rbi/privy/models/siws_link_request_body.rbi new file mode 100644 index 0000000..31ece50 --- /dev/null +++ b/rbi/privy/models/siws_link_request_body.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Privy + module Models + class SiwsLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiwsLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig do + returns(T.nilable(Privy::SiwsLinkRequestBody::MessageType::OrSymbol)) + end + attr_reader :message_type + + sig do + params( + message_type: Privy::SiwsLinkRequestBody::MessageType::OrSymbol + ).void + end + attr_writer :message_type + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # The request body for linking a SIWS ceremony. + sig do + params( + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: Privy::SiwsLinkRequestBody::MessageType::OrSymbol, + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + connector_type: nil, + message_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + connector_type: T.nilable(String), + message_type: Privy::SiwsLinkRequestBody::MessageType::OrSymbol, + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + + module MessageType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SiwsLinkRequestBody::MessageType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION = + T.let( + :transaction, + Privy::SiwsLinkRequestBody::MessageType::TaggedSymbol + ) + PLAIN = + T.let(:plain, Privy::SiwsLinkRequestBody::MessageType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SiwsLinkRequestBody::MessageType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/siws_nonce.rbi b/rbi/privy/models/siws_nonce.rbi new file mode 100644 index 0000000..f7db4ac --- /dev/null +++ b/rbi/privy/models/siws_nonce.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class SiwsNonce < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SiwsNonce, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :expires_at + + sig { returns(String) } + attr_accessor :nonce + + # A SIWS nonce response. + sig do + params(address: String, expires_at: String, nonce: String).returns( + T.attached_class + ) + end + def self.new(address:, expires_at:, nonce:) + end + + sig do + override.returns({ address: String, expires_at: String, nonce: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/siws_unlink_request_body.rbi b/rbi/privy/models/siws_unlink_request_body.rbi new file mode 100644 index 0000000..8407ffa --- /dev/null +++ b/rbi/privy/models/siws_unlink_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class SiwsUnlinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SiwsUnlinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + # The request body for unlinking a SIWS ceremony. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_configuration.rbi b/rbi/privy/models/smart_wallet_configuration.rbi new file mode 100644 index 0000000..18be95c --- /dev/null +++ b/rbi/privy/models/smart_wallet_configuration.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # The configuration object for smart wallets. + module SmartWalletConfiguration + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SmartWalletConfigurationDisabled, + Privy::SmartWalletConfigurationEnabled + ) + end + + sig do + override.returns(T::Array[Privy::SmartWalletConfiguration::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_configuration_disabled.rbi b/rbi/privy/models/smart_wallet_configuration_disabled.rbi new file mode 100644 index 0000000..ef1845d --- /dev/null +++ b/rbi/privy/models/smart_wallet_configuration_disabled.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class SmartWalletConfigurationDisabled < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SmartWalletConfigurationDisabled, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SmartWalletConfigurationDisabled::Enabled::TaggedBoolean) + end + attr_accessor :enabled + + # A disabled smart wallet configuration. + sig do + params( + enabled: Privy::SmartWalletConfigurationDisabled::Enabled::OrBoolean + ).returns(T.attached_class) + end + def self.new(enabled:) + end + + sig do + override.returns( + { + enabled: + Privy::SmartWalletConfigurationDisabled::Enabled::TaggedBoolean + } + ) + end + def to_hash + end + + module Enabled + extend Privy::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all(T::Boolean, Privy::SmartWalletConfigurationDisabled::Enabled) + end + OrBoolean = T.type_alias { T::Boolean } + + FALSE = + T.let( + false, + Privy::SmartWalletConfigurationDisabled::Enabled::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + Privy::SmartWalletConfigurationDisabled::Enabled::TaggedBoolean + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_configuration_enabled.rbi b/rbi/privy/models/smart_wallet_configuration_enabled.rbi new file mode 100644 index 0000000..7dc25fb --- /dev/null +++ b/rbi/privy/models/smart_wallet_configuration_enabled.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module Privy + module Models + class SmartWalletConfigurationEnabled < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SmartWalletConfigurationEnabled, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[Privy::SmartWalletNetworkConfiguration]) } + attr_accessor :configured_networks + + sig do + returns(Privy::SmartWalletConfigurationEnabled::Enabled::TaggedBoolean) + end + attr_accessor :enabled + + # The supported smart wallet providers. + sig { returns(Privy::SmartWalletType::TaggedSymbol) } + attr_accessor :smart_wallet_type + + sig { returns(T.nilable(String)) } + attr_reader :smart_wallet_version + + sig { params(smart_wallet_version: String).void } + attr_writer :smart_wallet_version + + # An enabled smart wallet configuration. + sig do + params( + configured_networks: + T::Array[Privy::SmartWalletNetworkConfiguration::OrHash], + enabled: Privy::SmartWalletConfigurationEnabled::Enabled::OrBoolean, + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + smart_wallet_version: String + ).returns(T.attached_class) + end + def self.new( + configured_networks:, + enabled:, + # The supported smart wallet providers. + smart_wallet_type:, + smart_wallet_version: nil + ) + end + + sig do + override.returns( + { + configured_networks: + T::Array[Privy::SmartWalletNetworkConfiguration], + enabled: + Privy::SmartWalletConfigurationEnabled::Enabled::TaggedBoolean, + smart_wallet_type: Privy::SmartWalletType::TaggedSymbol, + smart_wallet_version: String + } + ) + end + def to_hash + end + + module Enabled + extend Privy::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all(T::Boolean, Privy::SmartWalletConfigurationEnabled::Enabled) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + Privy::SmartWalletConfigurationEnabled::Enabled::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + Privy::SmartWalletConfigurationEnabled::Enabled::TaggedBoolean + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_configuration_input.rbi b/rbi/privy/models/smart_wallet_configuration_input.rbi new file mode 100644 index 0000000..63fd888 --- /dev/null +++ b/rbi/privy/models/smart_wallet_configuration_input.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # The input configuration object for smart wallets. + module SmartWalletConfigurationInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SmartWalletConfigurationDisabled, + Privy::SmartWalletConfigurationInputEnabled + ) + end + + sig do + override.returns( + T::Array[Privy::SmartWalletConfigurationInput::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_configuration_input_enabled.rbi b/rbi/privy/models/smart_wallet_configuration_input_enabled.rbi new file mode 100644 index 0000000..5556d57 --- /dev/null +++ b/rbi/privy/models/smart_wallet_configuration_input_enabled.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class SmartWalletConfigurationInputEnabled < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SmartWalletConfigurationInputEnabled, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[Privy::SmartWalletNetworkConfigurationInput]) } + attr_accessor :configured_networks + + sig do + returns(Privy::SmartWalletConfigurationInputEnabled::Enabled::OrBoolean) + end + attr_accessor :enabled + + # The supported smart wallet providers. + sig { returns(Privy::SmartWalletType::OrSymbol) } + attr_accessor :smart_wallet_type + + sig { returns(T.nilable(String)) } + attr_accessor :smart_wallet_version + + # An enabled smart wallet configuration input. + sig do + params( + configured_networks: + T::Array[Privy::SmartWalletNetworkConfigurationInput::OrHash], + enabled: + Privy::SmartWalletConfigurationInputEnabled::Enabled::OrBoolean, + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + smart_wallet_version: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + configured_networks:, + enabled:, + # The supported smart wallet providers. + smart_wallet_type:, + smart_wallet_version: nil + ) + end + + sig do + override.returns( + { + configured_networks: + T::Array[Privy::SmartWalletNetworkConfigurationInput], + enabled: + Privy::SmartWalletConfigurationInputEnabled::Enabled::OrBoolean, + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + smart_wallet_version: T.nilable(String) + } + ) + end + def to_hash + end + + module Enabled + extend Privy::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + Privy::SmartWalletConfigurationInputEnabled::Enabled + ) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + Privy::SmartWalletConfigurationInputEnabled::Enabled::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + Privy::SmartWalletConfigurationInputEnabled::Enabled::TaggedBoolean + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_network_configuration.rbi b/rbi/privy/models/smart_wallet_network_configuration.rbi new file mode 100644 index 0000000..b2305f1 --- /dev/null +++ b/rbi/privy/models/smart_wallet_network_configuration.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Privy + module Models + class SmartWalletNetworkConfiguration < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SmartWalletNetworkConfiguration, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :bundler_url + + sig { returns(String) } + attr_accessor :chain_id + + sig { returns(T.nilable(String)) } + attr_reader :chain_name + + sig { params(chain_name: String).void } + attr_writer :chain_name + + # The Alchemy paymaster context for a smart wallet network configuration. + sig { returns(T.nilable(Privy::AlchemyPaymasterContext)) } + attr_reader :paymaster_context + + sig do + params(paymaster_context: Privy::AlchemyPaymasterContext::OrHash).void + end + attr_writer :paymaster_context + + sig { returns(T.nilable(String)) } + attr_reader :paymaster_url + + sig { params(paymaster_url: String).void } + attr_writer :paymaster_url + + sig { returns(T.nilable(String)) } + attr_reader :rpc_url + + sig { params(rpc_url: String).void } + attr_writer :rpc_url + + # Network configuration for a smart wallet. + sig do + params( + bundler_url: String, + chain_id: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext::OrHash, + paymaster_url: String, + rpc_url: String + ).returns(T.attached_class) + end + def self.new( + bundler_url:, + chain_id:, + chain_name: nil, + # The Alchemy paymaster context for a smart wallet network configuration. + paymaster_context: nil, + paymaster_url: nil, + rpc_url: nil + ) + end + + sig do + override.returns( + { + bundler_url: String, + chain_id: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext, + paymaster_url: String, + rpc_url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_network_configuration_input.rbi b/rbi/privy/models/smart_wallet_network_configuration_input.rbi new file mode 100644 index 0000000..ae381e9 --- /dev/null +++ b/rbi/privy/models/smart_wallet_network_configuration_input.rbi @@ -0,0 +1,88 @@ +# typed: strong + +module Privy + module Models + class SmartWalletNetworkConfigurationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SmartWalletNetworkConfigurationInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :chain_id + + sig { returns(T.nilable(String)) } + attr_reader :bundler_url + + sig { params(bundler_url: String).void } + attr_writer :bundler_url + + sig { returns(T.nilable(String)) } + attr_reader :chain_name + + sig { params(chain_name: String).void } + attr_writer :chain_name + + # The Alchemy paymaster context for a smart wallet network configuration. + sig { returns(T.nilable(Privy::AlchemyPaymasterContext)) } + attr_reader :paymaster_context + + sig do + params(paymaster_context: Privy::AlchemyPaymasterContext::OrHash).void + end + attr_writer :paymaster_context + + sig { returns(T.nilable(String)) } + attr_reader :paymaster_url + + sig { params(paymaster_url: String).void } + attr_writer :paymaster_url + + sig { returns(T.nilable(String)) } + attr_reader :rpc_url + + sig { params(rpc_url: String).void } + attr_writer :rpc_url + + # Input for network configuration for a smart wallet. + sig do + params( + chain_id: String, + bundler_url: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext::OrHash, + paymaster_url: String, + rpc_url: String + ).returns(T.attached_class) + end + def self.new( + chain_id:, + bundler_url: nil, + chain_name: nil, + # The Alchemy paymaster context for a smart wallet network configuration. + paymaster_context: nil, + paymaster_url: nil, + rpc_url: nil + ) + end + + sig do + override.returns( + { + chain_id: String, + bundler_url: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext, + paymaster_url: String, + rpc_url: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_siwe_input.rbi b/rbi/privy/models/smart_wallet_siwe_input.rbi new file mode 100644 index 0000000..6cace28 --- /dev/null +++ b/rbi/privy/models/smart_wallet_siwe_input.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class SmartWalletSiweInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SmartWalletSiweInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(String) } + attr_accessor :signature + + # The supported smart wallet providers. + sig { returns(Privy::SmartWalletType::OrSymbol) } + attr_accessor :smart_wallet_type + + sig { returns(T.nilable(String)) } + attr_reader :smart_wallet_version + + sig { params(smart_wallet_version: String).void } + attr_writer :smart_wallet_version + + # Input for a smart wallet SIWE signing ceremony. + sig do + params( + message: String, + signature: String, + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + smart_wallet_version: String + ).returns(T.attached_class) + end + def self.new( + message:, + signature:, + # The supported smart wallet providers. + smart_wallet_type:, + smart_wallet_version: nil + ) + end + + sig do + override.returns( + { + message: String, + signature: String, + smart_wallet_type: Privy::SmartWalletType::OrSymbol, + smart_wallet_version: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/smart_wallet_type.rbi b/rbi/privy/models/smart_wallet_type.rbi new file mode 100644 index 0000000..18a9d10 --- /dev/null +++ b/rbi/privy/models/smart_wallet_type.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # The supported smart wallet providers. + module SmartWalletType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::SmartWalletType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SAFE = T.let(:safe, Privy::SmartWalletType::TaggedSymbol) + KERNEL = T.let(:kernel, Privy::SmartWalletType::TaggedSymbol) + LIGHT_ACCOUNT = + T.let(:light_account, Privy::SmartWalletType::TaggedSymbol) + BICONOMY = T.let(:biconomy, Privy::SmartWalletType::TaggedSymbol) + COINBASE_SMART_WALLET = + T.let(:coinbase_smart_wallet, Privy::SmartWalletType::TaggedSymbol) + THIRDWEB = T.let(:thirdweb, Privy::SmartWalletType::TaggedSymbol) + NEXUS = T.let(:nexus, Privy::SmartWalletType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::SmartWalletType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/sms_mfa_method.rbi b/rbi/privy/models/sms_mfa_method.rbi new file mode 100644 index 0000000..5284ed6 --- /dev/null +++ b/rbi/privy/models/sms_mfa_method.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class SMSMfaMethod < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SMSMfaMethod, Privy::Internal::AnyHash) } + + sig { returns(Privy::SMSMfaMethod::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A SMS MFA method. + sig do + params( + type: Privy::SMSMfaMethod::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new(type:, verified_at:) + end + + sig do + override.returns( + { type: Privy::SMSMfaMethod::Type::TaggedSymbol, verified_at: Float } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::SMSMfaMethod::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMS = T.let(:sms, Privy::SMSMfaMethod::Type::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::SMSMfaMethod::Type::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_program_instruction_condition.rbi b/rbi/privy/models/solana_program_instruction_condition.rbi new file mode 100644 index 0000000..fff694a --- /dev/null +++ b/rbi/privy/models/solana_program_instruction_condition.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Privy + module Models + class SolanaProgramInstructionCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaProgramInstructionCondition, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::SolanaProgramInstructionCondition::Field::OrSymbol) } + attr_accessor :field + + sig do + returns(Privy::SolanaProgramInstructionCondition::FieldSource::OrSymbol) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Solana Program attributes, enables allowlisting Solana Programs. + sig do + params( + field: Privy::SolanaProgramInstructionCondition::Field::OrSymbol, + field_source: + Privy::SolanaProgramInstructionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: Privy::SolanaProgramInstructionCondition::Field::OrSymbol, + field_source: + Privy::SolanaProgramInstructionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaProgramInstructionCondition::Field) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PROGRAM_ID = + T.let( + :programId, + Privy::SolanaProgramInstructionCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaProgramInstructionCondition::Field::TaggedSymbol + ] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaProgramInstructionCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA_PROGRAM_INSTRUCTION = + T.let( + :solana_program_instruction, + Privy::SolanaProgramInstructionCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaProgramInstructionCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_rpc_input.rbi b/rbi/privy/models/solana_rpc_input.rbi new file mode 100644 index 0000000..9afb108 --- /dev/null +++ b/rbi/privy/models/solana_rpc_input.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Request body for Solana wallet RPC operations, discriminated by method. + module SolanaRpcInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SolanaSignTransactionRpcInput, + Privy::SolanaSignAndSendTransactionRpcInput, + Privy::SolanaSignMessageRpcInput + ) + end + + sig { override.returns(T::Array[Privy::SolanaRpcInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/solana_rpc_response.rbi b/rbi/privy/models/solana_rpc_response.rbi new file mode 100644 index 0000000..ddf81ac --- /dev/null +++ b/rbi/privy/models/solana_rpc_response.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # Response body for Solana wallet RPC operations, discriminated by method. + module SolanaRpcResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SolanaSignMessageRpcResponse, + Privy::SolanaSignTransactionRpcResponse, + Privy::SolanaSignAndSendTransactionRpcResponse + ) + end + + sig { override.returns(T::Array[Privy::SolanaRpcResponse::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/solana_sign_and_send_transaction_rpc_input.rbi b/rbi/privy/models/solana_sign_and_send_transaction_rpc_input.rbi new file mode 100644 index 0000000..ee021bb --- /dev/null +++ b/rbi/privy/models/solana_sign_and_send_transaction_rpc_input.rbi @@ -0,0 +1,189 @@ +# typed: strong + +module Privy + module Models + class SolanaSignAndSendTransactionRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignAndSendTransactionRpcInput, + Privy::Internal::AnyHash + ) + end + + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + sig { returns(String) } + attr_accessor :caip2 + + sig do + returns(Privy::SolanaSignAndSendTransactionRpcInput::Method::OrSymbol) + end + attr_accessor :method_ + + # Parameters for the SVM `signAndSendTransaction` RPC. + sig { returns(Privy::SolanaSignAndSendTransactionRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::SolanaSignAndSendTransactionRpcInputParams::OrHash + ).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable( + Privy::SolanaSignAndSendTransactionRpcInput::ChainType::OrSymbol + ) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: + Privy::SolanaSignAndSendTransactionRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :optimistic_broadcast + + sig { params(optimistic_broadcast: T::Boolean).void } + attr_writer :optimistic_broadcast + + sig { returns(T.nilable(String)) } + attr_reader :reference_id + + sig { params(reference_id: String).void } + attr_writer :reference_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :sponsor + + sig { params(sponsor: T::Boolean).void } + attr_writer :sponsor + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the SVM `signAndSendTransaction` RPC to sign and broadcast a + # transaction. + sig do + params( + caip2: String, + method_: + Privy::SolanaSignAndSendTransactionRpcInput::Method::OrSymbol, + params: Privy::SolanaSignAndSendTransactionRpcInputParams::OrHash, + address: String, + chain_type: + Privy::SolanaSignAndSendTransactionRpcInput::ChainType::OrSymbol, + optimistic_broadcast: T::Boolean, + reference_id: String, + sponsor: T::Boolean, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + caip2:, + method_:, + # Parameters for the SVM `signAndSendTransaction` RPC. + params:, + address: nil, + chain_type: nil, + optimistic_broadcast: nil, + reference_id: nil, + sponsor: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + method_: + Privy::SolanaSignAndSendTransactionRpcInput::Method::OrSymbol, + params: Privy::SolanaSignAndSendTransactionRpcInputParams, + address: String, + chain_type: + Privy::SolanaSignAndSendTransactionRpcInput::ChainType::OrSymbol, + optimistic_broadcast: T::Boolean, + reference_id: String, + sponsor: T::Boolean, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignAndSendTransactionRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_AND_SEND_TRANSACTION = + T.let( + :signAndSendTransaction, + Privy::SolanaSignAndSendTransactionRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignAndSendTransactionRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SolanaSignAndSendTransactionRpcInput::ChainType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA = + T.let( + :solana, + Privy::SolanaSignAndSendTransactionRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignAndSendTransactionRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_and_send_transaction_rpc_input_params.rbi b/rbi/privy/models/solana_sign_and_send_transaction_rpc_input_params.rbi new file mode 100644 index 0000000..88a7b99 --- /dev/null +++ b/rbi/privy/models/solana_sign_and_send_transaction_rpc_input_params.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class SolanaSignAndSendTransactionRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignAndSendTransactionRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SolanaSignAndSendTransactionRpcInputParams::Encoding::OrSymbol + ) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :transaction + + # Parameters for the SVM `signAndSendTransaction` RPC. + sig do + params( + encoding: + Privy::SolanaSignAndSendTransactionRpcInputParams::Encoding::OrSymbol, + transaction: String + ).returns(T.attached_class) + end + def self.new(encoding:, transaction:) + end + + sig do + override.returns( + { + encoding: + Privy::SolanaSignAndSendTransactionRpcInputParams::Encoding::OrSymbol, + transaction: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SolanaSignAndSendTransactionRpcInputParams::Encoding + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BASE64 = + T.let( + :base64, + Privy::SolanaSignAndSendTransactionRpcInputParams::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignAndSendTransactionRpcInputParams::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_and_send_transaction_rpc_response.rbi b/rbi/privy/models/solana_sign_and_send_transaction_rpc_response.rbi new file mode 100644 index 0000000..34ca21b --- /dev/null +++ b/rbi/privy/models/solana_sign_and_send_transaction_rpc_response.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Privy + module Models + class SolanaSignAndSendTransactionRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignAndSendTransactionRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the SVM `signAndSendTransaction` RPC. + sig { returns(Privy::SolanaSignAndSendTransactionRpcResponseData) } + attr_reader :data + + sig do + params( + data: Privy::SolanaSignAndSendTransactionRpcResponseData::OrHash + ).void + end + attr_writer :data + + sig do + returns( + Privy::SolanaSignAndSendTransactionRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # Response to the SVM `signAndSendTransaction` RPC. + sig do + params( + data: Privy::SolanaSignAndSendTransactionRpcResponseData::OrHash, + method_: + Privy::SolanaSignAndSendTransactionRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the SVM `signAndSendTransaction` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::SolanaSignAndSendTransactionRpcResponseData, + method_: + Privy::SolanaSignAndSendTransactionRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SolanaSignAndSendTransactionRpcResponse::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_AND_SEND_TRANSACTION = + T.let( + :signAndSendTransaction, + Privy::SolanaSignAndSendTransactionRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignAndSendTransactionRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_and_send_transaction_rpc_response_data.rbi b/rbi/privy/models/solana_sign_and_send_transaction_rpc_response_data.rbi new file mode 100644 index 0000000..ef8a6d5 --- /dev/null +++ b/rbi/privy/models/solana_sign_and_send_transaction_rpc_response_data.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class SolanaSignAndSendTransactionRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignAndSendTransactionRpcResponseData, + Privy::Internal::AnyHash + ) + end + + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(String) } + attr_accessor :hash_ + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig { returns(T.nilable(String)) } + attr_reader :signed_transaction + + sig { params(signed_transaction: String).void } + attr_writer :signed_transaction + + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + + sig { params(transaction_id: String).void } + attr_writer :transaction_id + + # Data returned by the SVM `signAndSendTransaction` RPC. + sig do + params( + caip2: String, + hash_: String, + reference_id: T.nilable(String), + signed_transaction: String, + transaction_id: String + ).returns(T.attached_class) + end + def self.new( + # A valid CAIP-2 chain ID (e.g. 'eip155:1'). + caip2:, + hash_:, + reference_id: nil, + signed_transaction: nil, + transaction_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + hash_: String, + reference_id: T.nilable(String), + signed_transaction: String, + transaction_id: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/solana_sign_message_rpc_input.rbi b/rbi/privy/models/solana_sign_message_rpc_input.rbi new file mode 100644 index 0000000..88e5605 --- /dev/null +++ b/rbi/privy/models/solana_sign_message_rpc_input.rbi @@ -0,0 +1,132 @@ +# typed: strong + +module Privy + module Models + class SolanaSignMessageRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SolanaSignMessageRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SolanaSignMessageRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the SVM `signMessage` RPC. + sig { returns(Privy::SolanaSignMessageRpcInputParams) } + attr_reader :params + + sig do + params(params: Privy::SolanaSignMessageRpcInputParams::OrHash).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::SolanaSignMessageRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: Privy::SolanaSignMessageRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the SVM `signMessage` RPC to sign a message. + sig do + params( + method_: Privy::SolanaSignMessageRpcInput::Method::OrSymbol, + params: Privy::SolanaSignMessageRpcInputParams::OrHash, + address: String, + chain_type: Privy::SolanaSignMessageRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the SVM `signMessage` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SolanaSignMessageRpcInput::Method::OrSymbol, + params: Privy::SolanaSignMessageRpcInputParams, + address: String, + chain_type: Privy::SolanaSignMessageRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignMessageRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_MESSAGE = + T.let( + :signMessage, + Privy::SolanaSignMessageRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SolanaSignMessageRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignMessageRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA = + T.let( + :solana, + Privy::SolanaSignMessageRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SolanaSignMessageRpcInput::ChainType::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_message_rpc_input_params.rbi b/rbi/privy/models/solana_sign_message_rpc_input_params.rbi new file mode 100644 index 0000000..e2dfdaf --- /dev/null +++ b/rbi/privy/models/solana_sign_message_rpc_input_params.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class SolanaSignMessageRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignMessageRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SolanaSignMessageRpcInputParams::Encoding::OrSymbol) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :message + + # Parameters for the SVM `signMessage` RPC. + sig do + params( + encoding: Privy::SolanaSignMessageRpcInputParams::Encoding::OrSymbol, + message: String + ).returns(T.attached_class) + end + def self.new(encoding:, message:) + end + + sig do + override.returns( + { + encoding: + Privy::SolanaSignMessageRpcInputParams::Encoding::OrSymbol, + message: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignMessageRpcInputParams::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BASE64 = + T.let( + :base64, + Privy::SolanaSignMessageRpcInputParams::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignMessageRpcInputParams::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_message_rpc_response.rbi b/rbi/privy/models/solana_sign_message_rpc_response.rbi new file mode 100644 index 0000000..b024ee5 --- /dev/null +++ b/rbi/privy/models/solana_sign_message_rpc_response.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class SolanaSignMessageRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SolanaSignMessageRpcResponse, Privy::Internal::AnyHash) + end + + # Data returned by the SVM `signMessage` RPC. + sig { returns(Privy::SolanaSignMessageRpcResponseData) } + attr_reader :data + + sig { params(data: Privy::SolanaSignMessageRpcResponseData::OrHash).void } + attr_writer :data + + sig { returns(Privy::SolanaSignMessageRpcResponse::Method::TaggedSymbol) } + attr_accessor :method_ + + # Response to the SVM `signMessage` RPC. + sig do + params( + data: Privy::SolanaSignMessageRpcResponseData::OrHash, + method_: Privy::SolanaSignMessageRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the SVM `signMessage` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::SolanaSignMessageRpcResponseData, + method_: Privy::SolanaSignMessageRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignMessageRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_MESSAGE = + T.let( + :signMessage, + Privy::SolanaSignMessageRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SolanaSignMessageRpcResponse::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_message_rpc_response_data.rbi b/rbi/privy/models/solana_sign_message_rpc_response_data.rbi new file mode 100644 index 0000000..04e36d4 --- /dev/null +++ b/rbi/privy/models/solana_sign_message_rpc_response_data.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class SolanaSignMessageRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignMessageRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SolanaSignMessageRpcResponseData::Encoding::TaggedSymbol) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :signature + + # Data returned by the SVM `signMessage` RPC. + sig do + params( + encoding: Privy::SolanaSignMessageRpcResponseData::Encoding::OrSymbol, + signature: String + ).returns(T.attached_class) + end + def self.new(encoding:, signature:) + end + + sig do + override.returns( + { + encoding: + Privy::SolanaSignMessageRpcResponseData::Encoding::TaggedSymbol, + signature: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignMessageRpcResponseData::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BASE64 = + T.let( + :base64, + Privy::SolanaSignMessageRpcResponseData::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignMessageRpcResponseData::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_transaction_rpc_input.rbi b/rbi/privy/models/solana_sign_transaction_rpc_input.rbi new file mode 100644 index 0000000..f1a50e0 --- /dev/null +++ b/rbi/privy/models/solana_sign_transaction_rpc_input.rbi @@ -0,0 +1,135 @@ +# typed: strong + +module Privy + module Models + class SolanaSignTransactionRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SolanaSignTransactionRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SolanaSignTransactionRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the SVM `signTransaction` RPC. + sig { returns(Privy::SolanaSignTransactionRpcInputParams) } + attr_reader :params + + sig do + params(params: Privy::SolanaSignTransactionRpcInputParams::OrHash).void + end + attr_writer :params + + sig { returns(T.nilable(String)) } + attr_reader :address + + sig { params(address: String).void } + attr_writer :address + + sig do + returns( + T.nilable(Privy::SolanaSignTransactionRpcInput::ChainType::OrSymbol) + ) + end + attr_reader :chain_type + + sig do + params( + chain_type: Privy::SolanaSignTransactionRpcInput::ChainType::OrSymbol + ).void + end + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :wallet_id + + sig { params(wallet_id: String).void } + attr_writer :wallet_id + + # Executes the SVM `signTransaction` RPC to sign a transaction. + sig do + params( + method_: Privy::SolanaSignTransactionRpcInput::Method::OrSymbol, + params: Privy::SolanaSignTransactionRpcInputParams::OrHash, + address: String, + chain_type: Privy::SolanaSignTransactionRpcInput::ChainType::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the SVM `signTransaction` RPC. + params:, + address: nil, + chain_type: nil, + wallet_id: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SolanaSignTransactionRpcInput::Method::OrSymbol, + params: Privy::SolanaSignTransactionRpcInputParams, + address: String, + chain_type: + Privy::SolanaSignTransactionRpcInput::ChainType::OrSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignTransactionRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_TRANSACTION = + T.let( + :signTransaction, + Privy::SolanaSignTransactionRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SolanaSignTransactionRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + + module ChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignTransactionRpcInput::ChainType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA = + T.let( + :solana, + Privy::SolanaSignTransactionRpcInput::ChainType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignTransactionRpcInput::ChainType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_transaction_rpc_input_params.rbi b/rbi/privy/models/solana_sign_transaction_rpc_input_params.rbi new file mode 100644 index 0000000..632bad9 --- /dev/null +++ b/rbi/privy/models/solana_sign_transaction_rpc_input_params.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Privy + module Models + class SolanaSignTransactionRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignTransactionRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SolanaSignTransactionRpcInputParams::Encoding::OrSymbol) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :transaction + + # Parameters for the SVM `signTransaction` RPC. + sig do + params( + encoding: + Privy::SolanaSignTransactionRpcInputParams::Encoding::OrSymbol, + transaction: String + ).returns(T.attached_class) + end + def self.new(encoding:, transaction:) + end + + sig do + override.returns( + { + encoding: + Privy::SolanaSignTransactionRpcInputParams::Encoding::OrSymbol, + transaction: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignTransactionRpcInputParams::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BASE64 = + T.let( + :base64, + Privy::SolanaSignTransactionRpcInputParams::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignTransactionRpcInputParams::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_transaction_rpc_response.rbi b/rbi/privy/models/solana_sign_transaction_rpc_response.rbi new file mode 100644 index 0000000..1dadfe8 --- /dev/null +++ b/rbi/privy/models/solana_sign_transaction_rpc_response.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class SolanaSignTransactionRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignTransactionRpcResponse, + Privy::Internal::AnyHash + ) + end + + # Data returned by the SVM `signTransaction` RPC. + sig { returns(Privy::SolanaSignTransactionRpcResponseData) } + attr_reader :data + + sig do + params(data: Privy::SolanaSignTransactionRpcResponseData::OrHash).void + end + attr_writer :data + + sig do + returns(Privy::SolanaSignTransactionRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Response to the SVM `signTransaction` RPC. + sig do + params( + data: Privy::SolanaSignTransactionRpcResponseData::OrHash, + method_: Privy::SolanaSignTransactionRpcResponse::Method::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # Data returned by the SVM `signTransaction` RPC. + data:, + method_: + ) + end + + sig do + override.returns( + { + data: Privy::SolanaSignTransactionRpcResponseData, + method_: + Privy::SolanaSignTransactionRpcResponse::Method::TaggedSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignTransactionRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_TRANSACTION = + T.let( + :signTransaction, + Privy::SolanaSignTransactionRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignTransactionRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_sign_transaction_rpc_response_data.rbi b/rbi/privy/models/solana_sign_transaction_rpc_response_data.rbi new file mode 100644 index 0000000..bb9ba07 --- /dev/null +++ b/rbi/privy/models/solana_sign_transaction_rpc_response_data.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Privy + module Models + class SolanaSignTransactionRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSignTransactionRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SolanaSignTransactionRpcResponseData::Encoding::TaggedSymbol + ) + end + attr_accessor :encoding + + sig { returns(String) } + attr_accessor :signed_transaction + + # Data returned by the SVM `signTransaction` RPC. + sig do + params( + encoding: + Privy::SolanaSignTransactionRpcResponseData::Encoding::OrSymbol, + signed_transaction: String + ).returns(T.attached_class) + end + def self.new(encoding:, signed_transaction:) + end + + sig do + override.returns( + { + encoding: + Privy::SolanaSignTransactionRpcResponseData::Encoding::TaggedSymbol, + signed_transaction: String + } + ) + end + def to_hash + end + + module Encoding + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSignTransactionRpcResponseData::Encoding) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BASE64 = + T.let( + :base64, + Privy::SolanaSignTransactionRpcResponseData::Encoding::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSignTransactionRpcResponseData::Encoding::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_system_program_instruction_condition.rbi b/rbi/privy/models/solana_system_program_instruction_condition.rbi new file mode 100644 index 0000000..e4ca0f4 --- /dev/null +++ b/rbi/privy/models/solana_system_program_instruction_condition.rbi @@ -0,0 +1,144 @@ +# typed: strong + +module Privy + module Models + class SolanaSystemProgramInstructionCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaSystemProgramInstructionCondition, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SolanaSystemProgramInstructionCondition::Field::OrSymbol) + end + attr_accessor :field + + sig do + returns( + Privy::SolanaSystemProgramInstructionCondition::FieldSource::OrSymbol + ) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Solana System Program attributes, including more granular Transfer instruction + # fields. + sig do + params( + field: + Privy::SolanaSystemProgramInstructionCondition::Field::OrSymbol, + field_source: + Privy::SolanaSystemProgramInstructionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: + Privy::SolanaSystemProgramInstructionCondition::Field::OrSymbol, + field_source: + Privy::SolanaSystemProgramInstructionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaSystemProgramInstructionCondition::Field) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INSTRUCTION_NAME = + T.let( + :instructionName, + Privy::SolanaSystemProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_FROM = + T.let( + :"Transfer.from", + Privy::SolanaSystemProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_TO = + T.let( + :"Transfer.to", + Privy::SolanaSystemProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_LAMPORTS = + T.let( + :"Transfer.lamports", + Privy::SolanaSystemProgramInstructionCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSystemProgramInstructionCondition::Field::TaggedSymbol + ] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SolanaSystemProgramInstructionCondition::FieldSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA_SYSTEM_PROGRAM_INSTRUCTION = + T.let( + :solana_system_program_instruction, + Privy::SolanaSystemProgramInstructionCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaSystemProgramInstructionCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_token_program_instruction_condition.rbi b/rbi/privy/models/solana_token_program_instruction_condition.rbi new file mode 100644 index 0000000..aaa1b2f --- /dev/null +++ b/rbi/privy/models/solana_token_program_instruction_condition.rbi @@ -0,0 +1,243 @@ +# typed: strong + +module Privy + module Models + class SolanaTokenProgramInstructionCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SolanaTokenProgramInstructionCondition, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SolanaTokenProgramInstructionCondition::Field::OrSymbol) + end + attr_accessor :field + + sig do + returns( + Privy::SolanaTokenProgramInstructionCondition::FieldSource::OrSymbol + ) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Solana Token Program attributes, including more granular TransferChecked + # instruction fields. + sig do + params( + field: Privy::SolanaTokenProgramInstructionCondition::Field::OrSymbol, + field_source: + Privy::SolanaTokenProgramInstructionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: + Privy::SolanaTokenProgramInstructionCondition::Field::OrSymbol, + field_source: + Privy::SolanaTokenProgramInstructionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SolanaTokenProgramInstructionCondition::Field) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + INSTRUCTION_NAME = + T.let( + :instructionName, + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_SOURCE = + T.let( + :"Transfer.source", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_DESTINATION = + T.let( + :"Transfer.destination", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_AUTHORITY = + T.let( + :"Transfer.authority", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_AMOUNT = + T.let( + :"Transfer.amount", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_CHECKED_SOURCE = + T.let( + :"TransferChecked.source", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_CHECKED_DESTINATION = + T.let( + :"TransferChecked.destination", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_CHECKED_AUTHORITY = + T.let( + :"TransferChecked.authority", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_CHECKED_AMOUNT = + T.let( + :"TransferChecked.amount", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + TRANSFER_CHECKED_MINT = + T.let( + :"TransferChecked.mint", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + BURN_ACCOUNT = + T.let( + :"Burn.account", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + BURN_MINT = + T.let( + :"Burn.mint", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + BURN_AUTHORITY = + T.let( + :"Burn.authority", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + BURN_AMOUNT = + T.let( + :"Burn.amount", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + MINT_TO_MINT = + T.let( + :"MintTo.mint", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + MINT_TO_ACCOUNT = + T.let( + :"MintTo.account", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + MINT_TO_AUTHORITY = + T.let( + :"MintTo.authority", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + MINT_TO_AMOUNT = + T.let( + :"MintTo.amount", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + CLOSE_ACCOUNT_ACCOUNT = + T.let( + :"CloseAccount.account", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + CLOSE_ACCOUNT_DESTINATION = + T.let( + :"CloseAccount.destination", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + CLOSE_ACCOUNT_AUTHORITY = + T.let( + :"CloseAccount.authority", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + INITIALIZE_ACCOUNT3_ACCOUNT = + T.let( + :"InitializeAccount3.account", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + INITIALIZE_ACCOUNT3_MINT = + T.let( + :"InitializeAccount3.mint", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + INITIALIZE_ACCOUNT3_OWNER = + T.let( + :"InitializeAccount3.owner", + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaTokenProgramInstructionCondition::Field::TaggedSymbol + ] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SolanaTokenProgramInstructionCondition::FieldSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOLANA_TOKEN_PROGRAM_INSTRUCTION = + T.let( + :solana_token_program_instruction, + Privy::SolanaTokenProgramInstructionCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SolanaTokenProgramInstructionCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/solana_wallet_derivation_strategy.rbi b/rbi/privy/models/solana_wallet_derivation_strategy.rbi new file mode 100644 index 0000000..474822e --- /dev/null +++ b/rbi/privy/models/solana_wallet_derivation_strategy.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + # The derivation strategy used for Solana wallets. + module SolanaWalletDerivationStrategy + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SolanaWalletDerivationStrategy) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ENTROPY_TO_SEED = + T.let( + :ENTROPY_TO_SEED, + Privy::SolanaWalletDerivationStrategy::TaggedSymbol + ) + ENTROPY_TO_MNEMONIC_TO_SEED = + T.let( + :ENTROPY_TO_MNEMONIC_TO_SEED, + Privy::SolanaWalletDerivationStrategy::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SolanaWalletDerivationStrategy::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/spark_balance.rbi b/rbi/privy/models/spark_balance.rbi new file mode 100644 index 0000000..5e4662d --- /dev/null +++ b/rbi/privy/models/spark_balance.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + module Models + class SparkBalance < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SparkBalance, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :balance + + sig { returns(T::Hash[Symbol, Privy::SparkTokenBalance]) } + attr_accessor :token_balances + + # The balance of a Spark wallet. + sig do + params( + balance: String, + token_balances: T::Hash[Symbol, Privy::SparkTokenBalance::OrHash] + ).returns(T.attached_class) + end + def self.new(balance:, token_balances:) + end + + sig do + override.returns( + { + balance: String, + token_balances: T::Hash[Symbol, Privy::SparkTokenBalance] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_claim_static_deposit_rpc_input.rbi b/rbi/privy/models/spark_claim_static_deposit_rpc_input.rbi new file mode 100644 index 0000000..738c254 --- /dev/null +++ b/rbi/privy/models/spark_claim_static_deposit_rpc_input.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Privy + module Models + class SparkClaimStaticDepositRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkClaimStaticDepositRpcInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::SparkClaimStaticDepositRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the Spark `claimStaticDeposit` RPC. + sig { returns(Privy::SparkClaimStaticDepositRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::SparkClaimStaticDepositRpcInputParams::OrHash + ).void + end + attr_writer :params + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Claims a static deposit into the Spark wallet. + sig do + params( + method_: Privy::SparkClaimStaticDepositRpcInput::Method::OrSymbol, + params: Privy::SparkClaimStaticDepositRpcInputParams::OrHash, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the Spark `claimStaticDeposit` RPC. + params:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SparkClaimStaticDepositRpcInput::Method::OrSymbol, + params: Privy::SparkClaimStaticDepositRpcInputParams, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkClaimStaticDepositRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLAIM_STATIC_DEPOSIT = + T.let( + :claimStaticDeposit, + Privy::SparkClaimStaticDepositRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkClaimStaticDepositRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_claim_static_deposit_rpc_input_params.rbi b/rbi/privy/models/spark_claim_static_deposit_rpc_input_params.rbi new file mode 100644 index 0000000..b1b1ef3 --- /dev/null +++ b/rbi/privy/models/spark_claim_static_deposit_rpc_input_params.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class SparkClaimStaticDepositRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkClaimStaticDepositRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(Float) } + attr_accessor :credit_amount_sats + + sig { returns(String) } + attr_accessor :signature + + sig { returns(String) } + attr_accessor :transaction_id + + sig { returns(T.nilable(Float)) } + attr_reader :output_index + + sig { params(output_index: Float).void } + attr_writer :output_index + + # Parameters for the Spark `claimStaticDeposit` RPC. + sig do + params( + credit_amount_sats: Float, + signature: String, + transaction_id: String, + output_index: Float + ).returns(T.attached_class) + end + def self.new( + credit_amount_sats:, + signature:, + transaction_id:, + output_index: nil + ) + end + + sig do + override.returns( + { + credit_amount_sats: Float, + signature: String, + transaction_id: String, + output_index: Float + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_claim_static_deposit_rpc_response.rbi b/rbi/privy/models/spark_claim_static_deposit_rpc_response.rbi new file mode 100644 index 0000000..3586835 --- /dev/null +++ b/rbi/privy/models/spark_claim_static_deposit_rpc_response.rbi @@ -0,0 +1,81 @@ +# typed: strong + +module Privy + module Models + class SparkClaimStaticDepositRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkClaimStaticDepositRpcResponse, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SparkClaimStaticDepositRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Data returned by the Spark `claimStaticDeposit` RPC. + sig { returns(T.nilable(Privy::SparkClaimStaticDepositRpcResponseData)) } + attr_reader :data + + sig do + params(data: Privy::SparkClaimStaticDepositRpcResponseData::OrHash).void + end + attr_writer :data + + # Response to the Spark `claimStaticDeposit` RPC. + sig do + params( + method_: Privy::SparkClaimStaticDepositRpcResponse::Method::OrSymbol, + data: Privy::SparkClaimStaticDepositRpcResponseData::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # Data returned by the Spark `claimStaticDeposit` RPC. + data: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkClaimStaticDepositRpcResponse::Method::TaggedSymbol, + data: Privy::SparkClaimStaticDepositRpcResponseData + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkClaimStaticDepositRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CLAIM_STATIC_DEPOSIT = + T.let( + :claimStaticDeposit, + Privy::SparkClaimStaticDepositRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkClaimStaticDepositRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_claim_static_deposit_rpc_response_data.rbi b/rbi/privy/models/spark_claim_static_deposit_rpc_response_data.rbi new file mode 100644 index 0000000..4aad602 --- /dev/null +++ b/rbi/privy/models/spark_claim_static_deposit_rpc_response_data.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class SparkClaimStaticDepositRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkClaimStaticDepositRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :transfer_id + + # Data returned by the Spark `claimStaticDeposit` RPC. + sig { params(transfer_id: String).returns(T.attached_class) } + def self.new(transfer_id:) + end + + sig { override.returns({ transfer_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_create_lightning_invoice_rpc_input.rbi b/rbi/privy/models/spark_create_lightning_invoice_rpc_input.rbi new file mode 100644 index 0000000..b4da7c6 --- /dev/null +++ b/rbi/privy/models/spark_create_lightning_invoice_rpc_input.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class SparkCreateLightningInvoiceRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkCreateLightningInvoiceRpcInput, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SparkCreateLightningInvoiceRpcInput::Method::OrSymbol) + end + attr_accessor :method_ + + # Parameters for the Spark `createLightningInvoice` RPC. + sig { returns(Privy::SparkCreateLightningInvoiceRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::SparkCreateLightningInvoiceRpcInputParams::OrHash + ).void + end + attr_writer :params + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Creates a Lightning invoice for the Spark wallet. + sig do + params( + method_: Privy::SparkCreateLightningInvoiceRpcInput::Method::OrSymbol, + params: Privy::SparkCreateLightningInvoiceRpcInputParams::OrHash, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the Spark `createLightningInvoice` RPC. + params:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkCreateLightningInvoiceRpcInput::Method::OrSymbol, + params: Privy::SparkCreateLightningInvoiceRpcInputParams, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkCreateLightningInvoiceRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_LIGHTNING_INVOICE = + T.let( + :createLightningInvoice, + Privy::SparkCreateLightningInvoiceRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkCreateLightningInvoiceRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_create_lightning_invoice_rpc_input_params.rbi b/rbi/privy/models/spark_create_lightning_invoice_rpc_input_params.rbi new file mode 100644 index 0000000..be402f1 --- /dev/null +++ b/rbi/privy/models/spark_create_lightning_invoice_rpc_input_params.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Privy + module Models + class SparkCreateLightningInvoiceRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkCreateLightningInvoiceRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(Float) } + attr_accessor :amount_sats + + sig { returns(T.nilable(String)) } + attr_reader :description_hash + + sig { params(description_hash: String).void } + attr_writer :description_hash + + sig { returns(T.nilable(Float)) } + attr_reader :expiry_seconds + + sig { params(expiry_seconds: Float).void } + attr_writer :expiry_seconds + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :include_spark_address + + sig { params(include_spark_address: T::Boolean).void } + attr_writer :include_spark_address + + sig { returns(T.nilable(String)) } + attr_reader :memo + + sig { params(memo: String).void } + attr_writer :memo + + sig { returns(T.nilable(String)) } + attr_reader :receiver_identity_pubkey + + sig { params(receiver_identity_pubkey: String).void } + attr_writer :receiver_identity_pubkey + + # Parameters for the Spark `createLightningInvoice` RPC. + sig do + params( + amount_sats: Float, + description_hash: String, + expiry_seconds: Float, + include_spark_address: T::Boolean, + memo: String, + receiver_identity_pubkey: String + ).returns(T.attached_class) + end + def self.new( + amount_sats:, + description_hash: nil, + expiry_seconds: nil, + include_spark_address: nil, + memo: nil, + receiver_identity_pubkey: nil + ) + end + + sig do + override.returns( + { + amount_sats: Float, + description_hash: String, + expiry_seconds: Float, + include_spark_address: T::Boolean, + memo: String, + receiver_identity_pubkey: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_create_lightning_invoice_rpc_response.rbi b/rbi/privy/models/spark_create_lightning_invoice_rpc_response.rbi new file mode 100644 index 0000000..21788c4 --- /dev/null +++ b/rbi/privy/models/spark_create_lightning_invoice_rpc_response.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Models + class SparkCreateLightningInvoiceRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkCreateLightningInvoiceRpcResponse, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SparkCreateLightningInvoiceRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # A Spark Lightning receive request. + sig { returns(T.nilable(Privy::SparkLightningReceiveRequest)) } + attr_reader :data + + sig { params(data: Privy::SparkLightningReceiveRequest::OrHash).void } + attr_writer :data + + # Response to the Spark `createLightningInvoice` RPC. + sig do + params( + method_: + Privy::SparkCreateLightningInvoiceRpcResponse::Method::OrSymbol, + data: Privy::SparkLightningReceiveRequest::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # A Spark Lightning receive request. + data: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkCreateLightningInvoiceRpcResponse::Method::TaggedSymbol, + data: Privy::SparkLightningReceiveRequest + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkCreateLightningInvoiceRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CREATE_LIGHTNING_INVOICE = + T.let( + :createLightningInvoice, + Privy::SparkCreateLightningInvoiceRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkCreateLightningInvoiceRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_get_balance_rpc_input.rbi b/rbi/privy/models/spark_get_balance_rpc_input.rbi new file mode 100644 index 0000000..2381d12 --- /dev/null +++ b/rbi/privy/models/spark_get_balance_rpc_input.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class SparkGetBalanceRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkGetBalanceRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SparkGetBalanceRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Gets the balance of the Spark wallet. + sig do + params( + method_: Privy::SparkGetBalanceRpcInput::Method::OrSymbol, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SparkGetBalanceRpcInput::Method::OrSymbol, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SparkGetBalanceRpcInput::Method) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GET_BALANCE = + T.let( + :getBalance, + Privy::SparkGetBalanceRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SparkGetBalanceRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_get_balance_rpc_response.rbi b/rbi/privy/models/spark_get_balance_rpc_response.rbi new file mode 100644 index 0000000..4a5ab6b --- /dev/null +++ b/rbi/privy/models/spark_get_balance_rpc_response.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class SparkGetBalanceRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkGetBalanceRpcResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SparkGetBalanceRpcResponse::Method::TaggedSymbol) } + attr_accessor :method_ + + # The balance of a Spark wallet. + sig { returns(T.nilable(Privy::SparkBalance)) } + attr_reader :data + + sig { params(data: Privy::SparkBalance::OrHash).void } + attr_writer :data + + # Response to the Spark `getBalance` RPC. + sig do + params( + method_: Privy::SparkGetBalanceRpcResponse::Method::OrSymbol, + data: Privy::SparkBalance::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # The balance of a Spark wallet. + data: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SparkGetBalanceRpcResponse::Method::TaggedSymbol, + data: Privy::SparkBalance + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkGetBalanceRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GET_BALANCE = + T.let( + :getBalance, + Privy::SparkGetBalanceRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SparkGetBalanceRpcResponse::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rbi b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rbi new file mode 100644 index 0000000..30e9fd2 --- /dev/null +++ b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkGetClaimStaticDepositQuoteRpcInput, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SparkGetClaimStaticDepositQuoteRpcInput::Method::OrSymbol + ) + end + attr_accessor :method_ + + # Parameters for the Spark `getClaimStaticDepositQuote` RPC. + sig { returns(Privy::SparkGetClaimStaticDepositQuoteRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::SparkGetClaimStaticDepositQuoteRpcInputParams::OrHash + ).void + end + attr_writer :params + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Gets a quote for claiming a static deposit. + sig do + params( + method_: + Privy::SparkGetClaimStaticDepositQuoteRpcInput::Method::OrSymbol, + params: Privy::SparkGetClaimStaticDepositQuoteRpcInputParams::OrHash, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the Spark `getClaimStaticDepositQuote` RPC. + params:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkGetClaimStaticDepositQuoteRpcInput::Method::OrSymbol, + params: Privy::SparkGetClaimStaticDepositQuoteRpcInputParams, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SparkGetClaimStaticDepositQuoteRpcInput::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GET_CLAIM_STATIC_DEPOSIT_QUOTE = + T.let( + :getClaimStaticDepositQuote, + Privy::SparkGetClaimStaticDepositQuoteRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkGetClaimStaticDepositQuoteRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rbi b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rbi new file mode 100644 index 0000000..aaf6775 --- /dev/null +++ b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rbi @@ -0,0 +1,37 @@ +# typed: strong + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkGetClaimStaticDepositQuoteRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :transaction_id + + sig { returns(T.nilable(Float)) } + attr_reader :output_index + + sig { params(output_index: Float).void } + attr_writer :output_index + + # Parameters for the Spark `getClaimStaticDepositQuote` RPC. + sig do + params(transaction_id: String, output_index: Float).returns( + T.attached_class + ) + end + def self.new(transaction_id:, output_index: nil) + end + + sig { override.returns({ transaction_id: String, output_index: Float }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rbi b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rbi new file mode 100644 index 0000000..d2df778 --- /dev/null +++ b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkGetClaimStaticDepositQuoteRpcResponse, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SparkGetClaimStaticDepositQuoteRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # Data returned by the Spark `getClaimStaticDepositQuote` RPC. + sig do + returns( + T.nilable(Privy::SparkGetClaimStaticDepositQuoteRpcResponseData) + ) + end + attr_reader :data + + sig do + params( + data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData::OrHash + ).void + end + attr_writer :data + + # Response to the Spark `getClaimStaticDepositQuote` RPC. + sig do + params( + method_: + Privy::SparkGetClaimStaticDepositQuoteRpcResponse::Method::OrSymbol, + data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # Data returned by the Spark `getClaimStaticDepositQuote` RPC. + data: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkGetClaimStaticDepositQuoteRpcResponse::Method::TaggedSymbol, + data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SparkGetClaimStaticDepositQuoteRpcResponse::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GET_CLAIM_STATIC_DEPOSIT_QUOTE = + T.let( + :getClaimStaticDepositQuote, + Privy::SparkGetClaimStaticDepositQuoteRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkGetClaimStaticDepositQuoteRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rbi b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rbi new file mode 100644 index 0000000..17f6079 --- /dev/null +++ b/rbi/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class SparkGetClaimStaticDepositQuoteRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkGetClaimStaticDepositQuoteRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig { returns(Float) } + attr_accessor :credit_amount_sats + + sig { returns(String) } + attr_accessor :network + + sig { returns(Float) } + attr_accessor :output_index + + sig { returns(String) } + attr_accessor :signature + + sig { returns(String) } + attr_accessor :transaction_id + + # Data returned by the Spark `getClaimStaticDepositQuote` RPC. + sig do + params( + credit_amount_sats: Float, + network: String, + output_index: Float, + signature: String, + transaction_id: String + ).returns(T.attached_class) + end + def self.new( + credit_amount_sats:, + network:, + output_index:, + signature:, + transaction_id: + ) + end + + sig do + override.returns( + { + credit_amount_sats: Float, + network: String, + output_index: Float, + signature: String, + transaction_id: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_get_static_deposit_address_rpc_input.rbi b/rbi/privy/models/spark_get_static_deposit_address_rpc_input.rbi new file mode 100644 index 0000000..770d54b --- /dev/null +++ b/rbi/privy/models/spark_get_static_deposit_address_rpc_input.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Privy + module Models + class SparkGetStaticDepositAddressRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkGetStaticDepositAddressRpcInput, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::SparkGetStaticDepositAddressRpcInput::Method::OrSymbol) + end + attr_accessor :method_ + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Gets a static deposit address for the Spark wallet. + sig do + params( + method_: + Privy::SparkGetStaticDepositAddressRpcInput::Method::OrSymbol, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkGetStaticDepositAddressRpcInput::Method::OrSymbol, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkGetStaticDepositAddressRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GET_STATIC_DEPOSIT_ADDRESS = + T.let( + :getStaticDepositAddress, + Privy::SparkGetStaticDepositAddressRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkGetStaticDepositAddressRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_get_static_deposit_address_rpc_response.rbi b/rbi/privy/models/spark_get_static_deposit_address_rpc_response.rbi new file mode 100644 index 0000000..44b3c32 --- /dev/null +++ b/rbi/privy/models/spark_get_static_deposit_address_rpc_response.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Privy + module Models + class SparkGetStaticDepositAddressRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkGetStaticDepositAddressRpcResponse, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SparkGetStaticDepositAddressRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # Data returned by the Spark `getStaticDepositAddress` RPC. + sig do + returns(T.nilable(Privy::SparkGetStaticDepositAddressRpcResponseData)) + end + attr_reader :data + + sig do + params( + data: Privy::SparkGetStaticDepositAddressRpcResponseData::OrHash + ).void + end + attr_writer :data + + # Response to the Spark `getStaticDepositAddress` RPC. + sig do + params( + method_: + Privy::SparkGetStaticDepositAddressRpcResponse::Method::OrSymbol, + data: Privy::SparkGetStaticDepositAddressRpcResponseData::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # Data returned by the Spark `getStaticDepositAddress` RPC. + data: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkGetStaticDepositAddressRpcResponse::Method::TaggedSymbol, + data: Privy::SparkGetStaticDepositAddressRpcResponseData + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SparkGetStaticDepositAddressRpcResponse::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + GET_STATIC_DEPOSIT_ADDRESS = + T.let( + :getStaticDepositAddress, + Privy::SparkGetStaticDepositAddressRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkGetStaticDepositAddressRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_get_static_deposit_address_rpc_response_data.rbi b/rbi/privy/models/spark_get_static_deposit_address_rpc_response_data.rbi new file mode 100644 index 0000000..096ed0d --- /dev/null +++ b/rbi/privy/models/spark_get_static_deposit_address_rpc_response_data.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class SparkGetStaticDepositAddressRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkGetStaticDepositAddressRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :address + + # Data returned by the Spark `getStaticDepositAddress` RPC. + sig { params(address: String).returns(T.attached_class) } + def self.new(address:) + end + + sig { override.returns({ address: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_lightning_fee.rbi b/rbi/privy/models/spark_lightning_fee.rbi new file mode 100644 index 0000000..96e9737 --- /dev/null +++ b/rbi/privy/models/spark_lightning_fee.rbi @@ -0,0 +1,31 @@ +# typed: strong + +module Privy + module Models + class SparkLightningFee < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkLightningFee, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :original_unit + + sig { returns(Float) } + attr_accessor :original_value + + # The fee for a Spark Lightning payment. + sig do + params(original_unit: String, original_value: Float).returns( + T.attached_class + ) + end + def self.new(original_unit:, original_value:) + end + + sig { override.returns({ original_unit: String, original_value: Float }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_lightning_receive_request.rbi b/rbi/privy/models/spark_lightning_receive_request.rbi new file mode 100644 index 0000000..33d493d --- /dev/null +++ b/rbi/privy/models/spark_lightning_receive_request.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module Privy + module Models + class SparkLightningReceiveRequest < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkLightningReceiveRequest, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :network + + sig { returns(String) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :typename + + sig { returns(String) } + attr_accessor :updated_at + + sig { returns(T.nilable(T.anything)) } + attr_reader :invoice + + sig { params(invoice: T.anything).void } + attr_writer :invoice + + sig { returns(T.nilable(String)) } + attr_reader :payment_preimage + + sig { params(payment_preimage: String).void } + attr_writer :payment_preimage + + sig { returns(T.nilable(String)) } + attr_reader :receiver_identity_public_key + + sig { params(receiver_identity_public_key: String).void } + attr_writer :receiver_identity_public_key + + sig { returns(T.nilable(T.anything)) } + attr_reader :transfer + + sig { params(transfer: T.anything).void } + attr_writer :transfer + + # A Spark Lightning receive request. + sig do + params( + id: String, + created_at: String, + network: String, + status: String, + typename: String, + updated_at: String, + invoice: T.anything, + payment_preimage: String, + receiver_identity_public_key: String, + transfer: T.anything + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + network:, + status:, + typename:, + updated_at:, + invoice: nil, + payment_preimage: nil, + receiver_identity_public_key: nil, + transfer: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: String, + network: String, + status: String, + typename: String, + updated_at: String, + invoice: T.anything, + payment_preimage: String, + receiver_identity_public_key: String, + transfer: T.anything + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_lightning_send_request.rbi b/rbi/privy/models/spark_lightning_send_request.rbi new file mode 100644 index 0000000..d2f2824 --- /dev/null +++ b/rbi/privy/models/spark_lightning_send_request.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module Privy + module Models + class SparkLightningSendRequest < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkLightningSendRequest, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :encoded_invoice + + # The fee for a Spark Lightning payment. + sig { returns(Privy::SparkLightningFee) } + attr_reader :fee + + sig { params(fee: Privy::SparkLightningFee::OrHash).void } + attr_writer :fee + + sig { returns(String) } + attr_accessor :idempotency_key + + sig { returns(String) } + attr_accessor :network + + sig { returns(String) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :typename + + sig { returns(String) } + attr_accessor :updated_at + + sig { returns(T.nilable(String)) } + attr_reader :payment_preimage + + sig { params(payment_preimage: String).void } + attr_writer :payment_preimage + + sig { returns(T.nilable(T.anything)) } + attr_reader :transfer + + sig { params(transfer: T.anything).void } + attr_writer :transfer + + # A Spark Lightning send request. + sig do + params( + id: String, + created_at: String, + encoded_invoice: String, + fee: Privy::SparkLightningFee::OrHash, + idempotency_key: String, + network: String, + status: String, + typename: String, + updated_at: String, + payment_preimage: String, + transfer: T.anything + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + encoded_invoice:, + # The fee for a Spark Lightning payment. + fee:, + idempotency_key:, + network:, + status:, + typename:, + updated_at:, + payment_preimage: nil, + transfer: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: String, + encoded_invoice: String, + fee: Privy::SparkLightningFee, + idempotency_key: String, + network: String, + status: String, + typename: String, + updated_at: String, + payment_preimage: String, + transfer: T.anything + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_network.rbi b/rbi/privy/models/spark_network.rbi new file mode 100644 index 0000000..bfeaea5 --- /dev/null +++ b/rbi/privy/models/spark_network.rbi @@ -0,0 +1,20 @@ +# typed: strong + +module Privy + module Models + # The Spark network. + module SparkNetwork + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::SparkNetwork) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + MAINNET = T.let(:MAINNET, Privy::SparkNetwork::TaggedSymbol) + REGTEST = T.let(:REGTEST, Privy::SparkNetwork::TaggedSymbol) + + sig { override.returns(T::Array[Privy::SparkNetwork::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/spark_output_selection_strategy.rbi b/rbi/privy/models/spark_output_selection_strategy.rbi new file mode 100644 index 0000000..43d8736 --- /dev/null +++ b/rbi/privy/models/spark_output_selection_strategy.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # Strategy for selecting outputs in a Spark token transfer. + module SparkOutputSelectionStrategy + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SparkOutputSelectionStrategy) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SMALL_FIRST = + T.let(:SMALL_FIRST, Privy::SparkOutputSelectionStrategy::TaggedSymbol) + LARGE_FIRST = + T.let(:LARGE_FIRST, Privy::SparkOutputSelectionStrategy::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SparkOutputSelectionStrategy::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/spark_pay_lightning_invoice_rpc_input.rbi b/rbi/privy/models/spark_pay_lightning_invoice_rpc_input.rbi new file mode 100644 index 0000000..51443e9 --- /dev/null +++ b/rbi/privy/models/spark_pay_lightning_invoice_rpc_input.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Privy + module Models + class SparkPayLightningInvoiceRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkPayLightningInvoiceRpcInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::SparkPayLightningInvoiceRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the Spark `payLightningInvoice` RPC. + sig { returns(Privy::SparkPayLightningInvoiceRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::SparkPayLightningInvoiceRpcInputParams::OrHash + ).void + end + attr_writer :params + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Pays a Lightning invoice from the Spark wallet. + sig do + params( + method_: Privy::SparkPayLightningInvoiceRpcInput::Method::OrSymbol, + params: Privy::SparkPayLightningInvoiceRpcInputParams::OrHash, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the Spark `payLightningInvoice` RPC. + params:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SparkPayLightningInvoiceRpcInput::Method::OrSymbol, + params: Privy::SparkPayLightningInvoiceRpcInputParams, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkPayLightningInvoiceRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAY_LIGHTNING_INVOICE = + T.let( + :payLightningInvoice, + Privy::SparkPayLightningInvoiceRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkPayLightningInvoiceRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_pay_lightning_invoice_rpc_input_params.rbi b/rbi/privy/models/spark_pay_lightning_invoice_rpc_input_params.rbi new file mode 100644 index 0000000..1f59ea4 --- /dev/null +++ b/rbi/privy/models/spark_pay_lightning_invoice_rpc_input_params.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class SparkPayLightningInvoiceRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkPayLightningInvoiceRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :invoice + + sig { returns(Float) } + attr_accessor :max_fee_sats + + sig { returns(T.nilable(Float)) } + attr_reader :amount_sats_to_send + + sig { params(amount_sats_to_send: Float).void } + attr_writer :amount_sats_to_send + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prefer_spark + + sig { params(prefer_spark: T::Boolean).void } + attr_writer :prefer_spark + + # Parameters for the Spark `payLightningInvoice` RPC. + sig do + params( + invoice: String, + max_fee_sats: Float, + amount_sats_to_send: Float, + prefer_spark: T::Boolean + ).returns(T.attached_class) + end + def self.new( + invoice:, + max_fee_sats:, + amount_sats_to_send: nil, + prefer_spark: nil + ) + end + + sig do + override.returns( + { + invoice: String, + max_fee_sats: Float, + amount_sats_to_send: Float, + prefer_spark: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_pay_lightning_invoice_rpc_response.rbi b/rbi/privy/models/spark_pay_lightning_invoice_rpc_response.rbi new file mode 100644 index 0000000..c5a9b8a --- /dev/null +++ b/rbi/privy/models/spark_pay_lightning_invoice_rpc_response.rbi @@ -0,0 +1,115 @@ +# typed: strong + +module Privy + module Models + class SparkPayLightningInvoiceRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkPayLightningInvoiceRpcResponse, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SparkPayLightningInvoiceRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # A Spark transfer. + sig do + returns( + T.nilable(Privy::SparkPayLightningInvoiceRpcResponse::Data::Variants) + ) + end + attr_reader :data + + sig do + params( + data: + T.any( + Privy::SparkTransfer::OrHash, + Privy::SparkLightningSendRequest::OrHash + ) + ).void + end + attr_writer :data + + # Response to the Spark `payLightningInvoice` RPC. + sig do + params( + method_: Privy::SparkPayLightningInvoiceRpcResponse::Method::OrSymbol, + data: + T.any( + Privy::SparkTransfer::OrHash, + Privy::SparkLightningSendRequest::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + method_:, + # A Spark transfer. + data: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkPayLightningInvoiceRpcResponse::Method::TaggedSymbol, + data: Privy::SparkPayLightningInvoiceRpcResponse::Data::Variants + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkPayLightningInvoiceRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PAY_LIGHTNING_INVOICE = + T.let( + :payLightningInvoice, + Privy::SparkPayLightningInvoiceRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkPayLightningInvoiceRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + # A Spark transfer. + module Data + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any(Privy::SparkTransfer, Privy::SparkLightningSendRequest) + end + + sig do + override.returns( + T::Array[Privy::SparkPayLightningInvoiceRpcResponse::Data::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/privy/models/spark_rpc_input.rbi b/rbi/privy/models/spark_rpc_input.rbi new file mode 100644 index 0000000..755f83b --- /dev/null +++ b/rbi/privy/models/spark_rpc_input.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + # Request body for Spark wallet RPC operations, discriminated by method. + module SparkRpcInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SparkTransferRpcInput, + Privy::SparkGetBalanceRpcInput, + Privy::SparkTransferTokensRpcInput, + Privy::SparkGetStaticDepositAddressRpcInput, + Privy::SparkGetClaimStaticDepositQuoteRpcInput, + Privy::SparkClaimStaticDepositRpcInput, + Privy::SparkCreateLightningInvoiceRpcInput, + Privy::SparkPayLightningInvoiceRpcInput, + Privy::SparkSignMessageWithIdentityKeyRpcInput + ) + end + + sig { override.returns(T::Array[Privy::SparkRpcInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/spark_rpc_response.rbi b/rbi/privy/models/spark_rpc_response.rbi new file mode 100644 index 0000000..8ab9e19 --- /dev/null +++ b/rbi/privy/models/spark_rpc_response.rbi @@ -0,0 +1,29 @@ +# typed: strong + +module Privy + module Models + # Response body for Spark wallet RPC operations, discriminated by method. + module SparkRpcResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SparkTransferRpcResponse, + Privy::SparkGetBalanceRpcResponse, + Privy::SparkTransferTokensRpcResponse, + Privy::SparkGetStaticDepositAddressRpcResponse, + Privy::SparkGetClaimStaticDepositQuoteRpcResponse, + Privy::SparkClaimStaticDepositRpcResponse, + Privy::SparkCreateLightningInvoiceRpcResponse, + Privy::SparkPayLightningInvoiceRpcResponse, + Privy::SparkSignMessageWithIdentityKeyRpcResponse + ) + end + + sig { override.returns(T::Array[Privy::SparkRpcResponse::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/spark_sign_message_with_identity_key_rpc_input.rbi b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_input.rbi new file mode 100644 index 0000000..c1dde92 --- /dev/null +++ b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_input.rbi @@ -0,0 +1,100 @@ +# typed: strong + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkSignMessageWithIdentityKeyRpcInput, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SparkSignMessageWithIdentityKeyRpcInput::Method::OrSymbol + ) + end + attr_accessor :method_ + + # Parameters for the Spark `signMessageWithIdentityKey` RPC. + sig { returns(Privy::SparkSignMessageWithIdentityKeyRpcInputParams) } + attr_reader :params + + sig do + params( + params: Privy::SparkSignMessageWithIdentityKeyRpcInputParams::OrHash + ).void + end + attr_writer :params + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Signs a message with the Spark identity key. + sig do + params( + method_: + Privy::SparkSignMessageWithIdentityKeyRpcInput::Method::OrSymbol, + params: Privy::SparkSignMessageWithIdentityKeyRpcInputParams::OrHash, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the Spark `signMessageWithIdentityKey` RPC. + params:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkSignMessageWithIdentityKeyRpcInput::Method::OrSymbol, + params: Privy::SparkSignMessageWithIdentityKeyRpcInputParams, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SparkSignMessageWithIdentityKeyRpcInput::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_MESSAGE_WITH_IDENTITY_KEY = + T.let( + :signMessageWithIdentityKey, + Privy::SparkSignMessageWithIdentityKeyRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkSignMessageWithIdentityKeyRpcInput::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rbi b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rbi new file mode 100644 index 0000000..b7a683d --- /dev/null +++ b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkSignMessageWithIdentityKeyRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :message + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :compact + + sig { params(compact: T::Boolean).void } + attr_writer :compact + + # Parameters for the Spark `signMessageWithIdentityKey` RPC. + sig do + params(message: String, compact: T::Boolean).returns(T.attached_class) + end + def self.new(message:, compact: nil) + end + + sig { override.returns({ message: String, compact: T::Boolean }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_sign_message_with_identity_key_rpc_response.rbi b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_response.rbi new file mode 100644 index 0000000..d799c5e --- /dev/null +++ b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_response.rbi @@ -0,0 +1,93 @@ +# typed: strong + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkSignMessageWithIdentityKeyRpcResponse, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::SparkSignMessageWithIdentityKeyRpcResponse::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + # Data returned by the Spark `signMessageWithIdentityKey` RPC. + sig do + returns( + T.nilable(Privy::SparkSignMessageWithIdentityKeyRpcResponseData) + ) + end + attr_reader :data + + sig do + params( + data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData::OrHash + ).void + end + attr_writer :data + + # Response to the Spark `signMessageWithIdentityKey` RPC. + sig do + params( + method_: + Privy::SparkSignMessageWithIdentityKeyRpcResponse::Method::OrSymbol, + data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # Data returned by the Spark `signMessageWithIdentityKey` RPC. + data: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkSignMessageWithIdentityKeyRpcResponse::Method::TaggedSymbol, + data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SparkSignMessageWithIdentityKeyRpcResponse::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SIGN_MESSAGE_WITH_IDENTITY_KEY = + T.let( + :signMessageWithIdentityKey, + Privy::SparkSignMessageWithIdentityKeyRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkSignMessageWithIdentityKeyRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rbi b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rbi new file mode 100644 index 0000000..d0c4c73 --- /dev/null +++ b/rbi/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class SparkSignMessageWithIdentityKeyRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkSignMessageWithIdentityKeyRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :signature + + # Data returned by the Spark `signMessageWithIdentityKey` RPC. + sig { params(signature: String).returns(T.attached_class) } + def self.new(signature:) + end + + sig { override.returns({ signature: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_signing_keyshare.rbi b/rbi/privy/models/spark_signing_keyshare.rbi new file mode 100644 index 0000000..e1250db --- /dev/null +++ b/rbi/privy/models/spark_signing_keyshare.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class SparkSigningKeyshare < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkSigningKeyshare, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[String]) } + attr_accessor :owner_identifiers + + sig { returns(String) } + attr_accessor :public_key + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :public_shares + + sig { returns(Float) } + attr_accessor :threshold + + sig { returns(String) } + attr_accessor :updated_time + + # A Spark signing keyshare. + sig do + params( + owner_identifiers: T::Array[String], + public_key: String, + public_shares: T::Hash[Symbol, String], + threshold: Float, + updated_time: String + ).returns(T.attached_class) + end + def self.new( + owner_identifiers:, + public_key:, + public_shares:, + threshold:, + updated_time: + ) + end + + sig do + override.returns( + { + owner_identifiers: T::Array[String], + public_key: String, + public_shares: T::Hash[Symbol, String], + threshold: Float, + updated_time: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_token_balance.rbi b/rbi/privy/models/spark_token_balance.rbi new file mode 100644 index 0000000..e899752 --- /dev/null +++ b/rbi/privy/models/spark_token_balance.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class SparkTokenBalance < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkTokenBalance, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :balance + + # Metadata for a Spark user token. + sig { returns(Privy::SparkUserTokenMetadata) } + attr_reader :token_metadata + + sig { params(token_metadata: Privy::SparkUserTokenMetadata::OrHash).void } + attr_writer :token_metadata + + # Balance of a Spark token. + sig do + params( + balance: String, + token_metadata: Privy::SparkUserTokenMetadata::OrHash + ).returns(T.attached_class) + end + def self.new( + balance:, + # Metadata for a Spark user token. + token_metadata: + ) + end + + sig do + override.returns( + { balance: String, token_metadata: Privy::SparkUserTokenMetadata } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_transfer.rbi b/rbi/privy/models/spark_transfer.rbi new file mode 100644 index 0000000..2cb8cdf --- /dev/null +++ b/rbi/privy/models/spark_transfer.rbi @@ -0,0 +1,103 @@ +# typed: strong + +module Privy + module Models + class SparkTransfer < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SparkTransfer, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(T::Array[Privy::SparkTransferLeaf]) } + attr_accessor :leaves + + sig { returns(String) } + attr_accessor :receiver_identity_public_key + + sig { returns(String) } + attr_accessor :sender_identity_public_key + + sig { returns(String) } + attr_accessor :status + + sig { returns(Float) } + attr_accessor :total_value + + sig { returns(String) } + attr_accessor :transfer_direction + + sig { returns(String) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :created_time + + sig { params(created_time: String).void } + attr_writer :created_time + + sig { returns(T.nilable(String)) } + attr_reader :expiry_time + + sig { params(expiry_time: String).void } + attr_writer :expiry_time + + sig { returns(T.nilable(String)) } + attr_reader :updated_time + + sig { params(updated_time: String).void } + attr_writer :updated_time + + # A Spark transfer. + sig do + params( + id: String, + leaves: T::Array[Privy::SparkTransferLeaf::OrHash], + receiver_identity_public_key: String, + sender_identity_public_key: String, + status: String, + total_value: Float, + transfer_direction: String, + type: String, + created_time: String, + expiry_time: String, + updated_time: String + ).returns(T.attached_class) + end + def self.new( + id:, + leaves:, + receiver_identity_public_key:, + sender_identity_public_key:, + status:, + total_value:, + transfer_direction:, + type:, + created_time: nil, + expiry_time: nil, + updated_time: nil + ) + end + + sig do + override.returns( + { + id: String, + leaves: T::Array[Privy::SparkTransferLeaf], + receiver_identity_public_key: String, + sender_identity_public_key: String, + status: String, + total_value: Float, + transfer_direction: String, + type: String, + created_time: String, + expiry_time: String, + updated_time: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_leaf.rbi b/rbi/privy/models/spark_transfer_leaf.rbi new file mode 100644 index 0000000..880c4b1 --- /dev/null +++ b/rbi/privy/models/spark_transfer_leaf.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class SparkTransferLeaf < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkTransferLeaf, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :intermediate_refund_tx + + sig { returns(String) } + attr_accessor :secret_cipher + + sig { returns(String) } + attr_accessor :signature + + # A Spark wallet leaf node. + sig { returns(T.nilable(Privy::SparkWalletLeaf)) } + attr_reader :leaf + + sig { params(leaf: Privy::SparkWalletLeaf::OrHash).void } + attr_writer :leaf + + # A Spark transfer leaf. + sig do + params( + intermediate_refund_tx: String, + secret_cipher: String, + signature: String, + leaf: Privy::SparkWalletLeaf::OrHash + ).returns(T.attached_class) + end + def self.new( + intermediate_refund_tx:, + secret_cipher:, + signature:, + # A Spark wallet leaf node. + leaf: nil + ) + end + + sig do + override.returns( + { + intermediate_refund_tx: String, + secret_cipher: String, + signature: String, + leaf: Privy::SparkWalletLeaf + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_rpc_input.rbi b/rbi/privy/models/spark_transfer_rpc_input.rbi new file mode 100644 index 0000000..c82568a --- /dev/null +++ b/rbi/privy/models/spark_transfer_rpc_input.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class SparkTransferRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkTransferRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SparkTransferRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the Spark `transfer` RPC. + sig { returns(Privy::SparkTransferRpcInputParams) } + attr_reader :params + + sig { params(params: Privy::SparkTransferRpcInputParams::OrHash).void } + attr_writer :params + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Transfers satoshis to a Spark address. + sig do + params( + method_: Privy::SparkTransferRpcInput::Method::OrSymbol, + params: Privy::SparkTransferRpcInputParams::OrHash, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the Spark `transfer` RPC. + params:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SparkTransferRpcInput::Method::OrSymbol, + params: Privy::SparkTransferRpcInputParams, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SparkTransferRpcInput::Method) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = + T.let(:transfer, Privy::SparkTransferRpcInput::Method::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SparkTransferRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_rpc_input_params.rbi b/rbi/privy/models/spark_transfer_rpc_input_params.rbi new file mode 100644 index 0000000..d557105 --- /dev/null +++ b/rbi/privy/models/spark_transfer_rpc_input_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class SparkTransferRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkTransferRpcInputParams, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :amount_sats + + sig { returns(String) } + attr_accessor :receiver_spark_address + + # Parameters for the Spark `transfer` RPC. + sig do + params(amount_sats: Float, receiver_spark_address: String).returns( + T.attached_class + ) + end + def self.new(amount_sats:, receiver_spark_address:) + end + + sig do + override.returns({ amount_sats: Float, receiver_spark_address: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_rpc_response.rbi b/rbi/privy/models/spark_transfer_rpc_response.rbi new file mode 100644 index 0000000..91867bf --- /dev/null +++ b/rbi/privy/models/spark_transfer_rpc_response.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + class SparkTransferRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkTransferRpcResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SparkTransferRpcResponse::Method::TaggedSymbol) } + attr_accessor :method_ + + # A Spark transfer. + sig { returns(T.nilable(Privy::SparkTransfer)) } + attr_reader :data + + sig { params(data: Privy::SparkTransfer::OrHash).void } + attr_writer :data + + # Response to the Spark `transfer` RPC. + sig do + params( + method_: Privy::SparkTransferRpcResponse::Method::OrSymbol, + data: Privy::SparkTransfer::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # A Spark transfer. + data: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SparkTransferRpcResponse::Method::TaggedSymbol, + data: Privy::SparkTransfer + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkTransferRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = + T.let( + :transfer, + Privy::SparkTransferRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SparkTransferRpcResponse::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_tokens_rpc_input.rbi b/rbi/privy/models/spark_transfer_tokens_rpc_input.rbi new file mode 100644 index 0000000..909b8d5 --- /dev/null +++ b/rbi/privy/models/spark_transfer_tokens_rpc_input.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Privy + module Models + class SparkTransferTokensRpcInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkTransferTokensRpcInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SparkTransferTokensRpcInput::Method::OrSymbol) } + attr_accessor :method_ + + # Parameters for the Spark `transferTokens` RPC. + sig { returns(Privy::SparkTransferTokensRpcInputParams) } + attr_reader :params + + sig do + params(params: Privy::SparkTransferTokensRpcInputParams::OrHash).void + end + attr_writer :params + + # The Spark network. + sig { returns(T.nilable(Privy::SparkNetwork::OrSymbol)) } + attr_reader :network + + sig { params(network: Privy::SparkNetwork::OrSymbol).void } + attr_writer :network + + # Transfers tokens to a Spark address. + sig do + params( + method_: Privy::SparkTransferTokensRpcInput::Method::OrSymbol, + params: Privy::SparkTransferTokensRpcInputParams::OrHash, + network: Privy::SparkNetwork::OrSymbol + ).returns(T.attached_class) + end + def self.new( + method_:, + # Parameters for the Spark `transferTokens` RPC. + params:, + # The Spark network. + network: nil + ) + end + + sig do + override.returns( + { + method_: Privy::SparkTransferTokensRpcInput::Method::OrSymbol, + params: Privy::SparkTransferTokensRpcInputParams, + network: Privy::SparkNetwork::OrSymbol + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkTransferTokensRpcInput::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER_TOKENS = + T.let( + :transferTokens, + Privy::SparkTransferTokensRpcInput::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SparkTransferTokensRpcInput::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_tokens_rpc_input_params.rbi b/rbi/privy/models/spark_transfer_tokens_rpc_input_params.rbi new file mode 100644 index 0000000..c2e1933 --- /dev/null +++ b/rbi/privy/models/spark_transfer_tokens_rpc_input_params.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class SparkTransferTokensRpcInputParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkTransferTokensRpcInputParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :receiver_spark_address + + sig { returns(Float) } + attr_accessor :token_amount + + sig { returns(String) } + attr_accessor :token_identifier + + # Strategy for selecting outputs in a Spark token transfer. + sig { returns(T.nilable(Privy::SparkOutputSelectionStrategy::OrSymbol)) } + attr_reader :output_selection_strategy + + sig do + params( + output_selection_strategy: + Privy::SparkOutputSelectionStrategy::OrSymbol + ).void + end + attr_writer :output_selection_strategy + + sig do + returns(T.nilable(T::Array[Privy::OutputWithPreviousTransactionData])) + end + attr_reader :selected_outputs + + sig do + params( + selected_outputs: + T::Array[Privy::OutputWithPreviousTransactionData::OrHash] + ).void + end + attr_writer :selected_outputs + + # Parameters for the Spark `transferTokens` RPC. + sig do + params( + receiver_spark_address: String, + token_amount: Float, + token_identifier: String, + output_selection_strategy: + Privy::SparkOutputSelectionStrategy::OrSymbol, + selected_outputs: + T::Array[Privy::OutputWithPreviousTransactionData::OrHash] + ).returns(T.attached_class) + end + def self.new( + receiver_spark_address:, + token_amount:, + token_identifier:, + # Strategy for selecting outputs in a Spark token transfer. + output_selection_strategy: nil, + selected_outputs: nil + ) + end + + sig do + override.returns( + { + receiver_spark_address: String, + token_amount: Float, + token_identifier: String, + output_selection_strategy: + Privy::SparkOutputSelectionStrategy::OrSymbol, + selected_outputs: T::Array[Privy::OutputWithPreviousTransactionData] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_tokens_rpc_response.rbi b/rbi/privy/models/spark_transfer_tokens_rpc_response.rbi new file mode 100644 index 0000000..dbecbc2 --- /dev/null +++ b/rbi/privy/models/spark_transfer_tokens_rpc_response.rbi @@ -0,0 +1,78 @@ +# typed: strong + +module Privy + module Models + class SparkTransferTokensRpcResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkTransferTokensRpcResponse, Privy::Internal::AnyHash) + end + + sig do + returns(Privy::SparkTransferTokensRpcResponse::Method::TaggedSymbol) + end + attr_accessor :method_ + + # Data returned by the Spark `transferTokens` RPC. + sig { returns(T.nilable(Privy::SparkTransferTokensRpcResponseData)) } + attr_reader :data + + sig do + params(data: Privy::SparkTransferTokensRpcResponseData::OrHash).void + end + attr_writer :data + + # Response to the Spark `transferTokens` RPC. + sig do + params( + method_: Privy::SparkTransferTokensRpcResponse::Method::OrSymbol, + data: Privy::SparkTransferTokensRpcResponseData::OrHash + ).returns(T.attached_class) + end + def self.new( + method_:, + # Data returned by the Spark `transferTokens` RPC. + data: nil + ) + end + + sig do + override.returns( + { + method_: + Privy::SparkTransferTokensRpcResponse::Method::TaggedSymbol, + data: Privy::SparkTransferTokensRpcResponseData + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SparkTransferTokensRpcResponse::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER_TOKENS = + T.let( + :transferTokens, + Privy::SparkTransferTokensRpcResponse::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SparkTransferTokensRpcResponse::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/spark_transfer_tokens_rpc_response_data.rbi b/rbi/privy/models/spark_transfer_tokens_rpc_response_data.rbi new file mode 100644 index 0000000..3d8d3eb --- /dev/null +++ b/rbi/privy/models/spark_transfer_tokens_rpc_response_data.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class SparkTransferTokensRpcResponseData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SparkTransferTokensRpcResponseData, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Data returned by the Spark `transferTokens` RPC. + sig { params(id: String).returns(T.attached_class) } + def self.new(id:) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_user_token_metadata.rbi b/rbi/privy/models/spark_user_token_metadata.rbi new file mode 100644 index 0000000..cfd2d0f --- /dev/null +++ b/rbi/privy/models/spark_user_token_metadata.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class SparkUserTokenMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SparkUserTokenMetadata, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :decimals + + sig { returns(String) } + attr_accessor :max_supply + + sig { returns(String) } + attr_accessor :raw_token_identifier + + sig { returns(String) } + attr_accessor :token_name + + sig { returns(String) } + attr_accessor :token_public_key + + sig { returns(String) } + attr_accessor :token_ticker + + # Metadata for a Spark user token. + sig do + params( + decimals: Float, + max_supply: String, + raw_token_identifier: String, + token_name: String, + token_public_key: String, + token_ticker: String + ).returns(T.attached_class) + end + def self.new( + decimals:, + max_supply:, + raw_token_identifier:, + token_name:, + token_public_key:, + token_ticker: + ) + end + + sig do + override.returns( + { + decimals: Float, + max_supply: String, + raw_token_identifier: String, + token_name: String, + token_public_key: String, + token_ticker: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/spark_wallet_leaf.rbi b/rbi/privy/models/spark_wallet_leaf.rbi new file mode 100644 index 0000000..33ead3a --- /dev/null +++ b/rbi/privy/models/spark_wallet_leaf.rbi @@ -0,0 +1,110 @@ +# typed: strong + +module Privy + module Models + class SparkWalletLeaf < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SparkWalletLeaf, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + # The Spark network. + sig { returns(Privy::SparkNetwork::TaggedSymbol) } + attr_accessor :network + + sig { returns(String) } + attr_accessor :node_tx + + sig { returns(String) } + attr_accessor :owner_identity_public_key + + sig { returns(String) } + attr_accessor :refund_tx + + sig { returns(String) } + attr_accessor :status + + sig { returns(String) } + attr_accessor :tree_id + + sig { returns(Float) } + attr_accessor :value + + sig { returns(String) } + attr_accessor :verifying_public_key + + sig { returns(Float) } + attr_accessor :vout + + sig { returns(T.nilable(String)) } + attr_reader :parent_node_id + + sig { params(parent_node_id: String).void } + attr_writer :parent_node_id + + # A Spark signing keyshare. + sig { returns(T.nilable(Privy::SparkSigningKeyshare)) } + attr_reader :signing_keyshare + + sig { params(signing_keyshare: Privy::SparkSigningKeyshare::OrHash).void } + attr_writer :signing_keyshare + + # A Spark wallet leaf node. + sig do + params( + id: String, + network: Privy::SparkNetwork::OrSymbol, + node_tx: String, + owner_identity_public_key: String, + refund_tx: String, + status: String, + tree_id: String, + value: Float, + verifying_public_key: String, + vout: Float, + parent_node_id: String, + signing_keyshare: Privy::SparkSigningKeyshare::OrHash + ).returns(T.attached_class) + end + def self.new( + id:, + # The Spark network. + network:, + node_tx:, + owner_identity_public_key:, + refund_tx:, + status:, + tree_id:, + value:, + verifying_public_key:, + vout:, + parent_node_id: nil, + # A Spark signing keyshare. + signing_keyshare: nil + ) + end + + sig do + override.returns( + { + id: String, + network: Privy::SparkNetwork::TaggedSymbol, + node_tx: String, + owner_identity_public_key: String, + refund_tx: String, + status: String, + tree_id: String, + value: Float, + verifying_public_key: String, + vout: Float, + parent_node_id: String, + signing_keyshare: Privy::SparkSigningKeyshare + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/success_response.rbi b/rbi/privy/models/success_response.rbi new file mode 100644 index 0000000..ba75840 --- /dev/null +++ b/rbi/privy/models/success_response.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + class SuccessResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SuccessResponse, Privy::Internal::AnyHash) } + + sig { returns(T::Boolean) } + attr_accessor :success + + # A simple success response. + sig { params(success: T::Boolean).returns(T.attached_class) } + def self.new(success:) + end + + sig { override.returns({ success: T::Boolean }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/sui_command_name.rbi b/rbi/privy/models/sui_command_name.rbi new file mode 100644 index 0000000..1b08232 --- /dev/null +++ b/rbi/privy/models/sui_command_name.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # SUI transaction commands allowlist for raw_sign endpoint policy evaluation + module SuiCommandName + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::SuiCommandName) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER_OBJECTS = + T.let(:TransferObjects, Privy::SuiCommandName::TaggedSymbol) + SPLIT_COINS = T.let(:SplitCoins, Privy::SuiCommandName::TaggedSymbol) + MERGE_COINS = T.let(:MergeCoins, Privy::SuiCommandName::TaggedSymbol) + + sig { override.returns(T::Array[Privy::SuiCommandName::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/sui_transaction_command_condition.rbi b/rbi/privy/models/sui_transaction_command_condition.rbi new file mode 100644 index 0000000..2625f40 --- /dev/null +++ b/rbi/privy/models/sui_transaction_command_condition.rbi @@ -0,0 +1,161 @@ +# typed: strong + +module Privy + module Models + class SuiTransactionCommandCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SuiTransactionCommandCondition, Privy::Internal::AnyHash) + end + + sig { returns(Privy::SuiTransactionCommandCondition::Field::OrSymbol) } + attr_accessor :field + + sig do + returns(Privy::SuiTransactionCommandCondition::FieldSource::OrSymbol) + end + attr_accessor :field_source + + # Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are + # supported for command names. + sig { returns(Privy::SuiTransactionCommandOperator::OrSymbol) } + attr_accessor :operator + + # Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins', + # 'MergeCoins' + sig do + returns( + T.any( + Privy::SuiCommandName::OrSymbol, + T::Array[Privy::SuiCommandName::OrSymbol] + ) + ) + end + attr_accessor :value + + # SUI transaction command attributes, enables allowlisting specific command types. + # Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and + # 'in' operators are supported. + sig do + params( + field: Privy::SuiTransactionCommandCondition::Field::OrSymbol, + field_source: + Privy::SuiTransactionCommandCondition::FieldSource::OrSymbol, + operator: Privy::SuiTransactionCommandOperator::OrSymbol, + value: + T.any( + Privy::SuiCommandName::OrSymbol, + T::Array[Privy::SuiCommandName::OrSymbol] + ) + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are + # supported for command names. + operator:, + # Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins', + # 'MergeCoins' + value: + ) + end + + sig do + override.returns( + { + field: Privy::SuiTransactionCommandCondition::Field::OrSymbol, + field_source: + Privy::SuiTransactionCommandCondition::FieldSource::OrSymbol, + operator: Privy::SuiTransactionCommandOperator::OrSymbol, + value: + T.any( + Privy::SuiCommandName::OrSymbol, + T::Array[Privy::SuiCommandName::OrSymbol] + ) + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SuiTransactionCommandCondition::Field) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + COMMAND_NAME = + T.let( + :commandName, + Privy::SuiTransactionCommandCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SuiTransactionCommandCondition::Field::TaggedSymbol] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SuiTransactionCommandCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUI_TRANSACTION_COMMAND = + T.let( + :sui_transaction_command, + Privy::SuiTransactionCommandCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SuiTransactionCommandCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins', + # 'MergeCoins' + module Value + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SuiCommandName::TaggedSymbol, + T::Array[Privy::SuiCommandName::TaggedSymbol] + ) + end + + sig do + override.returns( + T::Array[Privy::SuiTransactionCommandCondition::Value::Variants] + ) + end + def self.variants + end + + SuiCommandNameArray = + T.let( + Privy::Internal::Type::ArrayOf[enum: Privy::SuiCommandName], + Privy::Internal::Type::Converter + ) + end + end + end +end diff --git a/rbi/privy/models/sui_transaction_command_operator.rbi b/rbi/privy/models/sui_transaction_command_operator.rbi new file mode 100644 index 0000000..c213161 --- /dev/null +++ b/rbi/privy/models/sui_transaction_command_operator.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are + # supported for command names. + module SuiTransactionCommandOperator + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SuiTransactionCommandOperator) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EQ = T.let(:eq, Privy::SuiTransactionCommandOperator::TaggedSymbol) + IN = T.let(:in, Privy::SuiTransactionCommandOperator::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SuiTransactionCommandOperator::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/sui_transfer_objects_command_condition.rbi b/rbi/privy/models/sui_transfer_objects_command_condition.rbi new file mode 100644 index 0000000..dbbd54c --- /dev/null +++ b/rbi/privy/models/sui_transfer_objects_command_condition.rbi @@ -0,0 +1,102 @@ +# typed: strong + +module Privy + module Models + class SuiTransferObjectsCommandCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::SuiTransferObjectsCommandCondition, + Privy::Internal::AnyHash + ) + end + + # Supported fields for SUI TransferObjects command conditions. Only 'recipient' + # and 'amount' are supported. + sig { returns(Privy::SuiTransferObjectsCommandField::OrSymbol) } + attr_accessor :field + + sig do + returns( + Privy::SuiTransferObjectsCommandCondition::FieldSource::OrSymbol + ) + end + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # SUI TransferObjects command attributes, including recipient and amount fields. + sig do + params( + field: Privy::SuiTransferObjectsCommandField::OrSymbol, + field_source: + Privy::SuiTransferObjectsCommandCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + # Supported fields for SUI TransferObjects command conditions. Only 'recipient' + # and 'amount' are supported. + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: Privy::SuiTransferObjectsCommandField::OrSymbol, + field_source: + Privy::SuiTransferObjectsCommandCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::SuiTransferObjectsCommandCondition::FieldSource + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUI_TRANSFER_OBJECTS_COMMAND = + T.let( + :sui_transfer_objects_command, + Privy::SuiTransferObjectsCommandCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::SuiTransferObjectsCommandCondition::FieldSource::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/sui_transfer_objects_command_field.rbi b/rbi/privy/models/sui_transfer_objects_command_field.rbi new file mode 100644 index 0000000..f98a148 --- /dev/null +++ b/rbi/privy/models/sui_transfer_objects_command_field.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + # Supported fields for SUI TransferObjects command conditions. Only 'recipient' + # and 'amount' are supported. + module SuiTransferObjectsCommandField + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SuiTransferObjectsCommandField) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + RECIPIENT = + T.let(:recipient, Privy::SuiTransferObjectsCommandField::TaggedSymbol) + AMOUNT = + T.let(:amount, Privy::SuiTransferObjectsCommandField::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SuiTransferObjectsCommandField::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/svm_transaction_wallet_action_step.rbi b/rbi/privy/models/svm_transaction_wallet_action_step.rbi new file mode 100644 index 0000000..ee8ad73 --- /dev/null +++ b/rbi/privy/models/svm_transaction_wallet_action_step.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Privy + module Models + class SvmTransactionWalletActionStep < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SvmTransactionWalletActionStep, Privy::Internal::AnyHash) + end + + # CAIP-2 chain identifier for the Solana network. + sig { returns(String) } + attr_accessor :caip2 + + # Status of an SVM step in a wallet action. + sig { returns(Privy::SvmWalletActionStepStatus::TaggedSymbol) } + attr_accessor :status + + # The Solana transaction signature (base58-encoded). Null until broadcast. + sig { returns(T.nilable(String)) } + attr_accessor :transaction_signature + + sig { returns(Privy::SvmTransactionWalletActionStep::Type::TaggedSymbol) } + attr_accessor :type + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # A wallet action step consisting of an SVM (Solana) transaction. + sig do + params( + caip2: String, + status: Privy::SvmWalletActionStepStatus::OrSymbol, + transaction_signature: T.nilable(String), + type: Privy::SvmTransactionWalletActionStep::Type::OrSymbol, + failure_reason: Privy::FailureReason::OrHash + ).returns(T.attached_class) + end + def self.new( + # CAIP-2 chain identifier for the Solana network. + caip2:, + # Status of an SVM step in a wallet action. + status:, + # The Solana transaction signature (base58-encoded). Null until broadcast. + transaction_signature:, + type:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil + ) + end + + sig do + override.returns( + { + caip2: String, + status: Privy::SvmWalletActionStepStatus::TaggedSymbol, + transaction_signature: T.nilable(String), + type: Privy::SvmTransactionWalletActionStep::Type::TaggedSymbol, + failure_reason: Privy::FailureReason + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::SvmTransactionWalletActionStep::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SVM_TRANSACTION = + T.let( + :svm_transaction, + Privy::SvmTransactionWalletActionStep::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SvmTransactionWalletActionStep::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/svm_wallet_action_step_status.rbi b/rbi/privy/models/svm_wallet_action_step_status.rbi new file mode 100644 index 0000000..5f71372 --- /dev/null +++ b/rbi/privy/models/svm_wallet_action_step_status.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + # Status of an SVM step in a wallet action. + module SvmWalletActionStepStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SvmWalletActionStepStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PREPARING = + T.let(:preparing, Privy::SvmWalletActionStepStatus::TaggedSymbol) + QUEUED = T.let(:queued, Privy::SvmWalletActionStepStatus::TaggedSymbol) + PENDING = T.let(:pending, Privy::SvmWalletActionStepStatus::TaggedSymbol) + CONFIRMED = + T.let(:confirmed, Privy::SvmWalletActionStepStatus::TaggedSymbol) + FINALIZED = + T.let(:finalized, Privy::SvmWalletActionStepStatus::TaggedSymbol) + REJECTED = + T.let(:rejected, Privy::SvmWalletActionStepStatus::TaggedSymbol) + REVERTED = + T.let(:reverted, Privy::SvmWalletActionStepStatus::TaggedSymbol) + FAILED = T.let(:failed, Privy::SvmWalletActionStepStatus::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SvmWalletActionStepStatus::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/swap_action_response.rbi b/rbi/privy/models/swap_action_response.rbi new file mode 100644 index 0000000..3702aae --- /dev/null +++ b/rbi/privy/models/swap_action_response.rbi @@ -0,0 +1,189 @@ +# typed: strong + +module Privy + module Models + class SwapActionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SwapActionResponse, Privy::Internal::AnyHash) + end + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :id + + # CAIP-2 chain identifier for the swap. + sig { returns(String) } + attr_accessor :caip2 + + # ISO 8601 timestamp of when the wallet action was created. + sig { returns(Time) } + attr_accessor :created_at + + # Exact base-unit amount of input token. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :input_amount + + # Token address or "native" for the token being sold. + sig { returns(String) } + attr_accessor :input_token + + # Exact base-unit amount of output token. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :output_amount + + # Token address or "native" for the token being bought. + sig { returns(String) } + attr_accessor :output_token + + # Status of a wallet action. + sig { returns(Privy::WalletActionStatus::OrSymbol) } + attr_accessor :status + + sig { returns(Privy::SwapActionResponse::Type::OrSymbol) } + attr_accessor :type + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # The steps of the wallet action. Only returned if `?include=steps` is provided. + sig do + returns( + T.nilable( + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep, + Privy::EvmUserOperationWalletActionStep, + Privy::SvmTransactionWalletActionStep, + Privy::ExternalTransactionWalletActionStep + ) + ] + ) + ) + end + attr_reader :steps + + sig do + params( + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).void + end + attr_writer :steps + + # Response for a swap action. + sig do + params( + id: String, + caip2: String, + created_at: Time, + input_amount: T.nilable(String), + input_token: String, + output_amount: T.nilable(String), + output_token: String, + status: Privy::WalletActionStatus::OrSymbol, + type: Privy::SwapActionResponse::Type::OrSymbol, + wallet_id: String, + failure_reason: Privy::FailureReason::OrHash, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # The ID of the wallet action. + id:, + # CAIP-2 chain identifier for the swap. + caip2:, + # ISO 8601 timestamp of when the wallet action was created. + created_at:, + # Exact base-unit amount of input token. Populated after on-chain confirmation. + input_amount:, + # Token address or "native" for the token being sold. + input_token:, + # Exact base-unit amount of output token. Populated after on-chain confirmation. + output_amount:, + # Token address or "native" for the token being bought. + output_token:, + # Status of a wallet action. + status:, + type:, + # The ID of the wallet involved in the action. + wallet_id:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil, + # The steps of the wallet action. Only returned if `?include=steps` is provided. + steps: nil + ) + end + + sig do + override.returns( + { + id: String, + caip2: String, + created_at: Time, + input_amount: T.nilable(String), + input_token: String, + output_amount: T.nilable(String), + output_token: String, + status: Privy::WalletActionStatus::OrSymbol, + type: Privy::SwapActionResponse::Type::OrSymbol, + wallet_id: String, + failure_reason: Privy::FailureReason, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep, + Privy::EvmUserOperationWalletActionStep, + Privy::SvmTransactionWalletActionStep, + Privy::ExternalTransactionWalletActionStep + ) + ] + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SwapActionResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWAP = T.let(:swap, Privy::SwapActionResponse::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SwapActionResponse::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/swap_destination.rbi b/rbi/privy/models/swap_destination.rbi new file mode 100644 index 0000000..40b8ab3 --- /dev/null +++ b/rbi/privy/models/swap_destination.rbi @@ -0,0 +1,39 @@ +# typed: strong + +module Privy + module Models + class SwapDestination < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SwapDestination, Privy::Internal::AnyHash) } + + # Token contract address to buy, or "native" for the chain's native token. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier for the destination. Must match source chain — + # cross-chain swaps are not yet supported. Defaults to source chain if omitted. + sig { returns(T.nilable(String)) } + attr_reader :caip2 + + sig { params(caip2: String).void } + attr_writer :caip2 + + # The output side of a swap execution request. + sig do + params(asset_address: String, caip2: String).returns(T.attached_class) + end + def self.new( + # Token contract address to buy, or "native" for the chain's native token. + asset_address:, + # CAIP-2 chain identifier for the destination. Must match source chain — + # cross-chain swaps are not yet supported. Defaults to source chain if omitted. + caip2: nil + ) + end + + sig { override.returns({ asset_address: String, caip2: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/swap_quote_destination.rbi b/rbi/privy/models/swap_quote_destination.rbi new file mode 100644 index 0000000..9472f41 --- /dev/null +++ b/rbi/privy/models/swap_quote_destination.rbi @@ -0,0 +1,41 @@ +# typed: strong + +module Privy + module Models + class SwapQuoteDestination < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SwapQuoteDestination, Privy::Internal::AnyHash) + end + + # Token contract address to buy, or "native" for the chain's native token. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier for the destination. Must match source chain — + # cross-chain swaps are not yet supported. Defaults to source chain if omitted. + sig { returns(T.nilable(String)) } + attr_reader :caip2 + + sig { params(caip2: String).void } + attr_writer :caip2 + + # The output side of a swap quote request. + sig do + params(asset_address: String, caip2: String).returns(T.attached_class) + end + def self.new( + # Token contract address to buy, or "native" for the chain's native token. + asset_address:, + # CAIP-2 chain identifier for the destination. Must match source chain — + # cross-chain swaps are not yet supported. Defaults to source chain if omitted. + caip2: nil + ) + end + + sig { override.returns({ asset_address: String, caip2: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/swap_quote_request_body.rbi b/rbi/privy/models/swap_quote_request_body.rbi new file mode 100644 index 0000000..8c3d92a --- /dev/null +++ b/rbi/privy/models/swap_quote_request_body.rbi @@ -0,0 +1,84 @@ +# typed: strong + +module Privy + module Models + class SwapQuoteRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SwapQuoteRequestBody, Privy::Internal::AnyHash) + end + + # Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + sig { returns(String) } + attr_accessor :base_amount + + # The output side of a swap quote request. + sig { returns(Privy::SwapQuoteDestination) } + attr_reader :destination + + sig { params(destination: Privy::SwapQuoteDestination::OrHash).void } + attr_writer :destination + + # The input side of a swap request, including token and chain. + sig { returns(Privy::SwapSource) } + attr_reader :source + + sig { params(source: Privy::SwapSource::OrHash).void } + attr_writer :source + + # Whether the amount refers to the input token or output token. + sig { returns(T.nilable(Privy::AmountType::OrSymbol)) } + attr_reader :amount_type + + sig { params(amount_type: Privy::AmountType::OrSymbol).void } + attr_writer :amount_type + + # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, + # auto-slippage is used. + sig { returns(T.nilable(Float)) } + attr_reader :slippage_bps + + sig { params(slippage_bps: Float).void } + attr_writer :slippage_bps + + # Input for requesting a token swap quote. + sig do + params( + base_amount: String, + destination: Privy::SwapQuoteDestination::OrHash, + source: Privy::SwapSource::OrHash, + amount_type: Privy::AmountType::OrSymbol, + slippage_bps: Float + ).returns(T.attached_class) + end + def self.new( + # Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + base_amount:, + # The output side of a swap quote request. + destination:, + # The input side of a swap request, including token and chain. + source:, + # Whether the amount refers to the input token or output token. + amount_type: nil, + # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). If omitted, + # auto-slippage is used. + slippage_bps: nil + ) + end + + sig do + override.returns( + { + base_amount: String, + destination: Privy::SwapQuoteDestination, + source: Privy::SwapSource, + amount_type: Privy::AmountType::OrSymbol, + slippage_bps: Float + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/swap_quote_response.rbi b/rbi/privy/models/swap_quote_response.rbi new file mode 100644 index 0000000..0629805 --- /dev/null +++ b/rbi/privy/models/swap_quote_response.rbi @@ -0,0 +1,86 @@ +# typed: strong + +module Privy + module Models + class SwapQuoteResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::SwapQuoteResponse, Privy::Internal::AnyHash) + end + + # Chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Estimated amount of output token in base units. + sig { returns(String) } + attr_accessor :est_output_amount + + # Estimated gas cost in base units of the native token. + sig { returns(String) } + attr_accessor :gas_estimate + + # Amount of input token in base units. + sig { returns(String) } + attr_accessor :input_amount + + # Token address being sold. + sig { returns(String) } + attr_accessor :input_token + + # Minimum output amount accounting for slippage, in base units. + sig { returns(String) } + attr_accessor :minimum_output_amount + + # Token address being bought. + sig { returns(String) } + attr_accessor :output_token + + # Pricing data for a token swap. + sig do + params( + caip2: String, + est_output_amount: String, + gas_estimate: String, + input_amount: String, + input_token: String, + minimum_output_amount: String, + output_token: String + ).returns(T.attached_class) + end + def self.new( + # Chain identifier. + caip2:, + # Estimated amount of output token in base units. + est_output_amount:, + # Estimated gas cost in base units of the native token. + gas_estimate:, + # Amount of input token in base units. + input_amount:, + # Token address being sold. + input_token:, + # Minimum output amount accounting for slippage, in base units. + minimum_output_amount:, + # Token address being bought. + output_token: + ) + end + + sig do + override.returns( + { + caip2: String, + est_output_amount: String, + gas_estimate: String, + input_amount: String, + input_token: String, + minimum_output_amount: String, + output_token: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/swap_request_body.rbi b/rbi/privy/models/swap_request_body.rbi new file mode 100644 index 0000000..4146e62 --- /dev/null +++ b/rbi/privy/models/swap_request_body.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Privy + module Models + class SwapRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SwapRequestBody, Privy::Internal::AnyHash) } + + # Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + sig { returns(String) } + attr_accessor :base_amount + + # The output side of a swap execution request. + sig { returns(Privy::SwapDestination) } + attr_reader :destination + + sig { params(destination: Privy::SwapDestination::OrHash).void } + attr_writer :destination + + # The input side of a swap request, including token and chain. + sig { returns(Privy::SwapSource) } + attr_reader :source + + sig { params(source: Privy::SwapSource::OrHash).void } + attr_writer :source + + # Whether the amount refers to the input token or output token. + sig { returns(T.nilable(Privy::AmountType::OrSymbol)) } + attr_reader :amount_type + + sig { params(amount_type: Privy::AmountType::OrSymbol).void } + attr_writer :amount_type + + # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). + sig { returns(T.nilable(Float)) } + attr_reader :slippage_bps + + sig { params(slippage_bps: Float).void } + attr_writer :slippage_bps + + # Input for executing a token swap. + sig do + params( + base_amount: String, + destination: Privy::SwapDestination::OrHash, + source: Privy::SwapSource::OrHash, + amount_type: Privy::AmountType::OrSymbol, + slippage_bps: Float + ).returns(T.attached_class) + end + def self.new( + # Amount in base units (e.g., wei for ETH). Must be a non-negative integer string. + base_amount:, + # The output side of a swap execution request. + destination:, + # The input side of a swap request, including token and chain. + source:, + # Whether the amount refers to the input token or output token. + amount_type: nil, + # Maximum slippage tolerance in basis points (e.g., 50 for 0.5%). + slippage_bps: nil + ) + end + + sig do + override.returns( + { + base_amount: String, + destination: Privy::SwapDestination, + source: Privy::SwapSource, + amount_type: Privy::AmountType::OrSymbol, + slippage_bps: Float + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/swap_source.rbi b/rbi/privy/models/swap_source.rbi new file mode 100644 index 0000000..0112524 --- /dev/null +++ b/rbi/privy/models/swap_source.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class SwapSource < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SwapSource, Privy::Internal::AnyHash) } + + # Token contract address to sell, or "native" for the chain's native token. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier (e.g., "eip155:1"). + sig { returns(String) } + attr_accessor :caip2 + + # The input side of a swap request, including token and chain. + sig do + params(asset_address: String, caip2: String).returns(T.attached_class) + end + def self.new( + # Token contract address to sell, or "native" for the chain's native token. + asset_address:, + # CAIP-2 chain identifier (e.g., "eip155:1"). + caip2: + ) + end + + sig { override.returns({ asset_address: String, caip2: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/system_condition.rbi b/rbi/privy/models/system_condition.rbi new file mode 100644 index 0000000..d2d1286 --- /dev/null +++ b/rbi/privy/models/system_condition.rbi @@ -0,0 +1,99 @@ +# typed: strong + +module Privy + module Models + class SystemCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::SystemCondition, Privy::Internal::AnyHash) } + + sig { returns(Privy::SystemCondition::Field::OrSymbol) } + attr_accessor :field + + sig { returns(Privy::SystemCondition::FieldSource::OrSymbol) } + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # System attributes, including current unix timestamp (in seconds). + sig do + params( + field: Privy::SystemCondition::Field::OrSymbol, + field_source: Privy::SystemCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: Privy::SystemCondition::Field::OrSymbol, + field_source: Privy::SystemCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SystemCondition::Field) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + CURRENT_UNIX_TIMESTAMP = + T.let( + :current_unix_timestamp, + Privy::SystemCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::SystemCondition::Field::TaggedSymbol] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::SystemCondition::FieldSource) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SYSTEM = + T.let(:system, Privy::SystemCondition::FieldSource::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::SystemCondition::FieldSource::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/telegram_auth_config_schema.rbi b/rbi/privy/models/telegram_auth_config_schema.rbi new file mode 100644 index 0000000..4ea0ffe --- /dev/null +++ b/rbi/privy/models/telegram_auth_config_schema.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class TelegramAuthConfigSchema < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TelegramAuthConfigSchema, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :bot_id + + sig { returns(String) } + attr_accessor :bot_name + + sig { returns(T::Boolean) } + attr_accessor :link_enabled + + sig { returns(T::Boolean) } + attr_accessor :seamless_auth_enabled + + # Configuration for Telegram authentication. + sig do + params( + bot_id: String, + bot_name: String, + link_enabled: T::Boolean, + seamless_auth_enabled: T::Boolean + ).returns(T.attached_class) + end + def self.new(bot_id:, bot_name:, link_enabled:, seamless_auth_enabled:) + end + + sig do + override.returns( + { + bot_id: String, + bot_name: String, + link_enabled: T::Boolean, + seamless_auth_enabled: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/telegram_auth_result.rbi b/rbi/privy/models/telegram_auth_result.rbi new file mode 100644 index 0000000..3973bf9 --- /dev/null +++ b/rbi/privy/models/telegram_auth_result.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Models + class TelegramAuthResult < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TelegramAuthResult, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :id + + sig { returns(T.nilable(Float)) } + attr_accessor :auth_date + + sig { returns(String) } + attr_accessor :first_name + + sig { returns(String) } + attr_accessor :hash_ + + sig { returns(T.nilable(String)) } + attr_reader :last_name + + sig { params(last_name: String).void } + attr_writer :last_name + + sig { returns(T.nilable(String)) } + attr_reader :photo_url + + sig { params(photo_url: String).void } + attr_writer :photo_url + + sig { returns(T.nilable(String)) } + attr_reader :username + + sig { params(username: String).void } + attr_writer :username + + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + sig do + params( + id: T.nilable(Float), + auth_date: T.nilable(Float), + first_name: String, + hash_: String, + last_name: String, + photo_url: String, + username: String + ).returns(T.attached_class) + end + def self.new( + id:, + auth_date:, + first_name:, + hash_:, + last_name: nil, + photo_url: nil, + username: nil + ) + end + + sig do + override.returns( + { + id: T.nilable(Float), + auth_date: T.nilable(Float), + first_name: String, + hash_: String, + last_name: String, + photo_url: String, + username: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/telegram_authenticate_input.rbi b/rbi/privy/models/telegram_authenticate_input.rbi new file mode 100644 index 0000000..3564e64 --- /dev/null +++ b/rbi/privy/models/telegram_authenticate_input.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Privy + module Models + class TelegramAuthenticateInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TelegramAuthenticateInput, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :captcha_token + + sig { params(captcha_token: String).void } + attr_writer :captcha_token + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + sig { returns(T.nilable(Privy::TelegramAuthResult)) } + attr_reader :telegram_auth_result + + sig do + params(telegram_auth_result: Privy::TelegramAuthResult::OrHash).void + end + attr_writer :telegram_auth_result + + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + sig { returns(T.nilable(Privy::TelegramWebAppData)) } + attr_reader :telegram_web_app_data + + sig do + params(telegram_web_app_data: Privy::TelegramWebAppData::OrHash).void + end + attr_writer :telegram_web_app_data + + # Input for authenticating with Telegram. + sig do + params( + captcha_token: String, + mode: Privy::AuthenticateModeOption::OrSymbol, + telegram_auth_result: Privy::TelegramAuthResult::OrHash, + telegram_web_app_data: Privy::TelegramWebAppData::OrHash + ).returns(T.attached_class) + end + def self.new( + captcha_token: nil, + # Whether to allow sign-up during authentication. + mode: nil, + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + telegram_auth_result: nil, + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + telegram_web_app_data: nil + ) + end + + sig do + override.returns( + { + captcha_token: String, + mode: Privy::AuthenticateModeOption::OrSymbol, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/telegram_authenticate_request_body.rbi b/rbi/privy/models/telegram_authenticate_request_body.rbi new file mode 100644 index 0000000..6521b63 --- /dev/null +++ b/rbi/privy/models/telegram_authenticate_request_body.rbi @@ -0,0 +1,83 @@ +# typed: strong + +module Privy + module Models + class TelegramAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TelegramAuthenticateRequestBody, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_reader :captcha_token + + sig { params(captcha_token: String).void } + attr_writer :captcha_token + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + sig { returns(T.nilable(Privy::TelegramAuthResult)) } + attr_reader :telegram_auth_result + + sig do + params(telegram_auth_result: Privy::TelegramAuthResult::OrHash).void + end + attr_writer :telegram_auth_result + + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + sig { returns(T.nilable(Privy::TelegramWebAppData)) } + attr_reader :telegram_web_app_data + + sig do + params(telegram_web_app_data: Privy::TelegramWebAppData::OrHash).void + end + attr_writer :telegram_web_app_data + + # The request body for authenticating with Telegram. + sig do + params( + captcha_token: String, + mode: Privy::AuthenticateModeOption::OrSymbol, + telegram_auth_result: Privy::TelegramAuthResult::OrHash, + telegram_web_app_data: Privy::TelegramWebAppData::OrHash + ).returns(T.attached_class) + end + def self.new( + captcha_token: nil, + # Whether to allow sign-up during authentication. + mode: nil, + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + telegram_auth_result: nil, + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + telegram_web_app_data: nil + ) + end + + sig do + override.returns( + { + captcha_token: String, + mode: Privy::AuthenticateModeOption::OrSymbol, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/telegram_link_request_body.rbi b/rbi/privy/models/telegram_link_request_body.rbi new file mode 100644 index 0000000..f942c12 --- /dev/null +++ b/rbi/privy/models/telegram_link_request_body.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Privy + module Models + class TelegramLinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TelegramLinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :captcha_token + + sig { params(captcha_token: String).void } + attr_writer :captcha_token + + # Whether to allow sign-up during authentication. + sig { returns(T.nilable(Privy::AuthenticateModeOption::OrSymbol)) } + attr_reader :mode + + sig { params(mode: Privy::AuthenticateModeOption::OrSymbol).void } + attr_writer :mode + + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + sig { returns(T.nilable(Privy::TelegramAuthResult)) } + attr_reader :telegram_auth_result + + sig do + params(telegram_auth_result: Privy::TelegramAuthResult::OrHash).void + end + attr_writer :telegram_auth_result + + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + sig { returns(T.nilable(Privy::TelegramWebAppData)) } + attr_reader :telegram_web_app_data + + sig do + params(telegram_web_app_data: Privy::TelegramWebAppData::OrHash).void + end + attr_writer :telegram_web_app_data + + # The request body for linking a Telegram account. + sig do + params( + captcha_token: String, + mode: Privy::AuthenticateModeOption::OrSymbol, + telegram_auth_result: Privy::TelegramAuthResult::OrHash, + telegram_web_app_data: Privy::TelegramWebAppData::OrHash + ).returns(T.attached_class) + end + def self.new( + captcha_token: nil, + # Whether to allow sign-up during authentication. + mode: nil, + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + telegram_auth_result: nil, + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + telegram_web_app_data: nil + ) + end + + sig do + override.returns( + { + captcha_token: String, + mode: Privy::AuthenticateModeOption::OrSymbol, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/telegram_unlink_input.rbi b/rbi/privy/models/telegram_unlink_input.rbi new file mode 100644 index 0000000..f3d3b1b --- /dev/null +++ b/rbi/privy/models/telegram_unlink_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class TelegramUnlinkInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TelegramUnlinkInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :telegram_user_id + + # Input for unlinking a Telegram account. + sig { params(telegram_user_id: String).returns(T.attached_class) } + def self.new(telegram_user_id:) + end + + sig { override.returns({ telegram_user_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/telegram_unlink_request_body.rbi b/rbi/privy/models/telegram_unlink_request_body.rbi new file mode 100644 index 0000000..7fa1b2a --- /dev/null +++ b/rbi/privy/models/telegram_unlink_request_body.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class TelegramUnlinkRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TelegramUnlinkRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :telegram_user_id + + # The request body for unlinking a Telegram account. + sig { params(telegram_user_id: String).returns(T.attached_class) } + def self.new(telegram_user_id:) + end + + sig { override.returns({ telegram_user_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/telegram_web_app_data.rbi b/rbi/privy/models/telegram_web_app_data.rbi new file mode 100644 index 0000000..8c9d6f3 --- /dev/null +++ b/rbi/privy/models/telegram_web_app_data.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class TelegramWebAppData < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TelegramWebAppData, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_accessor :auth_date + + sig { returns(String) } + attr_accessor :hash_ + + sig { returns(String) } + attr_accessor :user + + sig { returns(T.nilable(String)) } + attr_reader :chat_instance + + sig { params(chat_instance: String).void } + attr_writer :chat_instance + + sig { returns(T.nilable(String)) } + attr_reader :chat_type + + sig { params(chat_type: String).void } + attr_writer :chat_type + + sig { returns(T.nilable(String)) } + attr_reader :query_id + + sig { params(query_id: String).void } + attr_writer :query_id + + sig { returns(T.nilable(String)) } + attr_reader :signature + + sig { params(signature: String).void } + attr_writer :signature + + sig { returns(T.nilable(String)) } + attr_reader :start_param + + sig { params(start_param: String).void } + attr_writer :start_param + + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + sig do + params( + auth_date: T.nilable(Float), + hash_: String, + user: String, + chat_instance: String, + chat_type: String, + query_id: String, + signature: String, + start_param: String + ).returns(T.attached_class) + end + def self.new( + auth_date:, + hash_:, + user:, + chat_instance: nil, + chat_type: nil, + query_id: nil, + signature: nil, + start_param: nil + ) + end + + sig do + override.returns( + { + auth_date: T.nilable(Float), + hash_: String, + user: String, + chat_instance: String, + chat_type: String, + query_id: String, + signature: String, + start_param: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/tempo_aa_authorization.rbi b/rbi/privy/models/tempo_aa_authorization.rbi new file mode 100644 index 0000000..2d4c23b --- /dev/null +++ b/rbi/privy/models/tempo_aa_authorization.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class TempoAaAuthorization < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TempoAaAuthorization, Privy::Internal::AnyHash) + end + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(Privy::Quantity::Variants) } + attr_accessor :chain_id + + sig { returns(String) } + attr_accessor :contract + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(Privy::Quantity::Variants) } + attr_accessor :nonce + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :signature + + # An AA authorization for Tempo transactions with P256/WebAuthn signatures. + sig do + params( + chain_id: Privy::Quantity::Variants, + contract: String, + nonce: Privy::Quantity::Variants, + signature: String + ).returns(T.attached_class) + end + def self.new( + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + chain_id:, + contract:, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + nonce:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + signature: + ) + end + + sig do + override.returns( + { + chain_id: Privy::Quantity::Variants, + contract: String, + nonce: Privy::Quantity::Variants, + signature: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/tempo_call.rbi b/rbi/privy/models/tempo_call.rbi new file mode 100644 index 0000000..86cca96 --- /dev/null +++ b/rbi/privy/models/tempo_call.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class TempoCall < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::TempoCall, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :to + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :data + + sig { params(data: String).void } + attr_writer :data + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :value + + sig { params(value: Privy::Quantity::Variants).void } + attr_writer :value + + # A single call within a Tempo batched transaction. + sig do + params( + to: String, + data: String, + value: Privy::Quantity::Variants + ).returns(T.attached_class) + end + def self.new( + to:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + data: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + value: nil + ) + end + + sig do + override.returns( + { to: String, data: String, value: Privy::Quantity::Variants } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/tempo_fee_payer_signature.rbi b/rbi/privy/models/tempo_fee_payer_signature.rbi new file mode 100644 index 0000000..5f70571 --- /dev/null +++ b/rbi/privy/models/tempo_fee_payer_signature.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class TempoFeePayerSignature < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TempoFeePayerSignature, Privy::Internal::AnyHash) + end + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :r + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :s + + sig { returns(Privy::TempoFeePayerSignature::YParity::OrFloat) } + attr_accessor :y_parity + + # A fee payer signature for sponsored Tempo transactions (secp256k1 only). + sig do + params( + r: String, + s: String, + y_parity: Privy::TempoFeePayerSignature::YParity::OrFloat + ).returns(T.attached_class) + end + def self.new( + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + r:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + s:, + y_parity: + ) + end + + sig do + override.returns( + { + r: String, + s: String, + y_parity: Privy::TempoFeePayerSignature::YParity::OrFloat + } + ) + end + def to_hash + end + + module YParity + extend Privy::Internal::Type::Enum + + TaggedFloat = + T.type_alias { T.all(Float, Privy::TempoFeePayerSignature::YParity) } + OrFloat = T.type_alias { Float } + + Y_PARITY_0 = + T.let(0, Privy::TempoFeePayerSignature::YParity::TaggedFloat) + Y_PARITY_1 = + T.let(1, Privy::TempoFeePayerSignature::YParity::TaggedFloat) + + sig do + override.returns( + T::Array[Privy::TempoFeePayerSignature::YParity::TaggedFloat] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/test_account.rbi b/rbi/privy/models/test_account.rbi new file mode 100644 index 0000000..39a3c19 --- /dev/null +++ b/rbi/privy/models/test_account.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class TestAccount < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::TestAccount, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :created_at + + sig { returns(String) } + attr_accessor :email + + sig { returns(String) } + attr_accessor :otp_code + + sig { returns(String) } + attr_accessor :phone_number + + sig { returns(String) } + attr_accessor :updated_at + + # A test account for an app. + sig do + params( + id: String, + created_at: String, + email: String, + otp_code: String, + phone_number: String, + updated_at: String + ).returns(T.attached_class) + end + def self.new( + id:, + created_at:, + email:, + otp_code:, + phone_number:, + updated_at: + ) + end + + sig do + override.returns( + { + id: String, + created_at: String, + email: String, + otp_code: String, + phone_number: String, + updated_at: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/test_accounts_response.rbi b/rbi/privy/models/test_accounts_response.rbi new file mode 100644 index 0000000..754c561 --- /dev/null +++ b/rbi/privy/models/test_accounts_response.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + class TestAccountsResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TestAccountsResponse, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[Privy::TestAccount]) } + attr_accessor :data + + # Response for listing test accounts for an app. + sig do + params(data: T::Array[Privy::TestAccount::OrHash]).returns( + T.attached_class + ) + end + def self.new(data:) + end + + sig { override.returns({ data: T::Array[Privy::TestAccount] }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/token_output.rbi b/rbi/privy/models/token_output.rbi new file mode 100644 index 0000000..af12580 --- /dev/null +++ b/rbi/privy/models/token_output.rbi @@ -0,0 +1,94 @@ +# typed: strong + +module Privy + module Models + class TokenOutput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::TokenOutput, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :owner_public_key + + sig { returns(String) } + attr_accessor :token_amount + + sig { returns(T.nilable(String)) } + attr_reader :id + + sig { params(id: String).void } + attr_writer :id + + sig { returns(T.nilable(String)) } + attr_reader :revocation_commitment + + sig { params(revocation_commitment: String).void } + attr_writer :revocation_commitment + + sig { returns(T.nilable(String)) } + attr_reader :token_identifier + + sig { params(token_identifier: String).void } + attr_writer :token_identifier + + sig { returns(T.nilable(String)) } + attr_reader :token_public_key + + sig { params(token_public_key: String).void } + attr_writer :token_public_key + + sig { returns(T.nilable(Float)) } + attr_reader :withdraw_bond_sats + + sig { params(withdraw_bond_sats: Float).void } + attr_writer :withdraw_bond_sats + + sig { returns(T.nilable(Float)) } + attr_reader :withdraw_relative_block_locktime + + sig { params(withdraw_relative_block_locktime: Float).void } + attr_writer :withdraw_relative_block_locktime + + # A Spark token output. + sig do + params( + owner_public_key: String, + token_amount: String, + id: String, + revocation_commitment: String, + token_identifier: String, + token_public_key: String, + withdraw_bond_sats: Float, + withdraw_relative_block_locktime: Float + ).returns(T.attached_class) + end + def self.new( + owner_public_key:, + token_amount:, + id: nil, + revocation_commitment: nil, + token_identifier: nil, + token_public_key: nil, + withdraw_bond_sats: nil, + withdraw_relative_block_locktime: nil + ) + end + + sig do + override.returns( + { + owner_public_key: String, + token_amount: String, + id: String, + revocation_commitment: String, + token_identifier: String, + token_public_key: String, + withdraw_bond_sats: Float, + withdraw_relative_block_locktime: Float + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/token_transfer_destination.rbi b/rbi/privy/models/token_transfer_destination.rbi new file mode 100644 index 0000000..b4b46f9 --- /dev/null +++ b/rbi/privy/models/token_transfer_destination.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + class TokenTransferDestination < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TokenTransferDestination, Privy::Internal::AnyHash) + end + + # Recipient address (hex for EVM, base58 for Solana) + sig { returns(String) } + attr_accessor :address + + # The destination asset. Required for cross-asset transfers (e.g., source 'usdt' + # to destination 'usdc'). + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # The destination blockchain network. Required for cross-chain transfers (e.g., + # source 'base' to destination 'arbitrum'). + sig { returns(T.nilable(String)) } + attr_reader :chain + + sig { params(chain: String).void } + attr_writer :chain + + # The destination address for a token transfer. Optionally specify a different + # asset or chain for cross-asset or cross-chain transfers. + sig do + params(address: String, asset: String, chain: String).returns( + T.attached_class + ) + end + def self.new( + # Recipient address (hex for EVM, base58 for Solana) + address:, + # The destination asset. Required for cross-asset transfers (e.g., source 'usdt' + # to destination 'usdc'). + asset: nil, + # The destination blockchain network. Required for cross-chain transfers (e.g., + # source 'base' to destination 'arbitrum'). + chain: nil + ) + end + + sig do + override.returns({ address: String, asset: String, chain: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/token_transfer_source.rbi b/rbi/privy/models/token_transfer_source.rbi new file mode 100644 index 0000000..666ff01 --- /dev/null +++ b/rbi/privy/models/token_transfer_source.rbi @@ -0,0 +1,23 @@ +# typed: strong + +module Privy + module Models + # The source asset, amount, and chain for a token transfer. Specify either `asset` + # (named) or `asset_address` (custom), not both. + module TokenTransferSource + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::NamedTokenTransferSource, + Privy::CustomTokenTransferSource + ) + end + + sig { override.returns(T::Array[Privy::TokenTransferSource::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/totp_mfa_method.rbi b/rbi/privy/models/totp_mfa_method.rbi new file mode 100644 index 0000000..1530c16 --- /dev/null +++ b/rbi/privy/models/totp_mfa_method.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Models + class TotpMfaMethod < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::TotpMfaMethod, Privy::Internal::AnyHash) } + + sig { returns(Privy::TotpMfaMethod::Type::TaggedSymbol) } + attr_accessor :type + + sig { returns(Float) } + attr_accessor :verified_at + + # A TOTP MFA method. + sig do + params( + type: Privy::TotpMfaMethod::Type::OrSymbol, + verified_at: Float + ).returns(T.attached_class) + end + def self.new(type:, verified_at:) + end + + sig do + override.returns( + { type: Privy::TotpMfaMethod::Type::TaggedSymbol, verified_at: Float } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::TotpMfaMethod::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TOTP = T.let(:totp, Privy::TotpMfaMethod::Type::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::TotpMfaMethod::Type::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction.rbi b/rbi/privy/models/transaction.rbi new file mode 100644 index 0000000..e01803c --- /dev/null +++ b/rbi/privy/models/transaction.rbi @@ -0,0 +1,114 @@ +# typed: strong + +module Privy + module Models + class Transaction < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::Transaction, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(Float) } + attr_accessor :created_at + + sig { returns(Privy::Transaction::Status::TaggedSymbol) } + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_accessor :transaction_hash + + sig { returns(String) } + attr_accessor :wallet_id + + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :sponsored + + sig { params(sponsored: T::Boolean).void } + attr_writer :sponsored + + sig { returns(T.nilable(String)) } + attr_reader :user_operation_hash + + sig { params(user_operation_hash: String).void } + attr_writer :user_operation_hash + + # A transaction from a Privy wallet. + sig do + params( + id: String, + caip2: String, + created_at: Float, + status: Privy::Transaction::Status::OrSymbol, + transaction_hash: T.nilable(String), + wallet_id: String, + reference_id: T.nilable(String), + sponsored: T::Boolean, + user_operation_hash: String + ).returns(T.attached_class) + end + def self.new( + id:, + caip2:, + created_at:, + status:, + transaction_hash:, + wallet_id:, + reference_id: nil, + sponsored: nil, + user_operation_hash: nil + ) + end + + sig do + override.returns( + { + id: String, + caip2: String, + created_at: Float, + status: Privy::Transaction::Status::TaggedSymbol, + transaction_hash: T.nilable(String), + wallet_id: String, + reference_id: T.nilable(String), + sponsored: T::Boolean, + user_operation_hash: String + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::Transaction::Status) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BROADCASTED = + T.let(:broadcasted, Privy::Transaction::Status::TaggedSymbol) + CONFIRMED = T.let(:confirmed, Privy::Transaction::Status::TaggedSymbol) + EXECUTION_REVERTED = + T.let(:execution_reverted, Privy::Transaction::Status::TaggedSymbol) + FAILED = T.let(:failed, Privy::Transaction::Status::TaggedSymbol) + REPLACED = T.let(:replaced, Privy::Transaction::Status::TaggedSymbol) + FINALIZED = T.let(:finalized, Privy::Transaction::Status::TaggedSymbol) + PROVIDER_ERROR = + T.let(:provider_error, Privy::Transaction::Status::TaggedSymbol) + PENDING = T.let(:pending, Privy::Transaction::Status::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::Transaction::Status::TaggedSymbol]) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_broadcasted_webhook_payload.rbi b/rbi/privy/models/transaction_broadcasted_webhook_payload.rbi new file mode 100644 index 0000000..c094fac --- /dev/null +++ b/rbi/privy/models/transaction_broadcasted_webhook_payload.rbi @@ -0,0 +1,113 @@ +# typed: strong + +module Privy + module Models + class TransactionBroadcastedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionBroadcastedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + sig { returns(String) } + attr_accessor :caip2 + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The Privy-assigned ID for this transaction. + sig { returns(String) } + attr_accessor :transaction_id + + # The type of webhook event. + sig do + returns(Privy::TransactionBroadcastedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # The ID of the wallet that initiated the transaction. + sig { returns(String) } + attr_accessor :wallet_id + + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + # Payload for the transaction.broadcasted webhook event. + sig do + params( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionBroadcastedWebhookPayload::Type::OrSymbol, + wallet_id: String, + reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + caip2:, + # The blockchain transaction hash. + transaction_hash:, + # The Privy-assigned ID for this transaction. + transaction_id:, + # The type of webhook event. + type:, + # The ID of the wallet that initiated the transaction. + wallet_id:, + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + reference_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + transaction_hash: String, + transaction_id: String, + type: + Privy::TransactionBroadcastedWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransactionBroadcastedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION_BROADCASTED = + T.let( + :"transaction.broadcasted", + Privy::TransactionBroadcastedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionBroadcastedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_confirmed_webhook_payload.rbi b/rbi/privy/models/transaction_confirmed_webhook_payload.rbi new file mode 100644 index 0000000..14f52a4 --- /dev/null +++ b/rbi/privy/models/transaction_confirmed_webhook_payload.rbi @@ -0,0 +1,112 @@ +# typed: strong + +module Privy + module Models + class TransactionConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionConfirmedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + sig { returns(String) } + attr_accessor :caip2 + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The Privy-assigned ID for this transaction. + sig { returns(String) } + attr_accessor :transaction_id + + # The type of webhook event. + sig do + returns(Privy::TransactionConfirmedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # The ID of the wallet that initiated the transaction. + sig { returns(String) } + attr_accessor :wallet_id + + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + # Payload for the transaction.confirmed webhook event. + sig do + params( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionConfirmedWebhookPayload::Type::OrSymbol, + wallet_id: String, + reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + caip2:, + # The blockchain transaction hash. + transaction_hash:, + # The Privy-assigned ID for this transaction. + transaction_id:, + # The type of webhook event. + type:, + # The ID of the wallet that initiated the transaction. + wallet_id:, + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + reference_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionConfirmedWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransactionConfirmedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION_CONFIRMED = + T.let( + :"transaction.confirmed", + Privy::TransactionConfirmedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionConfirmedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_detail.rbi b/rbi/privy/models/transaction_detail.rbi new file mode 100644 index 0000000..50740dd --- /dev/null +++ b/rbi/privy/models/transaction_detail.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # Details of a wallet transaction, varying by transaction type. + module TransactionDetail + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::TransferSentTransactionDetail, + Privy::TransferReceivedTransactionDetail + ) + end + + sig { override.returns(T::Array[Privy::TransactionDetail::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/transaction_execution_reverted_webhook_payload.rbi b/rbi/privy/models/transaction_execution_reverted_webhook_payload.rbi new file mode 100644 index 0000000..9eabe94 --- /dev/null +++ b/rbi/privy/models/transaction_execution_reverted_webhook_payload.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Privy + module Models + class TransactionExecutionRevertedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionExecutionRevertedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + sig { returns(String) } + attr_accessor :caip2 + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The Privy-assigned ID for this transaction. + sig { returns(String) } + attr_accessor :transaction_id + + # The type of webhook event. + sig do + returns( + Privy::TransactionExecutionRevertedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet that initiated the transaction. + sig { returns(String) } + attr_accessor :wallet_id + + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + # Payload for the transaction.execution_reverted webhook event. + sig do + params( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: + Privy::TransactionExecutionRevertedWebhookPayload::Type::OrSymbol, + wallet_id: String, + reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + caip2:, + # The blockchain transaction hash. + transaction_hash:, + # The Privy-assigned ID for this transaction. + transaction_id:, + # The type of webhook event. + type:, + # The ID of the wallet that initiated the transaction. + wallet_id:, + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + reference_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + transaction_hash: String, + transaction_id: String, + type: + Privy::TransactionExecutionRevertedWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::TransactionExecutionRevertedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION_EXECUTION_REVERTED = + T.let( + :"transaction.execution_reverted", + Privy::TransactionExecutionRevertedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionExecutionRevertedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_failed_webhook_payload.rbi b/rbi/privy/models/transaction_failed_webhook_payload.rbi new file mode 100644 index 0000000..7749aa0 --- /dev/null +++ b/rbi/privy/models/transaction_failed_webhook_payload.rbi @@ -0,0 +1,110 @@ +# typed: strong + +module Privy + module Models + class TransactionFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionFailedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + sig { returns(String) } + attr_accessor :caip2 + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The Privy-assigned ID for this transaction. + sig { returns(String) } + attr_accessor :transaction_id + + # The type of webhook event. + sig do + returns(Privy::TransactionFailedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # The ID of the wallet that initiated the transaction. + sig { returns(String) } + attr_accessor :wallet_id + + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + # Payload for the transaction.failed webhook event. + sig do + params( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionFailedWebhookPayload::Type::OrSymbol, + wallet_id: String, + reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + caip2:, + # The blockchain transaction hash. + transaction_hash:, + # The Privy-assigned ID for this transaction. + transaction_id:, + # The type of webhook event. + type:, + # The ID of the wallet that initiated the transaction. + wallet_id:, + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + reference_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionFailedWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransactionFailedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION_FAILED = + T.let( + :"transaction.failed", + Privy::TransactionFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TransactionFailedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_get_params.rbi b/rbi/privy/models/transaction_get_params.rbi new file mode 100644 index 0000000..c95e9f9 --- /dev/null +++ b/rbi/privy/models/transaction_get_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Privy + module Models + class TransactionGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::TransactionGetParams, Privy::Internal::AnyHash) + end + + # ID of the transaction. + sig { returns(String) } + attr_accessor :transaction_id + + sig do + params( + transaction_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the transaction. + transaction_id:, + request_options: {} + ) + end + + sig do + override.returns( + { transaction_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_list.rbi b/rbi/privy/models/transaction_list.rbi new file mode 100644 index 0000000..a0978e6 --- /dev/null +++ b/rbi/privy/models/transaction_list.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + class TransactionList < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::TransactionList, Privy::Internal::AnyHash) } + + sig { returns(T::Array[Privy::Transaction]) } + attr_accessor :transactions + + # A list of transactions. + sig do + params(transactions: T::Array[Privy::Transaction::OrHash]).returns( + T.attached_class + ) + end + def self.new(transactions:) + end + + sig { override.returns({ transactions: T::Array[Privy::Transaction] }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_provider_error_webhook_payload.rbi b/rbi/privy/models/transaction_provider_error_webhook_payload.rbi new file mode 100644 index 0000000..cfc7d8f --- /dev/null +++ b/rbi/privy/models/transaction_provider_error_webhook_payload.rbi @@ -0,0 +1,115 @@ +# typed: strong + +module Privy + module Models + class TransactionProviderErrorWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionProviderErrorWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + sig { returns(String) } + attr_accessor :caip2 + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The Privy-assigned ID for this transaction. + sig { returns(String) } + attr_accessor :transaction_id + + # The type of webhook event. + sig do + returns( + Privy::TransactionProviderErrorWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet that initiated the transaction. + sig { returns(String) } + attr_accessor :wallet_id + + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + # Payload for the transaction.provider_error webhook event. + sig do + params( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionProviderErrorWebhookPayload::Type::OrSymbol, + wallet_id: String, + reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + caip2:, + # The blockchain transaction hash. + transaction_hash:, + # The Privy-assigned ID for this transaction. + transaction_id:, + # The type of webhook event. + type:, + # The ID of the wallet that initiated the transaction. + wallet_id:, + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + reference_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + transaction_hash: String, + transaction_id: String, + type: + Privy::TransactionProviderErrorWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransactionProviderErrorWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION_PROVIDER_ERROR = + T.let( + :"transaction.provider_error", + Privy::TransactionProviderErrorWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionProviderErrorWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_replaced_webhook_payload.rbi b/rbi/privy/models/transaction_replaced_webhook_payload.rbi new file mode 100644 index 0000000..05c8405 --- /dev/null +++ b/rbi/privy/models/transaction_replaced_webhook_payload.rbi @@ -0,0 +1,112 @@ +# typed: strong + +module Privy + module Models + class TransactionReplacedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionReplacedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + sig { returns(String) } + attr_accessor :caip2 + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The Privy-assigned ID for this transaction. + sig { returns(String) } + attr_accessor :transaction_id + + # The type of webhook event. + sig do + returns(Privy::TransactionReplacedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # The ID of the wallet that initiated the transaction. + sig { returns(String) } + attr_accessor :wallet_id + + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + # Payload for the transaction.replaced webhook event. + sig do + params( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionReplacedWebhookPayload::Type::OrSymbol, + wallet_id: String, + reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + caip2:, + # The blockchain transaction hash. + transaction_hash:, + # The Privy-assigned ID for this transaction. + transaction_id:, + # The type of webhook event. + type:, + # The ID of the wallet that initiated the transaction. + wallet_id:, + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + reference_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::TransactionReplacedWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransactionReplacedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION_REPLACED = + T.let( + :"transaction.replaced", + Privy::TransactionReplacedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionReplacedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_asset_diff.rbi b/rbi/privy/models/transaction_scanning_asset_diff.rbi new file mode 100644 index 0000000..7fb8b29 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_asset_diff.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningAssetDiff < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningAssetDiff, Privy::Internal::AnyHash) + end + + # Information about the moving asset in a transaction scan. + sig { returns(Privy::TransactionScanningAssetInfo) } + attr_reader :asset + + sig { params(asset: Privy::TransactionScanningAssetInfo::OrHash).void } + attr_writer :asset + + sig { returns(T::Array[Privy::TransactionScanningAssetValue]) } + attr_accessor :in_ + + sig { returns(T::Array[Privy::TransactionScanningAssetValue]) } + attr_accessor :out + + # An asset diff representing assets entering/leaving a wallet. + sig do + params( + asset: Privy::TransactionScanningAssetInfo::OrHash, + in_: T::Array[Privy::TransactionScanningAssetValue::OrHash], + out: T::Array[Privy::TransactionScanningAssetValue::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Information about the moving asset in a transaction scan. + asset:, + in_:, + out: + ) + end + + sig do + override.returns( + { + asset: Privy::TransactionScanningAssetInfo, + in_: T::Array[Privy::TransactionScanningAssetValue], + out: T::Array[Privy::TransactionScanningAssetValue] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_asset_info.rbi b/rbi/privy/models/transaction_scanning_asset_info.rbi new file mode 100644 index 0000000..1207c2a --- /dev/null +++ b/rbi/privy/models/transaction_scanning_asset_info.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningAssetInfo < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningAssetInfo, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(Float)) } + attr_reader :decimals + + sig { params(decimals: Float).void } + attr_writer :decimals + + sig { returns(T.nilable(String)) } + attr_reader :logo_url + + sig { params(logo_url: String).void } + attr_writer :logo_url + + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + sig { returns(T.nilable(String)) } + attr_reader :symbol + + sig { params(symbol: String).void } + attr_writer :symbol + + sig { returns(T.nilable(String)) } + attr_reader :type + + sig { params(type: String).void } + attr_writer :type + + # Information about the moving asset in a transaction scan. + sig do + params( + decimals: Float, + logo_url: String, + name: String, + symbol: String, + type: String + ).returns(T.attached_class) + end + def self.new( + decimals: nil, + logo_url: nil, + name: nil, + symbol: nil, + type: nil + ) + end + + sig do + override.returns( + { + decimals: Float, + logo_url: String, + name: String, + symbol: String, + type: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_asset_value.rbi b/rbi/privy/models/transaction_scanning_asset_value.rbi new file mode 100644 index 0000000..6a22e48 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_asset_value.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningAssetValue < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningAssetValue, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :usd_price + + sig { params(usd_price: String).void } + attr_writer :usd_price + + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + # The value of an asset in a transaction scan result. + sig { params(usd_price: String, value: String).returns(T.attached_class) } + def self.new(usd_price: nil, value: nil) + end + + sig { override.returns({ usd_price: String, value: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_calldata.rbi b/rbi/privy/models/transaction_scanning_calldata.rbi new file mode 100644 index 0000000..53b382c --- /dev/null +++ b/rbi/privy/models/transaction_scanning_calldata.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningCalldata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningCalldata, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :function_selector + + sig { returns(T.nilable(String)) } + attr_reader :function_declaration + + sig { params(function_declaration: String).void } + attr_writer :function_declaration + + sig { returns(T.nilable(String)) } + attr_reader :function_signature + + sig { params(function_signature: String).void } + attr_writer :function_signature + + # Decoded calldata from a scanned transaction. + sig do + params( + function_selector: String, + function_declaration: String, + function_signature: String + ).returns(T.attached_class) + end + def self.new( + function_selector:, + function_declaration: nil, + function_signature: nil + ) + end + + sig do + override.returns( + { + function_selector: String, + function_declaration: String, + function_signature: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_exposure.rbi b/rbi/privy/models/transaction_scanning_exposure.rbi new file mode 100644 index 0000000..c868b89 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_exposure.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningExposure < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningExposure, Privy::Internal::AnyHash) + end + + # Information about the moving asset in a transaction scan. + sig { returns(Privy::TransactionScanningAssetInfo) } + attr_reader :asset + + sig { params(asset: Privy::TransactionScanningAssetInfo::OrHash).void } + attr_writer :asset + + sig { returns(T::Hash[Symbol, Privy::TransactionScanningAssetValue]) } + attr_accessor :spenders + + # An exposure representing assets approved to spend. + sig do + params( + asset: Privy::TransactionScanningAssetInfo::OrHash, + spenders: + T::Hash[Symbol, Privy::TransactionScanningAssetValue::OrHash] + ).returns(T.attached_class) + end + def self.new( + # Information about the moving asset in a transaction scan. + asset:, + spenders: + ) + end + + sig do + override.returns( + { + asset: Privy::TransactionScanningAssetInfo, + spenders: T::Hash[Symbol, Privy::TransactionScanningAssetValue] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_metadata.rbi b/rbi/privy/models/transaction_scanning_metadata.rbi new file mode 100644 index 0000000..a52f414 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_metadata.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningMetadata < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningMetadata, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :domain + + # Additional information for Blockaid to validate against. + sig { params(domain: String).returns(T.attached_class) } + def self.new(domain:) + end + + sig { override.returns({ domain: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_params.rbi b/rbi/privy/models/transaction_scanning_params.rbi new file mode 100644 index 0000000..3a773e7 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_params.rbi @@ -0,0 +1,113 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningParams < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningParams, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_reader :block_tag + + sig { params(block_tag: String).void } + attr_writer :block_tag + + # Decoded calldata from a scanned transaction. + sig { returns(T.nilable(Privy::TransactionScanningCalldata)) } + attr_reader :calldata + + sig { params(calldata: Privy::TransactionScanningCalldata::OrHash).void } + attr_writer :calldata + + sig { returns(T.nilable(String)) } + attr_reader :chain + + sig { params(chain: String).void } + attr_writer :chain + + sig { returns(T.nilable(String)) } + attr_reader :data + + sig { params(data: String).void } + attr_writer :data + + sig { returns(T.nilable(String)) } + attr_reader :from + + sig { params(from: String).void } + attr_writer :from + + sig { returns(T.nilable(String)) } + attr_reader :gas + + sig { params(gas: String).void } + attr_writer :gas + + sig { returns(T.nilable(String)) } + attr_reader :gas_price + + sig { params(gas_price: String).void } + attr_writer :gas_price + + sig { returns(T.nilable(String)) } + attr_reader :to + + sig { params(to: String).void } + attr_writer :to + + sig { returns(T.nilable(String)) } + attr_reader :value + + sig { params(value: String).void } + attr_writer :value + + # The parameters of the scanned transaction. + sig do + params( + block_tag: String, + calldata: Privy::TransactionScanningCalldata::OrHash, + chain: String, + data: String, + from: String, + gas: String, + gas_price: String, + to: String, + value: String + ).returns(T.attached_class) + end + def self.new( + block_tag: nil, + # Decoded calldata from a scanned transaction. + calldata: nil, + chain: nil, + data: nil, + from: nil, + gas: nil, + gas_price: nil, + to: nil, + value: nil + ) + end + + sig do + override.returns( + { + block_tag: String, + calldata: Privy::TransactionScanningCalldata, + chain: String, + data: String, + from: String, + gas: String, + gas_price: String, + to: String, + value: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_request_body.rbi b/rbi/privy/models/transaction_scanning_request_body.rbi new file mode 100644 index 0000000..59a260c --- /dev/null +++ b/rbi/privy/models/transaction_scanning_request_body.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningRequestBody, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :chain_id + + # Additional information for Blockaid to validate against. + sig { returns(Privy::TransactionScanningMetadata) } + attr_reader :metadata + + sig { params(metadata: Privy::TransactionScanningMetadata::OrHash).void } + attr_writer :metadata + + # Raw RPC request to execute with the wallet. + sig { returns(Privy::TransactionScanningRpcRequest) } + attr_reader :request + + sig { params(request: Privy::TransactionScanningRpcRequest::OrHash).void } + attr_writer :request + + # The request body for scanning a transaction. + sig do + params( + chain_id: String, + metadata: Privy::TransactionScanningMetadata::OrHash, + request: Privy::TransactionScanningRpcRequest::OrHash + ).returns(T.attached_class) + end + def self.new( + chain_id:, + # Additional information for Blockaid to validate against. + metadata:, + # Raw RPC request to execute with the wallet. + request: + ) + end + + sig do + override.returns( + { + chain_id: String, + metadata: Privy::TransactionScanningMetadata, + request: Privy::TransactionScanningRpcRequest + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_response_body.rbi b/rbi/privy/models/transaction_scanning_response_body.rbi new file mode 100644 index 0000000..28690ab --- /dev/null +++ b/rbi/privy/models/transaction_scanning_response_body.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionScanningResponseBody, + Privy::Internal::AnyHash + ) + end + + # The simulation result from a transaction scan. + sig do + returns( + T.any( + Privy::TransactionScanningSimulationErrorResult, + Privy::TransactionScanningSimulationSuccessResult + ) + ) + end + attr_accessor :simulation + + # The validation result from a transaction scan. + sig do + returns( + T.any( + Privy::TransactionScanningValidationErrorResult, + Privy::TransactionScanningValidationSuccessResult + ) + ) + end + attr_accessor :validation + + # The response from scanning a transaction. + sig do + params( + simulation: + T.any( + Privy::TransactionScanningSimulationErrorResult::OrHash, + Privy::TransactionScanningSimulationSuccessResult::OrHash + ), + validation: + T.any( + Privy::TransactionScanningValidationErrorResult::OrHash, + Privy::TransactionScanningValidationSuccessResult::OrHash + ) + ).returns(T.attached_class) + end + def self.new( + # The simulation result from a transaction scan. + simulation:, + # The validation result from a transaction scan. + validation: + ) + end + + sig do + override.returns( + { + simulation: + T.any( + Privy::TransactionScanningSimulationErrorResult, + Privy::TransactionScanningSimulationSuccessResult + ), + validation: + T.any( + Privy::TransactionScanningValidationErrorResult, + Privy::TransactionScanningValidationSuccessResult + ) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_rpc_request.rbi b/rbi/privy/models/transaction_scanning_rpc_request.rbi new file mode 100644 index 0000000..a2035fd --- /dev/null +++ b/rbi/privy/models/transaction_scanning_rpc_request.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningRpcRequest < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransactionScanningRpcRequest, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :method_ + + sig { returns(T::Array[T.anything]) } + attr_accessor :params + + # Raw RPC request to execute with the wallet. + sig do + params(method_: String, params: T::Array[T.anything]).returns( + T.attached_class + ) + end + def self.new(method_:, params:) + end + + sig do + override.returns({ method_: String, params: T::Array[T.anything] }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_simulation_error_result.rbi b/rbi/privy/models/transaction_scanning_simulation_error_result.rbi new file mode 100644 index 0000000..a74e59a --- /dev/null +++ b/rbi/privy/models/transaction_scanning_simulation_error_result.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningSimulationErrorResult < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionScanningSimulationErrorResult, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :error + + sig do + returns( + Privy::TransactionScanningSimulationErrorResult::Status::OrSymbol + ) + end + attr_accessor :status + + # A failed simulation result from a transaction scan. + sig do + params( + error: String, + status: + Privy::TransactionScanningSimulationErrorResult::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(error:, status:) + end + + sig do + override.returns( + { + error: String, + status: + Privy::TransactionScanningSimulationErrorResult::Status::OrSymbol + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::TransactionScanningSimulationErrorResult::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ERROR = + T.let( + :Error, + Privy::TransactionScanningSimulationErrorResult::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionScanningSimulationErrorResult::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_simulation_result.rbi b/rbi/privy/models/transaction_scanning_simulation_result.rbi new file mode 100644 index 0000000..5ffc966 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_simulation_result.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # The simulation result from a transaction scan. + module TransactionScanningSimulationResult + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::TransactionScanningSimulationErrorResult, + Privy::TransactionScanningSimulationSuccessResult + ) + end + + sig do + override.returns( + T::Array[Privy::TransactionScanningSimulationResult::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_simulation_success_result.rbi b/rbi/privy/models/transaction_scanning_simulation_success_result.rbi new file mode 100644 index 0000000..c552854 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_simulation_success_result.rbi @@ -0,0 +1,97 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningSimulationSuccessResult < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionScanningSimulationSuccessResult, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[Privy::TransactionScanningAssetDiff]) } + attr_accessor :assets_diffs + + sig { returns(T::Array[Privy::TransactionScanningExposure]) } + attr_accessor :exposures + + sig do + returns( + Privy::TransactionScanningSimulationSuccessResult::Status::OrSymbol + ) + end + attr_accessor :status + + # The parameters of the scanned transaction. + sig { returns(T.nilable(Privy::TransactionScanningParams)) } + attr_reader :params + + sig { params(params: Privy::TransactionScanningParams::OrHash).void } + attr_writer :params + + # A successful simulation result from a transaction scan. + sig do + params( + assets_diffs: T::Array[Privy::TransactionScanningAssetDiff::OrHash], + exposures: T::Array[Privy::TransactionScanningExposure::OrHash], + status: + Privy::TransactionScanningSimulationSuccessResult::Status::OrSymbol, + params: Privy::TransactionScanningParams::OrHash + ).returns(T.attached_class) + end + def self.new( + assets_diffs:, + exposures:, + status:, + # The parameters of the scanned transaction. + params: nil + ) + end + + sig do + override.returns( + { + assets_diffs: T::Array[Privy::TransactionScanningAssetDiff], + exposures: T::Array[Privy::TransactionScanningExposure], + status: + Privy::TransactionScanningSimulationSuccessResult::Status::OrSymbol, + params: Privy::TransactionScanningParams + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::TransactionScanningSimulationSuccessResult::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCESS = + T.let( + :Success, + Privy::TransactionScanningSimulationSuccessResult::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionScanningSimulationSuccessResult::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_validation_error_result.rbi b/rbi/privy/models/transaction_scanning_validation_error_result.rbi new file mode 100644 index 0000000..c319033 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_validation_error_result.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningValidationErrorResult < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionScanningValidationErrorResult, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :error + + sig do + returns( + Privy::TransactionScanningValidationErrorResult::Status::OrSymbol + ) + end + attr_accessor :status + + # A failed validation result from a transaction scan. + sig do + params( + error: String, + status: + Privy::TransactionScanningValidationErrorResult::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(error:, status:) + end + + sig do + override.returns( + { + error: String, + status: + Privy::TransactionScanningValidationErrorResult::Status::OrSymbol + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::TransactionScanningValidationErrorResult::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ERROR = + T.let( + :Error, + Privy::TransactionScanningValidationErrorResult::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionScanningValidationErrorResult::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_validation_result.rbi b/rbi/privy/models/transaction_scanning_validation_result.rbi new file mode 100644 index 0000000..079fa64 --- /dev/null +++ b/rbi/privy/models/transaction_scanning_validation_result.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # The validation result from a transaction scan. + module TransactionScanningValidationResult + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::TransactionScanningValidationErrorResult, + Privy::TransactionScanningValidationSuccessResult + ) + end + + sig do + override.returns( + T::Array[Privy::TransactionScanningValidationResult::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/transaction_scanning_validation_success_result.rbi b/rbi/privy/models/transaction_scanning_validation_success_result.rbi new file mode 100644 index 0000000..bf4584d --- /dev/null +++ b/rbi/privy/models/transaction_scanning_validation_success_result.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class TransactionScanningValidationSuccessResult < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionScanningValidationSuccessResult, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :result_type + + sig do + returns( + Privy::TransactionScanningValidationSuccessResult::Status::OrSymbol + ) + end + attr_accessor :status + + # A successful validation result from a transaction scan. + sig do + params( + result_type: String, + status: + Privy::TransactionScanningValidationSuccessResult::Status::OrSymbol + ).returns(T.attached_class) + end + def self.new(result_type:, status:) + end + + sig do + override.returns( + { + result_type: String, + status: + Privy::TransactionScanningValidationSuccessResult::Status::OrSymbol + } + ) + end + def to_hash + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::TransactionScanningValidationSuccessResult::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCESS = + T.let( + :Success, + Privy::TransactionScanningValidationSuccessResult::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionScanningValidationSuccessResult::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_still_pending_webhook_payload.rbi b/rbi/privy/models/transaction_still_pending_webhook_payload.rbi new file mode 100644 index 0000000..c8251d7 --- /dev/null +++ b/rbi/privy/models/transaction_still_pending_webhook_payload.rbi @@ -0,0 +1,134 @@ +# typed: strong + +module Privy + module Models + class TransactionStillPendingWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransactionStillPendingWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + sig { returns(String) } + attr_accessor :caip2 + + # The blockchain transaction hash. + sig { returns(String) } + attr_accessor :transaction_hash + + # The Privy-assigned ID for this transaction. + sig { returns(String) } + attr_accessor :transaction_id + + # An unsigned standard Ethereum transaction object. Supports EVM transaction types + # 0, 1, 2, and 4. + sig { returns(Privy::UnsignedStandardEthereumTransaction) } + attr_reader :transaction_request + + sig do + params( + transaction_request: + Privy::UnsignedStandardEthereumTransaction::OrHash + ).void + end + attr_writer :transaction_request + + # The type of webhook event. + sig do + returns( + Privy::TransactionStillPendingWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet that initiated the transaction. + sig { returns(String) } + attr_accessor :wallet_id + + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + sig { returns(T.nilable(String)) } + attr_accessor :reference_id + + # Payload for the transaction.still_pending webhook event. + sig do + params( + caip2: String, + transaction_hash: String, + transaction_id: String, + transaction_request: + Privy::UnsignedStandardEthereumTransaction::OrHash, + type: Privy::TransactionStillPendingWebhookPayload::Type::OrSymbol, + wallet_id: String, + reference_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # The CAIP-2 chain identifier (e.g., eip155:1 for Ethereum mainnet). + caip2:, + # The blockchain transaction hash. + transaction_hash:, + # The Privy-assigned ID for this transaction. + transaction_id:, + # An unsigned standard Ethereum transaction object. Supports EVM transaction types + # 0, 1, 2, and 4. + transaction_request:, + # The type of webhook event. + type:, + # The ID of the wallet that initiated the transaction. + wallet_id:, + # Developer-provided reference ID for transaction reconciliation, if one was + # provided. + reference_id: nil + ) + end + + sig do + override.returns( + { + caip2: String, + transaction_hash: String, + transaction_id: String, + transaction_request: Privy::UnsignedStandardEthereumTransaction, + type: + Privy::TransactionStillPendingWebhookPayload::Type::TaggedSymbol, + wallet_id: String, + reference_id: T.nilable(String) + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransactionStillPendingWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSACTION_STILL_PENDING = + T.let( + :"transaction.still_pending", + Privy::TransactionStillPendingWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransactionStillPendingWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transaction_token_address_input.rbi b/rbi/privy/models/transaction_token_address_input.rbi new file mode 100644 index 0000000..6c7238c --- /dev/null +++ b/rbi/privy/models/transaction_token_address_input.rbi @@ -0,0 +1,7 @@ +# typed: strong + +module Privy + module Models + TransactionTokenAddressInput = String + end +end diff --git a/rbi/privy/models/transfer_action_response.rbi b/rbi/privy/models/transfer_action_response.rbi new file mode 100644 index 0000000..5b4bb2b --- /dev/null +++ b/rbi/privy/models/transfer_action_response.rbi @@ -0,0 +1,232 @@ +# typed: strong + +module Privy + module Models + class TransferActionResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferActionResponse, Privy::Internal::AnyHash) + end + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :id + + # ISO 8601 timestamp of when the wallet action was created. + sig { returns(Time) } + attr_accessor :created_at + + # Recipient address. + sig { returns(String) } + attr_accessor :destination_address + + # Chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :source_chain + + # Status of a wallet action. + sig { returns(Privy::WalletActionStatus::TaggedSymbol) } + attr_accessor :status + + sig { returns(Privy::TransferActionResponse::Type::TaggedSymbol) } + attr_accessor :type + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Amount received on the destination chain. Populated immediately for exact_output + # transfers, or after fill confirmation for exact_input transfers. + sig { returns(T.nilable(String)) } + attr_reader :destination_amount + + sig { params(destination_amount: String).void } + attr_writer :destination_amount + + # Destination asset for cross-asset transfers. Omitted for same-asset transfers. + sig { returns(T.nilable(String)) } + attr_reader :destination_asset + + sig { params(destination_asset: String).void } + attr_writer :destination_asset + + # Destination chain for cross-chain transfers. Omitted for same-chain transfers. + sig { returns(T.nilable(String)) } + attr_reader :destination_chain + + sig { params(destination_chain: String).void } + attr_writer :destination_chain + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(T.nilable(Privy::FailureReason)) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + sig { returns(T.nilable(String)) } + attr_reader :source_amount + + sig { params(source_amount: String).void } + attr_writer :source_amount + + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + sig { returns(T.nilable(String)) } + attr_reader :source_asset + + sig { params(source_asset: String).void } + attr_writer :source_asset + + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + sig { returns(T.nilable(String)) } + attr_reader :source_asset_address + + sig { params(source_asset_address: String).void } + attr_writer :source_asset_address + + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + sig { returns(T.nilable(Integer)) } + attr_reader :source_asset_decimals + + sig { params(source_asset_decimals: Integer).void } + attr_writer :source_asset_decimals + + # The steps of the wallet action. Only returned if `?include=steps` is provided. + sig { returns(T.nilable(T::Array[Privy::WalletActionStep::Variants])) } + attr_reader :steps + + sig do + params( + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).void + end + attr_writer :steps + + # Response for a transfer action. + sig do + params( + id: String, + created_at: Time, + destination_address: String, + source_chain: String, + status: Privy::WalletActionStatus::OrSymbol, + type: Privy::TransferActionResponse::Type::OrSymbol, + wallet_id: String, + destination_amount: String, + destination_asset: String, + destination_chain: String, + failure_reason: Privy::FailureReason::OrHash, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # The ID of the wallet action. + id:, + # ISO 8601 timestamp of when the wallet action was created. + created_at:, + # Recipient address. + destination_address:, + # Chain name (e.g. "base", "ethereum"). + source_chain:, + # Status of a wallet action. + status:, + type:, + # The ID of the wallet involved in the action. + wallet_id:, + # Amount received on the destination chain. Populated immediately for exact_output + # transfers, or after fill confirmation for exact_input transfers. + destination_amount: nil, + # Destination asset for cross-asset transfers. Omitted for same-asset transfers. + destination_asset: nil, + # Destination chain for cross-chain transfers. Omitted for same-chain transfers. + destination_chain: nil, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason: nil, + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + source_amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + source_asset: nil, + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + source_asset_address: nil, + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + source_asset_decimals: nil, + # The steps of the wallet action. Only returned if `?include=steps` is provided. + steps: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Time, + destination_address: String, + source_chain: String, + status: Privy::WalletActionStatus::TaggedSymbol, + type: Privy::TransferActionResponse::Type::TaggedSymbol, + wallet_id: String, + destination_amount: String, + destination_asset: String, + destination_chain: String, + failure_reason: Privy::FailureReason, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer, + steps: T::Array[Privy::WalletActionStep::Variants] + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::TransferActionResponse::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = + T.let(:transfer, Privy::TransferActionResponse::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::TransferActionResponse::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transfer_farcaster_input.rbi b/rbi/privy/models/transfer_farcaster_input.rbi new file mode 100644 index 0000000..b2ca726 --- /dev/null +++ b/rbi/privy/models/transfer_farcaster_input.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class TransferFarcasterInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferFarcasterInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :farcaster_embedded_address + + sig { returns(String) } + attr_accessor :farcaster_id + + sig { returns(String) } + attr_accessor :nonce + + # Input for transferring a Farcaster account. + sig do + params( + farcaster_embedded_address: String, + farcaster_id: String, + nonce: String + ).returns(T.attached_class) + end + def self.new(farcaster_embedded_address:, farcaster_id:, nonce:) + end + + sig do + override.returns( + { + farcaster_embedded_address: String, + farcaster_id: String, + nonce: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transfer_intent_request_details.rbi b/rbi/privy/models/transfer_intent_request_details.rbi new file mode 100644 index 0000000..07a1e12 --- /dev/null +++ b/rbi/privy/models/transfer_intent_request_details.rbi @@ -0,0 +1,77 @@ +# typed: strong + +module Privy + module Models + class TransferIntentRequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferIntentRequestDetails, Privy::Internal::AnyHash) + end + + # Request body for initiating a sponsored token transfer from an embedded wallet. + sig { returns(Privy::TransferRequestBody) } + attr_reader :body + + sig { params(body: Privy::TransferRequestBody::OrHash).void } + attr_writer :body + + sig { returns(Privy::TransferIntentRequestDetails::Method::OrSymbol) } + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # Request details for a transfer intent. + sig do + params( + body: Privy::TransferRequestBody::OrHash, + method_: Privy::TransferIntentRequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # Request body for initiating a sponsored token transfer from an embedded wallet. + body:, + method_:, + url: + ) + end + + sig do + override.returns( + { + body: Privy::TransferRequestBody, + method_: Privy::TransferIntentRequestDetails::Method::OrSymbol, + url: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferIntentRequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POST = + T.let( + :POST, + Privy::TransferIntentRequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TransferIntentRequestDetails::Method::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transfer_intent_response.rbi b/rbi/privy/models/transfer_intent_response.rbi new file mode 100644 index 0000000..0a43d21 --- /dev/null +++ b/rbi/privy/models/transfer_intent_response.rbi @@ -0,0 +1,187 @@ +# typed: strong + +module Privy + module Models + class TransferIntentResponse < Privy::Models::BaseIntentResponse + OrHash = + T.type_alias do + T.any(Privy::TransferIntentResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::TransferIntentResponse::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The original transfer request that would be sent to the wallet transfer endpoint + sig { returns(Privy::TransferIntentResponse::RequestDetails) } + attr_reader :request_details + + sig do + params( + request_details: Privy::TransferIntentResponse::RequestDetails::OrHash + ).void + end + attr_writer :request_details + + # Result of transfer execution (only present if intent status is 'executed' or + # 'failed') + sig { returns(T.nilable(Privy::BaseActionResult)) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # A wallet managed by Privy's wallet infrastructure. + sig { returns(T.nilable(Privy::Wallet)) } + attr_reader :current_resource_data + + sig { params(current_resource_data: Privy::Wallet::OrHash).void } + attr_writer :current_resource_data + + # Response for a transfer intent + sig do + params( + intent_type: Privy::TransferIntentResponse::IntentType::OrSymbol, + request_details: + Privy::TransferIntentResponse::RequestDetails::OrHash, + action_result: Privy::BaseActionResult::OrHash, + current_resource_data: Privy::Wallet::OrHash + ).returns(T.attached_class) + end + def self.new( + intent_type:, + # The original transfer request that would be sent to the wallet transfer endpoint + request_details:, + # Result of transfer execution (only present if intent status is 'executed' or + # 'failed') + action_result: nil, + # A wallet managed by Privy's wallet infrastructure. + current_resource_data: nil + ) + end + + sig do + override.returns( + { + intent_type: + Privy::TransferIntentResponse::IntentType::TaggedSymbol, + request_details: Privy::TransferIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + ) + end + def to_hash + end + + module IntentType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferIntentResponse::IntentType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER = + T.let( + :TRANSFER, + Privy::TransferIntentResponse::IntentType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TransferIntentResponse::IntentType::TaggedSymbol] + ) + end + def self.values + end + end + + class RequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransferIntentResponse::RequestDetails, + Privy::Internal::AnyHash + ) + end + + # Request body for initiating a sponsored token transfer from an embedded wallet. + sig { returns(Privy::TransferRequestBody) } + attr_reader :body + + sig { params(body: Privy::TransferRequestBody::OrHash).void } + attr_writer :body + + sig do + returns( + Privy::TransferIntentResponse::RequestDetails::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # The original transfer request that would be sent to the wallet transfer endpoint + sig do + params( + body: Privy::TransferRequestBody::OrHash, + method_: + Privy::TransferIntentResponse::RequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new( + # Request body for initiating a sponsored token transfer from an embedded wallet. + body:, + method_:, + url: + ) + end + + sig do + override.returns( + { + body: Privy::TransferRequestBody, + method_: + Privy::TransferIntentResponse::RequestDetails::Method::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::TransferIntentResponse::RequestDetails::Method + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + POST = + T.let( + :POST, + Privy::TransferIntentResponse::RequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransferIntentResponse::RequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/privy/models/transfer_received_transaction_detail.rbi b/rbi/privy/models/transfer_received_transaction_detail.rbi new file mode 100644 index 0000000..da1ab5f --- /dev/null +++ b/rbi/privy/models/transfer_received_transaction_detail.rbi @@ -0,0 +1,301 @@ +# typed: strong + +module Privy + module Models + class TransferReceivedTransactionDetail < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::TransferReceivedTransactionDetail, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::TransferReceivedTransactionDetail::Asset::Variants) } + attr_accessor :asset + + sig do + returns(Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol) + end + attr_accessor :chain + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :display_values + + sig { returns(String) } + attr_accessor :raw_value + + sig { returns(Float) } + attr_accessor :raw_value_decimals + + sig { returns(String) } + attr_accessor :recipient + + sig { returns(T.nilable(String)) } + attr_accessor :recipient_privy_user_id + + sig { returns(String) } + attr_accessor :sender + + sig { returns(T.nilable(String)) } + attr_accessor :sender_privy_user_id + + sig do + returns(Privy::TransferReceivedTransactionDetail::Type::TaggedSymbol) + end + attr_accessor :type + + # Details for a received transfer transaction. + sig do + params( + asset: + T.any( + Privy::TransferReceivedTransactionDetail::Asset::OrSymbol, + String + ), + chain: Privy::TransferReceivedTransactionDetail::Chain::OrSymbol, + display_values: T::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: T.nilable(String), + sender: String, + sender_privy_user_id: T.nilable(String), + type: Privy::TransferReceivedTransactionDetail::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + asset:, + chain:, + display_values:, + raw_value:, + raw_value_decimals:, + recipient:, + recipient_privy_user_id:, + sender:, + sender_privy_user_id:, + type: + ) + end + + sig do + override.returns( + { + asset: Privy::TransferReceivedTransactionDetail::Asset::Variants, + chain: + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol, + display_values: T::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: T.nilable(String), + sender: String, + sender_privy_user_id: T.nilable(String), + type: Privy::TransferReceivedTransactionDetail::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol, + String + ) + end + + sig do + override.returns( + T::Array[Privy::TransferReceivedTransactionDetail::Asset::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferReceivedTransactionDetail::Asset) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDC = + T.let( + :usdc, + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + USDC_E = + T.let( + :"usdc.e", + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + ETH = + T.let( + :eth, + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + POL = + T.let( + :pol, + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + USDT = + T.let( + :usdt, + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + EURC = + T.let( + :eurc, + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + USDB = + T.let( + :usdb, + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + SOL = + T.let( + :sol, + Privy::TransferReceivedTransactionDetail::Asset::TaggedSymbol + ) + end + + module Chain + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferReceivedTransactionDetail::Chain) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + ARBITRUM = + T.let( + :arbitrum, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + BASE = + T.let( + :base, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + TEMPO = + T.let( + :tempo, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + LINEA = + T.let( + :linea, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + OPTIMISM = + T.let( + :optimism, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + POLYGON = + T.let( + :polygon, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + SOLANA = + T.let( + :solana, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + ZKSYNC_ERA = + T.let( + :zksync_era, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + SEPOLIA = + T.let( + :sepolia, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + ARBITRUM_SEPOLIA = + T.let( + :arbitrum_sepolia, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + BASE_SEPOLIA = + T.let( + :base_sepolia, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + LINEA_TESTNET = + T.let( + :linea_testnet, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + OPTIMISM_SEPOLIA = + T.let( + :optimism_sepolia, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + POLYGON_AMOY = + T.let( + :polygon_amoy, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + SOLANA_DEVNET = + T.let( + :solana_devnet, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + SOLANA_TESTNET = + T.let( + :solana_testnet, + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransferReceivedTransactionDetail::Chain::TaggedSymbol + ] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferReceivedTransactionDetail::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER_RECEIVED = + T.let( + :transfer_received, + Privy::TransferReceivedTransactionDetail::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::TransferReceivedTransactionDetail::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transfer_request_body.rbi b/rbi/privy/models/transfer_request_body.rbi new file mode 100644 index 0000000..dabd43e --- /dev/null +++ b/rbi/privy/models/transfer_request_body.rbi @@ -0,0 +1,79 @@ +# typed: strong + +module Privy + module Models + class TransferRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferRequestBody, Privy::Internal::AnyHash) + end + + # The destination address for a token transfer. Optionally specify a different + # asset or chain for cross-asset or cross-chain transfers. + sig { returns(Privy::TokenTransferDestination) } + attr_reader :destination + + sig { params(destination: Privy::TokenTransferDestination::OrHash).void } + attr_writer :destination + + # The source asset, amount, and chain for a token transfer. Specify either `asset` + # (named) or `asset_address` (custom), not both. + sig { returns(Privy::TokenTransferSource::Variants) } + attr_accessor :source + + # Whether the amount refers to the input token or output token. + sig { returns(T.nilable(Privy::AmountType::TaggedSymbol)) } + attr_reader :amount_type + + sig { params(amount_type: Privy::AmountType::OrSymbol).void } + attr_writer :amount_type + + # Maximum allowed slippage in basis points (1 bps = 0.01%). + sig { returns(T.nilable(Integer)) } + attr_reader :slippage_bps + + sig { params(slippage_bps: Integer).void } + attr_writer :slippage_bps + + # Request body for initiating a sponsored token transfer from an embedded wallet. + sig do + params( + destination: Privy::TokenTransferDestination::OrHash, + source: + T.any( + Privy::NamedTokenTransferSource::OrHash, + Privy::CustomTokenTransferSource::OrHash + ), + amount_type: Privy::AmountType::OrSymbol, + slippage_bps: Integer + ).returns(T.attached_class) + end + def self.new( + # The destination address for a token transfer. Optionally specify a different + # asset or chain for cross-asset or cross-chain transfers. + destination:, + # The source asset, amount, and chain for a token transfer. Specify either `asset` + # (named) or `asset_address` (custom), not both. + source:, + # Whether the amount refers to the input token or output token. + amount_type: nil, + # Maximum allowed slippage in basis points (1 bps = 0.01%). + slippage_bps: nil + ) + end + + sig do + override.returns( + { + destination: Privy::TokenTransferDestination, + source: Privy::TokenTransferSource::Variants, + amount_type: Privy::AmountType::TaggedSymbol, + slippage_bps: Integer + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transfer_sent_transaction_detail.rbi b/rbi/privy/models/transfer_sent_transaction_detail.rbi new file mode 100644 index 0000000..f44130b --- /dev/null +++ b/rbi/privy/models/transfer_sent_transaction_detail.rbi @@ -0,0 +1,280 @@ +# typed: strong + +module Privy + module Models + class TransferSentTransactionDetail < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferSentTransactionDetail, Privy::Internal::AnyHash) + end + + sig { returns(Privy::TransferSentTransactionDetail::Asset::Variants) } + attr_accessor :asset + + sig { returns(Privy::TransferSentTransactionDetail::Chain::TaggedSymbol) } + attr_accessor :chain + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :display_values + + sig { returns(String) } + attr_accessor :raw_value + + sig { returns(Float) } + attr_accessor :raw_value_decimals + + sig { returns(String) } + attr_accessor :recipient + + sig { returns(T.nilable(String)) } + attr_accessor :recipient_privy_user_id + + sig { returns(String) } + attr_accessor :sender + + sig { returns(T.nilable(String)) } + attr_accessor :sender_privy_user_id + + sig { returns(Privy::TransferSentTransactionDetail::Type::TaggedSymbol) } + attr_accessor :type + + # Details for a sent transfer transaction. + sig do + params( + asset: + T.any( + Privy::TransferSentTransactionDetail::Asset::OrSymbol, + String + ), + chain: Privy::TransferSentTransactionDetail::Chain::OrSymbol, + display_values: T::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: T.nilable(String), + sender: String, + sender_privy_user_id: T.nilable(String), + type: Privy::TransferSentTransactionDetail::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + asset:, + chain:, + display_values:, + raw_value:, + raw_value_decimals:, + recipient:, + recipient_privy_user_id:, + sender:, + sender_privy_user_id:, + type: + ) + end + + sig do + override.returns( + { + asset: Privy::TransferSentTransactionDetail::Asset::Variants, + chain: Privy::TransferSentTransactionDetail::Chain::TaggedSymbol, + display_values: T::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: T.nilable(String), + sender: String, + sender_privy_user_id: T.nilable(String), + type: Privy::TransferSentTransactionDetail::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::TransferSentTransactionDetail::Asset::TaggedSymbol, + String + ) + end + + sig do + override.returns( + T::Array[Privy::TransferSentTransactionDetail::Asset::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferSentTransactionDetail::Asset) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDC = + T.let( + :usdc, + Privy::TransferSentTransactionDetail::Asset::TaggedSymbol + ) + USDC_E = + T.let( + :"usdc.e", + Privy::TransferSentTransactionDetail::Asset::TaggedSymbol + ) + ETH = + T.let(:eth, Privy::TransferSentTransactionDetail::Asset::TaggedSymbol) + POL = + T.let(:pol, Privy::TransferSentTransactionDetail::Asset::TaggedSymbol) + USDT = + T.let( + :usdt, + Privy::TransferSentTransactionDetail::Asset::TaggedSymbol + ) + EURC = + T.let( + :eurc, + Privy::TransferSentTransactionDetail::Asset::TaggedSymbol + ) + USDB = + T.let( + :usdb, + Privy::TransferSentTransactionDetail::Asset::TaggedSymbol + ) + SOL = + T.let(:sol, Privy::TransferSentTransactionDetail::Asset::TaggedSymbol) + end + + module Chain + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferSentTransactionDetail::Chain) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + ARBITRUM = + T.let( + :arbitrum, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + BASE = + T.let( + :base, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + TEMPO = + T.let( + :tempo, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + LINEA = + T.let( + :linea, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + OPTIMISM = + T.let( + :optimism, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + POLYGON = + T.let( + :polygon, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + SOLANA = + T.let( + :solana, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + ZKSYNC_ERA = + T.let( + :zksync_era, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + SEPOLIA = + T.let( + :sepolia, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + ARBITRUM_SEPOLIA = + T.let( + :arbitrum_sepolia, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + BASE_SEPOLIA = + T.let( + :base_sepolia, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + LINEA_TESTNET = + T.let( + :linea_testnet, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + OPTIMISM_SEPOLIA = + T.let( + :optimism_sepolia, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + POLYGON_AMOY = + T.let( + :polygon_amoy, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + SOLANA_DEVNET = + T.let( + :solana_devnet, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + SOLANA_TESTNET = + T.let( + :solana_testnet, + Privy::TransferSentTransactionDetail::Chain::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TransferSentTransactionDetail::Chain::TaggedSymbol] + ) + end + def self.values + end + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TransferSentTransactionDetail::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER_SENT = + T.let( + :transfer_sent, + Privy::TransferSentTransactionDetail::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TransferSentTransactionDetail::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/transfer_siwe_input.rbi b/rbi/privy/models/transfer_siwe_input.rbi new file mode 100644 index 0000000..d7e6945 --- /dev/null +++ b/rbi/privy/models/transfer_siwe_input.rbi @@ -0,0 +1,60 @@ +# typed: strong + +module Privy + module Models + class TransferSiweInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferSiweInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :nonce + + sig { returns(T.nilable(String)) } + attr_accessor :chain_id + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # Input for transferring a SIWE account. + sig do + params( + address: String, + nonce: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + address:, + nonce:, + chain_id: nil, + connector_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + address: String, + nonce: String, + chain_id: T.nilable(String), + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transfer_siws_input.rbi b/rbi/privy/models/transfer_siws_input.rbi new file mode 100644 index 0000000..161c337 --- /dev/null +++ b/rbi/privy/models/transfer_siws_input.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class TransferSiwsInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferSiwsInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(String) } + attr_accessor :nonce + + sig { returns(T.nilable(String)) } + attr_accessor :connector_type + + sig { returns(T.nilable(String)) } + attr_accessor :wallet_client_type + + # Input for transferring a SIWS account. + sig do + params( + address: String, + nonce: String, + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + address:, + nonce:, + connector_type: nil, + wallet_client_type: nil + ) + end + + sig do + override.returns( + { + address: String, + nonce: String, + connector_type: T.nilable(String), + wallet_client_type: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/transfer_telegram_input.rbi b/rbi/privy/models/transfer_telegram_input.rbi new file mode 100644 index 0000000..8906c01 --- /dev/null +++ b/rbi/privy/models/transfer_telegram_input.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class TransferTelegramInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TransferTelegramInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :nonce + + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + sig { returns(T.nilable(Privy::TelegramAuthResult)) } + attr_reader :telegram_auth_result + + sig do + params(telegram_auth_result: Privy::TelegramAuthResult::OrHash).void + end + attr_writer :telegram_auth_result + + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + sig { returns(T.nilable(Privy::TelegramWebAppData)) } + attr_reader :telegram_web_app_data + + sig do + params(telegram_web_app_data: Privy::TelegramWebAppData::OrHash).void + end + attr_writer :telegram_web_app_data + + # Input for transferring a Telegram account. + sig do + params( + nonce: String, + telegram_auth_result: Privy::TelegramAuthResult::OrHash, + telegram_web_app_data: Privy::TelegramWebAppData::OrHash + ).returns(T.attached_class) + end + def self.new( + nonce:, + # Auth result object returned by Telegram when a user authenticates using the + # login widget. + telegram_auth_result: nil, + # Auth result object returned by Telegram when a user authenticates using a mini + # app. + telegram_web_app_data: nil + ) + end + + sig do + override.returns( + { + nonce: String, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/tron_calldata_condition.rbi b/rbi/privy/models/tron_calldata_condition.rbi new file mode 100644 index 0000000..21c5c7d --- /dev/null +++ b/rbi/privy/models/tron_calldata_condition.rbi @@ -0,0 +1,92 @@ +# typed: strong + +module Privy + module Models + class TronCalldataCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TronCalldataCondition, Privy::Internal::AnyHash) + end + + # A Solidity ABI definition for decoding smart contract calldata. + sig { returns(T::Array[Privy::AbiSchemaItem]) } + attr_accessor :abi + + sig { returns(String) } + attr_accessor :field + + sig { returns(Privy::TronCalldataCondition::FieldSource::OrSymbol) } + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # Decoded calldata from a TRON TriggerSmartContract interaction. + sig do + params( + abi: T::Array[Privy::AbiSchemaItem::OrHash], + field: String, + field_source: Privy::TronCalldataCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + # A Solidity ABI definition for decoding smart contract calldata. + abi:, + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + abi: T::Array[Privy::AbiSchemaItem], + field: String, + field_source: Privy::TronCalldataCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TronCalldataCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRON_TRIGGER_SMART_CONTRACT_DATA = + T.let( + :tron_trigger_smart_contract_data, + Privy::TronCalldataCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TronCalldataCondition::FieldSource::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/tron_transaction_condition.rbi b/rbi/privy/models/tron_transaction_condition.rbi new file mode 100644 index 0000000..9228528 --- /dev/null +++ b/rbi/privy/models/tron_transaction_condition.rbi @@ -0,0 +1,136 @@ +# typed: strong + +module Privy + module Models + class TronTransactionCondition < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TronTransactionCondition, Privy::Internal::AnyHash) + end + + # Supported TRON transaction fields in format "TransactionType.field_name" + sig { returns(Privy::TronTransactionCondition::Field::OrSymbol) } + attr_accessor :field + + sig { returns(Privy::TronTransactionCondition::FieldSource::OrSymbol) } + attr_accessor :field_source + + # Operator to use for policy conditions. + sig { returns(Privy::ConditionOperator::OrSymbol) } + attr_accessor :operator + + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + sig { returns(Privy::ConditionValue::Variants) } + attr_accessor :value + + # TRON transaction fields for TransferContract and TriggerSmartContract + # transaction types. + sig do + params( + field: Privy::TronTransactionCondition::Field::OrSymbol, + field_source: Privy::TronTransactionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + ).returns(T.attached_class) + end + def self.new( + # Supported TRON transaction fields in format "TransactionType.field_name" + field:, + field_source:, + # Operator to use for policy conditions. + operator:, + # Value to compare against in a policy condition. Can be a single string or an + # array of strings. + value: + ) + end + + sig do + override.returns( + { + field: Privy::TronTransactionCondition::Field::OrSymbol, + field_source: + Privy::TronTransactionCondition::FieldSource::OrSymbol, + operator: Privy::ConditionOperator::OrSymbol, + value: Privy::ConditionValue::Variants + } + ) + end + def to_hash + end + + # Supported TRON transaction fields in format "TransactionType.field_name" + module Field + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::TronTransactionCondition::Field) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRANSFER_CONTRACT_TO_ADDRESS = + T.let( + :"TransferContract.to_address", + Privy::TronTransactionCondition::Field::TaggedSymbol + ) + TRANSFER_CONTRACT_AMOUNT = + T.let( + :"TransferContract.amount", + Privy::TronTransactionCondition::Field::TaggedSymbol + ) + TRIGGER_SMART_CONTRACT_CONTRACT_ADDRESS = + T.let( + :"TriggerSmartContract.contract_address", + Privy::TronTransactionCondition::Field::TaggedSymbol + ) + TRIGGER_SMART_CONTRACT_CALL_VALUE = + T.let( + :"TriggerSmartContract.call_value", + Privy::TronTransactionCondition::Field::TaggedSymbol + ) + TRIGGER_SMART_CONTRACT_TOKEN_ID = + T.let( + :"TriggerSmartContract.token_id", + Privy::TronTransactionCondition::Field::TaggedSymbol + ) + TRIGGER_SMART_CONTRACT_CALL_TOKEN_VALUE = + T.let( + :"TriggerSmartContract.call_token_value", + Privy::TronTransactionCondition::Field::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TronTransactionCondition::Field::TaggedSymbol] + ) + end + def self.values + end + end + + module FieldSource + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::TronTransactionCondition::FieldSource) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + TRON_TRANSACTION = + T.let( + :tron_transaction, + Privy::TronTransactionCondition::FieldSource::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::TronTransactionCondition::FieldSource::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/typed_data_domain_input_params.rbi b/rbi/privy/models/typed_data_domain_input_params.rbi new file mode 100644 index 0000000..2442758 --- /dev/null +++ b/rbi/privy/models/typed_data_domain_input_params.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + TypedDataDomainInputParams = + T.let( + Privy::Internal::Type::HashOf[Privy::Internal::Type::Unknown], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/typed_data_type_field_input.rbi b/rbi/privy/models/typed_data_type_field_input.rbi new file mode 100644 index 0000000..1b313d0 --- /dev/null +++ b/rbi/privy/models/typed_data_type_field_input.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class TypedDataTypeFieldInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::TypedDataTypeFieldInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :name + + sig { returns(String) } + attr_accessor :type + + # A single field definition in an EIP-712 typed data type. + sig { params(name: String, type: String).returns(T.attached_class) } + def self.new(name:, type:) + end + + sig { override.returns({ name: String, type: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/typed_data_types_input_params.rbi b/rbi/privy/models/typed_data_types_input_params.rbi new file mode 100644 index 0000000..3ca2241 --- /dev/null +++ b/rbi/privy/models/typed_data_types_input_params.rbi @@ -0,0 +1,13 @@ +# typed: strong + +module Privy + module Models + TypedDataTypesInputParams = + T.let( + Privy::Internal::Type::HashOf[ + Privy::Internal::Type::ArrayOf[Privy::TypedDataTypeFieldInput] + ], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/unlink_passkey_input.rbi b/rbi/privy/models/unlink_passkey_input.rbi new file mode 100644 index 0000000..5f18f33 --- /dev/null +++ b/rbi/privy/models/unlink_passkey_input.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + class UnlinkPasskeyInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UnlinkPasskeyInput, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :credential_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :remove_as_mfa + + sig { params(remove_as_mfa: T::Boolean).void } + attr_writer :remove_as_mfa + + # Input for unlinking a passkey credential. + sig do + params(credential_id: String, remove_as_mfa: T::Boolean).returns( + T.attached_class + ) + end + def self.new(credential_id:, remove_as_mfa: nil) + end + + sig do + override.returns({ credential_id: String, remove_as_mfa: T::Boolean }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/unsafe_unwrap_webhook_event.rbi b/rbi/privy/models/unsafe_unwrap_webhook_event.rbi new file mode 100644 index 0000000..79ae39f --- /dev/null +++ b/rbi/privy/models/unsafe_unwrap_webhook_event.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Privy + module Models + # Payload for the intent.authorized webhook event. + module UnsafeUnwrapWebhookEvent + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::IntentAuthorizedWebhookPayload, + Privy::IntentCreatedWebhookPayload, + Privy::IntentExecutedWebhookPayload, + Privy::IntentFailedWebhookPayload, + Privy::IntentRejectedWebhookPayload, + Privy::MfaDisabledWebhookPayload, + Privy::MfaEnabledWebhookPayload, + Privy::TransactionBroadcastedWebhookPayload, + Privy::TransactionConfirmedWebhookPayload, + Privy::TransactionExecutionRevertedWebhookPayload, + Privy::TransactionFailedWebhookPayload, + Privy::TransactionProviderErrorWebhookPayload, + Privy::TransactionReplacedWebhookPayload, + Privy::TransactionStillPendingWebhookPayload, + Privy::UserAuthenticatedWebhookPayload, + Privy::UserCreatedWebhookPayload, + Privy::UserLinkedAccountWebhookPayload, + Privy::UserTransferredAccountWebhookPayload, + Privy::UserUnlinkedAccountWebhookPayload, + Privy::UserUpdatedAccountWebhookPayload, + Privy::UserWalletCreatedWebhookPayload, + Privy::UserOperationCompletedWebhookPayload, + Privy::FundsDepositedWebhookPayload, + Privy::FundsWithdrawnWebhookPayload, + Privy::PrivateKeyExportWebhookPayload, + Privy::WalletRecoveredWebhookPayload, + Privy::WalletRecoverySetupWebhookPayload, + Privy::WalletActionEarnDepositCreatedWebhookPayload, + Privy::WalletActionEarnDepositFailedWebhookPayload, + Privy::WalletActionEarnDepositRejectedWebhookPayload, + Privy::WalletActionEarnDepositSucceededWebhookPayload, + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload, + Privy::WalletActionEarnWithdrawCreatedWebhookPayload, + Privy::WalletActionEarnWithdrawFailedWebhookPayload, + Privy::WalletActionEarnWithdrawRejectedWebhookPayload, + Privy::WalletActionEarnWithdrawSucceededWebhookPayload, + Privy::WalletActionSwapCreatedWebhookPayload, + Privy::WalletActionSwapFailedWebhookPayload, + Privy::WalletActionSwapRejectedWebhookPayload, + Privy::WalletActionSwapSucceededWebhookPayload, + Privy::WalletActionTransferCreatedWebhookPayload, + Privy::WalletActionTransferFailedWebhookPayload, + Privy::WalletActionTransferRejectedWebhookPayload, + Privy::WalletActionTransferSucceededWebhookPayload, + Privy::YieldClaimConfirmedWebhookPayload, + Privy::YieldDepositConfirmedWebhookPayload, + Privy::YieldWithdrawConfirmedWebhookPayload + ) + end + + sig do + override.returns(T::Array[Privy::UnsafeUnwrapWebhookEvent::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/unsigned_ethereum_transaction.rbi b/rbi/privy/models/unsigned_ethereum_transaction.rbi new file mode 100644 index 0000000..2d32e1d --- /dev/null +++ b/rbi/privy/models/unsigned_ethereum_transaction.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Privy + module Models + # An unsigned Ethereum transaction object. Supports standard EVM transaction types + # (0, 1, 2, 4) and Tempo transactions (type 118). + module UnsignedEthereumTransaction + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::UnsignedStandardEthereumTransaction, + Privy::UnsignedTempoTransaction + ) + end + + sig do + override.returns(T::Array[Privy::UnsignedEthereumTransaction::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/unsigned_standard_ethereum_transaction.rbi b/rbi/privy/models/unsigned_standard_ethereum_transaction.rbi new file mode 100644 index 0000000..1af34ea --- /dev/null +++ b/rbi/privy/models/unsigned_standard_ethereum_transaction.rbi @@ -0,0 +1,229 @@ +# typed: strong + +module Privy + module Models + class UnsignedStandardEthereumTransaction < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UnsignedStandardEthereumTransaction, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(T::Array[Privy::EthereumSign7702Authorization])) } + attr_reader :authorization_list + + sig do + params( + authorization_list: + T::Array[Privy::EthereumSign7702Authorization::OrHash] + ).void + end + attr_writer :authorization_list + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :chain_id + + sig { params(chain_id: Privy::Quantity::Variants).void } + attr_writer :chain_id + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :data + + sig { params(data: String).void } + attr_writer :data + + sig { returns(T.nilable(String)) } + attr_reader :from + + sig { params(from: String).void } + attr_writer :from + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :gas_limit + + sig { params(gas_limit: Privy::Quantity::Variants).void } + attr_writer :gas_limit + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :gas_price + + sig { params(gas_price: Privy::Quantity::Variants).void } + attr_writer :gas_price + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :max_fee_per_gas + + sig { params(max_fee_per_gas: Privy::Quantity::Variants).void } + attr_writer :max_fee_per_gas + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :max_priority_fee_per_gas + + sig { params(max_priority_fee_per_gas: Privy::Quantity::Variants).void } + attr_writer :max_priority_fee_per_gas + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :nonce + + sig { params(nonce: Privy::Quantity::Variants).void } + attr_writer :nonce + + sig { returns(T.nilable(String)) } + attr_reader :to + + sig { params(to: String).void } + attr_writer :to + + sig do + returns( + T.nilable(Privy::UnsignedStandardEthereumTransaction::Type::OrFloat) + ) + end + attr_reader :type + + sig do + params( + type: Privy::UnsignedStandardEthereumTransaction::Type::OrFloat + ).void + end + attr_writer :type + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :value + + sig { params(value: Privy::Quantity::Variants).void } + attr_writer :value + + # An unsigned standard Ethereum transaction object. Supports EVM transaction types + # 0, 1, 2, and 4. + sig do + params( + authorization_list: + T::Array[Privy::EthereumSign7702Authorization::OrHash], + chain_id: Privy::Quantity::Variants, + data: String, + from: String, + gas_limit: Privy::Quantity::Variants, + gas_price: Privy::Quantity::Variants, + max_fee_per_gas: Privy::Quantity::Variants, + max_priority_fee_per_gas: Privy::Quantity::Variants, + nonce: Privy::Quantity::Variants, + to: String, + type: Privy::UnsignedStandardEthereumTransaction::Type::OrFloat, + value: Privy::Quantity::Variants + ).returns(T.attached_class) + end + def self.new( + authorization_list: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + chain_id: nil, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + data: nil, + from: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + gas_limit: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + gas_price: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + max_fee_per_gas: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + max_priority_fee_per_gas: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + nonce: nil, + to: nil, + type: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + value: nil + ) + end + + sig do + override.returns( + { + authorization_list: T::Array[Privy::EthereumSign7702Authorization], + chain_id: Privy::Quantity::Variants, + data: String, + from: String, + gas_limit: Privy::Quantity::Variants, + gas_price: Privy::Quantity::Variants, + max_fee_per_gas: Privy::Quantity::Variants, + max_priority_fee_per_gas: Privy::Quantity::Variants, + nonce: Privy::Quantity::Variants, + to: String, + type: Privy::UnsignedStandardEthereumTransaction::Type::OrFloat, + value: Privy::Quantity::Variants + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedFloat = + T.type_alias do + T.all(Float, Privy::UnsignedStandardEthereumTransaction::Type) + end + OrFloat = T.type_alias { Float } + + TYPE_0 = + T.let( + 0, + Privy::UnsignedStandardEthereumTransaction::Type::TaggedFloat + ) + TYPE_1 = + T.let( + 1, + Privy::UnsignedStandardEthereumTransaction::Type::TaggedFloat + ) + TYPE_2 = + T.let( + 2, + Privy::UnsignedStandardEthereumTransaction::Type::TaggedFloat + ) + TYPE_4 = + T.let( + 4, + Privy::UnsignedStandardEthereumTransaction::Type::TaggedFloat + ) + + sig do + override.returns( + T::Array[ + Privy::UnsignedStandardEthereumTransaction::Type::TaggedFloat + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/unsigned_tempo_transaction.rbi b/rbi/privy/models/unsigned_tempo_transaction.rbi new file mode 100644 index 0000000..7dc7e64 --- /dev/null +++ b/rbi/privy/models/unsigned_tempo_transaction.rbi @@ -0,0 +1,258 @@ +# typed: strong + +module Privy + module Models + class UnsignedTempoTransaction < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UnsignedTempoTransaction, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[Privy::TempoCall]) } + attr_accessor :calls + + sig { returns(Privy::UnsignedTempoTransaction::Type::OrFloat) } + attr_accessor :type + + sig { returns(T.nilable(T::Array[Privy::TempoAaAuthorization])) } + attr_reader :aa_authorization_list + + sig do + params( + aa_authorization_list: T::Array[Privy::TempoAaAuthorization::OrHash] + ).void + end + attr_writer :aa_authorization_list + + sig do + returns( + T.nilable(T::Array[Privy::UnsignedTempoTransaction::AccessList]) + ) + end + attr_reader :access_list + + sig do + params( + access_list: + T::Array[Privy::UnsignedTempoTransaction::AccessList::OrHash] + ).void + end + attr_writer :access_list + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :chain_id + + sig { params(chain_id: Privy::Quantity::Variants).void } + attr_writer :chain_id + + # A fee payer signature for sponsored Tempo transactions (secp256k1 only). + sig { returns(T.nilable(Privy::TempoFeePayerSignature)) } + attr_reader :fee_payer_signature + + sig do + params(fee_payer_signature: Privy::TempoFeePayerSignature::OrHash).void + end + attr_writer :fee_payer_signature + + sig { returns(T.nilable(String)) } + attr_reader :fee_token + + sig { params(fee_token: String).void } + attr_writer :fee_token + + sig { returns(T.nilable(String)) } + attr_reader :from + + sig { params(from: String).void } + attr_writer :from + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :gas_limit + + sig { params(gas_limit: Privy::Quantity::Variants).void } + attr_writer :gas_limit + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :max_fee_per_gas + + sig { params(max_fee_per_gas: Privy::Quantity::Variants).void } + attr_writer :max_fee_per_gas + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :max_priority_fee_per_gas + + sig { params(max_priority_fee_per_gas: Privy::Quantity::Variants).void } + attr_writer :max_priority_fee_per_gas + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :nonce + + sig { params(nonce: Privy::Quantity::Variants).void } + attr_writer :nonce + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :nonce_key + + sig { params(nonce_key: Privy::Quantity::Variants).void } + attr_writer :nonce_key + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :valid_after + + sig { params(valid_after: Privy::Quantity::Variants).void } + attr_writer :valid_after + + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + sig { returns(T.nilable(Privy::Quantity::Variants)) } + attr_reader :valid_before + + sig { params(valid_before: Privy::Quantity::Variants).void } + attr_writer :valid_before + + # An unsigned Tempo transaction (type 118) with batched calls. + sig do + params( + calls: T::Array[Privy::TempoCall::OrHash], + type: Privy::UnsignedTempoTransaction::Type::OrFloat, + aa_authorization_list: T::Array[Privy::TempoAaAuthorization::OrHash], + access_list: + T::Array[Privy::UnsignedTempoTransaction::AccessList::OrHash], + chain_id: Privy::Quantity::Variants, + fee_payer_signature: Privy::TempoFeePayerSignature::OrHash, + fee_token: String, + from: String, + gas_limit: Privy::Quantity::Variants, + max_fee_per_gas: Privy::Quantity::Variants, + max_priority_fee_per_gas: Privy::Quantity::Variants, + nonce: Privy::Quantity::Variants, + nonce_key: Privy::Quantity::Variants, + valid_after: Privy::Quantity::Variants, + valid_before: Privy::Quantity::Variants + ).returns(T.attached_class) + end + def self.new( + calls:, + type:, + aa_authorization_list: nil, + access_list: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + chain_id: nil, + # A fee payer signature for sponsored Tempo transactions (secp256k1 only). + fee_payer_signature: nil, + fee_token: nil, + from: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + gas_limit: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + max_fee_per_gas: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + max_priority_fee_per_gas: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + nonce: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + nonce_key: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + valid_after: nil, + # A quantity value that can be either a hex string starting with '0x' or a + # non-negative integer. + valid_before: nil + ) + end + + sig do + override.returns( + { + calls: T::Array[Privy::TempoCall], + type: Privy::UnsignedTempoTransaction::Type::OrFloat, + aa_authorization_list: T::Array[Privy::TempoAaAuthorization], + access_list: T::Array[Privy::UnsignedTempoTransaction::AccessList], + chain_id: Privy::Quantity::Variants, + fee_payer_signature: Privy::TempoFeePayerSignature, + fee_token: String, + from: String, + gas_limit: Privy::Quantity::Variants, + max_fee_per_gas: Privy::Quantity::Variants, + max_priority_fee_per_gas: Privy::Quantity::Variants, + nonce: Privy::Quantity::Variants, + nonce_key: Privy::Quantity::Variants, + valid_after: Privy::Quantity::Variants, + valid_before: Privy::Quantity::Variants + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedFloat = + T.type_alias { T.all(Float, Privy::UnsignedTempoTransaction::Type) } + OrFloat = T.type_alias { Float } + + TYPE_118 = + T.let(118, Privy::UnsignedTempoTransaction::Type::TaggedFloat) + + sig do + override.returns( + T::Array[Privy::UnsignedTempoTransaction::Type::TaggedFloat] + ) + end + def self.values + end + end + + class AccessList < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UnsignedTempoTransaction::AccessList, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(T::Array[String]) } + attr_accessor :storage_keys + + sig do + params(address: String, storage_keys: T::Array[String]).returns( + T.attached_class + ) + end + def self.new(address:, storage_keys:) + end + + sig do + override.returns({ address: String, storage_keys: T::Array[String] }) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/update_account_from_wallet_ids_input.rbi b/rbi/privy/models/update_account_from_wallet_ids_input.rbi new file mode 100644 index 0000000..b4b1e18 --- /dev/null +++ b/rbi/privy/models/update_account_from_wallet_ids_input.rbi @@ -0,0 +1,47 @@ +# typed: strong + +module Privy + module Models + class UpdateAccountFromWalletIDsInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UpdateAccountFromWalletIDsInput, + Privy::Internal::AnyHash + ) + end + + # IDs for wallets to include in this account. + sig { returns(T::Array[String]) } + attr_accessor :wallet_ids + + # An optional display name for the account. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # Input for updating a digital asset account by adding existing wallets with a + # `wallet_ids` parameter. + sig do + params(wallet_ids: T::Array[String], display_name: String).returns( + T.attached_class + ) + end + def self.new( + # IDs for wallets to include in this account. + wallet_ids:, + # An optional display name for the account. + display_name: nil + ) + end + + sig do + override.returns({ wallet_ids: T::Array[String], display_name: String }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/update_account_from_wallets_configuration_input.rbi b/rbi/privy/models/update_account_from_wallets_configuration_input.rbi new file mode 100644 index 0000000..cb4982b --- /dev/null +++ b/rbi/privy/models/update_account_from_wallets_configuration_input.rbi @@ -0,0 +1,65 @@ +# typed: strong + +module Privy + module Models + class UpdateAccountFromWalletsConfigurationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UpdateAccountFromWalletsConfigurationInput, + Privy::Internal::AnyHash + ) + end + + # An optional display name for the account. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # Configuration for the wallets on this account. + sig do + returns(T.nilable(T::Array[Privy::AccountWalletConfigurationItem])) + end + attr_reader :wallets_configuration + + sig do + params( + wallets_configuration: + T::Array[Privy::AccountWalletConfigurationItem::OrHash] + ).void + end + attr_writer :wallets_configuration + + # Input for updating a digital asset account with a `wallets_configuration` + # specification. + sig do + params( + display_name: String, + wallets_configuration: + T::Array[Privy::AccountWalletConfigurationItem::OrHash] + ).returns(T.attached_class) + end + def self.new( + # An optional display name for the account. + display_name: nil, + # Configuration for the wallets on this account. + wallets_configuration: nil + ) + end + + sig do + override.returns( + { + display_name: String, + wallets_configuration: + T::Array[Privy::AccountWalletConfigurationItem] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/update_account_input.rbi b/rbi/privy/models/update_account_input.rbi new file mode 100644 index 0000000..0f564f5 --- /dev/null +++ b/rbi/privy/models/update_account_input.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # Input for updating a digital asset account. + module UpdateAccountInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::UpdateAccountFromWalletsConfigurationInput, + Privy::UpdateAccountFromWalletIDsInput + ) + end + + sig { override.returns(T::Array[Privy::UpdateAccountInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/update_condition_set_request_body.rbi b/rbi/privy/models/update_condition_set_request_body.rbi new file mode 100644 index 0000000..925ac6d --- /dev/null +++ b/rbi/privy/models/update_condition_set_request_body.rbi @@ -0,0 +1,75 @@ +# typed: strong + +module Privy + module Models + class UpdateConditionSetRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UpdateConditionSetRequestBody, Privy::Internal::AnyHash) + end + + # Name to assign to condition set. + sig { returns(T.nilable(String)) } + attr_reader :name + + sig { params(name: String).void } + attr_writer :name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # Request body for updating a condition set. At least one field must be provided. + # `owner` and `owner_id` are mutually exclusive. + sig do + params( + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String) + ).returns(T.attached_class) + end + def self.new( + # Name to assign to condition set. + name: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil + ) + end + + sig do + override.returns( + { + name: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/update_organization_secret_signing_key_input.rbi b/rbi/privy/models/update_organization_secret_signing_key_input.rbi new file mode 100644 index 0000000..30909ea --- /dev/null +++ b/rbi/privy/models/update_organization_secret_signing_key_input.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class UpdateOrganizationSecretSigningKeyInput < Privy::Models::OrganizationSecretIDInput + OrHash = + T.type_alias do + T.any( + Privy::UpdateOrganizationSecretSigningKeyInput, + Privy::Internal::AnyHash + ) + end + + # P-256 public key in PEM format, or null to clear the configured signing key. + sig { returns(T.nilable(String)) } + attr_accessor :signing_public_key + + # Request body for updating the signing public key on an organization secret. + sig do + params(signing_public_key: T.nilable(String)).returns(T.attached_class) + end + def self.new( + # P-256 public key in PEM format, or null to clear the configured signing key. + signing_public_key: + ) + end + + sig { override.returns({ signing_public_key: T.nilable(String) }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user.rbi b/rbi/privy/models/user.rbi new file mode 100644 index 0000000..c9fe580 --- /dev/null +++ b/rbi/privy/models/user.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module Privy + module Models + class User < Privy::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Privy::User, Privy::Internal::AnyHash) } + + sig { returns(String) } + attr_accessor :id + + # Unix timestamp of when the user was created in seconds. + sig { returns(Float) } + attr_accessor :created_at + + # Indicates if the user has accepted the terms of service. + sig { returns(T::Boolean) } + attr_accessor :has_accepted_terms + + # Indicates if the user is a guest account user. + sig { returns(T::Boolean) } + attr_accessor :is_guest + + sig { returns(T::Array[Privy::LinkedAccount::Variants]) } + attr_accessor :linked_accounts + + sig { returns(T::Array[Privy::LinkedMfaMethod::Variants]) } + attr_accessor :mfa_methods + + # Custom metadata associated with the user. + sig do + returns(T.nilable(T::Hash[Symbol, Privy::CustomMetadataItem::Variants])) + end + attr_reader :custom_metadata + + sig do + params( + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants] + ).void + end + attr_writer :custom_metadata + + # A Privy user object. + sig do + params( + id: String, + created_at: Float, + has_accepted_terms: T::Boolean, + is_guest: T::Boolean, + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountEmail::OrHash, + Privy::LinkedAccountPhone::OrHash, + Privy::LinkedAccountEthereum::OrHash, + Privy::LinkedAccountSolana::OrHash, + Privy::LinkedAccountSmartWallet::OrHash, + Privy::LinkedAccountEthereumEmbeddedWallet::OrHash, + Privy::LinkedAccountSolanaEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::OrHash, + Privy::LinkedAccountCurveSigningEmbeddedWallet::OrHash, + Privy::LinkedAccountGoogleOAuth::OrHash, + Privy::LinkedAccountTwitterOAuth::OrHash, + Privy::LinkedAccountDiscordOAuth::OrHash, + Privy::LinkedAccountGitHubOAuth::OrHash, + Privy::LinkedAccountSpotifyOAuth::OrHash, + Privy::LinkedAccountInstagramOAuth::OrHash, + Privy::LinkedAccountTiktokOAuth::OrHash, + Privy::LinkedAccountLineOAuth::OrHash, + Privy::LinkedAccountTwitchOAuth::OrHash, + Privy::LinkedAccountLinkedInOAuth::OrHash, + Privy::LinkedAccountAppleOAuth::OrHash, + Privy::LinkedAccountCustomOAuth::OrHash, + Privy::LinkedAccountCustomJwt::OrHash, + Privy::LinkedAccountFarcaster::OrHash, + Privy::LinkedAccountPasskey::OrHash, + Privy::LinkedAccountTelegram::OrHash, + Privy::LinkedAccountCrossApp::OrHash, + Privy::LinkedAccountAuthorizationKey::OrHash + ) + ], + mfa_methods: + T::Array[ + T.any( + Privy::SMSMfaMethod::OrHash, + Privy::TotpMfaMethod::OrHash, + Privy::PasskeyMfaMethod::OrHash + ) + ], + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants] + ).returns(T.attached_class) + end + def self.new( + id:, + # Unix timestamp of when the user was created in seconds. + created_at:, + # Indicates if the user has accepted the terms of service. + has_accepted_terms:, + # Indicates if the user is a guest account user. + is_guest:, + linked_accounts:, + mfa_methods:, + # Custom metadata associated with the user. + custom_metadata: nil + ) + end + + sig do + override.returns( + { + id: String, + created_at: Float, + has_accepted_terms: T::Boolean, + is_guest: T::Boolean, + linked_accounts: T::Array[Privy::LinkedAccount::Variants], + mfa_methods: T::Array[Privy::LinkedMfaMethod::Variants], + custom_metadata: + T::Hash[Symbol, Privy::CustomMetadataItem::Variants] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_authenticated_webhook_payload.rbi b/rbi/privy/models/user_authenticated_webhook_payload.rbi new file mode 100644 index 0000000..8faa71c --- /dev/null +++ b/rbi/privy/models/user_authenticated_webhook_payload.rbi @@ -0,0 +1,117 @@ +# typed: strong + +module Privy + module Models + class UserAuthenticatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserAuthenticatedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # A linked account for the user. + sig { returns(Privy::LinkedAccount::Variants) } + attr_accessor :account + + # The type of webhook event. + sig do + returns(Privy::UserAuthenticatedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + # Payload for the user.authenticated webhook event. + sig do + params( + account: + T.any( + Privy::LinkedAccountEmail::OrHash, + Privy::LinkedAccountPhone::OrHash, + Privy::LinkedAccountEthereum::OrHash, + Privy::LinkedAccountSolana::OrHash, + Privy::LinkedAccountSmartWallet::OrHash, + Privy::LinkedAccountEthereumEmbeddedWallet::OrHash, + Privy::LinkedAccountSolanaEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::OrHash, + Privy::LinkedAccountCurveSigningEmbeddedWallet::OrHash, + Privy::LinkedAccountGoogleOAuth::OrHash, + Privy::LinkedAccountTwitterOAuth::OrHash, + Privy::LinkedAccountDiscordOAuth::OrHash, + Privy::LinkedAccountGitHubOAuth::OrHash, + Privy::LinkedAccountSpotifyOAuth::OrHash, + Privy::LinkedAccountInstagramOAuth::OrHash, + Privy::LinkedAccountTiktokOAuth::OrHash, + Privy::LinkedAccountLineOAuth::OrHash, + Privy::LinkedAccountTwitchOAuth::OrHash, + Privy::LinkedAccountLinkedInOAuth::OrHash, + Privy::LinkedAccountAppleOAuth::OrHash, + Privy::LinkedAccountCustomOAuth::OrHash, + Privy::LinkedAccountCustomJwt::OrHash, + Privy::LinkedAccountFarcaster::OrHash, + Privy::LinkedAccountPasskey::OrHash, + Privy::LinkedAccountTelegram::OrHash, + Privy::LinkedAccountCrossApp::OrHash, + Privy::LinkedAccountAuthorizationKey::OrHash + ), + type: Privy::UserAuthenticatedWebhookPayload::Type::OrSymbol, + user: Privy::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # A linked account for the user. + account:, + # The type of webhook event. + type:, + # A Privy user object. + user: + ) + end + + sig do + override.returns( + { + account: Privy::LinkedAccount::Variants, + type: Privy::UserAuthenticatedWebhookPayload::Type::TaggedSymbol, + user: Privy::User + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::UserAuthenticatedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_AUTHENTICATED = + T.let( + :"user.authenticated", + Privy::UserAuthenticatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::UserAuthenticatedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_batch_create_input.rbi b/rbi/privy/models/user_batch_create_input.rbi new file mode 100644 index 0000000..067f50f --- /dev/null +++ b/rbi/privy/models/user_batch_create_input.rbi @@ -0,0 +1,218 @@ +# typed: strong + +module Privy + module Models + class UserBatchCreateInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UserBatchCreateInput, Privy::Internal::AnyHash) + end + + sig { returns(T::Array[Privy::UserBatchCreateInput::User]) } + attr_accessor :users + + # The payload for batch creating users. + sig do + params( + users: T::Array[Privy::UserBatchCreateInput::User::OrHash] + ).returns(T.attached_class) + end + def self.new(users:) + end + + sig do + override.returns({ users: T::Array[Privy::UserBatchCreateInput::User] }) + end + def to_hash + end + + class User < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UserBatchCreateInput::User, Privy::Internal::AnyHash) + end + + sig do + returns( + T::Array[ + T.any( + Privy::LinkedAccountWalletInput, + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountPhoneInput, + Privy::LinkedAccountGoogleInput, + Privy::LinkedAccountTwitterInput, + Privy::LinkedAccountDiscordInput, + Privy::LinkedAccountGitHubInput, + Privy::LinkedAccountSpotifyInput, + Privy::LinkedAccountInstagramInput, + Privy::LinkedAccountTiktokInput, + Privy::LinkedAccountLineInput, + Privy::LinkedAccountTwitchInput, + Privy::LinkedAccountAppleInput, + Privy::LinkedAccountLinkedInInput, + Privy::LinkedAccountFarcasterInput, + Privy::LinkedAccountTelegramInput, + Privy::LinkedAccountCustomJwtInput, + Privy::LinkedAccountPasskeyInput + ) + ] + ) + end + attr_accessor :linked_accounts + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :create_embedded_wallet + + sig { params(create_embedded_wallet: T::Boolean).void } + attr_writer :create_embedded_wallet + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :create_ethereum_smart_wallet + + sig { params(create_ethereum_smart_wallet: T::Boolean).void } + attr_writer :create_ethereum_smart_wallet + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :create_ethereum_wallet + + sig { params(create_ethereum_wallet: T::Boolean).void } + attr_writer :create_ethereum_wallet + + sig { returns(T.nilable(Float)) } + attr_reader :create_n_embedded_wallets + + sig { params(create_n_embedded_wallets: Float).void } + attr_writer :create_n_embedded_wallets + + sig { returns(T.nilable(Float)) } + attr_reader :create_n_ethereum_wallets + + sig { params(create_n_ethereum_wallets: Float).void } + attr_writer :create_n_ethereum_wallets + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :create_solana_wallet + + sig { params(create_solana_wallet: T::Boolean).void } + attr_writer :create_solana_wallet + + # Custom metadata associated with the user. + sig do + returns( + T.nilable(T::Hash[Symbol, Privy::CustomMetadataItem::Variants]) + ) + end + attr_reader :custom_metadata + + sig do + params( + custom_metadata: + T::Hash[Symbol, Privy::CustomMetadataItem::Variants] + ).void + end + attr_writer :custom_metadata + + # Wallets to create. + sig { returns(T.nilable(T::Array[Privy::WalletCreationInput])) } + attr_reader :wallets + + sig do + params(wallets: T::Array[Privy::WalletCreationInput::OrHash]).void + end + attr_writer :wallets + + sig do + params( + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountWalletInput::OrHash, + Privy::LinkedAccountEmailInput::OrHash, + Privy::LinkedAccountPhoneInput::OrHash, + Privy::LinkedAccountGoogleInput::OrHash, + Privy::LinkedAccountTwitterInput::OrHash, + Privy::LinkedAccountDiscordInput::OrHash, + Privy::LinkedAccountGitHubInput::OrHash, + Privy::LinkedAccountSpotifyInput::OrHash, + Privy::LinkedAccountInstagramInput::OrHash, + Privy::LinkedAccountTiktokInput::OrHash, + Privy::LinkedAccountLineInput::OrHash, + Privy::LinkedAccountTwitchInput::OrHash, + Privy::LinkedAccountAppleInput::OrHash, + Privy::LinkedAccountLinkedInInput::OrHash, + Privy::LinkedAccountFarcasterInput::OrHash, + Privy::LinkedAccountTelegramInput::OrHash, + Privy::LinkedAccountCustomJwtInput::OrHash, + Privy::LinkedAccountPasskeyInput::OrHash + ) + ], + create_embedded_wallet: T::Boolean, + create_ethereum_smart_wallet: T::Boolean, + create_ethereum_wallet: T::Boolean, + create_n_embedded_wallets: Float, + create_n_ethereum_wallets: Float, + create_solana_wallet: T::Boolean, + custom_metadata: + T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + wallets: T::Array[Privy::WalletCreationInput::OrHash] + ).returns(T.attached_class) + end + def self.new( + linked_accounts:, + create_embedded_wallet: nil, + create_ethereum_smart_wallet: nil, + create_ethereum_wallet: nil, + create_n_embedded_wallets: nil, + create_n_ethereum_wallets: nil, + create_solana_wallet: nil, + # Custom metadata associated with the user. + custom_metadata: nil, + # Wallets to create. + wallets: nil + ) + end + + sig do + override.returns( + { + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountWalletInput, + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountPhoneInput, + Privy::LinkedAccountGoogleInput, + Privy::LinkedAccountTwitterInput, + Privy::LinkedAccountDiscordInput, + Privy::LinkedAccountGitHubInput, + Privy::LinkedAccountSpotifyInput, + Privy::LinkedAccountInstagramInput, + Privy::LinkedAccountTiktokInput, + Privy::LinkedAccountLineInput, + Privy::LinkedAccountTwitchInput, + Privy::LinkedAccountAppleInput, + Privy::LinkedAccountLinkedInInput, + Privy::LinkedAccountFarcasterInput, + Privy::LinkedAccountTelegramInput, + Privy::LinkedAccountCustomJwtInput, + Privy::LinkedAccountPasskeyInput + ) + ], + create_embedded_wallet: T::Boolean, + create_ethereum_smart_wallet: T::Boolean, + create_ethereum_wallet: T::Boolean, + create_n_embedded_wallets: Float, + create_n_ethereum_wallets: Float, + create_solana_wallet: T::Boolean, + custom_metadata: + T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + wallets: T::Array[Privy::WalletCreationInput] + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/user_create_params.rbi b/rbi/privy/models/user_create_params.rbi new file mode 100644 index 0000000..d5766d5 --- /dev/null +++ b/rbi/privy/models/user_create_params.rbi @@ -0,0 +1,274 @@ +# typed: strong + +module Privy + module Models + class UserCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserCreateParams, Privy::Internal::AnyHash) + end + + sig do + returns( + T::Array[ + T.any( + Privy::LinkedAccountWalletInput, + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountPhoneInput, + Privy::LinkedAccountGoogleInput, + Privy::LinkedAccountTwitterInput, + Privy::LinkedAccountDiscordInput, + Privy::LinkedAccountGitHubInput, + Privy::LinkedAccountSpotifyInput, + Privy::LinkedAccountInstagramInput, + Privy::LinkedAccountTiktokInput, + Privy::LinkedAccountLineInput, + Privy::LinkedAccountTwitchInput, + Privy::LinkedAccountAppleInput, + Privy::LinkedAccountLinkedInInput, + Privy::LinkedAccountFarcasterInput, + Privy::LinkedAccountTelegramInput, + Privy::LinkedAccountCustomJwtInput, + Privy::LinkedAccountPasskeyInput + ) + ] + ) + end + attr_accessor :linked_accounts + + # Custom metadata associated with the user. + sig do + returns(T.nilable(T::Hash[Symbol, Privy::CustomMetadataItem::Variants])) + end + attr_reader :custom_metadata + + sig do + params( + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants] + ).void + end + attr_writer :custom_metadata + + # Wallets to create for the user. + sig { returns(T.nilable(T::Array[Privy::UserCreateParams::Wallet])) } + attr_reader :wallets + + sig do + params(wallets: T::Array[Privy::UserCreateParams::Wallet::OrHash]).void + end + attr_writer :wallets + + sig do + params( + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountWalletInput::OrHash, + Privy::LinkedAccountEmailInput::OrHash, + Privy::LinkedAccountPhoneInput::OrHash, + Privy::LinkedAccountGoogleInput::OrHash, + Privy::LinkedAccountTwitterInput::OrHash, + Privy::LinkedAccountDiscordInput::OrHash, + Privy::LinkedAccountGitHubInput::OrHash, + Privy::LinkedAccountSpotifyInput::OrHash, + Privy::LinkedAccountInstagramInput::OrHash, + Privy::LinkedAccountTiktokInput::OrHash, + Privy::LinkedAccountLineInput::OrHash, + Privy::LinkedAccountTwitchInput::OrHash, + Privy::LinkedAccountAppleInput::OrHash, + Privy::LinkedAccountLinkedInInput::OrHash, + Privy::LinkedAccountFarcasterInput::OrHash, + Privy::LinkedAccountTelegramInput::OrHash, + Privy::LinkedAccountCustomJwtInput::OrHash, + Privy::LinkedAccountPasskeyInput::OrHash + ) + ], + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + wallets: T::Array[Privy::UserCreateParams::Wallet::OrHash], + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + linked_accounts:, + # Custom metadata associated with the user. + custom_metadata: nil, + # Wallets to create for the user. + wallets: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountWalletInput, + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountPhoneInput, + Privy::LinkedAccountGoogleInput, + Privy::LinkedAccountTwitterInput, + Privy::LinkedAccountDiscordInput, + Privy::LinkedAccountGitHubInput, + Privy::LinkedAccountSpotifyInput, + Privy::LinkedAccountInstagramInput, + Privy::LinkedAccountTiktokInput, + Privy::LinkedAccountLineInput, + Privy::LinkedAccountTwitchInput, + Privy::LinkedAccountAppleInput, + Privy::LinkedAccountLinkedInInput, + Privy::LinkedAccountFarcasterInput, + Privy::LinkedAccountTelegramInput, + Privy::LinkedAccountCustomJwtInput, + Privy::LinkedAccountPasskeyInput + ) + ], + custom_metadata: + T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + wallets: T::Array[Privy::UserCreateParams::Wallet], + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + class Wallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UserCreateParams::Wallet, Privy::Internal::AnyHash) + end + + # The wallet chain types. + sig { returns(Privy::WalletChainType::OrSymbol) } + attr_accessor :chain_type + + # Additional signers for the wallet. + sig do + returns( + T.nilable( + T::Array[Privy::UserCreateParams::Wallet::AdditionalSigner] + ) + ) + end + attr_reader :additional_signers + + sig do + params( + additional_signers: + T::Array[ + Privy::UserCreateParams::Wallet::AdditionalSigner::OrHash + ] + ).void + end + attr_writer :additional_signers + + # Create a smart wallet with this wallet as the signer. Only supported for wallets + # with `chain_type: "ethereum"`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :create_smart_wallet + + sig { params(create_smart_wallet: T::Boolean).void } + attr_writer :create_smart_wallet + + # Policy IDs to enforce on the wallet. Currently, only one policy is supported per + # wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: + T::Array[ + Privy::UserCreateParams::Wallet::AdditionalSigner::OrHash + ], + create_smart_wallet: T::Boolean, + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The wallet chain types. + chain_type:, + # Additional signers for the wallet. + additional_signers: nil, + # Create a smart wallet with this wallet as the signer. Only supported for wallets + # with `chain_type: "ethereum"`. + create_smart_wallet: nil, + # Policy IDs to enforce on the wallet. Currently, only one policy is supported per + # wallet. + policy_ids: nil + ) + end + + sig do + override.returns( + { + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: + T::Array[Privy::UserCreateParams::Wallet::AdditionalSigner], + create_smart_wallet: T::Boolean, + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + + class AdditionalSigner < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserCreateParams::Wallet::AdditionalSigner, + Privy::Internal::AnyHash + ) + end + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :signer_id + + # The array of policy IDs that will be applied to wallet requests. If specified, + # this will override the base policy IDs set on the wallet. Currently, only one + # policy is supported per signer. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :override_policy_ids + + sig { params(override_policy_ids: T::Array[String]).void } + attr_writer :override_policy_ids + + sig do + params( + signer_id: String, + override_policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for a key quorum. + signer_id:, + # The array of policy IDs that will be applied to wallet requests. If specified, + # this will override the base policy IDs set on the wallet. Currently, only one + # policy is supported per signer. + override_policy_ids: nil + ) + end + + sig do + override.returns( + { signer_id: String, override_policy_ids: T::Array[String] } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/privy/models/user_created_webhook_payload.rbi b/rbi/privy/models/user_created_webhook_payload.rbi new file mode 100644 index 0000000..25f6d9d --- /dev/null +++ b/rbi/privy/models/user_created_webhook_payload.rbi @@ -0,0 +1,72 @@ +# typed: strong + +module Privy + module Models + class UserCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UserCreatedWebhookPayload, Privy::Internal::AnyHash) + end + + # The type of webhook event. + sig { returns(Privy::UserCreatedWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + # Payload for the user.created webhook event. + sig do + params( + type: Privy::UserCreatedWebhookPayload::Type::OrSymbol, + user: Privy::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # The type of webhook event. + type:, + # A Privy user object. + user: + ) + end + + sig do + override.returns( + { + type: Privy::UserCreatedWebhookPayload::Type::TaggedSymbol, + user: Privy::User + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::UserCreatedWebhookPayload::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_CREATED = + T.let( + :"user.created", + Privy::UserCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::UserCreatedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_delete_params.rbi b/rbi/privy/models/user_delete_params.rbi new file mode 100644 index 0000000..0a6381a --- /dev/null +++ b/rbi/privy/models/user_delete_params.rbi @@ -0,0 +1,40 @@ +# typed: strong + +module Privy + module Models + class UserDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserDeleteParams, Privy::Internal::AnyHash) + end + + # ID of the user. + sig { returns(String) } + attr_accessor :user_id + + sig do + params( + user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the user. + user_id:, + request_options: {} + ) + end + + sig do + override.returns( + { user_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_custom_auth_id_params.rbi b/rbi/privy/models/user_get_by_custom_auth_id_params.rbi new file mode 100644 index 0000000..38419bc --- /dev/null +++ b/rbi/privy/models/user_get_by_custom_auth_id_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByCustomAuthIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByCustomAuthIDParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :custom_user_id + + sig do + params( + custom_user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(custom_user_id:, request_options: {}) + end + + sig do + override.returns( + { custom_user_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_discord_username_params.rbi b/rbi/privy/models/user_get_by_discord_username_params.rbi new file mode 100644 index 0000000..493961b --- /dev/null +++ b/rbi/privy/models/user_get_by_discord_username_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByDiscordUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByDiscordUsernameParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :username + + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(username:, request_options: {}) + end + + sig do + override.returns( + { username: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_email_address_params.rbi b/rbi/privy/models/user_get_by_email_address_params.rbi new file mode 100644 index 0000000..db8938f --- /dev/null +++ b/rbi/privy/models/user_get_by_email_address_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByEmailAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByEmailAddressParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig do + params( + address: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(address:, request_options: {}) + end + + sig do + override.returns( + { address: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_farcaster_id_params.rbi b/rbi/privy/models/user_get_by_farcaster_id_params.rbi new file mode 100644 index 0000000..be2e706 --- /dev/null +++ b/rbi/privy/models/user_get_by_farcaster_id_params.rbi @@ -0,0 +1,33 @@ +# typed: strong + +module Privy + module Models + class UserGetByFarcasterIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByFarcasterIDParams, Privy::Internal::AnyHash) + end + + sig { returns(Float) } + attr_accessor :fid + + sig do + params( + fid: Float, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(fid:, request_options: {}) + end + + sig do + override.returns({ fid: Float, request_options: Privy::RequestOptions }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_github_username_params.rbi b/rbi/privy/models/user_get_by_github_username_params.rbi new file mode 100644 index 0000000..fb7166e --- /dev/null +++ b/rbi/privy/models/user_get_by_github_username_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByGitHubUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByGitHubUsernameParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :username + + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(username:, request_options: {}) + end + + sig do + override.returns( + { username: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_phone_number_params.rbi b/rbi/privy/models/user_get_by_phone_number_params.rbi new file mode 100644 index 0000000..2f19b1a --- /dev/null +++ b/rbi/privy/models/user_get_by_phone_number_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByPhoneNumberParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByPhoneNumberParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :number + + sig do + params( + number: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(number:, request_options: {}) + end + + sig do + override.returns( + { number: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_smart_wallet_address_params.rbi b/rbi/privy/models/user_get_by_smart_wallet_address_params.rbi new file mode 100644 index 0000000..2205f68 --- /dev/null +++ b/rbi/privy/models/user_get_by_smart_wallet_address_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class UserGetBySmartWalletAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::UserGetBySmartWalletAddressParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :address + + sig do + params( + address: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(address:, request_options: {}) + end + + sig do + override.returns( + { address: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_telegram_user_id_params.rbi b/rbi/privy/models/user_get_by_telegram_user_id_params.rbi new file mode 100644 index 0000000..8714166 --- /dev/null +++ b/rbi/privy/models/user_get_by_telegram_user_id_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByTelegramUserIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByTelegramUserIDParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :telegram_user_id + + sig do + params( + telegram_user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(telegram_user_id:, request_options: {}) + end + + sig do + override.returns( + { telegram_user_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_telegram_username_params.rbi b/rbi/privy/models/user_get_by_telegram_username_params.rbi new file mode 100644 index 0000000..07def5a --- /dev/null +++ b/rbi/privy/models/user_get_by_telegram_username_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class UserGetByTelegramUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::UserGetByTelegramUsernameParams, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :username + + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(username:, request_options: {}) + end + + sig do + override.returns( + { username: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_twitter_subject_params.rbi b/rbi/privy/models/user_get_by_twitter_subject_params.rbi new file mode 100644 index 0000000..edc6841 --- /dev/null +++ b/rbi/privy/models/user_get_by_twitter_subject_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByTwitterSubjectParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByTwitterSubjectParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :subject + + sig do + params( + subject: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(subject:, request_options: {}) + end + + sig do + override.returns( + { subject: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_twitter_username_params.rbi b/rbi/privy/models/user_get_by_twitter_username_params.rbi new file mode 100644 index 0000000..4c5e46e --- /dev/null +++ b/rbi/privy/models/user_get_by_twitter_username_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByTwitterUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByTwitterUsernameParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :username + + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(username:, request_options: {}) + end + + sig do + override.returns( + { username: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_by_wallet_address_params.rbi b/rbi/privy/models/user_get_by_wallet_address_params.rbi new file mode 100644 index 0000000..7f6a331 --- /dev/null +++ b/rbi/privy/models/user_get_by_wallet_address_params.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + class UserGetByWalletAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserGetByWalletAddressParams, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig do + params( + address: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(address:, request_options: {}) + end + + sig do + override.returns( + { address: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_get_params.rbi b/rbi/privy/models/user_get_params.rbi new file mode 100644 index 0000000..fb94900 --- /dev/null +++ b/rbi/privy/models/user_get_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class UserGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::UserGetParams, Privy::Internal::AnyHash) } + + # User ID + sig { returns(String) } + attr_accessor :user_id + + sig do + params( + user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # User ID + user_id:, + request_options: {} + ) + end + + sig do + override.returns( + { user_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_invite_input.rbi b/rbi/privy/models/user_invite_input.rbi new file mode 100644 index 0000000..6745a67 --- /dev/null +++ b/rbi/privy/models/user_invite_input.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # Input for adding or removing an allowlist entry. Discriminated by type. + module UserInviteInput + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::EmailInviteInput, + Privy::EmailDomainInviteInput, + Privy::WalletInviteInput, + Privy::PhoneInviteInput + ) + end + + sig { override.returns(T::Array[Privy::UserInviteInput::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/user_linked_account_webhook_payload.rbi b/rbi/privy/models/user_linked_account_webhook_payload.rbi new file mode 100644 index 0000000..f6af730 --- /dev/null +++ b/rbi/privy/models/user_linked_account_webhook_payload.rbi @@ -0,0 +1,117 @@ +# typed: strong + +module Privy + module Models + class UserLinkedAccountWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserLinkedAccountWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # A linked account for the user. + sig { returns(Privy::LinkedAccount::Variants) } + attr_accessor :account + + # The type of webhook event. + sig do + returns(Privy::UserLinkedAccountWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + # Payload for the user.linked_account webhook event. + sig do + params( + account: + T.any( + Privy::LinkedAccountEmail::OrHash, + Privy::LinkedAccountPhone::OrHash, + Privy::LinkedAccountEthereum::OrHash, + Privy::LinkedAccountSolana::OrHash, + Privy::LinkedAccountSmartWallet::OrHash, + Privy::LinkedAccountEthereumEmbeddedWallet::OrHash, + Privy::LinkedAccountSolanaEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::OrHash, + Privy::LinkedAccountCurveSigningEmbeddedWallet::OrHash, + Privy::LinkedAccountGoogleOAuth::OrHash, + Privy::LinkedAccountTwitterOAuth::OrHash, + Privy::LinkedAccountDiscordOAuth::OrHash, + Privy::LinkedAccountGitHubOAuth::OrHash, + Privy::LinkedAccountSpotifyOAuth::OrHash, + Privy::LinkedAccountInstagramOAuth::OrHash, + Privy::LinkedAccountTiktokOAuth::OrHash, + Privy::LinkedAccountLineOAuth::OrHash, + Privy::LinkedAccountTwitchOAuth::OrHash, + Privy::LinkedAccountLinkedInOAuth::OrHash, + Privy::LinkedAccountAppleOAuth::OrHash, + Privy::LinkedAccountCustomOAuth::OrHash, + Privy::LinkedAccountCustomJwt::OrHash, + Privy::LinkedAccountFarcaster::OrHash, + Privy::LinkedAccountPasskey::OrHash, + Privy::LinkedAccountTelegram::OrHash, + Privy::LinkedAccountCrossApp::OrHash, + Privy::LinkedAccountAuthorizationKey::OrHash + ), + type: Privy::UserLinkedAccountWebhookPayload::Type::OrSymbol, + user: Privy::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # A linked account for the user. + account:, + # The type of webhook event. + type:, + # A Privy user object. + user: + ) + end + + sig do + override.returns( + { + account: Privy::LinkedAccount::Variants, + type: Privy::UserLinkedAccountWebhookPayload::Type::TaggedSymbol, + user: Privy::User + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::UserLinkedAccountWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_LINKED_ACCOUNT = + T.let( + :"user.linked_account", + Privy::UserLinkedAccountWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::UserLinkedAccountWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_list_params.rbi b/rbi/privy/models/user_list_params.rbi new file mode 100644 index 0000000..3c7b875 --- /dev/null +++ b/rbi/privy/models/user_list_params.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class UserListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::UserListParams, Privy::Internal::AnyHash) } + + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + sig { returns(T.nilable(Float)) } + attr_accessor :limit + + sig do + params( + cursor: String, + limit: T.nilable(Float), + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(cursor: nil, limit: nil, request_options: {}) + end + + sig do + override.returns( + { + cursor: String, + limit: T.nilable(Float), + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_operation_completed_webhook_payload.rbi b/rbi/privy/models/user_operation_completed_webhook_payload.rbi new file mode 100644 index 0000000..ffda13e --- /dev/null +++ b/rbi/privy/models/user_operation_completed_webhook_payload.rbi @@ -0,0 +1,137 @@ +# typed: strong + +module Privy + module Models + class UserOperationCompletedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserOperationCompletedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :actual_gas_cost + + sig { returns(String) } + attr_accessor :actual_gas_used + + sig { returns(Float) } + attr_accessor :block_number + + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(Float) } + attr_accessor :log_index + + sig { returns(String) } + attr_accessor :nonce + + sig { returns(T.nilable(String)) } + attr_accessor :paymaster + + sig { returns(String) } + attr_accessor :sender + + sig { returns(T::Boolean) } + attr_accessor :success + + sig { returns(String) } + attr_accessor :transaction_hash + + # The type of webhook event. + sig do + returns(Privy::UserOperationCompletedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + sig { returns(String) } + attr_accessor :user_op_hash + + # Payload for the user_operation.completed webhook event. + sig do + params( + actual_gas_cost: String, + actual_gas_used: String, + block_number: Float, + caip2: String, + log_index: Float, + nonce: String, + paymaster: T.nilable(String), + sender: String, + success: T::Boolean, + transaction_hash: String, + type: Privy::UserOperationCompletedWebhookPayload::Type::OrSymbol, + user_op_hash: String + ).returns(T.attached_class) + end + def self.new( + actual_gas_cost:, + actual_gas_used:, + block_number:, + caip2:, + log_index:, + nonce:, + paymaster:, + sender:, + success:, + transaction_hash:, + # The type of webhook event. + type:, + user_op_hash: + ) + end + + sig do + override.returns( + { + actual_gas_cost: String, + actual_gas_used: String, + block_number: Float, + caip2: String, + log_index: Float, + nonce: String, + paymaster: T.nilable(String), + sender: String, + success: T::Boolean, + transaction_hash: String, + type: + Privy::UserOperationCompletedWebhookPayload::Type::TaggedSymbol, + user_op_hash: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::UserOperationCompletedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_OPERATION_COMPLETED = + T.let( + :"user_operation.completed", + Privy::UserOperationCompletedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::UserOperationCompletedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_operation_input.rbi b/rbi/privy/models/user_operation_input.rbi new file mode 100644 index 0000000..51b0788 --- /dev/null +++ b/rbi/privy/models/user_operation_input.rbi @@ -0,0 +1,154 @@ +# typed: strong + +module Privy + module Models + class UserOperationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UserOperationInput, Privy::Internal::AnyHash) + end + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :call_data + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :call_gas_limit + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :max_fee_per_gas + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :max_priority_fee_per_gas + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :nonce + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :pre_verification_gas + + sig { returns(String) } + attr_accessor :sender + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(String) } + attr_accessor :verification_gas_limit + + sig { returns(T.nilable(String)) } + attr_reader :paymaster + + sig { params(paymaster: String).void } + attr_writer :paymaster + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :paymaster_data + + sig { params(paymaster_data: String).void } + attr_writer :paymaster_data + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :paymaster_post_op_gas_limit + + sig { params(paymaster_post_op_gas_limit: String).void } + attr_writer :paymaster_post_op_gas_limit + + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + sig { returns(T.nilable(String)) } + attr_reader :paymaster_verification_gas_limit + + sig { params(paymaster_verification_gas_limit: String).void } + attr_writer :paymaster_verification_gas_limit + + # An ERC-4337 user operation. + sig do + params( + call_data: String, + call_gas_limit: String, + max_fee_per_gas: String, + max_priority_fee_per_gas: String, + nonce: String, + pre_verification_gas: String, + sender: String, + verification_gas_limit: String, + paymaster: String, + paymaster_data: String, + paymaster_post_op_gas_limit: String, + paymaster_verification_gas_limit: String + ).returns(T.attached_class) + end + def self.new( + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + call_data:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + call_gas_limit:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + max_fee_per_gas:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + max_priority_fee_per_gas:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + nonce:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + pre_verification_gas:, + sender:, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + verification_gas_limit:, + paymaster: nil, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + paymaster_data: nil, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + paymaster_post_op_gas_limit: nil, + # A hex-encoded string prefixed with '0x', capped at 100002 characters (50,000 + # bytes). + paymaster_verification_gas_limit: nil + ) + end + + sig do + override.returns( + { + call_data: String, + call_gas_limit: String, + max_fee_per_gas: String, + max_priority_fee_per_gas: String, + nonce: String, + pre_verification_gas: String, + sender: String, + verification_gas_limit: String, + paymaster: String, + paymaster_data: String, + paymaster_post_op_gas_limit: String, + paymaster_verification_gas_limit: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_owned_recovery_option.rbi b/rbi/privy/models/user_owned_recovery_option.rbi new file mode 100644 index 0000000..e3ea664 --- /dev/null +++ b/rbi/privy/models/user_owned_recovery_option.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # A user-owned recovery option for embedded wallets. + module UserOwnedRecoveryOption + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::UserOwnedRecoveryOption) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_PASSCODE = + T.let(:"user-passcode", Privy::UserOwnedRecoveryOption::TaggedSymbol) + GOOGLE_DRIVE = + T.let(:"google-drive", Privy::UserOwnedRecoveryOption::TaggedSymbol) + ICLOUD = T.let(:icloud, Privy::UserOwnedRecoveryOption::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::UserOwnedRecoveryOption::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/user_pregenerate_wallets_params.rbi b/rbi/privy/models/user_pregenerate_wallets_params.rbi new file mode 100644 index 0000000..6e9d0d6 --- /dev/null +++ b/rbi/privy/models/user_pregenerate_wallets_params.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Models + class UserPregenerateWalletsParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserPregenerateWalletsParams, Privy::Internal::AnyHash) + end + + # ID of the user. + sig { returns(String) } + attr_accessor :user_id + + sig { returns(T::Array[Privy::WalletCreationInput]) } + attr_accessor :wallets + + sig do + params( + user_id: String, + wallets: T::Array[Privy::WalletCreationInput::OrHash], + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the user. + user_id:, + wallets:, + request_options: {} + ) + end + + sig do + override.returns( + { + user_id: String, + wallets: T::Array[Privy::WalletCreationInput], + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_search_params.rbi b/rbi/privy/models/user_search_params.rbi new file mode 100644 index 0000000..9627567 --- /dev/null +++ b/rbi/privy/models/user_search_params.rbi @@ -0,0 +1,133 @@ +# typed: strong + +module Privy + module Models + class UserSearchParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserSearchParams, Privy::Internal::AnyHash) + end + + sig do + returns( + T.any( + Privy::UserSearchParams::Body::SearchTerm, + Privy::UserSearchParams::Body::UnionMember1 + ) + ) + end + attr_accessor :body + + sig do + params( + body: + T.any( + Privy::UserSearchParams::Body::SearchTerm::OrHash, + Privy::UserSearchParams::Body::UnionMember1::OrHash + ), + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new(body:, request_options: {}) + end + + sig do + override.returns( + { + body: + T.any( + Privy::UserSearchParams::Body::SearchTerm, + Privy::UserSearchParams::Body::UnionMember1 + ), + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + module Body + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::UserSearchParams::Body::SearchTerm, + Privy::UserSearchParams::Body::UnionMember1 + ) + end + + class SearchTerm < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserSearchParams::Body::SearchTerm, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :search_term + + sig { params(search_term: String).returns(T.attached_class) } + def self.new(search_term:) + end + + sig { override.returns({ search_term: String }) } + def to_hash + end + end + + class UnionMember1 < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserSearchParams::Body::UnionMember1, + Privy::Internal::AnyHash + ) + end + + sig { returns(T::Array[String]) } + attr_accessor :emails + + sig { returns(T::Array[String]) } + attr_accessor :phone_numbers + + sig { returns(T::Array[String]) } + attr_accessor :wallet_addresses + + sig do + params( + emails: T::Array[String], + phone_numbers: T::Array[String], + wallet_addresses: T::Array[String] + ).returns(T.attached_class) + end + def self.new(emails:, phone_numbers:, wallet_addresses:) + end + + sig do + override.returns( + { + emails: T::Array[String], + phone_numbers: T::Array[String], + wallet_addresses: T::Array[String] + } + ) + end + def to_hash + end + end + + sig do + override.returns(T::Array[Privy::UserSearchParams::Body::Variants]) + end + def self.variants + end + end + end + end +end diff --git a/rbi/privy/models/user_set_custom_metadata_params.rbi b/rbi/privy/models/user_set_custom_metadata_params.rbi new file mode 100644 index 0000000..3e466c2 --- /dev/null +++ b/rbi/privy/models/user_set_custom_metadata_params.rbi @@ -0,0 +1,52 @@ +# typed: strong + +module Privy + module Models + class UserSetCustomMetadataParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserSetCustomMetadataParams, Privy::Internal::AnyHash) + end + + # ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # Custom metadata associated with the user. + sig { returns(T::Hash[Symbol, Privy::CustomMetadataItem::Variants]) } + attr_accessor :custom_metadata + + sig do + params( + user_id: String, + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the user. + user_id:, + # Custom metadata associated with the user. + custom_metadata:, + request_options: {} + ) + end + + sig do + override.returns( + { + user_id: String, + custom_metadata: + T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_transferred_account_webhook_payload.rbi b/rbi/privy/models/user_transferred_account_webhook_payload.rbi new file mode 100644 index 0000000..8ba995b --- /dev/null +++ b/rbi/privy/models/user_transferred_account_webhook_payload.rbi @@ -0,0 +1,197 @@ +# typed: strong + +module Privy + module Models + class UserTransferredAccountWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserTransferredAccountWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # A linked account for the user. + sig { returns(Privy::LinkedAccount::Variants) } + attr_accessor :account + + sig do + returns( + Privy::UserTransferredAccountWebhookPayload::DeletedUser::TaggedBoolean + ) + end + attr_accessor :deleted_user + + sig { returns(Privy::UserTransferredAccountWebhookPayload::FromUser) } + attr_reader :from_user + + sig do + params( + from_user: + Privy::UserTransferredAccountWebhookPayload::FromUser::OrHash + ).void + end + attr_writer :from_user + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :to_user + + sig { params(to_user: Privy::User::OrHash).void } + attr_writer :to_user + + # The type of webhook event. + sig do + returns(Privy::UserTransferredAccountWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # Payload for the user.transferred_account webhook event. + sig do + params( + account: + T.any( + Privy::LinkedAccountEmail::OrHash, + Privy::LinkedAccountPhone::OrHash, + Privy::LinkedAccountEthereum::OrHash, + Privy::LinkedAccountSolana::OrHash, + Privy::LinkedAccountSmartWallet::OrHash, + Privy::LinkedAccountEthereumEmbeddedWallet::OrHash, + Privy::LinkedAccountSolanaEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::OrHash, + Privy::LinkedAccountCurveSigningEmbeddedWallet::OrHash, + Privy::LinkedAccountGoogleOAuth::OrHash, + Privy::LinkedAccountTwitterOAuth::OrHash, + Privy::LinkedAccountDiscordOAuth::OrHash, + Privy::LinkedAccountGitHubOAuth::OrHash, + Privy::LinkedAccountSpotifyOAuth::OrHash, + Privy::LinkedAccountInstagramOAuth::OrHash, + Privy::LinkedAccountTiktokOAuth::OrHash, + Privy::LinkedAccountLineOAuth::OrHash, + Privy::LinkedAccountTwitchOAuth::OrHash, + Privy::LinkedAccountLinkedInOAuth::OrHash, + Privy::LinkedAccountAppleOAuth::OrHash, + Privy::LinkedAccountCustomOAuth::OrHash, + Privy::LinkedAccountCustomJwt::OrHash, + Privy::LinkedAccountFarcaster::OrHash, + Privy::LinkedAccountPasskey::OrHash, + Privy::LinkedAccountTelegram::OrHash, + Privy::LinkedAccountCrossApp::OrHash, + Privy::LinkedAccountAuthorizationKey::OrHash + ), + deleted_user: + Privy::UserTransferredAccountWebhookPayload::DeletedUser::OrBoolean, + from_user: + Privy::UserTransferredAccountWebhookPayload::FromUser::OrHash, + to_user: Privy::User::OrHash, + type: Privy::UserTransferredAccountWebhookPayload::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # A linked account for the user. + account:, + deleted_user:, + from_user:, + # A Privy user object. + to_user:, + # The type of webhook event. + type: + ) + end + + sig do + override.returns( + { + account: Privy::LinkedAccount::Variants, + deleted_user: + Privy::UserTransferredAccountWebhookPayload::DeletedUser::TaggedBoolean, + from_user: Privy::UserTransferredAccountWebhookPayload::FromUser, + to_user: Privy::User, + type: + Privy::UserTransferredAccountWebhookPayload::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module DeletedUser + extend Privy::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + Privy::UserTransferredAccountWebhookPayload::DeletedUser + ) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + Privy::UserTransferredAccountWebhookPayload::DeletedUser::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + Privy::UserTransferredAccountWebhookPayload::DeletedUser::TaggedBoolean + ] + ) + end + def self.values + end + end + + class FromUser < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserTransferredAccountWebhookPayload::FromUser, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + sig { params(id: String).returns(T.attached_class) } + def self.new(id:) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::UserTransferredAccountWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_TRANSFERRED_ACCOUNT = + T.let( + :"user.transferred_account", + Privy::UserTransferredAccountWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::UserTransferredAccountWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_unlink_linked_account_params.rbi b/rbi/privy/models/user_unlink_linked_account_params.rbi new file mode 100644 index 0000000..86a6147 --- /dev/null +++ b/rbi/privy/models/user_unlink_linked_account_params.rbi @@ -0,0 +1,66 @@ +# typed: strong + +module Privy + module Models + class UserUnlinkLinkedAccountParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::UserUnlinkLinkedAccountParams, Privy::Internal::AnyHash) + end + + # ID of the user. + sig { returns(String) } + attr_accessor :user_id + + sig { returns(String) } + attr_accessor :handle + + # The possible types of linked accounts. + sig { returns(T.any(Privy::LinkedAccountType::OrSymbol, String)) } + attr_accessor :type + + sig { returns(T.nilable(String)) } + attr_reader :provider + + sig { params(provider: String).void } + attr_writer :provider + + sig do + params( + user_id: String, + handle: String, + type: T.any(Privy::LinkedAccountType::OrSymbol, String), + provider: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the user. + user_id:, + handle:, + # The possible types of linked accounts. + type:, + provider: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + user_id: String, + handle: String, + type: T.any(Privy::LinkedAccountType::OrSymbol, String), + provider: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/user_unlinked_account_webhook_payload.rbi b/rbi/privy/models/user_unlinked_account_webhook_payload.rbi new file mode 100644 index 0000000..dd18629 --- /dev/null +++ b/rbi/privy/models/user_unlinked_account_webhook_payload.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Privy + module Models + class UserUnlinkedAccountWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserUnlinkedAccountWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # A linked account for the user. + sig { returns(Privy::LinkedAccount::Variants) } + attr_accessor :account + + # The type of webhook event. + sig do + returns(Privy::UserUnlinkedAccountWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + # Payload for the user.unlinked_account webhook event. + sig do + params( + account: + T.any( + Privy::LinkedAccountEmail::OrHash, + Privy::LinkedAccountPhone::OrHash, + Privy::LinkedAccountEthereum::OrHash, + Privy::LinkedAccountSolana::OrHash, + Privy::LinkedAccountSmartWallet::OrHash, + Privy::LinkedAccountEthereumEmbeddedWallet::OrHash, + Privy::LinkedAccountSolanaEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::OrHash, + Privy::LinkedAccountCurveSigningEmbeddedWallet::OrHash, + Privy::LinkedAccountGoogleOAuth::OrHash, + Privy::LinkedAccountTwitterOAuth::OrHash, + Privy::LinkedAccountDiscordOAuth::OrHash, + Privy::LinkedAccountGitHubOAuth::OrHash, + Privy::LinkedAccountSpotifyOAuth::OrHash, + Privy::LinkedAccountInstagramOAuth::OrHash, + Privy::LinkedAccountTiktokOAuth::OrHash, + Privy::LinkedAccountLineOAuth::OrHash, + Privy::LinkedAccountTwitchOAuth::OrHash, + Privy::LinkedAccountLinkedInOAuth::OrHash, + Privy::LinkedAccountAppleOAuth::OrHash, + Privy::LinkedAccountCustomOAuth::OrHash, + Privy::LinkedAccountCustomJwt::OrHash, + Privy::LinkedAccountFarcaster::OrHash, + Privy::LinkedAccountPasskey::OrHash, + Privy::LinkedAccountTelegram::OrHash, + Privy::LinkedAccountCrossApp::OrHash, + Privy::LinkedAccountAuthorizationKey::OrHash + ), + type: Privy::UserUnlinkedAccountWebhookPayload::Type::OrSymbol, + user: Privy::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # A linked account for the user. + account:, + # The type of webhook event. + type:, + # A Privy user object. + user: + ) + end + + sig do + override.returns( + { + account: Privy::LinkedAccount::Variants, + type: Privy::UserUnlinkedAccountWebhookPayload::Type::TaggedSymbol, + user: Privy::User + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::UserUnlinkedAccountWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_UNLINKED_ACCOUNT = + T.let( + :"user.unlinked_account", + Privy::UserUnlinkedAccountWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::UserUnlinkedAccountWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_updated_account_webhook_payload.rbi b/rbi/privy/models/user_updated_account_webhook_payload.rbi new file mode 100644 index 0000000..9fbd92f --- /dev/null +++ b/rbi/privy/models/user_updated_account_webhook_payload.rbi @@ -0,0 +1,119 @@ +# typed: strong + +module Privy + module Models + class UserUpdatedAccountWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserUpdatedAccountWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # A linked account for the user. + sig { returns(Privy::LinkedAccount::Variants) } + attr_accessor :account + + # The type of webhook event. + sig do + returns(Privy::UserUpdatedAccountWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + # Payload for the user.updated_account webhook event. + sig do + params( + account: + T.any( + Privy::LinkedAccountEmail::OrHash, + Privy::LinkedAccountPhone::OrHash, + Privy::LinkedAccountEthereum::OrHash, + Privy::LinkedAccountSolana::OrHash, + Privy::LinkedAccountSmartWallet::OrHash, + Privy::LinkedAccountEthereumEmbeddedWallet::OrHash, + Privy::LinkedAccountSolanaEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinSegwitEmbeddedWallet::OrHash, + Privy::LinkedAccountBitcoinTaprootEmbeddedWallet::OrHash, + Privy::LinkedAccountCurveSigningEmbeddedWallet::OrHash, + Privy::LinkedAccountGoogleOAuth::OrHash, + Privy::LinkedAccountTwitterOAuth::OrHash, + Privy::LinkedAccountDiscordOAuth::OrHash, + Privy::LinkedAccountGitHubOAuth::OrHash, + Privy::LinkedAccountSpotifyOAuth::OrHash, + Privy::LinkedAccountInstagramOAuth::OrHash, + Privy::LinkedAccountTiktokOAuth::OrHash, + Privy::LinkedAccountLineOAuth::OrHash, + Privy::LinkedAccountTwitchOAuth::OrHash, + Privy::LinkedAccountLinkedInOAuth::OrHash, + Privy::LinkedAccountAppleOAuth::OrHash, + Privy::LinkedAccountCustomOAuth::OrHash, + Privy::LinkedAccountCustomJwt::OrHash, + Privy::LinkedAccountFarcaster::OrHash, + Privy::LinkedAccountPasskey::OrHash, + Privy::LinkedAccountTelegram::OrHash, + Privy::LinkedAccountCrossApp::OrHash, + Privy::LinkedAccountAuthorizationKey::OrHash + ), + type: Privy::UserUpdatedAccountWebhookPayload::Type::OrSymbol, + user: Privy::User::OrHash + ).returns(T.attached_class) + end + def self.new( + # A linked account for the user. + account:, + # The type of webhook event. + type:, + # A Privy user object. + user: + ) + end + + sig do + override.returns( + { + account: Privy::LinkedAccount::Variants, + type: Privy::UserUpdatedAccountWebhookPayload::Type::TaggedSymbol, + user: Privy::User + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::UserUpdatedAccountWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_UPDATED_ACCOUNT = + T.let( + :"user.updated_account", + Privy::UserUpdatedAccountWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::UserUpdatedAccountWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_wallet_created_webhook_payload.rbi b/rbi/privy/models/user_wallet_created_webhook_payload.rbi new file mode 100644 index 0000000..9376067 --- /dev/null +++ b/rbi/privy/models/user_wallet_created_webhook_payload.rbi @@ -0,0 +1,90 @@ +# typed: strong + +module Privy + module Models + class UserWalletCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::UserWalletCreatedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The type of webhook event. + sig do + returns(Privy::UserWalletCreatedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + # Base schema for wallet accounts linked to the user. + sig { returns(Privy::LinkedAccountBaseWallet) } + attr_reader :wallet + + sig { params(wallet: Privy::LinkedAccountBaseWallet::OrHash).void } + attr_writer :wallet + + # Payload for the user.wallet_created webhook event. + sig do + params( + type: Privy::UserWalletCreatedWebhookPayload::Type::OrSymbol, + user: Privy::User::OrHash, + wallet: Privy::LinkedAccountBaseWallet::OrHash + ).returns(T.attached_class) + end + def self.new( + # The type of webhook event. + type:, + # A Privy user object. + user:, + # Base schema for wallet accounts linked to the user. + wallet: + ) + end + + sig do + override.returns( + { + type: Privy::UserWalletCreatedWebhookPayload::Type::TaggedSymbol, + user: Privy::User, + wallet: Privy::LinkedAccountBaseWallet + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::UserWalletCreatedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_WALLET_CREATED = + T.let( + :"user.wallet_created", + Privy::UserWalletCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::UserWalletCreatedWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/user_with_identity_token.rbi b/rbi/privy/models/user_with_identity_token.rbi new file mode 100644 index 0000000..e1ffef5 --- /dev/null +++ b/rbi/privy/models/user_with_identity_token.rbi @@ -0,0 +1,44 @@ +# typed: strong + +module Privy + module Models + class UserWithIdentityToken < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::UserWithIdentityToken, Privy::Internal::AnyHash) + end + + sig { returns(T.nilable(String)) } + attr_accessor :identity_token + + # A Privy user object. + sig { returns(Privy::User) } + attr_reader :user + + sig { params(user: Privy::User::OrHash).void } + attr_writer :user + + # The user object along their identity token. + sig do + params( + identity_token: T.nilable(String), + user: Privy::User::OrHash + ).returns(T.attached_class) + end + def self.new( + identity_token:, + # A Privy user object. + user: + ) + end + + sig do + override.returns( + { identity_token: T.nilable(String), user: Privy::User } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet.rbi b/rbi/privy/models/wallet.rbi new file mode 100644 index 0000000..b80eda0 --- /dev/null +++ b/rbi/privy/models/wallet.rbi @@ -0,0 +1,165 @@ +# typed: strong + +module Privy + module Models + class Wallet < Privy::Internal::Type::BaseModel + OrHash = T.type_alias { T.any(Privy::Wallet, Privy::Internal::AnyHash) } + + # Unique ID of the wallet. This will be the primary identifier when using the + # wallet in the future. + sig { returns(String) } + attr_accessor :id + + # Additional signers for the wallet. + sig { returns(T::Array[Privy::WalletAdditionalSignerItem]) } + attr_accessor :additional_signers + + # Address of the wallet. + sig { returns(String) } + attr_accessor :address + + # The wallet chain types. + sig { returns(Privy::WalletChainType::TaggedSymbol) } + attr_accessor :chain_type + + # Unix timestamp of when the wallet was created in milliseconds. + sig { returns(Float) } + attr_accessor :created_at + + # Unix timestamp of when the wallet was exported in milliseconds, if the wallet + # was exported. + sig { returns(T.nilable(Float)) } + attr_accessor :exported_at + + # Unix timestamp of when the wallet was imported in milliseconds, if the wallet + # was imported. + sig { returns(T.nilable(Float)) } + attr_accessor :imported_at + + # The key quorum ID of the owner of the wallet. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # List of policy IDs for policies that are enforced on the wallet. + sig { returns(T::Array[String]) } + attr_accessor :policy_ids + + # The number of keys that must sign for an action to be valid. + sig { returns(T.nilable(Float)) } + attr_reader :authorization_threshold + + sig { params(authorization_threshold: Float).void } + attr_writer :authorization_threshold + + # Information about the custodian managing this wallet. + sig { returns(T.nilable(Privy::WalletCustodian)) } + attr_reader :custody + + sig { params(custody: Privy::WalletCustodian::OrHash).void } + attr_writer :custody + + # A human-readable label for the wallet. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # A customer-provided identifier for mapping to external systems. Write-once, set + # only at creation. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # The compressed, raw public key for the wallet along the chain cryptographic + # curve. + sig { returns(T.nilable(String)) } + attr_reader :public_key + + sig { params(public_key: String).void } + attr_writer :public_key + + # A wallet managed by Privy's wallet infrastructure. + sig do + params( + id: String, + additional_signers: + T::Array[Privy::WalletAdditionalSignerItem::OrHash], + address: String, + chain_type: Privy::WalletChainType::OrSymbol, + created_at: Float, + exported_at: T.nilable(Float), + imported_at: T.nilable(Float), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + authorization_threshold: Float, + custody: Privy::WalletCustodian::OrHash, + display_name: String, + external_id: String, + public_key: String + ).returns(T.attached_class) + end + def self.new( + # Unique ID of the wallet. This will be the primary identifier when using the + # wallet in the future. + id:, + # Additional signers for the wallet. + additional_signers:, + # Address of the wallet. + address:, + # The wallet chain types. + chain_type:, + # Unix timestamp of when the wallet was created in milliseconds. + created_at:, + # Unix timestamp of when the wallet was exported in milliseconds, if the wallet + # was exported. + exported_at:, + # Unix timestamp of when the wallet was imported in milliseconds, if the wallet + # was imported. + imported_at:, + # The key quorum ID of the owner of the wallet. + owner_id:, + # List of policy IDs for policies that are enforced on the wallet. + policy_ids:, + # The number of keys that must sign for an action to be valid. + authorization_threshold: nil, + # Information about the custodian managing this wallet. + custody: nil, + # A human-readable label for the wallet. + display_name: nil, + # A customer-provided identifier for mapping to external systems. Write-once, set + # only at creation. + external_id: nil, + # The compressed, raw public key for the wallet along the chain cryptographic + # curve. + public_key: nil + ) + end + + sig do + override.returns( + { + id: String, + additional_signers: T::Array[Privy::WalletAdditionalSignerItem], + address: String, + chain_type: Privy::WalletChainType::TaggedSymbol, + created_at: Float, + exported_at: T.nilable(Float), + imported_at: T.nilable(Float), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + authorization_threshold: Float, + custody: Privy::WalletCustodian, + display_name: String, + external_id: String, + public_key: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_deposit_created_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_deposit_created_webhook_payload.rbi new file mode 100644 index 0000000..b0b9daa --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_deposit_created_webhook_payload.rbi @@ -0,0 +1,224 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnDepositCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnDepositCreatedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Base-unit amount of asset deposited (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnDepositCreatedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnDepositCreatedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_deposit.created webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + status: + Privy::WalletActionEarnDepositCreatedWebhookPayload::Status::OrSymbol, + type: + Privy::WalletActionEarnDepositCreatedWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # Base-unit amount of asset deposited (e.g. "1500000"). + raw_amount:, + # The status of the wallet action. + status:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + status: + Privy::WalletActionEarnDepositCreatedWebhookPayload::Status::TaggedSymbol, + type: + Privy::WalletActionEarnDepositCreatedWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositCreatedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Privy::WalletActionEarnDepositCreatedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositCreatedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositCreatedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_DEPOSIT_CREATED = + T.let( + :"wallet_action.earn_deposit.created", + Privy::WalletActionEarnDepositCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositCreatedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rbi new file mode 100644 index 0000000..1c722ce --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rbi @@ -0,0 +1,253 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnDepositFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnDepositFailedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Base-unit amount of asset deposited (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnDepositFailedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnDepositFailedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_deposit.failed webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason::OrHash, + raw_amount: String, + status: + Privy::WalletActionEarnDepositFailedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnDepositFailedWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Base-unit amount of asset deposited (e.g. "1500000"). + raw_amount:, + # The status of the wallet action. + status:, + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + steps:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: + Privy::WalletActionEarnDepositFailedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnDepositFailedWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositFailedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = + T.let( + :failed, + Privy::WalletActionEarnDepositFailedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositFailedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositFailedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_DEPOSIT_FAILED = + T.let( + :"wallet_action.earn_deposit.failed", + Privy::WalletActionEarnDepositFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositFailedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rbi new file mode 100644 index 0000000..d5cd7fe --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rbi @@ -0,0 +1,251 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnDepositRejectedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnDepositRejectedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Base-unit amount of asset deposited (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnDepositRejectedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action at the time of rejection. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnDepositRejectedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_deposit.rejected webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason::OrHash, + raw_amount: String, + status: + Privy::WalletActionEarnDepositRejectedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnDepositRejectedWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Base-unit amount of asset deposited (e.g. "1500000"). + raw_amount:, + # The status of the wallet action. + status:, + # The steps of the wallet action at the time of rejection. + steps:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: + Privy::WalletActionEarnDepositRejectedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnDepositRejectedWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositRejectedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REJECTED = + T.let( + :rejected, + Privy::WalletActionEarnDepositRejectedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositRejectedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositRejectedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_DEPOSIT_REJECTED = + T.let( + :"wallet_action.earn_deposit.rejected", + Privy::WalletActionEarnDepositRejectedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositRejectedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rbi new file mode 100644 index 0000000..35180a2 --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rbi @@ -0,0 +1,248 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnDepositSucceededWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnDepositSucceededWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Base-unit amount of asset deposited (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # Vault shares received in base units. + sig { returns(String) } + attr_accessor :share_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnDepositSucceededWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action, including transaction hashes. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnDepositSucceededWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_deposit.succeeded webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + share_amount: String, + status: + Privy::WalletActionEarnDepositSucceededWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnDepositSucceededWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # Base-unit amount of asset deposited (e.g. "1500000"). + raw_amount:, + # Vault shares received in base units. + share_amount:, + # The status of the wallet action. + status:, + # The steps of the wallet action, including transaction hashes. + steps:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + share_amount: String, + status: + Privy::WalletActionEarnDepositSucceededWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnDepositSucceededWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositSucceededWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCEEDED = + T.let( + :succeeded, + Privy::WalletActionEarnDepositSucceededWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositSucceededWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnDepositSucceededWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_DEPOSIT_SUCCEEDED = + T.let( + :"wallet_action.earn_deposit.succeeded", + Privy::WalletActionEarnDepositSucceededWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnDepositSucceededWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rbi new file mode 100644 index 0000000..3e3f59e --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rbi @@ -0,0 +1,162 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnIncentiveClaimCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # EVM chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :chain + + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + sig { returns(T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry])) } + attr_accessor :rewards + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.earn_incentive_claim.created webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + chain: String, + rewards: + T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry::OrHash]), + status: + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status::OrSymbol, + type: + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # EVM chain name (e.g. "base", "ethereum"). + chain:, + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + rewards:, + # The status of the wallet action. + status:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + chain: String, + rewards: T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry]), + status: + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status::TaggedSymbol, + type: + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_CREATED = + T.let( + :"wallet_action.earn_incentive_claim.created", + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rbi new file mode 100644 index 0000000..981c9a7 --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rbi @@ -0,0 +1,191 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnIncentiveClaimFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # EVM chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :chain + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + sig { returns(T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry])) } + attr_accessor :rewards + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.earn_incentive_claim.failed webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + chain: String, + failure_reason: Privy::FailureReason::OrHash, + rewards: + T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry::OrHash]), + status: + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # EVM chain name (e.g. "base", "ethereum"). + chain:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + rewards:, + # The status of the wallet action. + status:, + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + chain: String, + failure_reason: Privy::FailureReason, + rewards: T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry]), + status: + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = + T.let( + :failed, + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_FAILED = + T.let( + :"wallet_action.earn_incentive_claim.failed", + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rbi new file mode 100644 index 0000000..d5c4341 --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rbi @@ -0,0 +1,189 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnIncentiveClaimRejectedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # EVM chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :chain + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + sig { returns(T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry])) } + attr_accessor :rewards + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action at the time of rejection. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.earn_incentive_claim.rejected webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + chain: String, + failure_reason: Privy::FailureReason::OrHash, + rewards: + T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry::OrHash]), + status: + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # EVM chain name (e.g. "base", "ethereum"). + chain:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + rewards:, + # The status of the wallet action. + status:, + # The steps of the wallet action at the time of rejection. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + chain: String, + failure_reason: Privy::FailureReason, + rewards: T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry]), + status: + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REJECTED = + T.let( + :rejected, + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_REJECTED = + T.let( + :"wallet_action.earn_incentive_claim.rejected", + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rbi new file mode 100644 index 0000000..1508a40 --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rbi @@ -0,0 +1,178 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnIncentiveClaimSucceededWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # EVM chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :chain + + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + sig { returns(T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry])) } + attr_accessor :rewards + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action, including transaction hashes. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.earn_incentive_claim.succeeded webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + chain: String, + rewards: + T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry::OrHash]), + status: + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # EVM chain name (e.g. "base", "ethereum"). + chain:, + # Claimed reward tokens. Populated after the preparation step fetches from Merkl. + rewards:, + # The status of the wallet action. + status:, + # The steps of the wallet action, including transaction hashes. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + chain: String, + rewards: T.nilable(T::Array[Privy::EarnIncetiveClaimRewardEntry]), + status: + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCEEDED = + T.let( + :succeeded, + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_SUCCEEDED = + T.let( + :"wallet_action.earn_incentive_claim.succeeded", + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rbi new file mode 100644 index 0000000..eb2967a --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rbi @@ -0,0 +1,224 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnWithdrawCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnWithdrawCreatedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Base-unit amount of asset withdrawn (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_withdraw.created webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + status: + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Status::OrSymbol, + type: + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # Base-unit amount of asset withdrawn (e.g. "1500000"). + raw_amount:, + # The status of the wallet action. + status:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + status: + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Status::TaggedSymbol, + type: + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_WITHDRAW_CREATED = + T.let( + :"wallet_action.earn_withdraw.created", + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawCreatedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rbi new file mode 100644 index 0000000..adb3930 --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rbi @@ -0,0 +1,253 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnWithdrawFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnWithdrawFailedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Base-unit amount of asset withdrawn (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_withdraw.failed webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason::OrHash, + raw_amount: String, + status: + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Base-unit amount of asset withdrawn (e.g. "1500000"). + raw_amount:, + # The status of the wallet action. + status:, + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + steps:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = + T.let( + :failed, + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_WITHDRAW_FAILED = + T.let( + :"wallet_action.earn_withdraw.failed", + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawFailedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rbi new file mode 100644 index 0000000..c30782c --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rbi @@ -0,0 +1,251 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnWithdrawRejectedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnWithdrawRejectedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Base-unit amount of asset withdrawn (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action at the time of rejection. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_withdraw.rejected webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason::OrHash, + raw_amount: String, + status: + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Base-unit amount of asset withdrawn (e.g. "1500000"). + raw_amount:, + # The status of the wallet action. + status:, + # The steps of the wallet action at the time of rejection. + steps:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REJECTED = + T.let( + :rejected, + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_WITHDRAW_REJECTED = + T.let( + :"wallet_action.earn_withdraw.rejected", + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawRejectedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rbi b/rbi/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rbi new file mode 100644 index 0000000..6d18365 --- /dev/null +++ b/rbi/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rbi @@ -0,0 +1,248 @@ +# typed: strong + +module Privy + module Models + class WalletActionEarnWithdrawSucceededWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionEarnWithdrawSucceededWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Underlying asset token address. + sig { returns(String) } + attr_accessor :asset_address + + # CAIP-2 chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Base-unit amount of asset withdrawn (e.g. "1500000"). + sig { returns(String) } + attr_accessor :raw_amount + + # Vault shares burned in base units. + sig { returns(String) } + attr_accessor :share_amount + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action, including transaction hashes. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # ERC-4626 vault contract address. + sig { returns(String) } + attr_accessor :vault_address + + # The vault ID. + sig { returns(String) } + attr_accessor :vault_id + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :amount + + sig { params(amount: String).void } + attr_writer :amount + + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + sig { returns(T.nilable(String)) } + attr_reader :asset + + sig { params(asset: String).void } + attr_writer :asset + + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + sig { returns(T.nilable(Integer)) } + attr_reader :decimals + + sig { params(decimals: Integer).void } + attr_writer :decimals + + # Payload for the wallet_action.earn_withdraw.succeeded webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + share_amount: String, + status: + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Type::OrSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Underlying asset token address. + asset_address:, + # CAIP-2 chain identifier. + caip2:, + # Base-unit amount of asset withdrawn (e.g. "1500000"). + raw_amount:, + # Vault shares burned in base units. + share_amount:, + # The status of the wallet action. + status:, + # The steps of the wallet action, including transaction hashes. + steps:, + # The type of webhook event. + type:, + # ERC-4626 vault contract address. + vault_address:, + # The vault ID. + vault_id:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when + # the token is known in the asset registry. + amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in + # the asset registry. + asset: nil, + # Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only + # present when the token is known in the asset registry. + decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + asset_address: String, + caip2: String, + raw_amount: String, + share_amount: String, + status: + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Type::TaggedSymbol, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCEEDED = + T.let( + :succeeded, + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_EARN_WITHDRAW_SUCCEEDED = + T.let( + :"wallet_action.earn_withdraw.succeeded", + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionEarnWithdrawSucceededWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_response.rbi b/rbi/privy/models/wallet_action_response.rbi new file mode 100644 index 0000000..d022762 --- /dev/null +++ b/rbi/privy/models/wallet_action_response.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Privy + module Models + # Response for a wallet action, discriminated on type. + module WalletActionResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::SwapActionResponse, + Privy::TransferActionResponse, + Privy::EarnDepositActionResponse, + Privy::EarnWithdrawActionResponse, + Privy::EarnIncentiveClaimActionResponse + ) + end + + sig { override.returns(T::Array[Privy::WalletActionResponse::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/wallet_action_status.rbi b/rbi/privy/models/wallet_action_status.rbi new file mode 100644 index 0000000..9dfb506 --- /dev/null +++ b/rbi/privy/models/wallet_action_status.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # Status of a wallet action. + module WalletActionStatus + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletActionStatus) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = T.let(:pending, Privy::WalletActionStatus::TaggedSymbol) + SUCCEEDED = T.let(:succeeded, Privy::WalletActionStatus::TaggedSymbol) + REJECTED = T.let(:rejected, Privy::WalletActionStatus::TaggedSymbol) + FAILED = T.let(:failed, Privy::WalletActionStatus::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::WalletActionStatus::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_action_step.rbi b/rbi/privy/models/wallet_action_step.rbi new file mode 100644 index 0000000..cf8263d --- /dev/null +++ b/rbi/privy/models/wallet_action_step.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # A step within a wallet action, representing a single onchain action. + module WalletActionStep + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::EvmTransactionWalletActionStep, + Privy::EvmUserOperationWalletActionStep, + Privy::SvmTransactionWalletActionStep, + Privy::ExternalTransactionWalletActionStep + ) + end + + sig { override.returns(T::Array[Privy::WalletActionStep::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/wallet_action_step_type.rbi b/rbi/privy/models/wallet_action_step_type.rbi new file mode 100644 index 0000000..c81a405 --- /dev/null +++ b/rbi/privy/models/wallet_action_step_type.rbi @@ -0,0 +1,28 @@ +# typed: strong + +module Privy + module Models + # Type of a wallet action step. + module WalletActionStepType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletActionStepType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + EVM_TRANSACTION = + T.let(:evm_transaction, Privy::WalletActionStepType::TaggedSymbol) + EVM_USER_OPERATION = + T.let(:evm_user_operation, Privy::WalletActionStepType::TaggedSymbol) + SVM_TRANSACTION = + T.let(:svm_transaction, Privy::WalletActionStepType::TaggedSymbol) + EXTERNAL_TRANSACTION = + T.let(:external_transaction, Privy::WalletActionStepType::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::WalletActionStepType::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_action_swap_created_webhook_payload.rbi b/rbi/privy/models/wallet_action_swap_created_webhook_payload.rbi new file mode 100644 index 0000000..c19366b --- /dev/null +++ b/rbi/privy/models/wallet_action_swap_created_webhook_payload.rbi @@ -0,0 +1,170 @@ +# typed: strong + +module Privy + module Models + class WalletActionSwapCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionSwapCreatedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Amount of input token in base units. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :input_amount + + # Token address being sold. + sig { returns(String) } + attr_accessor :input_token + + # Token address being bought. + sig { returns(String) } + attr_accessor :output_token + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionSwapCreatedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The type of webhook event. + sig do + returns( + Privy::WalletActionSwapCreatedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.swap.created webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + caip2: String, + input_amount: T.nilable(String), + input_token: String, + output_token: String, + status: + Privy::WalletActionSwapCreatedWebhookPayload::Status::OrSymbol, + type: Privy::WalletActionSwapCreatedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Chain identifier. + caip2:, + # Amount of input token in base units. Populated after on-chain confirmation. + input_amount:, + # Token address being sold. + input_token:, + # Token address being bought. + output_token:, + # The status of the wallet action. + status:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + caip2: String, + input_amount: T.nilable(String), + input_token: String, + output_token: String, + status: + Privy::WalletActionSwapCreatedWebhookPayload::Status::TaggedSymbol, + type: + Privy::WalletActionSwapCreatedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionSwapCreatedWebhookPayload::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Privy::WalletActionSwapCreatedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapCreatedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionSwapCreatedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_SWAP_CREATED = + T.let( + :"wallet_action.swap.created", + Privy::WalletActionSwapCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapCreatedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_swap_failed_webhook_payload.rbi b/rbi/privy/models/wallet_action_swap_failed_webhook_payload.rbi new file mode 100644 index 0000000..d1c664d --- /dev/null +++ b/rbi/privy/models/wallet_action_swap_failed_webhook_payload.rbi @@ -0,0 +1,196 @@ +# typed: strong + +module Privy + module Models + class WalletActionSwapFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionSwapFailedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Amount of input token in base units. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :input_amount + + # Token address being sold. + sig { returns(String) } + attr_accessor :input_token + + # Token address being bought. + sig { returns(String) } + attr_accessor :output_token + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionSwapFailedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns(Privy::WalletActionSwapFailedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.swap.failed webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + caip2: String, + failure_reason: Privy::FailureReason::OrHash, + input_amount: T.nilable(String), + input_token: String, + output_token: String, + status: Privy::WalletActionSwapFailedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: Privy::WalletActionSwapFailedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Chain identifier. + caip2:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Amount of input token in base units. Populated after on-chain confirmation. + input_amount:, + # Token address being sold. + input_token:, + # Token address being bought. + output_token:, + # The status of the wallet action. + status:, + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + caip2: String, + failure_reason: Privy::FailureReason, + input_amount: T.nilable(String), + input_token: String, + output_token: String, + status: + Privy::WalletActionSwapFailedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionSwapFailedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionSwapFailedWebhookPayload::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = + T.let( + :failed, + Privy::WalletActionSwapFailedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapFailedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionSwapFailedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_SWAP_FAILED = + T.let( + :"wallet_action.swap.failed", + Privy::WalletActionSwapFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapFailedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_swap_rejected_webhook_payload.rbi b/rbi/privy/models/wallet_action_swap_rejected_webhook_payload.rbi new file mode 100644 index 0000000..af6c904 --- /dev/null +++ b/rbi/privy/models/wallet_action_swap_rejected_webhook_payload.rbi @@ -0,0 +1,197 @@ +# typed: strong + +module Privy + module Models + class WalletActionSwapRejectedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionSwapRejectedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Amount of input token in base units. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :input_amount + + # Token address being sold. + sig { returns(String) } + attr_accessor :input_token + + # Token address being bought. + sig { returns(String) } + attr_accessor :output_token + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionSwapRejectedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action at the time of rejection. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionSwapRejectedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.swap.rejected webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + caip2: String, + failure_reason: Privy::FailureReason::OrHash, + input_amount: T.nilable(String), + input_token: String, + output_token: String, + status: + Privy::WalletActionSwapRejectedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: Privy::WalletActionSwapRejectedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Chain identifier. + caip2:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Amount of input token in base units. Populated after on-chain confirmation. + input_amount:, + # Token address being sold. + input_token:, + # Token address being bought. + output_token:, + # The status of the wallet action. + status:, + # The steps of the wallet action at the time of rejection. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + caip2: String, + failure_reason: Privy::FailureReason, + input_amount: T.nilable(String), + input_token: String, + output_token: String, + status: + Privy::WalletActionSwapRejectedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionSwapRejectedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionSwapRejectedWebhookPayload::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REJECTED = + T.let( + :rejected, + Privy::WalletActionSwapRejectedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapRejectedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionSwapRejectedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_SWAP_REJECTED = + T.let( + :"wallet_action.swap.rejected", + Privy::WalletActionSwapRejectedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapRejectedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_swap_succeeded_webhook_payload.rbi b/rbi/privy/models/wallet_action_swap_succeeded_webhook_payload.rbi new file mode 100644 index 0000000..ddf2dbc --- /dev/null +++ b/rbi/privy/models/wallet_action_swap_succeeded_webhook_payload.rbi @@ -0,0 +1,199 @@ +# typed: strong + +module Privy + module Models + class WalletActionSwapSucceededWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionSwapSucceededWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Chain identifier. + sig { returns(String) } + attr_accessor :caip2 + + # Amount of input token in base units. Populated after on-chain confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :input_amount + + # Token address being sold. + sig { returns(String) } + attr_accessor :input_token + + # Amount of output token received, in base units. Populated after on-chain + # confirmation. + sig { returns(T.nilable(String)) } + attr_accessor :output_amount + + # Token address being bought. + sig { returns(String) } + attr_accessor :output_token + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionSwapSucceededWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action, including transaction hashes. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionSwapSucceededWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet_action.swap.succeeded webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + caip2: String, + input_amount: T.nilable(String), + input_token: String, + output_amount: T.nilable(String), + output_token: String, + status: + Privy::WalletActionSwapSucceededWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: Privy::WalletActionSwapSucceededWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Chain identifier. + caip2:, + # Amount of input token in base units. Populated after on-chain confirmation. + input_amount:, + # Token address being sold. + input_token:, + # Amount of output token received, in base units. Populated after on-chain + # confirmation. + output_amount:, + # Token address being bought. + output_token:, + # The status of the wallet action. + status:, + # The steps of the wallet action, including transaction hashes. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id: + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + caip2: String, + input_amount: T.nilable(String), + input_token: String, + output_amount: T.nilable(String), + output_token: String, + status: + Privy::WalletActionSwapSucceededWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionSwapSucceededWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionSwapSucceededWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCEEDED = + T.let( + :succeeded, + Privy::WalletActionSwapSucceededWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapSucceededWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionSwapSucceededWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_SWAP_SUCCEEDED = + T.let( + :"wallet_action.swap.succeeded", + Privy::WalletActionSwapSucceededWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionSwapSucceededWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_transfer_created_webhook_payload.rbi b/rbi/privy/models/wallet_action_transfer_created_webhook_payload.rbi new file mode 100644 index 0000000..557948e --- /dev/null +++ b/rbi/privy/models/wallet_action_transfer_created_webhook_payload.rbi @@ -0,0 +1,213 @@ +# typed: strong + +module Privy + module Models + class WalletActionTransferCreatedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionTransferCreatedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Recipient address. + sig { returns(String) } + attr_accessor :destination_address + + # Chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :source_chain + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionTransferCreatedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The type of webhook event. + sig do + returns( + Privy::WalletActionTransferCreatedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + sig { returns(T.nilable(String)) } + attr_reader :source_amount + + sig { params(source_amount: String).void } + attr_writer :source_amount + + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + sig { returns(T.nilable(String)) } + attr_reader :source_asset + + sig { params(source_asset: String).void } + attr_writer :source_asset + + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + sig { returns(T.nilable(String)) } + attr_reader :source_asset_address + + sig { params(source_asset_address: String).void } + attr_writer :source_asset_address + + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + sig { returns(T.nilable(Integer)) } + attr_reader :source_asset_decimals + + sig { params(source_asset_decimals: Integer).void } + attr_writer :source_asset_decimals + + # Payload for the wallet_action.transfer.created webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + destination_address: String, + source_chain: String, + status: + Privy::WalletActionTransferCreatedWebhookPayload::Status::OrSymbol, + type: + Privy::WalletActionTransferCreatedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Recipient address. + destination_address:, + # Chain name (e.g. "base", "ethereum"). + source_chain:, + # The status of the wallet action. + status:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + source_amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + source_asset: nil, + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + source_asset_address: nil, + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + source_asset_decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + destination_address: String, + source_chain: String, + status: + Privy::WalletActionTransferCreatedWebhookPayload::Status::TaggedSymbol, + type: + Privy::WalletActionTransferCreatedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionTransferCreatedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PENDING = + T.let( + :pending, + Privy::WalletActionTransferCreatedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferCreatedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionTransferCreatedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_TRANSFER_CREATED = + T.let( + :"wallet_action.transfer.created", + Privy::WalletActionTransferCreatedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferCreatedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_transfer_failed_webhook_payload.rbi b/rbi/privy/models/wallet_action_transfer_failed_webhook_payload.rbi new file mode 100644 index 0000000..d72eef1 --- /dev/null +++ b/rbi/privy/models/wallet_action_transfer_failed_webhook_payload.rbi @@ -0,0 +1,238 @@ +# typed: strong + +module Privy + module Models + class WalletActionTransferFailedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionTransferFailedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Recipient address. + sig { returns(String) } + attr_accessor :destination_address + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :source_chain + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionTransferFailedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionTransferFailedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + sig { returns(T.nilable(String)) } + attr_reader :source_amount + + sig { params(source_amount: String).void } + attr_writer :source_amount + + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + sig { returns(T.nilable(String)) } + attr_reader :source_asset + + sig { params(source_asset: String).void } + attr_writer :source_asset + + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + sig { returns(T.nilable(String)) } + attr_reader :source_asset_address + + sig { params(source_asset_address: String).void } + attr_writer :source_asset_address + + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + sig { returns(T.nilable(Integer)) } + attr_reader :source_asset_decimals + + sig { params(source_asset_decimals: Integer).void } + attr_writer :source_asset_decimals + + # Payload for the wallet_action.transfer.failed webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + destination_address: String, + failure_reason: Privy::FailureReason::OrHash, + source_chain: String, + status: + Privy::WalletActionTransferFailedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: Privy::WalletActionTransferFailedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Recipient address. + destination_address:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Chain name (e.g. "base", "ethereum"). + source_chain:, + # The status of the wallet action. + status:, + # The steps of the wallet action. Completed steps will have transaction hashes; + # the failing step will have a failure_reason. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + source_amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + source_asset: nil, + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + source_asset_address: nil, + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + source_asset_decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: + Privy::WalletActionTransferFailedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionTransferFailedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionTransferFailedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + FAILED = + T.let( + :failed, + Privy::WalletActionTransferFailedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferFailedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletActionTransferFailedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_TRANSFER_FAILED = + T.let( + :"wallet_action.transfer.failed", + Privy::WalletActionTransferFailedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferFailedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_transfer_rejected_webhook_payload.rbi b/rbi/privy/models/wallet_action_transfer_rejected_webhook_payload.rbi new file mode 100644 index 0000000..c79def9 --- /dev/null +++ b/rbi/privy/models/wallet_action_transfer_rejected_webhook_payload.rbi @@ -0,0 +1,240 @@ +# typed: strong + +module Privy + module Models + class WalletActionTransferRejectedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionTransferRejectedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Recipient address. + sig { returns(String) } + attr_accessor :destination_address + + # A description of why a wallet action (or a step within a wallet action) failed. + sig { returns(Privy::FailureReason) } + attr_reader :failure_reason + + sig { params(failure_reason: Privy::FailureReason::OrHash).void } + attr_writer :failure_reason + + # Chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :source_chain + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionTransferRejectedWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action at the time of rejection. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionTransferRejectedWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + sig { returns(T.nilable(String)) } + attr_reader :source_amount + + sig { params(source_amount: String).void } + attr_writer :source_amount + + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + sig { returns(T.nilable(String)) } + attr_reader :source_asset + + sig { params(source_asset: String).void } + attr_writer :source_asset + + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + sig { returns(T.nilable(String)) } + attr_reader :source_asset_address + + sig { params(source_asset_address: String).void } + attr_writer :source_asset_address + + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + sig { returns(T.nilable(Integer)) } + attr_reader :source_asset_decimals + + sig { params(source_asset_decimals: Integer).void } + attr_writer :source_asset_decimals + + # Payload for the wallet_action.transfer.rejected webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + destination_address: String, + failure_reason: Privy::FailureReason::OrHash, + source_chain: String, + status: + Privy::WalletActionTransferRejectedWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionTransferRejectedWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Recipient address. + destination_address:, + # A description of why a wallet action (or a step within a wallet action) failed. + failure_reason:, + # Chain name (e.g. "base", "ethereum"). + source_chain:, + # The status of the wallet action. + status:, + # The steps of the wallet action at the time of rejection. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + source_amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + source_asset: nil, + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + source_asset_address: nil, + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + source_asset_decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: + Privy::WalletActionTransferRejectedWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionTransferRejectedWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionTransferRejectedWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + REJECTED = + T.let( + :rejected, + Privy::WalletActionTransferRejectedWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferRejectedWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionTransferRejectedWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_TRANSFER_REJECTED = + T.let( + :"wallet_action.transfer.rejected", + Privy::WalletActionTransferRejectedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferRejectedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_transfer_succeeded_webhook_payload.rbi b/rbi/privy/models/wallet_action_transfer_succeeded_webhook_payload.rbi new file mode 100644 index 0000000..7e45c05 --- /dev/null +++ b/rbi/privy/models/wallet_action_transfer_succeeded_webhook_payload.rbi @@ -0,0 +1,229 @@ +# typed: strong + +module Privy + module Models + class WalletActionTransferSucceededWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletActionTransferSucceededWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # Type of wallet action + sig { returns(Privy::WalletActionType::TaggedSymbol) } + attr_accessor :action_type + + # Recipient address. + sig { returns(String) } + attr_accessor :destination_address + + # Chain name (e.g. "base", "ethereum"). + sig { returns(String) } + attr_accessor :source_chain + + # The status of the wallet action. + sig do + returns( + Privy::WalletActionTransferSucceededWebhookPayload::Status::TaggedSymbol + ) + end + attr_accessor :status + + # The steps of the wallet action, including transaction hashes. + sig { returns(T::Array[Privy::WalletActionStep::Variants]) } + attr_accessor :steps + + # The type of webhook event. + sig do + returns( + Privy::WalletActionTransferSucceededWebhookPayload::Type::TaggedSymbol + ) + end + attr_accessor :type + + # The ID of the wallet action. + sig { returns(String) } + attr_accessor :wallet_action_id + + # The ID of the wallet involved in the action. + sig { returns(String) } + attr_accessor :wallet_id + + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + sig { returns(T.nilable(String)) } + attr_reader :source_amount + + sig { params(source_amount: String).void } + attr_writer :source_amount + + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + sig { returns(T.nilable(String)) } + attr_reader :source_asset + + sig { params(source_asset: String).void } + attr_writer :source_asset + + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + sig { returns(T.nilable(String)) } + attr_reader :source_asset_address + + sig { params(source_asset_address: String).void } + attr_writer :source_asset_address + + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + sig { returns(T.nilable(Integer)) } + attr_reader :source_asset_decimals + + sig { params(source_asset_decimals: Integer).void } + attr_writer :source_asset_decimals + + # Payload for the wallet_action.transfer.succeeded webhook event. + sig do + params( + action_type: Privy::WalletActionType::OrSymbol, + destination_address: String, + source_chain: String, + status: + Privy::WalletActionTransferSucceededWebhookPayload::Status::OrSymbol, + steps: + T::Array[ + T.any( + Privy::EvmTransactionWalletActionStep::OrHash, + Privy::EvmUserOperationWalletActionStep::OrHash, + Privy::SvmTransactionWalletActionStep::OrHash, + Privy::ExternalTransactionWalletActionStep::OrHash + ) + ], + type: + Privy::WalletActionTransferSucceededWebhookPayload::Type::OrSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + ).returns(T.attached_class) + end + def self.new( + # Type of wallet action + action_type:, + # Recipient address. + destination_address:, + # Chain name (e.g. "base", "ethereum"). + source_chain:, + # The status of the wallet action. + status:, + # The steps of the wallet action, including transaction hashes. + steps:, + # The type of webhook event. + type:, + # The ID of the wallet action. + wallet_action_id:, + # The ID of the wallet involved in the action. + wallet_id:, + # Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output + # cross-chain transfers until the source amount is determined. + source_amount: nil, + # Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated + # with a named asset; omitted for custom-token transfers. + source_asset: nil, + # Token contract address (EVM) or mint address (Solana). Present when the transfer + # was initiated with `asset_address`. + source_asset_address: nil, + # Number of decimals for the transferred token. Present when the transfer was + # initiated with `asset_address` and the decimals were resolved on-chain. + source_asset_decimals: nil + ) + end + + sig do + override.returns( + { + action_type: Privy::WalletActionType::TaggedSymbol, + destination_address: String, + source_chain: String, + status: + Privy::WalletActionTransferSucceededWebhookPayload::Status::TaggedSymbol, + steps: T::Array[Privy::WalletActionStep::Variants], + type: + Privy::WalletActionTransferSucceededWebhookPayload::Type::TaggedSymbol, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + ) + end + def to_hash + end + + # The status of the wallet action. + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionTransferSucceededWebhookPayload::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SUCCEEDED = + T.let( + :succeeded, + Privy::WalletActionTransferSucceededWebhookPayload::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferSucceededWebhookPayload::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletActionTransferSucceededWebhookPayload::Type + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_ACTION_TRANSFER_SUCCEEDED = + T.let( + :"wallet_action.transfer.succeeded", + Privy::WalletActionTransferSucceededWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletActionTransferSucceededWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_action_type.rbi b/rbi/privy/models/wallet_action_type.rbi new file mode 100644 index 0000000..be6786b --- /dev/null +++ b/rbi/privy/models/wallet_action_type.rbi @@ -0,0 +1,25 @@ +# typed: strong + +module Privy + module Models + # Type of wallet action + module WalletActionType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletActionType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SWAP = T.let(:swap, Privy::WalletActionType::TaggedSymbol) + TRANSFER = T.let(:transfer, Privy::WalletActionType::TaggedSymbol) + EARN_DEPOSIT = T.let(:earn_deposit, Privy::WalletActionType::TaggedSymbol) + EARN_WITHDRAW = + T.let(:earn_withdraw, Privy::WalletActionType::TaggedSymbol) + EARN_INCENTIVE_CLAIM = + T.let(:earn_incentive_claim, Privy::WalletActionType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::WalletActionType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_additional_signer.rbi b/rbi/privy/models/wallet_additional_signer.rbi new file mode 100644 index 0000000..b0f529f --- /dev/null +++ b/rbi/privy/models/wallet_additional_signer.rbi @@ -0,0 +1,11 @@ +# typed: strong + +module Privy + module Models + WalletAdditionalSigner = + T.let( + Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem], + Privy::Internal::Type::Converter + ) + end +end diff --git a/rbi/privy/models/wallet_additional_signer_item.rbi b/rbi/privy/models/wallet_additional_signer_item.rbi new file mode 100644 index 0000000..57e30c8 --- /dev/null +++ b/rbi/privy/models/wallet_additional_signer_item.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class WalletAdditionalSignerItem < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletAdditionalSignerItem, Privy::Internal::AnyHash) + end + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :signer_id + + # An optional list of up to one policy ID to enforce on the wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :override_policy_ids + + sig { params(override_policy_ids: T::Array[String]).void } + attr_writer :override_policy_ids + + # A single additional signer on a wallet, with an optional policy override. + sig do + params( + signer_id: String, + override_policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for a key quorum. + signer_id:, + # An optional list of up to one policy ID to enforce on the wallet. + override_policy_ids: nil + ) + end + + sig do + override.returns( + { signer_id: String, override_policy_ids: T::Array[String] } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_api_register_authorization_key_input.rbi b/rbi/privy/models/wallet_api_register_authorization_key_input.rbi new file mode 100644 index 0000000..cd12111 --- /dev/null +++ b/rbi/privy/models/wallet_api_register_authorization_key_input.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class WalletAPIRegisterAuthorizationKeyInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletAPIRegisterAuthorizationKeyInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :public_key + + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + sig { returns(T.nilable(Privy::AuthorizationKeyRole::OrSymbol)) } + attr_accessor :role + + # Input for registering or updating an application public signing key for + # API-based wallet actions. + sig do + params( + public_key: String, + display_name: String, + role: T.nilable(Privy::AuthorizationKeyRole::OrSymbol) + ).returns(T.attached_class) + end + def self.new( + public_key:, + display_name: nil, + # The role of an authorization key, controlling what actions it can authorize on a + # wallet. + role: nil + ) + end + + sig do + override.returns( + { + public_key: String, + display_name: String, + role: T.nilable(Privy::AuthorizationKeyRole::OrSymbol) + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_api_revoke_authorization_key_input.rbi b/rbi/privy/models/wallet_api_revoke_authorization_key_input.rbi new file mode 100644 index 0000000..08aefb8 --- /dev/null +++ b/rbi/privy/models/wallet_api_revoke_authorization_key_input.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class WalletAPIRevokeAuthorizationKeyInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletAPIRevokeAuthorizationKeyInput, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :id + + # Input for revoking an application authorization key. + sig { params(id: String).returns(T.attached_class) } + def self.new(id:) + end + + sig { override.returns({ id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_asset.rbi b/rbi/privy/models/wallet_asset.rbi new file mode 100644 index 0000000..64bbad5 --- /dev/null +++ b/rbi/privy/models/wallet_asset.rbi @@ -0,0 +1,26 @@ +# typed: strong + +module Privy + module Models + # A named asset supported across all chains. + module WalletAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDC = T.let(:usdc, Privy::WalletAsset::TaggedSymbol) + USDC_E = T.let(:"usdc.e", Privy::WalletAsset::TaggedSymbol) + ETH = T.let(:eth, Privy::WalletAsset::TaggedSymbol) + POL = T.let(:pol, Privy::WalletAsset::TaggedSymbol) + USDT = T.let(:usdt, Privy::WalletAsset::TaggedSymbol) + EURC = T.let(:eurc, Privy::WalletAsset::TaggedSymbol) + USDB = T.let(:usdb, Privy::WalletAsset::TaggedSymbol) + SOL = T.let(:sol, Privy::WalletAsset::TaggedSymbol) + + sig { override.returns(T::Array[Privy::WalletAsset::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_authenticate_request_body.rbi b/rbi/privy/models/wallet_authenticate_request_body.rbi new file mode 100644 index 0000000..b7cd3a1 --- /dev/null +++ b/rbi/privy/models/wallet_authenticate_request_body.rbi @@ -0,0 +1,90 @@ +# typed: strong + +module Privy + module Models + class WalletAuthenticateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletAuthenticateRequestBody, Privy::Internal::AnyHash) + end + + # The encryption type for the authentication response. Currently only supports + # HPKE. + sig do + returns(Privy::WalletAuthenticateRequestBody::EncryptionType::OrSymbol) + end + attr_accessor :encryption_type + + # The public key of your ECDH keypair, in base64-encoded, SPKI-format, whose + # private key will be able to decrypt the session key. + sig { returns(String) } + attr_accessor :recipient_public_key + + # The user's JWT, to be used to authenticate the user. + sig { returns(String) } + attr_accessor :user_jwt + + # Request body for wallet authentication with HPKE-encrypted response. + sig do + params( + encryption_type: + Privy::WalletAuthenticateRequestBody::EncryptionType::OrSymbol, + recipient_public_key: String, + user_jwt: String + ).returns(T.attached_class) + end + def self.new( + # The encryption type for the authentication response. Currently only supports + # HPKE. + encryption_type:, + # The public key of your ECDH keypair, in base64-encoded, SPKI-format, whose + # private key will be able to decrypt the session key. + recipient_public_key:, + # The user's JWT, to be used to authenticate the user. + user_jwt: + ) + end + + sig do + override.returns( + { + encryption_type: + Privy::WalletAuthenticateRequestBody::EncryptionType::OrSymbol, + recipient_public_key: String, + user_jwt: String + } + ) + end + def to_hash + end + + # The encryption type for the authentication response. Currently only supports + # HPKE. + module EncryptionType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletAuthenticateRequestBody::EncryptionType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HPKE = + T.let( + :HPKE, + Privy::WalletAuthenticateRequestBody::EncryptionType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletAuthenticateRequestBody::EncryptionType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_authenticate_with_jwt_params.rbi b/rbi/privy/models/wallet_authenticate_with_jwt_params.rbi new file mode 100644 index 0000000..a309b7b --- /dev/null +++ b/rbi/privy/models/wallet_authenticate_with_jwt_params.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + class WalletAuthenticateWithJwtParams < Privy::Models::WalletAuthenticateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::WalletAuthenticateWithJwtParams, + Privy::Internal::AnyHash + ) + end + + sig do + params(request_options: Privy::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Privy::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_authenticate_with_jwt_response.rbi b/rbi/privy/models/wallet_authenticate_with_jwt_response.rbi new file mode 100644 index 0000000..6af4b55 --- /dev/null +++ b/rbi/privy/models/wallet_authenticate_with_jwt_response.rbi @@ -0,0 +1,231 @@ +# typed: strong + +module Privy + module Models + # The response from authenticating a wallet, containing an authorization key and + # wallet data. + module WalletAuthenticateWithJwtResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::WalletAuthenticateWithJwtResponse::WithEncryption, + Privy::WalletAuthenticateWithJwtResponse::WithoutEncryption + ) + end + + class WithEncryption < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletAuthenticateWithJwtResponse::WithEncryption, + Privy::Internal::AnyHash + ) + end + + # The encrypted authorization key data. + sig do + returns( + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey + ) + end + attr_reader :encrypted_authorization_key + + sig do + params( + encrypted_authorization_key: + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::OrHash + ).void + end + attr_writer :encrypted_authorization_key + + # The expiration time of the authorization key in milliseconds since the epoch. + sig { returns(Float) } + attr_accessor :expires_at + + sig { returns(T::Array[Privy::Wallet]) } + attr_accessor :wallets + + sig do + params( + encrypted_authorization_key: + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::OrHash, + expires_at: Float, + wallets: T::Array[Privy::Wallet::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The encrypted authorization key data. + encrypted_authorization_key:, + # The expiration time of the authorization key in milliseconds since the epoch. + expires_at:, + wallets: + ) + end + + sig do + override.returns( + { + encrypted_authorization_key: + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey, + expires_at: Float, + wallets: T::Array[Privy::Wallet] + } + ) + end + def to_hash + end + + class EncryptedAuthorizationKey < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey, + Privy::Internal::AnyHash + ) + end + + # The encrypted authorization key corresponding to the user's current + # authentication session. + sig { returns(String) } + attr_accessor :ciphertext + + # Base64-encoded ephemeral public key used in the HPKE encryption process. + # Required for decryption. + sig { returns(String) } + attr_accessor :encapsulated_key + + # The encryption type used. Currently only supports HPKE. + sig do + returns( + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType::TaggedSymbol + ) + end + attr_accessor :encryption_type + + # The encrypted authorization key data. + sig do + params( + ciphertext: String, + encapsulated_key: String, + encryption_type: + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The encrypted authorization key corresponding to the user's current + # authentication session. + ciphertext:, + # Base64-encoded ephemeral public key used in the HPKE encryption process. + # Required for decryption. + encapsulated_key:, + # The encryption type used. Currently only supports HPKE. + encryption_type: + ) + end + + sig do + override.returns( + { + ciphertext: String, + encapsulated_key: String, + encryption_type: + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType::TaggedSymbol + } + ) + end + def to_hash + end + + # The encryption type used. Currently only supports HPKE. + module EncryptionType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HPKE = + T.let( + :HPKE, + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::EncryptionType::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + + class WithoutEncryption < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletAuthenticateWithJwtResponse::WithoutEncryption, + Privy::Internal::AnyHash + ) + end + + # The raw authorization key data. + sig { returns(String) } + attr_accessor :authorization_key + + # The expiration time of the authorization key in milliseconds since the epoch. + sig { returns(Float) } + attr_accessor :expires_at + + sig { returns(T::Array[Privy::Wallet]) } + attr_accessor :wallets + + sig do + params( + authorization_key: String, + expires_at: Float, + wallets: T::Array[Privy::Wallet::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The raw authorization key data. + authorization_key:, + # The expiration time of the authorization key in milliseconds since the epoch. + expires_at:, + wallets: + ) + end + + sig do + override.returns( + { + authorization_key: String, + expires_at: Float, + wallets: T::Array[Privy::Wallet] + } + ) + end + def to_hash + end + end + + sig do + override.returns( + T::Array[Privy::WalletAuthenticateWithJwtResponse::Variants] + ) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/wallet_authorization_headers.rbi b/rbi/privy/models/wallet_authorization_headers.rbi new file mode 100644 index 0000000..1d42086 --- /dev/null +++ b/rbi/privy/models/wallet_authorization_headers.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class WalletAuthorizationHeaders < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletAuthorizationHeaders, Privy::Internal::AnyHash) + end + + # ID of your Privy app. + sig { returns(String) } + attr_accessor :privy_app_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + # Headers required to authorize wallet operations. + sig do + params( + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + ).returns(T.attached_class) + end + def self.new( + # ID of your Privy app. + privy_app_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil + ) + end + + sig do + override.returns( + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_batch_create_input.rbi b/rbi/privy/models/wallet_batch_create_input.rbi new file mode 100644 index 0000000..2389315 --- /dev/null +++ b/rbi/privy/models/wallet_batch_create_input.rbi @@ -0,0 +1,34 @@ +# typed: strong + +module Privy + module Models + class WalletBatchCreateInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletBatchCreateInput, Privy::Internal::AnyHash) + end + + # Array of wallet creation requests. Minimum 1, maximum 100. + sig { returns(T::Array[Privy::WalletBatchItemInput]) } + attr_accessor :wallets + + # Request body for batch wallet creation. + sig do + params(wallets: T::Array[Privy::WalletBatchItemInput::OrHash]).returns( + T.attached_class + ) + end + def self.new( + # Array of wallet creation requests. Minimum 1, maximum 100. + wallets: + ) + end + + sig do + override.returns({ wallets: T::Array[Privy::WalletBatchItemInput] }) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_batch_create_response.rbi b/rbi/privy/models/wallet_batch_create_response.rbi new file mode 100644 index 0000000..793883f --- /dev/null +++ b/rbi/privy/models/wallet_batch_create_response.rbi @@ -0,0 +1,59 @@ +# typed: strong + +module Privy + module Models + class WalletBatchCreateResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletBatchCreateResponse, Privy::Internal::AnyHash) + end + + # Array of results for each wallet creation request, in the same order as input. + sig do + returns( + T::Array[ + T.any( + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess, + Privy::WalletBatchCreateResult::WalletBatchCreateFailure + ) + ] + ) + end + attr_accessor :results + + # Response for a batch wallet creation request. + sig do + params( + results: + T::Array[ + T.any( + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::OrHash, + Privy::WalletBatchCreateResult::WalletBatchCreateFailure::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new( + # Array of results for each wallet creation request, in the same order as input. + results: + ) + end + + sig do + override.returns( + { + results: + T::Array[ + T.any( + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess, + Privy::WalletBatchCreateResult::WalletBatchCreateFailure + ) + ] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_batch_create_result.rbi b/rbi/privy/models/wallet_batch_create_result.rbi new file mode 100644 index 0000000..7134e6f --- /dev/null +++ b/rbi/privy/models/wallet_batch_create_result.rbi @@ -0,0 +1,207 @@ +# typed: strong + +module Privy + module Models + # A single result from a batch wallet creation operation. + module WalletBatchCreateResult + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess, + Privy::WalletBatchCreateResult::WalletBatchCreateFailure + ) + end + + class WalletBatchCreateSuccess < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess, + Privy::Internal::AnyHash + ) + end + + # The index of the wallet in the original request array. + sig { returns(Float) } + attr_accessor :index + + sig do + returns( + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::Success::OrBoolean + ) + end + attr_accessor :success + + # A wallet managed by Privy's wallet infrastructure. + sig { returns(Privy::Wallet) } + attr_reader :wallet + + sig { params(wallet: Privy::Wallet::OrHash).void } + attr_writer :wallet + + # A successful wallet creation result within a batch operation. + sig do + params( + index: Float, + success: + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::Success::OrBoolean, + wallet: Privy::Wallet::OrHash + ).returns(T.attached_class) + end + def self.new( + # The index of the wallet in the original request array. + index:, + success:, + # A wallet managed by Privy's wallet infrastructure. + wallet: + ) + end + + sig do + override.returns( + { + index: Float, + success: + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::Success::OrBoolean, + wallet: Privy::Wallet + } + ) + end + def to_hash + end + + module Success + extend Privy::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::Success + ) + end + OrBoolean = T.type_alias { T::Boolean } + + TRUE = + T.let( + true, + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::Success::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess::Success::TaggedBoolean + ] + ) + end + def self.values + end + end + end + + class WalletBatchCreateFailure < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletBatchCreateResult::WalletBatchCreateFailure, + Privy::Internal::AnyHash + ) + end + + # A PrivyErrorCode string identifying the error type (e.g., "invalid_data", + # "resource_conflict"). + sig { returns(String) } + attr_accessor :code + + # A human-readable error message with details about what went wrong. + sig { returns(String) } + attr_accessor :error + + # The index of the wallet in the original request array. + sig { returns(Float) } + attr_accessor :index + + sig do + returns( + Privy::WalletBatchCreateResult::WalletBatchCreateFailure::Success::OrBoolean + ) + end + attr_accessor :success + + # A failed wallet creation result within a batch operation. + sig do + params( + code: String, + error: String, + index: Float, + success: + Privy::WalletBatchCreateResult::WalletBatchCreateFailure::Success::OrBoolean + ).returns(T.attached_class) + end + def self.new( + # A PrivyErrorCode string identifying the error type (e.g., "invalid_data", + # "resource_conflict"). + code:, + # A human-readable error message with details about what went wrong. + error:, + # The index of the wallet in the original request array. + index:, + success: + ) + end + + sig do + override.returns( + { + code: String, + error: String, + index: Float, + success: + Privy::WalletBatchCreateResult::WalletBatchCreateFailure::Success::OrBoolean + } + ) + end + def to_hash + end + + module Success + extend Privy::Internal::Type::Enum + + TaggedBoolean = + T.type_alias do + T.all( + T::Boolean, + Privy::WalletBatchCreateResult::WalletBatchCreateFailure::Success + ) + end + OrBoolean = T.type_alias { T::Boolean } + + FALSE = + T.let( + false, + Privy::WalletBatchCreateResult::WalletBatchCreateFailure::Success::TaggedBoolean + ) + + sig do + override.returns( + T::Array[ + Privy::WalletBatchCreateResult::WalletBatchCreateFailure::Success::TaggedBoolean + ] + ) + end + def self.values + end + end + end + + sig do + override.returns(T::Array[Privy::WalletBatchCreateResult::Variants]) + end + def self.variants + end + end + end +end diff --git a/rbi/privy/models/wallet_batch_item_input.rbi b/rbi/privy/models/wallet_batch_item_input.rbi new file mode 100644 index 0000000..fb9c73c --- /dev/null +++ b/rbi/privy/models/wallet_batch_item_input.rbi @@ -0,0 +1,126 @@ +# typed: strong + +module Privy + module Models + class WalletBatchItemInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletBatchItemInput, Privy::Internal::AnyHash) + end + + # The wallet chain types. + sig { returns(Privy::WalletChainType::OrSymbol) } + attr_accessor :chain_type + + # Additional signers for the wallet. + sig { returns(T.nilable(T::Array[Privy::AdditionalSignerItemInput])) } + attr_reader :additional_signers + + sig do + params( + additional_signers: T::Array[Privy::AdditionalSignerItemInput::OrHash] + ).void + end + attr_writer :additional_signers + + # A human-readable label for the wallet. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # List of policy IDs for policies that should be enforced on the wallet. + # Currently, only one policy is supported per wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + # Input for a single wallet in a batch creation request. + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The wallet chain types. + chain_type:, + # Additional signers for the wallet. + additional_signers: nil, + # A human-readable label for the wallet. + display_name: nil, + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + external_id: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + # List of policy IDs for policies that should be enforced on the wallet. + # Currently, only one policy is supported per wallet. + policy_ids: nil + ) + end + + sig do + override.returns( + { + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: T::Array[Privy::AdditionalSignerItemInput], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_chain_type.rbi b/rbi/privy/models/wallet_chain_type.rbi new file mode 100644 index 0000000..f3701d5 --- /dev/null +++ b/rbi/privy/models/wallet_chain_type.rbi @@ -0,0 +1,35 @@ +# typed: strong + +module Privy + module Models + # The wallet chain types. + module WalletChainType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletChainType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = T.let(:ethereum, Privy::WalletChainType::TaggedSymbol) + SOLANA = T.let(:solana, Privy::WalletChainType::TaggedSymbol) + COSMOS = T.let(:cosmos, Privy::WalletChainType::TaggedSymbol) + STELLAR = T.let(:stellar, Privy::WalletChainType::TaggedSymbol) + SUI = T.let(:sui, Privy::WalletChainType::TaggedSymbol) + APTOS = T.let(:aptos, Privy::WalletChainType::TaggedSymbol) + MOVEMENT = T.let(:movement, Privy::WalletChainType::TaggedSymbol) + TRON = T.let(:tron, Privy::WalletChainType::TaggedSymbol) + BITCOIN_SEGWIT = + T.let(:"bitcoin-segwit", Privy::WalletChainType::TaggedSymbol) + BITCOIN_TAPROOT = + T.let(:"bitcoin-taproot", Privy::WalletChainType::TaggedSymbol) + PEARL = T.let(:pearl, Privy::WalletChainType::TaggedSymbol) + NEAR = T.let(:near, Privy::WalletChainType::TaggedSymbol) + TON = T.let(:ton, Privy::WalletChainType::TaggedSymbol) + STARKNET = T.let(:starknet, Privy::WalletChainType::TaggedSymbol) + SPARK = T.let(:spark, Privy::WalletChainType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::WalletChainType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_create_params.rbi b/rbi/privy/models/wallet_create_params.rbi new file mode 100644 index 0000000..060a1cd --- /dev/null +++ b/rbi/privy/models/wallet_create_params.rbi @@ -0,0 +1,142 @@ +# typed: strong + +module Privy + module Models + class WalletCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletCreateParams, Privy::Internal::AnyHash) + end + + # The wallet chain types. + sig { returns(Privy::WalletChainType::OrSymbol) } + attr_accessor :chain_type + + # Additional signers for the wallet. + sig { returns(T.nilable(T::Array[Privy::AdditionalSignerItemInput])) } + attr_reader :additional_signers + + sig do + params( + additional_signers: T::Array[Privy::AdditionalSignerItemInput::OrHash] + ).void + end + attr_writer :additional_signers + + # A human-readable label for the wallet. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # An optional list of up to one policy ID to enforce on the wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + privy_idempotency_key: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The wallet chain types. + chain_type:, + # Additional signers for the wallet. + additional_signers: nil, + # A human-readable label for the wallet. + display_name: nil, + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + external_id: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + # An optional list of up to one policy ID to enforce on the wallet. + policy_ids: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: T::Array[Privy::AdditionalSignerItemInput], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + privy_idempotency_key: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_create_wallets_with_recovery_params.rbi b/rbi/privy/models/wallet_create_wallets_with_recovery_params.rbi new file mode 100644 index 0000000..1c396fe --- /dev/null +++ b/rbi/privy/models/wallet_create_wallets_with_recovery_params.rbi @@ -0,0 +1,258 @@ +# typed: strong + +module Privy + module Models + class WalletCreateWalletsWithRecoveryParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::WalletCreateWalletsWithRecoveryParams, + Privy::Internal::AnyHash + ) + end + + sig do + returns(Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner) + end + attr_reader :primary_signer + + sig do + params( + primary_signer: + Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner::OrHash + ).void + end + attr_writer :primary_signer + + sig do + returns(Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser) + end + attr_reader :recovery_user + + sig do + params( + recovery_user: + Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser::OrHash + ).void + end + attr_writer :recovery_user + + sig do + returns(T::Array[Privy::WalletCreateWalletsWithRecoveryParams::Wallet]) + end + attr_accessor :wallets + + sig do + params( + primary_signer: + Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner::OrHash, + recovery_user: + Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser::OrHash, + wallets: + T::Array[ + Privy::WalletCreateWalletsWithRecoveryParams::Wallet::OrHash + ], + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + primary_signer:, + recovery_user:, + wallets:, + request_options: {} + ) + end + + sig do + override.returns( + { + primary_signer: + Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner, + recovery_user: + Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser, + wallets: + T::Array[Privy::WalletCreateWalletsWithRecoveryParams::Wallet], + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + class PrimarySigner < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner, + Privy::Internal::AnyHash + ) + end + + # The JWT subject ID of the user. + sig { returns(String) } + attr_accessor :subject_id + + sig { params(subject_id: String).returns(T.attached_class) } + def self.new( + # The JWT subject ID of the user. + subject_id: + ) + end + + sig { override.returns({ subject_id: String }) } + def to_hash + end + end + + class RecoveryUser < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + T::Array[ + T.any( + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountCustomJwtInput + ) + ] + ) + end + attr_accessor :linked_accounts + + sig do + params( + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountEmailInput::OrHash, + Privy::LinkedAccountCustomJwtInput::OrHash + ) + ] + ).returns(T.attached_class) + end + def self.new(linked_accounts:) + end + + sig do + override.returns( + { + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountCustomJwtInput + ) + ] + } + ) + end + def to_hash + end + + # The payload for importing an email account. + module LinkedAccount + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::LinkedAccountEmailInput, + Privy::LinkedAccountCustomJwtInput + ) + end + + sig do + override.returns( + T::Array[ + Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser::LinkedAccount::Variants + ] + ) + end + def self.variants + end + end + end + + class Wallet < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletCreateWalletsWithRecoveryParams::Wallet, + Privy::Internal::AnyHash + ) + end + + # The wallet chain types. + sig { returns(Privy::WalletChainType::OrSymbol) } + attr_accessor :chain_type + + # A human-readable label for the wallet. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # An optional list of up to one policy ID to enforce on the wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + display_name: String, + external_id: String, + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The wallet chain types. + chain_type:, + # A human-readable label for the wallet. + display_name: nil, + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + external_id: nil, + # An optional list of up to one policy ID to enforce on the wallet. + policy_ids: nil + ) + end + + sig do + override.returns( + { + chain_type: Privy::WalletChainType::OrSymbol, + display_name: String, + external_id: String, + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end + end +end diff --git a/rbi/privy/models/wallet_create_wallets_with_recovery_response.rbi b/rbi/privy/models/wallet_create_wallets_with_recovery_response.rbi new file mode 100644 index 0000000..9c61b26 --- /dev/null +++ b/rbi/privy/models/wallet_create_wallets_with_recovery_response.rbi @@ -0,0 +1,46 @@ +# typed: strong + +module Privy + module Models + class WalletCreateWalletsWithRecoveryResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletCreateWalletsWithRecoveryResponse, + Privy::Internal::AnyHash + ) + end + + # The ID of the created user. + sig { returns(String) } + attr_accessor :recovery_user_id + + # The wallets that were created. + sig { returns(T::Array[Privy::Wallet]) } + attr_accessor :wallets + + # The response from creating wallets with an associated recovery user. + sig do + params( + recovery_user_id: String, + wallets: T::Array[Privy::Wallet::OrHash] + ).returns(T.attached_class) + end + def self.new( + # The ID of the created user. + recovery_user_id:, + # The wallets that were created. + wallets: + ) + end + + sig do + override.returns( + { recovery_user_id: String, wallets: T::Array[Privy::Wallet] } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_creation_additional_signer_item.rbi b/rbi/privy/models/wallet_creation_additional_signer_item.rbi new file mode 100644 index 0000000..6853bb5 --- /dev/null +++ b/rbi/privy/models/wallet_creation_additional_signer_item.rbi @@ -0,0 +1,53 @@ +# typed: strong + +module Privy + module Models + class WalletCreationAdditionalSignerItem < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletCreationAdditionalSignerItem, + Privy::Internal::AnyHash + ) + end + + # A unique identifier for a key quorum. + sig { returns(String) } + attr_accessor :signer_id + + # The array of policy IDs that will be applied to wallet requests. If specified, + # this will override the base policy IDs set on the wallet. Currently, only one + # policy is supported per signer. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :override_policy_ids + + sig { params(override_policy_ids: T::Array[String]).void } + attr_writer :override_policy_ids + + # An additional signer configuration for a wallet. + sig do + params( + signer_id: String, + override_policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # A unique identifier for a key quorum. + signer_id:, + # The array of policy IDs that will be applied to wallet requests. If specified, + # this will override the base policy IDs set on the wallet. Currently, only one + # policy is supported per signer. + override_policy_ids: nil + ) + end + + sig do + override.returns( + { signer_id: String, override_policy_ids: T::Array[String] } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_creation_input.rbi b/rbi/privy/models/wallet_creation_input.rbi new file mode 100644 index 0000000..215dc96 --- /dev/null +++ b/rbi/privy/models/wallet_creation_input.rbi @@ -0,0 +1,85 @@ +# typed: strong + +module Privy + module Models + class WalletCreationInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletCreationInput, Privy::Internal::AnyHash) + end + + # The wallet chain types. + sig { returns(Privy::WalletChainType::OrSymbol) } + attr_accessor :chain_type + + # Additional signers for the wallet. + sig do + returns(T.nilable(T::Array[Privy::WalletCreationAdditionalSignerItem])) + end + attr_reader :additional_signers + + sig do + params( + additional_signers: + T::Array[Privy::WalletCreationAdditionalSignerItem::OrHash] + ).void + end + attr_writer :additional_signers + + # Create a smart wallet with this wallet as the signer. Only supported for wallets + # with `chain_type: "ethereum"`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :create_smart_wallet + + sig { params(create_smart_wallet: T::Boolean).void } + attr_writer :create_smart_wallet + + # Policy IDs to enforce on the wallet. Currently, only one policy is supported per + # wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + # The fields on wallet creation that can be specified when creating a + # user-controlled embedded server wallet. + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: + T::Array[Privy::WalletCreationAdditionalSignerItem::OrHash], + create_smart_wallet: T::Boolean, + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # The wallet chain types. + chain_type:, + # Additional signers for the wallet. + additional_signers: nil, + # Create a smart wallet with this wallet as the signer. Only supported for wallets + # with `chain_type: "ethereum"`. + create_smart_wallet: nil, + # Policy IDs to enforce on the wallet. Currently, only one policy is supported per + # wallet. + policy_ids: nil + ) + end + + sig do + override.returns( + { + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: + T::Array[Privy::WalletCreationAdditionalSignerItem], + create_smart_wallet: T::Boolean, + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_custodian.rbi b/rbi/privy/models/wallet_custodian.rbi new file mode 100644 index 0000000..56c30d8 --- /dev/null +++ b/rbi/privy/models/wallet_custodian.rbi @@ -0,0 +1,36 @@ +# typed: strong + +module Privy + module Models + class WalletCustodian < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::WalletCustodian, Privy::Internal::AnyHash) } + + # The custodian responsible for the wallet. + sig { returns(String) } + attr_accessor :provider + + # The resource ID of the beneficiary of the custodial wallet. + sig { returns(String) } + attr_accessor :provider_user_id + + # Information about the custodian managing this wallet. + sig do + params(provider: String, provider_user_id: String).returns( + T.attached_class + ) + end + def self.new( + # The custodian responsible for the wallet. + provider:, + # The resource ID of the beneficiary of the custodial wallet. + provider_user_id: + ) + end + + sig { override.returns({ provider: String, provider_user_id: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_entropy_type.rbi b/rbi/privy/models/wallet_entropy_type.rbi new file mode 100644 index 0000000..817fca3 --- /dev/null +++ b/rbi/privy/models/wallet_entropy_type.rbi @@ -0,0 +1,21 @@ +# typed: strong + +module Privy + module Models + # The entropy type of the wallet. + module WalletEntropyType + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletEntropyType) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + HD = T.let(:hd, Privy::WalletEntropyType::TaggedSymbol) + PRIVATE_KEY = + T.let(:"private-key", Privy::WalletEntropyType::TaggedSymbol) + + sig { override.returns(T::Array[Privy::WalletEntropyType::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_ethereum_asset.rbi b/rbi/privy/models/wallet_ethereum_asset.rbi new file mode 100644 index 0000000..8a1e514 --- /dev/null +++ b/rbi/privy/models/wallet_ethereum_asset.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # A named asset on Ethereum-compatible chains. + module WalletEthereumAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletEthereumAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDC = T.let(:usdc, Privy::WalletEthereumAsset::TaggedSymbol) + USDC_E = T.let(:"usdc.e", Privy::WalletEthereumAsset::TaggedSymbol) + ETH = T.let(:eth, Privy::WalletEthereumAsset::TaggedSymbol) + POL = T.let(:pol, Privy::WalletEthereumAsset::TaggedSymbol) + USDT = T.let(:usdt, Privy::WalletEthereumAsset::TaggedSymbol) + EURC = T.let(:eurc, Privy::WalletEthereumAsset::TaggedSymbol) + USDB = T.let(:usdb, Privy::WalletEthereumAsset::TaggedSymbol) + + sig do + override.returns(T::Array[Privy::WalletEthereumAsset::TaggedSymbol]) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_export_params.rbi b/rbi/privy/models/wallet_export_params.rbi new file mode 100644 index 0000000..964c0f6 --- /dev/null +++ b/rbi/privy/models/wallet_export_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class WalletExportParams < Privy::Models::WalletExportRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletExportParams, Privy::Internal::AnyHash) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_export_request_body.rbi b/rbi/privy/models/wallet_export_request_body.rbi new file mode 100644 index 0000000..743a1b4 --- /dev/null +++ b/rbi/privy/models/wallet_export_request_body.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Privy + module Models + class WalletExportRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletExportRequestBody, Privy::Internal::AnyHash) + end + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + # The base64-encoded encryption public key to encrypt the wallet private key with. + sig { returns(String) } + attr_accessor :recipient_public_key + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :export_seed_phrase + + sig { params(export_seed_phrase: T::Boolean).void } + attr_writer :export_seed_phrase + + # Request body for exporting a wallet private key. + sig do + params( + encryption_type: Privy::HpkeEncryption::OrSymbol, + recipient_public_key: String, + export_seed_phrase: T::Boolean + ).returns(T.attached_class) + end + def self.new( + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + # The base64-encoded encryption public key to encrypt the wallet private key with. + recipient_public_key:, + export_seed_phrase: nil + ) + end + + sig do + override.returns( + { + encryption_type: Privy::HpkeEncryption::OrSymbol, + recipient_public_key: String, + export_seed_phrase: T::Boolean + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_export_response_body.rbi b/rbi/privy/models/wallet_export_response_body.rbi new file mode 100644 index 0000000..d52f43d --- /dev/null +++ b/rbi/privy/models/wallet_export_response_body.rbi @@ -0,0 +1,56 @@ +# typed: strong + +module Privy + module Models + class WalletExportResponseBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletExportResponseBody, Privy::Internal::AnyHash) + end + + # The encrypted private key. + sig { returns(String) } + attr_accessor :ciphertext + + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption. + sig { returns(String) } + attr_accessor :encapsulated_key + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::TaggedSymbol) } + attr_accessor :encryption_type + + # Response body containing the encrypted wallet private key. + sig do + params( + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The encrypted private key. + ciphertext:, + # The base64-encoded encapsulated key that was generated during encryption, for + # use during decryption. + encapsulated_key:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type: + ) + end + + sig do + override.returns( + { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption::TaggedSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_funds_asset.rbi b/rbi/privy/models/wallet_funds_asset.rbi new file mode 100644 index 0000000..a67689a --- /dev/null +++ b/rbi/privy/models/wallet_funds_asset.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + # An asset involved in a wallet transfer. + module WalletFundsAsset + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::WalletFundsNativeTokenAsset, + Privy::WalletFundsErc20Asset, + Privy::WalletFundsSplAsset, + Privy::WalletFundsSacAsset + ) + end + + sig { override.returns(T::Array[Privy::WalletFundsAsset::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/wallet_funds_erc_20_asset.rbi b/rbi/privy/models/wallet_funds_erc_20_asset.rbi new file mode 100644 index 0000000..3907324 --- /dev/null +++ b/rbi/privy/models/wallet_funds_erc_20_asset.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + class WalletFundsErc20Asset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletFundsErc20Asset, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::WalletFundsErc20Asset::Type::TaggedSymbol) } + attr_accessor :type + + # An ERC-20 token asset. + sig do + params( + address: String, + type: Privy::WalletFundsErc20Asset::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(address:, type:) + end + + sig do + override.returns( + { + address: String, + type: Privy::WalletFundsErc20Asset::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::WalletFundsErc20Asset::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ERC20 = T.let(:erc20, Privy::WalletFundsErc20Asset::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::WalletFundsErc20Asset::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_funds_native_token_asset.rbi b/rbi/privy/models/wallet_funds_native_token_asset.rbi new file mode 100644 index 0000000..174a0a5 --- /dev/null +++ b/rbi/privy/models/wallet_funds_native_token_asset.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class WalletFundsNativeTokenAsset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletFundsNativeTokenAsset, Privy::Internal::AnyHash) + end + + sig { returns(NilClass) } + attr_accessor :address + + sig { returns(Privy::WalletFundsNativeTokenAsset::Type::TaggedSymbol) } + attr_accessor :type + + # A native token asset (e.g. ETH, SOL). + sig do + params( + address: NilClass, + type: Privy::WalletFundsNativeTokenAsset::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(address:, type:) + end + + sig do + override.returns( + { + address: NilClass, + type: Privy::WalletFundsNativeTokenAsset::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletFundsNativeTokenAsset::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + NATIVE_TOKEN = + T.let( + :"native-token", + Privy::WalletFundsNativeTokenAsset::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::WalletFundsNativeTokenAsset::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_funds_sac_asset.rbi b/rbi/privy/models/wallet_funds_sac_asset.rbi new file mode 100644 index 0000000..fc70089 --- /dev/null +++ b/rbi/privy/models/wallet_funds_sac_asset.rbi @@ -0,0 +1,57 @@ +# typed: strong + +module Privy + module Models + class WalletFundsSacAsset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletFundsSacAsset, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :address + + sig { returns(Privy::WalletFundsSacAsset::Type::TaggedSymbol) } + attr_accessor :type + + # A Stellar Asset Contract (SAC) asset. + sig do + params( + address: String, + type: Privy::WalletFundsSacAsset::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(address:, type:) + end + + sig do + override.returns( + { + address: String, + type: Privy::WalletFundsSacAsset::Type::TaggedSymbol + } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::WalletFundsSacAsset::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SAC = T.let(:sac, Privy::WalletFundsSacAsset::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::WalletFundsSacAsset::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_funds_spl_asset.rbi b/rbi/privy/models/wallet_funds_spl_asset.rbi new file mode 100644 index 0000000..d6f2058 --- /dev/null +++ b/rbi/privy/models/wallet_funds_spl_asset.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class WalletFundsSplAsset < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletFundsSplAsset, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :mint + + sig { returns(Privy::WalletFundsSplAsset::Type::TaggedSymbol) } + attr_accessor :type + + # A Solana SPL token asset. + sig do + params( + mint: String, + type: Privy::WalletFundsSplAsset::Type::OrSymbol + ).returns(T.attached_class) + end + def self.new(mint:, type:) + end + + sig do + override.returns( + { mint: String, type: Privy::WalletFundsSplAsset::Type::TaggedSymbol } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::WalletFundsSplAsset::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SPL = T.let(:spl, Privy::WalletFundsSplAsset::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::WalletFundsSplAsset::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_get_params.rbi b/rbi/privy/models/wallet_get_params.rbi new file mode 100644 index 0000000..686f1da --- /dev/null +++ b/rbi/privy/models/wallet_get_params.rbi @@ -0,0 +1,38 @@ +# typed: strong + +module Privy + module Models + class WalletGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::WalletGetParams, Privy::Internal::AnyHash) } + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + sig do + params( + wallet_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + request_options: {} + ) + end + + sig do + override.returns( + { wallet_id: String, request_options: Privy::RequestOptions } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_get_wallet_by_address_params.rbi b/rbi/privy/models/wallet_get_wallet_by_address_params.rbi new file mode 100644 index 0000000..1caf01f --- /dev/null +++ b/rbi/privy/models/wallet_get_wallet_by_address_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class WalletGetWalletByAddressParams < Privy::Models::GetByWalletAddressRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletGetWalletByAddressParams, Privy::Internal::AnyHash) + end + + sig do + params(request_options: Privy::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Privy::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_import_init_response.rbi b/rbi/privy/models/wallet_import_init_response.rbi new file mode 100644 index 0000000..6f002aa --- /dev/null +++ b/rbi/privy/models/wallet_import_init_response.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class WalletImportInitResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletImportInitResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :encryption_public_key + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::OrSymbol) } + attr_accessor :encryption_type + + sig { returns(T.nilable(String)) } + attr_reader :import_id + + sig { params(import_id: String).void } + attr_writer :import_id + + # Response from initializing a wallet import, containing the encryption public + # key. + sig do + params( + encryption_public_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol, + import_id: String + ).returns(T.attached_class) + end + def self.new( + encryption_public_key:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type:, + import_id: nil + ) + end + + sig do + override.returns( + { + encryption_public_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol, + import_id: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_import_supported_chains.rbi b/rbi/privy/models/wallet_import_supported_chains.rbi new file mode 100644 index 0000000..3bbebb5 --- /dev/null +++ b/rbi/privy/models/wallet_import_supported_chains.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + # The chain type of the wallet to import. Currently supports `ethereum` and + # `solana`. + module WalletImportSupportedChains + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::WalletImportSupportedChains) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let(:ethereum, Privy::WalletImportSupportedChains::TaggedSymbol) + SOLANA = T.let(:solana, Privy::WalletImportSupportedChains::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::WalletImportSupportedChains::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_import_supported_entropy_types.rbi b/rbi/privy/models/wallet_import_supported_entropy_types.rbi new file mode 100644 index 0000000..58f9f30 --- /dev/null +++ b/rbi/privy/models/wallet_import_supported_entropy_types.rbi @@ -0,0 +1,30 @@ +# typed: strong + +module Privy + module Models + # The entropy type of the wallet to import. Supports `private-key` for raw private + # keys and `hd` for HD wallet seed phrases. + module WalletImportSupportedEntropyTypes + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::WalletImportSupportedEntropyTypes) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PRIVATE_KEY = + T.let( + :"private-key", + Privy::WalletImportSupportedEntropyTypes::TaggedSymbol + ) + HD = T.let(:hd, Privy::WalletImportSupportedEntropyTypes::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::WalletImportSupportedEntropyTypes::TaggedSymbol] + ) + end + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_init_import_params.rbi b/rbi/privy/models/wallet_init_import_params.rbi new file mode 100644 index 0000000..a9c23fc --- /dev/null +++ b/rbi/privy/models/wallet_init_import_params.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Models + class WalletInitImportParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletInitImportParams, Privy::Internal::AnyHash) + end + + # The input for HD wallets. + sig { returns(T.any(Privy::HDInitInput, Privy::PrivateKeyInitInput)) } + attr_accessor :body + + sig do + params( + body: + T.any( + Privy::HDInitInput::OrHash, + Privy::PrivateKeyInitInput::OrHash + ), + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The input for HD wallets. + body:, + request_options: {} + ) + end + + sig do + override.returns( + { + body: T.any(Privy::HDInitInput, Privy::PrivateKeyInitInput), + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + # The input for HD wallets. + module Body + extend Privy::Internal::Type::Union + + Variants = + T.type_alias { T.any(Privy::HDInitInput, Privy::PrivateKeyInitInput) } + + sig do + override.returns( + T::Array[Privy::WalletInitImportParams::Body::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/privy/models/wallet_init_import_response.rbi b/rbi/privy/models/wallet_init_import_response.rbi new file mode 100644 index 0000000..d4fe8d4 --- /dev/null +++ b/rbi/privy/models/wallet_init_import_response.rbi @@ -0,0 +1,48 @@ +# typed: strong + +module Privy + module Models + class WalletInitImportResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::Models::WalletInitImportResponse, + Privy::Internal::AnyHash + ) + end + + # The base64-encoded encryption public key to encrypt the wallet entropy with. + sig { returns(String) } + attr_accessor :encryption_public_key + + # The encryption type of the wallet to import. Currently only supports `HPKE`. + sig { returns(Privy::HpkeEncryption::TaggedSymbol) } + attr_accessor :encryption_type + + sig do + params( + encryption_public_key: String, + encryption_type: Privy::HpkeEncryption::OrSymbol + ).returns(T.attached_class) + end + def self.new( + # The base64-encoded encryption public key to encrypt the wallet entropy with. + encryption_public_key:, + # The encryption type of the wallet to import. Currently only supports `HPKE`. + encryption_type: + ) + end + + sig do + override.returns( + { + encryption_public_key: String, + encryption_type: Privy::HpkeEncryption::TaggedSymbol + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_intent_response.rbi b/rbi/privy/models/wallet_intent_response.rbi new file mode 100644 index 0000000..1bc95e6 --- /dev/null +++ b/rbi/privy/models/wallet_intent_response.rbi @@ -0,0 +1,282 @@ +# typed: strong + +module Privy + module Models + class WalletIntentResponse < Privy::Models::BaseIntentResponse + OrHash = + T.type_alias do + T.any(Privy::WalletIntentResponse, Privy::Internal::AnyHash) + end + + sig { returns(Privy::WalletIntentResponse::IntentType::TaggedSymbol) } + attr_accessor :intent_type + + # The original wallet update request that would be sent to the wallet endpoint + sig { returns(Privy::WalletIntentResponse::RequestDetails) } + attr_reader :request_details + + sig do + params( + request_details: Privy::WalletIntentResponse::RequestDetails::OrHash + ).void + end + attr_writer :request_details + + # Result of wallet update execution (only present if status is 'executed' or + # 'failed') + sig { returns(T.nilable(Privy::BaseActionResult)) } + attr_reader :action_result + + sig { params(action_result: Privy::BaseActionResult::OrHash).void } + attr_writer :action_result + + # A wallet managed by Privy's wallet infrastructure. + sig { returns(T.nilable(Privy::Wallet)) } + attr_reader :current_resource_data + + sig { params(current_resource_data: Privy::Wallet::OrHash).void } + attr_writer :current_resource_data + + # Response for a wallet intent + sig do + params( + intent_type: Privy::WalletIntentResponse::IntentType::OrSymbol, + request_details: Privy::WalletIntentResponse::RequestDetails::OrHash, + action_result: Privy::BaseActionResult::OrHash, + current_resource_data: Privy::Wallet::OrHash + ).returns(T.attached_class) + end + def self.new( + intent_type:, + # The original wallet update request that would be sent to the wallet endpoint + request_details:, + # Result of wallet update execution (only present if status is 'executed' or + # 'failed') + action_result: nil, + # A wallet managed by Privy's wallet infrastructure. + current_resource_data: nil + ) + end + + sig do + override.returns( + { + intent_type: Privy::WalletIntentResponse::IntentType::TaggedSymbol, + request_details: Privy::WalletIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + ) + end + def to_hash + end + + module IntentType + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletIntentResponse::IntentType) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = + T.let(:WALLET, Privy::WalletIntentResponse::IntentType::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::WalletIntentResponse::IntentType::TaggedSymbol] + ) + end + def self.values + end + end + + class RequestDetails < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletIntentResponse::RequestDetails, + Privy::Internal::AnyHash + ) + end + + sig { returns(Privy::WalletIntentResponse::RequestDetails::Body) } + attr_reader :body + + sig do + params( + body: Privy::WalletIntentResponse::RequestDetails::Body::OrHash + ).void + end + attr_writer :body + + sig do + returns( + Privy::WalletIntentResponse::RequestDetails::Method::TaggedSymbol + ) + end + attr_accessor :method_ + + sig { returns(String) } + attr_accessor :url + + # The original wallet update request that would be sent to the wallet endpoint + sig do + params( + body: Privy::WalletIntentResponse::RequestDetails::Body::OrHash, + method_: + Privy::WalletIntentResponse::RequestDetails::Method::OrSymbol, + url: String + ).returns(T.attached_class) + end + def self.new(body:, method_:, url:) + end + + sig do + override.returns( + { + body: Privy::WalletIntentResponse::RequestDetails::Body, + method_: + Privy::WalletIntentResponse::RequestDetails::Method::TaggedSymbol, + url: String + } + ) + end + def to_hash + end + + class Body < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletIntentResponse::RequestDetails::Body, + Privy::Internal::AnyHash + ) + end + + # Additional signers for the wallet. + sig { returns(T.nilable(T::Array[Privy::AdditionalSignerItemInput])) } + attr_reader :additional_signers + + sig do + params( + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash] + ).void + end + attr_writer :additional_signers + + sig { returns(T.nilable(T::Array[String])) } + attr_reader :authorization_key_ids + + sig { params(authorization_key_ids: T::Array[String]).void } + attr_writer :authorization_key_ids + + sig { returns(T.nilable(Float)) } + attr_reader :authorization_threshold + + sig { params(authorization_threshold: Float).void } + attr_writer :authorization_threshold + + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig { returns(T.nilable(Privy::OwnerInput::Variants)) } + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # An optional list of up to one policy ID to enforce on the wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + sig do + params( + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + authorization_key_ids: T::Array[String], + authorization_threshold: Float, + display_name: T.nilable(String), + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Additional signers for the wallet. + additional_signers: nil, + authorization_key_ids: nil, + authorization_threshold: nil, + display_name: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + # An optional list of up to one policy ID to enforce on the wallet. + policy_ids: nil + ) + end + + sig do + override.returns( + { + additional_signers: T::Array[Privy::AdditionalSignerItemInput], + authorization_key_ids: T::Array[String], + authorization_threshold: Float, + display_name: T.nilable(String), + owner: T.nilable(Privy::OwnerInput::Variants), + owner_id: T.nilable(String), + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + end + + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletIntentResponse::RequestDetails::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + PATCH = + T.let( + :PATCH, + Privy::WalletIntentResponse::RequestDetails::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletIntentResponse::RequestDetails::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/privy/models/wallet_invite_input.rbi b/rbi/privy/models/wallet_invite_input.rbi new file mode 100644 index 0000000..52b152f --- /dev/null +++ b/rbi/privy/models/wallet_invite_input.rbi @@ -0,0 +1,54 @@ +# typed: strong + +module Privy + module Models + class WalletInviteInput < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletInviteInput, Privy::Internal::AnyHash) + end + + sig { returns(Privy::WalletInviteInput::Type::OrSymbol) } + attr_accessor :type + + sig { returns(String) } + attr_accessor :value + + # Allowlist invite input for a wallet address. + sig do + params( + type: Privy::WalletInviteInput::Type::OrSymbol, + value: String + ).returns(T.attached_class) + end + def self.new(type:, value:) + end + + sig do + override.returns( + { type: Privy::WalletInviteInput::Type::OrSymbol, value: String } + ) + end + def to_hash + end + + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias { T.all(Symbol, Privy::WalletInviteInput::Type) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET = T.let(:wallet, Privy::WalletInviteInput::Type::TaggedSymbol) + + sig do + override.returns( + T::Array[Privy::WalletInviteInput::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_list_params.rbi b/rbi/privy/models/wallet_list_params.rbi new file mode 100644 index 0000000..3dc09b1 --- /dev/null +++ b/rbi/privy/models/wallet_list_params.rbi @@ -0,0 +1,98 @@ +# typed: strong + +module Privy + module Models + class WalletListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletListParams, Privy::Internal::AnyHash) + end + + # Filter wallets by authorization public key. Returns wallets owned by key quorums + # that include the specified P-256 public key (base64-encoded DER format). Cannot + # be used together with user_id. + sig { returns(T.nilable(String)) } + attr_reader :authorization_key + + sig { params(authorization_key: String).void } + attr_writer :authorization_key + + # The wallet chain types. + sig { returns(T.nilable(Privy::WalletChainType::OrSymbol)) } + attr_reader :chain_type + + sig { params(chain_type: Privy::WalletChainType::OrSymbol).void } + attr_writer :chain_type + + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + # Filter wallets by external ID. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + sig { returns(T.nilable(Float)) } + attr_accessor :limit + + # Filter wallets by user ID. Cannot be used together with authorization_key. + sig { returns(T.nilable(String)) } + attr_reader :user_id + + sig { params(user_id: String).void } + attr_writer :user_id + + sig do + params( + authorization_key: String, + chain_type: Privy::WalletChainType::OrSymbol, + cursor: String, + external_id: String, + limit: T.nilable(Float), + user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # Filter wallets by authorization public key. Returns wallets owned by key quorums + # that include the specified P-256 public key (base64-encoded DER format). Cannot + # be used together with user_id. + authorization_key: nil, + # The wallet chain types. + chain_type: nil, + cursor: nil, + # Filter wallets by external ID. + external_id: nil, + limit: nil, + # Filter wallets by user ID. Cannot be used together with authorization_key. + user_id: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + authorization_key: String, + chain_type: Privy::WalletChainType::OrSymbol, + cursor: String, + external_id: String, + limit: T.nilable(Float), + user_id: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_raw_sign_params.rbi b/rbi/privy/models/wallet_raw_sign_params.rbi new file mode 100644 index 0000000..b1b9ceb --- /dev/null +++ b/rbi/privy/models/wallet_raw_sign_params.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Models + class WalletRawSignParams < Privy::Models::RawSignInput + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletRawSignParams, Privy::Internal::AnyHash) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_recovered_webhook_payload.rbi b/rbi/privy/models/wallet_recovered_webhook_payload.rbi new file mode 100644 index 0000000..71b0a46 --- /dev/null +++ b/rbi/privy/models/wallet_recovered_webhook_payload.rbi @@ -0,0 +1,87 @@ +# typed: strong + +module Privy + module Models + class WalletRecoveredWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletRecoveredWebhookPayload, Privy::Internal::AnyHash) + end + + # The type of webhook event. + sig { returns(Privy::WalletRecoveredWebhookPayload::Type::TaggedSymbol) } + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # The address of the wallet. + sig { returns(String) } + attr_accessor :wallet_address + + # The ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet.recovered webhook event. + sig do + params( + type: Privy::WalletRecoveredWebhookPayload::Type::OrSymbol, + user_id: String, + wallet_address: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # The type of webhook event. + type:, + # The ID of the user. + user_id:, + # The address of the wallet. + wallet_address:, + # The ID of the wallet. + wallet_id: + ) + end + + sig do + override.returns( + { + type: Privy::WalletRecoveredWebhookPayload::Type::TaggedSymbol, + user_id: String, + wallet_address: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletRecoveredWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_RECOVERED = + T.let( + :"wallet.recovered", + Privy::WalletRecoveredWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[Privy::WalletRecoveredWebhookPayload::Type::TaggedSymbol] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_recovery_setup_webhook_payload.rbi b/rbi/privy/models/wallet_recovery_setup_webhook_payload.rbi new file mode 100644 index 0000000..e8fb032 --- /dev/null +++ b/rbi/privy/models/wallet_recovery_setup_webhook_payload.rbi @@ -0,0 +1,157 @@ +# typed: strong + +module Privy + module Models + class WalletRecoverySetupWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::WalletRecoverySetupWebhookPayload, + Privy::Internal::AnyHash + ) + end + + # The recovery method that was set up. + sig do + returns(Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol) + end + attr_accessor :method_ + + # The type of webhook event. + sig do + returns(Privy::WalletRecoverySetupWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + # The ID of the user. + sig { returns(String) } + attr_accessor :user_id + + # The address of the wallet. + sig { returns(String) } + attr_accessor :wallet_address + + # The ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the wallet.recovery_setup webhook event. + sig do + params( + method_: Privy::WalletRecoverySetupWebhookPayload::Method::OrSymbol, + type: Privy::WalletRecoverySetupWebhookPayload::Type::OrSymbol, + user_id: String, + wallet_address: String, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + # The recovery method that was set up. + method_:, + # The type of webhook event. + type:, + # The ID of the user. + user_id:, + # The address of the wallet. + wallet_address:, + # The ID of the wallet. + wallet_id: + ) + end + + sig do + override.returns( + { + method_: + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol, + type: Privy::WalletRecoverySetupWebhookPayload::Type::TaggedSymbol, + user_id: String, + wallet_address: String, + wallet_id: String + } + ) + end + def to_hash + end + + # The recovery method that was set up. + module Method + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletRecoverySetupWebhookPayload::Method) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USER_PASSCODE_DERIVED_RECOVERY_KEY = + T.let( + :user_passcode_derived_recovery_key, + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol + ) + PRIVY_PASSCODE_DERIVED_RECOVERY_KEY = + T.let( + :privy_passcode_derived_recovery_key, + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol + ) + PRIVY_GENERATED_RECOVERY_KEY = + T.let( + :privy_generated_recovery_key, + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol + ) + GOOGLE_DRIVE_RECOVERY_SECRET = + T.let( + :google_drive_recovery_secret, + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol + ) + ICLOUD_RECOVERY_SECRET = + T.let( + :icloud_recovery_secret, + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol + ) + RECOVERY_ENCRYPTION_KEY = + T.let( + :recovery_encryption_key, + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletRecoverySetupWebhookPayload::Method::TaggedSymbol + ] + ) + end + def self.values + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::WalletRecoverySetupWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + WALLET_RECOVERY_SETUP = + T.let( + :"wallet.recovery_setup", + Privy::WalletRecoverySetupWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::WalletRecoverySetupWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/wallet_revoke_response.rbi b/rbi/privy/models/wallet_revoke_response.rbi new file mode 100644 index 0000000..93cdf8d --- /dev/null +++ b/rbi/privy/models/wallet_revoke_response.rbi @@ -0,0 +1,24 @@ +# typed: strong + +module Privy + module Models + class WalletRevokeResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletRevokeResponse, Privy::Internal::AnyHash) + end + + sig { returns(String) } + attr_accessor :message + + # The response body from revoking a wallet delegation. + sig { params(message: String).returns(T.attached_class) } + def self.new(message:) + end + + sig { override.returns({ message: String }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_rpc_params.rbi b/rbi/privy/models/wallet_rpc_params.rbi new file mode 100644 index 0000000..d280f3d --- /dev/null +++ b/rbi/privy/models/wallet_rpc_params.rbi @@ -0,0 +1,80 @@ +# typed: strong + +module Privy + module Models + class WalletRpcParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias { T.any(Privy::WalletRpcParams, Privy::Internal::AnyHash) } + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_rpc_request_body.rbi b/rbi/privy/models/wallet_rpc_request_body.rbi new file mode 100644 index 0000000..33d16d6 --- /dev/null +++ b/rbi/privy/models/wallet_rpc_request_body.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + # Request body for wallet RPC operations, discriminated by method. + module WalletRpcRequestBody + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::EthereumSignTransactionRpcInput, + Privy::EthereumSendTransactionRpcInput, + Privy::EthereumPersonalSignRpcInput, + Privy::EthereumSignTypedDataRpcInput, + Privy::EthereumSecp256k1SignRpcInput, + Privy::EthereumSign7702AuthorizationRpcInput, + Privy::EthereumSignUserOperationRpcInput, + Privy::EthereumSendCallsRpcInput, + Privy::SolanaSignTransactionRpcInput, + Privy::SolanaSignAndSendTransactionRpcInput, + Privy::SolanaSignMessageRpcInput, + Privy::SparkTransferRpcInput, + Privy::SparkGetBalanceRpcInput, + Privy::SparkTransferTokensRpcInput, + Privy::SparkGetStaticDepositAddressRpcInput, + Privy::SparkGetClaimStaticDepositQuoteRpcInput, + Privy::SparkClaimStaticDepositRpcInput, + Privy::SparkCreateLightningInvoiceRpcInput, + Privy::SparkPayLightningInvoiceRpcInput, + Privy::SparkSignMessageWithIdentityKeyRpcInput, + Privy::ExportPrivateKeyRpcInput, + Privy::ExportSeedPhraseRpcInput + ) + end + + sig { override.returns(T::Array[Privy::WalletRpcRequestBody::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/wallet_rpc_response.rbi b/rbi/privy/models/wallet_rpc_response.rbi new file mode 100644 index 0000000..c9b4167 --- /dev/null +++ b/rbi/privy/models/wallet_rpc_response.rbi @@ -0,0 +1,42 @@ +# typed: strong + +module Privy + module Models + # Response body for wallet RPC operations, discriminated by method. + module WalletRpcResponse + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::EthereumPersonalSignRpcResponse, + Privy::EthereumSignTypedDataRpcResponse, + Privy::EthereumSignTransactionRpcResponse, + Privy::EthereumSendTransactionRpcResponse, + Privy::EthereumSignUserOperationRpcResponse, + Privy::EthereumSign7702AuthorizationRpcResponse, + Privy::EthereumSecp256k1SignRpcResponse, + Privy::EthereumSendCallsRpcResponse, + Privy::SolanaSignMessageRpcResponse, + Privy::SolanaSignTransactionRpcResponse, + Privy::SolanaSignAndSendTransactionRpcResponse, + Privy::SparkTransferRpcResponse, + Privy::SparkGetBalanceRpcResponse, + Privy::SparkTransferTokensRpcResponse, + Privy::SparkGetStaticDepositAddressRpcResponse, + Privy::SparkGetClaimStaticDepositQuoteRpcResponse, + Privy::SparkClaimStaticDepositRpcResponse, + Privy::SparkCreateLightningInvoiceRpcResponse, + Privy::SparkPayLightningInvoiceRpcResponse, + Privy::SparkSignMessageWithIdentityKeyRpcResponse, + Privy::ExportPrivateKeyRpcResponse, + Privy::ExportSeedPhraseRpcResponse + ) + end + + sig { override.returns(T::Array[Privy::WalletRpcResponse::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/wallet_solana_asset.rbi b/rbi/privy/models/wallet_solana_asset.rbi new file mode 100644 index 0000000..3474c58 --- /dev/null +++ b/rbi/privy/models/wallet_solana_asset.rbi @@ -0,0 +1,22 @@ +# typed: strong + +module Privy + module Models + # A named asset on Solana. + module WalletSolanaAsset + extend Privy::Internal::Type::Enum + + TaggedSymbol = T.type_alias { T.all(Symbol, Privy::WalletSolanaAsset) } + OrSymbol = T.type_alias { T.any(Symbol, String) } + + SOL = T.let(:sol, Privy::WalletSolanaAsset::TaggedSymbol) + USDC = T.let(:usdc, Privy::WalletSolanaAsset::TaggedSymbol) + EURC = T.let(:eurc, Privy::WalletSolanaAsset::TaggedSymbol) + USDB = T.let(:usdb, Privy::WalletSolanaAsset::TaggedSymbol) + + sig { override.returns(T::Array[Privy::WalletSolanaAsset::TaggedSymbol]) } + def self.values + end + end + end +end diff --git a/rbi/privy/models/wallet_submit_import_params.rbi b/rbi/privy/models/wallet_submit_import_params.rbi new file mode 100644 index 0000000..f1ac00b --- /dev/null +++ b/rbi/privy/models/wallet_submit_import_params.rbi @@ -0,0 +1,151 @@ +# typed: strong + +module Privy + module Models + class WalletSubmitImportParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletSubmitImportParams, Privy::Internal::AnyHash) + end + + # The submission input for importing an HD wallet. + sig { returns(T.any(Privy::HDSubmitInput, Privy::PrivateKeySubmitInput)) } + attr_accessor :wallet + + # Additional signers for the wallet. + sig { returns(T.nilable(T::Array[Privy::AdditionalSignerItemInput])) } + attr_reader :additional_signers + + sig do + params( + additional_signers: T::Array[Privy::AdditionalSignerItemInput::OrHash] + ).void + end + attr_writer :additional_signers + + # A human-readable label for the wallet. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + sig { params(display_name: String).void } + attr_writer :display_name + + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + sig { returns(T.nilable(String)) } + attr_reader :external_id + + sig { params(external_id: String).void } + attr_writer :external_id + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # An optional list of up to one policy ID to enforce on the wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + sig do + params( + wallet: + T.any( + Privy::HDSubmitInput::OrHash, + Privy::PrivateKeySubmitInput::OrHash + ), + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # The submission input for importing an HD wallet. + wallet:, + # Additional signers for the wallet. + additional_signers: nil, + # A human-readable label for the wallet. + display_name: nil, + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + external_id: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + # An optional list of up to one policy ID to enforce on the wallet. + policy_ids: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet: T.any(Privy::HDSubmitInput, Privy::PrivateKeySubmitInput), + additional_signers: T::Array[Privy::AdditionalSignerItemInput], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + # The submission input for importing an HD wallet. + module Wallet + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any(Privy::HDSubmitInput, Privy::PrivateKeySubmitInput) + end + + sig do + override.returns( + T::Array[Privy::WalletSubmitImportParams::Wallet::Variants] + ) + end + def self.variants + end + end + end + end +end diff --git a/rbi/privy/models/wallet_transfer_params.rbi b/rbi/privy/models/wallet_transfer_params.rbi new file mode 100644 index 0000000..cee0256 --- /dev/null +++ b/rbi/privy/models/wallet_transfer_params.rbi @@ -0,0 +1,82 @@ +# typed: strong + +module Privy + module Models + class WalletTransferParams < Privy::Models::TransferRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletTransferParams, Privy::Internal::AnyHash) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_update_params.rbi b/rbi/privy/models/wallet_update_params.rbi new file mode 100644 index 0000000..2d0ecdb --- /dev/null +++ b/rbi/privy/models/wallet_update_params.rbi @@ -0,0 +1,69 @@ +# typed: strong + +module Privy + module Models + class WalletUpdateParams < Privy::Models::WalletUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WalletUpdateParams, Privy::Internal::AnyHash) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallet_update_request_body.rbi b/rbi/privy/models/wallet_update_request_body.rbi new file mode 100644 index 0000000..6df2698 --- /dev/null +++ b/rbi/privy/models/wallet_update_request_body.rbi @@ -0,0 +1,101 @@ +# typed: strong + +module Privy + module Models + class WalletUpdateRequestBody < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::WalletUpdateRequestBody, Privy::Internal::AnyHash) + end + + # Additional signers for the wallet. + sig { returns(T.nilable(T::Array[Privy::AdditionalSignerItemInput])) } + attr_reader :additional_signers + + sig do + params( + additional_signers: T::Array[Privy::AdditionalSignerItemInput::OrHash] + ).void + end + attr_writer :additional_signers + + # A human-readable label for the wallet. Set to null to clear. + sig { returns(T.nilable(String)) } + attr_accessor :display_name + + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + sig do + returns( + T.nilable(T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey)) + ) + end + attr_accessor :owner + + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + sig { returns(T.nilable(String)) } + attr_accessor :owner_id + + # New policy IDs to enforce on the wallet. Currently, only one policy is supported + # per wallet. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :policy_ids + + sig { params(policy_ids: T::Array[String]).void } + attr_writer :policy_ids + + # Request body for updating a wallet. `owner` and `owner_id` are mutually + # exclusive. + sig do + params( + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: T.nilable(String), + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String] + ).returns(T.attached_class) + end + def self.new( + # Additional signers for the wallet. + additional_signers: nil, + # A human-readable label for the wallet. Set to null to clear. + display_name: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + # New policy IDs to enforce on the wallet. Currently, only one policy is supported + # per wallet. + policy_ids: nil + ) + end + + sig do + override.returns( + { + additional_signers: T::Array[Privy::AdditionalSignerItemInput], + display_name: T.nilable(String), + owner: + T.nilable( + T.any(Privy::OwnerInputUser, Privy::OwnerInputPublicKey) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String] + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/wallets/balance_get_params.rbi b/rbi/privy/models/wallets/balance_get_params.rbi new file mode 100644 index 0000000..0e9d0a3 --- /dev/null +++ b/rbi/privy/models/wallets/balance_get_params.rbi @@ -0,0 +1,511 @@ +# typed: strong + +module Privy + module Models + module Wallets + class BalanceGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::Wallets::BalanceGetParams, Privy::Internal::AnyHash) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # The token contract address(es) to query in format "chain:address" (e.g., + # "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" or + # "solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"). Cannot be used together + # with `asset`/`chain` or with `include_currency`. + sig do + returns(T.nilable(Privy::Wallets::BalanceGetParams::Token::Variants)) + end + attr_reader :token + + sig do + params(token: Privy::Wallets::BalanceGetParams::Token::Variants).void + end + attr_writer :token + + # Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # the query. Cannot be used with `token`. + sig do + returns( + T.nilable( + T.any( + Privy::Wallets::BalanceGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ) + ) + ) + end + attr_reader :asset + + sig do + params( + asset: + T.any( + Privy::Wallets::BalanceGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ) + ).void + end + attr_writer :asset + + # Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with + # `asset`. Cannot be used with `token`. + sig do + returns( + T.nilable( + T.any( + Privy::Wallets::BalanceGetParams::Chain::OrSymbol, + T::Array[ + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::OrSymbol + ] + ) + ) + ) + end + attr_reader :chain + + sig do + params( + chain: + T.any( + Privy::Wallets::BalanceGetParams::Chain::OrSymbol, + T::Array[ + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::OrSymbol + ] + ) + ).void + end + attr_writer :chain + + # If set, balances are converted to the specified fiat currency. Not supported + # when `token` is provided. + sig do + returns( + T.nilable( + Privy::Wallets::BalanceGetParams::IncludeCurrency::OrSymbol + ) + ) + end + attr_reader :include_currency + + sig do + params( + include_currency: + Privy::Wallets::BalanceGetParams::IncludeCurrency::OrSymbol + ).void + end + attr_writer :include_currency + + sig do + params( + wallet_id: String, + token: Privy::Wallets::BalanceGetParams::Token::Variants, + asset: + T.any( + Privy::Wallets::BalanceGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ), + chain: + T.any( + Privy::Wallets::BalanceGetParams::Chain::OrSymbol, + T::Array[ + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::OrSymbol + ] + ), + include_currency: + Privy::Wallets::BalanceGetParams::IncludeCurrency::OrSymbol, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # The token contract address(es) to query in format "chain:address" (e.g., + # "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" or + # "solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"). Cannot be used together + # with `asset`/`chain` or with `include_currency`. + token: nil, + # Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # the query. Cannot be used with `token`. + asset: nil, + # Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with + # `asset`. Cannot be used with `token`. + chain: nil, + # If set, balances are converted to the specified fiat currency. Not supported + # when `token` is provided. + include_currency: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + token: Privy::Wallets::BalanceGetParams::Token::Variants, + asset: + T.any( + Privy::Wallets::BalanceGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ), + chain: + T.any( + Privy::Wallets::BalanceGetParams::Chain::OrSymbol, + T::Array[ + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::OrSymbol + ] + ), + include_currency: + Privy::Wallets::BalanceGetParams::IncludeCurrency::OrSymbol, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + # The token contract address(es) to query in format "chain:address" (e.g., + # "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" or + # "solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"). Cannot be used together + # with `asset`/`chain` or with `include_currency`. + module Token + extend Privy::Internal::Type::Union + + Variants = T.type_alias { T.any(String, T::Array[String]) } + + sig do + override.returns( + T::Array[Privy::Wallets::BalanceGetParams::Token::Variants] + ) + end + def self.variants + end + + StringArray = + T.let( + Privy::Internal::Type::ArrayOf[String], + Privy::Internal::Type::Converter + ) + end + + # Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # the query. Cannot be used with `token`. + module Asset + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol, + T::Array[Privy::WalletAsset::TaggedSymbol] + ) + end + + sig do + override.returns( + T::Array[Privy::Wallets::BalanceGetParams::Asset::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::Wallets::BalanceGetParams::Asset) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDC = + T.let(:usdc, Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol) + USDC_E = + T.let( + :"usdc.e", + Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol + ) + ETH = + T.let(:eth, Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol) + POL = + T.let(:pol, Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol) + USDT = + T.let(:usdt, Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol) + EURC = + T.let(:eurc, Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol) + USDB = + T.let(:usdb, Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol) + SOL = + T.let(:sol, Privy::Wallets::BalanceGetParams::Asset::TaggedSymbol) + + WalletAssetArray = + T.let( + Privy::Internal::Type::ArrayOf[enum: Privy::WalletAsset], + Privy::Internal::Type::Converter + ) + end + + # Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with + # `asset`. Cannot be used with `token`. + module Chain + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol, + T::Array[ + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ] + ) + end + + module UnionMember1 + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1 + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + ARBITRUM = + T.let( + :arbitrum, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + BASE = + T.let( + :base, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + TEMPO = + T.let( + :tempo, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + LINEA = + T.let( + :linea, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + OPTIMISM = + T.let( + :optimism, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + POLYGON = + T.let( + :polygon, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + SOLANA = + T.let( + :solana, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + ZKSYNC_ERA = + T.let( + :zksync_era, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + SEPOLIA = + T.let( + :sepolia, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + ARBITRUM_SEPOLIA = + T.let( + :arbitrum_sepolia, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + BASE_SEPOLIA = + T.let( + :base_sepolia, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + LINEA_TESTNET = + T.let( + :linea_testnet, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + OPTIMISM_SEPOLIA = + T.let( + :optimism_sepolia, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + POLYGON_AMOY = + T.let( + :polygon_amoy, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + SOLANA_DEVNET = + T.let( + :solana_devnet, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + SOLANA_TESTNET = + T.let( + :solana_testnet, + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::TaggedSymbol + ] + ) + end + def self.values + end + end + + sig do + override.returns( + T::Array[Privy::Wallets::BalanceGetParams::Chain::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::Wallets::BalanceGetParams::Chain) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + ARBITRUM = + T.let( + :arbitrum, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + BASE = + T.let(:base, Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol) + TEMPO = + T.let(:tempo, Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol) + LINEA = + T.let(:linea, Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol) + OPTIMISM = + T.let( + :optimism, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + POLYGON = + T.let( + :polygon, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + SOLANA = + T.let( + :solana, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + ZKSYNC_ERA = + T.let( + :zksync_era, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + SEPOLIA = + T.let( + :sepolia, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + ARBITRUM_SEPOLIA = + T.let( + :arbitrum_sepolia, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + BASE_SEPOLIA = + T.let( + :base_sepolia, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + LINEA_TESTNET = + T.let( + :linea_testnet, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + OPTIMISM_SEPOLIA = + T.let( + :optimism_sepolia, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + POLYGON_AMOY = + T.let( + :polygon_amoy, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + SOLANA_DEVNET = + T.let( + :solana_devnet, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + SOLANA_TESTNET = + T.let( + :solana_testnet, + Privy::Wallets::BalanceGetParams::Chain::TaggedSymbol + ) + + UnionMember1Array = + T.let( + Privy::Internal::Type::ArrayOf[ + enum: Privy::Wallets::BalanceGetParams::Chain::UnionMember1 + ], + Privy::Internal::Type::Converter + ) + end + + # If set, balances are converted to the specified fiat currency. Not supported + # when `token` is provided. + module IncludeCurrency + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::Wallets::BalanceGetParams::IncludeCurrency) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USD = + T.let( + :usd, + Privy::Wallets::BalanceGetParams::IncludeCurrency::TaggedSymbol + ) + EUR = + T.let( + :eur, + Privy::Wallets::BalanceGetParams::IncludeCurrency::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::Wallets::BalanceGetParams::IncludeCurrency::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end +end diff --git a/rbi/privy/models/wallets/balance_get_response.rbi b/rbi/privy/models/wallets/balance_get_response.rbi new file mode 100644 index 0000000..2e01c17 --- /dev/null +++ b/rbi/privy/models/wallets/balance_get_response.rbi @@ -0,0 +1,297 @@ +# typed: strong + +module Privy + module Models + module Wallets + class BalanceGetResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::Models::Wallets::BalanceGetResponse, + Privy::Internal::AnyHash + ) + end + + sig do + returns(T::Array[Privy::Models::Wallets::BalanceGetResponse::Balance]) + end + attr_accessor :balances + + sig do + params( + balances: + T::Array[ + Privy::Models::Wallets::BalanceGetResponse::Balance::OrHash + ] + ).returns(T.attached_class) + end + def self.new(balances:) + end + + sig do + override.returns( + { + balances: + T::Array[Privy::Models::Wallets::BalanceGetResponse::Balance] + } + ) + end + def to_hash + end + + class Balance < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::Models::Wallets::BalanceGetResponse::Balance, + Privy::Internal::AnyHash + ) + end + + sig do + returns( + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::Variants + ) + end + attr_accessor :asset + + sig do + returns( + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + end + attr_accessor :chain + + sig { returns(T::Hash[Symbol, String]) } + attr_accessor :display_values + + sig { returns(String) } + attr_accessor :raw_value + + sig { returns(Float) } + attr_accessor :raw_value_decimals + + sig do + params( + asset: + T.any( + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::OrSymbol, + String + ), + chain: + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::OrSymbol, + display_values: T::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float + ).returns(T.attached_class) + end + def self.new( + asset:, + chain:, + display_values:, + raw_value:, + raw_value_decimals: + ) + end + + sig do + override.returns( + { + asset: + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::Variants, + chain: + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol, + display_values: T::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float + } + ) + end + def to_hash + end + + module Asset + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol, + String + ) + end + + sig do + override.returns( + T::Array[ + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::Variants + ] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDC = + T.let( + :usdc, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + USDC_E = + T.let( + :"usdc.e", + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + ETH = + T.let( + :eth, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + POL = + T.let( + :pol, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + USDT = + T.let( + :usdt, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + EURC = + T.let( + :eurc, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + USDB = + T.let( + :usdb, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + SOL = + T.let( + :sol, + Privy::Models::Wallets::BalanceGetResponse::Balance::Asset::TaggedSymbol + ) + end + + module Chain + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + ARBITRUM = + T.let( + :arbitrum, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + BASE = + T.let( + :base, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + TEMPO = + T.let( + :tempo, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + LINEA = + T.let( + :linea, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + OPTIMISM = + T.let( + :optimism, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + POLYGON = + T.let( + :polygon, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + SOLANA = + T.let( + :solana, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + ZKSYNC_ERA = + T.let( + :zksync_era, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + SEPOLIA = + T.let( + :sepolia, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + ARBITRUM_SEPOLIA = + T.let( + :arbitrum_sepolia, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + BASE_SEPOLIA = + T.let( + :base_sepolia, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + LINEA_TESTNET = + T.let( + :linea_testnet, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + OPTIMISM_SEPOLIA = + T.let( + :optimism_sepolia, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + POLYGON_AMOY = + T.let( + :polygon_amoy, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + SOLANA_DEVNET = + T.let( + :solana_devnet, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + SOLANA_TESTNET = + T.let( + :solana_testnet, + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::Models::Wallets::BalanceGetResponse::Balance::Chain::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/privy/models/wallets/earn/ethereum/incentive_claim_params.rbi b/rbi/privy/models/wallets/earn/ethereum/incentive_claim_params.rbi new file mode 100644 index 0000000..a71f8f1 --- /dev/null +++ b/rbi/privy/models/wallets/earn/ethereum/incentive_claim_params.rbi @@ -0,0 +1,91 @@ +# typed: strong + +module Privy + module Models + module Wallets + module Earn + module Ethereum + class IncentiveClaimParams < Privy::Models::EarnIncentiveClaimRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::Wallets::Earn::Ethereum::IncentiveClaimParams, + Privy::Internal::AnyHash + ) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end + end +end diff --git a/rbi/privy/models/wallets/earn/ethereum_deposit_params.rbi b/rbi/privy/models/wallets/earn/ethereum_deposit_params.rbi new file mode 100644 index 0000000..a42fe66 --- /dev/null +++ b/rbi/privy/models/wallets/earn/ethereum_deposit_params.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Privy + module Models + module Wallets + module Earn + class EthereumDepositParams < Privy::Models::EarnDepositRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::Wallets::Earn::EthereumDepositParams, + Privy::Internal::AnyHash + ) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/privy/models/wallets/earn/ethereum_withdraw_params.rbi b/rbi/privy/models/wallets/earn/ethereum_withdraw_params.rbi new file mode 100644 index 0000000..08f46a8 --- /dev/null +++ b/rbi/privy/models/wallets/earn/ethereum_withdraw_params.rbi @@ -0,0 +1,89 @@ +# typed: strong + +module Privy + module Models + module Wallets + module Earn + class EthereumWithdrawParams < Privy::Models::EarnWithdrawRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::Wallets::Earn::EthereumWithdrawParams, + Privy::Internal::AnyHash + ) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + sig { returns(T.nilable(String)) } + attr_reader :privy_idempotency_key + + sig { params(privy_idempotency_key: String).void } + attr_writer :privy_idempotency_key + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + sig do + params( + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Idempotency keys ensure API requests are executed only once within a 24-hour + # window. + privy_idempotency_key: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + end + end + end + end +end diff --git a/rbi/privy/models/wallets/transaction_get_params.rbi b/rbi/privy/models/wallets/transaction_get_params.rbi new file mode 100644 index 0000000..99dd36f --- /dev/null +++ b/rbi/privy/models/wallets/transaction_get_params.rbi @@ -0,0 +1,300 @@ +# typed: strong + +module Privy + module Models + module Wallets + class TransactionGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any( + Privy::Wallets::TransactionGetParams, + Privy::Internal::AnyHash + ) + end + + # ID of the wallet. + sig { returns(String) } + attr_accessor :wallet_id + + sig { returns(Privy::Wallets::TransactionGetParams::Chain::OrSymbol) } + attr_accessor :chain + + # Exactly one of `token` or `asset` is required. Cannot be used together with + # `asset`. + sig do + returns( + T.nilable(Privy::Wallets::TransactionGetParams::Token::Variants) + ) + end + attr_reader :token + + sig do + params( + token: Privy::Wallets::TransactionGetParams::Token::Variants + ).void + end + attr_writer :token + + # Exactly one of `asset` or `token` is required. Cannot be used together with + # `token`. + sig do + returns( + T.nilable( + T.any( + Privy::Wallets::TransactionGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ) + ) + ) + end + attr_reader :asset + + sig do + params( + asset: + T.any( + Privy::Wallets::TransactionGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ) + ).void + end + attr_writer :asset + + sig { returns(T.nilable(String)) } + attr_reader :cursor + + sig { params(cursor: String).void } + attr_writer :cursor + + sig { returns(T.nilable(Float)) } + attr_accessor :limit + + sig { returns(T.nilable(String)) } + attr_reader :tx_hash + + sig { params(tx_hash: String).void } + attr_writer :tx_hash + + sig do + params( + wallet_id: String, + chain: Privy::Wallets::TransactionGetParams::Chain::OrSymbol, + token: Privy::Wallets::TransactionGetParams::Token::Variants, + asset: + T.any( + Privy::Wallets::TransactionGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ), + cursor: String, + limit: T.nilable(Float), + tx_hash: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T.attached_class) + end + def self.new( + # ID of the wallet. + wallet_id:, + chain:, + # Exactly one of `token` or `asset` is required. Cannot be used together with + # `asset`. + token: nil, + # Exactly one of `asset` or `token` is required. Cannot be used together with + # `token`. + asset: nil, + cursor: nil, + limit: nil, + tx_hash: nil, + request_options: {} + ) + end + + sig do + override.returns( + { + wallet_id: String, + chain: Privy::Wallets::TransactionGetParams::Chain::OrSymbol, + token: Privy::Wallets::TransactionGetParams::Token::Variants, + asset: + T.any( + Privy::Wallets::TransactionGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ), + cursor: String, + limit: T.nilable(Float), + tx_hash: String, + request_options: Privy::RequestOptions + } + ) + end + def to_hash + end + + module Chain + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::Wallets::TransactionGetParams::Chain) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + ETHEREUM = + T.let( + :ethereum, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + ARBITRUM = + T.let( + :arbitrum, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + BASE = + T.let( + :base, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + TEMPO = + T.let( + :tempo, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + LINEA = + T.let( + :linea, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + OPTIMISM = + T.let( + :optimism, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + POLYGON = + T.let( + :polygon, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + SOLANA = + T.let( + :solana, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + SEPOLIA = + T.let( + :sepolia, + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::Wallets::TransactionGetParams::Chain::TaggedSymbol + ] + ) + end + def self.values + end + end + + # Exactly one of `token` or `asset` is required. Cannot be used together with + # `asset`. + module Token + extend Privy::Internal::Type::Union + + Variants = T.type_alias { T.any(String, T::Array[String]) } + + sig do + override.returns( + T::Array[Privy::Wallets::TransactionGetParams::Token::Variants] + ) + end + def self.variants + end + + TransactionTokenAddressInputArray = + T.let( + Privy::Internal::Type::ArrayOf[String], + Privy::Internal::Type::Converter + ) + end + + # Exactly one of `asset` or `token` is required. Cannot be used together with + # `token`. + module Asset + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol, + T::Array[Privy::WalletAsset::TaggedSymbol] + ) + end + + sig do + override.returns( + T::Array[Privy::Wallets::TransactionGetParams::Asset::Variants] + ) + end + def self.variants + end + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::Wallets::TransactionGetParams::Asset) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + USDC = + T.let( + :usdc, + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + USDC_E = + T.let( + :"usdc.e", + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + ETH = + T.let( + :eth, + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + POL = + T.let( + :pol, + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + USDT = + T.let( + :usdt, + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + EURC = + T.let( + :eurc, + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + USDB = + T.let( + :usdb, + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + SOL = + T.let( + :sol, + Privy::Wallets::TransactionGetParams::Asset::TaggedSymbol + ) + + WalletAssetArray = + T.let( + Privy::Internal::Type::ArrayOf[enum: Privy::WalletAsset], + Privy::Internal::Type::Converter + ) + end + end + end + end +end diff --git a/rbi/privy/models/wallets/transaction_get_response.rbi b/rbi/privy/models/wallets/transaction_get_response.rbi new file mode 100644 index 0000000..fb25bc0 --- /dev/null +++ b/rbi/privy/models/wallets/transaction_get_response.rbi @@ -0,0 +1,247 @@ +# typed: strong + +module Privy + module Models + module Wallets + class TransactionGetResponse < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::Models::Wallets::TransactionGetResponse, + Privy::Internal::AnyHash + ) + end + + sig { returns(T.nilable(String)) } + attr_accessor :next_cursor + + sig do + returns( + T::Array[ + Privy::Models::Wallets::TransactionGetResponse::Transaction + ] + ) + end + attr_accessor :transactions + + sig do + params( + next_cursor: T.nilable(String), + transactions: + T::Array[ + Privy::Models::Wallets::TransactionGetResponse::Transaction::OrHash + ] + ).returns(T.attached_class) + end + def self.new(next_cursor:, transactions:) + end + + sig do + override.returns( + { + next_cursor: T.nilable(String), + transactions: + T::Array[ + Privy::Models::Wallets::TransactionGetResponse::Transaction + ] + } + ) + end + def to_hash + end + + class Transaction < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::Models::Wallets::TransactionGetResponse::Transaction, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(Float) } + attr_accessor :created_at + + # Details of a wallet transaction, varying by transaction type. + sig do + returns( + Privy::Models::Wallets::TransactionGetResponse::Transaction::Details + ) + end + attr_reader :details + + sig do + params( + details: + Privy::Models::Wallets::TransactionGetResponse::Transaction::Details::OrHash + ).void + end + attr_writer :details + + sig { returns(String) } + attr_accessor :privy_transaction_id + + sig do + returns( + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + end + attr_accessor :status + + sig { returns(T.nilable(String)) } + attr_accessor :transaction_hash + + sig { returns(String) } + attr_accessor :wallet_id + + sig { returns(T.nilable(T::Boolean)) } + attr_reader :sponsored + + sig { params(sponsored: T::Boolean).void } + attr_writer :sponsored + + sig { returns(T.nilable(String)) } + attr_reader :user_operation_hash + + sig { params(user_operation_hash: String).void } + attr_writer :user_operation_hash + + sig do + params( + caip2: String, + created_at: Float, + details: + Privy::Models::Wallets::TransactionGetResponse::Transaction::Details::OrHash, + privy_transaction_id: String, + status: + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::OrSymbol, + transaction_hash: T.nilable(String), + wallet_id: String, + sponsored: T::Boolean, + user_operation_hash: String + ).returns(T.attached_class) + end + def self.new( + caip2:, + created_at:, + # Details of a wallet transaction, varying by transaction type. + details:, + privy_transaction_id:, + status:, + transaction_hash:, + wallet_id:, + sponsored: nil, + user_operation_hash: nil + ) + end + + sig do + override.returns( + { + caip2: String, + created_at: Float, + details: + Privy::Models::Wallets::TransactionGetResponse::Transaction::Details, + privy_transaction_id: String, + status: + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol, + transaction_hash: T.nilable(String), + wallet_id: String, + sponsored: T::Boolean, + user_operation_hash: String + } + ) + end + def to_hash + end + + class Details < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::Models::Wallets::TransactionGetResponse::Transaction::Details, + Privy::Internal::AnyHash + ) + end + + # Details of a wallet transaction, varying by transaction type. + sig { returns(T.attached_class) } + def self.new + end + + sig { override.returns({}) } + def to_hash + end + end + + module Status + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + BROADCASTED = + T.let( + :broadcasted, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + CONFIRMED = + T.let( + :confirmed, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + EXECUTION_REVERTED = + T.let( + :execution_reverted, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + REPLACED = + T.let( + :replaced, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + FINALIZED = + T.let( + :finalized, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + PROVIDER_ERROR = + T.let( + :provider_error, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + PENDING = + T.let( + :pending, + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::Models::Wallets::TransactionGetResponse::Transaction::Status::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end + end + end +end diff --git a/rbi/privy/models/webhook_payload.rbi b/rbi/privy/models/webhook_payload.rbi new file mode 100644 index 0000000..7df80d7 --- /dev/null +++ b/rbi/privy/models/webhook_payload.rbi @@ -0,0 +1,71 @@ +# typed: strong + +module Privy + module Models + # Union of all webhook payload schemas. + module WebhookPayload + extend Privy::Internal::Type::Union + + Variants = + T.type_alias do + T.any( + Privy::UserCreatedWebhookPayload, + Privy::UserAuthenticatedWebhookPayload, + Privy::UserLinkedAccountWebhookPayload, + Privy::UserUnlinkedAccountWebhookPayload, + Privy::UserUpdatedAccountWebhookPayload, + Privy::UserTransferredAccountWebhookPayload, + Privy::UserWalletCreatedWebhookPayload, + Privy::TransactionBroadcastedWebhookPayload, + Privy::TransactionConfirmedWebhookPayload, + Privy::TransactionExecutionRevertedWebhookPayload, + Privy::TransactionStillPendingWebhookPayload, + Privy::TransactionFailedWebhookPayload, + Privy::TransactionReplacedWebhookPayload, + Privy::TransactionProviderErrorWebhookPayload, + Privy::FundsDepositedWebhookPayload, + Privy::FundsWithdrawnWebhookPayload, + Privy::PrivateKeyExportWebhookPayload, + Privy::SeedPhraseExportWebhookPayload, + Privy::WalletRecoverySetupWebhookPayload, + Privy::WalletRecoveredWebhookPayload, + Privy::MfaEnabledWebhookPayload, + Privy::MfaDisabledWebhookPayload, + Privy::YieldDepositConfirmedWebhookPayload, + Privy::YieldWithdrawConfirmedWebhookPayload, + Privy::YieldClaimConfirmedWebhookPayload, + Privy::UserOperationCompletedWebhookPayload, + Privy::IntentCreatedWebhookPayload, + Privy::IntentAuthorizedWebhookPayload, + Privy::IntentRejectedWebhookPayload, + Privy::IntentExecutedWebhookPayload, + Privy::IntentFailedWebhookPayload, + Privy::WalletActionSwapCreatedWebhookPayload, + Privy::WalletActionSwapSucceededWebhookPayload, + Privy::WalletActionSwapRejectedWebhookPayload, + Privy::WalletActionSwapFailedWebhookPayload, + Privy::WalletActionTransferCreatedWebhookPayload, + Privy::WalletActionTransferSucceededWebhookPayload, + Privy::WalletActionTransferRejectedWebhookPayload, + Privy::WalletActionTransferFailedWebhookPayload, + Privy::WalletActionEarnDepositCreatedWebhookPayload, + Privy::WalletActionEarnDepositSucceededWebhookPayload, + Privy::WalletActionEarnDepositRejectedWebhookPayload, + Privy::WalletActionEarnDepositFailedWebhookPayload, + Privy::WalletActionEarnWithdrawCreatedWebhookPayload, + Privy::WalletActionEarnWithdrawSucceededWebhookPayload, + Privy::WalletActionEarnWithdrawRejectedWebhookPayload, + Privy::WalletActionEarnWithdrawFailedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload, + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload + ) + end + + sig { override.returns(T::Array[Privy::WebhookPayload::Variants]) } + def self.variants + end + end + end +end diff --git a/rbi/privy/models/webhook_unsafe_unwrap_params.rbi b/rbi/privy/models/webhook_unsafe_unwrap_params.rbi new file mode 100644 index 0000000..9148234 --- /dev/null +++ b/rbi/privy/models/webhook_unsafe_unwrap_params.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Models + class WebhookUnsafeUnwrapParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + OrHash = + T.type_alias do + T.any(Privy::WebhookUnsafeUnwrapParams, Privy::Internal::AnyHash) + end + + sig do + params(request_options: Privy::RequestOptions::OrHash).returns( + T.attached_class + ) + end + def self.new(request_options: {}) + end + + sig { override.returns({ request_options: Privy::RequestOptions }) } + def to_hash + end + end + end +end diff --git a/rbi/privy/models/yield_authorization_headers.rbi b/rbi/privy/models/yield_authorization_headers.rbi new file mode 100644 index 0000000..577e8f0 --- /dev/null +++ b/rbi/privy/models/yield_authorization_headers.rbi @@ -0,0 +1,64 @@ +# typed: strong + +module Privy + module Models + class YieldAuthorizationHeaders < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any(Privy::YieldAuthorizationHeaders, Privy::Internal::AnyHash) + end + + # ID of your Privy app. + sig { returns(String) } + attr_accessor :privy_app_id + + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + sig { returns(T.nilable(String)) } + attr_reader :privy_authorization_signature + + sig { params(privy_authorization_signature: String).void } + attr_writer :privy_authorization_signature + + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + sig { returns(T.nilable(String)) } + attr_reader :privy_request_expiry + + sig { params(privy_request_expiry: String).void } + attr_writer :privy_request_expiry + + # Headers required to authorize yield operations. + sig do + params( + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + ).returns(T.attached_class) + end + def self.new( + # ID of your Privy app. + privy_app_id:, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil + ) + end + + sig do + override.returns( + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + ) + end + def to_hash + end + end + end +end diff --git a/rbi/privy/models/yield_claim_confirmed_webhook_payload.rbi b/rbi/privy/models/yield_claim_confirmed_webhook_payload.rbi new file mode 100644 index 0000000..f8eca65 --- /dev/null +++ b/rbi/privy/models/yield_claim_confirmed_webhook_payload.rbi @@ -0,0 +1,134 @@ +# typed: strong + +module Privy + module Models + class YieldClaimConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::YieldClaimConfirmedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :caip2 + + sig do + returns(T::Array[Privy::YieldClaimConfirmedWebhookPayload::Reward]) + end + attr_accessor :rewards + + sig { returns(String) } + attr_accessor :transaction_id + + # The type of webhook event. + sig do + returns(Privy::YieldClaimConfirmedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + sig { returns(String) } + attr_accessor :wallet_id + + # Payload for the yield.claim.confirmed webhook event. + sig do + params( + caip2: String, + rewards: + T::Array[Privy::YieldClaimConfirmedWebhookPayload::Reward::OrHash], + transaction_id: String, + type: Privy::YieldClaimConfirmedWebhookPayload::Type::OrSymbol, + wallet_id: String + ).returns(T.attached_class) + end + def self.new( + caip2:, + rewards:, + transaction_id:, + # The type of webhook event. + type:, + wallet_id: + ) + end + + sig do + override.returns( + { + caip2: String, + rewards: T::Array[Privy::YieldClaimConfirmedWebhookPayload::Reward], + transaction_id: String, + type: Privy::YieldClaimConfirmedWebhookPayload::Type::TaggedSymbol, + wallet_id: String + } + ) + end + def to_hash + end + + class Reward < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::YieldClaimConfirmedWebhookPayload::Reward, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :amount + + sig { returns(String) } + attr_accessor :token_address + + sig { returns(String) } + attr_accessor :token_symbol + + sig do + params( + amount: String, + token_address: String, + token_symbol: String + ).returns(T.attached_class) + end + def self.new(amount:, token_address:, token_symbol:) + end + + sig do + override.returns( + { amount: String, token_address: String, token_symbol: String } + ) + end + def to_hash + end + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::YieldClaimConfirmedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + YIELD_CLAIM_CONFIRMED = + T.let( + :"yield.claim.confirmed", + Privy::YieldClaimConfirmedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::YieldClaimConfirmedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/yield_deposit_confirmed_webhook_payload.rbi b/rbi/privy/models/yield_deposit_confirmed_webhook_payload.rbi new file mode 100644 index 0000000..d0bcd18 --- /dev/null +++ b/rbi/privy/models/yield_deposit_confirmed_webhook_payload.rbi @@ -0,0 +1,107 @@ +# typed: strong + +module Privy + module Models + class YieldDepositConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::YieldDepositConfirmedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :assets + + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(String) } + attr_accessor :owner + + sig { returns(String) } + attr_accessor :sender + + sig { returns(String) } + attr_accessor :shares + + # The type of webhook event. + sig do + returns(Privy::YieldDepositConfirmedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + sig { returns(String) } + attr_accessor :vault_address + + # Payload for the yield.deposit.confirmed webhook event. + sig do + params( + assets: String, + caip2: String, + owner: String, + sender: String, + shares: String, + type: Privy::YieldDepositConfirmedWebhookPayload::Type::OrSymbol, + vault_address: String + ).returns(T.attached_class) + end + def self.new( + assets:, + caip2:, + owner:, + sender:, + shares:, + # The type of webhook event. + type:, + vault_address: + ) + end + + sig do + override.returns( + { + assets: String, + caip2: String, + owner: String, + sender: String, + shares: String, + type: + Privy::YieldDepositConfirmedWebhookPayload::Type::TaggedSymbol, + vault_address: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::YieldDepositConfirmedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + YIELD_DEPOSIT_CONFIRMED = + T.let( + :"yield.deposit.confirmed", + Privy::YieldDepositConfirmedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::YieldDepositConfirmedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/models/yield_withdraw_confirmed_webhook_payload.rbi b/rbi/privy/models/yield_withdraw_confirmed_webhook_payload.rbi new file mode 100644 index 0000000..310fd33 --- /dev/null +++ b/rbi/privy/models/yield_withdraw_confirmed_webhook_payload.rbi @@ -0,0 +1,113 @@ +# typed: strong + +module Privy + module Models + class YieldWithdrawConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias do + T.any( + Privy::YieldWithdrawConfirmedWebhookPayload, + Privy::Internal::AnyHash + ) + end + + sig { returns(String) } + attr_accessor :assets + + sig { returns(String) } + attr_accessor :caip2 + + sig { returns(String) } + attr_accessor :owner + + sig { returns(String) } + attr_accessor :receiver + + sig { returns(String) } + attr_accessor :sender + + sig { returns(String) } + attr_accessor :shares + + # The type of webhook event. + sig do + returns(Privy::YieldWithdrawConfirmedWebhookPayload::Type::TaggedSymbol) + end + attr_accessor :type + + sig { returns(String) } + attr_accessor :vault_address + + # Payload for the yield.withdraw.confirmed webhook event. + sig do + params( + assets: String, + caip2: String, + owner: String, + receiver: String, + sender: String, + shares: String, + type: Privy::YieldWithdrawConfirmedWebhookPayload::Type::OrSymbol, + vault_address: String + ).returns(T.attached_class) + end + def self.new( + assets:, + caip2:, + owner:, + receiver:, + sender:, + shares:, + # The type of webhook event. + type:, + vault_address: + ) + end + + sig do + override.returns( + { + assets: String, + caip2: String, + owner: String, + receiver: String, + sender: String, + shares: String, + type: + Privy::YieldWithdrawConfirmedWebhookPayload::Type::TaggedSymbol, + vault_address: String + } + ) + end + def to_hash + end + + # The type of webhook event. + module Type + extend Privy::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, Privy::YieldWithdrawConfirmedWebhookPayload::Type) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + YIELD_WITHDRAW_CONFIRMED = + T.let( + :"yield.withdraw.confirmed", + Privy::YieldWithdrawConfirmedWebhookPayload::Type::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + Privy::YieldWithdrawConfirmedWebhookPayload::Type::TaggedSymbol + ] + ) + end + def self.values + end + end + end + end +end diff --git a/rbi/privy/request_options.rbi b/rbi/privy/request_options.rbi new file mode 100644 index 0000000..0b78d45 --- /dev/null +++ b/rbi/privy/request_options.rbi @@ -0,0 +1,55 @@ +# typed: strong + +module Privy + # Specify HTTP behaviour to use for a specific request. These options supplement + # or override those provided at the client level. + # + # When making a request, you can pass an actual {RequestOptions} instance, or + # simply pass a Hash with symbol keys matching the attributes on this class. + class RequestOptions < Privy::Internal::Type::BaseModel + OrHash = + T.type_alias { T.any(Privy::RequestOptions, Privy::Internal::AnyHash) } + + # @api private + sig { params(opts: Privy::RequestOptions::OrHash).void } + def self.validate!(opts) + end + + # Idempotency key to send with request and all associated retries. Will only be + # sent for write requests. + sig { returns(T.nilable(String)) } + attr_accessor :idempotency_key + + # Extra query params to send with the request. These are `.merge`’d into any + # `query` given at the client level. + sig do + returns( + T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]) + ) + end + attr_accessor :extra_query + + # Extra headers to send with the request. These are `.merged`’d into any + # `extra_headers` given at the client level. + sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) } + attr_accessor :extra_headers + + # Extra data to send with the request. These are deep merged into any data + # generated as part of the normal request. + sig { returns(T.nilable(T.anything)) } + attr_accessor :extra_body + + # Maximum number of retries to attempt after a failed initial request. + sig { returns(T.nilable(Integer)) } + attr_accessor :max_retries + + # Request timeout in seconds. + sig { returns(T.nilable(Float)) } + attr_accessor :timeout + + # Returns a new instance of RequestOptions. + sig { params(values: Privy::Internal::AnyHash).returns(T.attached_class) } + def self.new(values = {}) + end + end +end diff --git a/rbi/privy/resources/accounts.rbi b/rbi/privy/resources/accounts.rbi new file mode 100644 index 0000000..d6a8394 --- /dev/null +++ b/rbi/privy/resources/accounts.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Accounts + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/aggregations.rbi b/rbi/privy/resources/aggregations.rbi new file mode 100644 index 0000000..5ead439 --- /dev/null +++ b/rbi/privy/resources/aggregations.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Aggregations + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/analytics.rbi b/rbi/privy/resources/analytics.rbi new file mode 100644 index 0000000..1b7aa6f --- /dev/null +++ b/rbi/privy/resources/analytics.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Analytics + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/apps.rbi b/rbi/privy/resources/apps.rbi new file mode 100644 index 0000000..b18de87 --- /dev/null +++ b/rbi/privy/resources/apps.rbi @@ -0,0 +1,63 @@ +# typed: strong + +module Privy + module Resources + # Operations related to app settings and allowlist management + class Apps + # Operations related to app settings and allowlist management + sig { returns(Privy::Resources::Apps::Allowlist) } + attr_reader :allowlist + + # Get the settings and configuration for an app. + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::AppResponse) + end + def get( + # The ID of the app. + app_id, + request_options: {} + ) + end + + # Get aggregated Privy gas credits charged for a set of wallets over a time range. + # Maximum 100 wallet IDs and 30-day range per request. + sig do + params( + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: T::Array[String], + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::GasSpendResponseBody) + end + def get_gas_spend( + end_timestamp:, + start_timestamp:, + wallet_ids:, + request_options: {} + ) + end + + # Get the test accounts and credentials for an app. + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::TestAccountsResponse) + end + def get_test_credentials( + # The ID of the app. + app_id, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/apps/allowlist.rbi b/rbi/privy/resources/apps/allowlist.rbi new file mode 100644 index 0000000..76fb688 --- /dev/null +++ b/rbi/privy/resources/apps/allowlist.rbi @@ -0,0 +1,76 @@ +# typed: strong + +module Privy + module Resources + class Apps + # Operations related to app settings and allowlist management + class Allowlist + # Add a new entry to the allowlist for an app. The allowlist must be enabled. + sig do + params( + app_id: String, + user_invite_input: + T.any( + Privy::EmailInviteInput::OrHash, + Privy::EmailDomainInviteInput::OrHash, + Privy::WalletInviteInput::OrHash, + Privy::PhoneInviteInput::OrHash + ), + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::AllowlistEntry) + end + def create( + # The ID of the app. + app_id, + # Input for adding or removing an allowlist entry. Discriminated by type. + user_invite_input:, + request_options: {} + ) + end + + # Get all allowlist entries for an app. Returns the list of users allowed to + # access the app when the allowlist is enabled. + sig do + params( + app_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(T::Array[Privy::AllowlistEntry]) + end + def list( + # The ID of the app. + app_id, + request_options: {} + ) + end + + # Remove an entry from the allowlist for an app. The allowlist must be enabled. + sig do + params( + app_id: String, + user_invite_input: + T.any( + Privy::EmailInviteInput::OrHash, + Privy::EmailDomainInviteInput::OrHash, + Privy::WalletInviteInput::OrHash, + Privy::PhoneInviteInput::OrHash + ), + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::AllowlistDeletionResponse) + end + def delete( + # The ID of the app. + app_id, + # Input for adding or removing an allowlist entry. Discriminated by type. + user_invite_input:, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/privy/resources/client_auth.rbi b/rbi/privy/resources/client_auth.rbi new file mode 100644 index 0000000..92de5ea --- /dev/null +++ b/rbi/privy/resources/client_auth.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class ClientAuth + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/cross_app.rbi b/rbi/privy/resources/cross_app.rbi new file mode 100644 index 0000000..abd9896 --- /dev/null +++ b/rbi/privy/resources/cross_app.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class CrossApp + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/embedded_wallets.rbi b/rbi/privy/resources/embedded_wallets.rbi new file mode 100644 index 0000000..294ee0f --- /dev/null +++ b/rbi/privy/resources/embedded_wallets.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class EmbeddedWallets + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/funding.rbi b/rbi/privy/resources/funding.rbi new file mode 100644 index 0000000..fe2016b --- /dev/null +++ b/rbi/privy/resources/funding.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Funding + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/intents.rbi b/rbi/privy/resources/intents.rbi new file mode 100644 index 0000000..5589726 --- /dev/null +++ b/rbi/privy/resources/intents.rbi @@ -0,0 +1,389 @@ +# typed: strong + +module Privy + module Resources + class Intents + # List intents for an app. Returns a paginated list of intents with their current + # status and details. + sig do + params( + created_by_id: String, + current_user_has_signed: + Privy::IntentListParams::CurrentUserHasSigned::OrSymbol, + cursor: String, + intent_type: Privy::IntentType::OrSymbol, + limit: T.nilable(Float), + pending_member_id: String, + resource_id: String, + sort_by: Privy::IntentListParams::SortBy::OrSymbol, + status: Privy::IntentStatus::OrSymbol, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Internal::Cursor[Privy::IntentResponse::Variants]) + end + def list( + created_by_id: nil, + current_user_has_signed: nil, + cursor: nil, + # Type of intent. + intent_type: nil, + limit: nil, + pending_member_id: nil, + resource_id: nil, + sort_by: nil, + # Current status of an intent. + status: nil, + request_options: {} + ) + end + + # Create an intent to add a rule to a policy. The intent must be authorized by the + # policy owner before it can be executed. + sig do + params( + policy_id: String, + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::RuleIntentResponse) + end + def create_policy_rule( + # Path param: ID of the policy. + policy_id, + # Body param: The action to take when a policy rule matches. + action:, + # Body param + conditions:, + # Body param: Method the rule applies to. + method_:, + # Body param + name:, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Create an intent to delete a rule from a policy. The intent must be authorized + # by the policy owner before it can be executed. + sig do + params( + rule_id: String, + policy_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::RuleIntentResponse) + end + def delete_policy_rule( + # Path param: ID of the rule. + rule_id, + # Path param: ID of the policy. + policy_id:, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Retrieve an intent by ID. Returns the intent details including its current + # status, authorization details, and execution result if applicable. + sig do + params( + intent_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::IntentResponse::Variants) + end + def get( + # ID of the intent. + intent_id, + request_options: {} + ) + end + + # Create an intent to execute an RPC method on a wallet. The intent must be + # authorized by either the wallet owner or signers before it can be executed. + sig do + params( + wallet_id: String, + wallet_rpc_request_body: + T.any( + Privy::EthereumSignTransactionRpcInput::OrHash, + Privy::EthereumSendTransactionRpcInput::OrHash, + Privy::EthereumPersonalSignRpcInput::OrHash, + Privy::EthereumSignTypedDataRpcInput::OrHash, + Privy::EthereumSecp256k1SignRpcInput::OrHash, + Privy::EthereumSign7702AuthorizationRpcInput::OrHash, + Privy::EthereumSignUserOperationRpcInput::OrHash, + Privy::EthereumSendCallsRpcInput::OrHash, + Privy::SolanaSignTransactionRpcInput::OrHash, + Privy::SolanaSignAndSendTransactionRpcInput::OrHash, + Privy::SolanaSignMessageRpcInput::OrHash, + Privy::SparkTransferRpcInput::OrHash, + Privy::SparkGetBalanceRpcInput::OrHash, + Privy::SparkTransferTokensRpcInput::OrHash, + Privy::SparkGetStaticDepositAddressRpcInput::OrHash, + Privy::SparkGetClaimStaticDepositQuoteRpcInput::OrHash, + Privy::SparkClaimStaticDepositRpcInput::OrHash, + Privy::SparkCreateLightningInvoiceRpcInput::OrHash, + Privy::SparkPayLightningInvoiceRpcInput::OrHash, + Privy::SparkSignMessageWithIdentityKeyRpcInput::OrHash, + Privy::ExportPrivateKeyRpcInput::OrHash, + Privy::ExportSeedPhraseRpcInput::OrHash + ), + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::RpcIntentResponse) + end + def rpc( + # Path param: ID of the wallet. + wallet_id, + # Body param: Request body for wallet RPC operations, discriminated by method. + wallet_rpc_request_body:, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Create an intent to execute a token transfer via a wallet. The intent must be + # authorized by either the wallet owner or signers before it can be executed. + sig do + params( + wallet_id: String, + destination: Privy::TokenTransferDestination::OrHash, + source: + T.any( + Privy::NamedTokenTransferSource::OrHash, + Privy::CustomTokenTransferSource::OrHash + ), + amount_type: Privy::AmountType::OrSymbol, + slippage_bps: Integer, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::TransferIntentResponse) + end + def transfer( + # Path param: ID of the wallet. + wallet_id, + # Body param: The destination address for a token transfer. Optionally specify a + # different asset or chain for cross-asset or cross-chain transfers. + destination:, + # Body param: The source asset, amount, and chain for a token transfer. Specify + # either `asset` (named) or `asset_address` (custom), not both. + source:, + # Body param: Whether the amount refers to the input token or output token. + amount_type: nil, + # Body param: Maximum allowed slippage in basis points (1 bps = 0.01%). + slippage_bps: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Create an intent to update a key quorum. The intent must be authorized by the + # key quorum members before it can be executed. + sig do + params( + key_quorum_id: String, + authorization_threshold: Float, + display_name: String, + key_quorum_ids: T::Array[String], + public_keys: T::Array[String], + user_ids: T::Array[String], + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::KeyQuorumIntentResponse) + end + def update_key_quorum( + # Path param: ID of the key quorum. + key_quorum_id, + # Body param: The number of keys that must sign for an action to be valid. Must be + # less than or equal to total number of key quorum members. + authorization_threshold: nil, + # Body param + display_name: nil, + # Body param: List of key quorum IDs that should be members of this key quorum. + # Key quorums can only be nested 1 level deep. + key_quorum_ids: nil, + # Body param: List of P-256 public keys of the keys that should be authorized to + # sign on the key quorum, in base64-encoded DER format. + public_keys: nil, + # Body param: List of user IDs of the users that should be authorized to sign on + # the key quorum. + user_ids: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Create an intent to update a policy. The intent must be authorized by the policy + # owner before it can be executed. + sig do + params( + policy_id: String, + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody::OrHash], + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::PolicyIntentResponse) + end + def update_policy( + # Path param: ID of the policy. + policy_id, + # Body param: Name to assign to policy. + name: nil, + # Body param: The owner of the resource, specified as a Privy user ID, a P-256 + # public key, or null to remove the current owner. + owner: nil, + # Body param: The key quorum ID to set as the owner of the resource. If you + # provide this, do not specify an owner. + owner_id: nil, + # Body param + rules: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Create an intent to update a rule on a policy. The intent must be authorized by + # the policy owner before it can be executed. + sig do + params( + rule_id: String, + policy_id: String, + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::RuleIntentResponse) + end + def update_policy_rule( + # Path param: ID of the rule. + rule_id, + # Path param: ID of the policy. + policy_id:, + # Body param: The action to take when a policy rule matches. + action:, + # Body param + conditions:, + # Body param: Method the rule applies to. + method_:, + # Body param + name:, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Create an intent to update a wallet. The intent must be authorized by the wallet + # owner before it can be executed. + sig do + params( + wallet_id: String, + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: T.nilable(String), + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::WalletIntentResponse) + end + def update_wallet( + # Path param: ID of the wallet. + wallet_id, + # Body param: Additional signers for the wallet. + additional_signers: nil, + # Body param: A human-readable label for the wallet. Set to null to clear. + display_name: nil, + # Body param: The owner of the resource, specified as a Privy user ID, a P-256 + # public key, or null to remove the current owner. + owner: nil, + # Body param: The key quorum ID to set as the owner of the resource. If you + # provide this, do not specify an owner. + owner_id: nil, + # Body param: New policy IDs to enforce on the wallet. Currently, only one policy + # is supported per wallet. + policy_ids: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/key_quorums.rbi b/rbi/privy/resources/key_quorums.rbi new file mode 100644 index 0000000..e407d63 --- /dev/null +++ b/rbi/privy/resources/key_quorums.rbi @@ -0,0 +1,122 @@ +# typed: strong + +module Privy + module Resources + # Operations related to key quorums + class KeyQuorums + # Create a new key quorum. + sig do + params( + authorization_threshold: Float, + display_name: String, + key_quorum_ids: T::Array[String], + public_keys: T::Array[String], + user_ids: T::Array[String], + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::KeyQuorum) + end + def create( + # The number of keys that must sign for an action to be valid. Must be less than + # or equal to total number of key quorum members. + authorization_threshold: nil, + display_name: nil, + # List of key quorum IDs that should be members of this key quorum. Key quorums + # can only be nested 1 level deep. At least one of `user_ids`, `public_keys`, or + # `key_quorum_ids` is required. + key_quorum_ids: nil, + # List of P-256 public keys of the keys that should be authorized to sign on the + # key quorum, in base64-encoded DER format. At least one of `user_ids`, + # `public_keys`, or `key_quorum_ids` is required. + public_keys: nil, + # List of user IDs of the users that should be authorized to sign on the key + # quorum. At least one of `user_ids`, `public_keys`, or `key_quorum_ids` is + # required. + user_ids: nil, + request_options: {} + ) + end + + # Update a key quorum by key quorum ID. + sig do + params( + key_quorum_id: String, + authorization_threshold: Float, + display_name: String, + key_quorum_ids: T::Array[String], + public_keys: T::Array[String], + user_ids: T::Array[String], + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::KeyQuorum) + end + def update( + # Path param: A unique identifier for a key quorum. + key_quorum_id, + # Body param: The number of keys that must sign for an action to be valid. Must be + # less than or equal to total number of key quorum members. + authorization_threshold: nil, + # Body param + display_name: nil, + # Body param: List of key quorum IDs that should be members of this key quorum. + # Key quorums can only be nested 1 level deep. + key_quorum_ids: nil, + # Body param: List of P-256 public keys of the keys that should be authorized to + # sign on the key quorum, in base64-encoded DER format. + public_keys: nil, + # Body param: List of user IDs of the users that should be authorized to sign on + # the key quorum. + user_ids: nil, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Delete a key quorum by key quorum ID. + sig do + params( + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::SuccessResponse) + end + def delete( + # A unique identifier for a key quorum. + key_quorum_id, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Get a key quorum by ID. + sig do + params( + key_quorum_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::KeyQuorum) + end + def get( + # A unique identifier for a key quorum. + key_quorum_id, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/kraken_embed.rbi b/rbi/privy/resources/kraken_embed.rbi new file mode 100644 index 0000000..44d621e --- /dev/null +++ b/rbi/privy/resources/kraken_embed.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class KrakenEmbed + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/organizations.rbi b/rbi/privy/resources/organizations.rbi new file mode 100644 index 0000000..84191fa --- /dev/null +++ b/rbi/privy/resources/organizations.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Organizations + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/policies.rbi b/rbi/privy/resources/policies.rbi new file mode 100644 index 0000000..b98ba6b --- /dev/null +++ b/rbi/privy/resources/policies.rbi @@ -0,0 +1,272 @@ +# typed: strong + +module Privy + module Resources + # Operations related to policies + class Policies + # Create a new policy. + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + name: String, + rules: T::Array[Privy::PolicyCreateParams::Rule::OrHash], + version: Privy::PolicyCreateParams::Version::OrSymbol, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + privy_idempotency_key: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Policy) + end + def create( + # Body param: The wallet chain types. + chain_type:, + # Body param: Name to assign to policy. + name:, + # Body param + rules:, + # Body param: Version of the policy. Currently, 1.0 is the only version. + version:, + # Body param: The owner of the resource, specified as a Privy user ID, a P-256 + # public key, or null to remove the current owner. + owner: nil, + # Body param: The key quorum ID to set as the owner of the resource. If you + # provide this, do not specify an owner. + owner_id: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + request_options: {} + ) + end + + # Update a policy by policy ID. + sig do + params( + policy_id: String, + name: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + rules: T::Array[Privy::PolicyRuleRequestBody::OrHash], + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Policy) + end + def update( + # Path param + policy_id, + # Body param: Name to assign to policy. + name: nil, + # Body param: The owner of the resource, specified as a Privy user ID, a P-256 + # public key, or null to remove the current owner. + owner: nil, + # Body param: The key quorum ID to set as the owner of the resource. If you + # provide this, do not specify an owner. + owner_id: nil, + # Body param + rules: nil, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Delete a policy by policy ID. + sig do + params( + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::SuccessResponse) + end + def delete( + policy_id, + # Request authorization signature. If multiple signatures are required, they + # should be comma separated. + privy_authorization_signature: nil, + # Request expiry. Value is a Unix timestamp in milliseconds representing the + # deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Create a new rule for a policy. + sig do + params( + policy_id: String, + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::PolicyRuleResponse) + end + def create_rule( + # Path param + policy_id, + # Body param: The action to take when a policy rule matches. + action:, + # Body param + conditions:, + # Body param: Method the rule applies to. + method_:, + # Body param + name:, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Delete a rule by policy ID and rule ID. + sig do + params( + rule_id: String, + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::SuccessResponse) + end + def delete_rule( + # Path param + rule_id, + # Path param + policy_id:, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Get a policy by policy ID. + sig do + params( + policy_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Policy) + end + def get(policy_id, request_options: {}) + end + + # Get a rule by policy ID and rule ID. + sig do + params( + rule_id: String, + policy_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::PolicyRuleResponse) + end + def get_rule(rule_id, policy_id:, request_options: {}) + end + + # Update a rule by policy ID and rule ID. + sig do + params( + rule_id: String, + policy_id: String, + action: Privy::PolicyAction::OrSymbol, + conditions: + T::Array[ + T.any( + Privy::EthereumTransactionCondition::OrHash, + Privy::EthereumCalldataCondition::OrHash, + Privy::EthereumTypedDataDomainCondition::OrHash, + Privy::EthereumTypedDataMessageCondition::OrHash, + Privy::Ethereum7702AuthorizationCondition::OrHash, + Privy::SolanaProgramInstructionCondition::OrHash, + Privy::SolanaSystemProgramInstructionCondition::OrHash, + Privy::SolanaTokenProgramInstructionCondition::OrHash, + Privy::SystemCondition::OrHash, + Privy::TronTransactionCondition::OrHash, + Privy::TronCalldataCondition::OrHash, + Privy::SuiTransactionCommandCondition::OrHash, + Privy::SuiTransferObjectsCommandCondition::OrHash, + Privy::ActionRequestBodyCondition::OrHash, + Privy::AggregationCondition::OrHash + ) + ], + method_: Privy::PolicyMethod::OrSymbol, + name: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::PolicyRuleResponse) + end + def update_rule( + # Path param + rule_id, + # Path param + policy_id:, + # Body param: The action to take when a policy rule matches. + action:, + # Body param + conditions:, + # Body param: Method the rule applies to. + method_:, + # Body param + name:, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/shared.rbi b/rbi/privy/resources/shared.rbi new file mode 100644 index 0000000..78e768c --- /dev/null +++ b/rbi/privy/resources/shared.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Shared + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/swaps.rbi b/rbi/privy/resources/swaps.rbi new file mode 100644 index 0000000..79f4b95 --- /dev/null +++ b/rbi/privy/resources/swaps.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Swaps + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/transactions.rbi b/rbi/privy/resources/transactions.rbi new file mode 100644 index 0000000..339cc69 --- /dev/null +++ b/rbi/privy/resources/transactions.rbi @@ -0,0 +1,27 @@ +# typed: strong + +module Privy + module Resources + # Operations related to transactions + class Transactions + # Get a transaction by transaction ID. + sig do + params( + transaction_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Transaction) + end + def get( + # ID of the transaction. + transaction_id, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/users.rbi b/rbi/privy/resources/users.rbi new file mode 100644 index 0000000..46f1cb0 --- /dev/null +++ b/rbi/privy/resources/users.rbi @@ -0,0 +1,282 @@ +# typed: strong + +module Privy + module Resources + # Operations related to users + class Users + # Create a new user with linked accounts. Optionally pre-generate embedded wallets + # for the user. + sig do + params( + linked_accounts: + T::Array[ + T.any( + Privy::LinkedAccountWalletInput::OrHash, + Privy::LinkedAccountEmailInput::OrHash, + Privy::LinkedAccountPhoneInput::OrHash, + Privy::LinkedAccountGoogleInput::OrHash, + Privy::LinkedAccountTwitterInput::OrHash, + Privy::LinkedAccountDiscordInput::OrHash, + Privy::LinkedAccountGitHubInput::OrHash, + Privy::LinkedAccountSpotifyInput::OrHash, + Privy::LinkedAccountInstagramInput::OrHash, + Privy::LinkedAccountTiktokInput::OrHash, + Privy::LinkedAccountLineInput::OrHash, + Privy::LinkedAccountTwitchInput::OrHash, + Privy::LinkedAccountAppleInput::OrHash, + Privy::LinkedAccountLinkedInInput::OrHash, + Privy::LinkedAccountFarcasterInput::OrHash, + Privy::LinkedAccountTelegramInput::OrHash, + Privy::LinkedAccountCustomJwtInput::OrHash, + Privy::LinkedAccountPasskeyInput::OrHash + ) + ], + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + wallets: T::Array[Privy::UserCreateParams::Wallet::OrHash], + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def create( + linked_accounts:, + # Custom metadata associated with the user. + custom_metadata: nil, + # Wallets to create for the user. + wallets: nil, + request_options: {} + ) + end + + # Get all users in your app. + sig do + params( + cursor: String, + limit: T.nilable(Float), + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Internal::Cursor[Privy::User]) + end + def list(cursor: nil, limit: nil, request_options: {}) + end + + # Delete a user by user ID. + sig do + params( + user_id: String, + request_options: Privy::RequestOptions::OrHash + ).void + end + def delete( + # ID of the user. + user_id, + request_options: {} + ) + end + + # Get a user by user ID. + sig do + params( + user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get( + # User ID + user_id, + request_options: {} + ) + end + + # Looks up a user by their custom auth ID. + sig do + params( + custom_user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_custom_auth_id(custom_user_id:, request_options: {}) + end + + # Looks up a user by their Discord username. + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_discord_username(username:, request_options: {}) + end + + # Looks up a user by their email address. + sig do + params( + address: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_email_address(address:, request_options: {}) + end + + # Looks up a user by their Farcaster ID. + sig do + params( + fid: Float, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_farcaster_id(fid:, request_options: {}) + end + + # Looks up a user by their Github username. + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_github_username(username:, request_options: {}) + end + + # Looks up a user by their phone number. + sig do + params( + number: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_phone_number(number:, request_options: {}) + end + + # Looks up a user by their smart wallet address. + sig do + params( + address: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_smart_wallet_address(address:, request_options: {}) + end + + # Looks up a user by their Telegram user ID. + sig do + params( + telegram_user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_telegram_user_id(telegram_user_id:, request_options: {}) + end + + # Looks up a user by their Telegram username. + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_telegram_username(username:, request_options: {}) + end + + # Looks up a user by their Twitter subject. + sig do + params( + subject: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_twitter_subject(subject:, request_options: {}) + end + + # Looks up a user by their Twitter username. + sig do + params( + username: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_twitter_username(username:, request_options: {}) + end + + # Looks up a user by their wallet address. + sig do + params( + address: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def get_by_wallet_address(address:, request_options: {}) + end + + # Creates an embedded wallet for an existing user. + sig do + params( + user_id: String, + wallets: T::Array[Privy::WalletCreationInput::OrHash], + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def pregenerate_wallets( + # ID of the user. + user_id, + wallets:, + request_options: {} + ) + end + + # Search users by search term, emails, phone numbers, or wallet addresses. + sig do + params( + body: + T.any( + Privy::UserSearchParams::Body::SearchTerm::OrHash, + Privy::UserSearchParams::Body::UnionMember1::OrHash + ), + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def search(body:, request_options: {}) + end + + # Adds custom metadata to a user by user ID. + sig do + params( + user_id: String, + custom_metadata: T::Hash[Symbol, Privy::CustomMetadataItem::Variants], + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def set_custom_metadata( + # ID of the user. + user_id, + # Custom metadata associated with the user. + custom_metadata:, + request_options: {} + ) + end + + # Unlinks a user linked account. + sig do + params( + user_id: String, + handle: String, + type: T.any(Privy::LinkedAccountType::OrSymbol, String), + provider: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::User) + end + def unlink_linked_account( + # ID of the user. + user_id, + handle:, + # The possible types of linked accounts. + type:, + provider: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/wallet_actions.rbi b/rbi/privy/resources/wallet_actions.rbi new file mode 100644 index 0000000..2fb612e --- /dev/null +++ b/rbi/privy/resources/wallet_actions.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class WalletActions + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/wallets.rbi b/rbi/privy/resources/wallets.rbi new file mode 100644 index 0000000..847420e --- /dev/null +++ b/rbi/privy/resources/wallets.rbi @@ -0,0 +1,447 @@ +# typed: strong + +module Privy + module Resources + class Wallets + sig { returns(Privy::Resources::Wallets::Earn) } + attr_reader :earn + + # Operations related to wallets + sig { returns(Privy::Resources::Wallets::Transactions) } + attr_reader :transactions + + # Operations related to wallets + sig { returns(Privy::Resources::Wallets::Balance) } + attr_reader :balance + + # Creates a new wallet on the requested chain and for the requested owner. + sig do + params( + chain_type: Privy::WalletChainType::OrSymbol, + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + privy_idempotency_key: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Wallet) + end + def create( + # Body param: The wallet chain types. + chain_type:, + # Body param: Additional signers for the wallet. + additional_signers: nil, + # Body param: A human-readable label for the wallet. + display_name: nil, + # Body param: A customer-provided identifier for mapping to external systems. + # URL-safe characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be + # changed after creation. + external_id: nil, + # Body param: The owner of the resource, specified as a Privy user ID, a P-256 + # public key, or null to remove the current owner. + owner: nil, + # Body param: The key quorum ID to set as the owner of the resource. If you + # provide this, do not specify an owner. + owner_id: nil, + # Body param: An optional list of up to one policy ID to enforce on the wallet. + policy_ids: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + request_options: {} + ) + end + + # Update a wallet's policies or authorization key configuration. + sig do + params( + wallet_id: String, + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: T.nilable(String), + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Wallet) + end + def update( + # Path param: ID of the wallet. + wallet_id, + # Body param: Additional signers for the wallet. + additional_signers: nil, + # Body param: A human-readable label for the wallet. Set to null to clear. + display_name: nil, + # Body param: The owner of the resource, specified as a Privy user ID, a P-256 + # public key, or null to remove the current owner. + owner: nil, + # Body param: The key quorum ID to set as the owner of the resource. If you + # provide this, do not specify an owner. + owner_id: nil, + # Body param: New policy IDs to enforce on the wallet. Currently, only one policy + # is supported per wallet. + policy_ids: nil, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Get all wallets in your app. + sig do + params( + authorization_key: String, + chain_type: Privy::WalletChainType::OrSymbol, + cursor: String, + external_id: String, + limit: T.nilable(Float), + user_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Internal::Cursor[Privy::Wallet]) + end + def list( + # Filter wallets by authorization public key. Returns wallets owned by key quorums + # that include the specified P-256 public key (base64-encoded DER format). Cannot + # be used together with user_id. + authorization_key: nil, + # The wallet chain types. + chain_type: nil, + cursor: nil, + # Filter wallets by external ID. + external_id: nil, + limit: nil, + # Filter wallets by user ID. Cannot be used together with authorization_key. + user_id: nil, + request_options: {} + ) + end + + # Initialize a wallet import. Complete by submitting the import. + sig do + params( + body: + T.any( + Privy::HDInitInput::OrHash, + Privy::PrivateKeyInitInput::OrHash + ), + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Models::WalletInitImportResponse) + end + def _init_import( + # The input for HD wallets. + body:, + request_options: {} + ) + end + + # Submit a wallet import request. + sig do + params( + wallet: + T.any( + Privy::HDSubmitInput::OrHash, + Privy::PrivateKeySubmitInput::OrHash + ), + additional_signers: + T::Array[Privy::AdditionalSignerItemInput::OrHash], + display_name: String, + external_id: String, + owner: + T.nilable( + T.any( + Privy::OwnerInputUser::OrHash, + Privy::OwnerInputPublicKey::OrHash + ) + ), + owner_id: T.nilable(String), + policy_ids: T::Array[String], + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Wallet) + end + def _submit_import( + # The submission input for importing an HD wallet. + wallet:, + # Additional signers for the wallet. + additional_signers: nil, + # A human-readable label for the wallet. + display_name: nil, + # A customer-provided identifier for mapping to external systems. URL-safe + # characters only ([a-zA-Z0-9_-]), max 64 chars. Write-once: cannot be changed + # after creation. + external_id: nil, + # The owner of the resource, specified as a Privy user ID, a P-256 public key, or + # null to remove the current owner. + owner: nil, + # The key quorum ID to set as the owner of the resource. If you provide this, do + # not specify an owner. + owner_id: nil, + # An optional list of up to one policy ID to enforce on the wallet. + policy_ids: nil, + request_options: {} + ) + end + + # Transfer tokens from a wallet to a destination address. + sig do + params( + wallet_id: String, + destination: Privy::TokenTransferDestination::OrHash, + source: + T.any( + Privy::NamedTokenTransferSource::OrHash, + Privy::CustomTokenTransferSource::OrHash + ), + amount_type: Privy::AmountType::OrSymbol, + slippage_bps: Integer, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::TransferActionResponse) + end + def _transfer( + # Path param: ID of the wallet. + wallet_id, + # Body param: The destination address for a token transfer. Optionally specify a + # different asset or chain for cross-asset or cross-chain transfers. + destination:, + # Body param: The source asset, amount, and chain for a token transfer. Specify + # either `asset` (named) or `asset_address` (custom), not both. + source:, + # Body param: Whether the amount refers to the input token or output token. + amount_type: nil, + # Body param: Maximum allowed slippage in basis points (1 bps = 0.01%). + slippage_bps: nil, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Obtain a session key to enable wallet access. + sig do + params( + encryption_type: + Privy::WalletAuthenticateRequestBody::EncryptionType::OrSymbol, + recipient_public_key: String, + user_jwt: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::WalletAuthenticateWithJwtResponse::Variants) + end + def authenticate_with_jwt( + # The encryption type for the authentication response. Currently only supports + # HPKE. + encryption_type:, + # The public key of your ECDH keypair, in base64-encoded, SPKI-format, whose + # private key will be able to decrypt the session key. + recipient_public_key:, + # The user's JWT, to be used to authenticate the user. + user_jwt:, + request_options: {} + ) + end + + # Create wallets with an associated recovery user. + sig do + params( + primary_signer: + Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner::OrHash, + recovery_user: + Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser::OrHash, + wallets: + T::Array[ + Privy::WalletCreateWalletsWithRecoveryParams::Wallet::OrHash + ], + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::WalletCreateWalletsWithRecoveryResponse) + end + def create_wallets_with_recovery( + primary_signer:, + recovery_user:, + wallets:, + request_options: {} + ) + end + + # Export a wallet's private key + sig do + params( + wallet_id: String, + encryption_type: Privy::HpkeEncryption::OrSymbol, + recipient_public_key: String, + export_seed_phrase: T::Boolean, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::WalletExportResponseBody) + end + def export( + # Path param: ID of the wallet. + wallet_id, + # Body param: The encryption type of the wallet to import. Currently only supports + # `HPKE`. + encryption_type:, + # Body param: The base64-encoded encryption public key to encrypt the wallet + # private key with. + recipient_public_key:, + # Body param + export_seed_phrase: nil, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Get a wallet by wallet ID. + sig do + params( + wallet_id: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Wallet) + end + def get( + # ID of the wallet. + wallet_id, + request_options: {} + ) + end + + # Look up a wallet by its blockchain address. Returns the wallet object if found. + sig do + params( + address: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Wallet) + end + def get_wallet_by_address( + # A blockchain wallet address (Ethereum or Solana). + address:, + request_options: {} + ) + end + + # Sign a message with a wallet by wallet ID. + sig do + params( + wallet_id: String, + params: + T.any( + Privy::RawSignHashParams::OrHash, + Privy::RawSignBytesParams::OrHash + ), + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::RawSignResponse) + end + def raw_sign( + # Path param: ID of the wallet. + wallet_id, + # Body param: Parameters for the `raw_sign` RPC. + params:, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Sign a message or transaction with a wallet by wallet ID. + sig do + params( + wallet_id: String, + wallet_rpc_request_body: + T.any( + Privy::EthereumSignTransactionRpcInput::OrHash, + Privy::EthereumSendTransactionRpcInput::OrHash, + Privy::EthereumPersonalSignRpcInput::OrHash, + Privy::EthereumSignTypedDataRpcInput::OrHash, + Privy::EthereumSecp256k1SignRpcInput::OrHash, + Privy::EthereumSign7702AuthorizationRpcInput::OrHash, + Privy::EthereumSignUserOperationRpcInput::OrHash, + Privy::EthereumSendCallsRpcInput::OrHash, + Privy::SolanaSignTransactionRpcInput::OrHash, + Privy::SolanaSignAndSendTransactionRpcInput::OrHash, + Privy::SolanaSignMessageRpcInput::OrHash, + Privy::SparkTransferRpcInput::OrHash, + Privy::SparkGetBalanceRpcInput::OrHash, + Privy::SparkTransferTokensRpcInput::OrHash, + Privy::SparkGetStaticDepositAddressRpcInput::OrHash, + Privy::SparkGetClaimStaticDepositQuoteRpcInput::OrHash, + Privy::SparkClaimStaticDepositRpcInput::OrHash, + Privy::SparkCreateLightningInvoiceRpcInput::OrHash, + Privy::SparkPayLightningInvoiceRpcInput::OrHash, + Privy::SparkSignMessageWithIdentityKeyRpcInput::OrHash, + Privy::ExportPrivateKeyRpcInput::OrHash, + Privy::ExportSeedPhraseRpcInput::OrHash + ), + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::WalletRpcResponse::Variants) + end + def rpc( + # Path param: ID of the wallet. + wallet_id, + # Body param: Request body for wallet RPC operations, discriminated by method. + wallet_rpc_request_body:, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/wallets/balance.rbi b/rbi/privy/resources/wallets/balance.rbi new file mode 100644 index 0000000..0e77af6 --- /dev/null +++ b/rbi/privy/resources/wallets/balance.rbi @@ -0,0 +1,58 @@ +# typed: strong + +module Privy + module Resources + class Wallets + # Operations related to wallets + class Balance + # Get the balance of a wallet by wallet ID. + sig do + params( + wallet_id: String, + token: Privy::Wallets::BalanceGetParams::Token::Variants, + asset: + T.any( + Privy::Wallets::BalanceGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ), + chain: + T.any( + Privy::Wallets::BalanceGetParams::Chain::OrSymbol, + T::Array[ + Privy::Wallets::BalanceGetParams::Chain::UnionMember1::OrSymbol + ] + ), + include_currency: + Privy::Wallets::BalanceGetParams::IncludeCurrency::OrSymbol, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Models::Wallets::BalanceGetResponse) + end + def get( + # ID of the wallet. + wallet_id, + # The token contract address(es) to query in format "chain:address" (e.g., + # "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" or + # "solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"). Cannot be used together + # with `asset`/`chain` or with `include_currency`. + token: nil, + # Named asset(s) to query (e.g. `eth`, `usdc`). Use together with `chain` to scope + # the query. Cannot be used with `token`. + asset: nil, + # Chain(s) to query named assets on (e.g. `base`, `ethereum`). Use together with + # `asset`. Cannot be used with `token`. + chain: nil, + # If set, balances are converted to the specified fiat currency. Not supported + # when `token` is provided. + include_currency: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/privy/resources/wallets/earn.rbi b/rbi/privy/resources/wallets/earn.rbi new file mode 100644 index 0000000..7b75a3b --- /dev/null +++ b/rbi/privy/resources/wallets/earn.rbi @@ -0,0 +1,18 @@ +# typed: strong + +module Privy + module Resources + class Wallets + class Earn + # Operations related to wallet actions + sig { returns(Privy::Resources::Wallets::Earn::Ethereum) } + attr_reader :ethereum + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/privy/resources/wallets/earn/ethereum.rbi b/rbi/privy/resources/wallets/earn/ethereum.rbi new file mode 100644 index 0000000..03fccff --- /dev/null +++ b/rbi/privy/resources/wallets/earn/ethereum.rbi @@ -0,0 +1,95 @@ +# typed: strong + +module Privy + module Resources + class Wallets + class Earn + # Operations related to wallet actions + class Ethereum + # Operations related to wallet actions + sig { returns(Privy::Resources::Wallets::Earn::Ethereum::Incentive) } + attr_reader :incentive + + # Deposit assets into an ERC-4626 vault. + sig do + params( + wallet_id: String, + vault_id: String, + amount: String, + raw_amount: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::EarnDepositActionResponse) + end + def _deposit( + # Path param: ID of the wallet. + wallet_id, + # Body param: The ID of the vault to deposit into. + vault_id:, + # Body param: Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). + # Exactly one of `amount` or `raw_amount` must be provided. + amount: nil, + # Body param: Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with + # 6 decimals). Exactly one of `amount` or `raw_amount` must be provided. + raw_amount: nil, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # Withdraw assets from an ERC-4626 vault. + sig do + params( + wallet_id: String, + vault_id: String, + amount: String, + raw_amount: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::EarnWithdrawActionResponse) + end + def _withdraw( + # Path param: ID of the wallet. + wallet_id, + # Body param: The ID of the vault to withdraw from. + vault_id:, + # Body param: Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). + # Exactly one of `amount` or `raw_amount` must be provided. + amount: nil, + # Body param: Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC + # with 6 decimals). Exactly one of `amount` or `raw_amount` must be provided. + raw_amount: nil, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end +end diff --git a/rbi/privy/resources/wallets/earn/ethereum/incentive.rbi b/rbi/privy/resources/wallets/earn/ethereum/incentive.rbi new file mode 100644 index 0000000..9af3a2c --- /dev/null +++ b/rbi/privy/resources/wallets/earn/ethereum/incentive.rbi @@ -0,0 +1,50 @@ +# typed: strong + +module Privy + module Resources + class Wallets + class Earn + class Ethereum + # Operations related to wallet actions + class Incentive + # Claim incentive rewards for a wallet. + sig do + params( + wallet_id: String, + chain: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::EarnIncentiveClaimActionResponse) + end + def _claim( + # Path param: ID of the wallet. + wallet_id, + # Body param: The blockchain network on which to perform the incentive claim. + # Supported chains include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', + # and more, along with their respective testnets. + chain:, + # Header param: Request authorization signature. If multiple signatures are + # required, they should be comma separated. + privy_authorization_signature: nil, + # Header param: Idempotency keys ensure API requests are executed only once within + # a 24-hour window. + privy_idempotency_key: nil, + # Header param: Request expiry. Value is a Unix timestamp in milliseconds + # representing the deadline by which the request must be processed. + privy_request_expiry: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end + end + end +end diff --git a/rbi/privy/resources/wallets/transactions.rbi b/rbi/privy/resources/wallets/transactions.rbi new file mode 100644 index 0000000..b7baed6 --- /dev/null +++ b/rbi/privy/resources/wallets/transactions.rbi @@ -0,0 +1,49 @@ +# typed: strong + +module Privy + module Resources + class Wallets + # Operations related to wallets + class Transactions + # Get incoming and outgoing transactions of a wallet by wallet ID. + sig do + params( + wallet_id: String, + chain: Privy::Wallets::TransactionGetParams::Chain::OrSymbol, + token: Privy::Wallets::TransactionGetParams::Token::Variants, + asset: + T.any( + Privy::Wallets::TransactionGetParams::Asset::OrSymbol, + T::Array[Privy::WalletAsset::OrSymbol] + ), + cursor: String, + limit: T.nilable(Float), + tx_hash: String, + request_options: Privy::RequestOptions::OrHash + ).returns(Privy::Models::Wallets::TransactionGetResponse) + end + def get( + # ID of the wallet. + wallet_id, + chain:, + # Exactly one of `token` or `asset` is required. Cannot be used together with + # `asset`. + token: nil, + # Exactly one of `asset` or `token` is required. Cannot be used together with + # `token`. + asset: nil, + cursor: nil, + limit: nil, + tx_hash: nil, + request_options: {} + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end + end +end diff --git a/rbi/privy/resources/webhooks.rbi b/rbi/privy/resources/webhooks.rbi new file mode 100644 index 0000000..4f2a2a0 --- /dev/null +++ b/rbi/privy/resources/webhooks.rbi @@ -0,0 +1,74 @@ +# typed: strong + +module Privy + module Resources + class Webhooks + sig do + params(payload: String).returns( + T.any( + Privy::IntentAuthorizedWebhookPayload, + Privy::IntentCreatedWebhookPayload, + Privy::IntentExecutedWebhookPayload, + Privy::IntentFailedWebhookPayload, + Privy::IntentRejectedWebhookPayload, + Privy::MfaDisabledWebhookPayload, + Privy::MfaEnabledWebhookPayload, + Privy::TransactionBroadcastedWebhookPayload, + Privy::TransactionConfirmedWebhookPayload, + Privy::TransactionExecutionRevertedWebhookPayload, + Privy::TransactionFailedWebhookPayload, + Privy::TransactionProviderErrorWebhookPayload, + Privy::TransactionReplacedWebhookPayload, + Privy::TransactionStillPendingWebhookPayload, + Privy::UserAuthenticatedWebhookPayload, + Privy::UserCreatedWebhookPayload, + Privy::UserLinkedAccountWebhookPayload, + Privy::UserTransferredAccountWebhookPayload, + Privy::UserUnlinkedAccountWebhookPayload, + Privy::UserUpdatedAccountWebhookPayload, + Privy::UserWalletCreatedWebhookPayload, + Privy::UserOperationCompletedWebhookPayload, + Privy::FundsDepositedWebhookPayload, + Privy::FundsWithdrawnWebhookPayload, + Privy::PrivateKeyExportWebhookPayload, + Privy::WalletRecoveredWebhookPayload, + Privy::WalletRecoverySetupWebhookPayload, + Privy::WalletActionEarnDepositCreatedWebhookPayload, + Privy::WalletActionEarnDepositFailedWebhookPayload, + Privy::WalletActionEarnDepositRejectedWebhookPayload, + Privy::WalletActionEarnDepositSucceededWebhookPayload, + Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload, + Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload, + Privy::WalletActionEarnWithdrawCreatedWebhookPayload, + Privy::WalletActionEarnWithdrawFailedWebhookPayload, + Privy::WalletActionEarnWithdrawRejectedWebhookPayload, + Privy::WalletActionEarnWithdrawSucceededWebhookPayload, + Privy::WalletActionSwapCreatedWebhookPayload, + Privy::WalletActionSwapFailedWebhookPayload, + Privy::WalletActionSwapRejectedWebhookPayload, + Privy::WalletActionSwapSucceededWebhookPayload, + Privy::WalletActionTransferCreatedWebhookPayload, + Privy::WalletActionTransferFailedWebhookPayload, + Privy::WalletActionTransferRejectedWebhookPayload, + Privy::WalletActionTransferSucceededWebhookPayload, + Privy::YieldClaimConfirmedWebhookPayload, + Privy::YieldDepositConfirmedWebhookPayload, + Privy::YieldWithdrawConfirmedWebhookPayload + ) + ) + end + def unsafe_unwrap( + # The raw webhook payload as a string + payload + ) + end + + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/resources/yield_.rbi b/rbi/privy/resources/yield_.rbi new file mode 100644 index 0000000..416ff3a --- /dev/null +++ b/rbi/privy/resources/yield_.rbi @@ -0,0 +1,12 @@ +# typed: strong + +module Privy + module Resources + class Yield + # @api private + sig { params(client: Privy::Client).returns(T.attached_class) } + def self.new(client:) + end + end + end +end diff --git a/rbi/privy/version.rbi b/rbi/privy/version.rbi new file mode 100644 index 0000000..6b2a022 --- /dev/null +++ b/rbi/privy/version.rbi @@ -0,0 +1,5 @@ +# typed: strong + +module Privy + VERSION = T.let(T.unsafe(nil), String) +end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..d679440 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,70 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "ruby", + "version-file": "lib/privy/version.rb", + "extra-files": [ + { + "type": "ruby-readme", + "path": "README.md" + } + ] +} \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 0000000..a5e1b80 --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then + brew bundle check >/dev/null 2>&1 || { + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo + } +fi + +echo "==> Installing Ruby dependencies…" + +exec -- bundle install "$@" diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 0000000..6d5973f --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd -- "$(dirname "$0")/.." +echo "Changed to directory: $PWD" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +exec -- bundle exec rake format FORMAT_FILE="$1" diff --git a/scripts/format b/scripts/format new file mode 100755 index 0000000..177d1e6 --- /dev/null +++ b/scripts/format @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running formatters" + +exec -- bundle exec rake format "$@" diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 0000000..08b0dbe --- /dev/null +++ b/scripts/lint @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running linters" + +exec -- bundle exec rake lint "$@" diff --git a/scripts/test b/scripts/test new file mode 100755 index 0000000..df8caf9 --- /dev/null +++ b/scripts/test @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + + + +echo "==> Running tests" +bundle exec rake test "$@" diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 0000000..61c5996 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# ANSI Color Codes +GREEN='\033[32m' +RED='\033[31m' +NC='\033[0m' # No Color + +DIST_DIR="dist" + +log_error() { + local msg="$1" + local headers="$2" + local body="$3" + echo -e "${RED}${msg}${NC}" + [[ -f "$headers" ]] && echo -e "${RED}Headers:$(cat "$headers")${NC}" + echo -e "${RED}Body: ${body}${NC}" + exit 1 +} + +upload_file() { + local file_name="$1" + local tmp_headers + tmp_headers=$(mktemp) + + if [ -f "$file_name" ]; then + echo -e "${GREEN}Processing file: $file_name${NC}" + pkg_file_name="${file_name#"${DIST_DIR}/"}" + + # Get signed URL for uploading artifact file + signed_url_response=$(curl -X POST -G "$URL" \ + -sS --retry 5 \ + -D "$tmp_headers" \ + --data-urlencode "filename=$pkg_file_name" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + + # Validate JSON and extract URL + if ! signed_url=$(echo "$signed_url_response" | jq -e -r '.url' 2>/dev/null) || [[ "$signed_url" == "null" ]]; then + log_error "Failed to get valid signed URL" "$tmp_headers" "$signed_url_response" + fi + + # Set content-type based on file extension + local extension="${file_name##*.}" + local content_type + case "$extension" in + gem) content_type="application/octet-stream" ;; + gz) content_type="application/gzip" ;; + rz) content_type="application/octet-stream" ;; + html) content_type="text/html" ;; + *) content_type="application/octet-stream" ;; + esac + + # Upload file + upload_response=$(curl -v -X PUT \ + --retry 5 \ + --retry-all-errors \ + -D "$tmp_headers" \ + -H "Content-Type: $content_type" \ + --data-binary "@${file_name}" "$signed_url" 2>&1) + + if ! echo "$upload_response" | grep -q "HTTP/[0-9.]* 200"; then + log_error "Failed to upload artifact file" "$tmp_headers" "$upload_response" + fi + + # Insert small throttle to reduce rate limiting risk + sleep 0.1 + fi +} + +walk_tree() { + local current_dir="$1" + + for entry in "$current_dir"/*; do + # Check that entry is valid + [ -e "$entry" ] || [ -h "$entry" ] || continue + + if [ -d "$entry" ]; then + walk_tree "$entry" + else + upload_file "$entry" + fi + done +} + +cd "$(dirname "$0")/../.." + +echo "::group::Building gem" +VERSION_FILE="lib/${PACKAGE_NAME}/version.rb" +if [[ ! -f "$VERSION_FILE" ]]; then + echo -e "${RED}Version file not found: ${VERSION_FILE}${NC}" + exit 1 +fi +SHORT_SHA="${SHA:0:7}" +sed -i.bak -E "s/(VERSION = \"[^\"]+)\"/\1.beta.${SHORT_SHA}\"/" "$VERSION_FILE" +rm -f "${VERSION_FILE}.bak" + +gem build +mkdir -p "${DIST_DIR}/gems" +mv ./*.gem "${DIST_DIR}/gems/" +echo "::endgroup::" + +echo "::group::Generating gem index" +gem generate_index --directory "$DIST_DIR" +echo "::endgroup::" + +echo "::group::Uploading to pkg.stainless.com" +walk_tree "$DIST_DIR" +echo "::endgroup::" + +echo -e "${GREEN}Gem artifacts uploaded to Stainless storage.${NC}" +echo -e "\033[32mInstallation: bundle remove privy && bundle add privy --source 'https://pkg.stainless.com/s/privy-api-client-ruby/$SHA'\033[0m" diff --git a/sig/privy/client.rbs b/sig/privy/client.rbs new file mode 100644 index 0000000..b5595d1 --- /dev/null +++ b/sig/privy/client.rbs @@ -0,0 +1,75 @@ +module Privy + class Client < Privy::Internal::Transport::BaseClient + DEFAULT_MAX_RETRIES: 2 + + DEFAULT_TIMEOUT_IN_SECONDS: Float + + DEFAULT_INITIAL_RETRY_DELAY: Float + + DEFAULT_MAX_RETRY_DELAY: Float + + ENVIRONMENTS: { + production: "https://api.privy.io", + staging: "https://api.staging.privy.io" + } + + attr_reader app_id: String + + attr_reader app_secret: String + + attr_reader wallets: Privy::Resources::Wallets + + attr_reader users: Privy::Resources::Users + + attr_reader policies: Privy::Resources::Policies + + attr_reader transactions: Privy::Resources::Transactions + + attr_reader key_quorums: Privy::Resources::KeyQuorums + + attr_reader intents: Privy::Resources::Intents + + attr_reader apps: Privy::Resources::Apps + + attr_reader webhooks: Privy::Resources::Webhooks + + attr_reader accounts: Privy::Resources::Accounts + + attr_reader aggregations: Privy::Resources::Aggregations + + attr_reader embedded_wallets: Privy::Resources::EmbeddedWallets + + attr_reader analytics: Privy::Resources::Analytics + + attr_reader client_auth: Privy::Resources::ClientAuth + + attr_reader funding: Privy::Resources::Funding + + attr_reader organizations: Privy::Resources::Organizations + + attr_reader cross_app: Privy::Resources::CrossApp + + attr_reader shared: Privy::Resources::Shared + + attr_reader wallet_actions: Privy::Resources::WalletActions + + attr_reader yield_: Privy::Resources::Yield + + attr_reader kraken_embed: Privy::Resources::KrakenEmbed + + attr_reader swaps: Privy::Resources::Swaps + + private def auth_headers: -> ::Hash[String, String] + + def initialize: ( + ?app_id: String?, + ?app_secret: String?, + ?environment: :production | :staging | nil, + ?base_url: String?, + ?max_retries: Integer, + ?timeout: Float, + ?initial_retry_delay: Float, + ?max_retry_delay: Float + ) -> void + end +end diff --git a/sig/privy/errors.rbs b/sig/privy/errors.rbs new file mode 100644 index 0000000..f1fd669 --- /dev/null +++ b/sig/privy/errors.rbs @@ -0,0 +1,117 @@ +module Privy + module Errors + class Error < StandardError + attr_accessor cause: StandardError? + end + + class ConversionError < Privy::Errors::Error + def cause: -> StandardError? + + def initialize: ( + on: Class, + method: Symbol, + target: top, + value: top, + ?cause: StandardError? + ) -> void + end + + class APIError < Privy::Errors::Error + attr_accessor url: URI::Generic + + attr_accessor status: Integer? + + attr_accessor headers: ::Hash[String, String]? + + attr_accessor body: top? + + def initialize: ( + url: URI::Generic, + ?status: Integer?, + ?headers: ::Hash[String, String]?, + ?body: Object?, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APIConnectionError < Privy::Errors::APIError + def initialize: ( + url: URI::Generic, + ?status: nil, + ?headers: ::Hash[String, String]?, + ?body: nil, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APITimeoutError < Privy::Errors::APIConnectionError + def initialize: ( + url: URI::Generic, + ?status: nil, + ?headers: ::Hash[String, String]?, + ?body: nil, + ?request: nil, + ?response: nil, + ?message: String? + ) -> void + end + + class APIStatusError < Privy::Errors::APIError + def self.for: ( + url: URI::Generic, + status: Integer, + headers: ::Hash[String, String]?, + body: Object?, + request: nil, + response: nil, + ?message: String? + ) -> instance + + def initialize: ( + url: URI::Generic, + status: Integer, + headers: ::Hash[String, String]?, + body: Object?, + request: nil, + response: nil, + ?message: String? + ) -> void + end + + class BadRequestError < Privy::Errors::APIStatusError + HTTP_STATUS: 400 + end + + class AuthenticationError < Privy::Errors::APIStatusError + HTTP_STATUS: 401 + end + + class PermissionDeniedError < Privy::Errors::APIStatusError + HTTP_STATUS: 403 + end + + class NotFoundError < Privy::Errors::APIStatusError + HTTP_STATUS: 404 + end + + class ConflictError < Privy::Errors::APIStatusError + HTTP_STATUS: 409 + end + + class UnprocessableEntityError < Privy::Errors::APIStatusError + HTTP_STATUS: 422 + end + + class RateLimitError < Privy::Errors::APIStatusError + HTTP_STATUS: 429 + end + + class InternalServerError < Privy::Errors::APIStatusError + HTTP_STATUS: Range[Integer] + end + end +end diff --git a/sig/privy/file_part.rbs b/sig/privy/file_part.rbs new file mode 100644 index 0000000..16baa08 --- /dev/null +++ b/sig/privy/file_part.rbs @@ -0,0 +1,21 @@ +module Privy + class FilePart + attr_reader content: Pathname | StringIO | IO | String + + attr_reader content_type: String? + + attr_reader filename: String? + + private def read: -> String + + def to_json: (*top a) -> String + + def to_yaml: (*top a) -> String + + def initialize: ( + Pathname | StringIO | IO | String content, + ?filename: (Pathname | String)?, + ?content_type: String? + ) -> void + end +end diff --git a/sig/privy/internal.rbs b/sig/privy/internal.rbs new file mode 100644 index 0000000..6e0d1a4 --- /dev/null +++ b/sig/privy/internal.rbs @@ -0,0 +1,9 @@ +module Privy + module Internal + extend Privy::Internal::Util::SorbetRuntimeSupport + + type file_input = Pathname | StringIO | IO | String | Privy::FilePart + + OMIT: Object + end +end diff --git a/sig/privy/internal/cursor.rbs b/sig/privy/internal/cursor.rbs new file mode 100644 index 0000000..d560ffb --- /dev/null +++ b/sig/privy/internal/cursor.rbs @@ -0,0 +1,13 @@ +module Privy + module Internal + class Cursor[Elem] + include Privy::Internal::Type::BasePage[Elem] + + attr_accessor data: ::Array[Elem]? + + attr_accessor next_cursor: String + + def inspect: -> String + end + end +end diff --git a/sig/privy/internal/transport/base_client.rbs b/sig/privy/internal/transport/base_client.rbs new file mode 100644 index 0000000..f20141a --- /dev/null +++ b/sig/privy/internal/transport/base_client.rbs @@ -0,0 +1,133 @@ +module Privy + module Internal + module Transport + class BaseClient + extend Privy::Internal::Util::SorbetRuntimeSupport + + type request_components = + { + method: Symbol, + path: String | ::Array[String], + query: ::Hash[String, (::Array[String] | String)?]?, + headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + body: top?, + unwrap: (Symbol + | Integer + | ::Array[(Symbol | Integer)] + | (^(top arg0) -> top))?, + page: Class?, + stream: Class?, + model: Privy::Internal::Type::Converter::input?, + options: Privy::request_opts? + } + type request_input = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + max_retries: Integer, + timeout: Float + } + + MAX_REDIRECTS: 20 + + PLATFORM_HEADERS: ::Hash[String, String] + + def self.validate!: ( + Privy::Internal::Transport::BaseClient::request_components req + ) -> void + + def self.should_retry?: ( + Integer status, + headers: ::Hash[String, String] + ) -> bool + + def self.follow_redirect: ( + Privy::Internal::Transport::BaseClient::request_input request, + status: Integer, + response_headers: ::Hash[String, String] + ) -> Privy::Internal::Transport::BaseClient::request_input + + def self.reap_connection!: ( + Integer | Privy::Errors::APIConnectionError status, + stream: Enumerable[String]? + ) -> void + + attr_reader base_url: URI::Generic + + attr_reader timeout: Float + + attr_reader max_retries: Integer + + attr_reader initial_retry_delay: Float + + attr_reader max_retry_delay: Float + + attr_reader headers: ::Hash[String, String] + + attr_reader idempotency_header: String? + + # @api private + attr_reader requester: Privy::Internal::Transport::PooledNetRequester + + def initialize: ( + base_url: String, + ?timeout: Float, + ?max_retries: Integer, + ?initial_retry_delay: Float, + ?max_retry_delay: Float, + ?headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?], + ?idempotency_header: String? + ) -> void + + private def auth_headers: -> ::Hash[String, String] + + private def user_agent: -> String + + private def generate_idempotency_key: -> String + + private def build_request: ( + Privy::Internal::Transport::BaseClient::request_components req, + Privy::request_options opts + ) -> Privy::Internal::Transport::BaseClient::request_input + + private def retry_delay: ( + ::Hash[String, String] headers, + retry_count: Integer + ) -> Float + + def send_request: ( + Privy::Internal::Transport::BaseClient::request_input request, + redirect_count: Integer, + retry_count: Integer, + send_retry_header: bool + ) -> [Integer, top, Enumerable[String]] + + def request: ( + Symbol method, + String | ::Array[String] path, + ?query: ::Hash[String, (::Array[String] | String)?]?, + ?headers: ::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?]?, + ?body: top?, + ?unwrap: (Symbol + | Integer + | ::Array[(Symbol | Integer)] + | (^(top arg0) -> top))?, + ?page: Class?, + ?stream: Class?, + ?model: Privy::Internal::Type::Converter::input?, + ?options: Privy::request_opts? + ) -> top + + def inspect: -> String + end + end + end +end diff --git a/sig/privy/internal/transport/pooled_net_requester.rbs b/sig/privy/internal/transport/pooled_net_requester.rbs new file mode 100644 index 0000000..ccf391e --- /dev/null +++ b/sig/privy/internal/transport/pooled_net_requester.rbs @@ -0,0 +1,48 @@ +module Privy + module Internal + module Transport + class PooledNetRequester + extend Privy::Internal::Util::SorbetRuntimeSupport + + type request = + { + method: Symbol, + url: URI::Generic, + headers: ::Hash[String, String], + body: top, + deadline: Float + } + + KEEP_ALIVE_TIMEOUT: 30 + + DEFAULT_MAX_CONNECTIONS: Integer + + def self.connect: ( + cert_store: OpenSSL::X509::Store, + url: URI::Generic + ) -> top + + def self.calibrate_socket_timeout: (top conn, Float deadline) -> void + + def self.build_request: ( + Privy::Internal::Transport::PooledNetRequester::request request + ) { + (String arg0) -> void + } -> [top, (^-> void)] + + private def with_pool: ( + URI::Generic url, + deadline: Float + ) { + (top arg0) -> void + } -> void + + def execute: ( + Privy::Internal::Transport::PooledNetRequester::request request + ) -> [Integer, top, Enumerable[String]] + + def initialize: (?size: Integer) -> void + end + end + end +end diff --git a/sig/privy/internal/type/array_of.rbs b/sig/privy/internal/type/array_of.rbs new file mode 100644 index 0000000..073b409 --- /dev/null +++ b/sig/privy/internal/type/array_of.rbs @@ -0,0 +1,48 @@ +module Privy + module Internal + module Type + class ArrayOf[Elem] + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def hash: -> Integer + + def coerce: ( + ::Array[top] | top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> (::Array[top] | top) + + def dump: ( + ::Array[top] | top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> (::Array[top] | top) + + def to_sorbet_type: -> top + + def item_type: -> Elem + + def nilable?: -> bool + + def initialize: ( + ::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def inspect: (?depth: Integer) -> String + end + end + end +end diff --git a/sig/privy/internal/type/base_model.rbs b/sig/privy/internal/type/base_model.rbs new file mode 100644 index 0000000..6de1f21 --- /dev/null +++ b/sig/privy/internal/type/base_model.rbs @@ -0,0 +1,102 @@ +module Privy + module Internal + module Type + class BaseModel + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + type known_field = + { mode: (:coerce | :dump)?, required: bool, nilable: bool } + + def self.inherited: (self child) -> void + + def self.known_fields: -> ::Hash[Symbol, (Privy::Internal::Type::BaseModel::known_field + & { type_fn: (^-> Privy::Internal::Type::Converter::input) })] + + def self.fields: -> ::Hash[Symbol, (Privy::Internal::Type::BaseModel::known_field + & { type: Privy::Internal::Type::Converter::input })] + + private def self.add_field: ( + Symbol name_sym, + required: bool, + type_info: { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Privy::Internal::Type::Converter::input?, + union: ^-> Privy::Internal::Type::Converter::input?, + api_name: Symbol + } + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input, + spec: ::Hash[Symbol, top] + ) -> void + + def self.required: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def self.optional: ( + Symbol name_sym, + ::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + private def self.request_only: { -> void } -> void + + private def self.response_only: { -> void } -> void + + def self.==: (top other) -> bool + + def self.hash: -> Integer + + def ==: (top other) -> bool + + def hash: -> Integer + + def self.coerce: ( + Privy::Internal::Type::BaseModel | ::Hash[top, top] | top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> (instance | top) + + def self.dump: ( + instance | top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> (::Hash[top, top] | top) + + def self.to_sorbet_type: -> top + + def self.recursively_to_h: ( + Privy::Internal::Type::BaseModel model, + convert: bool + ) -> ::Hash[Symbol, top] + + def []: (Symbol key) -> top? + + def to_h: -> ::Hash[Symbol, top] + + alias to_hash to_h + + def deep_to_h: -> ::Hash[Symbol, top] + + def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] + + def to_json: (*top a) -> String + + def to_yaml: (*top a) -> String + + def initialize: (?::Hash[Symbol, top] | instance data) -> void + + def self.inspect: (?depth: Integer) -> String + + def to_s: -> String + + def inspect: -> String + end + end + end +end diff --git a/sig/privy/internal/type/base_page.rbs b/sig/privy/internal/type/base_page.rbs new file mode 100644 index 0000000..8713cbe --- /dev/null +++ b/sig/privy/internal/type/base_page.rbs @@ -0,0 +1,24 @@ +module Privy + module Internal + module Type + module BasePage[Elem] + def next_page?: -> bool + + def next_page: -> instance + + def auto_paging_each: { (Elem arg0) -> void } -> void + + def to_enum: -> Enumerable[Elem] + + alias enum_for to_enum + + def initialize: ( + client: Privy::Internal::Transport::BaseClient, + req: Privy::Internal::Transport::BaseClient::request_components, + headers: ::Hash[String, String], + page_data: top + ) -> void + end + end + end +end diff --git a/sig/privy/internal/type/boolean.rbs b/sig/privy/internal/type/boolean.rbs new file mode 100644 index 0000000..1471232 --- /dev/null +++ b/sig/privy/internal/type/boolean.rbs @@ -0,0 +1,26 @@ +module Privy + module Internal + module Type + class Boolean + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + bool | top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> (bool | top) + + def self.dump: ( + bool | top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> (bool | top) + + def self.to_sorbet_type: -> top + end + end + end +end diff --git a/sig/privy/internal/type/converter.rbs b/sig/privy/internal/type/converter.rbs new file mode 100644 index 0000000..143d078 --- /dev/null +++ b/sig/privy/internal/type/converter.rbs @@ -0,0 +1,79 @@ +module Privy + module Internal + module Type + module Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + type input = Privy::Internal::Type::Converter | Class + + type coerce_state = + { + translate_names: bool, + strictness: bool, + exactness: { yes: Integer, no: Integer, maybe: Integer }, + error: Class, + branched: Integer + } + + type dump_state = { can_retry: bool } + + def coerce: ( + top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> top + + def dump: ( + top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> top + + def inspect: (?depth: Integer) -> String + + def self.type_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Privy::Internal::Type::Converter::input?, + union: ^-> Privy::Internal::Type::Converter::input? + } + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input spec + ) -> (^-> top) + + def self.meta_info: ( + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Privy::Internal::Type::Converter::input?, + union: ^-> Privy::Internal::Type::Converter::input? + } + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input type_info, + { + const: (nil | bool | Integer | Float | Symbol)?, + enum: ^-> Privy::Internal::Type::Converter::input?, + union: ^-> Privy::Internal::Type::Converter::input? + } + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input spec + ) -> ::Hash[Symbol, top] + + def self.new_coerce_state: ( + ?translate_names: bool + ) -> Privy::Internal::Type::Converter::coerce_state + + def self.coerce: ( + Privy::Internal::Type::Converter::input target, + top value, + ?state: Privy::Internal::Type::Converter::coerce_state + ) -> top + + def self.dump: ( + Privy::Internal::Type::Converter::input target, + top value, + ?state: Privy::Internal::Type::Converter::dump_state + ) -> top + + def self.inspect: (top target, depth: Integer) -> String + end + end + end +end diff --git a/sig/privy/internal/type/enum.rbs b/sig/privy/internal/type/enum.rbs new file mode 100644 index 0000000..d7173b8 --- /dev/null +++ b/sig/privy/internal/type/enum.rbs @@ -0,0 +1,32 @@ +module Privy + module Internal + module Type + module Enum + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def hash: -> Integer + + def coerce: ( + String | Symbol | top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> (Symbol | top) + + def dump: ( + Symbol | top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> (Symbol | top) + + def to_sorbet_type: -> top + + def inspect: (?depth: Integer) -> String + end + end + end +end diff --git a/sig/privy/internal/type/file_input.rbs b/sig/privy/internal/type/file_input.rbs new file mode 100644 index 0000000..278be4c --- /dev/null +++ b/sig/privy/internal/type/file_input.rbs @@ -0,0 +1,25 @@ +module Privy + module Internal + module Type + class FileInput + extend Privy::Internal::Type::Converter + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + StringIO | String | top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> (StringIO | top) + + def self.dump: ( + Pathname | StringIO | IO | String | top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> (Pathname | StringIO | IO | String | top) + + def self.to_sorbet_type: -> top + end + end + end +end diff --git a/sig/privy/internal/type/hash_of.rbs b/sig/privy/internal/type/hash_of.rbs new file mode 100644 index 0000000..95e66d4 --- /dev/null +++ b/sig/privy/internal/type/hash_of.rbs @@ -0,0 +1,48 @@ +module Privy + module Internal + module Type + class HashOf[Elem] + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + def self.[]: ( + ::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> instance + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def hash: -> Integer + + def coerce: ( + ::Hash[top, top] | top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> (::Hash[Symbol, top] | top) + + def dump: ( + ::Hash[top, top] | top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> (::Hash[Symbol, top] | top) + + def to_sorbet_type: -> top + + def item_type: -> Elem + + def nilable?: -> bool + + def initialize: ( + ::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input type_info, + ?::Hash[Symbol, top] spec + ) -> void + + def inspect: (?depth: Integer) -> String + end + end + end +end diff --git a/sig/privy/internal/type/request_parameters.rbs b/sig/privy/internal/type/request_parameters.rbs new file mode 100644 index 0000000..c234525 --- /dev/null +++ b/sig/privy/internal/type/request_parameters.rbs @@ -0,0 +1,17 @@ +module Privy + module Internal + module Type + type request_parameters = { request_options: Privy::request_opts } + + module RequestParameters + attr_reader request_options: Privy::request_opts + + def request_options=: (Privy::request_opts) -> Privy::request_opts + + module Converter + def dump_request: (top params) -> [top, ::Hash[Symbol, top]] + end + end + end + end +end diff --git a/sig/privy/internal/type/union.rbs b/sig/privy/internal/type/union.rbs new file mode 100644 index 0000000..a17235f --- /dev/null +++ b/sig/privy/internal/type/union.rbs @@ -0,0 +1,52 @@ +module Privy + module Internal + module Type + module Union + include Privy::Internal::Type::Converter + include Privy::Internal::Util::SorbetRuntimeSupport + + private def self.known_variants: -> ::Array[[Symbol?, (^-> Privy::Internal::Type::Converter::input), ::Hash[Symbol, top]]] + + def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]] + + def self.variants: -> ::Array[top] + + private def self.discriminator: (Symbol property) -> void + + private def self.variant: ( + Symbol + | ::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input key, + ?::Hash[Symbol, top] + | ^-> Privy::Internal::Type::Converter::input + | Privy::Internal::Type::Converter::input spec + ) -> void + + private def self.resolve_variant: ( + top value + ) -> Privy::Internal::Type::Converter::input? + + def ===: (top other) -> bool + + def ==: (top other) -> bool + + def hash: -> Integer + + def coerce: ( + top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> top + + def dump: ( + top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> top + + def to_sorbet_type: -> top + + def inspect: (?depth: Integer) -> String + end + end + end +end diff --git a/sig/privy/internal/type/unknown.rbs b/sig/privy/internal/type/unknown.rbs new file mode 100644 index 0000000..e89a663 --- /dev/null +++ b/sig/privy/internal/type/unknown.rbs @@ -0,0 +1,26 @@ +module Privy + module Internal + module Type + class Unknown + extend Privy::Internal::Type::Converter + extend Privy::Internal::Util::SorbetRuntimeSupport + + def self.===: (top other) -> bool + + def self.==: (top other) -> bool + + def self.coerce: ( + top value, + state: Privy::Internal::Type::Converter::coerce_state + ) -> top + + def self.dump: ( + top value, + state: Privy::Internal::Type::Converter::dump_state + ) -> top + + def self.to_sorbet_type: -> top + end + end + end +end diff --git a/sig/privy/internal/util.rbs b/sig/privy/internal/util.rbs new file mode 100644 index 0000000..b07ccd5 --- /dev/null +++ b/sig/privy/internal/util.rbs @@ -0,0 +1,199 @@ +module Privy + module Internal + module Util + extend Privy::Internal::Util::SorbetRuntimeSupport + + def self?.monotonic_secs: -> Float + + def self?.walk_namespaces: ( + Module | Class ns + ) -> Enumerable[(Module | Class)] + + def self?.arch: -> String + + def self?.os: -> String + + def self?.primitive?: (top input) -> bool + + def self?.coerce_boolean: (String | bool input) -> (bool | top) + + def self?.coerce_boolean!: (String | bool input) -> bool? + + def self?.coerce_integer: (String | Integer input) -> (Integer | top) + + def self?.coerce_float: (String | Integer | Float input) -> (Float | top) + + def self?.coerce_hash: (top input) -> (::Hash[top, top] | top) + + def self?.coerce_hash!: (top input) -> ::Hash[top, top]? + + def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top + + def self?.deep_merge: ( + *::Array[top] values, + ?sentinel: top?, + ?concat: bool + ) -> top + + def self?.dig: ( + ::Hash[Symbol, top] | ::Array[top] | top data, + (Symbol + | Integer + | ::Array[(Symbol | Integer)] + | (^(top arg0) -> top))? pick + ) { + -> top? + } -> top? + + RFC_3986_NOT_PCHARS: Regexp + + def self?.uri_origin: (URI::Generic uri) -> String + + def self?.encode_path: (String | Integer path) -> String + + def self?.interpolate_path: (String | ::Array[String] path) -> String + + def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] + + def self?.encode_query: ( + ::Hash[String, (::Array[String] | String)?]? query + ) -> String? + + type parsed_uri = + { + scheme: String?, + host: String?, + port: Integer?, + path: String?, + query: ::Hash[String, ::Array[String]] + } + + def self?.parse_uri: ( + URI::Generic | String url + ) -> Privy::Internal::Util::parsed_uri + + def self?.unparse_uri: ( + Privy::Internal::Util::parsed_uri parsed + ) -> URI::Generic + + def self?.join_parsed_uri: ( + Privy::Internal::Util::parsed_uri lhs, + Privy::Internal::Util::parsed_uri rhs + ) -> URI::Generic + + def self?.normalized_headers: ( + *::Hash[String, (String + | Integer + | ::Array[(String | Integer)?])?] headers + ) -> ::Hash[String, String] + + class ReadIOAdapter + def close?: -> bool? + + def close: -> void + + private def read_enum: (Integer? max_len) -> String + + def read: (?Integer? max_len, ?String? out_string) -> String? + + def initialize: ( + String | Pathname | StringIO | Enumerable[String] src + ) { + (String arg0) -> void + } -> void + end + + def self?.writable_enum: { + (Enumerator::Yielder y) -> void + } -> Enumerable[String] + + JSON_CONTENT: Regexp + JSONL_CONTENT: Regexp + + def encode_query_params: ( + ::Hash[Symbol, top] query + ) -> ::Hash[Symbol, top] + + private def write_query_param_element!: ( + ::Hash[Symbol, top] collection, + String key, + top element + ) -> nil + + def self?.write_multipart_content: ( + Enumerator::Yielder y, + val: top, + closing: ::Array[^-> void], + ?content_type: String? + ) -> void + + def self?.write_multipart_chunk: ( + Enumerator::Yielder y, + boundary: String, + key: Symbol | String, + val: top, + closing: ::Array[^-> void] + ) -> void + + def self?.encode_multipart_streaming: ( + top body + ) -> [String, Enumerable[String]] + + def self?.encode_content: ( + ::Hash[String, String] headers, + top body + ) -> top + + def self?.force_charset!: (String content_type, text: String) -> void + + def self?.decode_content: ( + ::Hash[String, String] headers, + stream: Enumerable[String], + ?suppress_error: bool + ) -> top + + def self?.fused_enum: ( + Enumerable[top] enum, + ?external: bool + ) { + -> void + } -> Enumerable[top] + + def self?.close_fused!: (Enumerable[top]? enum) -> void + + def self?.chain_fused: ( + Enumerable[top]? enum + ) { + (Enumerator::Yielder arg0) -> void + } -> Enumerable[top] + + type server_sent_event = + { event: String?, data: String?, id: String?, retry: Integer? } + + def self?.decode_lines: (Enumerable[String] enum) -> Enumerable[String] + + def self?.decode_sse: ( + Enumerable[String] lines + ) -> Enumerable[Privy::Internal::Util::server_sent_event] + + module SorbetRuntimeSupport + class MissingSorbetRuntimeError < ::RuntimeError + end + + private def sorbet_runtime_constants: -> ::Hash[Symbol, top] + + def const_missing: (Symbol name) -> void + + def sorbet_constant_defined?: (Symbol name) -> bool + + def define_sorbet_constant!: (Symbol name) { -> top } -> void + + def to_sorbet_type: -> top + + def self.to_sorbet_type: ( + Privy::Internal::Util::SorbetRuntimeSupport | top `type` + ) -> top + end + end + end +end diff --git a/sig/privy/models.rbs b/sig/privy/models.rbs new file mode 100644 index 0000000..46cdc0e --- /dev/null +++ b/sig/privy/models.rbs @@ -0,0 +1,1655 @@ +module Privy + class AbiParameter = Privy::Models::AbiParameter + + AbiSchema: Privy::Internal::Type::Converter + + class AbiSchemaItem = Privy::Models::AbiSchemaItem + + class AccountBalanceParams = Privy::Models::AccountBalanceParams + + class AccountBalanceResponse = Privy::Models::AccountBalanceResponse + + class AccountDisplayName = Privy::Models::AccountDisplayName + + class AccountResponse = Privy::Models::AccountResponse + + class AccountsDashboardListResponse = Privy::Models::AccountsDashboardListResponse + + class AccountsListResponse = Privy::Models::AccountsListResponse + + class AccountWallet = Privy::Models::AccountWallet + + class AccountWalletConfigurationItem = Privy::Models::AccountWalletConfigurationItem + + AccountWalletIDs: Privy::Internal::Type::Converter + + AccountWalletsConfiguration: Privy::Internal::Type::Converter + + class ActionRequestBodyCondition = Privy::Models::ActionRequestBodyCondition + + AdditionalSignerInput: Privy::Internal::Type::Converter + + class AdditionalSignerItemInput = Privy::Models::AdditionalSignerItemInput + + class Address = Privy::Models::Address + + class Aggregation = Privy::Models::Aggregation + + class AggregationCondition = Privy::Models::AggregationCondition + + class AggregationGroupBy = Privy::Models::AggregationGroupBy + + class AggregationInput = Privy::Models::AggregationInput + + module AggregationMethod = Privy::Models::AggregationMethod + + class AggregationMetric = Privy::Models::AggregationMetric + + class AggregationWindow = Privy::Models::AggregationWindow + + class AlchemyPaymasterContext = Privy::Models::AlchemyPaymasterContext + + class AllowlistDeletionResponse = Privy::Models::AllowlistDeletionResponse + + class AllowlistEntry = Privy::Models::AllowlistEntry + + module AmountType = Privy::Models::AmountType + + class AnalyticsEventInput = Privy::Models::AnalyticsEventInput + + class AppGetGasSpendParams = Privy::Models::AppGetGasSpendParams + + class AppGetParams = Privy::Models::AppGetParams + + class AppGetTestCredentialsParams = Privy::Models::AppGetTestCredentialsParams + + class AppResponse = Privy::Models::AppResponse + + module Apps = Privy::Models::Apps + + class AssetAccountWithBalance = Privy::Models::AssetAccountWithBalance + + class AuthenticatedUser = Privy::Models::AuthenticatedUser + + class AuthenticateJwtInput = Privy::Models::AuthenticateJwtInput + + class AuthenticateMode = Privy::Models::AuthenticateMode + + module AuthenticateModeOption = Privy::Models::AuthenticateModeOption + + class AuthenticateSiweInput = Privy::Models::AuthenticateSiweInput + + class AuthenticateSiwsInput = Privy::Models::AuthenticateSiwsInput + + class AuthorizationKeyDashboardResponse = Privy::Models::AuthorizationKeyDashboardResponse + + class AuthorizationKeyResponse = Privy::Models::AuthorizationKeyResponse + + module AuthorizationKeyRole = Privy::Models::AuthorizationKeyRole + + class BalanceAsset = Privy::Models::BalanceAsset + + class BalanceAssetByChain = Privy::Models::BalanceAssetByChain + + class BalanceResponse = Privy::Models::BalanceResponse + + class BaseActionResult = Privy::Models::BaseActionResult + + class BaseIntentResponse = Privy::Models::BaseIntentResponse + + class BridgeBrlFiatVirtualAccountDepositInstructions = Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions + + class BridgeCryptoDepositMetadata = Privy::Models::BridgeCryptoDepositMetadata + + class BridgeCryptoTransferMetadata = Privy::Models::BridgeCryptoTransferMetadata + + module BridgeDestinationAsset = Privy::Models::BridgeDestinationAsset + + class BridgeEurFiatVirtualAccountDepositInstructions = Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions + + class BridgeFiatCustomerResponse = Privy::Models::BridgeFiatCustomerResponse + + class BridgeFiatDepositMetadata = Privy::Models::BridgeFiatDepositMetadata + + class BridgeFiatRejectionReason = Privy::Models::BridgeFiatRejectionReason + + class BridgeFiatTransferMetadata = Privy::Models::BridgeFiatTransferMetadata + + module BridgeFiatVirtualAccountDepositInstructions = Privy::Models::BridgeFiatVirtualAccountDepositInstructions + + class BridgeFiatVirtualAccountDestination = Privy::Models::BridgeFiatVirtualAccountDestination + + class BridgeFiatVirtualAccountRequest = Privy::Models::BridgeFiatVirtualAccountRequest + + class BridgeFiatVirtualAccountResponse = Privy::Models::BridgeFiatVirtualAccountResponse + + class BridgeFiatVirtualAccountSource = Privy::Models::BridgeFiatVirtualAccountSource + + class BridgeGbpFiatVirtualAccountDepositInstructions = Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions + + module BridgeMetadata = Privy::Models::BridgeMetadata + + class BridgeMxnFiatVirtualAccountDepositInstructions = Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions + + module BridgeOnrampProvider = Privy::Models::BridgeOnrampProvider + + class BridgeRefundMetadata = Privy::Models::BridgeRefundMetadata + + class BridgeSandboxFiatCustomerResponse = Privy::Models::BridgeSandboxFiatCustomerResponse + + class BridgeSandboxFiatVirtualAccountRequest = Privy::Models::BridgeSandboxFiatVirtualAccountRequest + + class BridgeSandboxFiatVirtualAccountResponse = Privy::Models::BridgeSandboxFiatVirtualAccountResponse + + module BridgeSourceAsset = Privy::Models::BridgeSourceAsset + + class BridgeStaticMemoDepositMetadata = Privy::Models::BridgeStaticMemoDepositMetadata + + class BridgeTransferRefundMetadata = Privy::Models::BridgeTransferRefundMetadata + + class BridgeUsdFiatVirtualAccountDepositInstructions = Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions + + class Caip2 = Privy::Models::Caip2 + + class Caip2ChainID = Privy::Models::Caip2ChainID + + module CoinbaseBlockchain = Privy::Models::CoinbaseBlockchain + + module CoinbaseEthereumAsset = Privy::Models::CoinbaseEthereumAsset + + class CoinbaseOnRampEthereumAddress = Privy::Models::CoinbaseOnRampEthereumAddress + + class CoinbaseOnRampInitEthereumInput = Privy::Models::CoinbaseOnRampInitEthereumInput + + module CoinbaseOnRampInitInput = Privy::Models::CoinbaseOnRampInitInput + + class CoinbaseOnRampInitResponse = Privy::Models::CoinbaseOnRampInitResponse + + class CoinbaseOnRampInitSolanaInput = Privy::Models::CoinbaseOnRampInitSolanaInput + + class CoinbaseOnRampSolanaAddress = Privy::Models::CoinbaseOnRampSolanaAddress + + module CoinbaseOnRampStatus = Privy::Models::CoinbaseOnRampStatus + + class CoinbaseOnRampStatusResponse = Privy::Models::CoinbaseOnRampStatusResponse + + module CoinbaseSolanaAsset = Privy::Models::CoinbaseSolanaAsset + + module ConditionOperator = Privy::Models::ConditionOperator + + class ConditionSet = Privy::Models::ConditionSet + + class ConditionSetAuthorizationHeaders = Privy::Models::ConditionSetAuthorizationHeaders + + class ConditionSetItem = Privy::Models::ConditionSetItem + + class ConditionSetItemRequestParams = Privy::Models::ConditionSetItemRequestParams + + ConditionSetItems: Privy::Internal::Type::Converter + + ConditionSetItemsRequestBody: Privy::Internal::Type::Converter + + class ConditionSetItemsResponse = Privy::Models::ConditionSetItemsResponse + + class ConditionSetItemValueInput = Privy::Models::ConditionSetItemValueInput + + class ConditionSetRequestBody = Privy::Models::ConditionSetRequestBody + + class ConditionSetRequestParams = Privy::Models::ConditionSetRequestParams + + module ConditionValue = Privy::Models::ConditionValue + + class CreateAccountFromWalletIDsInput = Privy::Models::CreateAccountFromWalletIDsInput + + class CreateAccountFromWalletsConfigurationInput = Privy::Models::CreateAccountFromWalletsConfigurationInput + + module CreateAccountInput = Privy::Models::CreateAccountInput + + class CreateOrganizationSecretResponse = Privy::Models::CreateOrganizationSecretResponse + + class CreateOrUpdateFiatCustomerRequestInput = Privy::Models::CreateOrUpdateFiatCustomerRequestInput + + class CrossAppConnection = Privy::Models::CrossAppConnection + + class CrossAppConnectionsResponse = Privy::Models::CrossAppConnectionsResponse + + class CrossAppEmbeddedWallet = Privy::Models::CrossAppEmbeddedWallet + + class CrossAppSmartWallet = Privy::Models::CrossAppSmartWallet + + class CryptoCurrencyCode = Privy::Models::CryptoCurrencyCode + + class Currency = Privy::Models::Currency + + class CurrencyAmount = Privy::Models::CurrencyAmount + + module CurrencyAsset = Privy::Models::CurrencyAsset + + module CurveSigningChainType = Privy::Models::CurveSigningChainType + + module CurveType = Privy::Models::CurveType + + class CustodialWallet = Privy::Models::CustodialWallet + + module CustodialWalletChainType = Privy::Models::CustodialWalletChainType + + class CustodialWalletCreateInput = Privy::Models::CustodialWalletCreateInput + + module CustodialWalletProvider = Privy::Models::CustodialWalletProvider + + type custom_metadata_item = Privy::Models::custom_metadata_item + + class CustomJwtAuthenticateRequestBody = Privy::Models::CustomJwtAuthenticateRequestBody + + class CustomJwtLinkRequestBody = Privy::Models::CustomJwtLinkRequestBody + + CustomMetadata: Privy::Internal::Type::Converter + + class CustomOAuthProviderID = Privy::Models::CustomOAuthProviderID + + class CustomTokenTransferSource = Privy::Models::CustomTokenTransferSource + + class EarnAsset = Privy::Models::EarnAsset + + class EarnDepositActionResponse = Privy::Models::EarnDepositActionResponse + + class EarnDepositRequestBody = Privy::Models::EarnDepositRequestBody + + class EarnIncentiveClaimActionResponse = Privy::Models::EarnIncentiveClaimActionResponse + + class EarnIncentiveClaimRequestBody = Privy::Models::EarnIncentiveClaimRequestBody + + class EarnIncetiveClaimRewardEntry = Privy::Models::EarnIncetiveClaimRewardEntry + + class EarnWithdrawActionResponse = Privy::Models::EarnWithdrawActionResponse + + class EarnWithdrawRequestBody = Privy::Models::EarnWithdrawRequestBody + + class EmailDomain = Privy::Models::EmailDomain + + class EmailDomainInviteInput = Privy::Models::EmailDomainInviteInput + + class EmailInviteInput = Privy::Models::EmailInviteInput + + class EmbeddedWalletChainConfig = Privy::Models::EmbeddedWalletChainConfig + + class EmbeddedWalletConfigSchema = Privy::Models::EmbeddedWalletConfigSchema + + module EmbeddedWalletCreateOnLogin = Privy::Models::EmbeddedWalletCreateOnLogin + + class EmbeddedWalletCreationInput = Privy::Models::EmbeddedWalletCreationInput + + class EmbeddedWalletInputSchema = Privy::Models::EmbeddedWalletInputSchema + + module EmbeddedWalletMode = Privy::Models::EmbeddedWalletMode + + module EmbeddedWalletRecoveryMethod = Privy::Models::EmbeddedWalletRecoveryMethod + + class Ethereum7702AuthorizationCondition = Privy::Models::Ethereum7702AuthorizationCondition + + class EthereumCalldataCondition = Privy::Models::EthereumCalldataCondition + + class EthereumEarnPositionQuery = Privy::Models::EthereumEarnPositionQuery + + class EthereumEarnPositionResponse = Privy::Models::EthereumEarnPositionResponse + + module EthereumEarnProvider = Privy::Models::EthereumEarnProvider + + class EthereumEarnVaultDetailsResponse = Privy::Models::EthereumEarnVaultDetailsResponse + + class EthereumPersonalSignRpcInput = Privy::Models::EthereumPersonalSignRpcInput + + class EthereumPersonalSignRpcInputParams = Privy::Models::EthereumPersonalSignRpcInputParams + + class EthereumPersonalSignRpcResponse = Privy::Models::EthereumPersonalSignRpcResponse + + class EthereumPersonalSignRpcResponseData = Privy::Models::EthereumPersonalSignRpcResponseData + + module EthereumRpcInput = Privy::Models::EthereumRpcInput + + module EthereumRpcResponse = Privy::Models::EthereumRpcResponse + + class EthereumSecp256k1SignRpcInput = Privy::Models::EthereumSecp256k1SignRpcInput + + class EthereumSecp256k1SignRpcInputParams = Privy::Models::EthereumSecp256k1SignRpcInputParams + + class EthereumSecp256k1SignRpcResponse = Privy::Models::EthereumSecp256k1SignRpcResponse + + class EthereumSecp256k1SignRpcResponseData = Privy::Models::EthereumSecp256k1SignRpcResponseData + + class EthereumSendCallsCall = Privy::Models::EthereumSendCallsCall + + class EthereumSendCallsRpcInput = Privy::Models::EthereumSendCallsRpcInput + + class EthereumSendCallsRpcInputParams = Privy::Models::EthereumSendCallsRpcInputParams + + class EthereumSendCallsRpcResponse = Privy::Models::EthereumSendCallsRpcResponse + + class EthereumSendCallsRpcResponseData = Privy::Models::EthereumSendCallsRpcResponseData + + class EthereumSendTransactionRpcInput = Privy::Models::EthereumSendTransactionRpcInput + + class EthereumSendTransactionRpcInputParams = Privy::Models::EthereumSendTransactionRpcInputParams + + class EthereumSendTransactionRpcResponse = Privy::Models::EthereumSendTransactionRpcResponse + + class EthereumSendTransactionRpcResponseData = Privy::Models::EthereumSendTransactionRpcResponseData + + class EthereumSign7702Authorization = Privy::Models::EthereumSign7702Authorization + + class EthereumSign7702AuthorizationRpcInput = Privy::Models::EthereumSign7702AuthorizationRpcInput + + class EthereumSign7702AuthorizationRpcInputParams = Privy::Models::EthereumSign7702AuthorizationRpcInputParams + + class EthereumSign7702AuthorizationRpcResponse = Privy::Models::EthereumSign7702AuthorizationRpcResponse + + class EthereumSign7702AuthorizationRpcResponseData = Privy::Models::EthereumSign7702AuthorizationRpcResponseData + + class EthereumSignTransactionRpcInput = Privy::Models::EthereumSignTransactionRpcInput + + class EthereumSignTransactionRpcInputParams = Privy::Models::EthereumSignTransactionRpcInputParams + + class EthereumSignTransactionRpcResponse = Privy::Models::EthereumSignTransactionRpcResponse + + class EthereumSignTransactionRpcResponseData = Privy::Models::EthereumSignTransactionRpcResponseData + + class EthereumSignTypedDataRpcInput = Privy::Models::EthereumSignTypedDataRpcInput + + class EthereumSignTypedDataRpcInputParams = Privy::Models::EthereumSignTypedDataRpcInputParams + + class EthereumSignTypedDataRpcResponse = Privy::Models::EthereumSignTypedDataRpcResponse + + class EthereumSignTypedDataRpcResponseData = Privy::Models::EthereumSignTypedDataRpcResponseData + + class EthereumSignUserOperationRpcInput = Privy::Models::EthereumSignUserOperationRpcInput + + class EthereumSignUserOperationRpcInputParams = Privy::Models::EthereumSignUserOperationRpcInputParams + + class EthereumSignUserOperationRpcResponse = Privy::Models::EthereumSignUserOperationRpcResponse + + class EthereumSignUserOperationRpcResponseData = Privy::Models::EthereumSignUserOperationRpcResponseData + + class EthereumTransactionCondition = Privy::Models::EthereumTransactionCondition + + class EthereumTypedDataDomainCondition = Privy::Models::EthereumTypedDataDomainCondition + + class EthereumTypedDataInput = Privy::Models::EthereumTypedDataInput + + class EthereumTypedDataMessageCondition = Privy::Models::EthereumTypedDataMessageCondition + + class EthereumVaultDetailsInput = Privy::Models::EthereumVaultDetailsInput + + class EthereumVaultDetailsResponse = Privy::Models::EthereumVaultDetailsResponse + + class EthereumVaultPosition = Privy::Models::EthereumVaultPosition + + class EthereumVaultResponse = Privy::Models::EthereumVaultResponse + + class EthereumYieldClaimIDInput = Privy::Models::EthereumYieldClaimIDInput + + class EthereumYieldClaimInput = Privy::Models::EthereumYieldClaimInput + + class EthereumYieldClaimResponse = Privy::Models::EthereumYieldClaimResponse + + class EthereumYieldClaimReward = Privy::Models::EthereumYieldClaimReward + + class EthereumYieldDepositInput = Privy::Models::EthereumYieldDepositInput + + class EthereumYieldPositionResponse = Privy::Models::EthereumYieldPositionResponse + + class EthereumYieldPositionsInput = Privy::Models::EthereumYieldPositionsInput + + module EthereumYieldProvider = Privy::Models::EthereumYieldProvider + + class EthereumYieldSweepIDInput = Privy::Models::EthereumYieldSweepIDInput + + class EthereumYieldSweepResponse = Privy::Models::EthereumYieldSweepResponse + + module EthereumYieldSweepStatus = Privy::Models::EthereumYieldSweepStatus + + module EthereumYieldSweepType = Privy::Models::EthereumYieldSweepType + + class EthereumYieldWithdrawInput = Privy::Models::EthereumYieldWithdrawInput + + class EvmCaip2ChainID = Privy::Models::EvmCaip2ChainID + + class EvmTransactionWalletActionStep = Privy::Models::EvmTransactionWalletActionStep + + class EvmUserOperationWalletActionStep = Privy::Models::EvmUserOperationWalletActionStep + + module EvmWalletActionStepStatus = Privy::Models::EvmWalletActionStepStatus + + class ExportPrivateKeyRpcInput = Privy::Models::ExportPrivateKeyRpcInput + + class ExportPrivateKeyRpcResponse = Privy::Models::ExportPrivateKeyRpcResponse + + class ExportSeedPhraseRpcInput = Privy::Models::ExportSeedPhraseRpcInput + + class ExportSeedPhraseRpcResponse = Privy::Models::ExportSeedPhraseRpcResponse + + module ExportType = Privy::Models::ExportType + + module ExtendedChainType = Privy::Models::ExtendedChainType + + module ExternalOAuthProviderID = Privy::Models::ExternalOAuthProviderID + + class ExternalTransactionWalletActionStep = Privy::Models::ExternalTransactionWalletActionStep + + module ExternalTransactionWalletActionStepStatus = Privy::Models::ExternalTransactionWalletActionStepStatus + + class FailureReason = Privy::Models::FailureReason + + class FarcasterAuthenticateInput = Privy::Models::FarcasterAuthenticateInput + + class FarcasterAuthenticateRequestBody = Privy::Models::FarcasterAuthenticateRequestBody + + class FarcasterConnectInitResponse = Privy::Models::FarcasterConnectInitResponse + + class FarcasterConnectInitResponseBody = Privy::Models::FarcasterConnectInitResponseBody + + class FarcasterConnectStatusCompletedResponse = Privy::Models::FarcasterConnectStatusCompletedResponse + + class FarcasterConnectStatusCompletedResponseBody = Privy::Models::FarcasterConnectStatusCompletedResponseBody + + class FarcasterConnectStatusPendingResponse = Privy::Models::FarcasterConnectStatusPendingResponse + + class FarcasterConnectStatusPendingResponseBody = Privy::Models::FarcasterConnectStatusPendingResponseBody + + class FarcasterInitInput = Privy::Models::FarcasterInitInput + + class FarcasterInitRequestBody = Privy::Models::FarcasterInitRequestBody + + class FarcasterLinkInput = Privy::Models::FarcasterLinkInput + + class FarcasterLinkRequestBody = Privy::Models::FarcasterLinkRequestBody + + class FarcasterSignerApproved = Privy::Models::FarcasterSignerApproved + + class FarcasterSignerInitPendingApproval = Privy::Models::FarcasterSignerInitPendingApproval + + class FarcasterSignerInitRequestBody = Privy::Models::FarcasterSignerInitRequestBody + + module FarcasterSignerInitResponseBody = Privy::Models::FarcasterSignerInitResponseBody + + class FarcasterSignerRevoked = Privy::Models::FarcasterSignerRevoked + + class FarcasterSignerStatusPendingApproval = Privy::Models::FarcasterSignerStatusPendingApproval + + module FarcasterSignerStatusResponseBody = Privy::Models::FarcasterSignerStatusResponseBody + + class FarcasterUnlinkInput = Privy::Models::FarcasterUnlinkInput + + class FarcasterUnlinkRequestBody = Privy::Models::FarcasterUnlinkRequestBody + + class FarcasterV2AuthenticateInput = Privy::Models::FarcasterV2AuthenticateInput + + class FarcasterV2AuthenticateRequestBody = Privy::Models::FarcasterV2AuthenticateRequestBody + + class FarcasterV2InitInput = Privy::Models::FarcasterV2InitInput + + class FarcasterV2InitRequestBody = Privy::Models::FarcasterV2InitRequestBody + + class FarcasterV2InitResponse = Privy::Models::FarcasterV2InitResponse + + class FarcasterV2InitResponseBody = Privy::Models::FarcasterV2InitResponseBody + + class FiatAmount = Privy::Models::FiatAmount + + class FiatCurrencyCode = Privy::Models::FiatCurrencyCode + + module FiatCustomerResponse = Privy::Models::FiatCustomerResponse + + class FiatOnrampDestination = Privy::Models::FiatOnrampDestination + + module FiatOnrampEnvironment = Privy::Models::FiatOnrampEnvironment + + module FiatOnrampProvider = Privy::Models::FiatOnrampProvider + + class FiatOnrampProviderError = Privy::Models::FiatOnrampProviderError + + class FiatOnrampQuote = Privy::Models::FiatOnrampQuote + + class FiatOnrampSource = Privy::Models::FiatOnrampSource + + module FiatOnrampTransactionStatus = Privy::Models::FiatOnrampTransactionStatus + + module FiatVirtualAccountRequest = Privy::Models::FiatVirtualAccountRequest + + module FiatVirtualAccountResponse = Privy::Models::FiatVirtualAccountResponse + + module FirstClassChainType = Privy::Models::FirstClassChainType + + class FundingConfigResponseSchema = Privy::Models::FundingConfigResponseSchema + + module FundingMethodEnum = Privy::Models::FundingMethodEnum + + class FundingOption = Privy::Models::FundingOption + + class FundsDepositedWebhookPayload = Privy::Models::FundsDepositedWebhookPayload + + class FundsWithdrawnWebhookPayload = Privy::Models::FundsWithdrawnWebhookPayload + + module GasSpendCurrency = Privy::Models::GasSpendCurrency + + class GasSpendRequestBody = Privy::Models::GasSpendRequestBody + + class GasSpendResponseBody = Privy::Models::GasSpendResponseBody + + class GasSponsorshipConfiguration = Privy::Models::GasSponsorshipConfiguration + + class GasSponsorshipConfigurationInput = Privy::Models::GasSponsorshipConfigurationInput + + class GetByWalletAddressRequestBody = Privy::Models::GetByWalletAddressRequestBody + + class GetFiatCustomerRequestInput = Privy::Models::GetFiatCustomerRequestInput + + class GetFiatOnrampQuotesInput = Privy::Models::GetFiatOnrampQuotesInput + + class GetFiatOnrampQuotesResponse = Privy::Models::GetFiatOnrampQuotesResponse + + class GetFiatOnrampTransactionStatusInput = Privy::Models::GetFiatOnrampTransactionStatusInput + + class GetFiatOnrampTransactionStatusResponse = Privy::Models::GetFiatOnrampTransactionStatusResponse + + class GetFiatOnrampURLInput = Privy::Models::GetFiatOnrampURLInput + + class GetFiatOnrampURLResponse = Privy::Models::GetFiatOnrampURLResponse + + class GuestAuthenticateRequestBody = Privy::Models::GuestAuthenticateRequestBody + + class HDInitInput = Privy::Models::HDInitInput + + class HDPath = Privy::Models::HDPath + + class HDSubmitInput = Privy::Models::HDSubmitInput + + class Hex = Privy::Models::Hex + + module HpkeAeadAlgorithm = Privy::Models::HpkeAeadAlgorithm + + module HpkeEncryption = Privy::Models::HpkeEncryption + + class HpkeImportConfig = Privy::Models::HpkeImportConfig + + module ICloudClientType = Privy::Models::ICloudClientType + + class IntentAuthorization = Privy::Models::IntentAuthorization + + module IntentAuthorizationKeyQuorumMember = Privy::Models::IntentAuthorizationKeyQuorumMember + + module IntentAuthorizationMember = Privy::Models::IntentAuthorizationMember + + class IntentAuthorizedWebhookPayload = Privy::Models::IntentAuthorizedWebhookPayload + + class IntentCreatedWebhookPayload = Privy::Models::IntentCreatedWebhookPayload + + class IntentCreatePolicyRuleParams = Privy::Models::IntentCreatePolicyRuleParams + + class IntentCreationHeaders = Privy::Models::IntentCreationHeaders + + class IntentDeletePolicyRuleParams = Privy::Models::IntentDeletePolicyRuleParams + + class IntentExecutedWebhookPayload = Privy::Models::IntentExecutedWebhookPayload + + class IntentFailedWebhookPayload = Privy::Models::IntentFailedWebhookPayload + + class IntentGetParams = Privy::Models::IntentGetParams + + class IntentListParams = Privy::Models::IntentListParams + + class IntentRejectedWebhookPayload = Privy::Models::IntentRejectedWebhookPayload + + module IntentResponse = Privy::Models::IntentResponse + + class IntentRpcParams = Privy::Models::IntentRpcParams + + module IntentStatus = Privy::Models::IntentStatus + + class IntentTransferParams = Privy::Models::IntentTransferParams + + module IntentType = Privy::Models::IntentType + + class IntentUpdateKeyQuorumParams = Privy::Models::IntentUpdateKeyQuorumParams + + class IntentUpdatePolicyParams = Privy::Models::IntentUpdatePolicyParams + + class IntentUpdatePolicyRuleParams = Privy::Models::IntentUpdatePolicyRuleParams + + class IntentUpdateWalletParams = Privy::Models::IntentUpdateWalletParams + + class KeyQuorum = Privy::Models::KeyQuorum + + class KeyQuorumAuthorizationHeaders = Privy::Models::KeyQuorumAuthorizationHeaders + + class KeyQuorumCreateParams = Privy::Models::KeyQuorumCreateParams + + class KeyQuorumCreateRequestBody = Privy::Models::KeyQuorumCreateRequestBody + + class KeyQuorumDeleteParams = Privy::Models::KeyQuorumDeleteParams + + class KeyQuorumGetParams = Privy::Models::KeyQuorumGetParams + + class KeyQuorumID = Privy::Models::KeyQuorumID + + class KeyQuorumIntentResponse = Privy::Models::KeyQuorumIntentResponse + + class KeyQuorumUpdateParams = Privy::Models::KeyQuorumUpdateParams + + class KeyQuorumUpdateRequestBody = Privy::Models::KeyQuorumUpdateRequestBody + + class KrakenEmbedCurrentDayPnl = Privy::Models::KrakenEmbedCurrentDayPnl + + class KrakenEmbedGetAssetListQueryParamsSchema = Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema + + class KrakenEmbedGetPortfolioDetailsQueryParamsSchema = Privy::Models::KrakenEmbedGetPortfolioDetailsQueryParamsSchema + + class KrakenEmbedGetPortfolioSummaryQueryParams = Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams + + class KrakenEmbedGetPortfolioSummaryResponse = Privy::Models::KrakenEmbedGetPortfolioSummaryResponse + + class KrakenEmbedGetPortfolioTransactionsQueryParamsSchema = Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema + + class KrakenEmbedGetQuoteQueryParams = Privy::Models::KrakenEmbedGetQuoteQueryParams + + class KrakenEmbedQuoteCancelledWebhookPayload = Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload + + class KrakenEmbedQuoteExecutedWebhookPayload = Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload + + class KrakenEmbedQuoteExecutionFailedWebhookPayload = Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload + + class KrakenEmbedUserClosedWebhookPayload = Privy::Models::KrakenEmbedUserClosedWebhookPayload + + class KrakenEmbedUserDisabledWebhookPayload = Privy::Models::KrakenEmbedUserDisabledWebhookPayload + + class KrakenEmbedUserVerifiedWebhookPayload = Privy::Models::KrakenEmbedUserVerifiedWebhookPayload + + module LinkedAccount = Privy::Models::LinkedAccount + + class LinkedAccountAppleInput = Privy::Models::LinkedAccountAppleInput + + class LinkedAccountAppleOAuth = Privy::Models::LinkedAccountAppleOAuth + + class LinkedAccountAuthorizationKey = Privy::Models::LinkedAccountAuthorizationKey + + class LinkedAccountBaseWallet = Privy::Models::LinkedAccountBaseWallet + + class LinkedAccountBitcoinSegwitEmbeddedWallet = Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet + + class LinkedAccountBitcoinTaprootEmbeddedWallet = Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet + + class LinkedAccountCrossApp = Privy::Models::LinkedAccountCrossApp + + class LinkedAccountCurveSigningEmbeddedWallet = Privy::Models::LinkedAccountCurveSigningEmbeddedWallet + + class LinkedAccountCustomJwt = Privy::Models::LinkedAccountCustomJwt + + class LinkedAccountCustomJwtInput = Privy::Models::LinkedAccountCustomJwtInput + + class LinkedAccountCustomOAuth = Privy::Models::LinkedAccountCustomOAuth + + class LinkedAccountDiscordInput = Privy::Models::LinkedAccountDiscordInput + + class LinkedAccountDiscordOAuth = Privy::Models::LinkedAccountDiscordOAuth + + class LinkedAccountEmail = Privy::Models::LinkedAccountEmail + + class LinkedAccountEmailInput = Privy::Models::LinkedAccountEmailInput + + module LinkedAccountEmbeddedWallet = Privy::Models::LinkedAccountEmbeddedWallet + + module LinkedAccountEmbeddedWalletWithID = Privy::Models::LinkedAccountEmbeddedWalletWithID + + class LinkedAccountEthereum = Privy::Models::LinkedAccountEthereum + + class LinkedAccountEthereumEmbeddedWallet = Privy::Models::LinkedAccountEthereumEmbeddedWallet + + class LinkedAccountFarcaster = Privy::Models::LinkedAccountFarcaster + + class LinkedAccountFarcasterInput = Privy::Models::LinkedAccountFarcasterInput + + class LinkedAccountGitHubInput = Privy::Models::LinkedAccountGitHubInput + + class LinkedAccountGitHubOAuth = Privy::Models::LinkedAccountGitHubOAuth + + class LinkedAccountGoogleInput = Privy::Models::LinkedAccountGoogleInput + + class LinkedAccountGoogleOAuth = Privy::Models::LinkedAccountGoogleOAuth + + module LinkedAccountInput = Privy::Models::LinkedAccountInput + + class LinkedAccountInstagramInput = Privy::Models::LinkedAccountInstagramInput + + class LinkedAccountInstagramOAuth = Privy::Models::LinkedAccountInstagramOAuth + + class LinkedAccountLineInput = Privy::Models::LinkedAccountLineInput + + class LinkedAccountLineOAuth = Privy::Models::LinkedAccountLineOAuth + + class LinkedAccountLinkedInInput = Privy::Models::LinkedAccountLinkedInInput + + class LinkedAccountLinkedInOAuth = Privy::Models::LinkedAccountLinkedInOAuth + + class LinkedAccountPasskey = Privy::Models::LinkedAccountPasskey + + class LinkedAccountPasskeyInput = Privy::Models::LinkedAccountPasskeyInput + + class LinkedAccountPhone = Privy::Models::LinkedAccountPhone + + class LinkedAccountPhoneInput = Privy::Models::LinkedAccountPhoneInput + + class LinkedAccountSmartWallet = Privy::Models::LinkedAccountSmartWallet + + class LinkedAccountSolana = Privy::Models::LinkedAccountSolana + + class LinkedAccountSolanaEmbeddedWallet = Privy::Models::LinkedAccountSolanaEmbeddedWallet + + class LinkedAccountSpotifyInput = Privy::Models::LinkedAccountSpotifyInput + + class LinkedAccountSpotifyOAuth = Privy::Models::LinkedAccountSpotifyOAuth + + class LinkedAccountTelegram = Privy::Models::LinkedAccountTelegram + + class LinkedAccountTelegramInput = Privy::Models::LinkedAccountTelegramInput + + class LinkedAccountTiktokInput = Privy::Models::LinkedAccountTiktokInput + + class LinkedAccountTiktokOAuth = Privy::Models::LinkedAccountTiktokOAuth + + class LinkedAccountTwitchInput = Privy::Models::LinkedAccountTwitchInput + + class LinkedAccountTwitchOAuth = Privy::Models::LinkedAccountTwitchOAuth + + class LinkedAccountTwitterInput = Privy::Models::LinkedAccountTwitterInput + + class LinkedAccountTwitterOAuth = Privy::Models::LinkedAccountTwitterOAuth + + module LinkedAccountType = Privy::Models::LinkedAccountType + + class LinkedAccountWalletInput = Privy::Models::LinkedAccountWalletInput + + module LinkedMfaMethod = Privy::Models::LinkedMfaMethod + + class LinkJwtInput = Privy::Models::LinkJwtInput + + class MfaDisabledWebhookPayload = Privy::Models::MfaDisabledWebhookPayload + + class MfaEnabledWebhookPayload = Privy::Models::MfaEnabledWebhookPayload + + class MfaPasskeyEnrollmentRequestBody = Privy::Models::MfaPasskeyEnrollmentRequestBody + + class MfaPasskeyInitRequestBody = Privy::Models::MfaPasskeyInitRequestBody + + class MfaPasskeyInitResponseBody = Privy::Models::MfaPasskeyInitResponseBody + + class MfaPasskeyVerifyRequestBody = Privy::Models::MfaPasskeyVerifyRequestBody + + class MfaSMSEnrollRequestBody = Privy::Models::MfaSMSEnrollRequestBody + + class MfaSMSInitEnrollInput = Privy::Models::MfaSMSInitEnrollInput + + module MfaSMSInitRequestBody = Privy::Models::MfaSMSInitRequestBody + + class MfaSMSInitVerifyInput = Privy::Models::MfaSMSInitVerifyInput + + class MfaSMSVerifyRequestBody = Privy::Models::MfaSMSVerifyRequestBody + + class MfaTotpInitResponseBody = Privy::Models::MfaTotpInitResponseBody + + class MfaTotpInput = Privy::Models::MfaTotpInput + + class MfaVerifyResponseBody = Privy::Models::MfaVerifyResponseBody + + module MoonpayCurrencyCode = Privy::Models::MoonpayCurrencyCode + + class MoonpayFiatOnRampEthereumConfig = Privy::Models::MoonpayFiatOnRampEthereumConfig + + class MoonpayFiatOnRampEthereumInput = Privy::Models::MoonpayFiatOnRampEthereumInput + + class MoonpayFiatOnRampSolanaConfig = Privy::Models::MoonpayFiatOnRampSolanaConfig + + class MoonpayFiatOnRampSolanaInput = Privy::Models::MoonpayFiatOnRampSolanaInput + + class MoonpayOnRampSandboxConfig = Privy::Models::MoonpayOnRampSandboxConfig + + module MoonpayOnRampSignInput = Privy::Models::MoonpayOnRampSignInput + + class MoonpayOnRampSignResponse = Privy::Models::MoonpayOnRampSignResponse + + module MoonpayPaymentMethod = Privy::Models::MoonpayPaymentMethod + + module MoonpaySolanaCurrencyCode = Privy::Models::MoonpaySolanaCurrencyCode + + class MoonpayUiConfig = Privy::Models::MoonpayUiConfig + + module MoonpayUiTheme = Privy::Models::MoonpayUiTheme + + class NamedTokenTransferSource = Privy::Models::NamedTokenTransferSource + + class OAuthAuthenticateRecoveryResponse = Privy::Models::OAuthAuthenticateRecoveryResponse + + class OAuthAuthenticateRequestBody = Privy::Models::OAuthAuthenticateRequestBody + + class OAuthAuthorizationCodeRequestBody = Privy::Models::OAuthAuthorizationCodeRequestBody + + class OAuthCallbackICloudExpoInput = Privy::Models::OAuthCallbackICloudExpoInput + + module OAuthCodeType = Privy::Models::OAuthCodeType + + class OAuthInitICloudRecoveryInput = Privy::Models::OAuthInitICloudRecoveryInput + + class OAuthInitRecoveryInput = Privy::Models::OAuthInitRecoveryInput + + class OAuthInitRequestBody = Privy::Models::OAuthInitRequestBody + + class OAuthInitResponseBody = Privy::Models::OAuthInitResponseBody + + class OAuthLinkRequestBody = Privy::Models::OAuthLinkRequestBody + + class OAuthLinkResponseBody = Privy::Models::OAuthLinkResponseBody + + module OAuthProviderID = Privy::Models::OAuthProviderID + + class OAuthTokens = Privy::Models::OAuthTokens + + class OAuthTransferRequestBody = Privy::Models::OAuthTransferRequestBody + + class OAuthTransferUserInfo = Privy::Models::OAuthTransferUserInfo + + class OAuthTransferUserInfoMeta = Privy::Models::OAuthTransferUserInfoMeta + + class OAuthUnlinkRequestBody = Privy::Models::OAuthUnlinkRequestBody + + class OAuthVerifyRequestBody = Privy::Models::OAuthVerifyRequestBody + + class OAuthVerifyResponseBody = Privy::Models::OAuthVerifyResponseBody + + module OnrampProvider = Privy::Models::OnrampProvider + + class OptionalRefreshTokenInput = Privy::Models::OptionalRefreshTokenInput + + class OrganizationSecretIDInput = Privy::Models::OrganizationSecretIDInput + + class OrganizationSecretsListResponse = Privy::Models::OrganizationSecretsListResponse + + class OrganizationSecretView = Privy::Models::OrganizationSecretView + + class OutputWithPreviousTransactionData = Privy::Models::OutputWithPreviousTransactionData + + class OwnerIDInput = Privy::Models::OwnerIDInput + + module OwnerInput = Privy::Models::OwnerInput + + class OwnerInputPublicKey = Privy::Models::OwnerInputPublicKey + + class OwnerInputUser = Privy::Models::OwnerInputUser + + class P256PublicKey = Privy::Models::P256PublicKey + + class PasskeyAssertionResponse = Privy::Models::PasskeyAssertionResponse + + class PasskeyAttestationResponse = Privy::Models::PasskeyAttestationResponse + + class PasskeyAuthenticateInput = Privy::Models::PasskeyAuthenticateInput + + class PasskeyAuthenticatorEnrollmentOptions = Privy::Models::PasskeyAuthenticatorEnrollmentOptions + + class PasskeyAuthenticatorEnrollmentResponse = Privy::Models::PasskeyAuthenticatorEnrollmentResponse + + class PasskeyAuthenticatorSelection = Privy::Models::PasskeyAuthenticatorSelection + + class PasskeyAuthenticatorVerifyOptions = Privy::Models::PasskeyAuthenticatorVerifyOptions + + class PasskeyAuthenticatorVerifyResponse = Privy::Models::PasskeyAuthenticatorVerifyResponse + + class PasskeyClientExtensionResults = Privy::Models::PasskeyClientExtensionResults + + class PasskeyCredentialDescriptor = Privy::Models::PasskeyCredentialDescriptor + + class PasskeyCredPropsResult = Privy::Models::PasskeyCredPropsResult + + class PasskeyEnrollmentExtensions = Privy::Models::PasskeyEnrollmentExtensions + + class PasskeyInitInput = Privy::Models::PasskeyInitInput + + class PasskeyLinkInput = Privy::Models::PasskeyLinkInput + + class PasskeyMfaMethod = Privy::Models::PasskeyMfaMethod + + class PasskeyPubKeyCredParam = Privy::Models::PasskeyPubKeyCredParam + + class PasskeyRegisterInput = Privy::Models::PasskeyRegisterInput + + class PasskeyRelyingParty = Privy::Models::PasskeyRelyingParty + + class PasskeyUser = Privy::Models::PasskeyUser + + class PasskeyVerifyExtensions = Privy::Models::PasskeyVerifyExtensions + + class PasswordlessAuthenticateRequestBody = Privy::Models::PasswordlessAuthenticateRequestBody + + class PasswordlessInitRequestBody = Privy::Models::PasswordlessInitRequestBody + + class PasswordlessLinkRequestBody = Privy::Models::PasswordlessLinkRequestBody + + class PasswordlessSMSAuthenticateRequestBody = Privy::Models::PasswordlessSMSAuthenticateRequestBody + + class PasswordlessSMSInitRequestBody = Privy::Models::PasswordlessSMSInitRequestBody + + class PasswordlessSMSLinkRequestBody = Privy::Models::PasswordlessSMSLinkRequestBody + + class PasswordlessSMSTransferRequestBody = Privy::Models::PasswordlessSMSTransferRequestBody + + class PasswordlessSMSUnlinkRequestBody = Privy::Models::PasswordlessSMSUnlinkRequestBody + + class PasswordlessSMSUpdateRequestBody = Privy::Models::PasswordlessSMSUpdateRequestBody + + class PasswordlessTransferRequestBody = Privy::Models::PasswordlessTransferRequestBody + + class PasswordlessUnlinkRequestBody = Privy::Models::PasswordlessUnlinkRequestBody + + class PasswordlessUpdateRequestBody = Privy::Models::PasswordlessUpdateRequestBody + + class PatchUsersCustomMetadata = Privy::Models::PatchUsersCustomMetadata + + class PhoneInviteInput = Privy::Models::PhoneInviteInput + + class Policy = Privy::Models::Policy + + module PolicyAction = Privy::Models::PolicyAction + + class PolicyAuthorizationHeaders = Privy::Models::PolicyAuthorizationHeaders + + module PolicyCondition = Privy::Models::PolicyCondition + + class PolicyCreateParams = Privy::Models::PolicyCreateParams + + class PolicyCreateRuleParams = Privy::Models::PolicyCreateRuleParams + + class PolicyDeleteParams = Privy::Models::PolicyDeleteParams + + class PolicyDeleteRuleParams = Privy::Models::PolicyDeleteRuleParams + + class PolicyGetParams = Privy::Models::PolicyGetParams + + class PolicyGetRuleParams = Privy::Models::PolicyGetRuleParams + + PolicyInput: Privy::Internal::Type::Converter + + class PolicyIntentRequestDetails = Privy::Models::PolicyIntentRequestDetails + + class PolicyIntentResponse = Privy::Models::PolicyIntentResponse + + module PolicyMethod = Privy::Models::PolicyMethod + + class PolicyRequestBody = Privy::Models::PolicyRequestBody + + class PolicyRuleRequestBody = Privy::Models::PolicyRuleRequestBody + + class PolicyRuleRequestParams = Privy::Models::PolicyRuleRequestParams + + class PolicyRuleResponse = Privy::Models::PolicyRuleResponse + + class PolicyUpdateParams = Privy::Models::PolicyUpdateParams + + class PolicyUpdateRuleParams = Privy::Models::PolicyUpdateRuleParams + + class PrivateKeyExportInput = Privy::Models::PrivateKeyExportInput + + class PrivateKeyExportResponse = Privy::Models::PrivateKeyExportResponse + + class PrivateKeyExportWebhookPayload = Privy::Models::PrivateKeyExportWebhookPayload + + class PrivateKeyInitInput = Privy::Models::PrivateKeyInitInput + + class PrivateKeySubmitInput = Privy::Models::PrivateKeySubmitInput + + class PrivyOAuthProviderID = Privy::Models::PrivyOAuthProviderID + + module Quantity = Privy::Models::Quantity + + module RawSignBytesEncoding = Privy::Models::RawSignBytesEncoding + + module RawSignBytesHashFunction = Privy::Models::RawSignBytesHashFunction + + class RawSignBytesParams = Privy::Models::RawSignBytesParams + + class RawSignHashParams = Privy::Models::RawSignHashParams + + class RawSignInput = Privy::Models::RawSignInput + + module RawSignInputParams = Privy::Models::RawSignInputParams + + class RawSignResponse = Privy::Models::RawSignResponse + + class RawSignResponseData = Privy::Models::RawSignResponseData + + class RecipientPublicKey = Privy::Models::RecipientPublicKey + + class RecoveryConfigurationICloudInput = Privy::Models::RecoveryConfigurationICloudInput + + class RecoveryConfigurationICloudResponse = Privy::Models::RecoveryConfigurationICloudResponse + + class RecoveryKeyMaterialInput = Privy::Models::RecoveryKeyMaterialInput + + class RecoveryKeyMaterialResponse = Privy::Models::RecoveryKeyMaterialResponse + + module RecoveryType = Privy::Models::RecoveryType + + class ResponsePasskeyInitAuthenticate = Privy::Models::ResponsePasskeyInitAuthenticate + + class ResponsePasskeyInitLink = Privy::Models::ResponsePasskeyInitLink + + class ResponsePasskeyInitRegister = Privy::Models::ResponsePasskeyInitRegister + + class RpcIntentRequestDetails = Privy::Models::RpcIntentRequestDetails + + class RpcIntentResponse = Privy::Models::RpcIntentResponse + + class RuleIntentCreateRequestDetails = Privy::Models::RuleIntentCreateRequestDetails + + class RuleIntentDeleteRequestDetails = Privy::Models::RuleIntentDeleteRequestDetails + + module RuleIntentRequestDetails = Privy::Models::RuleIntentRequestDetails + + class RuleIntentResponse = Privy::Models::RuleIntentResponse + + class RuleIntentUpdateRequestDetails = Privy::Models::RuleIntentUpdateRequestDetails + + class SeedPhraseExportInput = Privy::Models::SeedPhraseExportInput + + class SeedPhraseExportResponse = Privy::Models::SeedPhraseExportResponse + + class SeedPhraseExportWebhookPayload = Privy::Models::SeedPhraseExportWebhookPayload + + module SigningAlgorithm = Privy::Models::SigningAlgorithm + + class SiweAddressInput = Privy::Models::SiweAddressInput + + class SiweAuthenticateRequestBody = Privy::Models::SiweAuthenticateRequestBody + + class SiweInitInput = Privy::Models::SiweInitInput + + class SiweInitRequestBody = Privy::Models::SiweInitRequestBody + + class SiweInitResponseBody = Privy::Models::SiweInitResponseBody + + class SiweInput = Privy::Models::SiweInput + + class SiweLinkRequestBody = Privy::Models::SiweLinkRequestBody + + class SiweLinkSmartWalletRequestBody = Privy::Models::SiweLinkSmartWalletRequestBody + + class SiweNonce = Privy::Models::SiweNonce + + class SiweUnlinkRequestBody = Privy::Models::SiweUnlinkRequestBody + + class SiwsAddressInput = Privy::Models::SiwsAddressInput + + class SiwsAuthenticateRequestBody = Privy::Models::SiwsAuthenticateRequestBody + + class SiwsInitInput = Privy::Models::SiwsInitInput + + class SiwsInitRequestBody = Privy::Models::SiwsInitRequestBody + + class SiwsInitResponseBody = Privy::Models::SiwsInitResponseBody + + class SiwsInput = Privy::Models::SiwsInput + + class SiwsLinkRequestBody = Privy::Models::SiwsLinkRequestBody + + class SiwsNonce = Privy::Models::SiwsNonce + + class SiwsUnlinkRequestBody = Privy::Models::SiwsUnlinkRequestBody + + module SmartWalletConfiguration = Privy::Models::SmartWalletConfiguration + + class SmartWalletConfigurationDisabled = Privy::Models::SmartWalletConfigurationDisabled + + class SmartWalletConfigurationEnabled = Privy::Models::SmartWalletConfigurationEnabled + + module SmartWalletConfigurationInput = Privy::Models::SmartWalletConfigurationInput + + class SmartWalletConfigurationInputEnabled = Privy::Models::SmartWalletConfigurationInputEnabled + + class SmartWalletNetworkConfiguration = Privy::Models::SmartWalletNetworkConfiguration + + class SmartWalletNetworkConfigurationInput = Privy::Models::SmartWalletNetworkConfigurationInput + + class SmartWalletSiweInput = Privy::Models::SmartWalletSiweInput + + module SmartWalletType = Privy::Models::SmartWalletType + + class SMSMfaMethod = Privy::Models::SMSMfaMethod + + class SolanaProgramInstructionCondition = Privy::Models::SolanaProgramInstructionCondition + + module SolanaRpcInput = Privy::Models::SolanaRpcInput + + module SolanaRpcResponse = Privy::Models::SolanaRpcResponse + + class SolanaSignAndSendTransactionRpcInput = Privy::Models::SolanaSignAndSendTransactionRpcInput + + class SolanaSignAndSendTransactionRpcInputParams = Privy::Models::SolanaSignAndSendTransactionRpcInputParams + + class SolanaSignAndSendTransactionRpcResponse = Privy::Models::SolanaSignAndSendTransactionRpcResponse + + class SolanaSignAndSendTransactionRpcResponseData = Privy::Models::SolanaSignAndSendTransactionRpcResponseData + + class SolanaSignMessageRpcInput = Privy::Models::SolanaSignMessageRpcInput + + class SolanaSignMessageRpcInputParams = Privy::Models::SolanaSignMessageRpcInputParams + + class SolanaSignMessageRpcResponse = Privy::Models::SolanaSignMessageRpcResponse + + class SolanaSignMessageRpcResponseData = Privy::Models::SolanaSignMessageRpcResponseData + + class SolanaSignTransactionRpcInput = Privy::Models::SolanaSignTransactionRpcInput + + class SolanaSignTransactionRpcInputParams = Privy::Models::SolanaSignTransactionRpcInputParams + + class SolanaSignTransactionRpcResponse = Privy::Models::SolanaSignTransactionRpcResponse + + class SolanaSignTransactionRpcResponseData = Privy::Models::SolanaSignTransactionRpcResponseData + + class SolanaSystemProgramInstructionCondition = Privy::Models::SolanaSystemProgramInstructionCondition + + class SolanaTokenProgramInstructionCondition = Privy::Models::SolanaTokenProgramInstructionCondition + + module SolanaWalletDerivationStrategy = Privy::Models::SolanaWalletDerivationStrategy + + class SparkBalance = Privy::Models::SparkBalance + + class SparkClaimStaticDepositRpcInput = Privy::Models::SparkClaimStaticDepositRpcInput + + class SparkClaimStaticDepositRpcInputParams = Privy::Models::SparkClaimStaticDepositRpcInputParams + + class SparkClaimStaticDepositRpcResponse = Privy::Models::SparkClaimStaticDepositRpcResponse + + class SparkClaimStaticDepositRpcResponseData = Privy::Models::SparkClaimStaticDepositRpcResponseData + + class SparkCreateLightningInvoiceRpcInput = Privy::Models::SparkCreateLightningInvoiceRpcInput + + class SparkCreateLightningInvoiceRpcInputParams = Privy::Models::SparkCreateLightningInvoiceRpcInputParams + + class SparkCreateLightningInvoiceRpcResponse = Privy::Models::SparkCreateLightningInvoiceRpcResponse + + class SparkGetBalanceRpcInput = Privy::Models::SparkGetBalanceRpcInput + + class SparkGetBalanceRpcResponse = Privy::Models::SparkGetBalanceRpcResponse + + class SparkGetClaimStaticDepositQuoteRpcInput = Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput + + class SparkGetClaimStaticDepositQuoteRpcInputParams = Privy::Models::SparkGetClaimStaticDepositQuoteRpcInputParams + + class SparkGetClaimStaticDepositQuoteRpcResponse = Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse + + class SparkGetClaimStaticDepositQuoteRpcResponseData = Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponseData + + class SparkGetStaticDepositAddressRpcInput = Privy::Models::SparkGetStaticDepositAddressRpcInput + + class SparkGetStaticDepositAddressRpcResponse = Privy::Models::SparkGetStaticDepositAddressRpcResponse + + class SparkGetStaticDepositAddressRpcResponseData = Privy::Models::SparkGetStaticDepositAddressRpcResponseData + + class SparkLightningFee = Privy::Models::SparkLightningFee + + class SparkLightningReceiveRequest = Privy::Models::SparkLightningReceiveRequest + + class SparkLightningSendRequest = Privy::Models::SparkLightningSendRequest + + module SparkNetwork = Privy::Models::SparkNetwork + + module SparkOutputSelectionStrategy = Privy::Models::SparkOutputSelectionStrategy + + class SparkPayLightningInvoiceRpcInput = Privy::Models::SparkPayLightningInvoiceRpcInput + + class SparkPayLightningInvoiceRpcInputParams = Privy::Models::SparkPayLightningInvoiceRpcInputParams + + class SparkPayLightningInvoiceRpcResponse = Privy::Models::SparkPayLightningInvoiceRpcResponse + + module SparkRpcInput = Privy::Models::SparkRpcInput + + module SparkRpcResponse = Privy::Models::SparkRpcResponse + + class SparkSigningKeyshare = Privy::Models::SparkSigningKeyshare + + class SparkSignMessageWithIdentityKeyRpcInput = Privy::Models::SparkSignMessageWithIdentityKeyRpcInput + + class SparkSignMessageWithIdentityKeyRpcInputParams = Privy::Models::SparkSignMessageWithIdentityKeyRpcInputParams + + class SparkSignMessageWithIdentityKeyRpcResponse = Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse + + class SparkSignMessageWithIdentityKeyRpcResponseData = Privy::Models::SparkSignMessageWithIdentityKeyRpcResponseData + + class SparkTokenBalance = Privy::Models::SparkTokenBalance + + class SparkTransfer = Privy::Models::SparkTransfer + + class SparkTransferLeaf = Privy::Models::SparkTransferLeaf + + class SparkTransferRpcInput = Privy::Models::SparkTransferRpcInput + + class SparkTransferRpcInputParams = Privy::Models::SparkTransferRpcInputParams + + class SparkTransferRpcResponse = Privy::Models::SparkTransferRpcResponse + + class SparkTransferTokensRpcInput = Privy::Models::SparkTransferTokensRpcInput + + class SparkTransferTokensRpcInputParams = Privy::Models::SparkTransferTokensRpcInputParams + + class SparkTransferTokensRpcResponse = Privy::Models::SparkTransferTokensRpcResponse + + class SparkTransferTokensRpcResponseData = Privy::Models::SparkTransferTokensRpcResponseData + + class SparkUserTokenMetadata = Privy::Models::SparkUserTokenMetadata + + class SparkWalletLeaf = Privy::Models::SparkWalletLeaf + + class SuccessResponse = Privy::Models::SuccessResponse + + module SuiCommandName = Privy::Models::SuiCommandName + + class SuiTransactionCommandCondition = Privy::Models::SuiTransactionCommandCondition + + module SuiTransactionCommandOperator = Privy::Models::SuiTransactionCommandOperator + + class SuiTransferObjectsCommandCondition = Privy::Models::SuiTransferObjectsCommandCondition + + module SuiTransferObjectsCommandField = Privy::Models::SuiTransferObjectsCommandField + + class SvmTransactionWalletActionStep = Privy::Models::SvmTransactionWalletActionStep + + module SvmWalletActionStepStatus = Privy::Models::SvmWalletActionStepStatus + + class SwapActionResponse = Privy::Models::SwapActionResponse + + class SwapDestination = Privy::Models::SwapDestination + + class SwapQuoteDestination = Privy::Models::SwapQuoteDestination + + class SwapQuoteRequestBody = Privy::Models::SwapQuoteRequestBody + + class SwapQuoteResponse = Privy::Models::SwapQuoteResponse + + class SwapRequestBody = Privy::Models::SwapRequestBody + + class SwapSource = Privy::Models::SwapSource + + class SystemCondition = Privy::Models::SystemCondition + + class TelegramAuthConfigSchema = Privy::Models::TelegramAuthConfigSchema + + class TelegramAuthenticateInput = Privy::Models::TelegramAuthenticateInput + + class TelegramAuthenticateRequestBody = Privy::Models::TelegramAuthenticateRequestBody + + class TelegramAuthResult = Privy::Models::TelegramAuthResult + + class TelegramLinkRequestBody = Privy::Models::TelegramLinkRequestBody + + class TelegramUnlinkInput = Privy::Models::TelegramUnlinkInput + + class TelegramUnlinkRequestBody = Privy::Models::TelegramUnlinkRequestBody + + class TelegramWebAppData = Privy::Models::TelegramWebAppData + + class TempoAaAuthorization = Privy::Models::TempoAaAuthorization + + class TempoCall = Privy::Models::TempoCall + + class TempoFeePayerSignature = Privy::Models::TempoFeePayerSignature + + class TestAccount = Privy::Models::TestAccount + + class TestAccountsResponse = Privy::Models::TestAccountsResponse + + class TokenOutput = Privy::Models::TokenOutput + + class TokenTransferDestination = Privy::Models::TokenTransferDestination + + module TokenTransferSource = Privy::Models::TokenTransferSource + + class TotpMfaMethod = Privy::Models::TotpMfaMethod + + class Transaction = Privy::Models::Transaction + + class TransactionBroadcastedWebhookPayload = Privy::Models::TransactionBroadcastedWebhookPayload + + class TransactionConfirmedWebhookPayload = Privy::Models::TransactionConfirmedWebhookPayload + + module TransactionDetail = Privy::Models::TransactionDetail + + class TransactionExecutionRevertedWebhookPayload = Privy::Models::TransactionExecutionRevertedWebhookPayload + + class TransactionFailedWebhookPayload = Privy::Models::TransactionFailedWebhookPayload + + class TransactionGetParams = Privy::Models::TransactionGetParams + + class TransactionList = Privy::Models::TransactionList + + class TransactionProviderErrorWebhookPayload = Privy::Models::TransactionProviderErrorWebhookPayload + + class TransactionReplacedWebhookPayload = Privy::Models::TransactionReplacedWebhookPayload + + class TransactionScanningAssetDiff = Privy::Models::TransactionScanningAssetDiff + + class TransactionScanningAssetInfo = Privy::Models::TransactionScanningAssetInfo + + class TransactionScanningAssetValue = Privy::Models::TransactionScanningAssetValue + + class TransactionScanningCalldata = Privy::Models::TransactionScanningCalldata + + class TransactionScanningExposure = Privy::Models::TransactionScanningExposure + + class TransactionScanningMetadata = Privy::Models::TransactionScanningMetadata + + class TransactionScanningParams = Privy::Models::TransactionScanningParams + + class TransactionScanningRequestBody = Privy::Models::TransactionScanningRequestBody + + class TransactionScanningResponseBody = Privy::Models::TransactionScanningResponseBody + + class TransactionScanningRpcRequest = Privy::Models::TransactionScanningRpcRequest + + class TransactionScanningSimulationErrorResult = Privy::Models::TransactionScanningSimulationErrorResult + + module TransactionScanningSimulationResult = Privy::Models::TransactionScanningSimulationResult + + class TransactionScanningSimulationSuccessResult = Privy::Models::TransactionScanningSimulationSuccessResult + + class TransactionScanningValidationErrorResult = Privy::Models::TransactionScanningValidationErrorResult + + module TransactionScanningValidationResult = Privy::Models::TransactionScanningValidationResult + + class TransactionScanningValidationSuccessResult = Privy::Models::TransactionScanningValidationSuccessResult + + class TransactionStillPendingWebhookPayload = Privy::Models::TransactionStillPendingWebhookPayload + + class TransactionTokenAddressInput = Privy::Models::TransactionTokenAddressInput + + class TransferActionResponse = Privy::Models::TransferActionResponse + + class TransferFarcasterInput = Privy::Models::TransferFarcasterInput + + class TransferIntentRequestDetails = Privy::Models::TransferIntentRequestDetails + + class TransferIntentResponse = Privy::Models::TransferIntentResponse + + class TransferReceivedTransactionDetail = Privy::Models::TransferReceivedTransactionDetail + + class TransferRequestBody = Privy::Models::TransferRequestBody + + class TransferSentTransactionDetail = Privy::Models::TransferSentTransactionDetail + + class TransferSiweInput = Privy::Models::TransferSiweInput + + class TransferSiwsInput = Privy::Models::TransferSiwsInput + + class TransferTelegramInput = Privy::Models::TransferTelegramInput + + class TronCalldataCondition = Privy::Models::TronCalldataCondition + + class TronTransactionCondition = Privy::Models::TronTransactionCondition + + TypedDataDomainInputParams: Privy::Internal::Type::Converter + + class TypedDataTypeFieldInput = Privy::Models::TypedDataTypeFieldInput + + TypedDataTypesInputParams: Privy::Internal::Type::Converter + + class UnlinkPasskeyInput = Privy::Models::UnlinkPasskeyInput + + module UnsafeUnwrapWebhookEvent = Privy::Models::UnsafeUnwrapWebhookEvent + + module UnsignedEthereumTransaction = Privy::Models::UnsignedEthereumTransaction + + class UnsignedStandardEthereumTransaction = Privy::Models::UnsignedStandardEthereumTransaction + + class UnsignedTempoTransaction = Privy::Models::UnsignedTempoTransaction + + class UpdateAccountFromWalletIDsInput = Privy::Models::UpdateAccountFromWalletIDsInput + + class UpdateAccountFromWalletsConfigurationInput = Privy::Models::UpdateAccountFromWalletsConfigurationInput + + module UpdateAccountInput = Privy::Models::UpdateAccountInput + + class UpdateConditionSetRequestBody = Privy::Models::UpdateConditionSetRequestBody + + class UpdateOrganizationSecretSigningKeyInput = Privy::Models::UpdateOrganizationSecretSigningKeyInput + + class User = Privy::Models::User + + class UserAuthenticatedWebhookPayload = Privy::Models::UserAuthenticatedWebhookPayload + + class UserBatchCreateInput = Privy::Models::UserBatchCreateInput + + class UserCreatedWebhookPayload = Privy::Models::UserCreatedWebhookPayload + + class UserCreateParams = Privy::Models::UserCreateParams + + class UserDeleteParams = Privy::Models::UserDeleteParams + + class UserGetByCustomAuthIDParams = Privy::Models::UserGetByCustomAuthIDParams + + class UserGetByDiscordUsernameParams = Privy::Models::UserGetByDiscordUsernameParams + + class UserGetByEmailAddressParams = Privy::Models::UserGetByEmailAddressParams + + class UserGetByFarcasterIDParams = Privy::Models::UserGetByFarcasterIDParams + + class UserGetByGitHubUsernameParams = Privy::Models::UserGetByGitHubUsernameParams + + class UserGetByPhoneNumberParams = Privy::Models::UserGetByPhoneNumberParams + + class UserGetBySmartWalletAddressParams = Privy::Models::UserGetBySmartWalletAddressParams + + class UserGetByTelegramUserIDParams = Privy::Models::UserGetByTelegramUserIDParams + + class UserGetByTelegramUsernameParams = Privy::Models::UserGetByTelegramUsernameParams + + class UserGetByTwitterSubjectParams = Privy::Models::UserGetByTwitterSubjectParams + + class UserGetByTwitterUsernameParams = Privy::Models::UserGetByTwitterUsernameParams + + class UserGetByWalletAddressParams = Privy::Models::UserGetByWalletAddressParams + + class UserGetParams = Privy::Models::UserGetParams + + module UserInviteInput = Privy::Models::UserInviteInput + + class UserLinkedAccountWebhookPayload = Privy::Models::UserLinkedAccountWebhookPayload + + class UserListParams = Privy::Models::UserListParams + + class UserOperationCompletedWebhookPayload = Privy::Models::UserOperationCompletedWebhookPayload + + class UserOperationInput = Privy::Models::UserOperationInput + + module UserOwnedRecoveryOption = Privy::Models::UserOwnedRecoveryOption + + class UserPregenerateWalletsParams = Privy::Models::UserPregenerateWalletsParams + + class UserSearchParams = Privy::Models::UserSearchParams + + class UserSetCustomMetadataParams = Privy::Models::UserSetCustomMetadataParams + + class UserTransferredAccountWebhookPayload = Privy::Models::UserTransferredAccountWebhookPayload + + class UserUnlinkedAccountWebhookPayload = Privy::Models::UserUnlinkedAccountWebhookPayload + + class UserUnlinkLinkedAccountParams = Privy::Models::UserUnlinkLinkedAccountParams + + class UserUpdatedAccountWebhookPayload = Privy::Models::UserUpdatedAccountWebhookPayload + + class UserWalletCreatedWebhookPayload = Privy::Models::UserWalletCreatedWebhookPayload + + class UserWithIdentityToken = Privy::Models::UserWithIdentityToken + + class Wallet = Privy::Models::Wallet + + class WalletActionEarnDepositCreatedWebhookPayload = Privy::Models::WalletActionEarnDepositCreatedWebhookPayload + + class WalletActionEarnDepositFailedWebhookPayload = Privy::Models::WalletActionEarnDepositFailedWebhookPayload + + class WalletActionEarnDepositRejectedWebhookPayload = Privy::Models::WalletActionEarnDepositRejectedWebhookPayload + + class WalletActionEarnDepositSucceededWebhookPayload = Privy::Models::WalletActionEarnDepositSucceededWebhookPayload + + class WalletActionEarnIncentiveClaimCreatedWebhookPayload = Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload + + class WalletActionEarnIncentiveClaimFailedWebhookPayload = Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload + + class WalletActionEarnIncentiveClaimRejectedWebhookPayload = Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload + + class WalletActionEarnIncentiveClaimSucceededWebhookPayload = Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload + + class WalletActionEarnWithdrawCreatedWebhookPayload = Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload + + class WalletActionEarnWithdrawFailedWebhookPayload = Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload + + class WalletActionEarnWithdrawRejectedWebhookPayload = Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload + + class WalletActionEarnWithdrawSucceededWebhookPayload = Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload + + module WalletActionResponse = Privy::Models::WalletActionResponse + + module WalletActionStatus = Privy::Models::WalletActionStatus + + module WalletActionStep = Privy::Models::WalletActionStep + + module WalletActionStepType = Privy::Models::WalletActionStepType + + class WalletActionSwapCreatedWebhookPayload = Privy::Models::WalletActionSwapCreatedWebhookPayload + + class WalletActionSwapFailedWebhookPayload = Privy::Models::WalletActionSwapFailedWebhookPayload + + class WalletActionSwapRejectedWebhookPayload = Privy::Models::WalletActionSwapRejectedWebhookPayload + + class WalletActionSwapSucceededWebhookPayload = Privy::Models::WalletActionSwapSucceededWebhookPayload + + class WalletActionTransferCreatedWebhookPayload = Privy::Models::WalletActionTransferCreatedWebhookPayload + + class WalletActionTransferFailedWebhookPayload = Privy::Models::WalletActionTransferFailedWebhookPayload + + class WalletActionTransferRejectedWebhookPayload = Privy::Models::WalletActionTransferRejectedWebhookPayload + + class WalletActionTransferSucceededWebhookPayload = Privy::Models::WalletActionTransferSucceededWebhookPayload + + module WalletActionType = Privy::Models::WalletActionType + + WalletAdditionalSigner: Privy::Internal::Type::Converter + + class WalletAdditionalSignerItem = Privy::Models::WalletAdditionalSignerItem + + class WalletAPIRegisterAuthorizationKeyInput = Privy::Models::WalletAPIRegisterAuthorizationKeyInput + + class WalletAPIRevokeAuthorizationKeyInput = Privy::Models::WalletAPIRevokeAuthorizationKeyInput + + module WalletAsset = Privy::Models::WalletAsset + + class WalletAuthenticateRequestBody = Privy::Models::WalletAuthenticateRequestBody + + class WalletAuthenticateWithJwtParams = Privy::Models::WalletAuthenticateWithJwtParams + + module WalletAuthenticateWithJwtResponse = Privy::Models::WalletAuthenticateWithJwtResponse + + class WalletAuthorizationHeaders = Privy::Models::WalletAuthorizationHeaders + + class WalletBatchCreateInput = Privy::Models::WalletBatchCreateInput + + class WalletBatchCreateResponse = Privy::Models::WalletBatchCreateResponse + + module WalletBatchCreateResult = Privy::Models::WalletBatchCreateResult + + class WalletBatchItemInput = Privy::Models::WalletBatchItemInput + + module WalletChainType = Privy::Models::WalletChainType + + class WalletCreateParams = Privy::Models::WalletCreateParams + + class WalletCreateWalletsWithRecoveryParams = Privy::Models::WalletCreateWalletsWithRecoveryParams + + class WalletCreateWalletsWithRecoveryResponse = Privy::Models::WalletCreateWalletsWithRecoveryResponse + + class WalletCreationAdditionalSignerItem = Privy::Models::WalletCreationAdditionalSignerItem + + class WalletCreationInput = Privy::Models::WalletCreationInput + + class WalletCustodian = Privy::Models::WalletCustodian + + module WalletEntropyType = Privy::Models::WalletEntropyType + + module WalletEthereumAsset = Privy::Models::WalletEthereumAsset + + class WalletExportParams = Privy::Models::WalletExportParams + + class WalletExportRequestBody = Privy::Models::WalletExportRequestBody + + class WalletExportResponseBody = Privy::Models::WalletExportResponseBody + + module WalletFundsAsset = Privy::Models::WalletFundsAsset + + class WalletFundsErc20Asset = Privy::Models::WalletFundsErc20Asset + + class WalletFundsNativeTokenAsset = Privy::Models::WalletFundsNativeTokenAsset + + class WalletFundsSacAsset = Privy::Models::WalletFundsSacAsset + + class WalletFundsSplAsset = Privy::Models::WalletFundsSplAsset + + class WalletGetParams = Privy::Models::WalletGetParams + + class WalletGetWalletByAddressParams = Privy::Models::WalletGetWalletByAddressParams + + class WalletImportInitResponse = Privy::Models::WalletImportInitResponse + + module WalletImportSupportedChains = Privy::Models::WalletImportSupportedChains + + module WalletImportSupportedEntropyTypes = Privy::Models::WalletImportSupportedEntropyTypes + + class WalletInitImportParams = Privy::Models::WalletInitImportParams + + class WalletIntentResponse = Privy::Models::WalletIntentResponse + + class WalletInviteInput = Privy::Models::WalletInviteInput + + class WalletListParams = Privy::Models::WalletListParams + + class WalletRawSignParams = Privy::Models::WalletRawSignParams + + class WalletRecoveredWebhookPayload = Privy::Models::WalletRecoveredWebhookPayload + + class WalletRecoverySetupWebhookPayload = Privy::Models::WalletRecoverySetupWebhookPayload + + class WalletRevokeResponse = Privy::Models::WalletRevokeResponse + + class WalletRpcParams = Privy::Models::WalletRpcParams + + module WalletRpcRequestBody = Privy::Models::WalletRpcRequestBody + + module WalletRpcResponse = Privy::Models::WalletRpcResponse + + module Wallets = Privy::Models::Wallets + + module WalletSolanaAsset = Privy::Models::WalletSolanaAsset + + class WalletSubmitImportParams = Privy::Models::WalletSubmitImportParams + + class WalletTransferParams = Privy::Models::WalletTransferParams + + class WalletUpdateParams = Privy::Models::WalletUpdateParams + + class WalletUpdateRequestBody = Privy::Models::WalletUpdateRequestBody + + module WebhookPayload = Privy::Models::WebhookPayload + + class WebhookUnsafeUnwrapParams = Privy::Models::WebhookUnsafeUnwrapParams + + class YieldAuthorizationHeaders = Privy::Models::YieldAuthorizationHeaders + + class YieldClaimConfirmedWebhookPayload = Privy::Models::YieldClaimConfirmedWebhookPayload + + class YieldDepositConfirmedWebhookPayload = Privy::Models::YieldDepositConfirmedWebhookPayload + + class YieldWithdrawConfirmedWebhookPayload = Privy::Models::YieldWithdrawConfirmedWebhookPayload +end diff --git a/sig/privy/models/abi_parameter.rbs b/sig/privy/models/abi_parameter.rbs new file mode 100644 index 0000000..2d5ebb1 --- /dev/null +++ b/sig/privy/models/abi_parameter.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type abi_parameter = + { + type: String, + components: ::Array[::Hash[Symbol, top]], + indexed: bool, + internal_type: String, + name: String + } + + class AbiParameter < Privy::Internal::Type::BaseModel + attr_accessor type: String + + attr_reader components: ::Array[::Hash[Symbol, top]]? + + def components=: ( + ::Array[::Hash[Symbol, top]] + ) -> ::Array[::Hash[Symbol, top]] + + attr_reader indexed: bool? + + def indexed=: (bool) -> bool + + attr_reader internal_type: String? + + def internal_type=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + type: String, + ?components: ::Array[::Hash[Symbol, top]], + ?indexed: bool, + ?internal_type: String, + ?name: String + ) -> void + + def to_hash: -> { + type: String, + components: ::Array[::Hash[Symbol, top]], + indexed: bool, + internal_type: String, + name: String + } + end + end +end diff --git a/sig/privy/models/abi_schema.rbs b/sig/privy/models/abi_schema.rbs new file mode 100644 index 0000000..5cb7741 --- /dev/null +++ b/sig/privy/models/abi_schema.rbs @@ -0,0 +1,92 @@ +module Privy + module Models + type abi_schema_item = + { + type: Privy::Models::AbiSchemaItem::type_, + anonymous: bool, + inputs: ::Array[Privy::AbiParameter], + name: String, + outputs: ::Array[Privy::AbiParameter], + state_mutability: Privy::Models::AbiSchemaItem::state_mutability + } + + class AbiSchemaItem < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::AbiSchemaItem::type_ + + attr_reader anonymous: bool? + + def anonymous=: (bool) -> bool + + attr_reader inputs: ::Array[Privy::AbiParameter]? + + def inputs=: ( + ::Array[Privy::AbiParameter] + ) -> ::Array[Privy::AbiParameter] + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader outputs: ::Array[Privy::AbiParameter]? + + def outputs=: ( + ::Array[Privy::AbiParameter] + ) -> ::Array[Privy::AbiParameter] + + attr_reader state_mutability: Privy::Models::AbiSchemaItem::state_mutability? + + def state_mutability=: ( + Privy::Models::AbiSchemaItem::state_mutability + ) -> Privy::Models::AbiSchemaItem::state_mutability + + def initialize: ( + type: Privy::Models::AbiSchemaItem::type_, + ?anonymous: bool, + ?inputs: ::Array[Privy::AbiParameter], + ?name: String, + ?outputs: ::Array[Privy::AbiParameter], + ?state_mutability: Privy::Models::AbiSchemaItem::state_mutability + ) -> void + + def to_hash: -> { + type: Privy::Models::AbiSchemaItem::type_, + anonymous: bool, + inputs: ::Array[Privy::AbiParameter], + name: String, + outputs: ::Array[Privy::AbiParameter], + state_mutability: Privy::Models::AbiSchemaItem::state_mutability + } + + type type_ = :function | :constructor | :event | :fallback | :receive + + module Type + extend Privy::Internal::Type::Enum + + TYPE_FUNCTION: :function + TYPE_CONSTRUCTOR: :constructor + TYPE_EVENT: :event + TYPE_FALLBACK: :fallback + TYPE_RECEIVE: :receive + + def self?.values: -> ::Array[Privy::Models::AbiSchemaItem::type_] + end + + type state_mutability = :pure | :view | :nonpayable | :payable + + module StateMutability + extend Privy::Internal::Type::Enum + + PURE: :pure + VIEW: :view + NONPAYABLE: :nonpayable + PAYABLE: :payable + + def self?.values: -> ::Array[Privy::Models::AbiSchemaItem::state_mutability] + end + end + + type abi_schema = ::Array[Privy::AbiSchemaItem] + + AbiSchema: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/account_balance_params.rbs b/sig/privy/models/account_balance_params.rbs new file mode 100644 index 0000000..2e84502 --- /dev/null +++ b/sig/privy/models/account_balance_params.rbs @@ -0,0 +1,33 @@ +module Privy + module Models + type account_balance_params = + { testnet_mode: Privy::Models::AccountBalanceParams::testnet_mode } + + class AccountBalanceParams < Privy::Internal::Type::BaseModel + attr_reader testnet_mode: Privy::Models::AccountBalanceParams::testnet_mode? + + def testnet_mode=: ( + Privy::Models::AccountBalanceParams::testnet_mode + ) -> Privy::Models::AccountBalanceParams::testnet_mode + + def initialize: ( + ?testnet_mode: Privy::Models::AccountBalanceParams::testnet_mode + ) -> void + + def to_hash: -> { + testnet_mode: Privy::Models::AccountBalanceParams::testnet_mode + } + + type testnet_mode = :true | :false + + module TestnetMode + extend Privy::Internal::Type::Enum + + TRUE: :true + FALSE: :false + + def self?.values: -> ::Array[Privy::Models::AccountBalanceParams::testnet_mode] + end + end + end +end diff --git a/sig/privy/models/account_balance_response.rbs b/sig/privy/models/account_balance_response.rbs new file mode 100644 index 0000000..58ec19a --- /dev/null +++ b/sig/privy/models/account_balance_response.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type account_balance_response = + { + assets: ::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + assets_by_chain: ::Array[Privy::BalanceAssetByChain] + } + + class AccountBalanceResponse < Privy::Internal::Type::BaseModel + attr_accessor assets: ::Array[Privy::BalanceAsset] + + attr_accessor total: Privy::CurrencyAmount + + attr_reader assets_by_chain: ::Array[Privy::BalanceAssetByChain]? + + def assets_by_chain=: ( + ::Array[Privy::BalanceAssetByChain] + ) -> ::Array[Privy::BalanceAssetByChain] + + def initialize: ( + assets: ::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + ?assets_by_chain: ::Array[Privy::BalanceAssetByChain] + ) -> void + + def to_hash: -> { + assets: ::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + assets_by_chain: ::Array[Privy::BalanceAssetByChain] + } + end + end +end diff --git a/sig/privy/models/account_display_name.rbs b/sig/privy/models/account_display_name.rbs new file mode 100644 index 0000000..4ff55d8 --- /dev/null +++ b/sig/privy/models/account_display_name.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class AccountDisplayName = String + end +end diff --git a/sig/privy/models/account_response.rbs b/sig/privy/models/account_response.rbs new file mode 100644 index 0000000..506ea1b --- /dev/null +++ b/sig/privy/models/account_response.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type account_response = + { + id: String, + display_name: String?, + wallets: ::Array[Privy::AccountWallet] + } + + class AccountResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor display_name: String? + + attr_accessor wallets: ::Array[Privy::AccountWallet] + + def initialize: ( + id: String, + display_name: String?, + wallets: ::Array[Privy::AccountWallet] + ) -> void + + def to_hash: -> { + id: String, + display_name: String?, + wallets: ::Array[Privy::AccountWallet] + } + end + end +end diff --git a/sig/privy/models/account_wallet.rbs b/sig/privy/models/account_wallet.rbs new file mode 100644 index 0000000..8ba027f --- /dev/null +++ b/sig/privy/models/account_wallet.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type account_wallet = + { + id: String, + address: String, + chain_type: Privy::Models::first_class_chain_type, + custody: Privy::WalletCustodian + } + + class AccountWallet < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::first_class_chain_type + + attr_reader custody: Privy::WalletCustodian? + + def custody=: (Privy::WalletCustodian) -> Privy::WalletCustodian + + def initialize: ( + id: String, + address: String, + chain_type: Privy::Models::first_class_chain_type, + ?custody: Privy::WalletCustodian + ) -> void + + def to_hash: -> { + id: String, + address: String, + chain_type: Privy::Models::first_class_chain_type, + custody: Privy::WalletCustodian + } + end + end +end diff --git a/sig/privy/models/account_wallet_configuration_item.rbs b/sig/privy/models/account_wallet_configuration_item.rbs new file mode 100644 index 0000000..7e3f93d --- /dev/null +++ b/sig/privy/models/account_wallet_configuration_item.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type account_wallet_configuration_item = + { + chain_type: Privy::Models::first_class_chain_type, + custody: Privy::WalletCustodian + } + + class AccountWalletConfigurationItem < Privy::Internal::Type::BaseModel + attr_accessor chain_type: Privy::Models::first_class_chain_type + + attr_reader custody: Privy::WalletCustodian? + + def custody=: (Privy::WalletCustodian) -> Privy::WalletCustodian + + def initialize: ( + chain_type: Privy::Models::first_class_chain_type, + ?custody: Privy::WalletCustodian + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::first_class_chain_type, + custody: Privy::WalletCustodian + } + end + end +end diff --git a/sig/privy/models/account_wallet_ids.rbs b/sig/privy/models/account_wallet_ids.rbs new file mode 100644 index 0000000..2050a79 --- /dev/null +++ b/sig/privy/models/account_wallet_ids.rbs @@ -0,0 +1,7 @@ +module Privy + module Models + type account_wallet_ids = ::Array[String] + + AccountWalletIDs: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/account_wallets_configuration.rbs b/sig/privy/models/account_wallets_configuration.rbs new file mode 100644 index 0000000..c9080ae --- /dev/null +++ b/sig/privy/models/account_wallets_configuration.rbs @@ -0,0 +1,8 @@ +module Privy + module Models + type account_wallets_configuration = + ::Array[Privy::AccountWalletConfigurationItem] + + AccountWalletsConfiguration: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/accounts_dashboard_list_response.rbs b/sig/privy/models/accounts_dashboard_list_response.rbs new file mode 100644 index 0000000..34605d7 --- /dev/null +++ b/sig/privy/models/accounts_dashboard_list_response.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type accounts_dashboard_list_response = + { data: ::Array[Privy::AssetAccountWithBalance], next_cursor: String? } + + class AccountsDashboardListResponse < Privy::Internal::Type::BaseModel + attr_accessor data: ::Array[Privy::AssetAccountWithBalance] + + attr_accessor next_cursor: String? + + def initialize: ( + data: ::Array[Privy::AssetAccountWithBalance], + next_cursor: String? + ) -> void + + def to_hash: -> { + data: ::Array[Privy::AssetAccountWithBalance], + next_cursor: String? + } + end + end +end diff --git a/sig/privy/models/accounts_list_response.rbs b/sig/privy/models/accounts_list_response.rbs new file mode 100644 index 0000000..7da0d42 --- /dev/null +++ b/sig/privy/models/accounts_list_response.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type accounts_list_response = + { data: ::Array[Privy::AccountResponse], next_cursor: String? } + + class AccountsListResponse < Privy::Internal::Type::BaseModel + attr_accessor data: ::Array[Privy::AccountResponse] + + attr_accessor next_cursor: String? + + def initialize: ( + data: ::Array[Privy::AccountResponse], + next_cursor: String? + ) -> void + + def to_hash: -> { + data: ::Array[Privy::AccountResponse], + next_cursor: String? + } + end + end +end diff --git a/sig/privy/models/action_request_body_condition.rbs b/sig/privy/models/action_request_body_condition.rbs new file mode 100644 index 0000000..d04b6c1 --- /dev/null +++ b/sig/privy/models/action_request_body_condition.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type action_request_body_condition = + { + field: String, + field_source: Privy::Models::ActionRequestBodyCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class ActionRequestBodyCondition < Privy::Internal::Type::BaseModel + attr_accessor field: String + + attr_accessor field_source: Privy::Models::ActionRequestBodyCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: String, + field_source: Privy::Models::ActionRequestBodyCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: String, + field_source: Privy::Models::ActionRequestBodyCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field_source = :action_request_body + + module FieldSource + extend Privy::Internal::Type::Enum + + ACTION_REQUEST_BODY: :action_request_body + + def self?.values: -> ::Array[Privy::Models::ActionRequestBodyCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/additional_signer_input.rbs b/sig/privy/models/additional_signer_input.rbs new file mode 100644 index 0000000..b2c7f4e --- /dev/null +++ b/sig/privy/models/additional_signer_input.rbs @@ -0,0 +1,7 @@ +module Privy + module Models + type additional_signer_input = ::Array[Privy::AdditionalSignerItemInput] + + AdditionalSignerInput: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/additional_signer_item_input.rbs b/sig/privy/models/additional_signer_item_input.rbs new file mode 100644 index 0000000..a492172 --- /dev/null +++ b/sig/privy/models/additional_signer_item_input.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type additional_signer_item_input = + { signer_id: String, override_policy_ids: Privy::Models::policy_input } + + class AdditionalSignerItemInput < Privy::Internal::Type::BaseModel + attr_accessor signer_id: String + + attr_reader override_policy_ids: Privy::Models::policy_input? + + def override_policy_ids=: ( + Privy::Models::policy_input + ) -> Privy::Models::policy_input + + def initialize: ( + signer_id: String, + ?override_policy_ids: Privy::Models::policy_input + ) -> void + + def to_hash: -> { + signer_id: String, + override_policy_ids: Privy::Models::policy_input + } + end + end +end diff --git a/sig/privy/models/address.rbs b/sig/privy/models/address.rbs new file mode 100644 index 0000000..24d69d8 --- /dev/null +++ b/sig/privy/models/address.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class Address = String + end +end diff --git a/sig/privy/models/aggregation.rbs b/sig/privy/models/aggregation.rbs new file mode 100644 index 0000000..c2aa8d7 --- /dev/null +++ b/sig/privy/models/aggregation.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type aggregation = + { + id: String, + created_at: Float, + method_: Privy::Models::aggregation_method, + metric: Privy::AggregationMetric, + name: String, + owner_id: String?, + window: Privy::AggregationWindow, + conditions: ::Array[Privy::Models::policy_condition], + group_by: ::Array[Privy::AggregationGroupBy] + } + + class Aggregation < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Float + + attr_accessor method_: Privy::Models::aggregation_method + + attr_accessor metric: Privy::AggregationMetric + + attr_accessor name: String + + attr_accessor owner_id: String? + + attr_accessor window: Privy::AggregationWindow + + attr_reader conditions: ::Array[Privy::Models::policy_condition]? + + def conditions=: ( + ::Array[Privy::Models::policy_condition] + ) -> ::Array[Privy::Models::policy_condition] + + attr_reader group_by: ::Array[Privy::AggregationGroupBy]? + + def group_by=: ( + ::Array[Privy::AggregationGroupBy] + ) -> ::Array[Privy::AggregationGroupBy] + + def initialize: ( + id: String, + created_at: Float, + method_: Privy::Models::aggregation_method, + metric: Privy::AggregationMetric, + name: String, + owner_id: String?, + window: Privy::AggregationWindow, + ?conditions: ::Array[Privy::Models::policy_condition], + ?group_by: ::Array[Privy::AggregationGroupBy] + ) -> void + + def to_hash: -> { + id: String, + created_at: Float, + method_: Privy::Models::aggregation_method, + metric: Privy::AggregationMetric, + name: String, + owner_id: String?, + window: Privy::AggregationWindow, + conditions: ::Array[Privy::Models::policy_condition], + group_by: ::Array[Privy::AggregationGroupBy] + } + end + end +end diff --git a/sig/privy/models/aggregation_condition.rbs b/sig/privy/models/aggregation_condition.rbs new file mode 100644 index 0000000..7c4964a --- /dev/null +++ b/sig/privy/models/aggregation_condition.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type aggregation_condition = + { + field: String, + field_source: Privy::Models::AggregationCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class AggregationCondition < Privy::Internal::Type::BaseModel + attr_accessor field: String + + attr_accessor field_source: Privy::Models::AggregationCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: String, + field_source: Privy::Models::AggregationCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: String, + field_source: Privy::Models::AggregationCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field_source = :reference + + module FieldSource + extend Privy::Internal::Type::Enum + + REFERENCE: :reference + + def self?.values: -> ::Array[Privy::Models::AggregationCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/aggregation_group_by.rbs b/sig/privy/models/aggregation_group_by.rbs new file mode 100644 index 0000000..2991d40 --- /dev/null +++ b/sig/privy/models/aggregation_group_by.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type aggregation_group_by = + { field: String, field_source: String, abi: Privy::Models::abi_schema } + + class AggregationGroupBy < Privy::Internal::Type::BaseModel + attr_accessor field: String + + attr_accessor field_source: String + + attr_reader abi: Privy::Models::abi_schema? + + def abi=: (Privy::Models::abi_schema) -> Privy::Models::abi_schema + + def initialize: ( + field: String, + field_source: String, + ?abi: Privy::Models::abi_schema + ) -> void + + def to_hash: -> { + field: String, + field_source: String, + abi: Privy::Models::abi_schema + } + end + end +end diff --git a/sig/privy/models/aggregation_input.rbs b/sig/privy/models/aggregation_input.rbs new file mode 100644 index 0000000..8e4b904 --- /dev/null +++ b/sig/privy/models/aggregation_input.rbs @@ -0,0 +1,63 @@ +module Privy + module Models + type aggregation_input = + { + method_: Privy::Models::aggregation_method, + metric: Privy::AggregationMetric, + name: String, + window: Privy::AggregationWindow, + conditions: ::Array[Privy::Models::policy_condition], + group_by: ::Array[Privy::AggregationGroupBy], + owner: Privy::Models::owner_input?, + owner_id: String? + } + + class AggregationInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::aggregation_method + + attr_accessor metric: Privy::AggregationMetric + + attr_accessor name: String + + attr_accessor window: Privy::AggregationWindow + + attr_reader conditions: ::Array[Privy::Models::policy_condition]? + + def conditions=: ( + ::Array[Privy::Models::policy_condition] + ) -> ::Array[Privy::Models::policy_condition] + + attr_reader group_by: ::Array[Privy::AggregationGroupBy]? + + def group_by=: ( + ::Array[Privy::AggregationGroupBy] + ) -> ::Array[Privy::AggregationGroupBy] + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + def initialize: ( + method_: Privy::Models::aggregation_method, + metric: Privy::AggregationMetric, + name: String, + window: Privy::AggregationWindow, + ?conditions: ::Array[Privy::Models::policy_condition], + ?group_by: ::Array[Privy::AggregationGroupBy], + ?owner: Privy::Models::owner_input?, + ?owner_id: String? + ) -> void + + def to_hash: -> { + method_: Privy::Models::aggregation_method, + metric: Privy::AggregationMetric, + name: String, + window: Privy::AggregationWindow, + conditions: ::Array[Privy::Models::policy_condition], + group_by: ::Array[Privy::AggregationGroupBy], + owner: Privy::Models::owner_input?, + owner_id: String? + } + end + end +end diff --git a/sig/privy/models/aggregation_method.rbs b/sig/privy/models/aggregation_method.rbs new file mode 100644 index 0000000..cabf945 --- /dev/null +++ b/sig/privy/models/aggregation_method.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type aggregation_method = :eth_signTransaction | :eth_signUserOperation + + module AggregationMethod + extend Privy::Internal::Type::Enum + + ETH_SIGN_TRANSACTION: :eth_signTransaction + ETH_SIGN_USER_OPERATION: :eth_signUserOperation + + def self?.values: -> ::Array[Privy::Models::aggregation_method] + end + end +end diff --git a/sig/privy/models/aggregation_metric.rbs b/sig/privy/models/aggregation_metric.rbs new file mode 100644 index 0000000..b802ae6 --- /dev/null +++ b/sig/privy/models/aggregation_metric.rbs @@ -0,0 +1,47 @@ +module Privy + module Models + type aggregation_metric = + { + field: String, + field_source: String, + function: Privy::Models::AggregationMetric::function, + abi: Privy::Models::abi_schema + } + + class AggregationMetric < Privy::Internal::Type::BaseModel + attr_accessor field: String + + attr_accessor field_source: String + + attr_accessor function: Privy::Models::AggregationMetric::function + + attr_reader abi: Privy::Models::abi_schema? + + def abi=: (Privy::Models::abi_schema) -> Privy::Models::abi_schema + + def initialize: ( + field: String, + field_source: String, + function: Privy::Models::AggregationMetric::function, + ?abi: Privy::Models::abi_schema + ) -> void + + def to_hash: -> { + field: String, + field_source: String, + function: Privy::Models::AggregationMetric::function, + abi: Privy::Models::abi_schema + } + + type function = :sum + + module Function + extend Privy::Internal::Type::Enum + + SUM: :sum + + def self?.values: -> ::Array[Privy::Models::AggregationMetric::function] + end + end + end +end diff --git a/sig/privy/models/aggregation_window.rbs b/sig/privy/models/aggregation_window.rbs new file mode 100644 index 0000000..5472327 --- /dev/null +++ b/sig/privy/models/aggregation_window.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type aggregation_window = + { seconds: Integer, type: Privy::Models::AggregationWindow::type_ } + + class AggregationWindow < Privy::Internal::Type::BaseModel + attr_accessor seconds: Integer + + attr_accessor type: Privy::Models::AggregationWindow::type_ + + def initialize: ( + seconds: Integer, + type: Privy::Models::AggregationWindow::type_ + ) -> void + + def to_hash: -> { + seconds: Integer, + type: Privy::Models::AggregationWindow::type_ + } + + type type_ = :rolling + + module Type + extend Privy::Internal::Type::Enum + + ROLLING: :rolling + + def self?.values: -> ::Array[Privy::Models::AggregationWindow::type_] + end + end + end +end diff --git a/sig/privy/models/alchemy_paymaster_context.rbs b/sig/privy/models/alchemy_paymaster_context.rbs new file mode 100644 index 0000000..11ef870 --- /dev/null +++ b/sig/privy/models/alchemy_paymaster_context.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type alchemy_paymaster_context = { policy_id: String } + + class AlchemyPaymasterContext < Privy::Internal::Type::BaseModel + attr_accessor policy_id: String + + def initialize: (policy_id: String) -> void + + def to_hash: -> { policy_id: String } + end + end +end diff --git a/sig/privy/models/allowlist_deletion_response.rbs b/sig/privy/models/allowlist_deletion_response.rbs new file mode 100644 index 0000000..e24786c --- /dev/null +++ b/sig/privy/models/allowlist_deletion_response.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type allowlist_deletion_response = { message: String } + + class AllowlistDeletionResponse < Privy::Internal::Type::BaseModel + attr_accessor message: String + + def initialize: (message: String) -> void + + def to_hash: -> { message: String } + end + end +end diff --git a/sig/privy/models/allowlist_entry.rbs b/sig/privy/models/allowlist_entry.rbs new file mode 100644 index 0000000..e6ba036 --- /dev/null +++ b/sig/privy/models/allowlist_entry.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type allowlist_entry = + { + id: String, + accepted_at: Float?, + app_id: String, + type: String, + value: String + } + + class AllowlistEntry < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor accepted_at: Float? + + attr_accessor app_id: String + + attr_accessor type: String + + attr_accessor value: String + + def initialize: ( + id: String, + accepted_at: Float?, + app_id: String, + type: String, + value: String + ) -> void + + def to_hash: -> { + id: String, + accepted_at: Float?, + app_id: String, + type: String, + value: String + } + end + end +end diff --git a/sig/privy/models/amount_type.rbs b/sig/privy/models/amount_type.rbs new file mode 100644 index 0000000..c9cf1eb --- /dev/null +++ b/sig/privy/models/amount_type.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type amount_type = :exact_input | :exact_output + + module AmountType + extend Privy::Internal::Type::Enum + + EXACT_INPUT: :exact_input + EXACT_OUTPUT: :exact_output + + def self?.values: -> ::Array[Privy::Models::amount_type] + end + end +end diff --git a/sig/privy/models/analytics_event_input.rbs b/sig/privy/models/analytics_event_input.rbs new file mode 100644 index 0000000..58913c4 --- /dev/null +++ b/sig/privy/models/analytics_event_input.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type analytics_event_input = + { event_name: String, client_id: String, payload: ::Hash[Symbol, top] } + + class AnalyticsEventInput < Privy::Internal::Type::BaseModel + attr_accessor event_name: String + + attr_reader client_id: String? + + def client_id=: (String) -> String + + attr_reader payload: ::Hash[Symbol, top]? + + def payload=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] + + def initialize: ( + event_name: String, + ?client_id: String, + ?payload: ::Hash[Symbol, top] + ) -> void + + def to_hash: -> { + event_name: String, + client_id: String, + payload: ::Hash[Symbol, top] + } + end + end +end diff --git a/sig/privy/models/app_get_gas_spend_params.rbs b/sig/privy/models/app_get_gas_spend_params.rbs new file mode 100644 index 0000000..dce5ea7 --- /dev/null +++ b/sig/privy/models/app_get_gas_spend_params.rbs @@ -0,0 +1,36 @@ +module Privy + module Models + type app_get_gas_spend_params = + { + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: ::Array[String] + } + & Privy::Internal::Type::request_parameters + + class AppGetGasSpendParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor end_timestamp: Float + + attr_accessor start_timestamp: Float + + attr_accessor wallet_ids: ::Array[String] + + def initialize: ( + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: ::Array[String], + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: ::Array[String], + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/app_get_params.rbs b/sig/privy/models/app_get_params.rbs new file mode 100644 index 0000000..66e1677 --- /dev/null +++ b/sig/privy/models/app_get_params.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type app_get_params = + { app_id: String } & Privy::Internal::Type::request_parameters + + class AppGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor app_id: String + + def initialize: ( + app_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { app_id: String, request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/app_get_test_credentials_params.rbs b/sig/privy/models/app_get_test_credentials_params.rbs new file mode 100644 index 0000000..ccade1a --- /dev/null +++ b/sig/privy/models/app_get_test_credentials_params.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type app_get_test_credentials_params = + { app_id: String } & Privy::Internal::Type::request_parameters + + class AppGetTestCredentialsParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor app_id: String + + def initialize: ( + app_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { app_id: String, request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/app_response.rbs b/sig/privy/models/app_response.rbs new file mode 100644 index 0000000..26b6295 --- /dev/null +++ b/sig/privy/models/app_response.rbs @@ -0,0 +1,412 @@ +module Privy + module Models + type app_response = + { + id: String, + accent_color: String?, + allowed_domains: ::Array[String], + allowed_native_app_ids: ::Array[String], + allowed_native_app_url_schemes: ::Array[String], + allowlist_config: Privy::AppResponse::AllowlistConfig, + allowlist_enabled: bool, + apple_oauth: bool, + captcha_enabled: bool, + custom_api_url: String?, + custom_jwt_auth: bool, + custom_oauth_providers: ::Array[Privy::AppResponse::CustomOAuthProvider], + data_classification: Privy::Models::AppResponse::data_classification, + disable_plus_emails: bool, + discord_oauth: bool, + email_auth: bool, + embedded_wallet_config: Privy::EmbeddedWalletConfigSchema, + enabled_captcha_provider: Privy::Models::AppResponse::enabled_captcha_provider?, + enforce_wallet_uis: bool, + farcaster_auth: bool, + farcaster_link_wallets_enabled: bool, + fiat_on_ramp_enabled: bool, + github_oauth: bool, + google_oauth: bool, + guest_auth: bool, + icon_url: String?, + instagram_oauth: bool, + legacy_wallet_ui_config: bool, + line_oauth: bool, + linkedin_oauth: bool, + logo_url: String?, + max_linked_wallets_per_user: Float?, + mfa_methods: ::Array[Privy::Models::AppResponse::mfa_method], + name: String, + passkey_auth: bool, + passkeys_for_signup_enabled: bool, + privacy_policy_url: String?, + require_users_accept_terms: bool?, + show_wallet_login_first: bool, + smart_wallet_config: Privy::Models::smart_wallet_configuration, + sms_auth: bool, + solana_wallet_auth: bool, + spotify_oauth: bool, + telegram_auth: bool, + telegram_oauth: bool, + terms_and_conditions_url: String?, + theme: String, + tiktok_oauth: bool, + twitch_oauth: bool, + twitter_oauth: bool, + twitter_oauth_on_mobile_enabled: bool, + verification_key: String, + wallet_auth: bool, + wallet_connect_cloud_project_id: String?, + whatsapp_enabled: bool, + captcha_site_key: String, + funding_config: Privy::FundingConfigResponseSchema, + telegram_auth_config: Privy::TelegramAuthConfigSchema + } + + class AppResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor accent_color: String? + + attr_accessor allowed_domains: ::Array[String] + + attr_accessor allowed_native_app_ids: ::Array[String] + + attr_accessor allowed_native_app_url_schemes: ::Array[String] + + attr_accessor allowlist_config: Privy::AppResponse::AllowlistConfig + + attr_accessor allowlist_enabled: bool + + attr_accessor apple_oauth: bool + + attr_accessor captcha_enabled: bool + + attr_accessor custom_api_url: String? + + attr_accessor custom_jwt_auth: bool + + attr_accessor custom_oauth_providers: ::Array[Privy::AppResponse::CustomOAuthProvider] + + attr_accessor data_classification: Privy::Models::AppResponse::data_classification + + attr_accessor disable_plus_emails: bool + + attr_accessor discord_oauth: bool + + attr_accessor email_auth: bool + + attr_accessor embedded_wallet_config: Privy::EmbeddedWalletConfigSchema + + attr_accessor enabled_captcha_provider: Privy::Models::AppResponse::enabled_captcha_provider? + + attr_accessor enforce_wallet_uis: bool + + attr_accessor farcaster_auth: bool + + attr_accessor farcaster_link_wallets_enabled: bool + + attr_accessor fiat_on_ramp_enabled: bool + + attr_accessor github_oauth: bool + + attr_accessor google_oauth: bool + + attr_accessor guest_auth: bool + + attr_accessor icon_url: String? + + attr_accessor instagram_oauth: bool + + attr_accessor legacy_wallet_ui_config: bool + + attr_accessor line_oauth: bool + + attr_accessor linkedin_oauth: bool + + attr_accessor logo_url: String? + + attr_accessor max_linked_wallets_per_user: Float? + + attr_accessor mfa_methods: ::Array[Privy::Models::AppResponse::mfa_method] + + attr_accessor name: String + + attr_accessor passkey_auth: bool + + attr_accessor passkeys_for_signup_enabled: bool + + attr_accessor privacy_policy_url: String? + + attr_accessor require_users_accept_terms: bool? + + attr_accessor show_wallet_login_first: bool + + attr_accessor smart_wallet_config: Privy::Models::smart_wallet_configuration + + attr_accessor sms_auth: bool + + attr_accessor solana_wallet_auth: bool + + attr_accessor spotify_oauth: bool + + attr_accessor telegram_auth: bool + + attr_accessor telegram_oauth: bool + + attr_accessor terms_and_conditions_url: String? + + attr_accessor theme: String + + attr_accessor tiktok_oauth: bool + + attr_accessor twitch_oauth: bool + + attr_accessor twitter_oauth: bool + + attr_accessor twitter_oauth_on_mobile_enabled: bool + + attr_accessor verification_key: String + + attr_accessor wallet_auth: bool + + attr_accessor wallet_connect_cloud_project_id: String? + + attr_accessor whatsapp_enabled: bool + + attr_reader captcha_site_key: String? + + def captcha_site_key=: (String) -> String + + attr_reader funding_config: Privy::FundingConfigResponseSchema? + + def funding_config=: ( + Privy::FundingConfigResponseSchema + ) -> Privy::FundingConfigResponseSchema + + attr_reader telegram_auth_config: Privy::TelegramAuthConfigSchema? + + def telegram_auth_config=: ( + Privy::TelegramAuthConfigSchema + ) -> Privy::TelegramAuthConfigSchema + + def initialize: ( + id: String, + accent_color: String?, + allowed_domains: ::Array[String], + allowed_native_app_ids: ::Array[String], + allowed_native_app_url_schemes: ::Array[String], + allowlist_config: Privy::AppResponse::AllowlistConfig, + allowlist_enabled: bool, + apple_oauth: bool, + captcha_enabled: bool, + custom_api_url: String?, + custom_jwt_auth: bool, + custom_oauth_providers: ::Array[Privy::AppResponse::CustomOAuthProvider], + data_classification: Privy::Models::AppResponse::data_classification, + disable_plus_emails: bool, + discord_oauth: bool, + email_auth: bool, + embedded_wallet_config: Privy::EmbeddedWalletConfigSchema, + enabled_captcha_provider: Privy::Models::AppResponse::enabled_captcha_provider?, + enforce_wallet_uis: bool, + farcaster_auth: bool, + farcaster_link_wallets_enabled: bool, + fiat_on_ramp_enabled: bool, + github_oauth: bool, + google_oauth: bool, + guest_auth: bool, + icon_url: String?, + instagram_oauth: bool, + legacy_wallet_ui_config: bool, + line_oauth: bool, + linkedin_oauth: bool, + logo_url: String?, + max_linked_wallets_per_user: Float?, + mfa_methods: ::Array[Privy::Models::AppResponse::mfa_method], + name: String, + passkey_auth: bool, + passkeys_for_signup_enabled: bool, + privacy_policy_url: String?, + require_users_accept_terms: bool?, + show_wallet_login_first: bool, + smart_wallet_config: Privy::Models::smart_wallet_configuration, + sms_auth: bool, + solana_wallet_auth: bool, + spotify_oauth: bool, + telegram_auth: bool, + telegram_oauth: bool, + terms_and_conditions_url: String?, + theme: String, + tiktok_oauth: bool, + twitch_oauth: bool, + twitter_oauth: bool, + twitter_oauth_on_mobile_enabled: bool, + verification_key: String, + wallet_auth: bool, + wallet_connect_cloud_project_id: String?, + whatsapp_enabled: bool, + ?captcha_site_key: String, + ?funding_config: Privy::FundingConfigResponseSchema, + ?telegram_auth_config: Privy::TelegramAuthConfigSchema + ) -> void + + def to_hash: -> { + id: String, + accent_color: String?, + allowed_domains: ::Array[String], + allowed_native_app_ids: ::Array[String], + allowed_native_app_url_schemes: ::Array[String], + allowlist_config: Privy::AppResponse::AllowlistConfig, + allowlist_enabled: bool, + apple_oauth: bool, + captcha_enabled: bool, + custom_api_url: String?, + custom_jwt_auth: bool, + custom_oauth_providers: ::Array[Privy::AppResponse::CustomOAuthProvider], + data_classification: Privy::Models::AppResponse::data_classification, + disable_plus_emails: bool, + discord_oauth: bool, + email_auth: bool, + embedded_wallet_config: Privy::EmbeddedWalletConfigSchema, + enabled_captcha_provider: Privy::Models::AppResponse::enabled_captcha_provider?, + enforce_wallet_uis: bool, + farcaster_auth: bool, + farcaster_link_wallets_enabled: bool, + fiat_on_ramp_enabled: bool, + github_oauth: bool, + google_oauth: bool, + guest_auth: bool, + icon_url: String?, + instagram_oauth: bool, + legacy_wallet_ui_config: bool, + line_oauth: bool, + linkedin_oauth: bool, + logo_url: String?, + max_linked_wallets_per_user: Float?, + mfa_methods: ::Array[Privy::Models::AppResponse::mfa_method], + name: String, + passkey_auth: bool, + passkeys_for_signup_enabled: bool, + privacy_policy_url: String?, + require_users_accept_terms: bool?, + show_wallet_login_first: bool, + smart_wallet_config: Privy::Models::smart_wallet_configuration, + sms_auth: bool, + solana_wallet_auth: bool, + spotify_oauth: bool, + telegram_auth: bool, + telegram_oauth: bool, + terms_and_conditions_url: String?, + theme: String, + tiktok_oauth: bool, + twitch_oauth: bool, + twitter_oauth: bool, + twitter_oauth_on_mobile_enabled: bool, + verification_key: String, + wallet_auth: bool, + wallet_connect_cloud_project_id: String?, + whatsapp_enabled: bool, + captcha_site_key: String, + funding_config: Privy::FundingConfigResponseSchema, + telegram_auth_config: Privy::TelegramAuthConfigSchema + } + + type allowlist_config = + { + cta_link: String?, + cta_text: String?, + error_detail: String?, + error_title: String? + } + + class AllowlistConfig < Privy::Internal::Type::BaseModel + attr_accessor cta_link: String? + + attr_accessor cta_text: String? + + attr_accessor error_detail: String? + + attr_accessor error_title: String? + + def initialize: ( + cta_link: String?, + cta_text: String?, + error_detail: String?, + error_title: String? + ) -> void + + def to_hash: -> { + cta_link: String?, + cta_text: String?, + error_detail: String?, + error_title: String? + } + end + + type custom_oauth_provider = + { + enabled: bool, + provider: String, + provider_display_name: String, + provider_icon_url: String + } + + class CustomOAuthProvider < Privy::Internal::Type::BaseModel + attr_accessor enabled: bool + + attr_accessor provider: String + + attr_accessor provider_display_name: String + + attr_accessor provider_icon_url: String + + def initialize: ( + enabled: bool, + provider: String, + provider_display_name: String, + provider_icon_url: String + ) -> void + + def to_hash: -> { + enabled: bool, + provider: String, + provider_display_name: String, + provider_icon_url: String + } + end + + type data_classification = :public + + module DataClassification + extend Privy::Internal::Type::Enum + + PUBLIC: :public + + def self?.values: -> ::Array[Privy::Models::AppResponse::data_classification] + end + + type enabled_captcha_provider = :turnstile | :hcaptcha + + module EnabledCaptchaProvider + extend Privy::Internal::Type::Enum + + TURNSTILE: :turnstile + HCAPTCHA: :hcaptcha + + def self?.values: -> ::Array[Privy::Models::AppResponse::enabled_captcha_provider] + end + + type mfa_method = :sms | :totp | :passkey + + module MfaMethod + extend Privy::Internal::Type::Enum + + SMS: :sms + TOTP: :totp + PASSKEY: :passkey + + def self?.values: -> ::Array[Privy::Models::AppResponse::mfa_method] + end + end + end +end diff --git a/sig/privy/models/apps/allowlist_create_params.rbs b/sig/privy/models/apps/allowlist_create_params.rbs new file mode 100644 index 0000000..1317c2d --- /dev/null +++ b/sig/privy/models/apps/allowlist_create_params.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + module Apps + type allowlist_create_params = + { app_id: String } & Privy::Internal::Type::request_parameters + + class AllowlistCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor app_id: String + + def initialize: ( + app_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + app_id: String, + request_options: Privy::RequestOptions + } + end + end + end +end diff --git a/sig/privy/models/apps/allowlist_delete_params.rbs b/sig/privy/models/apps/allowlist_delete_params.rbs new file mode 100644 index 0000000..ecb0021 --- /dev/null +++ b/sig/privy/models/apps/allowlist_delete_params.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + module Apps + type allowlist_delete_params = + { app_id: String } & Privy::Internal::Type::request_parameters + + class AllowlistDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor app_id: String + + def initialize: ( + app_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + app_id: String, + request_options: Privy::RequestOptions + } + end + end + end +end diff --git a/sig/privy/models/apps/allowlist_list_params.rbs b/sig/privy/models/apps/allowlist_list_params.rbs new file mode 100644 index 0000000..f156933 --- /dev/null +++ b/sig/privy/models/apps/allowlist_list_params.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + module Apps + type allowlist_list_params = + { app_id: String } & Privy::Internal::Type::request_parameters + + class AllowlistListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor app_id: String + + def initialize: ( + app_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + app_id: String, + request_options: Privy::RequestOptions + } + end + end + end +end diff --git a/sig/privy/models/apps/allowlist_list_response.rbs b/sig/privy/models/apps/allowlist_list_response.rbs new file mode 100644 index 0000000..46aaefd --- /dev/null +++ b/sig/privy/models/apps/allowlist_list_response.rbs @@ -0,0 +1,9 @@ +module Privy + module Models + module Apps + type allowlist_list_response = ::Array[Privy::AllowlistEntry] + + AllowlistListResponse: Privy::Internal::Type::Converter + end + end +end diff --git a/sig/privy/models/asset_account_with_balance.rbs b/sig/privy/models/asset_account_with_balance.rbs new file mode 100644 index 0000000..e26acbc --- /dev/null +++ b/sig/privy/models/asset_account_with_balance.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type asset_account_with_balance = + { + id: String, + balance: Privy::BalanceResponse, + display_name: String?, + wallets: ::Array[Privy::AccountWallet] + } + + class AssetAccountWithBalance < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor balance: Privy::BalanceResponse + + attr_accessor display_name: String? + + attr_accessor wallets: ::Array[Privy::AccountWallet] + + def initialize: ( + id: String, + balance: Privy::BalanceResponse, + display_name: String?, + wallets: ::Array[Privy::AccountWallet] + ) -> void + + def to_hash: -> { + id: String, + balance: Privy::BalanceResponse, + display_name: String?, + wallets: ::Array[Privy::AccountWallet] + } + end + end +end diff --git a/sig/privy/models/authenticate_jwt_input.rbs b/sig/privy/models/authenticate_jwt_input.rbs new file mode 100644 index 0000000..b48500c --- /dev/null +++ b/sig/privy/models/authenticate_jwt_input.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type authenticate_jwt_input = + { token: String, mode: Privy::Models::authenticate_mode_option } + + class AuthenticateJwtInput < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + ?token: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + token: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/authenticate_mode.rbs b/sig/privy/models/authenticate_mode.rbs new file mode 100644 index 0000000..2adc1ad --- /dev/null +++ b/sig/privy/models/authenticate_mode.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type authenticate_mode = { mode: Privy::Models::authenticate_mode_option } + + class AuthenticateMode < Privy::Internal::Type::BaseModel + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: (?mode: Privy::Models::authenticate_mode_option) -> void + + def to_hash: -> { mode: Privy::Models::authenticate_mode_option } + end + end +end diff --git a/sig/privy/models/authenticate_mode_option.rbs b/sig/privy/models/authenticate_mode_option.rbs new file mode 100644 index 0000000..d62bb3d --- /dev/null +++ b/sig/privy/models/authenticate_mode_option.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type authenticate_mode_option = :"no-signup" | :"login-or-sign-up" + + module AuthenticateModeOption + extend Privy::Internal::Type::Enum + + NO_SIGNUP: :"no-signup" + LOGIN_OR_SIGN_UP: :"login-or-sign-up" + + def self?.values: -> ::Array[Privy::Models::authenticate_mode_option] + end + end +end diff --git a/sig/privy/models/authenticate_siwe_input.rbs b/sig/privy/models/authenticate_siwe_input.rbs new file mode 100644 index 0000000..4c0499c --- /dev/null +++ b/sig/privy/models/authenticate_siwe_input.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type authenticate_siwe_input = + { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + + class AuthenticateSiweInput < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor chain_id: String? + + attr_accessor connector_type: String? + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?chain_id: String?, + ?connector_type: String?, + ?mode: Privy::Models::authenticate_mode_option, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + end + end +end diff --git a/sig/privy/models/authenticate_siws_input.rbs b/sig/privy/models/authenticate_siws_input.rbs new file mode 100644 index 0000000..3b33586 --- /dev/null +++ b/sig/privy/models/authenticate_siws_input.rbs @@ -0,0 +1,64 @@ +module Privy + module Models + type authenticate_siws_input = + { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::AuthenticateSiwsInput::message_type, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + + class AuthenticateSiwsInput < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor connector_type: String? + + attr_reader message_type: Privy::Models::AuthenticateSiwsInput::message_type? + + def message_type=: ( + Privy::Models::AuthenticateSiwsInput::message_type + ) -> Privy::Models::AuthenticateSiwsInput::message_type + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?connector_type: String?, + ?message_type: Privy::Models::AuthenticateSiwsInput::message_type, + ?mode: Privy::Models::authenticate_mode_option, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::AuthenticateSiwsInput::message_type, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + + type message_type = :transaction | :plain + + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION: :transaction + PLAIN: :plain + + def self?.values: -> ::Array[Privy::Models::AuthenticateSiwsInput::message_type] + end + end + end +end diff --git a/sig/privy/models/authenticated_user.rbs b/sig/privy/models/authenticated_user.rbs new file mode 100644 index 0000000..49fd591 --- /dev/null +++ b/sig/privy/models/authenticated_user.rbs @@ -0,0 +1,73 @@ +module Privy + module Models + type authenticated_user = + { + token: String?, + privy_access_token: String?, + refresh_token: String?, + session_update_action: Privy::Models::AuthenticatedUser::session_update_action, + user: Privy::User, + identity_token: String, + is_new_user: bool, + oauth_tokens: Privy::OAuthTokens + } + + class AuthenticatedUser < Privy::Internal::Type::BaseModel + attr_accessor token: String? + + attr_accessor privy_access_token: String? + + attr_accessor refresh_token: String? + + attr_accessor session_update_action: Privy::Models::AuthenticatedUser::session_update_action + + attr_accessor user: Privy::User + + attr_reader identity_token: String? + + def identity_token=: (String) -> String + + attr_reader is_new_user: bool? + + def is_new_user=: (bool) -> bool + + attr_reader oauth_tokens: Privy::OAuthTokens? + + def oauth_tokens=: (Privy::OAuthTokens) -> Privy::OAuthTokens + + def initialize: ( + token: String?, + privy_access_token: String?, + refresh_token: String?, + session_update_action: Privy::Models::AuthenticatedUser::session_update_action, + user: Privy::User, + ?identity_token: String, + ?is_new_user: bool, + ?oauth_tokens: Privy::OAuthTokens + ) -> void + + def to_hash: -> { + token: String?, + privy_access_token: String?, + refresh_token: String?, + session_update_action: Privy::Models::AuthenticatedUser::session_update_action, + user: Privy::User, + identity_token: String, + is_new_user: bool, + oauth_tokens: Privy::OAuthTokens + } + + type session_update_action = :set | :ignore | :clear + + module SessionUpdateAction + extend Privy::Internal::Type::Enum + + SET: :set + IGNORE: :ignore + CLEAR: :clear + + def self?.values: -> ::Array[Privy::Models::AuthenticatedUser::session_update_action] + end + end + end +end diff --git a/sig/privy/models/authorization_key_dashboard_response.rbs b/sig/privy/models/authorization_key_dashboard_response.rbs new file mode 100644 index 0000000..3162fc9 --- /dev/null +++ b/sig/privy/models/authorization_key_dashboard_response.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type authorization_key_dashboard_response = + { + id: String, + created_at: Float, + display_name: String?, + public_key: String, + role: Privy::Models::authorization_key_role? + } + + class AuthorizationKeyDashboardResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Float + + attr_accessor display_name: String? + + attr_accessor public_key: String + + attr_accessor role: Privy::Models::authorization_key_role? + + def initialize: ( + id: String, + created_at: Float, + display_name: String?, + public_key: String, + role: Privy::Models::authorization_key_role? + ) -> void + + def to_hash: -> { + id: String, + created_at: Float, + display_name: String?, + public_key: String, + role: Privy::Models::authorization_key_role? + } + end + end +end diff --git a/sig/privy/models/authorization_key_response.rbs b/sig/privy/models/authorization_key_response.rbs new file mode 100644 index 0000000..d873a57 --- /dev/null +++ b/sig/privy/models/authorization_key_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type authorization_key_response = + { + id: String, + created_at: Float, + display_name: String?, + public_key: String + } + + class AuthorizationKeyResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Float + + attr_accessor display_name: String? + + attr_accessor public_key: String + + def initialize: ( + id: String, + created_at: Float, + display_name: String?, + public_key: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Float, + display_name: String?, + public_key: String + } + end + end +end diff --git a/sig/privy/models/authorization_key_role.rbs b/sig/privy/models/authorization_key_role.rbs new file mode 100644 index 0000000..3649b00 --- /dev/null +++ b/sig/privy/models/authorization_key_role.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type authorization_key_role = :root | :manager | :"delegated-actions" + + module AuthorizationKeyRole + extend Privy::Internal::Type::Enum + + ROOT: :root + MANAGER: :manager + DELEGATED_ACTIONS: :"delegated-actions" + + def self?.values: -> ::Array[Privy::Models::authorization_key_role] + end + end +end diff --git a/sig/privy/models/balance_asset.rbs b/sig/privy/models/balance_asset.rbs new file mode 100644 index 0000000..79afdcc --- /dev/null +++ b/sig/privy/models/balance_asset.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type balance_asset = + { amount: String, price: Privy::CurrencyAmount, symbol: String } + + class BalanceAsset < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor price: Privy::CurrencyAmount + + attr_accessor symbol: String + + def initialize: ( + amount: String, + price: Privy::CurrencyAmount, + symbol: String + ) -> void + + def to_hash: -> { + amount: String, + price: Privy::CurrencyAmount, + symbol: String + } + end + end +end diff --git a/sig/privy/models/balance_asset_by_chain.rbs b/sig/privy/models/balance_asset_by_chain.rbs new file mode 100644 index 0000000..9484d87 --- /dev/null +++ b/sig/privy/models/balance_asset_by_chain.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type balance_asset_by_chain = + { + amount: String, + chain_id: String, + price: Privy::CurrencyAmount, + symbol: String + } + + class BalanceAssetByChain < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor chain_id: String + + attr_accessor price: Privy::CurrencyAmount + + attr_accessor symbol: String + + def initialize: ( + amount: String, + chain_id: String, + price: Privy::CurrencyAmount, + symbol: String + ) -> void + + def to_hash: -> { + amount: String, + chain_id: String, + price: Privy::CurrencyAmount, + symbol: String + } + end + end +end diff --git a/sig/privy/models/balance_response.rbs b/sig/privy/models/balance_response.rbs new file mode 100644 index 0000000..efbe220 --- /dev/null +++ b/sig/privy/models/balance_response.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type balance_response = + { + assets: ::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + assets_by_chain: ::Array[Privy::BalanceAssetByChain] + } + + class BalanceResponse < Privy::Internal::Type::BaseModel + attr_accessor assets: ::Array[Privy::BalanceAsset] + + attr_accessor total: Privy::CurrencyAmount + + attr_reader assets_by_chain: ::Array[Privy::BalanceAssetByChain]? + + def assets_by_chain=: ( + ::Array[Privy::BalanceAssetByChain] + ) -> ::Array[Privy::BalanceAssetByChain] + + def initialize: ( + assets: ::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + ?assets_by_chain: ::Array[Privy::BalanceAssetByChain] + ) -> void + + def to_hash: -> { + assets: ::Array[Privy::BalanceAsset], + total: Privy::CurrencyAmount, + assets_by_chain: ::Array[Privy::BalanceAssetByChain] + } + end + end +end diff --git a/sig/privy/models/base_action_result.rbs b/sig/privy/models/base_action_result.rbs new file mode 100644 index 0000000..8f0e7e6 --- /dev/null +++ b/sig/privy/models/base_action_result.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type base_action_result = + { + executed_at: Float, + status_code: Float, + authorized_by_display_name: String, + authorized_by_id: String + } + + class BaseActionResult < Privy::Internal::Type::BaseModel + attr_accessor executed_at: Float + + attr_accessor status_code: Float + + attr_reader authorized_by_display_name: String? + + def authorized_by_display_name=: (String) -> String + + attr_reader authorized_by_id: String? + + def authorized_by_id=: (String) -> String + + def initialize: ( + executed_at: Float, + status_code: Float, + ?authorized_by_display_name: String, + ?authorized_by_id: String + ) -> void + + def to_hash: -> { + executed_at: Float, + status_code: Float, + authorized_by_display_name: String, + authorized_by_id: String + } + end + end +end diff --git a/sig/privy/models/base_intent_response.rbs b/sig/privy/models/base_intent_response.rbs new file mode 100644 index 0000000..ed69723 --- /dev/null +++ b/sig/privy/models/base_intent_response.rbs @@ -0,0 +1,83 @@ +module Privy + module Models + type base_intent_response = + { + authorization_details: ::Array[Privy::IntentAuthorization], + created_at: Float, + created_by_display_name: String, + custom_expiry: bool, + expires_at: Float, + intent_id: String, + resource_id: String, + status: Privy::Models::intent_status, + created_by_id: String, + dismissal_reason: String, + dismissed_at: Float, + rejected_at: Float + } + + class BaseIntentResponse < Privy::Internal::Type::BaseModel + attr_accessor authorization_details: ::Array[Privy::IntentAuthorization] + + attr_accessor created_at: Float + + attr_accessor created_by_display_name: String + + attr_accessor custom_expiry: bool + + attr_accessor expires_at: Float + + attr_accessor intent_id: String + + attr_accessor resource_id: String + + attr_accessor status: Privy::Models::intent_status + + attr_reader created_by_id: String? + + def created_by_id=: (String) -> String + + attr_reader dismissal_reason: String? + + def dismissal_reason=: (String) -> String + + attr_reader dismissed_at: Float? + + def dismissed_at=: (Float) -> Float + + attr_reader rejected_at: Float? + + def rejected_at=: (Float) -> Float + + def initialize: ( + authorization_details: ::Array[Privy::IntentAuthorization], + created_at: Float, + created_by_display_name: String, + custom_expiry: bool, + expires_at: Float, + intent_id: String, + resource_id: String, + status: Privy::Models::intent_status, + ?created_by_id: String, + ?dismissal_reason: String, + ?dismissed_at: Float, + ?rejected_at: Float + ) -> void + + def to_hash: -> { + authorization_details: ::Array[Privy::IntentAuthorization], + created_at: Float, + created_by_display_name: String, + custom_expiry: bool, + expires_at: Float, + intent_id: String, + resource_id: String, + status: Privy::Models::intent_status, + created_by_id: String, + dismissal_reason: String, + dismissed_at: Float, + rejected_at: Float + } + end + end +end diff --git a/sig/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rbs b/sig/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rbs new file mode 100644 index 0000000..77fc8f5 --- /dev/null +++ b/sig/privy/models/bridge_brl_fiat_virtual_account_deposit_instructions.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type bridge_brl_fiat_virtual_account_deposit_instructions = + { + account_holder_name: String, + asset: Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + br_code: String, + payment_rails: ::Array[Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::payment_rail] + } + + class BridgeBrlFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + attr_accessor account_holder_name: String + + attr_accessor asset: Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::asset + + attr_accessor bank_address: String + + attr_accessor bank_name: String + + attr_accessor br_code: String + + attr_accessor payment_rails: ::Array[Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::payment_rail] + + def initialize: ( + account_holder_name: String, + asset: Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + br_code: String, + payment_rails: ::Array[Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::payment_rail] + ) -> void + + def to_hash: -> { + account_holder_name: String, + asset: Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + br_code: String, + payment_rails: ::Array[Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::payment_rail] + } + + type asset = :brl + + module Asset + extend Privy::Internal::Type::Enum + + BRL: :brl + + def self?.values: -> ::Array[Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::asset] + end + + type payment_rail = :pix + + module PaymentRail + extend Privy::Internal::Type::Enum + + PIX: :pix + + def self?.values: -> ::Array[Privy::Models::BridgeBrlFiatVirtualAccountDepositInstructions::payment_rail] + end + end + end +end diff --git a/sig/privy/models/bridge_crypto_deposit_metadata.rbs b/sig/privy/models/bridge_crypto_deposit_metadata.rbs new file mode 100644 index 0000000..37f3e34 --- /dev/null +++ b/sig/privy/models/bridge_crypto_deposit_metadata.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type bridge_crypto_deposit_metadata = + { + drain_id: String, + liquidation_address: String, + liquidation_address_id: String, + method_: Privy::Models::BridgeCryptoDepositMetadata::method_, + source_wallet_address: String, + type: Privy::Models::BridgeCryptoDepositMetadata::type_ + } + + class BridgeCryptoDepositMetadata < Privy::Internal::Type::BaseModel + attr_accessor drain_id: String + + attr_accessor liquidation_address: String + + attr_accessor liquidation_address_id: String + + attr_accessor method_: Privy::Models::BridgeCryptoDepositMetadata::method_ + + attr_accessor source_wallet_address: String + + attr_accessor type: Privy::Models::BridgeCryptoDepositMetadata::type_ + + def initialize: ( + drain_id: String, + liquidation_address: String, + liquidation_address_id: String, + method_: Privy::Models::BridgeCryptoDepositMetadata::method_, + source_wallet_address: String, + type: Privy::Models::BridgeCryptoDepositMetadata::type_ + ) -> void + + def to_hash: -> { + drain_id: String, + liquidation_address: String, + liquidation_address_id: String, + method_: Privy::Models::BridgeCryptoDepositMetadata::method_, + source_wallet_address: String, + type: Privy::Models::BridgeCryptoDepositMetadata::type_ + } + + type method_ = :liquidation_address + + module Method + extend Privy::Internal::Type::Enum + + LIQUIDATION_ADDRESS: :liquidation_address + + def self?.values: -> ::Array[Privy::Models::BridgeCryptoDepositMetadata::method_] + end + + type type_ = :crypto_deposit + + module Type + extend Privy::Internal::Type::Enum + + CRYPTO_DEPOSIT: :crypto_deposit + + def self?.values: -> ::Array[Privy::Models::BridgeCryptoDepositMetadata::type_] + end + end + end +end diff --git a/sig/privy/models/bridge_crypto_transfer_metadata.rbs b/sig/privy/models/bridge_crypto_transfer_metadata.rbs new file mode 100644 index 0000000..80fb983 --- /dev/null +++ b/sig/privy/models/bridge_crypto_transfer_metadata.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type bridge_crypto_transfer_metadata = + { + method_: Privy::Models::BridgeCryptoTransferMetadata::method_, + source_wallet_address: String, + transfer_id: String, + type: Privy::Models::BridgeCryptoTransferMetadata::type_ + } + + class BridgeCryptoTransferMetadata < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::BridgeCryptoTransferMetadata::method_ + + attr_accessor source_wallet_address: String + + attr_accessor transfer_id: String + + attr_accessor type: Privy::Models::BridgeCryptoTransferMetadata::type_ + + def initialize: ( + method_: Privy::Models::BridgeCryptoTransferMetadata::method_, + source_wallet_address: String, + transfer_id: String, + type: Privy::Models::BridgeCryptoTransferMetadata::type_ + ) -> void + + def to_hash: -> { + method_: Privy::Models::BridgeCryptoTransferMetadata::method_, + source_wallet_address: String, + transfer_id: String, + type: Privy::Models::BridgeCryptoTransferMetadata::type_ + } + + type method_ = :transfer + + module Method + extend Privy::Internal::Type::Enum + + TRANSFER: :transfer + + def self?.values: -> ::Array[Privy::Models::BridgeCryptoTransferMetadata::method_] + end + + type type_ = :crypto_deposit + + module Type + extend Privy::Internal::Type::Enum + + CRYPTO_DEPOSIT: :crypto_deposit + + def self?.values: -> ::Array[Privy::Models::BridgeCryptoTransferMetadata::type_] + end + end + end +end diff --git a/sig/privy/models/bridge_destination_asset.rbs b/sig/privy/models/bridge_destination_asset.rbs new file mode 100644 index 0000000..287dbdb --- /dev/null +++ b/sig/privy/models/bridge_destination_asset.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type bridge_destination_asset = + :usdb | :usdc | :usdt | :dai | :pyusd | :eurc + + module BridgeDestinationAsset + extend Privy::Internal::Type::Enum + + USDB: :usdb + USDC: :usdc + USDT: :usdt + DAI: :dai + PYUSD: :pyusd + EURC: :eurc + + def self?.values: -> ::Array[Privy::Models::bridge_destination_asset] + end + end +end diff --git a/sig/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rbs b/sig/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rbs new file mode 100644 index 0000000..c23fba0 --- /dev/null +++ b/sig/privy/models/bridge_eur_fiat_virtual_account_deposit_instructions.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type bridge_eur_fiat_virtual_account_deposit_instructions = + { + account_holder_name: String, + asset: Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + bic: String, + iban: String, + payment_rails: ::Array[Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::payment_rail] + } + + class BridgeEurFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + attr_accessor account_holder_name: String + + attr_accessor asset: Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::asset + + attr_accessor bank_address: String + + attr_accessor bank_name: String + + attr_accessor bic: String + + attr_accessor iban: String + + attr_accessor payment_rails: ::Array[Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::payment_rail] + + def initialize: ( + account_holder_name: String, + asset: Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + bic: String, + iban: String, + payment_rails: ::Array[Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::payment_rail] + ) -> void + + def to_hash: -> { + account_holder_name: String, + asset: Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + bic: String, + iban: String, + payment_rails: ::Array[Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::payment_rail] + } + + type asset = :eur + + module Asset + extend Privy::Internal::Type::Enum + + EUR: :eur + + def self?.values: -> ::Array[Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::asset] + end + + type payment_rail = :sepa + + module PaymentRail + extend Privy::Internal::Type::Enum + + SEPA: :sepa + + def self?.values: -> ::Array[Privy::Models::BridgeEurFiatVirtualAccountDepositInstructions::payment_rail] + end + end + end +end diff --git a/sig/privy/models/bridge_fiat_customer_response.rbs b/sig/privy/models/bridge_fiat_customer_response.rbs new file mode 100644 index 0000000..88582cf --- /dev/null +++ b/sig/privy/models/bridge_fiat_customer_response.rbs @@ -0,0 +1,85 @@ +module Privy + module Models + type bridge_fiat_customer_response = + { + has_accepted_terms: bool, + provider: Privy::Models::BridgeFiatCustomerResponse::provider, + status: Privy::Models::BridgeFiatCustomerResponse::status, + kyc_url: String, + rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason] + } + + class BridgeFiatCustomerResponse < Privy::Internal::Type::BaseModel + attr_accessor has_accepted_terms: bool + + attr_accessor provider: Privy::Models::BridgeFiatCustomerResponse::provider + + attr_accessor status: Privy::Models::BridgeFiatCustomerResponse::status + + attr_reader kyc_url: String? + + def kyc_url=: (String) -> String + + attr_reader rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason]? + + def rejection_reasons=: ( + ::Array[Privy::BridgeFiatRejectionReason] + ) -> ::Array[Privy::BridgeFiatRejectionReason] + + def initialize: ( + has_accepted_terms: bool, + provider: Privy::Models::BridgeFiatCustomerResponse::provider, + status: Privy::Models::BridgeFiatCustomerResponse::status, + ?kyc_url: String, + ?rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason] + ) -> void + + def to_hash: -> { + has_accepted_terms: bool, + provider: Privy::Models::BridgeFiatCustomerResponse::provider, + status: Privy::Models::BridgeFiatCustomerResponse::status, + kyc_url: String, + rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason] + } + + type provider = :bridge + + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE: :bridge + + def self?.values: -> ::Array[Privy::Models::BridgeFiatCustomerResponse::provider] + end + + type status = + :not_found + | :active + | :awaiting_questionnaire + | :awaiting_ubo + | :incomplete + | :not_started + | :offboarded + | :paused + | :rejected + | :under_review + + module Status + extend Privy::Internal::Type::Enum + + NOT_FOUND: :not_found + ACTIVE: :active + AWAITING_QUESTIONNAIRE: :awaiting_questionnaire + AWAITING_UBO: :awaiting_ubo + INCOMPLETE: :incomplete + NOT_STARTED: :not_started + OFFBOARDED: :offboarded + PAUSED: :paused + REJECTED: :rejected + UNDER_REVIEW: :under_review + + def self?.values: -> ::Array[Privy::Models::BridgeFiatCustomerResponse::status] + end + end + end +end diff --git a/sig/privy/models/bridge_fiat_deposit_metadata.rbs b/sig/privy/models/bridge_fiat_deposit_metadata.rbs new file mode 100644 index 0000000..c9140a6 --- /dev/null +++ b/sig/privy/models/bridge_fiat_deposit_metadata.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type bridge_fiat_deposit_metadata = + { + activity_id: String, + method_: Privy::Models::BridgeFiatDepositMetadata::method_, + type: Privy::Models::BridgeFiatDepositMetadata::type_, + virtual_account_id: String + } + + class BridgeFiatDepositMetadata < Privy::Internal::Type::BaseModel + attr_accessor activity_id: String + + attr_accessor method_: Privy::Models::BridgeFiatDepositMetadata::method_ + + attr_accessor type: Privy::Models::BridgeFiatDepositMetadata::type_ + + attr_accessor virtual_account_id: String + + def initialize: ( + activity_id: String, + method_: Privy::Models::BridgeFiatDepositMetadata::method_, + type: Privy::Models::BridgeFiatDepositMetadata::type_, + virtual_account_id: String + ) -> void + + def to_hash: -> { + activity_id: String, + method_: Privy::Models::BridgeFiatDepositMetadata::method_, + type: Privy::Models::BridgeFiatDepositMetadata::type_, + virtual_account_id: String + } + + type method_ = :virtual_account + + module Method + extend Privy::Internal::Type::Enum + + VIRTUAL_ACCOUNT: :virtual_account + + def self?.values: -> ::Array[Privy::Models::BridgeFiatDepositMetadata::method_] + end + + type type_ = :fiat_deposit + + module Type + extend Privy::Internal::Type::Enum + + FIAT_DEPOSIT: :fiat_deposit + + def self?.values: -> ::Array[Privy::Models::BridgeFiatDepositMetadata::type_] + end + end + end +end diff --git a/sig/privy/models/bridge_fiat_rejection_reason.rbs b/sig/privy/models/bridge_fiat_rejection_reason.rbs new file mode 100644 index 0000000..7d182ec --- /dev/null +++ b/sig/privy/models/bridge_fiat_rejection_reason.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type bridge_fiat_rejection_reason = { reason: String } + + class BridgeFiatRejectionReason < Privy::Internal::Type::BaseModel + attr_accessor reason: String + + def initialize: (reason: String) -> void + + def to_hash: -> { reason: String } + end + end +end diff --git a/sig/privy/models/bridge_fiat_transfer_metadata.rbs b/sig/privy/models/bridge_fiat_transfer_metadata.rbs new file mode 100644 index 0000000..da9a46d --- /dev/null +++ b/sig/privy/models/bridge_fiat_transfer_metadata.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type bridge_fiat_transfer_metadata = + { + method_: Privy::Models::BridgeFiatTransferMetadata::method_, + transfer_id: String, + type: Privy::Models::BridgeFiatTransferMetadata::type_ + } + + class BridgeFiatTransferMetadata < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::BridgeFiatTransferMetadata::method_ + + attr_accessor transfer_id: String + + attr_accessor type: Privy::Models::BridgeFiatTransferMetadata::type_ + + def initialize: ( + method_: Privy::Models::BridgeFiatTransferMetadata::method_, + transfer_id: String, + type: Privy::Models::BridgeFiatTransferMetadata::type_ + ) -> void + + def to_hash: -> { + method_: Privy::Models::BridgeFiatTransferMetadata::method_, + transfer_id: String, + type: Privy::Models::BridgeFiatTransferMetadata::type_ + } + + type method_ = :transfer + + module Method + extend Privy::Internal::Type::Enum + + TRANSFER: :transfer + + def self?.values: -> ::Array[Privy::Models::BridgeFiatTransferMetadata::method_] + end + + type type_ = :fiat_deposit + + module Type + extend Privy::Internal::Type::Enum + + FIAT_DEPOSIT: :fiat_deposit + + def self?.values: -> ::Array[Privy::Models::BridgeFiatTransferMetadata::type_] + end + end + end +end diff --git a/sig/privy/models/bridge_fiat_virtual_account_deposit_instructions.rbs b/sig/privy/models/bridge_fiat_virtual_account_deposit_instructions.rbs new file mode 100644 index 0000000..a749b02 --- /dev/null +++ b/sig/privy/models/bridge_fiat_virtual_account_deposit_instructions.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type bridge_fiat_virtual_account_deposit_instructions = + Privy::BridgeUsdFiatVirtualAccountDepositInstructions + | Privy::BridgeEurFiatVirtualAccountDepositInstructions + | Privy::BridgeMxnFiatVirtualAccountDepositInstructions + | Privy::BridgeBrlFiatVirtualAccountDepositInstructions + | Privy::BridgeGbpFiatVirtualAccountDepositInstructions + + module BridgeFiatVirtualAccountDepositInstructions + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::bridge_fiat_virtual_account_deposit_instructions] + end + end +end diff --git a/sig/privy/models/bridge_fiat_virtual_account_destination.rbs b/sig/privy/models/bridge_fiat_virtual_account_destination.rbs new file mode 100644 index 0000000..63a172a --- /dev/null +++ b/sig/privy/models/bridge_fiat_virtual_account_destination.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type bridge_fiat_virtual_account_destination = + { + address: String, + asset: Privy::Models::bridge_destination_asset, + chain: String + } + + class BridgeFiatVirtualAccountDestination < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor asset: Privy::Models::bridge_destination_asset + + attr_accessor chain: String + + def initialize: ( + address: String, + asset: Privy::Models::bridge_destination_asset, + chain: String + ) -> void + + def to_hash: -> { + address: String, + asset: Privy::Models::bridge_destination_asset, + chain: String + } + end + end +end diff --git a/sig/privy/models/bridge_fiat_virtual_account_request.rbs b/sig/privy/models/bridge_fiat_virtual_account_request.rbs new file mode 100644 index 0000000..9165a63 --- /dev/null +++ b/sig/privy/models/bridge_fiat_virtual_account_request.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type bridge_fiat_virtual_account_request = + { + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeFiatVirtualAccountRequest::provider, + source: Privy::BridgeFiatVirtualAccountSource + } + + class BridgeFiatVirtualAccountRequest < Privy::Internal::Type::BaseModel + attr_accessor destination: Privy::BridgeFiatVirtualAccountDestination + + attr_accessor provider: Privy::Models::BridgeFiatVirtualAccountRequest::provider + + attr_accessor source: Privy::BridgeFiatVirtualAccountSource + + def initialize: ( + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeFiatVirtualAccountRequest::provider, + source: Privy::BridgeFiatVirtualAccountSource + ) -> void + + def to_hash: -> { + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeFiatVirtualAccountRequest::provider, + source: Privy::BridgeFiatVirtualAccountSource + } + + type provider = :bridge + + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE: :bridge + + def self?.values: -> ::Array[Privy::Models::BridgeFiatVirtualAccountRequest::provider] + end + end + end +end diff --git a/sig/privy/models/bridge_fiat_virtual_account_response.rbs b/sig/privy/models/bridge_fiat_virtual_account_response.rbs new file mode 100644 index 0000000..94f9fec --- /dev/null +++ b/sig/privy/models/bridge_fiat_virtual_account_response.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type bridge_fiat_virtual_account_response = + { + deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions, + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeFiatVirtualAccountResponse::provider, + status: String + } + + class BridgeFiatVirtualAccountResponse < Privy::Internal::Type::BaseModel + attr_accessor deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions + + attr_accessor destination: Privy::BridgeFiatVirtualAccountDestination + + attr_accessor provider: Privy::Models::BridgeFiatVirtualAccountResponse::provider + + attr_accessor status: String + + def initialize: ( + deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions, + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeFiatVirtualAccountResponse::provider, + status: String + ) -> void + + def to_hash: -> { + deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions, + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeFiatVirtualAccountResponse::provider, + status: String + } + + type provider = :bridge + + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE: :bridge + + def self?.values: -> ::Array[Privy::Models::BridgeFiatVirtualAccountResponse::provider] + end + end + end +end diff --git a/sig/privy/models/bridge_fiat_virtual_account_source.rbs b/sig/privy/models/bridge_fiat_virtual_account_source.rbs new file mode 100644 index 0000000..87d8feb --- /dev/null +++ b/sig/privy/models/bridge_fiat_virtual_account_source.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type bridge_fiat_virtual_account_source = + { asset: Privy::Models::bridge_source_asset } + + class BridgeFiatVirtualAccountSource < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::Models::bridge_source_asset + + def initialize: (asset: Privy::Models::bridge_source_asset) -> void + + def to_hash: -> { asset: Privy::Models::bridge_source_asset } + end + end +end diff --git a/sig/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rbs b/sig/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rbs new file mode 100644 index 0000000..d15f50c --- /dev/null +++ b/sig/privy/models/bridge_gbp_fiat_virtual_account_deposit_instructions.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type bridge_gbp_fiat_virtual_account_deposit_instructions = + { + account_holder_name: String, + account_number: String, + asset: Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + payment_rails: ::Array[Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::payment_rail], + sort_code: String + } + + class BridgeGbpFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + attr_accessor account_holder_name: String + + attr_accessor account_number: String + + attr_accessor asset: Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::asset + + attr_accessor bank_address: String + + attr_accessor bank_name: String + + attr_accessor payment_rails: ::Array[Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::payment_rail] + + attr_accessor sort_code: String + + def initialize: ( + account_holder_name: String, + account_number: String, + asset: Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + payment_rails: ::Array[Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::payment_rail], + sort_code: String + ) -> void + + def to_hash: -> { + account_holder_name: String, + account_number: String, + asset: Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + payment_rails: ::Array[Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::payment_rail], + sort_code: String + } + + type asset = :gbp + + module Asset + extend Privy::Internal::Type::Enum + + GBP: :gbp + + def self?.values: -> ::Array[Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::asset] + end + + type payment_rail = :faster_payments + + module PaymentRail + extend Privy::Internal::Type::Enum + + FASTER_PAYMENTS: :faster_payments + + def self?.values: -> ::Array[Privy::Models::BridgeGbpFiatVirtualAccountDepositInstructions::payment_rail] + end + end + end +end diff --git a/sig/privy/models/bridge_metadata.rbs b/sig/privy/models/bridge_metadata.rbs new file mode 100644 index 0000000..afd5753 --- /dev/null +++ b/sig/privy/models/bridge_metadata.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type bridge_metadata = + Privy::BridgeCryptoDepositMetadata + | Privy::BridgeRefundMetadata + | Privy::BridgeFiatDepositMetadata + | Privy::BridgeCryptoTransferMetadata + | Privy::BridgeFiatTransferMetadata + | Privy::BridgeTransferRefundMetadata + | Privy::BridgeStaticMemoDepositMetadata + + module BridgeMetadata + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::bridge_metadata] + end + end +end diff --git a/sig/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rbs b/sig/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rbs new file mode 100644 index 0000000..d6e4eae --- /dev/null +++ b/sig/privy/models/bridge_mxn_fiat_virtual_account_deposit_instructions.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type bridge_mxn_fiat_virtual_account_deposit_instructions = + { + account_holder_name: String, + asset: Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + clabe: String, + payment_rails: ::Array[Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::payment_rail] + } + + class BridgeMxnFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + attr_accessor account_holder_name: String + + attr_accessor asset: Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::asset + + attr_accessor bank_address: String + + attr_accessor bank_name: String + + attr_accessor clabe: String + + attr_accessor payment_rails: ::Array[Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::payment_rail] + + def initialize: ( + account_holder_name: String, + asset: Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + clabe: String, + payment_rails: ::Array[Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::payment_rail] + ) -> void + + def to_hash: -> { + account_holder_name: String, + asset: Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::asset, + bank_address: String, + bank_name: String, + clabe: String, + payment_rails: ::Array[Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::payment_rail] + } + + type asset = :mxn + + module Asset + extend Privy::Internal::Type::Enum + + MXN: :mxn + + def self?.values: -> ::Array[Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::asset] + end + + type payment_rail = :spei + + module PaymentRail + extend Privy::Internal::Type::Enum + + SPEI: :spei + + def self?.values: -> ::Array[Privy::Models::BridgeMxnFiatVirtualAccountDepositInstructions::payment_rail] + end + end + end +end diff --git a/sig/privy/models/bridge_onramp_provider.rbs b/sig/privy/models/bridge_onramp_provider.rbs new file mode 100644 index 0000000..466bb85 --- /dev/null +++ b/sig/privy/models/bridge_onramp_provider.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type bridge_onramp_provider = :bridge | :"bridge-sandbox" + + module BridgeOnrampProvider + extend Privy::Internal::Type::Enum + + BRIDGE: :bridge + BRIDGE_SANDBOX: :"bridge-sandbox" + + def self?.values: -> ::Array[Privy::Models::bridge_onramp_provider] + end + end +end diff --git a/sig/privy/models/bridge_refund_metadata.rbs b/sig/privy/models/bridge_refund_metadata.rbs new file mode 100644 index 0000000..d21411d --- /dev/null +++ b/sig/privy/models/bridge_refund_metadata.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type bridge_refund_metadata = + { + drain_id: String, + liquidation_address_id: String, + method_: Privy::Models::BridgeRefundMetadata::method_, + original_transaction_hash: String, + type: Privy::Models::BridgeRefundMetadata::type_ + } + + class BridgeRefundMetadata < Privy::Internal::Type::BaseModel + attr_accessor drain_id: String + + attr_accessor liquidation_address_id: String + + attr_accessor method_: Privy::Models::BridgeRefundMetadata::method_ + + attr_accessor original_transaction_hash: String + + attr_accessor type: Privy::Models::BridgeRefundMetadata::type_ + + def initialize: ( + drain_id: String, + liquidation_address_id: String, + method_: Privy::Models::BridgeRefundMetadata::method_, + original_transaction_hash: String, + type: Privy::Models::BridgeRefundMetadata::type_ + ) -> void + + def to_hash: -> { + drain_id: String, + liquidation_address_id: String, + method_: Privy::Models::BridgeRefundMetadata::method_, + original_transaction_hash: String, + type: Privy::Models::BridgeRefundMetadata::type_ + } + + type method_ = :liquidation_address + + module Method + extend Privy::Internal::Type::Enum + + LIQUIDATION_ADDRESS: :liquidation_address + + def self?.values: -> ::Array[Privy::Models::BridgeRefundMetadata::method_] + end + + type type_ = :refund + + module Type + extend Privy::Internal::Type::Enum + + REFUND: :refund + + def self?.values: -> ::Array[Privy::Models::BridgeRefundMetadata::type_] + end + end + end +end diff --git a/sig/privy/models/bridge_sandbox_fiat_customer_response.rbs b/sig/privy/models/bridge_sandbox_fiat_customer_response.rbs new file mode 100644 index 0000000..dbf2c64 --- /dev/null +++ b/sig/privy/models/bridge_sandbox_fiat_customer_response.rbs @@ -0,0 +1,85 @@ +module Privy + module Models + type bridge_sandbox_fiat_customer_response = + { + has_accepted_terms: bool, + provider: Privy::Models::BridgeSandboxFiatCustomerResponse::provider, + status: Privy::Models::BridgeSandboxFiatCustomerResponse::status, + kyc_url: String, + rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason] + } + + class BridgeSandboxFiatCustomerResponse < Privy::Internal::Type::BaseModel + attr_accessor has_accepted_terms: bool + + attr_accessor provider: Privy::Models::BridgeSandboxFiatCustomerResponse::provider + + attr_accessor status: Privy::Models::BridgeSandboxFiatCustomerResponse::status + + attr_reader kyc_url: String? + + def kyc_url=: (String) -> String + + attr_reader rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason]? + + def rejection_reasons=: ( + ::Array[Privy::BridgeFiatRejectionReason] + ) -> ::Array[Privy::BridgeFiatRejectionReason] + + def initialize: ( + has_accepted_terms: bool, + provider: Privy::Models::BridgeSandboxFiatCustomerResponse::provider, + status: Privy::Models::BridgeSandboxFiatCustomerResponse::status, + ?kyc_url: String, + ?rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason] + ) -> void + + def to_hash: -> { + has_accepted_terms: bool, + provider: Privy::Models::BridgeSandboxFiatCustomerResponse::provider, + status: Privy::Models::BridgeSandboxFiatCustomerResponse::status, + kyc_url: String, + rejection_reasons: ::Array[Privy::BridgeFiatRejectionReason] + } + + type provider = :"bridge-sandbox" + + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE_SANDBOX: :"bridge-sandbox" + + def self?.values: -> ::Array[Privy::Models::BridgeSandboxFiatCustomerResponse::provider] + end + + type status = + :not_found + | :active + | :awaiting_questionnaire + | :awaiting_ubo + | :incomplete + | :not_started + | :offboarded + | :paused + | :rejected + | :under_review + + module Status + extend Privy::Internal::Type::Enum + + NOT_FOUND: :not_found + ACTIVE: :active + AWAITING_QUESTIONNAIRE: :awaiting_questionnaire + AWAITING_UBO: :awaiting_ubo + INCOMPLETE: :incomplete + NOT_STARTED: :not_started + OFFBOARDED: :offboarded + PAUSED: :paused + REJECTED: :rejected + UNDER_REVIEW: :under_review + + def self?.values: -> ::Array[Privy::Models::BridgeSandboxFiatCustomerResponse::status] + end + end + end +end diff --git a/sig/privy/models/bridge_sandbox_fiat_virtual_account_request.rbs b/sig/privy/models/bridge_sandbox_fiat_virtual_account_request.rbs new file mode 100644 index 0000000..59d9ffb --- /dev/null +++ b/sig/privy/models/bridge_sandbox_fiat_virtual_account_request.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type bridge_sandbox_fiat_virtual_account_request = + { + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeSandboxFiatVirtualAccountRequest::provider, + source: Privy::BridgeFiatVirtualAccountSource + } + + class BridgeSandboxFiatVirtualAccountRequest < Privy::Internal::Type::BaseModel + attr_accessor destination: Privy::BridgeFiatVirtualAccountDestination + + attr_accessor provider: Privy::Models::BridgeSandboxFiatVirtualAccountRequest::provider + + attr_accessor source: Privy::BridgeFiatVirtualAccountSource + + def initialize: ( + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeSandboxFiatVirtualAccountRequest::provider, + source: Privy::BridgeFiatVirtualAccountSource + ) -> void + + def to_hash: -> { + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeSandboxFiatVirtualAccountRequest::provider, + source: Privy::BridgeFiatVirtualAccountSource + } + + type provider = :"bridge-sandbox" + + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE_SANDBOX: :"bridge-sandbox" + + def self?.values: -> ::Array[Privy::Models::BridgeSandboxFiatVirtualAccountRequest::provider] + end + end + end +end diff --git a/sig/privy/models/bridge_sandbox_fiat_virtual_account_response.rbs b/sig/privy/models/bridge_sandbox_fiat_virtual_account_response.rbs new file mode 100644 index 0000000..7a46c1f --- /dev/null +++ b/sig/privy/models/bridge_sandbox_fiat_virtual_account_response.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type bridge_sandbox_fiat_virtual_account_response = + { + deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions, + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeSandboxFiatVirtualAccountResponse::provider, + status: String + } + + class BridgeSandboxFiatVirtualAccountResponse < Privy::Internal::Type::BaseModel + attr_accessor deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions + + attr_accessor destination: Privy::BridgeFiatVirtualAccountDestination + + attr_accessor provider: Privy::Models::BridgeSandboxFiatVirtualAccountResponse::provider + + attr_accessor status: String + + def initialize: ( + deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions, + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeSandboxFiatVirtualAccountResponse::provider, + status: String + ) -> void + + def to_hash: -> { + deposit_instructions: Privy::Models::bridge_fiat_virtual_account_deposit_instructions, + destination: Privy::BridgeFiatVirtualAccountDestination, + provider: Privy::Models::BridgeSandboxFiatVirtualAccountResponse::provider, + status: String + } + + type provider = :"bridge-sandbox" + + module Provider + extend Privy::Internal::Type::Enum + + BRIDGE_SANDBOX: :"bridge-sandbox" + + def self?.values: -> ::Array[Privy::Models::BridgeSandboxFiatVirtualAccountResponse::provider] + end + end + end +end diff --git a/sig/privy/models/bridge_source_asset.rbs b/sig/privy/models/bridge_source_asset.rbs new file mode 100644 index 0000000..c68a4c8 --- /dev/null +++ b/sig/privy/models/bridge_source_asset.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type bridge_source_asset = :usd | :eur | :mxn | :brl | :gbp + + module BridgeSourceAsset + extend Privy::Internal::Type::Enum + + USD: :usd + EUR: :eur + MXN: :mxn + BRL: :brl + GBP: :gbp + + def self?.values: -> ::Array[Privy::Models::bridge_source_asset] + end + end +end diff --git a/sig/privy/models/bridge_static_memo_deposit_metadata.rbs b/sig/privy/models/bridge_static_memo_deposit_metadata.rbs new file mode 100644 index 0000000..54d8602 --- /dev/null +++ b/sig/privy/models/bridge_static_memo_deposit_metadata.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type bridge_static_memo_deposit_metadata = + { + method_: Privy::Models::BridgeStaticMemoDepositMetadata::method_, + static_memo_event_id: String, + static_memo_id: String, + type: Privy::Models::BridgeStaticMemoDepositMetadata::type_ + } + + class BridgeStaticMemoDepositMetadata < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::BridgeStaticMemoDepositMetadata::method_ + + attr_accessor static_memo_event_id: String + + attr_accessor static_memo_id: String + + attr_accessor type: Privy::Models::BridgeStaticMemoDepositMetadata::type_ + + def initialize: ( + method_: Privy::Models::BridgeStaticMemoDepositMetadata::method_, + static_memo_event_id: String, + static_memo_id: String, + type: Privy::Models::BridgeStaticMemoDepositMetadata::type_ + ) -> void + + def to_hash: -> { + method_: Privy::Models::BridgeStaticMemoDepositMetadata::method_, + static_memo_event_id: String, + static_memo_id: String, + type: Privy::Models::BridgeStaticMemoDepositMetadata::type_ + } + + type method_ = :static_memo + + module Method + extend Privy::Internal::Type::Enum + + STATIC_MEMO: :static_memo + + def self?.values: -> ::Array[Privy::Models::BridgeStaticMemoDepositMetadata::method_] + end + + type type_ = :fiat_deposit + + module Type + extend Privy::Internal::Type::Enum + + FIAT_DEPOSIT: :fiat_deposit + + def self?.values: -> ::Array[Privy::Models::BridgeStaticMemoDepositMetadata::type_] + end + end + end +end diff --git a/sig/privy/models/bridge_transfer_refund_metadata.rbs b/sig/privy/models/bridge_transfer_refund_metadata.rbs new file mode 100644 index 0000000..f2fb250 --- /dev/null +++ b/sig/privy/models/bridge_transfer_refund_metadata.rbs @@ -0,0 +1,57 @@ +module Privy + module Models + type bridge_transfer_refund_metadata = + { + method_: Privy::Models::BridgeTransferRefundMetadata::method_, + transfer_id: String, + type: Privy::Models::BridgeTransferRefundMetadata::type_, + original_transaction_hash: String + } + + class BridgeTransferRefundMetadata < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::BridgeTransferRefundMetadata::method_ + + attr_accessor transfer_id: String + + attr_accessor type: Privy::Models::BridgeTransferRefundMetadata::type_ + + attr_reader original_transaction_hash: String? + + def original_transaction_hash=: (String) -> String + + def initialize: ( + method_: Privy::Models::BridgeTransferRefundMetadata::method_, + transfer_id: String, + type: Privy::Models::BridgeTransferRefundMetadata::type_, + ?original_transaction_hash: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::BridgeTransferRefundMetadata::method_, + transfer_id: String, + type: Privy::Models::BridgeTransferRefundMetadata::type_, + original_transaction_hash: String + } + + type method_ = :transfer + + module Method + extend Privy::Internal::Type::Enum + + TRANSFER: :transfer + + def self?.values: -> ::Array[Privy::Models::BridgeTransferRefundMetadata::method_] + end + + type type_ = :refund + + module Type + extend Privy::Internal::Type::Enum + + REFUND: :refund + + def self?.values: -> ::Array[Privy::Models::BridgeTransferRefundMetadata::type_] + end + end + end +end diff --git a/sig/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rbs b/sig/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rbs new file mode 100644 index 0000000..b2a691f --- /dev/null +++ b/sig/privy/models/bridge_usd_fiat_virtual_account_deposit_instructions.rbs @@ -0,0 +1,76 @@ +module Privy + module Models + type bridge_usd_fiat_virtual_account_deposit_instructions = + { + asset: Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::asset, + bank_account_number: String, + bank_address: String, + bank_beneficiary_address: String, + bank_beneficiary_name: String, + bank_name: String, + bank_routing_number: String, + payment_rails: ::Array[Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::payment_rail] + } + + class BridgeUsdFiatVirtualAccountDepositInstructions < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::asset + + attr_accessor bank_account_number: String + + attr_accessor bank_address: String + + attr_accessor bank_beneficiary_address: String + + attr_accessor bank_beneficiary_name: String + + attr_accessor bank_name: String + + attr_accessor bank_routing_number: String + + attr_accessor payment_rails: ::Array[Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::payment_rail] + + def initialize: ( + asset: Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::asset, + bank_account_number: String, + bank_address: String, + bank_beneficiary_address: String, + bank_beneficiary_name: String, + bank_name: String, + bank_routing_number: String, + payment_rails: ::Array[Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::payment_rail] + ) -> void + + def to_hash: -> { + asset: Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::asset, + bank_account_number: String, + bank_address: String, + bank_beneficiary_address: String, + bank_beneficiary_name: String, + bank_name: String, + bank_routing_number: String, + payment_rails: ::Array[Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::payment_rail] + } + + type asset = :usd + + module Asset + extend Privy::Internal::Type::Enum + + USD: :usd + + def self?.values: -> ::Array[Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::asset] + end + + type payment_rail = :ach_push | :wire + + module PaymentRail + extend Privy::Internal::Type::Enum + + ACH_PUSH: :ach_push + WIRE: :wire + + def self?.values: -> ::Array[Privy::Models::BridgeUsdFiatVirtualAccountDepositInstructions::payment_rail] + end + end + end +end diff --git a/sig/privy/models/caip_2.rbs b/sig/privy/models/caip_2.rbs new file mode 100644 index 0000000..6b54896 --- /dev/null +++ b/sig/privy/models/caip_2.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class Caip2 = String + end +end diff --git a/sig/privy/models/caip_2_chain_id.rbs b/sig/privy/models/caip_2_chain_id.rbs new file mode 100644 index 0000000..349ba7c --- /dev/null +++ b/sig/privy/models/caip_2_chain_id.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class Caip2ChainID = String + end +end diff --git a/sig/privy/models/coinbase_blockchain.rbs b/sig/privy/models/coinbase_blockchain.rbs new file mode 100644 index 0000000..bce5f8c --- /dev/null +++ b/sig/privy/models/coinbase_blockchain.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type coinbase_blockchain = + :ethereum + | :bitcoin + | :base + | :avacchain + | :optimism + | :solana + | :polygon + | :arbitrum + | :stellar + | :monad + + module CoinbaseBlockchain + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + BITCOIN: :bitcoin + BASE: :base + AVACCHAIN: :avacchain + OPTIMISM: :optimism + SOLANA: :solana + POLYGON: :polygon + ARBITRUM: :arbitrum + STELLAR: :stellar + MONAD: :monad + + def self?.values: -> ::Array[Privy::Models::coinbase_blockchain] + end + end +end diff --git a/sig/privy/models/coinbase_ethereum_asset.rbs b/sig/privy/models/coinbase_ethereum_asset.rbs new file mode 100644 index 0000000..408814c --- /dev/null +++ b/sig/privy/models/coinbase_ethereum_asset.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type coinbase_ethereum_asset = :eth | :ETH | :USDC | :POL | :MON + + module CoinbaseEthereumAsset + extend Privy::Internal::Type::Enum + + ETH: :eth + ETH_2: :ETH + USDC: :USDC + POL: :POL + MON: :MON + + def self?.values: -> ::Array[Privy::Models::coinbase_ethereum_asset] + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_ethereum_address.rbs b/sig/privy/models/coinbase_on_ramp_ethereum_address.rbs new file mode 100644 index 0000000..b9b9cd8 --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_ethereum_address.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + type coinbase_on_ramp_ethereum_address = + { + address: String, + blockchains: ::Array[Privy::Models::coinbase_blockchain] + } + + class CoinbaseOnRampEthereumAddress < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor blockchains: ::Array[Privy::Models::coinbase_blockchain] + + def initialize: ( + address: String, + blockchains: ::Array[Privy::Models::coinbase_blockchain] + ) -> void + + def to_hash: -> { + address: String, + blockchains: ::Array[Privy::Models::coinbase_blockchain] + } + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_init_ethereum_input.rbs b/sig/privy/models/coinbase_on_ramp_init_ethereum_input.rbs new file mode 100644 index 0000000..414a342 --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_init_ethereum_input.rbs @@ -0,0 +1,29 @@ +module Privy + module Models + type coinbase_on_ramp_init_ethereum_input = + { + addresses: ::Array[Privy::CoinbaseOnRampEthereumAddress], + assets: ::Array[Privy::Models::coinbase_ethereum_asset] + } + + class CoinbaseOnRampInitEthereumInput < Privy::Internal::Type::BaseModel + attr_accessor addresses: ::Array[Privy::CoinbaseOnRampEthereumAddress] + + attr_reader assets: ::Array[Privy::Models::coinbase_ethereum_asset]? + + def assets=: ( + ::Array[Privy::Models::coinbase_ethereum_asset] + ) -> ::Array[Privy::Models::coinbase_ethereum_asset] + + def initialize: ( + addresses: ::Array[Privy::CoinbaseOnRampEthereumAddress], + ?assets: ::Array[Privy::Models::coinbase_ethereum_asset] + ) -> void + + def to_hash: -> { + addresses: ::Array[Privy::CoinbaseOnRampEthereumAddress], + assets: ::Array[Privy::Models::coinbase_ethereum_asset] + } + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_init_input.rbs b/sig/privy/models/coinbase_on_ramp_init_input.rbs new file mode 100644 index 0000000..fc1a567 --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_init_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type coinbase_on_ramp_init_input = + Privy::CoinbaseOnRampInitEthereumInput + | Privy::CoinbaseOnRampInitSolanaInput + + module CoinbaseOnRampInitInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::coinbase_on_ramp_init_input] + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_init_response.rbs b/sig/privy/models/coinbase_on_ramp_init_response.rbs new file mode 100644 index 0000000..5e90bc8 --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_init_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type coinbase_on_ramp_init_response = + { + app_id: String, + channel_id: String, + partner_user_id: String, + session_token: String + } + + class CoinbaseOnRampInitResponse < Privy::Internal::Type::BaseModel + attr_accessor app_id: String + + attr_accessor channel_id: String + + attr_accessor partner_user_id: String + + attr_accessor session_token: String + + def initialize: ( + app_id: String, + channel_id: String, + partner_user_id: String, + session_token: String + ) -> void + + def to_hash: -> { + app_id: String, + channel_id: String, + partner_user_id: String, + session_token: String + } + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_init_solana_input.rbs b/sig/privy/models/coinbase_on_ramp_init_solana_input.rbs new file mode 100644 index 0000000..49f76ca --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_init_solana_input.rbs @@ -0,0 +1,29 @@ +module Privy + module Models + type coinbase_on_ramp_init_solana_input = + { + addresses: ::Array[Privy::CoinbaseOnRampSolanaAddress], + assets: ::Array[Privy::Models::coinbase_solana_asset] + } + + class CoinbaseOnRampInitSolanaInput < Privy::Internal::Type::BaseModel + attr_accessor addresses: ::Array[Privy::CoinbaseOnRampSolanaAddress] + + attr_reader assets: ::Array[Privy::Models::coinbase_solana_asset]? + + def assets=: ( + ::Array[Privy::Models::coinbase_solana_asset] + ) -> ::Array[Privy::Models::coinbase_solana_asset] + + def initialize: ( + addresses: ::Array[Privy::CoinbaseOnRampSolanaAddress], + ?assets: ::Array[Privy::Models::coinbase_solana_asset] + ) -> void + + def to_hash: -> { + addresses: ::Array[Privy::CoinbaseOnRampSolanaAddress], + assets: ::Array[Privy::Models::coinbase_solana_asset] + } + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_solana_address.rbs b/sig/privy/models/coinbase_on_ramp_solana_address.rbs new file mode 100644 index 0000000..bae1060 --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_solana_address.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + type coinbase_on_ramp_solana_address = + { + address: String, + blockchains: ::Array[Privy::Models::coinbase_blockchain] + } + + class CoinbaseOnRampSolanaAddress < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor blockchains: ::Array[Privy::Models::coinbase_blockchain] + + def initialize: ( + address: String, + blockchains: ::Array[Privy::Models::coinbase_blockchain] + ) -> void + + def to_hash: -> { + address: String, + blockchains: ::Array[Privy::Models::coinbase_blockchain] + } + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_status.rbs b/sig/privy/models/coinbase_on_ramp_status.rbs new file mode 100644 index 0000000..ed4f4e8 --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_status.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type coinbase_on_ramp_status = :pending | :success | :failure + + module CoinbaseOnRampStatus + extend Privy::Internal::Type::Enum + + PENDING: :pending + SUCCESS: :success + FAILURE: :failure + + def self?.values: -> ::Array[Privy::Models::coinbase_on_ramp_status] + end + end +end diff --git a/sig/privy/models/coinbase_on_ramp_status_response.rbs b/sig/privy/models/coinbase_on_ramp_status_response.rbs new file mode 100644 index 0000000..8c7bb90 --- /dev/null +++ b/sig/privy/models/coinbase_on_ramp_status_response.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type coinbase_on_ramp_status_response = + { status: Privy::Models::coinbase_on_ramp_status } + + class CoinbaseOnRampStatusResponse < Privy::Internal::Type::BaseModel + attr_accessor status: Privy::Models::coinbase_on_ramp_status + + def initialize: (status: Privy::Models::coinbase_on_ramp_status) -> void + + def to_hash: -> { status: Privy::Models::coinbase_on_ramp_status } + end + end +end diff --git a/sig/privy/models/coinbase_solana_asset.rbs b/sig/privy/models/coinbase_solana_asset.rbs new file mode 100644 index 0000000..170c21e --- /dev/null +++ b/sig/privy/models/coinbase_solana_asset.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type coinbase_solana_asset = :SOL | :USDC + + module CoinbaseSolanaAsset + extend Privy::Internal::Type::Enum + + SOL: :SOL + USDC: :USDC + + def self?.values: -> ::Array[Privy::Models::coinbase_solana_asset] + end + end +end diff --git a/sig/privy/models/condition_operator.rbs b/sig/privy/models/condition_operator.rbs new file mode 100644 index 0000000..ec6598f --- /dev/null +++ b/sig/privy/models/condition_operator.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type condition_operator = + :eq | :gt | :gte | :lt | :lte | :in | :in_condition_set + + module ConditionOperator + extend Privy::Internal::Type::Enum + + EQ: :eq + GT: :gt + GTE: :gte + LT: :lt + LTE: :lte + IN: :in + IN_CONDITION_SET: :in_condition_set + + def self?.values: -> ::Array[Privy::Models::condition_operator] + end + end +end diff --git a/sig/privy/models/condition_set.rbs b/sig/privy/models/condition_set.rbs new file mode 100644 index 0000000..413e119 --- /dev/null +++ b/sig/privy/models/condition_set.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type condition_set = + { id: String, created_at: Float, name: String, owner_id: String } + + class ConditionSet < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Float + + attr_accessor name: String + + attr_accessor owner_id: String + + def initialize: ( + id: String, + created_at: Float, + name: String, + owner_id: String + ) -> void + + def to_hash: -> { + id: String, + created_at: Float, + name: String, + owner_id: String + } + end + end +end diff --git a/sig/privy/models/condition_set_authorization_headers.rbs b/sig/privy/models/condition_set_authorization_headers.rbs new file mode 100644 index 0000000..df01b7a --- /dev/null +++ b/sig/privy/models/condition_set_authorization_headers.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type condition_set_authorization_headers = + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + + class ConditionSetAuthorizationHeaders < Privy::Internal::Type::BaseModel + attr_accessor privy_app_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + privy_app_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String + ) -> void + + def to_hash: -> { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + end + end +end diff --git a/sig/privy/models/condition_set_item.rbs b/sig/privy/models/condition_set_item.rbs new file mode 100644 index 0000000..b942f2b --- /dev/null +++ b/sig/privy/models/condition_set_item.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type condition_set_item = + { id: String, condition_set_id: String, created_at: Float, value: String } + + class ConditionSetItem < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor condition_set_id: String + + attr_accessor created_at: Float + + attr_accessor value: String + + def initialize: ( + id: String, + condition_set_id: String, + created_at: Float, + value: String + ) -> void + + def to_hash: -> { + id: String, + condition_set_id: String, + created_at: Float, + value: String + } + end + end +end diff --git a/sig/privy/models/condition_set_item_request_params.rbs b/sig/privy/models/condition_set_item_request_params.rbs new file mode 100644 index 0000000..f4d4e8e --- /dev/null +++ b/sig/privy/models/condition_set_item_request_params.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type condition_set_item_request_params = + { condition_set_id: String, condition_set_item_id: String } + + class ConditionSetItemRequestParams < Privy::Internal::Type::BaseModel + attr_accessor condition_set_id: String + + attr_accessor condition_set_item_id: String + + def initialize: ( + condition_set_id: String, + condition_set_item_id: String + ) -> void + + def to_hash: -> { + condition_set_id: String, + condition_set_item_id: String + } + end + end +end diff --git a/sig/privy/models/condition_set_item_value_input.rbs b/sig/privy/models/condition_set_item_value_input.rbs new file mode 100644 index 0000000..e2bce7b --- /dev/null +++ b/sig/privy/models/condition_set_item_value_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type condition_set_item_value_input = { value: String } + + class ConditionSetItemValueInput < Privy::Internal::Type::BaseModel + attr_accessor value: String + + def initialize: (value: String) -> void + + def to_hash: -> { value: String } + end + end +end diff --git a/sig/privy/models/condition_set_items.rbs b/sig/privy/models/condition_set_items.rbs new file mode 100644 index 0000000..ec16d61 --- /dev/null +++ b/sig/privy/models/condition_set_items.rbs @@ -0,0 +1,7 @@ +module Privy + module Models + type condition_set_items = ::Array[Privy::ConditionSetItem] + + ConditionSetItems: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/condition_set_items_request_body.rbs b/sig/privy/models/condition_set_items_request_body.rbs new file mode 100644 index 0000000..0702e02 --- /dev/null +++ b/sig/privy/models/condition_set_items_request_body.rbs @@ -0,0 +1,8 @@ +module Privy + module Models + type condition_set_items_request_body = + ::Array[Privy::ConditionSetItemValueInput] + + ConditionSetItemsRequestBody: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/condition_set_items_response.rbs b/sig/privy/models/condition_set_items_response.rbs new file mode 100644 index 0000000..5a423cf --- /dev/null +++ b/sig/privy/models/condition_set_items_response.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type condition_set_items_response = + { items: ::Array[Privy::ConditionSetItem], next_cursor: String? } + + class ConditionSetItemsResponse < Privy::Internal::Type::BaseModel + attr_accessor items: ::Array[Privy::ConditionSetItem] + + attr_accessor next_cursor: String? + + def initialize: ( + items: ::Array[Privy::ConditionSetItem], + next_cursor: String? + ) -> void + + def to_hash: -> { + items: ::Array[Privy::ConditionSetItem], + next_cursor: String? + } + end + end +end diff --git a/sig/privy/models/condition_set_request_body.rbs b/sig/privy/models/condition_set_request_body.rbs new file mode 100644 index 0000000..e00750b --- /dev/null +++ b/sig/privy/models/condition_set_request_body.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type condition_set_request_body = + { name: String, owner: Privy::Models::owner_input?, owner_id: String? } + + class ConditionSetRequestBody < Privy::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + def initialize: ( + name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String? + ) -> void + + def to_hash: -> { + name: String, + owner: Privy::Models::owner_input?, + owner_id: String? + } + end + end +end diff --git a/sig/privy/models/condition_set_request_params.rbs b/sig/privy/models/condition_set_request_params.rbs new file mode 100644 index 0000000..4493c0a --- /dev/null +++ b/sig/privy/models/condition_set_request_params.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type condition_set_request_params = { condition_set_id: String } + + class ConditionSetRequestParams < Privy::Internal::Type::BaseModel + attr_accessor condition_set_id: String + + def initialize: (condition_set_id: String) -> void + + def to_hash: -> { condition_set_id: String } + end + end +end diff --git a/sig/privy/models/condition_value.rbs b/sig/privy/models/condition_value.rbs new file mode 100644 index 0000000..a3ec6b4 --- /dev/null +++ b/sig/privy/models/condition_value.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type condition_value = String | ::Array[String] + + module ConditionValue + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::condition_value] + + StringArray: Privy::Internal::Type::Converter + end + end +end diff --git a/sig/privy/models/create_account_from_wallet_ids_input.rbs b/sig/privy/models/create_account_from_wallet_ids_input.rbs new file mode 100644 index 0000000..35e4293 --- /dev/null +++ b/sig/privy/models/create_account_from_wallet_ids_input.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type create_account_from_wallet_ids_input = + { wallet_ids: Privy::Models::account_wallet_ids, display_name: String } + + class CreateAccountFromWalletIDsInput < Privy::Internal::Type::BaseModel + attr_accessor wallet_ids: Privy::Models::account_wallet_ids + + attr_reader display_name: String? + + def display_name=: (String) -> String + + def initialize: ( + wallet_ids: Privy::Models::account_wallet_ids, + ?display_name: String + ) -> void + + def to_hash: -> { + wallet_ids: Privy::Models::account_wallet_ids, + display_name: String + } + end + end +end diff --git a/sig/privy/models/create_account_from_wallets_configuration_input.rbs b/sig/privy/models/create_account_from_wallets_configuration_input.rbs new file mode 100644 index 0000000..fbac7a3 --- /dev/null +++ b/sig/privy/models/create_account_from_wallets_configuration_input.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type create_account_from_wallets_configuration_input = + { + wallets_configuration: Privy::Models::account_wallets_configuration, + display_name: String + } + + class CreateAccountFromWalletsConfigurationInput < Privy::Internal::Type::BaseModel + attr_accessor wallets_configuration: Privy::Models::account_wallets_configuration + + attr_reader display_name: String? + + def display_name=: (String) -> String + + def initialize: ( + wallets_configuration: Privy::Models::account_wallets_configuration, + ?display_name: String + ) -> void + + def to_hash: -> { + wallets_configuration: Privy::Models::account_wallets_configuration, + display_name: String + } + end + end +end diff --git a/sig/privy/models/create_account_input.rbs b/sig/privy/models/create_account_input.rbs new file mode 100644 index 0000000..7d09345 --- /dev/null +++ b/sig/privy/models/create_account_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type create_account_input = + Privy::CreateAccountFromWalletsConfigurationInput + | Privy::CreateAccountFromWalletIDsInput + + module CreateAccountInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::create_account_input] + end + end +end diff --git a/sig/privy/models/create_or_update_fiat_customer_request_input.rbs b/sig/privy/models/create_or_update_fiat_customer_request_input.rbs new file mode 100644 index 0000000..9551e39 --- /dev/null +++ b/sig/privy/models/create_or_update_fiat_customer_request_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type create_or_update_fiat_customer_request_input = + { + has_accepted_terms: bool, + provider: Privy::Models::onramp_provider, + kyc_redirect_url: String + } + + class CreateOrUpdateFiatCustomerRequestInput < Privy::Internal::Type::BaseModel + attr_accessor has_accepted_terms: bool + + attr_accessor provider: Privy::Models::onramp_provider + + attr_reader kyc_redirect_url: String? + + def kyc_redirect_url=: (String) -> String + + def initialize: ( + has_accepted_terms: bool, + provider: Privy::Models::onramp_provider, + ?kyc_redirect_url: String + ) -> void + + def to_hash: -> { + has_accepted_terms: bool, + provider: Privy::Models::onramp_provider, + kyc_redirect_url: String + } + end + end +end diff --git a/sig/privy/models/create_organization_secret_response.rbs b/sig/privy/models/create_organization_secret_response.rbs new file mode 100644 index 0000000..71a2016 --- /dev/null +++ b/sig/privy/models/create_organization_secret_response.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type create_organization_secret_response = { organization_secret: String } + + class CreateOrganizationSecretResponse < Privy::Models::OrganizationSecretView + def organization_secret: -> String + + def organization_secret=: (String _) -> String + + def initialize: (organization_secret: String) -> void + + def to_hash: -> { organization_secret: String } + end + end +end diff --git a/sig/privy/models/cross_app_connection.rbs b/sig/privy/models/cross_app_connection.rbs new file mode 100644 index 0000000..5bcf562 --- /dev/null +++ b/sig/privy/models/cross_app_connection.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type cross_app_connection = + { + provider_app_custom_api_url: String?, + provider_app_custom_auth_authorize_url: String?, + provider_app_custom_auth_transact_url: String?, + provider_app_icon_url: String?, + provider_app_id: String, + provider_app_name: String, + read_only: bool + } + + class CrossAppConnection < Privy::Internal::Type::BaseModel + attr_accessor provider_app_custom_api_url: String? + + attr_accessor provider_app_custom_auth_authorize_url: String? + + attr_accessor provider_app_custom_auth_transact_url: String? + + attr_accessor provider_app_icon_url: String? + + attr_accessor provider_app_id: String + + attr_accessor provider_app_name: String + + attr_accessor read_only: bool + + def initialize: ( + provider_app_custom_api_url: String?, + provider_app_custom_auth_authorize_url: String?, + provider_app_custom_auth_transact_url: String?, + provider_app_icon_url: String?, + provider_app_id: String, + provider_app_name: String, + read_only: bool + ) -> void + + def to_hash: -> { + provider_app_custom_api_url: String?, + provider_app_custom_auth_authorize_url: String?, + provider_app_custom_auth_transact_url: String?, + provider_app_icon_url: String?, + provider_app_id: String, + provider_app_name: String, + read_only: bool + } + end + end +end diff --git a/sig/privy/models/cross_app_connections_response.rbs b/sig/privy/models/cross_app_connections_response.rbs new file mode 100644 index 0000000..223b995 --- /dev/null +++ b/sig/privy/models/cross_app_connections_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type cross_app_connections_response = + { + connections: ::Array[Privy::CrossAppConnection], + data_classification: Privy::Models::CrossAppConnectionsResponse::data_classification + } + + class CrossAppConnectionsResponse < Privy::Internal::Type::BaseModel + attr_accessor connections: ::Array[Privy::CrossAppConnection] + + attr_accessor data_classification: Privy::Models::CrossAppConnectionsResponse::data_classification + + def initialize: ( + connections: ::Array[Privy::CrossAppConnection], + data_classification: Privy::Models::CrossAppConnectionsResponse::data_classification + ) -> void + + def to_hash: -> { + connections: ::Array[Privy::CrossAppConnection], + data_classification: Privy::Models::CrossAppConnectionsResponse::data_classification + } + + type data_classification = :public + + module DataClassification + extend Privy::Internal::Type::Enum + + PUBLIC: :public + + def self?.values: -> ::Array[Privy::Models::CrossAppConnectionsResponse::data_classification] + end + end + end +end diff --git a/sig/privy/models/cross_app_embedded_wallet.rbs b/sig/privy/models/cross_app_embedded_wallet.rbs new file mode 100644 index 0000000..e28edcd --- /dev/null +++ b/sig/privy/models/cross_app_embedded_wallet.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type cross_app_embedded_wallet = { address: String } + + class CrossAppEmbeddedWallet < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/cross_app_smart_wallet.rbs b/sig/privy/models/cross_app_smart_wallet.rbs new file mode 100644 index 0000000..b78b515 --- /dev/null +++ b/sig/privy/models/cross_app_smart_wallet.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type cross_app_smart_wallet = { address: String } + + class CrossAppSmartWallet < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/crypto_currency_code.rbs b/sig/privy/models/crypto_currency_code.rbs new file mode 100644 index 0000000..7fb64b1 --- /dev/null +++ b/sig/privy/models/crypto_currency_code.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class CryptoCurrencyCode = String + end +end diff --git a/sig/privy/models/currency.rbs b/sig/privy/models/currency.rbs new file mode 100644 index 0000000..cf6c4f3 --- /dev/null +++ b/sig/privy/models/currency.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type currency = { chain: String, asset: Privy::Models::currency_asset } + + class Currency < Privy::Internal::Type::BaseModel + attr_accessor chain: String + + attr_reader asset: Privy::Models::currency_asset? + + def asset=: ( + Privy::Models::currency_asset + ) -> Privy::Models::currency_asset + + def initialize: ( + chain: String, + ?asset: Privy::Models::currency_asset + ) -> void + + def to_hash: -> { chain: String, asset: Privy::Models::currency_asset } + end + end +end diff --git a/sig/privy/models/currency_amount.rbs b/sig/privy/models/currency_amount.rbs new file mode 100644 index 0000000..e3d6983 --- /dev/null +++ b/sig/privy/models/currency_amount.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type currency_amount = + { currency: Privy::Models::CurrencyAmount::currency, value: String } + + class CurrencyAmount < Privy::Internal::Type::BaseModel + attr_accessor currency: Privy::Models::CurrencyAmount::currency + + attr_accessor value: String + + def initialize: ( + currency: Privy::Models::CurrencyAmount::currency, + value: String + ) -> void + + def to_hash: -> { + currency: Privy::Models::CurrencyAmount::currency, + value: String + } + + type currency = :usd + + module Currency + extend Privy::Internal::Type::Enum + + USD: :usd + + def self?.values: -> ::Array[Privy::Models::CurrencyAmount::currency] + end + end + end +end diff --git a/sig/privy/models/currency_asset.rbs b/sig/privy/models/currency_asset.rbs new file mode 100644 index 0000000..76014d8 --- /dev/null +++ b/sig/privy/models/currency_asset.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type currency_asset = :"native-currency" | :USDC + + module CurrencyAsset + extend Privy::Internal::Type::Enum + + NATIVE_CURRENCY: :"native-currency" + USDC: :USDC + + def self?.values: -> ::Array[Privy::Models::currency_asset] + end + end +end diff --git a/sig/privy/models/curve_signing_chain_type.rbs b/sig/privy/models/curve_signing_chain_type.rbs new file mode 100644 index 0000000..91a1b41 --- /dev/null +++ b/sig/privy/models/curve_signing_chain_type.rbs @@ -0,0 +1,36 @@ +module Privy + module Models + type curve_signing_chain_type = + :cosmos + | :stellar + | :sui + | :aptos + | :movement + | :tron + | :"bitcoin-segwit" + | :"bitcoin-taproot" + | :pearl + | :near + | :ton + | :starknet + + module CurveSigningChainType + extend Privy::Internal::Type::Enum + + COSMOS: :cosmos + STELLAR: :stellar + SUI: :sui + APTOS: :aptos + MOVEMENT: :movement + TRON: :tron + BITCOIN_SEGWIT: :"bitcoin-segwit" + BITCOIN_TAPROOT: :"bitcoin-taproot" + PEARL: :pearl + NEAR: :near + TON: :ton + STARKNET: :starknet + + def self?.values: -> ::Array[Privy::Models::curve_signing_chain_type] + end + end +end diff --git a/sig/privy/models/curve_type.rbs b/sig/privy/models/curve_type.rbs new file mode 100644 index 0000000..472d9a0 --- /dev/null +++ b/sig/privy/models/curve_type.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type curve_type = :secp256k1 | :ed25519 | :starknet + + module CurveType + extend Privy::Internal::Type::Enum + + SECP256K1: :secp256k1 + ED25519: :ed25519 + STARKNET: :starknet + + def self?.values: -> ::Array[Privy::Models::curve_type] + end + end +end diff --git a/sig/privy/models/custodial_wallet.rbs b/sig/privy/models/custodial_wallet.rbs new file mode 100644 index 0000000..415e19f --- /dev/null +++ b/sig/privy/models/custodial_wallet.rbs @@ -0,0 +1,56 @@ +module Privy + module Models + type custodial_wallet = + { + id: String, + address: String, + chain_type: Privy::Models::custodial_wallet_chain_type, + custody: Privy::WalletCustodian, + owner_id: String?, + additional_signers: Privy::Models::wallet_additional_signer, + policy_ids: ::Array[String] + } + + class CustodialWallet < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::custodial_wallet_chain_type + + attr_accessor custody: Privy::WalletCustodian + + attr_accessor owner_id: String? + + attr_reader additional_signers: Privy::Models::wallet_additional_signer? + + def additional_signers=: ( + Privy::Models::wallet_additional_signer + ) -> Privy::Models::wallet_additional_signer + + attr_reader policy_ids: ::Array[String]? + + def policy_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + id: String, + address: String, + chain_type: Privy::Models::custodial_wallet_chain_type, + custody: Privy::WalletCustodian, + owner_id: String?, + ?additional_signers: Privy::Models::wallet_additional_signer, + ?policy_ids: ::Array[String] + ) -> void + + def to_hash: -> { + id: String, + address: String, + chain_type: Privy::Models::custodial_wallet_chain_type, + custody: Privy::WalletCustodian, + owner_id: String?, + additional_signers: Privy::Models::wallet_additional_signer, + policy_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/custodial_wallet_chain_type.rbs b/sig/privy/models/custodial_wallet_chain_type.rbs new file mode 100644 index 0000000..822ba2f --- /dev/null +++ b/sig/privy/models/custodial_wallet_chain_type.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type custodial_wallet_chain_type = :ethereum | :solana + + module CustodialWalletChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::custodial_wallet_chain_type] + end + end +end diff --git a/sig/privy/models/custodial_wallet_create_input.rbs b/sig/privy/models/custodial_wallet_create_input.rbs new file mode 100644 index 0000000..1b6641c --- /dev/null +++ b/sig/privy/models/custodial_wallet_create_input.rbs @@ -0,0 +1,53 @@ +module Privy + module Models + type custodial_wallet_create_input = + { + chain_type: Privy::Models::custodial_wallet_chain_type, + provider: Privy::Models::custodial_wallet_provider, + provider_user_id: String, + additional_signers: Privy::Models::additional_signer_input, + owner: Privy::Models::owner_input?, + policy_ids: Privy::Models::policy_input + } + + class CustodialWalletCreateInput < Privy::Internal::Type::BaseModel + attr_accessor chain_type: Privy::Models::custodial_wallet_chain_type + + attr_accessor provider: Privy::Models::custodial_wallet_provider + + attr_accessor provider_user_id: String + + attr_reader additional_signers: Privy::Models::additional_signer_input? + + def additional_signers=: ( + Privy::Models::additional_signer_input + ) -> Privy::Models::additional_signer_input + + attr_accessor owner: Privy::Models::owner_input? + + attr_reader policy_ids: Privy::Models::policy_input? + + def policy_ids=: ( + Privy::Models::policy_input + ) -> Privy::Models::policy_input + + def initialize: ( + chain_type: Privy::Models::custodial_wallet_chain_type, + provider: Privy::Models::custodial_wallet_provider, + provider_user_id: String, + ?additional_signers: Privy::Models::additional_signer_input, + ?owner: Privy::Models::owner_input?, + ?policy_ids: Privy::Models::policy_input + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::custodial_wallet_chain_type, + provider: Privy::Models::custodial_wallet_provider, + provider_user_id: String, + additional_signers: Privy::Models::additional_signer_input, + owner: Privy::Models::owner_input?, + policy_ids: Privy::Models::policy_input + } + end + end +end diff --git a/sig/privy/models/custodial_wallet_provider.rbs b/sig/privy/models/custodial_wallet_provider.rbs new file mode 100644 index 0000000..184d1ae --- /dev/null +++ b/sig/privy/models/custodial_wallet_provider.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type custodial_wallet_provider = :bridge + + module CustodialWalletProvider + extend Privy::Internal::Type::Enum + + BRIDGE: :bridge + + def self?.values: -> ::Array[Privy::Models::custodial_wallet_provider] + end + end +end diff --git a/sig/privy/models/custom_jwt_authenticate_request_body.rbs b/sig/privy/models/custom_jwt_authenticate_request_body.rbs new file mode 100644 index 0000000..6e7ff8d --- /dev/null +++ b/sig/privy/models/custom_jwt_authenticate_request_body.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type custom_jwt_authenticate_request_body = + { token: String, mode: Privy::Models::authenticate_mode_option } + + class CustomJwtAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + ?token: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + token: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/custom_jwt_link_request_body.rbs b/sig/privy/models/custom_jwt_link_request_body.rbs new file mode 100644 index 0000000..59d2182 --- /dev/null +++ b/sig/privy/models/custom_jwt_link_request_body.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type custom_jwt_link_request_body = { token: String } + + class CustomJwtLinkRequestBody < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + def initialize: (?token: String) -> void + + def to_hash: -> { token: String } + end + end +end diff --git a/sig/privy/models/custom_metadata.rbs b/sig/privy/models/custom_metadata.rbs new file mode 100644 index 0000000..b125b72 --- /dev/null +++ b/sig/privy/models/custom_metadata.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type custom_metadata_item = String | Float | bool + + module CustomMetadataItem + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::custom_metadata_item] + end + + type custom_metadata = ::Hash[Symbol, Privy::Models::custom_metadata_item] + + CustomMetadata: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/custom_oauth_provider_id.rbs b/sig/privy/models/custom_oauth_provider_id.rbs new file mode 100644 index 0000000..be13c9e --- /dev/null +++ b/sig/privy/models/custom_oauth_provider_id.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class CustomOAuthProviderID = String + end +end diff --git a/sig/privy/models/custom_token_transfer_source.rbs b/sig/privy/models/custom_token_transfer_source.rbs new file mode 100644 index 0000000..1928b56 --- /dev/null +++ b/sig/privy/models/custom_token_transfer_source.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type custom_token_transfer_source = + { amount: String, asset_address: String, chain: String } + + class CustomTokenTransferSource < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor asset_address: String + + attr_accessor chain: String + + def initialize: ( + amount: String, + asset_address: String, + chain: String + ) -> void + + def to_hash: -> { amount: String, asset_address: String, chain: String } + end + end +end diff --git a/sig/privy/models/earn_asset.rbs b/sig/privy/models/earn_asset.rbs new file mode 100644 index 0000000..d60515a --- /dev/null +++ b/sig/privy/models/earn_asset.rbs @@ -0,0 +1,21 @@ +module Privy + module Models + type earn_asset = { address: String, decimals: Integer, symbol: String } + + class EarnAsset < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor decimals: Integer + + attr_accessor symbol: String + + def initialize: ( + address: String, + decimals: Integer, + symbol: String + ) -> void + + def to_hash: -> { address: String, decimals: Integer, symbol: String } + end + end +end diff --git a/sig/privy/models/earn_deposit_action_response.rbs b/sig/privy/models/earn_deposit_action_response.rbs new file mode 100644 index 0000000..3561bb6 --- /dev/null +++ b/sig/privy/models/earn_deposit_action_response.rbs @@ -0,0 +1,117 @@ +module Privy + module Models + type earn_deposit_action_response = + { + id: String, + asset_address: String, + :caip2 => String, + created_at: Time, + raw_amount: String, + share_amount: String?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnDepositActionResponse::type_, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + class EarnDepositActionResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor created_at: Time + + attr_accessor raw_amount: String + + attr_accessor share_amount: String? + + attr_accessor status: Privy::Models::wallet_action_status + + attr_accessor type: Privy::Models::EarnDepositActionResponse::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + attr_reader steps: ::Array[Privy::Models::wallet_action_step]? + + def steps=: ( + ::Array[Privy::Models::wallet_action_step] + ) -> ::Array[Privy::Models::wallet_action_step] + + def initialize: ( + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: String?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnDepositActionResponse::type_, + vault_address: String, + vault_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer, + ?failure_reason: Privy::FailureReason, + ?steps: ::Array[Privy::Models::wallet_action_step] + ) -> void + + def to_hash: -> { + id: String, + asset_address: String, + :caip2 => String, + created_at: Time, + raw_amount: String, + share_amount: String?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnDepositActionResponse::type_, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + type type_ = :earn_deposit + + module Type + extend Privy::Internal::Type::Enum + + EARN_DEPOSIT: :earn_deposit + + def self?.values: -> ::Array[Privy::Models::EarnDepositActionResponse::type_] + end + end + end +end diff --git a/sig/privy/models/earn_deposit_request_body.rbs b/sig/privy/models/earn_deposit_request_body.rbs new file mode 100644 index 0000000..f4fe254 --- /dev/null +++ b/sig/privy/models/earn_deposit_request_body.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type earn_deposit_request_body = + { vault_id: String, amount: String, raw_amount: String } + + class EarnDepositRequestBody < Privy::Internal::Type::BaseModel + attr_accessor vault_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader raw_amount: String? + + def raw_amount=: (String) -> String + + def initialize: ( + vault_id: String, + ?amount: String, + ?raw_amount: String + ) -> void + + def to_hash: -> { vault_id: String, amount: String, raw_amount: String } + end + end +end diff --git a/sig/privy/models/earn_incentive_claim_action_response.rbs b/sig/privy/models/earn_incentive_claim_action_response.rbs new file mode 100644 index 0000000..2e8a6d6 --- /dev/null +++ b/sig/privy/models/earn_incentive_claim_action_response.rbs @@ -0,0 +1,76 @@ +module Privy + module Models + type earn_incentive_claim_action_response = + { + id: String, + chain: String, + created_at: Time, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnIncentiveClaimActionResponse::type_, + wallet_id: String, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + class EarnIncentiveClaimActionResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor chain: String + + attr_accessor created_at: Time + + attr_accessor rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]? + + attr_accessor status: Privy::Models::wallet_action_status + + attr_accessor type: Privy::Models::EarnIncentiveClaimActionResponse::type_ + + attr_accessor wallet_id: String + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + attr_reader steps: ::Array[Privy::Models::wallet_action_step]? + + def steps=: ( + ::Array[Privy::Models::wallet_action_step] + ) -> ::Array[Privy::Models::wallet_action_step] + + def initialize: ( + id: String, + chain: String, + created_at: Time, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnIncentiveClaimActionResponse::type_, + wallet_id: String, + ?failure_reason: Privy::FailureReason, + ?steps: ::Array[Privy::Models::wallet_action_step] + ) -> void + + def to_hash: -> { + id: String, + chain: String, + created_at: Time, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnIncentiveClaimActionResponse::type_, + wallet_id: String, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + type type_ = :earn_incentive_claim + + module Type + extend Privy::Internal::Type::Enum + + EARN_INCENTIVE_CLAIM: :earn_incentive_claim + + def self?.values: -> ::Array[Privy::Models::EarnIncentiveClaimActionResponse::type_] + end + end + end +end diff --git a/sig/privy/models/earn_incentive_claim_request_body.rbs b/sig/privy/models/earn_incentive_claim_request_body.rbs new file mode 100644 index 0000000..c1cd3d2 --- /dev/null +++ b/sig/privy/models/earn_incentive_claim_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type earn_incentive_claim_request_body = { chain: String } + + class EarnIncentiveClaimRequestBody < Privy::Internal::Type::BaseModel + attr_accessor chain: String + + def initialize: (chain: String) -> void + + def to_hash: -> { chain: String } + end + end +end diff --git a/sig/privy/models/earn_incetive_claim_reward_entry.rbs b/sig/privy/models/earn_incetive_claim_reward_entry.rbs new file mode 100644 index 0000000..ac32b81 --- /dev/null +++ b/sig/privy/models/earn_incetive_claim_reward_entry.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type earn_incetive_claim_reward_entry = + { + amount: String, + token_address: String, + token_symbol: String, + token_decimals: Integer + } + + class EarnIncetiveClaimRewardEntry < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor token_address: String + + attr_accessor token_symbol: String + + attr_reader token_decimals: Integer? + + def token_decimals=: (Integer) -> Integer + + def initialize: ( + amount: String, + token_address: String, + token_symbol: String, + ?token_decimals: Integer + ) -> void + + def to_hash: -> { + amount: String, + token_address: String, + token_symbol: String, + token_decimals: Integer + } + end + end +end diff --git a/sig/privy/models/earn_withdraw_action_response.rbs b/sig/privy/models/earn_withdraw_action_response.rbs new file mode 100644 index 0000000..731d88c --- /dev/null +++ b/sig/privy/models/earn_withdraw_action_response.rbs @@ -0,0 +1,117 @@ +module Privy + module Models + type earn_withdraw_action_response = + { + id: String, + asset_address: String, + :caip2 => String, + created_at: Time, + raw_amount: String, + share_amount: String?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnWithdrawActionResponse::type_, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + class EarnWithdrawActionResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor created_at: Time + + attr_accessor raw_amount: String + + attr_accessor share_amount: String? + + attr_accessor status: Privy::Models::wallet_action_status + + attr_accessor type: Privy::Models::EarnWithdrawActionResponse::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + attr_reader steps: ::Array[Privy::Models::wallet_action_step]? + + def steps=: ( + ::Array[Privy::Models::wallet_action_step] + ) -> ::Array[Privy::Models::wallet_action_step] + + def initialize: ( + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: String?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnWithdrawActionResponse::type_, + vault_address: String, + vault_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer, + ?failure_reason: Privy::FailureReason, + ?steps: ::Array[Privy::Models::wallet_action_step] + ) -> void + + def to_hash: -> { + id: String, + asset_address: String, + :caip2 => String, + created_at: Time, + raw_amount: String, + share_amount: String?, + status: Privy::Models::wallet_action_status, + type: Privy::Models::EarnWithdrawActionResponse::type_, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + type type_ = :earn_withdraw + + module Type + extend Privy::Internal::Type::Enum + + EARN_WITHDRAW: :earn_withdraw + + def self?.values: -> ::Array[Privy::Models::EarnWithdrawActionResponse::type_] + end + end + end +end diff --git a/sig/privy/models/earn_withdraw_request_body.rbs b/sig/privy/models/earn_withdraw_request_body.rbs new file mode 100644 index 0000000..4d4545e --- /dev/null +++ b/sig/privy/models/earn_withdraw_request_body.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type earn_withdraw_request_body = + { vault_id: String, amount: String, raw_amount: String } + + class EarnWithdrawRequestBody < Privy::Internal::Type::BaseModel + attr_accessor vault_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader raw_amount: String? + + def raw_amount=: (String) -> String + + def initialize: ( + vault_id: String, + ?amount: String, + ?raw_amount: String + ) -> void + + def to_hash: -> { vault_id: String, amount: String, raw_amount: String } + end + end +end diff --git a/sig/privy/models/email_domain.rbs b/sig/privy/models/email_domain.rbs new file mode 100644 index 0000000..cd3931d --- /dev/null +++ b/sig/privy/models/email_domain.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class EmailDomain = String + end +end diff --git a/sig/privy/models/email_domain_invite_input.rbs b/sig/privy/models/email_domain_invite_input.rbs new file mode 100644 index 0000000..2a03840 --- /dev/null +++ b/sig/privy/models/email_domain_invite_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type email_domain_invite_input = + { type: Privy::Models::EmailDomainInviteInput::type_, value: String } + + class EmailDomainInviteInput < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::EmailDomainInviteInput::type_ + + attr_accessor value: String + + def initialize: ( + type: Privy::Models::EmailDomainInviteInput::type_, + value: String + ) -> void + + def to_hash: -> { + type: Privy::Models::EmailDomainInviteInput::type_, + value: String + } + + type type_ = :emailDomain + + module Type + extend Privy::Internal::Type::Enum + + EMAIL_DOMAIN: :emailDomain + + def self?.values: -> ::Array[Privy::Models::EmailDomainInviteInput::type_] + end + end + end +end diff --git a/sig/privy/models/email_invite_input.rbs b/sig/privy/models/email_invite_input.rbs new file mode 100644 index 0000000..f3f7fbf --- /dev/null +++ b/sig/privy/models/email_invite_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type email_invite_input = + { type: Privy::Models::EmailInviteInput::type_, value: String } + + class EmailInviteInput < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::EmailInviteInput::type_ + + attr_accessor value: String + + def initialize: ( + type: Privy::Models::EmailInviteInput::type_, + value: String + ) -> void + + def to_hash: -> { + type: Privy::Models::EmailInviteInput::type_, + value: String + } + + type type_ = :email + + module Type + extend Privy::Internal::Type::Enum + + EMAIL: :email + + def self?.values: -> ::Array[Privy::Models::EmailInviteInput::type_] + end + end + end +end diff --git a/sig/privy/models/embedded_wallet_chain_config.rbs b/sig/privy/models/embedded_wallet_chain_config.rbs new file mode 100644 index 0000000..65879fa --- /dev/null +++ b/sig/privy/models/embedded_wallet_chain_config.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type embedded_wallet_chain_config = + { create_on_login: Privy::Models::embedded_wallet_create_on_login } + + class EmbeddedWalletChainConfig < Privy::Internal::Type::BaseModel + attr_accessor create_on_login: Privy::Models::embedded_wallet_create_on_login + + def initialize: ( + create_on_login: Privy::Models::embedded_wallet_create_on_login + ) -> void + + def to_hash: -> { + create_on_login: Privy::Models::embedded_wallet_create_on_login + } + end + end +end diff --git a/sig/privy/models/embedded_wallet_config_schema.rbs b/sig/privy/models/embedded_wallet_config_schema.rbs new file mode 100644 index 0000000..9a05134 --- /dev/null +++ b/sig/privy/models/embedded_wallet_config_schema.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type embedded_wallet_config_schema = + { mode: Privy::Models::embedded_wallet_mode } + + class EmbeddedWalletConfigSchema < Privy::Models::EmbeddedWalletInputSchema + def mode: -> Privy::Models::embedded_wallet_mode + + def mode=: ( + Privy::Models::embedded_wallet_mode _ + ) -> Privy::Models::embedded_wallet_mode + + def initialize: (mode: Privy::Models::embedded_wallet_mode) -> void + + def to_hash: -> { mode: Privy::Models::embedded_wallet_mode } + end + end +end diff --git a/sig/privy/models/embedded_wallet_create_on_login.rbs b/sig/privy/models/embedded_wallet_create_on_login.rbs new file mode 100644 index 0000000..801a62b --- /dev/null +++ b/sig/privy/models/embedded_wallet_create_on_login.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type embedded_wallet_create_on_login = + :"users-without-wallets" | :"all-users" | :off + + module EmbeddedWalletCreateOnLogin + extend Privy::Internal::Type::Enum + + USERS_WITHOUT_WALLETS: :"users-without-wallets" + ALL_USERS: :"all-users" + OFF: :off + + def self?.values: -> ::Array[Privy::Models::embedded_wallet_create_on_login] + end + end +end diff --git a/sig/privy/models/embedded_wallet_creation_input.rbs b/sig/privy/models/embedded_wallet_creation_input.rbs new file mode 100644 index 0000000..e27222f --- /dev/null +++ b/sig/privy/models/embedded_wallet_creation_input.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type embedded_wallet_creation_input = + { wallets: ::Array[Privy::WalletCreationInput] } + + class EmbeddedWalletCreationInput < Privy::Internal::Type::BaseModel + attr_reader wallets: ::Array[Privy::WalletCreationInput]? + + def wallets=: ( + ::Array[Privy::WalletCreationInput] + ) -> ::Array[Privy::WalletCreationInput] + + def initialize: (?wallets: ::Array[Privy::WalletCreationInput]) -> void + + def to_hash: -> { wallets: ::Array[Privy::WalletCreationInput] } + end + end +end diff --git a/sig/privy/models/embedded_wallet_input_schema.rbs b/sig/privy/models/embedded_wallet_input_schema.rbs new file mode 100644 index 0000000..b5583e7 --- /dev/null +++ b/sig/privy/models/embedded_wallet_input_schema.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type embedded_wallet_input_schema = + { + create_on_login: Privy::Models::embedded_wallet_create_on_login, + ethereum: Privy::EmbeddedWalletChainConfig, + solana: Privy::EmbeddedWalletChainConfig, + user_owned_recovery_options: ::Array[Privy::Models::user_owned_recovery_option], + require_user_owned_recovery_on_create: bool, + require_user_password_on_create: bool + } + + class EmbeddedWalletInputSchema < Privy::Internal::Type::BaseModel + attr_accessor create_on_login: Privy::Models::embedded_wallet_create_on_login + + attr_accessor ethereum: Privy::EmbeddedWalletChainConfig + + attr_accessor solana: Privy::EmbeddedWalletChainConfig + + attr_accessor user_owned_recovery_options: ::Array[Privy::Models::user_owned_recovery_option] + + attr_reader require_user_owned_recovery_on_create: bool? + + def require_user_owned_recovery_on_create=: (bool) -> bool + + attr_reader require_user_password_on_create: bool? + + def require_user_password_on_create=: (bool) -> bool + + def initialize: ( + create_on_login: Privy::Models::embedded_wallet_create_on_login, + ethereum: Privy::EmbeddedWalletChainConfig, + solana: Privy::EmbeddedWalletChainConfig, + user_owned_recovery_options: ::Array[Privy::Models::user_owned_recovery_option], + ?require_user_owned_recovery_on_create: bool, + ?require_user_password_on_create: bool + ) -> void + + def to_hash: -> { + create_on_login: Privy::Models::embedded_wallet_create_on_login, + ethereum: Privy::EmbeddedWalletChainConfig, + solana: Privy::EmbeddedWalletChainConfig, + user_owned_recovery_options: ::Array[Privy::Models::user_owned_recovery_option], + require_user_owned_recovery_on_create: bool, + require_user_password_on_create: bool + } + end + end +end diff --git a/sig/privy/models/embedded_wallet_mode.rbs b/sig/privy/models/embedded_wallet_mode.rbs new file mode 100644 index 0000000..3ccab23 --- /dev/null +++ b/sig/privy/models/embedded_wallet_mode.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type embedded_wallet_mode = + :"legacy-embedded-wallets-only" | :"user-controlled-server-wallets-only" + + module EmbeddedWalletMode + extend Privy::Internal::Type::Enum + + LEGACY_EMBEDDED_WALLETS_ONLY: :"legacy-embedded-wallets-only" + USER_CONTROLLED_SERVER_WALLETS_ONLY: :"user-controlled-server-wallets-only" + + def self?.values: -> ::Array[Privy::Models::embedded_wallet_mode] + end + end +end diff --git a/sig/privy/models/embedded_wallet_recovery_method.rbs b/sig/privy/models/embedded_wallet_recovery_method.rbs new file mode 100644 index 0000000..318464e --- /dev/null +++ b/sig/privy/models/embedded_wallet_recovery_method.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type embedded_wallet_recovery_method = + :privy + | :"user-passcode" + | :"google-drive" + | :icloud + | :"recovery-encryption-key" + | :"privy-v2" + + module EmbeddedWalletRecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY: :privy + USER_PASSCODE: :"user-passcode" + GOOGLE_DRIVE: :"google-drive" + ICLOUD: :icloud + RECOVERY_ENCRYPTION_KEY: :"recovery-encryption-key" + PRIVY_V2: :"privy-v2" + + def self?.values: -> ::Array[Privy::Models::embedded_wallet_recovery_method] + end + end +end diff --git a/sig/privy/models/ethereum_7702_authorization_condition.rbs b/sig/privy/models/ethereum_7702_authorization_condition.rbs new file mode 100644 index 0000000..b396ee9 --- /dev/null +++ b/sig/privy/models/ethereum_7702_authorization_condition.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type ethereum7702_authorization_condition = + { + field: Privy::Models::Ethereum7702AuthorizationCondition::field, + field_source: Privy::Models::Ethereum7702AuthorizationCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class Ethereum7702AuthorizationCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::Ethereum7702AuthorizationCondition::field + + attr_accessor field_source: Privy::Models::Ethereum7702AuthorizationCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::Ethereum7702AuthorizationCondition::field, + field_source: Privy::Models::Ethereum7702AuthorizationCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::Ethereum7702AuthorizationCondition::field, + field_source: Privy::Models::Ethereum7702AuthorizationCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = :contract + + module Field + extend Privy::Internal::Type::Enum + + CONTRACT: :contract + + def self?.values: -> ::Array[Privy::Models::Ethereum7702AuthorizationCondition::field] + end + + type field_source = :ethereum_7702_authorization + + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_7702_AUTHORIZATION: :ethereum_7702_authorization + + def self?.values: -> ::Array[Privy::Models::Ethereum7702AuthorizationCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/ethereum_calldata_condition.rbs b/sig/privy/models/ethereum_calldata_condition.rbs new file mode 100644 index 0000000..8e30659 --- /dev/null +++ b/sig/privy/models/ethereum_calldata_condition.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type ethereum_calldata_condition = + { + abi: Privy::Models::abi_schema, + field: String, + field_source: Privy::Models::EthereumCalldataCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class EthereumCalldataCondition < Privy::Internal::Type::BaseModel + attr_accessor abi: Privy::Models::abi_schema + + attr_accessor field: String + + attr_accessor field_source: Privy::Models::EthereumCalldataCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + abi: Privy::Models::abi_schema, + field: String, + field_source: Privy::Models::EthereumCalldataCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + abi: Privy::Models::abi_schema, + field: String, + field_source: Privy::Models::EthereumCalldataCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field_source = :ethereum_calldata + + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_CALLDATA: :ethereum_calldata + + def self?.values: -> ::Array[Privy::Models::EthereumCalldataCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/ethereum_earn_position_query.rbs b/sig/privy/models/ethereum_earn_position_query.rbs new file mode 100644 index 0000000..8313110 --- /dev/null +++ b/sig/privy/models/ethereum_earn_position_query.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type ethereum_earn_position_query = { vault_id: String } + + class EthereumEarnPositionQuery < Privy::Internal::Type::BaseModel + attr_accessor vault_id: String + + def initialize: (vault_id: String) -> void + + def to_hash: -> { vault_id: String } + end + end +end diff --git a/sig/privy/models/ethereum_earn_position_response.rbs b/sig/privy/models/ethereum_earn_position_response.rbs new file mode 100644 index 0000000..3f458e5 --- /dev/null +++ b/sig/privy/models/ethereum_earn_position_response.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type ethereum_earn_position_response = + { + asset: Privy::EarnAsset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + + class EthereumEarnPositionResponse < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::EarnAsset + + attr_accessor assets_in_vault: String + + attr_accessor shares_in_vault: String + + attr_accessor total_deposited: String + + attr_accessor total_withdrawn: String + + def initialize: ( + asset: Privy::EarnAsset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + ) -> void + + def to_hash: -> { + asset: Privy::EarnAsset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + end + end +end diff --git a/sig/privy/models/ethereum_earn_provider.rbs b/sig/privy/models/ethereum_earn_provider.rbs new file mode 100644 index 0000000..80bfc28 --- /dev/null +++ b/sig/privy/models/ethereum_earn_provider.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type ethereum_earn_provider = :morpho | :aave + + module EthereumEarnProvider + extend Privy::Internal::Type::Enum + + MORPHO: :morpho + AAVE: :aave + + def self?.values: -> ::Array[Privy::Models::ethereum_earn_provider] + end + end +end diff --git a/sig/privy/models/ethereum_earn_vault_details_response.rbs b/sig/privy/models/ethereum_earn_vault_details_response.rbs new file mode 100644 index 0000000..f8335cd --- /dev/null +++ b/sig/privy/models/ethereum_earn_vault_details_response.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type ethereum_earn_vault_details_response = + { + id: String, + app_apy: Float?, + asset: Privy::EarnAsset, + available_liquidity_usd: Float?, + :caip2 => String, + name: String, + provider: Privy::Models::ethereum_earn_provider, + tvl_usd: Float?, + user_apy: Float?, + vault_address: String + } + + class EthereumEarnVaultDetailsResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor app_apy: Float? + + attr_accessor asset: Privy::EarnAsset + + attr_accessor available_liquidity_usd: Float? + + attr_accessor caip2: String + + attr_accessor name: String + + attr_accessor provider: Privy::Models::ethereum_earn_provider + + attr_accessor tvl_usd: Float? + + attr_accessor user_apy: Float? + + attr_accessor vault_address: String + + def initialize: ( + id: String, + app_apy: Float?, + asset: Privy::EarnAsset, + available_liquidity_usd: Float?, + caip2: String, + name: String, + provider: Privy::Models::ethereum_earn_provider, + tvl_usd: Float?, + user_apy: Float?, + vault_address: String + ) -> void + + def to_hash: -> { + id: String, + app_apy: Float?, + asset: Privy::EarnAsset, + available_liquidity_usd: Float?, + :caip2 => String, + name: String, + provider: Privy::Models::ethereum_earn_provider, + tvl_usd: Float?, + user_apy: Float?, + vault_address: String + } + end + end +end diff --git a/sig/privy/models/ethereum_personal_sign_rpc_input.rbs b/sig/privy/models/ethereum_personal_sign_rpc_input.rbs new file mode 100644 index 0000000..027b9e5 --- /dev/null +++ b/sig/privy/models/ethereum_personal_sign_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type ethereum_personal_sign_rpc_input = + { + method_: Privy::Models::EthereumPersonalSignRpcInput::method_, + params: Privy::EthereumPersonalSignRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumPersonalSignRpcInput::chain_type, + wallet_id: String + } + + class EthereumPersonalSignRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::EthereumPersonalSignRpcInput::method_ + + attr_accessor params: Privy::EthereumPersonalSignRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumPersonalSignRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumPersonalSignRpcInput::chain_type + ) -> Privy::Models::EthereumPersonalSignRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::EthereumPersonalSignRpcInput::method_, + params: Privy::EthereumPersonalSignRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumPersonalSignRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::EthereumPersonalSignRpcInput::method_, + params: Privy::EthereumPersonalSignRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumPersonalSignRpcInput::chain_type, + wallet_id: String + } + + type method_ = :personal_sign + + module Method + extend Privy::Internal::Type::Enum + + PERSONAL_SIGN: :personal_sign + + def self?.values: -> ::Array[Privy::Models::EthereumPersonalSignRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumPersonalSignRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_personal_sign_rpc_input_params.rbs b/sig/privy/models/ethereum_personal_sign_rpc_input_params.rbs new file mode 100644 index 0000000..4772a3a --- /dev/null +++ b/sig/privy/models/ethereum_personal_sign_rpc_input_params.rbs @@ -0,0 +1,36 @@ +module Privy + module Models + type ethereum_personal_sign_rpc_input_params = + { + encoding: Privy::Models::EthereumPersonalSignRpcInputParams::encoding, + message: String + } + + class EthereumPersonalSignRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::EthereumPersonalSignRpcInputParams::encoding + + attr_accessor message: String + + def initialize: ( + encoding: Privy::Models::EthereumPersonalSignRpcInputParams::encoding, + message: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::EthereumPersonalSignRpcInputParams::encoding, + message: String + } + + type encoding = :"utf-8" | :hex + + module Encoding + extend Privy::Internal::Type::Enum + + UTF_8: :"utf-8" + HEX: :hex + + def self?.values: -> ::Array[Privy::Models::EthereumPersonalSignRpcInputParams::encoding] + end + end + end +end diff --git a/sig/privy/models/ethereum_personal_sign_rpc_response.rbs b/sig/privy/models/ethereum_personal_sign_rpc_response.rbs new file mode 100644 index 0000000..2c72f67 --- /dev/null +++ b/sig/privy/models/ethereum_personal_sign_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_personal_sign_rpc_response = + { + data: Privy::EthereumPersonalSignRpcResponseData, + method_: Privy::Models::EthereumPersonalSignRpcResponse::method_ + } + + class EthereumPersonalSignRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumPersonalSignRpcResponseData + + attr_accessor method_: Privy::Models::EthereumPersonalSignRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumPersonalSignRpcResponseData, + method_: Privy::Models::EthereumPersonalSignRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumPersonalSignRpcResponseData, + method_: Privy::Models::EthereumPersonalSignRpcResponse::method_ + } + + type method_ = :personal_sign + + module Method + extend Privy::Internal::Type::Enum + + PERSONAL_SIGN: :personal_sign + + def self?.values: -> ::Array[Privy::Models::EthereumPersonalSignRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_personal_sign_rpc_response_data.rbs b/sig/privy/models/ethereum_personal_sign_rpc_response_data.rbs new file mode 100644 index 0000000..2602f8e --- /dev/null +++ b/sig/privy/models/ethereum_personal_sign_rpc_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_personal_sign_rpc_response_data = + { + encoding: Privy::Models::EthereumPersonalSignRpcResponseData::encoding, + signature: String + } + + class EthereumPersonalSignRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::EthereumPersonalSignRpcResponseData::encoding + + attr_accessor signature: String + + def initialize: ( + encoding: Privy::Models::EthereumPersonalSignRpcResponseData::encoding, + signature: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::EthereumPersonalSignRpcResponseData::encoding, + signature: String + } + + type encoding = :hex + + module Encoding + extend Privy::Internal::Type::Enum + + HEX: :hex + + def self?.values: -> ::Array[Privy::Models::EthereumPersonalSignRpcResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/ethereum_rpc_input.rbs b/sig/privy/models/ethereum_rpc_input.rbs new file mode 100644 index 0000000..c598f5c --- /dev/null +++ b/sig/privy/models/ethereum_rpc_input.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type ethereum_rpc_input = + Privy::EthereumSignTransactionRpcInput + | Privy::EthereumSendTransactionRpcInput + | Privy::EthereumPersonalSignRpcInput + | Privy::EthereumSignTypedDataRpcInput + | Privy::EthereumSecp256k1SignRpcInput + | Privy::EthereumSign7702AuthorizationRpcInput + | Privy::EthereumSignUserOperationRpcInput + | Privy::EthereumSendCallsRpcInput + + module EthereumRpcInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::ethereum_rpc_input] + end + end +end diff --git a/sig/privy/models/ethereum_rpc_response.rbs b/sig/privy/models/ethereum_rpc_response.rbs new file mode 100644 index 0000000..450acbd --- /dev/null +++ b/sig/privy/models/ethereum_rpc_response.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type ethereum_rpc_response = + Privy::EthereumPersonalSignRpcResponse + | Privy::EthereumSignTypedDataRpcResponse + | Privy::EthereumSignTransactionRpcResponse + | Privy::EthereumSendTransactionRpcResponse + | Privy::EthereumSignUserOperationRpcResponse + | Privy::EthereumSign7702AuthorizationRpcResponse + | Privy::EthereumSecp256k1SignRpcResponse + | Privy::EthereumSendCallsRpcResponse + + module EthereumRpcResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::ethereum_rpc_response] + end + end +end diff --git a/sig/privy/models/ethereum_secp_256k_1_sign_rpc_input.rbs b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_input.rbs new file mode 100644 index 0000000..61a5608 --- /dev/null +++ b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type ethereum_secp256k1_sign_rpc_input = + { + method_: Privy::Models::EthereumSecp256k1SignRpcInput::method_, + params: Privy::EthereumSecp256k1SignRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSecp256k1SignRpcInput::chain_type, + wallet_id: String + } + + class EthereumSecp256k1SignRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::EthereumSecp256k1SignRpcInput::method_ + + attr_accessor params: Privy::EthereumSecp256k1SignRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumSecp256k1SignRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumSecp256k1SignRpcInput::chain_type + ) -> Privy::Models::EthereumSecp256k1SignRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::EthereumSecp256k1SignRpcInput::method_, + params: Privy::EthereumSecp256k1SignRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumSecp256k1SignRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::EthereumSecp256k1SignRpcInput::method_, + params: Privy::EthereumSecp256k1SignRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSecp256k1SignRpcInput::chain_type, + wallet_id: String + } + + type method_ = :secp256k1_sign + + module Method + extend Privy::Internal::Type::Enum + + SECP256K1_SIGN: :secp256k1_sign + + def self?.values: -> ::Array[Privy::Models::EthereumSecp256k1SignRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumSecp256k1SignRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rbs b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rbs new file mode 100644 index 0000000..51caabe --- /dev/null +++ b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_input_params.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type ethereum_secp256k1_sign_rpc_input_params = { hash_: String } + + class EthereumSecp256k1SignRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor hash_: String + + def initialize: (hash_: String) -> void + + def to_hash: -> { hash_: String } + end + end +end diff --git a/sig/privy/models/ethereum_secp_256k_1_sign_rpc_response.rbs b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_response.rbs new file mode 100644 index 0000000..eeeb624 --- /dev/null +++ b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_secp256k1_sign_rpc_response = + { + data: Privy::EthereumSecp256k1SignRpcResponseData, + method_: Privy::Models::EthereumSecp256k1SignRpcResponse::method_ + } + + class EthereumSecp256k1SignRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumSecp256k1SignRpcResponseData + + attr_accessor method_: Privy::Models::EthereumSecp256k1SignRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumSecp256k1SignRpcResponseData, + method_: Privy::Models::EthereumSecp256k1SignRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumSecp256k1SignRpcResponseData, + method_: Privy::Models::EthereumSecp256k1SignRpcResponse::method_ + } + + type method_ = :secp256k1_sign + + module Method + extend Privy::Internal::Type::Enum + + SECP256K1_SIGN: :secp256k1_sign + + def self?.values: -> ::Array[Privy::Models::EthereumSecp256k1SignRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rbs b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rbs new file mode 100644 index 0000000..95b4afd --- /dev/null +++ b/sig/privy/models/ethereum_secp_256k_1_sign_rpc_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_secp256k1_sign_rpc_response_data = + { + encoding: Privy::Models::EthereumSecp256k1SignRpcResponseData::encoding, + signature: String + } + + class EthereumSecp256k1SignRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::EthereumSecp256k1SignRpcResponseData::encoding + + attr_accessor signature: String + + def initialize: ( + encoding: Privy::Models::EthereumSecp256k1SignRpcResponseData::encoding, + signature: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::EthereumSecp256k1SignRpcResponseData::encoding, + signature: String + } + + type encoding = :hex + + module Encoding + extend Privy::Internal::Type::Enum + + HEX: :hex + + def self?.values: -> ::Array[Privy::Models::EthereumSecp256k1SignRpcResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/ethereum_send_calls_call.rbs b/sig/privy/models/ethereum_send_calls_call.rbs new file mode 100644 index 0000000..d755734 --- /dev/null +++ b/sig/privy/models/ethereum_send_calls_call.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type ethereum_send_calls_call = + { to: String, data: String, value: Privy::Models::quantity } + + class EthereumSendCallsCall < Privy::Internal::Type::BaseModel + attr_accessor to: String + + attr_reader data: String? + + def data=: (String) -> String + + attr_reader value: Privy::Models::quantity? + + def value=: (Privy::Models::quantity) -> Privy::Models::quantity + + def initialize: ( + to: String, + ?data: String, + ?value: Privy::Models::quantity + ) -> void + + def to_hash: -> { + to: String, + data: String, + value: Privy::Models::quantity + } + end + end +end diff --git a/sig/privy/models/ethereum_send_calls_rpc_input.rbs b/sig/privy/models/ethereum_send_calls_rpc_input.rbs new file mode 100644 index 0000000..c101781 --- /dev/null +++ b/sig/privy/models/ethereum_send_calls_rpc_input.rbs @@ -0,0 +1,87 @@ +module Privy + module Models + type ethereum_send_calls_rpc_input = + { + :caip2 => String, + method_: Privy::Models::EthereumSendCallsRpcInput::method_, + params: Privy::EthereumSendCallsRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSendCallsRpcInput::chain_type, + experimental_data_suffix: String, + sponsor: bool, + wallet_id: String + } + + class EthereumSendCallsRpcInput < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor method_: Privy::Models::EthereumSendCallsRpcInput::method_ + + attr_accessor params: Privy::EthereumSendCallsRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumSendCallsRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumSendCallsRpcInput::chain_type + ) -> Privy::Models::EthereumSendCallsRpcInput::chain_type + + attr_reader experimental_data_suffix: String? + + def experimental_data_suffix=: (String) -> String + + attr_reader sponsor: bool? + + def sponsor=: (bool) -> bool + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + caip2: String, + method_: Privy::Models::EthereumSendCallsRpcInput::method_, + params: Privy::EthereumSendCallsRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumSendCallsRpcInput::chain_type, + ?experimental_data_suffix: String, + ?sponsor: bool, + ?wallet_id: String + ) -> void + + def to_hash: -> { + :caip2 => String, + method_: Privy::Models::EthereumSendCallsRpcInput::method_, + params: Privy::EthereumSendCallsRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSendCallsRpcInput::chain_type, + experimental_data_suffix: String, + sponsor: bool, + wallet_id: String + } + + type method_ = :wallet_sendCalls + + module Method + extend Privy::Internal::Type::Enum + + WALLET_SEND_CALLS: :wallet_sendCalls + + def self?.values: -> ::Array[Privy::Models::EthereumSendCallsRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumSendCallsRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_send_calls_rpc_input_params.rbs b/sig/privy/models/ethereum_send_calls_rpc_input_params.rbs new file mode 100644 index 0000000..fef8773 --- /dev/null +++ b/sig/privy/models/ethereum_send_calls_rpc_input_params.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type ethereum_send_calls_rpc_input_params = + { calls: ::Array[Privy::EthereumSendCallsCall] } + + class EthereumSendCallsRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor calls: ::Array[Privy::EthereumSendCallsCall] + + def initialize: (calls: ::Array[Privy::EthereumSendCallsCall]) -> void + + def to_hash: -> { calls: ::Array[Privy::EthereumSendCallsCall] } + end + end +end diff --git a/sig/privy/models/ethereum_send_calls_rpc_response.rbs b/sig/privy/models/ethereum_send_calls_rpc_response.rbs new file mode 100644 index 0000000..ad368f2 --- /dev/null +++ b/sig/privy/models/ethereum_send_calls_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_send_calls_rpc_response = + { + data: Privy::EthereumSendCallsRpcResponseData, + method_: Privy::Models::EthereumSendCallsRpcResponse::method_ + } + + class EthereumSendCallsRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumSendCallsRpcResponseData + + attr_accessor method_: Privy::Models::EthereumSendCallsRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumSendCallsRpcResponseData, + method_: Privy::Models::EthereumSendCallsRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumSendCallsRpcResponseData, + method_: Privy::Models::EthereumSendCallsRpcResponse::method_ + } + + type method_ = :wallet_sendCalls + + module Method + extend Privy::Internal::Type::Enum + + WALLET_SEND_CALLS: :wallet_sendCalls + + def self?.values: -> ::Array[Privy::Models::EthereumSendCallsRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_send_calls_rpc_response_data.rbs b/sig/privy/models/ethereum_send_calls_rpc_response_data.rbs new file mode 100644 index 0000000..e8daf39 --- /dev/null +++ b/sig/privy/models/ethereum_send_calls_rpc_response_data.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type ethereum_send_calls_rpc_response_data = + { :caip2 => String, transaction_id: String } + + class EthereumSendCallsRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_id: String + + def initialize: (caip2: String, transaction_id: String) -> void + + def to_hash: -> { :caip2 => String, transaction_id: String } + end + end +end diff --git a/sig/privy/models/ethereum_send_transaction_rpc_input.rbs b/sig/privy/models/ethereum_send_transaction_rpc_input.rbs new file mode 100644 index 0000000..fa3a38d --- /dev/null +++ b/sig/privy/models/ethereum_send_transaction_rpc_input.rbs @@ -0,0 +1,94 @@ +module Privy + module Models + type ethereum_send_transaction_rpc_input = + { + :caip2 => String, + method_: Privy::Models::EthereumSendTransactionRpcInput::method_, + params: Privy::EthereumSendTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSendTransactionRpcInput::chain_type, + experimental_data_suffix: String, + reference_id: String, + sponsor: bool, + wallet_id: String + } + + class EthereumSendTransactionRpcInput < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor method_: Privy::Models::EthereumSendTransactionRpcInput::method_ + + attr_accessor params: Privy::EthereumSendTransactionRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumSendTransactionRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumSendTransactionRpcInput::chain_type + ) -> Privy::Models::EthereumSendTransactionRpcInput::chain_type + + attr_reader experimental_data_suffix: String? + + def experimental_data_suffix=: (String) -> String + + attr_reader reference_id: String? + + def reference_id=: (String) -> String + + attr_reader sponsor: bool? + + def sponsor=: (bool) -> bool + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + caip2: String, + method_: Privy::Models::EthereumSendTransactionRpcInput::method_, + params: Privy::EthereumSendTransactionRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumSendTransactionRpcInput::chain_type, + ?experimental_data_suffix: String, + ?reference_id: String, + ?sponsor: bool, + ?wallet_id: String + ) -> void + + def to_hash: -> { + :caip2 => String, + method_: Privy::Models::EthereumSendTransactionRpcInput::method_, + params: Privy::EthereumSendTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSendTransactionRpcInput::chain_type, + experimental_data_suffix: String, + reference_id: String, + sponsor: bool, + wallet_id: String + } + + type method_ = :eth_sendTransaction + + module Method + extend Privy::Internal::Type::Enum + + ETH_SEND_TRANSACTION: :eth_sendTransaction + + def self?.values: -> ::Array[Privy::Models::EthereumSendTransactionRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumSendTransactionRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_send_transaction_rpc_input_params.rbs b/sig/privy/models/ethereum_send_transaction_rpc_input_params.rbs new file mode 100644 index 0000000..2a7af5a --- /dev/null +++ b/sig/privy/models/ethereum_send_transaction_rpc_input_params.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type ethereum_send_transaction_rpc_input_params = + { transaction: Privy::Models::unsigned_ethereum_transaction } + + class EthereumSendTransactionRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor transaction: Privy::Models::unsigned_ethereum_transaction + + def initialize: ( + transaction: Privy::Models::unsigned_ethereum_transaction + ) -> void + + def to_hash: -> { + transaction: Privy::Models::unsigned_ethereum_transaction + } + end + end +end diff --git a/sig/privy/models/ethereum_send_transaction_rpc_response.rbs b/sig/privy/models/ethereum_send_transaction_rpc_response.rbs new file mode 100644 index 0000000..4cef8da --- /dev/null +++ b/sig/privy/models/ethereum_send_transaction_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_send_transaction_rpc_response = + { + data: Privy::EthereumSendTransactionRpcResponseData, + method_: Privy::Models::EthereumSendTransactionRpcResponse::method_ + } + + class EthereumSendTransactionRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumSendTransactionRpcResponseData + + attr_accessor method_: Privy::Models::EthereumSendTransactionRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumSendTransactionRpcResponseData, + method_: Privy::Models::EthereumSendTransactionRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumSendTransactionRpcResponseData, + method_: Privy::Models::EthereumSendTransactionRpcResponse::method_ + } + + type method_ = :eth_sendTransaction + + module Method + extend Privy::Internal::Type::Enum + + ETH_SEND_TRANSACTION: :eth_sendTransaction + + def self?.values: -> ::Array[Privy::Models::EthereumSendTransactionRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_send_transaction_rpc_response_data.rbs b/sig/privy/models/ethereum_send_transaction_rpc_response_data.rbs new file mode 100644 index 0000000..28c619d --- /dev/null +++ b/sig/privy/models/ethereum_send_transaction_rpc_response_data.rbs @@ -0,0 +1,53 @@ +module Privy + module Models + type ethereum_send_transaction_rpc_response_data = + { + :caip2 => String, + hash_: String, + reference_id: String?, + transaction_id: String, + transaction_request: Privy::Models::unsigned_ethereum_transaction, + user_operation_hash: String + } + + class EthereumSendTransactionRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor hash_: String + + attr_accessor reference_id: String? + + attr_reader transaction_id: String? + + def transaction_id=: (String) -> String + + attr_reader transaction_request: Privy::Models::unsigned_ethereum_transaction? + + def transaction_request=: ( + Privy::Models::unsigned_ethereum_transaction + ) -> Privy::Models::unsigned_ethereum_transaction + + attr_reader user_operation_hash: String? + + def user_operation_hash=: (String) -> String + + def initialize: ( + caip2: String, + hash_: String, + ?reference_id: String?, + ?transaction_id: String, + ?transaction_request: Privy::Models::unsigned_ethereum_transaction, + ?user_operation_hash: String + ) -> void + + def to_hash: -> { + :caip2 => String, + hash_: String, + reference_id: String?, + transaction_id: String, + transaction_request: Privy::Models::unsigned_ethereum_transaction, + user_operation_hash: String + } + end + end +end diff --git a/sig/privy/models/ethereum_sign_7702_authorization.rbs b/sig/privy/models/ethereum_sign_7702_authorization.rbs new file mode 100644 index 0000000..e2055ea --- /dev/null +++ b/sig/privy/models/ethereum_sign_7702_authorization.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type ethereum_sign7702_authorization = + { + chain_id: Privy::Models::quantity, + contract: String, + nonce: Privy::Models::quantity, + r: String, + s: String, + y_parity: Float + } + + class EthereumSign7702Authorization < Privy::Internal::Type::BaseModel + attr_accessor chain_id: Privy::Models::quantity + + attr_accessor contract: String + + attr_accessor nonce: Privy::Models::quantity + + attr_accessor r: String + + attr_accessor s: String + + attr_accessor y_parity: Float + + def initialize: ( + chain_id: Privy::Models::quantity, + contract: String, + nonce: Privy::Models::quantity, + r: String, + s: String, + y_parity: Float + ) -> void + + def to_hash: -> { + chain_id: Privy::Models::quantity, + contract: String, + nonce: Privy::Models::quantity, + r: String, + s: String, + y_parity: Float + } + end + end +end diff --git a/sig/privy/models/ethereum_sign_7702_authorization_rpc_input.rbs b/sig/privy/models/ethereum_sign_7702_authorization_rpc_input.rbs new file mode 100644 index 0000000..4df6e5f --- /dev/null +++ b/sig/privy/models/ethereum_sign_7702_authorization_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type ethereum_sign7702_authorization_rpc_input = + { + method_: Privy::Models::EthereumSign7702AuthorizationRpcInput::method_, + params: Privy::EthereumSign7702AuthorizationRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSign7702AuthorizationRpcInput::chain_type, + wallet_id: String + } + + class EthereumSign7702AuthorizationRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::EthereumSign7702AuthorizationRpcInput::method_ + + attr_accessor params: Privy::EthereumSign7702AuthorizationRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumSign7702AuthorizationRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumSign7702AuthorizationRpcInput::chain_type + ) -> Privy::Models::EthereumSign7702AuthorizationRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::EthereumSign7702AuthorizationRpcInput::method_, + params: Privy::EthereumSign7702AuthorizationRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumSign7702AuthorizationRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::EthereumSign7702AuthorizationRpcInput::method_, + params: Privy::EthereumSign7702AuthorizationRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSign7702AuthorizationRpcInput::chain_type, + wallet_id: String + } + + type method_ = :eth_sign7702Authorization + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN7702_AUTHORIZATION: :eth_sign7702Authorization + + def self?.values: -> ::Array[Privy::Models::EthereumSign7702AuthorizationRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumSign7702AuthorizationRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rbs b/sig/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rbs new file mode 100644 index 0000000..279f8b6 --- /dev/null +++ b/sig/privy/models/ethereum_sign_7702_authorization_rpc_input_params.rbs @@ -0,0 +1,51 @@ +module Privy + module Models + type ethereum_sign7702_authorization_rpc_input_params = + { + chain_id: Privy::Models::quantity, + contract: String, + executor: Privy::Models::EthereumSign7702AuthorizationRpcInputParams::executor, + nonce: Privy::Models::quantity + } + + class EthereumSign7702AuthorizationRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor chain_id: Privy::Models::quantity + + attr_accessor contract: String + + attr_reader executor: Privy::Models::EthereumSign7702AuthorizationRpcInputParams::executor? + + def executor=: ( + Privy::Models::EthereumSign7702AuthorizationRpcInputParams::executor + ) -> Privy::Models::EthereumSign7702AuthorizationRpcInputParams::executor + + attr_reader nonce: Privy::Models::quantity? + + def nonce=: (Privy::Models::quantity) -> Privy::Models::quantity + + def initialize: ( + chain_id: Privy::Models::quantity, + contract: String, + ?executor: Privy::Models::EthereumSign7702AuthorizationRpcInputParams::executor, + ?nonce: Privy::Models::quantity + ) -> void + + def to_hash: -> { + chain_id: Privy::Models::quantity, + contract: String, + executor: Privy::Models::EthereumSign7702AuthorizationRpcInputParams::executor, + nonce: Privy::Models::quantity + } + + type executor = :self + + module Executor + extend Privy::Internal::Type::Enum + + SELF: :self + + def self?.values: -> ::Array[Privy::Models::EthereumSign7702AuthorizationRpcInputParams::executor] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_7702_authorization_rpc_response.rbs b/sig/privy/models/ethereum_sign_7702_authorization_rpc_response.rbs new file mode 100644 index 0000000..8a5f261 --- /dev/null +++ b/sig/privy/models/ethereum_sign_7702_authorization_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_sign7702_authorization_rpc_response = + { + data: Privy::EthereumSign7702AuthorizationRpcResponseData, + method_: Privy::Models::EthereumSign7702AuthorizationRpcResponse::method_ + } + + class EthereumSign7702AuthorizationRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumSign7702AuthorizationRpcResponseData + + attr_accessor method_: Privy::Models::EthereumSign7702AuthorizationRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumSign7702AuthorizationRpcResponseData, + method_: Privy::Models::EthereumSign7702AuthorizationRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumSign7702AuthorizationRpcResponseData, + method_: Privy::Models::EthereumSign7702AuthorizationRpcResponse::method_ + } + + type method_ = :eth_sign7702Authorization + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN7702_AUTHORIZATION: :eth_sign7702Authorization + + def self?.values: -> ::Array[Privy::Models::EthereumSign7702AuthorizationRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rbs b/sig/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rbs new file mode 100644 index 0000000..95823d6 --- /dev/null +++ b/sig/privy/models/ethereum_sign_7702_authorization_rpc_response_data.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type ethereum_sign7702_authorization_rpc_response_data = + { authorization: Privy::EthereumSign7702Authorization } + + class EthereumSign7702AuthorizationRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor authorization: Privy::EthereumSign7702Authorization + + def initialize: ( + authorization: Privy::EthereumSign7702Authorization + ) -> void + + def to_hash: -> { authorization: Privy::EthereumSign7702Authorization } + end + end +end diff --git a/sig/privy/models/ethereum_sign_transaction_rpc_input.rbs b/sig/privy/models/ethereum_sign_transaction_rpc_input.rbs new file mode 100644 index 0000000..54fddf0 --- /dev/null +++ b/sig/privy/models/ethereum_sign_transaction_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type ethereum_sign_transaction_rpc_input = + { + method_: Privy::Models::EthereumSignTransactionRpcInput::method_, + params: Privy::EthereumSignTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSignTransactionRpcInput::chain_type, + wallet_id: String + } + + class EthereumSignTransactionRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::EthereumSignTransactionRpcInput::method_ + + attr_accessor params: Privy::EthereumSignTransactionRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumSignTransactionRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumSignTransactionRpcInput::chain_type + ) -> Privy::Models::EthereumSignTransactionRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::EthereumSignTransactionRpcInput::method_, + params: Privy::EthereumSignTransactionRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumSignTransactionRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::EthereumSignTransactionRpcInput::method_, + params: Privy::EthereumSignTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSignTransactionRpcInput::chain_type, + wallet_id: String + } + + type method_ = :eth_signTransaction + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TRANSACTION: :eth_signTransaction + + def self?.values: -> ::Array[Privy::Models::EthereumSignTransactionRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumSignTransactionRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_transaction_rpc_input_params.rbs b/sig/privy/models/ethereum_sign_transaction_rpc_input_params.rbs new file mode 100644 index 0000000..3fd5aaa --- /dev/null +++ b/sig/privy/models/ethereum_sign_transaction_rpc_input_params.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type ethereum_sign_transaction_rpc_input_params = + { transaction: Privy::Models::unsigned_ethereum_transaction } + + class EthereumSignTransactionRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor transaction: Privy::Models::unsigned_ethereum_transaction + + def initialize: ( + transaction: Privy::Models::unsigned_ethereum_transaction + ) -> void + + def to_hash: -> { + transaction: Privy::Models::unsigned_ethereum_transaction + } + end + end +end diff --git a/sig/privy/models/ethereum_sign_transaction_rpc_response.rbs b/sig/privy/models/ethereum_sign_transaction_rpc_response.rbs new file mode 100644 index 0000000..98c278a --- /dev/null +++ b/sig/privy/models/ethereum_sign_transaction_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_sign_transaction_rpc_response = + { + data: Privy::EthereumSignTransactionRpcResponseData, + method_: Privy::Models::EthereumSignTransactionRpcResponse::method_ + } + + class EthereumSignTransactionRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumSignTransactionRpcResponseData + + attr_accessor method_: Privy::Models::EthereumSignTransactionRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumSignTransactionRpcResponseData, + method_: Privy::Models::EthereumSignTransactionRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumSignTransactionRpcResponseData, + method_: Privy::Models::EthereumSignTransactionRpcResponse::method_ + } + + type method_ = :eth_signTransaction + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TRANSACTION: :eth_signTransaction + + def self?.values: -> ::Array[Privy::Models::EthereumSignTransactionRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_transaction_rpc_response_data.rbs b/sig/privy/models/ethereum_sign_transaction_rpc_response_data.rbs new file mode 100644 index 0000000..9514273 --- /dev/null +++ b/sig/privy/models/ethereum_sign_transaction_rpc_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_sign_transaction_rpc_response_data = + { + encoding: Privy::Models::EthereumSignTransactionRpcResponseData::encoding, + signed_transaction: String + } + + class EthereumSignTransactionRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::EthereumSignTransactionRpcResponseData::encoding + + attr_accessor signed_transaction: String + + def initialize: ( + encoding: Privy::Models::EthereumSignTransactionRpcResponseData::encoding, + signed_transaction: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::EthereumSignTransactionRpcResponseData::encoding, + signed_transaction: String + } + + type encoding = :rlp + + module Encoding + extend Privy::Internal::Type::Enum + + RLP: :rlp + + def self?.values: -> ::Array[Privy::Models::EthereumSignTransactionRpcResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_typed_data_rpc_input.rbs b/sig/privy/models/ethereum_sign_typed_data_rpc_input.rbs new file mode 100644 index 0000000..1754bfb --- /dev/null +++ b/sig/privy/models/ethereum_sign_typed_data_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type ethereum_sign_typed_data_rpc_input = + { + method_: Privy::Models::EthereumSignTypedDataRpcInput::method_, + params: Privy::EthereumSignTypedDataRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSignTypedDataRpcInput::chain_type, + wallet_id: String + } + + class EthereumSignTypedDataRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::EthereumSignTypedDataRpcInput::method_ + + attr_accessor params: Privy::EthereumSignTypedDataRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumSignTypedDataRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumSignTypedDataRpcInput::chain_type + ) -> Privy::Models::EthereumSignTypedDataRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::EthereumSignTypedDataRpcInput::method_, + params: Privy::EthereumSignTypedDataRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumSignTypedDataRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::EthereumSignTypedDataRpcInput::method_, + params: Privy::EthereumSignTypedDataRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSignTypedDataRpcInput::chain_type, + wallet_id: String + } + + type method_ = :eth_signTypedData_v4 + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TYPED_DATA_V4: :eth_signTypedData_v4 + + def self?.values: -> ::Array[Privy::Models::EthereumSignTypedDataRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumSignTypedDataRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_typed_data_rpc_input_params.rbs b/sig/privy/models/ethereum_sign_typed_data_rpc_input_params.rbs new file mode 100644 index 0000000..518637f --- /dev/null +++ b/sig/privy/models/ethereum_sign_typed_data_rpc_input_params.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type ethereum_sign_typed_data_rpc_input_params = + { typed_data: Privy::EthereumTypedDataInput } + + class EthereumSignTypedDataRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor typed_data: Privy::EthereumTypedDataInput + + def initialize: (typed_data: Privy::EthereumTypedDataInput) -> void + + def to_hash: -> { typed_data: Privy::EthereumTypedDataInput } + end + end +end diff --git a/sig/privy/models/ethereum_sign_typed_data_rpc_response.rbs b/sig/privy/models/ethereum_sign_typed_data_rpc_response.rbs new file mode 100644 index 0000000..bc23b5c --- /dev/null +++ b/sig/privy/models/ethereum_sign_typed_data_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_sign_typed_data_rpc_response = + { + data: Privy::EthereumSignTypedDataRpcResponseData, + method_: Privy::Models::EthereumSignTypedDataRpcResponse::method_ + } + + class EthereumSignTypedDataRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumSignTypedDataRpcResponseData + + attr_accessor method_: Privy::Models::EthereumSignTypedDataRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumSignTypedDataRpcResponseData, + method_: Privy::Models::EthereumSignTypedDataRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumSignTypedDataRpcResponseData, + method_: Privy::Models::EthereumSignTypedDataRpcResponse::method_ + } + + type method_ = :eth_signTypedData_v4 + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_TYPED_DATA_V4: :eth_signTypedData_v4 + + def self?.values: -> ::Array[Privy::Models::EthereumSignTypedDataRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_typed_data_rpc_response_data.rbs b/sig/privy/models/ethereum_sign_typed_data_rpc_response_data.rbs new file mode 100644 index 0000000..fb9e1f9 --- /dev/null +++ b/sig/privy/models/ethereum_sign_typed_data_rpc_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_sign_typed_data_rpc_response_data = + { + encoding: Privy::Models::EthereumSignTypedDataRpcResponseData::encoding, + signature: String + } + + class EthereumSignTypedDataRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::EthereumSignTypedDataRpcResponseData::encoding + + attr_accessor signature: String + + def initialize: ( + encoding: Privy::Models::EthereumSignTypedDataRpcResponseData::encoding, + signature: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::EthereumSignTypedDataRpcResponseData::encoding, + signature: String + } + + type encoding = :hex + + module Encoding + extend Privy::Internal::Type::Enum + + HEX: :hex + + def self?.values: -> ::Array[Privy::Models::EthereumSignTypedDataRpcResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_user_operation_rpc_input.rbs b/sig/privy/models/ethereum_sign_user_operation_rpc_input.rbs new file mode 100644 index 0000000..b7e2dd9 --- /dev/null +++ b/sig/privy/models/ethereum_sign_user_operation_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type ethereum_sign_user_operation_rpc_input = + { + method_: Privy::Models::EthereumSignUserOperationRpcInput::method_, + params: Privy::EthereumSignUserOperationRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSignUserOperationRpcInput::chain_type, + wallet_id: String + } + + class EthereumSignUserOperationRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::EthereumSignUserOperationRpcInput::method_ + + attr_accessor params: Privy::EthereumSignUserOperationRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::EthereumSignUserOperationRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::EthereumSignUserOperationRpcInput::chain_type + ) -> Privy::Models::EthereumSignUserOperationRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::EthereumSignUserOperationRpcInput::method_, + params: Privy::EthereumSignUserOperationRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::EthereumSignUserOperationRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::EthereumSignUserOperationRpcInput::method_, + params: Privy::EthereumSignUserOperationRpcInputParams, + address: String, + chain_type: Privy::Models::EthereumSignUserOperationRpcInput::chain_type, + wallet_id: String + } + + type method_ = :eth_signUserOperation + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_USER_OPERATION: :eth_signUserOperation + + def self?.values: -> ::Array[Privy::Models::EthereumSignUserOperationRpcInput::method_] + end + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::EthereumSignUserOperationRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_user_operation_rpc_input_params.rbs b/sig/privy/models/ethereum_sign_user_operation_rpc_input_params.rbs new file mode 100644 index 0000000..422dc48 --- /dev/null +++ b/sig/privy/models/ethereum_sign_user_operation_rpc_input_params.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type ethereum_sign_user_operation_rpc_input_params = + { + chain_id: Privy::Models::quantity, + contract: String, + user_operation: Privy::UserOperationInput + } + + class EthereumSignUserOperationRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor chain_id: Privy::Models::quantity + + attr_accessor contract: String + + attr_accessor user_operation: Privy::UserOperationInput + + def initialize: ( + chain_id: Privy::Models::quantity, + contract: String, + user_operation: Privy::UserOperationInput + ) -> void + + def to_hash: -> { + chain_id: Privy::Models::quantity, + contract: String, + user_operation: Privy::UserOperationInput + } + end + end +end diff --git a/sig/privy/models/ethereum_sign_user_operation_rpc_response.rbs b/sig/privy/models/ethereum_sign_user_operation_rpc_response.rbs new file mode 100644 index 0000000..77e5f0c --- /dev/null +++ b/sig/privy/models/ethereum_sign_user_operation_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_sign_user_operation_rpc_response = + { + data: Privy::EthereumSignUserOperationRpcResponseData, + method_: Privy::Models::EthereumSignUserOperationRpcResponse::method_ + } + + class EthereumSignUserOperationRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::EthereumSignUserOperationRpcResponseData + + attr_accessor method_: Privy::Models::EthereumSignUserOperationRpcResponse::method_ + + def initialize: ( + data: Privy::EthereumSignUserOperationRpcResponseData, + method_: Privy::Models::EthereumSignUserOperationRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::EthereumSignUserOperationRpcResponseData, + method_: Privy::Models::EthereumSignUserOperationRpcResponse::method_ + } + + type method_ = :eth_signUserOperation + + module Method + extend Privy::Internal::Type::Enum + + ETH_SIGN_USER_OPERATION: :eth_signUserOperation + + def self?.values: -> ::Array[Privy::Models::EthereumSignUserOperationRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/ethereum_sign_user_operation_rpc_response_data.rbs b/sig/privy/models/ethereum_sign_user_operation_rpc_response_data.rbs new file mode 100644 index 0000000..bad81ec --- /dev/null +++ b/sig/privy/models/ethereum_sign_user_operation_rpc_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_sign_user_operation_rpc_response_data = + { + encoding: Privy::Models::EthereumSignUserOperationRpcResponseData::encoding, + signature: String + } + + class EthereumSignUserOperationRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::EthereumSignUserOperationRpcResponseData::encoding + + attr_accessor signature: String + + def initialize: ( + encoding: Privy::Models::EthereumSignUserOperationRpcResponseData::encoding, + signature: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::EthereumSignUserOperationRpcResponseData::encoding, + signature: String + } + + type encoding = :hex + + module Encoding + extend Privy::Internal::Type::Enum + + HEX: :hex + + def self?.values: -> ::Array[Privy::Models::EthereumSignUserOperationRpcResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/ethereum_transaction_condition.rbs b/sig/privy/models/ethereum_transaction_condition.rbs new file mode 100644 index 0000000..beebdd7 --- /dev/null +++ b/sig/privy/models/ethereum_transaction_condition.rbs @@ -0,0 +1,57 @@ +module Privy + module Models + type ethereum_transaction_condition = + { + field: Privy::Models::EthereumTransactionCondition::field, + field_source: Privy::Models::EthereumTransactionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class EthereumTransactionCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::EthereumTransactionCondition::field + + attr_accessor field_source: Privy::Models::EthereumTransactionCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::EthereumTransactionCondition::field, + field_source: Privy::Models::EthereumTransactionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::EthereumTransactionCondition::field, + field_source: Privy::Models::EthereumTransactionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = :to | :value | :chain_id + + module Field + extend Privy::Internal::Type::Enum + + TO: :to + VALUE: :value + CHAIN_ID: :chain_id + + def self?.values: -> ::Array[Privy::Models::EthereumTransactionCondition::field] + end + + type field_source = :ethereum_transaction + + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_TRANSACTION: :ethereum_transaction + + def self?.values: -> ::Array[Privy::Models::EthereumTransactionCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/ethereum_typed_data_domain_condition.rbs b/sig/privy/models/ethereum_typed_data_domain_condition.rbs new file mode 100644 index 0000000..95782f1 --- /dev/null +++ b/sig/privy/models/ethereum_typed_data_domain_condition.rbs @@ -0,0 +1,59 @@ +module Privy + module Models + type ethereum_typed_data_domain_condition = + { + field: Privy::Models::EthereumTypedDataDomainCondition::field, + field_source: Privy::Models::EthereumTypedDataDomainCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class EthereumTypedDataDomainCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::EthereumTypedDataDomainCondition::field + + attr_accessor field_source: Privy::Models::EthereumTypedDataDomainCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::EthereumTypedDataDomainCondition::field, + field_source: Privy::Models::EthereumTypedDataDomainCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::EthereumTypedDataDomainCondition::field, + field_source: Privy::Models::EthereumTypedDataDomainCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = + :chainId | :verifyingContract | :chain_id | :verifying_contract + + module Field + extend Privy::Internal::Type::Enum + + CHAIN_ID: :chainId + CHAIN_ID_2: :chain_id + VERIFYING_CONTRACT: :verifyingContract + VERIFYING_CONTRACT_2: :verifying_contract + + def self?.values: -> ::Array[Privy::Models::EthereumTypedDataDomainCondition::field] + end + + type field_source = :ethereum_typed_data_domain + + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_TYPED_DATA_DOMAIN: :ethereum_typed_data_domain + + def self?.values: -> ::Array[Privy::Models::EthereumTypedDataDomainCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/ethereum_typed_data_input.rbs b/sig/privy/models/ethereum_typed_data_input.rbs new file mode 100644 index 0000000..6fde543 --- /dev/null +++ b/sig/privy/models/ethereum_typed_data_input.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type ethereum_typed_data_input = + { + domain: Privy::Models::typed_data_domain_input_params, + message: ::Hash[Symbol, top], + primary_type: String, + types: Privy::Models::typed_data_types_input_params + } + + class EthereumTypedDataInput < Privy::Internal::Type::BaseModel + attr_accessor domain: Privy::Models::typed_data_domain_input_params + + attr_accessor message: ::Hash[Symbol, top] + + attr_accessor primary_type: String + + attr_accessor types: Privy::Models::typed_data_types_input_params + + def initialize: ( + domain: Privy::Models::typed_data_domain_input_params, + message: ::Hash[Symbol, top], + primary_type: String, + types: Privy::Models::typed_data_types_input_params + ) -> void + + def to_hash: -> { + domain: Privy::Models::typed_data_domain_input_params, + message: ::Hash[Symbol, top], + primary_type: String, + types: Privy::Models::typed_data_types_input_params + } + end + end +end diff --git a/sig/privy/models/ethereum_typed_data_message_condition.rbs b/sig/privy/models/ethereum_typed_data_message_condition.rbs new file mode 100644 index 0000000..8c9c0fd --- /dev/null +++ b/sig/privy/models/ethereum_typed_data_message_condition.rbs @@ -0,0 +1,72 @@ +module Privy + module Models + type ethereum_typed_data_message_condition = + { + field: String, + field_source: Privy::Models::EthereumTypedDataMessageCondition::field_source, + operator: Privy::Models::condition_operator, + typed_data: Privy::EthereumTypedDataMessageCondition::TypedData, + value: Privy::Models::condition_value + } + + class EthereumTypedDataMessageCondition < Privy::Internal::Type::BaseModel + attr_accessor field: String + + attr_accessor field_source: Privy::Models::EthereumTypedDataMessageCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor typed_data: Privy::EthereumTypedDataMessageCondition::TypedData + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: String, + field_source: Privy::Models::EthereumTypedDataMessageCondition::field_source, + operator: Privy::Models::condition_operator, + typed_data: Privy::EthereumTypedDataMessageCondition::TypedData, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: String, + field_source: Privy::Models::EthereumTypedDataMessageCondition::field_source, + operator: Privy::Models::condition_operator, + typed_data: Privy::EthereumTypedDataMessageCondition::TypedData, + value: Privy::Models::condition_value + } + + type field_source = :ethereum_typed_data_message + + module FieldSource + extend Privy::Internal::Type::Enum + + ETHEREUM_TYPED_DATA_MESSAGE: :ethereum_typed_data_message + + def self?.values: -> ::Array[Privy::Models::EthereumTypedDataMessageCondition::field_source] + end + + type typed_data = + { + primary_type: String, + types: Privy::Models::typed_data_types_input_params + } + + class TypedData < Privy::Internal::Type::BaseModel + attr_accessor primary_type: String + + attr_accessor types: Privy::Models::typed_data_types_input_params + + def initialize: ( + primary_type: String, + types: Privy::Models::typed_data_types_input_params + ) -> void + + def to_hash: -> { + primary_type: String, + types: Privy::Models::typed_data_types_input_params + } + end + end + end +end diff --git a/sig/privy/models/ethereum_vault_details_input.rbs b/sig/privy/models/ethereum_vault_details_input.rbs new file mode 100644 index 0000000..597fbf9 --- /dev/null +++ b/sig/privy/models/ethereum_vault_details_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type ethereum_vault_details_input = { vault_id: String } + + class EthereumVaultDetailsInput < Privy::Internal::Type::BaseModel + attr_accessor vault_id: String + + def initialize: (vault_id: String) -> void + + def to_hash: -> { vault_id: String } + end + end +end diff --git a/sig/privy/models/ethereum_vault_details_response.rbs b/sig/privy/models/ethereum_vault_details_response.rbs new file mode 100644 index 0000000..555d3e2 --- /dev/null +++ b/sig/privy/models/ethereum_vault_details_response.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type ethereum_vault_details_response = + { + id: String, + app_apy: Float?, + asset_address: String, + available_liquidity_usd: Float?, + :caip2 => String, + name: String, + provider: Privy::Models::ethereum_yield_provider, + tvl_usd: Float?, + user_apy: Float?, + vault_address: String + } + + class EthereumVaultDetailsResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor app_apy: Float? + + attr_accessor asset_address: String + + attr_accessor available_liquidity_usd: Float? + + attr_accessor caip2: String + + attr_accessor name: String + + attr_accessor provider: Privy::Models::ethereum_yield_provider + + attr_accessor tvl_usd: Float? + + attr_accessor user_apy: Float? + + attr_accessor vault_address: String + + def initialize: ( + id: String, + app_apy: Float?, + asset_address: String, + available_liquidity_usd: Float?, + caip2: String, + name: String, + provider: Privy::Models::ethereum_yield_provider, + tvl_usd: Float?, + user_apy: Float?, + vault_address: String + ) -> void + + def to_hash: -> { + id: String, + app_apy: Float?, + asset_address: String, + available_liquidity_usd: Float?, + :caip2 => String, + name: String, + provider: Privy::Models::ethereum_yield_provider, + tvl_usd: Float?, + user_apy: Float?, + vault_address: String + } + end + end +end diff --git a/sig/privy/models/ethereum_vault_position.rbs b/sig/privy/models/ethereum_vault_position.rbs new file mode 100644 index 0000000..d6651c7 --- /dev/null +++ b/sig/privy/models/ethereum_vault_position.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type ethereum_vault_position = + { + asset: Privy::EthereumVaultPosition::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + + class EthereumVaultPosition < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::EthereumVaultPosition::Asset + + attr_accessor assets_in_vault: String + + attr_accessor shares_in_vault: String + + attr_accessor total_deposited: String + + attr_accessor total_withdrawn: String + + def initialize: ( + asset: Privy::EthereumVaultPosition::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + ) -> void + + def to_hash: -> { + asset: Privy::EthereumVaultPosition::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + + type asset = { address: String, symbol: String } + + class Asset < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor symbol: String + + def initialize: (address: String, symbol: String) -> void + + def to_hash: -> { address: String, symbol: String } + end + end + end +end diff --git a/sig/privy/models/ethereum_vault_response.rbs b/sig/privy/models/ethereum_vault_response.rbs new file mode 100644 index 0000000..7f372ae --- /dev/null +++ b/sig/privy/models/ethereum_vault_response.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type ethereum_vault_response = + { + id: String, + asset_address: String, + :caip2 => String, + created_at: Float, + provider: Privy::Models::ethereum_yield_provider, + underlying_vault_address: String, + vault_address: String + } + + class EthereumVaultResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor created_at: Float + + attr_accessor provider: Privy::Models::ethereum_yield_provider + + attr_accessor underlying_vault_address: String + + attr_accessor vault_address: String + + def initialize: ( + id: String, + asset_address: String, + caip2: String, + created_at: Float, + provider: Privy::Models::ethereum_yield_provider, + underlying_vault_address: String, + vault_address: String + ) -> void + + def to_hash: -> { + id: String, + asset_address: String, + :caip2 => String, + created_at: Float, + provider: Privy::Models::ethereum_yield_provider, + underlying_vault_address: String, + vault_address: String + } + end + end +end diff --git a/sig/privy/models/ethereum_yield_claim_id_input.rbs b/sig/privy/models/ethereum_yield_claim_id_input.rbs new file mode 100644 index 0000000..7e0fd06 --- /dev/null +++ b/sig/privy/models/ethereum_yield_claim_id_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type ethereum_yield_claim_id_input = { id: String } + + class EthereumYieldClaimIDInput < Privy::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + end +end diff --git a/sig/privy/models/ethereum_yield_claim_input.rbs b/sig/privy/models/ethereum_yield_claim_input.rbs new file mode 100644 index 0000000..5c66fad --- /dev/null +++ b/sig/privy/models/ethereum_yield_claim_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type ethereum_yield_claim_input = { :caip2 => String } + + class EthereumYieldClaimInput < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + def initialize: (caip2: String) -> void + + def to_hash: -> { :caip2 => String } + end + end +end diff --git a/sig/privy/models/ethereum_yield_claim_response.rbs b/sig/privy/models/ethereum_yield_claim_response.rbs new file mode 100644 index 0000000..7c384ff --- /dev/null +++ b/sig/privy/models/ethereum_yield_claim_response.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type ethereum_yield_claim_response = + { + id: String, + :caip2 => String, + created_at: Float, + rewards: ::Array[Privy::EthereumYieldClaimReward], + status: Privy::Models::EthereumYieldClaimResponse::status, + updated_at: Float + } + + class EthereumYieldClaimResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor caip2: String + + attr_accessor created_at: Float + + attr_accessor rewards: ::Array[Privy::EthereumYieldClaimReward] + + attr_accessor status: Privy::Models::EthereumYieldClaimResponse::status + + attr_accessor updated_at: Float + + def initialize: ( + id: String, + caip2: String, + created_at: Float, + rewards: ::Array[Privy::EthereumYieldClaimReward], + status: Privy::Models::EthereumYieldClaimResponse::status, + updated_at: Float + ) -> void + + def to_hash: -> { + id: String, + :caip2 => String, + created_at: Float, + rewards: ::Array[Privy::EthereumYieldClaimReward], + status: Privy::Models::EthereumYieldClaimResponse::status, + updated_at: Float + } + + type status = + :broadcasted + | :confirmed + | :execution_reverted + | :failed + | :replaced + | :finalized + | :provider_error + | :pending + + module Status + extend Privy::Internal::Type::Enum + + BROADCASTED: :broadcasted + CONFIRMED: :confirmed + EXECUTION_REVERTED: :execution_reverted + FAILED: :failed + REPLACED: :replaced + FINALIZED: :finalized + PROVIDER_ERROR: :provider_error + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::EthereumYieldClaimResponse::status] + end + end + end +end diff --git a/sig/privy/models/ethereum_yield_claim_reward.rbs b/sig/privy/models/ethereum_yield_claim_reward.rbs new file mode 100644 index 0000000..ce22e87 --- /dev/null +++ b/sig/privy/models/ethereum_yield_claim_reward.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type ethereum_yield_claim_reward = + { amount: String, token_address: String, token_symbol: String } + + class EthereumYieldClaimReward < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor token_address: String + + attr_accessor token_symbol: String + + def initialize: ( + amount: String, + token_address: String, + token_symbol: String + ) -> void + + def to_hash: -> { + amount: String, + token_address: String, + token_symbol: String + } + end + end +end diff --git a/sig/privy/models/ethereum_yield_deposit_input.rbs b/sig/privy/models/ethereum_yield_deposit_input.rbs new file mode 100644 index 0000000..da8c262 --- /dev/null +++ b/sig/privy/models/ethereum_yield_deposit_input.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type ethereum_yield_deposit_input = + { asset_amount: String, vault_id: String } + + class EthereumYieldDepositInput < Privy::Internal::Type::BaseModel + attr_accessor asset_amount: String + + attr_accessor vault_id: String + + def initialize: (asset_amount: String, vault_id: String) -> void + + def to_hash: -> { asset_amount: String, vault_id: String } + end + end +end diff --git a/sig/privy/models/ethereum_yield_position_response.rbs b/sig/privy/models/ethereum_yield_position_response.rbs new file mode 100644 index 0000000..f6b4bcc --- /dev/null +++ b/sig/privy/models/ethereum_yield_position_response.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type ethereum_yield_position_response = + { + asset: Privy::EthereumYieldPositionResponse::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + + class EthereumYieldPositionResponse < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::EthereumYieldPositionResponse::Asset + + attr_accessor assets_in_vault: String + + attr_accessor shares_in_vault: String + + attr_accessor total_deposited: String + + attr_accessor total_withdrawn: String + + def initialize: ( + asset: Privy::EthereumYieldPositionResponse::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + ) -> void + + def to_hash: -> { + asset: Privy::EthereumYieldPositionResponse::Asset, + assets_in_vault: String, + shares_in_vault: String, + total_deposited: String, + total_withdrawn: String + } + + type asset = { address: String, symbol: String } + + class Asset < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor symbol: String + + def initialize: (address: String, symbol: String) -> void + + def to_hash: -> { address: String, symbol: String } + end + end + end +end diff --git a/sig/privy/models/ethereum_yield_positions_input.rbs b/sig/privy/models/ethereum_yield_positions_input.rbs new file mode 100644 index 0000000..8faf78c --- /dev/null +++ b/sig/privy/models/ethereum_yield_positions_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type ethereum_yield_positions_input = { vault_id: String } + + class EthereumYieldPositionsInput < Privy::Internal::Type::BaseModel + attr_accessor vault_id: String + + def initialize: (vault_id: String) -> void + + def to_hash: -> { vault_id: String } + end + end +end diff --git a/sig/privy/models/ethereum_yield_provider.rbs b/sig/privy/models/ethereum_yield_provider.rbs new file mode 100644 index 0000000..db60f2a --- /dev/null +++ b/sig/privy/models/ethereum_yield_provider.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type ethereum_yield_provider = :morpho | :aave + + module EthereumYieldProvider + extend Privy::Internal::Type::Enum + + MORPHO: :morpho + AAVE: :aave + + def self?.values: -> ::Array[Privy::Models::ethereum_yield_provider] + end + end +end diff --git a/sig/privy/models/ethereum_yield_sweep_id_input.rbs b/sig/privy/models/ethereum_yield_sweep_id_input.rbs new file mode 100644 index 0000000..00fda2f --- /dev/null +++ b/sig/privy/models/ethereum_yield_sweep_id_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type ethereum_yield_sweep_id_input = { id: String } + + class EthereumYieldSweepIDInput < Privy::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + end +end diff --git a/sig/privy/models/ethereum_yield_sweep_response.rbs b/sig/privy/models/ethereum_yield_sweep_response.rbs new file mode 100644 index 0000000..4d23733 --- /dev/null +++ b/sig/privy/models/ethereum_yield_sweep_response.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type ethereum_yield_sweep_response = + { + id: String, + asset_amount: String?, + created_at: Float, + share_amount: String?, + status: Privy::Models::ethereum_yield_sweep_status, + type: Privy::Models::ethereum_yield_sweep_type, + updated_at: Float, + vault_id: String, + wallet_id: String + } + + class EthereumYieldSweepResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor asset_amount: String? + + attr_accessor created_at: Float + + attr_accessor share_amount: String? + + attr_accessor status: Privy::Models::ethereum_yield_sweep_status + + attr_accessor type: Privy::Models::ethereum_yield_sweep_type + + attr_accessor updated_at: Float + + attr_accessor vault_id: String + + attr_accessor wallet_id: String + + def initialize: ( + id: String, + asset_amount: String?, + created_at: Float, + share_amount: String?, + status: Privy::Models::ethereum_yield_sweep_status, + type: Privy::Models::ethereum_yield_sweep_type, + updated_at: Float, + vault_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + id: String, + asset_amount: String?, + created_at: Float, + share_amount: String?, + status: Privy::Models::ethereum_yield_sweep_status, + type: Privy::Models::ethereum_yield_sweep_type, + updated_at: Float, + vault_id: String, + wallet_id: String + } + end + end +end diff --git a/sig/privy/models/ethereum_yield_sweep_status.rbs b/sig/privy/models/ethereum_yield_sweep_status.rbs new file mode 100644 index 0000000..75f0881 --- /dev/null +++ b/sig/privy/models/ethereum_yield_sweep_status.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type ethereum_yield_sweep_status = :pending | :confirmed | :failed + + module EthereumYieldSweepStatus + extend Privy::Internal::Type::Enum + + PENDING: :pending + CONFIRMED: :confirmed + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::ethereum_yield_sweep_status] + end + end +end diff --git a/sig/privy/models/ethereum_yield_sweep_type.rbs b/sig/privy/models/ethereum_yield_sweep_type.rbs new file mode 100644 index 0000000..ef3db81 --- /dev/null +++ b/sig/privy/models/ethereum_yield_sweep_type.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type ethereum_yield_sweep_type = :deposit | :withdraw + + module EthereumYieldSweepType + extend Privy::Internal::Type::Enum + + DEPOSIT: :deposit + WITHDRAW: :withdraw + + def self?.values: -> ::Array[Privy::Models::ethereum_yield_sweep_type] + end + end +end diff --git a/sig/privy/models/ethereum_yield_withdraw_input.rbs b/sig/privy/models/ethereum_yield_withdraw_input.rbs new file mode 100644 index 0000000..0e26a00 --- /dev/null +++ b/sig/privy/models/ethereum_yield_withdraw_input.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type ethereum_yield_withdraw_input = + { asset_amount: String, vault_id: String } + + class EthereumYieldWithdrawInput < Privy::Internal::Type::BaseModel + attr_accessor asset_amount: String + + attr_accessor vault_id: String + + def initialize: (asset_amount: String, vault_id: String) -> void + + def to_hash: -> { asset_amount: String, vault_id: String } + end + end +end diff --git a/sig/privy/models/evm_caip_2_chain_id.rbs b/sig/privy/models/evm_caip_2_chain_id.rbs new file mode 100644 index 0000000..224cdd0 --- /dev/null +++ b/sig/privy/models/evm_caip_2_chain_id.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class EvmCaip2ChainID = String + end +end diff --git a/sig/privy/models/evm_transaction_wallet_action_step.rbs b/sig/privy/models/evm_transaction_wallet_action_step.rbs new file mode 100644 index 0000000..584e9e5 --- /dev/null +++ b/sig/privy/models/evm_transaction_wallet_action_step.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type evm_transaction_wallet_action_step = + { + :caip2 => String, + status: Privy::Models::evm_wallet_action_step_status, + transaction_hash: String?, + type: Privy::Models::EvmTransactionWalletActionStep::type_, + failure_reason: Privy::FailureReason + } + + class EvmTransactionWalletActionStep < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor status: Privy::Models::evm_wallet_action_step_status + + attr_accessor transaction_hash: String? + + attr_accessor type: Privy::Models::EvmTransactionWalletActionStep::type_ + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + def initialize: ( + caip2: String, + status: Privy::Models::evm_wallet_action_step_status, + transaction_hash: String?, + type: Privy::Models::EvmTransactionWalletActionStep::type_, + ?failure_reason: Privy::FailureReason + ) -> void + + def to_hash: -> { + :caip2 => String, + status: Privy::Models::evm_wallet_action_step_status, + transaction_hash: String?, + type: Privy::Models::EvmTransactionWalletActionStep::type_, + failure_reason: Privy::FailureReason + } + + type type_ = :evm_transaction + + module Type + extend Privy::Internal::Type::Enum + + EVM_TRANSACTION: :evm_transaction + + def self?.values: -> ::Array[Privy::Models::EvmTransactionWalletActionStep::type_] + end + end + end +end diff --git a/sig/privy/models/evm_user_operation_wallet_action_step.rbs b/sig/privy/models/evm_user_operation_wallet_action_step.rbs new file mode 100644 index 0000000..84fef05 --- /dev/null +++ b/sig/privy/models/evm_user_operation_wallet_action_step.rbs @@ -0,0 +1,75 @@ +module Privy + module Models + type evm_user_operation_wallet_action_step = + { + bundle_transaction_hash: String?, + :caip2 => String, + entrypoint_version: Privy::Models::EvmUserOperationWalletActionStep::entrypoint_version, + status: Privy::Models::evm_wallet_action_step_status, + type: Privy::Models::EvmUserOperationWalletActionStep::type_, + user_operation_hash: String?, + failure_reason: Privy::FailureReason + } + + class EvmUserOperationWalletActionStep < Privy::Internal::Type::BaseModel + attr_accessor bundle_transaction_hash: String? + + attr_accessor caip2: String + + attr_accessor entrypoint_version: Privy::Models::EvmUserOperationWalletActionStep::entrypoint_version + + attr_accessor status: Privy::Models::evm_wallet_action_step_status + + attr_accessor type: Privy::Models::EvmUserOperationWalletActionStep::type_ + + attr_accessor user_operation_hash: String? + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + def initialize: ( + bundle_transaction_hash: String?, + caip2: String, + entrypoint_version: Privy::Models::EvmUserOperationWalletActionStep::entrypoint_version, + status: Privy::Models::evm_wallet_action_step_status, + type: Privy::Models::EvmUserOperationWalletActionStep::type_, + user_operation_hash: String?, + ?failure_reason: Privy::FailureReason + ) -> void + + def to_hash: -> { + bundle_transaction_hash: String?, + :caip2 => String, + entrypoint_version: Privy::Models::EvmUserOperationWalletActionStep::entrypoint_version, + status: Privy::Models::evm_wallet_action_step_status, + type: Privy::Models::EvmUserOperationWalletActionStep::type_, + user_operation_hash: String?, + failure_reason: Privy::FailureReason + } + + type entrypoint_version = :"0.6" | :"0.7" | :"0.8" | :"0.9" + + module EntrypointVersion + extend Privy::Internal::Type::Enum + + ENTRYPOINT_VERSION_0_6: :"0.6" + ENTRYPOINT_VERSION_0_7: :"0.7" + ENTRYPOINT_VERSION_0_8: :"0.8" + ENTRYPOINT_VERSION_0_9: :"0.9" + + def self?.values: -> ::Array[Privy::Models::EvmUserOperationWalletActionStep::entrypoint_version] + end + + type type_ = :evm_user_operation + + module Type + extend Privy::Internal::Type::Enum + + EVM_USER_OPERATION: :evm_user_operation + + def self?.values: -> ::Array[Privy::Models::EvmUserOperationWalletActionStep::type_] + end + end + end +end diff --git a/sig/privy/models/evm_wallet_action_step_status.rbs b/sig/privy/models/evm_wallet_action_step_status.rbs new file mode 100644 index 0000000..47b0079 --- /dev/null +++ b/sig/privy/models/evm_wallet_action_step_status.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type evm_wallet_action_step_status = + :preparing + | :queued + | :pending + | :retrying + | :confirmed + | :rejected + | :reverted + | :replaced + | :abandoned + + module EvmWalletActionStepStatus + extend Privy::Internal::Type::Enum + + PREPARING: :preparing + QUEUED: :queued + PENDING: :pending + RETRYING: :retrying + CONFIRMED: :confirmed + REJECTED: :rejected + REVERTED: :reverted + REPLACED: :replaced + ABANDONED: :abandoned + + def self?.values: -> ::Array[Privy::Models::evm_wallet_action_step_status] + end + end +end diff --git a/sig/privy/models/export_private_key_rpc_input.rbs b/sig/privy/models/export_private_key_rpc_input.rbs new file mode 100644 index 0000000..10490d7 --- /dev/null +++ b/sig/privy/models/export_private_key_rpc_input.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type export_private_key_rpc_input = + { + address: String, + method_: Privy::Models::ExportPrivateKeyRpcInput::method_, + params: Privy::PrivateKeyExportInput + } + + class ExportPrivateKeyRpcInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor method_: Privy::Models::ExportPrivateKeyRpcInput::method_ + + attr_accessor params: Privy::PrivateKeyExportInput + + def initialize: ( + address: String, + method_: Privy::Models::ExportPrivateKeyRpcInput::method_, + params: Privy::PrivateKeyExportInput + ) -> void + + def to_hash: -> { + address: String, + method_: Privy::Models::ExportPrivateKeyRpcInput::method_, + params: Privy::PrivateKeyExportInput + } + + type method_ = :exportPrivateKey + + module Method + extend Privy::Internal::Type::Enum + + EXPORT_PRIVATE_KEY: :exportPrivateKey + + def self?.values: -> ::Array[Privy::Models::ExportPrivateKeyRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/export_private_key_rpc_response.rbs b/sig/privy/models/export_private_key_rpc_response.rbs new file mode 100644 index 0000000..c2f1539 --- /dev/null +++ b/sig/privy/models/export_private_key_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type export_private_key_rpc_response = + { + data: Privy::PrivateKeyExportInput, + method_: Privy::Models::ExportPrivateKeyRpcResponse::method_ + } + + class ExportPrivateKeyRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::PrivateKeyExportInput + + attr_accessor method_: Privy::Models::ExportPrivateKeyRpcResponse::method_ + + def initialize: ( + data: Privy::PrivateKeyExportInput, + method_: Privy::Models::ExportPrivateKeyRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::PrivateKeyExportInput, + method_: Privy::Models::ExportPrivateKeyRpcResponse::method_ + } + + type method_ = :exportPrivateKey + + module Method + extend Privy::Internal::Type::Enum + + EXPORT_PRIVATE_KEY: :exportPrivateKey + + def self?.values: -> ::Array[Privy::Models::ExportPrivateKeyRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/export_seed_phrase_rpc_input.rbs b/sig/privy/models/export_seed_phrase_rpc_input.rbs new file mode 100644 index 0000000..9e926b4 --- /dev/null +++ b/sig/privy/models/export_seed_phrase_rpc_input.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type export_seed_phrase_rpc_input = + { + address: String, + method_: Privy::Models::ExportSeedPhraseRpcInput::method_, + params: Privy::SeedPhraseExportInput + } + + class ExportSeedPhraseRpcInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor method_: Privy::Models::ExportSeedPhraseRpcInput::method_ + + attr_accessor params: Privy::SeedPhraseExportInput + + def initialize: ( + address: String, + method_: Privy::Models::ExportSeedPhraseRpcInput::method_, + params: Privy::SeedPhraseExportInput + ) -> void + + def to_hash: -> { + address: String, + method_: Privy::Models::ExportSeedPhraseRpcInput::method_, + params: Privy::SeedPhraseExportInput + } + + type method_ = :exportSeedPhrase + + module Method + extend Privy::Internal::Type::Enum + + EXPORT_SEED_PHRASE: :exportSeedPhrase + + def self?.values: -> ::Array[Privy::Models::ExportSeedPhraseRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/export_seed_phrase_rpc_response.rbs b/sig/privy/models/export_seed_phrase_rpc_response.rbs new file mode 100644 index 0000000..75e1a76 --- /dev/null +++ b/sig/privy/models/export_seed_phrase_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type export_seed_phrase_rpc_response = + { + data: Privy::SeedPhraseExportResponse, + method_: Privy::Models::ExportSeedPhraseRpcResponse::method_ + } + + class ExportSeedPhraseRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::SeedPhraseExportResponse + + attr_accessor method_: Privy::Models::ExportSeedPhraseRpcResponse::method_ + + def initialize: ( + data: Privy::SeedPhraseExportResponse, + method_: Privy::Models::ExportSeedPhraseRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::SeedPhraseExportResponse, + method_: Privy::Models::ExportSeedPhraseRpcResponse::method_ + } + + type method_ = :exportSeedPhrase + + module Method + extend Privy::Internal::Type::Enum + + EXPORT_SEED_PHRASE: :exportSeedPhrase + + def self?.values: -> ::Array[Privy::Models::ExportSeedPhraseRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/export_type.rbs b/sig/privy/models/export_type.rbs new file mode 100644 index 0000000..f890859 --- /dev/null +++ b/sig/privy/models/export_type.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type export_type = :display | :client + + module ExportType + extend Privy::Internal::Type::Enum + + DISPLAY: :display + CLIENT: :client + + def self?.values: -> ::Array[Privy::Models::export_type] + end + end +end diff --git a/sig/privy/models/extended_chain_type.rbs b/sig/privy/models/extended_chain_type.rbs new file mode 100644 index 0000000..475f2fc --- /dev/null +++ b/sig/privy/models/extended_chain_type.rbs @@ -0,0 +1,38 @@ +module Privy + module Models + type extended_chain_type = + :cosmos + | :stellar + | :sui + | :aptos + | :movement + | :tron + | :"bitcoin-segwit" + | :"bitcoin-taproot" + | :pearl + | :near + | :ton + | :starknet + | :spark + + module ExtendedChainType + extend Privy::Internal::Type::Enum + + COSMOS: :cosmos + STELLAR: :stellar + SUI: :sui + APTOS: :aptos + MOVEMENT: :movement + TRON: :tron + BITCOIN_SEGWIT: :"bitcoin-segwit" + BITCOIN_TAPROOT: :"bitcoin-taproot" + PEARL: :pearl + NEAR: :near + TON: :ton + STARKNET: :starknet + SPARK: :spark + + def self?.values: -> ::Array[Privy::Models::extended_chain_type] + end + end +end diff --git a/sig/privy/models/external_oauth_provider_id.rbs b/sig/privy/models/external_oauth_provider_id.rbs new file mode 100644 index 0000000..e003ae3 --- /dev/null +++ b/sig/privy/models/external_oauth_provider_id.rbs @@ -0,0 +1,36 @@ +module Privy + module Models + type external_oauth_provider_id = + :google + | :discord + | :twitter + | :github + | :spotify + | :instagram + | :tiktok + | :linkedin + | :apple + | :line + | :twitch + | :telegram + + module ExternalOAuthProviderID + extend Privy::Internal::Type::Enum + + GOOGLE: :google + DISCORD: :discord + TWITTER: :twitter + GITHUB: :github + SPOTIFY: :spotify + INSTAGRAM: :instagram + TIKTOK: :tiktok + LINKEDIN: :linkedin + APPLE: :apple + LINE: :line + TWITCH: :twitch + TELEGRAM: :telegram + + def self?.values: -> ::Array[Privy::Models::external_oauth_provider_id] + end + end +end diff --git a/sig/privy/models/external_transaction_wallet_action_step.rbs b/sig/privy/models/external_transaction_wallet_action_step.rbs new file mode 100644 index 0000000..f846c2c --- /dev/null +++ b/sig/privy/models/external_transaction_wallet_action_step.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type external_transaction_wallet_action_step = + { + status: Privy::Models::external_transaction_wallet_action_step_status, + type: Privy::Models::ExternalTransactionWalletActionStep::type_, + failure_reason: Privy::FailureReason + } + + class ExternalTransactionWalletActionStep < Privy::Internal::Type::BaseModel + attr_accessor status: Privy::Models::external_transaction_wallet_action_step_status + + attr_accessor type: Privy::Models::ExternalTransactionWalletActionStep::type_ + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + def initialize: ( + status: Privy::Models::external_transaction_wallet_action_step_status, + type: Privy::Models::ExternalTransactionWalletActionStep::type_, + ?failure_reason: Privy::FailureReason + ) -> void + + def to_hash: -> { + status: Privy::Models::external_transaction_wallet_action_step_status, + type: Privy::Models::ExternalTransactionWalletActionStep::type_, + failure_reason: Privy::FailureReason + } + + type type_ = :external_transaction + + module Type + extend Privy::Internal::Type::Enum + + EXTERNAL_TRANSACTION: :external_transaction + + def self?.values: -> ::Array[Privy::Models::ExternalTransactionWalletActionStep::type_] + end + end + end +end diff --git a/sig/privy/models/external_transaction_wallet_action_step_status.rbs b/sig/privy/models/external_transaction_wallet_action_step_status.rbs new file mode 100644 index 0000000..32837a0 --- /dev/null +++ b/sig/privy/models/external_transaction_wallet_action_step_status.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type external_transaction_wallet_action_step_status = + :preparing | :queued | :pending | :confirmed | :rejected | :failed + + module ExternalTransactionWalletActionStepStatus + extend Privy::Internal::Type::Enum + + PREPARING: :preparing + QUEUED: :queued + PENDING: :pending + CONFIRMED: :confirmed + REJECTED: :rejected + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::external_transaction_wallet_action_step_status] + end + end +end diff --git a/sig/privy/models/failure_reason.rbs b/sig/privy/models/failure_reason.rbs new file mode 100644 index 0000000..ffafc5a --- /dev/null +++ b/sig/privy/models/failure_reason.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type failure_reason = { message: String, details: top } + + class FailureReason < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_reader details: top? + + def details=: (top) -> top + + def initialize: (message: String, ?details: top) -> void + + def to_hash: -> { message: String, details: top } + end + end +end diff --git a/sig/privy/models/farcaster_authenticate_input.rbs b/sig/privy/models/farcaster_authenticate_input.rbs new file mode 100644 index 0000000..508c2cc --- /dev/null +++ b/sig/privy/models/farcaster_authenticate_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type farcaster_authenticate_input = + { + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + + class FarcasterAuthenticateInput < Privy::Internal::Type::BaseModel + attr_accessor channel_token: String + + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor signature: String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + channel_token: String, + fid: Float, + message: String, + signature: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/farcaster_authenticate_request_body.rbs b/sig/privy/models/farcaster_authenticate_request_body.rbs new file mode 100644 index 0000000..c6b5afb --- /dev/null +++ b/sig/privy/models/farcaster_authenticate_request_body.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type farcaster_authenticate_request_body = + { + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + + class FarcasterAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor channel_token: String + + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor signature: String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + channel_token: String, + fid: Float, + message: String, + signature: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + channel_token: String, + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/farcaster_connect_init_response.rbs b/sig/privy/models/farcaster_connect_init_response.rbs new file mode 100644 index 0000000..8f53788 --- /dev/null +++ b/sig/privy/models/farcaster_connect_init_response.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type farcaster_connect_init_response = + { channel_token: String, connect_uri: String } + + class FarcasterConnectInitResponse < Privy::Internal::Type::BaseModel + attr_accessor channel_token: String + + attr_accessor connect_uri: String + + def initialize: (channel_token: String, connect_uri: String) -> void + + def to_hash: -> { channel_token: String, connect_uri: String } + end + end +end diff --git a/sig/privy/models/farcaster_connect_init_response_body.rbs b/sig/privy/models/farcaster_connect_init_response_body.rbs new file mode 100644 index 0000000..e40d1d4 --- /dev/null +++ b/sig/privy/models/farcaster_connect_init_response_body.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type farcaster_connect_init_response_body = + { channel_token: String, connect_uri: String } + + class FarcasterConnectInitResponseBody < Privy::Internal::Type::BaseModel + attr_accessor channel_token: String + + attr_accessor connect_uri: String + + def initialize: (channel_token: String, connect_uri: String) -> void + + def to_hash: -> { channel_token: String, connect_uri: String } + end + end +end diff --git a/sig/privy/models/farcaster_connect_status_completed_response.rbs b/sig/privy/models/farcaster_connect_status_completed_response.rbs new file mode 100644 index 0000000..726909f --- /dev/null +++ b/sig/privy/models/farcaster_connect_status_completed_response.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type farcaster_connect_status_completed_response = + { + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: Privy::Models::FarcasterConnectStatusCompletedResponse::state, + username: String + } + + class FarcasterConnectStatusCompletedResponse < Privy::Internal::Type::BaseModel + attr_accessor bio: String + + attr_accessor display_name: String + + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor nonce: String + + attr_accessor pfp_url: String + + attr_accessor signature: String + + attr_accessor state: Privy::Models::FarcasterConnectStatusCompletedResponse::state + + attr_accessor username: String + + def initialize: ( + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: Privy::Models::FarcasterConnectStatusCompletedResponse::state, + username: String + ) -> void + + def to_hash: -> { + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: Privy::Models::FarcasterConnectStatusCompletedResponse::state, + username: String + } + + type state = :completed + + module State + extend Privy::Internal::Type::Enum + + COMPLETED: :completed + + def self?.values: -> ::Array[Privy::Models::FarcasterConnectStatusCompletedResponse::state] + end + end + end +end diff --git a/sig/privy/models/farcaster_connect_status_completed_response_body.rbs b/sig/privy/models/farcaster_connect_status_completed_response_body.rbs new file mode 100644 index 0000000..f3ed86c --- /dev/null +++ b/sig/privy/models/farcaster_connect_status_completed_response_body.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type farcaster_connect_status_completed_response_body = + { + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: Privy::Models::FarcasterConnectStatusCompletedResponseBody::state, + username: String + } + + class FarcasterConnectStatusCompletedResponseBody < Privy::Internal::Type::BaseModel + attr_accessor bio: String + + attr_accessor display_name: String + + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor nonce: String + + attr_accessor pfp_url: String + + attr_accessor signature: String + + attr_accessor state: Privy::Models::FarcasterConnectStatusCompletedResponseBody::state + + attr_accessor username: String + + def initialize: ( + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: Privy::Models::FarcasterConnectStatusCompletedResponseBody::state, + username: String + ) -> void + + def to_hash: -> { + bio: String, + display_name: String, + fid: Float, + message: String, + nonce: String, + pfp_url: String, + signature: String, + state: Privy::Models::FarcasterConnectStatusCompletedResponseBody::state, + username: String + } + + type state = :completed + + module State + extend Privy::Internal::Type::Enum + + COMPLETED: :completed + + def self?.values: -> ::Array[Privy::Models::FarcasterConnectStatusCompletedResponseBody::state] + end + end + end +end diff --git a/sig/privy/models/farcaster_connect_status_pending_response.rbs b/sig/privy/models/farcaster_connect_status_pending_response.rbs new file mode 100644 index 0000000..dc6209b --- /dev/null +++ b/sig/privy/models/farcaster_connect_status_pending_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type farcaster_connect_status_pending_response = + { + nonce: String, + state: Privy::Models::FarcasterConnectStatusPendingResponse::state + } + + class FarcasterConnectStatusPendingResponse < Privy::Internal::Type::BaseModel + attr_accessor nonce: String + + attr_accessor state: Privy::Models::FarcasterConnectStatusPendingResponse::state + + def initialize: ( + nonce: String, + state: Privy::Models::FarcasterConnectStatusPendingResponse::state + ) -> void + + def to_hash: -> { + nonce: String, + state: Privy::Models::FarcasterConnectStatusPendingResponse::state + } + + type state = :pending + + module State + extend Privy::Internal::Type::Enum + + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::FarcasterConnectStatusPendingResponse::state] + end + end + end +end diff --git a/sig/privy/models/farcaster_connect_status_pending_response_body.rbs b/sig/privy/models/farcaster_connect_status_pending_response_body.rbs new file mode 100644 index 0000000..72bb486 --- /dev/null +++ b/sig/privy/models/farcaster_connect_status_pending_response_body.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type farcaster_connect_status_pending_response_body = + { + nonce: String, + state: Privy::Models::FarcasterConnectStatusPendingResponseBody::state + } + + class FarcasterConnectStatusPendingResponseBody < Privy::Internal::Type::BaseModel + attr_accessor nonce: String + + attr_accessor state: Privy::Models::FarcasterConnectStatusPendingResponseBody::state + + def initialize: ( + nonce: String, + state: Privy::Models::FarcasterConnectStatusPendingResponseBody::state + ) -> void + + def to_hash: -> { + nonce: String, + state: Privy::Models::FarcasterConnectStatusPendingResponseBody::state + } + + type state = :pending + + module State + extend Privy::Internal::Type::Enum + + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::FarcasterConnectStatusPendingResponseBody::state] + end + end + end +end diff --git a/sig/privy/models/farcaster_init_input.rbs b/sig/privy/models/farcaster_init_input.rbs new file mode 100644 index 0000000..2717555 --- /dev/null +++ b/sig/privy/models/farcaster_init_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type farcaster_init_input = + { token: String, redirect_url: String, relying_party: String } + + class FarcasterInitInput < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader redirect_url: String? + + def redirect_url=: (String) -> String + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + ?token: String, + ?redirect_url: String, + ?relying_party: String + ) -> void + + def to_hash: -> { + token: String, + redirect_url: String, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/farcaster_init_request_body.rbs b/sig/privy/models/farcaster_init_request_body.rbs new file mode 100644 index 0000000..45d6404 --- /dev/null +++ b/sig/privy/models/farcaster_init_request_body.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type farcaster_init_request_body = + { token: String, redirect_url: String, relying_party: String } + + class FarcasterInitRequestBody < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader redirect_url: String? + + def redirect_url=: (String) -> String + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + ?token: String, + ?redirect_url: String, + ?relying_party: String + ) -> void + + def to_hash: -> { + token: String, + redirect_url: String, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/farcaster_link_input.rbs b/sig/privy/models/farcaster_link_input.rbs new file mode 100644 index 0000000..49b363b --- /dev/null +++ b/sig/privy/models/farcaster_link_input.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type farcaster_link_input = + { channel_token: String, fid: Float, message: String, signature: String } + + class FarcasterLinkInput < Privy::Internal::Type::BaseModel + attr_accessor channel_token: String + + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor signature: String + + def initialize: ( + channel_token: String, + fid: Float, + message: String, + signature: String + ) -> void + + def to_hash: -> { + channel_token: String, + fid: Float, + message: String, + signature: String + } + end + end +end diff --git a/sig/privy/models/farcaster_link_request_body.rbs b/sig/privy/models/farcaster_link_request_body.rbs new file mode 100644 index 0000000..4673a40 --- /dev/null +++ b/sig/privy/models/farcaster_link_request_body.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type farcaster_link_request_body = + { channel_token: String, fid: Float, message: String, signature: String } + + class FarcasterLinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor channel_token: String + + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor signature: String + + def initialize: ( + channel_token: String, + fid: Float, + message: String, + signature: String + ) -> void + + def to_hash: -> { + channel_token: String, + fid: Float, + message: String, + signature: String + } + end + end +end diff --git a/sig/privy/models/farcaster_signer_approved.rbs b/sig/privy/models/farcaster_signer_approved.rbs new file mode 100644 index 0000000..2fc88bc --- /dev/null +++ b/sig/privy/models/farcaster_signer_approved.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type farcaster_signer_approved = + { + fid: String, + public_key: String, + status: Privy::Models::FarcasterSignerApproved::status + } + + class FarcasterSignerApproved < Privy::Internal::Type::BaseModel + attr_accessor fid: String + + attr_accessor public_key: String + + attr_accessor status: Privy::Models::FarcasterSignerApproved::status + + def initialize: ( + fid: String, + public_key: String, + status: Privy::Models::FarcasterSignerApproved::status + ) -> void + + def to_hash: -> { + fid: String, + public_key: String, + status: Privy::Models::FarcasterSignerApproved::status + } + + type status = :approved + + module Status + extend Privy::Internal::Type::Enum + + APPROVED: :approved + + def self?.values: -> ::Array[Privy::Models::FarcasterSignerApproved::status] + end + end + end +end diff --git a/sig/privy/models/farcaster_signer_init_pending_approval.rbs b/sig/privy/models/farcaster_signer_init_pending_approval.rbs new file mode 100644 index 0000000..d23c3e4 --- /dev/null +++ b/sig/privy/models/farcaster_signer_init_pending_approval.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type farcaster_signer_init_pending_approval = + { + public_key: String, + signer_approval_url: String, + status: Privy::Models::FarcasterSignerInitPendingApproval::status + } + + class FarcasterSignerInitPendingApproval < Privy::Internal::Type::BaseModel + attr_accessor public_key: String + + attr_accessor signer_approval_url: String + + attr_accessor status: Privy::Models::FarcasterSignerInitPendingApproval::status + + def initialize: ( + public_key: String, + signer_approval_url: String, + status: Privy::Models::FarcasterSignerInitPendingApproval::status + ) -> void + + def to_hash: -> { + public_key: String, + signer_approval_url: String, + status: Privy::Models::FarcasterSignerInitPendingApproval::status + } + + type status = :pending_approval + + module Status + extend Privy::Internal::Type::Enum + + PENDING_APPROVAL: :pending_approval + + def self?.values: -> ::Array[Privy::Models::FarcasterSignerInitPendingApproval::status] + end + end + end +end diff --git a/sig/privy/models/farcaster_signer_init_request_body.rbs b/sig/privy/models/farcaster_signer_init_request_body.rbs new file mode 100644 index 0000000..913d99f --- /dev/null +++ b/sig/privy/models/farcaster_signer_init_request_body.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type farcaster_signer_init_request_body = + { :ed25519_public_key => String, deadline: String } + + class FarcasterSignerInitRequestBody < Privy::Internal::Type::BaseModel + attr_accessor ed25519_public_key: String + + attr_reader deadline: String? + + def deadline=: (String) -> String + + def initialize: (ed25519_public_key: String, ?deadline: String) -> void + + def to_hash: -> { :ed25519_public_key => String, deadline: String } + end + end +end diff --git a/sig/privy/models/farcaster_signer_init_response_body.rbs b/sig/privy/models/farcaster_signer_init_response_body.rbs new file mode 100644 index 0000000..4545b51 --- /dev/null +++ b/sig/privy/models/farcaster_signer_init_response_body.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type farcaster_signer_init_response_body = + Privy::FarcasterSignerInitPendingApproval + | Privy::FarcasterSignerApproved + | Privy::FarcasterSignerRevoked + + module FarcasterSignerInitResponseBody + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::farcaster_signer_init_response_body] + end + end +end diff --git a/sig/privy/models/farcaster_signer_revoked.rbs b/sig/privy/models/farcaster_signer_revoked.rbs new file mode 100644 index 0000000..d096dcd --- /dev/null +++ b/sig/privy/models/farcaster_signer_revoked.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type farcaster_signer_revoked = + { + fid: String, + public_key: String, + status: Privy::Models::FarcasterSignerRevoked::status + } + + class FarcasterSignerRevoked < Privy::Internal::Type::BaseModel + attr_accessor fid: String + + attr_accessor public_key: String + + attr_accessor status: Privy::Models::FarcasterSignerRevoked::status + + def initialize: ( + fid: String, + public_key: String, + status: Privy::Models::FarcasterSignerRevoked::status + ) -> void + + def to_hash: -> { + fid: String, + public_key: String, + status: Privy::Models::FarcasterSignerRevoked::status + } + + type status = :revoked + + module Status + extend Privy::Internal::Type::Enum + + REVOKED: :revoked + + def self?.values: -> ::Array[Privy::Models::FarcasterSignerRevoked::status] + end + end + end +end diff --git a/sig/privy/models/farcaster_signer_status_pending_approval.rbs b/sig/privy/models/farcaster_signer_status_pending_approval.rbs new file mode 100644 index 0000000..7c5ed24 --- /dev/null +++ b/sig/privy/models/farcaster_signer_status_pending_approval.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type farcaster_signer_status_pending_approval = + { + public_key: String, + status: Privy::Models::FarcasterSignerStatusPendingApproval::status + } + + class FarcasterSignerStatusPendingApproval < Privy::Internal::Type::BaseModel + attr_accessor public_key: String + + attr_accessor status: Privy::Models::FarcasterSignerStatusPendingApproval::status + + def initialize: ( + public_key: String, + status: Privy::Models::FarcasterSignerStatusPendingApproval::status + ) -> void + + def to_hash: -> { + public_key: String, + status: Privy::Models::FarcasterSignerStatusPendingApproval::status + } + + type status = :pending_approval + + module Status + extend Privy::Internal::Type::Enum + + PENDING_APPROVAL: :pending_approval + + def self?.values: -> ::Array[Privy::Models::FarcasterSignerStatusPendingApproval::status] + end + end + end +end diff --git a/sig/privy/models/farcaster_signer_status_response_body.rbs b/sig/privy/models/farcaster_signer_status_response_body.rbs new file mode 100644 index 0000000..bdd8328 --- /dev/null +++ b/sig/privy/models/farcaster_signer_status_response_body.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type farcaster_signer_status_response_body = + Privy::FarcasterSignerStatusPendingApproval + | Privy::FarcasterSignerApproved + | Privy::FarcasterSignerRevoked + + module FarcasterSignerStatusResponseBody + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::farcaster_signer_status_response_body] + end + end +end diff --git a/sig/privy/models/farcaster_unlink_input.rbs b/sig/privy/models/farcaster_unlink_input.rbs new file mode 100644 index 0000000..294d5da --- /dev/null +++ b/sig/privy/models/farcaster_unlink_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type farcaster_unlink_input = { fid: Float } + + class FarcasterUnlinkInput < Privy::Internal::Type::BaseModel + attr_accessor fid: Float + + def initialize: (fid: Float) -> void + + def to_hash: -> { fid: Float } + end + end +end diff --git a/sig/privy/models/farcaster_unlink_request_body.rbs b/sig/privy/models/farcaster_unlink_request_body.rbs new file mode 100644 index 0000000..3116e97 --- /dev/null +++ b/sig/privy/models/farcaster_unlink_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type farcaster_unlink_request_body = { fid: Float } + + class FarcasterUnlinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor fid: Float + + def initialize: (fid: Float) -> void + + def to_hash: -> { fid: Float } + end + end +end diff --git a/sig/privy/models/farcaster_v_2_authenticate_input.rbs b/sig/privy/models/farcaster_v_2_authenticate_input.rbs new file mode 100644 index 0000000..229cd6f --- /dev/null +++ b/sig/privy/models/farcaster_v_2_authenticate_input.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type farcaster_v2_authenticate_input = + { + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + + class FarcasterV2AuthenticateInput < Privy::Internal::Type::BaseModel + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor signature: String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + fid: Float, + message: String, + signature: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/farcaster_v_2_authenticate_request_body.rbs b/sig/privy/models/farcaster_v_2_authenticate_request_body.rbs new file mode 100644 index 0000000..d84334a --- /dev/null +++ b/sig/privy/models/farcaster_v_2_authenticate_request_body.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type farcaster_v2_authenticate_request_body = + { + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + + class FarcasterV2AuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor fid: Float + + attr_accessor message: String + + attr_accessor signature: String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + fid: Float, + message: String, + signature: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + fid: Float, + message: String, + signature: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/farcaster_v_2_init_input.rbs b/sig/privy/models/farcaster_v_2_init_input.rbs new file mode 100644 index 0000000..e4e54fd --- /dev/null +++ b/sig/privy/models/farcaster_v_2_init_input.rbs @@ -0,0 +1,11 @@ +module Privy + module Models + type farcaster_v2_init_input = { } + + class FarcasterV2InitInput < Privy::Internal::Type::BaseModel + def initialize: -> void + + def to_hash: -> { } + end + end +end diff --git a/sig/privy/models/farcaster_v_2_init_request_body.rbs b/sig/privy/models/farcaster_v_2_init_request_body.rbs new file mode 100644 index 0000000..db9b37b --- /dev/null +++ b/sig/privy/models/farcaster_v_2_init_request_body.rbs @@ -0,0 +1,11 @@ +module Privy + module Models + type farcaster_v2_init_request_body = { } + + class FarcasterV2InitRequestBody < Privy::Internal::Type::BaseModel + def initialize: -> void + + def to_hash: -> { } + end + end +end diff --git a/sig/privy/models/farcaster_v_2_init_response.rbs b/sig/privy/models/farcaster_v_2_init_response.rbs new file mode 100644 index 0000000..9e8c917 --- /dev/null +++ b/sig/privy/models/farcaster_v_2_init_response.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type farcaster_v2_init_response = { expires_at: String, nonce: String } + + class FarcasterV2InitResponse < Privy::Internal::Type::BaseModel + attr_accessor expires_at: String + + attr_accessor nonce: String + + def initialize: (expires_at: String, nonce: String) -> void + + def to_hash: -> { expires_at: String, nonce: String } + end + end +end diff --git a/sig/privy/models/farcaster_v_2_init_response_body.rbs b/sig/privy/models/farcaster_v_2_init_response_body.rbs new file mode 100644 index 0000000..5207f66 --- /dev/null +++ b/sig/privy/models/farcaster_v_2_init_response_body.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type farcaster_v2_init_response_body = { expires_at: String, nonce: String } + + class FarcasterV2InitResponseBody < Privy::Internal::Type::BaseModel + attr_accessor expires_at: String + + attr_accessor nonce: String + + def initialize: (expires_at: String, nonce: String) -> void + + def to_hash: -> { expires_at: String, nonce: String } + end + end +end diff --git a/sig/privy/models/fiat_amount.rbs b/sig/privy/models/fiat_amount.rbs new file mode 100644 index 0000000..6daaaf4 --- /dev/null +++ b/sig/privy/models/fiat_amount.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class FiatAmount = String + end +end diff --git a/sig/privy/models/fiat_currency_code.rbs b/sig/privy/models/fiat_currency_code.rbs new file mode 100644 index 0000000..78bea40 --- /dev/null +++ b/sig/privy/models/fiat_currency_code.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class FiatCurrencyCode = String + end +end diff --git a/sig/privy/models/fiat_customer_response.rbs b/sig/privy/models/fiat_customer_response.rbs new file mode 100644 index 0000000..fb8ec18 --- /dev/null +++ b/sig/privy/models/fiat_customer_response.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type fiat_customer_response = + Privy::BridgeFiatCustomerResponse + | Privy::BridgeSandboxFiatCustomerResponse + + module FiatCustomerResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::fiat_customer_response] + end + end +end diff --git a/sig/privy/models/fiat_onramp_destination.rbs b/sig/privy/models/fiat_onramp_destination.rbs new file mode 100644 index 0000000..b140d67 --- /dev/null +++ b/sig/privy/models/fiat_onramp_destination.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type fiat_onramp_destination = + { address: String, asset: String, chain: String } + + class FiatOnrampDestination < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor asset: String + + attr_accessor chain: String + + def initialize: (address: String, asset: String, chain: String) -> void + + def to_hash: -> { address: String, asset: String, chain: String } + end + end +end diff --git a/sig/privy/models/fiat_onramp_environment.rbs b/sig/privy/models/fiat_onramp_environment.rbs new file mode 100644 index 0000000..8d8c22d --- /dev/null +++ b/sig/privy/models/fiat_onramp_environment.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type fiat_onramp_environment = :sandbox | :production + + module FiatOnrampEnvironment + extend Privy::Internal::Type::Enum + + SANDBOX: :sandbox + PRODUCTION: :production + + def self?.values: -> ::Array[Privy::Models::fiat_onramp_environment] + end + end +end diff --git a/sig/privy/models/fiat_onramp_provider.rbs b/sig/privy/models/fiat_onramp_provider.rbs new file mode 100644 index 0000000..d847dca --- /dev/null +++ b/sig/privy/models/fiat_onramp_provider.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type fiat_onramp_provider = + :meld + | :"meld-sandbox" + | :moonpay + | :"moonpay-sandbox" + | :coinbase + | :"coinbase-sandbox" + + module FiatOnrampProvider + extend Privy::Internal::Type::Enum + + MELD: :meld + MELD_SANDBOX: :"meld-sandbox" + MOONPAY: :moonpay + MOONPAY_SANDBOX: :"moonpay-sandbox" + COINBASE: :coinbase + COINBASE_SANDBOX: :"coinbase-sandbox" + + def self?.values: -> ::Array[Privy::Models::fiat_onramp_provider] + end + end +end diff --git a/sig/privy/models/fiat_onramp_provider_error.rbs b/sig/privy/models/fiat_onramp_provider_error.rbs new file mode 100644 index 0000000..958ca29 --- /dev/null +++ b/sig/privy/models/fiat_onramp_provider_error.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type fiat_onramp_provider_error = + { error: String, provider: Privy::Models::fiat_onramp_provider } + + class FiatOnrampProviderError < Privy::Internal::Type::BaseModel + attr_accessor error: String + + attr_accessor provider: Privy::Models::fiat_onramp_provider + + def initialize: ( + error: String, + provider: Privy::Models::fiat_onramp_provider + ) -> void + + def to_hash: -> { + error: String, + provider: Privy::Models::fiat_onramp_provider + } + end + end +end diff --git a/sig/privy/models/fiat_onramp_quote.rbs b/sig/privy/models/fiat_onramp_quote.rbs new file mode 100644 index 0000000..4998b06 --- /dev/null +++ b/sig/privy/models/fiat_onramp_quote.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type fiat_onramp_quote = + { + payment_method: String, + provider: Privy::Models::fiat_onramp_provider, + destination_currency_code: String?, + source_amount: Float?, + source_currency_code: String?, + sub_provider: String? + } + + class FiatOnrampQuote < Privy::Internal::Type::BaseModel + attr_accessor payment_method: String + + attr_accessor provider: Privy::Models::fiat_onramp_provider + + attr_accessor destination_currency_code: String? + + attr_accessor source_amount: Float? + + attr_accessor source_currency_code: String? + + attr_accessor sub_provider: String? + + def initialize: ( + payment_method: String, + provider: Privy::Models::fiat_onramp_provider, + ?destination_currency_code: String?, + ?source_amount: Float?, + ?source_currency_code: String?, + ?sub_provider: String? + ) -> void + + def to_hash: -> { + payment_method: String, + provider: Privy::Models::fiat_onramp_provider, + destination_currency_code: String?, + source_amount: Float?, + source_currency_code: String?, + sub_provider: String? + } + end + end +end diff --git a/sig/privy/models/fiat_onramp_source.rbs b/sig/privy/models/fiat_onramp_source.rbs new file mode 100644 index 0000000..a549ccb --- /dev/null +++ b/sig/privy/models/fiat_onramp_source.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type fiat_onramp_source = { amount: String, asset: String } + + class FiatOnrampSource < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor asset: String + + def initialize: (amount: String, asset: String) -> void + + def to_hash: -> { amount: String, asset: String } + end + end +end diff --git a/sig/privy/models/fiat_onramp_transaction_status.rbs b/sig/privy/models/fiat_onramp_transaction_status.rbs new file mode 100644 index 0000000..c7f8012 --- /dev/null +++ b/sig/privy/models/fiat_onramp_transaction_status.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type fiat_onramp_transaction_status = + :pending + | :processing + | :completed + | :failed + | :cancelled + | :refunded + | :unknown + + module FiatOnrampTransactionStatus + extend Privy::Internal::Type::Enum + + PENDING: :pending + PROCESSING: :processing + COMPLETED: :completed + FAILED: :failed + CANCELLED: :cancelled + REFUNDED: :refunded + UNKNOWN: :unknown + + def self?.values: -> ::Array[Privy::Models::fiat_onramp_transaction_status] + end + end +end diff --git a/sig/privy/models/fiat_virtual_account_request.rbs b/sig/privy/models/fiat_virtual_account_request.rbs new file mode 100644 index 0000000..6927bb3 --- /dev/null +++ b/sig/privy/models/fiat_virtual_account_request.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type fiat_virtual_account_request = + Privy::BridgeFiatVirtualAccountRequest + | Privy::BridgeSandboxFiatVirtualAccountRequest + + module FiatVirtualAccountRequest + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::fiat_virtual_account_request] + end + end +end diff --git a/sig/privy/models/fiat_virtual_account_response.rbs b/sig/privy/models/fiat_virtual_account_response.rbs new file mode 100644 index 0000000..ac70cbc --- /dev/null +++ b/sig/privy/models/fiat_virtual_account_response.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type fiat_virtual_account_response = + Privy::BridgeFiatVirtualAccountResponse + | Privy::BridgeSandboxFiatVirtualAccountResponse + + module FiatVirtualAccountResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::fiat_virtual_account_response] + end + end +end diff --git a/sig/privy/models/first_class_chain_type.rbs b/sig/privy/models/first_class_chain_type.rbs new file mode 100644 index 0000000..728b678 --- /dev/null +++ b/sig/privy/models/first_class_chain_type.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type first_class_chain_type = :ethereum | :solana + + module FirstClassChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::first_class_chain_type] + end + end +end diff --git a/sig/privy/models/funding_config_response_schema.rbs b/sig/privy/models/funding_config_response_schema.rbs new file mode 100644 index 0000000..1475265 --- /dev/null +++ b/sig/privy/models/funding_config_response_schema.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type funding_config_response_schema = + { + cross_chain_bridging_enabled: bool, + default_recommended_amount: String, + default_recommended_currency: Privy::Currency, + methods_: ::Array[Privy::Models::funding_method_enum], + options: ::Array[Privy::FundingOption], + prompt_funding_on_wallet_creation: bool + } + + class FundingConfigResponseSchema < Privy::Internal::Type::BaseModel + attr_accessor cross_chain_bridging_enabled: bool + + attr_accessor default_recommended_amount: String + + attr_accessor default_recommended_currency: Privy::Currency + + attr_accessor methods_: ::Array[Privy::Models::funding_method_enum] + + attr_accessor options: ::Array[Privy::FundingOption] + + attr_accessor prompt_funding_on_wallet_creation: bool + + def initialize: ( + cross_chain_bridging_enabled: bool, + default_recommended_amount: String, + default_recommended_currency: Privy::Currency, + methods_: ::Array[Privy::Models::funding_method_enum], + options: ::Array[Privy::FundingOption], + prompt_funding_on_wallet_creation: bool + ) -> void + + def to_hash: -> { + cross_chain_bridging_enabled: bool, + default_recommended_amount: String, + default_recommended_currency: Privy::Currency, + methods_: ::Array[Privy::Models::funding_method_enum], + options: ::Array[Privy::FundingOption], + prompt_funding_on_wallet_creation: bool + } + end + end +end diff --git a/sig/privy/models/funding_method_enum.rbs b/sig/privy/models/funding_method_enum.rbs new file mode 100644 index 0000000..ee231bd --- /dev/null +++ b/sig/privy/models/funding_method_enum.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type funding_method_enum = :moonpay | :"coinbase-onramp" | :external + + module FundingMethodEnum + extend Privy::Internal::Type::Enum + + MOONPAY: :moonpay + COINBASE_ONRAMP: :"coinbase-onramp" + EXTERNAL: :external + + def self?.values: -> ::Array[Privy::Models::funding_method_enum] + end + end +end diff --git a/sig/privy/models/funding_option.rbs b/sig/privy/models/funding_option.rbs new file mode 100644 index 0000000..c370c63 --- /dev/null +++ b/sig/privy/models/funding_option.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type funding_option = { method_: String, provider: String } + + class FundingOption < Privy::Internal::Type::BaseModel + attr_accessor method_: String + + attr_accessor provider: String + + def initialize: (method_: String, provider: String) -> void + + def to_hash: -> { method_: String, provider: String } + end + end +end diff --git a/sig/privy/models/funds_deposited_webhook_payload.rbs b/sig/privy/models/funds_deposited_webhook_payload.rbs new file mode 100644 index 0000000..34b701b --- /dev/null +++ b/sig/privy/models/funds_deposited_webhook_payload.rbs @@ -0,0 +1,103 @@ +module Privy + module Models + type funds_deposited_webhook_payload = + { + amount: String, + asset: Privy::Models::wallet_funds_asset, + block: Privy::FundsDepositedWebhookPayload::Block, + :caip2 => String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::Models::FundsDepositedWebhookPayload::type_, + wallet_id: String, + bridge_metadata: Privy::Models::bridge_metadata, + transaction_fee: String + } + + class FundsDepositedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor asset: Privy::Models::wallet_funds_asset + + attr_accessor block: Privy::FundsDepositedWebhookPayload::Block + + attr_accessor caip2: String + + attr_accessor idempotency_key: String + + attr_accessor recipient: String + + attr_accessor sender: String + + attr_accessor transaction_hash: String + + attr_accessor type: Privy::Models::FundsDepositedWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_reader bridge_metadata: Privy::Models::bridge_metadata? + + def bridge_metadata=: ( + Privy::Models::bridge_metadata + ) -> Privy::Models::bridge_metadata + + attr_reader transaction_fee: String? + + def transaction_fee=: (String) -> String + + def initialize: ( + amount: String, + asset: Privy::Models::wallet_funds_asset, + block: Privy::FundsDepositedWebhookPayload::Block, + caip2: String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::Models::FundsDepositedWebhookPayload::type_, + wallet_id: String, + ?bridge_metadata: Privy::Models::bridge_metadata, + ?transaction_fee: String + ) -> void + + def to_hash: -> { + amount: String, + asset: Privy::Models::wallet_funds_asset, + block: Privy::FundsDepositedWebhookPayload::Block, + :caip2 => String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::Models::FundsDepositedWebhookPayload::type_, + wallet_id: String, + bridge_metadata: Privy::Models::bridge_metadata, + transaction_fee: String + } + + type block = { number: Float, timestamp: Float } + + class Block < Privy::Internal::Type::BaseModel + attr_accessor number: Float + + attr_accessor timestamp: Float + + def initialize: (number: Float, timestamp: Float) -> void + + def to_hash: -> { number: Float, timestamp: Float } + end + + type type_ = :"wallet.funds_deposited" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_FUNDS_DEPOSITED: :"wallet.funds_deposited" + + def self?.values: -> ::Array[Privy::Models::FundsDepositedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/funds_withdrawn_webhook_payload.rbs b/sig/privy/models/funds_withdrawn_webhook_payload.rbs new file mode 100644 index 0000000..05b3dd3 --- /dev/null +++ b/sig/privy/models/funds_withdrawn_webhook_payload.rbs @@ -0,0 +1,94 @@ +module Privy + module Models + type funds_withdrawn_webhook_payload = + { + amount: String, + asset: Privy::Models::wallet_funds_asset, + block: Privy::FundsWithdrawnWebhookPayload::Block, + :caip2 => String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::Models::FundsWithdrawnWebhookPayload::type_, + wallet_id: String, + transaction_fee: String + } + + class FundsWithdrawnWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor asset: Privy::Models::wallet_funds_asset + + attr_accessor block: Privy::FundsWithdrawnWebhookPayload::Block + + attr_accessor caip2: String + + attr_accessor idempotency_key: String + + attr_accessor recipient: String + + attr_accessor sender: String + + attr_accessor transaction_hash: String + + attr_accessor type: Privy::Models::FundsWithdrawnWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_reader transaction_fee: String? + + def transaction_fee=: (String) -> String + + def initialize: ( + amount: String, + asset: Privy::Models::wallet_funds_asset, + block: Privy::FundsWithdrawnWebhookPayload::Block, + caip2: String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::Models::FundsWithdrawnWebhookPayload::type_, + wallet_id: String, + ?transaction_fee: String + ) -> void + + def to_hash: -> { + amount: String, + asset: Privy::Models::wallet_funds_asset, + block: Privy::FundsWithdrawnWebhookPayload::Block, + :caip2 => String, + idempotency_key: String, + recipient: String, + sender: String, + transaction_hash: String, + type: Privy::Models::FundsWithdrawnWebhookPayload::type_, + wallet_id: String, + transaction_fee: String + } + + type block = { number: Float, timestamp: Float } + + class Block < Privy::Internal::Type::BaseModel + attr_accessor number: Float + + attr_accessor timestamp: Float + + def initialize: (number: Float, timestamp: Float) -> void + + def to_hash: -> { number: Float, timestamp: Float } + end + + type type_ = :"wallet.funds_withdrawn" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_FUNDS_WITHDRAWN: :"wallet.funds_withdrawn" + + def self?.values: -> ::Array[Privy::Models::FundsWithdrawnWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/gas_spend_currency.rbs b/sig/privy/models/gas_spend_currency.rbs new file mode 100644 index 0000000..876a111 --- /dev/null +++ b/sig/privy/models/gas_spend_currency.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type gas_spend_currency = :usd + + module GasSpendCurrency + extend Privy::Internal::Type::Enum + + USD: :usd + + def self?.values: -> ::Array[Privy::Models::gas_spend_currency] + end + end +end diff --git a/sig/privy/models/gas_spend_request_body.rbs b/sig/privy/models/gas_spend_request_body.rbs new file mode 100644 index 0000000..8409355 --- /dev/null +++ b/sig/privy/models/gas_spend_request_body.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type gas_spend_request_body = + { + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: ::Array[String] + } + + class GasSpendRequestBody < Privy::Internal::Type::BaseModel + attr_accessor end_timestamp: Float + + attr_accessor start_timestamp: Float + + attr_accessor wallet_ids: ::Array[String] + + def initialize: ( + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: ::Array[String] + ) -> void + + def to_hash: -> { + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/gas_spend_response_body.rbs b/sig/privy/models/gas_spend_response_body.rbs new file mode 100644 index 0000000..583856f --- /dev/null +++ b/sig/privy/models/gas_spend_response_body.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type gas_spend_response_body = + { currency: Privy::Models::gas_spend_currency, value: String } + + class GasSpendResponseBody < Privy::Internal::Type::BaseModel + attr_accessor currency: Privy::Models::gas_spend_currency + + attr_accessor value: String + + def initialize: ( + currency: Privy::Models::gas_spend_currency, + value: String + ) -> void + + def to_hash: -> { + currency: Privy::Models::gas_spend_currency, + value: String + } + end + end +end diff --git a/sig/privy/models/gas_sponsorship_configuration.rbs b/sig/privy/models/gas_sponsorship_configuration.rbs new file mode 100644 index 0000000..6dde679 --- /dev/null +++ b/sig/privy/models/gas_sponsorship_configuration.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type gas_sponsorship_configuration = + { + configured_networks: ::Array[String], + require_app_secret: bool, + sponsorship_enabled: bool + } + + class GasSponsorshipConfiguration < Privy::Internal::Type::BaseModel + attr_accessor configured_networks: ::Array[String] + + attr_accessor require_app_secret: bool + + attr_accessor sponsorship_enabled: bool + + def initialize: ( + configured_networks: ::Array[String], + require_app_secret: bool, + sponsorship_enabled: bool + ) -> void + + def to_hash: -> { + configured_networks: ::Array[String], + require_app_secret: bool, + sponsorship_enabled: bool + } + end + end +end diff --git a/sig/privy/models/gas_sponsorship_configuration_input.rbs b/sig/privy/models/gas_sponsorship_configuration_input.rbs new file mode 100644 index 0000000..e8ca936 --- /dev/null +++ b/sig/privy/models/gas_sponsorship_configuration_input.rbs @@ -0,0 +1,36 @@ +module Privy + module Models + type gas_sponsorship_configuration_input = + { + configured_networks: ::Array[String], + require_app_secret: bool, + sponsorship_enabled: bool + } + + class GasSponsorshipConfigurationInput < Privy::Internal::Type::BaseModel + attr_reader configured_networks: ::Array[String]? + + def configured_networks=: (::Array[String]) -> ::Array[String] + + attr_reader require_app_secret: bool? + + def require_app_secret=: (bool) -> bool + + attr_reader sponsorship_enabled: bool? + + def sponsorship_enabled=: (bool) -> bool + + def initialize: ( + ?configured_networks: ::Array[String], + ?require_app_secret: bool, + ?sponsorship_enabled: bool + ) -> void + + def to_hash: -> { + configured_networks: ::Array[String], + require_app_secret: bool, + sponsorship_enabled: bool + } + end + end +end diff --git a/sig/privy/models/get_by_wallet_address_request_body.rbs b/sig/privy/models/get_by_wallet_address_request_body.rbs new file mode 100644 index 0000000..2735e75 --- /dev/null +++ b/sig/privy/models/get_by_wallet_address_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type get_by_wallet_address_request_body = { address: String } + + class GetByWalletAddressRequestBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/get_fiat_customer_request_input.rbs b/sig/privy/models/get_fiat_customer_request_input.rbs new file mode 100644 index 0000000..236331d --- /dev/null +++ b/sig/privy/models/get_fiat_customer_request_input.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type get_fiat_customer_request_input = + { provider: Privy::Models::onramp_provider, kyc_redirect_url: String } + + class GetFiatCustomerRequestInput < Privy::Internal::Type::BaseModel + attr_accessor provider: Privy::Models::onramp_provider + + attr_reader kyc_redirect_url: String? + + def kyc_redirect_url=: (String) -> String + + def initialize: ( + provider: Privy::Models::onramp_provider, + ?kyc_redirect_url: String + ) -> void + + def to_hash: -> { + provider: Privy::Models::onramp_provider, + kyc_redirect_url: String + } + end + end +end diff --git a/sig/privy/models/get_fiat_onramp_quotes_input.rbs b/sig/privy/models/get_fiat_onramp_quotes_input.rbs new file mode 100644 index 0000000..27d71ad --- /dev/null +++ b/sig/privy/models/get_fiat_onramp_quotes_input.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type get_fiat_onramp_quotes_input = + { + destination: Privy::FiatOnrampDestination, + environment: Privy::Models::fiat_onramp_environment, + source: Privy::FiatOnrampSource + } + + class GetFiatOnrampQuotesInput < Privy::Internal::Type::BaseModel + attr_accessor destination: Privy::FiatOnrampDestination + + attr_accessor environment: Privy::Models::fiat_onramp_environment + + attr_accessor source: Privy::FiatOnrampSource + + def initialize: ( + destination: Privy::FiatOnrampDestination, + environment: Privy::Models::fiat_onramp_environment, + source: Privy::FiatOnrampSource + ) -> void + + def to_hash: -> { + destination: Privy::FiatOnrampDestination, + environment: Privy::Models::fiat_onramp_environment, + source: Privy::FiatOnrampSource + } + end + end +end diff --git a/sig/privy/models/get_fiat_onramp_quotes_response.rbs b/sig/privy/models/get_fiat_onramp_quotes_response.rbs new file mode 100644 index 0000000..17e07c8 --- /dev/null +++ b/sig/privy/models/get_fiat_onramp_quotes_response.rbs @@ -0,0 +1,29 @@ +module Privy + module Models + type get_fiat_onramp_quotes_response = + { + quotes: ::Array[Privy::FiatOnrampQuote], + provider_errors: ::Array[Privy::FiatOnrampProviderError] + } + + class GetFiatOnrampQuotesResponse < Privy::Internal::Type::BaseModel + attr_accessor quotes: ::Array[Privy::FiatOnrampQuote] + + attr_reader provider_errors: ::Array[Privy::FiatOnrampProviderError]? + + def provider_errors=: ( + ::Array[Privy::FiatOnrampProviderError] + ) -> ::Array[Privy::FiatOnrampProviderError] + + def initialize: ( + quotes: ::Array[Privy::FiatOnrampQuote], + ?provider_errors: ::Array[Privy::FiatOnrampProviderError] + ) -> void + + def to_hash: -> { + quotes: ::Array[Privy::FiatOnrampQuote], + provider_errors: ::Array[Privy::FiatOnrampProviderError] + } + end + end +end diff --git a/sig/privy/models/get_fiat_onramp_transaction_status_input.rbs b/sig/privy/models/get_fiat_onramp_transaction_status_input.rbs new file mode 100644 index 0000000..b96b2e3 --- /dev/null +++ b/sig/privy/models/get_fiat_onramp_transaction_status_input.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type get_fiat_onramp_transaction_status_input = + { provider: Privy::Models::fiat_onramp_provider, session_id: String } + + class GetFiatOnrampTransactionStatusInput < Privy::Internal::Type::BaseModel + attr_accessor provider: Privy::Models::fiat_onramp_provider + + attr_accessor session_id: String + + def initialize: ( + provider: Privy::Models::fiat_onramp_provider, + session_id: String + ) -> void + + def to_hash: -> { + provider: Privy::Models::fiat_onramp_provider, + session_id: String + } + end + end +end diff --git a/sig/privy/models/get_fiat_onramp_transaction_status_response.rbs b/sig/privy/models/get_fiat_onramp_transaction_status_response.rbs new file mode 100644 index 0000000..0c3268b --- /dev/null +++ b/sig/privy/models/get_fiat_onramp_transaction_status_response.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type get_fiat_onramp_transaction_status_response = + { + raw_status: String, + session_id: String, + status: Privy::Models::fiat_onramp_transaction_status, + transaction_id: String + } + + class GetFiatOnrampTransactionStatusResponse < Privy::Internal::Type::BaseModel + attr_accessor raw_status: String + + attr_accessor session_id: String + + attr_accessor status: Privy::Models::fiat_onramp_transaction_status + + attr_reader transaction_id: String? + + def transaction_id=: (String) -> String + + def initialize: ( + raw_status: String, + session_id: String, + status: Privy::Models::fiat_onramp_transaction_status, + ?transaction_id: String + ) -> void + + def to_hash: -> { + raw_status: String, + session_id: String, + status: Privy::Models::fiat_onramp_transaction_status, + transaction_id: String + } + end + end +end diff --git a/sig/privy/models/get_fiat_onramp_url_input.rbs b/sig/privy/models/get_fiat_onramp_url_input.rbs new file mode 100644 index 0000000..3ab9bc2 --- /dev/null +++ b/sig/privy/models/get_fiat_onramp_url_input.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type get_fiat_onramp_url_input = + { + destination: Privy::FiatOnrampDestination, + payment_method: String, + provider: Privy::Models::fiat_onramp_provider, + source: Privy::FiatOnrampSource, + redirect_url: String, + sub_provider: String + } + + class GetFiatOnrampURLInput < Privy::Internal::Type::BaseModel + attr_accessor destination: Privy::FiatOnrampDestination + + attr_accessor payment_method: String + + attr_accessor provider: Privy::Models::fiat_onramp_provider + + attr_accessor source: Privy::FiatOnrampSource + + attr_reader redirect_url: String? + + def redirect_url=: (String) -> String + + attr_reader sub_provider: String? + + def sub_provider=: (String) -> String + + def initialize: ( + destination: Privy::FiatOnrampDestination, + payment_method: String, + provider: Privy::Models::fiat_onramp_provider, + source: Privy::FiatOnrampSource, + ?redirect_url: String, + ?sub_provider: String + ) -> void + + def to_hash: -> { + destination: Privy::FiatOnrampDestination, + payment_method: String, + provider: Privy::Models::fiat_onramp_provider, + source: Privy::FiatOnrampSource, + redirect_url: String, + sub_provider: String + } + end + end +end diff --git a/sig/privy/models/get_fiat_onramp_url_response.rbs b/sig/privy/models/get_fiat_onramp_url_response.rbs new file mode 100644 index 0000000..a19f31d --- /dev/null +++ b/sig/privy/models/get_fiat_onramp_url_response.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type get_fiat_onramp_url_response = { session_id: String, url: String } + + class GetFiatOnrampURLResponse < Privy::Internal::Type::BaseModel + attr_accessor session_id: String + + attr_accessor url: String + + def initialize: (session_id: String, url: String) -> void + + def to_hash: -> { session_id: String, url: String } + end + end +end diff --git a/sig/privy/models/guest_authenticate_request_body.rbs b/sig/privy/models/guest_authenticate_request_body.rbs new file mode 100644 index 0000000..3b1c8e8 --- /dev/null +++ b/sig/privy/models/guest_authenticate_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type guest_authenticate_request_body = { guest_credential: String } + + class GuestAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor guest_credential: String + + def initialize: (guest_credential: String) -> void + + def to_hash: -> { guest_credential: String } + end + end +end diff --git a/sig/privy/models/hd_init_input.rbs b/sig/privy/models/hd_init_input.rbs new file mode 100644 index 0000000..122d445 --- /dev/null +++ b/sig/privy/models/hd_init_input.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type hd_init_input = + { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::HDInitInput::entropy_type, + index: Integer + } + + class HDInitInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::wallet_import_supported_chains + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_accessor entropy_type: Privy::Models::HDInitInput::entropy_type + + attr_accessor index: Integer + + def initialize: ( + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::HDInitInput::entropy_type, + index: Integer + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::HDInitInput::entropy_type, + index: Integer + } + + type entropy_type = :hd + + module EntropyType + extend Privy::Internal::Type::Enum + + HD: :hd + + def self?.values: -> ::Array[Privy::Models::HDInitInput::entropy_type] + end + end + end +end diff --git a/sig/privy/models/hd_path.rbs b/sig/privy/models/hd_path.rbs new file mode 100644 index 0000000..16cd521 --- /dev/null +++ b/sig/privy/models/hd_path.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class HDPath = String + end +end diff --git a/sig/privy/models/hd_submit_input.rbs b/sig/privy/models/hd_submit_input.rbs new file mode 100644 index 0000000..9bc7a6d --- /dev/null +++ b/sig/privy/models/hd_submit_input.rbs @@ -0,0 +1,67 @@ +module Privy + module Models + type hd_submit_input = + { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::HDSubmitInput::entropy_type, + index: Integer, + hpke_config: Privy::HpkeImportConfig + } + + class HDSubmitInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::wallet_import_supported_chains + + attr_accessor ciphertext: String + + attr_accessor encapsulated_key: String + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_accessor entropy_type: Privy::Models::HDSubmitInput::entropy_type + + attr_accessor index: Integer + + attr_reader hpke_config: Privy::HpkeImportConfig? + + def hpke_config=: (Privy::HpkeImportConfig) -> Privy::HpkeImportConfig + + def initialize: ( + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::HDSubmitInput::entropy_type, + index: Integer, + ?hpke_config: Privy::HpkeImportConfig + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::HDSubmitInput::entropy_type, + index: Integer, + hpke_config: Privy::HpkeImportConfig + } + + type entropy_type = :hd + + module EntropyType + extend Privy::Internal::Type::Enum + + HD: :hd + + def self?.values: -> ::Array[Privy::Models::HDSubmitInput::entropy_type] + end + end + end +end diff --git a/sig/privy/models/hex.rbs b/sig/privy/models/hex.rbs new file mode 100644 index 0000000..f357917 --- /dev/null +++ b/sig/privy/models/hex.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class Hex = String + end +end diff --git a/sig/privy/models/hpke_aead_algorithm.rbs b/sig/privy/models/hpke_aead_algorithm.rbs new file mode 100644 index 0000000..edeb7c6 --- /dev/null +++ b/sig/privy/models/hpke_aead_algorithm.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type hpke_aead_algorithm = :CHACHA20_POLY1305 | :AES_GCM256 + + module HpkeAeadAlgorithm + extend Privy::Internal::Type::Enum + + CHACHA20_POLY1305: :CHACHA20_POLY1305 + AES_GCM256: :AES_GCM256 + + def self?.values: -> ::Array[Privy::Models::hpke_aead_algorithm] + end + end +end diff --git a/sig/privy/models/hpke_encryption.rbs b/sig/privy/models/hpke_encryption.rbs new file mode 100644 index 0000000..6a59073 --- /dev/null +++ b/sig/privy/models/hpke_encryption.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type hpke_encryption = :HPKE + + module HpkeEncryption + extend Privy::Internal::Type::Enum + + HPKE: :HPKE + + def self?.values: -> ::Array[Privy::Models::hpke_encryption] + end + end +end diff --git a/sig/privy/models/hpke_import_config.rbs b/sig/privy/models/hpke_import_config.rbs new file mode 100644 index 0000000..cdc4164 --- /dev/null +++ b/sig/privy/models/hpke_import_config.rbs @@ -0,0 +1,38 @@ +module Privy + module Models + type hpke_import_config = + { + aad: String, + aead_algorithm: Privy::Models::hpke_aead_algorithm, + info: String + } + + class HpkeImportConfig < Privy::Internal::Type::BaseModel + attr_reader aad: String? + + def aad=: (String) -> String + + attr_reader aead_algorithm: Privy::Models::hpke_aead_algorithm? + + def aead_algorithm=: ( + Privy::Models::hpke_aead_algorithm + ) -> Privy::Models::hpke_aead_algorithm + + attr_reader info: String? + + def info=: (String) -> String + + def initialize: ( + ?aad: String, + ?aead_algorithm: Privy::Models::hpke_aead_algorithm, + ?info: String + ) -> void + + def to_hash: -> { + aad: String, + aead_algorithm: Privy::Models::hpke_aead_algorithm, + info: String + } + end + end +end diff --git a/sig/privy/models/icloud_client_type.rbs b/sig/privy/models/icloud_client_type.rbs new file mode 100644 index 0000000..5166eed --- /dev/null +++ b/sig/privy/models/icloud_client_type.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type icloud_client_type = :web | :"expo-ios" + + module ICloudClientType + extend Privy::Internal::Type::Enum + + WEB: :web + EXPO_IOS: :"expo-ios" + + def self?.values: -> ::Array[Privy::Models::icloud_client_type] + end + end +end diff --git a/sig/privy/models/intent_authorization.rbs b/sig/privy/models/intent_authorization.rbs new file mode 100644 index 0000000..4ca8310 --- /dev/null +++ b/sig/privy/models/intent_authorization.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type intent_authorization = + { + members: ::Array[Privy::Models::intent_authorization_member], + threshold: Float, + display_name: String + } + + class IntentAuthorization < Privy::Internal::Type::BaseModel + attr_accessor members: ::Array[Privy::Models::intent_authorization_member] + + attr_accessor threshold: Float + + attr_reader display_name: String? + + def display_name=: (String) -> String + + def initialize: ( + members: ::Array[Privy::Models::intent_authorization_member], + threshold: Float, + ?display_name: String + ) -> void + + def to_hash: -> { + members: ::Array[Privy::Models::intent_authorization_member], + threshold: Float, + display_name: String + } + end + end +end diff --git a/sig/privy/models/intent_authorization_key_quorum_member.rbs b/sig/privy/models/intent_authorization_key_quorum_member.rbs new file mode 100644 index 0000000..4e7be5c --- /dev/null +++ b/sig/privy/models/intent_authorization_key_quorum_member.rbs @@ -0,0 +1,87 @@ +module Privy + module Models + type intent_authorization_key_quorum_member = + Privy::IntentAuthorizationKeyQuorumMember::UserMember + | Privy::IntentAuthorizationKeyQuorumMember::KeyMember + + module IntentAuthorizationKeyQuorumMember + extend Privy::Internal::Type::Union + + type user_member = + { + signed_at: Float?, + type: Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember::type_, + user_id: String + } + + class UserMember < Privy::Internal::Type::BaseModel + attr_accessor signed_at: Float? + + attr_accessor type: Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember::type_ + + attr_accessor user_id: String + + def initialize: ( + signed_at: Float?, + type: Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember::type_, + user_id: String + ) -> void + + def to_hash: -> { + signed_at: Float?, + type: Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember::type_, + user_id: String + } + + type type_ = :user + + module Type + extend Privy::Internal::Type::Enum + + USER: :user + + def self?.values: -> ::Array[Privy::Models::IntentAuthorizationKeyQuorumMember::UserMember::type_] + end + end + + type key_member = + { + public_key: String, + signed_at: Float?, + type: Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember::type_ + } + + class KeyMember < Privy::Internal::Type::BaseModel + attr_accessor public_key: String + + attr_accessor signed_at: Float? + + attr_accessor type: Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember::type_ + + def initialize: ( + public_key: String, + signed_at: Float?, + type: Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember::type_ + ) -> void + + def to_hash: -> { + public_key: String, + signed_at: Float?, + type: Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember::type_ + } + + type type_ = :key + + module Type + extend Privy::Internal::Type::Enum + + KEY: :key + + def self?.values: -> ::Array[Privy::Models::IntentAuthorizationKeyQuorumMember::KeyMember::type_] + end + end + + def self?.variants: -> ::Array[Privy::Models::intent_authorization_key_quorum_member] + end + end +end diff --git a/sig/privy/models/intent_authorization_member.rbs b/sig/privy/models/intent_authorization_member.rbs new file mode 100644 index 0000000..4f5f3ed --- /dev/null +++ b/sig/privy/models/intent_authorization_member.rbs @@ -0,0 +1,142 @@ +module Privy + module Models + type intent_authorization_member = + Privy::IntentAuthorizationMember::UserMember + | Privy::IntentAuthorizationMember::KeyMember + | Privy::IntentAuthorizationMember::KeyQuorumMember + + module IntentAuthorizationMember + extend Privy::Internal::Type::Union + + type user_member = + { + signed_at: Float?, + type: Privy::Models::IntentAuthorizationMember::UserMember::type_, + user_id: String + } + + class UserMember < Privy::Internal::Type::BaseModel + attr_accessor signed_at: Float? + + attr_accessor type: Privy::Models::IntentAuthorizationMember::UserMember::type_ + + attr_accessor user_id: String + + def initialize: ( + signed_at: Float?, + type: Privy::Models::IntentAuthorizationMember::UserMember::type_, + user_id: String + ) -> void + + def to_hash: -> { + signed_at: Float?, + type: Privy::Models::IntentAuthorizationMember::UserMember::type_, + user_id: String + } + + type type_ = :user + + module Type + extend Privy::Internal::Type::Enum + + USER: :user + + def self?.values: -> ::Array[Privy::Models::IntentAuthorizationMember::UserMember::type_] + end + end + + type key_member = + { + public_key: String, + signed_at: Float?, + type: Privy::Models::IntentAuthorizationMember::KeyMember::type_ + } + + class KeyMember < Privy::Internal::Type::BaseModel + attr_accessor public_key: String + + attr_accessor signed_at: Float? + + attr_accessor type: Privy::Models::IntentAuthorizationMember::KeyMember::type_ + + def initialize: ( + public_key: String, + signed_at: Float?, + type: Privy::Models::IntentAuthorizationMember::KeyMember::type_ + ) -> void + + def to_hash: -> { + public_key: String, + signed_at: Float?, + type: Privy::Models::IntentAuthorizationMember::KeyMember::type_ + } + + type type_ = :key + + module Type + extend Privy::Internal::Type::Enum + + KEY: :key + + def self?.values: -> ::Array[Privy::Models::IntentAuthorizationMember::KeyMember::type_] + end + end + + type key_quorum_member = + { + key_quorum_id: String, + members: ::Array[Privy::Models::intent_authorization_key_quorum_member], + threshold: Float, + threshold_met: bool, + type: Privy::Models::IntentAuthorizationMember::KeyQuorumMember::type_, + display_name: String + } + + class KeyQuorumMember < Privy::Internal::Type::BaseModel + attr_accessor key_quorum_id: String + + attr_accessor members: ::Array[Privy::Models::intent_authorization_key_quorum_member] + + attr_accessor threshold: Float + + attr_accessor threshold_met: bool + + attr_accessor type: Privy::Models::IntentAuthorizationMember::KeyQuorumMember::type_ + + attr_reader display_name: String? + + def display_name=: (String) -> String + + def initialize: ( + key_quorum_id: String, + members: ::Array[Privy::Models::intent_authorization_key_quorum_member], + threshold: Float, + threshold_met: bool, + type: Privy::Models::IntentAuthorizationMember::KeyQuorumMember::type_, + ?display_name: String + ) -> void + + def to_hash: -> { + key_quorum_id: String, + members: ::Array[Privy::Models::intent_authorization_key_quorum_member], + threshold: Float, + threshold_met: bool, + type: Privy::Models::IntentAuthorizationMember::KeyQuorumMember::type_, + display_name: String + } + + type type_ = :key_quorum + + module Type + extend Privy::Internal::Type::Enum + + KEY_QUORUM: :key_quorum + + def self?.values: -> ::Array[Privy::Models::IntentAuthorizationMember::KeyQuorumMember::type_] + end + end + + def self?.variants: -> ::Array[Privy::Models::intent_authorization_member] + end + end +end diff --git a/sig/privy/models/intent_authorized_webhook_payload.rbs b/sig/privy/models/intent_authorized_webhook_payload.rbs new file mode 100644 index 0000000..6df961d --- /dev/null +++ b/sig/privy/models/intent_authorized_webhook_payload.rbs @@ -0,0 +1,79 @@ +module Privy + module Models + type intent_authorized_webhook_payload = + { + authorized_at: Float, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + member: Privy::Models::intent_authorization_key_quorum_member, + status: String, + type: Privy::Models::IntentAuthorizedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + class IntentAuthorizedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor authorized_at: Float + + attr_accessor created_at: Float + + attr_accessor expires_at: Float + + attr_accessor intent_id: String + + attr_accessor intent_type: Privy::Models::intent_type + + attr_accessor member: Privy::Models::intent_authorization_key_quorum_member + + attr_accessor status: String + + attr_accessor type: Privy::Models::IntentAuthorizedWebhookPayload::type_ + + attr_reader created_by_display_name: String? + + def created_by_display_name=: (String) -> String + + attr_reader created_by_id: String? + + def created_by_id=: (String) -> String + + def initialize: ( + authorized_at: Float, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + member: Privy::Models::intent_authorization_key_quorum_member, + status: String, + type: Privy::Models::IntentAuthorizedWebhookPayload::type_, + ?created_by_display_name: String, + ?created_by_id: String + ) -> void + + def to_hash: -> { + authorized_at: Float, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + member: Privy::Models::intent_authorization_key_quorum_member, + status: String, + type: Privy::Models::IntentAuthorizedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + type type_ = :"intent.authorized" + + module Type + extend Privy::Internal::Type::Enum + + INTENT_AUTHORIZED: :"intent.authorized" + + def self?.values: -> ::Array[Privy::Models::IntentAuthorizedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/intent_create_policy_rule_params.rbs b/sig/privy/models/intent_create_policy_rule_params.rbs new file mode 100644 index 0000000..0b9c5d2 --- /dev/null +++ b/sig/privy/models/intent_create_policy_rule_params.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type intent_create_policy_rule_params = + { policy_id: String, privy_request_expiry: String } + & Privy::Internal::Type::request_parameters + + class IntentCreatePolicyRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def policy_id: -> String + + def policy_id=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + policy_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_created_webhook_payload.rbs b/sig/privy/models/intent_created_webhook_payload.rbs new file mode 100644 index 0000000..c7d7198 --- /dev/null +++ b/sig/privy/models/intent_created_webhook_payload.rbs @@ -0,0 +1,78 @@ +module Privy + module Models + type intent_created_webhook_payload = + { + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentCreatedWebhookPayload::type_, + authorization_details: ::Array[Privy::IntentAuthorization], + created_by_display_name: String, + created_by_id: String + } + + class IntentCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor created_at: Float + + attr_accessor expires_at: Float + + attr_accessor intent_id: String + + attr_accessor intent_type: Privy::Models::intent_type + + attr_accessor status: String + + attr_accessor type: Privy::Models::IntentCreatedWebhookPayload::type_ + + attr_reader authorization_details: ::Array[Privy::IntentAuthorization]? + + def authorization_details=: ( + ::Array[Privy::IntentAuthorization] + ) -> ::Array[Privy::IntentAuthorization] + + attr_reader created_by_display_name: String? + + def created_by_display_name=: (String) -> String + + attr_reader created_by_id: String? + + def created_by_id=: (String) -> String + + def initialize: ( + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentCreatedWebhookPayload::type_, + ?authorization_details: ::Array[Privy::IntentAuthorization], + ?created_by_display_name: String, + ?created_by_id: String + ) -> void + + def to_hash: -> { + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentCreatedWebhookPayload::type_, + authorization_details: ::Array[Privy::IntentAuthorization], + created_by_display_name: String, + created_by_id: String + } + + type type_ = :"intent.created" + + module Type + extend Privy::Internal::Type::Enum + + INTENT_CREATED: :"intent.created" + + def self?.values: -> ::Array[Privy::Models::IntentCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/intent_creation_headers.rbs b/sig/privy/models/intent_creation_headers.rbs new file mode 100644 index 0000000..aa5552b --- /dev/null +++ b/sig/privy/models/intent_creation_headers.rbs @@ -0,0 +1,21 @@ +module Privy + module Models + type intent_creation_headers = + { privy_app_id: String, privy_request_expiry: String } + + class IntentCreationHeaders < Privy::Internal::Type::BaseModel + attr_accessor privy_app_id: String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + privy_app_id: String, + ?privy_request_expiry: String + ) -> void + + def to_hash: -> { privy_app_id: String, privy_request_expiry: String } + end + end +end diff --git a/sig/privy/models/intent_delete_policy_rule_params.rbs b/sig/privy/models/intent_delete_policy_rule_params.rbs new file mode 100644 index 0000000..3fb7a41 --- /dev/null +++ b/sig/privy/models/intent_delete_policy_rule_params.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type intent_delete_policy_rule_params = + { policy_id: String, rule_id: String, privy_request_expiry: String } + & Privy::Internal::Type::request_parameters + + class IntentDeletePolicyRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor policy_id: String + + attr_accessor rule_id: String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + policy_id: String, + rule_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + rule_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_executed_webhook_payload.rbs b/sig/privy/models/intent_executed_webhook_payload.rbs new file mode 100644 index 0000000..82815bb --- /dev/null +++ b/sig/privy/models/intent_executed_webhook_payload.rbs @@ -0,0 +1,74 @@ +module Privy + module Models + type intent_executed_webhook_payload = + { + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentExecutedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + class IntentExecutedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_result: Privy::BaseActionResult + + attr_accessor created_at: Float + + attr_accessor expires_at: Float + + attr_accessor intent_id: String + + attr_accessor intent_type: Privy::Models::intent_type + + attr_accessor status: String + + attr_accessor type: Privy::Models::IntentExecutedWebhookPayload::type_ + + attr_reader created_by_display_name: String? + + def created_by_display_name=: (String) -> String + + attr_reader created_by_id: String? + + def created_by_id=: (String) -> String + + def initialize: ( + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentExecutedWebhookPayload::type_, + ?created_by_display_name: String, + ?created_by_id: String + ) -> void + + def to_hash: -> { + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentExecutedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + type type_ = :"intent.executed" + + module Type + extend Privy::Internal::Type::Enum + + INTENT_EXECUTED: :"intent.executed" + + def self?.values: -> ::Array[Privy::Models::IntentExecutedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/intent_failed_webhook_payload.rbs b/sig/privy/models/intent_failed_webhook_payload.rbs new file mode 100644 index 0000000..1a6a5f2 --- /dev/null +++ b/sig/privy/models/intent_failed_webhook_payload.rbs @@ -0,0 +1,74 @@ +module Privy + module Models + type intent_failed_webhook_payload = + { + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentFailedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + class IntentFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_result: Privy::BaseActionResult + + attr_accessor created_at: Float + + attr_accessor expires_at: Float + + attr_accessor intent_id: String + + attr_accessor intent_type: Privy::Models::intent_type + + attr_accessor status: String + + attr_accessor type: Privy::Models::IntentFailedWebhookPayload::type_ + + attr_reader created_by_display_name: String? + + def created_by_display_name=: (String) -> String + + attr_reader created_by_id: String? + + def created_by_id=: (String) -> String + + def initialize: ( + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentFailedWebhookPayload::type_, + ?created_by_display_name: String, + ?created_by_id: String + ) -> void + + def to_hash: -> { + action_result: Privy::BaseActionResult, + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + status: String, + type: Privy::Models::IntentFailedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + type type_ = :"intent.failed" + + module Type + extend Privy::Internal::Type::Enum + + INTENT_FAILED: :"intent.failed" + + def self?.values: -> ::Array[Privy::Models::IntentFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/intent_get_params.rbs b/sig/privy/models/intent_get_params.rbs new file mode 100644 index 0000000..9144909 --- /dev/null +++ b/sig/privy/models/intent_get_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type intent_get_params = + { intent_id: String } & Privy::Internal::Type::request_parameters + + class IntentGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor intent_id: String + + def initialize: ( + intent_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + intent_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_list_params.rbs b/sig/privy/models/intent_list_params.rbs new file mode 100644 index 0000000..d9c0835 --- /dev/null +++ b/sig/privy/models/intent_list_params.rbs @@ -0,0 +1,113 @@ +module Privy + module Models + type intent_list_params = + { + created_by_id: String, + current_user_has_signed: Privy::Models::IntentListParams::current_user_has_signed, + cursor: String, + intent_type: Privy::Models::intent_type, + limit: Float?, + pending_member_id: String, + resource_id: String, + sort_by: Privy::Models::IntentListParams::sort_by, + status: Privy::Models::intent_status + } + & Privy::Internal::Type::request_parameters + + class IntentListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_reader created_by_id: String? + + def created_by_id=: (String) -> String + + attr_reader current_user_has_signed: Privy::Models::IntentListParams::current_user_has_signed? + + def current_user_has_signed=: ( + Privy::Models::IntentListParams::current_user_has_signed + ) -> Privy::Models::IntentListParams::current_user_has_signed + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader intent_type: Privy::Models::intent_type? + + def intent_type=: ( + Privy::Models::intent_type + ) -> Privy::Models::intent_type + + attr_accessor limit: Float? + + attr_reader pending_member_id: String? + + def pending_member_id=: (String) -> String + + attr_reader resource_id: String? + + def resource_id=: (String) -> String + + attr_reader sort_by: Privy::Models::IntentListParams::sort_by? + + def sort_by=: ( + Privy::Models::IntentListParams::sort_by + ) -> Privy::Models::IntentListParams::sort_by + + attr_reader status: Privy::Models::intent_status? + + def status=: ( + Privy::Models::intent_status + ) -> Privy::Models::intent_status + + def initialize: ( + ?created_by_id: String, + ?current_user_has_signed: Privy::Models::IntentListParams::current_user_has_signed, + ?cursor: String, + ?intent_type: Privy::Models::intent_type, + ?limit: Float?, + ?pending_member_id: String, + ?resource_id: String, + ?sort_by: Privy::Models::IntentListParams::sort_by, + ?status: Privy::Models::intent_status, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + created_by_id: String, + current_user_has_signed: Privy::Models::IntentListParams::current_user_has_signed, + cursor: String, + intent_type: Privy::Models::intent_type, + limit: Float?, + pending_member_id: String, + resource_id: String, + sort_by: Privy::Models::IntentListParams::sort_by, + status: Privy::Models::intent_status, + request_options: Privy::RequestOptions + } + + type current_user_has_signed = :true | :false + + module CurrentUserHasSigned + extend Privy::Internal::Type::Enum + + TRUE: :true + FALSE: :false + + def self?.values: -> ::Array[Privy::Models::IntentListParams::current_user_has_signed] + end + + type sort_by = :created_at_desc | :expires_at_asc | :updated_at_desc + + module SortBy + extend Privy::Internal::Type::Enum + + CREATED_AT_DESC: :created_at_desc + EXPIRES_AT_ASC: :expires_at_asc + UPDATED_AT_DESC: :updated_at_desc + + def self?.values: -> ::Array[Privy::Models::IntentListParams::sort_by] + end + end + end +end diff --git a/sig/privy/models/intent_rejected_webhook_payload.rbs b/sig/privy/models/intent_rejected_webhook_payload.rbs new file mode 100644 index 0000000..03e3c25 --- /dev/null +++ b/sig/privy/models/intent_rejected_webhook_payload.rbs @@ -0,0 +1,74 @@ +module Privy + module Models + type intent_rejected_webhook_payload = + { + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + rejected_at: Float, + status: String, + type: Privy::Models::IntentRejectedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + class IntentRejectedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor created_at: Float + + attr_accessor expires_at: Float + + attr_accessor intent_id: String + + attr_accessor intent_type: Privy::Models::intent_type + + attr_accessor rejected_at: Float + + attr_accessor status: String + + attr_accessor type: Privy::Models::IntentRejectedWebhookPayload::type_ + + attr_reader created_by_display_name: String? + + def created_by_display_name=: (String) -> String + + attr_reader created_by_id: String? + + def created_by_id=: (String) -> String + + def initialize: ( + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + rejected_at: Float, + status: String, + type: Privy::Models::IntentRejectedWebhookPayload::type_, + ?created_by_display_name: String, + ?created_by_id: String + ) -> void + + def to_hash: -> { + created_at: Float, + expires_at: Float, + intent_id: String, + intent_type: Privy::Models::intent_type, + rejected_at: Float, + status: String, + type: Privy::Models::IntentRejectedWebhookPayload::type_, + created_by_display_name: String, + created_by_id: String + } + + type type_ = :"intent.rejected" + + module Type + extend Privy::Internal::Type::Enum + + INTENT_REJECTED: :"intent.rejected" + + def self?.values: -> ::Array[Privy::Models::IntentRejectedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/intent_response.rbs b/sig/privy/models/intent_response.rbs new file mode 100644 index 0000000..c346381 --- /dev/null +++ b/sig/privy/models/intent_response.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type intent_response = + Privy::RpcIntentResponse + | Privy::TransferIntentResponse + | Privy::WalletIntentResponse + | Privy::PolicyIntentResponse + | Privy::RuleIntentResponse + | Privy::KeyQuorumIntentResponse + + module IntentResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::intent_response] + end + end +end diff --git a/sig/privy/models/intent_rpc_params.rbs b/sig/privy/models/intent_rpc_params.rbs new file mode 100644 index 0000000..fc629b6 --- /dev/null +++ b/sig/privy/models/intent_rpc_params.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type intent_rpc_params = + { wallet_id: String, privy_request_expiry: String } + & Privy::Internal::Type::request_parameters + + class IntentRpcParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor wallet_id: String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + wallet_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_status.rbs b/sig/privy/models/intent_status.rbs new file mode 100644 index 0000000..fcecb8e --- /dev/null +++ b/sig/privy/models/intent_status.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type intent_status = + :pending | :executed | :failed | :expired | :rejected | :dismissed + + module IntentStatus + extend Privy::Internal::Type::Enum + + PENDING: :pending + EXECUTED: :executed + FAILED: :failed + EXPIRED: :expired + REJECTED: :rejected + DISMISSED: :dismissed + + def self?.values: -> ::Array[Privy::Models::intent_status] + end + end +end diff --git a/sig/privy/models/intent_transfer_params.rbs b/sig/privy/models/intent_transfer_params.rbs new file mode 100644 index 0000000..64bff22 --- /dev/null +++ b/sig/privy/models/intent_transfer_params.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type intent_transfer_params = + { wallet_id: String, privy_request_expiry: String } + & Privy::Internal::Type::request_parameters + + class IntentTransferParams < Privy::Models::TransferRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_type.rbs b/sig/privy/models/intent_type.rbs new file mode 100644 index 0000000..1357e52 --- /dev/null +++ b/sig/privy/models/intent_type.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type intent_type = + :KEY_QUORUM | :POLICY | :RULE | :RPC | :TRANSFER | :WALLET + + module IntentType + extend Privy::Internal::Type::Enum + + KEY_QUORUM: :KEY_QUORUM + POLICY: :POLICY + RULE: :RULE + RPC: :RPC + TRANSFER: :TRANSFER + WALLET: :WALLET + + def self?.values: -> ::Array[Privy::Models::intent_type] + end + end +end diff --git a/sig/privy/models/intent_update_key_quorum_params.rbs b/sig/privy/models/intent_update_key_quorum_params.rbs new file mode 100644 index 0000000..5f8f6ec --- /dev/null +++ b/sig/privy/models/intent_update_key_quorum_params.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type intent_update_key_quorum_params = + { key_quorum_id: String, privy_request_expiry: String } + & Privy::Internal::Type::request_parameters + + class IntentUpdateKeyQuorumParams < Privy::Models::KeyQuorumUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def key_quorum_id: -> String + + def key_quorum_id=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + key_quorum_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + key_quorum_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_update_policy_params.rbs b/sig/privy/models/intent_update_policy_params.rbs new file mode 100644 index 0000000..e52dd96 --- /dev/null +++ b/sig/privy/models/intent_update_policy_params.rbs @@ -0,0 +1,59 @@ +module Privy + module Models + type intent_update_policy_params = + { + policy_id: String, + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody], + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class IntentUpdatePolicyParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor policy_id: String + + attr_reader name: String? + + def name=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader rules: ::Array[Privy::PolicyRuleRequestBody]? + + def rules=: ( + ::Array[Privy::PolicyRuleRequestBody] + ) -> ::Array[Privy::PolicyRuleRequestBody] + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + policy_id: String, + ?name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?rules: ::Array[Privy::PolicyRuleRequestBody], + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody], + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_update_policy_rule_params.rbs b/sig/privy/models/intent_update_policy_rule_params.rbs new file mode 100644 index 0000000..d3d6b61 --- /dev/null +++ b/sig/privy/models/intent_update_policy_rule_params.rbs @@ -0,0 +1,38 @@ +module Privy + module Models + type intent_update_policy_rule_params = + { policy_id: String, rule_id: String, privy_request_expiry: String } + & Privy::Internal::Type::request_parameters + + class IntentUpdatePolicyRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def policy_id: -> String + + def policy_id=: (String _) -> String + + def rule_id: -> String + + def rule_id=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + policy_id: String, + rule_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + rule_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/intent_update_wallet_params.rbs b/sig/privy/models/intent_update_wallet_params.rbs new file mode 100644 index 0000000..c97c1e1 --- /dev/null +++ b/sig/privy/models/intent_update_wallet_params.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type intent_update_wallet_params = + { wallet_id: String, privy_request_expiry: String } + & Privy::Internal::Type::request_parameters + + class IntentUpdateWalletParams < Privy::Models::WalletUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/key_quorum.rbs b/sig/privy/models/key_quorum.rbs new file mode 100644 index 0000000..d5ac8b6 --- /dev/null +++ b/sig/privy/models/key_quorum.rbs @@ -0,0 +1,59 @@ +module Privy + module Models + type key_quorum = + { + id: String, + authorization_keys: ::Array[Privy::KeyQuorum::AuthorizationKey], + authorization_threshold: Float?, + display_name: String?, + user_ids: ::Array[String]?, + key_quorum_ids: ::Array[String] + } + + class KeyQuorum < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor authorization_keys: ::Array[Privy::KeyQuorum::AuthorizationKey] + + attr_accessor authorization_threshold: Float? + + attr_accessor display_name: String? + + attr_accessor user_ids: ::Array[String]? + + attr_reader key_quorum_ids: ::Array[String]? + + def key_quorum_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + id: String, + authorization_keys: ::Array[Privy::KeyQuorum::AuthorizationKey], + authorization_threshold: Float?, + display_name: String?, + user_ids: ::Array[String]?, + ?key_quorum_ids: ::Array[String] + ) -> void + + def to_hash: -> { + id: String, + authorization_keys: ::Array[Privy::KeyQuorum::AuthorizationKey], + authorization_threshold: Float?, + display_name: String?, + user_ids: ::Array[String]?, + key_quorum_ids: ::Array[String] + } + + type authorization_key = { display_name: String?, public_key: String } + + class AuthorizationKey < Privy::Internal::Type::BaseModel + attr_accessor display_name: String? + + attr_accessor public_key: String + + def initialize: (display_name: String?, public_key: String) -> void + + def to_hash: -> { display_name: String?, public_key: String } + end + end + end +end diff --git a/sig/privy/models/key_quorum_authorization_headers.rbs b/sig/privy/models/key_quorum_authorization_headers.rbs new file mode 100644 index 0000000..2b8905f --- /dev/null +++ b/sig/privy/models/key_quorum_authorization_headers.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type key_quorum_authorization_headers = + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + + class KeyQuorumAuthorizationHeaders < Privy::Internal::Type::BaseModel + attr_accessor privy_app_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + privy_app_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String + ) -> void + + def to_hash: -> { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + end + end +end diff --git a/sig/privy/models/key_quorum_create_params.rbs b/sig/privy/models/key_quorum_create_params.rbs new file mode 100644 index 0000000..5c28448 --- /dev/null +++ b/sig/privy/models/key_quorum_create_params.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type key_quorum_create_params = + { } & Privy::Internal::Type::request_parameters + + class KeyQuorumCreateParams < Privy::Models::KeyQuorumCreateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def initialize: (?request_options: Privy::request_opts) -> void + + def to_hash: -> { request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/key_quorum_create_request_body.rbs b/sig/privy/models/key_quorum_create_request_body.rbs new file mode 100644 index 0000000..ad515bc --- /dev/null +++ b/sig/privy/models/key_quorum_create_request_body.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type key_quorum_create_request_body = + { + authorization_threshold: Float, + display_name: String, + key_quorum_ids: ::Array[String], + public_keys: ::Array[String], + user_ids: ::Array[String] + } + + class KeyQuorumCreateRequestBody < Privy::Internal::Type::BaseModel + attr_reader authorization_threshold: Float? + + def authorization_threshold=: (Float) -> Float + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader key_quorum_ids: ::Array[String]? + + def key_quorum_ids=: (::Array[String]) -> ::Array[String] + + attr_reader public_keys: ::Array[String]? + + def public_keys=: (::Array[String]) -> ::Array[String] + + attr_reader user_ids: ::Array[String]? + + def user_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?authorization_threshold: Float, + ?display_name: String, + ?key_quorum_ids: ::Array[String], + ?public_keys: ::Array[String], + ?user_ids: ::Array[String] + ) -> void + + def to_hash: -> { + authorization_threshold: Float, + display_name: String, + key_quorum_ids: ::Array[String], + public_keys: ::Array[String], + user_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/key_quorum_delete_params.rbs b/sig/privy/models/key_quorum_delete_params.rbs new file mode 100644 index 0000000..69b8a61 --- /dev/null +++ b/sig/privy/models/key_quorum_delete_params.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type key_quorum_delete_params = + { + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class KeyQuorumDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor key_quorum_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + key_quorum_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/key_quorum_get_params.rbs b/sig/privy/models/key_quorum_get_params.rbs new file mode 100644 index 0000000..03629a8 --- /dev/null +++ b/sig/privy/models/key_quorum_get_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type key_quorum_get_params = + { key_quorum_id: String } & Privy::Internal::Type::request_parameters + + class KeyQuorumGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor key_quorum_id: String + + def initialize: ( + key_quorum_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + key_quorum_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/key_quorum_id.rbs b/sig/privy/models/key_quorum_id.rbs new file mode 100644 index 0000000..a8bfd7d --- /dev/null +++ b/sig/privy/models/key_quorum_id.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class KeyQuorumID = String + end +end diff --git a/sig/privy/models/key_quorum_intent_response.rbs b/sig/privy/models/key_quorum_intent_response.rbs new file mode 100644 index 0000000..1c4e843 --- /dev/null +++ b/sig/privy/models/key_quorum_intent_response.rbs @@ -0,0 +1,94 @@ +module Privy + module Models + type key_quorum_intent_response = + { + intent_type: Privy::Models::KeyQuorumIntentResponse::intent_type, + request_details: Privy::KeyQuorumIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::KeyQuorum + } + + class KeyQuorumIntentResponse < Privy::Models::BaseIntentResponse + def intent_type: -> Privy::Models::KeyQuorumIntentResponse::intent_type + + def intent_type=: ( + Privy::Models::KeyQuorumIntentResponse::intent_type _ + ) -> Privy::Models::KeyQuorumIntentResponse::intent_type + + def request_details: -> Privy::KeyQuorumIntentResponse::RequestDetails + + def request_details=: ( + Privy::KeyQuorumIntentResponse::RequestDetails _ + ) -> Privy::KeyQuorumIntentResponse::RequestDetails + + def action_result: -> Privy::BaseActionResult? + + def action_result=: (Privy::BaseActionResult _) -> Privy::BaseActionResult + + def current_resource_data: -> Privy::KeyQuorum? + + def current_resource_data=: (Privy::KeyQuorum _) -> Privy::KeyQuorum + + def initialize: ( + intent_type: Privy::Models::KeyQuorumIntentResponse::intent_type, + request_details: Privy::KeyQuorumIntentResponse::RequestDetails, + ?action_result: Privy::BaseActionResult, + ?current_resource_data: Privy::KeyQuorum + ) -> void + + def to_hash: -> { + intent_type: Privy::Models::KeyQuorumIntentResponse::intent_type, + request_details: Privy::KeyQuorumIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::KeyQuorum + } + + type intent_type = :KEY_QUORUM + + module IntentType + extend Privy::Internal::Type::Enum + + KEY_QUORUM: :KEY_QUORUM + + def self?.values: -> ::Array[Privy::Models::KeyQuorumIntentResponse::intent_type] + end + + type request_details = + { + body: Privy::KeyQuorumUpdateRequestBody, + method_: Privy::Models::KeyQuorumIntentResponse::RequestDetails::method_, + url: String + } + + class RequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::KeyQuorumUpdateRequestBody + + attr_accessor method_: Privy::Models::KeyQuorumIntentResponse::RequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::KeyQuorumUpdateRequestBody, + method_: Privy::Models::KeyQuorumIntentResponse::RequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::KeyQuorumUpdateRequestBody, + method_: Privy::Models::KeyQuorumIntentResponse::RequestDetails::method_, + url: String + } + + type method_ = :PATCH + + module Method + extend Privy::Internal::Type::Enum + + PATCH: :PATCH + + def self?.values: -> ::Array[Privy::Models::KeyQuorumIntentResponse::RequestDetails::method_] + end + end + end + end +end diff --git a/sig/privy/models/key_quorum_update_params.rbs b/sig/privy/models/key_quorum_update_params.rbs new file mode 100644 index 0000000..aa4cb7a --- /dev/null +++ b/sig/privy/models/key_quorum_update_params.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type key_quorum_update_params = + { + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class KeyQuorumUpdateParams < Privy::Models::KeyQuorumUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def key_quorum_id: -> String + + def key_quorum_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + key_quorum_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + key_quorum_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/key_quorum_update_request_body.rbs b/sig/privy/models/key_quorum_update_request_body.rbs new file mode 100644 index 0000000..51f853c --- /dev/null +++ b/sig/privy/models/key_quorum_update_request_body.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type key_quorum_update_request_body = + { + authorization_threshold: Float, + display_name: String, + key_quorum_ids: ::Array[String], + public_keys: ::Array[String], + user_ids: ::Array[String] + } + + class KeyQuorumUpdateRequestBody < Privy::Internal::Type::BaseModel + attr_reader authorization_threshold: Float? + + def authorization_threshold=: (Float) -> Float + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader key_quorum_ids: ::Array[String]? + + def key_quorum_ids=: (::Array[String]) -> ::Array[String] + + attr_reader public_keys: ::Array[String]? + + def public_keys=: (::Array[String]) -> ::Array[String] + + attr_reader user_ids: ::Array[String]? + + def user_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?authorization_threshold: Float, + ?display_name: String, + ?key_quorum_ids: ::Array[String], + ?public_keys: ::Array[String], + ?user_ids: ::Array[String] + ) -> void + + def to_hash: -> { + authorization_threshold: Float, + display_name: String, + key_quorum_ids: ::Array[String], + public_keys: ::Array[String], + user_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/kraken_embed_current_day_pnl.rbs b/sig/privy/models/kraken_embed_current_day_pnl.rbs new file mode 100644 index 0000000..fb0beb7 --- /dev/null +++ b/sig/privy/models/kraken_embed_current_day_pnl.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type kraken_embed_current_day_pnl = { pnl: String, since: Time } + + class KrakenEmbedCurrentDayPnl < Privy::Internal::Type::BaseModel + attr_accessor pnl: String + + attr_accessor since: Time + + def initialize: (pnl: String, since: Time) -> void + + def to_hash: -> { pnl: String, since: Time } + end + end +end diff --git a/sig/privy/models/kraken_embed_get_asset_list_query_params_schema.rbs b/sig/privy/models/kraken_embed_get_asset_list_query_params_schema.rbs new file mode 100644 index 0000000..bc3a70a --- /dev/null +++ b/sig/privy/models/kraken_embed_get_asset_list_query_params_schema.rbs @@ -0,0 +1,147 @@ +module Privy + module Models + type kraken_embed_get_asset_list_query_params_schema = + { + filter_assets: ::Array[String], + filter_platform_statuses: ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::filter_platform_status], + filter_tradable_only: bool?, + filter_user: String, + lang: String, + page_number: Integer, + page_size: Integer, + quote: String, + sort: Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::sort + } + + class KrakenEmbedGetAssetListQueryParamsSchema < Privy::Internal::Type::BaseModel + attr_reader filter_assets: ::Array[String]? + + def filter_assets=: (::Array[String]) -> ::Array[String] + + attr_reader filter_platform_statuses: ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::filter_platform_status]? + + def filter_platform_statuses=: ( + ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::filter_platform_status] + ) -> ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::filter_platform_status] + + attr_accessor filter_tradable_only: bool? + + attr_reader filter_user: String? + + def filter_user=: (String) -> String + + attr_reader lang: String? + + def lang=: (String) -> String + + attr_reader page_number: Integer? + + def page_number=: (Integer) -> Integer + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quote: String? + + def quote=: (String) -> String + + attr_reader sort: Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::sort? + + def sort=: ( + Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::sort + ) -> Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::sort + + def initialize: ( + ?filter_assets: ::Array[String], + ?filter_platform_statuses: ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::filter_platform_status], + ?filter_tradable_only: bool?, + ?filter_user: String, + ?lang: String, + ?page_number: Integer, + ?page_size: Integer, + ?quote: String, + ?sort: Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::sort + ) -> void + + def to_hash: -> { + filter_assets: ::Array[String], + filter_platform_statuses: ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::filter_platform_status], + filter_tradable_only: bool?, + filter_user: String, + lang: String, + page_number: Integer, + page_size: Integer, + quote: String, + sort: Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::sort + } + + type filter_platform_status = + :enabled + | :deposit_only + | :withdrawal_only + | :funding_temporarily_disabled + | :disabled + | String + + module FilterPlatformStatus + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::filter_platform_status] + + ENABLED: :enabled + DEPOSIT_ONLY: :deposit_only + WITHDRAWAL_ONLY: :withdrawal_only + FUNDING_TEMPORARILY_DISABLED: :funding_temporarily_disabled + DISABLED: :disabled + end + + type sort = + :trending + | :market_cap_rank + | :"-market_cap_rank" + | :symbol + | :"-symbol" + | :name + | :"-name" + | :change_percent_1h + | :"-change_percent_1h" + | :change_percent_24h + | :"-change_percent_24h" + | :change_percent_7d + | :"-change_percent_7d" + | :change_percent_30d + | :"-change_percent_30d" + | :change_percent_1y + | :"-change_percent_1y" + | :listing_date + | :"-listing_date" + + module Sort + extend Privy::Internal::Type::Enum + + TRENDING: :trending + MARKET_CAP_RANK: :market_cap_rank + MINUS_MARKET_CAP_RANK: :"-market_cap_rank" + SYMBOL: :symbol + MINUS_SYMBOL: :"-symbol" + NAME: :name + MINUS_NAME: :"-name" + CHANGE_PERCENT_1H: :change_percent_1h + MINUS_CHANGE_PERCENT_1_H: :"-change_percent_1h" + CHANGE_PERCENT_24H: :change_percent_24h + MINUS_CHANGE_PERCENT_24_H: :"-change_percent_24h" + CHANGE_PERCENT_7D: :change_percent_7d + MINUS_CHANGE_PERCENT_7_D: :"-change_percent_7d" + CHANGE_PERCENT_30D: :change_percent_30d + MINUS_CHANGE_PERCENT_30_D: :"-change_percent_30d" + CHANGE_PERCENT_1Y: :change_percent_1y + MINUS_CHANGE_PERCENT_1_Y: :"-change_percent_1y" + LISTING_DATE: :listing_date + MINUS_LISTING_DATE: :"-listing_date" + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedGetAssetListQueryParamsSchema::sort] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rbs b/sig/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rbs new file mode 100644 index 0000000..809163d --- /dev/null +++ b/sig/privy/models/kraken_embed_get_portfolio_details_query_params_schema.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type kraken_embed_get_portfolio_details_query_params_schema = + { quote: String } + + class KrakenEmbedGetPortfolioDetailsQueryParamsSchema < Privy::Internal::Type::BaseModel + attr_reader quote: String? + + def quote=: (String) -> String + + def initialize: (?quote: String) -> void + + def to_hash: -> { quote: String } + end + end +end diff --git a/sig/privy/models/kraken_embed_get_portfolio_summary_query_params.rbs b/sig/privy/models/kraken_embed_get_portfolio_summary_query_params.rbs new file mode 100644 index 0000000..9d572ea --- /dev/null +++ b/sig/privy/models/kraken_embed_get_portfolio_summary_query_params.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type kraken_embed_get_portfolio_summary_query_params = + { + include_current_day_pnl: Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::include_current_day_pnl, + quote: String + } + + class KrakenEmbedGetPortfolioSummaryQueryParams < Privy::Internal::Type::BaseModel + attr_reader include_current_day_pnl: Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::include_current_day_pnl? + + def include_current_day_pnl=: ( + Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::include_current_day_pnl + ) -> Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::include_current_day_pnl + + attr_reader quote: String? + + def quote=: (String) -> String + + def initialize: ( + ?include_current_day_pnl: Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::include_current_day_pnl, + ?quote: String + ) -> void + + def to_hash: -> { + include_current_day_pnl: Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::include_current_day_pnl, + quote: String + } + + type include_current_day_pnl = :true | :false + + module IncludeCurrentDayPnl + extend Privy::Internal::Type::Enum + + TRUE: :true + FALSE: :false + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedGetPortfolioSummaryQueryParams::include_current_day_pnl] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_get_portfolio_summary_response.rbs b/sig/privy/models/kraken_embed_get_portfolio_summary_response.rbs new file mode 100644 index 0000000..2c334b6 --- /dev/null +++ b/sig/privy/models/kraken_embed_get_portfolio_summary_response.rbs @@ -0,0 +1,106 @@ +module Privy + module Models + type kraken_embed_get_portfolio_summary_response = + { data: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data } + + class KrakenEmbedGetPortfolioSummaryResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data + + def initialize: ( + data: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data + ) -> void + + def to_hash: -> { + data: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data + } + + type data = + { + result: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result?, + error: ::Array[String], + errors: ::Array[String] + } + + class Data < Privy::Internal::Type::BaseModel + attr_accessor result: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result? + + attr_reader error: ::Array[String]? + + def error=: (::Array[String]) -> ::Array[String] + + attr_reader errors: ::Array[String]? + + def errors=: (::Array[String]) -> ::Array[String] + + def initialize: ( + result: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result?, + ?error: ::Array[String], + ?errors: ::Array[String] + ) -> void + + def to_hash: -> { + result: Privy::KrakenEmbedGetPortfolioSummaryResponse::Data::Result?, + error: ::Array[String], + errors: ::Array[String] + } + + type result = + { + available_balance: String, + currency: String, + open_orders: String, + portfolio_value: String, + timestamp: Time, + withheld_value: String, + cost_basis: String?, + current_day_pnl: Privy::KrakenEmbedCurrentDayPnl?, + lots_upnl: String? + } + + class Result < Privy::Internal::Type::BaseModel + attr_accessor available_balance: String + + attr_accessor currency: String + + attr_accessor open_orders: String + + attr_accessor portfolio_value: String + + attr_accessor timestamp: Time + + attr_accessor withheld_value: String + + attr_accessor cost_basis: String? + + attr_accessor current_day_pnl: Privy::KrakenEmbedCurrentDayPnl? + + attr_accessor lots_upnl: String? + + def initialize: ( + available_balance: String, + currency: String, + open_orders: String, + portfolio_value: String, + timestamp: Time, + withheld_value: String, + ?cost_basis: String?, + ?current_day_pnl: Privy::KrakenEmbedCurrentDayPnl?, + ?lots_upnl: String? + ) -> void + + def to_hash: -> { + available_balance: String, + currency: String, + open_orders: String, + portfolio_value: String, + timestamp: Time, + withheld_value: String, + cost_basis: String?, + current_day_pnl: Privy::KrakenEmbedCurrentDayPnl?, + lots_upnl: String? + } + end + end + end + end +end diff --git a/sig/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rbs b/sig/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rbs new file mode 100644 index 0000000..616f53f --- /dev/null +++ b/sig/privy/models/kraken_embed_get_portfolio_transactions_query_params_schema.rbs @@ -0,0 +1,169 @@ +module Privy + module Models + type kraken_embed_get_portfolio_transactions_query_params_schema = + { + assets: ::Array[String], + cursor: String, + from_time: Time, + ids: ::Array[String], + page_size: Integer, + quote: String, + ref_ids: ::Array[Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID], + sorting: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::sorting, + statuses: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::status], + types: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::type_], + until_time: Time + } + + class KrakenEmbedGetPortfolioTransactionsQueryParamsSchema < Privy::Internal::Type::BaseModel + attr_reader assets: ::Array[String]? + + def assets=: (::Array[String]) -> ::Array[String] + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader from_time: Time? + + def from_time=: (Time) -> Time + + attr_reader ids: ::Array[String]? + + def ids=: (::Array[String]) -> ::Array[String] + + attr_reader page_size: Integer? + + def page_size=: (Integer) -> Integer + + attr_reader quote: String? + + def quote=: (String) -> String + + attr_reader ref_ids: ::Array[Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID]? + + def ref_ids=: ( + ::Array[Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID] + ) -> ::Array[Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID] + + attr_reader sorting: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::sorting? + + def sorting=: ( + Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::sorting + ) -> Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::sorting + + attr_reader statuses: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::status]? + + def statuses=: ( + ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::status] + ) -> ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::status] + + attr_reader types: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::type_]? + + def types=: ( + ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::type_] + ) -> ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::type_] + + attr_reader until_time: Time? + + def until_time=: (Time) -> Time + + def initialize: ( + ?assets: ::Array[String], + ?cursor: String, + ?from_time: Time, + ?ids: ::Array[String], + ?page_size: Integer, + ?quote: String, + ?ref_ids: ::Array[Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID], + ?sorting: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::sorting, + ?statuses: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::status], + ?types: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::type_], + ?until_time: Time + ) -> void + + def to_hash: -> { + assets: ::Array[String], + cursor: String, + from_time: Time, + ids: ::Array[String], + page_size: Integer, + quote: String, + ref_ids: ::Array[Privy::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID], + sorting: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::sorting, + statuses: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::status], + types: ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::type_], + until_time: Time + } + + type ref_id = + { + ref_id: String, + type: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::type_ + } + + class RefID < Privy::Internal::Type::BaseModel + attr_accessor ref_id: String + + attr_accessor type: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::type_ + + def initialize: ( + ref_id: String, + type: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::type_ + ) -> void + + def to_hash: -> { + ref_id: String, + type: Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::type_ + } + + type type_ = :simple_order_quote | :simple_order_quote_failed + + module Type + extend Privy::Internal::Type::Enum + + SIMPLE_ORDER_QUOTE: :simple_order_quote + SIMPLE_ORDER_QUOTE_FAILED: :simple_order_quote_failed + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::RefID::type_] + end + end + + type sorting = :descending | :ascending + + module Sorting + extend Privy::Internal::Type::Enum + + DESCENDING: :descending + ASCENDING: :ascending + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::sorting] + end + + type status = :unspecified | :in_progress | :successful | :failed + + module Status + extend Privy::Internal::Type::Enum + + UNSPECIFIED: :unspecified + IN_PROGRESS: :in_progress + SUCCESSFUL: :successful + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::status] + end + + type type_ = :simple_order | :simple_order_failed | :earn_reward + + module Type + extend Privy::Internal::Type::Enum + + SIMPLE_ORDER: :simple_order + SIMPLE_ORDER_FAILED: :simple_order_failed + EARN_REWARD: :earn_reward + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedGetPortfolioTransactionsQueryParamsSchema::type_] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_get_quote_query_params.rbs b/sig/privy/models/kraken_embed_get_quote_query_params.rbs new file mode 100644 index 0000000..06278fb --- /dev/null +++ b/sig/privy/models/kraken_embed_get_quote_query_params.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type kraken_embed_get_quote_query_params = { user_id: String } + + class KrakenEmbedGetQuoteQueryParams < Privy::Internal::Type::BaseModel + attr_accessor user_id: String + + def initialize: (user_id: String) -> void + + def to_hash: -> { user_id: String } + end + end +end diff --git a/sig/privy/models/kraken_embed_quote_cancelled_webhook_payload.rbs b/sig/privy/models/kraken_embed_quote_cancelled_webhook_payload.rbs new file mode 100644 index 0000000..79c7cd1 --- /dev/null +++ b/sig/privy/models/kraken_embed_quote_cancelled_webhook_payload.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type kraken_embed_quote_cancelled_webhook_payload = + { + cancelled_at: String, + quote_id: String, + reason: String, + type: Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload::type_, + user_id: String + } + + class KrakenEmbedQuoteCancelledWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor cancelled_at: String + + attr_accessor quote_id: String + + attr_accessor reason: String + + attr_accessor type: Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload::type_ + + attr_accessor user_id: String + + def initialize: ( + cancelled_at: String, + quote_id: String, + reason: String, + type: Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload::type_, + user_id: String + ) -> void + + def to_hash: -> { + cancelled_at: String, + quote_id: String, + reason: String, + type: Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload::type_, + user_id: String + } + + type type_ = :"kraken_embed.quote.cancelled" + + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_QUOTE_CANCELLED: :"kraken_embed.quote.cancelled" + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedQuoteCancelledWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_quote_executed_webhook_payload.rbs b/sig/privy/models/kraken_embed_quote_executed_webhook_payload.rbs new file mode 100644 index 0000000..3040446 --- /dev/null +++ b/sig/privy/models/kraken_embed_quote_executed_webhook_payload.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type kraken_embed_quote_executed_webhook_payload = + { + executed_at: String, + quote_id: String, + type: Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload::type_, + user_id: String + } + + class KrakenEmbedQuoteExecutedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor executed_at: String + + attr_accessor quote_id: String + + attr_accessor type: Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload::type_ + + attr_accessor user_id: String + + def initialize: ( + executed_at: String, + quote_id: String, + type: Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload::type_, + user_id: String + ) -> void + + def to_hash: -> { + executed_at: String, + quote_id: String, + type: Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload::type_, + user_id: String + } + + type type_ = :"kraken_embed.quote.executed" + + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_QUOTE_EXECUTED: :"kraken_embed.quote.executed" + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedQuoteExecutedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rbs b/sig/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rbs new file mode 100644 index 0000000..78c3b81 --- /dev/null +++ b/sig/privy/models/kraken_embed_quote_execution_failed_webhook_payload.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type kraken_embed_quote_execution_failed_webhook_payload = + { + failed_at: String, + quote_id: String, + reason: String, + type: Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload::type_, + user_id: String + } + + class KrakenEmbedQuoteExecutionFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor failed_at: String + + attr_accessor quote_id: String + + attr_accessor reason: String + + attr_accessor type: Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload::type_ + + attr_accessor user_id: String + + def initialize: ( + failed_at: String, + quote_id: String, + reason: String, + type: Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload::type_, + user_id: String + ) -> void + + def to_hash: -> { + failed_at: String, + quote_id: String, + reason: String, + type: Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload::type_, + user_id: String + } + + type type_ = :"kraken_embed.quote.execution_failed" + + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_QUOTE_EXECUTION_FAILED: :"kraken_embed.quote.execution_failed" + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedQuoteExecutionFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_user_closed_webhook_payload.rbs b/sig/privy/models/kraken_embed_user_closed_webhook_payload.rbs new file mode 100644 index 0000000..faff38b --- /dev/null +++ b/sig/privy/models/kraken_embed_user_closed_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type kraken_embed_user_closed_webhook_payload = + { + closed_at: String, + type: Privy::Models::KrakenEmbedUserClosedWebhookPayload::type_, + user_id: String + } + + class KrakenEmbedUserClosedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor closed_at: String + + attr_accessor type: Privy::Models::KrakenEmbedUserClosedWebhookPayload::type_ + + attr_accessor user_id: String + + def initialize: ( + closed_at: String, + type: Privy::Models::KrakenEmbedUserClosedWebhookPayload::type_, + user_id: String + ) -> void + + def to_hash: -> { + closed_at: String, + type: Privy::Models::KrakenEmbedUserClosedWebhookPayload::type_, + user_id: String + } + + type type_ = :"kraken_embed.user.closed" + + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_USER_CLOSED: :"kraken_embed.user.closed" + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedUserClosedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_user_disabled_webhook_payload.rbs b/sig/privy/models/kraken_embed_user_disabled_webhook_payload.rbs new file mode 100644 index 0000000..efb3497 --- /dev/null +++ b/sig/privy/models/kraken_embed_user_disabled_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type kraken_embed_user_disabled_webhook_payload = + { + disabled_at: String, + type: Privy::Models::KrakenEmbedUserDisabledWebhookPayload::type_, + user_id: String + } + + class KrakenEmbedUserDisabledWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor disabled_at: String + + attr_accessor type: Privy::Models::KrakenEmbedUserDisabledWebhookPayload::type_ + + attr_accessor user_id: String + + def initialize: ( + disabled_at: String, + type: Privy::Models::KrakenEmbedUserDisabledWebhookPayload::type_, + user_id: String + ) -> void + + def to_hash: -> { + disabled_at: String, + type: Privy::Models::KrakenEmbedUserDisabledWebhookPayload::type_, + user_id: String + } + + type type_ = :"kraken_embed.user.disabled" + + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_USER_DISABLED: :"kraken_embed.user.disabled" + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedUserDisabledWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/kraken_embed_user_verified_webhook_payload.rbs b/sig/privy/models/kraken_embed_user_verified_webhook_payload.rbs new file mode 100644 index 0000000..82542e8 --- /dev/null +++ b/sig/privy/models/kraken_embed_user_verified_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type kraken_embed_user_verified_webhook_payload = + { + type: Privy::Models::KrakenEmbedUserVerifiedWebhookPayload::type_, + user_id: String, + verified_at: String + } + + class KrakenEmbedUserVerifiedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::KrakenEmbedUserVerifiedWebhookPayload::type_ + + attr_accessor user_id: String + + attr_accessor verified_at: String + + def initialize: ( + type: Privy::Models::KrakenEmbedUserVerifiedWebhookPayload::type_, + user_id: String, + verified_at: String + ) -> void + + def to_hash: -> { + type: Privy::Models::KrakenEmbedUserVerifiedWebhookPayload::type_, + user_id: String, + verified_at: String + } + + type type_ = :"kraken_embed.user.verified" + + module Type + extend Privy::Internal::Type::Enum + + KRAKEN_EMBED_USER_VERIFIED: :"kraken_embed.user.verified" + + def self?.values: -> ::Array[Privy::Models::KrakenEmbedUserVerifiedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/link_jwt_input.rbs b/sig/privy/models/link_jwt_input.rbs new file mode 100644 index 0000000..15b4087 --- /dev/null +++ b/sig/privy/models/link_jwt_input.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type link_jwt_input = { token: String } + + class LinkJwtInput < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + def initialize: (?token: String) -> void + + def to_hash: -> { token: String } + end + end +end diff --git a/sig/privy/models/linked_account.rbs b/sig/privy/models/linked_account.rbs new file mode 100644 index 0000000..6f7c66c --- /dev/null +++ b/sig/privy/models/linked_account.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type linked_account = + Privy::LinkedAccountEmail + | Privy::LinkedAccountPhone + | Privy::LinkedAccountEthereum + | Privy::LinkedAccountSolana + | Privy::LinkedAccountSmartWallet + | Privy::LinkedAccountEthereumEmbeddedWallet + | Privy::LinkedAccountSolanaEmbeddedWallet + | Privy::LinkedAccountBitcoinSegwitEmbeddedWallet + | Privy::LinkedAccountBitcoinTaprootEmbeddedWallet + | Privy::LinkedAccountCurveSigningEmbeddedWallet + | Privy::LinkedAccountGoogleOAuth + | Privy::LinkedAccountTwitterOAuth + | Privy::LinkedAccountDiscordOAuth + | Privy::LinkedAccountGitHubOAuth + | Privy::LinkedAccountSpotifyOAuth + | Privy::LinkedAccountInstagramOAuth + | Privy::LinkedAccountTiktokOAuth + | Privy::LinkedAccountLineOAuth + | Privy::LinkedAccountTwitchOAuth + | Privy::LinkedAccountLinkedInOAuth + | Privy::LinkedAccountAppleOAuth + | Privy::LinkedAccountCustomOAuth + | Privy::LinkedAccountCustomJwt + | Privy::LinkedAccountFarcaster + | Privy::LinkedAccountPasskey + | Privy::LinkedAccountTelegram + | Privy::LinkedAccountCrossApp + | Privy::LinkedAccountAuthorizationKey + + module LinkedAccount + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::linked_account] + end + end +end diff --git a/sig/privy/models/linked_account_apple_input.rbs b/sig/privy/models/linked_account_apple_input.rbs new file mode 100644 index 0000000..4f3344c --- /dev/null +++ b/sig/privy/models/linked_account_apple_input.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type linked_account_apple_input = + { subject: String, type: :apple_oauth, email: String } + + class LinkedAccountAppleInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :apple_oauth + + attr_reader email: String? + + def email=: (String) -> String + + def initialize: ( + subject: String, + ?email: String, + ?type: :apple_oauth + ) -> void + + def to_hash: -> { subject: String, type: :apple_oauth, email: String } + end + end +end diff --git a/sig/privy/models/linked_account_apple_oauth.rbs b/sig/privy/models/linked_account_apple_oauth.rbs new file mode 100644 index 0000000..c392140 --- /dev/null +++ b/sig/privy/models/linked_account_apple_oauth.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type linked_account_apple_oauth = + { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountAppleOAuth::type_, + verified_at: Float + } + + class LinkedAccountAppleOAuth < Privy::Internal::Type::BaseModel + attr_accessor email: String? + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountAppleOAuth::type_ + + attr_accessor verified_at: Float + + def initialize: ( + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountAppleOAuth::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountAppleOAuth::type_, + verified_at: Float + } + + type type_ = :apple_oauth + + module Type + extend Privy::Internal::Type::Enum + + APPLE_OAUTH: :apple_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountAppleOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_authorization_key.rbs b/sig/privy/models/linked_account_authorization_key.rbs new file mode 100644 index 0000000..8d853df --- /dev/null +++ b/sig/privy/models/linked_account_authorization_key.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type linked_account_authorization_key = + { + first_verified_at: Float?, + latest_verified_at: Float?, + public_key: String, + type: Privy::Models::LinkedAccountAuthorizationKey::type_, + verified_at: Float + } + + class LinkedAccountAuthorizationKey < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor public_key: String + + attr_accessor type: Privy::Models::LinkedAccountAuthorizationKey::type_ + + attr_accessor verified_at: Float + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + public_key: String, + type: Privy::Models::LinkedAccountAuthorizationKey::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + public_key: String, + type: Privy::Models::LinkedAccountAuthorizationKey::type_, + verified_at: Float + } + + type type_ = :authorization_key + + module Type + extend Privy::Internal::Type::Enum + + AUTHORIZATION_KEY: :authorization_key + + def self?.values: -> ::Array[Privy::Models::LinkedAccountAuthorizationKey::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_base_wallet.rbs b/sig/privy/models/linked_account_base_wallet.rbs new file mode 100644 index 0000000..3e83e17 --- /dev/null +++ b/sig/privy/models/linked_account_base_wallet.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type linked_account_base_wallet = + { + address: String, + chain_type: Privy::Models::LinkedAccountBaseWallet::chain_type, + type: Privy::Models::LinkedAccountBaseWallet::type_ + } + + class LinkedAccountBaseWallet < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::LinkedAccountBaseWallet::chain_type + + attr_accessor type: Privy::Models::LinkedAccountBaseWallet::type_ + + def initialize: ( + address: String, + chain_type: Privy::Models::LinkedAccountBaseWallet::chain_type, + type: Privy::Models::LinkedAccountBaseWallet::type_ + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::LinkedAccountBaseWallet::chain_type, + type: Privy::Models::LinkedAccountBaseWallet::type_ + } + + type chain_type = :solana | :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA: :solana + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBaseWallet::chain_type] + end + + type type_ = :wallet | :smart_wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + SMART_WALLET: :smart_wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBaseWallet::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rbs b/sig/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rbs new file mode 100644 index 0000000..e22ae4a --- /dev/null +++ b/sig/privy/models/linked_account_bitcoin_segwit_embedded_wallet.rbs @@ -0,0 +1,145 @@ +module Privy + module Models + type linked_account_bitcoin_segwit_embedded_wallet = + { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + class LinkedAccountBitcoinSegwitEmbeddedWallet < Privy::Internal::Type::BaseModel + attr_accessor id: String? + + attr_accessor address: String + + attr_accessor chain_id: String + + attr_accessor chain_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::chain_type + + attr_accessor connector_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::connector_type + + attr_accessor delegated: bool + + attr_accessor first_verified_at: Float? + + attr_accessor imported: bool + + attr_accessor latest_verified_at: Float? + + attr_accessor public_key: String + + attr_accessor recovery_method: Privy::Models::embedded_wallet_recovery_method + + attr_accessor type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::type_ + + attr_accessor verified_at: Float + + attr_accessor wallet_client: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client + + attr_accessor wallet_client_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client_type + + attr_accessor wallet_index: Float + + def initialize: ( + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client_type, + wallet_index: Float + ) -> void + + def to_hash: -> { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + type chain_type = :"bitcoin-segwit" + + module ChainType + extend Privy::Internal::Type::Enum + + BITCOIN_SEGWIT: :"bitcoin-segwit" + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::chain_type] + end + + type connector_type = :embedded + + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED: :embedded + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::connector_type] + end + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::type_] + end + + type wallet_client = :privy + + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client] + end + + type wallet_client_type = :privy + + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet::wallet_client_type] + end + end + end +end diff --git a/sig/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rbs b/sig/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rbs new file mode 100644 index 0000000..5b78762 --- /dev/null +++ b/sig/privy/models/linked_account_bitcoin_taproot_embedded_wallet.rbs @@ -0,0 +1,145 @@ +module Privy + module Models + type linked_account_bitcoin_taproot_embedded_wallet = + { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + class LinkedAccountBitcoinTaprootEmbeddedWallet < Privy::Internal::Type::BaseModel + attr_accessor id: String? + + attr_accessor address: String + + attr_accessor chain_id: String + + attr_accessor chain_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::chain_type + + attr_accessor connector_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::connector_type + + attr_accessor delegated: bool + + attr_accessor first_verified_at: Float? + + attr_accessor imported: bool + + attr_accessor latest_verified_at: Float? + + attr_accessor public_key: String + + attr_accessor recovery_method: Privy::Models::embedded_wallet_recovery_method + + attr_accessor type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::type_ + + attr_accessor verified_at: Float + + attr_accessor wallet_client: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client + + attr_accessor wallet_client_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client_type + + attr_accessor wallet_index: Float + + def initialize: ( + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client_type, + wallet_index: Float + ) -> void + + def to_hash: -> { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + type chain_type = :"bitcoin-taproot" + + module ChainType + extend Privy::Internal::Type::Enum + + BITCOIN_TAPROOT: :"bitcoin-taproot" + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::chain_type] + end + + type connector_type = :embedded + + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED: :embedded + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::connector_type] + end + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::type_] + end + + type wallet_client = :privy + + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client] + end + + type wallet_client_type = :privy + + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet::wallet_client_type] + end + end + end +end diff --git a/sig/privy/models/linked_account_cross_app.rbs b/sig/privy/models/linked_account_cross_app.rbs new file mode 100644 index 0000000..da5e3e4 --- /dev/null +++ b/sig/privy/models/linked_account_cross_app.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type linked_account_cross_app = + { + embedded_wallets: ::Array[Privy::CrossAppEmbeddedWallet], + first_verified_at: Float?, + latest_verified_at: Float?, + provider_app_id: String, + smart_wallets: ::Array[Privy::CrossAppSmartWallet], + subject: String, + type: Privy::Models::LinkedAccountCrossApp::type_, + verified_at: Float + } + + class LinkedAccountCrossApp < Privy::Internal::Type::BaseModel + attr_accessor embedded_wallets: ::Array[Privy::CrossAppEmbeddedWallet] + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor provider_app_id: String + + attr_accessor smart_wallets: ::Array[Privy::CrossAppSmartWallet] + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountCrossApp::type_ + + attr_accessor verified_at: Float + + def initialize: ( + embedded_wallets: ::Array[Privy::CrossAppEmbeddedWallet], + first_verified_at: Float?, + latest_verified_at: Float?, + provider_app_id: String, + smart_wallets: ::Array[Privy::CrossAppSmartWallet], + subject: String, + type: Privy::Models::LinkedAccountCrossApp::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + embedded_wallets: ::Array[Privy::CrossAppEmbeddedWallet], + first_verified_at: Float?, + latest_verified_at: Float?, + provider_app_id: String, + smart_wallets: ::Array[Privy::CrossAppSmartWallet], + subject: String, + type: Privy::Models::LinkedAccountCrossApp::type_, + verified_at: Float + } + + type type_ = :cross_app + + module Type + extend Privy::Internal::Type::Enum + + CROSS_APP: :cross_app + + def self?.values: -> ::Array[Privy::Models::LinkedAccountCrossApp::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_curve_signing_embedded_wallet.rbs b/sig/privy/models/linked_account_curve_signing_embedded_wallet.rbs new file mode 100644 index 0000000..f54c1a4 --- /dev/null +++ b/sig/privy/models/linked_account_curve_signing_embedded_wallet.rbs @@ -0,0 +1,135 @@ +module Privy + module Models + type linked_account_curve_signing_embedded_wallet = + { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::curve_signing_chain_type, + connector_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + class LinkedAccountCurveSigningEmbeddedWallet < Privy::Internal::Type::BaseModel + attr_accessor id: String? + + attr_accessor address: String + + attr_accessor chain_id: String + + attr_accessor chain_type: Privy::Models::curve_signing_chain_type + + attr_accessor connector_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::connector_type + + attr_accessor delegated: bool + + attr_accessor first_verified_at: Float? + + attr_accessor imported: bool + + attr_accessor latest_verified_at: Float? + + attr_accessor public_key: String + + attr_accessor recovery_method: Privy::Models::embedded_wallet_recovery_method + + attr_accessor type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::type_ + + attr_accessor verified_at: Float + + attr_accessor wallet_client: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client + + attr_accessor wallet_client_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client_type + + attr_accessor wallet_index: Float + + def initialize: ( + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::curve_signing_chain_type, + connector_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client_type, + wallet_index: Float + ) -> void + + def to_hash: -> { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::curve_signing_chain_type, + connector_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + type connector_type = :embedded + + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED: :embedded + + def self?.values: -> ::Array[Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::connector_type] + end + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::type_] + end + + type wallet_client = :privy + + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client] + end + + type wallet_client_type = :privy + + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountCurveSigningEmbeddedWallet::wallet_client_type] + end + end + end +end diff --git a/sig/privy/models/linked_account_custom_jwt.rbs b/sig/privy/models/linked_account_custom_jwt.rbs new file mode 100644 index 0000000..820b28d --- /dev/null +++ b/sig/privy/models/linked_account_custom_jwt.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type linked_account_custom_jwt = + { + custom_user_id: String, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountCustomJwt::type_, + verified_at: Float + } + + class LinkedAccountCustomJwt < Privy::Internal::Type::BaseModel + attr_accessor custom_user_id: String + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor type: Privy::Models::LinkedAccountCustomJwt::type_ + + attr_accessor verified_at: Float + + def initialize: ( + custom_user_id: String, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountCustomJwt::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + custom_user_id: String, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountCustomJwt::type_, + verified_at: Float + } + + type type_ = :custom_auth + + module Type + extend Privy::Internal::Type::Enum + + CUSTOM_AUTH: :custom_auth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountCustomJwt::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_custom_jwt_input.rbs b/sig/privy/models/linked_account_custom_jwt_input.rbs new file mode 100644 index 0000000..ea54dc6 --- /dev/null +++ b/sig/privy/models/linked_account_custom_jwt_input.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type linked_account_custom_jwt_input = + { custom_user_id: String, type: :custom_auth } + + class LinkedAccountCustomJwtInput < Privy::Internal::Type::BaseModel + attr_accessor custom_user_id: String + + attr_accessor type: :custom_auth + + def initialize: (custom_user_id: String, ?type: :custom_auth) -> void + + def to_hash: -> { custom_user_id: String, type: :custom_auth } + end + end +end diff --git a/sig/privy/models/linked_account_custom_oauth.rbs b/sig/privy/models/linked_account_custom_oauth.rbs new file mode 100644 index 0000000..c757d90 --- /dev/null +++ b/sig/privy/models/linked_account_custom_oauth.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type linked_account_custom_oauth = + { + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: String, + verified_at: Float, + email: String, + name: String, + profile_picture_url: String, + username: String + } + + class LinkedAccountCustomOAuth < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor subject: String + + attr_accessor type: String + + attr_accessor verified_at: Float + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader profile_picture_url: String? + + def profile_picture_url=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: String, + verified_at: Float, + ?email: String, + ?name: String, + ?profile_picture_url: String, + ?username: String + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: String, + verified_at: Float, + email: String, + name: String, + profile_picture_url: String, + username: String + } + end + end +end diff --git a/sig/privy/models/linked_account_discord_input.rbs b/sig/privy/models/linked_account_discord_input.rbs new file mode 100644 index 0000000..068f5e7 --- /dev/null +++ b/sig/privy/models/linked_account_discord_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type linked_account_discord_input = + { subject: String, type: :discord_oauth, username: String, email: String } + + class LinkedAccountDiscordInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :discord_oauth + + attr_accessor username: String + + attr_reader email: String? + + def email=: (String) -> String + + def initialize: ( + subject: String, + username: String, + ?email: String, + ?type: :discord_oauth + ) -> void + + def to_hash: -> { + subject: String, + type: :discord_oauth, + username: String, + email: String + } + end + end +end diff --git a/sig/privy/models/linked_account_discord_oauth.rbs b/sig/privy/models/linked_account_discord_oauth.rbs new file mode 100644 index 0000000..1c54def --- /dev/null +++ b/sig/privy/models/linked_account_discord_oauth.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type linked_account_discord_oauth = + { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountDiscordOAuth::type_, + username: String?, + verified_at: Float + } + + class LinkedAccountDiscordOAuth < Privy::Internal::Type::BaseModel + attr_accessor email: String? + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountDiscordOAuth::type_ + + attr_accessor username: String? + + attr_accessor verified_at: Float + + def initialize: ( + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountDiscordOAuth::type_, + username: String?, + verified_at: Float + ) -> void + + def to_hash: -> { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountDiscordOAuth::type_, + username: String?, + verified_at: Float + } + + type type_ = :discord_oauth + + module Type + extend Privy::Internal::Type::Enum + + DISCORD_OAUTH: :discord_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountDiscordOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_email.rbs b/sig/privy/models/linked_account_email.rbs new file mode 100644 index 0000000..046c732 --- /dev/null +++ b/sig/privy/models/linked_account_email.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type linked_account_email = + { + address: String, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountEmail::type_, + verified_at: Float + } + + class LinkedAccountEmail < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor type: Privy::Models::LinkedAccountEmail::type_ + + attr_accessor verified_at: Float + + def initialize: ( + address: String, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountEmail::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + address: String, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountEmail::type_, + verified_at: Float + } + + type type_ = :email + + module Type + extend Privy::Internal::Type::Enum + + EMAIL: :email + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEmail::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_email_input.rbs b/sig/privy/models/linked_account_email_input.rbs new file mode 100644 index 0000000..137b7f8 --- /dev/null +++ b/sig/privy/models/linked_account_email_input.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type linked_account_email_input = { address: String, type: :email } + + class LinkedAccountEmailInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor type: :email + + def initialize: (address: String, ?type: :email) -> void + + def to_hash: -> { address: String, type: :email } + end + end +end diff --git a/sig/privy/models/linked_account_embedded_wallet.rbs b/sig/privy/models/linked_account_embedded_wallet.rbs new file mode 100644 index 0000000..11a9d3a --- /dev/null +++ b/sig/privy/models/linked_account_embedded_wallet.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type linked_account_embedded_wallet = + Privy::LinkedAccountEthereumEmbeddedWallet + | Privy::LinkedAccountSolanaEmbeddedWallet + | Privy::LinkedAccountBitcoinSegwitEmbeddedWallet + | Privy::LinkedAccountBitcoinTaprootEmbeddedWallet + | Privy::LinkedAccountCurveSigningEmbeddedWallet + + module LinkedAccountEmbeddedWallet + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::linked_account_embedded_wallet] + end + end +end diff --git a/sig/privy/models/linked_account_embedded_wallet_with_id.rbs b/sig/privy/models/linked_account_embedded_wallet_with_id.rbs new file mode 100644 index 0000000..0408ac7 --- /dev/null +++ b/sig/privy/models/linked_account_embedded_wallet_with_id.rbs @@ -0,0 +1,206 @@ +module Privy + module Models + type linked_account_embedded_wallet_with_id = + Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet + | Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet + | Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet + | Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet + | Privy::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet + + module LinkedAccountEmbeddedWalletWithID + extend Privy::Internal::Type::Union + + type linked_account_ethereum_embedded_wallet = + { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::recovery_method + } + + class LinkedAccountEthereumEmbeddedWallet < Privy::Models::LinkedAccountEthereumEmbeddedWallet + def id: -> String + + def id=: (String _) -> String + + def recovery_method: -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::recovery_method + + def recovery_method=: ( + Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::recovery_method _ + ) -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::recovery_method + + def initialize: ( + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::recovery_method + ) -> void + + def to_hash: -> { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::recovery_method + } + + type recovery_method = :"privy-v2" + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2: :"privy-v2" + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountEthereumEmbeddedWallet::recovery_method] + end + end + + type linked_account_solana_embedded_wallet = + { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::recovery_method + } + + class LinkedAccountSolanaEmbeddedWallet < Privy::Models::LinkedAccountSolanaEmbeddedWallet + def id: -> String + + def id=: (String _) -> String + + def recovery_method: -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::recovery_method + + def recovery_method=: ( + Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::recovery_method _ + ) -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::recovery_method + + def initialize: ( + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::recovery_method + ) -> void + + def to_hash: -> { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::recovery_method + } + + type recovery_method = :"privy-v2" + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2: :"privy-v2" + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountSolanaEmbeddedWallet::recovery_method] + end + end + + type linked_account_bitcoin_segwit_embedded_wallet = + { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::recovery_method + } + + class LinkedAccountBitcoinSegwitEmbeddedWallet < Privy::Models::LinkedAccountBitcoinSegwitEmbeddedWallet + def id: -> String + + def id=: (String _) -> String + + def recovery_method: -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::recovery_method + + def recovery_method=: ( + Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::recovery_method _ + ) -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::recovery_method + + def initialize: ( + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::recovery_method + ) -> void + + def to_hash: -> { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::recovery_method + } + + type recovery_method = :"privy-v2" + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2: :"privy-v2" + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinSegwitEmbeddedWallet::recovery_method] + end + end + + type linked_account_bitcoin_taproot_embedded_wallet = + { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::recovery_method + } + + class LinkedAccountBitcoinTaprootEmbeddedWallet < Privy::Models::LinkedAccountBitcoinTaprootEmbeddedWallet + def id: -> String + + def id=: (String _) -> String + + def recovery_method: -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::recovery_method + + def recovery_method=: ( + Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::recovery_method _ + ) -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::recovery_method + + def initialize: ( + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::recovery_method + ) -> void + + def to_hash: -> { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::recovery_method + } + + type recovery_method = :"privy-v2" + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2: :"privy-v2" + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountBitcoinTaprootEmbeddedWallet::recovery_method] + end + end + + type linked_account_curve_signing_embedded_wallet = + { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::recovery_method + } + + class LinkedAccountCurveSigningEmbeddedWallet < Privy::Models::LinkedAccountCurveSigningEmbeddedWallet + def id: -> String + + def id=: (String _) -> String + + def recovery_method: -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::recovery_method + + def recovery_method=: ( + Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::recovery_method _ + ) -> Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::recovery_method + + def initialize: ( + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::recovery_method + ) -> void + + def to_hash: -> { + id: String, + recovery_method: Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::recovery_method + } + + type recovery_method = :"privy-v2" + + module RecoveryMethod + extend Privy::Internal::Type::Enum + + PRIVY_V2: :"privy-v2" + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEmbeddedWalletWithID::LinkedAccountCurveSigningEmbeddedWallet::recovery_method] + end + end + + def self?.variants: -> ::Array[Privy::Models::linked_account_embedded_wallet_with_id] + end + end +end diff --git a/sig/privy/models/linked_account_ethereum.rbs b/sig/privy/models/linked_account_ethereum.rbs new file mode 100644 index 0000000..e07a24c --- /dev/null +++ b/sig/privy/models/linked_account_ethereum.rbs @@ -0,0 +1,101 @@ +module Privy + module Models + type linked_account_ethereum = + { + address: String, + chain_type: Privy::Models::LinkedAccountEthereum::chain_type, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountEthereum::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountEthereum::wallet_client, + chain_id: String, + connector_type: String, + wallet_client_type: String + } + + class LinkedAccountEthereum < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::LinkedAccountEthereum::chain_type + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor type: Privy::Models::LinkedAccountEthereum::type_ + + attr_accessor verified_at: Float + + attr_accessor wallet_client: Privy::Models::LinkedAccountEthereum::wallet_client + + attr_reader chain_id: String? + + def chain_id=: (String) -> String + + attr_reader connector_type: String? + + def connector_type=: (String) -> String + + attr_reader wallet_client_type: String? + + def wallet_client_type=: (String) -> String + + def initialize: ( + address: String, + chain_type: Privy::Models::LinkedAccountEthereum::chain_type, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountEthereum::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountEthereum::wallet_client, + ?chain_id: String, + ?connector_type: String, + ?wallet_client_type: String + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::LinkedAccountEthereum::chain_type, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountEthereum::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountEthereum::wallet_client, + chain_id: String, + connector_type: String, + wallet_client_type: String + } + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereum::chain_type] + end + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereum::type_] + end + + type wallet_client = :unknown + + module WalletClient + extend Privy::Internal::Type::Enum + + UNKNOWN: :unknown + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereum::wallet_client] + end + end + end +end diff --git a/sig/privy/models/linked_account_ethereum_embedded_wallet.rbs b/sig/privy/models/linked_account_ethereum_embedded_wallet.rbs new file mode 100644 index 0000000..eae1a97 --- /dev/null +++ b/sig/privy/models/linked_account_ethereum_embedded_wallet.rbs @@ -0,0 +1,140 @@ +module Privy + module Models + type linked_account_ethereum_embedded_wallet = + { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + class LinkedAccountEthereumEmbeddedWallet < Privy::Internal::Type::BaseModel + attr_accessor id: String? + + attr_accessor address: String + + attr_accessor chain_id: String + + attr_accessor chain_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::chain_type + + attr_accessor connector_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::connector_type + + attr_accessor delegated: bool + + attr_accessor first_verified_at: Float? + + attr_accessor imported: bool + + attr_accessor latest_verified_at: Float? + + attr_accessor recovery_method: Privy::Models::embedded_wallet_recovery_method + + attr_accessor type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::type_ + + attr_accessor verified_at: Float + + attr_accessor wallet_client: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client + + attr_accessor wallet_client_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client_type + + attr_accessor wallet_index: Float + + def initialize: ( + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client_type, + wallet_index: Float + ) -> void + + def to_hash: -> { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + type chain_type = :ethereum + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereumEmbeddedWallet::chain_type] + end + + type connector_type = :embedded + + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED: :embedded + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereumEmbeddedWallet::connector_type] + end + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereumEmbeddedWallet::type_] + end + + type wallet_client = :privy + + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client] + end + + type wallet_client_type = :privy + + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountEthereumEmbeddedWallet::wallet_client_type] + end + end + end +end diff --git a/sig/privy/models/linked_account_farcaster.rbs b/sig/privy/models/linked_account_farcaster.rbs new file mode 100644 index 0000000..046baca --- /dev/null +++ b/sig/privy/models/linked_account_farcaster.rbs @@ -0,0 +1,104 @@ +module Privy + module Models + type linked_account_farcaster = + { + fid: Float, + first_verified_at: Float?, + latest_verified_at: Float?, + owner_address: String, + type: Privy::Models::LinkedAccountFarcaster::type_, + verified_at: Float, + bio: String, + display_name: String, + homepage_url: String, + profile_picture: String, + profile_picture_url: String, + signer_public_key: String, + username: String + } + + class LinkedAccountFarcaster < Privy::Internal::Type::BaseModel + attr_accessor fid: Float + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor owner_address: String + + attr_accessor type: Privy::Models::LinkedAccountFarcaster::type_ + + attr_accessor verified_at: Float + + attr_reader bio: String? + + def bio=: (String) -> String + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader homepage_url: String? + + def homepage_url=: (String) -> String + + attr_reader profile_picture: String? + + def profile_picture=: (String) -> String + + attr_reader profile_picture_url: String? + + def profile_picture_url=: (String) -> String + + attr_reader signer_public_key: String? + + def signer_public_key=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + fid: Float, + first_verified_at: Float?, + latest_verified_at: Float?, + owner_address: String, + type: Privy::Models::LinkedAccountFarcaster::type_, + verified_at: Float, + ?bio: String, + ?display_name: String, + ?homepage_url: String, + ?profile_picture: String, + ?profile_picture_url: String, + ?signer_public_key: String, + ?username: String + ) -> void + + def to_hash: -> { + fid: Float, + first_verified_at: Float?, + latest_verified_at: Float?, + owner_address: String, + type: Privy::Models::LinkedAccountFarcaster::type_, + verified_at: Float, + bio: String, + display_name: String, + homepage_url: String, + profile_picture: String, + profile_picture_url: String, + signer_public_key: String, + username: String + } + + type type_ = :farcaster + + module Type + extend Privy::Internal::Type::Enum + + FARCASTER: :farcaster + + def self?.values: -> ::Array[Privy::Models::LinkedAccountFarcaster::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_farcaster_input.rbs b/sig/privy/models/linked_account_farcaster_input.rbs new file mode 100644 index 0000000..2de5ecb --- /dev/null +++ b/sig/privy/models/linked_account_farcaster_input.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type linked_account_farcaster_input = + { + fid: Integer, + owner_address: String, + type: :farcaster, + bio: String, + display_name: String, + homepage_url: String, + profile_picture_url: String, + username: String + } + + class LinkedAccountFarcasterInput < Privy::Internal::Type::BaseModel + attr_accessor fid: Integer + + attr_accessor owner_address: String + + attr_accessor type: :farcaster + + attr_reader bio: String? + + def bio=: (String) -> String + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader homepage_url: String? + + def homepage_url=: (String) -> String + + attr_reader profile_picture_url: String? + + def profile_picture_url=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + fid: Integer, + owner_address: String, + ?bio: String, + ?display_name: String, + ?homepage_url: String, + ?profile_picture_url: String, + ?username: String, + ?type: :farcaster + ) -> void + + def to_hash: -> { + fid: Integer, + owner_address: String, + type: :farcaster, + bio: String, + display_name: String, + homepage_url: String, + profile_picture_url: String, + username: String + } + end + end +end diff --git a/sig/privy/models/linked_account_github_input.rbs b/sig/privy/models/linked_account_github_input.rbs new file mode 100644 index 0000000..fafd6ca --- /dev/null +++ b/sig/privy/models/linked_account_github_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type linked_account_github_input = + { + subject: String, + type: :github_oauth, + username: String, + email: String, + name: String + } + + class LinkedAccountGitHubInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :github_oauth + + attr_accessor username: String + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + subject: String, + username: String, + ?email: String, + ?name: String, + ?type: :github_oauth + ) -> void + + def to_hash: -> { + subject: String, + type: :github_oauth, + username: String, + email: String, + name: String + } + end + end +end diff --git a/sig/privy/models/linked_account_github_oauth.rbs b/sig/privy/models/linked_account_github_oauth.rbs new file mode 100644 index 0000000..b8a8811 --- /dev/null +++ b/sig/privy/models/linked_account_github_oauth.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type linked_account_github_oauth = + { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountGitHubOAuth::type_, + username: String?, + verified_at: Float + } + + class LinkedAccountGitHubOAuth < Privy::Internal::Type::BaseModel + attr_accessor email: String? + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor name: String? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountGitHubOAuth::type_ + + attr_accessor username: String? + + attr_accessor verified_at: Float + + def initialize: ( + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountGitHubOAuth::type_, + username: String?, + verified_at: Float + ) -> void + + def to_hash: -> { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountGitHubOAuth::type_, + username: String?, + verified_at: Float + } + + type type_ = :github_oauth + + module Type + extend Privy::Internal::Type::Enum + + GITHUB_OAUTH: :github_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountGitHubOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_google_input.rbs b/sig/privy/models/linked_account_google_input.rbs new file mode 100644 index 0000000..d104f98 --- /dev/null +++ b/sig/privy/models/linked_account_google_input.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type linked_account_google_input = + { email: String, name: String, subject: String, type: :google_oauth } + + class LinkedAccountGoogleInput < Privy::Internal::Type::BaseModel + attr_accessor email: String + + attr_accessor name: String + + attr_accessor subject: String + + attr_accessor type: :google_oauth + + def initialize: ( + email: String, + name: String, + subject: String, + ?type: :google_oauth + ) -> void + + def to_hash: -> { + email: String, + name: String, + subject: String, + type: :google_oauth + } + end + end +end diff --git a/sig/privy/models/linked_account_google_oauth.rbs b/sig/privy/models/linked_account_google_oauth.rbs new file mode 100644 index 0000000..3a19914 --- /dev/null +++ b/sig/privy/models/linked_account_google_oauth.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type linked_account_google_oauth = + { + email: String, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountGoogleOAuth::type_, + verified_at: Float + } + + class LinkedAccountGoogleOAuth < Privy::Internal::Type::BaseModel + attr_accessor email: String + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor name: String? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountGoogleOAuth::type_ + + attr_accessor verified_at: Float + + def initialize: ( + email: String, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountGoogleOAuth::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + email: String, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountGoogleOAuth::type_, + verified_at: Float + } + + type type_ = :google_oauth + + module Type + extend Privy::Internal::Type::Enum + + GOOGLE_OAUTH: :google_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountGoogleOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_input.rbs b/sig/privy/models/linked_account_input.rbs new file mode 100644 index 0000000..667f200 --- /dev/null +++ b/sig/privy/models/linked_account_input.rbs @@ -0,0 +1,29 @@ +module Privy + module Models + type linked_account_input = + Privy::LinkedAccountWalletInput + | Privy::LinkedAccountEmailInput + | Privy::LinkedAccountPhoneInput + | Privy::LinkedAccountGoogleInput + | Privy::LinkedAccountTwitterInput + | Privy::LinkedAccountDiscordInput + | Privy::LinkedAccountGitHubInput + | Privy::LinkedAccountSpotifyInput + | Privy::LinkedAccountInstagramInput + | Privy::LinkedAccountTiktokInput + | Privy::LinkedAccountLineInput + | Privy::LinkedAccountTwitchInput + | Privy::LinkedAccountAppleInput + | Privy::LinkedAccountLinkedInInput + | Privy::LinkedAccountFarcasterInput + | Privy::LinkedAccountTelegramInput + | Privy::LinkedAccountCustomJwtInput + | Privy::LinkedAccountPasskeyInput + + module LinkedAccountInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::linked_account_input] + end + end +end diff --git a/sig/privy/models/linked_account_instagram_input.rbs b/sig/privy/models/linked_account_instagram_input.rbs new file mode 100644 index 0000000..efff4d5 --- /dev/null +++ b/sig/privy/models/linked_account_instagram_input.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type linked_account_instagram_input = + { subject: String, type: :instagram_oauth, username: String } + + class LinkedAccountInstagramInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :instagram_oauth + + attr_accessor username: String + + def initialize: ( + subject: String, + username: String, + ?type: :instagram_oauth + ) -> void + + def to_hash: -> { + subject: String, + type: :instagram_oauth, + username: String + } + end + end +end diff --git a/sig/privy/models/linked_account_instagram_oauth.rbs b/sig/privy/models/linked_account_instagram_oauth.rbs new file mode 100644 index 0000000..d1b9a8d --- /dev/null +++ b/sig/privy/models/linked_account_instagram_oauth.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type linked_account_instagram_oauth = + { + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountInstagramOAuth::type_, + username: String?, + verified_at: Float + } + + class LinkedAccountInstagramOAuth < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountInstagramOAuth::type_ + + attr_accessor username: String? + + attr_accessor verified_at: Float + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountInstagramOAuth::type_, + username: String?, + verified_at: Float + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountInstagramOAuth::type_, + username: String?, + verified_at: Float + } + + type type_ = :instagram_oauth + + module Type + extend Privy::Internal::Type::Enum + + INSTAGRAM_OAUTH: :instagram_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountInstagramOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_line_input.rbs b/sig/privy/models/linked_account_line_input.rbs new file mode 100644 index 0000000..2fbef6e --- /dev/null +++ b/sig/privy/models/linked_account_line_input.rbs @@ -0,0 +1,46 @@ +module Privy + module Models + type linked_account_line_input = + { + subject: String, + type: :line_oauth, + email: String, + name: String, + profile_picture_url: String + } + + class LinkedAccountLineInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :line_oauth + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader profile_picture_url: String? + + def profile_picture_url=: (String) -> String + + def initialize: ( + subject: String, + ?email: String, + ?name: String, + ?profile_picture_url: String, + ?type: :line_oauth + ) -> void + + def to_hash: -> { + subject: String, + type: :line_oauth, + email: String, + name: String, + profile_picture_url: String + } + end + end +end diff --git a/sig/privy/models/linked_account_line_oauth.rbs b/sig/privy/models/linked_account_line_oauth.rbs new file mode 100644 index 0000000..8bc95a0 --- /dev/null +++ b/sig/privy/models/linked_account_line_oauth.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type linked_account_line_oauth = + { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + profile_picture_url: String?, + subject: String, + type: Privy::Models::LinkedAccountLineOAuth::type_, + verified_at: Float + } + + class LinkedAccountLineOAuth < Privy::Internal::Type::BaseModel + attr_accessor email: String? + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor name: String? + + attr_accessor profile_picture_url: String? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountLineOAuth::type_ + + attr_accessor verified_at: Float + + def initialize: ( + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + profile_picture_url: String?, + subject: String, + type: Privy::Models::LinkedAccountLineOAuth::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + profile_picture_url: String?, + subject: String, + type: Privy::Models::LinkedAccountLineOAuth::type_, + verified_at: Float + } + + type type_ = :line_oauth + + module Type + extend Privy::Internal::Type::Enum + + LINE_OAUTH: :line_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountLineOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_linked_in_input.rbs b/sig/privy/models/linked_account_linked_in_input.rbs new file mode 100644 index 0000000..87fc374 --- /dev/null +++ b/sig/privy/models/linked_account_linked_in_input.rbs @@ -0,0 +1,46 @@ +module Privy + module Models + type linked_account_linked_in_input = + { + subject: String, + type: :linkedin_oauth, + email: String, + name: String, + vanity_name: String + } + + class LinkedAccountLinkedInInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :linkedin_oauth + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader vanity_name: String? + + def vanity_name=: (String) -> String + + def initialize: ( + subject: String, + ?email: String, + ?name: String, + ?vanity_name: String, + ?type: :linkedin_oauth + ) -> void + + def to_hash: -> { + subject: String, + type: :linkedin_oauth, + email: String, + name: String, + vanity_name: String + } + end + end +end diff --git a/sig/privy/models/linked_account_linked_in_oauth.rbs b/sig/privy/models/linked_account_linked_in_oauth.rbs new file mode 100644 index 0000000..8563802 --- /dev/null +++ b/sig/privy/models/linked_account_linked_in_oauth.rbs @@ -0,0 +1,69 @@ +module Privy + module Models + type linked_account_linked_in_oauth = + { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountLinkedInOAuth::type_, + verified_at: Float, + name: String, + vanity_name: String + } + + class LinkedAccountLinkedInOAuth < Privy::Internal::Type::BaseModel + attr_accessor email: String? + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountLinkedInOAuth::type_ + + attr_accessor verified_at: Float + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader vanity_name: String? + + def vanity_name=: (String) -> String + + def initialize: ( + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountLinkedInOAuth::type_, + verified_at: Float, + ?name: String, + ?vanity_name: String + ) -> void + + def to_hash: -> { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountLinkedInOAuth::type_, + verified_at: Float, + name: String, + vanity_name: String + } + + type type_ = :linkedin_oauth + + module Type + extend Privy::Internal::Type::Enum + + LINKEDIN_OAUTH: :linkedin_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountLinkedInOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_passkey.rbs b/sig/privy/models/linked_account_passkey.rbs new file mode 100644 index 0000000..694ed22 --- /dev/null +++ b/sig/privy/models/linked_account_passkey.rbs @@ -0,0 +1,90 @@ +module Privy + module Models + type linked_account_passkey = + { + credential_id: String, + enrolled_in_mfa: bool, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountPasskey::type_, + verified_at: Float, + authenticator_name: String, + created_with_browser: String, + created_with_device: String, + created_with_os: String, + public_key: String + } + + class LinkedAccountPasskey < Privy::Internal::Type::BaseModel + attr_accessor credential_id: String + + attr_accessor enrolled_in_mfa: bool + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor type: Privy::Models::LinkedAccountPasskey::type_ + + attr_accessor verified_at: Float + + attr_reader authenticator_name: String? + + def authenticator_name=: (String) -> String + + attr_reader created_with_browser: String? + + def created_with_browser=: (String) -> String + + attr_reader created_with_device: String? + + def created_with_device=: (String) -> String + + attr_reader created_with_os: String? + + def created_with_os=: (String) -> String + + attr_reader public_key: String? + + def public_key=: (String) -> String + + def initialize: ( + credential_id: String, + enrolled_in_mfa: bool, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountPasskey::type_, + verified_at: Float, + ?authenticator_name: String, + ?created_with_browser: String, + ?created_with_device: String, + ?created_with_os: String, + ?public_key: String + ) -> void + + def to_hash: -> { + credential_id: String, + enrolled_in_mfa: bool, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountPasskey::type_, + verified_at: Float, + authenticator_name: String, + created_with_browser: String, + created_with_device: String, + created_with_os: String, + public_key: String + } + + type type_ = :passkey + + module Type + extend Privy::Internal::Type::Enum + + PASSKEY: :passkey + + def self?.values: -> ::Array[Privy::Models::LinkedAccountPasskey::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_passkey_input.rbs b/sig/privy/models/linked_account_passkey_input.rbs new file mode 100644 index 0000000..285f1ad --- /dev/null +++ b/sig/privy/models/linked_account_passkey_input.rbs @@ -0,0 +1,51 @@ +module Privy + module Models + type linked_account_passkey_input = + { + credential_device_type: Privy::Models::LinkedAccountPasskeyInput::credential_device_type, + credential_id: String, + credential_public_key: String, + credential_username: String, + type: :passkey + } + + class LinkedAccountPasskeyInput < Privy::Internal::Type::BaseModel + attr_accessor credential_device_type: Privy::Models::LinkedAccountPasskeyInput::credential_device_type + + attr_accessor credential_id: String + + attr_accessor credential_public_key: String + + attr_accessor credential_username: String + + attr_accessor type: :passkey + + def initialize: ( + credential_device_type: Privy::Models::LinkedAccountPasskeyInput::credential_device_type, + credential_id: String, + credential_public_key: String, + credential_username: String, + ?type: :passkey + ) -> void + + def to_hash: -> { + credential_device_type: Privy::Models::LinkedAccountPasskeyInput::credential_device_type, + credential_id: String, + credential_public_key: String, + credential_username: String, + type: :passkey + } + + type credential_device_type = :singleDevice | :multiDevice + + module CredentialDeviceType + extend Privy::Internal::Type::Enum + + SINGLE_DEVICE: :singleDevice + MULTI_DEVICE: :multiDevice + + def self?.values: -> ::Array[Privy::Models::LinkedAccountPasskeyInput::credential_device_type] + end + end + end +end diff --git a/sig/privy/models/linked_account_phone.rbs b/sig/privy/models/linked_account_phone.rbs new file mode 100644 index 0000000..386685d --- /dev/null +++ b/sig/privy/models/linked_account_phone.rbs @@ -0,0 +1,57 @@ +module Privy + module Models + type linked_account_phone = + { + first_verified_at: Float?, + latest_verified_at: Float?, + phone_number: String, + type: Privy::Models::LinkedAccountPhone::type_, + verified_at: Float, + number: String + } + + class LinkedAccountPhone < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor phone_number: String + + attr_accessor type: Privy::Models::LinkedAccountPhone::type_ + + attr_accessor verified_at: Float + + attr_reader number: String? + + def number=: (String) -> String + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + phone_number: String, + type: Privy::Models::LinkedAccountPhone::type_, + verified_at: Float, + ?number: String + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + phone_number: String, + type: Privy::Models::LinkedAccountPhone::type_, + verified_at: Float, + number: String + } + + type type_ = :phone + + module Type + extend Privy::Internal::Type::Enum + + PHONE: :phone + + def self?.values: -> ::Array[Privy::Models::LinkedAccountPhone::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_phone_input.rbs b/sig/privy/models/linked_account_phone_input.rbs new file mode 100644 index 0000000..89bca77 --- /dev/null +++ b/sig/privy/models/linked_account_phone_input.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type linked_account_phone_input = { number: String, type: :phone } + + class LinkedAccountPhoneInput < Privy::Internal::Type::BaseModel + attr_accessor number: String + + attr_accessor type: :phone + + def initialize: (number: String, ?type: :phone) -> void + + def to_hash: -> { number: String, type: :phone } + end + end +end diff --git a/sig/privy/models/linked_account_smart_wallet.rbs b/sig/privy/models/linked_account_smart_wallet.rbs new file mode 100644 index 0000000..6be00c1 --- /dev/null +++ b/sig/privy/models/linked_account_smart_wallet.rbs @@ -0,0 +1,62 @@ +module Privy + module Models + type linked_account_smart_wallet = + { + address: String, + first_verified_at: Float?, + latest_verified_at: Float?, + smart_wallet_type: Privy::Models::smart_wallet_type, + type: Privy::Models::LinkedAccountSmartWallet::type_, + verified_at: Float, + smart_wallet_version: String + } + + class LinkedAccountSmartWallet < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor smart_wallet_type: Privy::Models::smart_wallet_type + + attr_accessor type: Privy::Models::LinkedAccountSmartWallet::type_ + + attr_accessor verified_at: Float + + attr_reader smart_wallet_version: String? + + def smart_wallet_version=: (String) -> String + + def initialize: ( + address: String, + first_verified_at: Float?, + latest_verified_at: Float?, + smart_wallet_type: Privy::Models::smart_wallet_type, + type: Privy::Models::LinkedAccountSmartWallet::type_, + verified_at: Float, + ?smart_wallet_version: String + ) -> void + + def to_hash: -> { + address: String, + first_verified_at: Float?, + latest_verified_at: Float?, + smart_wallet_type: Privy::Models::smart_wallet_type, + type: Privy::Models::LinkedAccountSmartWallet::type_, + verified_at: Float, + smart_wallet_version: String + } + + type type_ = :smart_wallet + + module Type + extend Privy::Internal::Type::Enum + + SMART_WALLET: :smart_wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSmartWallet::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_solana.rbs b/sig/privy/models/linked_account_solana.rbs new file mode 100644 index 0000000..9d83959 --- /dev/null +++ b/sig/privy/models/linked_account_solana.rbs @@ -0,0 +1,94 @@ +module Privy + module Models + type linked_account_solana = + { + address: String, + chain_type: Privy::Models::LinkedAccountSolana::chain_type, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountSolana::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountSolana::wallet_client, + connector_type: String, + wallet_client_type: String + } + + class LinkedAccountSolana < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::LinkedAccountSolana::chain_type + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor type: Privy::Models::LinkedAccountSolana::type_ + + attr_accessor verified_at: Float + + attr_accessor wallet_client: Privy::Models::LinkedAccountSolana::wallet_client + + attr_reader connector_type: String? + + def connector_type=: (String) -> String + + attr_reader wallet_client_type: String? + + def wallet_client_type=: (String) -> String + + def initialize: ( + address: String, + chain_type: Privy::Models::LinkedAccountSolana::chain_type, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountSolana::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountSolana::wallet_client, + ?connector_type: String, + ?wallet_client_type: String + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::LinkedAccountSolana::chain_type, + first_verified_at: Float?, + latest_verified_at: Float?, + type: Privy::Models::LinkedAccountSolana::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountSolana::wallet_client, + connector_type: String, + wallet_client_type: String + } + + type chain_type = :solana + + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolana::chain_type] + end + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolana::type_] + end + + type wallet_client = :unknown + + module WalletClient + extend Privy::Internal::Type::Enum + + UNKNOWN: :unknown + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolana::wallet_client] + end + end + end +end diff --git a/sig/privy/models/linked_account_solana_embedded_wallet.rbs b/sig/privy/models/linked_account_solana_embedded_wallet.rbs new file mode 100644 index 0000000..7732bbd --- /dev/null +++ b/sig/privy/models/linked_account_solana_embedded_wallet.rbs @@ -0,0 +1,145 @@ +module Privy + module Models + type linked_account_solana_embedded_wallet = + { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + class LinkedAccountSolanaEmbeddedWallet < Privy::Internal::Type::BaseModel + attr_accessor id: String? + + attr_accessor address: String + + attr_accessor chain_id: String + + attr_accessor chain_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::chain_type + + attr_accessor connector_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::connector_type + + attr_accessor delegated: bool + + attr_accessor first_verified_at: Float? + + attr_accessor imported: bool + + attr_accessor latest_verified_at: Float? + + attr_accessor public_key: String + + attr_accessor recovery_method: Privy::Models::embedded_wallet_recovery_method + + attr_accessor type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::type_ + + attr_accessor verified_at: Float + + attr_accessor wallet_client: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client + + attr_accessor wallet_client_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client_type + + attr_accessor wallet_index: Float + + def initialize: ( + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client_type, + wallet_index: Float + ) -> void + + def to_hash: -> { + id: String?, + address: String, + chain_id: String, + chain_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::chain_type, + connector_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::connector_type, + delegated: bool, + first_verified_at: Float?, + imported: bool, + latest_verified_at: Float?, + public_key: String, + recovery_method: Privy::Models::embedded_wallet_recovery_method, + type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::type_, + verified_at: Float, + wallet_client: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client, + wallet_client_type: Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client_type, + wallet_index: Float + } + + type chain_type = :solana + + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolanaEmbeddedWallet::chain_type] + end + + type connector_type = :embedded + + module ConnectorType + extend Privy::Internal::Type::Enum + + EMBEDDED: :embedded + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolanaEmbeddedWallet::connector_type] + end + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolanaEmbeddedWallet::type_] + end + + type wallet_client = :privy + + module WalletClient + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client] + end + + type wallet_client_type = :privy + + module WalletClientType + extend Privy::Internal::Type::Enum + + PRIVY: :privy + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSolanaEmbeddedWallet::wallet_client_type] + end + end + end +end diff --git a/sig/privy/models/linked_account_spotify_input.rbs b/sig/privy/models/linked_account_spotify_input.rbs new file mode 100644 index 0000000..990ab2c --- /dev/null +++ b/sig/privy/models/linked_account_spotify_input.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type linked_account_spotify_input = + { subject: String, type: :spotify_oauth, email: String, name: String } + + class LinkedAccountSpotifyInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :spotify_oauth + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + def initialize: ( + subject: String, + ?email: String, + ?name: String, + ?type: :spotify_oauth + ) -> void + + def to_hash: -> { + subject: String, + type: :spotify_oauth, + email: String, + name: String + } + end + end +end diff --git a/sig/privy/models/linked_account_spotify_oauth.rbs b/sig/privy/models/linked_account_spotify_oauth.rbs new file mode 100644 index 0000000..bb49135 --- /dev/null +++ b/sig/privy/models/linked_account_spotify_oauth.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type linked_account_spotify_oauth = + { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountSpotifyOAuth::type_, + verified_at: Float + } + + class LinkedAccountSpotifyOAuth < Privy::Internal::Type::BaseModel + attr_accessor email: String? + + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor name: String? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountSpotifyOAuth::type_ + + attr_accessor verified_at: Float + + def initialize: ( + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountSpotifyOAuth::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + email: String?, + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountSpotifyOAuth::type_, + verified_at: Float + } + + type type_ = :spotify_oauth + + module Type + extend Privy::Internal::Type::Enum + + SPOTIFY_OAUTH: :spotify_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountSpotifyOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_telegram.rbs b/sig/privy/models/linked_account_telegram.rbs new file mode 100644 index 0000000..9251292 --- /dev/null +++ b/sig/privy/models/linked_account_telegram.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type linked_account_telegram = + { + first_verified_at: Float?, + latest_verified_at: Float?, + telegram_user_id: String, + type: Privy::Models::LinkedAccountTelegram::type_, + verified_at: Float, + first_name: String?, + last_name: String?, + photo_url: String?, + username: String? + } + + class LinkedAccountTelegram < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor telegram_user_id: String + + attr_accessor type: Privy::Models::LinkedAccountTelegram::type_ + + attr_accessor verified_at: Float + + attr_accessor first_name: String? + + attr_accessor last_name: String? + + attr_accessor photo_url: String? + + attr_accessor username: String? + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + telegram_user_id: String, + type: Privy::Models::LinkedAccountTelegram::type_, + verified_at: Float, + ?first_name: String?, + ?last_name: String?, + ?photo_url: String?, + ?username: String? + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + telegram_user_id: String, + type: Privy::Models::LinkedAccountTelegram::type_, + verified_at: Float, + first_name: String?, + last_name: String?, + photo_url: String?, + username: String? + } + + type type_ = :telegram + + module Type + extend Privy::Internal::Type::Enum + + TELEGRAM: :telegram + + def self?.values: -> ::Array[Privy::Models::LinkedAccountTelegram::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_telegram_input.rbs b/sig/privy/models/linked_account_telegram_input.rbs new file mode 100644 index 0000000..f5cee57 --- /dev/null +++ b/sig/privy/models/linked_account_telegram_input.rbs @@ -0,0 +1,53 @@ +module Privy + module Models + type linked_account_telegram_input = + { + telegram_user_id: String, + type: :telegram, + first_name: String, + last_name: String, + photo_url: String, + username: String + } + + class LinkedAccountTelegramInput < Privy::Internal::Type::BaseModel + attr_accessor telegram_user_id: String + + attr_accessor type: :telegram + + attr_reader first_name: String? + + def first_name=: (String) -> String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader photo_url: String? + + def photo_url=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + telegram_user_id: String, + ?first_name: String, + ?last_name: String, + ?photo_url: String, + ?username: String, + ?type: :telegram + ) -> void + + def to_hash: -> { + telegram_user_id: String, + type: :telegram, + first_name: String, + last_name: String, + photo_url: String, + username: String + } + end + end +end diff --git a/sig/privy/models/linked_account_tiktok_input.rbs b/sig/privy/models/linked_account_tiktok_input.rbs new file mode 100644 index 0000000..59738df --- /dev/null +++ b/sig/privy/models/linked_account_tiktok_input.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type linked_account_tiktok_input = + { name: String?, subject: String, type: :tiktok_oauth, username: String } + + class LinkedAccountTiktokInput < Privy::Internal::Type::BaseModel + attr_accessor name: String? + + attr_accessor subject: String + + attr_accessor type: :tiktok_oauth + + attr_accessor username: String + + def initialize: ( + name: String?, + subject: String, + username: String, + ?type: :tiktok_oauth + ) -> void + + def to_hash: -> { + name: String?, + subject: String, + type: :tiktok_oauth, + username: String + } + end + end +end diff --git a/sig/privy/models/linked_account_tiktok_oauth.rbs b/sig/privy/models/linked_account_tiktok_oauth.rbs new file mode 100644 index 0000000..579f5fc --- /dev/null +++ b/sig/privy/models/linked_account_tiktok_oauth.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type linked_account_tiktok_oauth = + { + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountTiktokOAuth::type_, + username: String?, + verified_at: Float + } + + class LinkedAccountTiktokOAuth < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor name: String? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountTiktokOAuth::type_ + + attr_accessor username: String? + + attr_accessor verified_at: Float + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountTiktokOAuth::type_, + username: String?, + verified_at: Float + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + subject: String, + type: Privy::Models::LinkedAccountTiktokOAuth::type_, + username: String?, + verified_at: Float + } + + type type_ = :tiktok_oauth + + module Type + extend Privy::Internal::Type::Enum + + TIKTOK_OAUTH: :tiktok_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountTiktokOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_twitch_input.rbs b/sig/privy/models/linked_account_twitch_input.rbs new file mode 100644 index 0000000..8613da3 --- /dev/null +++ b/sig/privy/models/linked_account_twitch_input.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type linked_account_twitch_input = + { subject: String, type: :twitch_oauth, username: String } + + class LinkedAccountTwitchInput < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor type: :twitch_oauth + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + subject: String, + ?username: String, + ?type: :twitch_oauth + ) -> void + + def to_hash: -> { subject: String, type: :twitch_oauth, username: String } + end + end +end diff --git a/sig/privy/models/linked_account_twitch_oauth.rbs b/sig/privy/models/linked_account_twitch_oauth.rbs new file mode 100644 index 0000000..4247c90 --- /dev/null +++ b/sig/privy/models/linked_account_twitch_oauth.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type linked_account_twitch_oauth = + { + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountTwitchOAuth::type_, + username: String?, + verified_at: Float + } + + class LinkedAccountTwitchOAuth < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountTwitchOAuth::type_ + + attr_accessor username: String? + + attr_accessor verified_at: Float + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountTwitchOAuth::type_, + username: String?, + verified_at: Float + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + subject: String, + type: Privy::Models::LinkedAccountTwitchOAuth::type_, + username: String?, + verified_at: Float + } + + type type_ = :twitch_oauth + + module Type + extend Privy::Internal::Type::Enum + + TWITCH_OAUTH: :twitch_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountTwitchOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_twitter_input.rbs b/sig/privy/models/linked_account_twitter_input.rbs new file mode 100644 index 0000000..4b0a13a --- /dev/null +++ b/sig/privy/models/linked_account_twitter_input.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type linked_account_twitter_input = + { + name: String, + subject: String, + type: :twitter_oauth, + username: String, + profile_picture_url: String + } + + class LinkedAccountTwitterInput < Privy::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor subject: String + + attr_accessor type: :twitter_oauth + + attr_accessor username: String + + attr_reader profile_picture_url: String? + + def profile_picture_url=: (String) -> String + + def initialize: ( + name: String, + subject: String, + username: String, + ?profile_picture_url: String, + ?type: :twitter_oauth + ) -> void + + def to_hash: -> { + name: String, + subject: String, + type: :twitter_oauth, + username: String, + profile_picture_url: String + } + end + end +end diff --git a/sig/privy/models/linked_account_twitter_oauth.rbs b/sig/privy/models/linked_account_twitter_oauth.rbs new file mode 100644 index 0000000..5bf40c9 --- /dev/null +++ b/sig/privy/models/linked_account_twitter_oauth.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type linked_account_twitter_oauth = + { + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + profile_picture_url: String?, + subject: String, + type: Privy::Models::LinkedAccountTwitterOAuth::type_, + username: String?, + verified_at: Float + } + + class LinkedAccountTwitterOAuth < Privy::Internal::Type::BaseModel + attr_accessor first_verified_at: Float? + + attr_accessor latest_verified_at: Float? + + attr_accessor name: String? + + attr_accessor profile_picture_url: String? + + attr_accessor subject: String + + attr_accessor type: Privy::Models::LinkedAccountTwitterOAuth::type_ + + attr_accessor username: String? + + attr_accessor verified_at: Float + + def initialize: ( + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + profile_picture_url: String?, + subject: String, + type: Privy::Models::LinkedAccountTwitterOAuth::type_, + username: String?, + verified_at: Float + ) -> void + + def to_hash: -> { + first_verified_at: Float?, + latest_verified_at: Float?, + name: String?, + profile_picture_url: String?, + subject: String, + type: Privy::Models::LinkedAccountTwitterOAuth::type_, + username: String?, + verified_at: Float + } + + type type_ = :twitter_oauth + + module Type + extend Privy::Internal::Type::Enum + + TWITTER_OAUTH: :twitter_oauth + + def self?.values: -> ::Array[Privy::Models::LinkedAccountTwitterOAuth::type_] + end + end + end +end diff --git a/sig/privy/models/linked_account_type.rbs b/sig/privy/models/linked_account_type.rbs new file mode 100644 index 0000000..e2571ad --- /dev/null +++ b/sig/privy/models/linked_account_type.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type linked_account_type = + :email + | :phone + | :wallet + | :smart_wallet + | :google_oauth + | :twitter_oauth + | :discord_oauth + | :github_oauth + | :spotify_oauth + | :instagram_oauth + | :tiktok_oauth + | :line_oauth + | :twitch_oauth + | :linkedin_oauth + | :apple_oauth + | :custom_auth + | :farcaster + | :passkey + | :telegram + | :cross_app + | :authorization_key + | String + + module LinkedAccountType + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::linked_account_type] + + EMAIL: :email + PHONE: :phone + WALLET: :wallet + SMART_WALLET: :smart_wallet + GOOGLE_OAUTH: :google_oauth + TWITTER_OAUTH: :twitter_oauth + DISCORD_OAUTH: :discord_oauth + GITHUB_OAUTH: :github_oauth + SPOTIFY_OAUTH: :spotify_oauth + INSTAGRAM_OAUTH: :instagram_oauth + TIKTOK_OAUTH: :tiktok_oauth + LINE_OAUTH: :line_oauth + TWITCH_OAUTH: :twitch_oauth + LINKEDIN_OAUTH: :linkedin_oauth + APPLE_OAUTH: :apple_oauth + CUSTOM_AUTH: :custom_auth + FARCASTER: :farcaster + PASSKEY: :passkey + TELEGRAM: :telegram + CROSS_APP: :cross_app + AUTHORIZATION_KEY: :authorization_key + end + end +end diff --git a/sig/privy/models/linked_account_wallet_input.rbs b/sig/privy/models/linked_account_wallet_input.rbs new file mode 100644 index 0000000..969ae33 --- /dev/null +++ b/sig/privy/models/linked_account_wallet_input.rbs @@ -0,0 +1,41 @@ +module Privy + module Models + type linked_account_wallet_input = + { + address: String, + chain_type: Privy::Models::LinkedAccountWalletInput::chain_type, + type: :wallet + } + + class LinkedAccountWalletInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::LinkedAccountWalletInput::chain_type + + attr_accessor type: :wallet + + def initialize: ( + address: String, + chain_type: Privy::Models::LinkedAccountWalletInput::chain_type, + ?type: :wallet + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::LinkedAccountWalletInput::chain_type, + type: :wallet + } + + type chain_type = :ethereum | :solana + + module ChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::LinkedAccountWalletInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/linked_mfa_method.rbs b/sig/privy/models/linked_mfa_method.rbs new file mode 100644 index 0000000..2dc0011 --- /dev/null +++ b/sig/privy/models/linked_mfa_method.rbs @@ -0,0 +1,12 @@ +module Privy + module Models + type linked_mfa_method = + Privy::SMSMfaMethod | Privy::TotpMfaMethod | Privy::PasskeyMfaMethod + + module LinkedMfaMethod + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::linked_mfa_method] + end + end +end diff --git a/sig/privy/models/mfa_disabled_webhook_payload.rbs b/sig/privy/models/mfa_disabled_webhook_payload.rbs new file mode 100644 index 0000000..b681d04 --- /dev/null +++ b/sig/privy/models/mfa_disabled_webhook_payload.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type mfa_disabled_webhook_payload = + { + method_: Privy::Models::MfaDisabledWebhookPayload::method_, + type: Privy::Models::MfaDisabledWebhookPayload::type_, + user_id: String + } + + class MfaDisabledWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::MfaDisabledWebhookPayload::method_ + + attr_accessor type: Privy::Models::MfaDisabledWebhookPayload::type_ + + attr_accessor user_id: String + + def initialize: ( + method_: Privy::Models::MfaDisabledWebhookPayload::method_, + type: Privy::Models::MfaDisabledWebhookPayload::type_, + user_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::MfaDisabledWebhookPayload::method_, + type: Privy::Models::MfaDisabledWebhookPayload::type_, + user_id: String + } + + type method_ = :sms | :totp | :passkey + + module Method + extend Privy::Internal::Type::Enum + + SMS: :sms + TOTP: :totp + PASSKEY: :passkey + + def self?.values: -> ::Array[Privy::Models::MfaDisabledWebhookPayload::method_] + end + + type type_ = :"mfa.disabled" + + module Type + extend Privy::Internal::Type::Enum + + MFA_DISABLED: :"mfa.disabled" + + def self?.values: -> ::Array[Privy::Models::MfaDisabledWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/mfa_enabled_webhook_payload.rbs b/sig/privy/models/mfa_enabled_webhook_payload.rbs new file mode 100644 index 0000000..add02a3 --- /dev/null +++ b/sig/privy/models/mfa_enabled_webhook_payload.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type mfa_enabled_webhook_payload = + { + method_: Privy::Models::MfaEnabledWebhookPayload::method_, + type: Privy::Models::MfaEnabledWebhookPayload::type_, + user_id: String + } + + class MfaEnabledWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::MfaEnabledWebhookPayload::method_ + + attr_accessor type: Privy::Models::MfaEnabledWebhookPayload::type_ + + attr_accessor user_id: String + + def initialize: ( + method_: Privy::Models::MfaEnabledWebhookPayload::method_, + type: Privy::Models::MfaEnabledWebhookPayload::type_, + user_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::MfaEnabledWebhookPayload::method_, + type: Privy::Models::MfaEnabledWebhookPayload::type_, + user_id: String + } + + type method_ = :sms | :totp | :passkey + + module Method + extend Privy::Internal::Type::Enum + + SMS: :sms + TOTP: :totp + PASSKEY: :passkey + + def self?.values: -> ::Array[Privy::Models::MfaEnabledWebhookPayload::method_] + end + + type type_ = :"mfa.enabled" + + module Type + extend Privy::Internal::Type::Enum + + MFA_ENABLED: :"mfa.enabled" + + def self?.values: -> ::Array[Privy::Models::MfaEnabledWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/mfa_passkey_enrollment_request_body.rbs b/sig/privy/models/mfa_passkey_enrollment_request_body.rbs new file mode 100644 index 0000000..986e5d3 --- /dev/null +++ b/sig/privy/models/mfa_passkey_enrollment_request_body.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type mfa_passkey_enrollment_request_body = + { credential_ids: ::Array[String], remove_for_login: bool } + + class MfaPasskeyEnrollmentRequestBody < Privy::Internal::Type::BaseModel + attr_accessor credential_ids: ::Array[String] + + attr_reader remove_for_login: bool? + + def remove_for_login=: (bool) -> bool + + def initialize: ( + credential_ids: ::Array[String], + ?remove_for_login: bool + ) -> void + + def to_hash: -> { + credential_ids: ::Array[String], + remove_for_login: bool + } + end + end +end diff --git a/sig/privy/models/mfa_passkey_init_request_body.rbs b/sig/privy/models/mfa_passkey_init_request_body.rbs new file mode 100644 index 0000000..f6e743a --- /dev/null +++ b/sig/privy/models/mfa_passkey_init_request_body.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type mfa_passkey_init_request_body = { relying_party: String } + + class MfaPasskeyInitRequestBody < Privy::Internal::Type::BaseModel + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: (?relying_party: String) -> void + + def to_hash: -> { relying_party: String } + end + end +end diff --git a/sig/privy/models/mfa_passkey_init_response_body.rbs b/sig/privy/models/mfa_passkey_init_response_body.rbs new file mode 100644 index 0000000..59a31e1 --- /dev/null +++ b/sig/privy/models/mfa_passkey_init_response_body.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type mfa_passkey_init_response_body = + { + options: Privy::PasskeyAuthenticatorVerifyOptions, + relying_party: String + } + + class MfaPasskeyInitResponseBody < Privy::Internal::Type::BaseModel + attr_accessor options: Privy::PasskeyAuthenticatorVerifyOptions + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + options: Privy::PasskeyAuthenticatorVerifyOptions, + ?relying_party: String + ) -> void + + def to_hash: -> { + options: Privy::PasskeyAuthenticatorVerifyOptions, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/mfa_passkey_verify_request_body.rbs b/sig/privy/models/mfa_passkey_verify_request_body.rbs new file mode 100644 index 0000000..03fc329 --- /dev/null +++ b/sig/privy/models/mfa_passkey_verify_request_body.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type mfa_passkey_verify_request_body = + { + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + relying_party: String + } + + class MfaPasskeyVerifyRequestBody < Privy::Internal::Type::BaseModel + attr_accessor authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + ?relying_party: String + ) -> void + + def to_hash: -> { + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/mfa_sms_enroll_request_body.rbs b/sig/privy/models/mfa_sms_enroll_request_body.rbs new file mode 100644 index 0000000..fe1a885 --- /dev/null +++ b/sig/privy/models/mfa_sms_enroll_request_body.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type mfa_sms_enroll_request_body = { code: String, phone_number: String } + + class MfaSMSEnrollRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor phone_number: String + + def initialize: (code: String, phone_number: String) -> void + + def to_hash: -> { code: String, phone_number: String } + end + end +end diff --git a/sig/privy/models/mfa_sms_init_enroll_input.rbs b/sig/privy/models/mfa_sms_init_enroll_input.rbs new file mode 100644 index 0000000..a948e83 --- /dev/null +++ b/sig/privy/models/mfa_sms_init_enroll_input.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type mfa_sms_init_enroll_input = + { + action: Privy::Models::MfaSMSInitEnrollInput::action, + phone_number: String + } + + class MfaSMSInitEnrollInput < Privy::Internal::Type::BaseModel + attr_accessor action: Privy::Models::MfaSMSInitEnrollInput::action + + attr_accessor phone_number: String + + def initialize: ( + action: Privy::Models::MfaSMSInitEnrollInput::action, + phone_number: String + ) -> void + + def to_hash: -> { + action: Privy::Models::MfaSMSInitEnrollInput::action, + phone_number: String + } + + type action = :enroll + + module Action + extend Privy::Internal::Type::Enum + + ENROLL: :enroll + + def self?.values: -> ::Array[Privy::Models::MfaSMSInitEnrollInput::action] + end + end + end +end diff --git a/sig/privy/models/mfa_sms_init_request_body.rbs b/sig/privy/models/mfa_sms_init_request_body.rbs new file mode 100644 index 0000000..fbff30b --- /dev/null +++ b/sig/privy/models/mfa_sms_init_request_body.rbs @@ -0,0 +1,12 @@ +module Privy + module Models + type mfa_sms_init_request_body = + Privy::MfaSMSInitVerifyInput | Privy::MfaSMSInitEnrollInput + + module MfaSMSInitRequestBody + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::mfa_sms_init_request_body] + end + end +end diff --git a/sig/privy/models/mfa_sms_init_verify_input.rbs b/sig/privy/models/mfa_sms_init_verify_input.rbs new file mode 100644 index 0000000..00b1451 --- /dev/null +++ b/sig/privy/models/mfa_sms_init_verify_input.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type mfa_sms_init_verify_input = + { action: Privy::Models::MfaSMSInitVerifyInput::action } + + class MfaSMSInitVerifyInput < Privy::Internal::Type::BaseModel + attr_accessor action: Privy::Models::MfaSMSInitVerifyInput::action + + def initialize: ( + action: Privy::Models::MfaSMSInitVerifyInput::action + ) -> void + + def to_hash: -> { action: Privy::Models::MfaSMSInitVerifyInput::action } + + type action = :verify + + module Action + extend Privy::Internal::Type::Enum + + VERIFY: :verify + + def self?.values: -> ::Array[Privy::Models::MfaSMSInitVerifyInput::action] + end + end + end +end diff --git a/sig/privy/models/mfa_sms_verify_request_body.rbs b/sig/privy/models/mfa_sms_verify_request_body.rbs new file mode 100644 index 0000000..bc73b30 --- /dev/null +++ b/sig/privy/models/mfa_sms_verify_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type mfa_sms_verify_request_body = { code: String } + + class MfaSMSVerifyRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + def initialize: (code: String) -> void + + def to_hash: -> { code: String } + end + end +end diff --git a/sig/privy/models/mfa_totp_init_response_body.rbs b/sig/privy/models/mfa_totp_init_response_body.rbs new file mode 100644 index 0000000..52c6141 --- /dev/null +++ b/sig/privy/models/mfa_totp_init_response_body.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type mfa_totp_init_response_body = + { totp_auth_url: String, totp_secret: String } + + class MfaTotpInitResponseBody < Privy::Internal::Type::BaseModel + attr_accessor totp_auth_url: String + + attr_accessor totp_secret: String + + def initialize: (totp_auth_url: String, totp_secret: String) -> void + + def to_hash: -> { totp_auth_url: String, totp_secret: String } + end + end +end diff --git a/sig/privy/models/mfa_totp_input.rbs b/sig/privy/models/mfa_totp_input.rbs new file mode 100644 index 0000000..838e0e8 --- /dev/null +++ b/sig/privy/models/mfa_totp_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type mfa_totp_input = { code: String } + + class MfaTotpInput < Privy::Internal::Type::BaseModel + attr_accessor code: String + + def initialize: (code: String) -> void + + def to_hash: -> { code: String } + end + end +end diff --git a/sig/privy/models/mfa_verify_response_body.rbs b/sig/privy/models/mfa_verify_response_body.rbs new file mode 100644 index 0000000..0c86639 --- /dev/null +++ b/sig/privy/models/mfa_verify_response_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type mfa_verify_response_body = { token: String } + + class MfaVerifyResponseBody < Privy::Internal::Type::BaseModel + attr_accessor token: String + + def initialize: (token: String) -> void + + def to_hash: -> { token: String } + end + end +end diff --git a/sig/privy/models/moonpay_currency_code.rbs b/sig/privy/models/moonpay_currency_code.rbs new file mode 100644 index 0000000..b775ef5 --- /dev/null +++ b/sig/privy/models/moonpay_currency_code.rbs @@ -0,0 +1,88 @@ +module Privy + module Models + type moonpay_currency_code = + :AVAX_CCHAIN + | :CELO_CELO + | :CUSD_CELO + | :DAI_ETHEREUM + | :ETH_ETHEREUM + | :ETH_ARBITRUM + | :ETH_OPTIMISM + | :ETH_POLYGON + | :ETH_BASE + | :FIL_FVM + | :MATIC_ETHEREUM + | :MATIC_POLYGON + | :POL_POLYGON + | :POL_ETHEREUM + | :USDC_ETHEREUM + | :USDC_ARBITRUM + | :USDC_OPTIMISM + | :USDC_POLYGON + | :USDC_BASE + | :USDC_CCHAIN + | :USDC_SOL + | :USDT_ETHEREUM + | :USDT_POLYGON + | :WETH_POLYGON + | :WBTC_ETHEREUM + | :BNB_BNB + | :BNB_BSC + | :MON_MON + | :CELO + | :CUSD + | :DAI + | :ETH + | :FIL + | :MATIC + | :USDC + | :USDT + | :WETH + | :WBTC + + module MoonpayCurrencyCode + extend Privy::Internal::Type::Enum + + AVAX_CCHAIN: :AVAX_CCHAIN + CELO_CELO: :CELO_CELO + CUSD_CELO: :CUSD_CELO + DAI_ETHEREUM: :DAI_ETHEREUM + ETH_ETHEREUM: :ETH_ETHEREUM + ETH_ARBITRUM: :ETH_ARBITRUM + ETH_OPTIMISM: :ETH_OPTIMISM + ETH_POLYGON: :ETH_POLYGON + ETH_BASE: :ETH_BASE + FIL_FVM: :FIL_FVM + MATIC_ETHEREUM: :MATIC_ETHEREUM + MATIC_POLYGON: :MATIC_POLYGON + POL_POLYGON: :POL_POLYGON + POL_ETHEREUM: :POL_ETHEREUM + USDC_ETHEREUM: :USDC_ETHEREUM + USDC_ARBITRUM: :USDC_ARBITRUM + USDC_OPTIMISM: :USDC_OPTIMISM + USDC_POLYGON: :USDC_POLYGON + USDC_BASE: :USDC_BASE + USDC_CCHAIN: :USDC_CCHAIN + USDC_SOL: :USDC_SOL + USDT_ETHEREUM: :USDT_ETHEREUM + USDT_POLYGON: :USDT_POLYGON + WETH_POLYGON: :WETH_POLYGON + WBTC_ETHEREUM: :WBTC_ETHEREUM + BNB_BNB: :BNB_BNB + BNB_BSC: :BNB_BSC + MON_MON: :MON_MON + CELO: :CELO + CUSD: :CUSD + DAI: :DAI + ETH: :ETH + FIL: :FIL + MATIC: :MATIC + USDC: :USDC + USDT: :USDT + WETH: :WETH + WBTC: :WBTC + + def self?.values: -> ::Array[Privy::Models::moonpay_currency_code] + end + end +end diff --git a/sig/privy/models/moonpay_fiat_on_ramp_ethereum_config.rbs b/sig/privy/models/moonpay_fiat_on_ramp_ethereum_config.rbs new file mode 100644 index 0000000..5984960 --- /dev/null +++ b/sig/privy/models/moonpay_fiat_on_ramp_ethereum_config.rbs @@ -0,0 +1,54 @@ +module Privy + module Models + type moonpay_fiat_on_ramp_ethereum_config = + { + currency_code: Privy::Models::moonpay_currency_code, + email: String, + payment_method: Privy::Models::moonpay_payment_method, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig + } + + class MoonpayFiatOnRampEthereumConfig < Privy::Internal::Type::BaseModel + attr_reader currency_code: Privy::Models::moonpay_currency_code? + + def currency_code=: ( + Privy::Models::moonpay_currency_code + ) -> Privy::Models::moonpay_currency_code + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader payment_method: Privy::Models::moonpay_payment_method? + + def payment_method=: ( + Privy::Models::moonpay_payment_method + ) -> Privy::Models::moonpay_payment_method + + attr_reader quote_currency_amount: Float? + + def quote_currency_amount=: (Float) -> Float + + attr_reader ui_config: Privy::MoonpayUiConfig? + + def ui_config=: (Privy::MoonpayUiConfig) -> Privy::MoonpayUiConfig + + def initialize: ( + ?currency_code: Privy::Models::moonpay_currency_code, + ?email: String, + ?payment_method: Privy::Models::moonpay_payment_method, + ?quote_currency_amount: Float, + ?ui_config: Privy::MoonpayUiConfig + ) -> void + + def to_hash: -> { + currency_code: Privy::Models::moonpay_currency_code, + email: String, + payment_method: Privy::Models::moonpay_payment_method, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig + } + end + end +end diff --git a/sig/privy/models/moonpay_fiat_on_ramp_ethereum_input.rbs b/sig/privy/models/moonpay_fiat_on_ramp_ethereum_input.rbs new file mode 100644 index 0000000..c0c6ef9 --- /dev/null +++ b/sig/privy/models/moonpay_fiat_on_ramp_ethereum_input.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type moonpay_fiat_on_ramp_ethereum_input = + { address: String, config: Privy::MoonpayFiatOnRampEthereumConfig } + + class MoonpayFiatOnRampEthereumInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor config: Privy::MoonpayFiatOnRampEthereumConfig + + def initialize: ( + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig + ) -> void + + def to_hash: -> { + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig + } + end + end +end diff --git a/sig/privy/models/moonpay_fiat_on_ramp_solana_config.rbs b/sig/privy/models/moonpay_fiat_on_ramp_solana_config.rbs new file mode 100644 index 0000000..140156a --- /dev/null +++ b/sig/privy/models/moonpay_fiat_on_ramp_solana_config.rbs @@ -0,0 +1,54 @@ +module Privy + module Models + type moonpay_fiat_on_ramp_solana_config = + { + currency_code: Privy::Models::moonpay_solana_currency_code, + email: String, + payment_method: Privy::Models::moonpay_payment_method, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig + } + + class MoonpayFiatOnRampSolanaConfig < Privy::Internal::Type::BaseModel + attr_reader currency_code: Privy::Models::moonpay_solana_currency_code? + + def currency_code=: ( + Privy::Models::moonpay_solana_currency_code + ) -> Privy::Models::moonpay_solana_currency_code + + attr_reader email: String? + + def email=: (String) -> String + + attr_reader payment_method: Privy::Models::moonpay_payment_method? + + def payment_method=: ( + Privy::Models::moonpay_payment_method + ) -> Privy::Models::moonpay_payment_method + + attr_reader quote_currency_amount: Float? + + def quote_currency_amount=: (Float) -> Float + + attr_reader ui_config: Privy::MoonpayUiConfig? + + def ui_config=: (Privy::MoonpayUiConfig) -> Privy::MoonpayUiConfig + + def initialize: ( + ?currency_code: Privy::Models::moonpay_solana_currency_code, + ?email: String, + ?payment_method: Privy::Models::moonpay_payment_method, + ?quote_currency_amount: Float, + ?ui_config: Privy::MoonpayUiConfig + ) -> void + + def to_hash: -> { + currency_code: Privy::Models::moonpay_solana_currency_code, + email: String, + payment_method: Privy::Models::moonpay_payment_method, + quote_currency_amount: Float, + ui_config: Privy::MoonpayUiConfig + } + end + end +end diff --git a/sig/privy/models/moonpay_fiat_on_ramp_solana_input.rbs b/sig/privy/models/moonpay_fiat_on_ramp_solana_input.rbs new file mode 100644 index 0000000..016d53c --- /dev/null +++ b/sig/privy/models/moonpay_fiat_on_ramp_solana_input.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type moonpay_fiat_on_ramp_solana_input = + { address: String, config: Privy::MoonpayFiatOnRampSolanaConfig } + + class MoonpayFiatOnRampSolanaInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor config: Privy::MoonpayFiatOnRampSolanaConfig + + def initialize: ( + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig + ) -> void + + def to_hash: -> { + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig + } + end + end +end diff --git a/sig/privy/models/moonpay_on_ramp_sandbox_config.rbs b/sig/privy/models/moonpay_on_ramp_sandbox_config.rbs new file mode 100644 index 0000000..69b9774 --- /dev/null +++ b/sig/privy/models/moonpay_on_ramp_sandbox_config.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type moonpay_on_ramp_sandbox_config = { use_sandbox: bool } + + class MoonpayOnRampSandboxConfig < Privy::Internal::Type::BaseModel + attr_reader use_sandbox: bool? + + def use_sandbox=: (bool) -> bool + + def initialize: (?use_sandbox: bool) -> void + + def to_hash: -> { use_sandbox: bool } + end + end +end diff --git a/sig/privy/models/moonpay_on_ramp_sign_input.rbs b/sig/privy/models/moonpay_on_ramp_sign_input.rbs new file mode 100644 index 0000000..1c83d8e --- /dev/null +++ b/sig/privy/models/moonpay_on_ramp_sign_input.rbs @@ -0,0 +1,71 @@ +module Privy + module Models + type moonpay_on_ramp_sign_input = + Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampEthereumInput + | Privy::MoonpayOnRampSignInput::MoonpayFiatOnRampSolanaInput + + module MoonpayOnRampSignInput + extend Privy::Internal::Type::Union + + type moonpay_fiat_on_ramp_ethereum_input = + { + use_sandbox: bool, + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig + } + + class MoonpayFiatOnRampEthereumInput < Privy::Internal::Type::BaseModel + attr_reader use_sandbox: bool? + + def use_sandbox=: (bool) -> bool + + attr_accessor address: String + + attr_accessor config: Privy::MoonpayFiatOnRampEthereumConfig + + def initialize: ( + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig, + ?use_sandbox: bool + ) -> void + + def to_hash: -> { + use_sandbox: bool, + address: String, + config: Privy::MoonpayFiatOnRampEthereumConfig + } + end + + type moonpay_fiat_on_ramp_solana_input = + { + use_sandbox: bool, + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig + } + + class MoonpayFiatOnRampSolanaInput < Privy::Internal::Type::BaseModel + attr_reader use_sandbox: bool? + + def use_sandbox=: (bool) -> bool + + attr_accessor address: String + + attr_accessor config: Privy::MoonpayFiatOnRampSolanaConfig + + def initialize: ( + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig, + ?use_sandbox: bool + ) -> void + + def to_hash: -> { + use_sandbox: bool, + address: String, + config: Privy::MoonpayFiatOnRampSolanaConfig + } + end + + def self?.variants: -> ::Array[Privy::Models::moonpay_on_ramp_sign_input] + end + end +end diff --git a/sig/privy/models/moonpay_on_ramp_sign_response.rbs b/sig/privy/models/moonpay_on_ramp_sign_response.rbs new file mode 100644 index 0000000..5169b1b --- /dev/null +++ b/sig/privy/models/moonpay_on_ramp_sign_response.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type moonpay_on_ramp_sign_response = + { external_transaction_id: String, signed_url: String } + + class MoonpayOnRampSignResponse < Privy::Internal::Type::BaseModel + attr_accessor external_transaction_id: String + + attr_accessor signed_url: String + + def initialize: ( + external_transaction_id: String, + signed_url: String + ) -> void + + def to_hash: -> { external_transaction_id: String, signed_url: String } + end + end +end diff --git a/sig/privy/models/moonpay_payment_method.rbs b/sig/privy/models/moonpay_payment_method.rbs new file mode 100644 index 0000000..a268dbd --- /dev/null +++ b/sig/privy/models/moonpay_payment_method.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type moonpay_payment_method = + :ach_bank_transfer + | :credit_debit_card + | :gbp_bank_transfer + | :gbp_open_banking_payment + | :mobile_wallet + | :sepa_bank_transfer + | :sepa_open_banking_payment + | :pix_instant_payment + | :yellow_card_bank_transfer + + module MoonpayPaymentMethod + extend Privy::Internal::Type::Enum + + ACH_BANK_TRANSFER: :ach_bank_transfer + CREDIT_DEBIT_CARD: :credit_debit_card + GBP_BANK_TRANSFER: :gbp_bank_transfer + GBP_OPEN_BANKING_PAYMENT: :gbp_open_banking_payment + MOBILE_WALLET: :mobile_wallet + SEPA_BANK_TRANSFER: :sepa_bank_transfer + SEPA_OPEN_BANKING_PAYMENT: :sepa_open_banking_payment + PIX_INSTANT_PAYMENT: :pix_instant_payment + YELLOW_CARD_BANK_TRANSFER: :yellow_card_bank_transfer + + def self?.values: -> ::Array[Privy::Models::moonpay_payment_method] + end + end +end diff --git a/sig/privy/models/moonpay_solana_currency_code.rbs b/sig/privy/models/moonpay_solana_currency_code.rbs new file mode 100644 index 0000000..aaddebc --- /dev/null +++ b/sig/privy/models/moonpay_solana_currency_code.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type moonpay_solana_currency_code = :SOL | :USDC_SOL + + module MoonpaySolanaCurrencyCode + extend Privy::Internal::Type::Enum + + SOL: :SOL + USDC_SOL: :USDC_SOL + + def self?.values: -> ::Array[Privy::Models::moonpay_solana_currency_code] + end + end +end diff --git a/sig/privy/models/moonpay_ui_config.rbs b/sig/privy/models/moonpay_ui_config.rbs new file mode 100644 index 0000000..7c4b920 --- /dev/null +++ b/sig/privy/models/moonpay_ui_config.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type moonpay_ui_config = + { accent_color: String, theme: Privy::Models::moonpay_ui_theme } + + class MoonpayUiConfig < Privy::Internal::Type::BaseModel + attr_reader accent_color: String? + + def accent_color=: (String) -> String + + attr_reader theme: Privy::Models::moonpay_ui_theme? + + def theme=: ( + Privy::Models::moonpay_ui_theme + ) -> Privy::Models::moonpay_ui_theme + + def initialize: ( + ?accent_color: String, + ?theme: Privy::Models::moonpay_ui_theme + ) -> void + + def to_hash: -> { + accent_color: String, + theme: Privy::Models::moonpay_ui_theme + } + end + end +end diff --git a/sig/privy/models/moonpay_ui_theme.rbs b/sig/privy/models/moonpay_ui_theme.rbs new file mode 100644 index 0000000..66c0469 --- /dev/null +++ b/sig/privy/models/moonpay_ui_theme.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type moonpay_ui_theme = :light | :dark + + module MoonpayUiTheme + extend Privy::Internal::Type::Enum + + LIGHT: :light + DARK: :dark + + def self?.values: -> ::Array[Privy::Models::moonpay_ui_theme] + end + end +end diff --git a/sig/privy/models/named_token_transfer_source.rbs b/sig/privy/models/named_token_transfer_source.rbs new file mode 100644 index 0000000..f3af85c --- /dev/null +++ b/sig/privy/models/named_token_transfer_source.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type named_token_transfer_source = + { amount: String, asset: String, chain: String } + + class NamedTokenTransferSource < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor asset: String + + attr_accessor chain: String + + def initialize: (amount: String, asset: String, chain: String) -> void + + def to_hash: -> { amount: String, asset: String, chain: String } + end + end +end diff --git a/sig/privy/models/oauth_authenticate_recovery_response.rbs b/sig/privy/models/oauth_authenticate_recovery_response.rbs new file mode 100644 index 0000000..c49efcf --- /dev/null +++ b/sig/privy/models/oauth_authenticate_recovery_response.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type oauth_authenticate_recovery_response = { access_token: String } + + class OAuthAuthenticateRecoveryResponse < Privy::Internal::Type::BaseModel + attr_accessor access_token: String + + def initialize: (access_token: String) -> void + + def to_hash: -> { access_token: String } + end + end +end diff --git a/sig/privy/models/oauth_authenticate_request_body.rbs b/sig/privy/models/oauth_authenticate_request_body.rbs new file mode 100644 index 0000000..75f3871 --- /dev/null +++ b/sig/privy/models/oauth_authenticate_request_body.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type oauth_authenticate_request_body = + { + authorization_code: String, + state_code: String, + code_type: Privy::Models::oauth_code_type, + code_verifier: String, + mode: Privy::Models::authenticate_mode_option + } + + class OAuthAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor authorization_code: String + + attr_accessor state_code: String + + attr_reader code_type: Privy::Models::oauth_code_type? + + def code_type=: ( + Privy::Models::oauth_code_type + ) -> Privy::Models::oauth_code_type + + attr_reader code_verifier: String? + + def code_verifier=: (String) -> String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + authorization_code: String, + state_code: String, + ?code_type: Privy::Models::oauth_code_type, + ?code_verifier: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + authorization_code: String, + state_code: String, + code_type: Privy::Models::oauth_code_type, + code_verifier: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/oauth_authorization_code_request_body.rbs b/sig/privy/models/oauth_authorization_code_request_body.rbs new file mode 100644 index 0000000..afbe9d1 --- /dev/null +++ b/sig/privy/models/oauth_authorization_code_request_body.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type oauth_authorization_code_request_body = + { code_challenge: String, redirect_to: String, state: String } + + class OAuthAuthorizationCodeRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code_challenge: String + + attr_accessor redirect_to: String + + attr_accessor state: String + + def initialize: ( + code_challenge: String, + redirect_to: String, + state: String + ) -> void + + def to_hash: -> { + code_challenge: String, + redirect_to: String, + state: String + } + end + end +end diff --git a/sig/privy/models/oauth_callback_icloud_expo_input.rbs b/sig/privy/models/oauth_callback_icloud_expo_input.rbs new file mode 100644 index 0000000..7290c2f --- /dev/null +++ b/sig/privy/models/oauth_callback_icloud_expo_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type oauth_callback_icloud_expo_input = { ck_web_auth_token: String } + + class OAuthCallbackICloudExpoInput < Privy::Internal::Type::BaseModel + attr_accessor ck_web_auth_token: String + + def initialize: (ck_web_auth_token: String) -> void + + def to_hash: -> { ck_web_auth_token: String } + end + end +end diff --git a/sig/privy/models/oauth_code_type.rbs b/sig/privy/models/oauth_code_type.rbs new file mode 100644 index 0000000..89277a9 --- /dev/null +++ b/sig/privy/models/oauth_code_type.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type oauth_code_type = :raw + + module OAuthCodeType + extend Privy::Internal::Type::Enum + + RAW: :raw + + def self?.values: -> ::Array[Privy::Models::oauth_code_type] + end + end +end diff --git a/sig/privy/models/oauth_init_icloud_recovery_input.rbs b/sig/privy/models/oauth_init_icloud_recovery_input.rbs new file mode 100644 index 0000000..5b047b3 --- /dev/null +++ b/sig/privy/models/oauth_init_icloud_recovery_input.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type oauth_init_icloud_recovery_input = + { client_type: Privy::Models::icloud_client_type } + + class OAuthInitICloudRecoveryInput < Privy::Internal::Type::BaseModel + attr_accessor client_type: Privy::Models::icloud_client_type + + def initialize: (client_type: Privy::Models::icloud_client_type) -> void + + def to_hash: -> { client_type: Privy::Models::icloud_client_type } + end + end +end diff --git a/sig/privy/models/oauth_init_recovery_input.rbs b/sig/privy/models/oauth_init_recovery_input.rbs new file mode 100644 index 0000000..3f10c57 --- /dev/null +++ b/sig/privy/models/oauth_init_recovery_input.rbs @@ -0,0 +1,41 @@ +module Privy + module Models + type oauth_init_recovery_input = + { + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + } + + class OAuthInitRecoveryInput < Privy::Internal::Type::BaseModel + attr_accessor redirect_to: String + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader code_challenge: String? + + def code_challenge=: (String) -> String + + attr_reader state_code: String? + + def state_code=: (String) -> String + + def initialize: ( + redirect_to: String, + ?token: String, + ?code_challenge: String, + ?state_code: String + ) -> void + + def to_hash: -> { + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + } + end + end +end diff --git a/sig/privy/models/oauth_init_request_body.rbs b/sig/privy/models/oauth_init_request_body.rbs new file mode 100644 index 0000000..c187192 --- /dev/null +++ b/sig/privy/models/oauth_init_request_body.rbs @@ -0,0 +1,46 @@ +module Privy + module Models + type oauth_init_request_body = + { + provider: Privy::Models::oauth_provider_id, + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + } + + class OAuthInitRequestBody < Privy::Internal::Type::BaseModel + attr_accessor provider: Privy::Models::oauth_provider_id + + attr_accessor redirect_to: String + + attr_reader token: String? + + def token=: (String) -> String + + attr_reader code_challenge: String? + + def code_challenge=: (String) -> String + + attr_reader state_code: String? + + def state_code=: (String) -> String + + def initialize: ( + provider: Privy::Models::oauth_provider_id, + redirect_to: String, + ?token: String, + ?code_challenge: String, + ?state_code: String + ) -> void + + def to_hash: -> { + provider: Privy::Models::oauth_provider_id, + redirect_to: String, + token: String, + code_challenge: String, + state_code: String + } + end + end +end diff --git a/sig/privy/models/oauth_init_response_body.rbs b/sig/privy/models/oauth_init_response_body.rbs new file mode 100644 index 0000000..c1d8655 --- /dev/null +++ b/sig/privy/models/oauth_init_response_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type oauth_init_response_body = { url: String } + + class OAuthInitResponseBody < Privy::Internal::Type::BaseModel + attr_accessor url: String + + def initialize: (url: String) -> void + + def to_hash: -> { url: String } + end + end +end diff --git a/sig/privy/models/oauth_link_request_body.rbs b/sig/privy/models/oauth_link_request_body.rbs new file mode 100644 index 0000000..e214282 --- /dev/null +++ b/sig/privy/models/oauth_link_request_body.rbs @@ -0,0 +1,41 @@ +module Privy + module Models + type oauth_link_request_body = + { + authorization_code: String, + state_code: String, + code_type: Privy::Models::oauth_code_type, + code_verifier: String + } + + class OAuthLinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor authorization_code: String + + attr_accessor state_code: String + + attr_reader code_type: Privy::Models::oauth_code_type? + + def code_type=: ( + Privy::Models::oauth_code_type + ) -> Privy::Models::oauth_code_type + + attr_reader code_verifier: String? + + def code_verifier=: (String) -> String + + def initialize: ( + authorization_code: String, + state_code: String, + ?code_type: Privy::Models::oauth_code_type, + ?code_verifier: String + ) -> void + + def to_hash: -> { + authorization_code: String, + state_code: String, + code_type: Privy::Models::oauth_code_type, + code_verifier: String + } + end + end +end diff --git a/sig/privy/models/oauth_link_response_body.rbs b/sig/privy/models/oauth_link_response_body.rbs new file mode 100644 index 0000000..6a28d6c --- /dev/null +++ b/sig/privy/models/oauth_link_response_body.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type oauth_link_response_body = { oauth_tokens: Privy::OAuthTokens } + + class OAuthLinkResponseBody < Privy::Models::User + def oauth_tokens: -> Privy::OAuthTokens? + + def oauth_tokens=: (Privy::OAuthTokens _) -> Privy::OAuthTokens + + def initialize: (?oauth_tokens: Privy::OAuthTokens) -> void + + def to_hash: -> { oauth_tokens: Privy::OAuthTokens } + end + end +end diff --git a/sig/privy/models/oauth_provider_id.rbs b/sig/privy/models/oauth_provider_id.rbs new file mode 100644 index 0000000..51d0ae6 --- /dev/null +++ b/sig/privy/models/oauth_provider_id.rbs @@ -0,0 +1,11 @@ +module Privy + module Models + type oauth_provider_id = Privy::Models::external_oauth_provider_id | String + + module OAuthProviderID + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::oauth_provider_id] + end + end +end diff --git a/sig/privy/models/oauth_tokens.rbs b/sig/privy/models/oauth_tokens.rbs new file mode 100644 index 0000000..528619c --- /dev/null +++ b/sig/privy/models/oauth_tokens.rbs @@ -0,0 +1,53 @@ +module Privy + module Models + type oauth_tokens = + { + access_token: String, + provider: String, + access_token_expires_in_seconds: Float, + refresh_token: String, + refresh_token_expires_in_seconds: Float, + scopes: ::Array[String] + } + + class OAuthTokens < Privy::Internal::Type::BaseModel + attr_accessor access_token: String + + attr_accessor provider: String + + attr_reader access_token_expires_in_seconds: Float? + + def access_token_expires_in_seconds=: (Float) -> Float + + attr_reader refresh_token: String? + + def refresh_token=: (String) -> String + + attr_reader refresh_token_expires_in_seconds: Float? + + def refresh_token_expires_in_seconds=: (Float) -> Float + + attr_reader scopes: ::Array[String]? + + def scopes=: (::Array[String]) -> ::Array[String] + + def initialize: ( + access_token: String, + provider: String, + ?access_token_expires_in_seconds: Float, + ?refresh_token: String, + ?refresh_token_expires_in_seconds: Float, + ?scopes: ::Array[String] + ) -> void + + def to_hash: -> { + access_token: String, + provider: String, + access_token_expires_in_seconds: Float, + refresh_token: String, + refresh_token_expires_in_seconds: Float, + scopes: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/oauth_transfer_request_body.rbs b/sig/privy/models/oauth_transfer_request_body.rbs new file mode 100644 index 0000000..6ce606e --- /dev/null +++ b/sig/privy/models/oauth_transfer_request_body.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type oauth_transfer_request_body = + { nonce: String, user_info: Privy::OAuthTransferUserInfo } + + class OAuthTransferRequestBody < Privy::Internal::Type::BaseModel + attr_accessor nonce: String + + attr_accessor user_info: Privy::OAuthTransferUserInfo + + def initialize: ( + nonce: String, + user_info: Privy::OAuthTransferUserInfo + ) -> void + + def to_hash: -> { nonce: String, user_info: Privy::OAuthTransferUserInfo } + end + end +end diff --git a/sig/privy/models/oauth_transfer_user_info.rbs b/sig/privy/models/oauth_transfer_user_info.rbs new file mode 100644 index 0000000..16881c5 --- /dev/null +++ b/sig/privy/models/oauth_transfer_user_info.rbs @@ -0,0 +1,76 @@ +module Privy + module Models + type oauth_transfer_user_info = + { + subject: String, + email: String?, + embedded_wallet_addresses: ::Array[String], + meta: Privy::OAuthTransferUserInfoMeta, + name: String, + profile_picture_url: String, + smart_wallet_addresses: ::Array[String], + username: String, + vanity_name: String + } + + class OAuthTransferUserInfo < Privy::Internal::Type::BaseModel + attr_accessor subject: String + + attr_accessor email: String? + + attr_reader embedded_wallet_addresses: ::Array[String]? + + def embedded_wallet_addresses=: (::Array[String]) -> ::Array[String] + + attr_reader meta: Privy::OAuthTransferUserInfoMeta? + + def meta=: ( + Privy::OAuthTransferUserInfoMeta + ) -> Privy::OAuthTransferUserInfoMeta + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader profile_picture_url: String? + + def profile_picture_url=: (String) -> String + + attr_reader smart_wallet_addresses: ::Array[String]? + + def smart_wallet_addresses=: (::Array[String]) -> ::Array[String] + + attr_reader username: String? + + def username=: (String) -> String + + attr_reader vanity_name: String? + + def vanity_name=: (String) -> String + + def initialize: ( + subject: String, + ?email: String?, + ?embedded_wallet_addresses: ::Array[String], + ?meta: Privy::OAuthTransferUserInfoMeta, + ?name: String, + ?profile_picture_url: String, + ?smart_wallet_addresses: ::Array[String], + ?username: String, + ?vanity_name: String + ) -> void + + def to_hash: -> { + subject: String, + email: String?, + embedded_wallet_addresses: ::Array[String], + meta: Privy::OAuthTransferUserInfoMeta, + name: String, + profile_picture_url: String, + smart_wallet_addresses: ::Array[String], + username: String, + vanity_name: String + } + end + end +end diff --git a/sig/privy/models/oauth_transfer_user_info_meta.rbs b/sig/privy/models/oauth_transfer_user_info_meta.rbs new file mode 100644 index 0000000..94a2516 --- /dev/null +++ b/sig/privy/models/oauth_transfer_user_info_meta.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type oauth_transfer_user_info_meta = { provider_app_id: String } + + class OAuthTransferUserInfoMeta < Privy::Internal::Type::BaseModel + attr_reader provider_app_id: String? + + def provider_app_id=: (String) -> String + + def initialize: (?provider_app_id: String) -> void + + def to_hash: -> { provider_app_id: String } + end + end +end diff --git a/sig/privy/models/oauth_unlink_request_body.rbs b/sig/privy/models/oauth_unlink_request_body.rbs new file mode 100644 index 0000000..cc09f6a --- /dev/null +++ b/sig/privy/models/oauth_unlink_request_body.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type oauth_unlink_request_body = + { provider: Privy::Models::oauth_provider_id, subject: String } + + class OAuthUnlinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor provider: Privy::Models::oauth_provider_id + + attr_accessor subject: String + + def initialize: ( + provider: Privy::Models::oauth_provider_id, + subject: String + ) -> void + + def to_hash: -> { + provider: Privy::Models::oauth_provider_id, + subject: String + } + end + end +end diff --git a/sig/privy/models/oauth_verify_request_body.rbs b/sig/privy/models/oauth_verify_request_body.rbs new file mode 100644 index 0000000..8a64170 --- /dev/null +++ b/sig/privy/models/oauth_verify_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type oauth_verify_request_body = { prat: String } + + class OAuthVerifyRequestBody < Privy::Internal::Type::BaseModel + attr_accessor prat: String + + def initialize: (prat: String) -> void + + def to_hash: -> { prat: String } + end + end +end diff --git a/sig/privy/models/oauth_verify_response_body.rbs b/sig/privy/models/oauth_verify_response_body.rbs new file mode 100644 index 0000000..bb084e6 --- /dev/null +++ b/sig/privy/models/oauth_verify_response_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type oauth_verify_response_body = { verified: bool } + + class OAuthVerifyResponseBody < Privy::Internal::Type::BaseModel + attr_accessor verified: bool + + def initialize: (verified: bool) -> void + + def to_hash: -> { verified: bool } + end + end +end diff --git a/sig/privy/models/onramp_provider.rbs b/sig/privy/models/onramp_provider.rbs new file mode 100644 index 0000000..fd354f3 --- /dev/null +++ b/sig/privy/models/onramp_provider.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type onramp_provider = :bridge | :"bridge-sandbox" + + module OnrampProvider + extend Privy::Internal::Type::Enum + + BRIDGE: :bridge + BRIDGE_SANDBOX: :"bridge-sandbox" + + def self?.values: -> ::Array[Privy::Models::onramp_provider] + end + end +end diff --git a/sig/privy/models/optional_refresh_token_input.rbs b/sig/privy/models/optional_refresh_token_input.rbs new file mode 100644 index 0000000..cab0959 --- /dev/null +++ b/sig/privy/models/optional_refresh_token_input.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type optional_refresh_token_input = { refresh_token: String } + + class OptionalRefreshTokenInput < Privy::Internal::Type::BaseModel + attr_reader refresh_token: String? + + def refresh_token=: (String) -> String + + def initialize: (?refresh_token: String) -> void + + def to_hash: -> { refresh_token: String } + end + end +end diff --git a/sig/privy/models/organization_secret_id_input.rbs b/sig/privy/models/organization_secret_id_input.rbs new file mode 100644 index 0000000..3969175 --- /dev/null +++ b/sig/privy/models/organization_secret_id_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type organization_secret_id_input = { secret_id: String } + + class OrganizationSecretIDInput < Privy::Internal::Type::BaseModel + attr_accessor secret_id: String + + def initialize: (secret_id: String) -> void + + def to_hash: -> { secret_id: String } + end + end +end diff --git a/sig/privy/models/organization_secret_view.rbs b/sig/privy/models/organization_secret_view.rbs new file mode 100644 index 0000000..fba9e97 --- /dev/null +++ b/sig/privy/models/organization_secret_view.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type organization_secret_view = + { + id: String, + created_at: String, + last_four: String, + revoked_at: String?, + signing_public_key: String? + } + + class OrganizationSecretView < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: String + + attr_accessor last_four: String + + attr_accessor revoked_at: String? + + attr_accessor signing_public_key: String? + + def initialize: ( + id: String, + created_at: String, + last_four: String, + revoked_at: String?, + signing_public_key: String? + ) -> void + + def to_hash: -> { + id: String, + created_at: String, + last_four: String, + revoked_at: String?, + signing_public_key: String? + } + end + end +end diff --git a/sig/privy/models/organization_secrets_list_response.rbs b/sig/privy/models/organization_secrets_list_response.rbs new file mode 100644 index 0000000..ae5d3f0 --- /dev/null +++ b/sig/privy/models/organization_secrets_list_response.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type organization_secrets_list_response = + { data: ::Array[Privy::OrganizationSecretView] } + + class OrganizationSecretsListResponse < Privy::Internal::Type::BaseModel + attr_accessor data: ::Array[Privy::OrganizationSecretView] + + def initialize: (data: ::Array[Privy::OrganizationSecretView]) -> void + + def to_hash: -> { data: ::Array[Privy::OrganizationSecretView] } + end + end +end diff --git a/sig/privy/models/output_with_previous_transaction_data.rbs b/sig/privy/models/output_with_previous_transaction_data.rbs new file mode 100644 index 0000000..d212dfe --- /dev/null +++ b/sig/privy/models/output_with_previous_transaction_data.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type output_with_previous_transaction_data = + { + previous_transaction_hash: String, + previous_transaction_vout: Float, + output: Privy::TokenOutput + } + + class OutputWithPreviousTransactionData < Privy::Internal::Type::BaseModel + attr_accessor previous_transaction_hash: String + + attr_accessor previous_transaction_vout: Float + + attr_reader output: Privy::TokenOutput? + + def output=: (Privy::TokenOutput) -> Privy::TokenOutput + + def initialize: ( + previous_transaction_hash: String, + previous_transaction_vout: Float, + ?output: Privy::TokenOutput + ) -> void + + def to_hash: -> { + previous_transaction_hash: String, + previous_transaction_vout: Float, + output: Privy::TokenOutput + } + end + end +end diff --git a/sig/privy/models/owner_id_input.rbs b/sig/privy/models/owner_id_input.rbs new file mode 100644 index 0000000..37ca344 --- /dev/null +++ b/sig/privy/models/owner_id_input.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class OwnerIDInput = String + end +end diff --git a/sig/privy/models/owner_input.rbs b/sig/privy/models/owner_input.rbs new file mode 100644 index 0000000..4d652ba --- /dev/null +++ b/sig/privy/models/owner_input.rbs @@ -0,0 +1,11 @@ +module Privy + module Models + type owner_input = Privy::OwnerInputUser | Privy::OwnerInputPublicKey + + module OwnerInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::owner_input] + end + end +end diff --git a/sig/privy/models/owner_input_public_key.rbs b/sig/privy/models/owner_input_public_key.rbs new file mode 100644 index 0000000..d488534 --- /dev/null +++ b/sig/privy/models/owner_input_public_key.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type owner_input_public_key = { public_key: String } + + class OwnerInputPublicKey < Privy::Internal::Type::BaseModel + attr_accessor public_key: String + + def initialize: (public_key: String) -> void + + def to_hash: -> { public_key: String } + end + end +end diff --git a/sig/privy/models/owner_input_user.rbs b/sig/privy/models/owner_input_user.rbs new file mode 100644 index 0000000..e37e879 --- /dev/null +++ b/sig/privy/models/owner_input_user.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type owner_input_user = { user_id: String } + + class OwnerInputUser < Privy::Internal::Type::BaseModel + attr_accessor user_id: String + + def initialize: (user_id: String) -> void + + def to_hash: -> { user_id: String } + end + end +end diff --git a/sig/privy/models/p_256_public_key.rbs b/sig/privy/models/p_256_public_key.rbs new file mode 100644 index 0000000..5084df6 --- /dev/null +++ b/sig/privy/models/p_256_public_key.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class P256PublicKey = String + end +end diff --git a/sig/privy/models/passkey_assertion_response.rbs b/sig/privy/models/passkey_assertion_response.rbs new file mode 100644 index 0000000..266d138 --- /dev/null +++ b/sig/privy/models/passkey_assertion_response.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type passkey_assertion_response = + { + authenticator_data: String, + client_data_json: String, + signature: String, + user_handle: String + } + + class PasskeyAssertionResponse < Privy::Internal::Type::BaseModel + attr_accessor authenticator_data: String + + attr_accessor client_data_json: String + + attr_accessor signature: String + + attr_reader user_handle: String? + + def user_handle=: (String) -> String + + def initialize: ( + authenticator_data: String, + client_data_json: String, + signature: String, + ?user_handle: String + ) -> void + + def to_hash: -> { + authenticator_data: String, + client_data_json: String, + signature: String, + user_handle: String + } + end + end +end diff --git a/sig/privy/models/passkey_attestation_response.rbs b/sig/privy/models/passkey_attestation_response.rbs new file mode 100644 index 0000000..6990c5d --- /dev/null +++ b/sig/privy/models/passkey_attestation_response.rbs @@ -0,0 +1,53 @@ +module Privy + module Models + type passkey_attestation_response = + { + attestation_object: String, + client_data_json: String, + authenticator_data: String, + public_key: String, + public_key_algorithm: Float, + transports: ::Array[String] + } + + class PasskeyAttestationResponse < Privy::Internal::Type::BaseModel + attr_accessor attestation_object: String + + attr_accessor client_data_json: String + + attr_reader authenticator_data: String? + + def authenticator_data=: (String) -> String + + attr_reader public_key: String? + + def public_key=: (String) -> String + + attr_reader public_key_algorithm: Float? + + def public_key_algorithm=: (Float) -> Float + + attr_reader transports: ::Array[String]? + + def transports=: (::Array[String]) -> ::Array[String] + + def initialize: ( + attestation_object: String, + client_data_json: String, + ?authenticator_data: String, + ?public_key: String, + ?public_key_algorithm: Float, + ?transports: ::Array[String] + ) -> void + + def to_hash: -> { + attestation_object: String, + client_data_json: String, + authenticator_data: String, + public_key: String, + public_key_algorithm: Float, + transports: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/passkey_authenticate_input.rbs b/sig/privy/models/passkey_authenticate_input.rbs new file mode 100644 index 0000000..86813ec --- /dev/null +++ b/sig/privy/models/passkey_authenticate_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type passkey_authenticate_input = + { + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + challenge: String, + relying_party: String + } + + class PasskeyAuthenticateInput < Privy::Internal::Type::BaseModel + attr_accessor authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse + + attr_accessor challenge: String + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + challenge: String, + ?relying_party: String + ) -> void + + def to_hash: -> { + authenticator_response: Privy::PasskeyAuthenticatorVerifyResponse, + challenge: String, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/passkey_authenticator_enrollment_options.rbs b/sig/privy/models/passkey_authenticator_enrollment_options.rbs new file mode 100644 index 0000000..df82c1d --- /dev/null +++ b/sig/privy/models/passkey_authenticator_enrollment_options.rbs @@ -0,0 +1,76 @@ +module Privy + module Models + type passkey_authenticator_enrollment_options = + { + challenge: String, + pub_key_cred_params: ::Array[Privy::PasskeyPubKeyCredParam], + rp: Privy::PasskeyRelyingParty, + user: Privy::PasskeyUser, + attestation: String, + authenticator_selection: Privy::PasskeyAuthenticatorSelection, + exclude_credentials: ::Array[Privy::PasskeyCredentialDescriptor], + extensions: Privy::PasskeyEnrollmentExtensions, + timeout: Float + } + + class PasskeyAuthenticatorEnrollmentOptions < Privy::Internal::Type::BaseModel + attr_accessor challenge: String + + attr_accessor pub_key_cred_params: ::Array[Privy::PasskeyPubKeyCredParam] + + attr_accessor rp: Privy::PasskeyRelyingParty + + attr_accessor user: Privy::PasskeyUser + + attr_reader attestation: String? + + def attestation=: (String) -> String + + attr_reader authenticator_selection: Privy::PasskeyAuthenticatorSelection? + + def authenticator_selection=: ( + Privy::PasskeyAuthenticatorSelection + ) -> Privy::PasskeyAuthenticatorSelection + + attr_reader exclude_credentials: ::Array[Privy::PasskeyCredentialDescriptor]? + + def exclude_credentials=: ( + ::Array[Privy::PasskeyCredentialDescriptor] + ) -> ::Array[Privy::PasskeyCredentialDescriptor] + + attr_reader extensions: Privy::PasskeyEnrollmentExtensions? + + def extensions=: ( + Privy::PasskeyEnrollmentExtensions + ) -> Privy::PasskeyEnrollmentExtensions + + attr_reader timeout: Float? + + def timeout=: (Float) -> Float + + def initialize: ( + challenge: String, + pub_key_cred_params: ::Array[Privy::PasskeyPubKeyCredParam], + rp: Privy::PasskeyRelyingParty, + user: Privy::PasskeyUser, + ?attestation: String, + ?authenticator_selection: Privy::PasskeyAuthenticatorSelection, + ?exclude_credentials: ::Array[Privy::PasskeyCredentialDescriptor], + ?extensions: Privy::PasskeyEnrollmentExtensions, + ?timeout: Float + ) -> void + + def to_hash: -> { + challenge: String, + pub_key_cred_params: ::Array[Privy::PasskeyPubKeyCredParam], + rp: Privy::PasskeyRelyingParty, + user: Privy::PasskeyUser, + attestation: String, + authenticator_selection: Privy::PasskeyAuthenticatorSelection, + exclude_credentials: ::Array[Privy::PasskeyCredentialDescriptor], + extensions: Privy::PasskeyEnrollmentExtensions, + timeout: Float + } + end + end +end diff --git a/sig/privy/models/passkey_authenticator_enrollment_response.rbs b/sig/privy/models/passkey_authenticator_enrollment_response.rbs new file mode 100644 index 0000000..142c8b7 --- /dev/null +++ b/sig/privy/models/passkey_authenticator_enrollment_response.rbs @@ -0,0 +1,57 @@ +module Privy + module Models + type passkey_authenticator_enrollment_response = + { + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAttestationResponse, + type: Privy::Models::PasskeyAuthenticatorEnrollmentResponse::type_, + authenticator_attachment: String + } + + class PasskeyAuthenticatorEnrollmentResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor client_extension_results: Privy::PasskeyClientExtensionResults + + attr_accessor raw_id: String + + attr_accessor response: Privy::PasskeyAttestationResponse + + attr_accessor type: Privy::Models::PasskeyAuthenticatorEnrollmentResponse::type_ + + attr_reader authenticator_attachment: String? + + def authenticator_attachment=: (String) -> String + + def initialize: ( + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAttestationResponse, + type: Privy::Models::PasskeyAuthenticatorEnrollmentResponse::type_, + ?authenticator_attachment: String + ) -> void + + def to_hash: -> { + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAttestationResponse, + type: Privy::Models::PasskeyAuthenticatorEnrollmentResponse::type_, + authenticator_attachment: String + } + + type type_ = :"public-key" + + module Type + extend Privy::Internal::Type::Enum + + PUBLIC_KEY: :"public-key" + + def self?.values: -> ::Array[Privy::Models::PasskeyAuthenticatorEnrollmentResponse::type_] + end + end + end +end diff --git a/sig/privy/models/passkey_authenticator_selection.rbs b/sig/privy/models/passkey_authenticator_selection.rbs new file mode 100644 index 0000000..7889f31 --- /dev/null +++ b/sig/privy/models/passkey_authenticator_selection.rbs @@ -0,0 +1,43 @@ +module Privy + module Models + type passkey_authenticator_selection = + { + authenticator_attachment: String, + require_resident_key: bool, + resident_key: String, + user_verification: String + } + + class PasskeyAuthenticatorSelection < Privy::Internal::Type::BaseModel + attr_reader authenticator_attachment: String? + + def authenticator_attachment=: (String) -> String + + attr_reader require_resident_key: bool? + + def require_resident_key=: (bool) -> bool + + attr_reader resident_key: String? + + def resident_key=: (String) -> String + + attr_reader user_verification: String? + + def user_verification=: (String) -> String + + def initialize: ( + ?authenticator_attachment: String, + ?require_resident_key: bool, + ?resident_key: String, + ?user_verification: String + ) -> void + + def to_hash: -> { + authenticator_attachment: String, + require_resident_key: bool, + resident_key: String, + user_verification: String + } + end + end +end diff --git a/sig/privy/models/passkey_authenticator_verify_options.rbs b/sig/privy/models/passkey_authenticator_verify_options.rbs new file mode 100644 index 0000000..c7b3e78 --- /dev/null +++ b/sig/privy/models/passkey_authenticator_verify_options.rbs @@ -0,0 +1,59 @@ +module Privy + module Models + type passkey_authenticator_verify_options = + { + challenge: String, + allow_credentials: ::Array[Privy::PasskeyCredentialDescriptor], + extensions: Privy::PasskeyVerifyExtensions, + rp_id: String, + timeout: Float, + user_verification: String + } + + class PasskeyAuthenticatorVerifyOptions < Privy::Internal::Type::BaseModel + attr_accessor challenge: String + + attr_reader allow_credentials: ::Array[Privy::PasskeyCredentialDescriptor]? + + def allow_credentials=: ( + ::Array[Privy::PasskeyCredentialDescriptor] + ) -> ::Array[Privy::PasskeyCredentialDescriptor] + + attr_reader extensions: Privy::PasskeyVerifyExtensions? + + def extensions=: ( + Privy::PasskeyVerifyExtensions + ) -> Privy::PasskeyVerifyExtensions + + attr_reader rp_id: String? + + def rp_id=: (String) -> String + + attr_reader timeout: Float? + + def timeout=: (Float) -> Float + + attr_reader user_verification: String? + + def user_verification=: (String) -> String + + def initialize: ( + challenge: String, + ?allow_credentials: ::Array[Privy::PasskeyCredentialDescriptor], + ?extensions: Privy::PasskeyVerifyExtensions, + ?rp_id: String, + ?timeout: Float, + ?user_verification: String + ) -> void + + def to_hash: -> { + challenge: String, + allow_credentials: ::Array[Privy::PasskeyCredentialDescriptor], + extensions: Privy::PasskeyVerifyExtensions, + rp_id: String, + timeout: Float, + user_verification: String + } + end + end +end diff --git a/sig/privy/models/passkey_authenticator_verify_response.rbs b/sig/privy/models/passkey_authenticator_verify_response.rbs new file mode 100644 index 0000000..15f8543 --- /dev/null +++ b/sig/privy/models/passkey_authenticator_verify_response.rbs @@ -0,0 +1,57 @@ +module Privy + module Models + type passkey_authenticator_verify_response = + { + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAssertionResponse, + type: Privy::Models::PasskeyAuthenticatorVerifyResponse::type_, + authenticator_attachment: String + } + + class PasskeyAuthenticatorVerifyResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor client_extension_results: Privy::PasskeyClientExtensionResults + + attr_accessor raw_id: String + + attr_accessor response: Privy::PasskeyAssertionResponse + + attr_accessor type: Privy::Models::PasskeyAuthenticatorVerifyResponse::type_ + + attr_reader authenticator_attachment: String? + + def authenticator_attachment=: (String) -> String + + def initialize: ( + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAssertionResponse, + type: Privy::Models::PasskeyAuthenticatorVerifyResponse::type_, + ?authenticator_attachment: String + ) -> void + + def to_hash: -> { + id: String, + client_extension_results: Privy::PasskeyClientExtensionResults, + raw_id: String, + response: Privy::PasskeyAssertionResponse, + type: Privy::Models::PasskeyAuthenticatorVerifyResponse::type_, + authenticator_attachment: String + } + + type type_ = :"public-key" + + module Type + extend Privy::Internal::Type::Enum + + PUBLIC_KEY: :"public-key" + + def self?.values: -> ::Array[Privy::Models::PasskeyAuthenticatorVerifyResponse::type_] + end + end + end +end diff --git a/sig/privy/models/passkey_client_extension_results.rbs b/sig/privy/models/passkey_client_extension_results.rbs new file mode 100644 index 0000000..4e4e56c --- /dev/null +++ b/sig/privy/models/passkey_client_extension_results.rbs @@ -0,0 +1,38 @@ +module Privy + module Models + type passkey_client_extension_results = + { + app_id: bool, + cred_props: Privy::PasskeyCredPropsResult, + hmac_create_secret: bool + } + + class PasskeyClientExtensionResults < Privy::Internal::Type::BaseModel + attr_reader app_id: bool? + + def app_id=: (bool) -> bool + + attr_reader cred_props: Privy::PasskeyCredPropsResult? + + def cred_props=: ( + Privy::PasskeyCredPropsResult + ) -> Privy::PasskeyCredPropsResult + + attr_reader hmac_create_secret: bool? + + def hmac_create_secret=: (bool) -> bool + + def initialize: ( + ?app_id: bool, + ?cred_props: Privy::PasskeyCredPropsResult, + ?hmac_create_secret: bool + ) -> void + + def to_hash: -> { + app_id: bool, + cred_props: Privy::PasskeyCredPropsResult, + hmac_create_secret: bool + } + end + end +end diff --git a/sig/privy/models/passkey_cred_props_result.rbs b/sig/privy/models/passkey_cred_props_result.rbs new file mode 100644 index 0000000..7c223f2 --- /dev/null +++ b/sig/privy/models/passkey_cred_props_result.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type passkey_cred_props_result = { rk: bool } + + class PasskeyCredPropsResult < Privy::Internal::Type::BaseModel + attr_reader rk: bool? + + def rk=: (bool) -> bool + + def initialize: (?rk: bool) -> void + + def to_hash: -> { rk: bool } + end + end +end diff --git a/sig/privy/models/passkey_credential_descriptor.rbs b/sig/privy/models/passkey_credential_descriptor.rbs new file mode 100644 index 0000000..b1f37bc --- /dev/null +++ b/sig/privy/models/passkey_credential_descriptor.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type passkey_credential_descriptor = + { id: String, type: String, transports: ::Array[String] } + + class PasskeyCredentialDescriptor < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor type: String + + attr_reader transports: ::Array[String]? + + def transports=: (::Array[String]) -> ::Array[String] + + def initialize: ( + id: String, + type: String, + ?transports: ::Array[String] + ) -> void + + def to_hash: -> { id: String, type: String, transports: ::Array[String] } + end + end +end diff --git a/sig/privy/models/passkey_enrollment_extensions.rbs b/sig/privy/models/passkey_enrollment_extensions.rbs new file mode 100644 index 0000000..0291233 --- /dev/null +++ b/sig/privy/models/passkey_enrollment_extensions.rbs @@ -0,0 +1,38 @@ +module Privy + module Models + type passkey_enrollment_extensions = + { + app_id: String, + cred_props: Privy::PasskeyCredPropsResult, + hmac_create_secret: bool + } + + class PasskeyEnrollmentExtensions < Privy::Internal::Type::BaseModel + attr_reader app_id: String? + + def app_id=: (String) -> String + + attr_reader cred_props: Privy::PasskeyCredPropsResult? + + def cred_props=: ( + Privy::PasskeyCredPropsResult + ) -> Privy::PasskeyCredPropsResult + + attr_reader hmac_create_secret: bool? + + def hmac_create_secret=: (bool) -> bool + + def initialize: ( + ?app_id: String, + ?cred_props: Privy::PasskeyCredPropsResult, + ?hmac_create_secret: bool + ) -> void + + def to_hash: -> { + app_id: String, + cred_props: Privy::PasskeyCredPropsResult, + hmac_create_secret: bool + } + end + end +end diff --git a/sig/privy/models/passkey_init_input.rbs b/sig/privy/models/passkey_init_input.rbs new file mode 100644 index 0000000..74f3e46 --- /dev/null +++ b/sig/privy/models/passkey_init_input.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type passkey_init_input = { token: String, relying_party: String } + + class PasskeyInitInput < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: (?token: String, ?relying_party: String) -> void + + def to_hash: -> { token: String, relying_party: String } + end + end +end diff --git a/sig/privy/models/passkey_link_input.rbs b/sig/privy/models/passkey_link_input.rbs new file mode 100644 index 0000000..b17725c --- /dev/null +++ b/sig/privy/models/passkey_link_input.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type passkey_link_input = + { + authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse, + relying_party: String + } + + class PasskeyLinkInput < Privy::Internal::Type::BaseModel + attr_accessor authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse, + ?relying_party: String + ) -> void + + def to_hash: -> { + authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/passkey_mfa_method.rbs b/sig/privy/models/passkey_mfa_method.rbs new file mode 100644 index 0000000..996b6b8 --- /dev/null +++ b/sig/privy/models/passkey_mfa_method.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type passkey_mfa_method = + { type: Privy::Models::PasskeyMfaMethod::type_, verified_at: Float } + + class PasskeyMfaMethod < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::PasskeyMfaMethod::type_ + + attr_accessor verified_at: Float + + def initialize: ( + type: Privy::Models::PasskeyMfaMethod::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + type: Privy::Models::PasskeyMfaMethod::type_, + verified_at: Float + } + + type type_ = :passkey + + module Type + extend Privy::Internal::Type::Enum + + PASSKEY: :passkey + + def self?.values: -> ::Array[Privy::Models::PasskeyMfaMethod::type_] + end + end + end +end diff --git a/sig/privy/models/passkey_pub_key_cred_param.rbs b/sig/privy/models/passkey_pub_key_cred_param.rbs new file mode 100644 index 0000000..f4e76f7 --- /dev/null +++ b/sig/privy/models/passkey_pub_key_cred_param.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type passkey_pub_key_cred_param = + { alg: Float, type: Privy::Models::PasskeyPubKeyCredParam::type_ } + + class PasskeyPubKeyCredParam < Privy::Internal::Type::BaseModel + attr_accessor alg: Float + + attr_accessor type: Privy::Models::PasskeyPubKeyCredParam::type_ + + def initialize: ( + alg: Float, + type: Privy::Models::PasskeyPubKeyCredParam::type_ + ) -> void + + def to_hash: -> { + alg: Float, + type: Privy::Models::PasskeyPubKeyCredParam::type_ + } + + type type_ = :"public-key" + + module Type + extend Privy::Internal::Type::Enum + + PUBLIC_KEY: :"public-key" + + def self?.values: -> ::Array[Privy::Models::PasskeyPubKeyCredParam::type_] + end + end + end +end diff --git a/sig/privy/models/passkey_register_input.rbs b/sig/privy/models/passkey_register_input.rbs new file mode 100644 index 0000000..aa1ec2f --- /dev/null +++ b/sig/privy/models/passkey_register_input.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type passkey_register_input = + { + authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse, + relying_party: String + } + + class PasskeyRegisterInput < Privy::Internal::Type::BaseModel + attr_accessor authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse, + ?relying_party: String + ) -> void + + def to_hash: -> { + authenticator_response: Privy::PasskeyAuthenticatorEnrollmentResponse, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/passkey_relying_party.rbs b/sig/privy/models/passkey_relying_party.rbs new file mode 100644 index 0000000..e36492a --- /dev/null +++ b/sig/privy/models/passkey_relying_party.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type passkey_relying_party = { name: String, id: String } + + class PasskeyRelyingParty < Privy::Internal::Type::BaseModel + attr_accessor name: String + + attr_reader id: String? + + def id=: (String) -> String + + def initialize: (name: String, ?id: String) -> void + + def to_hash: -> { name: String, id: String } + end + end +end diff --git a/sig/privy/models/passkey_user.rbs b/sig/privy/models/passkey_user.rbs new file mode 100644 index 0000000..6b9be1c --- /dev/null +++ b/sig/privy/models/passkey_user.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type passkey_user = { id: String, display_name: String, name: String } + + class PasskeyUser < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor display_name: String + + attr_accessor name: String + + def initialize: (id: String, display_name: String, name: String) -> void + + def to_hash: -> { id: String, display_name: String, name: String } + end + end +end diff --git a/sig/privy/models/passkey_verify_extensions.rbs b/sig/privy/models/passkey_verify_extensions.rbs new file mode 100644 index 0000000..976631f --- /dev/null +++ b/sig/privy/models/passkey_verify_extensions.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type passkey_verify_extensions = + { app_id: String, cred_props: bool, hmac_create_secret: bool } + + class PasskeyVerifyExtensions < Privy::Internal::Type::BaseModel + attr_reader app_id: String? + + def app_id=: (String) -> String + + attr_reader cred_props: bool? + + def cred_props=: (bool) -> bool + + attr_reader hmac_create_secret: bool? + + def hmac_create_secret=: (bool) -> bool + + def initialize: ( + ?app_id: String, + ?cred_props: bool, + ?hmac_create_secret: bool + ) -> void + + def to_hash: -> { + app_id: String, + cred_props: bool, + hmac_create_secret: bool + } + end + end +end diff --git a/sig/privy/models/passwordless_authenticate_request_body.rbs b/sig/privy/models/passwordless_authenticate_request_body.rbs new file mode 100644 index 0000000..d664038 --- /dev/null +++ b/sig/privy/models/passwordless_authenticate_request_body.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type passwordless_authenticate_request_body = + { + code: String, + email: String, + mode: Privy::Models::authenticate_mode_option + } + + class PasswordlessAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor email: String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + code: String, + email: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + code: String, + email: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/passwordless_init_request_body.rbs b/sig/privy/models/passwordless_init_request_body.rbs new file mode 100644 index 0000000..1ab6c6e --- /dev/null +++ b/sig/privy/models/passwordless_init_request_body.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type passwordless_init_request_body = { email: String, token: String } + + class PasswordlessInitRequestBody < Privy::Internal::Type::BaseModel + attr_accessor email: String + + attr_reader token: String? + + def token=: (String) -> String + + def initialize: (email: String, ?token: String) -> void + + def to_hash: -> { email: String, token: String } + end + end +end diff --git a/sig/privy/models/passwordless_link_request_body.rbs b/sig/privy/models/passwordless_link_request_body.rbs new file mode 100644 index 0000000..4c7b325 --- /dev/null +++ b/sig/privy/models/passwordless_link_request_body.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type passwordless_link_request_body = { code: String, email: String } + + class PasswordlessLinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor email: String + + def initialize: (code: String, email: String) -> void + + def to_hash: -> { code: String, email: String } + end + end +end diff --git a/sig/privy/models/passwordless_sms_authenticate_request_body.rbs b/sig/privy/models/passwordless_sms_authenticate_request_body.rbs new file mode 100644 index 0000000..537ac89 --- /dev/null +++ b/sig/privy/models/passwordless_sms_authenticate_request_body.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type passwordless_sms_authenticate_request_body = + { + code: String, + phone_number: String, + mode: Privy::Models::authenticate_mode_option + } + + class PasswordlessSMSAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor phone_number: String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + def initialize: ( + code: String, + phone_number: String, + ?mode: Privy::Models::authenticate_mode_option + ) -> void + + def to_hash: -> { + code: String, + phone_number: String, + mode: Privy::Models::authenticate_mode_option + } + end + end +end diff --git a/sig/privy/models/passwordless_sms_init_request_body.rbs b/sig/privy/models/passwordless_sms_init_request_body.rbs new file mode 100644 index 0000000..19fac23 --- /dev/null +++ b/sig/privy/models/passwordless_sms_init_request_body.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type passwordless_sms_init_request_body = + { phone_number: String, token: String } + + class PasswordlessSMSInitRequestBody < Privy::Internal::Type::BaseModel + attr_accessor phone_number: String + + attr_reader token: String? + + def token=: (String) -> String + + def initialize: (phone_number: String, ?token: String) -> void + + def to_hash: -> { phone_number: String, token: String } + end + end +end diff --git a/sig/privy/models/passwordless_sms_link_request_body.rbs b/sig/privy/models/passwordless_sms_link_request_body.rbs new file mode 100644 index 0000000..267edff --- /dev/null +++ b/sig/privy/models/passwordless_sms_link_request_body.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type passwordless_sms_link_request_body = + { code: String, phone_number: String } + + class PasswordlessSMSLinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor phone_number: String + + def initialize: (code: String, phone_number: String) -> void + + def to_hash: -> { code: String, phone_number: String } + end + end +end diff --git a/sig/privy/models/passwordless_sms_transfer_request_body.rbs b/sig/privy/models/passwordless_sms_transfer_request_body.rbs new file mode 100644 index 0000000..7e14812 --- /dev/null +++ b/sig/privy/models/passwordless_sms_transfer_request_body.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type passwordless_sms_transfer_request_body = + { nonce: String, phone_number: String } + + class PasswordlessSMSTransferRequestBody < Privy::Internal::Type::BaseModel + attr_accessor nonce: String + + attr_accessor phone_number: String + + def initialize: (nonce: String, phone_number: String) -> void + + def to_hash: -> { nonce: String, phone_number: String } + end + end +end diff --git a/sig/privy/models/passwordless_sms_unlink_request_body.rbs b/sig/privy/models/passwordless_sms_unlink_request_body.rbs new file mode 100644 index 0000000..05159f0 --- /dev/null +++ b/sig/privy/models/passwordless_sms_unlink_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type passwordless_sms_unlink_request_body = { phone_number: String } + + class PasswordlessSMSUnlinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor phone_number: String + + def initialize: (phone_number: String) -> void + + def to_hash: -> { phone_number: String } + end + end +end diff --git a/sig/privy/models/passwordless_sms_update_request_body.rbs b/sig/privy/models/passwordless_sms_update_request_body.rbs new file mode 100644 index 0000000..1b4d272 --- /dev/null +++ b/sig/privy/models/passwordless_sms_update_request_body.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type passwordless_sms_update_request_body = + { code: String, new_phone_number: String, old_phone_number: String } + + class PasswordlessSMSUpdateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor new_phone_number: String + + attr_accessor old_phone_number: String + + def initialize: ( + code: String, + new_phone_number: String, + old_phone_number: String + ) -> void + + def to_hash: -> { + code: String, + new_phone_number: String, + old_phone_number: String + } + end + end +end diff --git a/sig/privy/models/passwordless_transfer_request_body.rbs b/sig/privy/models/passwordless_transfer_request_body.rbs new file mode 100644 index 0000000..d9933bf --- /dev/null +++ b/sig/privy/models/passwordless_transfer_request_body.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type passwordless_transfer_request_body = { email: String, nonce: String } + + class PasswordlessTransferRequestBody < Privy::Internal::Type::BaseModel + attr_accessor email: String + + attr_accessor nonce: String + + def initialize: (email: String, nonce: String) -> void + + def to_hash: -> { email: String, nonce: String } + end + end +end diff --git a/sig/privy/models/passwordless_unlink_request_body.rbs b/sig/privy/models/passwordless_unlink_request_body.rbs new file mode 100644 index 0000000..65c1e60 --- /dev/null +++ b/sig/privy/models/passwordless_unlink_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type passwordless_unlink_request_body = { address: String } + + class PasswordlessUnlinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/passwordless_update_request_body.rbs b/sig/privy/models/passwordless_update_request_body.rbs new file mode 100644 index 0000000..fd2da4f --- /dev/null +++ b/sig/privy/models/passwordless_update_request_body.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type passwordless_update_request_body = + { code: String, new_address: String, old_address: String } + + class PasswordlessUpdateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor new_address: String + + attr_accessor old_address: String + + def initialize: ( + code: String, + new_address: String, + old_address: String + ) -> void + + def to_hash: -> { code: String, new_address: String, old_address: String } + end + end +end diff --git a/sig/privy/models/patch_users_custom_metadata.rbs b/sig/privy/models/patch_users_custom_metadata.rbs new file mode 100644 index 0000000..57237e6 --- /dev/null +++ b/sig/privy/models/patch_users_custom_metadata.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type patch_users_custom_metadata = + { custom_metadata: Privy::Models::custom_metadata } + + class PatchUsersCustomMetadata < Privy::Internal::Type::BaseModel + attr_accessor custom_metadata: Privy::Models::custom_metadata + + def initialize: (custom_metadata: Privy::Models::custom_metadata) -> void + + def to_hash: -> { custom_metadata: Privy::Models::custom_metadata } + end + end +end diff --git a/sig/privy/models/phone_invite_input.rbs b/sig/privy/models/phone_invite_input.rbs new file mode 100644 index 0000000..358cf39 --- /dev/null +++ b/sig/privy/models/phone_invite_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type phone_invite_input = + { type: Privy::Models::PhoneInviteInput::type_, value: String } + + class PhoneInviteInput < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::PhoneInviteInput::type_ + + attr_accessor value: String + + def initialize: ( + type: Privy::Models::PhoneInviteInput::type_, + value: String + ) -> void + + def to_hash: -> { + type: Privy::Models::PhoneInviteInput::type_, + value: String + } + + type type_ = :phone + + module Type + extend Privy::Internal::Type::Enum + + PHONE: :phone + + def self?.values: -> ::Array[Privy::Models::PhoneInviteInput::type_] + end + end + end +end diff --git a/sig/privy/models/policy.rbs b/sig/privy/models/policy.rbs new file mode 100644 index 0000000..b956af1 --- /dev/null +++ b/sig/privy/models/policy.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type policy = + { + id: String, + chain_type: Privy::Models::wallet_chain_type, + created_at: Float, + name: String, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleResponse], + version: Privy::Models::Policy::version + } + + class Policy < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_accessor created_at: Float + + attr_accessor name: String + + attr_accessor owner_id: String? + + attr_accessor rules: ::Array[Privy::PolicyRuleResponse] + + attr_accessor version: Privy::Models::Policy::version + + def initialize: ( + id: String, + chain_type: Privy::Models::wallet_chain_type, + created_at: Float, + name: String, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleResponse], + version: Privy::Models::Policy::version + ) -> void + + def to_hash: -> { + id: String, + chain_type: Privy::Models::wallet_chain_type, + created_at: Float, + name: String, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleResponse], + version: Privy::Models::Policy::version + } + + type version = :"1.0" + + module Version + extend Privy::Internal::Type::Enum + + VERSION_1_0: :"1.0" + + def self?.values: -> ::Array[Privy::Models::Policy::version] + end + end + end +end diff --git a/sig/privy/models/policy_action.rbs b/sig/privy/models/policy_action.rbs new file mode 100644 index 0000000..05ae0a2 --- /dev/null +++ b/sig/privy/models/policy_action.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type policy_action = :ALLOW | :DENY + + module PolicyAction + extend Privy::Internal::Type::Enum + + ALLOW: :ALLOW + DENY: :DENY + + def self?.values: -> ::Array[Privy::Models::policy_action] + end + end +end diff --git a/sig/privy/models/policy_authorization_headers.rbs b/sig/privy/models/policy_authorization_headers.rbs new file mode 100644 index 0000000..fbaf173 --- /dev/null +++ b/sig/privy/models/policy_authorization_headers.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type policy_authorization_headers = + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + + class PolicyAuthorizationHeaders < Privy::Internal::Type::BaseModel + attr_accessor privy_app_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + privy_app_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String + ) -> void + + def to_hash: -> { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + end + end +end diff --git a/sig/privy/models/policy_condition.rbs b/sig/privy/models/policy_condition.rbs new file mode 100644 index 0000000..fdb3bbd --- /dev/null +++ b/sig/privy/models/policy_condition.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type policy_condition = + Privy::EthereumTransactionCondition + | Privy::EthereumCalldataCondition + | Privy::EthereumTypedDataDomainCondition + | Privy::EthereumTypedDataMessageCondition + | Privy::Ethereum7702AuthorizationCondition + | Privy::SolanaProgramInstructionCondition + | Privy::SolanaSystemProgramInstructionCondition + | Privy::SolanaTokenProgramInstructionCondition + | Privy::SystemCondition + | Privy::TronTransactionCondition + | Privy::TronCalldataCondition + | Privy::SuiTransactionCommandCondition + | Privy::SuiTransferObjectsCommandCondition + | Privy::ActionRequestBodyCondition + | Privy::AggregationCondition + + module PolicyCondition + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::policy_condition] + end + end +end diff --git a/sig/privy/models/policy_create_params.rbs b/sig/privy/models/policy_create_params.rbs new file mode 100644 index 0000000..388e73b --- /dev/null +++ b/sig/privy/models/policy_create_params.rbs @@ -0,0 +1,107 @@ +module Privy + module Models + type policy_create_params = + { + chain_type: Privy::Models::wallet_chain_type, + name: String, + rules: ::Array[Privy::PolicyCreateParams::Rule], + version: Privy::Models::PolicyCreateParams::version, + owner: Privy::Models::owner_input?, + owner_id: String?, + privy_idempotency_key: String + } + & Privy::Internal::Type::request_parameters + + class PolicyCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_accessor name: String + + attr_accessor rules: ::Array[Privy::PolicyCreateParams::Rule] + + attr_accessor version: Privy::Models::PolicyCreateParams::version + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader privy_idempotency_key: String? + + def privy_idempotency_key=: (String) -> String + + def initialize: ( + chain_type: Privy::Models::wallet_chain_type, + name: String, + rules: ::Array[Privy::PolicyCreateParams::Rule], + version: Privy::Models::PolicyCreateParams::version, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?privy_idempotency_key: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::wallet_chain_type, + name: String, + rules: ::Array[Privy::PolicyCreateParams::Rule], + version: Privy::Models::PolicyCreateParams::version, + owner: Privy::Models::owner_input?, + owner_id: String?, + privy_idempotency_key: String, + request_options: Privy::RequestOptions + } + + type rule = + { + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String, + id: String + } + + class Rule < Privy::Internal::Type::BaseModel + attr_accessor action: Privy::Models::policy_action + + attr_accessor conditions: ::Array[Privy::Models::policy_condition] + + attr_accessor method_: Privy::Models::policy_method + + attr_accessor name: String + + attr_reader id: String? + + def id=: (String) -> String + + def initialize: ( + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String, + ?id: String + ) -> void + + def to_hash: -> { + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String, + id: String + } + end + + type version = :"1.0" + + module Version + extend Privy::Internal::Type::Enum + + VERSION_1_0: :"1.0" + + def self?.values: -> ::Array[Privy::Models::PolicyCreateParams::version] + end + end + end +end diff --git a/sig/privy/models/policy_create_rule_params.rbs b/sig/privy/models/policy_create_rule_params.rbs new file mode 100644 index 0000000..b6fb5fd --- /dev/null +++ b/sig/privy/models/policy_create_rule_params.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type policy_create_rule_params = + { + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class PolicyCreateRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def policy_id: -> String + + def policy_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + policy_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/policy_delete_params.rbs b/sig/privy/models/policy_delete_params.rbs new file mode 100644 index 0000000..0df38a8 --- /dev/null +++ b/sig/privy/models/policy_delete_params.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type policy_delete_params = + { + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class PolicyDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor policy_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + policy_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/policy_delete_rule_params.rbs b/sig/privy/models/policy_delete_rule_params.rbs new file mode 100644 index 0000000..bc01852 --- /dev/null +++ b/sig/privy/models/policy_delete_rule_params.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type policy_delete_rule_params = + { + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class PolicyDeleteRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor policy_id: String + + attr_accessor rule_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + policy_id: String, + rule_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/policy_get_params.rbs b/sig/privy/models/policy_get_params.rbs new file mode 100644 index 0000000..16a22f3 --- /dev/null +++ b/sig/privy/models/policy_get_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type policy_get_params = + { policy_id: String } & Privy::Internal::Type::request_parameters + + class PolicyGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor policy_id: String + + def initialize: ( + policy_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/policy_get_rule_params.rbs b/sig/privy/models/policy_get_rule_params.rbs new file mode 100644 index 0000000..2632b30 --- /dev/null +++ b/sig/privy/models/policy_get_rule_params.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type policy_get_rule_params = + { policy_id: String, rule_id: String } + & Privy::Internal::Type::request_parameters + + class PolicyGetRuleParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor policy_id: String + + attr_accessor rule_id: String + + def initialize: ( + policy_id: String, + rule_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + rule_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/policy_input.rbs b/sig/privy/models/policy_input.rbs new file mode 100644 index 0000000..a6e4721 --- /dev/null +++ b/sig/privy/models/policy_input.rbs @@ -0,0 +1,7 @@ +module Privy + module Models + type policy_input = ::Array[String] + + PolicyInput: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/policy_intent_request_details.rbs b/sig/privy/models/policy_intent_request_details.rbs new file mode 100644 index 0000000..3c9ed12 --- /dev/null +++ b/sig/privy/models/policy_intent_request_details.rbs @@ -0,0 +1,78 @@ +module Privy + module Models + type policy_intent_request_details = + { + body: Privy::PolicyIntentRequestDetails::Body, + method_: Privy::Models::PolicyIntentRequestDetails::method_, + url: String + } + + class PolicyIntentRequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::PolicyIntentRequestDetails::Body + + attr_accessor method_: Privy::Models::PolicyIntentRequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::PolicyIntentRequestDetails::Body, + method_: Privy::Models::PolicyIntentRequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::PolicyIntentRequestDetails::Body, + method_: Privy::Models::PolicyIntentRequestDetails::method_, + url: String + } + + type body = + { + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody] + } + + class Body < Privy::Internal::Type::BaseModel + attr_reader name: String? + + def name=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader rules: ::Array[Privy::PolicyRuleRequestBody]? + + def rules=: ( + ::Array[Privy::PolicyRuleRequestBody] + ) -> ::Array[Privy::PolicyRuleRequestBody] + + def initialize: ( + ?name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?rules: ::Array[Privy::PolicyRuleRequestBody] + ) -> void + + def to_hash: -> { + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody] + } + end + + type method_ = :PATCH + + module Method + extend Privy::Internal::Type::Enum + + PATCH: :PATCH + + def self?.values: -> ::Array[Privy::Models::PolicyIntentRequestDetails::method_] + end + end + end +end diff --git a/sig/privy/models/policy_intent_response.rbs b/sig/privy/models/policy_intent_response.rbs new file mode 100644 index 0000000..639da18 --- /dev/null +++ b/sig/privy/models/policy_intent_response.rbs @@ -0,0 +1,132 @@ +module Privy + module Models + type policy_intent_response = + { + intent_type: Privy::Models::PolicyIntentResponse::intent_type, + request_details: Privy::PolicyIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Policy + } + + class PolicyIntentResponse < Privy::Models::BaseIntentResponse + def intent_type: -> Privy::Models::PolicyIntentResponse::intent_type + + def intent_type=: ( + Privy::Models::PolicyIntentResponse::intent_type _ + ) -> Privy::Models::PolicyIntentResponse::intent_type + + def request_details: -> Privy::PolicyIntentResponse::RequestDetails + + def request_details=: ( + Privy::PolicyIntentResponse::RequestDetails _ + ) -> Privy::PolicyIntentResponse::RequestDetails + + def action_result: -> Privy::BaseActionResult? + + def action_result=: (Privy::BaseActionResult _) -> Privy::BaseActionResult + + def current_resource_data: -> Privy::Policy? + + def current_resource_data=: (Privy::Policy _) -> Privy::Policy + + def initialize: ( + intent_type: Privy::Models::PolicyIntentResponse::intent_type, + request_details: Privy::PolicyIntentResponse::RequestDetails, + ?action_result: Privy::BaseActionResult, + ?current_resource_data: Privy::Policy + ) -> void + + def to_hash: -> { + intent_type: Privy::Models::PolicyIntentResponse::intent_type, + request_details: Privy::PolicyIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Policy + } + + type intent_type = :POLICY + + module IntentType + extend Privy::Internal::Type::Enum + + POLICY: :POLICY + + def self?.values: -> ::Array[Privy::Models::PolicyIntentResponse::intent_type] + end + + type request_details = + { + body: Privy::PolicyIntentResponse::RequestDetails::Body, + method_: Privy::Models::PolicyIntentResponse::RequestDetails::method_, + url: String + } + + class RequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::PolicyIntentResponse::RequestDetails::Body + + attr_accessor method_: Privy::Models::PolicyIntentResponse::RequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::PolicyIntentResponse::RequestDetails::Body, + method_: Privy::Models::PolicyIntentResponse::RequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::PolicyIntentResponse::RequestDetails::Body, + method_: Privy::Models::PolicyIntentResponse::RequestDetails::method_, + url: String + } + + type body = + { + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody] + } + + class Body < Privy::Internal::Type::BaseModel + attr_reader name: String? + + def name=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader rules: ::Array[Privy::PolicyRuleRequestBody]? + + def rules=: ( + ::Array[Privy::PolicyRuleRequestBody] + ) -> ::Array[Privy::PolicyRuleRequestBody] + + def initialize: ( + ?name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?rules: ::Array[Privy::PolicyRuleRequestBody] + ) -> void + + def to_hash: -> { + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody] + } + end + + type method_ = :PATCH + + module Method + extend Privy::Internal::Type::Enum + + PATCH: :PATCH + + def self?.values: -> ::Array[Privy::Models::PolicyIntentResponse::RequestDetails::method_] + end + end + end + end +end diff --git a/sig/privy/models/policy_method.rbs b/sig/privy/models/policy_method.rbs new file mode 100644 index 0000000..cb3415b --- /dev/null +++ b/sig/privy/models/policy_method.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type policy_method = + :eth_sendTransaction + | :eth_signTransaction + | :eth_signUserOperation + | :eth_signTypedData_v4 + | :eth_sign7702Authorization + | :wallet_sendCalls + | :signTransaction + | :signAndSendTransaction + | :exportPrivateKey + | :exportSeedPhrase + | :signTransactionBytes + | :earn_deposit + | :earn_withdraw + | :transfer + | :* + + module PolicyMethod + extend Privy::Internal::Type::Enum + + ETH_SEND_TRANSACTION: :eth_sendTransaction + ETH_SIGN_TRANSACTION: :eth_signTransaction + ETH_SIGN_USER_OPERATION: :eth_signUserOperation + ETH_SIGN_TYPED_DATA_V4: :eth_signTypedData_v4 + ETH_SIGN7702_AUTHORIZATION: :eth_sign7702Authorization + WALLET_SEND_CALLS: :wallet_sendCalls + SIGN_TRANSACTION: :signTransaction + SIGN_AND_SEND_TRANSACTION: :signAndSendTransaction + EXPORT_PRIVATE_KEY: :exportPrivateKey + EXPORT_SEED_PHRASE: :exportSeedPhrase + SIGN_TRANSACTION_BYTES: :signTransactionBytes + EARN_DEPOSIT: :earn_deposit + EARN_WITHDRAW: :earn_withdraw + TRANSFER: :transfer + STAR: :* + + def self?.values: -> ::Array[Privy::Models::policy_method] + end + end +end diff --git a/sig/privy/models/policy_request_body.rbs b/sig/privy/models/policy_request_body.rbs new file mode 100644 index 0000000..d28f697 --- /dev/null +++ b/sig/privy/models/policy_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type policy_request_body = { policy_id: String } + + class PolicyRequestBody < Privy::Internal::Type::BaseModel + attr_accessor policy_id: String + + def initialize: (policy_id: String) -> void + + def to_hash: -> { policy_id: String } + end + end +end diff --git a/sig/privy/models/policy_rule_request_body.rbs b/sig/privy/models/policy_rule_request_body.rbs new file mode 100644 index 0000000..8db7326 --- /dev/null +++ b/sig/privy/models/policy_rule_request_body.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type policy_rule_request_body = + { + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String + } + + class PolicyRuleRequestBody < Privy::Internal::Type::BaseModel + attr_accessor action: Privy::Models::policy_action + + attr_accessor conditions: ::Array[Privy::Models::policy_condition] + + attr_accessor method_: Privy::Models::policy_method + + attr_accessor name: String + + def initialize: ( + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String + ) -> void + + def to_hash: -> { + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String + } + end + end +end diff --git a/sig/privy/models/policy_rule_request_params.rbs b/sig/privy/models/policy_rule_request_params.rbs new file mode 100644 index 0000000..19415cc --- /dev/null +++ b/sig/privy/models/policy_rule_request_params.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type policy_rule_request_params = { policy_id: String, rule_id: String } + + class PolicyRuleRequestParams < Privy::Internal::Type::BaseModel + attr_accessor policy_id: String + + attr_accessor rule_id: String + + def initialize: (policy_id: String, rule_id: String) -> void + + def to_hash: -> { policy_id: String, rule_id: String } + end + end +end diff --git a/sig/privy/models/policy_rule_response.rbs b/sig/privy/models/policy_rule_response.rbs new file mode 100644 index 0000000..dd0bcce --- /dev/null +++ b/sig/privy/models/policy_rule_response.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type policy_rule_response = + { + id: String, + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String + } + + class PolicyRuleResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor action: Privy::Models::policy_action + + attr_accessor conditions: ::Array[Privy::Models::policy_condition] + + attr_accessor method_: Privy::Models::policy_method + + attr_accessor name: String + + def initialize: ( + id: String, + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String + ) -> void + + def to_hash: -> { + id: String, + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String + } + end + end +end diff --git a/sig/privy/models/policy_update_params.rbs b/sig/privy/models/policy_update_params.rbs new file mode 100644 index 0000000..d8cf3de --- /dev/null +++ b/sig/privy/models/policy_update_params.rbs @@ -0,0 +1,66 @@ +module Privy + module Models + type policy_update_params = + { + policy_id: String, + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody], + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class PolicyUpdateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor policy_id: String + + attr_reader name: String? + + def name=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader rules: ::Array[Privy::PolicyRuleRequestBody]? + + def rules=: ( + ::Array[Privy::PolicyRuleRequestBody] + ) -> ::Array[Privy::PolicyRuleRequestBody] + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + policy_id: String, + ?name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?rules: ::Array[Privy::PolicyRuleRequestBody], + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + name: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + rules: ::Array[Privy::PolicyRuleRequestBody], + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/policy_update_rule_params.rbs b/sig/privy/models/policy_update_rule_params.rbs new file mode 100644 index 0000000..ea051c1 --- /dev/null +++ b/sig/privy/models/policy_update_rule_params.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type policy_update_rule_params = + { + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class PolicyUpdateRuleParams < Privy::Models::PolicyRuleRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def policy_id: -> String + + def policy_id=: (String _) -> String + + def rule_id: -> String + + def rule_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + policy_id: String, + rule_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + policy_id: String, + rule_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/private_key_export_input.rbs b/sig/privy/models/private_key_export_input.rbs new file mode 100644 index 0000000..a46a8dc --- /dev/null +++ b/sig/privy/models/private_key_export_input.rbs @@ -0,0 +1,41 @@ +module Privy + module Models + type private_key_export_input = + { + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + export_seed_phrase: bool, + export_type: Privy::Models::export_type + } + + class PrivateKeyExportInput < Privy::Internal::Type::BaseModel + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_accessor recipient_public_key: String + + attr_reader export_seed_phrase: bool? + + def export_seed_phrase=: (bool) -> bool + + attr_reader export_type: Privy::Models::export_type? + + def export_type=: ( + Privy::Models::export_type + ) -> Privy::Models::export_type + + def initialize: ( + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + ?export_seed_phrase: bool, + ?export_type: Privy::Models::export_type + ) -> void + + def to_hash: -> { + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + export_seed_phrase: bool, + export_type: Privy::Models::export_type + } + end + end +end diff --git a/sig/privy/models/private_key_export_response.rbs b/sig/privy/models/private_key_export_response.rbs new file mode 100644 index 0000000..213d1fb --- /dev/null +++ b/sig/privy/models/private_key_export_response.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type private_key_export_response = + { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + } + + class PrivateKeyExportResponse < Privy::Internal::Type::BaseModel + attr_accessor ciphertext: String + + attr_accessor encapsulated_key: String + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + def initialize: ( + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + ) -> void + + def to_hash: -> { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + } + end + end +end diff --git a/sig/privy/models/private_key_export_webhook_payload.rbs b/sig/privy/models/private_key_export_webhook_payload.rbs new file mode 100644 index 0000000..75523a9 --- /dev/null +++ b/sig/privy/models/private_key_export_webhook_payload.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type private_key_export_webhook_payload = + { + type: Privy::Models::PrivateKeyExportWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: Privy::Models::PrivateKeyExportWebhookPayload::export_source + } + + class PrivateKeyExportWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::PrivateKeyExportWebhookPayload::type_ + + attr_accessor user_id: String + + attr_accessor wallet_address: String + + attr_accessor wallet_id: String + + attr_reader export_source: Privy::Models::PrivateKeyExportWebhookPayload::export_source? + + def export_source=: ( + Privy::Models::PrivateKeyExportWebhookPayload::export_source + ) -> Privy::Models::PrivateKeyExportWebhookPayload::export_source + + def initialize: ( + type: Privy::Models::PrivateKeyExportWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String, + ?export_source: Privy::Models::PrivateKeyExportWebhookPayload::export_source + ) -> void + + def to_hash: -> { + type: Privy::Models::PrivateKeyExportWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: Privy::Models::PrivateKeyExportWebhookPayload::export_source + } + + type type_ = :"wallet.private_key_export" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_PRIVATE_KEY_EXPORT: :"wallet.private_key_export" + + def self?.values: -> ::Array[Privy::Models::PrivateKeyExportWebhookPayload::type_] + end + + type export_source = :display | :client + + module ExportSource + extend Privy::Internal::Type::Enum + + DISPLAY: :display + CLIENT: :client + + def self?.values: -> ::Array[Privy::Models::PrivateKeyExportWebhookPayload::export_source] + end + end + end +end diff --git a/sig/privy/models/private_key_init_input.rbs b/sig/privy/models/private_key_init_input.rbs new file mode 100644 index 0000000..7224e02 --- /dev/null +++ b/sig/privy/models/private_key_init_input.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type private_key_init_input = + { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::PrivateKeyInitInput::entropy_type + } + + class PrivateKeyInitInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::wallet_import_supported_chains + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_accessor entropy_type: Privy::Models::PrivateKeyInitInput::entropy_type + + def initialize: ( + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::PrivateKeyInitInput::entropy_type + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::PrivateKeyInitInput::entropy_type + } + + type entropy_type = :"private-key" + + module EntropyType + extend Privy::Internal::Type::Enum + + PRIVATE_KEY: :"private-key" + + def self?.values: -> ::Array[Privy::Models::PrivateKeyInitInput::entropy_type] + end + end + end +end diff --git a/sig/privy/models/private_key_submit_input.rbs b/sig/privy/models/private_key_submit_input.rbs new file mode 100644 index 0000000..d308ee6 --- /dev/null +++ b/sig/privy/models/private_key_submit_input.rbs @@ -0,0 +1,62 @@ +module Privy + module Models + type private_key_submit_input = + { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::PrivateKeySubmitInput::entropy_type, + hpke_config: Privy::HpkeImportConfig + } + + class PrivateKeySubmitInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::wallet_import_supported_chains + + attr_accessor ciphertext: String + + attr_accessor encapsulated_key: String + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_accessor entropy_type: Privy::Models::PrivateKeySubmitInput::entropy_type + + attr_reader hpke_config: Privy::HpkeImportConfig? + + def hpke_config=: (Privy::HpkeImportConfig) -> Privy::HpkeImportConfig + + def initialize: ( + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::PrivateKeySubmitInput::entropy_type, + ?hpke_config: Privy::HpkeImportConfig + ) -> void + + def to_hash: -> { + address: String, + chain_type: Privy::Models::wallet_import_supported_chains, + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption, + entropy_type: Privy::Models::PrivateKeySubmitInput::entropy_type, + hpke_config: Privy::HpkeImportConfig + } + + type entropy_type = :"private-key" + + module EntropyType + extend Privy::Internal::Type::Enum + + PRIVATE_KEY: :"private-key" + + def self?.values: -> ::Array[Privy::Models::PrivateKeySubmitInput::entropy_type] + end + end + end +end diff --git a/sig/privy/models/privy_oauth_provider_id.rbs b/sig/privy/models/privy_oauth_provider_id.rbs new file mode 100644 index 0000000..b8926b3 --- /dev/null +++ b/sig/privy/models/privy_oauth_provider_id.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class PrivyOAuthProviderID = String + end +end diff --git a/sig/privy/models/quantity.rbs b/sig/privy/models/quantity.rbs new file mode 100644 index 0000000..6406a40 --- /dev/null +++ b/sig/privy/models/quantity.rbs @@ -0,0 +1,11 @@ +module Privy + module Models + type quantity = String | Integer + + module Quantity + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::quantity] + end + end +end diff --git a/sig/privy/models/raw_sign_bytes_encoding.rbs b/sig/privy/models/raw_sign_bytes_encoding.rbs new file mode 100644 index 0000000..b7379f2 --- /dev/null +++ b/sig/privy/models/raw_sign_bytes_encoding.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type raw_sign_bytes_encoding = :"utf-8" | :hex | :base64 + + module RawSignBytesEncoding + extend Privy::Internal::Type::Enum + + UTF_8: :"utf-8" + HEX: :hex + BASE64: :base64 + + def self?.values: -> ::Array[Privy::Models::raw_sign_bytes_encoding] + end + end +end diff --git a/sig/privy/models/raw_sign_bytes_hash_function.rbs b/sig/privy/models/raw_sign_bytes_hash_function.rbs new file mode 100644 index 0000000..798b82d --- /dev/null +++ b/sig/privy/models/raw_sign_bytes_hash_function.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type raw_sign_bytes_hash_function = :keccak256 | :sha256 | :blake2b256 + + module RawSignBytesHashFunction + extend Privy::Internal::Type::Enum + + KECCAK256: :keccak256 + SHA256: :sha256 + BLAKE2B256: :blake2b256 + + def self?.values: -> ::Array[Privy::Models::raw_sign_bytes_hash_function] + end + end +end diff --git a/sig/privy/models/raw_sign_bytes_params.rbs b/sig/privy/models/raw_sign_bytes_params.rbs new file mode 100644 index 0000000..1075e24 --- /dev/null +++ b/sig/privy/models/raw_sign_bytes_params.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type raw_sign_bytes_params = + { + bytes: String, + encoding: Privy::Models::raw_sign_bytes_encoding, + hash_function: Privy::Models::raw_sign_bytes_hash_function + } + + class RawSignBytesParams < Privy::Internal::Type::BaseModel + attr_accessor bytes: String + + attr_accessor encoding: Privy::Models::raw_sign_bytes_encoding + + attr_accessor hash_function: Privy::Models::raw_sign_bytes_hash_function + + def initialize: ( + bytes: String, + encoding: Privy::Models::raw_sign_bytes_encoding, + hash_function: Privy::Models::raw_sign_bytes_hash_function + ) -> void + + def to_hash: -> { + bytes: String, + encoding: Privy::Models::raw_sign_bytes_encoding, + hash_function: Privy::Models::raw_sign_bytes_hash_function + } + end + end +end diff --git a/sig/privy/models/raw_sign_hash_params.rbs b/sig/privy/models/raw_sign_hash_params.rbs new file mode 100644 index 0000000..58be418 --- /dev/null +++ b/sig/privy/models/raw_sign_hash_params.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type raw_sign_hash_params = { hash_: String } + + class RawSignHashParams < Privy::Internal::Type::BaseModel + attr_accessor hash_: String + + def initialize: (hash_: String) -> void + + def to_hash: -> { hash_: String } + end + end +end diff --git a/sig/privy/models/raw_sign_input.rbs b/sig/privy/models/raw_sign_input.rbs new file mode 100644 index 0000000..b150fdd --- /dev/null +++ b/sig/privy/models/raw_sign_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type raw_sign_input = { params: Privy::Models::raw_sign_input_params } + + class RawSignInput < Privy::Internal::Type::BaseModel + attr_accessor params: Privy::Models::raw_sign_input_params + + def initialize: (params: Privy::Models::raw_sign_input_params) -> void + + def to_hash: -> { params: Privy::Models::raw_sign_input_params } + end + end +end diff --git a/sig/privy/models/raw_sign_input_params.rbs b/sig/privy/models/raw_sign_input_params.rbs new file mode 100644 index 0000000..f5e75f9 --- /dev/null +++ b/sig/privy/models/raw_sign_input_params.rbs @@ -0,0 +1,12 @@ +module Privy + module Models + type raw_sign_input_params = + Privy::RawSignHashParams | Privy::RawSignBytesParams + + module RawSignInputParams + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::raw_sign_input_params] + end + end +end diff --git a/sig/privy/models/raw_sign_response.rbs b/sig/privy/models/raw_sign_response.rbs new file mode 100644 index 0000000..94fc8c6 --- /dev/null +++ b/sig/privy/models/raw_sign_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type raw_sign_response = + { + data: Privy::RawSignResponseData, + method_: Privy::Models::RawSignResponse::method_ + } + + class RawSignResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::RawSignResponseData + + attr_accessor method_: Privy::Models::RawSignResponse::method_ + + def initialize: ( + data: Privy::RawSignResponseData, + method_: Privy::Models::RawSignResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::RawSignResponseData, + method_: Privy::Models::RawSignResponse::method_ + } + + type method_ = :raw_sign + + module Method + extend Privy::Internal::Type::Enum + + RAW_SIGN: :raw_sign + + def self?.values: -> ::Array[Privy::Models::RawSignResponse::method_] + end + end + end +end diff --git a/sig/privy/models/raw_sign_response_data.rbs b/sig/privy/models/raw_sign_response_data.rbs new file mode 100644 index 0000000..15fe2c7 --- /dev/null +++ b/sig/privy/models/raw_sign_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type raw_sign_response_data = + { + encoding: Privy::Models::RawSignResponseData::encoding, + signature: String + } + + class RawSignResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::RawSignResponseData::encoding + + attr_accessor signature: String + + def initialize: ( + encoding: Privy::Models::RawSignResponseData::encoding, + signature: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::RawSignResponseData::encoding, + signature: String + } + + type encoding = :hex + + module Encoding + extend Privy::Internal::Type::Enum + + HEX: :hex + + def self?.values: -> ::Array[Privy::Models::RawSignResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/recipient_public_key.rbs b/sig/privy/models/recipient_public_key.rbs new file mode 100644 index 0000000..a389fce --- /dev/null +++ b/sig/privy/models/recipient_public_key.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class RecipientPublicKey = String + end +end diff --git a/sig/privy/models/recovery_configuration_icloud_input.rbs b/sig/privy/models/recovery_configuration_icloud_input.rbs new file mode 100644 index 0000000..0840545 --- /dev/null +++ b/sig/privy/models/recovery_configuration_icloud_input.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type recovery_configuration_icloud_input = + { client_type: Privy::Models::icloud_client_type } + + class RecoveryConfigurationICloudInput < Privy::Internal::Type::BaseModel + attr_accessor client_type: Privy::Models::icloud_client_type + + def initialize: (client_type: Privy::Models::icloud_client_type) -> void + + def to_hash: -> { client_type: Privy::Models::icloud_client_type } + end + end +end diff --git a/sig/privy/models/recovery_configuration_icloud_response.rbs b/sig/privy/models/recovery_configuration_icloud_response.rbs new file mode 100644 index 0000000..b2708e4 --- /dev/null +++ b/sig/privy/models/recovery_configuration_icloud_response.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type recovery_configuration_icloud_response = + { api_token: String, container_identifier: String, environment: String } + + class RecoveryConfigurationICloudResponse < Privy::Internal::Type::BaseModel + attr_accessor api_token: String + + attr_accessor container_identifier: String + + attr_accessor environment: String + + def initialize: ( + api_token: String, + container_identifier: String, + environment: String + ) -> void + + def to_hash: -> { + api_token: String, + container_identifier: String, + environment: String + } + end + end +end diff --git a/sig/privy/models/recovery_key_material_input.rbs b/sig/privy/models/recovery_key_material_input.rbs new file mode 100644 index 0000000..bbcecab --- /dev/null +++ b/sig/privy/models/recovery_key_material_input.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type recovery_key_material_input = { chain_type: String } + + class RecoveryKeyMaterialInput < Privy::Internal::Type::BaseModel + attr_reader chain_type: String? + + def chain_type=: (String) -> String + + def initialize: (?chain_type: String) -> void + + def to_hash: -> { chain_type: String } + end + end +end diff --git a/sig/privy/models/recovery_key_material_response.rbs b/sig/privy/models/recovery_key_material_response.rbs new file mode 100644 index 0000000..570ff7b --- /dev/null +++ b/sig/privy/models/recovery_key_material_response.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type recovery_key_material_response = + { + file_id: String, + icloud_record_name: String, + recovery_code: String, + recovery_key: String, + recovery_key_derivation_salt: String, + recovery_type: Privy::Models::recovery_type + } + + class RecoveryKeyMaterialResponse < Privy::Internal::Type::BaseModel + attr_accessor file_id: String + + attr_accessor icloud_record_name: String + + attr_accessor recovery_code: String + + attr_accessor recovery_key: String + + attr_accessor recovery_key_derivation_salt: String + + attr_accessor recovery_type: Privy::Models::recovery_type + + def initialize: ( + file_id: String, + icloud_record_name: String, + recovery_code: String, + recovery_key: String, + recovery_key_derivation_salt: String, + recovery_type: Privy::Models::recovery_type + ) -> void + + def to_hash: -> { + file_id: String, + icloud_record_name: String, + recovery_code: String, + recovery_key: String, + recovery_key_derivation_salt: String, + recovery_type: Privy::Models::recovery_type + } + end + end +end diff --git a/sig/privy/models/recovery_type.rbs b/sig/privy/models/recovery_type.rbs new file mode 100644 index 0000000..1ee4969 --- /dev/null +++ b/sig/privy/models/recovery_type.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type recovery_type = + :user_passcode_derived_recovery_key + | :privy_passcode_derived_recovery_key + | :privy_generated_recovery_key + | :google_drive_recovery_secret + | :icloud_recovery_secret + + module RecoveryType + extend Privy::Internal::Type::Enum + + USER_PASSCODE_DERIVED_RECOVERY_KEY: :user_passcode_derived_recovery_key + PRIVY_PASSCODE_DERIVED_RECOVERY_KEY: :privy_passcode_derived_recovery_key + PRIVY_GENERATED_RECOVERY_KEY: :privy_generated_recovery_key + GOOGLE_DRIVE_RECOVERY_SECRET: :google_drive_recovery_secret + ICLOUD_RECOVERY_SECRET: :icloud_recovery_secret + + def self?.values: -> ::Array[Privy::Models::recovery_type] + end + end +end diff --git a/sig/privy/models/response_passkey_init_authenticate.rbs b/sig/privy/models/response_passkey_init_authenticate.rbs new file mode 100644 index 0000000..366c9e9 --- /dev/null +++ b/sig/privy/models/response_passkey_init_authenticate.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type response_passkey_init_authenticate = + { + options: Privy::PasskeyAuthenticatorVerifyOptions, + relying_party: String + } + + class ResponsePasskeyInitAuthenticate < Privy::Internal::Type::BaseModel + attr_accessor options: Privy::PasskeyAuthenticatorVerifyOptions + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + options: Privy::PasskeyAuthenticatorVerifyOptions, + ?relying_party: String + ) -> void + + def to_hash: -> { + options: Privy::PasskeyAuthenticatorVerifyOptions, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/response_passkey_init_link.rbs b/sig/privy/models/response_passkey_init_link.rbs new file mode 100644 index 0000000..0fe0b53 --- /dev/null +++ b/sig/privy/models/response_passkey_init_link.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type response_passkey_init_link = + { + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + relying_party: String + } + + class ResponsePasskeyInitLink < Privy::Internal::Type::BaseModel + attr_accessor options: Privy::PasskeyAuthenticatorEnrollmentOptions + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + ?relying_party: String + ) -> void + + def to_hash: -> { + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/response_passkey_init_register.rbs b/sig/privy/models/response_passkey_init_register.rbs new file mode 100644 index 0000000..da9b8eb --- /dev/null +++ b/sig/privy/models/response_passkey_init_register.rbs @@ -0,0 +1,27 @@ +module Privy + module Models + type response_passkey_init_register = + { + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + relying_party: String + } + + class ResponsePasskeyInitRegister < Privy::Internal::Type::BaseModel + attr_accessor options: Privy::PasskeyAuthenticatorEnrollmentOptions + + attr_reader relying_party: String? + + def relying_party=: (String) -> String + + def initialize: ( + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + ?relying_party: String + ) -> void + + def to_hash: -> { + options: Privy::PasskeyAuthenticatorEnrollmentOptions, + relying_party: String + } + end + end +end diff --git a/sig/privy/models/rpc_intent_request_details.rbs b/sig/privy/models/rpc_intent_request_details.rbs new file mode 100644 index 0000000..77a65f8 --- /dev/null +++ b/sig/privy/models/rpc_intent_request_details.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type rpc_intent_request_details = + { + body: Privy::Models::wallet_rpc_request_body, + method_: Privy::Models::RpcIntentRequestDetails::method_, + url: String + } + + class RpcIntentRequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::Models::wallet_rpc_request_body + + attr_accessor method_: Privy::Models::RpcIntentRequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::Models::wallet_rpc_request_body, + method_: Privy::Models::RpcIntentRequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::Models::wallet_rpc_request_body, + method_: Privy::Models::RpcIntentRequestDetails::method_, + url: String + } + + type method_ = :POST + + module Method + extend Privy::Internal::Type::Enum + + POST: :POST + + def self?.values: -> ::Array[Privy::Models::RpcIntentRequestDetails::method_] + end + end + end +end diff --git a/sig/privy/models/rpc_intent_response.rbs b/sig/privy/models/rpc_intent_response.rbs new file mode 100644 index 0000000..a2168d3 --- /dev/null +++ b/sig/privy/models/rpc_intent_response.rbs @@ -0,0 +1,94 @@ +module Privy + module Models + type rpc_intent_response = + { + intent_type: Privy::Models::RpcIntentResponse::intent_type, + request_details: Privy::RpcIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + + class RpcIntentResponse < Privy::Models::BaseIntentResponse + def intent_type: -> Privy::Models::RpcIntentResponse::intent_type + + def intent_type=: ( + Privy::Models::RpcIntentResponse::intent_type _ + ) -> Privy::Models::RpcIntentResponse::intent_type + + def request_details: -> Privy::RpcIntentResponse::RequestDetails + + def request_details=: ( + Privy::RpcIntentResponse::RequestDetails _ + ) -> Privy::RpcIntentResponse::RequestDetails + + def action_result: -> Privy::BaseActionResult? + + def action_result=: (Privy::BaseActionResult _) -> Privy::BaseActionResult + + def current_resource_data: -> Privy::Wallet? + + def current_resource_data=: (Privy::Wallet _) -> Privy::Wallet + + def initialize: ( + intent_type: Privy::Models::RpcIntentResponse::intent_type, + request_details: Privy::RpcIntentResponse::RequestDetails, + ?action_result: Privy::BaseActionResult, + ?current_resource_data: Privy::Wallet + ) -> void + + def to_hash: -> { + intent_type: Privy::Models::RpcIntentResponse::intent_type, + request_details: Privy::RpcIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + + type intent_type = :RPC + + module IntentType + extend Privy::Internal::Type::Enum + + RPC: :RPC + + def self?.values: -> ::Array[Privy::Models::RpcIntentResponse::intent_type] + end + + type request_details = + { + body: Privy::Models::wallet_rpc_request_body, + method_: Privy::Models::RpcIntentResponse::RequestDetails::method_, + url: String + } + + class RequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::Models::wallet_rpc_request_body + + attr_accessor method_: Privy::Models::RpcIntentResponse::RequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::Models::wallet_rpc_request_body, + method_: Privy::Models::RpcIntentResponse::RequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::Models::wallet_rpc_request_body, + method_: Privy::Models::RpcIntentResponse::RequestDetails::method_, + url: String + } + + type method_ = :POST + + module Method + extend Privy::Internal::Type::Enum + + POST: :POST + + def self?.values: -> ::Array[Privy::Models::RpcIntentResponse::RequestDetails::method_] + end + end + end + end +end diff --git a/sig/privy/models/rule_intent_create_request_details.rbs b/sig/privy/models/rule_intent_create_request_details.rbs new file mode 100644 index 0000000..7b9bcdb --- /dev/null +++ b/sig/privy/models/rule_intent_create_request_details.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type rule_intent_create_request_details = + { + body: Privy::PolicyRuleRequestBody, + method_: Privy::Models::RuleIntentCreateRequestDetails::method_, + url: String + } + + class RuleIntentCreateRequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::PolicyRuleRequestBody + + attr_accessor method_: Privy::Models::RuleIntentCreateRequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::PolicyRuleRequestBody, + method_: Privy::Models::RuleIntentCreateRequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::PolicyRuleRequestBody, + method_: Privy::Models::RuleIntentCreateRequestDetails::method_, + url: String + } + + type method_ = :POST + + module Method + extend Privy::Internal::Type::Enum + + POST: :POST + + def self?.values: -> ::Array[Privy::Models::RuleIntentCreateRequestDetails::method_] + end + end + end +end diff --git a/sig/privy/models/rule_intent_delete_request_details.rbs b/sig/privy/models/rule_intent_delete_request_details.rbs new file mode 100644 index 0000000..ecba3f4 --- /dev/null +++ b/sig/privy/models/rule_intent_delete_request_details.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type rule_intent_delete_request_details = + { + method_: Privy::Models::RuleIntentDeleteRequestDetails::method_, + url: String, + body: Privy::RuleIntentDeleteRequestDetails::Body + } + + class RuleIntentDeleteRequestDetails < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::RuleIntentDeleteRequestDetails::method_ + + attr_accessor url: String + + attr_reader body: Privy::RuleIntentDeleteRequestDetails::Body? + + def body=: ( + Privy::RuleIntentDeleteRequestDetails::Body + ) -> Privy::RuleIntentDeleteRequestDetails::Body + + def initialize: ( + method_: Privy::Models::RuleIntentDeleteRequestDetails::method_, + url: String, + ?body: Privy::RuleIntentDeleteRequestDetails::Body + ) -> void + + def to_hash: -> { + method_: Privy::Models::RuleIntentDeleteRequestDetails::method_, + url: String, + body: Privy::RuleIntentDeleteRequestDetails::Body + } + + type method_ = :DELETE + + module Method + extend Privy::Internal::Type::Enum + + DELETE: :DELETE + + def self?.values: -> ::Array[Privy::Models::RuleIntentDeleteRequestDetails::method_] + end + + type body = { } + + class Body < Privy::Internal::Type::BaseModel + def initialize: -> void + + def to_hash: -> { } + end + end + end +end diff --git a/sig/privy/models/rule_intent_request_details.rbs b/sig/privy/models/rule_intent_request_details.rbs new file mode 100644 index 0000000..0e8be42 --- /dev/null +++ b/sig/privy/models/rule_intent_request_details.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type rule_intent_request_details = + Privy::RuleIntentCreateRequestDetails + | Privy::RuleIntentUpdateRequestDetails + | Privy::RuleIntentDeleteRequestDetails + + module RuleIntentRequestDetails + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::rule_intent_request_details] + end + end +end diff --git a/sig/privy/models/rule_intent_response.rbs b/sig/privy/models/rule_intent_response.rbs new file mode 100644 index 0000000..aab4b2c --- /dev/null +++ b/sig/privy/models/rule_intent_response.rbs @@ -0,0 +1,66 @@ +module Privy + module Models + type rule_intent_response = + { + intent_type: Privy::Models::RuleIntentResponse::intent_type, + request_details: Privy::Models::rule_intent_request_details, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::PolicyRuleResponse, + policy: Privy::Policy + } + + class RuleIntentResponse < Privy::Models::BaseIntentResponse + def intent_type: -> Privy::Models::RuleIntentResponse::intent_type + + def intent_type=: ( + Privy::Models::RuleIntentResponse::intent_type _ + ) -> Privy::Models::RuleIntentResponse::intent_type + + def request_details: -> Privy::Models::rule_intent_request_details + + def request_details=: ( + Privy::Models::rule_intent_request_details _ + ) -> Privy::Models::rule_intent_request_details + + def action_result: -> Privy::BaseActionResult? + + def action_result=: (Privy::BaseActionResult _) -> Privy::BaseActionResult + + def current_resource_data: -> Privy::PolicyRuleResponse? + + def current_resource_data=: ( + Privy::PolicyRuleResponse _ + ) -> Privy::PolicyRuleResponse + + def policy: -> Privy::Policy? + + def policy=: (Privy::Policy _) -> Privy::Policy + + def initialize: ( + intent_type: Privy::Models::RuleIntentResponse::intent_type, + request_details: Privy::Models::rule_intent_request_details, + ?action_result: Privy::BaseActionResult, + ?current_resource_data: Privy::PolicyRuleResponse, + ?policy: Privy::Policy + ) -> void + + def to_hash: -> { + intent_type: Privy::Models::RuleIntentResponse::intent_type, + request_details: Privy::Models::rule_intent_request_details, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::PolicyRuleResponse, + policy: Privy::Policy + } + + type intent_type = :RULE + + module IntentType + extend Privy::Internal::Type::Enum + + RULE: :RULE + + def self?.values: -> ::Array[Privy::Models::RuleIntentResponse::intent_type] + end + end + end +end diff --git a/sig/privy/models/rule_intent_update_request_details.rbs b/sig/privy/models/rule_intent_update_request_details.rbs new file mode 100644 index 0000000..78759fc --- /dev/null +++ b/sig/privy/models/rule_intent_update_request_details.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type rule_intent_update_request_details = + { + body: Privy::PolicyRuleRequestBody, + method_: Privy::Models::RuleIntentUpdateRequestDetails::method_, + url: String + } + + class RuleIntentUpdateRequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::PolicyRuleRequestBody + + attr_accessor method_: Privy::Models::RuleIntentUpdateRequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::PolicyRuleRequestBody, + method_: Privy::Models::RuleIntentUpdateRequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::PolicyRuleRequestBody, + method_: Privy::Models::RuleIntentUpdateRequestDetails::method_, + url: String + } + + type method_ = :PATCH + + module Method + extend Privy::Internal::Type::Enum + + PATCH: :PATCH + + def self?.values: -> ::Array[Privy::Models::RuleIntentUpdateRequestDetails::method_] + end + end + end +end diff --git a/sig/privy/models/seed_phrase_export_input.rbs b/sig/privy/models/seed_phrase_export_input.rbs new file mode 100644 index 0000000..271f6d6 --- /dev/null +++ b/sig/privy/models/seed_phrase_export_input.rbs @@ -0,0 +1,41 @@ +module Privy + module Models + type seed_phrase_export_input = + { + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + export_seed_phrase: bool, + export_type: Privy::Models::export_type + } + + class SeedPhraseExportInput < Privy::Internal::Type::BaseModel + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_accessor recipient_public_key: String + + attr_reader export_seed_phrase: bool? + + def export_seed_phrase=: (bool) -> bool + + attr_reader export_type: Privy::Models::export_type? + + def export_type=: ( + Privy::Models::export_type + ) -> Privy::Models::export_type + + def initialize: ( + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + ?export_seed_phrase: bool, + ?export_type: Privy::Models::export_type + ) -> void + + def to_hash: -> { + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + export_seed_phrase: bool, + export_type: Privy::Models::export_type + } + end + end +end diff --git a/sig/privy/models/seed_phrase_export_response.rbs b/sig/privy/models/seed_phrase_export_response.rbs new file mode 100644 index 0000000..c2105a9 --- /dev/null +++ b/sig/privy/models/seed_phrase_export_response.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type seed_phrase_export_response = + { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + } + + class SeedPhraseExportResponse < Privy::Internal::Type::BaseModel + attr_accessor ciphertext: String + + attr_accessor encapsulated_key: String + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + def initialize: ( + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + ) -> void + + def to_hash: -> { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + } + end + end +end diff --git a/sig/privy/models/seed_phrase_export_webhook_payload.rbs b/sig/privy/models/seed_phrase_export_webhook_payload.rbs new file mode 100644 index 0000000..d87b267 --- /dev/null +++ b/sig/privy/models/seed_phrase_export_webhook_payload.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type seed_phrase_export_webhook_payload = + { + type: Privy::Models::SeedPhraseExportWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: Privy::Models::SeedPhraseExportWebhookPayload::export_source + } + + class SeedPhraseExportWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::SeedPhraseExportWebhookPayload::type_ + + attr_accessor user_id: String + + attr_accessor wallet_address: String + + attr_accessor wallet_id: String + + attr_reader export_source: Privy::Models::SeedPhraseExportWebhookPayload::export_source? + + def export_source=: ( + Privy::Models::SeedPhraseExportWebhookPayload::export_source + ) -> Privy::Models::SeedPhraseExportWebhookPayload::export_source + + def initialize: ( + type: Privy::Models::SeedPhraseExportWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String, + ?export_source: Privy::Models::SeedPhraseExportWebhookPayload::export_source + ) -> void + + def to_hash: -> { + type: Privy::Models::SeedPhraseExportWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String, + export_source: Privy::Models::SeedPhraseExportWebhookPayload::export_source + } + + type type_ = :"wallet.seed_phrase_export" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_SEED_PHRASE_EXPORT: :"wallet.seed_phrase_export" + + def self?.values: -> ::Array[Privy::Models::SeedPhraseExportWebhookPayload::type_] + end + + type export_source = :display | :client + + module ExportSource + extend Privy::Internal::Type::Enum + + DISPLAY: :display + CLIENT: :client + + def self?.values: -> ::Array[Privy::Models::SeedPhraseExportWebhookPayload::export_source] + end + end + end +end diff --git a/sig/privy/models/signing_algorithm.rbs b/sig/privy/models/signing_algorithm.rbs new file mode 100644 index 0000000..7fa207e --- /dev/null +++ b/sig/privy/models/signing_algorithm.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type signing_algorithm = :ECDSA | :EdDSA | :Schnorr + + module SigningAlgorithm + extend Privy::Internal::Type::Enum + + ECDSA: :ECDSA + ED_DSA: :EdDSA + SCHNORR: :Schnorr + + def self?.values: -> ::Array[Privy::Models::signing_algorithm] + end + end +end diff --git a/sig/privy/models/siwe_address_input.rbs b/sig/privy/models/siwe_address_input.rbs new file mode 100644 index 0000000..4acbb66 --- /dev/null +++ b/sig/privy/models/siwe_address_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type siwe_address_input = { address: String } + + class SiweAddressInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/siwe_authenticate_request_body.rbs b/sig/privy/models/siwe_authenticate_request_body.rbs new file mode 100644 index 0000000..eae8c16 --- /dev/null +++ b/sig/privy/models/siwe_authenticate_request_body.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type siwe_authenticate_request_body = + { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + + class SiweAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor chain_id: String? + + attr_accessor connector_type: String? + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?chain_id: String?, + ?connector_type: String?, + ?mode: Privy::Models::authenticate_mode_option, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + end + end +end diff --git a/sig/privy/models/siwe_init_input.rbs b/sig/privy/models/siwe_init_input.rbs new file mode 100644 index 0000000..eae7034 --- /dev/null +++ b/sig/privy/models/siwe_init_input.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type siwe_init_input = { token: String, address: String } + + class SiweInitInput < Privy::Internal::Type::BaseModel + attr_reader token: String? + + def token=: (String) -> String + + attr_reader address: String? + + def address=: (String) -> String + + def initialize: (?token: String, ?address: String) -> void + + def to_hash: -> { token: String, address: String } + end + end +end diff --git a/sig/privy/models/siwe_init_request_body.rbs b/sig/privy/models/siwe_init_request_body.rbs new file mode 100644 index 0000000..e2d8b49 --- /dev/null +++ b/sig/privy/models/siwe_init_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type siwe_init_request_body = { address: String } + + class SiweInitRequestBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/siwe_init_response_body.rbs b/sig/privy/models/siwe_init_response_body.rbs new file mode 100644 index 0000000..ab1353f --- /dev/null +++ b/sig/privy/models/siwe_init_response_body.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type siwe_init_response_body = + { address: String, expires_at: String, nonce: String } + + class SiweInitResponseBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor expires_at: String + + attr_accessor nonce: String + + def initialize: ( + address: String, + expires_at: String, + nonce: String + ) -> void + + def to_hash: -> { address: String, expires_at: String, nonce: String } + end + end +end diff --git a/sig/privy/models/siwe_input.rbs b/sig/privy/models/siwe_input.rbs new file mode 100644 index 0000000..5a42626 --- /dev/null +++ b/sig/privy/models/siwe_input.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type siwe_input = + { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + wallet_client_type: String? + } + + class SiweInput < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor chain_id: String? + + attr_accessor connector_type: String? + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?chain_id: String?, + ?connector_type: String?, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + wallet_client_type: String? + } + end + end +end diff --git a/sig/privy/models/siwe_link_request_body.rbs b/sig/privy/models/siwe_link_request_body.rbs new file mode 100644 index 0000000..03eb65d --- /dev/null +++ b/sig/privy/models/siwe_link_request_body.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type siwe_link_request_body = + { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + wallet_client_type: String? + } + + class SiweLinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor chain_id: String? + + attr_accessor connector_type: String? + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?chain_id: String?, + ?connector_type: String?, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + chain_id: String?, + connector_type: String?, + wallet_client_type: String? + } + end + end +end diff --git a/sig/privy/models/siwe_link_smart_wallet_request_body.rbs b/sig/privy/models/siwe_link_smart_wallet_request_body.rbs new file mode 100644 index 0000000..4c74660 --- /dev/null +++ b/sig/privy/models/siwe_link_smart_wallet_request_body.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type siwe_link_smart_wallet_request_body = + { + message: String, + signature: String, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String + } + + class SiweLinkSmartWalletRequestBody < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor smart_wallet_type: Privy::Models::smart_wallet_type + + attr_reader smart_wallet_version: String? + + def smart_wallet_version=: (String) -> String + + def initialize: ( + message: String, + signature: String, + smart_wallet_type: Privy::Models::smart_wallet_type, + ?smart_wallet_version: String + ) -> void + + def to_hash: -> { + message: String, + signature: String, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String + } + end + end +end diff --git a/sig/privy/models/siwe_nonce.rbs b/sig/privy/models/siwe_nonce.rbs new file mode 100644 index 0000000..2fd9621 --- /dev/null +++ b/sig/privy/models/siwe_nonce.rbs @@ -0,0 +1,21 @@ +module Privy + module Models + type siwe_nonce = { address: String, expires_at: String, nonce: String } + + class SiweNonce < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor expires_at: String + + attr_accessor nonce: String + + def initialize: ( + address: String, + expires_at: String, + nonce: String + ) -> void + + def to_hash: -> { address: String, expires_at: String, nonce: String } + end + end +end diff --git a/sig/privy/models/siwe_unlink_request_body.rbs b/sig/privy/models/siwe_unlink_request_body.rbs new file mode 100644 index 0000000..47933b0 --- /dev/null +++ b/sig/privy/models/siwe_unlink_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type siwe_unlink_request_body = { address: String } + + class SiweUnlinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/siws_address_input.rbs b/sig/privy/models/siws_address_input.rbs new file mode 100644 index 0000000..70da54e --- /dev/null +++ b/sig/privy/models/siws_address_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type siws_address_input = { address: String } + + class SiwsAddressInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/siws_authenticate_request_body.rbs b/sig/privy/models/siws_authenticate_request_body.rbs new file mode 100644 index 0000000..02d9ece --- /dev/null +++ b/sig/privy/models/siws_authenticate_request_body.rbs @@ -0,0 +1,64 @@ +module Privy + module Models + type siws_authenticate_request_body = + { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::SiwsAuthenticateRequestBody::message_type, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + + class SiwsAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor connector_type: String? + + attr_reader message_type: Privy::Models::SiwsAuthenticateRequestBody::message_type? + + def message_type=: ( + Privy::Models::SiwsAuthenticateRequestBody::message_type + ) -> Privy::Models::SiwsAuthenticateRequestBody::message_type + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?connector_type: String?, + ?message_type: Privy::Models::SiwsAuthenticateRequestBody::message_type, + ?mode: Privy::Models::authenticate_mode_option, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::SiwsAuthenticateRequestBody::message_type, + mode: Privy::Models::authenticate_mode_option, + wallet_client_type: String? + } + + type message_type = :transaction | :plain + + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION: :transaction + PLAIN: :plain + + def self?.values: -> ::Array[Privy::Models::SiwsAuthenticateRequestBody::message_type] + end + end + end +end diff --git a/sig/privy/models/siws_init_input.rbs b/sig/privy/models/siws_init_input.rbs new file mode 100644 index 0000000..8cd5eb8 --- /dev/null +++ b/sig/privy/models/siws_init_input.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type siws_init_input = { address: String, token: String } + + class SiwsInitInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_reader token: String? + + def token=: (String) -> String + + def initialize: (address: String, ?token: String) -> void + + def to_hash: -> { address: String, token: String } + end + end +end diff --git a/sig/privy/models/siws_init_request_body.rbs b/sig/privy/models/siws_init_request_body.rbs new file mode 100644 index 0000000..9bef664 --- /dev/null +++ b/sig/privy/models/siws_init_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type siws_init_request_body = { address: String } + + class SiwsInitRequestBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/siws_init_response_body.rbs b/sig/privy/models/siws_init_response_body.rbs new file mode 100644 index 0000000..80e98f1 --- /dev/null +++ b/sig/privy/models/siws_init_response_body.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type siws_init_response_body = + { address: String, expires_at: String, nonce: String } + + class SiwsInitResponseBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor expires_at: String + + attr_accessor nonce: String + + def initialize: ( + address: String, + expires_at: String, + nonce: String + ) -> void + + def to_hash: -> { address: String, expires_at: String, nonce: String } + end + end +end diff --git a/sig/privy/models/siws_input.rbs b/sig/privy/models/siws_input.rbs new file mode 100644 index 0000000..73266c9 --- /dev/null +++ b/sig/privy/models/siws_input.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type siws_input = + { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::SiwsInput::message_type, + wallet_client_type: String? + } + + class SiwsInput < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor connector_type: String? + + attr_reader message_type: Privy::Models::SiwsInput::message_type? + + def message_type=: ( + Privy::Models::SiwsInput::message_type + ) -> Privy::Models::SiwsInput::message_type + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?connector_type: String?, + ?message_type: Privy::Models::SiwsInput::message_type, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::SiwsInput::message_type, + wallet_client_type: String? + } + + type message_type = :transaction | :plain + + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION: :transaction + PLAIN: :plain + + def self?.values: -> ::Array[Privy::Models::SiwsInput::message_type] + end + end + end +end diff --git a/sig/privy/models/siws_link_request_body.rbs b/sig/privy/models/siws_link_request_body.rbs new file mode 100644 index 0000000..aba117b --- /dev/null +++ b/sig/privy/models/siws_link_request_body.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type siws_link_request_body = + { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::SiwsLinkRequestBody::message_type, + wallet_client_type: String? + } + + class SiwsLinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor connector_type: String? + + attr_reader message_type: Privy::Models::SiwsLinkRequestBody::message_type? + + def message_type=: ( + Privy::Models::SiwsLinkRequestBody::message_type + ) -> Privy::Models::SiwsLinkRequestBody::message_type + + attr_accessor wallet_client_type: String? + + def initialize: ( + message: String, + signature: String, + ?connector_type: String?, + ?message_type: Privy::Models::SiwsLinkRequestBody::message_type, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + message: String, + signature: String, + connector_type: String?, + message_type: Privy::Models::SiwsLinkRequestBody::message_type, + wallet_client_type: String? + } + + type message_type = :transaction | :plain + + module MessageType + extend Privy::Internal::Type::Enum + + TRANSACTION: :transaction + PLAIN: :plain + + def self?.values: -> ::Array[Privy::Models::SiwsLinkRequestBody::message_type] + end + end + end +end diff --git a/sig/privy/models/siws_nonce.rbs b/sig/privy/models/siws_nonce.rbs new file mode 100644 index 0000000..fc62989 --- /dev/null +++ b/sig/privy/models/siws_nonce.rbs @@ -0,0 +1,21 @@ +module Privy + module Models + type siws_nonce = { address: String, expires_at: String, nonce: String } + + class SiwsNonce < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor expires_at: String + + attr_accessor nonce: String + + def initialize: ( + address: String, + expires_at: String, + nonce: String + ) -> void + + def to_hash: -> { address: String, expires_at: String, nonce: String } + end + end +end diff --git a/sig/privy/models/siws_unlink_request_body.rbs b/sig/privy/models/siws_unlink_request_body.rbs new file mode 100644 index 0000000..ee819b5 --- /dev/null +++ b/sig/privy/models/siws_unlink_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type siws_unlink_request_body = { address: String } + + class SiwsUnlinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/smart_wallet_configuration.rbs b/sig/privy/models/smart_wallet_configuration.rbs new file mode 100644 index 0000000..aa9651d --- /dev/null +++ b/sig/privy/models/smart_wallet_configuration.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type smart_wallet_configuration = + Privy::SmartWalletConfigurationDisabled + | Privy::SmartWalletConfigurationEnabled + + module SmartWalletConfiguration + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::smart_wallet_configuration] + end + end +end diff --git a/sig/privy/models/smart_wallet_configuration_disabled.rbs b/sig/privy/models/smart_wallet_configuration_disabled.rbs new file mode 100644 index 0000000..c16edce --- /dev/null +++ b/sig/privy/models/smart_wallet_configuration_disabled.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type smart_wallet_configuration_disabled = + { enabled: Privy::Models::SmartWalletConfigurationDisabled::enabled } + + class SmartWalletConfigurationDisabled < Privy::Internal::Type::BaseModel + attr_accessor enabled: Privy::Models::SmartWalletConfigurationDisabled::enabled + + def initialize: ( + enabled: Privy::Models::SmartWalletConfigurationDisabled::enabled + ) -> void + + def to_hash: -> { + enabled: Privy::Models::SmartWalletConfigurationDisabled::enabled + } + + type enabled = false + + module Enabled + extend Privy::Internal::Type::Enum + + FALSE: false + + def self?.values: -> ::Array[Privy::Models::SmartWalletConfigurationDisabled::enabled] + end + end + end +end diff --git a/sig/privy/models/smart_wallet_configuration_enabled.rbs b/sig/privy/models/smart_wallet_configuration_enabled.rbs new file mode 100644 index 0000000..9ef63f5 --- /dev/null +++ b/sig/privy/models/smart_wallet_configuration_enabled.rbs @@ -0,0 +1,47 @@ +module Privy + module Models + type smart_wallet_configuration_enabled = + { + configured_networks: ::Array[Privy::SmartWalletNetworkConfiguration], + enabled: Privy::Models::SmartWalletConfigurationEnabled::enabled, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String + } + + class SmartWalletConfigurationEnabled < Privy::Internal::Type::BaseModel + attr_accessor configured_networks: ::Array[Privy::SmartWalletNetworkConfiguration] + + attr_accessor enabled: Privy::Models::SmartWalletConfigurationEnabled::enabled + + attr_accessor smart_wallet_type: Privy::Models::smart_wallet_type + + attr_reader smart_wallet_version: String? + + def smart_wallet_version=: (String) -> String + + def initialize: ( + configured_networks: ::Array[Privy::SmartWalletNetworkConfiguration], + enabled: Privy::Models::SmartWalletConfigurationEnabled::enabled, + smart_wallet_type: Privy::Models::smart_wallet_type, + ?smart_wallet_version: String + ) -> void + + def to_hash: -> { + configured_networks: ::Array[Privy::SmartWalletNetworkConfiguration], + enabled: Privy::Models::SmartWalletConfigurationEnabled::enabled, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String + } + + type enabled = true + + module Enabled + extend Privy::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[Privy::Models::SmartWalletConfigurationEnabled::enabled] + end + end + end +end diff --git a/sig/privy/models/smart_wallet_configuration_input.rbs b/sig/privy/models/smart_wallet_configuration_input.rbs new file mode 100644 index 0000000..3444a74 --- /dev/null +++ b/sig/privy/models/smart_wallet_configuration_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type smart_wallet_configuration_input = + Privy::SmartWalletConfigurationDisabled + | Privy::SmartWalletConfigurationInputEnabled + + module SmartWalletConfigurationInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::smart_wallet_configuration_input] + end + end +end diff --git a/sig/privy/models/smart_wallet_configuration_input_enabled.rbs b/sig/privy/models/smart_wallet_configuration_input_enabled.rbs new file mode 100644 index 0000000..98db8ef --- /dev/null +++ b/sig/privy/models/smart_wallet_configuration_input_enabled.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type smart_wallet_configuration_input_enabled = + { + configured_networks: ::Array[Privy::SmartWalletNetworkConfigurationInput], + enabled: Privy::Models::SmartWalletConfigurationInputEnabled::enabled, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String? + } + + class SmartWalletConfigurationInputEnabled < Privy::Internal::Type::BaseModel + attr_accessor configured_networks: ::Array[Privy::SmartWalletNetworkConfigurationInput] + + attr_accessor enabled: Privy::Models::SmartWalletConfigurationInputEnabled::enabled + + attr_accessor smart_wallet_type: Privy::Models::smart_wallet_type + + attr_accessor smart_wallet_version: String? + + def initialize: ( + configured_networks: ::Array[Privy::SmartWalletNetworkConfigurationInput], + enabled: Privy::Models::SmartWalletConfigurationInputEnabled::enabled, + smart_wallet_type: Privy::Models::smart_wallet_type, + ?smart_wallet_version: String? + ) -> void + + def to_hash: -> { + configured_networks: ::Array[Privy::SmartWalletNetworkConfigurationInput], + enabled: Privy::Models::SmartWalletConfigurationInputEnabled::enabled, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String? + } + + type enabled = true + + module Enabled + extend Privy::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[Privy::Models::SmartWalletConfigurationInputEnabled::enabled] + end + end + end +end diff --git a/sig/privy/models/smart_wallet_network_configuration.rbs b/sig/privy/models/smart_wallet_network_configuration.rbs new file mode 100644 index 0000000..ff451b5 --- /dev/null +++ b/sig/privy/models/smart_wallet_network_configuration.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type smart_wallet_network_configuration = + { + bundler_url: String, + chain_id: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext, + paymaster_url: String, + rpc_url: String + } + + class SmartWalletNetworkConfiguration < Privy::Internal::Type::BaseModel + attr_accessor bundler_url: String + + attr_accessor chain_id: String + + attr_reader chain_name: String? + + def chain_name=: (String) -> String + + attr_reader paymaster_context: Privy::AlchemyPaymasterContext? + + def paymaster_context=: ( + Privy::AlchemyPaymasterContext + ) -> Privy::AlchemyPaymasterContext + + attr_reader paymaster_url: String? + + def paymaster_url=: (String) -> String + + attr_reader rpc_url: String? + + def rpc_url=: (String) -> String + + def initialize: ( + bundler_url: String, + chain_id: String, + ?chain_name: String, + ?paymaster_context: Privy::AlchemyPaymasterContext, + ?paymaster_url: String, + ?rpc_url: String + ) -> void + + def to_hash: -> { + bundler_url: String, + chain_id: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext, + paymaster_url: String, + rpc_url: String + } + end + end +end diff --git a/sig/privy/models/smart_wallet_network_configuration_input.rbs b/sig/privy/models/smart_wallet_network_configuration_input.rbs new file mode 100644 index 0000000..c629294 --- /dev/null +++ b/sig/privy/models/smart_wallet_network_configuration_input.rbs @@ -0,0 +1,57 @@ +module Privy + module Models + type smart_wallet_network_configuration_input = + { + chain_id: String, + bundler_url: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext, + paymaster_url: String, + rpc_url: String + } + + class SmartWalletNetworkConfigurationInput < Privy::Internal::Type::BaseModel + attr_accessor chain_id: String + + attr_reader bundler_url: String? + + def bundler_url=: (String) -> String + + attr_reader chain_name: String? + + def chain_name=: (String) -> String + + attr_reader paymaster_context: Privy::AlchemyPaymasterContext? + + def paymaster_context=: ( + Privy::AlchemyPaymasterContext + ) -> Privy::AlchemyPaymasterContext + + attr_reader paymaster_url: String? + + def paymaster_url=: (String) -> String + + attr_reader rpc_url: String? + + def rpc_url=: (String) -> String + + def initialize: ( + chain_id: String, + ?bundler_url: String, + ?chain_name: String, + ?paymaster_context: Privy::AlchemyPaymasterContext, + ?paymaster_url: String, + ?rpc_url: String + ) -> void + + def to_hash: -> { + chain_id: String, + bundler_url: String, + chain_name: String, + paymaster_context: Privy::AlchemyPaymasterContext, + paymaster_url: String, + rpc_url: String + } + end + end +end diff --git a/sig/privy/models/smart_wallet_siwe_input.rbs b/sig/privy/models/smart_wallet_siwe_input.rbs new file mode 100644 index 0000000..0b612d1 --- /dev/null +++ b/sig/privy/models/smart_wallet_siwe_input.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type smart_wallet_siwe_input = + { + message: String, + signature: String, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String + } + + class SmartWalletSiweInput < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_accessor signature: String + + attr_accessor smart_wallet_type: Privy::Models::smart_wallet_type + + attr_reader smart_wallet_version: String? + + def smart_wallet_version=: (String) -> String + + def initialize: ( + message: String, + signature: String, + smart_wallet_type: Privy::Models::smart_wallet_type, + ?smart_wallet_version: String + ) -> void + + def to_hash: -> { + message: String, + signature: String, + smart_wallet_type: Privy::Models::smart_wallet_type, + smart_wallet_version: String + } + end + end +end diff --git a/sig/privy/models/smart_wallet_type.rbs b/sig/privy/models/smart_wallet_type.rbs new file mode 100644 index 0000000..2e53c06 --- /dev/null +++ b/sig/privy/models/smart_wallet_type.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type smart_wallet_type = + :safe + | :kernel + | :light_account + | :biconomy + | :coinbase_smart_wallet + | :thirdweb + | :nexus + + module SmartWalletType + extend Privy::Internal::Type::Enum + + SAFE: :safe + KERNEL: :kernel + LIGHT_ACCOUNT: :light_account + BICONOMY: :biconomy + COINBASE_SMART_WALLET: :coinbase_smart_wallet + THIRDWEB: :thirdweb + NEXUS: :nexus + + def self?.values: -> ::Array[Privy::Models::smart_wallet_type] + end + end +end diff --git a/sig/privy/models/sms_mfa_method.rbs b/sig/privy/models/sms_mfa_method.rbs new file mode 100644 index 0000000..ffffbf6 --- /dev/null +++ b/sig/privy/models/sms_mfa_method.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type sms_mfa_method = + { type: Privy::Models::SMSMfaMethod::type_, verified_at: Float } + + class SMSMfaMethod < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::SMSMfaMethod::type_ + + attr_accessor verified_at: Float + + def initialize: ( + type: Privy::Models::SMSMfaMethod::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + type: Privy::Models::SMSMfaMethod::type_, + verified_at: Float + } + + type type_ = :sms + + module Type + extend Privy::Internal::Type::Enum + + SMS: :sms + + def self?.values: -> ::Array[Privy::Models::SMSMfaMethod::type_] + end + end + end +end diff --git a/sig/privy/models/solana_program_instruction_condition.rbs b/sig/privy/models/solana_program_instruction_condition.rbs new file mode 100644 index 0000000..ffe4be3 --- /dev/null +++ b/sig/privy/models/solana_program_instruction_condition.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type solana_program_instruction_condition = + { + field: Privy::Models::SolanaProgramInstructionCondition::field, + field_source: Privy::Models::SolanaProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class SolanaProgramInstructionCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::SolanaProgramInstructionCondition::field + + attr_accessor field_source: Privy::Models::SolanaProgramInstructionCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::SolanaProgramInstructionCondition::field, + field_source: Privy::Models::SolanaProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::SolanaProgramInstructionCondition::field, + field_source: Privy::Models::SolanaProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = :programId + + module Field + extend Privy::Internal::Type::Enum + + PROGRAM_ID: :programId + + def self?.values: -> ::Array[Privy::Models::SolanaProgramInstructionCondition::field] + end + + type field_source = :solana_program_instruction + + module FieldSource + extend Privy::Internal::Type::Enum + + SOLANA_PROGRAM_INSTRUCTION: :solana_program_instruction + + def self?.values: -> ::Array[Privy::Models::SolanaProgramInstructionCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/solana_rpc_input.rbs b/sig/privy/models/solana_rpc_input.rbs new file mode 100644 index 0000000..cb466f6 --- /dev/null +++ b/sig/privy/models/solana_rpc_input.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type solana_rpc_input = + Privy::SolanaSignTransactionRpcInput + | Privy::SolanaSignAndSendTransactionRpcInput + | Privy::SolanaSignMessageRpcInput + + module SolanaRpcInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::solana_rpc_input] + end + end +end diff --git a/sig/privy/models/solana_rpc_response.rbs b/sig/privy/models/solana_rpc_response.rbs new file mode 100644 index 0000000..aef9c9f --- /dev/null +++ b/sig/privy/models/solana_rpc_response.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type solana_rpc_response = + Privy::SolanaSignMessageRpcResponse + | Privy::SolanaSignTransactionRpcResponse + | Privy::SolanaSignAndSendTransactionRpcResponse + + module SolanaRpcResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::solana_rpc_response] + end + end +end diff --git a/sig/privy/models/solana_sign_and_send_transaction_rpc_input.rbs b/sig/privy/models/solana_sign_and_send_transaction_rpc_input.rbs new file mode 100644 index 0000000..b94bb91 --- /dev/null +++ b/sig/privy/models/solana_sign_and_send_transaction_rpc_input.rbs @@ -0,0 +1,94 @@ +module Privy + module Models + type solana_sign_and_send_transaction_rpc_input = + { + :caip2 => String, + method_: Privy::Models::SolanaSignAndSendTransactionRpcInput::method_, + params: Privy::SolanaSignAndSendTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::SolanaSignAndSendTransactionRpcInput::chain_type, + optimistic_broadcast: bool, + reference_id: String, + sponsor: bool, + wallet_id: String + } + + class SolanaSignAndSendTransactionRpcInput < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor method_: Privy::Models::SolanaSignAndSendTransactionRpcInput::method_ + + attr_accessor params: Privy::SolanaSignAndSendTransactionRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::SolanaSignAndSendTransactionRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::SolanaSignAndSendTransactionRpcInput::chain_type + ) -> Privy::Models::SolanaSignAndSendTransactionRpcInput::chain_type + + attr_reader optimistic_broadcast: bool? + + def optimistic_broadcast=: (bool) -> bool + + attr_reader reference_id: String? + + def reference_id=: (String) -> String + + attr_reader sponsor: bool? + + def sponsor=: (bool) -> bool + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + caip2: String, + method_: Privy::Models::SolanaSignAndSendTransactionRpcInput::method_, + params: Privy::SolanaSignAndSendTransactionRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::SolanaSignAndSendTransactionRpcInput::chain_type, + ?optimistic_broadcast: bool, + ?reference_id: String, + ?sponsor: bool, + ?wallet_id: String + ) -> void + + def to_hash: -> { + :caip2 => String, + method_: Privy::Models::SolanaSignAndSendTransactionRpcInput::method_, + params: Privy::SolanaSignAndSendTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::SolanaSignAndSendTransactionRpcInput::chain_type, + optimistic_broadcast: bool, + reference_id: String, + sponsor: bool, + wallet_id: String + } + + type method_ = :signAndSendTransaction + + module Method + extend Privy::Internal::Type::Enum + + SIGN_AND_SEND_TRANSACTION: :signAndSendTransaction + + def self?.values: -> ::Array[Privy::Models::SolanaSignAndSendTransactionRpcInput::method_] + end + + type chain_type = :solana + + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::SolanaSignAndSendTransactionRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/solana_sign_and_send_transaction_rpc_input_params.rbs b/sig/privy/models/solana_sign_and_send_transaction_rpc_input_params.rbs new file mode 100644 index 0000000..e8152bc --- /dev/null +++ b/sig/privy/models/solana_sign_and_send_transaction_rpc_input_params.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_and_send_transaction_rpc_input_params = + { + encoding: Privy::Models::SolanaSignAndSendTransactionRpcInputParams::encoding, + transaction: String + } + + class SolanaSignAndSendTransactionRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::SolanaSignAndSendTransactionRpcInputParams::encoding + + attr_accessor transaction: String + + def initialize: ( + encoding: Privy::Models::SolanaSignAndSendTransactionRpcInputParams::encoding, + transaction: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::SolanaSignAndSendTransactionRpcInputParams::encoding, + transaction: String + } + + type encoding = :base64 + + module Encoding + extend Privy::Internal::Type::Enum + + BASE64: :base64 + + def self?.values: -> ::Array[Privy::Models::SolanaSignAndSendTransactionRpcInputParams::encoding] + end + end + end +end diff --git a/sig/privy/models/solana_sign_and_send_transaction_rpc_response.rbs b/sig/privy/models/solana_sign_and_send_transaction_rpc_response.rbs new file mode 100644 index 0000000..9ce22ef --- /dev/null +++ b/sig/privy/models/solana_sign_and_send_transaction_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_and_send_transaction_rpc_response = + { + data: Privy::SolanaSignAndSendTransactionRpcResponseData, + method_: Privy::Models::SolanaSignAndSendTransactionRpcResponse::method_ + } + + class SolanaSignAndSendTransactionRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::SolanaSignAndSendTransactionRpcResponseData + + attr_accessor method_: Privy::Models::SolanaSignAndSendTransactionRpcResponse::method_ + + def initialize: ( + data: Privy::SolanaSignAndSendTransactionRpcResponseData, + method_: Privy::Models::SolanaSignAndSendTransactionRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::SolanaSignAndSendTransactionRpcResponseData, + method_: Privy::Models::SolanaSignAndSendTransactionRpcResponse::method_ + } + + type method_ = :signAndSendTransaction + + module Method + extend Privy::Internal::Type::Enum + + SIGN_AND_SEND_TRANSACTION: :signAndSendTransaction + + def self?.values: -> ::Array[Privy::Models::SolanaSignAndSendTransactionRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/solana_sign_and_send_transaction_rpc_response_data.rbs b/sig/privy/models/solana_sign_and_send_transaction_rpc_response_data.rbs new file mode 100644 index 0000000..62865ac --- /dev/null +++ b/sig/privy/models/solana_sign_and_send_transaction_rpc_response_data.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type solana_sign_and_send_transaction_rpc_response_data = + { + :caip2 => String, + hash_: String, + reference_id: String?, + signed_transaction: String, + transaction_id: String + } + + class SolanaSignAndSendTransactionRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor hash_: String + + attr_accessor reference_id: String? + + attr_reader signed_transaction: String? + + def signed_transaction=: (String) -> String + + attr_reader transaction_id: String? + + def transaction_id=: (String) -> String + + def initialize: ( + caip2: String, + hash_: String, + ?reference_id: String?, + ?signed_transaction: String, + ?transaction_id: String + ) -> void + + def to_hash: -> { + :caip2 => String, + hash_: String, + reference_id: String?, + signed_transaction: String, + transaction_id: String + } + end + end +end diff --git a/sig/privy/models/solana_sign_message_rpc_input.rbs b/sig/privy/models/solana_sign_message_rpc_input.rbs new file mode 100644 index 0000000..8c838f4 --- /dev/null +++ b/sig/privy/models/solana_sign_message_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type solana_sign_message_rpc_input = + { + method_: Privy::Models::SolanaSignMessageRpcInput::method_, + params: Privy::SolanaSignMessageRpcInputParams, + address: String, + chain_type: Privy::Models::SolanaSignMessageRpcInput::chain_type, + wallet_id: String + } + + class SolanaSignMessageRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SolanaSignMessageRpcInput::method_ + + attr_accessor params: Privy::SolanaSignMessageRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::SolanaSignMessageRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::SolanaSignMessageRpcInput::chain_type + ) -> Privy::Models::SolanaSignMessageRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::SolanaSignMessageRpcInput::method_, + params: Privy::SolanaSignMessageRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::SolanaSignMessageRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::SolanaSignMessageRpcInput::method_, + params: Privy::SolanaSignMessageRpcInputParams, + address: String, + chain_type: Privy::Models::SolanaSignMessageRpcInput::chain_type, + wallet_id: String + } + + type method_ = :signMessage + + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE: :signMessage + + def self?.values: -> ::Array[Privy::Models::SolanaSignMessageRpcInput::method_] + end + + type chain_type = :solana + + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::SolanaSignMessageRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/solana_sign_message_rpc_input_params.rbs b/sig/privy/models/solana_sign_message_rpc_input_params.rbs new file mode 100644 index 0000000..78c8fa1 --- /dev/null +++ b/sig/privy/models/solana_sign_message_rpc_input_params.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_message_rpc_input_params = + { + encoding: Privy::Models::SolanaSignMessageRpcInputParams::encoding, + message: String + } + + class SolanaSignMessageRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::SolanaSignMessageRpcInputParams::encoding + + attr_accessor message: String + + def initialize: ( + encoding: Privy::Models::SolanaSignMessageRpcInputParams::encoding, + message: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::SolanaSignMessageRpcInputParams::encoding, + message: String + } + + type encoding = :base64 + + module Encoding + extend Privy::Internal::Type::Enum + + BASE64: :base64 + + def self?.values: -> ::Array[Privy::Models::SolanaSignMessageRpcInputParams::encoding] + end + end + end +end diff --git a/sig/privy/models/solana_sign_message_rpc_response.rbs b/sig/privy/models/solana_sign_message_rpc_response.rbs new file mode 100644 index 0000000..b933fd6 --- /dev/null +++ b/sig/privy/models/solana_sign_message_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_message_rpc_response = + { + data: Privy::SolanaSignMessageRpcResponseData, + method_: Privy::Models::SolanaSignMessageRpcResponse::method_ + } + + class SolanaSignMessageRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::SolanaSignMessageRpcResponseData + + attr_accessor method_: Privy::Models::SolanaSignMessageRpcResponse::method_ + + def initialize: ( + data: Privy::SolanaSignMessageRpcResponseData, + method_: Privy::Models::SolanaSignMessageRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::SolanaSignMessageRpcResponseData, + method_: Privy::Models::SolanaSignMessageRpcResponse::method_ + } + + type method_ = :signMessage + + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE: :signMessage + + def self?.values: -> ::Array[Privy::Models::SolanaSignMessageRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/solana_sign_message_rpc_response_data.rbs b/sig/privy/models/solana_sign_message_rpc_response_data.rbs new file mode 100644 index 0000000..fe27746 --- /dev/null +++ b/sig/privy/models/solana_sign_message_rpc_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_message_rpc_response_data = + { + encoding: Privy::Models::SolanaSignMessageRpcResponseData::encoding, + signature: String + } + + class SolanaSignMessageRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::SolanaSignMessageRpcResponseData::encoding + + attr_accessor signature: String + + def initialize: ( + encoding: Privy::Models::SolanaSignMessageRpcResponseData::encoding, + signature: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::SolanaSignMessageRpcResponseData::encoding, + signature: String + } + + type encoding = :base64 + + module Encoding + extend Privy::Internal::Type::Enum + + BASE64: :base64 + + def self?.values: -> ::Array[Privy::Models::SolanaSignMessageRpcResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/solana_sign_transaction_rpc_input.rbs b/sig/privy/models/solana_sign_transaction_rpc_input.rbs new file mode 100644 index 0000000..12edeeb --- /dev/null +++ b/sig/privy/models/solana_sign_transaction_rpc_input.rbs @@ -0,0 +1,68 @@ +module Privy + module Models + type solana_sign_transaction_rpc_input = + { + method_: Privy::Models::SolanaSignTransactionRpcInput::method_, + params: Privy::SolanaSignTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::SolanaSignTransactionRpcInput::chain_type, + wallet_id: String + } + + class SolanaSignTransactionRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SolanaSignTransactionRpcInput::method_ + + attr_accessor params: Privy::SolanaSignTransactionRpcInputParams + + attr_reader address: String? + + def address=: (String) -> String + + attr_reader chain_type: Privy::Models::SolanaSignTransactionRpcInput::chain_type? + + def chain_type=: ( + Privy::Models::SolanaSignTransactionRpcInput::chain_type + ) -> Privy::Models::SolanaSignTransactionRpcInput::chain_type + + attr_reader wallet_id: String? + + def wallet_id=: (String) -> String + + def initialize: ( + method_: Privy::Models::SolanaSignTransactionRpcInput::method_, + params: Privy::SolanaSignTransactionRpcInputParams, + ?address: String, + ?chain_type: Privy::Models::SolanaSignTransactionRpcInput::chain_type, + ?wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::SolanaSignTransactionRpcInput::method_, + params: Privy::SolanaSignTransactionRpcInputParams, + address: String, + chain_type: Privy::Models::SolanaSignTransactionRpcInput::chain_type, + wallet_id: String + } + + type method_ = :signTransaction + + module Method + extend Privy::Internal::Type::Enum + + SIGN_TRANSACTION: :signTransaction + + def self?.values: -> ::Array[Privy::Models::SolanaSignTransactionRpcInput::method_] + end + + type chain_type = :solana + + module ChainType + extend Privy::Internal::Type::Enum + + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::SolanaSignTransactionRpcInput::chain_type] + end + end + end +end diff --git a/sig/privy/models/solana_sign_transaction_rpc_input_params.rbs b/sig/privy/models/solana_sign_transaction_rpc_input_params.rbs new file mode 100644 index 0000000..2e1df42 --- /dev/null +++ b/sig/privy/models/solana_sign_transaction_rpc_input_params.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_transaction_rpc_input_params = + { + encoding: Privy::Models::SolanaSignTransactionRpcInputParams::encoding, + transaction: String + } + + class SolanaSignTransactionRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::SolanaSignTransactionRpcInputParams::encoding + + attr_accessor transaction: String + + def initialize: ( + encoding: Privy::Models::SolanaSignTransactionRpcInputParams::encoding, + transaction: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::SolanaSignTransactionRpcInputParams::encoding, + transaction: String + } + + type encoding = :base64 + + module Encoding + extend Privy::Internal::Type::Enum + + BASE64: :base64 + + def self?.values: -> ::Array[Privy::Models::SolanaSignTransactionRpcInputParams::encoding] + end + end + end +end diff --git a/sig/privy/models/solana_sign_transaction_rpc_response.rbs b/sig/privy/models/solana_sign_transaction_rpc_response.rbs new file mode 100644 index 0000000..ab3fbb6 --- /dev/null +++ b/sig/privy/models/solana_sign_transaction_rpc_response.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_transaction_rpc_response = + { + data: Privy::SolanaSignTransactionRpcResponseData, + method_: Privy::Models::SolanaSignTransactionRpcResponse::method_ + } + + class SolanaSignTransactionRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor data: Privy::SolanaSignTransactionRpcResponseData + + attr_accessor method_: Privy::Models::SolanaSignTransactionRpcResponse::method_ + + def initialize: ( + data: Privy::SolanaSignTransactionRpcResponseData, + method_: Privy::Models::SolanaSignTransactionRpcResponse::method_ + ) -> void + + def to_hash: -> { + data: Privy::SolanaSignTransactionRpcResponseData, + method_: Privy::Models::SolanaSignTransactionRpcResponse::method_ + } + + type method_ = :signTransaction + + module Method + extend Privy::Internal::Type::Enum + + SIGN_TRANSACTION: :signTransaction + + def self?.values: -> ::Array[Privy::Models::SolanaSignTransactionRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/solana_sign_transaction_rpc_response_data.rbs b/sig/privy/models/solana_sign_transaction_rpc_response_data.rbs new file mode 100644 index 0000000..c23c9b8 --- /dev/null +++ b/sig/privy/models/solana_sign_transaction_rpc_response_data.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type solana_sign_transaction_rpc_response_data = + { + encoding: Privy::Models::SolanaSignTransactionRpcResponseData::encoding, + signed_transaction: String + } + + class SolanaSignTransactionRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor encoding: Privy::Models::SolanaSignTransactionRpcResponseData::encoding + + attr_accessor signed_transaction: String + + def initialize: ( + encoding: Privy::Models::SolanaSignTransactionRpcResponseData::encoding, + signed_transaction: String + ) -> void + + def to_hash: -> { + encoding: Privy::Models::SolanaSignTransactionRpcResponseData::encoding, + signed_transaction: String + } + + type encoding = :base64 + + module Encoding + extend Privy::Internal::Type::Enum + + BASE64: :base64 + + def self?.values: -> ::Array[Privy::Models::SolanaSignTransactionRpcResponseData::encoding] + end + end + end +end diff --git a/sig/privy/models/solana_system_program_instruction_condition.rbs b/sig/privy/models/solana_system_program_instruction_condition.rbs new file mode 100644 index 0000000..3d22421 --- /dev/null +++ b/sig/privy/models/solana_system_program_instruction_condition.rbs @@ -0,0 +1,62 @@ +module Privy + module Models + type solana_system_program_instruction_condition = + { + field: Privy::Models::SolanaSystemProgramInstructionCondition::field, + field_source: Privy::Models::SolanaSystemProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class SolanaSystemProgramInstructionCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::SolanaSystemProgramInstructionCondition::field + + attr_accessor field_source: Privy::Models::SolanaSystemProgramInstructionCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::SolanaSystemProgramInstructionCondition::field, + field_source: Privy::Models::SolanaSystemProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::SolanaSystemProgramInstructionCondition::field, + field_source: Privy::Models::SolanaSystemProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = + :instructionName + | :"Transfer.from" + | :"Transfer.to" + | :"Transfer.lamports" + + module Field + extend Privy::Internal::Type::Enum + + INSTRUCTION_NAME: :instructionName + TRANSFER_FROM: :"Transfer.from" + TRANSFER_TO: :"Transfer.to" + TRANSFER_LAMPORTS: :"Transfer.lamports" + + def self?.values: -> ::Array[Privy::Models::SolanaSystemProgramInstructionCondition::field] + end + + type field_source = :solana_system_program_instruction + + module FieldSource + extend Privy::Internal::Type::Enum + + SOLANA_SYSTEM_PROGRAM_INSTRUCTION: :solana_system_program_instruction + + def self?.values: -> ::Array[Privy::Models::SolanaSystemProgramInstructionCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/solana_token_program_instruction_condition.rbs b/sig/privy/models/solana_token_program_instruction_condition.rbs new file mode 100644 index 0000000..6b4daf7 --- /dev/null +++ b/sig/privy/models/solana_token_program_instruction_condition.rbs @@ -0,0 +1,102 @@ +module Privy + module Models + type solana_token_program_instruction_condition = + { + field: Privy::Models::SolanaTokenProgramInstructionCondition::field, + field_source: Privy::Models::SolanaTokenProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class SolanaTokenProgramInstructionCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::SolanaTokenProgramInstructionCondition::field + + attr_accessor field_source: Privy::Models::SolanaTokenProgramInstructionCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::SolanaTokenProgramInstructionCondition::field, + field_source: Privy::Models::SolanaTokenProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::SolanaTokenProgramInstructionCondition::field, + field_source: Privy::Models::SolanaTokenProgramInstructionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = + :instructionName + | :"Transfer.source" + | :"Transfer.destination" + | :"Transfer.authority" + | :"Transfer.amount" + | :"TransferChecked.source" + | :"TransferChecked.destination" + | :"TransferChecked.authority" + | :"TransferChecked.amount" + | :"TransferChecked.mint" + | :"Burn.account" + | :"Burn.mint" + | :"Burn.authority" + | :"Burn.amount" + | :"MintTo.mint" + | :"MintTo.account" + | :"MintTo.authority" + | :"MintTo.amount" + | :"CloseAccount.account" + | :"CloseAccount.destination" + | :"CloseAccount.authority" + | :"InitializeAccount3.account" + | :"InitializeAccount3.mint" + | :"InitializeAccount3.owner" + + module Field + extend Privy::Internal::Type::Enum + + INSTRUCTION_NAME: :instructionName + TRANSFER_SOURCE: :"Transfer.source" + TRANSFER_DESTINATION: :"Transfer.destination" + TRANSFER_AUTHORITY: :"Transfer.authority" + TRANSFER_AMOUNT: :"Transfer.amount" + TRANSFER_CHECKED_SOURCE: :"TransferChecked.source" + TRANSFER_CHECKED_DESTINATION: :"TransferChecked.destination" + TRANSFER_CHECKED_AUTHORITY: :"TransferChecked.authority" + TRANSFER_CHECKED_AMOUNT: :"TransferChecked.amount" + TRANSFER_CHECKED_MINT: :"TransferChecked.mint" + BURN_ACCOUNT: :"Burn.account" + BURN_MINT: :"Burn.mint" + BURN_AUTHORITY: :"Burn.authority" + BURN_AMOUNT: :"Burn.amount" + MINT_TO_MINT: :"MintTo.mint" + MINT_TO_ACCOUNT: :"MintTo.account" + MINT_TO_AUTHORITY: :"MintTo.authority" + MINT_TO_AMOUNT: :"MintTo.amount" + CLOSE_ACCOUNT_ACCOUNT: :"CloseAccount.account" + CLOSE_ACCOUNT_DESTINATION: :"CloseAccount.destination" + CLOSE_ACCOUNT_AUTHORITY: :"CloseAccount.authority" + INITIALIZE_ACCOUNT3_ACCOUNT: :"InitializeAccount3.account" + INITIALIZE_ACCOUNT3_MINT: :"InitializeAccount3.mint" + INITIALIZE_ACCOUNT3_OWNER: :"InitializeAccount3.owner" + + def self?.values: -> ::Array[Privy::Models::SolanaTokenProgramInstructionCondition::field] + end + + type field_source = :solana_token_program_instruction + + module FieldSource + extend Privy::Internal::Type::Enum + + SOLANA_TOKEN_PROGRAM_INSTRUCTION: :solana_token_program_instruction + + def self?.values: -> ::Array[Privy::Models::SolanaTokenProgramInstructionCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/solana_wallet_derivation_strategy.rbs b/sig/privy/models/solana_wallet_derivation_strategy.rbs new file mode 100644 index 0000000..41dfc77 --- /dev/null +++ b/sig/privy/models/solana_wallet_derivation_strategy.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type solana_wallet_derivation_strategy = + :ENTROPY_TO_SEED | :ENTROPY_TO_MNEMONIC_TO_SEED + + module SolanaWalletDerivationStrategy + extend Privy::Internal::Type::Enum + + ENTROPY_TO_SEED: :ENTROPY_TO_SEED + ENTROPY_TO_MNEMONIC_TO_SEED: :ENTROPY_TO_MNEMONIC_TO_SEED + + def self?.values: -> ::Array[Privy::Models::solana_wallet_derivation_strategy] + end + end +end diff --git a/sig/privy/models/spark_balance.rbs b/sig/privy/models/spark_balance.rbs new file mode 100644 index 0000000..d625791 --- /dev/null +++ b/sig/privy/models/spark_balance.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + type spark_balance = + { + balance: String, + token_balances: ::Hash[Symbol, Privy::SparkTokenBalance] + } + + class SparkBalance < Privy::Internal::Type::BaseModel + attr_accessor balance: String + + attr_accessor token_balances: ::Hash[Symbol, Privy::SparkTokenBalance] + + def initialize: ( + balance: String, + token_balances: ::Hash[Symbol, Privy::SparkTokenBalance] + ) -> void + + def to_hash: -> { + balance: String, + token_balances: ::Hash[Symbol, Privy::SparkTokenBalance] + } + end + end +end diff --git a/sig/privy/models/spark_claim_static_deposit_rpc_input.rbs b/sig/privy/models/spark_claim_static_deposit_rpc_input.rbs new file mode 100644 index 0000000..54e4e1d --- /dev/null +++ b/sig/privy/models/spark_claim_static_deposit_rpc_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type spark_claim_static_deposit_rpc_input = + { + method_: Privy::Models::SparkClaimStaticDepositRpcInput::method_, + params: Privy::SparkClaimStaticDepositRpcInputParams, + network: Privy::Models::spark_network + } + + class SparkClaimStaticDepositRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkClaimStaticDepositRpcInput::method_ + + attr_accessor params: Privy::SparkClaimStaticDepositRpcInputParams + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkClaimStaticDepositRpcInput::method_, + params: Privy::SparkClaimStaticDepositRpcInputParams, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkClaimStaticDepositRpcInput::method_, + params: Privy::SparkClaimStaticDepositRpcInputParams, + network: Privy::Models::spark_network + } + + type method_ = :claimStaticDeposit + + module Method + extend Privy::Internal::Type::Enum + + CLAIM_STATIC_DEPOSIT: :claimStaticDeposit + + def self?.values: -> ::Array[Privy::Models::SparkClaimStaticDepositRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_claim_static_deposit_rpc_input_params.rbs b/sig/privy/models/spark_claim_static_deposit_rpc_input_params.rbs new file mode 100644 index 0000000..7a8d1a9 --- /dev/null +++ b/sig/privy/models/spark_claim_static_deposit_rpc_input_params.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type spark_claim_static_deposit_rpc_input_params = + { + credit_amount_sats: Float, + signature: String, + transaction_id: String, + output_index: Float + } + + class SparkClaimStaticDepositRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor credit_amount_sats: Float + + attr_accessor signature: String + + attr_accessor transaction_id: String + + attr_reader output_index: Float? + + def output_index=: (Float) -> Float + + def initialize: ( + credit_amount_sats: Float, + signature: String, + transaction_id: String, + ?output_index: Float + ) -> void + + def to_hash: -> { + credit_amount_sats: Float, + signature: String, + transaction_id: String, + output_index: Float + } + end + end +end diff --git a/sig/privy/models/spark_claim_static_deposit_rpc_response.rbs b/sig/privy/models/spark_claim_static_deposit_rpc_response.rbs new file mode 100644 index 0000000..fdb6a51 --- /dev/null +++ b/sig/privy/models/spark_claim_static_deposit_rpc_response.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_claim_static_deposit_rpc_response = + { + method_: Privy::Models::SparkClaimStaticDepositRpcResponse::method_, + data: Privy::SparkClaimStaticDepositRpcResponseData + } + + class SparkClaimStaticDepositRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkClaimStaticDepositRpcResponse::method_ + + attr_reader data: Privy::SparkClaimStaticDepositRpcResponseData? + + def data=: ( + Privy::SparkClaimStaticDepositRpcResponseData + ) -> Privy::SparkClaimStaticDepositRpcResponseData + + def initialize: ( + method_: Privy::Models::SparkClaimStaticDepositRpcResponse::method_, + ?data: Privy::SparkClaimStaticDepositRpcResponseData + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkClaimStaticDepositRpcResponse::method_, + data: Privy::SparkClaimStaticDepositRpcResponseData + } + + type method_ = :claimStaticDeposit + + module Method + extend Privy::Internal::Type::Enum + + CLAIM_STATIC_DEPOSIT: :claimStaticDeposit + + def self?.values: -> ::Array[Privy::Models::SparkClaimStaticDepositRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_claim_static_deposit_rpc_response_data.rbs b/sig/privy/models/spark_claim_static_deposit_rpc_response_data.rbs new file mode 100644 index 0000000..74b9d11 --- /dev/null +++ b/sig/privy/models/spark_claim_static_deposit_rpc_response_data.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type spark_claim_static_deposit_rpc_response_data = { transfer_id: String } + + class SparkClaimStaticDepositRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor transfer_id: String + + def initialize: (transfer_id: String) -> void + + def to_hash: -> { transfer_id: String } + end + end +end diff --git a/sig/privy/models/spark_create_lightning_invoice_rpc_input.rbs b/sig/privy/models/spark_create_lightning_invoice_rpc_input.rbs new file mode 100644 index 0000000..025c886 --- /dev/null +++ b/sig/privy/models/spark_create_lightning_invoice_rpc_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type spark_create_lightning_invoice_rpc_input = + { + method_: Privy::Models::SparkCreateLightningInvoiceRpcInput::method_, + params: Privy::SparkCreateLightningInvoiceRpcInputParams, + network: Privy::Models::spark_network + } + + class SparkCreateLightningInvoiceRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkCreateLightningInvoiceRpcInput::method_ + + attr_accessor params: Privy::SparkCreateLightningInvoiceRpcInputParams + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkCreateLightningInvoiceRpcInput::method_, + params: Privy::SparkCreateLightningInvoiceRpcInputParams, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkCreateLightningInvoiceRpcInput::method_, + params: Privy::SparkCreateLightningInvoiceRpcInputParams, + network: Privy::Models::spark_network + } + + type method_ = :createLightningInvoice + + module Method + extend Privy::Internal::Type::Enum + + CREATE_LIGHTNING_INVOICE: :createLightningInvoice + + def self?.values: -> ::Array[Privy::Models::SparkCreateLightningInvoiceRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_create_lightning_invoice_rpc_input_params.rbs b/sig/privy/models/spark_create_lightning_invoice_rpc_input_params.rbs new file mode 100644 index 0000000..500b0fd --- /dev/null +++ b/sig/privy/models/spark_create_lightning_invoice_rpc_input_params.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type spark_create_lightning_invoice_rpc_input_params = + { + amount_sats: Float, + description_hash: String, + expiry_seconds: Float, + include_spark_address: bool, + memo: String, + receiver_identity_pubkey: String + } + + class SparkCreateLightningInvoiceRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor amount_sats: Float + + attr_reader description_hash: String? + + def description_hash=: (String) -> String + + attr_reader expiry_seconds: Float? + + def expiry_seconds=: (Float) -> Float + + attr_reader include_spark_address: bool? + + def include_spark_address=: (bool) -> bool + + attr_reader memo: String? + + def memo=: (String) -> String + + attr_reader receiver_identity_pubkey: String? + + def receiver_identity_pubkey=: (String) -> String + + def initialize: ( + amount_sats: Float, + ?description_hash: String, + ?expiry_seconds: Float, + ?include_spark_address: bool, + ?memo: String, + ?receiver_identity_pubkey: String + ) -> void + + def to_hash: -> { + amount_sats: Float, + description_hash: String, + expiry_seconds: Float, + include_spark_address: bool, + memo: String, + receiver_identity_pubkey: String + } + end + end +end diff --git a/sig/privy/models/spark_create_lightning_invoice_rpc_response.rbs b/sig/privy/models/spark_create_lightning_invoice_rpc_response.rbs new file mode 100644 index 0000000..6bd94c8 --- /dev/null +++ b/sig/privy/models/spark_create_lightning_invoice_rpc_response.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_create_lightning_invoice_rpc_response = + { + method_: Privy::Models::SparkCreateLightningInvoiceRpcResponse::method_, + data: Privy::SparkLightningReceiveRequest + } + + class SparkCreateLightningInvoiceRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkCreateLightningInvoiceRpcResponse::method_ + + attr_reader data: Privy::SparkLightningReceiveRequest? + + def data=: ( + Privy::SparkLightningReceiveRequest + ) -> Privy::SparkLightningReceiveRequest + + def initialize: ( + method_: Privy::Models::SparkCreateLightningInvoiceRpcResponse::method_, + ?data: Privy::SparkLightningReceiveRequest + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkCreateLightningInvoiceRpcResponse::method_, + data: Privy::SparkLightningReceiveRequest + } + + type method_ = :createLightningInvoice + + module Method + extend Privy::Internal::Type::Enum + + CREATE_LIGHTNING_INVOICE: :createLightningInvoice + + def self?.values: -> ::Array[Privy::Models::SparkCreateLightningInvoiceRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_get_balance_rpc_input.rbs b/sig/privy/models/spark_get_balance_rpc_input.rbs new file mode 100644 index 0000000..9639a16 --- /dev/null +++ b/sig/privy/models/spark_get_balance_rpc_input.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_get_balance_rpc_input = + { + method_: Privy::Models::SparkGetBalanceRpcInput::method_, + network: Privy::Models::spark_network + } + + class SparkGetBalanceRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkGetBalanceRpcInput::method_ + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkGetBalanceRpcInput::method_, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkGetBalanceRpcInput::method_, + network: Privy::Models::spark_network + } + + type method_ = :getBalance + + module Method + extend Privy::Internal::Type::Enum + + GET_BALANCE: :getBalance + + def self?.values: -> ::Array[Privy::Models::SparkGetBalanceRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_get_balance_rpc_response.rbs b/sig/privy/models/spark_get_balance_rpc_response.rbs new file mode 100644 index 0000000..11e3751 --- /dev/null +++ b/sig/privy/models/spark_get_balance_rpc_response.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type spark_get_balance_rpc_response = + { + method_: Privy::Models::SparkGetBalanceRpcResponse::method_, + data: Privy::SparkBalance + } + + class SparkGetBalanceRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkGetBalanceRpcResponse::method_ + + attr_reader data: Privy::SparkBalance? + + def data=: (Privy::SparkBalance) -> Privy::SparkBalance + + def initialize: ( + method_: Privy::Models::SparkGetBalanceRpcResponse::method_, + ?data: Privy::SparkBalance + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkGetBalanceRpcResponse::method_, + data: Privy::SparkBalance + } + + type method_ = :getBalance + + module Method + extend Privy::Internal::Type::Enum + + GET_BALANCE: :getBalance + + def self?.values: -> ::Array[Privy::Models::SparkGetBalanceRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rbs b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rbs new file mode 100644 index 0000000..2989e6a --- /dev/null +++ b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type spark_get_claim_static_deposit_quote_rpc_input = + { + method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput::method_, + params: Privy::SparkGetClaimStaticDepositQuoteRpcInputParams, + network: Privy::Models::spark_network + } + + class SparkGetClaimStaticDepositQuoteRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput::method_ + + attr_accessor params: Privy::SparkGetClaimStaticDepositQuoteRpcInputParams + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput::method_, + params: Privy::SparkGetClaimStaticDepositQuoteRpcInputParams, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput::method_, + params: Privy::SparkGetClaimStaticDepositQuoteRpcInputParams, + network: Privy::Models::spark_network + } + + type method_ = :getClaimStaticDepositQuote + + module Method + extend Privy::Internal::Type::Enum + + GET_CLAIM_STATIC_DEPOSIT_QUOTE: :getClaimStaticDepositQuote + + def self?.values: -> ::Array[Privy::Models::SparkGetClaimStaticDepositQuoteRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rbs b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rbs new file mode 100644 index 0000000..5fa99a3 --- /dev/null +++ b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_input_params.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type spark_get_claim_static_deposit_quote_rpc_input_params = + { transaction_id: String, output_index: Float } + + class SparkGetClaimStaticDepositQuoteRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor transaction_id: String + + attr_reader output_index: Float? + + def output_index=: (Float) -> Float + + def initialize: (transaction_id: String, ?output_index: Float) -> void + + def to_hash: -> { transaction_id: String, output_index: Float } + end + end +end diff --git a/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rbs b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rbs new file mode 100644 index 0000000..4703ed1 --- /dev/null +++ b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_response.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_get_claim_static_deposit_quote_rpc_response = + { + method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse::method_, + data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData + } + + class SparkGetClaimStaticDepositQuoteRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse::method_ + + attr_reader data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData? + + def data=: ( + Privy::SparkGetClaimStaticDepositQuoteRpcResponseData + ) -> Privy::SparkGetClaimStaticDepositQuoteRpcResponseData + + def initialize: ( + method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse::method_, + ?data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse::method_, + data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData + } + + type method_ = :getClaimStaticDepositQuote + + module Method + extend Privy::Internal::Type::Enum + + GET_CLAIM_STATIC_DEPOSIT_QUOTE: :getClaimStaticDepositQuote + + def self?.values: -> ::Array[Privy::Models::SparkGetClaimStaticDepositQuoteRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rbs b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rbs new file mode 100644 index 0000000..a6b41a8 --- /dev/null +++ b/sig/privy/models/spark_get_claim_static_deposit_quote_rpc_response_data.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type spark_get_claim_static_deposit_quote_rpc_response_data = + { + credit_amount_sats: Float, + network: String, + output_index: Float, + signature: String, + transaction_id: String + } + + class SparkGetClaimStaticDepositQuoteRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor credit_amount_sats: Float + + attr_accessor network: String + + attr_accessor output_index: Float + + attr_accessor signature: String + + attr_accessor transaction_id: String + + def initialize: ( + credit_amount_sats: Float, + network: String, + output_index: Float, + signature: String, + transaction_id: String + ) -> void + + def to_hash: -> { + credit_amount_sats: Float, + network: String, + output_index: Float, + signature: String, + transaction_id: String + } + end + end +end diff --git a/sig/privy/models/spark_get_static_deposit_address_rpc_input.rbs b/sig/privy/models/spark_get_static_deposit_address_rpc_input.rbs new file mode 100644 index 0000000..a8a6414 --- /dev/null +++ b/sig/privy/models/spark_get_static_deposit_address_rpc_input.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_get_static_deposit_address_rpc_input = + { + method_: Privy::Models::SparkGetStaticDepositAddressRpcInput::method_, + network: Privy::Models::spark_network + } + + class SparkGetStaticDepositAddressRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkGetStaticDepositAddressRpcInput::method_ + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkGetStaticDepositAddressRpcInput::method_, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkGetStaticDepositAddressRpcInput::method_, + network: Privy::Models::spark_network + } + + type method_ = :getStaticDepositAddress + + module Method + extend Privy::Internal::Type::Enum + + GET_STATIC_DEPOSIT_ADDRESS: :getStaticDepositAddress + + def self?.values: -> ::Array[Privy::Models::SparkGetStaticDepositAddressRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_get_static_deposit_address_rpc_response.rbs b/sig/privy/models/spark_get_static_deposit_address_rpc_response.rbs new file mode 100644 index 0000000..bf1221b --- /dev/null +++ b/sig/privy/models/spark_get_static_deposit_address_rpc_response.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_get_static_deposit_address_rpc_response = + { + method_: Privy::Models::SparkGetStaticDepositAddressRpcResponse::method_, + data: Privy::SparkGetStaticDepositAddressRpcResponseData + } + + class SparkGetStaticDepositAddressRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkGetStaticDepositAddressRpcResponse::method_ + + attr_reader data: Privy::SparkGetStaticDepositAddressRpcResponseData? + + def data=: ( + Privy::SparkGetStaticDepositAddressRpcResponseData + ) -> Privy::SparkGetStaticDepositAddressRpcResponseData + + def initialize: ( + method_: Privy::Models::SparkGetStaticDepositAddressRpcResponse::method_, + ?data: Privy::SparkGetStaticDepositAddressRpcResponseData + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkGetStaticDepositAddressRpcResponse::method_, + data: Privy::SparkGetStaticDepositAddressRpcResponseData + } + + type method_ = :getStaticDepositAddress + + module Method + extend Privy::Internal::Type::Enum + + GET_STATIC_DEPOSIT_ADDRESS: :getStaticDepositAddress + + def self?.values: -> ::Array[Privy::Models::SparkGetStaticDepositAddressRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_get_static_deposit_address_rpc_response_data.rbs b/sig/privy/models/spark_get_static_deposit_address_rpc_response_data.rbs new file mode 100644 index 0000000..0b76e32 --- /dev/null +++ b/sig/privy/models/spark_get_static_deposit_address_rpc_response_data.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type spark_get_static_deposit_address_rpc_response_data = + { address: String } + + class SparkGetStaticDepositAddressRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor address: String + + def initialize: (address: String) -> void + + def to_hash: -> { address: String } + end + end +end diff --git a/sig/privy/models/spark_lightning_fee.rbs b/sig/privy/models/spark_lightning_fee.rbs new file mode 100644 index 0000000..6a6e224 --- /dev/null +++ b/sig/privy/models/spark_lightning_fee.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type spark_lightning_fee = { original_unit: String, original_value: Float } + + class SparkLightningFee < Privy::Internal::Type::BaseModel + attr_accessor original_unit: String + + attr_accessor original_value: Float + + def initialize: (original_unit: String, original_value: Float) -> void + + def to_hash: -> { original_unit: String, original_value: Float } + end + end +end diff --git a/sig/privy/models/spark_lightning_receive_request.rbs b/sig/privy/models/spark_lightning_receive_request.rbs new file mode 100644 index 0000000..86d6858 --- /dev/null +++ b/sig/privy/models/spark_lightning_receive_request.rbs @@ -0,0 +1,73 @@ +module Privy + module Models + type spark_lightning_receive_request = + { + id: String, + created_at: String, + network: String, + status: String, + typename: String, + updated_at: String, + invoice: top, + payment_preimage: String, + receiver_identity_public_key: String, + transfer: top + } + + class SparkLightningReceiveRequest < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: String + + attr_accessor network: String + + attr_accessor status: String + + attr_accessor typename: String + + attr_accessor updated_at: String + + attr_reader invoice: top? + + def invoice=: (top) -> top + + attr_reader payment_preimage: String? + + def payment_preimage=: (String) -> String + + attr_reader receiver_identity_public_key: String? + + def receiver_identity_public_key=: (String) -> String + + attr_reader transfer: top? + + def transfer=: (top) -> top + + def initialize: ( + id: String, + created_at: String, + network: String, + status: String, + typename: String, + updated_at: String, + ?invoice: top, + ?payment_preimage: String, + ?receiver_identity_public_key: String, + ?transfer: top + ) -> void + + def to_hash: -> { + id: String, + created_at: String, + network: String, + status: String, + typename: String, + updated_at: String, + invoice: top, + payment_preimage: String, + receiver_identity_public_key: String, + transfer: top + } + end + end +end diff --git a/sig/privy/models/spark_lightning_send_request.rbs b/sig/privy/models/spark_lightning_send_request.rbs new file mode 100644 index 0000000..12b855f --- /dev/null +++ b/sig/privy/models/spark_lightning_send_request.rbs @@ -0,0 +1,74 @@ +module Privy + module Models + type spark_lightning_send_request = + { + id: String, + created_at: String, + encoded_invoice: String, + fee: Privy::SparkLightningFee, + idempotency_key: String, + network: String, + status: String, + typename: String, + updated_at: String, + payment_preimage: String, + transfer: top + } + + class SparkLightningSendRequest < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: String + + attr_accessor encoded_invoice: String + + attr_accessor fee: Privy::SparkLightningFee + + attr_accessor idempotency_key: String + + attr_accessor network: String + + attr_accessor status: String + + attr_accessor typename: String + + attr_accessor updated_at: String + + attr_reader payment_preimage: String? + + def payment_preimage=: (String) -> String + + attr_reader transfer: top? + + def transfer=: (top) -> top + + def initialize: ( + id: String, + created_at: String, + encoded_invoice: String, + fee: Privy::SparkLightningFee, + idempotency_key: String, + network: String, + status: String, + typename: String, + updated_at: String, + ?payment_preimage: String, + ?transfer: top + ) -> void + + def to_hash: -> { + id: String, + created_at: String, + encoded_invoice: String, + fee: Privy::SparkLightningFee, + idempotency_key: String, + network: String, + status: String, + typename: String, + updated_at: String, + payment_preimage: String, + transfer: top + } + end + end +end diff --git a/sig/privy/models/spark_network.rbs b/sig/privy/models/spark_network.rbs new file mode 100644 index 0000000..a6cbca4 --- /dev/null +++ b/sig/privy/models/spark_network.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type spark_network = :MAINNET | :REGTEST + + module SparkNetwork + extend Privy::Internal::Type::Enum + + MAINNET: :MAINNET + REGTEST: :REGTEST + + def self?.values: -> ::Array[Privy::Models::spark_network] + end + end +end diff --git a/sig/privy/models/spark_output_selection_strategy.rbs b/sig/privy/models/spark_output_selection_strategy.rbs new file mode 100644 index 0000000..97c3d91 --- /dev/null +++ b/sig/privy/models/spark_output_selection_strategy.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type spark_output_selection_strategy = :SMALL_FIRST | :LARGE_FIRST + + module SparkOutputSelectionStrategy + extend Privy::Internal::Type::Enum + + SMALL_FIRST: :SMALL_FIRST + LARGE_FIRST: :LARGE_FIRST + + def self?.values: -> ::Array[Privy::Models::spark_output_selection_strategy] + end + end +end diff --git a/sig/privy/models/spark_pay_lightning_invoice_rpc_input.rbs b/sig/privy/models/spark_pay_lightning_invoice_rpc_input.rbs new file mode 100644 index 0000000..a6ed6a5 --- /dev/null +++ b/sig/privy/models/spark_pay_lightning_invoice_rpc_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type spark_pay_lightning_invoice_rpc_input = + { + method_: Privy::Models::SparkPayLightningInvoiceRpcInput::method_, + params: Privy::SparkPayLightningInvoiceRpcInputParams, + network: Privy::Models::spark_network + } + + class SparkPayLightningInvoiceRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkPayLightningInvoiceRpcInput::method_ + + attr_accessor params: Privy::SparkPayLightningInvoiceRpcInputParams + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkPayLightningInvoiceRpcInput::method_, + params: Privy::SparkPayLightningInvoiceRpcInputParams, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkPayLightningInvoiceRpcInput::method_, + params: Privy::SparkPayLightningInvoiceRpcInputParams, + network: Privy::Models::spark_network + } + + type method_ = :payLightningInvoice + + module Method + extend Privy::Internal::Type::Enum + + PAY_LIGHTNING_INVOICE: :payLightningInvoice + + def self?.values: -> ::Array[Privy::Models::SparkPayLightningInvoiceRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_pay_lightning_invoice_rpc_input_params.rbs b/sig/privy/models/spark_pay_lightning_invoice_rpc_input_params.rbs new file mode 100644 index 0000000..2e885f9 --- /dev/null +++ b/sig/privy/models/spark_pay_lightning_invoice_rpc_input_params.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_pay_lightning_invoice_rpc_input_params = + { + invoice: String, + max_fee_sats: Float, + amount_sats_to_send: Float, + prefer_spark: bool + } + + class SparkPayLightningInvoiceRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor invoice: String + + attr_accessor max_fee_sats: Float + + attr_reader amount_sats_to_send: Float? + + def amount_sats_to_send=: (Float) -> Float + + attr_reader prefer_spark: bool? + + def prefer_spark=: (bool) -> bool + + def initialize: ( + invoice: String, + max_fee_sats: Float, + ?amount_sats_to_send: Float, + ?prefer_spark: bool + ) -> void + + def to_hash: -> { + invoice: String, + max_fee_sats: Float, + amount_sats_to_send: Float, + prefer_spark: bool + } + end + end +end diff --git a/sig/privy/models/spark_pay_lightning_invoice_rpc_response.rbs b/sig/privy/models/spark_pay_lightning_invoice_rpc_response.rbs new file mode 100644 index 0000000..86e68ac --- /dev/null +++ b/sig/privy/models/spark_pay_lightning_invoice_rpc_response.rbs @@ -0,0 +1,47 @@ +module Privy + module Models + type spark_pay_lightning_invoice_rpc_response = + { + method_: Privy::Models::SparkPayLightningInvoiceRpcResponse::method_, + data: Privy::Models::SparkPayLightningInvoiceRpcResponse::data + } + + class SparkPayLightningInvoiceRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkPayLightningInvoiceRpcResponse::method_ + + attr_reader data: Privy::Models::SparkPayLightningInvoiceRpcResponse::data? + + def data=: ( + Privy::Models::SparkPayLightningInvoiceRpcResponse::data + ) -> Privy::Models::SparkPayLightningInvoiceRpcResponse::data + + def initialize: ( + method_: Privy::Models::SparkPayLightningInvoiceRpcResponse::method_, + ?data: Privy::Models::SparkPayLightningInvoiceRpcResponse::data + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkPayLightningInvoiceRpcResponse::method_, + data: Privy::Models::SparkPayLightningInvoiceRpcResponse::data + } + + type method_ = :payLightningInvoice + + module Method + extend Privy::Internal::Type::Enum + + PAY_LIGHTNING_INVOICE: :payLightningInvoice + + def self?.values: -> ::Array[Privy::Models::SparkPayLightningInvoiceRpcResponse::method_] + end + + type data = Privy::SparkTransfer | Privy::SparkLightningSendRequest + + module Data + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::SparkPayLightningInvoiceRpcResponse::data] + end + end + end +end diff --git a/sig/privy/models/spark_rpc_input.rbs b/sig/privy/models/spark_rpc_input.rbs new file mode 100644 index 0000000..f310825 --- /dev/null +++ b/sig/privy/models/spark_rpc_input.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type spark_rpc_input = + Privy::SparkTransferRpcInput + | Privy::SparkGetBalanceRpcInput + | Privy::SparkTransferTokensRpcInput + | Privy::SparkGetStaticDepositAddressRpcInput + | Privy::SparkGetClaimStaticDepositQuoteRpcInput + | Privy::SparkClaimStaticDepositRpcInput + | Privy::SparkCreateLightningInvoiceRpcInput + | Privy::SparkPayLightningInvoiceRpcInput + | Privy::SparkSignMessageWithIdentityKeyRpcInput + + module SparkRpcInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::spark_rpc_input] + end + end +end diff --git a/sig/privy/models/spark_rpc_response.rbs b/sig/privy/models/spark_rpc_response.rbs new file mode 100644 index 0000000..2e5627c --- /dev/null +++ b/sig/privy/models/spark_rpc_response.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type spark_rpc_response = + Privy::SparkTransferRpcResponse + | Privy::SparkGetBalanceRpcResponse + | Privy::SparkTransferTokensRpcResponse + | Privy::SparkGetStaticDepositAddressRpcResponse + | Privy::SparkGetClaimStaticDepositQuoteRpcResponse + | Privy::SparkClaimStaticDepositRpcResponse + | Privy::SparkCreateLightningInvoiceRpcResponse + | Privy::SparkPayLightningInvoiceRpcResponse + | Privy::SparkSignMessageWithIdentityKeyRpcResponse + + module SparkRpcResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::spark_rpc_response] + end + end +end diff --git a/sig/privy/models/spark_sign_message_with_identity_key_rpc_input.rbs b/sig/privy/models/spark_sign_message_with_identity_key_rpc_input.rbs new file mode 100644 index 0000000..e4c0bb4 --- /dev/null +++ b/sig/privy/models/spark_sign_message_with_identity_key_rpc_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type spark_sign_message_with_identity_key_rpc_input = + { + method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcInput::method_, + params: Privy::SparkSignMessageWithIdentityKeyRpcInputParams, + network: Privy::Models::spark_network + } + + class SparkSignMessageWithIdentityKeyRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcInput::method_ + + attr_accessor params: Privy::SparkSignMessageWithIdentityKeyRpcInputParams + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcInput::method_, + params: Privy::SparkSignMessageWithIdentityKeyRpcInputParams, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcInput::method_, + params: Privy::SparkSignMessageWithIdentityKeyRpcInputParams, + network: Privy::Models::spark_network + } + + type method_ = :signMessageWithIdentityKey + + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE_WITH_IDENTITY_KEY: :signMessageWithIdentityKey + + def self?.values: -> ::Array[Privy::Models::SparkSignMessageWithIdentityKeyRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rbs b/sig/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rbs new file mode 100644 index 0000000..cdae5d1 --- /dev/null +++ b/sig/privy/models/spark_sign_message_with_identity_key_rpc_input_params.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type spark_sign_message_with_identity_key_rpc_input_params = + { message: String, compact: bool } + + class SparkSignMessageWithIdentityKeyRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor message: String + + attr_reader compact: bool? + + def compact=: (bool) -> bool + + def initialize: (message: String, ?compact: bool) -> void + + def to_hash: -> { message: String, compact: bool } + end + end +end diff --git a/sig/privy/models/spark_sign_message_with_identity_key_rpc_response.rbs b/sig/privy/models/spark_sign_message_with_identity_key_rpc_response.rbs new file mode 100644 index 0000000..cb723cc --- /dev/null +++ b/sig/privy/models/spark_sign_message_with_identity_key_rpc_response.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_sign_message_with_identity_key_rpc_response = + { + method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse::method_, + data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData + } + + class SparkSignMessageWithIdentityKeyRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse::method_ + + attr_reader data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData? + + def data=: ( + Privy::SparkSignMessageWithIdentityKeyRpcResponseData + ) -> Privy::SparkSignMessageWithIdentityKeyRpcResponseData + + def initialize: ( + method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse::method_, + ?data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse::method_, + data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData + } + + type method_ = :signMessageWithIdentityKey + + module Method + extend Privy::Internal::Type::Enum + + SIGN_MESSAGE_WITH_IDENTITY_KEY: :signMessageWithIdentityKey + + def self?.values: -> ::Array[Privy::Models::SparkSignMessageWithIdentityKeyRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rbs b/sig/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rbs new file mode 100644 index 0000000..71d64a9 --- /dev/null +++ b/sig/privy/models/spark_sign_message_with_identity_key_rpc_response_data.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type spark_sign_message_with_identity_key_rpc_response_data = + { signature: String } + + class SparkSignMessageWithIdentityKeyRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor signature: String + + def initialize: (signature: String) -> void + + def to_hash: -> { signature: String } + end + end +end diff --git a/sig/privy/models/spark_signing_keyshare.rbs b/sig/privy/models/spark_signing_keyshare.rbs new file mode 100644 index 0000000..c185bd1 --- /dev/null +++ b/sig/privy/models/spark_signing_keyshare.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type spark_signing_keyshare = + { + owner_identifiers: ::Array[String], + public_key: String, + public_shares: ::Hash[Symbol, String], + threshold: Float, + updated_time: String + } + + class SparkSigningKeyshare < Privy::Internal::Type::BaseModel + attr_accessor owner_identifiers: ::Array[String] + + attr_accessor public_key: String + + attr_accessor public_shares: ::Hash[Symbol, String] + + attr_accessor threshold: Float + + attr_accessor updated_time: String + + def initialize: ( + owner_identifiers: ::Array[String], + public_key: String, + public_shares: ::Hash[Symbol, String], + threshold: Float, + updated_time: String + ) -> void + + def to_hash: -> { + owner_identifiers: ::Array[String], + public_key: String, + public_shares: ::Hash[Symbol, String], + threshold: Float, + updated_time: String + } + end + end +end diff --git a/sig/privy/models/spark_token_balance.rbs b/sig/privy/models/spark_token_balance.rbs new file mode 100644 index 0000000..25541bd --- /dev/null +++ b/sig/privy/models/spark_token_balance.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type spark_token_balance = + { balance: String, token_metadata: Privy::SparkUserTokenMetadata } + + class SparkTokenBalance < Privy::Internal::Type::BaseModel + attr_accessor balance: String + + attr_accessor token_metadata: Privy::SparkUserTokenMetadata + + def initialize: ( + balance: String, + token_metadata: Privy::SparkUserTokenMetadata + ) -> void + + def to_hash: -> { + balance: String, + token_metadata: Privy::SparkUserTokenMetadata + } + end + end +end diff --git a/sig/privy/models/spark_transfer.rbs b/sig/privy/models/spark_transfer.rbs new file mode 100644 index 0000000..1b65e7d --- /dev/null +++ b/sig/privy/models/spark_transfer.rbs @@ -0,0 +1,76 @@ +module Privy + module Models + type spark_transfer = + { + id: String, + leaves: ::Array[Privy::SparkTransferLeaf], + receiver_identity_public_key: String, + sender_identity_public_key: String, + status: String, + total_value: Float, + transfer_direction: String, + type: String, + created_time: String, + expiry_time: String, + updated_time: String + } + + class SparkTransfer < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor leaves: ::Array[Privy::SparkTransferLeaf] + + attr_accessor receiver_identity_public_key: String + + attr_accessor sender_identity_public_key: String + + attr_accessor status: String + + attr_accessor total_value: Float + + attr_accessor transfer_direction: String + + attr_accessor type: String + + attr_reader created_time: String? + + def created_time=: (String) -> String + + attr_reader expiry_time: String? + + def expiry_time=: (String) -> String + + attr_reader updated_time: String? + + def updated_time=: (String) -> String + + def initialize: ( + id: String, + leaves: ::Array[Privy::SparkTransferLeaf], + receiver_identity_public_key: String, + sender_identity_public_key: String, + status: String, + total_value: Float, + transfer_direction: String, + type: String, + ?created_time: String, + ?expiry_time: String, + ?updated_time: String + ) -> void + + def to_hash: -> { + id: String, + leaves: ::Array[Privy::SparkTransferLeaf], + receiver_identity_public_key: String, + sender_identity_public_key: String, + status: String, + total_value: Float, + transfer_direction: String, + type: String, + created_time: String, + expiry_time: String, + updated_time: String + } + end + end +end diff --git a/sig/privy/models/spark_transfer_leaf.rbs b/sig/privy/models/spark_transfer_leaf.rbs new file mode 100644 index 0000000..5940237 --- /dev/null +++ b/sig/privy/models/spark_transfer_leaf.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type spark_transfer_leaf = + { + intermediate_refund_tx: String, + secret_cipher: String, + signature: String, + leaf: Privy::SparkWalletLeaf + } + + class SparkTransferLeaf < Privy::Internal::Type::BaseModel + attr_accessor intermediate_refund_tx: String + + attr_accessor secret_cipher: String + + attr_accessor signature: String + + attr_reader leaf: Privy::SparkWalletLeaf? + + def leaf=: (Privy::SparkWalletLeaf) -> Privy::SparkWalletLeaf + + def initialize: ( + intermediate_refund_tx: String, + secret_cipher: String, + signature: String, + ?leaf: Privy::SparkWalletLeaf + ) -> void + + def to_hash: -> { + intermediate_refund_tx: String, + secret_cipher: String, + signature: String, + leaf: Privy::SparkWalletLeaf + } + end + end +end diff --git a/sig/privy/models/spark_transfer_rpc_input.rbs b/sig/privy/models/spark_transfer_rpc_input.rbs new file mode 100644 index 0000000..c3544db --- /dev/null +++ b/sig/privy/models/spark_transfer_rpc_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type spark_transfer_rpc_input = + { + method_: Privy::Models::SparkTransferRpcInput::method_, + params: Privy::SparkTransferRpcInputParams, + network: Privy::Models::spark_network + } + + class SparkTransferRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkTransferRpcInput::method_ + + attr_accessor params: Privy::SparkTransferRpcInputParams + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkTransferRpcInput::method_, + params: Privy::SparkTransferRpcInputParams, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkTransferRpcInput::method_, + params: Privy::SparkTransferRpcInputParams, + network: Privy::Models::spark_network + } + + type method_ = :transfer + + module Method + extend Privy::Internal::Type::Enum + + TRANSFER: :transfer + + def self?.values: -> ::Array[Privy::Models::SparkTransferRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_transfer_rpc_input_params.rbs b/sig/privy/models/spark_transfer_rpc_input_params.rbs new file mode 100644 index 0000000..f81bc21 --- /dev/null +++ b/sig/privy/models/spark_transfer_rpc_input_params.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type spark_transfer_rpc_input_params = + { amount_sats: Float, receiver_spark_address: String } + + class SparkTransferRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor amount_sats: Float + + attr_accessor receiver_spark_address: String + + def initialize: ( + amount_sats: Float, + receiver_spark_address: String + ) -> void + + def to_hash: -> { amount_sats: Float, receiver_spark_address: String } + end + end +end diff --git a/sig/privy/models/spark_transfer_rpc_response.rbs b/sig/privy/models/spark_transfer_rpc_response.rbs new file mode 100644 index 0000000..c4464b8 --- /dev/null +++ b/sig/privy/models/spark_transfer_rpc_response.rbs @@ -0,0 +1,37 @@ +module Privy + module Models + type spark_transfer_rpc_response = + { + method_: Privy::Models::SparkTransferRpcResponse::method_, + data: Privy::SparkTransfer + } + + class SparkTransferRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkTransferRpcResponse::method_ + + attr_reader data: Privy::SparkTransfer? + + def data=: (Privy::SparkTransfer) -> Privy::SparkTransfer + + def initialize: ( + method_: Privy::Models::SparkTransferRpcResponse::method_, + ?data: Privy::SparkTransfer + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkTransferRpcResponse::method_, + data: Privy::SparkTransfer + } + + type method_ = :transfer + + module Method + extend Privy::Internal::Type::Enum + + TRANSFER: :transfer + + def self?.values: -> ::Array[Privy::Models::SparkTransferRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_transfer_tokens_rpc_input.rbs b/sig/privy/models/spark_transfer_tokens_rpc_input.rbs new file mode 100644 index 0000000..4382c0f --- /dev/null +++ b/sig/privy/models/spark_transfer_tokens_rpc_input.rbs @@ -0,0 +1,44 @@ +module Privy + module Models + type spark_transfer_tokens_rpc_input = + { + method_: Privy::Models::SparkTransferTokensRpcInput::method_, + params: Privy::SparkTransferTokensRpcInputParams, + network: Privy::Models::spark_network + } + + class SparkTransferTokensRpcInput < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkTransferTokensRpcInput::method_ + + attr_accessor params: Privy::SparkTransferTokensRpcInputParams + + attr_reader network: Privy::Models::spark_network? + + def network=: ( + Privy::Models::spark_network + ) -> Privy::Models::spark_network + + def initialize: ( + method_: Privy::Models::SparkTransferTokensRpcInput::method_, + params: Privy::SparkTransferTokensRpcInputParams, + ?network: Privy::Models::spark_network + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkTransferTokensRpcInput::method_, + params: Privy::SparkTransferTokensRpcInputParams, + network: Privy::Models::spark_network + } + + type method_ = :transferTokens + + module Method + extend Privy::Internal::Type::Enum + + TRANSFER_TOKENS: :transferTokens + + def self?.values: -> ::Array[Privy::Models::SparkTransferTokensRpcInput::method_] + end + end + end +end diff --git a/sig/privy/models/spark_transfer_tokens_rpc_input_params.rbs b/sig/privy/models/spark_transfer_tokens_rpc_input_params.rbs new file mode 100644 index 0000000..1c282fe --- /dev/null +++ b/sig/privy/models/spark_transfer_tokens_rpc_input_params.rbs @@ -0,0 +1,48 @@ +module Privy + module Models + type spark_transfer_tokens_rpc_input_params = + { + receiver_spark_address: String, + token_amount: Float, + token_identifier: String, + output_selection_strategy: Privy::Models::spark_output_selection_strategy, + selected_outputs: ::Array[Privy::OutputWithPreviousTransactionData] + } + + class SparkTransferTokensRpcInputParams < Privy::Internal::Type::BaseModel + attr_accessor receiver_spark_address: String + + attr_accessor token_amount: Float + + attr_accessor token_identifier: String + + attr_reader output_selection_strategy: Privy::Models::spark_output_selection_strategy? + + def output_selection_strategy=: ( + Privy::Models::spark_output_selection_strategy + ) -> Privy::Models::spark_output_selection_strategy + + attr_reader selected_outputs: ::Array[Privy::OutputWithPreviousTransactionData]? + + def selected_outputs=: ( + ::Array[Privy::OutputWithPreviousTransactionData] + ) -> ::Array[Privy::OutputWithPreviousTransactionData] + + def initialize: ( + receiver_spark_address: String, + token_amount: Float, + token_identifier: String, + ?output_selection_strategy: Privy::Models::spark_output_selection_strategy, + ?selected_outputs: ::Array[Privy::OutputWithPreviousTransactionData] + ) -> void + + def to_hash: -> { + receiver_spark_address: String, + token_amount: Float, + token_identifier: String, + output_selection_strategy: Privy::Models::spark_output_selection_strategy, + selected_outputs: ::Array[Privy::OutputWithPreviousTransactionData] + } + end + end +end diff --git a/sig/privy/models/spark_transfer_tokens_rpc_response.rbs b/sig/privy/models/spark_transfer_tokens_rpc_response.rbs new file mode 100644 index 0000000..e897f3e --- /dev/null +++ b/sig/privy/models/spark_transfer_tokens_rpc_response.rbs @@ -0,0 +1,39 @@ +module Privy + module Models + type spark_transfer_tokens_rpc_response = + { + method_: Privy::Models::SparkTransferTokensRpcResponse::method_, + data: Privy::SparkTransferTokensRpcResponseData + } + + class SparkTransferTokensRpcResponse < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::SparkTransferTokensRpcResponse::method_ + + attr_reader data: Privy::SparkTransferTokensRpcResponseData? + + def data=: ( + Privy::SparkTransferTokensRpcResponseData + ) -> Privy::SparkTransferTokensRpcResponseData + + def initialize: ( + method_: Privy::Models::SparkTransferTokensRpcResponse::method_, + ?data: Privy::SparkTransferTokensRpcResponseData + ) -> void + + def to_hash: -> { + method_: Privy::Models::SparkTransferTokensRpcResponse::method_, + data: Privy::SparkTransferTokensRpcResponseData + } + + type method_ = :transferTokens + + module Method + extend Privy::Internal::Type::Enum + + TRANSFER_TOKENS: :transferTokens + + def self?.values: -> ::Array[Privy::Models::SparkTransferTokensRpcResponse::method_] + end + end + end +end diff --git a/sig/privy/models/spark_transfer_tokens_rpc_response_data.rbs b/sig/privy/models/spark_transfer_tokens_rpc_response_data.rbs new file mode 100644 index 0000000..c861ae9 --- /dev/null +++ b/sig/privy/models/spark_transfer_tokens_rpc_response_data.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type spark_transfer_tokens_rpc_response_data = { id: String } + + class SparkTransferTokensRpcResponseData < Privy::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + end +end diff --git a/sig/privy/models/spark_user_token_metadata.rbs b/sig/privy/models/spark_user_token_metadata.rbs new file mode 100644 index 0000000..dd42064 --- /dev/null +++ b/sig/privy/models/spark_user_token_metadata.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type spark_user_token_metadata = + { + decimals: Float, + max_supply: String, + raw_token_identifier: String, + token_name: String, + token_public_key: String, + token_ticker: String + } + + class SparkUserTokenMetadata < Privy::Internal::Type::BaseModel + attr_accessor decimals: Float + + attr_accessor max_supply: String + + attr_accessor raw_token_identifier: String + + attr_accessor token_name: String + + attr_accessor token_public_key: String + + attr_accessor token_ticker: String + + def initialize: ( + decimals: Float, + max_supply: String, + raw_token_identifier: String, + token_name: String, + token_public_key: String, + token_ticker: String + ) -> void + + def to_hash: -> { + decimals: Float, + max_supply: String, + raw_token_identifier: String, + token_name: String, + token_public_key: String, + token_ticker: String + } + end + end +end diff --git a/sig/privy/models/spark_wallet_leaf.rbs b/sig/privy/models/spark_wallet_leaf.rbs new file mode 100644 index 0000000..ee6bbea --- /dev/null +++ b/sig/privy/models/spark_wallet_leaf.rbs @@ -0,0 +1,81 @@ +module Privy + module Models + type spark_wallet_leaf = + { + id: String, + network: Privy::Models::spark_network, + node_tx: String, + owner_identity_public_key: String, + refund_tx: String, + status: String, + tree_id: String, + value: Float, + verifying_public_key: String, + vout: Float, + parent_node_id: String, + signing_keyshare: Privy::SparkSigningKeyshare + } + + class SparkWalletLeaf < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor network: Privy::Models::spark_network + + attr_accessor node_tx: String + + attr_accessor owner_identity_public_key: String + + attr_accessor refund_tx: String + + attr_accessor status: String + + attr_accessor tree_id: String + + attr_accessor value: Float + + attr_accessor verifying_public_key: String + + attr_accessor vout: Float + + attr_reader parent_node_id: String? + + def parent_node_id=: (String) -> String + + attr_reader signing_keyshare: Privy::SparkSigningKeyshare? + + def signing_keyshare=: ( + Privy::SparkSigningKeyshare + ) -> Privy::SparkSigningKeyshare + + def initialize: ( + id: String, + network: Privy::Models::spark_network, + node_tx: String, + owner_identity_public_key: String, + refund_tx: String, + status: String, + tree_id: String, + value: Float, + verifying_public_key: String, + vout: Float, + ?parent_node_id: String, + ?signing_keyshare: Privy::SparkSigningKeyshare + ) -> void + + def to_hash: -> { + id: String, + network: Privy::Models::spark_network, + node_tx: String, + owner_identity_public_key: String, + refund_tx: String, + status: String, + tree_id: String, + value: Float, + verifying_public_key: String, + vout: Float, + parent_node_id: String, + signing_keyshare: Privy::SparkSigningKeyshare + } + end + end +end diff --git a/sig/privy/models/success_response.rbs b/sig/privy/models/success_response.rbs new file mode 100644 index 0000000..1c0d4f6 --- /dev/null +++ b/sig/privy/models/success_response.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type success_response = { success: bool } + + class SuccessResponse < Privy::Internal::Type::BaseModel + attr_accessor success: bool + + def initialize: (success: bool) -> void + + def to_hash: -> { success: bool } + end + end +end diff --git a/sig/privy/models/sui_command_name.rbs b/sig/privy/models/sui_command_name.rbs new file mode 100644 index 0000000..0c6f3de --- /dev/null +++ b/sig/privy/models/sui_command_name.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type sui_command_name = :TransferObjects | :SplitCoins | :MergeCoins + + module SuiCommandName + extend Privy::Internal::Type::Enum + + TRANSFER_OBJECTS: :TransferObjects + SPLIT_COINS: :SplitCoins + MERGE_COINS: :MergeCoins + + def self?.values: -> ::Array[Privy::Models::sui_command_name] + end + end +end diff --git a/sig/privy/models/sui_transaction_command_condition.rbs b/sig/privy/models/sui_transaction_command_condition.rbs new file mode 100644 index 0000000..0560538 --- /dev/null +++ b/sig/privy/models/sui_transaction_command_condition.rbs @@ -0,0 +1,67 @@ +module Privy + module Models + type sui_transaction_command_condition = + { + field: Privy::Models::SuiTransactionCommandCondition::field, + field_source: Privy::Models::SuiTransactionCommandCondition::field_source, + operator: Privy::Models::sui_transaction_command_operator, + value: Privy::Models::SuiTransactionCommandCondition::value + } + + class SuiTransactionCommandCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::SuiTransactionCommandCondition::field + + attr_accessor field_source: Privy::Models::SuiTransactionCommandCondition::field_source + + attr_accessor operator: Privy::Models::sui_transaction_command_operator + + attr_accessor value: Privy::Models::SuiTransactionCommandCondition::value + + def initialize: ( + field: Privy::Models::SuiTransactionCommandCondition::field, + field_source: Privy::Models::SuiTransactionCommandCondition::field_source, + operator: Privy::Models::sui_transaction_command_operator, + value: Privy::Models::SuiTransactionCommandCondition::value + ) -> void + + def to_hash: -> { + field: Privy::Models::SuiTransactionCommandCondition::field, + field_source: Privy::Models::SuiTransactionCommandCondition::field_source, + operator: Privy::Models::sui_transaction_command_operator, + value: Privy::Models::SuiTransactionCommandCondition::value + } + + type field = :commandName + + module Field + extend Privy::Internal::Type::Enum + + COMMAND_NAME: :commandName + + def self?.values: -> ::Array[Privy::Models::SuiTransactionCommandCondition::field] + end + + type field_source = :sui_transaction_command + + module FieldSource + extend Privy::Internal::Type::Enum + + SUI_TRANSACTION_COMMAND: :sui_transaction_command + + def self?.values: -> ::Array[Privy::Models::SuiTransactionCommandCondition::field_source] + end + + type value = + Privy::Models::sui_command_name + | ::Array[Privy::Models::sui_command_name] + + module Value + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::SuiTransactionCommandCondition::value] + + SuiCommandNameArray: Privy::Internal::Type::Converter + end + end + end +end diff --git a/sig/privy/models/sui_transaction_command_operator.rbs b/sig/privy/models/sui_transaction_command_operator.rbs new file mode 100644 index 0000000..2b501b7 --- /dev/null +++ b/sig/privy/models/sui_transaction_command_operator.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type sui_transaction_command_operator = :eq | :in + + module SuiTransactionCommandOperator + extend Privy::Internal::Type::Enum + + EQ: :eq + IN: :in + + def self?.values: -> ::Array[Privy::Models::sui_transaction_command_operator] + end + end +end diff --git a/sig/privy/models/sui_transfer_objects_command_condition.rbs b/sig/privy/models/sui_transfer_objects_command_condition.rbs new file mode 100644 index 0000000..95a8faa --- /dev/null +++ b/sig/privy/models/sui_transfer_objects_command_condition.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type sui_transfer_objects_command_condition = + { + field: Privy::Models::sui_transfer_objects_command_field, + field_source: Privy::Models::SuiTransferObjectsCommandCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class SuiTransferObjectsCommandCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::sui_transfer_objects_command_field + + attr_accessor field_source: Privy::Models::SuiTransferObjectsCommandCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::sui_transfer_objects_command_field, + field_source: Privy::Models::SuiTransferObjectsCommandCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::sui_transfer_objects_command_field, + field_source: Privy::Models::SuiTransferObjectsCommandCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field_source = :sui_transfer_objects_command + + module FieldSource + extend Privy::Internal::Type::Enum + + SUI_TRANSFER_OBJECTS_COMMAND: :sui_transfer_objects_command + + def self?.values: -> ::Array[Privy::Models::SuiTransferObjectsCommandCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/sui_transfer_objects_command_field.rbs b/sig/privy/models/sui_transfer_objects_command_field.rbs new file mode 100644 index 0000000..f2e1b14 --- /dev/null +++ b/sig/privy/models/sui_transfer_objects_command_field.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type sui_transfer_objects_command_field = :recipient | :amount + + module SuiTransferObjectsCommandField + extend Privy::Internal::Type::Enum + + RECIPIENT: :recipient + AMOUNT: :amount + + def self?.values: -> ::Array[Privy::Models::sui_transfer_objects_command_field] + end + end +end diff --git a/sig/privy/models/svm_transaction_wallet_action_step.rbs b/sig/privy/models/svm_transaction_wallet_action_step.rbs new file mode 100644 index 0000000..167e706 --- /dev/null +++ b/sig/privy/models/svm_transaction_wallet_action_step.rbs @@ -0,0 +1,52 @@ +module Privy + module Models + type svm_transaction_wallet_action_step = + { + :caip2 => String, + status: Privy::Models::svm_wallet_action_step_status, + transaction_signature: String?, + type: Privy::Models::SvmTransactionWalletActionStep::type_, + failure_reason: Privy::FailureReason + } + + class SvmTransactionWalletActionStep < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor status: Privy::Models::svm_wallet_action_step_status + + attr_accessor transaction_signature: String? + + attr_accessor type: Privy::Models::SvmTransactionWalletActionStep::type_ + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + def initialize: ( + caip2: String, + status: Privy::Models::svm_wallet_action_step_status, + transaction_signature: String?, + type: Privy::Models::SvmTransactionWalletActionStep::type_, + ?failure_reason: Privy::FailureReason + ) -> void + + def to_hash: -> { + :caip2 => String, + status: Privy::Models::svm_wallet_action_step_status, + transaction_signature: String?, + type: Privy::Models::SvmTransactionWalletActionStep::type_, + failure_reason: Privy::FailureReason + } + + type type_ = :svm_transaction + + module Type + extend Privy::Internal::Type::Enum + + SVM_TRANSACTION: :svm_transaction + + def self?.values: -> ::Array[Privy::Models::SvmTransactionWalletActionStep::type_] + end + end + end +end diff --git a/sig/privy/models/svm_wallet_action_step_status.rbs b/sig/privy/models/svm_wallet_action_step_status.rbs new file mode 100644 index 0000000..35b710b --- /dev/null +++ b/sig/privy/models/svm_wallet_action_step_status.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type svm_wallet_action_step_status = + :preparing + | :queued + | :pending + | :confirmed + | :finalized + | :rejected + | :reverted + | :failed + + module SvmWalletActionStepStatus + extend Privy::Internal::Type::Enum + + PREPARING: :preparing + QUEUED: :queued + PENDING: :pending + CONFIRMED: :confirmed + FINALIZED: :finalized + REJECTED: :rejected + REVERTED: :reverted + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::svm_wallet_action_step_status] + end + end +end diff --git a/sig/privy/models/swap_action_response.rbs b/sig/privy/models/swap_action_response.rbs new file mode 100644 index 0000000..81ece5c --- /dev/null +++ b/sig/privy/models/swap_action_response.rbs @@ -0,0 +1,91 @@ +module Privy + module Models + type swap_action_response = + { + id: String, + :caip2 => String, + created_at: Time, + input_amount: String?, + input_token: String, + output_amount: String?, + output_token: String, + status: Privy::Models::wallet_action_status, + type: Privy::Models::SwapActionResponse::type_, + wallet_id: String, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + class SwapActionResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor caip2: String + + attr_accessor created_at: Time + + attr_accessor input_amount: String? + + attr_accessor input_token: String + + attr_accessor output_amount: String? + + attr_accessor output_token: String + + attr_accessor status: Privy::Models::wallet_action_status + + attr_accessor type: Privy::Models::SwapActionResponse::type_ + + attr_accessor wallet_id: String + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + attr_reader steps: ::Array[Privy::Models::wallet_action_step]? + + def steps=: ( + ::Array[Privy::Models::wallet_action_step] + ) -> ::Array[Privy::Models::wallet_action_step] + + def initialize: ( + id: String, + caip2: String, + created_at: Time, + input_amount: String?, + input_token: String, + output_amount: String?, + output_token: String, + status: Privy::Models::wallet_action_status, + type: Privy::Models::SwapActionResponse::type_, + wallet_id: String, + ?failure_reason: Privy::FailureReason, + ?steps: ::Array[Privy::Models::wallet_action_step] + ) -> void + + def to_hash: -> { + id: String, + :caip2 => String, + created_at: Time, + input_amount: String?, + input_token: String, + output_amount: String?, + output_token: String, + status: Privy::Models::wallet_action_status, + type: Privy::Models::SwapActionResponse::type_, + wallet_id: String, + failure_reason: Privy::FailureReason, + steps: ::Array[Privy::Models::wallet_action_step] + } + + type type_ = :swap + + module Type + extend Privy::Internal::Type::Enum + + SWAP: :swap + + def self?.values: -> ::Array[Privy::Models::SwapActionResponse::type_] + end + end + end +end diff --git a/sig/privy/models/swap_destination.rbs b/sig/privy/models/swap_destination.rbs new file mode 100644 index 0000000..55f3606 --- /dev/null +++ b/sig/privy/models/swap_destination.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type swap_destination = { asset_address: String, :caip2 => String } + + class SwapDestination < Privy::Internal::Type::BaseModel + attr_accessor asset_address: String + + attr_reader caip2: String? + + def caip2=: (String) -> String + + def initialize: (asset_address: String, ?caip2: String) -> void + + def to_hash: -> { asset_address: String, :caip2 => String } + end + end +end diff --git a/sig/privy/models/swap_quote_destination.rbs b/sig/privy/models/swap_quote_destination.rbs new file mode 100644 index 0000000..e74ac91 --- /dev/null +++ b/sig/privy/models/swap_quote_destination.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type swap_quote_destination = { asset_address: String, :caip2 => String } + + class SwapQuoteDestination < Privy::Internal::Type::BaseModel + attr_accessor asset_address: String + + attr_reader caip2: String? + + def caip2=: (String) -> String + + def initialize: (asset_address: String, ?caip2: String) -> void + + def to_hash: -> { asset_address: String, :caip2 => String } + end + end +end diff --git a/sig/privy/models/swap_quote_request_body.rbs b/sig/privy/models/swap_quote_request_body.rbs new file mode 100644 index 0000000..be8519f --- /dev/null +++ b/sig/privy/models/swap_quote_request_body.rbs @@ -0,0 +1,46 @@ +module Privy + module Models + type swap_quote_request_body = + { + base_amount: String, + destination: Privy::SwapQuoteDestination, + source: Privy::SwapSource, + amount_type: Privy::Models::amount_type, + slippage_bps: Float + } + + class SwapQuoteRequestBody < Privy::Internal::Type::BaseModel + attr_accessor base_amount: String + + attr_accessor destination: Privy::SwapQuoteDestination + + attr_accessor source: Privy::SwapSource + + attr_reader amount_type: Privy::Models::amount_type? + + def amount_type=: ( + Privy::Models::amount_type + ) -> Privy::Models::amount_type + + attr_reader slippage_bps: Float? + + def slippage_bps=: (Float) -> Float + + def initialize: ( + base_amount: String, + destination: Privy::SwapQuoteDestination, + source: Privy::SwapSource, + ?amount_type: Privy::Models::amount_type, + ?slippage_bps: Float + ) -> void + + def to_hash: -> { + base_amount: String, + destination: Privy::SwapQuoteDestination, + source: Privy::SwapSource, + amount_type: Privy::Models::amount_type, + slippage_bps: Float + } + end + end +end diff --git a/sig/privy/models/swap_quote_response.rbs b/sig/privy/models/swap_quote_response.rbs new file mode 100644 index 0000000..4828e95 --- /dev/null +++ b/sig/privy/models/swap_quote_response.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type swap_quote_response = + { + :caip2 => String, + est_output_amount: String, + gas_estimate: String, + input_amount: String, + input_token: String, + minimum_output_amount: String, + output_token: String + } + + class SwapQuoteResponse < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor est_output_amount: String + + attr_accessor gas_estimate: String + + attr_accessor input_amount: String + + attr_accessor input_token: String + + attr_accessor minimum_output_amount: String + + attr_accessor output_token: String + + def initialize: ( + caip2: String, + est_output_amount: String, + gas_estimate: String, + input_amount: String, + input_token: String, + minimum_output_amount: String, + output_token: String + ) -> void + + def to_hash: -> { + :caip2 => String, + est_output_amount: String, + gas_estimate: String, + input_amount: String, + input_token: String, + minimum_output_amount: String, + output_token: String + } + end + end +end diff --git a/sig/privy/models/swap_request_body.rbs b/sig/privy/models/swap_request_body.rbs new file mode 100644 index 0000000..156ea8a --- /dev/null +++ b/sig/privy/models/swap_request_body.rbs @@ -0,0 +1,46 @@ +module Privy + module Models + type swap_request_body = + { + base_amount: String, + destination: Privy::SwapDestination, + source: Privy::SwapSource, + amount_type: Privy::Models::amount_type, + slippage_bps: Float + } + + class SwapRequestBody < Privy::Internal::Type::BaseModel + attr_accessor base_amount: String + + attr_accessor destination: Privy::SwapDestination + + attr_accessor source: Privy::SwapSource + + attr_reader amount_type: Privy::Models::amount_type? + + def amount_type=: ( + Privy::Models::amount_type + ) -> Privy::Models::amount_type + + attr_reader slippage_bps: Float? + + def slippage_bps=: (Float) -> Float + + def initialize: ( + base_amount: String, + destination: Privy::SwapDestination, + source: Privy::SwapSource, + ?amount_type: Privy::Models::amount_type, + ?slippage_bps: Float + ) -> void + + def to_hash: -> { + base_amount: String, + destination: Privy::SwapDestination, + source: Privy::SwapSource, + amount_type: Privy::Models::amount_type, + slippage_bps: Float + } + end + end +end diff --git a/sig/privy/models/swap_source.rbs b/sig/privy/models/swap_source.rbs new file mode 100644 index 0000000..45db796 --- /dev/null +++ b/sig/privy/models/swap_source.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type swap_source = { asset_address: String, :caip2 => String } + + class SwapSource < Privy::Internal::Type::BaseModel + attr_accessor asset_address: String + + attr_accessor caip2: String + + def initialize: (asset_address: String, caip2: String) -> void + + def to_hash: -> { asset_address: String, :caip2 => String } + end + end +end diff --git a/sig/privy/models/system_condition.rbs b/sig/privy/models/system_condition.rbs new file mode 100644 index 0000000..2ee60a9 --- /dev/null +++ b/sig/privy/models/system_condition.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type system_condition = + { + field: Privy::Models::SystemCondition::field, + field_source: Privy::Models::SystemCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class SystemCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::SystemCondition::field + + attr_accessor field_source: Privy::Models::SystemCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::SystemCondition::field, + field_source: Privy::Models::SystemCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::SystemCondition::field, + field_source: Privy::Models::SystemCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = :current_unix_timestamp + + module Field + extend Privy::Internal::Type::Enum + + CURRENT_UNIX_TIMESTAMP: :current_unix_timestamp + + def self?.values: -> ::Array[Privy::Models::SystemCondition::field] + end + + type field_source = :system + + module FieldSource + extend Privy::Internal::Type::Enum + + SYSTEM: :system + + def self?.values: -> ::Array[Privy::Models::SystemCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/telegram_auth_config_schema.rbs b/sig/privy/models/telegram_auth_config_schema.rbs new file mode 100644 index 0000000..8922939 --- /dev/null +++ b/sig/privy/models/telegram_auth_config_schema.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type telegram_auth_config_schema = + { + bot_id: String, + bot_name: String, + link_enabled: bool, + seamless_auth_enabled: bool + } + + class TelegramAuthConfigSchema < Privy::Internal::Type::BaseModel + attr_accessor bot_id: String + + attr_accessor bot_name: String + + attr_accessor link_enabled: bool + + attr_accessor seamless_auth_enabled: bool + + def initialize: ( + bot_id: String, + bot_name: String, + link_enabled: bool, + seamless_auth_enabled: bool + ) -> void + + def to_hash: -> { + bot_id: String, + bot_name: String, + link_enabled: bool, + seamless_auth_enabled: bool + } + end + end +end diff --git a/sig/privy/models/telegram_auth_result.rbs b/sig/privy/models/telegram_auth_result.rbs new file mode 100644 index 0000000..4f3b259 --- /dev/null +++ b/sig/privy/models/telegram_auth_result.rbs @@ -0,0 +1,56 @@ +module Privy + module Models + type telegram_auth_result = + { + id: Float?, + auth_date: Float?, + first_name: String, + hash_: String, + last_name: String, + photo_url: String, + username: String + } + + class TelegramAuthResult < Privy::Internal::Type::BaseModel + attr_accessor id: Float? + + attr_accessor auth_date: Float? + + attr_accessor first_name: String + + attr_accessor hash_: String + + attr_reader last_name: String? + + def last_name=: (String) -> String + + attr_reader photo_url: String? + + def photo_url=: (String) -> String + + attr_reader username: String? + + def username=: (String) -> String + + def initialize: ( + id: Float?, + auth_date: Float?, + first_name: String, + hash_: String, + ?last_name: String, + ?photo_url: String, + ?username: String + ) -> void + + def to_hash: -> { + id: Float?, + auth_date: Float?, + first_name: String, + hash_: String, + last_name: String, + photo_url: String, + username: String + } + end + end +end diff --git a/sig/privy/models/telegram_authenticate_input.rbs b/sig/privy/models/telegram_authenticate_input.rbs new file mode 100644 index 0000000..68ab340 --- /dev/null +++ b/sig/privy/models/telegram_authenticate_input.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type telegram_authenticate_input = + { + captcha_token: String, + mode: Privy::Models::authenticate_mode_option, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + + class TelegramAuthenticateInput < Privy::Internal::Type::BaseModel + attr_reader captcha_token: String? + + def captcha_token=: (String) -> String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + attr_reader telegram_auth_result: Privy::TelegramAuthResult? + + def telegram_auth_result=: ( + Privy::TelegramAuthResult + ) -> Privy::TelegramAuthResult + + attr_reader telegram_web_app_data: Privy::TelegramWebAppData? + + def telegram_web_app_data=: ( + Privy::TelegramWebAppData + ) -> Privy::TelegramWebAppData + + def initialize: ( + ?captcha_token: String, + ?mode: Privy::Models::authenticate_mode_option, + ?telegram_auth_result: Privy::TelegramAuthResult, + ?telegram_web_app_data: Privy::TelegramWebAppData + ) -> void + + def to_hash: -> { + captcha_token: String, + mode: Privy::Models::authenticate_mode_option, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + end + end +end diff --git a/sig/privy/models/telegram_authenticate_request_body.rbs b/sig/privy/models/telegram_authenticate_request_body.rbs new file mode 100644 index 0000000..195bb72 --- /dev/null +++ b/sig/privy/models/telegram_authenticate_request_body.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type telegram_authenticate_request_body = + { + captcha_token: String, + mode: Privy::Models::authenticate_mode_option, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + + class TelegramAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_reader captcha_token: String? + + def captcha_token=: (String) -> String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + attr_reader telegram_auth_result: Privy::TelegramAuthResult? + + def telegram_auth_result=: ( + Privy::TelegramAuthResult + ) -> Privy::TelegramAuthResult + + attr_reader telegram_web_app_data: Privy::TelegramWebAppData? + + def telegram_web_app_data=: ( + Privy::TelegramWebAppData + ) -> Privy::TelegramWebAppData + + def initialize: ( + ?captcha_token: String, + ?mode: Privy::Models::authenticate_mode_option, + ?telegram_auth_result: Privy::TelegramAuthResult, + ?telegram_web_app_data: Privy::TelegramWebAppData + ) -> void + + def to_hash: -> { + captcha_token: String, + mode: Privy::Models::authenticate_mode_option, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + end + end +end diff --git a/sig/privy/models/telegram_link_request_body.rbs b/sig/privy/models/telegram_link_request_body.rbs new file mode 100644 index 0000000..b9da6e6 --- /dev/null +++ b/sig/privy/models/telegram_link_request_body.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type telegram_link_request_body = + { + captcha_token: String, + mode: Privy::Models::authenticate_mode_option, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + + class TelegramLinkRequestBody < Privy::Internal::Type::BaseModel + attr_reader captcha_token: String? + + def captcha_token=: (String) -> String + + attr_reader mode: Privy::Models::authenticate_mode_option? + + def mode=: ( + Privy::Models::authenticate_mode_option + ) -> Privy::Models::authenticate_mode_option + + attr_reader telegram_auth_result: Privy::TelegramAuthResult? + + def telegram_auth_result=: ( + Privy::TelegramAuthResult + ) -> Privy::TelegramAuthResult + + attr_reader telegram_web_app_data: Privy::TelegramWebAppData? + + def telegram_web_app_data=: ( + Privy::TelegramWebAppData + ) -> Privy::TelegramWebAppData + + def initialize: ( + ?captcha_token: String, + ?mode: Privy::Models::authenticate_mode_option, + ?telegram_auth_result: Privy::TelegramAuthResult, + ?telegram_web_app_data: Privy::TelegramWebAppData + ) -> void + + def to_hash: -> { + captcha_token: String, + mode: Privy::Models::authenticate_mode_option, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + end + end +end diff --git a/sig/privy/models/telegram_unlink_input.rbs b/sig/privy/models/telegram_unlink_input.rbs new file mode 100644 index 0000000..14b01ca --- /dev/null +++ b/sig/privy/models/telegram_unlink_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type telegram_unlink_input = { telegram_user_id: String } + + class TelegramUnlinkInput < Privy::Internal::Type::BaseModel + attr_accessor telegram_user_id: String + + def initialize: (telegram_user_id: String) -> void + + def to_hash: -> { telegram_user_id: String } + end + end +end diff --git a/sig/privy/models/telegram_unlink_request_body.rbs b/sig/privy/models/telegram_unlink_request_body.rbs new file mode 100644 index 0000000..7878274 --- /dev/null +++ b/sig/privy/models/telegram_unlink_request_body.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type telegram_unlink_request_body = { telegram_user_id: String } + + class TelegramUnlinkRequestBody < Privy::Internal::Type::BaseModel + attr_accessor telegram_user_id: String + + def initialize: (telegram_user_id: String) -> void + + def to_hash: -> { telegram_user_id: String } + end + end +end diff --git a/sig/privy/models/telegram_web_app_data.rbs b/sig/privy/models/telegram_web_app_data.rbs new file mode 100644 index 0000000..b4bb06c --- /dev/null +++ b/sig/privy/models/telegram_web_app_data.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type telegram_web_app_data = + { + auth_date: Float?, + hash_: String, + user: String, + chat_instance: String, + chat_type: String, + query_id: String, + signature: String, + start_param: String + } + + class TelegramWebAppData < Privy::Internal::Type::BaseModel + attr_accessor auth_date: Float? + + attr_accessor hash_: String + + attr_accessor user: String + + attr_reader chat_instance: String? + + def chat_instance=: (String) -> String + + attr_reader chat_type: String? + + def chat_type=: (String) -> String + + attr_reader query_id: String? + + def query_id=: (String) -> String + + attr_reader signature: String? + + def signature=: (String) -> String + + attr_reader start_param: String? + + def start_param=: (String) -> String + + def initialize: ( + auth_date: Float?, + hash_: String, + user: String, + ?chat_instance: String, + ?chat_type: String, + ?query_id: String, + ?signature: String, + ?start_param: String + ) -> void + + def to_hash: -> { + auth_date: Float?, + hash_: String, + user: String, + chat_instance: String, + chat_type: String, + query_id: String, + signature: String, + start_param: String + } + end + end +end diff --git a/sig/privy/models/tempo_aa_authorization.rbs b/sig/privy/models/tempo_aa_authorization.rbs new file mode 100644 index 0000000..d1e2354 --- /dev/null +++ b/sig/privy/models/tempo_aa_authorization.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type tempo_aa_authorization = + { + chain_id: Privy::Models::quantity, + contract: String, + nonce: Privy::Models::quantity, + signature: String + } + + class TempoAaAuthorization < Privy::Internal::Type::BaseModel + attr_accessor chain_id: Privy::Models::quantity + + attr_accessor contract: String + + attr_accessor nonce: Privy::Models::quantity + + attr_accessor signature: String + + def initialize: ( + chain_id: Privy::Models::quantity, + contract: String, + nonce: Privy::Models::quantity, + signature: String + ) -> void + + def to_hash: -> { + chain_id: Privy::Models::quantity, + contract: String, + nonce: Privy::Models::quantity, + signature: String + } + end + end +end diff --git a/sig/privy/models/tempo_call.rbs b/sig/privy/models/tempo_call.rbs new file mode 100644 index 0000000..1e597a3 --- /dev/null +++ b/sig/privy/models/tempo_call.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type tempo_call = + { to: String, data: String, value: Privy::Models::quantity } + + class TempoCall < Privy::Internal::Type::BaseModel + attr_accessor to: String + + attr_reader data: String? + + def data=: (String) -> String + + attr_reader value: Privy::Models::quantity? + + def value=: (Privy::Models::quantity) -> Privy::Models::quantity + + def initialize: ( + to: String, + ?data: String, + ?value: Privy::Models::quantity + ) -> void + + def to_hash: -> { + to: String, + data: String, + value: Privy::Models::quantity + } + end + end +end diff --git a/sig/privy/models/tempo_fee_payer_signature.rbs b/sig/privy/models/tempo_fee_payer_signature.rbs new file mode 100644 index 0000000..34ec7da --- /dev/null +++ b/sig/privy/models/tempo_fee_payer_signature.rbs @@ -0,0 +1,41 @@ +module Privy + module Models + type tempo_fee_payer_signature = + { + r: String, + s: String, + y_parity: Privy::Models::TempoFeePayerSignature::y_parity + } + + class TempoFeePayerSignature < Privy::Internal::Type::BaseModel + attr_accessor r: String + + attr_accessor s: String + + attr_accessor y_parity: Privy::Models::TempoFeePayerSignature::y_parity + + def initialize: ( + r: String, + s: String, + y_parity: Privy::Models::TempoFeePayerSignature::y_parity + ) -> void + + def to_hash: -> { + r: String, + s: String, + y_parity: Privy::Models::TempoFeePayerSignature::y_parity + } + + type y_parity = Float + + module YParity + extend Privy::Internal::Type::Enum + + Y_PARITY_0: 0 + Y_PARITY_1: 1 + + def self?.values: -> ::Array[Privy::Models::TempoFeePayerSignature::y_parity] + end + end + end +end diff --git a/sig/privy/models/test_account.rbs b/sig/privy/models/test_account.rbs new file mode 100644 index 0000000..a1c1b4c --- /dev/null +++ b/sig/privy/models/test_account.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type test_account = + { + id: String, + created_at: String, + email: String, + otp_code: String, + phone_number: String, + updated_at: String + } + + class TestAccount < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: String + + attr_accessor email: String + + attr_accessor otp_code: String + + attr_accessor phone_number: String + + attr_accessor updated_at: String + + def initialize: ( + id: String, + created_at: String, + email: String, + otp_code: String, + phone_number: String, + updated_at: String + ) -> void + + def to_hash: -> { + id: String, + created_at: String, + email: String, + otp_code: String, + phone_number: String, + updated_at: String + } + end + end +end diff --git a/sig/privy/models/test_accounts_response.rbs b/sig/privy/models/test_accounts_response.rbs new file mode 100644 index 0000000..b37b0ee --- /dev/null +++ b/sig/privy/models/test_accounts_response.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type test_accounts_response = { data: ::Array[Privy::TestAccount] } + + class TestAccountsResponse < Privy::Internal::Type::BaseModel + attr_accessor data: ::Array[Privy::TestAccount] + + def initialize: (data: ::Array[Privy::TestAccount]) -> void + + def to_hash: -> { data: ::Array[Privy::TestAccount] } + end + end +end diff --git a/sig/privy/models/token_output.rbs b/sig/privy/models/token_output.rbs new file mode 100644 index 0000000..52c65ab --- /dev/null +++ b/sig/privy/models/token_output.rbs @@ -0,0 +1,67 @@ +module Privy + module Models + type token_output = + { + owner_public_key: String, + token_amount: String, + id: String, + revocation_commitment: String, + token_identifier: String, + token_public_key: String, + withdraw_bond_sats: Float, + withdraw_relative_block_locktime: Float + } + + class TokenOutput < Privy::Internal::Type::BaseModel + attr_accessor owner_public_key: String + + attr_accessor token_amount: String + + attr_reader id: String? + + def id=: (String) -> String + + attr_reader revocation_commitment: String? + + def revocation_commitment=: (String) -> String + + attr_reader token_identifier: String? + + def token_identifier=: (String) -> String + + attr_reader token_public_key: String? + + def token_public_key=: (String) -> String + + attr_reader withdraw_bond_sats: Float? + + def withdraw_bond_sats=: (Float) -> Float + + attr_reader withdraw_relative_block_locktime: Float? + + def withdraw_relative_block_locktime=: (Float) -> Float + + def initialize: ( + owner_public_key: String, + token_amount: String, + ?id: String, + ?revocation_commitment: String, + ?token_identifier: String, + ?token_public_key: String, + ?withdraw_bond_sats: Float, + ?withdraw_relative_block_locktime: Float + ) -> void + + def to_hash: -> { + owner_public_key: String, + token_amount: String, + id: String, + revocation_commitment: String, + token_identifier: String, + token_public_key: String, + withdraw_bond_sats: Float, + withdraw_relative_block_locktime: Float + } + end + end +end diff --git a/sig/privy/models/token_transfer_destination.rbs b/sig/privy/models/token_transfer_destination.rbs new file mode 100644 index 0000000..0070554 --- /dev/null +++ b/sig/privy/models/token_transfer_destination.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type token_transfer_destination = + { address: String, asset: String, chain: String } + + class TokenTransferDestination < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader chain: String? + + def chain=: (String) -> String + + def initialize: (address: String, ?asset: String, ?chain: String) -> void + + def to_hash: -> { address: String, asset: String, chain: String } + end + end +end diff --git a/sig/privy/models/token_transfer_source.rbs b/sig/privy/models/token_transfer_source.rbs new file mode 100644 index 0000000..4091c4b --- /dev/null +++ b/sig/privy/models/token_transfer_source.rbs @@ -0,0 +1,12 @@ +module Privy + module Models + type token_transfer_source = + Privy::NamedTokenTransferSource | Privy::CustomTokenTransferSource + + module TokenTransferSource + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::token_transfer_source] + end + end +end diff --git a/sig/privy/models/totp_mfa_method.rbs b/sig/privy/models/totp_mfa_method.rbs new file mode 100644 index 0000000..9ad512a --- /dev/null +++ b/sig/privy/models/totp_mfa_method.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type totp_mfa_method = + { type: Privy::Models::TotpMfaMethod::type_, verified_at: Float } + + class TotpMfaMethod < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::TotpMfaMethod::type_ + + attr_accessor verified_at: Float + + def initialize: ( + type: Privy::Models::TotpMfaMethod::type_, + verified_at: Float + ) -> void + + def to_hash: -> { + type: Privy::Models::TotpMfaMethod::type_, + verified_at: Float + } + + type type_ = :totp + + module Type + extend Privy::Internal::Type::Enum + + TOTP: :totp + + def self?.values: -> ::Array[Privy::Models::TotpMfaMethod::type_] + end + end + end +end diff --git a/sig/privy/models/transaction.rbs b/sig/privy/models/transaction.rbs new file mode 100644 index 0000000..f5dc9bd --- /dev/null +++ b/sig/privy/models/transaction.rbs @@ -0,0 +1,89 @@ +module Privy + module Models + type transaction = + { + id: String, + :caip2 => String, + created_at: Float, + status: Privy::Models::Transaction::status, + transaction_hash: String?, + wallet_id: String, + reference_id: String?, + sponsored: bool, + user_operation_hash: String + } + + class Transaction < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor caip2: String + + attr_accessor created_at: Float + + attr_accessor status: Privy::Models::Transaction::status + + attr_accessor transaction_hash: String? + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + attr_reader sponsored: bool? + + def sponsored=: (bool) -> bool + + attr_reader user_operation_hash: String? + + def user_operation_hash=: (String) -> String + + def initialize: ( + id: String, + caip2: String, + created_at: Float, + status: Privy::Models::Transaction::status, + transaction_hash: String?, + wallet_id: String, + ?reference_id: String?, + ?sponsored: bool, + ?user_operation_hash: String + ) -> void + + def to_hash: -> { + id: String, + :caip2 => String, + created_at: Float, + status: Privy::Models::Transaction::status, + transaction_hash: String?, + wallet_id: String, + reference_id: String?, + sponsored: bool, + user_operation_hash: String + } + + type status = + :broadcasted + | :confirmed + | :execution_reverted + | :failed + | :replaced + | :finalized + | :provider_error + | :pending + + module Status + extend Privy::Internal::Type::Enum + + BROADCASTED: :broadcasted + CONFIRMED: :confirmed + EXECUTION_REVERTED: :execution_reverted + FAILED: :failed + REPLACED: :replaced + FINALIZED: :finalized + PROVIDER_ERROR: :provider_error + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::Transaction::status] + end + end + end +end diff --git a/sig/privy/models/transaction_broadcasted_webhook_payload.rbs b/sig/privy/models/transaction_broadcasted_webhook_payload.rbs new file mode 100644 index 0000000..b3c9b45 --- /dev/null +++ b/sig/privy/models/transaction_broadcasted_webhook_payload.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type transaction_broadcasted_webhook_payload = + { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionBroadcastedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + class TransactionBroadcastedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_hash: String + + attr_accessor transaction_id: String + + attr_accessor type: Privy::Models::TransactionBroadcastedWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + def initialize: ( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionBroadcastedWebhookPayload::type_, + wallet_id: String, + ?reference_id: String? + ) -> void + + def to_hash: -> { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionBroadcastedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + type type_ = :"transaction.broadcasted" + + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_BROADCASTED: :"transaction.broadcasted" + + def self?.values: -> ::Array[Privy::Models::TransactionBroadcastedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/transaction_confirmed_webhook_payload.rbs b/sig/privy/models/transaction_confirmed_webhook_payload.rbs new file mode 100644 index 0000000..945b552 --- /dev/null +++ b/sig/privy/models/transaction_confirmed_webhook_payload.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type transaction_confirmed_webhook_payload = + { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionConfirmedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + class TransactionConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_hash: String + + attr_accessor transaction_id: String + + attr_accessor type: Privy::Models::TransactionConfirmedWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + def initialize: ( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionConfirmedWebhookPayload::type_, + wallet_id: String, + ?reference_id: String? + ) -> void + + def to_hash: -> { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionConfirmedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + type type_ = :"transaction.confirmed" + + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_CONFIRMED: :"transaction.confirmed" + + def self?.values: -> ::Array[Privy::Models::TransactionConfirmedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/transaction_detail.rbs b/sig/privy/models/transaction_detail.rbs new file mode 100644 index 0000000..37e61da --- /dev/null +++ b/sig/privy/models/transaction_detail.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type transaction_detail = + Privy::TransferSentTransactionDetail + | Privy::TransferReceivedTransactionDetail + + module TransactionDetail + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::transaction_detail] + end + end +end diff --git a/sig/privy/models/transaction_execution_reverted_webhook_payload.rbs b/sig/privy/models/transaction_execution_reverted_webhook_payload.rbs new file mode 100644 index 0000000..6e7f188 --- /dev/null +++ b/sig/privy/models/transaction_execution_reverted_webhook_payload.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type transaction_execution_reverted_webhook_payload = + { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionExecutionRevertedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + class TransactionExecutionRevertedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_hash: String + + attr_accessor transaction_id: String + + attr_accessor type: Privy::Models::TransactionExecutionRevertedWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + def initialize: ( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionExecutionRevertedWebhookPayload::type_, + wallet_id: String, + ?reference_id: String? + ) -> void + + def to_hash: -> { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionExecutionRevertedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + type type_ = :"transaction.execution_reverted" + + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_EXECUTION_REVERTED: :"transaction.execution_reverted" + + def self?.values: -> ::Array[Privy::Models::TransactionExecutionRevertedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/transaction_failed_webhook_payload.rbs b/sig/privy/models/transaction_failed_webhook_payload.rbs new file mode 100644 index 0000000..6ff8500 --- /dev/null +++ b/sig/privy/models/transaction_failed_webhook_payload.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type transaction_failed_webhook_payload = + { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionFailedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + class TransactionFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_hash: String + + attr_accessor transaction_id: String + + attr_accessor type: Privy::Models::TransactionFailedWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + def initialize: ( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionFailedWebhookPayload::type_, + wallet_id: String, + ?reference_id: String? + ) -> void + + def to_hash: -> { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionFailedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + type type_ = :"transaction.failed" + + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_FAILED: :"transaction.failed" + + def self?.values: -> ::Array[Privy::Models::TransactionFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/transaction_get_params.rbs b/sig/privy/models/transaction_get_params.rbs new file mode 100644 index 0000000..80cba8d --- /dev/null +++ b/sig/privy/models/transaction_get_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type transaction_get_params = + { transaction_id: String } & Privy::Internal::Type::request_parameters + + class TransactionGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor transaction_id: String + + def initialize: ( + transaction_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + transaction_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/transaction_list.rbs b/sig/privy/models/transaction_list.rbs new file mode 100644 index 0000000..b3b41f1 --- /dev/null +++ b/sig/privy/models/transaction_list.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type transaction_list = { transactions: ::Array[Privy::Transaction] } + + class TransactionList < Privy::Internal::Type::BaseModel + attr_accessor transactions: ::Array[Privy::Transaction] + + def initialize: (transactions: ::Array[Privy::Transaction]) -> void + + def to_hash: -> { transactions: ::Array[Privy::Transaction] } + end + end +end diff --git a/sig/privy/models/transaction_provider_error_webhook_payload.rbs b/sig/privy/models/transaction_provider_error_webhook_payload.rbs new file mode 100644 index 0000000..0b1fb2a --- /dev/null +++ b/sig/privy/models/transaction_provider_error_webhook_payload.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type transaction_provider_error_webhook_payload = + { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionProviderErrorWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + class TransactionProviderErrorWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_hash: String + + attr_accessor transaction_id: String + + attr_accessor type: Privy::Models::TransactionProviderErrorWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + def initialize: ( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionProviderErrorWebhookPayload::type_, + wallet_id: String, + ?reference_id: String? + ) -> void + + def to_hash: -> { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionProviderErrorWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + type type_ = :"transaction.provider_error" + + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_PROVIDER_ERROR: :"transaction.provider_error" + + def self?.values: -> ::Array[Privy::Models::TransactionProviderErrorWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/transaction_replaced_webhook_payload.rbs b/sig/privy/models/transaction_replaced_webhook_payload.rbs new file mode 100644 index 0000000..c5f3b17 --- /dev/null +++ b/sig/privy/models/transaction_replaced_webhook_payload.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + type transaction_replaced_webhook_payload = + { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionReplacedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + class TransactionReplacedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_hash: String + + attr_accessor transaction_id: String + + attr_accessor type: Privy::Models::TransactionReplacedWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + def initialize: ( + caip2: String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionReplacedWebhookPayload::type_, + wallet_id: String, + ?reference_id: String? + ) -> void + + def to_hash: -> { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + type: Privy::Models::TransactionReplacedWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + type type_ = :"transaction.replaced" + + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_REPLACED: :"transaction.replaced" + + def self?.values: -> ::Array[Privy::Models::TransactionReplacedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/transaction_scanning_asset_diff.rbs b/sig/privy/models/transaction_scanning_asset_diff.rbs new file mode 100644 index 0000000..54ea0fc --- /dev/null +++ b/sig/privy/models/transaction_scanning_asset_diff.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type transaction_scanning_asset_diff = + { + asset: Privy::TransactionScanningAssetInfo, + in_: ::Array[Privy::TransactionScanningAssetValue], + out: ::Array[Privy::TransactionScanningAssetValue] + } + + class TransactionScanningAssetDiff < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::TransactionScanningAssetInfo + + attr_accessor in_: ::Array[Privy::TransactionScanningAssetValue] + + attr_accessor out: ::Array[Privy::TransactionScanningAssetValue] + + def initialize: ( + asset: Privy::TransactionScanningAssetInfo, + in_: ::Array[Privy::TransactionScanningAssetValue], + out: ::Array[Privy::TransactionScanningAssetValue] + ) -> void + + def to_hash: -> { + asset: Privy::TransactionScanningAssetInfo, + in_: ::Array[Privy::TransactionScanningAssetValue], + out: ::Array[Privy::TransactionScanningAssetValue] + } + end + end +end diff --git a/sig/privy/models/transaction_scanning_asset_info.rbs b/sig/privy/models/transaction_scanning_asset_info.rbs new file mode 100644 index 0000000..5dfb68f --- /dev/null +++ b/sig/privy/models/transaction_scanning_asset_info.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type transaction_scanning_asset_info = + { + decimals: Float, + logo_url: String, + name: String, + symbol: String, + type: String + } + + class TransactionScanningAssetInfo < Privy::Internal::Type::BaseModel + attr_reader decimals: Float? + + def decimals=: (Float) -> Float + + attr_reader logo_url: String? + + def logo_url=: (String) -> String + + attr_reader name: String? + + def name=: (String) -> String + + attr_reader symbol: String? + + def symbol=: (String) -> String + + attr_reader type: String? + + def type=: (String) -> String + + def initialize: ( + ?decimals: Float, + ?logo_url: String, + ?name: String, + ?symbol: String, + ?type: String + ) -> void + + def to_hash: -> { + decimals: Float, + logo_url: String, + name: String, + symbol: String, + type: String + } + end + end +end diff --git a/sig/privy/models/transaction_scanning_asset_value.rbs b/sig/privy/models/transaction_scanning_asset_value.rbs new file mode 100644 index 0000000..6a58246 --- /dev/null +++ b/sig/privy/models/transaction_scanning_asset_value.rbs @@ -0,0 +1,19 @@ +module Privy + module Models + type transaction_scanning_asset_value = { usd_price: String, value: String } + + class TransactionScanningAssetValue < Privy::Internal::Type::BaseModel + attr_reader usd_price: String? + + def usd_price=: (String) -> String + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: (?usd_price: String, ?value: String) -> void + + def to_hash: -> { usd_price: String, value: String } + end + end +end diff --git a/sig/privy/models/transaction_scanning_calldata.rbs b/sig/privy/models/transaction_scanning_calldata.rbs new file mode 100644 index 0000000..b14fd8e --- /dev/null +++ b/sig/privy/models/transaction_scanning_calldata.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type transaction_scanning_calldata = + { + function_selector: String, + function_declaration: String, + function_signature: String + } + + class TransactionScanningCalldata < Privy::Internal::Type::BaseModel + attr_accessor function_selector: String + + attr_reader function_declaration: String? + + def function_declaration=: (String) -> String + + attr_reader function_signature: String? + + def function_signature=: (String) -> String + + def initialize: ( + function_selector: String, + ?function_declaration: String, + ?function_signature: String + ) -> void + + def to_hash: -> { + function_selector: String, + function_declaration: String, + function_signature: String + } + end + end +end diff --git a/sig/privy/models/transaction_scanning_exposure.rbs b/sig/privy/models/transaction_scanning_exposure.rbs new file mode 100644 index 0000000..3de6cfc --- /dev/null +++ b/sig/privy/models/transaction_scanning_exposure.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + type transaction_scanning_exposure = + { + asset: Privy::TransactionScanningAssetInfo, + spenders: ::Hash[Symbol, Privy::TransactionScanningAssetValue] + } + + class TransactionScanningExposure < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::TransactionScanningAssetInfo + + attr_accessor spenders: ::Hash[Symbol, Privy::TransactionScanningAssetValue] + + def initialize: ( + asset: Privy::TransactionScanningAssetInfo, + spenders: ::Hash[Symbol, Privy::TransactionScanningAssetValue] + ) -> void + + def to_hash: -> { + asset: Privy::TransactionScanningAssetInfo, + spenders: ::Hash[Symbol, Privy::TransactionScanningAssetValue] + } + end + end +end diff --git a/sig/privy/models/transaction_scanning_metadata.rbs b/sig/privy/models/transaction_scanning_metadata.rbs new file mode 100644 index 0000000..61ec16d --- /dev/null +++ b/sig/privy/models/transaction_scanning_metadata.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type transaction_scanning_metadata = { domain: String } + + class TransactionScanningMetadata < Privy::Internal::Type::BaseModel + attr_accessor domain: String + + def initialize: (domain: String) -> void + + def to_hash: -> { domain: String } + end + end +end diff --git a/sig/privy/models/transaction_scanning_params.rbs b/sig/privy/models/transaction_scanning_params.rbs new file mode 100644 index 0000000..eeb0e31 --- /dev/null +++ b/sig/privy/models/transaction_scanning_params.rbs @@ -0,0 +1,80 @@ +module Privy + module Models + type transaction_scanning_params = + { + block_tag: String, + calldata: Privy::TransactionScanningCalldata, + chain: String, + data: String, + from: String, + gas: String, + gas_price: String, + to: String, + value: String + } + + class TransactionScanningParams < Privy::Internal::Type::BaseModel + attr_reader block_tag: String? + + def block_tag=: (String) -> String + + attr_reader calldata: Privy::TransactionScanningCalldata? + + def calldata=: ( + Privy::TransactionScanningCalldata + ) -> Privy::TransactionScanningCalldata + + attr_reader chain: String? + + def chain=: (String) -> String + + attr_reader data: String? + + def data=: (String) -> String + + attr_reader from: String? + + def from=: (String) -> String + + attr_reader gas: String? + + def gas=: (String) -> String + + attr_reader gas_price: String? + + def gas_price=: (String) -> String + + attr_reader to: String? + + def to=: (String) -> String + + attr_reader value: String? + + def value=: (String) -> String + + def initialize: ( + ?block_tag: String, + ?calldata: Privy::TransactionScanningCalldata, + ?chain: String, + ?data: String, + ?from: String, + ?gas: String, + ?gas_price: String, + ?to: String, + ?value: String + ) -> void + + def to_hash: -> { + block_tag: String, + calldata: Privy::TransactionScanningCalldata, + chain: String, + data: String, + from: String, + gas: String, + gas_price: String, + to: String, + value: String + } + end + end +end diff --git a/sig/privy/models/transaction_scanning_request_body.rbs b/sig/privy/models/transaction_scanning_request_body.rbs new file mode 100644 index 0000000..8747586 --- /dev/null +++ b/sig/privy/models/transaction_scanning_request_body.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type transaction_scanning_request_body = + { + chain_id: String, + metadata: Privy::TransactionScanningMetadata, + request: Privy::TransactionScanningRpcRequest + } + + class TransactionScanningRequestBody < Privy::Internal::Type::BaseModel + attr_accessor chain_id: String + + attr_accessor metadata: Privy::TransactionScanningMetadata + + attr_accessor request: Privy::TransactionScanningRpcRequest + + def initialize: ( + chain_id: String, + metadata: Privy::TransactionScanningMetadata, + request: Privy::TransactionScanningRpcRequest + ) -> void + + def to_hash: -> { + chain_id: String, + metadata: Privy::TransactionScanningMetadata, + request: Privy::TransactionScanningRpcRequest + } + end + end +end diff --git a/sig/privy/models/transaction_scanning_response_body.rbs b/sig/privy/models/transaction_scanning_response_body.rbs new file mode 100644 index 0000000..1401454 --- /dev/null +++ b/sig/privy/models/transaction_scanning_response_body.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + type transaction_scanning_response_body = + { + simulation: Privy::Models::transaction_scanning_simulation_result, + validation: Privy::Models::transaction_scanning_validation_result + } + + class TransactionScanningResponseBody < Privy::Internal::Type::BaseModel + attr_accessor simulation: Privy::Models::transaction_scanning_simulation_result + + attr_accessor validation: Privy::Models::transaction_scanning_validation_result + + def initialize: ( + simulation: Privy::Models::transaction_scanning_simulation_result, + validation: Privy::Models::transaction_scanning_validation_result + ) -> void + + def to_hash: -> { + simulation: Privy::Models::transaction_scanning_simulation_result, + validation: Privy::Models::transaction_scanning_validation_result + } + end + end +end diff --git a/sig/privy/models/transaction_scanning_rpc_request.rbs b/sig/privy/models/transaction_scanning_rpc_request.rbs new file mode 100644 index 0000000..bd46daf --- /dev/null +++ b/sig/privy/models/transaction_scanning_rpc_request.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type transaction_scanning_rpc_request = + { method_: String, params: ::Array[top] } + + class TransactionScanningRpcRequest < Privy::Internal::Type::BaseModel + attr_accessor method_: String + + attr_accessor params: ::Array[top] + + def initialize: (method_: String, params: ::Array[top]) -> void + + def to_hash: -> { method_: String, params: ::Array[top] } + end + end +end diff --git a/sig/privy/models/transaction_scanning_simulation_error_result.rbs b/sig/privy/models/transaction_scanning_simulation_error_result.rbs new file mode 100644 index 0000000..f929307 --- /dev/null +++ b/sig/privy/models/transaction_scanning_simulation_error_result.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type transaction_scanning_simulation_error_result = + { + error: String, + status: Privy::Models::TransactionScanningSimulationErrorResult::status + } + + class TransactionScanningSimulationErrorResult < Privy::Internal::Type::BaseModel + attr_accessor error: String + + attr_accessor status: Privy::Models::TransactionScanningSimulationErrorResult::status + + def initialize: ( + error: String, + status: Privy::Models::TransactionScanningSimulationErrorResult::status + ) -> void + + def to_hash: -> { + error: String, + status: Privy::Models::TransactionScanningSimulationErrorResult::status + } + + type status = :Error + + module Status + extend Privy::Internal::Type::Enum + + ERROR: :Error + + def self?.values: -> ::Array[Privy::Models::TransactionScanningSimulationErrorResult::status] + end + end + end +end diff --git a/sig/privy/models/transaction_scanning_simulation_result.rbs b/sig/privy/models/transaction_scanning_simulation_result.rbs new file mode 100644 index 0000000..c6c00cb --- /dev/null +++ b/sig/privy/models/transaction_scanning_simulation_result.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type transaction_scanning_simulation_result = + Privy::TransactionScanningSimulationErrorResult + | Privy::TransactionScanningSimulationSuccessResult + + module TransactionScanningSimulationResult + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::transaction_scanning_simulation_result] + end + end +end diff --git a/sig/privy/models/transaction_scanning_simulation_success_result.rbs b/sig/privy/models/transaction_scanning_simulation_success_result.rbs new file mode 100644 index 0000000..51c8c19 --- /dev/null +++ b/sig/privy/models/transaction_scanning_simulation_success_result.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type transaction_scanning_simulation_success_result = + { + assets_diffs: ::Array[Privy::TransactionScanningAssetDiff], + exposures: ::Array[Privy::TransactionScanningExposure], + status: Privy::Models::TransactionScanningSimulationSuccessResult::status, + params: Privy::TransactionScanningParams + } + + class TransactionScanningSimulationSuccessResult < Privy::Internal::Type::BaseModel + attr_accessor assets_diffs: ::Array[Privy::TransactionScanningAssetDiff] + + attr_accessor exposures: ::Array[Privy::TransactionScanningExposure] + + attr_accessor status: Privy::Models::TransactionScanningSimulationSuccessResult::status + + attr_reader params: Privy::TransactionScanningParams? + + def params=: ( + Privy::TransactionScanningParams + ) -> Privy::TransactionScanningParams + + def initialize: ( + assets_diffs: ::Array[Privy::TransactionScanningAssetDiff], + exposures: ::Array[Privy::TransactionScanningExposure], + status: Privy::Models::TransactionScanningSimulationSuccessResult::status, + ?params: Privy::TransactionScanningParams + ) -> void + + def to_hash: -> { + assets_diffs: ::Array[Privy::TransactionScanningAssetDiff], + exposures: ::Array[Privy::TransactionScanningExposure], + status: Privy::Models::TransactionScanningSimulationSuccessResult::status, + params: Privy::TransactionScanningParams + } + + type status = :Success + + module Status + extend Privy::Internal::Type::Enum + + SUCCESS: :Success + + def self?.values: -> ::Array[Privy::Models::TransactionScanningSimulationSuccessResult::status] + end + end + end +end diff --git a/sig/privy/models/transaction_scanning_validation_error_result.rbs b/sig/privy/models/transaction_scanning_validation_error_result.rbs new file mode 100644 index 0000000..8cc7c7a --- /dev/null +++ b/sig/privy/models/transaction_scanning_validation_error_result.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type transaction_scanning_validation_error_result = + { + error: String, + status: Privy::Models::TransactionScanningValidationErrorResult::status + } + + class TransactionScanningValidationErrorResult < Privy::Internal::Type::BaseModel + attr_accessor error: String + + attr_accessor status: Privy::Models::TransactionScanningValidationErrorResult::status + + def initialize: ( + error: String, + status: Privy::Models::TransactionScanningValidationErrorResult::status + ) -> void + + def to_hash: -> { + error: String, + status: Privy::Models::TransactionScanningValidationErrorResult::status + } + + type status = :Error + + module Status + extend Privy::Internal::Type::Enum + + ERROR: :Error + + def self?.values: -> ::Array[Privy::Models::TransactionScanningValidationErrorResult::status] + end + end + end +end diff --git a/sig/privy/models/transaction_scanning_validation_result.rbs b/sig/privy/models/transaction_scanning_validation_result.rbs new file mode 100644 index 0000000..8ddd6b8 --- /dev/null +++ b/sig/privy/models/transaction_scanning_validation_result.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type transaction_scanning_validation_result = + Privy::TransactionScanningValidationErrorResult + | Privy::TransactionScanningValidationSuccessResult + + module TransactionScanningValidationResult + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::transaction_scanning_validation_result] + end + end +end diff --git a/sig/privy/models/transaction_scanning_validation_success_result.rbs b/sig/privy/models/transaction_scanning_validation_success_result.rbs new file mode 100644 index 0000000..cb5a097 --- /dev/null +++ b/sig/privy/models/transaction_scanning_validation_success_result.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type transaction_scanning_validation_success_result = + { + result_type: String, + status: Privy::Models::TransactionScanningValidationSuccessResult::status + } + + class TransactionScanningValidationSuccessResult < Privy::Internal::Type::BaseModel + attr_accessor result_type: String + + attr_accessor status: Privy::Models::TransactionScanningValidationSuccessResult::status + + def initialize: ( + result_type: String, + status: Privy::Models::TransactionScanningValidationSuccessResult::status + ) -> void + + def to_hash: -> { + result_type: String, + status: Privy::Models::TransactionScanningValidationSuccessResult::status + } + + type status = :Success + + module Status + extend Privy::Internal::Type::Enum + + SUCCESS: :Success + + def self?.values: -> ::Array[Privy::Models::TransactionScanningValidationSuccessResult::status] + end + end + end +end diff --git a/sig/privy/models/transaction_still_pending_webhook_payload.rbs b/sig/privy/models/transaction_still_pending_webhook_payload.rbs new file mode 100644 index 0000000..8cb349e --- /dev/null +++ b/sig/privy/models/transaction_still_pending_webhook_payload.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type transaction_still_pending_webhook_payload = + { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + transaction_request: Privy::UnsignedStandardEthereumTransaction, + type: Privy::Models::TransactionStillPendingWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + class TransactionStillPendingWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor transaction_hash: String + + attr_accessor transaction_id: String + + attr_accessor transaction_request: Privy::UnsignedStandardEthereumTransaction + + attr_accessor type: Privy::Models::TransactionStillPendingWebhookPayload::type_ + + attr_accessor wallet_id: String + + attr_accessor reference_id: String? + + def initialize: ( + caip2: String, + transaction_hash: String, + transaction_id: String, + transaction_request: Privy::UnsignedStandardEthereumTransaction, + type: Privy::Models::TransactionStillPendingWebhookPayload::type_, + wallet_id: String, + ?reference_id: String? + ) -> void + + def to_hash: -> { + :caip2 => String, + transaction_hash: String, + transaction_id: String, + transaction_request: Privy::UnsignedStandardEthereumTransaction, + type: Privy::Models::TransactionStillPendingWebhookPayload::type_, + wallet_id: String, + reference_id: String? + } + + type type_ = :"transaction.still_pending" + + module Type + extend Privy::Internal::Type::Enum + + TRANSACTION_STILL_PENDING: :"transaction.still_pending" + + def self?.values: -> ::Array[Privy::Models::TransactionStillPendingWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/transaction_token_address_input.rbs b/sig/privy/models/transaction_token_address_input.rbs new file mode 100644 index 0000000..b41457e --- /dev/null +++ b/sig/privy/models/transaction_token_address_input.rbs @@ -0,0 +1,5 @@ +module Privy + module Models + class TransactionTokenAddressInput = String + end +end diff --git a/sig/privy/models/transfer_action_response.rbs b/sig/privy/models/transfer_action_response.rbs new file mode 100644 index 0000000..d377c9b --- /dev/null +++ b/sig/privy/models/transfer_action_response.rbs @@ -0,0 +1,125 @@ +module Privy + module Models + type transfer_action_response = + { + id: String, + created_at: Time, + destination_address: String, + source_chain: String, + status: Privy::Models::wallet_action_status, + type: Privy::Models::TransferActionResponse::type_, + wallet_id: String, + destination_amount: String, + destination_asset: String, + destination_chain: String, + failure_reason: Privy::FailureReason, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer, + steps: ::Array[Privy::Models::wallet_action_step] + } + + class TransferActionResponse < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Time + + attr_accessor destination_address: String + + attr_accessor source_chain: String + + attr_accessor status: Privy::Models::wallet_action_status + + attr_accessor type: Privy::Models::TransferActionResponse::type_ + + attr_accessor wallet_id: String + + attr_reader destination_amount: String? + + def destination_amount=: (String) -> String + + attr_reader destination_asset: String? + + def destination_asset=: (String) -> String + + attr_reader destination_chain: String? + + def destination_chain=: (String) -> String + + attr_reader failure_reason: Privy::FailureReason? + + def failure_reason=: (Privy::FailureReason) -> Privy::FailureReason + + attr_reader source_amount: String? + + def source_amount=: (String) -> String + + attr_reader source_asset: String? + + def source_asset=: (String) -> String + + attr_reader source_asset_address: String? + + def source_asset_address=: (String) -> String + + attr_reader source_asset_decimals: Integer? + + def source_asset_decimals=: (Integer) -> Integer + + attr_reader steps: ::Array[Privy::Models::wallet_action_step]? + + def steps=: ( + ::Array[Privy::Models::wallet_action_step] + ) -> ::Array[Privy::Models::wallet_action_step] + + def initialize: ( + id: String, + created_at: Time, + destination_address: String, + source_chain: String, + status: Privy::Models::wallet_action_status, + type: Privy::Models::TransferActionResponse::type_, + wallet_id: String, + ?destination_amount: String, + ?destination_asset: String, + ?destination_chain: String, + ?failure_reason: Privy::FailureReason, + ?source_amount: String, + ?source_asset: String, + ?source_asset_address: String, + ?source_asset_decimals: Integer, + ?steps: ::Array[Privy::Models::wallet_action_step] + ) -> void + + def to_hash: -> { + id: String, + created_at: Time, + destination_address: String, + source_chain: String, + status: Privy::Models::wallet_action_status, + type: Privy::Models::TransferActionResponse::type_, + wallet_id: String, + destination_amount: String, + destination_asset: String, + destination_chain: String, + failure_reason: Privy::FailureReason, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer, + steps: ::Array[Privy::Models::wallet_action_step] + } + + type type_ = :transfer + + module Type + extend Privy::Internal::Type::Enum + + TRANSFER: :transfer + + def self?.values: -> ::Array[Privy::Models::TransferActionResponse::type_] + end + end + end +end diff --git a/sig/privy/models/transfer_farcaster_input.rbs b/sig/privy/models/transfer_farcaster_input.rbs new file mode 100644 index 0000000..0818b86 --- /dev/null +++ b/sig/privy/models/transfer_farcaster_input.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type transfer_farcaster_input = + { + farcaster_embedded_address: String, + farcaster_id: String, + nonce: String + } + + class TransferFarcasterInput < Privy::Internal::Type::BaseModel + attr_accessor farcaster_embedded_address: String + + attr_accessor farcaster_id: String + + attr_accessor nonce: String + + def initialize: ( + farcaster_embedded_address: String, + farcaster_id: String, + nonce: String + ) -> void + + def to_hash: -> { + farcaster_embedded_address: String, + farcaster_id: String, + nonce: String + } + end + end +end diff --git a/sig/privy/models/transfer_intent_request_details.rbs b/sig/privy/models/transfer_intent_request_details.rbs new file mode 100644 index 0000000..a66ece1 --- /dev/null +++ b/sig/privy/models/transfer_intent_request_details.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type transfer_intent_request_details = + { + body: Privy::TransferRequestBody, + method_: Privy::Models::TransferIntentRequestDetails::method_, + url: String + } + + class TransferIntentRequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::TransferRequestBody + + attr_accessor method_: Privy::Models::TransferIntentRequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::TransferRequestBody, + method_: Privy::Models::TransferIntentRequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::TransferRequestBody, + method_: Privy::Models::TransferIntentRequestDetails::method_, + url: String + } + + type method_ = :POST + + module Method + extend Privy::Internal::Type::Enum + + POST: :POST + + def self?.values: -> ::Array[Privy::Models::TransferIntentRequestDetails::method_] + end + end + end +end diff --git a/sig/privy/models/transfer_intent_response.rbs b/sig/privy/models/transfer_intent_response.rbs new file mode 100644 index 0000000..a7451fd --- /dev/null +++ b/sig/privy/models/transfer_intent_response.rbs @@ -0,0 +1,94 @@ +module Privy + module Models + type transfer_intent_response = + { + intent_type: Privy::Models::TransferIntentResponse::intent_type, + request_details: Privy::TransferIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + + class TransferIntentResponse < Privy::Models::BaseIntentResponse + def intent_type: -> Privy::Models::TransferIntentResponse::intent_type + + def intent_type=: ( + Privy::Models::TransferIntentResponse::intent_type _ + ) -> Privy::Models::TransferIntentResponse::intent_type + + def request_details: -> Privy::TransferIntentResponse::RequestDetails + + def request_details=: ( + Privy::TransferIntentResponse::RequestDetails _ + ) -> Privy::TransferIntentResponse::RequestDetails + + def action_result: -> Privy::BaseActionResult? + + def action_result=: (Privy::BaseActionResult _) -> Privy::BaseActionResult + + def current_resource_data: -> Privy::Wallet? + + def current_resource_data=: (Privy::Wallet _) -> Privy::Wallet + + def initialize: ( + intent_type: Privy::Models::TransferIntentResponse::intent_type, + request_details: Privy::TransferIntentResponse::RequestDetails, + ?action_result: Privy::BaseActionResult, + ?current_resource_data: Privy::Wallet + ) -> void + + def to_hash: -> { + intent_type: Privy::Models::TransferIntentResponse::intent_type, + request_details: Privy::TransferIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + + type intent_type = :TRANSFER + + module IntentType + extend Privy::Internal::Type::Enum + + TRANSFER: :TRANSFER + + def self?.values: -> ::Array[Privy::Models::TransferIntentResponse::intent_type] + end + + type request_details = + { + body: Privy::TransferRequestBody, + method_: Privy::Models::TransferIntentResponse::RequestDetails::method_, + url: String + } + + class RequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::TransferRequestBody + + attr_accessor method_: Privy::Models::TransferIntentResponse::RequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::TransferRequestBody, + method_: Privy::Models::TransferIntentResponse::RequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::TransferRequestBody, + method_: Privy::Models::TransferIntentResponse::RequestDetails::method_, + url: String + } + + type method_ = :POST + + module Method + extend Privy::Internal::Type::Enum + + POST: :POST + + def self?.values: -> ::Array[Privy::Models::TransferIntentResponse::RequestDetails::method_] + end + end + end + end +end diff --git a/sig/privy/models/transfer_received_transaction_detail.rbs b/sig/privy/models/transfer_received_transaction_detail.rbs new file mode 100644 index 0000000..c78f22c --- /dev/null +++ b/sig/privy/models/transfer_received_transaction_detail.rbs @@ -0,0 +1,136 @@ +module Privy + module Models + type transfer_received_transaction_detail = + { + asset: Privy::Models::TransferReceivedTransactionDetail::asset, + chain: Privy::Models::TransferReceivedTransactionDetail::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: String?, + sender: String, + sender_privy_user_id: String?, + type: Privy::Models::TransferReceivedTransactionDetail::type_ + } + + class TransferReceivedTransactionDetail < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::Models::TransferReceivedTransactionDetail::asset + + attr_accessor chain: Privy::Models::TransferReceivedTransactionDetail::chain + + attr_accessor display_values: ::Hash[Symbol, String] + + attr_accessor raw_value: String + + attr_accessor raw_value_decimals: Float + + attr_accessor recipient: String + + attr_accessor recipient_privy_user_id: String? + + attr_accessor sender: String + + attr_accessor sender_privy_user_id: String? + + attr_accessor type: Privy::Models::TransferReceivedTransactionDetail::type_ + + def initialize: ( + asset: Privy::Models::TransferReceivedTransactionDetail::asset, + chain: Privy::Models::TransferReceivedTransactionDetail::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: String?, + sender: String, + sender_privy_user_id: String?, + type: Privy::Models::TransferReceivedTransactionDetail::type_ + ) -> void + + def to_hash: -> { + asset: Privy::Models::TransferReceivedTransactionDetail::asset, + chain: Privy::Models::TransferReceivedTransactionDetail::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: String?, + sender: String, + sender_privy_user_id: String?, + type: Privy::Models::TransferReceivedTransactionDetail::type_ + } + + type asset = + :usdc | :"usdc.e" | :eth | :pol | :usdt | :eurc | :usdb | :sol | String + + module Asset + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::TransferReceivedTransactionDetail::asset] + + USDC: :usdc + USDC_E: :"usdc.e" + ETH: :eth + POL: :pol + USDT: :usdt + EURC: :eurc + USDB: :usdb + SOL: :sol + end + + type chain = + :ethereum + | :arbitrum + | :base + | :tempo + | :linea + | :optimism + | :polygon + | :solana + | :zksync_era + | :sepolia + | :arbitrum_sepolia + | :base_sepolia + | :linea_testnet + | :optimism_sepolia + | :polygon_amoy + | :solana_devnet + | :solana_testnet + + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + ARBITRUM: :arbitrum + BASE: :base + TEMPO: :tempo + LINEA: :linea + OPTIMISM: :optimism + POLYGON: :polygon + SOLANA: :solana + ZKSYNC_ERA: :zksync_era + SEPOLIA: :sepolia + ARBITRUM_SEPOLIA: :arbitrum_sepolia + BASE_SEPOLIA: :base_sepolia + LINEA_TESTNET: :linea_testnet + OPTIMISM_SEPOLIA: :optimism_sepolia + POLYGON_AMOY: :polygon_amoy + SOLANA_DEVNET: :solana_devnet + SOLANA_TESTNET: :solana_testnet + + def self?.values: -> ::Array[Privy::Models::TransferReceivedTransactionDetail::chain] + end + + type type_ = :transfer_received + + module Type + extend Privy::Internal::Type::Enum + + TRANSFER_RECEIVED: :transfer_received + + def self?.values: -> ::Array[Privy::Models::TransferReceivedTransactionDetail::type_] + end + end + end +end diff --git a/sig/privy/models/transfer_request_body.rbs b/sig/privy/models/transfer_request_body.rbs new file mode 100644 index 0000000..1bf3f0e --- /dev/null +++ b/sig/privy/models/transfer_request_body.rbs @@ -0,0 +1,41 @@ +module Privy + module Models + type transfer_request_body = + { + destination: Privy::TokenTransferDestination, + source: Privy::Models::token_transfer_source, + amount_type: Privy::Models::amount_type, + slippage_bps: Integer + } + + class TransferRequestBody < Privy::Internal::Type::BaseModel + attr_accessor destination: Privy::TokenTransferDestination + + attr_accessor source: Privy::Models::token_transfer_source + + attr_reader amount_type: Privy::Models::amount_type? + + def amount_type=: ( + Privy::Models::amount_type + ) -> Privy::Models::amount_type + + attr_reader slippage_bps: Integer? + + def slippage_bps=: (Integer) -> Integer + + def initialize: ( + destination: Privy::TokenTransferDestination, + source: Privy::Models::token_transfer_source, + ?amount_type: Privy::Models::amount_type, + ?slippage_bps: Integer + ) -> void + + def to_hash: -> { + destination: Privy::TokenTransferDestination, + source: Privy::Models::token_transfer_source, + amount_type: Privy::Models::amount_type, + slippage_bps: Integer + } + end + end +end diff --git a/sig/privy/models/transfer_sent_transaction_detail.rbs b/sig/privy/models/transfer_sent_transaction_detail.rbs new file mode 100644 index 0000000..41b6bb4 --- /dev/null +++ b/sig/privy/models/transfer_sent_transaction_detail.rbs @@ -0,0 +1,136 @@ +module Privy + module Models + type transfer_sent_transaction_detail = + { + asset: Privy::Models::TransferSentTransactionDetail::asset, + chain: Privy::Models::TransferSentTransactionDetail::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: String?, + sender: String, + sender_privy_user_id: String?, + type: Privy::Models::TransferSentTransactionDetail::type_ + } + + class TransferSentTransactionDetail < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::Models::TransferSentTransactionDetail::asset + + attr_accessor chain: Privy::Models::TransferSentTransactionDetail::chain + + attr_accessor display_values: ::Hash[Symbol, String] + + attr_accessor raw_value: String + + attr_accessor raw_value_decimals: Float + + attr_accessor recipient: String + + attr_accessor recipient_privy_user_id: String? + + attr_accessor sender: String + + attr_accessor sender_privy_user_id: String? + + attr_accessor type: Privy::Models::TransferSentTransactionDetail::type_ + + def initialize: ( + asset: Privy::Models::TransferSentTransactionDetail::asset, + chain: Privy::Models::TransferSentTransactionDetail::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: String?, + sender: String, + sender_privy_user_id: String?, + type: Privy::Models::TransferSentTransactionDetail::type_ + ) -> void + + def to_hash: -> { + asset: Privy::Models::TransferSentTransactionDetail::asset, + chain: Privy::Models::TransferSentTransactionDetail::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float, + recipient: String, + recipient_privy_user_id: String?, + sender: String, + sender_privy_user_id: String?, + type: Privy::Models::TransferSentTransactionDetail::type_ + } + + type asset = + :usdc | :"usdc.e" | :eth | :pol | :usdt | :eurc | :usdb | :sol | String + + module Asset + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::TransferSentTransactionDetail::asset] + + USDC: :usdc + USDC_E: :"usdc.e" + ETH: :eth + POL: :pol + USDT: :usdt + EURC: :eurc + USDB: :usdb + SOL: :sol + end + + type chain = + :ethereum + | :arbitrum + | :base + | :tempo + | :linea + | :optimism + | :polygon + | :solana + | :zksync_era + | :sepolia + | :arbitrum_sepolia + | :base_sepolia + | :linea_testnet + | :optimism_sepolia + | :polygon_amoy + | :solana_devnet + | :solana_testnet + + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + ARBITRUM: :arbitrum + BASE: :base + TEMPO: :tempo + LINEA: :linea + OPTIMISM: :optimism + POLYGON: :polygon + SOLANA: :solana + ZKSYNC_ERA: :zksync_era + SEPOLIA: :sepolia + ARBITRUM_SEPOLIA: :arbitrum_sepolia + BASE_SEPOLIA: :base_sepolia + LINEA_TESTNET: :linea_testnet + OPTIMISM_SEPOLIA: :optimism_sepolia + POLYGON_AMOY: :polygon_amoy + SOLANA_DEVNET: :solana_devnet + SOLANA_TESTNET: :solana_testnet + + def self?.values: -> ::Array[Privy::Models::TransferSentTransactionDetail::chain] + end + + type type_ = :transfer_sent + + module Type + extend Privy::Internal::Type::Enum + + TRANSFER_SENT: :transfer_sent + + def self?.values: -> ::Array[Privy::Models::TransferSentTransactionDetail::type_] + end + end + end +end diff --git a/sig/privy/models/transfer_siwe_input.rbs b/sig/privy/models/transfer_siwe_input.rbs new file mode 100644 index 0000000..91fd54f --- /dev/null +++ b/sig/privy/models/transfer_siwe_input.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type transfer_siwe_input = + { + address: String, + nonce: String, + chain_id: String?, + connector_type: String?, + wallet_client_type: String? + } + + class TransferSiweInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor nonce: String + + attr_accessor chain_id: String? + + attr_accessor connector_type: String? + + attr_accessor wallet_client_type: String? + + def initialize: ( + address: String, + nonce: String, + ?chain_id: String?, + ?connector_type: String?, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + address: String, + nonce: String, + chain_id: String?, + connector_type: String?, + wallet_client_type: String? + } + end + end +end diff --git a/sig/privy/models/transfer_siws_input.rbs b/sig/privy/models/transfer_siws_input.rbs new file mode 100644 index 0000000..005276b --- /dev/null +++ b/sig/privy/models/transfer_siws_input.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type transfer_siws_input = + { + address: String, + nonce: String, + connector_type: String?, + wallet_client_type: String? + } + + class TransferSiwsInput < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor nonce: String + + attr_accessor connector_type: String? + + attr_accessor wallet_client_type: String? + + def initialize: ( + address: String, + nonce: String, + ?connector_type: String?, + ?wallet_client_type: String? + ) -> void + + def to_hash: -> { + address: String, + nonce: String, + connector_type: String?, + wallet_client_type: String? + } + end + end +end diff --git a/sig/privy/models/transfer_telegram_input.rbs b/sig/privy/models/transfer_telegram_input.rbs new file mode 100644 index 0000000..975e831 --- /dev/null +++ b/sig/privy/models/transfer_telegram_input.rbs @@ -0,0 +1,38 @@ +module Privy + module Models + type transfer_telegram_input = + { + nonce: String, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + + class TransferTelegramInput < Privy::Internal::Type::BaseModel + attr_accessor nonce: String + + attr_reader telegram_auth_result: Privy::TelegramAuthResult? + + def telegram_auth_result=: ( + Privy::TelegramAuthResult + ) -> Privy::TelegramAuthResult + + attr_reader telegram_web_app_data: Privy::TelegramWebAppData? + + def telegram_web_app_data=: ( + Privy::TelegramWebAppData + ) -> Privy::TelegramWebAppData + + def initialize: ( + nonce: String, + ?telegram_auth_result: Privy::TelegramAuthResult, + ?telegram_web_app_data: Privy::TelegramWebAppData + ) -> void + + def to_hash: -> { + nonce: String, + telegram_auth_result: Privy::TelegramAuthResult, + telegram_web_app_data: Privy::TelegramWebAppData + } + end + end +end diff --git a/sig/privy/models/tron_calldata_condition.rbs b/sig/privy/models/tron_calldata_condition.rbs new file mode 100644 index 0000000..2b484de --- /dev/null +++ b/sig/privy/models/tron_calldata_condition.rbs @@ -0,0 +1,50 @@ +module Privy + module Models + type tron_calldata_condition = + { + abi: Privy::Models::abi_schema, + field: String, + field_source: Privy::Models::TronCalldataCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class TronCalldataCondition < Privy::Internal::Type::BaseModel + attr_accessor abi: Privy::Models::abi_schema + + attr_accessor field: String + + attr_accessor field_source: Privy::Models::TronCalldataCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + abi: Privy::Models::abi_schema, + field: String, + field_source: Privy::Models::TronCalldataCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + abi: Privy::Models::abi_schema, + field: String, + field_source: Privy::Models::TronCalldataCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field_source = :tron_trigger_smart_contract_data + + module FieldSource + extend Privy::Internal::Type::Enum + + TRON_TRIGGER_SMART_CONTRACT_DATA: :tron_trigger_smart_contract_data + + def self?.values: -> ::Array[Privy::Models::TronCalldataCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/tron_transaction_condition.rbs b/sig/privy/models/tron_transaction_condition.rbs new file mode 100644 index 0000000..a407fd5 --- /dev/null +++ b/sig/privy/models/tron_transaction_condition.rbs @@ -0,0 +1,66 @@ +module Privy + module Models + type tron_transaction_condition = + { + field: Privy::Models::TronTransactionCondition::field, + field_source: Privy::Models::TronTransactionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + class TronTransactionCondition < Privy::Internal::Type::BaseModel + attr_accessor field: Privy::Models::TronTransactionCondition::field + + attr_accessor field_source: Privy::Models::TronTransactionCondition::field_source + + attr_accessor operator: Privy::Models::condition_operator + + attr_accessor value: Privy::Models::condition_value + + def initialize: ( + field: Privy::Models::TronTransactionCondition::field, + field_source: Privy::Models::TronTransactionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + ) -> void + + def to_hash: -> { + field: Privy::Models::TronTransactionCondition::field, + field_source: Privy::Models::TronTransactionCondition::field_source, + operator: Privy::Models::condition_operator, + value: Privy::Models::condition_value + } + + type field = + :"TransferContract.to_address" + | :"TransferContract.amount" + | :"TriggerSmartContract.contract_address" + | :"TriggerSmartContract.call_value" + | :"TriggerSmartContract.token_id" + | :"TriggerSmartContract.call_token_value" + + module Field + extend Privy::Internal::Type::Enum + + TRANSFER_CONTRACT_TO_ADDRESS: :"TransferContract.to_address" + TRANSFER_CONTRACT_AMOUNT: :"TransferContract.amount" + TRIGGER_SMART_CONTRACT_CONTRACT_ADDRESS: :"TriggerSmartContract.contract_address" + TRIGGER_SMART_CONTRACT_CALL_VALUE: :"TriggerSmartContract.call_value" + TRIGGER_SMART_CONTRACT_TOKEN_ID: :"TriggerSmartContract.token_id" + TRIGGER_SMART_CONTRACT_CALL_TOKEN_VALUE: :"TriggerSmartContract.call_token_value" + + def self?.values: -> ::Array[Privy::Models::TronTransactionCondition::field] + end + + type field_source = :tron_transaction + + module FieldSource + extend Privy::Internal::Type::Enum + + TRON_TRANSACTION: :tron_transaction + + def self?.values: -> ::Array[Privy::Models::TronTransactionCondition::field_source] + end + end + end +end diff --git a/sig/privy/models/typed_data_domain_input_params.rbs b/sig/privy/models/typed_data_domain_input_params.rbs new file mode 100644 index 0000000..c5b0690 --- /dev/null +++ b/sig/privy/models/typed_data_domain_input_params.rbs @@ -0,0 +1,7 @@ +module Privy + module Models + type typed_data_domain_input_params = ::Hash[Symbol, top] + + TypedDataDomainInputParams: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/typed_data_type_field_input.rbs b/sig/privy/models/typed_data_type_field_input.rbs new file mode 100644 index 0000000..3d57c5a --- /dev/null +++ b/sig/privy/models/typed_data_type_field_input.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type typed_data_type_field_input = { name: String, type: String } + + class TypedDataTypeFieldInput < Privy::Internal::Type::BaseModel + attr_accessor name: String + + attr_accessor type: String + + def initialize: (name: String, type: String) -> void + + def to_hash: -> { name: String, type: String } + end + end +end diff --git a/sig/privy/models/typed_data_types_input_params.rbs b/sig/privy/models/typed_data_types_input_params.rbs new file mode 100644 index 0000000..8363b27 --- /dev/null +++ b/sig/privy/models/typed_data_types_input_params.rbs @@ -0,0 +1,8 @@ +module Privy + module Models + type typed_data_types_input_params = + ::Hash[Symbol, ::Array[Privy::TypedDataTypeFieldInput]] + + TypedDataTypesInputParams: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/unlink_passkey_input.rbs b/sig/privy/models/unlink_passkey_input.rbs new file mode 100644 index 0000000..7af130d --- /dev/null +++ b/sig/privy/models/unlink_passkey_input.rbs @@ -0,0 +1,17 @@ +module Privy + module Models + type unlink_passkey_input = { credential_id: String, remove_as_mfa: bool } + + class UnlinkPasskeyInput < Privy::Internal::Type::BaseModel + attr_accessor credential_id: String + + attr_reader remove_as_mfa: bool? + + def remove_as_mfa=: (bool) -> bool + + def initialize: (credential_id: String, ?remove_as_mfa: bool) -> void + + def to_hash: -> { credential_id: String, remove_as_mfa: bool } + end + end +end diff --git a/sig/privy/models/unsafe_unwrap_webhook_event.rbs b/sig/privy/models/unsafe_unwrap_webhook_event.rbs new file mode 100644 index 0000000..b517162 --- /dev/null +++ b/sig/privy/models/unsafe_unwrap_webhook_event.rbs @@ -0,0 +1,61 @@ +module Privy + module Models + type unsafe_unwrap_webhook_event = + Privy::IntentAuthorizedWebhookPayload + | Privy::IntentCreatedWebhookPayload + | Privy::IntentExecutedWebhookPayload + | Privy::IntentFailedWebhookPayload + | Privy::IntentRejectedWebhookPayload + | Privy::MfaDisabledWebhookPayload + | Privy::MfaEnabledWebhookPayload + | Privy::TransactionBroadcastedWebhookPayload + | Privy::TransactionConfirmedWebhookPayload + | Privy::TransactionExecutionRevertedWebhookPayload + | Privy::TransactionFailedWebhookPayload + | Privy::TransactionProviderErrorWebhookPayload + | Privy::TransactionReplacedWebhookPayload + | Privy::TransactionStillPendingWebhookPayload + | Privy::UserAuthenticatedWebhookPayload + | Privy::UserCreatedWebhookPayload + | Privy::UserLinkedAccountWebhookPayload + | Privy::UserTransferredAccountWebhookPayload + | Privy::UserUnlinkedAccountWebhookPayload + | Privy::UserUpdatedAccountWebhookPayload + | Privy::UserWalletCreatedWebhookPayload + | Privy::UserOperationCompletedWebhookPayload + | Privy::FundsDepositedWebhookPayload + | Privy::FundsWithdrawnWebhookPayload + | Privy::PrivateKeyExportWebhookPayload + | Privy::WalletRecoveredWebhookPayload + | Privy::WalletRecoverySetupWebhookPayload + | Privy::WalletActionEarnDepositCreatedWebhookPayload + | Privy::WalletActionEarnDepositFailedWebhookPayload + | Privy::WalletActionEarnDepositRejectedWebhookPayload + | Privy::WalletActionEarnDepositSucceededWebhookPayload + | Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload + | Privy::WalletActionEarnWithdrawCreatedWebhookPayload + | Privy::WalletActionEarnWithdrawFailedWebhookPayload + | Privy::WalletActionEarnWithdrawRejectedWebhookPayload + | Privy::WalletActionEarnWithdrawSucceededWebhookPayload + | Privy::WalletActionSwapCreatedWebhookPayload + | Privy::WalletActionSwapFailedWebhookPayload + | Privy::WalletActionSwapRejectedWebhookPayload + | Privy::WalletActionSwapSucceededWebhookPayload + | Privy::WalletActionTransferCreatedWebhookPayload + | Privy::WalletActionTransferFailedWebhookPayload + | Privy::WalletActionTransferRejectedWebhookPayload + | Privy::WalletActionTransferSucceededWebhookPayload + | Privy::YieldClaimConfirmedWebhookPayload + | Privy::YieldDepositConfirmedWebhookPayload + | Privy::YieldWithdrawConfirmedWebhookPayload + + module UnsafeUnwrapWebhookEvent + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::unsafe_unwrap_webhook_event] + end + end +end diff --git a/sig/privy/models/unsigned_ethereum_transaction.rbs b/sig/privy/models/unsigned_ethereum_transaction.rbs new file mode 100644 index 0000000..3fc482d --- /dev/null +++ b/sig/privy/models/unsigned_ethereum_transaction.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type unsigned_ethereum_transaction = + Privy::UnsignedStandardEthereumTransaction + | Privy::UnsignedTempoTransaction + + module UnsignedEthereumTransaction + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::unsigned_ethereum_transaction] + end + end +end diff --git a/sig/privy/models/unsigned_standard_ethereum_transaction.rbs b/sig/privy/models/unsigned_standard_ethereum_transaction.rbs new file mode 100644 index 0000000..d613c39 --- /dev/null +++ b/sig/privy/models/unsigned_standard_ethereum_transaction.rbs @@ -0,0 +1,118 @@ +module Privy + module Models + type unsigned_standard_ethereum_transaction = + { + authorization_list: ::Array[Privy::EthereumSign7702Authorization], + chain_id: Privy::Models::quantity, + data: String, + from: String, + gas_limit: Privy::Models::quantity, + gas_price: Privy::Models::quantity, + max_fee_per_gas: Privy::Models::quantity, + max_priority_fee_per_gas: Privy::Models::quantity, + nonce: Privy::Models::quantity, + to: String, + type: Privy::Models::UnsignedStandardEthereumTransaction::type_, + value: Privy::Models::quantity + } + + class UnsignedStandardEthereumTransaction < Privy::Internal::Type::BaseModel + attr_reader authorization_list: ::Array[Privy::EthereumSign7702Authorization]? + + def authorization_list=: ( + ::Array[Privy::EthereumSign7702Authorization] + ) -> ::Array[Privy::EthereumSign7702Authorization] + + attr_reader chain_id: Privy::Models::quantity? + + def chain_id=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader data: String? + + def data=: (String) -> String + + attr_reader from: String? + + def from=: (String) -> String + + attr_reader gas_limit: Privy::Models::quantity? + + def gas_limit=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader gas_price: Privy::Models::quantity? + + def gas_price=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader max_fee_per_gas: Privy::Models::quantity? + + def max_fee_per_gas=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader max_priority_fee_per_gas: Privy::Models::quantity? + + def max_priority_fee_per_gas=: ( + Privy::Models::quantity + ) -> Privy::Models::quantity + + attr_reader nonce: Privy::Models::quantity? + + def nonce=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader to: String? + + def to=: (String) -> String + + attr_reader type: Privy::Models::UnsignedStandardEthereumTransaction::type_? + + def type=: ( + Privy::Models::UnsignedStandardEthereumTransaction::type_ + ) -> Privy::Models::UnsignedStandardEthereumTransaction::type_ + + attr_reader value: Privy::Models::quantity? + + def value=: (Privy::Models::quantity) -> Privy::Models::quantity + + def initialize: ( + ?authorization_list: ::Array[Privy::EthereumSign7702Authorization], + ?chain_id: Privy::Models::quantity, + ?data: String, + ?from: String, + ?gas_limit: Privy::Models::quantity, + ?gas_price: Privy::Models::quantity, + ?max_fee_per_gas: Privy::Models::quantity, + ?max_priority_fee_per_gas: Privy::Models::quantity, + ?nonce: Privy::Models::quantity, + ?to: String, + ?type: Privy::Models::UnsignedStandardEthereumTransaction::type_, + ?value: Privy::Models::quantity + ) -> void + + def to_hash: -> { + authorization_list: ::Array[Privy::EthereumSign7702Authorization], + chain_id: Privy::Models::quantity, + data: String, + from: String, + gas_limit: Privy::Models::quantity, + gas_price: Privy::Models::quantity, + max_fee_per_gas: Privy::Models::quantity, + max_priority_fee_per_gas: Privy::Models::quantity, + nonce: Privy::Models::quantity, + to: String, + type: Privy::Models::UnsignedStandardEthereumTransaction::type_, + value: Privy::Models::quantity + } + + type type_ = Float + + module Type + extend Privy::Internal::Type::Enum + + TYPE_0: 0 + TYPE_1: 1 + TYPE_2: 2 + TYPE_4: 4 + + def self?.values: -> ::Array[Privy::Models::UnsignedStandardEthereumTransaction::type_] + end + end + end +end diff --git a/sig/privy/models/unsigned_tempo_transaction.rbs b/sig/privy/models/unsigned_tempo_transaction.rbs new file mode 100644 index 0000000..6d40c73 --- /dev/null +++ b/sig/privy/models/unsigned_tempo_transaction.rbs @@ -0,0 +1,146 @@ +module Privy + module Models + type unsigned_tempo_transaction = + { + calls: ::Array[Privy::TempoCall], + type: Privy::Models::UnsignedTempoTransaction::type_, + aa_authorization_list: ::Array[Privy::TempoAaAuthorization], + access_list: ::Array[Privy::UnsignedTempoTransaction::AccessList], + chain_id: Privy::Models::quantity, + fee_payer_signature: Privy::TempoFeePayerSignature, + fee_token: String, + from: String, + gas_limit: Privy::Models::quantity, + max_fee_per_gas: Privy::Models::quantity, + max_priority_fee_per_gas: Privy::Models::quantity, + nonce: Privy::Models::quantity, + nonce_key: Privy::Models::quantity, + valid_after: Privy::Models::quantity, + valid_before: Privy::Models::quantity + } + + class UnsignedTempoTransaction < Privy::Internal::Type::BaseModel + attr_accessor calls: ::Array[Privy::TempoCall] + + attr_accessor type: Privy::Models::UnsignedTempoTransaction::type_ + + attr_reader aa_authorization_list: ::Array[Privy::TempoAaAuthorization]? + + def aa_authorization_list=: ( + ::Array[Privy::TempoAaAuthorization] + ) -> ::Array[Privy::TempoAaAuthorization] + + attr_reader access_list: ::Array[Privy::UnsignedTempoTransaction::AccessList]? + + def access_list=: ( + ::Array[Privy::UnsignedTempoTransaction::AccessList] + ) -> ::Array[Privy::UnsignedTempoTransaction::AccessList] + + attr_reader chain_id: Privy::Models::quantity? + + def chain_id=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader fee_payer_signature: Privy::TempoFeePayerSignature? + + def fee_payer_signature=: ( + Privy::TempoFeePayerSignature + ) -> Privy::TempoFeePayerSignature + + attr_reader fee_token: String? + + def fee_token=: (String) -> String + + attr_reader from: String? + + def from=: (String) -> String + + attr_reader gas_limit: Privy::Models::quantity? + + def gas_limit=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader max_fee_per_gas: Privy::Models::quantity? + + def max_fee_per_gas=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader max_priority_fee_per_gas: Privy::Models::quantity? + + def max_priority_fee_per_gas=: ( + Privy::Models::quantity + ) -> Privy::Models::quantity + + attr_reader nonce: Privy::Models::quantity? + + def nonce=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader nonce_key: Privy::Models::quantity? + + def nonce_key=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader valid_after: Privy::Models::quantity? + + def valid_after=: (Privy::Models::quantity) -> Privy::Models::quantity + + attr_reader valid_before: Privy::Models::quantity? + + def valid_before=: (Privy::Models::quantity) -> Privy::Models::quantity + + def initialize: ( + calls: ::Array[Privy::TempoCall], + type: Privy::Models::UnsignedTempoTransaction::type_, + ?aa_authorization_list: ::Array[Privy::TempoAaAuthorization], + ?access_list: ::Array[Privy::UnsignedTempoTransaction::AccessList], + ?chain_id: Privy::Models::quantity, + ?fee_payer_signature: Privy::TempoFeePayerSignature, + ?fee_token: String, + ?from: String, + ?gas_limit: Privy::Models::quantity, + ?max_fee_per_gas: Privy::Models::quantity, + ?max_priority_fee_per_gas: Privy::Models::quantity, + ?nonce: Privy::Models::quantity, + ?nonce_key: Privy::Models::quantity, + ?valid_after: Privy::Models::quantity, + ?valid_before: Privy::Models::quantity + ) -> void + + def to_hash: -> { + calls: ::Array[Privy::TempoCall], + type: Privy::Models::UnsignedTempoTransaction::type_, + aa_authorization_list: ::Array[Privy::TempoAaAuthorization], + access_list: ::Array[Privy::UnsignedTempoTransaction::AccessList], + chain_id: Privy::Models::quantity, + fee_payer_signature: Privy::TempoFeePayerSignature, + fee_token: String, + from: String, + gas_limit: Privy::Models::quantity, + max_fee_per_gas: Privy::Models::quantity, + max_priority_fee_per_gas: Privy::Models::quantity, + nonce: Privy::Models::quantity, + nonce_key: Privy::Models::quantity, + valid_after: Privy::Models::quantity, + valid_before: Privy::Models::quantity + } + + type type_ = Float + + module Type + extend Privy::Internal::Type::Enum + + TYPE_118: 118 + + def self?.values: -> ::Array[Privy::Models::UnsignedTempoTransaction::type_] + end + + type access_list = { address: String, storage_keys: ::Array[String] } + + class AccessList < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor storage_keys: ::Array[String] + + def initialize: (address: String, storage_keys: ::Array[String]) -> void + + def to_hash: -> { address: String, storage_keys: ::Array[String] } + end + end + end +end diff --git a/sig/privy/models/update_account_from_wallet_ids_input.rbs b/sig/privy/models/update_account_from_wallet_ids_input.rbs new file mode 100644 index 0000000..085dd23 --- /dev/null +++ b/sig/privy/models/update_account_from_wallet_ids_input.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type update_account_from_wallet_ids_input = + { wallet_ids: Privy::Models::account_wallet_ids, display_name: String } + + class UpdateAccountFromWalletIDsInput < Privy::Internal::Type::BaseModel + attr_accessor wallet_ids: Privy::Models::account_wallet_ids + + attr_reader display_name: String? + + def display_name=: (String) -> String + + def initialize: ( + wallet_ids: Privy::Models::account_wallet_ids, + ?display_name: String + ) -> void + + def to_hash: -> { + wallet_ids: Privy::Models::account_wallet_ids, + display_name: String + } + end + end +end diff --git a/sig/privy/models/update_account_from_wallets_configuration_input.rbs b/sig/privy/models/update_account_from_wallets_configuration_input.rbs new file mode 100644 index 0000000..54135ca --- /dev/null +++ b/sig/privy/models/update_account_from_wallets_configuration_input.rbs @@ -0,0 +1,31 @@ +module Privy + module Models + type update_account_from_wallets_configuration_input = + { + display_name: String, + wallets_configuration: Privy::Models::account_wallets_configuration + } + + class UpdateAccountFromWalletsConfigurationInput < Privy::Internal::Type::BaseModel + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader wallets_configuration: Privy::Models::account_wallets_configuration? + + def wallets_configuration=: ( + Privy::Models::account_wallets_configuration + ) -> Privy::Models::account_wallets_configuration + + def initialize: ( + ?display_name: String, + ?wallets_configuration: Privy::Models::account_wallets_configuration + ) -> void + + def to_hash: -> { + display_name: String, + wallets_configuration: Privy::Models::account_wallets_configuration + } + end + end +end diff --git a/sig/privy/models/update_account_input.rbs b/sig/privy/models/update_account_input.rbs new file mode 100644 index 0000000..3f3b701 --- /dev/null +++ b/sig/privy/models/update_account_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type update_account_input = + Privy::UpdateAccountFromWalletsConfigurationInput + | Privy::UpdateAccountFromWalletIDsInput + + module UpdateAccountInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::update_account_input] + end + end +end diff --git a/sig/privy/models/update_condition_set_request_body.rbs b/sig/privy/models/update_condition_set_request_body.rbs new file mode 100644 index 0000000..98ed4a2 --- /dev/null +++ b/sig/privy/models/update_condition_set_request_body.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type update_condition_set_request_body = + { name: String, owner: Privy::Models::owner_input?, owner_id: String? } + + class UpdateConditionSetRequestBody < Privy::Internal::Type::BaseModel + attr_reader name: String? + + def name=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + def initialize: ( + ?name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String? + ) -> void + + def to_hash: -> { + name: String, + owner: Privy::Models::owner_input?, + owner_id: String? + } + end + end +end diff --git a/sig/privy/models/update_organization_secret_signing_key_input.rbs b/sig/privy/models/update_organization_secret_signing_key_input.rbs new file mode 100644 index 0000000..2408b7f --- /dev/null +++ b/sig/privy/models/update_organization_secret_signing_key_input.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type update_organization_secret_signing_key_input = + { signing_public_key: String? } + + class UpdateOrganizationSecretSigningKeyInput < Privy::Models::OrganizationSecretIDInput + def signing_public_key: -> String? + + def signing_public_key=: (String? _) -> String? + + def initialize: (signing_public_key: String?) -> void + + def to_hash: -> { signing_public_key: String? } + end + end +end diff --git a/sig/privy/models/user.rbs b/sig/privy/models/user.rbs new file mode 100644 index 0000000..705933d --- /dev/null +++ b/sig/privy/models/user.rbs @@ -0,0 +1,54 @@ +module Privy + module Models + type user = + { + id: String, + created_at: Float, + has_accepted_terms: bool, + is_guest: bool, + linked_accounts: ::Array[Privy::Models::linked_account], + mfa_methods: ::Array[Privy::Models::linked_mfa_method], + custom_metadata: Privy::Models::custom_metadata + } + + class User < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor created_at: Float + + attr_accessor has_accepted_terms: bool + + attr_accessor is_guest: bool + + attr_accessor linked_accounts: ::Array[Privy::Models::linked_account] + + attr_accessor mfa_methods: ::Array[Privy::Models::linked_mfa_method] + + attr_reader custom_metadata: Privy::Models::custom_metadata? + + def custom_metadata=: ( + Privy::Models::custom_metadata + ) -> Privy::Models::custom_metadata + + def initialize: ( + id: String, + created_at: Float, + has_accepted_terms: bool, + is_guest: bool, + linked_accounts: ::Array[Privy::Models::linked_account], + mfa_methods: ::Array[Privy::Models::linked_mfa_method], + ?custom_metadata: Privy::Models::custom_metadata + ) -> void + + def to_hash: -> { + id: String, + created_at: Float, + has_accepted_terms: bool, + is_guest: bool, + linked_accounts: ::Array[Privy::Models::linked_account], + mfa_methods: ::Array[Privy::Models::linked_mfa_method], + custom_metadata: Privy::Models::custom_metadata + } + end + end +end diff --git a/sig/privy/models/user_authenticated_webhook_payload.rbs b/sig/privy/models/user_authenticated_webhook_payload.rbs new file mode 100644 index 0000000..8f99556 --- /dev/null +++ b/sig/privy/models/user_authenticated_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type user_authenticated_webhook_payload = + { + account: Privy::Models::linked_account, + type: Privy::Models::UserAuthenticatedWebhookPayload::type_, + user: Privy::User + } + + class UserAuthenticatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor account: Privy::Models::linked_account + + attr_accessor type: Privy::Models::UserAuthenticatedWebhookPayload::type_ + + attr_accessor user: Privy::User + + def initialize: ( + account: Privy::Models::linked_account, + type: Privy::Models::UserAuthenticatedWebhookPayload::type_, + user: Privy::User + ) -> void + + def to_hash: -> { + account: Privy::Models::linked_account, + type: Privy::Models::UserAuthenticatedWebhookPayload::type_, + user: Privy::User + } + + type type_ = :"user.authenticated" + + module Type + extend Privy::Internal::Type::Enum + + USER_AUTHENTICATED: :"user.authenticated" + + def self?.values: -> ::Array[Privy::Models::UserAuthenticatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_batch_create_input.rbs b/sig/privy/models/user_batch_create_input.rbs new file mode 100644 index 0000000..ebedb99 --- /dev/null +++ b/sig/privy/models/user_batch_create_input.rbs @@ -0,0 +1,93 @@ +module Privy + module Models + type user_batch_create_input = + { users: ::Array[Privy::UserBatchCreateInput::User] } + + class UserBatchCreateInput < Privy::Internal::Type::BaseModel + attr_accessor users: ::Array[Privy::UserBatchCreateInput::User] + + def initialize: ( + users: ::Array[Privy::UserBatchCreateInput::User] + ) -> void + + def to_hash: -> { users: ::Array[Privy::UserBatchCreateInput::User] } + + type user = + { + linked_accounts: ::Array[Privy::Models::linked_account_input], + create_embedded_wallet: bool, + create_ethereum_smart_wallet: bool, + create_ethereum_wallet: bool, + create_n_embedded_wallets: Float, + create_n_ethereum_wallets: Float, + create_solana_wallet: bool, + custom_metadata: Privy::Models::custom_metadata, + wallets: ::Array[Privy::WalletCreationInput] + } + + class User < Privy::Internal::Type::BaseModel + attr_accessor linked_accounts: ::Array[Privy::Models::linked_account_input] + + attr_reader create_embedded_wallet: bool? + + def create_embedded_wallet=: (bool) -> bool + + attr_reader create_ethereum_smart_wallet: bool? + + def create_ethereum_smart_wallet=: (bool) -> bool + + attr_reader create_ethereum_wallet: bool? + + def create_ethereum_wallet=: (bool) -> bool + + attr_reader create_n_embedded_wallets: Float? + + def create_n_embedded_wallets=: (Float) -> Float + + attr_reader create_n_ethereum_wallets: Float? + + def create_n_ethereum_wallets=: (Float) -> Float + + attr_reader create_solana_wallet: bool? + + def create_solana_wallet=: (bool) -> bool + + attr_reader custom_metadata: Privy::Models::custom_metadata? + + def custom_metadata=: ( + Privy::Models::custom_metadata + ) -> Privy::Models::custom_metadata + + attr_reader wallets: ::Array[Privy::WalletCreationInput]? + + def wallets=: ( + ::Array[Privy::WalletCreationInput] + ) -> ::Array[Privy::WalletCreationInput] + + def initialize: ( + linked_accounts: ::Array[Privy::Models::linked_account_input], + ?create_embedded_wallet: bool, + ?create_ethereum_smart_wallet: bool, + ?create_ethereum_wallet: bool, + ?create_n_embedded_wallets: Float, + ?create_n_ethereum_wallets: Float, + ?create_solana_wallet: bool, + ?custom_metadata: Privy::Models::custom_metadata, + ?wallets: ::Array[Privy::WalletCreationInput] + ) -> void + + def to_hash: -> { + linked_accounts: ::Array[Privy::Models::linked_account_input], + create_embedded_wallet: bool, + create_ethereum_smart_wallet: bool, + create_ethereum_wallet: bool, + create_n_embedded_wallets: Float, + create_n_ethereum_wallets: Float, + create_solana_wallet: bool, + custom_metadata: Privy::Models::custom_metadata, + wallets: ::Array[Privy::WalletCreationInput] + } + end + end + end +end diff --git a/sig/privy/models/user_create_params.rbs b/sig/privy/models/user_create_params.rbs new file mode 100644 index 0000000..68bc594 --- /dev/null +++ b/sig/privy/models/user_create_params.rbs @@ -0,0 +1,105 @@ +module Privy + module Models + type user_create_params = + { + linked_accounts: ::Array[Privy::Models::linked_account_input], + custom_metadata: Privy::Models::custom_metadata, + wallets: ::Array[Privy::UserCreateParams::Wallet] + } + & Privy::Internal::Type::request_parameters + + class UserCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor linked_accounts: ::Array[Privy::Models::linked_account_input] + + attr_reader custom_metadata: Privy::Models::custom_metadata? + + def custom_metadata=: ( + Privy::Models::custom_metadata + ) -> Privy::Models::custom_metadata + + attr_reader wallets: ::Array[Privy::UserCreateParams::Wallet]? + + def wallets=: ( + ::Array[Privy::UserCreateParams::Wallet] + ) -> ::Array[Privy::UserCreateParams::Wallet] + + def initialize: ( + linked_accounts: ::Array[Privy::Models::linked_account_input], + ?custom_metadata: Privy::Models::custom_metadata, + ?wallets: ::Array[Privy::UserCreateParams::Wallet], + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + linked_accounts: ::Array[Privy::Models::linked_account_input], + custom_metadata: Privy::Models::custom_metadata, + wallets: ::Array[Privy::UserCreateParams::Wallet], + request_options: Privy::RequestOptions + } + + type wallet = + { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: ::Array[Privy::UserCreateParams::Wallet::AdditionalSigner], + create_smart_wallet: bool, + policy_ids: ::Array[String] + } + + class Wallet < Privy::Internal::Type::BaseModel + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_reader additional_signers: ::Array[Privy::UserCreateParams::Wallet::AdditionalSigner]? + + def additional_signers=: ( + ::Array[Privy::UserCreateParams::Wallet::AdditionalSigner] + ) -> ::Array[Privy::UserCreateParams::Wallet::AdditionalSigner] + + attr_reader create_smart_wallet: bool? + + def create_smart_wallet=: (bool) -> bool + + attr_reader policy_ids: ::Array[String]? + + def policy_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + chain_type: Privy::Models::wallet_chain_type, + ?additional_signers: ::Array[Privy::UserCreateParams::Wallet::AdditionalSigner], + ?create_smart_wallet: bool, + ?policy_ids: ::Array[String] + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: ::Array[Privy::UserCreateParams::Wallet::AdditionalSigner], + create_smart_wallet: bool, + policy_ids: ::Array[String] + } + + type additional_signer = + { signer_id: String, override_policy_ids: ::Array[String] } + + class AdditionalSigner < Privy::Internal::Type::BaseModel + attr_accessor signer_id: String + + attr_reader override_policy_ids: ::Array[String]? + + def override_policy_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + signer_id: String, + ?override_policy_ids: ::Array[String] + ) -> void + + def to_hash: -> { + signer_id: String, + override_policy_ids: ::Array[String] + } + end + end + end + end +end diff --git a/sig/privy/models/user_created_webhook_payload.rbs b/sig/privy/models/user_created_webhook_payload.rbs new file mode 100644 index 0000000..2ada4de --- /dev/null +++ b/sig/privy/models/user_created_webhook_payload.rbs @@ -0,0 +1,35 @@ +module Privy + module Models + type user_created_webhook_payload = + { + type: Privy::Models::UserCreatedWebhookPayload::type_, + user: Privy::User + } + + class UserCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::UserCreatedWebhookPayload::type_ + + attr_accessor user: Privy::User + + def initialize: ( + type: Privy::Models::UserCreatedWebhookPayload::type_, + user: Privy::User + ) -> void + + def to_hash: -> { + type: Privy::Models::UserCreatedWebhookPayload::type_, + user: Privy::User + } + + type type_ = :"user.created" + + module Type + extend Privy::Internal::Type::Enum + + USER_CREATED: :"user.created" + + def self?.values: -> ::Array[Privy::Models::UserCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_delete_params.rbs b/sig/privy/models/user_delete_params.rbs new file mode 100644 index 0000000..de18180 --- /dev/null +++ b/sig/privy/models/user_delete_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_delete_params = + { user_id: String } & Privy::Internal::Type::request_parameters + + class UserDeleteParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor user_id: String + + def initialize: ( + user_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + user_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_custom_auth_id_params.rbs b/sig/privy/models/user_get_by_custom_auth_id_params.rbs new file mode 100644 index 0000000..1c7a614 --- /dev/null +++ b/sig/privy/models/user_get_by_custom_auth_id_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_custom_auth_id_params = + { custom_user_id: String } & Privy::Internal::Type::request_parameters + + class UserGetByCustomAuthIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor custom_user_id: String + + def initialize: ( + custom_user_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + custom_user_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_discord_username_params.rbs b/sig/privy/models/user_get_by_discord_username_params.rbs new file mode 100644 index 0000000..1b613f4 --- /dev/null +++ b/sig/privy/models/user_get_by_discord_username_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_discord_username_params = + { username: String } & Privy::Internal::Type::request_parameters + + class UserGetByDiscordUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor username: String + + def initialize: ( + username: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + username: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_email_address_params.rbs b/sig/privy/models/user_get_by_email_address_params.rbs new file mode 100644 index 0000000..33bb4ed --- /dev/null +++ b/sig/privy/models/user_get_by_email_address_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_email_address_params = + { address: String } & Privy::Internal::Type::request_parameters + + class UserGetByEmailAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor address: String + + def initialize: ( + address: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + address: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_farcaster_id_params.rbs b/sig/privy/models/user_get_by_farcaster_id_params.rbs new file mode 100644 index 0000000..e88494c --- /dev/null +++ b/sig/privy/models/user_get_by_farcaster_id_params.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type user_get_by_farcaster_id_params = + { fid: Float } & Privy::Internal::Type::request_parameters + + class UserGetByFarcasterIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor fid: Float + + def initialize: ( + fid: Float, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { fid: Float, request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/user_get_by_github_username_params.rbs b/sig/privy/models/user_get_by_github_username_params.rbs new file mode 100644 index 0000000..48e0c24 --- /dev/null +++ b/sig/privy/models/user_get_by_github_username_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_github_username_params = + { username: String } & Privy::Internal::Type::request_parameters + + class UserGetByGitHubUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor username: String + + def initialize: ( + username: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + username: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_phone_number_params.rbs b/sig/privy/models/user_get_by_phone_number_params.rbs new file mode 100644 index 0000000..e3065a2 --- /dev/null +++ b/sig/privy/models/user_get_by_phone_number_params.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type user_get_by_phone_number_params = + { number: String } & Privy::Internal::Type::request_parameters + + class UserGetByPhoneNumberParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor number: String + + def initialize: ( + number: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { number: String, request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/user_get_by_smart_wallet_address_params.rbs b/sig/privy/models/user_get_by_smart_wallet_address_params.rbs new file mode 100644 index 0000000..13c716e --- /dev/null +++ b/sig/privy/models/user_get_by_smart_wallet_address_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_smart_wallet_address_params = + { address: String } & Privy::Internal::Type::request_parameters + + class UserGetBySmartWalletAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor address: String + + def initialize: ( + address: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + address: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_telegram_user_id_params.rbs b/sig/privy/models/user_get_by_telegram_user_id_params.rbs new file mode 100644 index 0000000..693a71d --- /dev/null +++ b/sig/privy/models/user_get_by_telegram_user_id_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_telegram_user_id_params = + { telegram_user_id: String } & Privy::Internal::Type::request_parameters + + class UserGetByTelegramUserIDParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor telegram_user_id: String + + def initialize: ( + telegram_user_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + telegram_user_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_telegram_username_params.rbs b/sig/privy/models/user_get_by_telegram_username_params.rbs new file mode 100644 index 0000000..bcd1c3c --- /dev/null +++ b/sig/privy/models/user_get_by_telegram_username_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_telegram_username_params = + { username: String } & Privy::Internal::Type::request_parameters + + class UserGetByTelegramUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor username: String + + def initialize: ( + username: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + username: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_twitter_subject_params.rbs b/sig/privy/models/user_get_by_twitter_subject_params.rbs new file mode 100644 index 0000000..728a443 --- /dev/null +++ b/sig/privy/models/user_get_by_twitter_subject_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_twitter_subject_params = + { subject: String } & Privy::Internal::Type::request_parameters + + class UserGetByTwitterSubjectParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor subject: String + + def initialize: ( + subject: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + subject: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_twitter_username_params.rbs b/sig/privy/models/user_get_by_twitter_username_params.rbs new file mode 100644 index 0000000..2766f95 --- /dev/null +++ b/sig/privy/models/user_get_by_twitter_username_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_twitter_username_params = + { username: String } & Privy::Internal::Type::request_parameters + + class UserGetByTwitterUsernameParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor username: String + + def initialize: ( + username: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + username: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_by_wallet_address_params.rbs b/sig/privy/models/user_get_by_wallet_address_params.rbs new file mode 100644 index 0000000..1d51e52 --- /dev/null +++ b/sig/privy/models/user_get_by_wallet_address_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_by_wallet_address_params = + { address: String } & Privy::Internal::Type::request_parameters + + class UserGetByWalletAddressParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor address: String + + def initialize: ( + address: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + address: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_get_params.rbs b/sig/privy/models/user_get_params.rbs new file mode 100644 index 0000000..d6cb346 --- /dev/null +++ b/sig/privy/models/user_get_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type user_get_params = + { user_id: String } & Privy::Internal::Type::request_parameters + + class UserGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor user_id: String + + def initialize: ( + user_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + user_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_invite_input.rbs b/sig/privy/models/user_invite_input.rbs new file mode 100644 index 0000000..5670575 --- /dev/null +++ b/sig/privy/models/user_invite_input.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type user_invite_input = + Privy::EmailInviteInput + | Privy::EmailDomainInviteInput + | Privy::WalletInviteInput + | Privy::PhoneInviteInput + + module UserInviteInput + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::user_invite_input] + end + end +end diff --git a/sig/privy/models/user_linked_account_webhook_payload.rbs b/sig/privy/models/user_linked_account_webhook_payload.rbs new file mode 100644 index 0000000..51389a8 --- /dev/null +++ b/sig/privy/models/user_linked_account_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type user_linked_account_webhook_payload = + { + account: Privy::Models::linked_account, + type: Privy::Models::UserLinkedAccountWebhookPayload::type_, + user: Privy::User + } + + class UserLinkedAccountWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor account: Privy::Models::linked_account + + attr_accessor type: Privy::Models::UserLinkedAccountWebhookPayload::type_ + + attr_accessor user: Privy::User + + def initialize: ( + account: Privy::Models::linked_account, + type: Privy::Models::UserLinkedAccountWebhookPayload::type_, + user: Privy::User + ) -> void + + def to_hash: -> { + account: Privy::Models::linked_account, + type: Privy::Models::UserLinkedAccountWebhookPayload::type_, + user: Privy::User + } + + type type_ = :"user.linked_account" + + module Type + extend Privy::Internal::Type::Enum + + USER_LINKED_ACCOUNT: :"user.linked_account" + + def self?.values: -> ::Array[Privy::Models::UserLinkedAccountWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_list_params.rbs b/sig/privy/models/user_list_params.rbs new file mode 100644 index 0000000..7d01066 --- /dev/null +++ b/sig/privy/models/user_list_params.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type user_list_params = + { cursor: String, limit: Float? } + & Privy::Internal::Type::request_parameters + + class UserListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_accessor limit: Float? + + def initialize: ( + ?cursor: String, + ?limit: Float?, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + cursor: String, + limit: Float?, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_operation_completed_webhook_payload.rbs b/sig/privy/models/user_operation_completed_webhook_payload.rbs new file mode 100644 index 0000000..dd926a2 --- /dev/null +++ b/sig/privy/models/user_operation_completed_webhook_payload.rbs @@ -0,0 +1,85 @@ +module Privy + module Models + type user_operation_completed_webhook_payload = + { + actual_gas_cost: String, + actual_gas_used: String, + block_number: Float, + :caip2 => String, + log_index: Float, + nonce: String, + paymaster: String?, + sender: String, + success: bool, + transaction_hash: String, + type: Privy::Models::UserOperationCompletedWebhookPayload::type_, + user_op_hash: String + } + + class UserOperationCompletedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor actual_gas_cost: String + + attr_accessor actual_gas_used: String + + attr_accessor block_number: Float + + attr_accessor caip2: String + + attr_accessor log_index: Float + + attr_accessor nonce: String + + attr_accessor paymaster: String? + + attr_accessor sender: String + + attr_accessor success: bool + + attr_accessor transaction_hash: String + + attr_accessor type: Privy::Models::UserOperationCompletedWebhookPayload::type_ + + attr_accessor user_op_hash: String + + def initialize: ( + actual_gas_cost: String, + actual_gas_used: String, + block_number: Float, + caip2: String, + log_index: Float, + nonce: String, + paymaster: String?, + sender: String, + success: bool, + transaction_hash: String, + type: Privy::Models::UserOperationCompletedWebhookPayload::type_, + user_op_hash: String + ) -> void + + def to_hash: -> { + actual_gas_cost: String, + actual_gas_used: String, + block_number: Float, + :caip2 => String, + log_index: Float, + nonce: String, + paymaster: String?, + sender: String, + success: bool, + transaction_hash: String, + type: Privy::Models::UserOperationCompletedWebhookPayload::type_, + user_op_hash: String + } + + type type_ = :"user_operation.completed" + + module Type + extend Privy::Internal::Type::Enum + + USER_OPERATION_COMPLETED: :"user_operation.completed" + + def self?.values: -> ::Array[Privy::Models::UserOperationCompletedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_operation_input.rbs b/sig/privy/models/user_operation_input.rbs new file mode 100644 index 0000000..2363f58 --- /dev/null +++ b/sig/privy/models/user_operation_input.rbs @@ -0,0 +1,83 @@ +module Privy + module Models + type user_operation_input = + { + call_data: String, + call_gas_limit: String, + max_fee_per_gas: String, + max_priority_fee_per_gas: String, + nonce: String, + pre_verification_gas: String, + sender: String, + verification_gas_limit: String, + paymaster: String, + paymaster_data: String, + paymaster_post_op_gas_limit: String, + paymaster_verification_gas_limit: String + } + + class UserOperationInput < Privy::Internal::Type::BaseModel + attr_accessor call_data: String + + attr_accessor call_gas_limit: String + + attr_accessor max_fee_per_gas: String + + attr_accessor max_priority_fee_per_gas: String + + attr_accessor nonce: String + + attr_accessor pre_verification_gas: String + + attr_accessor sender: String + + attr_accessor verification_gas_limit: String + + attr_reader paymaster: String? + + def paymaster=: (String) -> String + + attr_reader paymaster_data: String? + + def paymaster_data=: (String) -> String + + attr_reader paymaster_post_op_gas_limit: String? + + def paymaster_post_op_gas_limit=: (String) -> String + + attr_reader paymaster_verification_gas_limit: String? + + def paymaster_verification_gas_limit=: (String) -> String + + def initialize: ( + call_data: String, + call_gas_limit: String, + max_fee_per_gas: String, + max_priority_fee_per_gas: String, + nonce: String, + pre_verification_gas: String, + sender: String, + verification_gas_limit: String, + ?paymaster: String, + ?paymaster_data: String, + ?paymaster_post_op_gas_limit: String, + ?paymaster_verification_gas_limit: String + ) -> void + + def to_hash: -> { + call_data: String, + call_gas_limit: String, + max_fee_per_gas: String, + max_priority_fee_per_gas: String, + nonce: String, + pre_verification_gas: String, + sender: String, + verification_gas_limit: String, + paymaster: String, + paymaster_data: String, + paymaster_post_op_gas_limit: String, + paymaster_verification_gas_limit: String + } + end + end +end diff --git a/sig/privy/models/user_owned_recovery_option.rbs b/sig/privy/models/user_owned_recovery_option.rbs new file mode 100644 index 0000000..544be1e --- /dev/null +++ b/sig/privy/models/user_owned_recovery_option.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type user_owned_recovery_option = + :"user-passcode" | :"google-drive" | :icloud + + module UserOwnedRecoveryOption + extend Privy::Internal::Type::Enum + + USER_PASSCODE: :"user-passcode" + GOOGLE_DRIVE: :"google-drive" + ICLOUD: :icloud + + def self?.values: -> ::Array[Privy::Models::user_owned_recovery_option] + end + end +end diff --git a/sig/privy/models/user_pregenerate_wallets_params.rbs b/sig/privy/models/user_pregenerate_wallets_params.rbs new file mode 100644 index 0000000..8f19c44 --- /dev/null +++ b/sig/privy/models/user_pregenerate_wallets_params.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type user_pregenerate_wallets_params = + { user_id: String, wallets: ::Array[Privy::WalletCreationInput] } + & Privy::Internal::Type::request_parameters + + class UserPregenerateWalletsParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor user_id: String + + attr_accessor wallets: ::Array[Privy::WalletCreationInput] + + def initialize: ( + user_id: String, + wallets: ::Array[Privy::WalletCreationInput], + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + user_id: String, + wallets: ::Array[Privy::WalletCreationInput], + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_search_params.rbs b/sig/privy/models/user_search_params.rbs new file mode 100644 index 0000000..f900a2f --- /dev/null +++ b/sig/privy/models/user_search_params.rbs @@ -0,0 +1,71 @@ +module Privy + module Models + type user_search_params = + { body: Privy::Models::UserSearchParams::body } + & Privy::Internal::Type::request_parameters + + class UserSearchParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor body: Privy::Models::UserSearchParams::body + + def initialize: ( + body: Privy::Models::UserSearchParams::body, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + body: Privy::Models::UserSearchParams::body, + request_options: Privy::RequestOptions + } + + type body = + Privy::UserSearchParams::Body::SearchTerm + | Privy::UserSearchParams::Body::UnionMember1 + + module Body + extend Privy::Internal::Type::Union + + type search_term = { search_term: String } + + class SearchTerm < Privy::Internal::Type::BaseModel + attr_accessor search_term: String + + def initialize: (search_term: String) -> void + + def to_hash: -> { search_term: String } + end + + type union_member1 = + { + emails: ::Array[String], + phone_numbers: ::Array[String], + wallet_addresses: ::Array[String] + } + + class UnionMember1 < Privy::Internal::Type::BaseModel + attr_accessor emails: ::Array[String] + + attr_accessor phone_numbers: ::Array[String] + + attr_accessor wallet_addresses: ::Array[String] + + def initialize: ( + emails: ::Array[String], + phone_numbers: ::Array[String], + wallet_addresses: ::Array[String] + ) -> void + + def to_hash: -> { + emails: ::Array[String], + phone_numbers: ::Array[String], + wallet_addresses: ::Array[String] + } + end + + def self?.variants: -> ::Array[Privy::Models::UserSearchParams::body] + end + end + end +end diff --git a/sig/privy/models/user_set_custom_metadata_params.rbs b/sig/privy/models/user_set_custom_metadata_params.rbs new file mode 100644 index 0000000..5749e8f --- /dev/null +++ b/sig/privy/models/user_set_custom_metadata_params.rbs @@ -0,0 +1,28 @@ +module Privy + module Models + type user_set_custom_metadata_params = + { user_id: String, custom_metadata: Privy::Models::custom_metadata } + & Privy::Internal::Type::request_parameters + + class UserSetCustomMetadataParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor user_id: String + + attr_accessor custom_metadata: Privy::Models::custom_metadata + + def initialize: ( + user_id: String, + custom_metadata: Privy::Models::custom_metadata, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + user_id: String, + custom_metadata: Privy::Models::custom_metadata, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_transferred_account_webhook_payload.rbs b/sig/privy/models/user_transferred_account_webhook_payload.rbs new file mode 100644 index 0000000..e4d1b97 --- /dev/null +++ b/sig/privy/models/user_transferred_account_webhook_payload.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type user_transferred_account_webhook_payload = + { + account: Privy::Models::linked_account, + deleted_user: Privy::Models::UserTransferredAccountWebhookPayload::deleted_user, + from_user: Privy::UserTransferredAccountWebhookPayload::FromUser, + to_user: Privy::User, + type: Privy::Models::UserTransferredAccountWebhookPayload::type_ + } + + class UserTransferredAccountWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor account: Privy::Models::linked_account + + attr_accessor deleted_user: Privy::Models::UserTransferredAccountWebhookPayload::deleted_user + + attr_accessor from_user: Privy::UserTransferredAccountWebhookPayload::FromUser + + attr_accessor to_user: Privy::User + + attr_accessor type: Privy::Models::UserTransferredAccountWebhookPayload::type_ + + def initialize: ( + account: Privy::Models::linked_account, + deleted_user: Privy::Models::UserTransferredAccountWebhookPayload::deleted_user, + from_user: Privy::UserTransferredAccountWebhookPayload::FromUser, + to_user: Privy::User, + type: Privy::Models::UserTransferredAccountWebhookPayload::type_ + ) -> void + + def to_hash: -> { + account: Privy::Models::linked_account, + deleted_user: Privy::Models::UserTransferredAccountWebhookPayload::deleted_user, + from_user: Privy::UserTransferredAccountWebhookPayload::FromUser, + to_user: Privy::User, + type: Privy::Models::UserTransferredAccountWebhookPayload::type_ + } + + type deleted_user = true + + module DeletedUser + extend Privy::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[Privy::Models::UserTransferredAccountWebhookPayload::deleted_user] + end + + type from_user = { id: String } + + class FromUser < Privy::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + + type type_ = :"user.transferred_account" + + module Type + extend Privy::Internal::Type::Enum + + USER_TRANSFERRED_ACCOUNT: :"user.transferred_account" + + def self?.values: -> ::Array[Privy::Models::UserTransferredAccountWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_unlink_linked_account_params.rbs b/sig/privy/models/user_unlink_linked_account_params.rbs new file mode 100644 index 0000000..ae81f57 --- /dev/null +++ b/sig/privy/models/user_unlink_linked_account_params.rbs @@ -0,0 +1,43 @@ +module Privy + module Models + type user_unlink_linked_account_params = + { + user_id: String, + handle: String, + type: Privy::Models::linked_account_type, + provider: String + } + & Privy::Internal::Type::request_parameters + + class UserUnlinkLinkedAccountParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor user_id: String + + attr_accessor handle: String + + attr_accessor type: Privy::Models::linked_account_type + + attr_reader provider: String? + + def provider=: (String) -> String + + def initialize: ( + user_id: String, + handle: String, + type: Privy::Models::linked_account_type, + ?provider: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + user_id: String, + handle: String, + type: Privy::Models::linked_account_type, + provider: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/user_unlinked_account_webhook_payload.rbs b/sig/privy/models/user_unlinked_account_webhook_payload.rbs new file mode 100644 index 0000000..bc0e4f4 --- /dev/null +++ b/sig/privy/models/user_unlinked_account_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type user_unlinked_account_webhook_payload = + { + account: Privy::Models::linked_account, + type: Privy::Models::UserUnlinkedAccountWebhookPayload::type_, + user: Privy::User + } + + class UserUnlinkedAccountWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor account: Privy::Models::linked_account + + attr_accessor type: Privy::Models::UserUnlinkedAccountWebhookPayload::type_ + + attr_accessor user: Privy::User + + def initialize: ( + account: Privy::Models::linked_account, + type: Privy::Models::UserUnlinkedAccountWebhookPayload::type_, + user: Privy::User + ) -> void + + def to_hash: -> { + account: Privy::Models::linked_account, + type: Privy::Models::UserUnlinkedAccountWebhookPayload::type_, + user: Privy::User + } + + type type_ = :"user.unlinked_account" + + module Type + extend Privy::Internal::Type::Enum + + USER_UNLINKED_ACCOUNT: :"user.unlinked_account" + + def self?.values: -> ::Array[Privy::Models::UserUnlinkedAccountWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_updated_account_webhook_payload.rbs b/sig/privy/models/user_updated_account_webhook_payload.rbs new file mode 100644 index 0000000..5647e9d --- /dev/null +++ b/sig/privy/models/user_updated_account_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type user_updated_account_webhook_payload = + { + account: Privy::Models::linked_account, + type: Privy::Models::UserUpdatedAccountWebhookPayload::type_, + user: Privy::User + } + + class UserUpdatedAccountWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor account: Privy::Models::linked_account + + attr_accessor type: Privy::Models::UserUpdatedAccountWebhookPayload::type_ + + attr_accessor user: Privy::User + + def initialize: ( + account: Privy::Models::linked_account, + type: Privy::Models::UserUpdatedAccountWebhookPayload::type_, + user: Privy::User + ) -> void + + def to_hash: -> { + account: Privy::Models::linked_account, + type: Privy::Models::UserUpdatedAccountWebhookPayload::type_, + user: Privy::User + } + + type type_ = :"user.updated_account" + + module Type + extend Privy::Internal::Type::Enum + + USER_UPDATED_ACCOUNT: :"user.updated_account" + + def self?.values: -> ::Array[Privy::Models::UserUpdatedAccountWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_wallet_created_webhook_payload.rbs b/sig/privy/models/user_wallet_created_webhook_payload.rbs new file mode 100644 index 0000000..ab564b4 --- /dev/null +++ b/sig/privy/models/user_wallet_created_webhook_payload.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type user_wallet_created_webhook_payload = + { + type: Privy::Models::UserWalletCreatedWebhookPayload::type_, + user: Privy::User, + wallet: Privy::LinkedAccountBaseWallet + } + + class UserWalletCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::UserWalletCreatedWebhookPayload::type_ + + attr_accessor user: Privy::User + + attr_accessor wallet: Privy::LinkedAccountBaseWallet + + def initialize: ( + type: Privy::Models::UserWalletCreatedWebhookPayload::type_, + user: Privy::User, + wallet: Privy::LinkedAccountBaseWallet + ) -> void + + def to_hash: -> { + type: Privy::Models::UserWalletCreatedWebhookPayload::type_, + user: Privy::User, + wallet: Privy::LinkedAccountBaseWallet + } + + type type_ = :"user.wallet_created" + + module Type + extend Privy::Internal::Type::Enum + + USER_WALLET_CREATED: :"user.wallet_created" + + def self?.values: -> ::Array[Privy::Models::UserWalletCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/user_with_identity_token.rbs b/sig/privy/models/user_with_identity_token.rbs new file mode 100644 index 0000000..004355d --- /dev/null +++ b/sig/privy/models/user_with_identity_token.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type user_with_identity_token = + { identity_token: String?, user: Privy::User } + + class UserWithIdentityToken < Privy::Internal::Type::BaseModel + attr_accessor identity_token: String? + + attr_accessor user: Privy::User + + def initialize: (identity_token: String?, user: Privy::User) -> void + + def to_hash: -> { identity_token: String?, user: Privy::User } + end + end +end diff --git a/sig/privy/models/wallet.rbs b/sig/privy/models/wallet.rbs new file mode 100644 index 0000000..3b61fa2 --- /dev/null +++ b/sig/privy/models/wallet.rbs @@ -0,0 +1,95 @@ +module Privy + module Models + type wallet = + { + id: String, + additional_signers: Privy::Models::wallet_additional_signer, + address: String, + chain_type: Privy::Models::wallet_chain_type, + created_at: Float, + exported_at: Float?, + imported_at: Float?, + owner_id: String?, + policy_ids: ::Array[String], + authorization_threshold: Float, + custody: Privy::WalletCustodian, + display_name: String, + external_id: String, + public_key: String + } + + class Wallet < Privy::Internal::Type::BaseModel + attr_accessor id: String + + attr_accessor additional_signers: Privy::Models::wallet_additional_signer + + attr_accessor address: String + + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_accessor created_at: Float + + attr_accessor exported_at: Float? + + attr_accessor imported_at: Float? + + attr_accessor owner_id: String? + + attr_accessor policy_ids: ::Array[String] + + attr_reader authorization_threshold: Float? + + def authorization_threshold=: (Float) -> Float + + attr_reader custody: Privy::WalletCustodian? + + def custody=: (Privy::WalletCustodian) -> Privy::WalletCustodian + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader public_key: String? + + def public_key=: (String) -> String + + def initialize: ( + id: String, + additional_signers: Privy::Models::wallet_additional_signer, + address: String, + chain_type: Privy::Models::wallet_chain_type, + created_at: Float, + exported_at: Float?, + imported_at: Float?, + owner_id: String?, + policy_ids: ::Array[String], + ?authorization_threshold: Float, + ?custody: Privy::WalletCustodian, + ?display_name: String, + ?external_id: String, + ?public_key: String + ) -> void + + def to_hash: -> { + id: String, + additional_signers: Privy::Models::wallet_additional_signer, + address: String, + chain_type: Privy::Models::wallet_chain_type, + created_at: Float, + exported_at: Float?, + imported_at: Float?, + owner_id: String?, + policy_ids: ::Array[String], + authorization_threshold: Float, + custody: Privy::WalletCustodian, + display_name: String, + external_id: String, + public_key: String + } + end + end +end diff --git a/sig/privy/models/wallet_action_earn_deposit_created_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_deposit_created_webhook_payload.rbs new file mode 100644 index 0000000..2aaba08 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_deposit_created_webhook_payload.rbs @@ -0,0 +1,106 @@ +module Privy + module Models + type wallet_action_earn_deposit_created_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnDepositCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor raw_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::status + + attr_accessor type: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :pending + + module Status + extend Privy::Internal::Type::Enum + + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_deposit.created" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_CREATED: :"wallet_action.earn_deposit.created" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rbs new file mode 100644 index 0000000..8ebbf7b --- /dev/null +++ b/sig/privy/models/wallet_action_earn_deposit_failed_webhook_payload.rbs @@ -0,0 +1,116 @@ +module Privy + module Models + type wallet_action_earn_deposit_failed_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnDepositFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor raw_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositFailedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :failed + + module Status + extend Privy::Internal::Type::Enum + + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositFailedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_deposit.failed" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_FAILED: :"wallet_action.earn_deposit.failed" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rbs new file mode 100644 index 0000000..9f3b41f --- /dev/null +++ b/sig/privy/models/wallet_action_earn_deposit_rejected_webhook_payload.rbs @@ -0,0 +1,116 @@ +module Privy + module Models + type wallet_action_earn_deposit_rejected_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnDepositRejectedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor raw_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :rejected + + module Status + extend Privy::Internal::Type::Enum + + REJECTED: :rejected + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_deposit.rejected" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_REJECTED: :"wallet_action.earn_deposit.rejected" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositRejectedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rbs new file mode 100644 index 0000000..1adaf8b --- /dev/null +++ b/sig/privy/models/wallet_action_earn_deposit_succeeded_webhook_payload.rbs @@ -0,0 +1,116 @@ +module Privy + module Models + type wallet_action_earn_deposit_succeeded_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + share_amount: String, + status: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnDepositSucceededWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor raw_amount: String + + attr_accessor share_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + raw_amount: String, + share_amount: String, + status: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + share_amount: String, + status: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :succeeded + + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED: :succeeded + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_deposit.succeeded" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_DEPOSIT_SUCCEEDED: :"wallet_action.earn_deposit.succeeded" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnDepositSucceededWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rbs new file mode 100644 index 0000000..a53476d --- /dev/null +++ b/sig/privy/models/wallet_action_earn_incentive_claim_created_webhook_payload.rbs @@ -0,0 +1,70 @@ +module Privy + module Models + type wallet_action_earn_incentive_claim_created_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + chain: String, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionEarnIncentiveClaimCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor chain: String + + attr_accessor rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]? + + attr_accessor status: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::status + + attr_accessor type: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + chain: String, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + chain: String, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :pending + + module Status + extend Privy::Internal::Type::Enum + + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_incentive_claim.created" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_CREATED: :"wallet_action.earn_incentive_claim.created" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rbs new file mode 100644 index 0000000..61a2883 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_incentive_claim_failed_webhook_payload.rbs @@ -0,0 +1,80 @@ +module Privy + module Models + type wallet_action_earn_incentive_claim_failed_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + chain: String, + failure_reason: Privy::FailureReason, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionEarnIncentiveClaimFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor chain: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]? + + attr_accessor status: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + chain: String, + failure_reason: Privy::FailureReason, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + chain: String, + failure_reason: Privy::FailureReason, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :failed + + module Status + extend Privy::Internal::Type::Enum + + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_incentive_claim.failed" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_FAILED: :"wallet_action.earn_incentive_claim.failed" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rbs new file mode 100644 index 0000000..2760e61 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_incentive_claim_rejected_webhook_payload.rbs @@ -0,0 +1,80 @@ +module Privy + module Models + type wallet_action_earn_incentive_claim_rejected_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + chain: String, + failure_reason: Privy::FailureReason, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionEarnIncentiveClaimRejectedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor chain: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]? + + attr_accessor status: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + chain: String, + failure_reason: Privy::FailureReason, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + chain: String, + failure_reason: Privy::FailureReason, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :rejected + + module Status + extend Privy::Internal::Type::Enum + + REJECTED: :rejected + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_incentive_claim.rejected" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_REJECTED: :"wallet_action.earn_incentive_claim.rejected" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimRejectedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rbs new file mode 100644 index 0000000..7a28297 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_incentive_claim_succeeded_webhook_payload.rbs @@ -0,0 +1,75 @@ +module Privy + module Models + type wallet_action_earn_incentive_claim_succeeded_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + chain: String, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionEarnIncentiveClaimSucceededWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor chain: String + + attr_accessor rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]? + + attr_accessor status: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + chain: String, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + chain: String, + rewards: ::Array[Privy::EarnIncetiveClaimRewardEntry]?, + status: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :succeeded + + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED: :succeeded + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_incentive_claim.succeeded" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_INCENTIVE_CLAIM_SUCCEEDED: :"wallet_action.earn_incentive_claim.succeeded" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnIncentiveClaimSucceededWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rbs new file mode 100644 index 0000000..1ec2543 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_withdraw_created_webhook_payload.rbs @@ -0,0 +1,106 @@ +module Privy + module Models + type wallet_action_earn_withdraw_created_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnWithdrawCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor raw_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::status + + attr_accessor type: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::status, + type: Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :pending + + module Status + extend Privy::Internal::Type::Enum + + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_withdraw.created" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_CREATED: :"wallet_action.earn_withdraw.created" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rbs new file mode 100644 index 0000000..373bca8 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_withdraw_failed_webhook_payload.rbs @@ -0,0 +1,116 @@ +module Privy + module Models + type wallet_action_earn_withdraw_failed_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnWithdrawFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor raw_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :failed + + module Status + extend Privy::Internal::Type::Enum + + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_withdraw.failed" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_FAILED: :"wallet_action.earn_withdraw.failed" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rbs new file mode 100644 index 0000000..dabc220 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_withdraw_rejected_webhook_payload.rbs @@ -0,0 +1,116 @@ +module Privy + module Models + type wallet_action_earn_withdraw_rejected_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnWithdrawRejectedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor raw_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + failure_reason: Privy::FailureReason, + raw_amount: String, + status: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :rejected + + module Status + extend Privy::Internal::Type::Enum + + REJECTED: :rejected + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_withdraw.rejected" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_REJECTED: :"wallet_action.earn_withdraw.rejected" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawRejectedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rbs b/sig/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rbs new file mode 100644 index 0000000..83ec026 --- /dev/null +++ b/sig/privy/models/wallet_action_earn_withdraw_succeeded_webhook_payload.rbs @@ -0,0 +1,116 @@ +module Privy + module Models + type wallet_action_earn_withdraw_succeeded_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + share_amount: String, + status: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + class WalletActionEarnWithdrawSucceededWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor asset_address: String + + attr_accessor caip2: String + + attr_accessor raw_amount: String + + attr_accessor share_amount: String + + attr_accessor status: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::type_ + + attr_accessor vault_address: String + + attr_accessor vault_id: String + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader amount: String? + + def amount=: (String) -> String + + attr_reader asset: String? + + def asset=: (String) -> String + + attr_reader decimals: Integer? + + def decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + asset_address: String, + caip2: String, + raw_amount: String, + share_amount: String, + status: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + ?amount: String, + ?asset: String, + ?decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + asset_address: String, + :caip2 => String, + raw_amount: String, + share_amount: String, + status: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::type_, + vault_address: String, + vault_id: String, + wallet_action_id: String, + wallet_id: String, + amount: String, + asset: String, + decimals: Integer + } + + type status = :succeeded + + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED: :succeeded + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::status] + end + + type type_ = :"wallet_action.earn_withdraw.succeeded" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_EARN_WITHDRAW_SUCCEEDED: :"wallet_action.earn_withdraw.succeeded" + + def self?.values: -> ::Array[Privy::Models::WalletActionEarnWithdrawSucceededWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_response.rbs b/sig/privy/models/wallet_action_response.rbs new file mode 100644 index 0000000..5b48702 --- /dev/null +++ b/sig/privy/models/wallet_action_response.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type wallet_action_response = + Privy::SwapActionResponse + | Privy::TransferActionResponse + | Privy::EarnDepositActionResponse + | Privy::EarnWithdrawActionResponse + | Privy::EarnIncentiveClaimActionResponse + + module WalletActionResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::wallet_action_response] + end + end +end diff --git a/sig/privy/models/wallet_action_status.rbs b/sig/privy/models/wallet_action_status.rbs new file mode 100644 index 0000000..14384aa --- /dev/null +++ b/sig/privy/models/wallet_action_status.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type wallet_action_status = :pending | :succeeded | :rejected | :failed + + module WalletActionStatus + extend Privy::Internal::Type::Enum + + PENDING: :pending + SUCCEEDED: :succeeded + REJECTED: :rejected + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::wallet_action_status] + end + end +end diff --git a/sig/privy/models/wallet_action_step.rbs b/sig/privy/models/wallet_action_step.rbs new file mode 100644 index 0000000..3df58be --- /dev/null +++ b/sig/privy/models/wallet_action_step.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type wallet_action_step = + Privy::EvmTransactionWalletActionStep + | Privy::EvmUserOperationWalletActionStep + | Privy::SvmTransactionWalletActionStep + | Privy::ExternalTransactionWalletActionStep + + module WalletActionStep + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::wallet_action_step] + end + end +end diff --git a/sig/privy/models/wallet_action_step_type.rbs b/sig/privy/models/wallet_action_step_type.rbs new file mode 100644 index 0000000..d3a1a3d --- /dev/null +++ b/sig/privy/models/wallet_action_step_type.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type wallet_action_step_type = + :evm_transaction + | :evm_user_operation + | :svm_transaction + | :external_transaction + + module WalletActionStepType + extend Privy::Internal::Type::Enum + + EVM_TRANSACTION: :evm_transaction + EVM_USER_OPERATION: :evm_user_operation + SVM_TRANSACTION: :svm_transaction + EXTERNAL_TRANSACTION: :external_transaction + + def self?.values: -> ::Array[Privy::Models::wallet_action_step_type] + end + end +end diff --git a/sig/privy/models/wallet_action_swap_created_webhook_payload.rbs b/sig/privy/models/wallet_action_swap_created_webhook_payload.rbs new file mode 100644 index 0000000..9ee3d00 --- /dev/null +++ b/sig/privy/models/wallet_action_swap_created_webhook_payload.rbs @@ -0,0 +1,80 @@ +module Privy + module Models + type wallet_action_swap_created_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapCreatedWebhookPayload::status, + type: Privy::Models::WalletActionSwapCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionSwapCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor caip2: String + + attr_accessor input_amount: String? + + attr_accessor input_token: String + + attr_accessor output_token: String + + attr_accessor status: Privy::Models::WalletActionSwapCreatedWebhookPayload::status + + attr_accessor type: Privy::Models::WalletActionSwapCreatedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + caip2: String, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapCreatedWebhookPayload::status, + type: Privy::Models::WalletActionSwapCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapCreatedWebhookPayload::status, + type: Privy::Models::WalletActionSwapCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :pending + + module Status + extend Privy::Internal::Type::Enum + + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapCreatedWebhookPayload::status] + end + + type type_ = :"wallet_action.swap.created" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_CREATED: :"wallet_action.swap.created" + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_swap_failed_webhook_payload.rbs b/sig/privy/models/wallet_action_swap_failed_webhook_payload.rbs new file mode 100644 index 0000000..f7e0c0d --- /dev/null +++ b/sig/privy/models/wallet_action_swap_failed_webhook_payload.rbs @@ -0,0 +1,90 @@ +module Privy + module Models + type wallet_action_swap_failed_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + failure_reason: Privy::FailureReason, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionSwapFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor caip2: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor input_amount: String? + + attr_accessor input_token: String + + attr_accessor output_token: String + + attr_accessor status: Privy::Models::WalletActionSwapFailedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionSwapFailedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + caip2: String, + failure_reason: Privy::FailureReason, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + failure_reason: Privy::FailureReason, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :failed + + module Status + extend Privy::Internal::Type::Enum + + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapFailedWebhookPayload::status] + end + + type type_ = :"wallet_action.swap.failed" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_FAILED: :"wallet_action.swap.failed" + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_swap_rejected_webhook_payload.rbs b/sig/privy/models/wallet_action_swap_rejected_webhook_payload.rbs new file mode 100644 index 0000000..c60010d --- /dev/null +++ b/sig/privy/models/wallet_action_swap_rejected_webhook_payload.rbs @@ -0,0 +1,90 @@ +module Privy + module Models + type wallet_action_swap_rejected_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + failure_reason: Privy::FailureReason, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionSwapRejectedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor caip2: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor input_amount: String? + + attr_accessor input_token: String + + attr_accessor output_token: String + + attr_accessor status: Privy::Models::WalletActionSwapRejectedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionSwapRejectedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + caip2: String, + failure_reason: Privy::FailureReason, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + failure_reason: Privy::FailureReason, + input_amount: String?, + input_token: String, + output_token: String, + status: Privy::Models::WalletActionSwapRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :rejected + + module Status + extend Privy::Internal::Type::Enum + + REJECTED: :rejected + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapRejectedWebhookPayload::status] + end + + type type_ = :"wallet_action.swap.rejected" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_REJECTED: :"wallet_action.swap.rejected" + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapRejectedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_swap_succeeded_webhook_payload.rbs b/sig/privy/models/wallet_action_swap_succeeded_webhook_payload.rbs new file mode 100644 index 0000000..ffd69e2 --- /dev/null +++ b/sig/privy/models/wallet_action_swap_succeeded_webhook_payload.rbs @@ -0,0 +1,90 @@ +module Privy + module Models + type wallet_action_swap_succeeded_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + input_amount: String?, + input_token: String, + output_amount: String?, + output_token: String, + status: Privy::Models::WalletActionSwapSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + class WalletActionSwapSucceededWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor caip2: String + + attr_accessor input_amount: String? + + attr_accessor input_token: String + + attr_accessor output_amount: String? + + attr_accessor output_token: String + + attr_accessor status: Privy::Models::WalletActionSwapSucceededWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionSwapSucceededWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + caip2: String, + input_amount: String?, + input_token: String, + output_amount: String?, + output_token: String, + status: Privy::Models::WalletActionSwapSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + :caip2 => String, + input_amount: String?, + input_token: String, + output_amount: String?, + output_token: String, + status: Privy::Models::WalletActionSwapSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionSwapSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String + } + + type status = :succeeded + + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED: :succeeded + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapSucceededWebhookPayload::status] + end + + type type_ = :"wallet_action.swap.succeeded" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_SWAP_SUCCEEDED: :"wallet_action.swap.succeeded" + + def self?.values: -> ::Array[Privy::Models::WalletActionSwapSucceededWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_transfer_created_webhook_payload.rbs b/sig/privy/models/wallet_action_transfer_created_webhook_payload.rbs new file mode 100644 index 0000000..21ac178 --- /dev/null +++ b/sig/privy/models/wallet_action_transfer_created_webhook_payload.rbs @@ -0,0 +1,98 @@ +module Privy + module Models + type wallet_action_transfer_created_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + source_chain: String, + status: Privy::Models::WalletActionTransferCreatedWebhookPayload::status, + type: Privy::Models::WalletActionTransferCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + class WalletActionTransferCreatedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor destination_address: String + + attr_accessor source_chain: String + + attr_accessor status: Privy::Models::WalletActionTransferCreatedWebhookPayload::status + + attr_accessor type: Privy::Models::WalletActionTransferCreatedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader source_amount: String? + + def source_amount=: (String) -> String + + attr_reader source_asset: String? + + def source_asset=: (String) -> String + + attr_reader source_asset_address: String? + + def source_asset_address=: (String) -> String + + attr_reader source_asset_decimals: Integer? + + def source_asset_decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + destination_address: String, + source_chain: String, + status: Privy::Models::WalletActionTransferCreatedWebhookPayload::status, + type: Privy::Models::WalletActionTransferCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + ?source_amount: String, + ?source_asset: String, + ?source_asset_address: String, + ?source_asset_decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + source_chain: String, + status: Privy::Models::WalletActionTransferCreatedWebhookPayload::status, + type: Privy::Models::WalletActionTransferCreatedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + type status = :pending + + module Status + extend Privy::Internal::Type::Enum + + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferCreatedWebhookPayload::status] + end + + type type_ = :"wallet_action.transfer.created" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_CREATED: :"wallet_action.transfer.created" + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferCreatedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_transfer_failed_webhook_payload.rbs b/sig/privy/models/wallet_action_transfer_failed_webhook_payload.rbs new file mode 100644 index 0000000..257ce0c --- /dev/null +++ b/sig/privy/models/wallet_action_transfer_failed_webhook_payload.rbs @@ -0,0 +1,108 @@ +module Privy + module Models + type wallet_action_transfer_failed_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: Privy::Models::WalletActionTransferFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + class WalletActionTransferFailedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor destination_address: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor source_chain: String + + attr_accessor status: Privy::Models::WalletActionTransferFailedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionTransferFailedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader source_amount: String? + + def source_amount=: (String) -> String + + attr_reader source_asset: String? + + def source_asset=: (String) -> String + + attr_reader source_asset_address: String? + + def source_asset_address=: (String) -> String + + attr_reader source_asset_decimals: Integer? + + def source_asset_decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: Privy::Models::WalletActionTransferFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + ?source_amount: String, + ?source_asset: String, + ?source_asset_address: String, + ?source_asset_decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: Privy::Models::WalletActionTransferFailedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferFailedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + type status = :failed + + module Status + extend Privy::Internal::Type::Enum + + FAILED: :failed + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferFailedWebhookPayload::status] + end + + type type_ = :"wallet_action.transfer.failed" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_FAILED: :"wallet_action.transfer.failed" + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferFailedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_transfer_rejected_webhook_payload.rbs b/sig/privy/models/wallet_action_transfer_rejected_webhook_payload.rbs new file mode 100644 index 0000000..b183413 --- /dev/null +++ b/sig/privy/models/wallet_action_transfer_rejected_webhook_payload.rbs @@ -0,0 +1,108 @@ +module Privy + module Models + type wallet_action_transfer_rejected_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: Privy::Models::WalletActionTransferRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + class WalletActionTransferRejectedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor destination_address: String + + attr_accessor failure_reason: Privy::FailureReason + + attr_accessor source_chain: String + + attr_accessor status: Privy::Models::WalletActionTransferRejectedWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionTransferRejectedWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader source_amount: String? + + def source_amount=: (String) -> String + + attr_reader source_asset: String? + + def source_asset=: (String) -> String + + attr_reader source_asset_address: String? + + def source_asset_address=: (String) -> String + + attr_reader source_asset_decimals: Integer? + + def source_asset_decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: Privy::Models::WalletActionTransferRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + ?source_amount: String, + ?source_asset: String, + ?source_asset_address: String, + ?source_asset_decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + failure_reason: Privy::FailureReason, + source_chain: String, + status: Privy::Models::WalletActionTransferRejectedWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferRejectedWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + type status = :rejected + + module Status + extend Privy::Internal::Type::Enum + + REJECTED: :rejected + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferRejectedWebhookPayload::status] + end + + type type_ = :"wallet_action.transfer.rejected" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_REJECTED: :"wallet_action.transfer.rejected" + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferRejectedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_transfer_succeeded_webhook_payload.rbs b/sig/privy/models/wallet_action_transfer_succeeded_webhook_payload.rbs new file mode 100644 index 0000000..0735068 --- /dev/null +++ b/sig/privy/models/wallet_action_transfer_succeeded_webhook_payload.rbs @@ -0,0 +1,103 @@ +module Privy + module Models + type wallet_action_transfer_succeeded_webhook_payload = + { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + source_chain: String, + status: Privy::Models::WalletActionTransferSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + class WalletActionTransferSucceededWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor action_type: Privy::Models::wallet_action_type + + attr_accessor destination_address: String + + attr_accessor source_chain: String + + attr_accessor status: Privy::Models::WalletActionTransferSucceededWebhookPayload::status + + attr_accessor steps: ::Array[Privy::Models::wallet_action_step] + + attr_accessor type: Privy::Models::WalletActionTransferSucceededWebhookPayload::type_ + + attr_accessor wallet_action_id: String + + attr_accessor wallet_id: String + + attr_reader source_amount: String? + + def source_amount=: (String) -> String + + attr_reader source_asset: String? + + def source_asset=: (String) -> String + + attr_reader source_asset_address: String? + + def source_asset_address=: (String) -> String + + attr_reader source_asset_decimals: Integer? + + def source_asset_decimals=: (Integer) -> Integer + + def initialize: ( + action_type: Privy::Models::wallet_action_type, + destination_address: String, + source_chain: String, + status: Privy::Models::WalletActionTransferSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + ?source_amount: String, + ?source_asset: String, + ?source_asset_address: String, + ?source_asset_decimals: Integer + ) -> void + + def to_hash: -> { + action_type: Privy::Models::wallet_action_type, + destination_address: String, + source_chain: String, + status: Privy::Models::WalletActionTransferSucceededWebhookPayload::status, + steps: ::Array[Privy::Models::wallet_action_step], + type: Privy::Models::WalletActionTransferSucceededWebhookPayload::type_, + wallet_action_id: String, + wallet_id: String, + source_amount: String, + source_asset: String, + source_asset_address: String, + source_asset_decimals: Integer + } + + type status = :succeeded + + module Status + extend Privy::Internal::Type::Enum + + SUCCEEDED: :succeeded + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferSucceededWebhookPayload::status] + end + + type type_ = :"wallet_action.transfer.succeeded" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_ACTION_TRANSFER_SUCCEEDED: :"wallet_action.transfer.succeeded" + + def self?.values: -> ::Array[Privy::Models::WalletActionTransferSucceededWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_action_type.rbs b/sig/privy/models/wallet_action_type.rbs new file mode 100644 index 0000000..858b19f --- /dev/null +++ b/sig/privy/models/wallet_action_type.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type wallet_action_type = + :swap | :transfer | :earn_deposit | :earn_withdraw | :earn_incentive_claim + + module WalletActionType + extend Privy::Internal::Type::Enum + + SWAP: :swap + TRANSFER: :transfer + EARN_DEPOSIT: :earn_deposit + EARN_WITHDRAW: :earn_withdraw + EARN_INCENTIVE_CLAIM: :earn_incentive_claim + + def self?.values: -> ::Array[Privy::Models::wallet_action_type] + end + end +end diff --git a/sig/privy/models/wallet_additional_signer.rbs b/sig/privy/models/wallet_additional_signer.rbs new file mode 100644 index 0000000..2e8de81 --- /dev/null +++ b/sig/privy/models/wallet_additional_signer.rbs @@ -0,0 +1,7 @@ +module Privy + module Models + type wallet_additional_signer = ::Array[Privy::WalletAdditionalSignerItem] + + WalletAdditionalSigner: Privy::Internal::Type::Converter + end +end diff --git a/sig/privy/models/wallet_additional_signer_item.rbs b/sig/privy/models/wallet_additional_signer_item.rbs new file mode 100644 index 0000000..e454973 --- /dev/null +++ b/sig/privy/models/wallet_additional_signer_item.rbs @@ -0,0 +1,26 @@ +module Privy + module Models + type wallet_additional_signer_item = + { signer_id: String, override_policy_ids: Privy::Models::policy_input } + + class WalletAdditionalSignerItem < Privy::Internal::Type::BaseModel + attr_accessor signer_id: String + + attr_reader override_policy_ids: Privy::Models::policy_input? + + def override_policy_ids=: ( + Privy::Models::policy_input + ) -> Privy::Models::policy_input + + def initialize: ( + signer_id: String, + ?override_policy_ids: Privy::Models::policy_input + ) -> void + + def to_hash: -> { + signer_id: String, + override_policy_ids: Privy::Models::policy_input + } + end + end +end diff --git a/sig/privy/models/wallet_api_register_authorization_key_input.rbs b/sig/privy/models/wallet_api_register_authorization_key_input.rbs new file mode 100644 index 0000000..8f6b035 --- /dev/null +++ b/sig/privy/models/wallet_api_register_authorization_key_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_api_register_authorization_key_input = + { + public_key: String, + display_name: String, + role: Privy::Models::authorization_key_role? + } + + class WalletAPIRegisterAuthorizationKeyInput < Privy::Internal::Type::BaseModel + attr_accessor public_key: String + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_accessor role: Privy::Models::authorization_key_role? + + def initialize: ( + public_key: String, + ?display_name: String, + ?role: Privy::Models::authorization_key_role? + ) -> void + + def to_hash: -> { + public_key: String, + display_name: String, + role: Privy::Models::authorization_key_role? + } + end + end +end diff --git a/sig/privy/models/wallet_api_revoke_authorization_key_input.rbs b/sig/privy/models/wallet_api_revoke_authorization_key_input.rbs new file mode 100644 index 0000000..e027ed6 --- /dev/null +++ b/sig/privy/models/wallet_api_revoke_authorization_key_input.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type wallet_api_revoke_authorization_key_input = { id: String } + + class WalletAPIRevokeAuthorizationKeyInput < Privy::Internal::Type::BaseModel + attr_accessor id: String + + def initialize: (id: String) -> void + + def to_hash: -> { id: String } + end + end +end diff --git a/sig/privy/models/wallet_asset.rbs b/sig/privy/models/wallet_asset.rbs new file mode 100644 index 0000000..dbf3224 --- /dev/null +++ b/sig/privy/models/wallet_asset.rbs @@ -0,0 +1,21 @@ +module Privy + module Models + type wallet_asset = + :usdc | :"usdc.e" | :eth | :pol | :usdt | :eurc | :usdb | :sol + + module WalletAsset + extend Privy::Internal::Type::Enum + + USDC: :usdc + USDC_E: :"usdc.e" + ETH: :eth + POL: :pol + USDT: :usdt + EURC: :eurc + USDB: :usdb + SOL: :sol + + def self?.values: -> ::Array[Privy::Models::wallet_asset] + end + end +end diff --git a/sig/privy/models/wallet_authenticate_request_body.rbs b/sig/privy/models/wallet_authenticate_request_body.rbs new file mode 100644 index 0000000..df46067 --- /dev/null +++ b/sig/privy/models/wallet_authenticate_request_body.rbs @@ -0,0 +1,40 @@ +module Privy + module Models + type wallet_authenticate_request_body = + { + encryption_type: Privy::Models::WalletAuthenticateRequestBody::encryption_type, + recipient_public_key: String, + user_jwt: String + } + + class WalletAuthenticateRequestBody < Privy::Internal::Type::BaseModel + attr_accessor encryption_type: Privy::Models::WalletAuthenticateRequestBody::encryption_type + + attr_accessor recipient_public_key: String + + attr_accessor user_jwt: String + + def initialize: ( + encryption_type: Privy::Models::WalletAuthenticateRequestBody::encryption_type, + recipient_public_key: String, + user_jwt: String + ) -> void + + def to_hash: -> { + encryption_type: Privy::Models::WalletAuthenticateRequestBody::encryption_type, + recipient_public_key: String, + user_jwt: String + } + + type encryption_type = :HPKE + + module EncryptionType + extend Privy::Internal::Type::Enum + + HPKE: :HPKE + + def self?.values: -> ::Array[Privy::Models::WalletAuthenticateRequestBody::encryption_type] + end + end + end +end diff --git a/sig/privy/models/wallet_authenticate_with_jwt_params.rbs b/sig/privy/models/wallet_authenticate_with_jwt_params.rbs new file mode 100644 index 0000000..f082486 --- /dev/null +++ b/sig/privy/models/wallet_authenticate_with_jwt_params.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type wallet_authenticate_with_jwt_params = + { } & Privy::Internal::Type::request_parameters + + class WalletAuthenticateWithJwtParams < Privy::Models::WalletAuthenticateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def initialize: (?request_options: Privy::request_opts) -> void + + def to_hash: -> { request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/wallet_authenticate_with_jwt_response.rbs b/sig/privy/models/wallet_authenticate_with_jwt_response.rbs new file mode 100644 index 0000000..f215429 --- /dev/null +++ b/sig/privy/models/wallet_authenticate_with_jwt_response.rbs @@ -0,0 +1,104 @@ +module Privy + module Models + type wallet_authenticate_with_jwt_response = + Privy::WalletAuthenticateWithJwtResponse::WithEncryption + | Privy::WalletAuthenticateWithJwtResponse::WithoutEncryption + + module WalletAuthenticateWithJwtResponse + extend Privy::Internal::Type::Union + + type with_encryption = + { + encrypted_authorization_key: Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey, + expires_at: Float, + wallets: ::Array[Privy::Wallet] + } + + class WithEncryption < Privy::Internal::Type::BaseModel + attr_accessor encrypted_authorization_key: Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey + + attr_accessor expires_at: Float + + attr_accessor wallets: ::Array[Privy::Wallet] + + def initialize: ( + encrypted_authorization_key: Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey, + expires_at: Float, + wallets: ::Array[Privy::Wallet] + ) -> void + + def to_hash: -> { + encrypted_authorization_key: Privy::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey, + expires_at: Float, + wallets: ::Array[Privy::Wallet] + } + + type encrypted_authorization_key = + { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::encryption_type + } + + class EncryptedAuthorizationKey < Privy::Internal::Type::BaseModel + attr_accessor ciphertext: String + + attr_accessor encapsulated_key: String + + attr_accessor encryption_type: Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::encryption_type + + def initialize: ( + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::encryption_type + ) -> void + + def to_hash: -> { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::encryption_type + } + + type encryption_type = :HPKE + + module EncryptionType + extend Privy::Internal::Type::Enum + + HPKE: :HPKE + + def self?.values: -> ::Array[Privy::Models::WalletAuthenticateWithJwtResponse::WithEncryption::EncryptedAuthorizationKey::encryption_type] + end + end + end + + type without_encryption = + { + authorization_key: String, + expires_at: Float, + wallets: ::Array[Privy::Wallet] + } + + class WithoutEncryption < Privy::Internal::Type::BaseModel + attr_accessor authorization_key: String + + attr_accessor expires_at: Float + + attr_accessor wallets: ::Array[Privy::Wallet] + + def initialize: ( + authorization_key: String, + expires_at: Float, + wallets: ::Array[Privy::Wallet] + ) -> void + + def to_hash: -> { + authorization_key: String, + expires_at: Float, + wallets: ::Array[Privy::Wallet] + } + end + + def self?.variants: -> ::Array[Privy::Models::wallet_authenticate_with_jwt_response] + end + end +end diff --git a/sig/privy/models/wallet_authorization_headers.rbs b/sig/privy/models/wallet_authorization_headers.rbs new file mode 100644 index 0000000..b439186 --- /dev/null +++ b/sig/privy/models/wallet_authorization_headers.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type wallet_authorization_headers = + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + + class WalletAuthorizationHeaders < Privy::Internal::Type::BaseModel + attr_accessor privy_app_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + privy_app_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String + ) -> void + + def to_hash: -> { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + end + end +end diff --git a/sig/privy/models/wallet_batch_create_input.rbs b/sig/privy/models/wallet_batch_create_input.rbs new file mode 100644 index 0000000..78cbc24 --- /dev/null +++ b/sig/privy/models/wallet_batch_create_input.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type wallet_batch_create_input = + { wallets: ::Array[Privy::WalletBatchItemInput] } + + class WalletBatchCreateInput < Privy::Internal::Type::BaseModel + attr_accessor wallets: ::Array[Privy::WalletBatchItemInput] + + def initialize: (wallets: ::Array[Privy::WalletBatchItemInput]) -> void + + def to_hash: -> { wallets: ::Array[Privy::WalletBatchItemInput] } + end + end +end diff --git a/sig/privy/models/wallet_batch_create_response.rbs b/sig/privy/models/wallet_batch_create_response.rbs new file mode 100644 index 0000000..920f2e5 --- /dev/null +++ b/sig/privy/models/wallet_batch_create_response.rbs @@ -0,0 +1,18 @@ +module Privy + module Models + type wallet_batch_create_response = + { results: ::Array[Privy::Models::wallet_batch_create_result] } + + class WalletBatchCreateResponse < Privy::Internal::Type::BaseModel + attr_accessor results: ::Array[Privy::Models::wallet_batch_create_result] + + def initialize: ( + results: ::Array[Privy::Models::wallet_batch_create_result] + ) -> void + + def to_hash: -> { + results: ::Array[Privy::Models::wallet_batch_create_result] + } + end + end +end diff --git a/sig/privy/models/wallet_batch_create_result.rbs b/sig/privy/models/wallet_batch_create_result.rbs new file mode 100644 index 0000000..81a70af --- /dev/null +++ b/sig/privy/models/wallet_batch_create_result.rbs @@ -0,0 +1,92 @@ +module Privy + module Models + type wallet_batch_create_result = + Privy::WalletBatchCreateResult::WalletBatchCreateSuccess + | Privy::WalletBatchCreateResult::WalletBatchCreateFailure + + module WalletBatchCreateResult + extend Privy::Internal::Type::Union + + type wallet_batch_create_success = + { + index: Float, + success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess::success, + wallet: Privy::Wallet + } + + class WalletBatchCreateSuccess < Privy::Internal::Type::BaseModel + attr_accessor index: Float + + attr_accessor success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess::success + + attr_accessor wallet: Privy::Wallet + + def initialize: ( + index: Float, + success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess::success, + wallet: Privy::Wallet + ) -> void + + def to_hash: -> { + index: Float, + success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess::success, + wallet: Privy::Wallet + } + + type success = true + + module Success + extend Privy::Internal::Type::Enum + + TRUE: true + + def self?.values: -> ::Array[Privy::Models::WalletBatchCreateResult::WalletBatchCreateSuccess::success] + end + end + + type wallet_batch_create_failure = + { + code: String, + error: String, + index: Float, + success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure::success + } + + class WalletBatchCreateFailure < Privy::Internal::Type::BaseModel + attr_accessor code: String + + attr_accessor error: String + + attr_accessor index: Float + + attr_accessor success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure::success + + def initialize: ( + code: String, + error: String, + index: Float, + success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure::success + ) -> void + + def to_hash: -> { + code: String, + error: String, + index: Float, + success: Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure::success + } + + type success = false + + module Success + extend Privy::Internal::Type::Enum + + FALSE: false + + def self?.values: -> ::Array[Privy::Models::WalletBatchCreateResult::WalletBatchCreateFailure::success] + end + end + + def self?.variants: -> ::Array[Privy::Models::wallet_batch_create_result] + end + end +end diff --git a/sig/privy/models/wallet_batch_item_input.rbs b/sig/privy/models/wallet_batch_item_input.rbs new file mode 100644 index 0000000..e4edf82 --- /dev/null +++ b/sig/privy/models/wallet_batch_item_input.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type wallet_batch_item_input = + { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: Privy::Models::additional_signer_input, + display_name: String, + external_id: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: ::Array[String] + } + + class WalletBatchItemInput < Privy::Internal::Type::BaseModel + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_reader additional_signers: Privy::Models::additional_signer_input? + + def additional_signers=: ( + Privy::Models::additional_signer_input + ) -> Privy::Models::additional_signer_input + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader policy_ids: ::Array[String]? + + def policy_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + chain_type: Privy::Models::wallet_chain_type, + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String, + ?external_id: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: ::Array[String] + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: Privy::Models::additional_signer_input, + display_name: String, + external_id: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/wallet_chain_type.rbs b/sig/privy/models/wallet_chain_type.rbs new file mode 100644 index 0000000..27da88b --- /dev/null +++ b/sig/privy/models/wallet_chain_type.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type wallet_chain_type = + :ethereum + | :solana + | :cosmos + | :stellar + | :sui + | :aptos + | :movement + | :tron + | :"bitcoin-segwit" + | :"bitcoin-taproot" + | :pearl + | :near + | :ton + | :starknet + | :spark + + module WalletChainType + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + SOLANA: :solana + COSMOS: :cosmos + STELLAR: :stellar + SUI: :sui + APTOS: :aptos + MOVEMENT: :movement + TRON: :tron + BITCOIN_SEGWIT: :"bitcoin-segwit" + BITCOIN_TAPROOT: :"bitcoin-taproot" + PEARL: :pearl + NEAR: :near + TON: :ton + STARKNET: :starknet + SPARK: :spark + + def self?.values: -> ::Array[Privy::Models::wallet_chain_type] + end + end +end diff --git a/sig/privy/models/wallet_create_params.rbs b/sig/privy/models/wallet_create_params.rbs new file mode 100644 index 0000000..fb79fbe --- /dev/null +++ b/sig/privy/models/wallet_create_params.rbs @@ -0,0 +1,75 @@ +module Privy + module Models + type wallet_create_params = + { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: Privy::Models::additional_signer_input, + display_name: String, + external_id: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: Privy::Models::policy_input, + privy_idempotency_key: String + } + & Privy::Internal::Type::request_parameters + + class WalletCreateParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_reader additional_signers: Privy::Models::additional_signer_input? + + def additional_signers=: ( + Privy::Models::additional_signer_input + ) -> Privy::Models::additional_signer_input + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader policy_ids: Privy::Models::policy_input? + + def policy_ids=: ( + Privy::Models::policy_input + ) -> Privy::Models::policy_input + + attr_reader privy_idempotency_key: String? + + def privy_idempotency_key=: (String) -> String + + def initialize: ( + chain_type: Privy::Models::wallet_chain_type, + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String, + ?external_id: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: Privy::Models::policy_input, + ?privy_idempotency_key: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: Privy::Models::additional_signer_input, + display_name: String, + external_id: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: Privy::Models::policy_input, + privy_idempotency_key: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_create_wallets_with_recovery_params.rbs b/sig/privy/models/wallet_create_wallets_with_recovery_params.rbs new file mode 100644 index 0000000..872afa0 --- /dev/null +++ b/sig/privy/models/wallet_create_wallets_with_recovery_params.rbs @@ -0,0 +1,112 @@ +module Privy + module Models + type wallet_create_wallets_with_recovery_params = + { + primary_signer: Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner, + recovery_user: Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser, + wallets: ::Array[Privy::WalletCreateWalletsWithRecoveryParams::Wallet] + } + & Privy::Internal::Type::request_parameters + + class WalletCreateWalletsWithRecoveryParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor primary_signer: Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner + + attr_accessor recovery_user: Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser + + attr_accessor wallets: ::Array[Privy::WalletCreateWalletsWithRecoveryParams::Wallet] + + def initialize: ( + primary_signer: Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner, + recovery_user: Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser, + wallets: ::Array[Privy::WalletCreateWalletsWithRecoveryParams::Wallet], + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + primary_signer: Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner, + recovery_user: Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser, + wallets: ::Array[Privy::WalletCreateWalletsWithRecoveryParams::Wallet], + request_options: Privy::RequestOptions + } + + type primary_signer = { subject_id: String } + + class PrimarySigner < Privy::Internal::Type::BaseModel + attr_accessor subject_id: String + + def initialize: (subject_id: String) -> void + + def to_hash: -> { subject_id: String } + end + + type recovery_user = + { + linked_accounts: ::Array[Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser::linked_account] + } + + class RecoveryUser < Privy::Internal::Type::BaseModel + attr_accessor linked_accounts: ::Array[Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser::linked_account] + + def initialize: ( + linked_accounts: ::Array[Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser::linked_account] + ) -> void + + def to_hash: -> { + linked_accounts: ::Array[Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser::linked_account] + } + + type linked_account = + Privy::LinkedAccountEmailInput | Privy::LinkedAccountCustomJwtInput + + module LinkedAccount + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::WalletCreateWalletsWithRecoveryParams::RecoveryUser::linked_account] + end + end + + type wallet = + { + chain_type: Privy::Models::wallet_chain_type, + display_name: String, + external_id: String, + policy_ids: Privy::Models::policy_input + } + + class Wallet < Privy::Internal::Type::BaseModel + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_reader policy_ids: Privy::Models::policy_input? + + def policy_ids=: ( + Privy::Models::policy_input + ) -> Privy::Models::policy_input + + def initialize: ( + chain_type: Privy::Models::wallet_chain_type, + ?display_name: String, + ?external_id: String, + ?policy_ids: Privy::Models::policy_input + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::wallet_chain_type, + display_name: String, + external_id: String, + policy_ids: Privy::Models::policy_input + } + end + end + end +end diff --git a/sig/privy/models/wallet_create_wallets_with_recovery_response.rbs b/sig/privy/models/wallet_create_wallets_with_recovery_response.rbs new file mode 100644 index 0000000..71247a5 --- /dev/null +++ b/sig/privy/models/wallet_create_wallets_with_recovery_response.rbs @@ -0,0 +1,22 @@ +module Privy + module Models + type wallet_create_wallets_with_recovery_response = + { recovery_user_id: String, wallets: ::Array[Privy::Wallet] } + + class WalletCreateWalletsWithRecoveryResponse < Privy::Internal::Type::BaseModel + attr_accessor recovery_user_id: String + + attr_accessor wallets: ::Array[Privy::Wallet] + + def initialize: ( + recovery_user_id: String, + wallets: ::Array[Privy::Wallet] + ) -> void + + def to_hash: -> { + recovery_user_id: String, + wallets: ::Array[Privy::Wallet] + } + end + end +end diff --git a/sig/privy/models/wallet_creation_additional_signer_item.rbs b/sig/privy/models/wallet_creation_additional_signer_item.rbs new file mode 100644 index 0000000..7a5c7f7 --- /dev/null +++ b/sig/privy/models/wallet_creation_additional_signer_item.rbs @@ -0,0 +1,24 @@ +module Privy + module Models + type wallet_creation_additional_signer_item = + { signer_id: String, override_policy_ids: ::Array[String] } + + class WalletCreationAdditionalSignerItem < Privy::Internal::Type::BaseModel + attr_accessor signer_id: String + + attr_reader override_policy_ids: ::Array[String]? + + def override_policy_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + signer_id: String, + ?override_policy_ids: ::Array[String] + ) -> void + + def to_hash: -> { + signer_id: String, + override_policy_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/wallet_creation_input.rbs b/sig/privy/models/wallet_creation_input.rbs new file mode 100644 index 0000000..4a0f351 --- /dev/null +++ b/sig/privy/models/wallet_creation_input.rbs @@ -0,0 +1,43 @@ +module Privy + module Models + type wallet_creation_input = + { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: ::Array[Privy::WalletCreationAdditionalSignerItem], + create_smart_wallet: bool, + policy_ids: ::Array[String] + } + + class WalletCreationInput < Privy::Internal::Type::BaseModel + attr_accessor chain_type: Privy::Models::wallet_chain_type + + attr_reader additional_signers: ::Array[Privy::WalletCreationAdditionalSignerItem]? + + def additional_signers=: ( + ::Array[Privy::WalletCreationAdditionalSignerItem] + ) -> ::Array[Privy::WalletCreationAdditionalSignerItem] + + attr_reader create_smart_wallet: bool? + + def create_smart_wallet=: (bool) -> bool + + attr_reader policy_ids: ::Array[String]? + + def policy_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + chain_type: Privy::Models::wallet_chain_type, + ?additional_signers: ::Array[Privy::WalletCreationAdditionalSignerItem], + ?create_smart_wallet: bool, + ?policy_ids: ::Array[String] + ) -> void + + def to_hash: -> { + chain_type: Privy::Models::wallet_chain_type, + additional_signers: ::Array[Privy::WalletCreationAdditionalSignerItem], + create_smart_wallet: bool, + policy_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/wallet_custodian.rbs b/sig/privy/models/wallet_custodian.rbs new file mode 100644 index 0000000..f6a7cf4 --- /dev/null +++ b/sig/privy/models/wallet_custodian.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type wallet_custodian = { provider: String, provider_user_id: String } + + class WalletCustodian < Privy::Internal::Type::BaseModel + attr_accessor provider: String + + attr_accessor provider_user_id: String + + def initialize: (provider: String, provider_user_id: String) -> void + + def to_hash: -> { provider: String, provider_user_id: String } + end + end +end diff --git a/sig/privy/models/wallet_entropy_type.rbs b/sig/privy/models/wallet_entropy_type.rbs new file mode 100644 index 0000000..a57bc94 --- /dev/null +++ b/sig/privy/models/wallet_entropy_type.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type wallet_entropy_type = :hd | :"private-key" + + module WalletEntropyType + extend Privy::Internal::Type::Enum + + HD: :hd + PRIVATE_KEY: :"private-key" + + def self?.values: -> ::Array[Privy::Models::wallet_entropy_type] + end + end +end diff --git a/sig/privy/models/wallet_ethereum_asset.rbs b/sig/privy/models/wallet_ethereum_asset.rbs new file mode 100644 index 0000000..36f42c2 --- /dev/null +++ b/sig/privy/models/wallet_ethereum_asset.rbs @@ -0,0 +1,20 @@ +module Privy + module Models + type wallet_ethereum_asset = + :usdc | :"usdc.e" | :eth | :pol | :usdt | :eurc | :usdb + + module WalletEthereumAsset + extend Privy::Internal::Type::Enum + + USDC: :usdc + USDC_E: :"usdc.e" + ETH: :eth + POL: :pol + USDT: :usdt + EURC: :eurc + USDB: :usdb + + def self?.values: -> ::Array[Privy::Models::wallet_ethereum_asset] + end + end +end diff --git a/sig/privy/models/wallet_export_params.rbs b/sig/privy/models/wallet_export_params.rbs new file mode 100644 index 0000000..a77f45b --- /dev/null +++ b/sig/privy/models/wallet_export_params.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type wallet_export_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class WalletExportParams < Privy::Models::WalletExportRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_export_request_body.rbs b/sig/privy/models/wallet_export_request_body.rbs new file mode 100644 index 0000000..74329be --- /dev/null +++ b/sig/privy/models/wallet_export_request_body.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_export_request_body = + { + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + export_seed_phrase: bool + } + + class WalletExportRequestBody < Privy::Internal::Type::BaseModel + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_accessor recipient_public_key: String + + attr_reader export_seed_phrase: bool? + + def export_seed_phrase=: (bool) -> bool + + def initialize: ( + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + ?export_seed_phrase: bool + ) -> void + + def to_hash: -> { + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + export_seed_phrase: bool + } + end + end +end diff --git a/sig/privy/models/wallet_export_response_body.rbs b/sig/privy/models/wallet_export_response_body.rbs new file mode 100644 index 0000000..31080a3 --- /dev/null +++ b/sig/privy/models/wallet_export_response_body.rbs @@ -0,0 +1,30 @@ +module Privy + module Models + type wallet_export_response_body = + { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + } + + class WalletExportResponseBody < Privy::Internal::Type::BaseModel + attr_accessor ciphertext: String + + attr_accessor encapsulated_key: String + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + def initialize: ( + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + ) -> void + + def to_hash: -> { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::Models::hpke_encryption + } + end + end +end diff --git a/sig/privy/models/wallet_funds_asset.rbs b/sig/privy/models/wallet_funds_asset.rbs new file mode 100644 index 0000000..60d48b1 --- /dev/null +++ b/sig/privy/models/wallet_funds_asset.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type wallet_funds_asset = + Privy::WalletFundsNativeTokenAsset + | Privy::WalletFundsErc20Asset + | Privy::WalletFundsSplAsset + | Privy::WalletFundsSacAsset + + module WalletFundsAsset + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::wallet_funds_asset] + end + end +end diff --git a/sig/privy/models/wallet_funds_erc_20_asset.rbs b/sig/privy/models/wallet_funds_erc_20_asset.rbs new file mode 100644 index 0000000..0aa80fb --- /dev/null +++ b/sig/privy/models/wallet_funds_erc_20_asset.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_funds_erc20_asset = + { address: String, type: Privy::Models::WalletFundsErc20Asset::type_ } + + class WalletFundsErc20Asset < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor type: Privy::Models::WalletFundsErc20Asset::type_ + + def initialize: ( + address: String, + type: Privy::Models::WalletFundsErc20Asset::type_ + ) -> void + + def to_hash: -> { + address: String, + type: Privy::Models::WalletFundsErc20Asset::type_ + } + + type type_ = :erc20 + + module Type + extend Privy::Internal::Type::Enum + + ERC20: :erc20 + + def self?.values: -> ::Array[Privy::Models::WalletFundsErc20Asset::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_funds_native_token_asset.rbs b/sig/privy/models/wallet_funds_native_token_asset.rbs new file mode 100644 index 0000000..77adb4c --- /dev/null +++ b/sig/privy/models/wallet_funds_native_token_asset.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_funds_native_token_asset = + { address: nil, type: Privy::Models::WalletFundsNativeTokenAsset::type_ } + + class WalletFundsNativeTokenAsset < Privy::Internal::Type::BaseModel + attr_accessor address: nil + + attr_accessor type: Privy::Models::WalletFundsNativeTokenAsset::type_ + + def initialize: ( + address: nil, + type: Privy::Models::WalletFundsNativeTokenAsset::type_ + ) -> void + + def to_hash: -> { + address: nil, + type: Privy::Models::WalletFundsNativeTokenAsset::type_ + } + + type type_ = :"native-token" + + module Type + extend Privy::Internal::Type::Enum + + NATIVE_TOKEN: :"native-token" + + def self?.values: -> ::Array[Privy::Models::WalletFundsNativeTokenAsset::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_funds_sac_asset.rbs b/sig/privy/models/wallet_funds_sac_asset.rbs new file mode 100644 index 0000000..0a08a63 --- /dev/null +++ b/sig/privy/models/wallet_funds_sac_asset.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_funds_sac_asset = + { address: String, type: Privy::Models::WalletFundsSacAsset::type_ } + + class WalletFundsSacAsset < Privy::Internal::Type::BaseModel + attr_accessor address: String + + attr_accessor type: Privy::Models::WalletFundsSacAsset::type_ + + def initialize: ( + address: String, + type: Privy::Models::WalletFundsSacAsset::type_ + ) -> void + + def to_hash: -> { + address: String, + type: Privy::Models::WalletFundsSacAsset::type_ + } + + type type_ = :sac + + module Type + extend Privy::Internal::Type::Enum + + SAC: :sac + + def self?.values: -> ::Array[Privy::Models::WalletFundsSacAsset::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_funds_spl_asset.rbs b/sig/privy/models/wallet_funds_spl_asset.rbs new file mode 100644 index 0000000..26e9e2f --- /dev/null +++ b/sig/privy/models/wallet_funds_spl_asset.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_funds_spl_asset = + { mint: String, type: Privy::Models::WalletFundsSplAsset::type_ } + + class WalletFundsSplAsset < Privy::Internal::Type::BaseModel + attr_accessor mint: String + + attr_accessor type: Privy::Models::WalletFundsSplAsset::type_ + + def initialize: ( + mint: String, + type: Privy::Models::WalletFundsSplAsset::type_ + ) -> void + + def to_hash: -> { + mint: String, + type: Privy::Models::WalletFundsSplAsset::type_ + } + + type type_ = :spl + + module Type + extend Privy::Internal::Type::Enum + + SPL: :spl + + def self?.values: -> ::Array[Privy::Models::WalletFundsSplAsset::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_get_params.rbs b/sig/privy/models/wallet_get_params.rbs new file mode 100644 index 0000000..98c67f7 --- /dev/null +++ b/sig/privy/models/wallet_get_params.rbs @@ -0,0 +1,23 @@ +module Privy + module Models + type wallet_get_params = + { wallet_id: String } & Privy::Internal::Type::request_parameters + + class WalletGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor wallet_id: String + + def initialize: ( + wallet_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_get_wallet_by_address_params.rbs b/sig/privy/models/wallet_get_wallet_by_address_params.rbs new file mode 100644 index 0000000..5827503 --- /dev/null +++ b/sig/privy/models/wallet_get_wallet_by_address_params.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type wallet_get_wallet_by_address_params = + { } & Privy::Internal::Type::request_parameters + + class WalletGetWalletByAddressParams < Privy::Models::GetByWalletAddressRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def initialize: (?request_options: Privy::request_opts) -> void + + def to_hash: -> { request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/wallet_import_init_response.rbs b/sig/privy/models/wallet_import_init_response.rbs new file mode 100644 index 0000000..6aff5f5 --- /dev/null +++ b/sig/privy/models/wallet_import_init_response.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_import_init_response = + { + encryption_public_key: String, + encryption_type: Privy::Models::hpke_encryption, + import_id: String + } + + class WalletImportInitResponse < Privy::Internal::Type::BaseModel + attr_accessor encryption_public_key: String + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + attr_reader import_id: String? + + def import_id=: (String) -> String + + def initialize: ( + encryption_public_key: String, + encryption_type: Privy::Models::hpke_encryption, + ?import_id: String + ) -> void + + def to_hash: -> { + encryption_public_key: String, + encryption_type: Privy::Models::hpke_encryption, + import_id: String + } + end + end +end diff --git a/sig/privy/models/wallet_import_supported_chains.rbs b/sig/privy/models/wallet_import_supported_chains.rbs new file mode 100644 index 0000000..7d5d187 --- /dev/null +++ b/sig/privy/models/wallet_import_supported_chains.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type wallet_import_supported_chains = :ethereum | :solana + + module WalletImportSupportedChains + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + SOLANA: :solana + + def self?.values: -> ::Array[Privy::Models::wallet_import_supported_chains] + end + end +end diff --git a/sig/privy/models/wallet_import_supported_entropy_types.rbs b/sig/privy/models/wallet_import_supported_entropy_types.rbs new file mode 100644 index 0000000..316a456 --- /dev/null +++ b/sig/privy/models/wallet_import_supported_entropy_types.rbs @@ -0,0 +1,14 @@ +module Privy + module Models + type wallet_import_supported_entropy_types = :"private-key" | :hd + + module WalletImportSupportedEntropyTypes + extend Privy::Internal::Type::Enum + + PRIVATE_KEY: :"private-key" + HD: :hd + + def self?.values: -> ::Array[Privy::Models::wallet_import_supported_entropy_types] + end + end +end diff --git a/sig/privy/models/wallet_init_import_params.rbs b/sig/privy/models/wallet_init_import_params.rbs new file mode 100644 index 0000000..bd8915c --- /dev/null +++ b/sig/privy/models/wallet_init_import_params.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_init_import_params = + { body: Privy::Models::WalletInitImportParams::body } + & Privy::Internal::Type::request_parameters + + class WalletInitImportParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor body: Privy::Models::WalletInitImportParams::body + + def initialize: ( + body: Privy::Models::WalletInitImportParams::body, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + body: Privy::Models::WalletInitImportParams::body, + request_options: Privy::RequestOptions + } + + type body = Privy::HDInitInput | Privy::PrivateKeyInitInput + + module Body + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::WalletInitImportParams::body] + end + end + end +end diff --git a/sig/privy/models/wallet_init_import_response.rbs b/sig/privy/models/wallet_init_import_response.rbs new file mode 100644 index 0000000..321326c --- /dev/null +++ b/sig/privy/models/wallet_init_import_response.rbs @@ -0,0 +1,25 @@ +module Privy + module Models + type wallet_init_import_response = + { + encryption_public_key: String, + encryption_type: Privy::Models::hpke_encryption + } + + class WalletInitImportResponse < Privy::Internal::Type::BaseModel + attr_accessor encryption_public_key: String + + attr_accessor encryption_type: Privy::Models::hpke_encryption + + def initialize: ( + encryption_public_key: String, + encryption_type: Privy::Models::hpke_encryption + ) -> void + + def to_hash: -> { + encryption_public_key: String, + encryption_type: Privy::Models::hpke_encryption + } + end + end +end diff --git a/sig/privy/models/wallet_intent_response.rbs b/sig/privy/models/wallet_intent_response.rbs new file mode 100644 index 0000000..276173b --- /dev/null +++ b/sig/privy/models/wallet_intent_response.rbs @@ -0,0 +1,153 @@ +module Privy + module Models + type wallet_intent_response = + { + intent_type: Privy::Models::WalletIntentResponse::intent_type, + request_details: Privy::WalletIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + + class WalletIntentResponse < Privy::Models::BaseIntentResponse + def intent_type: -> Privy::Models::WalletIntentResponse::intent_type + + def intent_type=: ( + Privy::Models::WalletIntentResponse::intent_type _ + ) -> Privy::Models::WalletIntentResponse::intent_type + + def request_details: -> Privy::WalletIntentResponse::RequestDetails + + def request_details=: ( + Privy::WalletIntentResponse::RequestDetails _ + ) -> Privy::WalletIntentResponse::RequestDetails + + def action_result: -> Privy::BaseActionResult? + + def action_result=: (Privy::BaseActionResult _) -> Privy::BaseActionResult + + def current_resource_data: -> Privy::Wallet? + + def current_resource_data=: (Privy::Wallet _) -> Privy::Wallet + + def initialize: ( + intent_type: Privy::Models::WalletIntentResponse::intent_type, + request_details: Privy::WalletIntentResponse::RequestDetails, + ?action_result: Privy::BaseActionResult, + ?current_resource_data: Privy::Wallet + ) -> void + + def to_hash: -> { + intent_type: Privy::Models::WalletIntentResponse::intent_type, + request_details: Privy::WalletIntentResponse::RequestDetails, + action_result: Privy::BaseActionResult, + current_resource_data: Privy::Wallet + } + + type intent_type = :WALLET + + module IntentType + extend Privy::Internal::Type::Enum + + WALLET: :WALLET + + def self?.values: -> ::Array[Privy::Models::WalletIntentResponse::intent_type] + end + + type request_details = + { + body: Privy::WalletIntentResponse::RequestDetails::Body, + method_: Privy::Models::WalletIntentResponse::RequestDetails::method_, + url: String + } + + class RequestDetails < Privy::Internal::Type::BaseModel + attr_accessor body: Privy::WalletIntentResponse::RequestDetails::Body + + attr_accessor method_: Privy::Models::WalletIntentResponse::RequestDetails::method_ + + attr_accessor url: String + + def initialize: ( + body: Privy::WalletIntentResponse::RequestDetails::Body, + method_: Privy::Models::WalletIntentResponse::RequestDetails::method_, + url: String + ) -> void + + def to_hash: -> { + body: Privy::WalletIntentResponse::RequestDetails::Body, + method_: Privy::Models::WalletIntentResponse::RequestDetails::method_, + url: String + } + + type body = + { + additional_signers: Privy::Models::additional_signer_input, + authorization_key_ids: ::Array[String], + authorization_threshold: Float, + display_name: String?, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: Privy::Models::policy_input + } + + class Body < Privy::Internal::Type::BaseModel + attr_reader additional_signers: Privy::Models::additional_signer_input? + + def additional_signers=: ( + Privy::Models::additional_signer_input + ) -> Privy::Models::additional_signer_input + + attr_reader authorization_key_ids: ::Array[String]? + + def authorization_key_ids=: (::Array[String]) -> ::Array[String] + + attr_reader authorization_threshold: Float? + + def authorization_threshold=: (Float) -> Float + + attr_accessor display_name: String? + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader policy_ids: Privy::Models::policy_input? + + def policy_ids=: ( + Privy::Models::policy_input + ) -> Privy::Models::policy_input + + def initialize: ( + ?additional_signers: Privy::Models::additional_signer_input, + ?authorization_key_ids: ::Array[String], + ?authorization_threshold: Float, + ?display_name: String?, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: Privy::Models::policy_input + ) -> void + + def to_hash: -> { + additional_signers: Privy::Models::additional_signer_input, + authorization_key_ids: ::Array[String], + authorization_threshold: Float, + display_name: String?, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: Privy::Models::policy_input + } + end + + type method_ = :PATCH + + module Method + extend Privy::Internal::Type::Enum + + PATCH: :PATCH + + def self?.values: -> ::Array[Privy::Models::WalletIntentResponse::RequestDetails::method_] + end + end + end + end +end diff --git a/sig/privy/models/wallet_invite_input.rbs b/sig/privy/models/wallet_invite_input.rbs new file mode 100644 index 0000000..aaf6103 --- /dev/null +++ b/sig/privy/models/wallet_invite_input.rbs @@ -0,0 +1,32 @@ +module Privy + module Models + type wallet_invite_input = + { type: Privy::Models::WalletInviteInput::type_, value: String } + + class WalletInviteInput < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::WalletInviteInput::type_ + + attr_accessor value: String + + def initialize: ( + type: Privy::Models::WalletInviteInput::type_, + value: String + ) -> void + + def to_hash: -> { + type: Privy::Models::WalletInviteInput::type_, + value: String + } + + type type_ = :wallet + + module Type + extend Privy::Internal::Type::Enum + + WALLET: :wallet + + def self?.values: -> ::Array[Privy::Models::WalletInviteInput::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_list_params.rbs b/sig/privy/models/wallet_list_params.rbs new file mode 100644 index 0000000..101c3c1 --- /dev/null +++ b/sig/privy/models/wallet_list_params.rbs @@ -0,0 +1,63 @@ +module Privy + module Models + type wallet_list_params = + { + authorization_key: String, + chain_type: Privy::Models::wallet_chain_type, + cursor: String, + external_id: String, + limit: Float?, + user_id: String + } + & Privy::Internal::Type::request_parameters + + class WalletListParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_reader authorization_key: String? + + def authorization_key=: (String) -> String + + attr_reader chain_type: Privy::Models::wallet_chain_type? + + def chain_type=: ( + Privy::Models::wallet_chain_type + ) -> Privy::Models::wallet_chain_type + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_accessor limit: Float? + + attr_reader user_id: String? + + def user_id=: (String) -> String + + def initialize: ( + ?authorization_key: String, + ?chain_type: Privy::Models::wallet_chain_type, + ?cursor: String, + ?external_id: String, + ?limit: Float?, + ?user_id: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + authorization_key: String, + chain_type: Privy::Models::wallet_chain_type, + cursor: String, + external_id: String, + limit: Float?, + user_id: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_raw_sign_params.rbs b/sig/privy/models/wallet_raw_sign_params.rbs new file mode 100644 index 0000000..22ea5fc --- /dev/null +++ b/sig/privy/models/wallet_raw_sign_params.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type wallet_raw_sign_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class WalletRawSignParams < Privy::Models::RawSignInput + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_idempotency_key: -> String? + + def privy_idempotency_key=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_recovered_webhook_payload.rbs b/sig/privy/models/wallet_recovered_webhook_payload.rbs new file mode 100644 index 0000000..5c83dbf --- /dev/null +++ b/sig/privy/models/wallet_recovered_webhook_payload.rbs @@ -0,0 +1,45 @@ +module Privy + module Models + type wallet_recovered_webhook_payload = + { + type: Privy::Models::WalletRecoveredWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String + } + + class WalletRecoveredWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor type: Privy::Models::WalletRecoveredWebhookPayload::type_ + + attr_accessor user_id: String + + attr_accessor wallet_address: String + + attr_accessor wallet_id: String + + def initialize: ( + type: Privy::Models::WalletRecoveredWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String + ) -> void + + def to_hash: -> { + type: Privy::Models::WalletRecoveredWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String + } + + type type_ = :"wallet.recovered" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_RECOVERED: :"wallet.recovered" + + def self?.values: -> ::Array[Privy::Models::WalletRecoveredWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_recovery_setup_webhook_payload.rbs b/sig/privy/models/wallet_recovery_setup_webhook_payload.rbs new file mode 100644 index 0000000..37617fa --- /dev/null +++ b/sig/privy/models/wallet_recovery_setup_webhook_payload.rbs @@ -0,0 +1,71 @@ +module Privy + module Models + type wallet_recovery_setup_webhook_payload = + { + method_: Privy::Models::WalletRecoverySetupWebhookPayload::method_, + type: Privy::Models::WalletRecoverySetupWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String + } + + class WalletRecoverySetupWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor method_: Privy::Models::WalletRecoverySetupWebhookPayload::method_ + + attr_accessor type: Privy::Models::WalletRecoverySetupWebhookPayload::type_ + + attr_accessor user_id: String + + attr_accessor wallet_address: String + + attr_accessor wallet_id: String + + def initialize: ( + method_: Privy::Models::WalletRecoverySetupWebhookPayload::method_, + type: Privy::Models::WalletRecoverySetupWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String + ) -> void + + def to_hash: -> { + method_: Privy::Models::WalletRecoverySetupWebhookPayload::method_, + type: Privy::Models::WalletRecoverySetupWebhookPayload::type_, + user_id: String, + wallet_address: String, + wallet_id: String + } + + type method_ = + :user_passcode_derived_recovery_key + | :privy_passcode_derived_recovery_key + | :privy_generated_recovery_key + | :google_drive_recovery_secret + | :icloud_recovery_secret + | :recovery_encryption_key + + module Method + extend Privy::Internal::Type::Enum + + USER_PASSCODE_DERIVED_RECOVERY_KEY: :user_passcode_derived_recovery_key + PRIVY_PASSCODE_DERIVED_RECOVERY_KEY: :privy_passcode_derived_recovery_key + PRIVY_GENERATED_RECOVERY_KEY: :privy_generated_recovery_key + GOOGLE_DRIVE_RECOVERY_SECRET: :google_drive_recovery_secret + ICLOUD_RECOVERY_SECRET: :icloud_recovery_secret + RECOVERY_ENCRYPTION_KEY: :recovery_encryption_key + + def self?.values: -> ::Array[Privy::Models::WalletRecoverySetupWebhookPayload::method_] + end + + type type_ = :"wallet.recovery_setup" + + module Type + extend Privy::Internal::Type::Enum + + WALLET_RECOVERY_SETUP: :"wallet.recovery_setup" + + def self?.values: -> ::Array[Privy::Models::WalletRecoverySetupWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/wallet_revoke_response.rbs b/sig/privy/models/wallet_revoke_response.rbs new file mode 100644 index 0000000..6033d5c --- /dev/null +++ b/sig/privy/models/wallet_revoke_response.rbs @@ -0,0 +1,13 @@ +module Privy + module Models + type wallet_revoke_response = { message: String } + + class WalletRevokeResponse < Privy::Internal::Type::BaseModel + attr_accessor message: String + + def initialize: (message: String) -> void + + def to_hash: -> { message: String } + end + end +end diff --git a/sig/privy/models/wallet_rpc_params.rbs b/sig/privy/models/wallet_rpc_params.rbs new file mode 100644 index 0000000..b7c2bcb --- /dev/null +++ b/sig/privy/models/wallet_rpc_params.rbs @@ -0,0 +1,47 @@ +module Privy + module Models + type wallet_rpc_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class WalletRpcParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor wallet_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_idempotency_key: String? + + def privy_idempotency_key=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_rpc_request_body.rbs b/sig/privy/models/wallet_rpc_request_body.rbs new file mode 100644 index 0000000..e9c0092 --- /dev/null +++ b/sig/privy/models/wallet_rpc_request_body.rbs @@ -0,0 +1,33 @@ +module Privy + module Models + type wallet_rpc_request_body = + Privy::EthereumSignTransactionRpcInput + | Privy::EthereumSendTransactionRpcInput + | Privy::EthereumPersonalSignRpcInput + | Privy::EthereumSignTypedDataRpcInput + | Privy::EthereumSecp256k1SignRpcInput + | Privy::EthereumSign7702AuthorizationRpcInput + | Privy::EthereumSignUserOperationRpcInput + | Privy::EthereumSendCallsRpcInput + | Privy::SolanaSignTransactionRpcInput + | Privy::SolanaSignAndSendTransactionRpcInput + | Privy::SolanaSignMessageRpcInput + | Privy::SparkTransferRpcInput + | Privy::SparkGetBalanceRpcInput + | Privy::SparkTransferTokensRpcInput + | Privy::SparkGetStaticDepositAddressRpcInput + | Privy::SparkGetClaimStaticDepositQuoteRpcInput + | Privy::SparkClaimStaticDepositRpcInput + | Privy::SparkCreateLightningInvoiceRpcInput + | Privy::SparkPayLightningInvoiceRpcInput + | Privy::SparkSignMessageWithIdentityKeyRpcInput + | Privy::ExportPrivateKeyRpcInput + | Privy::ExportSeedPhraseRpcInput + + module WalletRpcRequestBody + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::wallet_rpc_request_body] + end + end +end diff --git a/sig/privy/models/wallet_rpc_response.rbs b/sig/privy/models/wallet_rpc_response.rbs new file mode 100644 index 0000000..50ae3f7 --- /dev/null +++ b/sig/privy/models/wallet_rpc_response.rbs @@ -0,0 +1,33 @@ +module Privy + module Models + type wallet_rpc_response = + Privy::EthereumPersonalSignRpcResponse + | Privy::EthereumSignTypedDataRpcResponse + | Privy::EthereumSignTransactionRpcResponse + | Privy::EthereumSendTransactionRpcResponse + | Privy::EthereumSignUserOperationRpcResponse + | Privy::EthereumSign7702AuthorizationRpcResponse + | Privy::EthereumSecp256k1SignRpcResponse + | Privy::EthereumSendCallsRpcResponse + | Privy::SolanaSignMessageRpcResponse + | Privy::SolanaSignTransactionRpcResponse + | Privy::SolanaSignAndSendTransactionRpcResponse + | Privy::SparkTransferRpcResponse + | Privy::SparkGetBalanceRpcResponse + | Privy::SparkTransferTokensRpcResponse + | Privy::SparkGetStaticDepositAddressRpcResponse + | Privy::SparkGetClaimStaticDepositQuoteRpcResponse + | Privy::SparkClaimStaticDepositRpcResponse + | Privy::SparkCreateLightningInvoiceRpcResponse + | Privy::SparkPayLightningInvoiceRpcResponse + | Privy::SparkSignMessageWithIdentityKeyRpcResponse + | Privy::ExportPrivateKeyRpcResponse + | Privy::ExportSeedPhraseRpcResponse + + module WalletRpcResponse + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::wallet_rpc_response] + end + end +end diff --git a/sig/privy/models/wallet_solana_asset.rbs b/sig/privy/models/wallet_solana_asset.rbs new file mode 100644 index 0000000..66af23e --- /dev/null +++ b/sig/privy/models/wallet_solana_asset.rbs @@ -0,0 +1,16 @@ +module Privy + module Models + type wallet_solana_asset = :sol | :usdc | :eurc | :usdb + + module WalletSolanaAsset + extend Privy::Internal::Type::Enum + + SOL: :sol + USDC: :usdc + EURC: :eurc + USDB: :usdb + + def self?.values: -> ::Array[Privy::Models::wallet_solana_asset] + end + end +end diff --git a/sig/privy/models/wallet_submit_import_params.rbs b/sig/privy/models/wallet_submit_import_params.rbs new file mode 100644 index 0000000..21ba0bb --- /dev/null +++ b/sig/privy/models/wallet_submit_import_params.rbs @@ -0,0 +1,76 @@ +module Privy + module Models + type wallet_submit_import_params = + { + wallet: Privy::Models::WalletSubmitImportParams::wallet, + additional_signers: Privy::Models::additional_signer_input, + display_name: String, + external_id: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: Privy::Models::policy_input + } + & Privy::Internal::Type::request_parameters + + class WalletSubmitImportParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor wallet: Privy::Models::WalletSubmitImportParams::wallet + + attr_reader additional_signers: Privy::Models::additional_signer_input? + + def additional_signers=: ( + Privy::Models::additional_signer_input + ) -> Privy::Models::additional_signer_input + + attr_reader display_name: String? + + def display_name=: (String) -> String + + attr_reader external_id: String? + + def external_id=: (String) -> String + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader policy_ids: Privy::Models::policy_input? + + def policy_ids=: ( + Privy::Models::policy_input + ) -> Privy::Models::policy_input + + def initialize: ( + wallet: Privy::Models::WalletSubmitImportParams::wallet, + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String, + ?external_id: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: Privy::Models::policy_input, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet: Privy::Models::WalletSubmitImportParams::wallet, + additional_signers: Privy::Models::additional_signer_input, + display_name: String, + external_id: String, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: Privy::Models::policy_input, + request_options: Privy::RequestOptions + } + + type wallet = Privy::HDSubmitInput | Privy::PrivateKeySubmitInput + + module Wallet + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::WalletSubmitImportParams::wallet] + end + end + end +end diff --git a/sig/privy/models/wallet_transfer_params.rbs b/sig/privy/models/wallet_transfer_params.rbs new file mode 100644 index 0000000..6f476b9 --- /dev/null +++ b/sig/privy/models/wallet_transfer_params.rbs @@ -0,0 +1,49 @@ +module Privy + module Models + type wallet_transfer_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class WalletTransferParams < Privy::Models::TransferRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_idempotency_key: -> String? + + def privy_idempotency_key=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_update_params.rbs b/sig/privy/models/wallet_update_params.rbs new file mode 100644 index 0000000..dfd4ce9 --- /dev/null +++ b/sig/privy/models/wallet_update_params.rbs @@ -0,0 +1,42 @@ +module Privy + module Models + type wallet_update_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class WalletUpdateParams < Privy::Models::WalletUpdateRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end +end diff --git a/sig/privy/models/wallet_update_request_body.rbs b/sig/privy/models/wallet_update_request_body.rbs new file mode 100644 index 0000000..772d465 --- /dev/null +++ b/sig/privy/models/wallet_update_request_body.rbs @@ -0,0 +1,46 @@ +module Privy + module Models + type wallet_update_request_body = + { + additional_signers: Privy::Models::additional_signer_input, + display_name: String?, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: ::Array[String] + } + + class WalletUpdateRequestBody < Privy::Internal::Type::BaseModel + attr_reader additional_signers: Privy::Models::additional_signer_input? + + def additional_signers=: ( + Privy::Models::additional_signer_input + ) -> Privy::Models::additional_signer_input + + attr_accessor display_name: String? + + attr_accessor owner: Privy::Models::owner_input? + + attr_accessor owner_id: String? + + attr_reader policy_ids: ::Array[String]? + + def policy_ids=: (::Array[String]) -> ::Array[String] + + def initialize: ( + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String?, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: ::Array[String] + ) -> void + + def to_hash: -> { + additional_signers: Privy::Models::additional_signer_input, + display_name: String?, + owner: Privy::Models::owner_input?, + owner_id: String?, + policy_ids: ::Array[String] + } + end + end +end diff --git a/sig/privy/models/wallets/balance_get_params.rbs b/sig/privy/models/wallets/balance_get_params.rbs new file mode 100644 index 0000000..f9aae43 --- /dev/null +++ b/sig/privy/models/wallets/balance_get_params.rbs @@ -0,0 +1,202 @@ +module Privy + module Models + module Wallets + type balance_get_params = + { + wallet_id: String, + token: Privy::Models::Wallets::BalanceGetParams::token, + asset: Privy::Models::Wallets::BalanceGetParams::asset, + chain: Privy::Models::Wallets::BalanceGetParams::chain, + include_currency: Privy::Models::Wallets::BalanceGetParams::include_currency + } + & Privy::Internal::Type::request_parameters + + class BalanceGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor wallet_id: String + + attr_reader token: Privy::Models::Wallets::BalanceGetParams::token? + + def token=: ( + Privy::Models::Wallets::BalanceGetParams::token + ) -> Privy::Models::Wallets::BalanceGetParams::token + + attr_reader asset: Privy::Models::Wallets::BalanceGetParams::asset? + + def asset=: ( + Privy::Models::Wallets::BalanceGetParams::asset + ) -> Privy::Models::Wallets::BalanceGetParams::asset + + attr_reader chain: Privy::Models::Wallets::BalanceGetParams::chain? + + def chain=: ( + Privy::Models::Wallets::BalanceGetParams::chain + ) -> Privy::Models::Wallets::BalanceGetParams::chain + + attr_reader include_currency: Privy::Models::Wallets::BalanceGetParams::include_currency? + + def include_currency=: ( + Privy::Models::Wallets::BalanceGetParams::include_currency + ) -> Privy::Models::Wallets::BalanceGetParams::include_currency + + def initialize: ( + wallet_id: String, + ?token: Privy::Models::Wallets::BalanceGetParams::token, + ?asset: Privy::Models::Wallets::BalanceGetParams::asset, + ?chain: Privy::Models::Wallets::BalanceGetParams::chain, + ?include_currency: Privy::Models::Wallets::BalanceGetParams::include_currency, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + token: Privy::Models::Wallets::BalanceGetParams::token, + asset: Privy::Models::Wallets::BalanceGetParams::asset, + chain: Privy::Models::Wallets::BalanceGetParams::chain, + include_currency: Privy::Models::Wallets::BalanceGetParams::include_currency, + request_options: Privy::RequestOptions + } + + type token = String | ::Array[String] + + module Token + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::Wallets::BalanceGetParams::token] + + StringArray: Privy::Internal::Type::Converter + end + + type asset = + :usdc + | :"usdc.e" + | :eth + | :pol + | :usdt + | :eurc + | :usdb + | :sol + | ::Array[Privy::Models::wallet_asset] + + module Asset + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::Wallets::BalanceGetParams::asset] + + USDC: :usdc + USDC_E: :"usdc.e" + ETH: :eth + POL: :pol + USDT: :usdt + EURC: :eurc + USDB: :usdb + SOL: :sol + + WalletAssetArray: Privy::Internal::Type::Converter + end + + type chain = + :ethereum + | :arbitrum + | :base + | :tempo + | :linea + | :optimism + | :polygon + | :solana + | :zksync_era + | :sepolia + | :arbitrum_sepolia + | :base_sepolia + | :linea_testnet + | :optimism_sepolia + | :polygon_amoy + | :solana_devnet + | :solana_testnet + | ::Array[Privy::Models::Wallets::BalanceGetParams::Chain::union_member1] + + module Chain + extend Privy::Internal::Type::Union + + type union_member1 = + :ethereum + | :arbitrum + | :base + | :tempo + | :linea + | :optimism + | :polygon + | :solana + | :zksync_era + | :sepolia + | :arbitrum_sepolia + | :base_sepolia + | :linea_testnet + | :optimism_sepolia + | :polygon_amoy + | :solana_devnet + | :solana_testnet + + module UnionMember1 + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + ARBITRUM: :arbitrum + BASE: :base + TEMPO: :tempo + LINEA: :linea + OPTIMISM: :optimism + POLYGON: :polygon + SOLANA: :solana + ZKSYNC_ERA: :zksync_era + SEPOLIA: :sepolia + ARBITRUM_SEPOLIA: :arbitrum_sepolia + BASE_SEPOLIA: :base_sepolia + LINEA_TESTNET: :linea_testnet + OPTIMISM_SEPOLIA: :optimism_sepolia + POLYGON_AMOY: :polygon_amoy + SOLANA_DEVNET: :solana_devnet + SOLANA_TESTNET: :solana_testnet + + def self?.values: -> ::Array[Privy::Models::Wallets::BalanceGetParams::Chain::union_member1] + end + + def self?.variants: -> ::Array[Privy::Models::Wallets::BalanceGetParams::chain] + + ETHEREUM: :ethereum + ARBITRUM: :arbitrum + BASE: :base + TEMPO: :tempo + LINEA: :linea + OPTIMISM: :optimism + POLYGON: :polygon + SOLANA: :solana + ZKSYNC_ERA: :zksync_era + SEPOLIA: :sepolia + ARBITRUM_SEPOLIA: :arbitrum_sepolia + BASE_SEPOLIA: :base_sepolia + LINEA_TESTNET: :linea_testnet + OPTIMISM_SEPOLIA: :optimism_sepolia + POLYGON_AMOY: :polygon_amoy + SOLANA_DEVNET: :solana_devnet + SOLANA_TESTNET: :solana_testnet + + UnionMember1Array: Privy::Internal::Type::Converter + end + + type include_currency = :usd | :eur + + module IncludeCurrency + extend Privy::Internal::Type::Enum + + USD: :usd + EUR: :eur + + def self?.values: -> ::Array[Privy::Models::Wallets::BalanceGetParams::include_currency] + end + end + end + end +end diff --git a/sig/privy/models/wallets/balance_get_response.rbs b/sig/privy/models/wallets/balance_get_response.rbs new file mode 100644 index 0000000..38d91aa --- /dev/null +++ b/sig/privy/models/wallets/balance_get_response.rbs @@ -0,0 +1,128 @@ +module Privy + module Models + module Wallets + type balance_get_response = + { + balances: ::Array[Privy::Models::Wallets::BalanceGetResponse::Balance] + } + + class BalanceGetResponse < Privy::Internal::Type::BaseModel + attr_accessor balances: ::Array[Privy::Models::Wallets::BalanceGetResponse::Balance] + + def initialize: ( + balances: ::Array[Privy::Models::Wallets::BalanceGetResponse::Balance] + ) -> void + + def to_hash: -> { + balances: ::Array[Privy::Models::Wallets::BalanceGetResponse::Balance] + } + + type balance = + { + asset: Privy::Models::Wallets::BalanceGetResponse::Balance::asset, + chain: Privy::Models::Wallets::BalanceGetResponse::Balance::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float + } + + class Balance < Privy::Internal::Type::BaseModel + attr_accessor asset: Privy::Models::Wallets::BalanceGetResponse::Balance::asset + + attr_accessor chain: Privy::Models::Wallets::BalanceGetResponse::Balance::chain + + attr_accessor display_values: ::Hash[Symbol, String] + + attr_accessor raw_value: String + + attr_accessor raw_value_decimals: Float + + def initialize: ( + asset: Privy::Models::Wallets::BalanceGetResponse::Balance::asset, + chain: Privy::Models::Wallets::BalanceGetResponse::Balance::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float + ) -> void + + def to_hash: -> { + asset: Privy::Models::Wallets::BalanceGetResponse::Balance::asset, + chain: Privy::Models::Wallets::BalanceGetResponse::Balance::chain, + display_values: ::Hash[Symbol, String], + raw_value: String, + raw_value_decimals: Float + } + + type asset = + :usdc + | :"usdc.e" + | :eth + | :pol + | :usdt + | :eurc + | :usdb + | :sol + | String + + module Asset + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::Wallets::BalanceGetResponse::Balance::asset] + + USDC: :usdc + USDC_E: :"usdc.e" + ETH: :eth + POL: :pol + USDT: :usdt + EURC: :eurc + USDB: :usdb + SOL: :sol + end + + type chain = + :ethereum + | :arbitrum + | :base + | :tempo + | :linea + | :optimism + | :polygon + | :solana + | :zksync_era + | :sepolia + | :arbitrum_sepolia + | :base_sepolia + | :linea_testnet + | :optimism_sepolia + | :polygon_amoy + | :solana_devnet + | :solana_testnet + + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + ARBITRUM: :arbitrum + BASE: :base + TEMPO: :tempo + LINEA: :linea + OPTIMISM: :optimism + POLYGON: :polygon + SOLANA: :solana + ZKSYNC_ERA: :zksync_era + SEPOLIA: :sepolia + ARBITRUM_SEPOLIA: :arbitrum_sepolia + BASE_SEPOLIA: :base_sepolia + LINEA_TESTNET: :linea_testnet + OPTIMISM_SEPOLIA: :optimism_sepolia + POLYGON_AMOY: :polygon_amoy + SOLANA_DEVNET: :solana_devnet + SOLANA_TESTNET: :solana_testnet + + def self?.values: -> ::Array[Privy::Models::Wallets::BalanceGetResponse::Balance::chain] + end + end + end + end + end +end diff --git a/sig/privy/models/wallets/earn/ethereum/incentive_claim_params.rbs b/sig/privy/models/wallets/earn/ethereum/incentive_claim_params.rbs new file mode 100644 index 0000000..fed41ee --- /dev/null +++ b/sig/privy/models/wallets/earn/ethereum/incentive_claim_params.rbs @@ -0,0 +1,55 @@ +module Privy + module Models + module Wallets + module Earn + module Ethereum + type incentive_claim_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class IncentiveClaimParams < Privy::Models::EarnIncentiveClaimRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_idempotency_key: -> String? + + def privy_idempotency_key=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end + end + end + end +end diff --git a/sig/privy/models/wallets/earn/ethereum_deposit_params.rbs b/sig/privy/models/wallets/earn/ethereum_deposit_params.rbs new file mode 100644 index 0000000..acec5df --- /dev/null +++ b/sig/privy/models/wallets/earn/ethereum_deposit_params.rbs @@ -0,0 +1,53 @@ +module Privy + module Models + module Wallets + module Earn + type ethereum_deposit_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class EthereumDepositParams < Privy::Models::EarnDepositRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_idempotency_key: -> String? + + def privy_idempotency_key=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end + end + end +end diff --git a/sig/privy/models/wallets/earn/ethereum_withdraw_params.rbs b/sig/privy/models/wallets/earn/ethereum_withdraw_params.rbs new file mode 100644 index 0000000..5ec1065 --- /dev/null +++ b/sig/privy/models/wallets/earn/ethereum_withdraw_params.rbs @@ -0,0 +1,53 @@ +module Privy + module Models + module Wallets + module Earn + type ethereum_withdraw_params = + { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String + } + & Privy::Internal::Type::request_parameters + + class EthereumWithdrawParams < Privy::Models::EarnWithdrawRequestBody + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def wallet_id: -> String + + def wallet_id=: (String _) -> String + + def privy_authorization_signature: -> String? + + def privy_authorization_signature=: (String _) -> String + + def privy_idempotency_key: -> String? + + def privy_idempotency_key=: (String _) -> String + + def privy_request_expiry: -> String? + + def privy_request_expiry=: (String _) -> String + + def initialize: ( + wallet_id: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + privy_authorization_signature: String, + privy_idempotency_key: String, + privy_request_expiry: String, + request_options: Privy::RequestOptions + } + end + end + end + end +end diff --git a/sig/privy/models/wallets/transaction_get_params.rbs b/sig/privy/models/wallets/transaction_get_params.rbs new file mode 100644 index 0000000..3608ef2 --- /dev/null +++ b/sig/privy/models/wallets/transaction_get_params.rbs @@ -0,0 +1,135 @@ +module Privy + module Models + module Wallets + type transaction_get_params = + { + wallet_id: String, + chain: Privy::Models::Wallets::TransactionGetParams::chain, + token: Privy::Models::Wallets::TransactionGetParams::token, + asset: Privy::Models::Wallets::TransactionGetParams::asset, + cursor: String, + limit: Float?, + tx_hash: String + } + & Privy::Internal::Type::request_parameters + + class TransactionGetParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + attr_accessor wallet_id: String + + attr_accessor chain: Privy::Models::Wallets::TransactionGetParams::chain + + attr_reader token: Privy::Models::Wallets::TransactionGetParams::token? + + def token=: ( + Privy::Models::Wallets::TransactionGetParams::token + ) -> Privy::Models::Wallets::TransactionGetParams::token + + attr_reader asset: Privy::Models::Wallets::TransactionGetParams::asset? + + def asset=: ( + Privy::Models::Wallets::TransactionGetParams::asset + ) -> Privy::Models::Wallets::TransactionGetParams::asset + + attr_reader cursor: String? + + def cursor=: (String) -> String + + attr_accessor limit: Float? + + attr_reader tx_hash: String? + + def tx_hash=: (String) -> String + + def initialize: ( + wallet_id: String, + chain: Privy::Models::Wallets::TransactionGetParams::chain, + ?token: Privy::Models::Wallets::TransactionGetParams::token, + ?asset: Privy::Models::Wallets::TransactionGetParams::asset, + ?cursor: String, + ?limit: Float?, + ?tx_hash: String, + ?request_options: Privy::request_opts + ) -> void + + def to_hash: -> { + wallet_id: String, + chain: Privy::Models::Wallets::TransactionGetParams::chain, + token: Privy::Models::Wallets::TransactionGetParams::token, + asset: Privy::Models::Wallets::TransactionGetParams::asset, + cursor: String, + limit: Float?, + tx_hash: String, + request_options: Privy::RequestOptions + } + + type chain = + :ethereum + | :arbitrum + | :base + | :tempo + | :linea + | :optimism + | :polygon + | :solana + | :sepolia + + module Chain + extend Privy::Internal::Type::Enum + + ETHEREUM: :ethereum + ARBITRUM: :arbitrum + BASE: :base + TEMPO: :tempo + LINEA: :linea + OPTIMISM: :optimism + POLYGON: :polygon + SOLANA: :solana + SEPOLIA: :sepolia + + def self?.values: -> ::Array[Privy::Models::Wallets::TransactionGetParams::chain] + end + + type token = String | ::Array[String] + + module Token + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::Wallets::TransactionGetParams::token] + + TransactionTokenAddressInputArray: Privy::Internal::Type::Converter + end + + type asset = + :usdc + | :"usdc.e" + | :eth + | :pol + | :usdt + | :eurc + | :usdb + | :sol + | ::Array[Privy::Models::wallet_asset] + + module Asset + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::Wallets::TransactionGetParams::asset] + + USDC: :usdc + USDC_E: :"usdc.e" + ETH: :eth + POL: :pol + USDT: :usdt + EURC: :eurc + USDB: :usdb + SOL: :sol + + WalletAssetArray: Privy::Internal::Type::Converter + end + end + end + end +end diff --git a/sig/privy/models/wallets/transaction_get_response.rbs b/sig/privy/models/wallets/transaction_get_response.rbs new file mode 100644 index 0000000..544c8d4 --- /dev/null +++ b/sig/privy/models/wallets/transaction_get_response.rbs @@ -0,0 +1,121 @@ +module Privy + module Models + module Wallets + type transaction_get_response = + { + next_cursor: String?, + transactions: ::Array[Privy::Models::Wallets::TransactionGetResponse::Transaction] + } + + class TransactionGetResponse < Privy::Internal::Type::BaseModel + attr_accessor next_cursor: String? + + attr_accessor transactions: ::Array[Privy::Models::Wallets::TransactionGetResponse::Transaction] + + def initialize: ( + next_cursor: String?, + transactions: ::Array[Privy::Models::Wallets::TransactionGetResponse::Transaction] + ) -> void + + def to_hash: -> { + next_cursor: String?, + transactions: ::Array[Privy::Models::Wallets::TransactionGetResponse::Transaction] + } + + type transaction = + { + :caip2 => String, + created_at: Float, + details: Privy::Models::Wallets::TransactionGetResponse::Transaction::Details, + privy_transaction_id: String, + status: Privy::Models::Wallets::TransactionGetResponse::Transaction::status, + transaction_hash: String?, + wallet_id: String, + sponsored: bool, + user_operation_hash: String + } + + class Transaction < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor created_at: Float + + attr_accessor details: Privy::Models::Wallets::TransactionGetResponse::Transaction::Details + + attr_accessor privy_transaction_id: String + + attr_accessor status: Privy::Models::Wallets::TransactionGetResponse::Transaction::status + + attr_accessor transaction_hash: String? + + attr_accessor wallet_id: String + + attr_reader sponsored: bool? + + def sponsored=: (bool) -> bool + + attr_reader user_operation_hash: String? + + def user_operation_hash=: (String) -> String + + def initialize: ( + caip2: String, + created_at: Float, + details: Privy::Models::Wallets::TransactionGetResponse::Transaction::Details, + privy_transaction_id: String, + status: Privy::Models::Wallets::TransactionGetResponse::Transaction::status, + transaction_hash: String?, + wallet_id: String, + ?sponsored: bool, + ?user_operation_hash: String + ) -> void + + def to_hash: -> { + :caip2 => String, + created_at: Float, + details: Privy::Models::Wallets::TransactionGetResponse::Transaction::Details, + privy_transaction_id: String, + status: Privy::Models::Wallets::TransactionGetResponse::Transaction::status, + transaction_hash: String?, + wallet_id: String, + sponsored: bool, + user_operation_hash: String + } + + type details = { } + + class Details < Privy::Internal::Type::BaseModel + def initialize: -> void + + def to_hash: -> { } + end + + type status = + :broadcasted + | :confirmed + | :execution_reverted + | :failed + | :replaced + | :finalized + | :provider_error + | :pending + + module Status + extend Privy::Internal::Type::Enum + + BROADCASTED: :broadcasted + CONFIRMED: :confirmed + EXECUTION_REVERTED: :execution_reverted + FAILED: :failed + REPLACED: :replaced + FINALIZED: :finalized + PROVIDER_ERROR: :provider_error + PENDING: :pending + + def self?.values: -> ::Array[Privy::Models::Wallets::TransactionGetResponse::Transaction::status] + end + end + end + end + end +end diff --git a/sig/privy/models/webhook_payload.rbs b/sig/privy/models/webhook_payload.rbs new file mode 100644 index 0000000..8b71ab6 --- /dev/null +++ b/sig/privy/models/webhook_payload.rbs @@ -0,0 +1,62 @@ +module Privy + module Models + type webhook_payload = + Privy::UserCreatedWebhookPayload + | Privy::UserAuthenticatedWebhookPayload + | Privy::UserLinkedAccountWebhookPayload + | Privy::UserUnlinkedAccountWebhookPayload + | Privy::UserUpdatedAccountWebhookPayload + | Privy::UserTransferredAccountWebhookPayload + | Privy::UserWalletCreatedWebhookPayload + | Privy::TransactionBroadcastedWebhookPayload + | Privy::TransactionConfirmedWebhookPayload + | Privy::TransactionExecutionRevertedWebhookPayload + | Privy::TransactionStillPendingWebhookPayload + | Privy::TransactionFailedWebhookPayload + | Privy::TransactionReplacedWebhookPayload + | Privy::TransactionProviderErrorWebhookPayload + | Privy::FundsDepositedWebhookPayload + | Privy::FundsWithdrawnWebhookPayload + | Privy::PrivateKeyExportWebhookPayload + | Privy::SeedPhraseExportWebhookPayload + | Privy::WalletRecoverySetupWebhookPayload + | Privy::WalletRecoveredWebhookPayload + | Privy::MfaEnabledWebhookPayload + | Privy::MfaDisabledWebhookPayload + | Privy::YieldDepositConfirmedWebhookPayload + | Privy::YieldWithdrawConfirmedWebhookPayload + | Privy::YieldClaimConfirmedWebhookPayload + | Privy::UserOperationCompletedWebhookPayload + | Privy::IntentCreatedWebhookPayload + | Privy::IntentAuthorizedWebhookPayload + | Privy::IntentRejectedWebhookPayload + | Privy::IntentExecutedWebhookPayload + | Privy::IntentFailedWebhookPayload + | Privy::WalletActionSwapCreatedWebhookPayload + | Privy::WalletActionSwapSucceededWebhookPayload + | Privy::WalletActionSwapRejectedWebhookPayload + | Privy::WalletActionSwapFailedWebhookPayload + | Privy::WalletActionTransferCreatedWebhookPayload + | Privy::WalletActionTransferSucceededWebhookPayload + | Privy::WalletActionTransferRejectedWebhookPayload + | Privy::WalletActionTransferFailedWebhookPayload + | Privy::WalletActionEarnDepositCreatedWebhookPayload + | Privy::WalletActionEarnDepositSucceededWebhookPayload + | Privy::WalletActionEarnDepositRejectedWebhookPayload + | Privy::WalletActionEarnDepositFailedWebhookPayload + | Privy::WalletActionEarnWithdrawCreatedWebhookPayload + | Privy::WalletActionEarnWithdrawSucceededWebhookPayload + | Privy::WalletActionEarnWithdrawRejectedWebhookPayload + | Privy::WalletActionEarnWithdrawFailedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload + | Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload + + module WebhookPayload + extend Privy::Internal::Type::Union + + def self?.variants: -> ::Array[Privy::Models::webhook_payload] + end + end +end diff --git a/sig/privy/models/webhook_unsafe_unwrap_params.rbs b/sig/privy/models/webhook_unsafe_unwrap_params.rbs new file mode 100644 index 0000000..efb5b03 --- /dev/null +++ b/sig/privy/models/webhook_unsafe_unwrap_params.rbs @@ -0,0 +1,15 @@ +module Privy + module Models + type webhook_unsafe_unwrap_params = + { } & Privy::Internal::Type::request_parameters + + class WebhookUnsafeUnwrapParams < Privy::Internal::Type::BaseModel + extend Privy::Internal::Type::RequestParameters::Converter + include Privy::Internal::Type::RequestParameters + + def initialize: (?request_options: Privy::request_opts) -> void + + def to_hash: -> { request_options: Privy::RequestOptions } + end + end +end diff --git a/sig/privy/models/yield_authorization_headers.rbs b/sig/privy/models/yield_authorization_headers.rbs new file mode 100644 index 0000000..1af38b9 --- /dev/null +++ b/sig/privy/models/yield_authorization_headers.rbs @@ -0,0 +1,34 @@ +module Privy + module Models + type yield_authorization_headers = + { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + + class YieldAuthorizationHeaders < Privy::Internal::Type::BaseModel + attr_accessor privy_app_id: String + + attr_reader privy_authorization_signature: String? + + def privy_authorization_signature=: (String) -> String + + attr_reader privy_request_expiry: String? + + def privy_request_expiry=: (String) -> String + + def initialize: ( + privy_app_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String + ) -> void + + def to_hash: -> { + privy_app_id: String, + privy_authorization_signature: String, + privy_request_expiry: String + } + end + end +end diff --git a/sig/privy/models/yield_claim_confirmed_webhook_payload.rbs b/sig/privy/models/yield_claim_confirmed_webhook_payload.rbs new file mode 100644 index 0000000..d71fd5b --- /dev/null +++ b/sig/privy/models/yield_claim_confirmed_webhook_payload.rbs @@ -0,0 +1,73 @@ +module Privy + module Models + type yield_claim_confirmed_webhook_payload = + { + :caip2 => String, + rewards: ::Array[Privy::YieldClaimConfirmedWebhookPayload::Reward], + transaction_id: String, + type: Privy::Models::YieldClaimConfirmedWebhookPayload::type_, + wallet_id: String + } + + class YieldClaimConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor caip2: String + + attr_accessor rewards: ::Array[Privy::YieldClaimConfirmedWebhookPayload::Reward] + + attr_accessor transaction_id: String + + attr_accessor type: Privy::Models::YieldClaimConfirmedWebhookPayload::type_ + + attr_accessor wallet_id: String + + def initialize: ( + caip2: String, + rewards: ::Array[Privy::YieldClaimConfirmedWebhookPayload::Reward], + transaction_id: String, + type: Privy::Models::YieldClaimConfirmedWebhookPayload::type_, + wallet_id: String + ) -> void + + def to_hash: -> { + :caip2 => String, + rewards: ::Array[Privy::YieldClaimConfirmedWebhookPayload::Reward], + transaction_id: String, + type: Privy::Models::YieldClaimConfirmedWebhookPayload::type_, + wallet_id: String + } + + type reward = + { amount: String, token_address: String, token_symbol: String } + + class Reward < Privy::Internal::Type::BaseModel + attr_accessor amount: String + + attr_accessor token_address: String + + attr_accessor token_symbol: String + + def initialize: ( + amount: String, + token_address: String, + token_symbol: String + ) -> void + + def to_hash: -> { + amount: String, + token_address: String, + token_symbol: String + } + end + + type type_ = :"yield.claim.confirmed" + + module Type + extend Privy::Internal::Type::Enum + + YIELD_CLAIM_CONFIRMED: :"yield.claim.confirmed" + + def self?.values: -> ::Array[Privy::Models::YieldClaimConfirmedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/yield_deposit_confirmed_webhook_payload.rbs b/sig/privy/models/yield_deposit_confirmed_webhook_payload.rbs new file mode 100644 index 0000000..8d353cb --- /dev/null +++ b/sig/privy/models/yield_deposit_confirmed_webhook_payload.rbs @@ -0,0 +1,60 @@ +module Privy + module Models + type yield_deposit_confirmed_webhook_payload = + { + assets: String, + :caip2 => String, + owner: String, + sender: String, + shares: String, + type: Privy::Models::YieldDepositConfirmedWebhookPayload::type_, + vault_address: String + } + + class YieldDepositConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor assets: String + + attr_accessor caip2: String + + attr_accessor owner: String + + attr_accessor sender: String + + attr_accessor shares: String + + attr_accessor type: Privy::Models::YieldDepositConfirmedWebhookPayload::type_ + + attr_accessor vault_address: String + + def initialize: ( + assets: String, + caip2: String, + owner: String, + sender: String, + shares: String, + type: Privy::Models::YieldDepositConfirmedWebhookPayload::type_, + vault_address: String + ) -> void + + def to_hash: -> { + assets: String, + :caip2 => String, + owner: String, + sender: String, + shares: String, + type: Privy::Models::YieldDepositConfirmedWebhookPayload::type_, + vault_address: String + } + + type type_ = :"yield.deposit.confirmed" + + module Type + extend Privy::Internal::Type::Enum + + YIELD_DEPOSIT_CONFIRMED: :"yield.deposit.confirmed" + + def self?.values: -> ::Array[Privy::Models::YieldDepositConfirmedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/models/yield_withdraw_confirmed_webhook_payload.rbs b/sig/privy/models/yield_withdraw_confirmed_webhook_payload.rbs new file mode 100644 index 0000000..db99091 --- /dev/null +++ b/sig/privy/models/yield_withdraw_confirmed_webhook_payload.rbs @@ -0,0 +1,65 @@ +module Privy + module Models + type yield_withdraw_confirmed_webhook_payload = + { + assets: String, + :caip2 => String, + owner: String, + receiver: String, + sender: String, + shares: String, + type: Privy::Models::YieldWithdrawConfirmedWebhookPayload::type_, + vault_address: String + } + + class YieldWithdrawConfirmedWebhookPayload < Privy::Internal::Type::BaseModel + attr_accessor assets: String + + attr_accessor caip2: String + + attr_accessor owner: String + + attr_accessor receiver: String + + attr_accessor sender: String + + attr_accessor shares: String + + attr_accessor type: Privy::Models::YieldWithdrawConfirmedWebhookPayload::type_ + + attr_accessor vault_address: String + + def initialize: ( + assets: String, + caip2: String, + owner: String, + receiver: String, + sender: String, + shares: String, + type: Privy::Models::YieldWithdrawConfirmedWebhookPayload::type_, + vault_address: String + ) -> void + + def to_hash: -> { + assets: String, + :caip2 => String, + owner: String, + receiver: String, + sender: String, + shares: String, + type: Privy::Models::YieldWithdrawConfirmedWebhookPayload::type_, + vault_address: String + } + + type type_ = :"yield.withdraw.confirmed" + + module Type + extend Privy::Internal::Type::Enum + + YIELD_WITHDRAW_CONFIRMED: :"yield.withdraw.confirmed" + + def self?.values: -> ::Array[Privy::Models::YieldWithdrawConfirmedWebhookPayload::type_] + end + end + end +end diff --git a/sig/privy/request_options.rbs b/sig/privy/request_options.rbs new file mode 100644 index 0000000..b32d3a1 --- /dev/null +++ b/sig/privy/request_options.rbs @@ -0,0 +1,34 @@ +module Privy + type request_opts = + Privy::RequestOptions | Privy::request_options | ::Hash[Symbol, top] + + type request_options = + { + idempotency_key: String?, + extra_query: ::Hash[String, (::Array[String] | String)?]?, + extra_headers: ::Hash[String, String?]?, + extra_body: top?, + max_retries: Integer?, + timeout: Float? + } + + class RequestOptions < Privy::Internal::Type::BaseModel + def self.validate!: (Privy::request_opts opts) -> void + + attr_accessor idempotency_key: String? + + attr_accessor extra_query: ::Hash[String, (::Array[String] | String)?]? + + attr_accessor extra_headers: ::Hash[String, String?]? + + attr_accessor extra_body: top? + + attr_accessor max_retries: Integer? + + attr_accessor timeout: Float? + + def initialize: ( + ?Privy::request_options | ::Hash[Symbol, top] values + ) -> void + end +end diff --git a/sig/privy/resources/accounts.rbs b/sig/privy/resources/accounts.rbs new file mode 100644 index 0000000..7c735d6 --- /dev/null +++ b/sig/privy/resources/accounts.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Accounts + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/aggregations.rbs b/sig/privy/resources/aggregations.rbs new file mode 100644 index 0000000..be31102 --- /dev/null +++ b/sig/privy/resources/aggregations.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Aggregations + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/analytics.rbs b/sig/privy/resources/analytics.rbs new file mode 100644 index 0000000..5b1e389 --- /dev/null +++ b/sig/privy/resources/analytics.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Analytics + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/apps.rbs b/sig/privy/resources/apps.rbs new file mode 100644 index 0000000..ca8294f --- /dev/null +++ b/sig/privy/resources/apps.rbs @@ -0,0 +1,26 @@ +module Privy + module Resources + class Apps + attr_reader allowlist: Privy::Resources::Apps::Allowlist + + def get: ( + String app_id, + ?request_options: Privy::request_opts + ) -> Privy::AppResponse + + def get_gas_spend: ( + end_timestamp: Float, + start_timestamp: Float, + wallet_ids: ::Array[String], + ?request_options: Privy::request_opts + ) -> Privy::GasSpendResponseBody + + def get_test_credentials: ( + String app_id, + ?request_options: Privy::request_opts + ) -> Privy::TestAccountsResponse + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/apps/allowlist.rbs b/sig/privy/resources/apps/allowlist.rbs new file mode 100644 index 0000000..7617cef --- /dev/null +++ b/sig/privy/resources/apps/allowlist.rbs @@ -0,0 +1,26 @@ +module Privy + module Resources + class Apps + class Allowlist + def create: ( + String app_id, + user_invite_input: Privy::Models::user_invite_input, + ?request_options: Privy::request_opts + ) -> Privy::AllowlistEntry + + def list: ( + String app_id, + ?request_options: Privy::request_opts + ) -> Privy::Models::Apps::allowlist_list_response + + def delete: ( + String app_id, + user_invite_input: Privy::Models::user_invite_input, + ?request_options: Privy::request_opts + ) -> Privy::AllowlistDeletionResponse + + def initialize: (client: Privy::Client) -> void + end + end + end +end diff --git a/sig/privy/resources/client_auth.rbs b/sig/privy/resources/client_auth.rbs new file mode 100644 index 0000000..d316a77 --- /dev/null +++ b/sig/privy/resources/client_auth.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class ClientAuth + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/cross_app.rbs b/sig/privy/resources/cross_app.rbs new file mode 100644 index 0000000..bbfd3e7 --- /dev/null +++ b/sig/privy/resources/cross_app.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class CrossApp + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/embedded_wallets.rbs b/sig/privy/resources/embedded_wallets.rbs new file mode 100644 index 0000000..493600a --- /dev/null +++ b/sig/privy/resources/embedded_wallets.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class EmbeddedWallets + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/funding.rbs b/sig/privy/resources/funding.rbs new file mode 100644 index 0000000..e510b1f --- /dev/null +++ b/sig/privy/resources/funding.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Funding + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/intents.rbs b/sig/privy/resources/intents.rbs new file mode 100644 index 0000000..2acf219 --- /dev/null +++ b/sig/privy/resources/intents.rbs @@ -0,0 +1,102 @@ +module Privy + module Resources + class Intents + def list: ( + ?created_by_id: String, + ?current_user_has_signed: Privy::Models::IntentListParams::current_user_has_signed, + ?cursor: String, + ?intent_type: Privy::Models::intent_type, + ?limit: Float?, + ?pending_member_id: String, + ?resource_id: String, + ?sort_by: Privy::Models::IntentListParams::sort_by, + ?status: Privy::Models::intent_status, + ?request_options: Privy::request_opts + ) -> Privy::Internal::Cursor[Privy::Models::intent_response] + + def create_policy_rule: ( + String policy_id, + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::RuleIntentResponse + + def delete_policy_rule: ( + String rule_id, + policy_id: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::RuleIntentResponse + + def get: ( + String intent_id, + ?request_options: Privy::request_opts + ) -> Privy::Models::intent_response + + def rpc: ( + String wallet_id, + wallet_rpc_request_body: Privy::Models::wallet_rpc_request_body, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::RpcIntentResponse + + def transfer: ( + String wallet_id, + destination: Privy::TokenTransferDestination, + source: Privy::Models::token_transfer_source, + ?amount_type: Privy::Models::amount_type, + ?slippage_bps: Integer, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::TransferIntentResponse + + def update_key_quorum: ( + String key_quorum_id, + ?authorization_threshold: Float, + ?display_name: String, + ?key_quorum_ids: ::Array[String], + ?public_keys: ::Array[String], + ?user_ids: ::Array[String], + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::KeyQuorumIntentResponse + + def update_policy: ( + String policy_id, + ?name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?rules: ::Array[Privy::PolicyRuleRequestBody], + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::PolicyIntentResponse + + def update_policy_rule: ( + String rule_id, + policy_id: String, + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::RuleIntentResponse + + def update_wallet: ( + String wallet_id, + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String?, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: ::Array[String], + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::WalletIntentResponse + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/key_quorums.rbs b/sig/privy/resources/key_quorums.rbs new file mode 100644 index 0000000..ed94bd9 --- /dev/null +++ b/sig/privy/resources/key_quorums.rbs @@ -0,0 +1,40 @@ +module Privy + module Resources + class KeyQuorums + def create: ( + ?authorization_threshold: Float, + ?display_name: String, + ?key_quorum_ids: ::Array[String], + ?public_keys: ::Array[String], + ?user_ids: ::Array[String], + ?request_options: Privy::request_opts + ) -> Privy::KeyQuorum + + def update: ( + String key_quorum_id, + ?authorization_threshold: Float, + ?display_name: String, + ?key_quorum_ids: ::Array[String], + ?public_keys: ::Array[String], + ?user_ids: ::Array[String], + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::KeyQuorum + + def delete: ( + String key_quorum_id, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::SuccessResponse + + def get: ( + String key_quorum_id, + ?request_options: Privy::request_opts + ) -> Privy::KeyQuorum + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/kraken_embed.rbs b/sig/privy/resources/kraken_embed.rbs new file mode 100644 index 0000000..6f361d0 --- /dev/null +++ b/sig/privy/resources/kraken_embed.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class KrakenEmbed + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/organizations.rbs b/sig/privy/resources/organizations.rbs new file mode 100644 index 0000000..b56a938 --- /dev/null +++ b/sig/privy/resources/organizations.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Organizations + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/policies.rbs b/sig/privy/resources/policies.rbs new file mode 100644 index 0000000..36a0112 --- /dev/null +++ b/sig/privy/resources/policies.rbs @@ -0,0 +1,78 @@ +module Privy + module Resources + class Policies + def create: ( + chain_type: Privy::Models::wallet_chain_type, + name: String, + rules: ::Array[Privy::PolicyCreateParams::Rule], + version: Privy::Models::PolicyCreateParams::version, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?privy_idempotency_key: String, + ?request_options: Privy::request_opts + ) -> Privy::Policy + + def update: ( + String policy_id, + ?name: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?rules: ::Array[Privy::PolicyRuleRequestBody], + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::Policy + + def delete: ( + String policy_id, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::SuccessResponse + + def create_rule: ( + String policy_id, + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::PolicyRuleResponse + + def delete_rule: ( + String rule_id, + policy_id: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::SuccessResponse + + def get: ( + String policy_id, + ?request_options: Privy::request_opts + ) -> Privy::Policy + + def get_rule: ( + String rule_id, + policy_id: String, + ?request_options: Privy::request_opts + ) -> Privy::PolicyRuleResponse + + def update_rule: ( + String rule_id, + policy_id: String, + action: Privy::Models::policy_action, + conditions: ::Array[Privy::Models::policy_condition], + method_: Privy::Models::policy_method, + name: String, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::PolicyRuleResponse + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/shared.rbs b/sig/privy/resources/shared.rbs new file mode 100644 index 0000000..660af37 --- /dev/null +++ b/sig/privy/resources/shared.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Shared + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/swaps.rbs b/sig/privy/resources/swaps.rbs new file mode 100644 index 0000000..ae632d0 --- /dev/null +++ b/sig/privy/resources/swaps.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Swaps + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/transactions.rbs b/sig/privy/resources/transactions.rbs new file mode 100644 index 0000000..c5d0de6 --- /dev/null +++ b/sig/privy/resources/transactions.rbs @@ -0,0 +1,12 @@ +module Privy + module Resources + class Transactions + def get: ( + String transaction_id, + ?request_options: Privy::request_opts + ) -> Privy::Transaction + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/users.rbs b/sig/privy/resources/users.rbs new file mode 100644 index 0000000..0b5e847 --- /dev/null +++ b/sig/privy/resources/users.rbs @@ -0,0 +1,112 @@ +module Privy + module Resources + class Users + def create: ( + linked_accounts: ::Array[Privy::Models::linked_account_input], + ?custom_metadata: Privy::Models::custom_metadata, + ?wallets: ::Array[Privy::UserCreateParams::Wallet], + ?request_options: Privy::request_opts + ) -> Privy::User + + def list: ( + ?cursor: String, + ?limit: Float?, + ?request_options: Privy::request_opts + ) -> Privy::Internal::Cursor[Privy::User] + + def delete: (String user_id, ?request_options: Privy::request_opts) -> nil + + def get: ( + String user_id, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_custom_auth_id: ( + custom_user_id: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_discord_username: ( + username: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_email_address: ( + address: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_farcaster_id: ( + fid: Float, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_github_username: ( + username: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_phone_number: ( + number: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_smart_wallet_address: ( + address: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_telegram_user_id: ( + telegram_user_id: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_telegram_username: ( + username: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_twitter_subject: ( + subject: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_twitter_username: ( + username: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def get_by_wallet_address: ( + address: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def pregenerate_wallets: ( + String user_id, + wallets: ::Array[Privy::WalletCreationInput], + ?request_options: Privy::request_opts + ) -> Privy::User + + def search: ( + body: Privy::Models::UserSearchParams::body, + ?request_options: Privy::request_opts + ) -> Privy::User + + def set_custom_metadata: ( + String user_id, + custom_metadata: Privy::Models::custom_metadata, + ?request_options: Privy::request_opts + ) -> Privy::User + + def unlink_linked_account: ( + String user_id, + handle: String, + type: Privy::Models::linked_account_type, + ?provider: String, + ?request_options: Privy::request_opts + ) -> Privy::User + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/wallet_actions.rbs b/sig/privy/resources/wallet_actions.rbs new file mode 100644 index 0000000..fed8b14 --- /dev/null +++ b/sig/privy/resources/wallet_actions.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class WalletActions + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/wallets.rbs b/sig/privy/resources/wallets.rbs new file mode 100644 index 0000000..b3803ff --- /dev/null +++ b/sig/privy/resources/wallets.rbs @@ -0,0 +1,127 @@ +module Privy + module Resources + class Wallets + attr_reader earn: Privy::Resources::Wallets::Earn + + attr_reader transactions: Privy::Resources::Wallets::Transactions + + attr_reader balance: Privy::Resources::Wallets::Balance + + def create: ( + chain_type: Privy::Models::wallet_chain_type, + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String, + ?external_id: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: Privy::Models::policy_input, + ?privy_idempotency_key: String, + ?request_options: Privy::request_opts + ) -> Privy::Wallet + + def update: ( + String wallet_id, + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String?, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: ::Array[String], + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::Wallet + + def list: ( + ?authorization_key: String, + ?chain_type: Privy::Models::wallet_chain_type, + ?cursor: String, + ?external_id: String, + ?limit: Float?, + ?user_id: String, + ?request_options: Privy::request_opts + ) -> Privy::Internal::Cursor[Privy::Wallet] + + def _init_import: ( + body: Privy::Models::WalletInitImportParams::body, + ?request_options: Privy::request_opts + ) -> Privy::Models::WalletInitImportResponse + + def _submit_import: ( + wallet: Privy::Models::WalletSubmitImportParams::wallet, + ?additional_signers: Privy::Models::additional_signer_input, + ?display_name: String, + ?external_id: String, + ?owner: Privy::Models::owner_input?, + ?owner_id: String?, + ?policy_ids: Privy::Models::policy_input, + ?request_options: Privy::request_opts + ) -> Privy::Wallet + + def _transfer: ( + String wallet_id, + destination: Privy::TokenTransferDestination, + source: Privy::Models::token_transfer_source, + ?amount_type: Privy::Models::amount_type, + ?slippage_bps: Integer, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::TransferActionResponse + + def authenticate_with_jwt: ( + encryption_type: Privy::Models::WalletAuthenticateRequestBody::encryption_type, + recipient_public_key: String, + user_jwt: String, + ?request_options: Privy::request_opts + ) -> Privy::Models::wallet_authenticate_with_jwt_response + + def create_wallets_with_recovery: ( + primary_signer: Privy::WalletCreateWalletsWithRecoveryParams::PrimarySigner, + recovery_user: Privy::WalletCreateWalletsWithRecoveryParams::RecoveryUser, + wallets: ::Array[Privy::WalletCreateWalletsWithRecoveryParams::Wallet], + ?request_options: Privy::request_opts + ) -> Privy::WalletCreateWalletsWithRecoveryResponse + + def export: ( + String wallet_id, + encryption_type: Privy::Models::hpke_encryption, + recipient_public_key: String, + ?export_seed_phrase: bool, + ?privy_authorization_signature: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::WalletExportResponseBody + + def get: ( + String wallet_id, + ?request_options: Privy::request_opts + ) -> Privy::Wallet + + def get_wallet_by_address: ( + address: String, + ?request_options: Privy::request_opts + ) -> Privy::Wallet + + def raw_sign: ( + String wallet_id, + params: Privy::Models::raw_sign_input_params, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::RawSignResponse + + def rpc: ( + String wallet_id, + wallet_rpc_request_body: Privy::Models::wallet_rpc_request_body, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::Models::wallet_rpc_response + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/wallets/balance.rbs b/sig/privy/resources/wallets/balance.rbs new file mode 100644 index 0000000..3d241eb --- /dev/null +++ b/sig/privy/resources/wallets/balance.rbs @@ -0,0 +1,18 @@ +module Privy + module Resources + class Wallets + class Balance + def get: ( + String wallet_id, + ?token: Privy::Models::Wallets::BalanceGetParams::token, + ?asset: Privy::Models::Wallets::BalanceGetParams::asset, + ?chain: Privy::Models::Wallets::BalanceGetParams::chain, + ?include_currency: Privy::Models::Wallets::BalanceGetParams::include_currency, + ?request_options: Privy::request_opts + ) -> Privy::Models::Wallets::BalanceGetResponse + + def initialize: (client: Privy::Client) -> void + end + end + end +end diff --git a/sig/privy/resources/wallets/earn.rbs b/sig/privy/resources/wallets/earn.rbs new file mode 100644 index 0000000..c27c114 --- /dev/null +++ b/sig/privy/resources/wallets/earn.rbs @@ -0,0 +1,11 @@ +module Privy + module Resources + class Wallets + class Earn + attr_reader ethereum: Privy::Resources::Wallets::Earn::Ethereum + + def initialize: (client: Privy::Client) -> void + end + end + end +end diff --git a/sig/privy/resources/wallets/earn/ethereum.rbs b/sig/privy/resources/wallets/earn/ethereum.rbs new file mode 100644 index 0000000..06f2da5 --- /dev/null +++ b/sig/privy/resources/wallets/earn/ethereum.rbs @@ -0,0 +1,35 @@ +module Privy + module Resources + class Wallets + class Earn + class Ethereum + attr_reader incentive: Privy::Resources::Wallets::Earn::Ethereum::Incentive + + def _deposit: ( + String wallet_id, + vault_id: String, + ?amount: String, + ?raw_amount: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::EarnDepositActionResponse + + def _withdraw: ( + String wallet_id, + vault_id: String, + ?amount: String, + ?raw_amount: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::EarnWithdrawActionResponse + + def initialize: (client: Privy::Client) -> void + end + end + end + end +end diff --git a/sig/privy/resources/wallets/earn/ethereum/incentive.rbs b/sig/privy/resources/wallets/earn/ethereum/incentive.rbs new file mode 100644 index 0000000..cfed44c --- /dev/null +++ b/sig/privy/resources/wallets/earn/ethereum/incentive.rbs @@ -0,0 +1,22 @@ +module Privy + module Resources + class Wallets + class Earn + class Ethereum + class Incentive + def _claim: ( + String wallet_id, + chain: String, + ?privy_authorization_signature: String, + ?privy_idempotency_key: String, + ?privy_request_expiry: String, + ?request_options: Privy::request_opts + ) -> Privy::EarnIncentiveClaimActionResponse + + def initialize: (client: Privy::Client) -> void + end + end + end + end + end +end diff --git a/sig/privy/resources/wallets/transactions.rbs b/sig/privy/resources/wallets/transactions.rbs new file mode 100644 index 0000000..eb41e3e --- /dev/null +++ b/sig/privy/resources/wallets/transactions.rbs @@ -0,0 +1,20 @@ +module Privy + module Resources + class Wallets + class Transactions + def get: ( + String wallet_id, + chain: Privy::Models::Wallets::TransactionGetParams::chain, + ?token: Privy::Models::Wallets::TransactionGetParams::token, + ?asset: Privy::Models::Wallets::TransactionGetParams::asset, + ?cursor: String, + ?limit: Float?, + ?tx_hash: String, + ?request_options: Privy::request_opts + ) -> Privy::Models::Wallets::TransactionGetResponse + + def initialize: (client: Privy::Client) -> void + end + end + end +end diff --git a/sig/privy/resources/webhooks.rbs b/sig/privy/resources/webhooks.rbs new file mode 100644 index 0000000..1cfda7d --- /dev/null +++ b/sig/privy/resources/webhooks.rbs @@ -0,0 +1,60 @@ +module Privy + module Resources + class Webhooks + def unsafe_unwrap: ( + String payload + ) -> (Privy::IntentAuthorizedWebhookPayload + | Privy::IntentCreatedWebhookPayload + | Privy::IntentExecutedWebhookPayload + | Privy::IntentFailedWebhookPayload + | Privy::IntentRejectedWebhookPayload + | Privy::MfaDisabledWebhookPayload + | Privy::MfaEnabledWebhookPayload + | Privy::TransactionBroadcastedWebhookPayload + | Privy::TransactionConfirmedWebhookPayload + | Privy::TransactionExecutionRevertedWebhookPayload + | Privy::TransactionFailedWebhookPayload + | Privy::TransactionProviderErrorWebhookPayload + | Privy::TransactionReplacedWebhookPayload + | Privy::TransactionStillPendingWebhookPayload + | Privy::UserAuthenticatedWebhookPayload + | Privy::UserCreatedWebhookPayload + | Privy::UserLinkedAccountWebhookPayload + | Privy::UserTransferredAccountWebhookPayload + | Privy::UserUnlinkedAccountWebhookPayload + | Privy::UserUpdatedAccountWebhookPayload + | Privy::UserWalletCreatedWebhookPayload + | Privy::UserOperationCompletedWebhookPayload + | Privy::FundsDepositedWebhookPayload + | Privy::FundsWithdrawnWebhookPayload + | Privy::PrivateKeyExportWebhookPayload + | Privy::WalletRecoveredWebhookPayload + | Privy::WalletRecoverySetupWebhookPayload + | Privy::WalletActionEarnDepositCreatedWebhookPayload + | Privy::WalletActionEarnDepositFailedWebhookPayload + | Privy::WalletActionEarnDepositRejectedWebhookPayload + | Privy::WalletActionEarnDepositSucceededWebhookPayload + | Privy::WalletActionEarnIncentiveClaimCreatedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimFailedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimRejectedWebhookPayload + | Privy::WalletActionEarnIncentiveClaimSucceededWebhookPayload + | Privy::WalletActionEarnWithdrawCreatedWebhookPayload + | Privy::WalletActionEarnWithdrawFailedWebhookPayload + | Privy::WalletActionEarnWithdrawRejectedWebhookPayload + | Privy::WalletActionEarnWithdrawSucceededWebhookPayload + | Privy::WalletActionSwapCreatedWebhookPayload + | Privy::WalletActionSwapFailedWebhookPayload + | Privy::WalletActionSwapRejectedWebhookPayload + | Privy::WalletActionSwapSucceededWebhookPayload + | Privy::WalletActionTransferCreatedWebhookPayload + | Privy::WalletActionTransferFailedWebhookPayload + | Privy::WalletActionTransferRejectedWebhookPayload + | Privy::WalletActionTransferSucceededWebhookPayload + | Privy::YieldClaimConfirmedWebhookPayload + | Privy::YieldDepositConfirmedWebhookPayload + | Privy::YieldWithdrawConfirmedWebhookPayload) + + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/resources/yield_.rbs b/sig/privy/resources/yield_.rbs new file mode 100644 index 0000000..e335633 --- /dev/null +++ b/sig/privy/resources/yield_.rbs @@ -0,0 +1,7 @@ +module Privy + module Resources + class Yield + def initialize: (client: Privy::Client) -> void + end + end +end diff --git a/sig/privy/version.rbs b/sig/privy/version.rbs new file mode 100644 index 0000000..d09207b --- /dev/null +++ b/sig/privy/version.rbs @@ -0,0 +1,3 @@ +module Privy + VERSION: String +end diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 0000000..6fe84ed --- /dev/null +++ b/sorbet/config @@ -0,0 +1,2 @@ +--dir=rbi/ +--ignore=test/ diff --git a/sorbet/rbi/.gitignore b/sorbet/rbi/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/sorbet/rbi/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/test/privy/authorization/authorization_test.rb b/test/privy/authorization/authorization_test.rb new file mode 100644 index 0000000..6b5708d --- /dev/null +++ b/test/privy/authorization/authorization_test.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::AuthorizationTest < Minitest::Test + def setup + @kp = Privy::Cryptography.generate_p256_key_pair + @privy_client = Struct.new(:app_id).new("app-abc") + end + + def test_prepare_with_no_context_returns_no_sig_header + prepared = Privy::Authorization.prepare_request( + @privy_client, + method: :patch, + url: "https://api.privy.io/v1/wallets/w-1", + body: {display_name: "test"}, + authorization_context: nil + ) + refute(prepared.headers.key?("privy-authorization-signature")) + end + + def test_prepare_with_private_key_signs_and_includes_expiry + ctx = Privy::Authorization::AuthorizationContext.build(authorization_private_keys: [@kp.private_key]) + prepared = Privy::Authorization.prepare_request( + @privy_client, + method: :patch, + url: "https://api.privy.io/v1/wallets/w-1", + body: {display_name: "test"}, + authorization_context: ctx, + request_expiry: 1_750_000_000_000 + ) + assert(prepared.headers["privy-authorization-signature"]) + assert_equal("1750000000000", prepared.headers["privy-request-expiry"]) + end + + def test_prepare_passes_through_precomputed_signatures + ctx = Privy::Authorization::AuthorizationContext.build(signatures: %w[sig1 sig2]) + prepared = Privy::Authorization.prepare_request( + @privy_client, + method: :post, + url: "https://api.privy.io/v1/foo", + body: {}, + authorization_context: ctx + ) + assert_equal("sig1,sig2", prepared.headers["privy-authorization-signature"]) + end + + def test_prepare_calls_sign_fns_with_canonical_payload + captured = nil + ctx = Privy::Authorization::AuthorizationContext.build( + sign_fns: [ + ->(payload) { + captured = payload + "fn-sig" + } + ] + ) + prepared = Privy::Authorization.prepare_request( + @privy_client, + method: :post, + url: "https://api.privy.io/v1/foo", + body: {key: "value"}, + authorization_context: ctx + ) + assert_equal("fn-sig", prepared.headers["privy-authorization-signature"]) + assert_includes(captured, '"key":"value"') + end +end diff --git a/test/privy/authorization/crypto_test.rb b/test/privy/authorization/crypto_test.rb new file mode 100644 index 0000000..80422d5 --- /dev/null +++ b/test/privy/authorization/crypto_test.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::CryptographyTest < Minitest::Test + def test_canonicalize_sorts_keys_and_strips_whitespace + result = Privy::Authorization::Canonicalization.canonicalize({b: 1, a: [3, 2]}) + assert_equal('{"a":[3,2],"b":1}', result) + end + + def test_canonicalize_empty_object_and_array + assert_equal("{}", Privy::Authorization::Canonicalization.canonicalize({})) + assert_equal("[]", Privy::Authorization::Canonicalization.canonicalize([])) + end + + def test_canonicalize_nested + result = Privy::Authorization::Canonicalization.canonicalize({outer: {z: 1, a: {nested: true}}}) + assert_equal('{"outer":{"a":{"nested":true},"z":1}}', result) + end + + def test_round_trip_signature_verifies + kp = Privy::Cryptography.generate_p256_key_pair + pubkey = OpenSSL::PKey.read(kp.public_key.unpack1("m0")) + payload = "hello world" + sig_b64 = Privy::Authorization.generate_authorization_signature(private_key_base64: kp.private_key, payload: payload) + der = sig_b64.unpack1("m0") + digest = OpenSSL::Digest.new("SHA256").digest(payload) + assert(pubkey.dsa_verify_asn1(digest, der)) + end +end diff --git a/test/privy/authorization/jwt_exchange_test.rb b/test/privy/authorization/jwt_exchange_test.rb new file mode 100644 index 0000000..6a56927 --- /dev/null +++ b/test/privy/authorization/jwt_exchange_test.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +require_relative "../test_helper" +require "base64" +require "openssl" +require "hpke" + +class Privy::JwtExchangeServiceTest < Minitest::Test + def setup + @wallets_resource = Object.new + @service = Privy::JwtExchangeService.new(wallets_resource: @wallets_resource, cache_max_capacity: 3) + end + + def test_exchange_jwt_decrypts_and_returns_authorization_key + jwt = "test.jwt.token" + plaintext = "base64-encoded-private-key-material" + + stub_authenticate(jwt, plaintext, expires_at: future_ms) + + result = @service.exchange_jwt_for_authorization_key(jwt) + assert_equal(plaintext, result) + end + + def test_exchange_jwt_caches_result + jwt = "cached.jwt.token" + plaintext = "cached-key" + call_count = 0 + + stub_authenticate(jwt, plaintext, expires_at: future_ms) { call_count += 1 } + + first = @service.exchange_jwt_for_authorization_key(jwt) + second = @service.exchange_jwt_for_authorization_key(jwt) + + assert_equal(first, second) + assert_equal(1, call_count) + end + + def test_expired_cache_entry_is_evicted + jwt = "expiring.jwt.token" + plaintext = "expiring-key" + call_count = 0 + + stub_authenticate(jwt, plaintext, expires_at: past_ms) { call_count += 1 } + + @service.exchange_jwt_for_authorization_key(jwt) + + stub_authenticate(jwt, plaintext, expires_at: future_ms) { call_count += 1 } + @service.exchange_jwt_for_authorization_key(jwt) + + assert_equal(2, call_count) + end + + def test_cache_evicts_when_full + call_counts = Hash.new(0) + + 4.times do |i| + jwt = "jwt-#{i}" + stub_authenticate(jwt, "key-#{i}", expires_at: future_ms) { call_counts[jwt] += 1 } + @service.exchange_jwt_for_authorization_key(jwt) + end + + assert_equal(4, call_counts.values.sum) + end + + def test_raises_on_unsupported_encryption_type + jwt = "bad.jwt.token" + encrypted = Struct.new(:encryption_type, :encapsulated_key, :ciphertext) + .new("AES", "abc", "def") + response = Struct.new(:encrypted_authorization_key, :expires_at) + .new(encrypted, future_ms) + + @wallets_resource.define_singleton_method(:authenticate_with_jwt) { |**_| response } + + assert_raises(Privy::Errors::Error) do + @service.exchange_jwt_for_authorization_key(jwt) + end + end + + private + + def future_ms + ((Time.now.to_f + 3600) * 1000).to_i + end + + def past_ms + ((Time.now.to_f - 1) * 1000).to_i + end + + def stub_authenticate(_jwt, plaintext, expires_at:, &on_call) + recipient_key = extract_recipient_public_key + encrypted_payload = hpke_encrypt(recipient_key, plaintext) + + encrypted = Struct.new(:encryption_type, :encapsulated_key, :ciphertext) + .new("HPKE", encrypted_payload[:encapsulated_key], encrypted_payload[:ciphertext]) + response = Struct.new(:encrypted_authorization_key, :expires_at) + .new(encrypted, expires_at) + + @wallets_resource.define_singleton_method(:authenticate_with_jwt) do |**_kwargs| + on_call&.call + response + end + end + + def extract_recipient_public_key + # Access the service's internal HPKE recipient public key for encryption + recipient = @service.instance_variable_get(:@hpke_recipient) + recipient.public_key_pkey + end + + def hpke_encrypt(public_key, plaintext) + hpke = HPKE.new(HPKE::DHKEM_P256_HKDF_SHA256, HPKE::HKDF_SHA256, HPKE::CHACHA20_POLY1305) + result = hpke.setup_base_s(public_key, "") + ciphertext = result[:context_s].seal("", plaintext) + + { + encapsulated_key: Base64.strict_encode64(result[:enc]), + ciphertext: Base64.strict_encode64(ciphertext) + } + end +end diff --git a/test/privy/client_test.rb b/test/privy/client_test.rb new file mode 100644 index 0000000..25e4ccb --- /dev/null +++ b/test/privy/client_test.rb @@ -0,0 +1,346 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class PrivyTest < Minitest::Test + extend Minitest::Serial + include WebMock::API + + def before_all + super + WebMock.enable! + end + + def setup + super + Thread.current.thread_variable_set(:mock_sleep, []) + end + + def teardown + Thread.current.thread_variable_set(:mock_sleep, nil) + WebMock.reset! + super + end + + def after_all + WebMock.disable! + super + end + + def test_raises_on_unknown_environment + e = assert_raises(ArgumentError) do + Privy::Client.new(environment: "wrong") + end + assert_match(/environment must be one of/, e.message) + end + + def test_raises_on_missing_non_nullable_opts + e = assert_raises(ArgumentError) do + Privy::Client.new + end + assert_match(/is required/, e.message) + end + + def test_client_default_request_default_retry_attempts + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 500, body: {}) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id") + end + + assert_requested(:any, /./, times: 3) + end + + def test_client_given_request_default_retry_attempts + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 500, body: {}) + + privy_api = + Privy::Client.new( + base_url: "http://localhost", + app_id: "My App ID", + app_secret: "My App Secret", + max_retries: 3 + ) + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id") + end + + assert_requested(:any, /./, times: 4) + end + + def test_client_default_request_given_retry_attempts + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 500, body: {}) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id", request_options: {max_retries: 3}) + end + + assert_requested(:any, /./, times: 4) + end + + def test_client_given_request_given_retry_attempts + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 500, body: {}) + + privy_api = + Privy::Client.new( + base_url: "http://localhost", + app_id: "My App ID", + app_secret: "My App Secret", + max_retries: 3 + ) + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id", request_options: {max_retries: 4}) + end + + assert_requested(:any, /./, times: 5) + end + + def test_client_retry_after_seconds + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json( + status: 500, + headers: {"retry-after" => "1.3"}, + body: {} + ) + + privy_api = + Privy::Client.new( + base_url: "http://localhost", + app_id: "My App ID", + app_secret: "My App Secret", + max_retries: 1 + ) + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id") + end + + assert_requested(:any, /./, times: 2) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_client_retry_after_date + time_now = Time.now + + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json( + status: 500, + headers: {"retry-after" => (time_now + 10).httpdate}, + body: {} + ) + + privy_api = + Privy::Client.new( + base_url: "http://localhost", + app_id: "My App ID", + app_secret: "My App Secret", + max_retries: 1 + ) + + Thread.current.thread_variable_set(:time_now, time_now) + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id") + end + Thread.current.thread_variable_set(:time_now, nil) + + assert_requested(:any, /./, times: 2) + assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0) + end + + def test_client_retry_after_ms + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json( + status: 500, + headers: {"retry-after-ms" => "1300"}, + body: {} + ) + + privy_api = + Privy::Client.new( + base_url: "http://localhost", + app_id: "My App ID", + app_secret: "My App Secret", + max_retries: 1 + ) + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id") + end + + assert_requested(:any, /./, times: 2) + assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) + end + + def test_retry_count_header + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 500, body: {}) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id") + end + + 3.times do + assert_requested(:any, /./, headers: {"x-stainless-retry-count" => _1}) + end + end + + def test_omit_retry_count_header + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 500, body: {}) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get("wallet_id", request_options: {extra_headers: {"x-stainless-retry-count" => nil}}) + end + + assert_requested(:any, /./, times: 3) do + refute_includes(_1.headers.keys.map(&:downcase), "x-stainless-retry-count") + end + end + + def test_overwrite_retry_count_header + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 500, body: {}) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::InternalServerError) do + privy_api.wallets.get( + "wallet_id", + request_options: {extra_headers: {"x-stainless-retry-count" => "42"}} + ) + end + + assert_requested(:any, /./, headers: {"x-stainless-retry-count" => "42"}, times: 3) + end + + def test_client_redirect_307 + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json( + status: 307, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:any, "http://localhost/redirected").to_return( + status: 307, + headers: {"location" => "/redirected"} + ) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::APIConnectionError) do + privy_api.wallets.get("wallet_id", request_options: {extra_headers: {}}) + end + + recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first + + assert_requested(:any, "http://localhost/redirected", times: Privy::Client::MAX_REDIRECTS) do + assert_equal(recorded.method, _1.method) + assert_equal(recorded.body, _1.body) + assert_equal( + recorded.headers.transform_keys(&:downcase)["content-type"], + _1.headers.transform_keys(&:downcase)["content-type"] + ) + end + end + + def test_client_redirect_303 + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json( + status: 303, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:get, "http://localhost/redirected").to_return( + status: 303, + headers: {"location" => "/redirected"} + ) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::APIConnectionError) do + privy_api.wallets.get("wallet_id", request_options: {extra_headers: {}}) + end + + assert_requested(:get, "http://localhost/redirected", times: Privy::Client::MAX_REDIRECTS) do + headers = _1.headers.keys.map(&:downcase) + refute_includes(headers, "content-type") + assert_nil(_1.body) + end + end + + def test_client_redirect_auth_keep_same_origin + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json( + status: 307, + headers: {"location" => "/redirected"}, + body: {} + ) + stub_request(:any, "http://localhost/redirected").to_return( + status: 307, + headers: {"location" => "/redirected"} + ) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::APIConnectionError) do + privy_api.wallets.get("wallet_id", request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) + end + + recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first + auth_header = recorded.headers.transform_keys(&:downcase).fetch("authorization") + + assert_equal("Bearer xyz", auth_header) + assert_requested(:any, "http://localhost/redirected", times: Privy::Client::MAX_REDIRECTS) do + auth_header = _1.headers.transform_keys(&:downcase).fetch("authorization") + assert_equal("Bearer xyz", auth_header) + end + end + + def test_client_redirect_auth_strip_cross_origin + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json( + status: 307, + headers: {"location" => "https://example.com/redirected"}, + body: {} + ) + stub_request(:any, "https://example.com/redirected").to_return( + status: 307, + headers: {"location" => "https://example.com/redirected"} + ) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + assert_raises(Privy::Errors::APIConnectionError) do + privy_api.wallets.get("wallet_id", request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) + end + + assert_requested(:any, "https://example.com/redirected", times: Privy::Client::MAX_REDIRECTS) do + headers = _1.headers.keys.map(&:downcase) + refute_includes(headers, "authorization") + end + end + + def test_default_headers + stub_request(:get, "http://localhost/v1/wallets/wallet_id").to_return_json(status: 200, body: {}) + + privy_api = + Privy::Client.new(base_url: "http://localhost", app_id: "My App ID", app_secret: "My App Secret") + + privy_api.wallets.get("wallet_id") + + assert_requested(:any, /./) do |req| + headers = req.headers.transform_keys(&:downcase) + expected = req.body.nil? ? ["accept"] : %w[accept content-type] + headers.fetch_values(*expected).each { refute_empty(_1) } + end + end +end diff --git a/test/privy/file_part_test.rb b/test/privy/file_part_test.rb new file mode 100644 index 0000000..de38c4c --- /dev/null +++ b/test/privy/file_part_test.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require_relative "test_helper" + +class Privy::Test::FilePartTest < Minitest::Test + def test_to_json + text = "gray" + filepart = Privy::FilePart.new(StringIO.new(text)) + + assert_equal(text.to_json, filepart.to_json) + assert_equal(text.to_yaml, filepart.to_yaml) + end +end diff --git a/test/privy/integration/integration_test_helper.rb b/test/privy/integration/integration_test_helper.rb new file mode 100644 index 0000000..45d8c7f --- /dev/null +++ b/test/privy/integration/integration_test_helper.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +require "dotenv/load" +require_relative "../test_helper" +require_relative "support/jwt_helpers" + +module Privy + module Test + # Loads env-var config for live-backend tests. + module IntegrationConfig + def self.app_id + ENV["TEST_APP_ID"] + end + + def self.app_secret + ENV["TEST_APP_SECRET"] + end + + def self.api_url + ENV.fetch("TEST_API_URL", "https://api.staging.privy.io") + end + + def self.configured? + !(app_id.nil? || app_id.empty? || app_secret.nil? || app_secret.empty?) + end + + def self.skip_reason + "Skipping integration test: set TEST_APP_ID and TEST_APP_SECRET (via .env or environment) " \ + "to run against #{api_url}" + end + end + + # Namespace for live-backend integration tests. + module Integration + end + + # Base class for live-backend tests. Disables WebMock's net-connect block + # for the test duration and exposes a memoized PrivyClient pointed at the + # configured API URL. + class IntegrationTest < Minitest::Test + include Privy::Test::Integration::JwtHelpers + + def setup + unless Privy::Test::IntegrationConfig.configured? + skip(Privy::Test::IntegrationConfig.skip_reason) + end + WebMock.allow_net_connect! if defined?(WebMock) + end + + def teardown + WebMock.disable_net_connect! if defined?(WebMock) + end + + def client + @client ||= Privy::PrivyClient.new( + app_id: Privy::Test::IntegrationConfig.app_id, + app_secret: Privy::Test::IntegrationConfig.app_secret, + base_url: Privy::Test::IntegrationConfig.api_url + ) + end + end + end +end + +# Opt-in HTTP traces for integration tests. +# +# The Stainless-generated client has no logger option. This prepend hooks +# Net::HTTP#set_debug_output onto the pooled connection factory so that every +# request/response pair (status line, headers, body) goes to $stderr when +# PRIVY_LOG_HTTP=1 is set. Unit tests use WebMock and never reach this code. +# +# WARNING: traces include the Authorization header, which base64-decodes to +# app_id:app_secret. Do not paste traces into issues or share CI logs verbatim. +module Privy + module Test + # Wraps an IO to make Net::HTTP debug output readable. + # Net::HTTP writes each chunk to debug_output as either a literal direction + # prefix ("<- " or "-> ") or a String#dump-quoted chunk ('"POST /foo HTTP/1.1\r\n..."'). + # We track the last-seen prefix, undump the quoted chunks, then re-emit + # each line with the prefix attached. + class ReadableHTTPDebugIO + DIRECTION_PREFIXES = ["<- ", "-> "].freeze + # Matches "-> \"...dumped...\"\n" (Net::BufferedIO#rbuf_fill), capturing + # the direction arrow and the dumped payload (with surrounding quotes). + COMBINED_LINE_RE = /\A(<-|->) (".*")\n?\z/m + + def initialize(sink) + @sink = sink + @prefix = "" + end + + def <<(chunk) + s = chunk.to_s + + # Pattern 1: bare direction prefix (Net::BufferedIO#write0 emits "<- " + # as its own chunk, followed by dumped payload, followed by "\n"). + if DIRECTION_PREFIXES.include?(s) + @prefix = s + return self + end + + # Pattern 2: combined "-> \"...\"\n" line (Net::BufferedIO#rbuf_fill + # writes the response line as a single chunk). + if (m = s.match(COMBINED_LINE_RE)) + emit_with_prefix("#{m[1]} ", safe_undump(m[2])) + return self + end + + # Pattern 3: plain LOG message ("reading N bytes...\n" etc.) or the + # bare "\n" terminator that follows the request-side dumped chunk. + unless s.start_with?('"') && s.end_with?('"') + return self if s.match?(/\A\s*\z/) # skip bare whitespace terminators + emit_with_prefix("", s.chomp) + return self + end + + # Pattern 4: dumped payload following a stored @prefix (request side). + emit_with_prefix(@prefix, safe_undump(s)) + self + end + + def write(str) + self << str + str.length + end + + private + + def safe_undump(quoted) + undumped = quoted.undump + # Binary response bodies (e.g. gzipped) contain bytes that $stderr + # (UTF-8) cannot encode. Keep the ASCII-safe dumped form in that case. + undumped.dup.force_encoding(Encoding::UTF_8).valid_encoding? ? undumped : quoted + rescue StandardError + quoted + end + + def emit_with_prefix(prefix, text) + lines = text.split(/\r?\n/, -1) + lines.each_with_index do |line, i| + last = (i == lines.length - 1) + # Skip the empty sentinel split returns for text ending in a + # newline; we've already terminated the previous line. + next if last && line.empty? + + @sink << prefix << line << "\n" + end + end + end + + module HTTPLogging + def connect(cert_store:, url:) + conn = super + conn.set_debug_output(Privy::Test::ReadableHTTPDebugIO.new($stderr)) if ENV["PRIVY_LOG_HTTP"] == "1" + conn + end + end + end +end + +Privy::Internal::Transport::PooledNetRequester.singleton_class.prepend(Privy::Test::HTTPLogging) + +# When HTTP logging is enabled, disable response compression so traces show +# readable JSON bodies instead of gzipped bytes. Prepended onto Net::HTTP#request +# because Net::HTTPGenericRequest defaults Accept-Encoding to a gzip-preferring +# q-list and sets @decode_content=true. +module Privy + module Test + module DisableCompressionForLogging + def request(req, body = nil, &block) + req["Accept-Encoding"] = "identity" + super + end + end + end +end + +Net::HTTP.prepend(Privy::Test::DisableCompressionForLogging) if ENV["PRIVY_LOG_HTTP"] == "1" diff --git a/test/privy/integration/jwt_exchange_test.rb b/test/privy/integration/jwt_exchange_test.rb new file mode 100644 index 0000000..e0cd9b3 --- /dev/null +++ b/test/privy/integration/jwt_exchange_test.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require_relative "integration_test_helper" + +class Privy::Test::Integration::JwtExchangeTest < Privy::Test::IntegrationTest + def setup + super + skip("JWT_AUTH_SK not set") unless ENV["JWT_AUTH_SK"] && !ENV["JWT_AUTH_SK"].empty? + + # /wallets/authenticate (which jwt_exchange wraps) rejects JWTs for users + # that don't own any wallet. Ensure the freshly-minted user has one. + create_user_owned_wallet + end + + def test_exchange_jwt_returns_authorization_key + jwt = generate_test_jwt + key = client.jwt_exchange.exchange_jwt_for_authorization_key(jwt) + + refute_nil(key) + assert_kind_of(String, key) + decoded = Base64.strict_decode64(key) + assert(decoded.length.positive?, "Decoded key should not be empty") + end + + def test_exchange_jwt_caches_result + jwt = generate_test_jwt + first_result = client.jwt_exchange.exchange_jwt_for_authorization_key(jwt) + second_result = client.jwt_exchange.exchange_jwt_for_authorization_key(jwt) + + assert_equal(first_result, second_result) + end +end diff --git a/test/privy/integration/services/key_quorums_test.rb b/test/privy/integration/services/key_quorums_test.rb new file mode 100644 index 0000000..cf5a069 --- /dev/null +++ b/test/privy/integration/services/key_quorums_test.rb @@ -0,0 +1,105 @@ +# frozen_string_literal: true + +require_relative "../integration_test_helper" + +class Privy::Test::Integration::KeyQuorumsTest < Privy::Test::IntegrationTest + def test_create_key_quorum + kp1 = Privy::Cryptography.generate_p256_key_pair + kp2 = Privy::Cryptography.generate_p256_key_pair + + key_quorum = client.key_quorums.create( + key_quorum_create_params: { + public_keys: [kp1.public_key, kp2.public_key], + display_name: "2 of 2 Test Key Quorum", + authorization_threshold: 2 + } + ) + + refute_nil(key_quorum.id) + assert_equal("2 of 2 Test Key Quorum", key_quorum.display_name) + assert_equal(2, key_quorum.authorization_threshold) + assert_equal(2, key_quorum.authorization_keys.length) + + public_keys = key_quorum.authorization_keys.map(&:public_key) + assert_includes(public_keys, kp1.public_key) + assert_includes(public_keys, kp2.public_key) + + cleanup_key_quorum(key_quorum.id, [kp1.private_key, kp2.private_key]) + end + + def test_update_key_quorum_threshold + kp1 = Privy::Cryptography.generate_p256_key_pair + kp2 = Privy::Cryptography.generate_p256_key_pair + + key_quorum = client.key_quorums.create( + key_quorum_create_params: { + public_keys: [kp1.public_key, kp2.public_key], + display_name: "2 of 2 Update Test", + authorization_threshold: 2 + } + ) + + # Update from 2-of-2 to 1-of-2 (requires both keys since threshold is 2) + ctx_both = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp1.private_key, kp2.private_key] + ) + updated = client.key_quorums.update( + key_quorum.id, + key_quorum_update_params: {authorization_threshold: 1}, + authorization_context: ctx_both + ) + assert_equal(1, updated.authorization_threshold) + + # Update back to 2-of-2 (only 1 key needed now since threshold is 1) + ctx_single = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp1.private_key] + ) + restored = client.key_quorums.update( + key_quorum.id, + key_quorum_update_params: {authorization_threshold: 2}, + authorization_context: ctx_single + ) + assert_equal(2, restored.authorization_threshold) + + cleanup_key_quorum(key_quorum.id, [kp1.private_key, kp2.private_key]) + end + + def test_delete_key_quorum + kp1 = Privy::Cryptography.generate_p256_key_pair + kp2 = Privy::Cryptography.generate_p256_key_pair + + key_quorum = client.key_quorums.create( + key_quorum_create_params: { + public_keys: [kp1.public_key, kp2.public_key], + display_name: "2 of 2 Delete Test", + authorization_threshold: 2 + } + ) + refute_nil(key_quorum.id) + + # Verify it exists + fetched = client.key_quorums.get(key_quorum.id) + assert_equal(key_quorum.id, fetched.id) + + # Delete with authorization + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp1.private_key, kp2.private_key] + ) + result = client.key_quorums.delete(key_quorum.id, authorization_context: ctx) + assert_equal(true, result.success) + + # Verify it no longer exists + assert_raises(Privy::Errors::APIStatusError) do + client.key_quorums.get(key_quorum.id) + end + end + + private + + def cleanup_key_quorum(id, private_keys) + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: private_keys + ) + client.key_quorums.delete(id, authorization_context: ctx) + end +end diff --git a/test/privy/integration/services/policies_test.rb b/test/privy/integration/services/policies_test.rb new file mode 100644 index 0000000..a24bc9f --- /dev/null +++ b/test/privy/integration/services/policies_test.rb @@ -0,0 +1,331 @@ +# frozen_string_literal: true + +require_relative "../integration_test_helper" + +class Privy::Test::Integration::PoliciesTest < Privy::Test::IntegrationTest + def test_create_policy + policy = client.policies.create( + policy_create_params: { + version: "1.0", + name: "Native token transfer maximums", + chain_type: "ethereum", + rules: [ + { + name: "Restrict ETH transfers to a maximum value", + method: "eth_sendTransaction", + action: "ALLOW", + conditions: [ + { + field_source: "ethereum_transaction", + field: "value", + operator: "lte", + value: "0x2386F26FC10000" + } + ] + } + ] + } + ) + + refute_nil(policy.id) + assert_equal("Native token transfer maximums", policy.name) + assert_equal(:ethereum, policy.chain_type) + assert_equal(1, policy.rules.length) + assert_equal("Restrict ETH transfers to a maximum value", policy.rules[0].name) + assert_equal(:eth_sendTransaction, policy.rules[0].method_) + + client.policies.delete(policy.id) + end + + def test_create_idempotency_same_key_same_body_succeeds + idempotency_key = SecureRandom.uuid + + response1 = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Idempotency Test", + chain_type: "ethereum", + rules: [] + }, + idempotency_key: idempotency_key + ) + refute_nil(response1.id) + assert_equal("RubySDK Idempotency Test", response1.name) + assert_equal(:ethereum, response1.chain_type) + + # Wait for the server to finish processing the first request; otherwise the + # second call returns "Previous request with matching idempotency key is still in progress." + sleep(1) + + response2 = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Idempotency Test", + chain_type: "ethereum", + rules: [] + }, + idempotency_key: idempotency_key + ) + assert_equal(response1.id, response2.id) + + client.policies.delete(response1.id) + end + + def test_create_idempotency_same_key_different_body_fails + idempotency_key = SecureRandom.uuid + + response = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Idempotency Test", + chain_type: "ethereum", + rules: [] + }, + idempotency_key: idempotency_key + ) + + assert_raises(Privy::Errors::APIStatusError) do + client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Idempotency Test Different", + chain_type: "ethereum", + rules: [] + }, + idempotency_key: idempotency_key + ) + end + + client.policies.delete(response.id) + end + + def test_update_policy_owner + kp = Privy::Cryptography.generate_p256_key_pair + + # Create an ownerless policy + policy = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Policies Update Test", + chain_type: "ethereum", + rules: [] + } + ) + refute_nil(policy.id) + assert_nil(policy.owner_id) + + # Update the owner to a P-256 key + policy2 = client.policies.update( + policy.id, + policy_update_params: {owner: {public_key: kp.public_key}} + ) + refute_nil(policy2.owner_id) + + # Remove the owner (requires authorization) + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + policy3 = client.policies.update( + policy.id, + policy_update_params: {owner: nil}, + authorization_context: ctx + ) + assert_nil(policy3.owner_id) + + client.policies.delete(policy.id) + end + + def test_delete_owned_policy + kp = Privy::Cryptography.generate_p256_key_pair + + policy = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Policies Delete Test", + chain_type: "ethereum", + rules: [], + owner: {public_key: kp.public_key} + } + ) + refute_nil(policy.id) + + # Verify it exists + fetched = client.policies.get(policy.id) + assert_equal(policy.id, fetched.id) + + # Delete with authorization + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + result = client.policies.delete(policy.id, authorization_context: ctx) + assert_equal(true, result.success) + + # Verify it no longer exists + assert_raises(Privy::Errors::APIStatusError) do + client.policies.get(policy.id) + end + end + + def test_create_rule + kp = Privy::Cryptography.generate_p256_key_pair + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + + policy = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Create Rule Test", + chain_type: "ethereum", + rules: [ + { + name: "Restrict ETH transfers to a maximum value", + method: "eth_sendTransaction", + action: "ALLOW", + conditions: [ + { + field_source: "ethereum_transaction", + field: "value", + operator: "lte", + value: "0x2386F26FC10000" + } + ] + } + ], + owner: {public_key: kp.public_key} + } + ) + original_rule_id = policy.rules[0].id + + response = client.policies.create_rule( + policy.id, + policy_create_rule_params: { + name: "Allow transfers to known address", + method: "eth_sendTransaction", + action: "ALLOW", + conditions: [ + { + field_source: "ethereum_transaction", + field: "to", + operator: "eq", + value: "0x0000000000000000000000000000000000000001" + } + ] + }, + authorization_context: ctx + ) + refute_nil(response.id) + + fetched = client.policies.get(policy.id) + assert_equal(2, fetched.rules.length) + assert_equal(original_rule_id, fetched.rules[0].id) + assert_equal(response.id, fetched.rules[1].id) + assert_equal("Allow transfers to known address", fetched.rules[1].name) + + client.policies.delete(policy.id, authorization_context: ctx) + end + + def test_update_rule + kp = Privy::Cryptography.generate_p256_key_pair + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + + policy = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Update Rule Test", + chain_type: "ethereum", + rules: [ + { + name: "Restrict ETH transfers to a maximum value", + method: "eth_sendTransaction", + action: "ALLOW", + conditions: [ + { + field_source: "ethereum_transaction", + field: "value", + operator: "lte", + value: "0x2386F26FC10000" + } + ] + } + ], + owner: {public_key: kp.public_key} + } + ) + rule_id = policy.rules[0].id + + response = client.policies.update_rule( + rule_id, + policy_id: policy.id, + policy_update_rule_params: { + name: "Updated rule name", + method: "eth_sendTransaction", + action: "DENY", + conditions: [ + { + field_source: "ethereum_transaction", + field: "to", + operator: "eq", + value: "0x0000000000000000000000000000000000000001" + } + ] + }, + authorization_context: ctx + ) + assert_equal(rule_id, response.id) + + fetched = client.policies.get(policy.id) + assert_equal(1, fetched.rules.length) + assert_equal(rule_id, fetched.rules[0].id) + assert_equal("Updated rule name", fetched.rules[0].name) + assert_equal(:DENY, fetched.rules[0].action) + + client.policies.delete(policy.id, authorization_context: ctx) + end + + def test_delete_rule + kp = Privy::Cryptography.generate_p256_key_pair + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + + policy = client.policies.create( + policy_create_params: { + version: "1.0", + name: "RubySDK Delete Rule Test", + chain_type: "ethereum", + rules: [ + { + name: "Restrict ETH transfers to a maximum value", + method: "eth_sendTransaction", + action: "ALLOW", + conditions: [ + { + field_source: "ethereum_transaction", + field: "value", + operator: "lte", + value: "0x2386F26FC10000" + } + ] + } + ], + owner: {public_key: kp.public_key} + } + ) + rule_id = policy.rules[0].id + + result = client.policies.delete_rule( + rule_id, + policy_id: policy.id, + authorization_context: ctx + ) + assert_equal(true, result.success) + + fetched = client.policies.get(policy.id) + assert_equal(0, fetched.rules.length) + + client.policies.delete(policy.id, authorization_context: ctx) + end +end diff --git a/test/privy/integration/services/request_expiry_test.rb b/test/privy/integration/services/request_expiry_test.rb new file mode 100644 index 0000000..d8357c7 --- /dev/null +++ b/test/privy/integration/services/request_expiry_test.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +require_relative "../integration_test_helper" + +class Privy::Test::Integration::RequestExpiryTest < Privy::Test::IntegrationTest + def test_default_request_expiry_round_trips + kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create( + wallet_create_params: {chain_type: :ethereum, owner: {public_key: kp.public_key}} + ) + ctx = Privy::Authorization::AuthorizationContext.build(authorization_private_keys: [kp.private_key]) + + updated = client.wallets.update( + wallet.id, + wallet_update_params: {display_name: "ruby-sdk-expiry-default-#{Time.now.to_i}"}, + authorization_context: ctx + ) + refute_nil(updated.id) + end + + def test_per_call_request_expiry_round_trips + kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create( + wallet_create_params: {chain_type: :ethereum, owner: {public_key: kp.public_key}} + ) + ctx = Privy::Authorization::AuthorizationContext.build(authorization_private_keys: [kp.private_key]) + + expiry = Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + (5 * 60 * 1_000) + updated = client.wallets.update( + wallet.id, + wallet_update_params: {display_name: "ruby-sdk-expiry-explicit-#{Time.now.to_i}"}, + authorization_context: ctx, + request_expiry: expiry + ) + refute_nil(updated.id) + end + + def test_disabled_request_expiry_round_trips + disabled_client = Privy::PrivyClient.new( + app_id: Privy::Test::IntegrationConfig.app_id, + app_secret: Privy::Test::IntegrationConfig.app_secret, + base_url: Privy::Test::IntegrationConfig.api_url, + request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true) + ) + + kp = Privy::Cryptography.generate_p256_key_pair + wallet = disabled_client.wallets.create( + wallet_create_params: {chain_type: :ethereum, owner: {public_key: kp.public_key}} + ) + ctx = Privy::Authorization::AuthorizationContext.build(authorization_private_keys: [kp.private_key]) + + updated = disabled_client.wallets.update( + wallet.id, + wallet_update_params: {display_name: "ruby-sdk-expiry-disabled-#{Time.now.to_i}"}, + authorization_context: ctx + ) + refute_nil(updated.id) + end + + def test_expired_request_is_rejected + kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create( + wallet_create_params: {chain_type: :ethereum, owner: {public_key: kp.public_key}} + ) + ctx = Privy::Authorization::AuthorizationContext.build(authorization_private_keys: [kp.private_key]) + + expired = Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) - 60_000 + + error = assert_raises(Privy::Errors::APIStatusError) do + client.wallets.update( + wallet.id, + wallet_update_params: {display_name: "ruby-sdk-expiry-expired-#{Time.now.to_i}"}, + authorization_context: ctx, + request_expiry: expired + ) + end + refute_nil(error.message) + end +end diff --git a/test/privy/integration/services/users_test.rb b/test/privy/integration/services/users_test.rb new file mode 100644 index 0000000..51f68f1 --- /dev/null +++ b/test/privy/integration/services/users_test.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require_relative "../integration_test_helper" + +class Privy::Test::Integration::UsersTest < Privy::Test::IntegrationTest + def test_create_user_with_custom_auth_and_pregenerated_ethereum_wallet + custom_user_id = "test-user-#{Time.now.to_f.to_s.tr('.', '-')}" + + user = client.users.create( + user_create_params: { + linked_accounts: [{custom_user_id: custom_user_id, type: :custom_auth}], + wallets: [{chain_type: :ethereum}] + } + ) + + refute_nil(user.id, "expected user.id to be set") + + custom_auth = user.linked_accounts.find { |a| a.type == :custom_auth } + refute_nil(custom_auth, "expected to find custom_auth linked account") + assert_equal(custom_user_id, custom_auth.custom_user_id) + + wallet = user.linked_accounts.find { |a| a.type == :wallet } + refute_nil(wallet, "expected to find wallet linked account") + assert_equal(:ethereum, wallet.chain_type) + refute_nil(wallet.address, "expected wallet.address to be set") + assert_match(/^0x[a-fA-F0-9]{40}$/, wallet.address) + ensure + client.users.delete(user.id) if user&.id + end +end diff --git a/test/privy/integration/services/wallets_test.rb b/test/privy/integration/services/wallets_test.rb new file mode 100644 index 0000000..0391e8e --- /dev/null +++ b/test/privy/integration/services/wallets_test.rb @@ -0,0 +1,237 @@ +# frozen_string_literal: true + +require_relative "../integration_test_helper" + +class Privy::Test::Integration::WalletsTest < Privy::Test::IntegrationTest + def test_create_ownerless_ethereum_wallet_returns_id_and_address + wallet = client.wallets.create(wallet_create_params: {chain_type: :ethereum}) + + refute_nil(wallet.id, "expected wallet.id to be set") + refute_nil(wallet.address, "expected wallet.address to be set") + assert_match(/^0x[a-fA-F0-9]{40}$/, wallet.address, "address should be 0x-prefixed 40 hex chars") + assert_equal(:ethereum, wallet.chain_type) + end + + def test_rpc_personal_sign_on_ownerless_wallet_returns_signature + wallet = client.wallets.create(wallet_create_params: {chain_type: :ethereum}) + assert_equal(:ethereum, wallet.chain_type) + + response = client.wallets.rpc( + wallet.id, + wallet_rpc_request_body: { + method: "personal_sign", + chain_type: "ethereum", + params: {message: "hello from ruby-sdk integration test", encoding: "utf-8"} + } + ) + + signature = response.data.signature + refute_nil(signature) + assert(signature.start_with?("0x"), "expected 0x-prefixed signature, got #{signature.inspect}") + end + + def test_create_wallet_with_p256_owner_returns_wallet_with_owner_id + kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create(wallet_create_params: {chain_type: :ethereum, owner: {public_key: kp.public_key}}) + + refute_nil(wallet.id) + refute_nil(wallet.address) + assert_match(/^0x[a-fA-F0-9]{40}$/, wallet.address) + assert_equal(:ethereum, wallet.chain_type) + refute_nil(wallet.owner_id, "expected owner_id to be set when a P-256 owner is provided") + end + + def test_rpc_personal_sign_on_p256_owned_wallet_returns_signature + kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create(wallet_create_params: {chain_type: :ethereum, owner: {public_key: kp.public_key}}) + + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + response = client.wallets.rpc( + wallet.id, + wallet_rpc_request_body: { + method: "personal_sign", + chain_type: "ethereum", + params: {message: "hello from ruby-sdk p256 integration test", encoding: "utf-8"} + }, + authorization_context: ctx + ) + + signature = response.data.signature + refute_nil(signature) + assert(signature.start_with?("0x"), "expected 0x-prefixed signature, got #{signature.inspect}") + end + + def test_rpc_personal_sign_on_p256_owned_wallet_with_wrong_signature_is_rejected + owner_kp = Privy::Cryptography.generate_p256_key_pair + other_kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create(wallet_create_params: {chain_type: :ethereum, owner: {public_key: owner_kp.public_key}}) + + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [other_kp.private_key] + ) + + assert_raises(Privy::Errors::APIStatusError) do + client.wallets.rpc( + wallet.id, + wallet_rpc_request_body: { + method: "personal_sign", + chain_type: "ethereum", + params: {message: "should be rejected", encoding: "utf-8"} + }, + authorization_context: ctx + ) + end + end + + def test_rpc_personal_sign_on_p256_owned_wallet_with_sign_fn_returns_signature + kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create(wallet_create_params: {chain_type: :ethereum, owner: {public_key: kp.public_key}}) + + sign_fn = lambda do |payload| + Privy::Authorization.generate_authorization_signature( + private_key_base64: kp.private_key, + payload: payload + ) + end + ctx = Privy::Authorization::AuthorizationContext.build(sign_fns: [sign_fn]) + + response = client.wallets.rpc( + wallet.id, + wallet_rpc_request_body: { + method: "personal_sign", + chain_type: "ethereum", + params: {message: "hello from ruby-sdk sign_fn integration test", encoding: "utf-8"} + }, + authorization_context: ctx + ) + + signature = response.data.signature + refute_nil(signature) + assert(signature.start_with?("0x"), "expected 0x-prefixed signature, got #{signature.inspect}") + end + + # --- User-owned wallet tests (JWT authorization) --- + + def test_rpc_personal_sign_on_user_owned_wallet_with_jwt_returns_signature + skip("JWT_AUTH_SK not set") unless ENV["JWT_AUTH_SK"] && !ENV["JWT_AUTH_SK"].empty? + + wallet = create_user_owned_wallet + jwt = generate_test_jwt + + ctx = Privy::Authorization::AuthorizationContext.build(user_jwts: [jwt]) + response = client.wallets.rpc( + wallet.id, + wallet_rpc_request_body: { + method: "personal_sign", + chain_type: "ethereum", + params: {message: "hello from ruby-sdk user_jwts test", encoding: "utf-8"} + }, + authorization_context: ctx + ) + + signature = response.data.signature + refute_nil(signature) + assert(signature.start_with?("0x"), "expected 0x-prefixed signature, got #{signature.inspect}") + end + + def test_rpc_sign_transaction_on_user_owned_wallet_with_jwt_returns_signed_tx + skip("JWT_AUTH_SK not set") unless ENV["JWT_AUTH_SK"] && !ENV["JWT_AUTH_SK"].empty? + + wallet = create_user_owned_wallet + jwt = generate_test_jwt + + ctx = Privy::Authorization::AuthorizationContext.build(user_jwts: [jwt]) + response = client.wallets.rpc( + wallet.id, + wallet_rpc_request_body: { + method: "eth_signTransaction", + chain_type: "ethereum", + params: { + transaction: { + to: "0x0000000000000000000000000000000000000000", + value: "0x0", + chain_id: 11_155_111 + } + } + }, + authorization_context: ctx + ) + + signed_transaction = response.data.signed_transaction + refute_nil(signed_transaction) + assert( + signed_transaction.start_with?("0x"), + "expected 0x-prefixed signed tx, got #{signed_transaction.inspect}" + ) + end + + # --- raw_sign tests --- + + RAW_SIGN_HASH = "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" + + def test_raw_sign_on_ownerless_wallet_returns_signature + wallet = client.wallets.create(wallet_create_params: {chain_type: :tron}) + + response = client.wallets.raw_sign( + wallet.id, + raw_sign_input: {params: {hash: RAW_SIGN_HASH}} + ) + + refute_nil(response.data.signature) + assert_equal(:hex, response.data.encoding) + end + + def test_raw_sign_on_p256_owned_wallet_returns_signature + kp = Privy::Cryptography.generate_p256_key_pair + wallet = client.wallets.create(wallet_create_params: {chain_type: :tron, owner: {public_key: kp.public_key}}) + + ctx = Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + response = client.wallets.raw_sign( + wallet.id, + raw_sign_input: {params: {hash: RAW_SIGN_HASH}}, + authorization_context: ctx + ) + + refute_nil(response.data.signature) + assert_equal(:hex, response.data.encoding) + end + + def test_raw_sign_on_user_owned_wallet_returns_signature + skip("JWT_AUTH_SK not set") unless ENV["JWT_AUTH_SK"] && !ENV["JWT_AUTH_SK"].empty? + + wallet = create_user_owned_wallet(chain_type: :tron) + jwt = generate_test_jwt + + ctx = Privy::Authorization::AuthorizationContext.build(user_jwts: [jwt]) + response = client.wallets.raw_sign( + wallet.id, + raw_sign_input: {params: {hash: RAW_SIGN_HASH}}, + authorization_context: ctx + ) + + refute_nil(response.data.signature) + assert_equal(:hex, response.data.encoding) + end + + # --- transfer tests --- + + def test_transfer_on_ownerless_wallet + skip("Skipped to avoid transferring real funds") + + wallet = client.wallets.create(wallet_create_params: {chain_type: :ethereum}) + + response = client.wallets.transfer( + wallet.id, + wallet_transfer_params: { + source: {asset: "usdc", amount: "0.01", chain: "base"}, + destination: {address: "0xB00F0759DbeeF5E543Cc3E3B07A6442F5f3928a2"} + } + ) + + refute_nil(response) + end +end diff --git a/test/privy/integration/support/jwt_helpers.rb b/test/privy/integration/support/jwt_helpers.rb new file mode 100644 index 0000000..beeb034 --- /dev/null +++ b/test/privy/integration/support/jwt_helpers.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require "openssl" +require "jwt" +require "securerandom" + +module Privy + module Test + module Integration + module JwtHelpers + # A unique custom-auth subject per test instance. Memoized so the JWT + # `sub` claim and the user's custom_auth_id stay in lockstep within one + # test, while Minitest's per-test instance gives us a fresh value across + # tests and runs. This avoids accumulating wallets under a single shared + # user (which trips the per-user wallet limit on staging). + def jwt_auth_subject + @jwt_auth_subject ||= "ruby-sdk-test-#{SecureRandom.uuid}" + end + + def generate_test_jwt + # Ensure the Privy user exists before handing out a JWT for them; the + # API endpoints that accept these JWTs (e.g. /wallets/authenticate) + # 404 when the subject has never been linked to a user. + jwt_auth_user + raw = ENV.fetch("JWT_AUTH_SK") + pem = raw.gsub('\n', "\n").gsub("\r", "").strip + private_key = OpenSSL::PKey::RSA.new(pem) + payload = {sub: jwt_auth_subject, exp: Time.now.to_i + 3600} + JWT.encode(payload, private_key, "RS256", {typ: "JWT"}) + end + + # Lazily creates a Privy user backed by a fresh custom-auth subject and + # returns it. Subsequent calls within the same test return the same user. + def jwt_auth_user + @jwt_auth_user ||= client.users.create( + user_create_params: { + linked_accounts: [{type: :custom_auth, custom_user_id: jwt_auth_subject}] + } + ) + end + + def create_user_owned_wallet(chain_type: :ethereum) + client.wallets.create( + wallet_create_params: {chain_type: chain_type, owner: {user_id: jwt_auth_user.id}} + ) + end + end + end + end +end diff --git a/test/privy/internal/sorbet_runtime_support_test.rb b/test/privy/internal/sorbet_runtime_support_test.rb new file mode 100644 index 0000000..5da51c6 --- /dev/null +++ b/test/privy/internal/sorbet_runtime_support_test.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::SorbetRuntimeSupportTest < Minitest::Test + extend Minitest::Serial + + i_suck_and_my_tests_are_order_dependent! + + module E + extend Privy::Internal::Type::Enum + + define_sorbet_constant!(:TaggedSymbol) { 1 } + end + + module U + extend Privy::Internal::Type::Union + + define_sorbet_constant!(:Variants) { 2 } + end + + class M < Privy::Internal::Type::BaseModel + define_sorbet_constant!(:OrHash) { 3 } + end + + def test_nil_aliases + err = Privy::Internal::Util::SorbetRuntimeSupport::MissingSorbetRuntimeError + + assert_raises(err) { Privy::Internal::AnyHash } + assert_raises(err) { Privy::Internal::FileInput } + assert_raises(err) { Privy::Internal::Type::Converter::Input } + assert_raises(err) { Privy::Internal::Type::Converter::CoerceState } + assert_raises(err) { Privy::Internal::Type::Converter::DumpState } + assert_raises(err) { Privy::Internal::Type::BaseModel::KnownField } + assert_raises(err) { Privy::Internal::Util::ParsedUri } + assert_raises(err) { Privy::Internal::Util::ServerSentEvent } + assert_raises(err) { Privy::Internal::Transport::BaseClient::RequestComponents } + assert_raises(err) { Privy::Internal::Transport::BaseClient::RequestInput } + assert_raises(err) { Privy::Internal::Transport::PooledNetRequester::Request } + assert_raises(err) { E::TaggedSymbol } + assert_raises(err) { U::Variants } + assert_raises(err) { M::OrHash } + end + + def test_stubbed_aliases + Kernel.instance_eval { const_set(:T, nil) } + + assert_equal(1, E::TaggedSymbol) + assert_equal(2, U::Variants) + assert_equal(3, M::OrHash) + end +end diff --git a/test/privy/internal/type/base_model_test.rb b/test/privy/internal/type/base_model_test.rb new file mode 100644 index 0000000..dab8f3d --- /dev/null +++ b/test/privy/internal/type/base_model_test.rb @@ -0,0 +1,727 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Test::PrimitiveModelTest < Minitest::Test + A = Privy::Internal::Type::ArrayOf[-> { Integer }] + H = Privy::Internal::Type::HashOf[-> { Integer }, nil?: true] + + module E + extend Privy::Internal::Type::Enum + end + + module U + extend Privy::Internal::Type::Union + end + + class B < Privy::Internal::Type::BaseModel + optional :a, Integer + optional :b, B + end + + def test_typing + converters = [ + Privy::Internal::Type::Unknown, + Privy::Internal::Type::Boolean, + A, + H, + E, + U, + B + ] + + converters.each do |conv| + assert_pattern do + conv => Privy::Internal::Type::Converter + end + end + end + + def test_coerce + cases = { + [Privy::Internal::Type::Unknown, :a] => [{yes: 1}, :a], + [NilClass, :a] => [{maybe: 1}, nil], + [NilClass, nil] => [{yes: 1}, nil], + [Privy::Internal::Type::Boolean, true] => [{yes: 1}, true], + [Privy::Internal::Type::Boolean, "true"] => [{no: 1}, "true"], + [Integer, 1] => [{yes: 1}, 1], + [Integer, 1.0] => [{maybe: 1}, 1], + [Integer, "1"] => [{maybe: 1}, 1], + [Integer, "one"] => [{no: 1}, "one"], + [Float, 1] => [{yes: 1}, 1.0], + [Float, "1"] => [{maybe: 1}, 1.0], + [Float, :one] => [{no: 1}, :one], + [String, :str] => [{yes: 1}, "str"], + [String, "str"] => [{yes: 1}, "str"], + [String, 1] => [{maybe: 1}, "1"], + [:a, "a"] => [{yes: 1}, :a], + [Date, "1990-09-19"] => [{yes: 1}, Date.new(1990, 9, 19)], + [Date, Date.new(1990, 9, 19)] => [{yes: 1}, Date.new(1990, 9, 19)], + [Date, "one"] => [{no: 1}, "one"], + [Time, "1990-09-19"] => [{yes: 1}, Time.new(1990, 9, 19)], + [Time, Time.new(1990, 9, 19)] => [{yes: 1}, Time.new(1990, 9, 19)], + [Time, "one"] => [{no: 1}, "one"] + } + + cases.each do |lhs, rhs| + target, input = lhs + exactness, expect = rhs + state = Privy::Internal::Type::Converter.new_coerce_state + assert_pattern do + Privy::Internal::Type::Converter.coerce(target, input, state: state) => ^expect + state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness + end + end + end + + def test_dump + cases = { + [Privy::Internal::Type::Unknown, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [A, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [H, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [E, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [U, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [B, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [String, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [:b, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [nil, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, + [Privy::Internal::Type::Boolean, true] => true, + [Privy::Internal::Type::Boolean, "true"] => "true", + [Integer, "1"] => "1", + [Float, 1] => 1, + [String, "one"] => "one", + [String, :one] => :one, + [:a, :b] => :b, + [:a, "a"] => "a", + [String, StringIO.new("one")] => "one", + [String, Pathname(__FILE__)] => Privy::FilePart + } + + cases.each do + target, input = _1 + expect = _2 + assert_pattern do + Privy::Internal::Type::Converter.dump(target, input) => ^expect + end + end + end + + def test_coerce_errors + cases = { + [Integer, "one"] => ArgumentError, + [Float, "one"] => ArgumentError, + [String, Time] => TypeError, + [Date, "one"] => ArgumentError, + [Time, "one"] => ArgumentError + } + + cases.each do |testcase, expect| + target, input = testcase + state = Privy::Internal::Type::Converter.new_coerce_state + Privy::Internal::Type::Converter.coerce(target, input, state: state) + assert_pattern do + state => {error: ^expect} + end + end + end + + def test_dump_retry + types = [ + Privy::Internal::Type::Unknown, + Privy::Internal::Type::Boolean, + A, + H, + E, + U, + B + ] + Pathname(__FILE__).open do |fd| + cases = [ + fd, + [fd], + {a: fd}, + {a: {b: fd}} + ] + types.product(cases).each do |target, input| + state = {can_retry: true} + Privy::Internal::Type::Converter.dump(target, input, state: state) + + assert_pattern do + state => {can_retry: false} + end + end + end + end +end + +class Privy::Test::EnumModelTest < Minitest::Test + class E0 + include Privy::Internal::Type::Enum + + attr_reader :values + + def initialize(*values) = (@values = values) + end + + module E1 + extend Privy::Internal::Type::Enum + + TRUE = true + end + + module E2 + extend Privy::Internal::Type::Enum + + ONE = 1 + TWO = 2 + end + + module E3 + extend Privy::Internal::Type::Enum + + ONE = 1.0 + TWO = 2.0 + end + + module E4 + extend Privy::Internal::Type::Enum + + ONE = :one + TWO = :two + end + + def test_coerce + cases = { + [E0.new, "one"] => [{no: 1}, "one"], + [E0.new(:one), "one"] => [{yes: 1}, :one], + [E0.new(:two), "one"] => [{maybe: 1}, "one"], + + [E1, true] => [{yes: 1}, true], + [E1, false] => [{no: 1}, false], + [E1, :true] => [{no: 1}, :true], + + [E2, 1] => [{yes: 1}, 1], + [E2, 1.0] => [{yes: 1}, 1], + [E2, 1.2] => [{no: 1}, 1.2], + [E2, "1"] => [{no: 1}, "1"], + + [E3, 1.0] => [{yes: 1}, 1.0], + [E3, 1] => [{yes: 1}, 1.0], + [E3, "one"] => [{no: 1}, "one"], + + [E4, :one] => [{yes: 1}, :one], + [E4, "one"] => [{yes: 1}, :one], + [E4, "1"] => [{maybe: 1}, "1"], + [E4, :"1"] => [{maybe: 1}, :"1"], + [E4, 1] => [{no: 1}, 1] + } + + cases.each do |lhs, rhs| + target, input = lhs + exactness, expect = rhs + state = Privy::Internal::Type::Converter.new_coerce_state + assert_pattern do + Privy::Internal::Type::Converter.coerce(target, input, state: state) => ^expect + state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness + end + end + end + + def test_dump + cases = { + [E1, true] => true, + [E1, "true"] => "true", + + [E2, 1.0] => 1.0, + [E2, 3] => 3, + [E2, "1.0"] => "1.0", + + [E3, 1.0] => 1.0, + [E3, 3] => 3, + [E3, "1.0"] => "1.0", + + [E4, :one] => :one, + [E4, "one"] => "one", + [E4, "1.0"] => "1.0" + } + + cases.each do + target, input = _1 + expect = _2 + assert_pattern do + Privy::Internal::Type::Converter.dump(target, input) => ^expect + end + end + end +end + +class Privy::Test::CollectionModelTest < Minitest::Test + A1 = Privy::Internal::Type::ArrayOf[-> { Integer }] + H1 = Privy::Internal::Type::HashOf[Integer] + + A2 = Privy::Internal::Type::ArrayOf[H1] + H2 = Privy::Internal::Type::HashOf[-> { A1 }] + + A3 = Privy::Internal::Type::ArrayOf[Integer, nil?: true] + H3 = Privy::Internal::Type::HashOf[Integer, nil?: true] + + def test_coerce + cases = { + [A1, []] => [{yes: 1}, []], + [A1, {}] => [{no: 1}, {}], + [A1, [1, 2.0]] => [{yes: 2, maybe: 1}, [1, 2]], + [A1, ["1", 2.0]] => [{yes: 1, maybe: 2}, [1, 2]], + [H1, {}] => [{yes: 1}, {}], + [H1, []] => [{no: 1}, []], + [H1, {a: 1, b: 2}] => [{yes: 3}, {a: 1, b: 2}], + [H1, {"a" => 1, "b" => 2}] => [{yes: 3}, {a: 1, b: 2}], + [H1, {[] => 1}] => [{yes: 2, no: 1}, {[] => 1}], + [H1, {a: 1.5}] => [{yes: 1, maybe: 1}, {a: 1}], + + [A2, [{}, {"a" => 1}]] => [{yes: 4}, [{}, {a: 1}]], + [A2, [{"a" => "1"}]] => [{yes: 2, maybe: 1}, [{a: 1}]], + [H2, {a: [1, 2]}] => [{yes: 4}, {a: [1, 2]}], + [H2, {"a" => ["1", 2]}] => [{yes: 3, maybe: 1}, {a: [1, 2]}], + [H2, {"a" => ["one", 2]}] => [{yes: 3, no: 1}, {a: ["one", 2]}], + + [A3, [nil, 1]] => [{yes: 3}, [nil, 1]], + [A3, [nil, "1"]] => [{yes: 2, maybe: 1}, [nil, 1]], + [H3, {a: nil, b: "1"}] => [{yes: 2, maybe: 1}, {a: nil, b: 1}], + [H3, {a: nil}] => [{yes: 2}, {a: nil}] + } + + cases.each do |lhs, rhs| + target, input = lhs + exactness, expect = rhs + state = Privy::Internal::Type::Converter.new_coerce_state + assert_pattern do + Privy::Internal::Type::Converter.coerce(target, input, state: state) => ^expect + state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness + end + end + end +end + +class Privy::Test::BaseModelTest < Minitest::Test + class M1 < Privy::Internal::Type::BaseModel + required :a, Integer + end + + class M2 < M1 + required :a, Time + required :b, Integer, nil?: true + optional :c, String + end + + class M3 < Privy::Internal::Type::BaseModel + optional :c, const: :c + required :d, const: :d + end + + class M4 < M1 + request_only do + required :a, Integer + optional :b, String + end + + response_only do + required :c, Integer + optional :d, String + end + end + + class M5 < Privy::Internal::Type::BaseModel + request_only do + required :c, const: :c + end + + response_only do + required :d, const: :d + end + end + + class M6 < M1 + required :a, Privy::Internal::Type::ArrayOf[M6] + optional :b, M6 + end + + def test_coerce + cases = { + [M1, {}] => [{yes: 1, no: 1}, {}], + [M1, :m1] => [{no: 1}, :m1], + + [M2, {}] => [{yes: 2, no: 1, maybe: 1}, {}], + [M2, {a: "1990-09-19", b: nil}] => [{yes: 4}, {a: "1990-09-19", b: nil}], + [M2, {a: "1990-09-19", b: "1"}] => [{yes: 3, maybe: 1}, {a: "1990-09-19", b: "1"}], + [M2, {a: "1990-09-19"}] => [{yes: 3, maybe: 1}, {a: "1990-09-19"}], + [M2, {a: "1990-09-19", c: nil}] => [{yes: 2, maybe: 2}, {a: "1990-09-19", c: nil}], + + [M3, {c: "c", d: "d"}] => [{yes: 3}, {c: :c, d: :d}], + [M3, {c: "d", d: "c"}] => [{yes: 1, maybe: 2}, {c: "d", d: "c"}], + + [M4, {c: 2}] => [{yes: 5}, {c: 2}], + [M4, {a: "1", c: 2}] => [{yes: 4, maybe: 1}, {a: "1", c: 2}], + [M4, {b: nil, c: 2}] => [{yes: 4, maybe: 1}, {b: nil, c: 2}], + + [M5, {}] => [{yes: 3}, {}], + [M5, {c: "c"}] => [{yes: 3}, {c: :c}], + [M5, {d: "d"}] => [{yes: 3}, {d: :d}], + [M5, {d: nil}] => [{yes: 2, no: 1}, {d: nil}], + + [M6, {a: [{a: []}]}] => [{yes: 6}, -> { _1 in {a: [M6]} }], + [M6, {b: {a: []}}] => [{yes: 4, no: 1}, -> { _1 in {b: M6} }] + } + + cases.each do |lhs, rhs| + target, input = lhs + exactness, expect = rhs + state = Privy::Internal::Type::Converter.new_coerce_state + assert_pattern do + coerced = Privy::Internal::Type::Converter.coerce(target, input, state: state) + assert_equal(coerced, coerced) + if coerced.is_a?(Privy::Internal::Type::BaseModel) + coerced.to_h => ^expect + else + coerced => ^expect + end + state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness + end + end + end + + def test_dump + cases = { + [M3, M3.new] => {d: :d}, + [M3, {}] => {d: :d}, + [M3, {d: 1}] => {d: 1}, + + [M4, M4.new(a: 1, b: "b", c: 2, d: "d")] => {a: 1, b: "b"}, + [M4, {a: 1, b: "b", c: 2, d: "d"}] => {a: 1, b: "b"}, + + [M5, M5.new] => {c: :c}, + [M5, {}] => {c: :c}, + [M5, {c: 1}] => {c: 1} + } + + cases.each do + target, input = _1 + expect = _2 + assert_pattern do + Privy::Internal::Type::Converter.dump(target, input) => ^expect + end + end + end + + def test_accessors + cases = { + M2.new({a: "1990-09-19", b: "1"}) => [{a: "1990-09-19", b: "1"}, {a: Time.new(1990, 9, 19), b: 1}], + M2.new(a: "one", b: "one") => [{a: "one", b: "one"}, {a: ArgumentError, b: ArgumentError}], + M2.new(a: nil, b: 2.0) => [{a: nil, b: 2.0}, {a: TypeError}], + M2.new(a: nil, b: 2.2) => [{a: nil, b: 2.2}, {a: TypeError, b: 2}], + + M3.new => [{}, {d: :d}], + M3.new(d: 1) => [{d: 1}, {d: ArgumentError}], + + M5.new => [{}, {c: :c, d: :d}] + } + + cases.each do + target = _1 + data, attributes = _2 + + assert_pattern do + target.to_h => ^data + end + + attributes.each do |accessor, expect| + case expect + in Class if expect <= StandardError + tap do + target.public_send(accessor) + flunk + rescue Privy::Errors::ConversionError => e + assert_kind_of(expect, e.cause) + end + else + assert_pattern { target.public_send(accessor) => ^expect } + end + end + end + end + + def test_inplace_modification + m1 = M6.new(a: []) + m1.a << M6.new(a: []) + + m2 = M6.new(b: M6.new(a: [])) + m2.b.a << M6.new(a: []) + + m3 = M6.new(a: []) + m4 = M6.new(b: m3) + m3.a << M6.new(a: []) + + assert_pattern do + m1 => {a: [{a: []}]} + m2 => {b: {a: [{a: []}]}} + m4 => {b: {a: [{a: []}]}} + end + end +end + +class Privy::Test::UnionTest < Minitest::Test + class U0 + include Privy::Internal::Type::Union + + def initialize(*variants) = variants.each { variant(_1) } + end + + module U1 + extend Privy::Internal::Type::Union + + variant const: :a + variant const: 2 + end + + class M1 < Privy::Internal::Type::BaseModel + required :t, const: :a, api_name: :type + optional :c, String + end + + class M2 < Privy::Internal::Type::BaseModel + required :type, const: :b + optional :c, String + end + + module U2 + extend Privy::Internal::Type::Union + + discriminator :type + + variant :a, M1 + variant :b, M2 + end + + module U3 + extend Privy::Internal::Type::Union + + discriminator :type + + variant :a, M1 + variant String + end + + module U4 + extend Privy::Internal::Type::Union + + discriminator :type + + variant String + variant :a, M1 + end + + class M3 < Privy::Internal::Type::BaseModel + optional :recur, -> { U5 } + required :a, Integer + end + + class M4 < Privy::Internal::Type::BaseModel + optional :recur, -> { U5 } + required :a, Privy::Internal::Type::ArrayOf[-> { U5 }] + end + + class M5 < Privy::Internal::Type::BaseModel + optional :recur, -> { U5 } + required :b, Privy::Internal::Type::ArrayOf[-> { U5 }] + end + + module U5 + extend Privy::Internal::Type::Union + + variant -> { M3 } + variant -> { M4 } + end + + module U6 + extend Privy::Internal::Type::Union + + variant -> { M3 } + variant -> { M5 } + end + + def test_accessors + model = M3.new(recur: []) + tap do + model.recur + flunk + rescue Privy::Errors::ConversionError => e + assert_kind_of(ArgumentError, e.cause) + end + end + + def test_coerce + cases = { + [U0, :""] => [{no: 1}, 0, :""], + + [U0.new(Integer, Float), "one"] => [{no: 1}, 2, "one"], + [U0.new(Integer, Float), 1.0] => [{yes: 1}, 2, 1.0], + [U0.new({const: :a}), "a"] => [{yes: 1}, 1, :a], + [U0.new({const: :a}), "2"] => [{maybe: 1}, 1, "2"], + + [U1, "a"] => [{yes: 1}, 1, :a], + [U1, "2"] => [{maybe: 1}, 2, "2"], + [U1, :b] => [{maybe: 1}, 2, :b], + + [U2, {type: :a}] => [{yes: 3}, 0, {t: :a}], + [U2, {type: "b"}] => [{yes: 3}, 0, {type: :b}], + + [U3, "one"] => [{yes: 1}, 2, "one"], + [U4, "one"] => [{yes: 1}, 1, "one"], + + [U5, {a: []}] => [{yes: 3}, 2, {a: []}], + [U6, {b: []}] => [{yes: 3}, 2, {b: []}], + + [U5, {a: [{a: []}]}] => [{yes: 6}, 4, {a: [M4.new(a: [])]}], + [U5, {a: [{a: [{a: []}]}]}] => [{yes: 9}, 6, {a: [M4.new(a: [M4.new(a: [])])]}] + } + + cases.each do |lhs, rhs| + target, input = lhs + exactness, branched, expect = rhs + state = Privy::Internal::Type::Converter.new_coerce_state + assert_pattern do + coerced = Privy::Internal::Type::Converter.coerce(target, input, state: state) + assert_equal(coerced, coerced) + if coerced.is_a?(Privy::Internal::Type::BaseModel) + coerced.to_h => ^expect + else + coerced => ^expect + end + state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness + state => {branched: ^branched} + end + end + end +end + +class Privy::Test::BaseModelQoLTest < Minitest::Test + class E0 + include Privy::Internal::Type::Enum + + attr_reader :values + + def initialize(*values) = (@values = values) + end + + module E1 + extend Privy::Internal::Type::Enum + + A = 1 + end + + module E2 + extend Privy::Internal::Type::Enum + + A = 1 + end + + module E3 + extend Privy::Internal::Type::Enum + + A = 2 + B = 3 + end + + class U0 + include Privy::Internal::Type::Union + + def initialize(*variants) = variants.each { variant(_1) } + end + + module U1 + extend Privy::Internal::Type::Union + + variant String + variant Integer + end + + module U2 + extend Privy::Internal::Type::Union + + variant String + variant Integer + end + + class M1 < Privy::Internal::Type::BaseModel + required :a, Integer + end + + class M2 < Privy::Internal::Type::BaseModel + required :a, Integer, nil?: true + end + + class M3 < M2 + required :a, Integer + end + + def test_equality + cases = { + [Privy::Internal::Type::Unknown, Privy::Internal::Type::Unknown] => true, + [Privy::Internal::Type::Boolean, Privy::Internal::Type::Boolean] => true, + [Privy::Internal::Type::Unknown, Privy::Internal::Type::Boolean] => false, + [E0.new(:a, :b), E0.new(:a, :b)] => true, + [E0.new(:a, :b), E0.new(:b, :a)] => true, + [E0.new(:a, :b), E0.new(:b, :c)] => false, + [E1, E2] => true, + [E1, E3] => false, + [U0.new(String, Integer), U0.new(String, Integer)] => true, + [U0.new(String, Integer), U0.new(Integer, String)] => false, + [U0.new(String, Float), U0.new(String, Integer)] => false, + [U1, U2] => true, + [M1, M2] => false, + [M1, M3] => true, + [M1.new(a: 1), M1.new(a: 1)] => true + } + + cases.each do + if _2 + assert_equal(*_1) + assert_equal(*_1.map(&:hash)) + else + refute_equal(*_1) + refute_equal(*_1.map(&:hash)) + end + end + end +end + +class Privy::Test::MetaInfoTest < Minitest::Test + A1 = Privy::Internal::Type::ArrayOf[Integer, nil?: true, doc: "dog"] + H1 = Privy::Internal::Type::HashOf[-> { String }, nil?: true, doc: "dawg"] + + class M1 < Privy::Internal::Type::BaseModel + required :a, Integer, doc: "dog" + optional :b, -> { String }, nil?: true, doc: "dawg" + end + + module U1 + extend Privy::Internal::Type::Union + + variant -> { Integer }, const: 2, doc: "dog" + variant -> { String }, doc: "dawg" + end + + def test_meta_retrieval + m1 = A1.instance_variable_get(:@meta) + m2 = H1.instance_variable_get(:@meta) + assert_equal({doc: "dog"}, m1) + assert_equal({doc: "dawg"}, m2) + + ma, mb = M1.fields.fetch_values(:a, :b) + assert_equal({doc: "dog"}, ma.fetch(:meta)) + assert_equal({doc: "dawg"}, mb.fetch(:meta)) + + ua, ub = U1.send(:known_variants).map(&:last) + assert_equal({doc: "dog"}, ua) + assert_equal({doc: "dawg"}, ub) + end +end diff --git a/test/privy/internal/util_test.rb b/test/privy/internal/util_test.rb new file mode 100644 index 0000000..1a416c0 --- /dev/null +++ b/test/privy/internal/util_test.rb @@ -0,0 +1,675 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::UtilDataHandlingTest < Minitest::Test + def test_left_map + assert_pattern do + Privy::Internal::Util.deep_merge({a: 1}, nil) => nil + end + end + + def test_right_map + assert_pattern do + Privy::Internal::Util.deep_merge(nil, {a: 1}) => {a: 1} + end + end + + def test_disjoint_maps + assert_pattern do + Privy::Internal::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} + end + end + + def test_overlapping_maps + assert_pattern do + Privy::Internal::Util.deep_merge({b: 2, c: 3}, {a: 1, c: 4}) => {a: 1, b: 2, c: 4} + end + end + + def test_nested + assert_pattern do + Privy::Internal::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} + end + end + + def test_nested_left_map + assert_pattern do + Privy::Internal::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} + end + end + + def test_omission + merged = Privy::Internal::Util.deep_merge( + {b: {b2: 1, b3: {c: 4, d: 5}}}, + {b: {b2: 1, b3: {c: Privy::Internal::OMIT, d: 5}}} + ) + + assert_pattern do + merged => {b: {b2: 1, b3: {d: 5}}} + end + end + + def test_concat + merged = Privy::Internal::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: true + ) + + assert_pattern do + merged => {a: {b: [1, 2, 3, 4]}} + end + end + + def test_concat_false + merged = Privy::Internal::Util.deep_merge( + {a: {b: [1, 2]}}, + {a: {b: [3, 4]}}, + concat: false + ) + + assert_pattern do + merged => {a: {b: [3, 4]}} + end + end + + def test_dig + assert_pattern do + Privy::Internal::Util.dig(1, nil) => 1 + Privy::Internal::Util.dig({a: 1}, :b) => nil + Privy::Internal::Util.dig({a: 1}, :a) => 1 + Privy::Internal::Util.dig({a: {b: 1}}, [:a, :b]) => 1 + + Privy::Internal::Util.dig([], 1) => nil + Privy::Internal::Util.dig([nil, [nil, 1]], [1, 1]) => 1 + Privy::Internal::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 + Privy::Internal::Util.dig([], 1.0) => nil + + Privy::Internal::Util.dig(Object, 1) => nil + Privy::Internal::Util.dig([], 1.0) { 2 } => 2 + Privy::Internal::Util.dig([], ->(_) { 2 }) => 2 + Privy::Internal::Util.dig([1], -> { _1 in [1] }) => true + end + end +end + +class Privy::Test::UtilUriHandlingTest < Minitest::Test + def test_parsing + %w[ + http://example.com + https://example.com/ + https://example.com:443/example?e1=e1&e2=e2&e= + ].each do |url| + parsed = Privy::Internal::Util.parse_uri(url) + unparsed = Privy::Internal::Util.unparse_uri(parsed).to_s + + assert_equal(url, unparsed) + assert_equal(parsed, Privy::Internal::Util.parse_uri(unparsed)) + end + end + + def test_joining + cases = [ + [ + "h://a.b/c?d=e", + "h://nope/ignored", + Privy::Internal::Util.parse_uri("h://a.b/c?d=e") + ], + [ + "h://a.b/c?d=e", + "h://nope", + { + host: "a.b", + path: "/c", + query: {"d" => ["e"]} + } + ], + [ + "h://a.b/c?d=e", + "h://nope", + { + path: "h://a.b/c", + query: {"d" => ["e"]} + } + ] + ] + + cases.each do |expect, lhs, rhs| + assert_equal( + URI.parse(expect), + Privy::Internal::Util.join_parsed_uri( + Privy::Internal::Util.parse_uri(lhs), + rhs + ) + ) + end + end + + def test_joining_queries + base_url = "h://a.b/c?d=e" + cases = { + "c2" => "h://a.b/c/c2", + "/c2?f=g" => "h://a.b/c2?f=g", + "/c?f=g" => "h://a.b/c?d=e&f=g" + } + + cases.each do |path, expected| + assert_equal( + URI.parse(expected), + Privy::Internal::Util.join_parsed_uri( + Privy::Internal::Util.parse_uri(base_url), + {path: path} + ) + ) + end + end +end + +class Privy::Test::RegexMatchTest < Minitest::Test + def test_json_content + cases = { + "application/json" => true, + "application/jsonl" => false, + "application/arbitrary+json" => true, + "application/ARBITRARY+json" => true, + "application/vnd.github.v3+json" => true, + "application/vnd.api+json" => true + } + cases.each do |header, verdict| + assert_pattern do + Privy::Internal::Util::JSON_CONTENT.match?(header) => ^verdict + end + end + end + + def test_jsonl_content + cases = { + "application/x-ndjson" => true, + "application/x-ldjson" => true, + "application/jsonl" => true, + "application/x-jsonl" => true, + "application/json" => false, + "application/vnd.api+json" => false + } + cases.each do |header, verdict| + assert_pattern do + Privy::Internal::Util::JSONL_CONTENT.match?(header) => ^verdict + end + end + end +end + +class Privy::Test::UtilFormDataEncodingTest < Minitest::Test + class FakeCGI < CGI + def initialize(headers, io) + encoded = io.to_a + @ctype = headers["content-type"] + # rubocop:disable Lint/EmptyBlock + @io = Privy::Internal::Util::ReadIOAdapter.new(encoded.to_enum) {} + # rubocop:enable Lint/EmptyBlock + @c_len = encoded.join.bytesize.to_s + super() + end + + def stdinput = @io + + def env_table + { + "REQUEST_METHOD" => "POST", + "CONTENT_TYPE" => @ctype, + "CONTENT_LENGTH" => @c_len + } + end + end + + def test_encoding_length + headers, = Privy::Internal::Util.encode_content( + {"content-type" => "multipart/form-data"}, + Pathname(__FILE__) + ) + assert_pattern do + headers.fetch("content-type") => /boundary=(.+)$/ + end + field, = Regexp.last_match.captures + assert(field.length < 70 - 6) + end + + def test_file_encode + file = Pathname(__FILE__) + fileinput = Privy::Internal::Type::Converter.dump(Privy::Internal::Type::FileInput, "abc") + headers = {"content-type" => "multipart/form-data"} + cases = { + "abc" => ["", "abc"], + StringIO.new("abc") => ["", "abc"], + fileinput => %w[upload abc], + Privy::FilePart.new(StringIO.new("abc")) => ["", "abc"], + file => [file.basename.to_path, /^class Privy/], + Privy::FilePart.new(file, filename: "d o g") => ["d%20o%20g", /^class Privy/] + } + cases.each do |body, testcase| + filename, val = testcase + encoded = Privy::Internal::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + io = cgi[""] + assert_pattern do + io.original_filename => ^filename + io.read => ^val + end + end + end + + def test_hash_encode + headers = {"content-type" => "multipart/form-data"} + cases = { + {a: 2, b: 3} => {"a" => "2", "b" => "3"}, + {a: 2, b: nil} => {"a" => "2", "b" => "null"}, + {a: 2, b: [1, 2, 3]} => {"a" => "2", "b" => "1"}, + {strio: StringIO.new("a")} => {"strio" => "a"}, + {strio: Privy::FilePart.new("a")} => {"strio" => "a"}, + {pathname: Pathname(__FILE__)} => {"pathname" => -> { _1.read in /^class Privy/ }}, + {pathname: Privy::FilePart.new(Pathname(__FILE__))} => {"pathname" => -> { _1.read in /^class Privy/ }} + } + cases.each do |body, testcase| + encoded = Privy::Internal::Util.encode_content(headers, body) + cgi = FakeCGI.new(*encoded) + testcase.each do |key, val| + assert_pattern do + parsed = + case (p = cgi[key]) + in StringIO + p.read + else + p + end + parsed => ^val + end + end + end + end +end + +class Privy::Test::UtilIOAdapterTest < Minitest::Test + def test_copy_read + cases = { + StringIO.new("abc") => "abc", + Enumerator.new { _1 << "abc" } => "abc" + } + cases.each do |input, expected| + io = StringIO.new + # rubocop:disable Lint/EmptyBlock + adapter = Privy::Internal::Util::ReadIOAdapter.new(input) {} + # rubocop:enable Lint/EmptyBlock + IO.copy_stream(adapter, io) + assert_equal(expected, io.string) + end + end + + def test_copy_write + cases = { + StringIO.new => "", + StringIO.new("abc") => "abc" + } + cases.each do |input, expected| + enum = Privy::Internal::Util.writable_enum do |y| + IO.copy_stream(input, y) + end + assert_equal(expected, enum.to_a.join) + end + end +end + +class Privy::Test::UtilFusedEnumTest < Minitest::Test + def test_rewind_closing + touched = false + once = 0 + steps = 0 + enum = Enumerator.new do |y| + next if touched + + 10.times do + steps = _1 + y << _1 + end + ensure + once = once.succ + end + + fused = Privy::Internal::Util.fused_enum(enum, external: true) do + touched = true + loop { enum.next } + end + Privy::Internal::Util.close_fused!(fused) + + assert_equal(1, once) + assert_equal(0, steps) + end + + def test_thread_interrupts + once = 0 + que = Queue.new + enum = Enumerator.new do |y| + 10.times { y << _1 } + ensure + once = once.succ + end + + fused_1 = Privy::Internal::Util.fused_enum(enum, external: true) { loop { enum.next } } + fused_2 = Privy::Internal::Util.chain_fused(fused_1) { fused_1.each(&_1) } + fused_3 = Privy::Internal::Util.chain_fused(fused_2) { fused_2.each(&_1) } + + th = ::Thread.new do + que << "🐶" + fused_3.each { sleep(10) } + end + + assert_equal("🐶", que.pop) + th.kill.join + assert_equal(1, once) + end + + def test_closing + arr = [1, 2, 3] + once = 0 + fused = Privy::Internal::Util.fused_enum(arr.to_enum) do + once = once.succ + end + + enumerated_1 = fused.to_a + assert_equal(arr, enumerated_1) + assert_equal(1, once) + + enumerated_2 = fused.to_a + assert_equal([], enumerated_2) + assert_equal(1, once) + end + + def test_rewind_chain + once = 0 + fused = Privy::Internal::Util.fused_enum([1, 2, 3].to_enum) do + once = once.succ + end + .lazy + .map(&:succ) + .filter(&:odd?) + first = fused.next + + assert_equal(3, first) + assert_equal(0, once) + assert_raises(StopIteration) { fused.rewind.next } + assert_equal(1, once) + end + + def test_external_iteration + iter = [1, 2, 3].to_enum + first = iter.next + fused = Privy::Internal::Util.fused_enum(iter, external: true) + + assert_equal(1, first) + assert_equal([2, 3], fused.to_a) + end + + def test_close_fused + once = 0 + fused = Privy::Internal::Util.fused_enum([1, 2, 3].to_enum) do + once = once.succ + end + + Privy::Internal::Util.close_fused!(fused) + + assert_equal(1, once) + assert_equal([], fused.to_a) + assert_equal(1, once) + end + + def test_closed_fused_extern_iteration + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + fused = Privy::Internal::Util.fused_enum(enum) + first = fused.next + + assert_equal(1, first) + Privy::Internal::Util.close_fused!(fused) + assert_equal(1, taken) + end + + def test_closed_fused_taken_count + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:odd?) + fused = Privy::Internal::Util.fused_enum(enum) + + assert_equal(0, taken) + Privy::Internal::Util.close_fused!(fused) + assert_equal(0, taken) + end + + def test_closed_fused_extern_iter_taken_count + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:itself) + first = enum.next + assert_equal(2, first) + assert_equal(1, taken) + + fused = Privy::Internal::Util.fused_enum(enum) + Privy::Internal::Util.close_fused!(fused) + assert_equal(1, taken) + end + + def test_close_fused_sse_chain + taken = 0 + enum = [1, 2, 3].to_enum.lazy.map do + taken = taken.succ + _1 + end + .map(&:succ) + .filter(&:odd?) + .map(&:to_s) + + fused_1 = Privy::Internal::Util.fused_enum(enum) + fused_2 = Privy::Internal::Util.decode_lines(fused_1) + fused_3 = Privy::Internal::Util.decode_sse(fused_2) + + assert_equal(0, taken) + Privy::Internal::Util.close_fused!(fused_3) + assert_equal(0, taken) + end +end + +class Privy::Test::UtilContentDecodingTest < Minitest::Test + def test_charset + cases = { + "application/json" => Encoding::BINARY, + "application/json; charset=utf-8" => Encoding::UTF_8, + "charset=uTf-8 application/json; " => Encoding::UTF_8, + "charset=UTF-8; application/json; " => Encoding::UTF_8, + "charset=ISO-8859-1 ;application/json; " => Encoding::ISO_8859_1, + "charset=EUC-KR ;application/json; " => Encoding::EUC_KR + } + text = String.new.force_encoding(Encoding::BINARY) + cases.each do |content_type, encoding| + Privy::Internal::Util.force_charset!(content_type, text: text) + assert_equal(encoding, text.encoding) + end + end +end + +class Privy::Test::UtilSseTest < Minitest::Test + def test_decode_lines + cases = { + %w[] => %w[], + %W[\n\n] => %W[\n \n], + %W[\n \n] => %W[\n \n], + %w[a] => %w[a], + %W[a\nb] => %W[a\n b], + %W[a\nb\n] => %W[a\n b\n], + %W[\na b\n] => %W[\n ab\n], + %W[\na b\n\n] => %W[\n ab\n \n], + %W[\na b] => %W[\n ab], + %W[\u1F62E\u200D\u1F4A8] => %W[\u1F62E\u200D\u1F4A8], + %W[\u1F62E \u200D \u1F4A8] => %W[\u1F62E\u200D\u1F4A8], + ["\xf0\x9f".b, "\xa5\xba".b] => ["\xf0\x9f\xa5\xba".b], + ["\xf0".b, "\x9f".b, "\xa5".b, "\xba".b] => ["\xf0\x9f\xa5\xba".b] + } + eols = %W[\n \r \r\n] + cases.each do |enum, expected| + eols.each do |eol| + lines = Privy::Internal::Util.decode_lines(enum.map { _1.gsub("\n", eol) }) + assert_equal(expected.map { _1.gsub("\n", eol) }, lines.to_a, "eol=#{JSON.generate(eol)}") + end + end + end + + def test_mixed_decode_lines + cases = { + %w[] => %w[], + %W[\r\r] => %W[\r \r], + %W[\r \r] => %W[\r \r], + %W[\r\r\r] => %W[\r \r \r], + %W[\r\r \r] => %W[\r \r \r], + %W[\r \n] => %W[\r\n], + %W[\r\r\n] => %W[\r \r\n], + %W[\n\r] => %W[\n \r] + } + cases.each do |enum, expected| + lines = Privy::Internal::Util.decode_lines(enum) + assert_equal(expected, lines.to_a) + end + end + + def test_decode_sse + cases = { + "empty input" => { + [] => [] + }, + "single data event" => { + [ + "data: hello world\n", + "\n" + ] => [ + {data: "hello world\n"} + ] + }, + "multiple data lines" => { + [ + "data: line 1\n", + "data: line 2\n", + "\n" + ] => [ + {data: "line 1\nline 2\n"} + ] + }, + "complete event" => { + [ + "id: 123\n", + "event: update\n", + "data: hello world\n", + "retry: 5000\n", + "\n" + ] => [ + { + event: "update", + id: "123", + data: "hello world\n", + retry: 5000 + } + ] + }, + "multiple events" => { + [ + "event: update\n", + "data: first\n", + "\n", + "event: message\n", + "data: second\n", + "\n" + ] => [ + {event: "update", data: "first\n"}, + {event: "message", data: "second\n"} + ] + }, + "comments" => { + [ + ": this is a comment\n", + "data: actual data\n", + "\n" + ] => [ + {data: "actual data\n"} + ] + }, + "invalid retry" => { + [ + "retry: not a number\n", + "data: hello\n", + "\n" + ] => [ + {data: "hello\n"} + ] + }, + "invalid id with null" => { + [ + "id: bad\0id\n", + "data: hello\n", + "\n" + ] => [ + {data: "hello\n"} + ] + }, + "leading space in value" => { + [ + "data: hello world\n", + "data: leading space\n", + "\n" + ] => [ + {data: "hello world\n leading space\n"} + ] + }, + "no final newline" => { + [ + "data: hello\n", + "id: 1" + ] => [ + {data: "hello\n", id: "1"} + ] + }, + "multiple empty lines" => { + [ + "data: first\n", + "\n", + "\n", + "data: second\n", + "\n" + ] => [ + {data: "first\n"}, + {data: "second\n"} + ] + }, + "multibyte unicode" => { + [ + "data: \u1F62E\u200D\u1F4A8\n" + ] => [ + {data: "\u1F62E\u200D\u1F4A8\n"} + ] + } + } + + cases.each do |name, test_cases| + test_cases.each do |input, expected| + actual = Privy::Internal::Util.decode_sse(input).map(&:compact) + assert_equal(expected, actual, name) + end + end + end +end diff --git a/test/privy/public_api/privy_client_test.rb b/test/privy/public_api/privy_client_test.rb new file mode 100644 index 0000000..18351a1 --- /dev/null +++ b/test/privy/public_api/privy_client_test.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::PrivyClientTest < Minitest::Test + def test_constructs_with_explicit_credentials + client = Privy::PrivyClient.new(app_id: "app-123", app_secret: "secret", environment: :staging) + assert_equal("app-123", client.app_id) + assert_instance_of(Privy::Client, client.api) + end + + def build_client(**opts) + Privy::PrivyClient.new( + app_id: "app-abc", + app_secret: "secret", + environment: :staging, + **opts + ) + end + + def now_ms + Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + end + + def test_default_expiry_is_15_minutes_from_now + client = build_client + expiry = client.compute_request_expiry(nil) + assert_in_delta(now_ms + (15 * 60 * 1_000), expiry, 1_000) + end + + def test_default_ms_overrides_hardcoded_default + client = build_client( + request_expiry: Privy::PrivyRequestExpiryOptions.build(default_ms: 60_000) + ) + expiry = client.compute_request_expiry(nil) + assert_in_delta(now_ms + 60_000, expiry, 1_000) + end + + def test_disabled_returns_nil + client = build_client( + request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true) + ) + assert_nil(client.compute_request_expiry(nil)) + end + + def test_explicit_override_wins_over_default_ms + client = build_client( + request_expiry: Privy::PrivyRequestExpiryOptions.build(default_ms: 60_000) + ) + assert_equal(1_750_000_000_000, client.compute_request_expiry(1_750_000_000_000)) + end + + def test_explicit_override_wins_over_disabled + client = build_client( + request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true) + ) + assert_equal(1_750_000_000_000, client.compute_request_expiry(1_750_000_000_000)) + end + + def test_request_expiry_options_default_value_does_not_disable + client = build_client + refute_nil(client.compute_request_expiry(nil)) + end + + def test_compute_request_expiry_callable_without_arguments + client = build_client + refute_nil(client.compute_request_expiry) + end + + def test_default_authorization_key_cache_max_capacity_uses_service_default + client = Privy::PrivyClient.new(app_id: "app-123", app_secret: "secret", environment: :staging) + configured = client.jwt_exchange.cache_max_capacity + assert_equal(Privy::JwtExchangeService::DEFAULT_CACHE_MAX_CAPACITY, configured) + end + + def test_authorization_key_cache_max_capacity_is_forwarded_to_jwt_exchange + client = Privy::PrivyClient.new( + app_id: "app-123", + app_secret: "secret", + environment: :staging, + authorization_key_cache_max_capacity: 7 + ) + configured = client.jwt_exchange.cache_max_capacity + assert_equal(7, configured) + end +end diff --git a/test/privy/public_api/privy_request_expiry_options_test.rb b/test/privy/public_api/privy_request_expiry_options_test.rb new file mode 100644 index 0000000..f9ba997 --- /dev/null +++ b/test/privy/public_api/privy_request_expiry_options_test.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::PrivyRequestExpiryOptionsTest < Minitest::Test + def test_build_defaults_default_ms_nil_disabled_false + opts = Privy::PrivyRequestExpiryOptions.build + assert_nil(opts.default_ms) + assert_equal(false, opts.disabled) + end + + def test_build_accepts_kwargs + opts = Privy::PrivyRequestExpiryOptions.build(default_ms: 60_000, disabled: true) + assert_equal(60_000, opts.default_ms) + assert_equal(true, opts.disabled) + end + + def test_is_a_data_value_object + opts = Privy::PrivyRequestExpiryOptions.build(default_ms: 1) + other = Privy::PrivyRequestExpiryOptions.build(default_ms: 1) + assert_equal(opts, other) # Data equality is structural + end +end diff --git a/test/privy/public_api/services/key_quorums_test.rb b/test/privy/public_api/services/key_quorums_test.rb new file mode 100644 index 0000000..d8658b2 --- /dev/null +++ b/test/privy/public_api/services/key_quorums_test.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Services::KeyQuorumsTest < Minitest::Test + extend Minitest::Serial + include WebMock::API + + BASE_URL = "https://api.staging.privy.io" + + def before_all + super + WebMock.enable! + end + + def after_all + WebMock.disable! + super + end + + def teardown + WebMock.reset! + super + end + + def build_client(**opts) + Privy::PrivyClient.new(app_id: "app-abc", app_secret: "secret", environment: :staging, **opts) + end + + def key_quorum_response_body(**overrides) + { + id: "kq-1", + authorization_keys: [], + authorization_threshold: 1.0, + display_name: nil, + user_ids: nil + }.merge(overrides).to_json + end + + def stub_json(method, url, body:) + stub_request(method, url).to_return( + status: 200, + body: body, + headers: {"content-type" => "application/json"} + ) + end + + # --- request_expiry on update ---------------------------------------------- + + def test_update_default_request_expiry_is_auto_set + stub_json(:patch, "#{BASE_URL}/v1/key_quorums/kq-1", body: key_quorum_response_body) + before = Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + build_client.key_quorums.update("kq-1", key_quorum_update_params: {authorization_threshold: 1}) + assert_requested(:patch, "#{BASE_URL}/v1/key_quorums/kq-1") do |req| + assert_in_delta(before + (15 * 60 * 1_000), req.headers["Privy-Request-Expiry"].to_i, 5_000) + end + end + + def test_update_per_call_request_expiry_overrides_default + stub_json(:patch, "#{BASE_URL}/v1/key_quorums/kq-1", body: key_quorum_response_body) + build_client.key_quorums.update( + "kq-1", + key_quorum_update_params: {authorization_threshold: 1}, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:patch, "#{BASE_URL}/v1/key_quorums/kq-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_update_disabled_options_omit_header + stub_json(:patch, "#{BASE_URL}/v1/key_quorums/kq-1", body: key_quorum_response_body) + build_client(request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true)) + .key_quorums.update("kq-1", key_quorum_update_params: {authorization_threshold: 1}) + assert_requested(:patch, "#{BASE_URL}/v1/key_quorums/kq-1") do |req| + refute(req.headers.key?("Privy-Request-Expiry")) + end + end + + def test_update_disabled_options_still_honor_explicit_override + stub_json(:patch, "#{BASE_URL}/v1/key_quorums/kq-1", body: key_quorum_response_body) + build_client(request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true)) + .key_quorums.update( + "kq-1", + key_quorum_update_params: {authorization_threshold: 1}, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:patch, "#{BASE_URL}/v1/key_quorums/kq-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + # --- request_expiry on delete ---------------------------------------------- + + def test_delete_per_call_request_expiry_overrides_default + stub_request(:delete, "#{BASE_URL}/v1/key_quorums/kq-1").to_return( + status: 200, body: '{"success":true}', headers: {"content-type" => "application/json"} + ) + build_client.key_quorums.delete("kq-1", request_expiry: 1_750_000_000_000) + assert_requested(:delete, "#{BASE_URL}/v1/key_quorums/kq-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end +end diff --git a/test/privy/public_api/services/policies_test.rb b/test/privy/public_api/services/policies_test.rb new file mode 100644 index 0000000..ab3e74a --- /dev/null +++ b/test/privy/public_api/services/policies_test.rb @@ -0,0 +1,150 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Services::PoliciesTest < Minitest::Test + extend Minitest::Serial + include WebMock::API + + BASE_URL = "https://api.staging.privy.io" + + def before_all + super + WebMock.enable! + end + + def after_all + WebMock.disable! + super + end + + def teardown + WebMock.reset! + super + end + + def build_client(**opts) + Privy::PrivyClient.new(app_id: "app-abc", app_secret: "secret", environment: :staging, **opts) + end + + def policy_response_body(**overrides) + { + id: "p-1", + chain_type: "ethereum", + created_at: 0, + name: "test policy", + owner_id: nil, + rules: [], + version: "1.0" + }.merge(overrides).to_json + end + + def stub_json(method, url, body:) + stub_request(method, url).to_return( + status: 200, + body: body, + headers: {"content-type" => "application/json"} + ) + end + + # --- request_expiry on update ----------------------------------------------- + + def test_update_default_request_expiry_is_auto_set + stub_json(:patch, "#{BASE_URL}/v1/policies/p-1", body: policy_response_body(name: "n")) + before = Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + build_client.policies.update("p-1", policy_update_params: {name: "n"}) + assert_requested(:patch, "#{BASE_URL}/v1/policies/p-1") do |req| + sent = req.headers["Privy-Request-Expiry"].to_i + assert_in_delta(before + (15 * 60 * 1_000), sent, 5_000) + end + end + + def test_update_per_call_request_expiry_overrides_default + stub_json(:patch, "#{BASE_URL}/v1/policies/p-1", body: policy_response_body(name: "n")) + build_client.policies.update( + "p-1", + policy_update_params: {name: "n"}, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:patch, "#{BASE_URL}/v1/policies/p-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_update_disabled_options_omit_header + stub_json(:patch, "#{BASE_URL}/v1/policies/p-1", body: policy_response_body(name: "n")) + build_client(request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true)) + .policies.update("p-1", policy_update_params: {name: "n"}) + assert_requested(:patch, "#{BASE_URL}/v1/policies/p-1") do |req| + refute(req.headers.key?("Privy-Request-Expiry")) + end + end + + def test_update_disabled_options_still_honor_explicit_override + stub_json(:patch, "#{BASE_URL}/v1/policies/p-1", body: policy_response_body(name: "n")) + build_client(request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true)) + .policies.update("p-1", policy_update_params: {name: "n"}, request_expiry: 1_750_000_000_000) + assert_requested(:patch, "#{BASE_URL}/v1/policies/p-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + # --- request_expiry on delete / create_rule / update_rule / delete_rule ---- + + def test_delete_per_call_request_expiry_overrides_default + stub_request(:delete, "#{BASE_URL}/v1/policies/p-1").to_return( + status: 200, body: '{"success":true}', headers: {"content-type" => "application/json"} + ) + build_client.policies.delete("p-1", request_expiry: 1_750_000_000_000) + assert_requested(:delete, "#{BASE_URL}/v1/policies/p-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_create_rule_per_call_request_expiry_overrides_default + stub_json( + :post, + "#{BASE_URL}/v1/policies/p-1/rules", + body: '{"id":"r-1","name":"n","method":"eth_sendTransaction","action":"ALLOW","conditions":[]}' + ) + build_client.policies.create_rule( + "p-1", + policy_create_rule_params: { + name: "n", method: "eth_sendTransaction", action: "ALLOW", conditions: [] + }, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:post, "#{BASE_URL}/v1/policies/p-1/rules") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_update_rule_per_call_request_expiry_overrides_default + stub_json( + :patch, + "#{BASE_URL}/v1/policies/p-1/rules/r-1", + body: '{"id":"r-1","name":"n","method":"eth_sendTransaction","action":"ALLOW","conditions":[]}' + ) + build_client.policies.update_rule( + "r-1", + policy_id: "p-1", + policy_update_rule_params: { + name: "n", method: "eth_sendTransaction", action: "ALLOW", conditions: [] + }, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:patch, "#{BASE_URL}/v1/policies/p-1/rules/r-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_delete_rule_per_call_request_expiry_overrides_default + stub_request(:delete, "#{BASE_URL}/v1/policies/p-1/rules/r-1").to_return( + status: 200, body: '{"success":true}', headers: {"content-type" => "application/json"} + ) + build_client.policies.delete_rule("r-1", policy_id: "p-1", request_expiry: 1_750_000_000_000) + assert_requested(:delete, "#{BASE_URL}/v1/policies/p-1/rules/r-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end +end diff --git a/test/privy/public_api/services/wallets_test.rb b/test/privy/public_api/services/wallets_test.rb new file mode 100644 index 0000000..467050e --- /dev/null +++ b/test/privy/public_api/services/wallets_test.rb @@ -0,0 +1,336 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Services::WalletsTest < Minitest::Test + extend Minitest::Serial + include WebMock::API + + BASE_URL = "https://api.staging.privy.io" + + def before_all + super + WebMock.enable! + end + + def after_all + WebMock.disable! + super + end + + def teardown + WebMock.reset! + super + end + + def build_client + Privy::PrivyClient.new(app_id: "app-abc", app_secret: "secret", environment: :staging) + end + + def wallet_response_body(**overrides) + { + id: "w-1", + additional_signers: [], + address: "0x0000000000000000000000000000000000000001", + chain_type: "ethereum", + created_at: 0, + policy_ids: [] + }.merge(overrides).to_json + end + + def stub_json(method, url, body:) + stub_request(method, url).to_return( + status: 200, + body: body, + headers: {"content-type" => "application/json"} + ) + end + + # --- create ----------------------------------------------------------------- + + def test_create_without_idempotency_sends_no_idempotency_header + stub_json(:post, "#{BASE_URL}/v1/wallets", body: wallet_response_body) + build_client.wallets.create(wallet_create_params: {chain_type: :ethereum}) + assert_requested(:post, "#{BASE_URL}/v1/wallets") do |req| + refute(req.headers.key?("Privy-Idempotency-Key")) + end + end + + def test_create_forwards_idempotency_key_as_header + stub_json(:post, "#{BASE_URL}/v1/wallets", body: wallet_response_body) + build_client.wallets.create(wallet_create_params: {chain_type: :ethereum}, idempotency_key: "idem-1") + assert_requested(:post, "#{BASE_URL}/v1/wallets") do |req| + assert_equal("idem-1", req.headers["Privy-Idempotency-Key"]) + end + end + + # --- update ----------------------------------------------------------------- + + def test_update_without_auth_context_sends_no_signature_header + stub_json(:patch, "#{BASE_URL}/v1/wallets/w-1", body: wallet_response_body(display_name: "new")) + build_client.wallets.update("w-1", wallet_update_params: {display_name: "new"}) + assert_requested(:patch, "#{BASE_URL}/v1/wallets/w-1") do |req| + refute(req.headers.key?("Privy-Authorization-Signature")) + end + end + + def test_update_with_auth_context_signs_canonical_payload + kp = Privy::Cryptography.generate_p256_key_pair + stub_json(:patch, "#{BASE_URL}/v1/wallets/w-1", body: wallet_response_body(display_name: "new")) + + build_client.wallets.update( + "w-1", + wallet_update_params: {display_name: "new"}, + authorization_context: Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + ) + + captured_sig = nil + captured_expiry = nil + assert_requested(:patch, "#{BASE_URL}/v1/wallets/w-1") do |req| + captured_sig = req.headers["Privy-Authorization-Signature"] + captured_expiry = req.headers["Privy-Request-Expiry"] + end + + expected_payload = Privy::Authorization.format_request_for_authorization_signature( + Privy::Authorization::WalletApiRequestSignatureInput.build( + method: :patch, + url: "#{BASE_URL}/v1/wallets/w-1", + body: {display_name: "new"}, + headers: { + "privy-app-id" => "app-abc", + "privy-request-expiry" => captured_expiry + } + ) + ) + pub = OpenSSL::PKey.read(kp.public_key.unpack1("m0")) + digest = OpenSSL::Digest.new("SHA256").digest(expected_payload) + assert( + pub.dsa_verify_asn1(digest, captured_sig.unpack1("m0")), + "signature should verify against canonical payload" + ) + end + + # --- rpc -------------------------------------------------------------------- + + RPC_RESPONSE_BODY = { + method: "personal_sign", + data: {signature: "0xdeadbeef", encoding: "hex"} + }.to_json + + def rpc_body + { + method: "personal_sign", + chain_type: "ethereum", + params: {message: "hi", encoding: "utf-8"} + } + end + + def test_rpc_without_extras_sends_no_auth_or_idempotency_header + stub_json(:post, "#{BASE_URL}/v1/wallets/w-1/rpc", body: RPC_RESPONSE_BODY) + build_client.wallets.rpc("w-1", wallet_rpc_request_body: rpc_body) + assert_requested(:post, "#{BASE_URL}/v1/wallets/w-1/rpc") do |req| + refute(req.headers.key?("Privy-Authorization-Signature")) + refute(req.headers.key?("Privy-Idempotency-Key")) + end + end + + def test_rpc_with_idempotency_key_only_sends_idempotency_header + stub_json(:post, "#{BASE_URL}/v1/wallets/w-1/rpc", body: RPC_RESPONSE_BODY) + build_client.wallets.rpc("w-1", wallet_rpc_request_body: rpc_body, idempotency_key: "idem-rpc") + assert_requested(:post, "#{BASE_URL}/v1/wallets/w-1/rpc") do |req| + assert_equal("idem-rpc", req.headers["Privy-Idempotency-Key"]) + refute(req.headers.key?("Privy-Authorization-Signature")) + end + end + + def test_rpc_with_auth_context_signs_body_and_sends_sig_header + kp = Privy::Cryptography.generate_p256_key_pair + stub_json(:post, "#{BASE_URL}/v1/wallets/w-1/rpc", body: RPC_RESPONSE_BODY) + + build_client.wallets.rpc( + "w-1", + wallet_rpc_request_body: rpc_body, + authorization_context: Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + ) + + captured_sig = nil + captured_expiry = nil + assert_requested(:post, "#{BASE_URL}/v1/wallets/w-1/rpc") do |req| + captured_sig = req.headers["Privy-Authorization-Signature"] + captured_expiry = req.headers["Privy-Request-Expiry"] + refute(req.headers.key?("Privy-Idempotency-Key")) + end + + expected_payload = Privy::Authorization.format_request_for_authorization_signature( + Privy::Authorization::WalletApiRequestSignatureInput.build( + method: :post, + url: "#{BASE_URL}/v1/wallets/w-1/rpc", + body: rpc_body, + headers: { + "privy-app-id" => "app-abc", + "privy-request-expiry" => captured_expiry + } + ) + ) + pub = OpenSSL::PKey.read(kp.public_key.unpack1("m0")) + digest = OpenSSL::Digest.new("SHA256").digest(expected_payload) + assert(pub.dsa_verify_asn1(digest, captured_sig.unpack1("m0"))) + end + + def test_rpc_with_auth_context_and_idempotency_signs_over_idempotency_header + kp = Privy::Cryptography.generate_p256_key_pair + stub_json(:post, "#{BASE_URL}/v1/wallets/w-1/rpc", body: RPC_RESPONSE_BODY) + + build_client.wallets.rpc( + "w-1", + wallet_rpc_request_body: rpc_body, + idempotency_key: "idem-both", + authorization_context: Privy::Authorization::AuthorizationContext.build( + authorization_private_keys: [kp.private_key] + ) + ) + + captured_sig = nil + captured_expiry = nil + assert_requested(:post, "#{BASE_URL}/v1/wallets/w-1/rpc") do |req| + assert_equal("idem-both", req.headers["Privy-Idempotency-Key"]) + captured_sig = req.headers["Privy-Authorization-Signature"] + captured_expiry = req.headers["Privy-Request-Expiry"] + end + + expected_payload = Privy::Authorization.format_request_for_authorization_signature( + Privy::Authorization::WalletApiRequestSignatureInput.build( + method: :post, + url: "#{BASE_URL}/v1/wallets/w-1/rpc", + body: rpc_body, + headers: { + "privy-app-id" => "app-abc", + "privy-idempotency-key" => "idem-both", + "privy-request-expiry" => captured_expiry + } + ) + ) + pub = OpenSSL::PKey.read(kp.public_key.unpack1("m0")) + digest = OpenSSL::Digest.new("SHA256").digest(expected_payload) + assert( + pub.dsa_verify_asn1(digest, captured_sig.unpack1("m0")), + "signature must cover idempotency-key header" + ) + end + + # --- request_expiry on update ---------------------------------------------- + + def test_update_default_request_expiry_is_auto_set + stub_json(:patch, "#{BASE_URL}/v1/wallets/w-1", body: wallet_response_body(display_name: "n")) + before = Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) + build_client.wallets.update("w-1", wallet_update_params: {display_name: "n"}) + assert_requested(:patch, "#{BASE_URL}/v1/wallets/w-1") do |req| + sent = req.headers["Privy-Request-Expiry"].to_i + assert_in_delta(before + (15 * 60 * 1_000), sent, 5_000) + end + end + + def test_update_per_call_request_expiry_overrides_default + stub_json(:patch, "#{BASE_URL}/v1/wallets/w-1", body: wallet_response_body(display_name: "n")) + build_client.wallets.update( + "w-1", + wallet_update_params: {display_name: "n"}, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:patch, "#{BASE_URL}/v1/wallets/w-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_update_disabled_options_omit_header + client = Privy::PrivyClient.new( + app_id: "app-abc", + app_secret: "secret", + environment: :staging, + request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true) + ) + stub_json(:patch, "#{BASE_URL}/v1/wallets/w-1", body: wallet_response_body(display_name: "n")) + client.wallets.update("w-1", wallet_update_params: {display_name: "n"}) + assert_requested(:patch, "#{BASE_URL}/v1/wallets/w-1") do |req| + refute(req.headers.key?("Privy-Request-Expiry")) + end + end + + def test_update_disabled_options_still_honor_explicit_override + client = Privy::PrivyClient.new( + app_id: "app-abc", + app_secret: "secret", + environment: :staging, + request_expiry: Privy::PrivyRequestExpiryOptions.build(disabled: true) + ) + stub_json(:patch, "#{BASE_URL}/v1/wallets/w-1", body: wallet_response_body(display_name: "n")) + client.wallets.update( + "w-1", + wallet_update_params: {display_name: "n"}, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:patch, "#{BASE_URL}/v1/wallets/w-1") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + # --- request_expiry on rpc / raw_sign / transfer --------------------------- + + RAW_SIGN_RESPONSE_BODY = { + method: "raw_sign", + data: {encoding: "hex", signature: "0xdeadbeef"} + }.to_json + + TRANSFER_RESPONSE_BODY = { + id: "wa-1", + created_at: "2026-01-01T00:00:00Z", + destination_address: "0x0000000000000000000000000000000000000001", + source_chain: "base", + status: "submitted", + type: "transfer", + wallet_id: "w-1" + }.to_json + + def test_rpc_per_call_request_expiry_overrides_default + stub_json(:post, "#{BASE_URL}/v1/wallets/w-1/rpc", body: RPC_RESPONSE_BODY) + build_client.wallets.rpc( + "w-1", + wallet_rpc_request_body: rpc_body, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:post, "#{BASE_URL}/v1/wallets/w-1/rpc") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_raw_sign_per_call_request_expiry_overrides_default + stub_json(:post, "#{BASE_URL}/v1/wallets/w-1/raw_sign", body: RAW_SIGN_RESPONSE_BODY) + build_client.wallets.raw_sign( + "w-1", + raw_sign_input: {params: {hash: "0x1234"}}, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:post, "#{BASE_URL}/v1/wallets/w-1/raw_sign") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end + + def test_transfer_per_call_request_expiry_overrides_default + stub_json(:post, "#{BASE_URL}/v1/wallets/w-1/transfer", body: TRANSFER_RESPONSE_BODY) + build_client.wallets.transfer( + "w-1", + wallet_transfer_params: { + source: {asset: "usdc", amount: "1", chain: "base"}, + destination: {address: "0x0000000000000000000000000000000000000001"} + }, + request_expiry: 1_750_000_000_000 + ) + assert_requested(:post, "#{BASE_URL}/v1/wallets/w-1/transfer") do |req| + assert_equal("1750000000000", req.headers["Privy-Request-Expiry"]) + end + end +end diff --git a/test/privy/resource_namespaces.rb b/test/privy/resource_namespaces.rb new file mode 100644 index 0000000..5d8ad4c --- /dev/null +++ b/test/privy/resource_namespaces.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Privy + module Test + module Resources + module Apps + end + + module Earn + module Ethereum + end + end + + module Ethereum + end + + module Wallets + module Earn + module Ethereum + end + end + end + end + end +end diff --git a/test/privy/resources/accounts_test.rb b/test/privy/resources/accounts_test.rb new file mode 100644 index 0000000..553d62c --- /dev/null +++ b/test/privy/resources/accounts_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::AccountsTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/aggregations_test.rb b/test/privy/resources/aggregations_test.rb new file mode 100644 index 0000000..ce8ab79 --- /dev/null +++ b/test/privy/resources/aggregations_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::AggregationsTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/analytics_test.rb b/test/privy/resources/analytics_test.rb new file mode 100644 index 0000000..a5f778e --- /dev/null +++ b/test/privy/resources/analytics_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::AnalyticsTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/apps/allowlist_test.rb b/test/privy/resources/apps/allowlist_test.rb new file mode 100644 index 0000000..b6c2797 --- /dev/null +++ b/test/privy/resources/apps/allowlist_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Test::Resources::Apps::AllowlistTest < Privy::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.apps.allowlist.create("app_id", user_invite_input: {type: :email, value: "batman@privy.io"}) + + assert_pattern do + response => Privy::AllowlistEntry + end + + assert_pattern do + response => { + id: String, + accepted_at: Float | nil, + app_id: String, + type: String, + value: String + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @privy_api.apps.allowlist.list("app_id") + + assert_pattern do + response => ^(Privy::Internal::Type::ArrayOf[Privy::AllowlistEntry]) + end + end + + def test_delete_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.apps.allowlist.delete("app_id", user_invite_input: {type: :email, value: "batman@privy.io"}) + + assert_pattern do + response => Privy::AllowlistDeletionResponse + end + + assert_pattern do + response => { + message: String + } + end + end +end diff --git a/test/privy/resources/apps_test.rb b/test/privy/resources/apps_test.rb new file mode 100644 index 0000000..e37dae5 --- /dev/null +++ b/test/privy/resources/apps_test.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::AppsTest < Privy::Test::ResourceTest + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.apps.get("app_id") + + assert_pattern do + response => Privy::AppResponse + end + + assert_pattern do + response => { + id: String, + accent_color: String | nil, + allowed_domains: ^(Privy::Internal::Type::ArrayOf[String]), + allowed_native_app_ids: ^(Privy::Internal::Type::ArrayOf[String]), + allowed_native_app_url_schemes: ^(Privy::Internal::Type::ArrayOf[String]), + allowlist_config: Privy::AppResponse::AllowlistConfig, + allowlist_enabled: Privy::Internal::Type::Boolean, + apple_oauth: Privy::Internal::Type::Boolean, + captcha_enabled: Privy::Internal::Type::Boolean, + custom_api_url: String | nil, + custom_jwt_auth: Privy::Internal::Type::Boolean, + custom_oauth_providers: ^(Privy::Internal::Type::ArrayOf[Privy::AppResponse::CustomOAuthProvider]), + data_classification: Privy::AppResponse::DataClassification, + disable_plus_emails: Privy::Internal::Type::Boolean, + discord_oauth: Privy::Internal::Type::Boolean, + email_auth: Privy::Internal::Type::Boolean, + embedded_wallet_config: Privy::EmbeddedWalletConfigSchema, + enabled_captcha_provider: Privy::AppResponse::EnabledCaptchaProvider | nil, + enforce_wallet_uis: Privy::Internal::Type::Boolean, + farcaster_auth: Privy::Internal::Type::Boolean, + farcaster_link_wallets_enabled: Privy::Internal::Type::Boolean, + fiat_on_ramp_enabled: Privy::Internal::Type::Boolean, + github_oauth: Privy::Internal::Type::Boolean, + google_oauth: Privy::Internal::Type::Boolean, + guest_auth: Privy::Internal::Type::Boolean, + icon_url: String | nil, + instagram_oauth: Privy::Internal::Type::Boolean, + legacy_wallet_ui_config: Privy::Internal::Type::Boolean, + line_oauth: Privy::Internal::Type::Boolean, + linkedin_oauth: Privy::Internal::Type::Boolean, + logo_url: String | nil, + max_linked_wallets_per_user: Float | nil, + mfa_methods: ^(Privy::Internal::Type::ArrayOf[enum: Privy::AppResponse::MfaMethod]), + name: String, + passkey_auth: Privy::Internal::Type::Boolean, + passkeys_for_signup_enabled: Privy::Internal::Type::Boolean, + privacy_policy_url: String | nil, + require_users_accept_terms: Privy::Internal::Type::Boolean | nil, + show_wallet_login_first: Privy::Internal::Type::Boolean, + smart_wallet_config: Privy::SmartWalletConfiguration, + sms_auth: Privy::Internal::Type::Boolean, + solana_wallet_auth: Privy::Internal::Type::Boolean, + spotify_oauth: Privy::Internal::Type::Boolean, + telegram_auth: Privy::Internal::Type::Boolean, + telegram_oauth: Privy::Internal::Type::Boolean, + terms_and_conditions_url: String | nil, + theme: String, + tiktok_oauth: Privy::Internal::Type::Boolean, + twitch_oauth: Privy::Internal::Type::Boolean, + twitter_oauth: Privy::Internal::Type::Boolean, + twitter_oauth_on_mobile_enabled: Privy::Internal::Type::Boolean, + verification_key: String, + wallet_auth: Privy::Internal::Type::Boolean, + wallet_connect_cloud_project_id: String | nil, + whatsapp_enabled: Privy::Internal::Type::Boolean, + captcha_site_key: String | nil, + funding_config: Privy::FundingConfigResponseSchema | nil, + telegram_auth_config: Privy::TelegramAuthConfigSchema | nil + } + end + end + + def test_get_gas_spend_required_params + skip("Mock server tests are disabled") + + response = @privy_api.apps.get_gas_spend(end_timestamp: 0, start_timestamp: 0, wallet_ids: ["string"]) + + assert_pattern do + response => Privy::GasSpendResponseBody + end + + assert_pattern do + response => { + currency: Privy::GasSpendCurrency, + value: String + } + end + end + + def test_get_test_credentials + skip("Mock server tests are disabled") + + response = @privy_api.apps.get_test_credentials("app_id") + + assert_pattern do + response => Privy::TestAccountsResponse + end + + assert_pattern do + response => { + data: ^(Privy::Internal::Type::ArrayOf[Privy::TestAccount]) + } + end + end +end diff --git a/test/privy/resources/client_auth_test.rb b/test/privy/resources/client_auth_test.rb new file mode 100644 index 0000000..1d2032c --- /dev/null +++ b/test/privy/resources/client_auth_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::ClientAuthTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/cross_app_test.rb b/test/privy/resources/cross_app_test.rb new file mode 100644 index 0000000..e72ad53 --- /dev/null +++ b/test/privy/resources/cross_app_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::CrossAppTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/embedded_wallets_test.rb b/test/privy/resources/embedded_wallets_test.rb new file mode 100644 index 0000000..0476286 --- /dev/null +++ b/test/privy/resources/embedded_wallets_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::EmbeddedWalletsTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/funding_test.rb b/test/privy/resources/funding_test.rb new file mode 100644 index 0000000..b310699 --- /dev/null +++ b/test/privy/resources/funding_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::FundingTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/intents_test.rb b/test/privy/resources/intents_test.rb new file mode 100644 index 0000000..a091916 --- /dev/null +++ b/test/privy/resources/intents_test.rb @@ -0,0 +1,158 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::IntentsTest < Privy::Test::ResourceTest + def test_list + skip("Mock server tests are disabled") + + response = @privy_api.intents.list + + assert_pattern do + response => Privy::Internal::Cursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Privy::IntentResponse + end + + assert_pattern do + case row + in Privy::RpcIntentResponse + in Privy::TransferIntentResponse + in Privy::WalletIntentResponse + in Privy::PolicyIntentResponse + in Privy::RuleIntentResponse + in Privy::KeyQuorumIntentResponse + end + end + end + + def test_create_policy_rule_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.intents.create_policy_rule( + "policy_id", + action: :ALLOW, + conditions: [{field: :to, field_source: :ethereum_transaction, operator: :eq, value: "string"}], + method_: :eth_sendTransaction, + name: "x" + ) + + assert_pattern do + response => Privy::RuleIntentResponse + end + end + + def test_delete_policy_rule_required_params + skip("Mock server tests are disabled") + + response = @privy_api.intents.delete_policy_rule("rule_id", policy_id: "policy_id") + + assert_pattern do + response => Privy::RuleIntentResponse + end + end + + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.intents.get("intent_id") + + assert_pattern do + response => Privy::IntentResponse + end + + assert_pattern do + case response + in Privy::RpcIntentResponse + in Privy::TransferIntentResponse + in Privy::WalletIntentResponse + in Privy::PolicyIntentResponse + in Privy::RuleIntentResponse + in Privy::KeyQuorumIntentResponse + end + end + end + + def test_rpc_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.intents.rpc( + "wallet_id", + wallet_rpc_request_body: {method: :eth_signTransaction, params: {transaction: {}}} + ) + + assert_pattern do + response => Privy::RpcIntentResponse + end + end + + def test_transfer_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.intents.transfer( + "wallet_id", + destination: {address: "0xB00F0759DbeeF5E543Cc3E3B07A6442F5f3928a2"}, + source: {amount: "10.5", asset: "usdc", chain: "base"} + ) + + assert_pattern do + response => Privy::TransferIntentResponse + end + end + + def test_update_key_quorum + skip("Mock server tests are disabled") + + response = @privy_api.intents.update_key_quorum("key_quorum_id") + + assert_pattern do + response => Privy::KeyQuorumIntentResponse + end + end + + def test_update_policy + skip("Mock server tests are disabled") + + response = @privy_api.intents.update_policy("policy_id") + + assert_pattern do + response => Privy::PolicyIntentResponse + end + end + + def test_update_policy_rule_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.intents.update_policy_rule( + "rule_id", + policy_id: "policy_id", + action: :ALLOW, + conditions: [{field: :to, field_source: :ethereum_transaction, operator: :eq, value: "string"}], + method_: :eth_sendTransaction, + name: "x" + ) + + assert_pattern do + response => Privy::RuleIntentResponse + end + end + + def test_update_wallet + skip("Mock server tests are disabled") + + response = @privy_api.intents.update_wallet("wallet_id") + + assert_pattern do + response => Privy::WalletIntentResponse + end + end +end diff --git a/test/privy/resources/key_quorums_test.rb b/test/privy/resources/key_quorums_test.rb new file mode 100644 index 0000000..f6d8238 --- /dev/null +++ b/test/privy/resources/key_quorums_test.rb @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::KeyQuorumsTest < Privy::Test::ResourceTest + def test_create + skip("Mock server tests are disabled") + + response = @privy_api.key_quorums.create + + assert_pattern do + response => Privy::KeyQuorum + end + + assert_pattern do + response => { + id: String, + authorization_keys: ^(Privy::Internal::Type::ArrayOf[Privy::KeyQuorum::AuthorizationKey]), + authorization_threshold: Float | nil, + display_name: String | nil, + user_ids: ^(Privy::Internal::Type::ArrayOf[String]) | nil, + key_quorum_ids: ^(Privy::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @privy_api.key_quorums.update("string") + + assert_pattern do + response => Privy::KeyQuorum + end + + assert_pattern do + response => { + id: String, + authorization_keys: ^(Privy::Internal::Type::ArrayOf[Privy::KeyQuorum::AuthorizationKey]), + authorization_threshold: Float | nil, + display_name: String | nil, + user_ids: ^(Privy::Internal::Type::ArrayOf[String]) | nil, + key_quorum_ids: ^(Privy::Internal::Type::ArrayOf[String]) | nil + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @privy_api.key_quorums.delete("string") + + assert_pattern do + response => Privy::SuccessResponse + end + + assert_pattern do + response => { + success: Privy::Internal::Type::Boolean + } + end + end + + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.key_quorums.get("string") + + assert_pattern do + response => Privy::KeyQuorum + end + + assert_pattern do + response => { + id: String, + authorization_keys: ^(Privy::Internal::Type::ArrayOf[Privy::KeyQuorum::AuthorizationKey]), + authorization_threshold: Float | nil, + display_name: String | nil, + user_ids: ^(Privy::Internal::Type::ArrayOf[String]) | nil, + key_quorum_ids: ^(Privy::Internal::Type::ArrayOf[String]) | nil + } + end + end +end diff --git a/test/privy/resources/kraken_embed_test.rb b/test/privy/resources/kraken_embed_test.rb new file mode 100644 index 0000000..4cc295a --- /dev/null +++ b/test/privy/resources/kraken_embed_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::KrakenEmbedTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/organizations_test.rb b/test/privy/resources/organizations_test.rb new file mode 100644 index 0000000..a473e4e --- /dev/null +++ b/test/privy/resources/organizations_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::OrganizationsTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/policies_test.rb b/test/privy/resources/policies_test.rb new file mode 100644 index 0000000..5de57dc --- /dev/null +++ b/test/privy/resources/policies_test.rb @@ -0,0 +1,193 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::PoliciesTest < Privy::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.policies.create( + chain_type: :ethereum, + name: "x", + rules: [ + { + action: :ALLOW, + conditions: [{field: :to, field_source: :ethereum_transaction, operator: :eq, value: "string"}], + method: :eth_sendTransaction, + name: "x" + } + ], + version: :"1.0" + ) + + assert_pattern do + response => Privy::Policy + end + + assert_pattern do + response => { + id: String, + chain_type: Privy::WalletChainType, + created_at: Float, + name: String, + owner_id: String | nil, + rules: ^(Privy::Internal::Type::ArrayOf[Privy::PolicyRuleResponse]), + version: Privy::Policy::Version + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @privy_api.policies.update("xxxxxxxxxxxxxxxxxxxxxxxx") + + assert_pattern do + response => Privy::Policy + end + + assert_pattern do + response => { + id: String, + chain_type: Privy::WalletChainType, + created_at: Float, + name: String, + owner_id: String | nil, + rules: ^(Privy::Internal::Type::ArrayOf[Privy::PolicyRuleResponse]), + version: Privy::Policy::Version + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @privy_api.policies.delete("xxxxxxxxxxxxxxxxxxxxxxxx") + + assert_pattern do + response => Privy::SuccessResponse + end + + assert_pattern do + response => { + success: Privy::Internal::Type::Boolean + } + end + end + + def test_create_rule_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.policies.create_rule( + "xxxxxxxxxxxxxxxxxxxxxxxx", + action: :ALLOW, + conditions: [{field: :to, field_source: :ethereum_transaction, operator: :eq, value: "string"}], + method_: :eth_sendTransaction, + name: "x" + ) + + assert_pattern do + response => Privy::PolicyRuleResponse + end + + assert_pattern do + response => { + id: String, + action: Privy::PolicyAction, + conditions: ^(Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition]), + method_: Privy::PolicyMethod, + name: String + } + end + end + + def test_delete_rule_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.policies.delete_rule("xxxxxxxxxxxxxxxxxxxxxxxx", policy_id: "xxxxxxxxxxxxxxxxxxxxxxxx") + + assert_pattern do + response => Privy::SuccessResponse + end + + assert_pattern do + response => { + success: Privy::Internal::Type::Boolean + } + end + end + + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.policies.get("xxxxxxxxxxxxxxxxxxxxxxxx") + + assert_pattern do + response => Privy::Policy + end + + assert_pattern do + response => { + id: String, + chain_type: Privy::WalletChainType, + created_at: Float, + name: String, + owner_id: String | nil, + rules: ^(Privy::Internal::Type::ArrayOf[Privy::PolicyRuleResponse]), + version: Privy::Policy::Version + } + end + end + + def test_get_rule_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.policies.get_rule("xxxxxxxxxxxxxxxxxxxxxxxx", policy_id: "xxxxxxxxxxxxxxxxxxxxxxxx") + + assert_pattern do + response => Privy::PolicyRuleResponse + end + + assert_pattern do + response => { + id: String, + action: Privy::PolicyAction, + conditions: ^(Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition]), + method_: Privy::PolicyMethod, + name: String + } + end + end + + def test_update_rule_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.policies.update_rule( + "xxxxxxxxxxxxxxxxxxxxxxxx", + policy_id: "xxxxxxxxxxxxxxxxxxxxxxxx", + action: :ALLOW, + conditions: [{field: :to, field_source: :ethereum_transaction, operator: :eq, value: "string"}], + method_: :eth_sendTransaction, + name: "x" + ) + + assert_pattern do + response => Privy::PolicyRuleResponse + end + + assert_pattern do + response => { + id: String, + action: Privy::PolicyAction, + conditions: ^(Privy::Internal::Type::ArrayOf[union: Privy::PolicyCondition]), + method_: Privy::PolicyMethod, + name: String + } + end + end +end diff --git a/test/privy/resources/shared_test.rb b/test/privy/resources/shared_test.rb new file mode 100644 index 0000000..642221b --- /dev/null +++ b/test/privy/resources/shared_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::SharedTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/swaps_test.rb b/test/privy/resources/swaps_test.rb new file mode 100644 index 0000000..18c1e68 --- /dev/null +++ b/test/privy/resources/swaps_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::SwapsTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/transactions_test.rb b/test/privy/resources/transactions_test.rb new file mode 100644 index 0000000..8ad73f3 --- /dev/null +++ b/test/privy/resources/transactions_test.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::TransactionsTest < Privy::Test::ResourceTest + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.transactions.get("transaction_id") + + assert_pattern do + response => Privy::Transaction + end + + assert_pattern do + response => { + id: String, + caip2: String, + created_at: Float, + status: Privy::Transaction::Status, + transaction_hash: String | nil, + wallet_id: String, + reference_id: String | nil, + sponsored: Privy::Internal::Type::Boolean | nil, + user_operation_hash: String | nil + } + end + end +end diff --git a/test/privy/resources/users_test.rb b/test/privy/resources/users_test.rb new file mode 100644 index 0000000..ebc11d2 --- /dev/null +++ b/test/privy/resources/users_test.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::UsersTest < Privy::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.create(linked_accounts: [{address: "tom.bombadill@privy.io", type: :email}]) + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @privy_api.users.list + + assert_pattern do + response => Privy::Internal::Cursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Privy::User + end + + assert_pattern do + row => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_delete + skip("Mock server tests are disabled") + + response = @privy_api.users.delete("user_id") + + assert_pattern do + response => nil + end + end + + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.users.get("user_id") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_custom_auth_id_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_custom_auth_id(custom_user_id: "custom_user_id") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_discord_username_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_discord_username(username: "username") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_email_address_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_email_address(address: "dev@stainless.com") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_farcaster_id_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_farcaster_id(fid: 0) + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_github_username_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_github_username(username: "username") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_phone_number_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_phone_number(number: "number") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_smart_wallet_address_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_smart_wallet_address(address: "address") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_telegram_user_id_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_telegram_user_id(telegram_user_id: "telegram_user_id") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_telegram_username_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_telegram_username(username: "username") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_twitter_subject_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_twitter_subject(subject: "subject") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_twitter_username_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_twitter_username(username: "username") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_get_by_wallet_address_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.get_by_wallet_address(address: "address") + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_pregenerate_wallets_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.pregenerate_wallets("user_id", wallets: [{chain_type: :ethereum}]) + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_search_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.search(body: {searchTerm: "searchTerm"}) + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_set_custom_metadata_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.set_custom_metadata("user_id", custom_metadata: {key: "value"}) + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end + + def test_unlink_linked_account_required_params + skip("Mock server tests are disabled") + + response = @privy_api.users.unlink_linked_account("user_id", handle: "test@test.com", type: :email) + + assert_pattern do + response => Privy::User + end + + assert_pattern do + response => { + id: String, + created_at: Float, + has_accepted_terms: Privy::Internal::Type::Boolean, + is_guest: Privy::Internal::Type::Boolean, + linked_accounts: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedAccount]), + mfa_methods: ^(Privy::Internal::Type::ArrayOf[union: Privy::LinkedMfaMethod]), + custom_metadata: ^(Privy::Internal::Type::HashOf[union: Privy::CustomMetadataItem]) | nil + } + end + end +end diff --git a/test/privy/resources/wallet_actions_test.rb b/test/privy/resources/wallet_actions_test.rb new file mode 100644 index 0000000..7b5066c --- /dev/null +++ b/test/privy/resources/wallet_actions_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::WalletActionsTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/wallets/balance_test.rb b/test/privy/resources/wallets/balance_test.rb new file mode 100644 index 0000000..f9e49d2 --- /dev/null +++ b/test/privy/resources/wallets/balance_test.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Test::Resources::Wallets::BalanceTest < Privy::Test::ResourceTest + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.wallets.balance.get("wallet_id") + + assert_pattern do + response => Privy::Models::Wallets::BalanceGetResponse + end + + assert_pattern do + response => { + balances: ^(Privy::Internal::Type::ArrayOf[Privy::Models::Wallets::BalanceGetResponse::Balance]) + } + end + end +end diff --git a/test/privy/resources/wallets/earn/ethereum/incentive_test.rb b/test/privy/resources/wallets/earn/ethereum/incentive_test.rb new file mode 100644 index 0000000..647fe5e --- /dev/null +++ b/test/privy/resources/wallets/earn/ethereum/incentive_test.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require_relative "../../../../test_helper" + +class Privy::Test::Resources::Wallets::Earn::Ethereum::IncentiveTest < Privy::Test::ResourceTest + def test__claim_required_params + skip("Mock server tests are disabled") + + response = @privy_api.wallets.earn.ethereum.incentive._claim("wallet_id", chain: "base") + + assert_pattern do + response => Privy::EarnIncentiveClaimActionResponse + end + + assert_pattern do + response => { + id: String, + chain: String, + created_at: Time, + rewards: ^(Privy::Internal::Type::ArrayOf[Privy::EarnIncetiveClaimRewardEntry]) | nil, + status: Privy::WalletActionStatus, + type: Privy::EarnIncentiveClaimActionResponse::Type, + wallet_id: String, + failure_reason: Privy::FailureReason | nil, + steps: ^(Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep]) | nil + } + end + end +end diff --git a/test/privy/resources/wallets/earn/ethereum_test.rb b/test/privy/resources/wallets/earn/ethereum_test.rb new file mode 100644 index 0000000..aec3ec8 --- /dev/null +++ b/test/privy/resources/wallets/earn/ethereum_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +require_relative "../../../test_helper" + +class Privy::Test::Resources::Wallets::Earn::EthereumTest < Privy::Test::ResourceTest + def test__deposit_required_params + skip("Mock server tests are disabled") + + response = @privy_api.wallets.earn.ethereum._deposit("wallet_id", vault_id: "cm7oxq1el000e11o8iwp7d0d0") + + assert_pattern do + response => Privy::EarnDepositActionResponse + end + + assert_pattern do + response => { + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: String | nil, + status: Privy::WalletActionStatus, + type: Privy::EarnDepositActionResponse::Type, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String | nil, + asset: String | nil, + decimals: Integer | nil, + failure_reason: Privy::FailureReason | nil, + steps: ^(Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep]) | nil + } + end + end + + def test__withdraw_required_params + skip("Mock server tests are disabled") + + response = @privy_api.wallets.earn.ethereum._withdraw("wallet_id", vault_id: "cm7oxq1el000e11o8iwp7d0d0") + + assert_pattern do + response => Privy::EarnWithdrawActionResponse + end + + assert_pattern do + response => { + id: String, + asset_address: String, + caip2: String, + created_at: Time, + raw_amount: String, + share_amount: String | nil, + status: Privy::WalletActionStatus, + type: Privy::EarnWithdrawActionResponse::Type, + vault_address: String, + vault_id: String, + wallet_id: String, + amount: String | nil, + asset: String | nil, + decimals: Integer | nil, + failure_reason: Privy::FailureReason | nil, + steps: ^(Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep]) | nil + } + end + end +end diff --git a/test/privy/resources/wallets/earn_test.rb b/test/privy/resources/wallets/earn_test.rb new file mode 100644 index 0000000..5762a47 --- /dev/null +++ b/test/privy/resources/wallets/earn_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Test::Resources::Wallets::EarnTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/wallets/transactions_test.rb b/test/privy/resources/wallets/transactions_test.rb new file mode 100644 index 0000000..f6f0f63 --- /dev/null +++ b/test/privy/resources/wallets/transactions_test.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require_relative "../../test_helper" + +class Privy::Test::Resources::Wallets::TransactionsTest < Privy::Test::ResourceTest + def test_get_required_params + skip("Mock server tests are disabled") + + response = @privy_api.wallets.transactions.get("wallet_id", chain: :ethereum) + + assert_pattern do + response => Privy::Models::Wallets::TransactionGetResponse + end + + assert_pattern do + response => { + next_cursor: String | nil, + transactions: ^(Privy::Internal::Type::ArrayOf[Privy::Models::Wallets::TransactionGetResponse::Transaction]) + } + end + end +end diff --git a/test/privy/resources/wallets_test.rb b/test/privy/resources/wallets_test.rb new file mode 100644 index 0000000..07416e5 --- /dev/null +++ b/test/privy/resources/wallets_test.rb @@ -0,0 +1,422 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::WalletsTest < Privy::Test::ResourceTest + def test_create_required_params + skip("Mock server tests are disabled") + + response = @privy_api.wallets.create(chain_type: :ethereum) + + assert_pattern do + response => Privy::Wallet + end + + assert_pattern do + response => { + id: String, + additional_signers: ^(Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem]), + address: String, + chain_type: Privy::WalletChainType, + created_at: Float, + exported_at: Float | nil, + imported_at: Float | nil, + owner_id: String | nil, + policy_ids: ^(Privy::Internal::Type::ArrayOf[String]), + authorization_threshold: Float | nil, + custody: Privy::WalletCustodian | nil, + display_name: String | nil, + external_id: String | nil, + public_key: String | nil + } + end + end + + def test_update + skip("Mock server tests are disabled") + + response = @privy_api.wallets.update("wallet_id") + + assert_pattern do + response => Privy::Wallet + end + + assert_pattern do + response => { + id: String, + additional_signers: ^(Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem]), + address: String, + chain_type: Privy::WalletChainType, + created_at: Float, + exported_at: Float | nil, + imported_at: Float | nil, + owner_id: String | nil, + policy_ids: ^(Privy::Internal::Type::ArrayOf[String]), + authorization_threshold: Float | nil, + custody: Privy::WalletCustodian | nil, + display_name: String | nil, + external_id: String | nil, + public_key: String | nil + } + end + end + + def test_list + skip("Mock server tests are disabled") + + response = @privy_api.wallets.list + + assert_pattern do + response => Privy::Internal::Cursor + end + + row = response.to_enum.first + return if row.nil? + + assert_pattern do + row => Privy::Wallet + end + + assert_pattern do + row => { + id: String, + additional_signers: ^(Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem]), + address: String, + chain_type: Privy::WalletChainType, + created_at: Float, + exported_at: Float | nil, + imported_at: Float | nil, + owner_id: String | nil, + policy_ids: ^(Privy::Internal::Type::ArrayOf[String]), + authorization_threshold: Float | nil, + custody: Privy::WalletCustodian | nil, + display_name: String | nil, + external_id: String | nil, + public_key: String | nil + } + end + end + + def test__init_import_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets._init_import( + body: { + address: "0xF1DBff66C993EE895C8cb176c30b07A559d76496", + chain_type: :ethereum, + encryption_type: :HPKE, + entropy_type: :"private-key" + } + ) + + assert_pattern do + response => Privy::Models::WalletInitImportResponse + end + + assert_pattern do + response => { + encryption_public_key: String, + encryption_type: Privy::HpkeEncryption + } + end + end + + def test__submit_import_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets._submit_import( + wallet: { + address: "0xF1DBff66C993EE895C8cb176c30b07A559d76496", + chain_type: :ethereum, + ciphertext: "PRoRXygG+YYSDBXjCopNYZmx8Z6nvdl1D0lpePTYZdZI2VGfK+LkFt+GlEJqdoi9", + encapsulated_key: "BOhR6xITDt5THJawHHJKrKdI9CBr2M/SDWzZZAaOW4gCMsSpC65U007WyKiwuuOVAo1BNm4YgcBBROuMmyIZXZk=", + encryption_type: :HPKE, + entropy_type: :"private-key" + } + ) + + assert_pattern do + response => Privy::Wallet + end + + assert_pattern do + response => { + id: String, + additional_signers: ^(Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem]), + address: String, + chain_type: Privy::WalletChainType, + created_at: Float, + exported_at: Float | nil, + imported_at: Float | nil, + owner_id: String | nil, + policy_ids: ^(Privy::Internal::Type::ArrayOf[String]), + authorization_threshold: Float | nil, + custody: Privy::WalletCustodian | nil, + display_name: String | nil, + external_id: String | nil, + public_key: String | nil + } + end + end + + def test__transfer_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets._transfer( + "wallet_id", + destination: {address: "0xB00F0759DbeeF5E543Cc3E3B07A6442F5f3928a2"}, + source: {amount: "10.5", asset: "usdc", chain: "base"} + ) + + assert_pattern do + response => Privy::TransferActionResponse + end + + assert_pattern do + response => { + id: String, + created_at: Time, + destination_address: String, + source_chain: String, + status: Privy::WalletActionStatus, + type: Privy::TransferActionResponse::Type, + wallet_id: String, + destination_amount: String | nil, + destination_asset: String | nil, + destination_chain: String | nil, + failure_reason: Privy::FailureReason | nil, + source_amount: String | nil, + source_asset: String | nil, + source_asset_address: String | nil, + source_asset_decimals: Integer | nil, + steps: ^(Privy::Internal::Type::ArrayOf[union: Privy::WalletActionStep]) | nil + } + end + end + + def test_authenticate_with_jwt_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets.authenticate_with_jwt( + encryption_type: :HPKE, + recipient_public_key: "DAQcDQgAEx4aoeD72yykviK+fckqE2CItVIGn1rCnvCXZ1HgpOcMEMialRmTrqIK4oZlYd1", + user_jwt: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.KMUFsIDTnFmyG3nMiGM6H9FNFUROf3wh7SmqJp-QV30" + ) + + assert_pattern do + response => Privy::WalletAuthenticateWithJwtResponse + end + + assert_pattern do + case response + in Privy::WalletAuthenticateWithJwtResponse::WithEncryption + in Privy::WalletAuthenticateWithJwtResponse::WithoutEncryption + end + end + end + + def test_create_wallets_with_recovery_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets.create_wallets_with_recovery( + primary_signer: {subject_id: "cm7oxq1el000e11o8iwp7d0d0"}, + recovery_user: {linked_accounts: [{address: "john@doe.com", type: :email}]}, + wallets: [{chain_type: :ethereum}, {chain_type: :solana}] + ) + + assert_pattern do + response => Privy::WalletCreateWalletsWithRecoveryResponse + end + + assert_pattern do + response => { + recovery_user_id: String, + wallets: ^(Privy::Internal::Type::ArrayOf[Privy::Wallet]) + } + end + end + + def test_export_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets.export( + "wallet_id", + encryption_type: :HPKE, + recipient_public_key: "BDAZLOIdTaPycEYkgG0MvCzbIKJLli/yWkAV5yCa9yOsZ4JsrLweA5MnP8YIiY4k/RRzC+APhhO+P+Hoz/rt7Go=" + ) + + assert_pattern do + response => Privy::WalletExportResponseBody + end + + assert_pattern do + response => { + ciphertext: String, + encapsulated_key: String, + encryption_type: Privy::HpkeEncryption + } + end + end + + def test_get + skip("Mock server tests are disabled") + + response = @privy_api.wallets.get("wallet_id") + + assert_pattern do + response => Privy::Wallet + end + + assert_pattern do + response => { + id: String, + additional_signers: ^(Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem]), + address: String, + chain_type: Privy::WalletChainType, + created_at: Float, + exported_at: Float | nil, + imported_at: Float | nil, + owner_id: String | nil, + policy_ids: ^(Privy::Internal::Type::ArrayOf[String]), + authorization_threshold: Float | nil, + custody: Privy::WalletCustodian | nil, + display_name: String | nil, + external_id: String | nil, + public_key: String | nil + } + end + end + + def test_get_wallet_by_address_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets.get_wallet_by_address(address: "0xF1DBff66C993EE895C8cb176c30b07A559d76496") + + assert_pattern do + response => Privy::Wallet + end + + assert_pattern do + response => { + id: String, + additional_signers: ^(Privy::Internal::Type::ArrayOf[Privy::WalletAdditionalSignerItem]), + address: String, + chain_type: Privy::WalletChainType, + created_at: Float, + exported_at: Float | nil, + imported_at: Float | nil, + owner_id: String | nil, + policy_ids: ^(Privy::Internal::Type::ArrayOf[String]), + authorization_threshold: Float | nil, + custody: Privy::WalletCustodian | nil, + display_name: String | nil, + external_id: String | nil, + public_key: String | nil + } + end + end + + def test_raw_sign_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets.raw_sign( + "wallet_id", + params: { + bytes: "0a0234ea220809701d7a17a77e04408093e981a6335a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a15417009bf59e27d2031a23a61e1590289fc3d21b3cd121541132b98ed6fb80a2d45f177cdef091ae2d9dc115418e80770a0bee581a633", + encoding: :hex, + hash_function: :sha256 + } + ) + + assert_pattern do + response => Privy::RawSignResponse + end + + assert_pattern do + response => { + data: Privy::RawSignResponseData, + method_: Privy::RawSignResponse::Method + } + end + end + + def test_rpc_required_params + skip("Mock server tests are disabled") + + response = + @privy_api.wallets.rpc( + "wallet_id", + wallet_rpc_request_body: { + caip2: "eip155:8453", + method: :eth_sendTransaction, + params: {transaction: {}} + } + ) + + assert_pattern do + response => Privy::WalletRpcResponse + end + + assert_pattern do + case response + in Privy::EthereumPersonalSignRpcResponse + in Privy::EthereumSignTypedDataRpcResponse + in Privy::EthereumSignTransactionRpcResponse + in Privy::EthereumSendTransactionRpcResponse + in Privy::EthereumSignUserOperationRpcResponse + in Privy::EthereumSign7702AuthorizationRpcResponse + in Privy::EthereumSecp256k1SignRpcResponse + in Privy::EthereumSendCallsRpcResponse + in Privy::SolanaSignMessageRpcResponse + in Privy::SolanaSignTransactionRpcResponse + in Privy::SolanaSignAndSendTransactionRpcResponse + in Privy::SparkTransferRpcResponse + in Privy::SparkGetBalanceRpcResponse + in Privy::SparkTransferTokensRpcResponse + in Privy::SparkGetStaticDepositAddressRpcResponse + in Privy::SparkGetClaimStaticDepositQuoteRpcResponse + in Privy::SparkClaimStaticDepositRpcResponse + in Privy::SparkCreateLightningInvoiceRpcResponse + in Privy::SparkPayLightningInvoiceRpcResponse + in Privy::SparkSignMessageWithIdentityKeyRpcResponse + in Privy::ExportPrivateKeyRpcResponse + in Privy::ExportSeedPhraseRpcResponse + end + end + + assert_pattern do + case response + in {method_: :personal_sign, data: Privy::EthereumPersonalSignRpcResponseData} + in {method_: :eth_signTypedData_v4, data: Privy::EthereumSignTypedDataRpcResponseData} + in {method_: :eth_signTransaction, data: Privy::EthereumSignTransactionRpcResponseData} + in {method_: :eth_sendTransaction, data: Privy::EthereumSendTransactionRpcResponseData} + in {method_: :eth_signUserOperation, data: Privy::EthereumSignUserOperationRpcResponseData} + in {method_: :eth_sign7702Authorization, data: Privy::EthereumSign7702AuthorizationRpcResponseData} + in {method_: :secp256k1_sign, data: Privy::EthereumSecp256k1SignRpcResponseData} + in {method_: :wallet_sendCalls, data: Privy::EthereumSendCallsRpcResponseData} + in {method_: :signMessage, data: Privy::SolanaSignMessageRpcResponseData} + in {method_: :signTransaction, data: Privy::SolanaSignTransactionRpcResponseData} + in {method_: :signAndSendTransaction, data: Privy::SolanaSignAndSendTransactionRpcResponseData} + in {method_: :transfer, data: Privy::SparkTransfer | nil} + in {method_: :getBalance, data: Privy::SparkBalance | nil} + in {method_: :transferTokens, data: Privy::SparkTransferTokensRpcResponseData | nil} + in {method_: :getStaticDepositAddress, data: Privy::SparkGetStaticDepositAddressRpcResponseData | nil} + in {method_: :getClaimStaticDepositQuote, data: Privy::SparkGetClaimStaticDepositQuoteRpcResponseData | nil} + in {method_: :claimStaticDeposit, data: Privy::SparkClaimStaticDepositRpcResponseData | nil} + in {method_: :createLightningInvoice, data: Privy::SparkLightningReceiveRequest | nil} + in {method_: :payLightningInvoice, data: Privy::SparkPayLightningInvoiceRpcResponse::Data | nil} + in {method_: :signMessageWithIdentityKey, data: Privy::SparkSignMessageWithIdentityKeyRpcResponseData | nil} + in {method_: :exportPrivateKey, data: Privy::PrivateKeyExportInput} + in {method_: :exportSeedPhrase, data: Privy::SeedPhraseExportResponse} + end + end + end +end diff --git a/test/privy/resources/webhooks_test.rb b/test/privy/resources/webhooks_test.rb new file mode 100644 index 0000000..07b5cbb --- /dev/null +++ b/test/privy/resources/webhooks_test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::WebhooksTest < Privy::Test::ResourceTest +end diff --git a/test/privy/resources/yield__test.rb b/test/privy/resources/yield__test.rb new file mode 100644 index 0000000..9bee992 --- /dev/null +++ b/test/privy/resources/yield__test.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +class Privy::Test::Resources::YieldTest < Privy::Test::ResourceTest +end diff --git a/test/privy/test_helper.rb b/test/privy/test_helper.rb new file mode 100644 index 0000000..4c78fff --- /dev/null +++ b/test/privy/test_helper.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +# Requiring this file from each test file ensures we always do the following, even +# when running a single-file test: +# - Load the whole gem (as one would in production) +# - Define shared testing namespace so that we don't need to indent test files as much +# - Setting up testing dependencies + +require "digest" +require "singleton" + +require "async" +require "minitest/autorun" +require "minitest/focus" +require "minitest/hooks/test" +require "minitest/proveit" +require "minitest/rg" +require "webmock" + +require_relative "../../lib/privy" +require_relative "resource_namespaces" + +module Kernel + alias_method :_sleep, :sleep + + def sleep(secs) + case Thread.current.thread_variable_get(:mock_sleep) + in Array => counter + counter << secs + secs + else + _sleep(secs) + end + end +end + +class Time + class << self + alias_method :_now, :now + end + + def self.now = Thread.current.thread_variable_get(:time_now) || _now +end + +class Privy::Test::SingletonClient < Privy::Client + include Singleton + + TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") + + def initialize + super( + base_url: Privy::Test::SingletonClient::TEST_API_BASE_URL, + app_id: "My App ID", + app_secret: "My App Secret" + ) + end +end + +module Minitest::Serial + def test_order = :random + + def run_one_method(...) = Minitest::Runnable.run_one_method(...) +end + +class Minitest::Test + include Minitest::Hooks + + make_my_diffs_pretty! + parallelize_me! + prove_it! +end + +class Privy::Test::ResourceTest < Minitest::Test + def async? + return @async unless @async.nil? + @async = Digest::SHA256.hexdigest(self.class.name).to_i(16).odd? + end + + def before_all + super + @privy_api = Privy::Test::SingletonClient.instance + end + + def around_all = async? ? Sync { super } : super + + def around = async? ? Async { super }.wait : super +end + +module WebMock + AssertionFailure.error_class = Minitest::Assertion +end