diff --git a/packages/waas/src/auth.ts b/packages/waas/src/auth.ts index 5ff4b606b..a27dc2826 100644 --- a/packages/waas/src/auth.ts +++ b/packages/waas/src/auth.ts @@ -18,13 +18,16 @@ import { SignedIntent, SignMessageArgs, getTimeDrift, - updateTimeDrift + updateTimeDrift, + AdoptChildWalletArgs } from './intents' import { FeeOptionsResponse, + isChildWalletAdoptedResponse, isCloseSessionResponse, isFeeOptionsResponse, isFinishValidateSessionResponse, + isGetAdopterResponse, isGetIdTokenResponse, isGetSessionResponse, isInitiateAuthResponse, @@ -738,6 +741,19 @@ export class SequenceWaaS { return res.data } + async getAdopter(): Promise { + await this.updateTimeDrift() + + const intent = await this.waas.getAdopter() + const res = await this.sendIntent(intent) + + if (!isGetAdopterResponse(res)) { + throw new Error(`Invalid response: ${JSON.stringify(res)}`) + } + + return res.data.adopterAddress + } + async useIdentifier(args: T): Promise { if (args.identifier) { return args as T & { identifier: string } @@ -844,6 +860,13 @@ export class SequenceWaaS { return this.trySendIntent(args, intent, isFeeOptionsResponse) } + async adoptChildWallet(args: WithSimpleNetwork & CommonAuthArgs) { + await this.updateTimeDrift() + + const intent = await this.waas.adoptChildWallet(args) + return this.trySendIntent(args, intent, isChildWalletAdoptedResponse) + } + async networkList(): Promise { const networks: NetworkList = [] const chainList = await this.client.chainList({ diff --git a/packages/waas/src/base.ts b/packages/waas/src/base.ts index e2bae0f58..cdde0f509 100644 --- a/packages/waas/src/base.ts +++ b/packages/waas/src/base.ts @@ -1,9 +1,12 @@ import { + adoptChildWallet, + AdoptChildWalletArgs, changeIntentTime, closeSession, combineTransactionIntents, feeOptions, finishValidateSession, + getAdopter, getIdToken, getSession, getTransactionReceipt, @@ -589,6 +592,23 @@ export class SequenceWaaSBase { return this.signIntent(intent) } + async adoptChildWallet(args: WithSimpleNetwork) { + const intent = adoptChildWallet({ + wallet: await this.getWalletAddress(), + ...args, + lifespan: DEFAULT_LIFESPAN, + }) + return this.signIntent(intent) + } + + async getAdopter() { + const intent = getAdopter({ + wallet: await this.getWalletAddress(), + lifespan: DEFAULT_LIFESPAN, + }) + return this.signIntent(intent) + } + async batch(intents: Intent[]): Promise> { const combined = combineTransactionIntents(intents) return this.signIntent(combined) diff --git a/packages/waas/src/clients/authenticator.gen.ts b/packages/waas/src/clients/authenticator.gen.ts index fa192f665..3bbad8c2f 100644 --- a/packages/waas/src/clients/authenticator.gen.ts +++ b/packages/waas/src/clients/authenticator.gen.ts @@ -1,23 +1,24 @@ /* eslint-disable */ -// sequence-waas-authenticator v0.1.0 35f86317a98af91896d1114ad52dd22102d9de9f +// sequence-waas-authenticator v0.1.0 7745c7293a861623f7ac36bb18d0c261d75b04b3 // -- -// Code generated by webrpc-gen@v0.18.8 with typescript generator. DO NOT EDIT. +// Code generated by webrpc-gen@v0.19.3 with typescript generator. DO NOT EDIT. // // webrpc-gen -schema=authenticator.ridl -target=typescript -client -out=./clients/authenticator.gen.ts // WebRPC description and code-gen version -export const WebRPCVersion = 'v1' +export const WebRPCVersion = "v1" // Schema version of your RIDL schema -export const WebRPCSchemaVersion = 'v0.1.0' +export const WebRPCSchemaVersion = "v0.1.0" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = '35f86317a98af91896d1114ad52dd22102d9de9f' +export const WebRPCSchemaHash = "7745c7293a861623f7ac36bb18d0c261d75b04b3" // // Types // + export enum IntentName { initiateAuth = 'initiateAuth', openSession = 'openSession', @@ -34,7 +35,11 @@ export enum IntentName { federateAccount = 'federateAccount', removeAccount = 'removeAccount', listAccounts = 'listAccounts', - getIdToken = 'getIdToken' + getIdToken = 'getIdToken', + adoptChildWallet = 'adoptChildWallet', + getAdopter = 'getAdopter', + confirmIntent = 'confirmIntent', + getConfirmationStatus = 'getConfirmationStatus' } export enum IntentResponseCode { @@ -54,7 +59,10 @@ export enum IntentResponseCode { accountList = 'accountList', accountFederated = 'accountFederated', accountRemoved = 'accountRemoved', - idToken = 'idToken' + idToken = 'idToken', + adopter = 'adopter', + childWalletAdopted = 'childWalletAdopted', + confirmationRequired = 'confirmationRequired' } export enum IdentityType { @@ -85,6 +93,11 @@ export interface IntentResponse { data: any } +export enum Migration { + OIDCToStytch = 'OIDCToStytch', + OIDCToEmail = 'OIDCToEmail' +} + export interface Version { webrpcVersion: string schemaVersion: string @@ -210,6 +223,11 @@ export interface VerificationContext { expiresAt: string } +export interface Page { + limit?: number + after?: string +} + export interface WaasAuthenticator { registerSession(args: RegisterSessionArgs, headers?: object, signal?: AbortSignal): Promise sendIntent(args: SendIntentArgs, headers?: object, signal?: AbortSignal): Promise @@ -223,19 +241,20 @@ export interface RegisterSessionArgs { export interface RegisterSessionReturn { session: Session - response: IntentResponse + response: IntentResponse } export interface SendIntentArgs { intent: Intent } export interface SendIntentReturn { - response: IntentResponse + response: IntentResponse +} +export interface ChainListArgs { } -export interface ChainListArgs {} export interface ChainListReturn { - chains: Array + chains: Array } export interface WaasAuthenticatorAdmin { @@ -245,29 +264,34 @@ export interface WaasAuthenticatorAdmin { getTenant(args: GetTenantArgs, headers?: object, signal?: AbortSignal): Promise createTenant(args: CreateTenantArgs, headers?: object, signal?: AbortSignal): Promise updateTenant(args: UpdateTenantArgs, headers?: object, signal?: AbortSignal): Promise + nextMigrationBatch(args: NextMigrationBatchArgs, headers?: object, signal?: AbortSignal): Promise + processMigrationBatch(args: ProcessMigrationBatchArgs, headers?: object, signal?: AbortSignal): Promise } -export interface VersionArgs {} +export interface VersionArgs { +} export interface VersionReturn { - version: Version + version: Version +} +export interface RuntimeStatusArgs { } -export interface RuntimeStatusArgs {} export interface RuntimeStatusReturn { - status: RuntimeStatus + status: RuntimeStatus +} +export interface ClockArgs { } -export interface ClockArgs {} export interface ClockReturn { - serverTime: string + serverTime: string } export interface GetTenantArgs { projectId: number } export interface GetTenantReturn { - tenant: Tenant + tenant: Tenant } export interface CreateTenantArgs { projectId: number @@ -280,7 +304,7 @@ export interface CreateTenantArgs { export interface CreateTenantReturn { tenant: Tenant - upgradeCode: string + upgradeCode: string } export interface UpdateTenantArgs { projectId: number @@ -291,9 +315,31 @@ export interface UpdateTenantArgs { } export interface UpdateTenantReturn { - tenant: Tenant + tenant: Tenant +} +export interface NextMigrationBatchArgs { + migration: Migration + projectId: number + page: Page } +export interface NextMigrationBatchReturn { + page: Page + items: Array +} +export interface ProcessMigrationBatchArgs { + migration: Migration + projectId: number + items: Array +} + +export interface ProcessMigrationBatchReturn { + logs: {[key: string]: Array} + errors: {[key: string]: string} +} + + + // // Client // @@ -310,52 +356,51 @@ export class WaasAuthenticator implements WaasAuthenticator { private url(name: string): string { return this.hostname + this.path + name } - + registerSession = (args: RegisterSessionArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('RegisterSession'), createHTTPRequest(args, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - session: _data.session, - response: _data.response - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('RegisterSession'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + session: (_data.session), + response: (_data.response), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + sendIntent = (args: SendIntentArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SendIntent'), createHTTPRequest(args, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - response: _data.response - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('SendIntent'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + response: (_data.response), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + chainList = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('ChainList'), createHTTPRequest({}, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - chains: >_data.chains - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('ChainList'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + chains: >(_data.chains), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } + } export class WaasAuthenticatorAdmin implements WaasAuthenticatorAdmin { protected hostname: string @@ -370,100 +415,128 @@ export class WaasAuthenticatorAdmin implements WaasAuthenticatorAdmin { private url(name: string): string { return this.hostname + this.path + name } - + version = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - version: _data.version - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('Version'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + version: (_data.version), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + runtimeStatus = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - status: _data.status - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('RuntimeStatus'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + clock = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Clock'), createHTTPRequest({}, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - serverTime: _data.serverTime - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('Clock'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + serverTime: (_data.serverTime), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getTenant = (args: GetTenantArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetTenant'), createHTTPRequest(args, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - tenant: _data.tenant - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('GetTenant'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + tenant: (_data.tenant), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + createTenant = (args: CreateTenantArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('CreateTenant'), createHTTPRequest(args, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - tenant: _data.tenant, - upgradeCode: _data.upgradeCode - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('CreateTenant'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + tenant: (_data.tenant), + upgradeCode: (_data.upgradeCode), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + updateTenant = (args: UpdateTenantArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('UpdateTenant'), createHTTPRequest(args, headers, signal)).then( - res => { - return buildResponse(res).then(_data => { - return { - tenant: _data.tenant - } - }) - }, - error => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - } - ) + return this.fetch( + this.url('UpdateTenant'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + tenant: (_data.tenant), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + nextMigrationBatch = (args: NextMigrationBatchArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('NextMigrationBatch'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + items: >(_data.items), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + processMigrationBatch = (args: ProcessMigrationBatchArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ProcessMigrationBatch'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + logs: <{[key: string]: Array}>(_data.logs), + errors: <{[key: string]: string}>(_data.errors), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } + } -const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { + const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { return { method: 'POST', headers: { ...headers, 'Content-Type': 'application/json' }, @@ -477,18 +550,18 @@ const buildResponse = (res: Response): Promise => { let data try { data = JSON.parse(text) - } catch (error) { + } catch(error) { let message = '' - if (error instanceof Error) { + if (error instanceof Error) { message = error.message } throw WebrpcBadResponseError.new({ status: res.status, - cause: `JSON.parse(): ${message}: response text: ${text}` - }) + cause: `JSON.parse(): ${message}: response text: ${text}`}, + ) } if (!res.ok) { - const code: number = typeof data.code === 'number' ? data.code : 0 + const code: number = (typeof data.code === 'number') ? data.code : 0 throw (webrpcErrorByCode[code] || WebrpcError).new(data) } return data @@ -670,6 +743,7 @@ export class WebrpcStreamFinishedError extends WebrpcError { } } + // Schema errors export class UnauthorizedError extends WebrpcError { @@ -776,6 +850,7 @@ export class TooManyAttemptsError extends WebrpcError { } } + export enum errors { WebrpcEndpoint = 'WebrpcEndpoint', WebrpcRequestFailed = 'WebrpcRequestFailed', @@ -795,7 +870,7 @@ export enum errors { ProofVerificationFailed = 'ProofVerificationFailed', AnswerIncorrect = 'AnswerIncorrect', ChallengeExpired = 'ChallengeExpired', - TooManyAttempts = 'TooManyAttempts' + TooManyAttempts = 'TooManyAttempts', } const webrpcErrorByCode: { [code: number]: any } = { @@ -817,7 +892,8 @@ const webrpcErrorByCode: { [code: number]: any } = { [7002]: ProofVerificationFailedError, [7003]: AnswerIncorrectError, [7004]: ChallengeExpiredError, - [7005]: TooManyAttemptsError + [7005]: TooManyAttemptsError, } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise + diff --git a/packages/waas/src/clients/intent.gen.ts b/packages/waas/src/clients/intent.gen.ts index 2e0544c1f..5458f9986 100644 --- a/packages/waas/src/clients/intent.gen.ts +++ b/packages/waas/src/clients/intent.gen.ts @@ -1,23 +1,24 @@ /* eslint-disable */ -// sequence-waas-intents v0.1.0 2e4f5d4a4107d8e8c74c252f4d1a7aad391db6e7 +// sequence-waas-intents v0.1.0 47010351881054ccb75b704db39b04ddc8837c4b // -- // Code generated by webrpc-gen@v0.19.3 with typescript generator. DO NOT EDIT. // // webrpc-gen -schema=intent.ridl -target=typescript -out=./intent.gen.ts // WebRPC description and code-gen version -export const WebRPCVersion = 'v1' +export const WebRPCVersion = "v1" // Schema version of your RIDL schema -export const WebRPCSchemaVersion = 'v0.1.0' +export const WebRPCSchemaVersion = "v0.1.0" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = '2e4f5d4a4107d8e8c74c252f4d1a7aad391db6e7' +export const WebRPCSchemaHash = "47010351881054ccb75b704db39b04ddc8837c4b" // // Types // + export enum IntentName { initiateAuth = 'initiateAuth', openSession = 'openSession', @@ -34,7 +35,11 @@ export enum IntentName { federateAccount = 'federateAccount', removeAccount = 'removeAccount', listAccounts = 'listAccounts', - getIdToken = 'getIdToken' + getIdToken = 'getIdToken', + adoptChildWallet = 'adoptChildWallet', + getAdopter = 'getAdopter', + confirmIntent = 'confirmIntent', + getConfirmationStatus = 'getConfirmationStatus' } export enum TransactionType { @@ -63,7 +68,10 @@ export enum IntentResponseCode { accountList = 'accountList', accountFederated = 'accountFederated', accountRemoved = 'accountRemoved', - idToken = 'idToken' + idToken = 'idToken', + adopter = 'adopter', + childWalletAdopted = 'childWalletAdopted', + confirmationRequired = 'confirmationRequired' } export enum FeeTokenType { @@ -81,6 +89,10 @@ export enum IdentityType { Stytch = 'Stytch' } +export enum ChallengeType { + EmailOTP = 'EmailOTP' +} + export interface Intent { version: string name: IntentName @@ -188,12 +200,39 @@ export interface IntentDataRemoveAccount { accountId: string } +export interface IntentDataAdoptChildWallet { + network: string + wallet: string + adopter: string + adopterProof: AdopterProof +} + +export interface AdopterProof { + message: string + signature: string +} + export interface IntentDataGetIdToken { sessionId: string wallet: string nonce?: string } +export interface IntentDataGetAdopter { + wallet: string +} + +export interface IntentDataConfirmIntent { + wallet: string + confirmationID: string + challengeAnswer: string +} + +export interface IntentDataGetConfirmationStatus { + wallet: string + confirmationID: string +} + export interface TransactionRaw { type: string to: string @@ -267,9 +306,11 @@ export interface IntentResponseSessionOpened { wallet: string } -export interface IntentResponseSessionClosed {} +export interface IntentResponseSessionClosed { +} -export interface IntentResponseValidateSession {} +export interface IntentResponseValidateSession { +} export interface IntentResponseValidationRequired { sessionId: string @@ -353,13 +394,30 @@ export interface IntentResponseAccountFederated { account: Account } -export interface IntentResponseAccountRemoved {} +export interface IntentResponseAccountRemoved { +} export interface IntentResponseIdToken { idToken: string expiresIn: number } +export interface IntentResponseChildWalletAdopted { + adopterAddress: string +} + +export interface IntentResponseAdopter { + adopterAddress: string +} + +export interface IntentResponseConfirmationRequired { + confirmationId: string + salt: string + challengeType: ChallengeType + challengeDestination?: string + expiresIn: number +} + export interface Account { id: string type: IdentityType diff --git a/packages/waas/src/intents/responses.ts b/packages/waas/src/intents/responses.ts index faa72f452..6af89ba43 100644 --- a/packages/waas/src/intents/responses.ts +++ b/packages/waas/src/intents/responses.ts @@ -3,7 +3,9 @@ import { IntentDataSendTransaction, IntentResponseAccountFederated, IntentResponseAccountList, + IntentResponseAdopter, IntentResponseAuthInitiated, + IntentResponseChildWalletAdopted, IntentResponseCode, IntentResponseGetSession, IntentResponseIdToken, @@ -130,6 +132,8 @@ export type GetSessionResponse = Response export type ListAccountsResponse = Response export type IdTokenResponse = Response +export type AdopterResponse = Response +export type ChildWalletAdoptedResponse = Response export function isInitiateAuthResponse(receipt: any): receipt is InitiateAuthResponse { return ( @@ -288,3 +292,21 @@ export function isGetIdTokenResponse(receipt: any): receipt is IdTokenResponse { typeof receipt.data.idToken === 'string' ) } + +export function isGetAdopterResponse(receipt: any): receipt is AdopterResponse { + return ( + typeof receipt === 'object' && + receipt.code === IntentResponseCode.adopter && + typeof receipt.data === 'object' && + typeof receipt.data.adopterAddress === 'string' + ) +} + +export function isChildWalletAdoptedResponse(receipt: any): receipt is ChildWalletAdoptedResponse { + return ( + typeof receipt === 'object' && + receipt.code === IntentResponseCode.childWalletAdopted && + typeof receipt.data === 'object' && + typeof receipt.data.adopterAddress === 'string' + ) +} diff --git a/packages/waas/src/intents/session.ts b/packages/waas/src/intents/session.ts index 74a114580..e8028fe77 100644 --- a/packages/waas/src/intents/session.ts +++ b/packages/waas/src/intents/session.ts @@ -9,7 +9,9 @@ import { IntentDataSessionAuthProof, IntentDataInitiateAuth, IntentDataGetIdToken, - IntentName + IntentName, + IntentDataAdoptChildWallet, + IntentDataGetAdopter } from '../clients/intent.gen' interface BaseArgs { @@ -69,3 +71,15 @@ export type GetIdTokenArgs = BaseArgs & IntentDataGetIdToken export function getIdToken({ lifespan, ...data }: GetIdTokenArgs): Intent { return makeIntent(IntentName.getIdToken, lifespan, data) } + +export type AdoptChildWalletArgs = BaseArgs & IntentDataAdoptChildWallet + +export function adoptChildWallet({ lifespan, ...data }: AdoptChildWalletArgs): Intent { + return makeIntent(IntentName.adoptChildWallet, lifespan, data) +} + +export type GetAdopterArgs = BaseArgs & IntentDataGetAdopter + +export function getAdopter({ lifespan, ...data }: GetAdopterArgs): Intent { + return makeIntent(IntentName.getAdopter, lifespan, data) +}