diff --git a/packages/rpc/package.json b/packages/rpc/package.json index ed26ad1..d6164b7 100644 --- a/packages/rpc/package.json +++ b/packages/rpc/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/rpc", - "version": "1.0.2", + "version": "1.1.0", "license": "MIT", "repository": { "type": "git", diff --git a/packages/rpc/src/generated/account/v1/account_service_connect.ts b/packages/rpc/src/generated/account/v1/account_service_connect.ts index e5adc48..ac87ea9 100644 --- a/packages/rpc/src/generated/account/v1/account_service_connect.ts +++ b/packages/rpc/src/generated/account/v1/account_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file account/v1/account_service.proto (package code.account.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -26,8 +26,8 @@ export const Account = { kind: MethodKind.Unary, }, /** - * GetTokenAccountInfos returns information about token accounts relevant to - * the owner account. + * GetTokenAccountInfos returns token account metadata relevant to the Code owner + * account. * * @generated from rpc code.account.v1.Account.GetTokenAccountInfos */ diff --git a/packages/rpc/src/generated/account/v1/account_service_pb.ts b/packages/rpc/src/generated/account/v1/account_service_pb.ts index 2fedcca..15ff697 100644 --- a/packages/rpc/src/generated/account/v1/account_service_pb.ts +++ b/packages/rpc/src/generated/account/v1/account_service_pb.ts @@ -1,11 +1,11 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file account/v1/account_service.proto (package code.account.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; -import { AccountType, Signature, SolanaAccountId } from "../../common/v1/model_pb"; +import { AccountType, Relationship, Signature, SolanaAccountId } from "../../common/v1/model_pb"; import { ExchangeData } from "../../transaction/v2/transaction_service_pb"; /** @@ -113,7 +113,7 @@ export enum IsCodeAccountResponse_Result { NOT_FOUND = 1, /** - * The account exists, but at least one timelock account is unlocked + * The account exists, but at least one timelock account is unlocked. * * @generated from enum value: UNLOCKED_TIMELOCK_ACCOUNT = 2; */ @@ -291,9 +291,9 @@ export class TokenAccountInfo extends Message { balanceSource = TokenAccountInfo_BalanceSource.UNKNOWN; /** - * The Kin balance in quarks, as observed by Code. This may not reflect the - * value on the blockchain and could be non-zero even if the account hasn't - * been created. Use balance_source to determine how this value was calculated. + * The balance in quarks, as observed by Code. This may not reflect the value + * on the blockchain and could be non-zero even if the account hasn't been created. + * Use balance_source to determine how this value was calculated. * * @generated from field: uint64 balance = 7; */ @@ -315,9 +315,9 @@ export class TokenAccountInfo extends Message { /** * For temporary incoming accounts only. Flag indicates whether client must - * actively try rotating it by issuing a ReceivePayments intent. In general, - * clients should wait as long as possible until this flag is true or requiring - * the funds to send their next payment. + * actively try rotating it by issuing a ReceivePaymentsPrivately intent. In + * general, clients should wait as long as possible until this flag is true + * or requiring the funds to send their next payment. * * @generated from field: bool must_rotate = 10; */ @@ -345,6 +345,35 @@ export class TokenAccountInfo extends Message { */ originalExchangeData?: ExchangeData; + /** + * The token account's mint + * + * @generated from field: code.common.v1.SolanaAccountId mint = 13; + */ + mint?: SolanaAccountId; + + /** + * The number of decimals configured for the mint + * + * @generated from field: uint32 mint_decimals = 14; + */ + mintDecimals = 0; + + /** + * User-friendly display name for the mint + * + * @generated from field: string mint_display_name = 15; + */ + mintDisplayName = ""; + + /** + * The relationship with a third party that this account has established with. + * This only applies to relevant account types (eg. RELATIONSHIP). + * + * @generated from field: code.common.v1.Relationship relationship = 16; + */ + relationship?: Relationship; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -365,6 +394,10 @@ export class TokenAccountInfo extends Message { { no: 10, name: "must_rotate", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 11, name: "claim_state", kind: "enum", T: proto3.getEnumType(TokenAccountInfo_ClaimState) }, { no: 12, name: "original_exchange_data", kind: "message", T: ExchangeData }, + { no: 13, name: "mint", kind: "message", T: SolanaAccountId }, + { no: 14, name: "mint_decimals", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 15, name: "mint_display_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 16, name: "relationship", kind: "message", T: Relationship }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): TokenAccountInfo { diff --git a/packages/rpc/src/generated/badge/v1/badge_service_connect.ts b/packages/rpc/src/generated/badge/v1/badge_service_connect.ts new file mode 100644 index 0000000..5a78519 --- /dev/null +++ b/packages/rpc/src/generated/badge/v1/badge_service_connect.ts @@ -0,0 +1,28 @@ +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" +// @generated from file badge/v1/badge_service.proto (package code.badge.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { ResetBadgeCountRequest, ResetBadgeCountResponse } from "./badge_service_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service code.badge.v1.Badge + */ +export const Badge = { + typeName: "code.badge.v1.Badge", + methods: { + /** + * ResetBadgeCount resets an owner account's app icon badge count back to zero + * + * @generated from rpc code.badge.v1.Badge.ResetBadgeCount + */ + resetBadgeCount: { + name: "ResetBadgeCount", + I: ResetBadgeCountRequest, + O: ResetBadgeCountResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/packages/rpc/src/generated/badge/v1/badge_service_pb.ts b/packages/rpc/src/generated/badge/v1/badge_service_pb.ts new file mode 100644 index 0000000..5ee5bc4 --- /dev/null +++ b/packages/rpc/src/generated/badge/v1/badge_service_pb.ts @@ -0,0 +1,109 @@ +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" +// @generated from file badge/v1/badge_service.proto (package code.badge.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { Signature, SolanaAccountId } from "../../common/v1/model_pb"; + +/** + * @generated from message code.badge.v1.ResetBadgeCountRequest + */ +export class ResetBadgeCountRequest extends Message { + /** + * The owner account to clear badge count + * + * @generated from field: code.common.v1.SolanaAccountId owner = 1; + */ + owner?: SolanaAccountId; + + /** + * The signature is of serialize(ResetBadgeCountRequest) without this field set + * using the private key of the owner account. This provides an authentication + * mechanism to the RPC. + * + * @generated from field: code.common.v1.Signature signature = 2; + */ + signature?: Signature; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.badge.v1.ResetBadgeCountRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "owner", kind: "message", T: SolanaAccountId }, + { no: 2, name: "signature", kind: "message", T: Signature }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResetBadgeCountRequest { + return new ResetBadgeCountRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResetBadgeCountRequest { + return new ResetBadgeCountRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResetBadgeCountRequest { + return new ResetBadgeCountRequest().fromJsonString(jsonString, options); + } + + static equals(a: ResetBadgeCountRequest | PlainMessage | undefined, b: ResetBadgeCountRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ResetBadgeCountRequest, a, b); + } +} + +/** + * @generated from message code.badge.v1.ResetBadgeCountResponse + */ +export class ResetBadgeCountResponse extends Message { + /** + * @generated from field: code.badge.v1.ResetBadgeCountResponse.Result result = 1; + */ + result = ResetBadgeCountResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.badge.v1.ResetBadgeCountResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(ResetBadgeCountResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ResetBadgeCountResponse { + return new ResetBadgeCountResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ResetBadgeCountResponse { + return new ResetBadgeCountResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ResetBadgeCountResponse { + return new ResetBadgeCountResponse().fromJsonString(jsonString, options); + } + + static equals(a: ResetBadgeCountResponse | PlainMessage | undefined, b: ResetBadgeCountResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ResetBadgeCountResponse, a, b); + } +} + +/** + * @generated from enum code.badge.v1.ResetBadgeCountResponse.Result + */ +export enum ResetBadgeCountResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, +} +// Retrieve enum metadata with: proto3.getEnumType(ResetBadgeCountResponse_Result) +proto3.util.setEnumType(ResetBadgeCountResponse_Result, "code.badge.v1.ResetBadgeCountResponse.Result", [ + { no: 0, name: "OK" }, +]); + diff --git a/packages/rpc/src/generated/badge/v1/index.ts b/packages/rpc/src/generated/badge/v1/index.ts new file mode 100644 index 0000000..1c507b5 --- /dev/null +++ b/packages/rpc/src/generated/badge/v1/index.ts @@ -0,0 +1,2 @@ +export * from './badge_service_connect'; +export * from './badge_service_pb'; diff --git a/packages/rpc/src/generated/chat/v1/chat_service_connect.ts b/packages/rpc/src/generated/chat/v1/chat_service_connect.ts new file mode 100644 index 0000000..967554f --- /dev/null +++ b/packages/rpc/src/generated/chat/v1/chat_service_connect.ts @@ -0,0 +1,72 @@ +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" +// @generated from file chat/v1/chat_service.proto (package code.chat.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { AdvancePointerRequest, AdvancePointerResponse, GetChatsRequest, GetChatsResponse, GetMessagesRequest, GetMessagesResponse, SetMuteStateRequest, SetMuteStateResponse, SetSubscriptionStateRequest, SetSubscriptionStateResponse } from "./chat_service_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service code.chat.v1.Chat + */ +export const Chat = { + typeName: "code.chat.v1.Chat", + methods: { + /** + * GetChats gets the set of chats for an owner account + * + * @generated from rpc code.chat.v1.Chat.GetChats + */ + getChats: { + name: "GetChats", + I: GetChatsRequest, + O: GetChatsResponse, + kind: MethodKind.Unary, + }, + /** + * GetMessages gets the set of messages for a chat + * + * @generated from rpc code.chat.v1.Chat.GetMessages + */ + getMessages: { + name: "GetMessages", + I: GetMessagesRequest, + O: GetMessagesResponse, + kind: MethodKind.Unary, + }, + /** + * AdvancePointer advances a pointer in chat history + * + * @generated from rpc code.chat.v1.Chat.AdvancePointer + */ + advancePointer: { + name: "AdvancePointer", + I: AdvancePointerRequest, + O: AdvancePointerResponse, + kind: MethodKind.Unary, + }, + /** + * SetMuteState configures the mute state of a chat + * + * @generated from rpc code.chat.v1.Chat.SetMuteState + */ + setMuteState: { + name: "SetMuteState", + I: SetMuteStateRequest, + O: SetMuteStateResponse, + kind: MethodKind.Unary, + }, + /** + * SetSubscriptionState configures the susbscription state of a chat + * + * @generated from rpc code.chat.v1.Chat.SetSubscriptionState + */ + setSubscriptionState: { + name: "SetSubscriptionState", + I: SetSubscriptionStateRequest, + O: SetSubscriptionStateResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/packages/rpc/src/generated/chat/v1/chat_service_pb.ts b/packages/rpc/src/generated/chat/v1/chat_service_pb.ts new file mode 100644 index 0000000..b39f3a8 --- /dev/null +++ b/packages/rpc/src/generated/chat/v1/chat_service_pb.ts @@ -0,0 +1,1290 @@ +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" +// @generated from file chat/v1/chat_service.proto (package code.chat.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; +import { Domain, Signature, SolanaAccountId } from "../../common/v1/model_pb"; +import { ExchangeData, ExchangeDataWithoutRate } from "../../transaction/v2/transaction_service_pb"; + +/** + * @generated from message code.chat.v1.GetChatsRequest + */ +export class GetChatsRequest extends Message { + /** + * @generated from field: code.common.v1.SolanaAccountId owner = 1; + */ + owner?: SolanaAccountId; + + /** + * @generated from field: code.common.v1.Signature signature = 2; + */ + signature?: Signature; + + /** + * @generated from field: uint32 page_size = 3; + */ + pageSize = 0; + + /** + * @generated from field: code.chat.v1.Cursor cursor = 4; + */ + cursor?: Cursor; + + /** + * @generated from field: code.chat.v1.GetChatsRequest.Direction direction = 5; + */ + direction = GetChatsRequest_Direction.ASC; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.GetChatsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "owner", kind: "message", T: SolanaAccountId }, + { no: 2, name: "signature", kind: "message", T: Signature }, + { no: 3, name: "page_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 4, name: "cursor", kind: "message", T: Cursor }, + { no: 5, name: "direction", kind: "enum", T: proto3.getEnumType(GetChatsRequest_Direction) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetChatsRequest { + return new GetChatsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetChatsRequest { + return new GetChatsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetChatsRequest { + return new GetChatsRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetChatsRequest | PlainMessage | undefined, b: GetChatsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetChatsRequest, a, b); + } +} + +/** + * @generated from enum code.chat.v1.GetChatsRequest.Direction + */ +export enum GetChatsRequest_Direction { + /** + * @generated from enum value: ASC = 0; + */ + ASC = 0, + + /** + * @generated from enum value: DESC = 1; + */ + DESC = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(GetChatsRequest_Direction) +proto3.util.setEnumType(GetChatsRequest_Direction, "code.chat.v1.GetChatsRequest.Direction", [ + { no: 0, name: "ASC" }, + { no: 1, name: "DESC" }, +]); + +/** + * @generated from message code.chat.v1.GetChatsResponse + */ +export class GetChatsResponse extends Message { + /** + * @generated from field: code.chat.v1.GetChatsResponse.Result result = 1; + */ + result = GetChatsResponse_Result.OK; + + /** + * @generated from field: repeated code.chat.v1.ChatMetadata chats = 2; + */ + chats: ChatMetadata[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.GetChatsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(GetChatsResponse_Result) }, + { no: 2, name: "chats", kind: "message", T: ChatMetadata, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetChatsResponse { + return new GetChatsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetChatsResponse { + return new GetChatsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetChatsResponse { + return new GetChatsResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetChatsResponse | PlainMessage | undefined, b: GetChatsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetChatsResponse, a, b); + } +} + +/** + * @generated from enum code.chat.v1.GetChatsResponse.Result + */ +export enum GetChatsResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: NOT_FOUND = 1; + */ + NOT_FOUND = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(GetChatsResponse_Result) +proto3.util.setEnumType(GetChatsResponse_Result, "code.chat.v1.GetChatsResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "NOT_FOUND" }, +]); + +/** + * @generated from message code.chat.v1.GetMessagesRequest + */ +export class GetMessagesRequest extends Message { + /** + * @generated from field: code.chat.v1.ChatId chat_id = 1; + */ + chatId?: ChatId; + + /** + * @generated from field: code.common.v1.SolanaAccountId owner = 2; + */ + owner?: SolanaAccountId; + + /** + * @generated from field: code.common.v1.Signature signature = 3; + */ + signature?: Signature; + + /** + * @generated from field: uint32 page_size = 4; + */ + pageSize = 0; + + /** + * @generated from field: code.chat.v1.Cursor cursor = 5; + */ + cursor?: Cursor; + + /** + * @generated from field: code.chat.v1.GetMessagesRequest.Direction direction = 6; + */ + direction = GetMessagesRequest_Direction.ASC; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.GetMessagesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "chat_id", kind: "message", T: ChatId }, + { no: 2, name: "owner", kind: "message", T: SolanaAccountId }, + { no: 3, name: "signature", kind: "message", T: Signature }, + { no: 4, name: "page_size", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 5, name: "cursor", kind: "message", T: Cursor }, + { no: 6, name: "direction", kind: "enum", T: proto3.getEnumType(GetMessagesRequest_Direction) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetMessagesRequest { + return new GetMessagesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetMessagesRequest { + return new GetMessagesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetMessagesRequest { + return new GetMessagesRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetMessagesRequest | PlainMessage | undefined, b: GetMessagesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetMessagesRequest, a, b); + } +} + +/** + * @generated from enum code.chat.v1.GetMessagesRequest.Direction + */ +export enum GetMessagesRequest_Direction { + /** + * @generated from enum value: ASC = 0; + */ + ASC = 0, + + /** + * @generated from enum value: DESC = 1; + */ + DESC = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(GetMessagesRequest_Direction) +proto3.util.setEnumType(GetMessagesRequest_Direction, "code.chat.v1.GetMessagesRequest.Direction", [ + { no: 0, name: "ASC" }, + { no: 1, name: "DESC" }, +]); + +/** + * @generated from message code.chat.v1.GetMessagesResponse + */ +export class GetMessagesResponse extends Message { + /** + * @generated from field: code.chat.v1.GetMessagesResponse.Result result = 1; + */ + result = GetMessagesResponse_Result.OK; + + /** + * @generated from field: repeated code.chat.v1.ChatMessage messages = 2; + */ + messages: ChatMessage[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.GetMessagesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(GetMessagesResponse_Result) }, + { no: 2, name: "messages", kind: "message", T: ChatMessage, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetMessagesResponse { + return new GetMessagesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetMessagesResponse { + return new GetMessagesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetMessagesResponse { + return new GetMessagesResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetMessagesResponse | PlainMessage | undefined, b: GetMessagesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetMessagesResponse, a, b); + } +} + +/** + * @generated from enum code.chat.v1.GetMessagesResponse.Result + */ +export enum GetMessagesResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: NOT_FOUND = 1; + */ + NOT_FOUND = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(GetMessagesResponse_Result) +proto3.util.setEnumType(GetMessagesResponse_Result, "code.chat.v1.GetMessagesResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "NOT_FOUND" }, +]); + +/** + * @generated from message code.chat.v1.AdvancePointerRequest + */ +export class AdvancePointerRequest extends Message { + /** + * @generated from field: code.chat.v1.ChatId chat_id = 1; + */ + chatId?: ChatId; + + /** + * @generated from field: code.chat.v1.Pointer pointer = 2; + */ + pointer?: Pointer; + + /** + * @generated from field: code.common.v1.SolanaAccountId owner = 3; + */ + owner?: SolanaAccountId; + + /** + * @generated from field: code.common.v1.Signature signature = 4; + */ + signature?: Signature; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.AdvancePointerRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "chat_id", kind: "message", T: ChatId }, + { no: 2, name: "pointer", kind: "message", T: Pointer }, + { no: 3, name: "owner", kind: "message", T: SolanaAccountId }, + { no: 4, name: "signature", kind: "message", T: Signature }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AdvancePointerRequest { + return new AdvancePointerRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AdvancePointerRequest { + return new AdvancePointerRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AdvancePointerRequest { + return new AdvancePointerRequest().fromJsonString(jsonString, options); + } + + static equals(a: AdvancePointerRequest | PlainMessage | undefined, b: AdvancePointerRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(AdvancePointerRequest, a, b); + } +} + +/** + * @generated from message code.chat.v1.AdvancePointerResponse + */ +export class AdvancePointerResponse extends Message { + /** + * @generated from field: code.chat.v1.AdvancePointerResponse.Result result = 1; + */ + result = AdvancePointerResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.AdvancePointerResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(AdvancePointerResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AdvancePointerResponse { + return new AdvancePointerResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AdvancePointerResponse { + return new AdvancePointerResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AdvancePointerResponse { + return new AdvancePointerResponse().fromJsonString(jsonString, options); + } + + static equals(a: AdvancePointerResponse | PlainMessage | undefined, b: AdvancePointerResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(AdvancePointerResponse, a, b); + } +} + +/** + * @generated from enum code.chat.v1.AdvancePointerResponse.Result + */ +export enum AdvancePointerResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: CHAT_NOT_FOUND = 1; + */ + CHAT_NOT_FOUND = 1, + + /** + * @generated from enum value: MESSAGE_NOT_FOUND = 2; + */ + MESSAGE_NOT_FOUND = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(AdvancePointerResponse_Result) +proto3.util.setEnumType(AdvancePointerResponse_Result, "code.chat.v1.AdvancePointerResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "CHAT_NOT_FOUND" }, + { no: 2, name: "MESSAGE_NOT_FOUND" }, +]); + +/** + * @generated from message code.chat.v1.SetMuteStateRequest + */ +export class SetMuteStateRequest extends Message { + /** + * @generated from field: code.chat.v1.ChatId chat_id = 1; + */ + chatId?: ChatId; + + /** + * @generated from field: bool is_muted = 2; + */ + isMuted = false; + + /** + * @generated from field: code.common.v1.SolanaAccountId owner = 3; + */ + owner?: SolanaAccountId; + + /** + * @generated from field: code.common.v1.Signature signature = 4; + */ + signature?: Signature; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.SetMuteStateRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "chat_id", kind: "message", T: ChatId }, + { no: 2, name: "is_muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "owner", kind: "message", T: SolanaAccountId }, + { no: 4, name: "signature", kind: "message", T: Signature }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetMuteStateRequest { + return new SetMuteStateRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetMuteStateRequest { + return new SetMuteStateRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetMuteStateRequest { + return new SetMuteStateRequest().fromJsonString(jsonString, options); + } + + static equals(a: SetMuteStateRequest | PlainMessage | undefined, b: SetMuteStateRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SetMuteStateRequest, a, b); + } +} + +/** + * @generated from message code.chat.v1.SetMuteStateResponse + */ +export class SetMuteStateResponse extends Message { + /** + * @generated from field: code.chat.v1.SetMuteStateResponse.Result result = 1; + */ + result = SetMuteStateResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.SetMuteStateResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(SetMuteStateResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetMuteStateResponse { + return new SetMuteStateResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetMuteStateResponse { + return new SetMuteStateResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetMuteStateResponse { + return new SetMuteStateResponse().fromJsonString(jsonString, options); + } + + static equals(a: SetMuteStateResponse | PlainMessage | undefined, b: SetMuteStateResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SetMuteStateResponse, a, b); + } +} + +/** + * @generated from enum code.chat.v1.SetMuteStateResponse.Result + */ +export enum SetMuteStateResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: CHAT_NOT_FOUND = 1; + */ + CHAT_NOT_FOUND = 1, + + /** + * @generated from enum value: CANT_MUTE = 2; + */ + CANT_MUTE = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SetMuteStateResponse_Result) +proto3.util.setEnumType(SetMuteStateResponse_Result, "code.chat.v1.SetMuteStateResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "CHAT_NOT_FOUND" }, + { no: 2, name: "CANT_MUTE" }, +]); + +/** + * @generated from message code.chat.v1.SetSubscriptionStateRequest + */ +export class SetSubscriptionStateRequest extends Message { + /** + * @generated from field: code.chat.v1.ChatId chat_id = 1; + */ + chatId?: ChatId; + + /** + * @generated from field: bool is_subscribed = 2; + */ + isSubscribed = false; + + /** + * @generated from field: code.common.v1.SolanaAccountId owner = 3; + */ + owner?: SolanaAccountId; + + /** + * @generated from field: code.common.v1.Signature signature = 4; + */ + signature?: Signature; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.SetSubscriptionStateRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "chat_id", kind: "message", T: ChatId }, + { no: 2, name: "is_subscribed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "owner", kind: "message", T: SolanaAccountId }, + { no: 4, name: "signature", kind: "message", T: Signature }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscriptionStateRequest { + return new SetSubscriptionStateRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetSubscriptionStateRequest { + return new SetSubscriptionStateRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetSubscriptionStateRequest { + return new SetSubscriptionStateRequest().fromJsonString(jsonString, options); + } + + static equals(a: SetSubscriptionStateRequest | PlainMessage | undefined, b: SetSubscriptionStateRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SetSubscriptionStateRequest, a, b); + } +} + +/** + * @generated from message code.chat.v1.SetSubscriptionStateResponse + */ +export class SetSubscriptionStateResponse extends Message { + /** + * @generated from field: code.chat.v1.SetSubscriptionStateResponse.Result result = 1; + */ + result = SetSubscriptionStateResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.SetSubscriptionStateResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(SetSubscriptionStateResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SetSubscriptionStateResponse { + return new SetSubscriptionStateResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SetSubscriptionStateResponse { + return new SetSubscriptionStateResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SetSubscriptionStateResponse { + return new SetSubscriptionStateResponse().fromJsonString(jsonString, options); + } + + static equals(a: SetSubscriptionStateResponse | PlainMessage | undefined, b: SetSubscriptionStateResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SetSubscriptionStateResponse, a, b); + } +} + +/** + * @generated from enum code.chat.v1.SetSubscriptionStateResponse.Result + */ +export enum SetSubscriptionStateResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: CHAT_NOT_FOUND = 1; + */ + CHAT_NOT_FOUND = 1, + + /** + * @generated from enum value: CANT_UNSUBSCRIBE = 2; + */ + CANT_UNSUBSCRIBE = 2, +} +// Retrieve enum metadata with: proto3.getEnumType(SetSubscriptionStateResponse_Result) +proto3.util.setEnumType(SetSubscriptionStateResponse_Result, "code.chat.v1.SetSubscriptionStateResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "CHAT_NOT_FOUND" }, + { no: 2, name: "CANT_UNSUBSCRIBE" }, +]); + +/** + * @generated from message code.chat.v1.ChatId + */ +export class ChatId extends Message { + /** + * @generated from field: bytes value = 1; + */ + value = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.ChatId"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChatId { + return new ChatId().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChatId { + return new ChatId().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChatId { + return new ChatId().fromJsonString(jsonString, options); + } + + static equals(a: ChatId | PlainMessage | undefined, b: ChatId | PlainMessage | undefined): boolean { + return proto3.util.equals(ChatId, a, b); + } +} + +/** + * @generated from message code.chat.v1.ChatMessageId + */ +export class ChatMessageId extends Message { + /** + * @generated from field: bytes value = 1; + */ + value = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.ChatMessageId"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessageId { + return new ChatMessageId().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChatMessageId { + return new ChatMessageId().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChatMessageId { + return new ChatMessageId().fromJsonString(jsonString, options); + } + + static equals(a: ChatMessageId | PlainMessage | undefined, b: ChatMessageId | PlainMessage | undefined): boolean { + return proto3.util.equals(ChatMessageId, a, b); + } +} + +/** + * @generated from message code.chat.v1.Pointer + */ +export class Pointer extends Message { + /** + * @generated from field: code.chat.v1.Pointer.Kind kind = 1; + */ + kind = Pointer_Kind.UNKNOWN; + + /** + * @generated from field: code.chat.v1.ChatMessageId value = 2; + */ + value?: ChatMessageId; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.Pointer"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "kind", kind: "enum", T: proto3.getEnumType(Pointer_Kind) }, + { no: 2, name: "value", kind: "message", T: ChatMessageId }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Pointer { + return new Pointer().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Pointer { + return new Pointer().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Pointer { + return new Pointer().fromJsonString(jsonString, options); + } + + static equals(a: Pointer | PlainMessage | undefined, b: Pointer | PlainMessage | undefined): boolean { + return proto3.util.equals(Pointer, a, b); + } +} + +/** + * @generated from enum code.chat.v1.Pointer.Kind + */ +export enum Pointer_Kind { + /** + * @generated from enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + + /** + * @generated from enum value: READ = 1; + */ + READ = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(Pointer_Kind) +proto3.util.setEnumType(Pointer_Kind, "code.chat.v1.Pointer.Kind", [ + { no: 0, name: "UNKNOWN" }, + { no: 1, name: "READ" }, +]); + +/** + * @generated from message code.chat.v1.ChatMetadata + */ +export class ChatMetadata extends Message { + /** + * @generated from field: code.chat.v1.ChatId chat_id = 1; + */ + chatId?: ChatId; + + /** + * Recommended chat title inferred by the type of chat + * + * @generated from oneof code.chat.v1.ChatMetadata.title + */ + title: { + /** + * @generated from field: code.chat.v1.LocalizedContent localized = 2; + */ + value: LocalizedContent; + case: "localized"; + } | { + /** + * @generated from field: code.common.v1.Domain domain = 3; + */ + value: Domain; + case: "domain"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + /** + * Pointer in the chat indicating the most recently read message by the user + * + * @generated from field: code.chat.v1.Pointer read_pointer = 4; + */ + readPointer?: Pointer; + + /** + * Estimated number of unread messages in this chat + * + * @generated from field: uint32 num_unread = 5; + */ + numUnread = 0; + + /** + * Has the user muted this chat? + * + * @generated from field: bool is_muted = 6; + */ + isMuted = false; + + /** + * Is the user subscribed to this chat? + * + * @generated from field: bool is_subscribed = 7; + */ + isSubscribed = false; + + /** + * Can the user mute this chat? + * + * @generated from field: bool can_mute = 8; + */ + canMute = false; + + /** + * Can the user unsubscribe from this chat? + * + * @generated from field: bool can_unsubscribe = 9; + */ + canUnsubscribe = false; + + /** + * Cursor value for this chat for reference in subsequent GetChatsRequest + * + * @generated from field: code.chat.v1.Cursor cursor = 10; + */ + cursor?: Cursor; + + /** + * Is this a verified chat? + * + * Note: It's possible to have two chats with the same title, but with + * different verification statuses. They should be treated separately. + * + * @generated from field: bool is_verified = 11; + */ + isVerified = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.ChatMetadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "chat_id", kind: "message", T: ChatId }, + { no: 2, name: "localized", kind: "message", T: LocalizedContent, oneof: "title" }, + { no: 3, name: "domain", kind: "message", T: Domain, oneof: "title" }, + { no: 4, name: "read_pointer", kind: "message", T: Pointer }, + { no: 5, name: "num_unread", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 6, name: "is_muted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 7, name: "is_subscribed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 8, name: "can_mute", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 9, name: "can_unsubscribe", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 10, name: "cursor", kind: "message", T: Cursor }, + { no: 11, name: "is_verified", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChatMetadata { + return new ChatMetadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChatMetadata { + return new ChatMetadata().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChatMetadata { + return new ChatMetadata().fromJsonString(jsonString, options); + } + + static equals(a: ChatMetadata | PlainMessage | undefined, b: ChatMetadata | PlainMessage | undefined): boolean { + return proto3.util.equals(ChatMetadata, a, b); + } +} + +/** + * @generated from message code.chat.v1.ChatMessage + */ +export class ChatMessage extends Message { + /** + * Unique ID for this message + * + * @generated from field: code.chat.v1.ChatMessageId message_id = 1; + */ + messageId?: ChatMessageId; + + /** + * Timestamp this message was generated at + * + * @generated from field: google.protobuf.Timestamp ts = 2; + */ + ts?: Timestamp; + + /** + * Ordered message content. A message may have more than one piece of content. + * + * @generated from field: repeated code.chat.v1.Content content = 3; + */ + content: Content[] = []; + + /** + * Cursor value for this message for reference in subsequent GetMessagesRequest + * + * @generated from field: code.chat.v1.Cursor cursor = 4; + */ + cursor?: Cursor; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.ChatMessage"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "message_id", kind: "message", T: ChatMessageId }, + { no: 2, name: "ts", kind: "message", T: Timestamp }, + { no: 3, name: "content", kind: "message", T: Content, repeated: true }, + { no: 4, name: "cursor", kind: "message", T: Cursor }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChatMessage { + return new ChatMessage().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChatMessage { + return new ChatMessage().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChatMessage { + return new ChatMessage().fromJsonString(jsonString, options); + } + + static equals(a: ChatMessage | PlainMessage | undefined, b: ChatMessage | PlainMessage | undefined): boolean { + return proto3.util.equals(ChatMessage, a, b); + } +} + +/** + * @generated from message code.chat.v1.Content + */ +export class Content extends Message { + /** + * @generated from oneof code.chat.v1.Content.type + */ + type: { + /** + * @generated from field: code.chat.v1.LocalizedContent localized = 1; + */ + value: LocalizedContent; + case: "localized"; + } | { + /** + * @generated from field: code.chat.v1.ExchangeDataContent exchange_data = 2; + */ + value: ExchangeDataContent; + case: "exchangeData"; + } | { + /** + * @generated from field: code.chat.v1.NaclBoxEncryptedContent nacl_box = 3; + */ + value: NaclBoxEncryptedContent; + case: "naclBox"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.Content"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "localized", kind: "message", T: LocalizedContent, oneof: "type" }, + { no: 2, name: "exchange_data", kind: "message", T: ExchangeDataContent, oneof: "type" }, + { no: 3, name: "nacl_box", kind: "message", T: NaclBoxEncryptedContent, oneof: "type" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Content { + return new Content().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Content { + return new Content().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Content { + return new Content().fromJsonString(jsonString, options); + } + + static equals(a: Content | PlainMessage | undefined, b: Content | PlainMessage | undefined): boolean { + return proto3.util.equals(Content, a, b); + } +} + +/** + * @generated from message code.chat.v1.LocalizedContent + */ +export class LocalizedContent extends Message { + /** + * @generated from field: string key = 1; + */ + key = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.LocalizedContent"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LocalizedContent { + return new LocalizedContent().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LocalizedContent { + return new LocalizedContent().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LocalizedContent { + return new LocalizedContent().fromJsonString(jsonString, options); + } + + static equals(a: LocalizedContent | PlainMessage | undefined, b: LocalizedContent | PlainMessage | undefined): boolean { + return proto3.util.equals(LocalizedContent, a, b); + } +} + +/** + * @generated from message code.chat.v1.ExchangeDataContent + */ +export class ExchangeDataContent extends Message { + /** + * @generated from field: code.chat.v1.ExchangeDataContent.Verb verb = 1; + */ + verb = ExchangeDataContent_Verb.UNKNOWN; + + /** + * @generated from oneof code.chat.v1.ExchangeDataContent.exchange_data + */ + exchangeData: { + /** + * @generated from field: code.transaction.v2.ExchangeData exact = 2; + */ + value: ExchangeData; + case: "exact"; + } | { + /** + * @generated from field: code.transaction.v2.ExchangeDataWithoutRate partial = 3; + */ + value: ExchangeDataWithoutRate; + case: "partial"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.ExchangeDataContent"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "verb", kind: "enum", T: proto3.getEnumType(ExchangeDataContent_Verb) }, + { no: 2, name: "exact", kind: "message", T: ExchangeData, oneof: "exchange_data" }, + { no: 3, name: "partial", kind: "message", T: ExchangeDataWithoutRate, oneof: "exchange_data" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ExchangeDataContent { + return new ExchangeDataContent().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ExchangeDataContent { + return new ExchangeDataContent().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ExchangeDataContent { + return new ExchangeDataContent().fromJsonString(jsonString, options); + } + + static equals(a: ExchangeDataContent | PlainMessage | undefined, b: ExchangeDataContent | PlainMessage | undefined): boolean { + return proto3.util.equals(ExchangeDataContent, a, b); + } +} + +/** + * @generated from enum code.chat.v1.ExchangeDataContent.Verb + */ +export enum ExchangeDataContent_Verb { + /** + * @generated from enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + + /** + * @generated from enum value: GAVE = 1; + */ + GAVE = 1, + + /** + * @generated from enum value: RECEIVED = 2; + */ + RECEIVED = 2, + + /** + * @generated from enum value: WITHDREW = 3; + */ + WITHDREW = 3, + + /** + * @generated from enum value: DEPOSITED = 4; + */ + DEPOSITED = 4, + + /** + * @generated from enum value: SENT = 5; + */ + SENT = 5, + + /** + * @generated from enum value: RETURNED = 6; + */ + RETURNED = 6, + + /** + * @generated from enum value: SPENT = 7; + */ + SPENT = 7, + + /** + * @generated from enum value: PAID = 8; + */ + PAID = 8, + + /** + * @generated from enum value: PURCHASED = 9; + */ + PURCHASED = 9, +} +// Retrieve enum metadata with: proto3.getEnumType(ExchangeDataContent_Verb) +proto3.util.setEnumType(ExchangeDataContent_Verb, "code.chat.v1.ExchangeDataContent.Verb", [ + { no: 0, name: "UNKNOWN" }, + { no: 1, name: "GAVE" }, + { no: 2, name: "RECEIVED" }, + { no: 3, name: "WITHDREW" }, + { no: 4, name: "DEPOSITED" }, + { no: 5, name: "SENT" }, + { no: 6, name: "RETURNED" }, + { no: 7, name: "SPENT" }, + { no: 8, name: "PAID" }, + { no: 9, name: "PURCHASED" }, +]); + +/** + * @generated from message code.chat.v1.NaclBoxEncryptedContent + */ +export class NaclBoxEncryptedContent extends Message { + /** + * @generated from field: code.common.v1.SolanaAccountId peer_public_key = 1; + */ + peerPublicKey?: SolanaAccountId; + + /** + * @generated from field: bytes nonce = 2; + */ + nonce = new Uint8Array(0); + + /** + * @generated from field: bytes encrypted_payload = 3; + */ + encryptedPayload = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.NaclBoxEncryptedContent"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "peer_public_key", kind: "message", T: SolanaAccountId }, + { no: 2, name: "nonce", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 3, name: "encrypted_payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): NaclBoxEncryptedContent { + return new NaclBoxEncryptedContent().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): NaclBoxEncryptedContent { + return new NaclBoxEncryptedContent().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): NaclBoxEncryptedContent { + return new NaclBoxEncryptedContent().fromJsonString(jsonString, options); + } + + static equals(a: NaclBoxEncryptedContent | PlainMessage | undefined, b: NaclBoxEncryptedContent | PlainMessage | undefined): boolean { + return proto3.util.equals(NaclBoxEncryptedContent, a, b); + } +} + +/** + * Opaque cursor used across paged APIs. Underlying bytes may change as paging + * strategies evolve. + * + * @generated from message code.chat.v1.Cursor + */ +export class Cursor extends Message { + /** + * @generated from field: bytes value = 1; + */ + value = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.chat.v1.Cursor"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Cursor { + return new Cursor().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Cursor { + return new Cursor().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Cursor { + return new Cursor().fromJsonString(jsonString, options); + } + + static equals(a: Cursor | PlainMessage | undefined, b: Cursor | PlainMessage | undefined): boolean { + return proto3.util.equals(Cursor, a, b); + } +} + diff --git a/packages/rpc/src/generated/chat/v1/index.ts b/packages/rpc/src/generated/chat/v1/index.ts new file mode 100644 index 0000000..d60d4f9 --- /dev/null +++ b/packages/rpc/src/generated/chat/v1/index.ts @@ -0,0 +1,2 @@ +export * from './chat_service_connect'; +export * from './chat_service_pb'; diff --git a/packages/rpc/src/generated/common/v1/model_pb.ts b/packages/rpc/src/generated/common/v1/model_pb.ts index 3ec9ebe..80f2e28 100644 --- a/packages/rpc/src/generated/common/v1/model_pb.ts +++ b/packages/rpc/src/generated/common/v1/model_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file common/v1/model.proto (package code.common.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -7,6 +7,9 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialM import { Message, proto3 } from "@bufbuild/protobuf"; /** + * AccountType associates a type to an account, which infers how an account is used + * within the Code ecosystem. + * * @generated from enum code.common.v1.AccountType */ export enum AccountType { @@ -74,6 +77,16 @@ export enum AccountType { * @generated from enum value: REMOTE_SEND_GIFT_CARD = 12; */ REMOTE_SEND_GIFT_CARD = 12, + + /** + * @generated from enum value: RELATIONSHIP = 13; + */ + RELATIONSHIP = 13, + + /** + * @generated from enum value: ASSOCIATED_TOKEN_ACCOUNT = 14; + */ + ASSOCIATED_TOKEN_ACCOUNT = 14, } // Retrieve enum metadata with: proto3.getEnumType(AccountType) proto3.util.setEnumType(AccountType, "code.common.v1.AccountType", [ @@ -90,9 +103,13 @@ proto3.util.setEnumType(AccountType, "code.common.v1.AccountType", [ { no: 10, name: "BUCKET_1_000_000_KIN" }, { no: 11, name: "LEGACY_PRIMARY_2022" }, { no: 12, name: "REMOTE_SEND_GIFT_CARD" }, + { no: 13, name: "RELATIONSHIP" }, + { no: 14, name: "ASSOCIATED_TOKEN_ACCOUNT" }, ]); /** + * SolanaAccountId is a raw binary Ed25519 public key for a Solana account + * * @generated from message code.common.v1.SolanaAccountId */ export class SolanaAccountId extends Message { @@ -130,14 +147,13 @@ export class SolanaAccountId extends Message { } /** + * Transaction is a raw binary Solana transaction + * * @generated from message code.common.v1.Transaction */ export class Transaction extends Message { /** * Maximum size taken from: https://github.com/solana-labs/solana/blob/39b3ac6a8d29e14faa1de73d8b46d390ad41797b/sdk/src/packet.rs#L9-L13 - * The client-side generated ID that maps to an intent that defines a contract. - * Clients can treat this as a deduplication ID. The server guarantees idempotency - * and will treat equal IDs as the same transaction. * * @generated from field: bytes value = 1; */ @@ -172,45 +188,8 @@ export class Transaction extends Message { } /** - * Signature represents a raw binary Ed25519 signature. + * Blockhash is a raw binary Solana blockchash * - * @generated from message code.common.v1.Signature - */ -export class Signature extends Message { - /** - * @generated from field: bytes value = 1; - */ - value = new Uint8Array(0); - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.common.v1.Signature"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Signature { - return new Signature().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Signature { - return new Signature().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Signature { - return new Signature().fromJsonString(jsonString, options); - } - - static equals(a: Signature | PlainMessage | undefined, b: Signature | PlainMessage | undefined): boolean { - return proto3.util.equals(Signature, a, b); - } -} - -/** * @generated from message code.common.v1.Blockhash */ export class Blockhash extends Message { @@ -248,46 +227,47 @@ export class Blockhash extends Message { } /** - * @generated from message code.common.v1.Hash + * Signature is a raw binary Ed25519 signature + * + * @generated from message code.common.v1.Signature */ -export class Hash extends Message { +export class Signature extends Message { /** * @generated from field: bytes value = 1; */ value = new Uint8Array(0); - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.common.v1.Hash"; + static readonly typeName = "code.common.v1.Signature"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): Hash { - return new Hash().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): Signature { + return new Signature().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): Hash { - return new Hash().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): Signature { + return new Signature().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): Hash { - return new Hash().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): Signature { + return new Signature().fromJsonString(jsonString, options); } - static equals(a: Hash | PlainMessage | undefined, b: Hash | PlainMessage | undefined): boolean { - return proto3.util.equals(Hash, a, b); + static equals(a: Signature | PlainMessage | undefined, b: Signature | PlainMessage | undefined): boolean { + return proto3.util.equals(Signature, a, b); } } /** - * The client-side generated ID that maps to an intent that defines a contract. - * Clients can treat this as a deduplication ID. The server guarantees idempotency - * and will treat equal IDs as the same transaction. + * IntentId is a client-side generated ID that maps to an intent to perform actions + * on the blockchain fulfilled by the Code sequencer. * * @generated from message code.common.v1.IntentId */ @@ -326,7 +306,7 @@ export class IntentId extends Message { } /** - * UserId is a globally unique identifier for a user from the identity service. + * UserId is a globally unique identifier for a user * * @generated from message code.common.v1.UserId */ @@ -366,7 +346,7 @@ export class UserId extends Message { /** * DataContainerId is a globally unique identifier for a container where a user - * can store a copy of their data. + * can store a copy of their data * * @generated from message code.common.v1.DataContainerId */ @@ -405,11 +385,93 @@ export class DataContainerId extends Message { } /** + * DeviceToken is an opaque token used to verify whether a device real + * + * @generated from message code.common.v1.DeviceToken + */ +export class DeviceToken extends Message { + /** + * @generated from field: string value = 1; + */ + value = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.common.v1.DeviceToken"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeviceToken { + return new DeviceToken().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeviceToken { + return new DeviceToken().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeviceToken { + return new DeviceToken().fromJsonString(jsonString, options); + } + + static equals(a: DeviceToken | PlainMessage | undefined, b: DeviceToken | PlainMessage | undefined): boolean { + return proto3.util.equals(DeviceToken, a, b); + } +} + +/** + * AppInstallId is a unque ID tied to a client app installation. It does not + * identify a device. Value should remain private and not be shared across + * installs. + * + * @generated from message code.common.v1.AppInstallId + */ +export class AppInstallId extends Message { + /** + * @generated from field: string value = 1; + */ + value = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.common.v1.AppInstallId"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): AppInstallId { + return new AppInstallId().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): AppInstallId { + return new AppInstallId().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): AppInstallId { + return new AppInstallId().fromJsonString(jsonString, options); + } + + static equals(a: AppInstallId | PlainMessage | undefined, b: AppInstallId | PlainMessage | undefined): boolean { + return proto3.util.equals(AppInstallId, a, b); + } +} + +/** + * PhoneNumber is an E.164 phone number + * * @generated from message code.common.v1.PhoneNumber */ export class PhoneNumber extends Message { /** - * E.164 phone number value. Regex provided by Twilio here: https://www.twilio.com/docs/glossary/what-e164#regex-matching-for-e164 + * Regex provided by Twilio here: https://www.twilio.com/docs/glossary/what-e164#regex-matching-for-e164 * * @generated from field: string value = 1; */ @@ -444,49 +506,126 @@ export class PhoneNumber extends Message { } /** - * @generated from message code.common.v1.Locale + * Domain is a hostname + * + * @generated from message code.common.v1.Domain */ -export class Locale extends Message { +export class Domain extends Message { /** - * The ISO 639 alpha-2 language code. - * - * @generated from field: string language = 1; + * @generated from field: string value = 1; + */ + value = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.common.v1.Domain"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Domain { + return new Domain().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Domain { + return new Domain().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Domain { + return new Domain().fromJsonString(jsonString, options); + } + + static equals(a: Domain | PlainMessage | undefined, b: Domain | PlainMessage | undefined): boolean { + return proto3.util.equals(Domain, a, b); + } +} + +/** + * Relationship is a set of identifiers that a user can establish a relationship + * with. + * + * @generated from message code.common.v1.Relationship + */ +export class Relationship extends Message { + /** + * @generated from oneof code.common.v1.Relationship.type */ - language = ""; + type: { + /** + * @generated from field: code.common.v1.Domain domain = 1; + */ + value: Domain; + case: "domain"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.common.v1.Relationship"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "domain", kind: "message", T: Domain, oneof: "type" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Relationship { + return new Relationship().fromBinary(bytes, options); + } + static fromJson(jsonValue: JsonValue, options?: Partial): Relationship { + return new Relationship().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Relationship { + return new Relationship().fromJsonString(jsonString, options); + } + + static equals(a: Relationship | PlainMessage | undefined, b: Relationship | PlainMessage | undefined): boolean { + return proto3.util.equals(Relationship, a, b); + } +} + +/** + * Hash is a raw binary 32 byte hash value + * + * @generated from message code.common.v1.Hash + */ +export class Hash extends Message { /** - * ISO 3166 alpha-2 country code. - * - * @generated from field: string country = 2; + * @generated from field: bytes value = 1; */ - country = ""; + value = new Uint8Array(0); - constructor(data?: PartialMessage) { + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); } static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.common.v1.Locale"; + static readonly typeName = "code.common.v1.Hash"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "language", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "country", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, ]); - static fromBinary(bytes: Uint8Array, options?: Partial): Locale { - return new Locale().fromBinary(bytes, options); + static fromBinary(bytes: Uint8Array, options?: Partial): Hash { + return new Hash().fromBinary(bytes, options); } - static fromJson(jsonValue: JsonValue, options?: Partial): Locale { - return new Locale().fromJson(jsonValue, options); + static fromJson(jsonValue: JsonValue, options?: Partial): Hash { + return new Hash().fromJson(jsonValue, options); } - static fromJsonString(jsonString: string, options?: Partial): Locale { - return new Locale().fromJsonString(jsonString, options); + static fromJsonString(jsonString: string, options?: Partial): Hash { + return new Hash().fromJsonString(jsonString, options); } - static equals(a: Locale | PlainMessage | undefined, b: Locale | PlainMessage | undefined): boolean { - return proto3.util.equals(Locale, a, b); + static equals(a: Hash | PlainMessage | undefined, b: Hash | PlainMessage | undefined): boolean { + return proto3.util.equals(Hash, a, b); } } diff --git a/packages/rpc/src/generated/contact/v1/contact_list_service_connect.ts b/packages/rpc/src/generated/contact/v1/contact_list_service_connect.ts index 8c8debe..d6df7b9 100644 --- a/packages/rpc/src/generated/contact/v1/contact_list_service_connect.ts +++ b/packages/rpc/src/generated/contact/v1/contact_list_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file contact/v1/contact_list_service.proto (package code.contact.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -13,7 +13,7 @@ export const ContactList = { typeName: "code.contact.v1.ContactList", methods: { /** - * Adds a batch of contacts to a user's contact list + * AddContacts adds a batch of contacts to a user's contact list * * @generated from rpc code.contact.v1.ContactList.AddContacts */ @@ -24,7 +24,7 @@ export const ContactList = { kind: MethodKind.Unary, }, /** - * Removes a batch of contacts from a user's contact list + * RemoveContacts removes a batch of contacts from a user's contact list * * @generated from rpc code.contact.v1.ContactList.RemoveContacts */ @@ -35,7 +35,7 @@ export const ContactList = { kind: MethodKind.Unary, }, /** - * Gets a subset of contacts from a user's contact list + * GetContacts gets a subset of contacts from a user's contact list * * @generated from rpc code.contact.v1.ContactList.GetContacts */ diff --git a/packages/rpc/src/generated/contact/v1/contact_list_service_pb.ts b/packages/rpc/src/generated/contact/v1/contact_list_service_pb.ts index b2aebe0..70f9427 100644 --- a/packages/rpc/src/generated/contact/v1/contact_list_service_pb.ts +++ b/packages/rpc/src/generated/contact/v1/contact_list_service_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file contact/v1/contact_list_service.proto (package code.contact.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/rpc/src/generated/currency/v1/currency_service_connect.ts b/packages/rpc/src/generated/currency/v1/currency_service_connect.ts index 8a84196..c42dc23 100644 --- a/packages/rpc/src/generated/currency/v1/currency_service_connect.ts +++ b/packages/rpc/src/generated/currency/v1/currency_service_connect.ts @@ -1,9 +1,9 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file currency/v1/currency_service.proto (package code.currency.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck -import { GetAllRatesRequest, GetAllRatesResponse, GetExchangeRateHistoryRequest, GetExchangeRateHistoryResponse } from "./currency_service_pb"; +import { GetAllRatesRequest, GetAllRatesResponse } from "./currency_service_pb"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -13,7 +13,7 @@ export const Currency = { typeName: "code.currency.v1.Currency", methods: { /** - * GetRate returns the exchange rates for Kin against all available currencies. + * GetAllRates returns the exchange rates for Kin against all available currencies * * @generated from rpc code.currency.v1.Currency.GetAllRates */ @@ -23,18 +23,6 @@ export const Currency = { O: GetAllRatesResponse, kind: MethodKind.Unary, }, - /** - * GetExchangeRateHistory returns the exchange rate for Kin given a time - * range, bucketing interval, and currency. - * - * @generated from rpc code.currency.v1.Currency.GetExchangeRateHistory - */ - getExchangeRateHistory: { - name: "GetExchangeRateHistory", - I: GetExchangeRateHistoryRequest, - O: GetExchangeRateHistoryResponse, - kind: MethodKind.Unary, - }, } } as const; diff --git a/packages/rpc/src/generated/currency/v1/currency_service_pb.ts b/packages/rpc/src/generated/currency/v1/currency_service_pb.ts index fc0abf9..fdcdd05 100644 --- a/packages/rpc/src/generated/currency/v1/currency_service_pb.ts +++ b/packages/rpc/src/generated/currency/v1/currency_service_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file currency/v1/currency_service.proto (package code.currency.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -12,8 +12,8 @@ import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; export class GetAllRatesRequest extends Message { /** * If timestamp is included, the returned rate will be the most recent available - * exchange rate prior to the provided timestamp within the same day. If timestamp - * is excluded, the current rate will be returned. + * exchange rate prior to the provided timestamp within the same day. Otherwise, + * the latest rates will be returned. * * @generated from field: google.protobuf.Timestamp timestamp = 1; */ @@ -57,14 +57,14 @@ export class GetAllRatesResponse extends Message { result = GetAllRatesResponse_Result.OK; /** - * The time of the exchange rate. + * The time the exchange rates were observed * * @generated from field: google.protobuf.Timestamp as_of = 2; */ asOf?: Timestamp; /** - * The price of 1 Kin in different currencies. Keyed on 3- or 4- letter lowercase currency code. + * The price of 1 Kin in different currencies, keyed on 3- or 4- letter lowercase currency code. * * @generated from field: map rates = 3; */ @@ -110,7 +110,7 @@ export enum GetAllRatesResponse_Result { OK = 0, /** - * MISSING_DATA indicates no currency data is available for the requested timestamp. + * No currency data is available for the requested timestamp. * * @generated from enum value: MISSING_DATA = 1; */ @@ -122,231 +122,3 @@ proto3.util.setEnumType(GetAllRatesResponse_Result, "code.currency.v1.GetAllRate { no: 1, name: "MISSING_DATA" }, ]); -/** - * @generated from message code.currency.v1.GetExchangeRateHistoryRequest - */ -export class GetExchangeRateHistoryRequest extends Message { - /** - * ISO 4217 alpha-3 currency code (example: 'USD'). - * - * @generated from field: string for_symbol = 5; - */ - forSymbol = ""; - - /** - * The frequency of the samples in the data returned. The data will be - * sampled into buckets if the underlying currency exchange - * data is available for the range requested. If missing, there - * could be gaps in the response. - * - * NOTE: the first record returned will be the current exchange rate and may not - * align with the frequency selected. - * - * @generated from field: code.currency.v1.GetExchangeRateHistoryRequest.Interval interval = 2; - */ - interval = GetExchangeRateHistoryRequest_Interval.RAW; - - /** - * From timestamp (inclusive, in the past) - * - * @generated from field: google.protobuf.Timestamp start = 3; - */ - start?: Timestamp; - - /** - * Until timestamp (optional but must be in the future relative to the start - * timestamp. If not provided the server will default to "now") - * - * @generated from field: google.protobuf.Timestamp end = 4; - */ - end?: Timestamp; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.currency.v1.GetExchangeRateHistoryRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 5, name: "for_symbol", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "interval", kind: "enum", T: proto3.getEnumType(GetExchangeRateHistoryRequest_Interval) }, - { no: 3, name: "start", kind: "message", T: Timestamp }, - { no: 4, name: "end", kind: "message", T: Timestamp }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetExchangeRateHistoryRequest { - return new GetExchangeRateHistoryRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetExchangeRateHistoryRequest { - return new GetExchangeRateHistoryRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetExchangeRateHistoryRequest { - return new GetExchangeRateHistoryRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetExchangeRateHistoryRequest | PlainMessage | undefined, b: GetExchangeRateHistoryRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetExchangeRateHistoryRequest, a, b); - } -} - -/** - * @generated from enum code.currency.v1.GetExchangeRateHistoryRequest.Interval - */ -export enum GetExchangeRateHistoryRequest_Interval { - /** - * Get the raw data stored by the database - * - * @generated from enum value: INTERVAL_RAW = 0; - */ - RAW = 0, - - /** - * Get hourly buckets of data (if it exists) - * - * @generated from enum value: INTERVAL_HOUR = 1; - */ - HOUR = 1, - - /** - * Get daily buckets of data (if it exists) - * - * @generated from enum value: INTERVAL_DAY = 2; - */ - DAY = 2, - - /** - * Get weekly buckets of data (if it exists) - * - * @generated from enum value: INTERVAL_WEEK = 3; - */ - WEEK = 3, - - /** - * Get monthly buckets of data (if it exists) - * - * @generated from enum value: INTERVAL_MONTH = 4; - */ - MONTH = 4, -} -// Retrieve enum metadata with: proto3.getEnumType(GetExchangeRateHistoryRequest_Interval) -proto3.util.setEnumType(GetExchangeRateHistoryRequest_Interval, "code.currency.v1.GetExchangeRateHistoryRequest.Interval", [ - { no: 0, name: "INTERVAL_RAW" }, - { no: 1, name: "INTERVAL_HOUR" }, - { no: 2, name: "INTERVAL_DAY" }, - { no: 3, name: "INTERVAL_WEEK" }, - { no: 4, name: "INTERVAL_MONTH" }, -]); - -/** - * @generated from message code.currency.v1.GetExchangeRateHistoryResponse - */ -export class GetExchangeRateHistoryResponse extends Message { - /** - * @generated from field: code.currency.v1.GetExchangeRateHistoryResponse.Result result = 1; - */ - result = GetExchangeRateHistoryResponse_Result.OK; - - /** - * @generated from field: repeated code.currency.v1.ExchangeRate items = 2; - */ - items: ExchangeRate[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.currency.v1.GetExchangeRateHistoryResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(GetExchangeRateHistoryResponse_Result) }, - { no: 2, name: "items", kind: "message", T: ExchangeRate, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetExchangeRateHistoryResponse { - return new GetExchangeRateHistoryResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetExchangeRateHistoryResponse { - return new GetExchangeRateHistoryResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetExchangeRateHistoryResponse { - return new GetExchangeRateHistoryResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetExchangeRateHistoryResponse | PlainMessage | undefined, b: GetExchangeRateHistoryResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetExchangeRateHistoryResponse, a, b); - } -} - -/** - * @generated from enum code.currency.v1.GetExchangeRateHistoryResponse.Result - */ -export enum GetExchangeRateHistoryResponse_Result { - /** - * @generated from enum value: OK = 0; - */ - OK = 0, - - /** - * @generated from enum value: NOT_FOUND = 1; - */ - NOT_FOUND = 1, -} -// Retrieve enum metadata with: proto3.getEnumType(GetExchangeRateHistoryResponse_Result) -proto3.util.setEnumType(GetExchangeRateHistoryResponse_Result, "code.currency.v1.GetExchangeRateHistoryResponse.Result", [ - { no: 0, name: "OK" }, - { no: 1, name: "NOT_FOUND" }, -]); - -/** - * @generated from message code.currency.v1.ExchangeRate - */ -export class ExchangeRate extends Message { - /** - * Rate of the currency in the base currency - * - * @generated from field: double rate = 2; - */ - rate = 0; - - /** - * The time for the exchange rate - * - * @generated from field: google.protobuf.Timestamp time = 1; - */ - time?: Timestamp; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.currency.v1.ExchangeRate"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 2, name: "rate", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, - { no: 1, name: "time", kind: "message", T: Timestamp }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ExchangeRate { - return new ExchangeRate().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ExchangeRate { - return new ExchangeRate().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ExchangeRate { - return new ExchangeRate().fromJsonString(jsonString, options); - } - - static equals(a: ExchangeRate | PlainMessage | undefined, b: ExchangeRate | PlainMessage | undefined): boolean { - return proto3.util.equals(ExchangeRate, a, b); - } -} - diff --git a/packages/rpc/src/generated/device/v1/device_service_connect.ts b/packages/rpc/src/generated/device/v1/device_service_connect.ts new file mode 100644 index 0000000..a396ddd --- /dev/null +++ b/packages/rpc/src/generated/device/v1/device_service_connect.ts @@ -0,0 +1,43 @@ +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" +// @generated from file device/v1/device_service.proto (package code.device.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { GetLoggedInAccountsRequest, GetLoggedInAccountsResponse, RegisterLoggedInAccountsRequest, RegisterLoggedInAccountsResponse } from "./device_service_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service code.device.v1.Device + */ +export const Device = { + typeName: "code.device.v1.Device", + methods: { + /** + * RegisterLoggedInAccounts registers a set of owner accounts logged for + * an app install. Currently, a single login is enforced per app install. + * After using GetLoggedInAccounts to detect stale logins, clients can use + * this RPC to update the set of accounts with valid login sessions. + * + * @generated from rpc code.device.v1.Device.RegisterLoggedInAccounts + */ + registerLoggedInAccounts: { + name: "RegisterLoggedInAccounts", + I: RegisterLoggedInAccountsRequest, + O: RegisterLoggedInAccountsResponse, + kind: MethodKind.Unary, + }, + /** + * GetLoggedInAccounts gets the set of logged in accounts for an app install. + * Clients can use this RPC to detect stale logins for boot out of the app. + * + * @generated from rpc code.device.v1.Device.GetLoggedInAccounts + */ + getLoggedInAccounts: { + name: "GetLoggedInAccounts", + I: GetLoggedInAccountsRequest, + O: GetLoggedInAccountsResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/packages/rpc/src/generated/device/v1/device_service_pb.ts b/packages/rpc/src/generated/device/v1/device_service_pb.ts new file mode 100644 index 0000000..89da6b0 --- /dev/null +++ b/packages/rpc/src/generated/device/v1/device_service_pb.ts @@ -0,0 +1,227 @@ +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" +// @generated from file device/v1/device_service.proto (package code.device.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { AppInstallId, Signature, SolanaAccountId } from "../../common/v1/model_pb"; + +/** + * @generated from message code.device.v1.RegisterLoggedInAccountsRequest + */ +export class RegisterLoggedInAccountsRequest extends Message { + /** + * @generated from field: code.common.v1.AppInstallId app_install = 1; + */ + appInstall?: AppInstallId; + + /** + * The set of owners logged into the app install. Setting an empty value + * indicates there are no logged in users. We allow for more than one owner + * in the spec with a repeated field to be flexible in the future. + * + * @generated from field: repeated code.common.v1.SolanaAccountId owners = 2; + */ + owners: SolanaAccountId[] = []; + + /** + * Signature values must appear in the exact order their respecitive signing + * owner account appears in the owners field. All signatures should be generated + * without any other signature values set. + * + * @generated from field: repeated code.common.v1.Signature signatures = 3; + */ + signatures: Signature[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.device.v1.RegisterLoggedInAccountsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "app_install", kind: "message", T: AppInstallId }, + { no: 2, name: "owners", kind: "message", T: SolanaAccountId, repeated: true }, + { no: 3, name: "signatures", kind: "message", T: Signature, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterLoggedInAccountsRequest { + return new RegisterLoggedInAccountsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterLoggedInAccountsRequest { + return new RegisterLoggedInAccountsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegisterLoggedInAccountsRequest { + return new RegisterLoggedInAccountsRequest().fromJsonString(jsonString, options); + } + + static equals(a: RegisterLoggedInAccountsRequest | PlainMessage | undefined, b: RegisterLoggedInAccountsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RegisterLoggedInAccountsRequest, a, b); + } +} + +/** + * @generated from message code.device.v1.RegisterLoggedInAccountsResponse + */ +export class RegisterLoggedInAccountsResponse extends Message { + /** + * @generated from field: code.device.v1.RegisterLoggedInAccountsResponse.Result result = 1; + */ + result = RegisterLoggedInAccountsResponse_Result.OK; + + /** + * Set of invalid owner accounts detected in the request. An owner account + * can be invalid for several reasons: not phone verified, timelock account + * unlocked, etc. Value is set when result is INVALID_OWNER. + * + * @generated from field: repeated code.common.v1.SolanaAccountId invalid_owners = 2; + */ + invalidOwners: SolanaAccountId[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.device.v1.RegisterLoggedInAccountsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(RegisterLoggedInAccountsResponse_Result) }, + { no: 2, name: "invalid_owners", kind: "message", T: SolanaAccountId, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterLoggedInAccountsResponse { + return new RegisterLoggedInAccountsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterLoggedInAccountsResponse { + return new RegisterLoggedInAccountsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegisterLoggedInAccountsResponse { + return new RegisterLoggedInAccountsResponse().fromJsonString(jsonString, options); + } + + static equals(a: RegisterLoggedInAccountsResponse | PlainMessage | undefined, b: RegisterLoggedInAccountsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RegisterLoggedInAccountsResponse, a, b); + } +} + +/** + * @generated from enum code.device.v1.RegisterLoggedInAccountsResponse.Result + */ +export enum RegisterLoggedInAccountsResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: INVALID_OWNER = 1; + */ + INVALID_OWNER = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(RegisterLoggedInAccountsResponse_Result) +proto3.util.setEnumType(RegisterLoggedInAccountsResponse_Result, "code.device.v1.RegisterLoggedInAccountsResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "INVALID_OWNER" }, +]); + +/** + * @generated from message code.device.v1.GetLoggedInAccountsRequest + */ +export class GetLoggedInAccountsRequest extends Message { + /** + * @generated from field: code.common.v1.AppInstallId app_install = 1; + */ + appInstall?: AppInstallId; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.device.v1.GetLoggedInAccountsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "app_install", kind: "message", T: AppInstallId }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetLoggedInAccountsRequest { + return new GetLoggedInAccountsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetLoggedInAccountsRequest { + return new GetLoggedInAccountsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetLoggedInAccountsRequest { + return new GetLoggedInAccountsRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetLoggedInAccountsRequest | PlainMessage | undefined, b: GetLoggedInAccountsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetLoggedInAccountsRequest, a, b); + } +} + +/** + * @generated from message code.device.v1.GetLoggedInAccountsResponse + */ +export class GetLoggedInAccountsResponse extends Message { + /** + * @generated from field: code.device.v1.GetLoggedInAccountsResponse.Result result = 1; + */ + result = GetLoggedInAccountsResponse_Result.OK; + + /** + * @generated from field: repeated code.common.v1.SolanaAccountId owners = 2; + */ + owners: SolanaAccountId[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.device.v1.GetLoggedInAccountsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(GetLoggedInAccountsResponse_Result) }, + { no: 2, name: "owners", kind: "message", T: SolanaAccountId, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetLoggedInAccountsResponse { + return new GetLoggedInAccountsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetLoggedInAccountsResponse { + return new GetLoggedInAccountsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetLoggedInAccountsResponse { + return new GetLoggedInAccountsResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetLoggedInAccountsResponse | PlainMessage | undefined, b: GetLoggedInAccountsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetLoggedInAccountsResponse, a, b); + } +} + +/** + * @generated from enum code.device.v1.GetLoggedInAccountsResponse.Result + */ +export enum GetLoggedInAccountsResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, +} +// Retrieve enum metadata with: proto3.getEnumType(GetLoggedInAccountsResponse_Result) +proto3.util.setEnumType(GetLoggedInAccountsResponse_Result, "code.device.v1.GetLoggedInAccountsResponse.Result", [ + { no: 0, name: "OK" }, +]); + diff --git a/packages/rpc/src/generated/device/v1/index.ts b/packages/rpc/src/generated/device/v1/index.ts new file mode 100644 index 0000000..f3201bc --- /dev/null +++ b/packages/rpc/src/generated/device/v1/index.ts @@ -0,0 +1,2 @@ +export * from './device_service_connect'; +export * from './device_service_pb'; diff --git a/packages/rpc/src/generated/index.ts b/packages/rpc/src/generated/index.ts index 7be3615..40b7570 100644 --- a/packages/rpc/src/generated/index.ts +++ b/packages/rpc/src/generated/index.ts @@ -1,35 +1,44 @@ export * from './account/v1'; +export * from './badge/v1'; +export * as Chat from './chat/v1'; export * as Common from './common/v1'; export * as Contact from './contact/v1'; export * from './currency/v1'; +export * from './device/v1'; export * from './invite/v2'; export * from './messaging/v1'; +export * from './micropayment/v1'; export * from './phone/v1'; export * from './push/v1'; -export * from './support/v1'; export * from './transaction/v2'; export * from './user/v1'; import { Account } from './account/v1'; +import { Badge } from './badge/v1'; +import { Chat } from './chat/v1'; import { ContactList } from './contact/v1'; import { Currency } from './currency/v1'; +import { Device } from './device/v1'; import { Invite } from './invite/v2'; import { Messaging } from './messaging/v1'; +import { MicroPayment } from './micropayment/v1'; import { PhoneVerification } from './phone/v1'; import { Push } from './push/v1'; -import { Support } from './support/v1'; import { Transaction } from './transaction/v2'; import { Identity } from './user/v1'; const Services = { Account, + Badge, + Chat, ContactList, Currency, + Device, Invite, Messaging, + MicroPayment, PhoneVerification, Push, - Support, Transaction, Identity, } diff --git a/packages/rpc/src/generated/invite/v2/invite_service_connect.ts b/packages/rpc/src/generated/invite/v2/invite_service_connect.ts index 93cdc7a..ea8dd7c 100644 --- a/packages/rpc/src/generated/invite/v2/invite_service_connect.ts +++ b/packages/rpc/src/generated/invite/v2/invite_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file invite/v2/invite_service.proto (package code.invite.v2, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -13,7 +13,7 @@ export const Invite = { typeName: "code.invite.v2.Invite", methods: { /** - * Gets the number of invites that a user can send out. + * GetInviteCount gets the number of invites that a user can send out. * * @generated from rpc code.invite.v2.Invite.GetInviteCount */ @@ -24,9 +24,9 @@ export const Invite = { kind: MethodKind.Unary, }, /** - * Invites someone to join via their phone number. A phone number can only - * be invited once by a unique user or invite code. This is to avoid having a - * phone number consuming more than one invite count globally. + * InvitePhoneNumber invites someone to join via their phone number. A phone number + * can only be invited once by a unique user or invite code. This is to avoid having + * a phone number consuming more than one invite count globally. * * @generated from rpc code.invite.v2.Invite.InvitePhoneNumber */ @@ -37,7 +37,7 @@ export const Invite = { kind: MethodKind.Unary, }, /** - * Gets a phone number's invitation status. + * GetInvitationStatus gets a phone number's invitation status. * * @generated from rpc code.invite.v2.Invite.GetInvitationStatus */ diff --git a/packages/rpc/src/generated/invite/v2/invite_service_pb.ts b/packages/rpc/src/generated/invite/v2/invite_service_pb.ts index a9a5b64..d18271b 100644 --- a/packages/rpc/src/generated/invite/v2/invite_service_pb.ts +++ b/packages/rpc/src/generated/invite/v2/invite_service_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file invite/v2/invite_service.proto (package code.invite.v2, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/rpc/src/generated/messaging/v1/messaging_service_connect.ts b/packages/rpc/src/generated/messaging/v1/messaging_service_connect.ts index 877af40..68cbdeb 100644 --- a/packages/rpc/src/generated/messaging/v1/messaging_service_connect.ts +++ b/packages/rpc/src/generated/messaging/v1/messaging_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file messaging/v1/messaging_service.proto (package code.messaging.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -22,33 +22,46 @@ export const Messaging = { * and are eligible for deletion from the service. Clients should, however, handle * duplicate delivery of messages. * - * Only RequestToGrabBill and RequestToReceiveBill are supported for real time events. - * * For grabbing a bill, the expected flow is as follows: - * 1. The payment sender creates a payment scan code - * (see: https://github.com/code-wallet/code-api/blob/master/spec/scan.md). - * 2. The payment sender calls `OpenMessageStream` on the rendezvous public key, which is - * derived by using sha256(scan_payload) as the keypair seed. - * 3. The payment recipient scans the code and uses `SendMessage` to send their account ID + * 1. The payment sender creates a cash scan code + * 2. The payment sender calls OpenMessageStream on the rendezvous public key, which is + * derived by using sha256(scan payload) as the keypair seed. + * 3. The payment recipient scans the code and uses SendMessage to send their account ID * back to the sender via the rendezvous public key. * 4. The payment sender receives the message, submits the intent, and closes the stream. * * For receiving a bill of requested value, the expected flow is as follows: - * 1. The payment recipient uses `SendMessage` to send their account ID and payment amount to - * the sender via the rendezvous public key, which is derived by using sha256(scan_payload) + * 1. The payment recipient uses SendMessage to send their account ID and payment amount to + * the sender via the rendezvous public key, which is derived by using sha256(scan payload) * as the keypair seed. - * 2. The payment recipient calls `OpenMessageStream` on the rendezvous public key to listen - * for status messages generated by server. It must ignore the original message it sent as - * part of step 1. - * 3. The payment recipient creates a payment scan code - * (see: https://github.com/code-wallet/code-api/blob/master/spec/scan.md). - * 4. The payment sender calls `PollMessages` on the rendezvous public key. This is ok because + * 2. The payment recipient calls OpenMessageStream on the rendezvous public key to listen + * for status messages generated by client/server. It must ignore the original message it sent + * as part of step 1. + * 3. The payment recipient creates a payment request scan code + * 4. The payment sender calls PollMessages on the rendezvous public key. This is ok because * we know the message exists per step 1, and doesn't actually incur a long poll. This is a * required hack because we don't have the infrastructure in place to allow multiple listens * on the same stream, and the recipient needs real-time status updates. * 5. The payment sender receives the message (any status messages are ignored), and submits the * intent. - * 6. The payment recipient sees a success/failure/timeout status message and closes the stream. + * 6. The payment recipient observes status message (eg. IntentSubmitted, ClientRejectedPayment, + * WebhookCalled) for payment state. + * 7. The payment recipient closes the stream once the payment hits a terminal state, or times out. + * + * For logging in, the expected flow is as follows: + * 1. The third party uses SendMessage to send their login challenge to the user via the rendezvous + * public key, which is derived by using sha256(scan payload) as the keypair seed. + * 2. The third party calls OpenMessageStream on the rendezvous public key to listen for status + * messages generated by server. It must ignore the original message it sent as part of step 1. + * 3. The third party creates a login scan code + * 4. The user logging in calls PollMessages on the rendezvous public key. This is ok because + * we know the message exists per step 1, and doesn't actually incur a long poll. This is a + * required hack because we don't have the infrastructure in place to allow multiple listens + * on the same stream, and the recipient needs real-time status updates. + * 5. The user logging in receives the message (any status messages are ignored), verifies it, + * then uses SendMessage to send a login attempt. + * 6. The third party receives sees the login attempt message, verifies it, then accepts/denies + * the login attempt. The stream is closed. * * @generated from rpc code.messaging.v1.Messaging.OpenMessageStream */ diff --git a/packages/rpc/src/generated/messaging/v1/messaging_service_pb.ts b/packages/rpc/src/generated/messaging/v1/messaging_service_pb.ts index cdd25d6..c884eba 100644 --- a/packages/rpc/src/generated/messaging/v1/messaging_service_pb.ts +++ b/packages/rpc/src/generated/messaging/v1/messaging_service_pb.ts @@ -1,11 +1,11 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file messaging/v1/messaging_service.proto (package code.messaging.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Duration, Message as Message$1, proto3, Timestamp } from "@bufbuild/protobuf"; -import { IntentId, Signature, SolanaAccountId } from "../../common/v1/model_pb"; +import { Domain, IntentId, Signature, SolanaAccountId } from "../../common/v1/model_pb"; import { AirdropType, ExchangeData, ExchangeDataWithoutRate, Metadata } from "../../transaction/v2/transaction_service_pb"; /** @@ -488,6 +488,47 @@ proto3.util.setEnumType(SendMessageResponse_Result, "code.messaging.v1.SendMessa { no: 1, name: "NO_ACTIVE_STREAM" }, ]); +/** + * RendezvousKey is a unique key pair, typically derived from a scan code payload, + * which is used to establish a secure communication channel anonymously to coordinate + * a flow using messages. + * + * @generated from message code.messaging.v1.RendezvousKey + */ +export class RendezvousKey extends Message$1 { + /** + * @generated from field: bytes value = 1; + */ + value = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.messaging.v1.RendezvousKey"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RendezvousKey { + return new RendezvousKey().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RendezvousKey { + return new RendezvousKey().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RendezvousKey { + return new RendezvousKey().fromJsonString(jsonString, options); + } + + static equals(a: RendezvousKey | PlainMessage | undefined, b: RendezvousKey | PlainMessage | undefined): boolean { + return proto3.util.equals(RendezvousKey, a, b); + } +} + /** * MessageId identifies a message. It is only guaranteed to be unique when * paired with a destination (i.e. the rendezvous public key). @@ -617,6 +658,36 @@ export class RequestToReceiveBill extends Message$1 { case: "partial"; } | { case: undefined; value?: undefined } = { case: undefined }; + /** + * The third-party's domain name, which is its primary identifier. Server + * guarantees to perform domain verification against the verifier account. + * + * @generated from field: code.common.v1.Domain domain = 4; + */ + domain?: Domain; + + /** + * Owner account owned by the third party used in domain verification. + * + * @generated from field: code.common.v1.SolanaAccountId verifier = 5; + */ + verifier?: SolanaAccountId; + + /** + * Signature of this message using the verifier private key, which in addition + * to domain verification, authenticates the third party. + * + * @generated from field: code.common.v1.Signature signature = 6; + */ + signature?: Signature; + + /** + * Rendezvous key to avoid replay attacks + * + * @generated from field: code.messaging.v1.RendezvousKey rendezvous_key = 7; + */ + rendezvousKey?: RendezvousKey; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -628,6 +699,10 @@ export class RequestToReceiveBill extends Message$1 { { no: 1, name: "requestor_account", kind: "message", T: SolanaAccountId }, { no: 2, name: "exact", kind: "message", T: ExchangeData, oneof: "exchange_data" }, { no: 3, name: "partial", kind: "message", T: ExchangeDataWithoutRate, oneof: "exchange_data" }, + { no: 4, name: "domain", kind: "message", T: Domain }, + { no: 5, name: "verifier", kind: "message", T: SolanaAccountId }, + { no: 6, name: "signature", kind: "message", T: Signature }, + { no: 7, name: "rendezvous_key", kind: "message", T: RendezvousKey }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): RequestToReceiveBill { @@ -651,13 +726,13 @@ export class RequestToReceiveBill extends Message$1 { * A status update on a stream to indicate a scan code was scanned. This can appear * multiple times for the same stream. * - * This message type is only initiated by server + * This message type is only initiated by client * * @generated from message code.messaging.v1.CodeScanned */ export class CodeScanned extends Message$1 { /** - * Estimated scan time as observed by server + * Timestamp the client scanned the code * * @generated from field: google.protobuf.Timestamp timestamp = 1; */ @@ -822,6 +897,218 @@ export class WebhookCalled extends Message$1 { } } +/** + * Request that an account logs in + * + * This message type is only initiated by third-parties through the SDK. + * + * @generated from message code.messaging.v1.RequestToLogin + */ +export class RequestToLogin extends Message$1 { + /** + * The third-party's domain name, which is its primary identifier. Server + * guarantees to perform domain verification against the verifier account. + * + * Clients should expect subdomains for future feature compatiblity, but must + * use the ASCII base domain in the RELATIONSHIP account derivation strategy. + * + * @generated from field: code.common.v1.Domain domain = 1; + */ + domain?: Domain; + + /** + * Random nonce to include for signing in LoginAttempt + * + * @generated from field: code.common.v1.SolanaAccountId nonce = 2; + */ + nonce?: SolanaAccountId; + + /** + * Timestamp the request was created + * + * @generated from field: google.protobuf.Timestamp timestamp = 3; + */ + timestamp?: Timestamp; + + /** + * Owner account owned by the third party used in domain verification. + * + * @generated from field: code.common.v1.SolanaAccountId verifier = 4; + */ + verifier?: SolanaAccountId; + + /** + * Signature of this message using the verifier private key, which in addition + * to domain verification, authenticates the third party. + * + * @generated from field: code.common.v1.Signature signature = 5; + */ + signature?: Signature; + + /** + * Rendezvous key to avoid replay attacks + * + * @generated from field: code.messaging.v1.RendezvousKey rendezvous_key = 6; + */ + rendezvousKey?: RendezvousKey; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.messaging.v1.RequestToLogin"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "domain", kind: "message", T: Domain }, + { no: 2, name: "nonce", kind: "message", T: SolanaAccountId }, + { no: 3, name: "timestamp", kind: "message", T: Timestamp }, + { no: 4, name: "verifier", kind: "message", T: SolanaAccountId }, + { no: 5, name: "signature", kind: "message", T: Signature }, + { no: 6, name: "rendezvous_key", kind: "message", T: RendezvousKey }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RequestToLogin { + return new RequestToLogin().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RequestToLogin { + return new RequestToLogin().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RequestToLogin { + return new RequestToLogin().fromJsonString(jsonString, options); + } + + static equals(a: RequestToLogin | PlainMessage | undefined, b: RequestToLogin | PlainMessage | undefined): boolean { + return proto3.util.equals(RequestToLogin, a, b); + } +} + +/** + * Attempt to login + * + * This message type is only initiated by user clients + * + * @generated from message code.messaging.v1.LoginAttempt + */ +export class LoginAttempt extends Message$1 { + /** + * Derived owner account from a user's 12 words, which is uniquely used with + * the third party as identified by the domain. + * + * @generated from field: code.common.v1.SolanaAccountId user_id = 1; + */ + userId?: SolanaAccountId; + + /** + * Domain value provided in the RequestToLogin message + * + * @generated from field: code.common.v1.Domain domain = 3; + */ + domain?: Domain; + + /** + * Nonce value provided in the RequestToLogin message + * + * @generated from field: code.common.v1.SolanaAccountId nonce = 4; + */ + nonce?: SolanaAccountId; + + /** + * Timestamp the attempt was created + * + * @generated from field: google.protobuf.Timestamp timestamp = 5; + */ + timestamp?: Timestamp; + + /** + * Signature of this message using the user_id private key, which + * authenticates the user. + * + * @generated from field: code.common.v1.Signature signature = 6; + */ + signature?: Signature; + + /** + * Rendezvous key to avoid replay attacks + * + * @generated from field: code.messaging.v1.RendezvousKey rendezvous_key = 7; + */ + rendezvousKey?: RendezvousKey; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.messaging.v1.LoginAttempt"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "user_id", kind: "message", T: SolanaAccountId }, + { no: 3, name: "domain", kind: "message", T: Domain }, + { no: 4, name: "nonce", kind: "message", T: SolanaAccountId }, + { no: 5, name: "timestamp", kind: "message", T: Timestamp }, + { no: 6, name: "signature", kind: "message", T: Signature }, + { no: 7, name: "rendezvous_key", kind: "message", T: RendezvousKey }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoginAttempt { + return new LoginAttempt().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoginAttempt { + return new LoginAttempt().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoginAttempt { + return new LoginAttempt().fromJsonString(jsonString, options); + } + + static equals(a: LoginAttempt | PlainMessage | undefined, b: LoginAttempt | PlainMessage | undefined): boolean { + return proto3.util.equals(LoginAttempt, a, b); + } +} + +/** + * @generated from message code.messaging.v1.LoginRejected + */ +export class LoginRejected extends Message$1 { + /** + * Timestamp the login was rejected + * + * @generated from field: google.protobuf.Timestamp timestamp = 4; + */ + timestamp?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.messaging.v1.LoginRejected"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 4, name: "timestamp", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LoginRejected { + return new LoginRejected().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LoginRejected { + return new LoginRejected().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LoginRejected { + return new LoginRejected().fromJsonString(jsonString, options); + } + + static equals(a: LoginRejected | PlainMessage | undefined, b: LoginRejected | PlainMessage | undefined): boolean { + return proto3.util.equals(LoginRejected, a, b); + } +} + /** * Client has received an aidrop from server * @@ -900,18 +1187,14 @@ export class Message extends Message$1 { /** * The signature sent from SendMessageRequest, which will be injected by server. * This enables clients to ensure no MITM attacks were performed to hijack contents - * of the typed message. This is only applicable for client-initiated messages. + * of the typed message. This is only applicable for messages not generated by server. * * @generated from field: code.common.v1.Signature send_message_request_signature = 3; */ sendMessageRequestSignature?: Signature; /** - * Next field number is 10 - * - * - * Section: Client requests - * + * Next field number is 13 * * @generated from oneof code.messaging.v1.Message.kind */ @@ -951,6 +1234,24 @@ export class Message extends Message$1 { */ value: WebhookCalled; case: "webhookCalled"; + } | { + /** + * @generated from field: code.messaging.v1.RequestToLogin request_to_login = 10; + */ + value: RequestToLogin; + case: "requestToLogin"; + } | { + /** + * @generated from field: code.messaging.v1.LoginAttempt login_attempt = 11; + */ + value: LoginAttempt; + case: "loginAttempt"; + } | { + /** + * @generated from field: code.messaging.v1.LoginRejected login_rejected = 12; + */ + value: LoginRejected; + case: "loginRejected"; } | { /** * @generated from field: code.messaging.v1.AirdropReceived airdrop_received = 4; @@ -975,6 +1276,9 @@ export class Message extends Message$1 { { no: 7, name: "client_rejected_payment", kind: "message", T: ClientRejectedPayment, oneof: "kind" }, { no: 8, name: "intent_submitted", kind: "message", T: IntentSubmitted, oneof: "kind" }, { no: 9, name: "webhook_called", kind: "message", T: WebhookCalled, oneof: "kind" }, + { no: 10, name: "request_to_login", kind: "message", T: RequestToLogin, oneof: "kind" }, + { no: 11, name: "login_attempt", kind: "message", T: LoginAttempt, oneof: "kind" }, + { no: 12, name: "login_rejected", kind: "message", T: LoginRejected, oneof: "kind" }, { no: 4, name: "airdrop_received", kind: "message", T: AirdropReceived, oneof: "kind" }, ]); @@ -995,43 +1299,6 @@ export class Message extends Message$1 { } } -/** - * @generated from message code.messaging.v1.RendezvousKey - */ -export class RendezvousKey extends Message$1 { - /** - * @generated from field: bytes value = 1; - */ - value = new Uint8Array(0); - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.messaging.v1.RendezvousKey"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): RendezvousKey { - return new RendezvousKey().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): RendezvousKey { - return new RendezvousKey().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): RendezvousKey { - return new RendezvousKey().fromJsonString(jsonString, options); - } - - static equals(a: RendezvousKey | PlainMessage | undefined, b: RendezvousKey | PlainMessage | undefined): boolean { - return proto3.util.equals(RendezvousKey, a, b); - } -} - /** * @generated from message code.messaging.v1.ServerPing */ diff --git a/packages/rpc/src/generated/micropayment/v1/index.ts b/packages/rpc/src/generated/micropayment/v1/index.ts new file mode 100644 index 0000000..9054c8a --- /dev/null +++ b/packages/rpc/src/generated/micropayment/v1/index.ts @@ -0,0 +1,2 @@ +export * from './micro_payment_service_connect'; +export * from './micro_payment_service_pb'; diff --git a/packages/rpc/src/generated/micropayment/v1/micro_payment_service_connect.ts b/packages/rpc/src/generated/micropayment/v1/micro_payment_service_connect.ts new file mode 100644 index 0000000..8335109 --- /dev/null +++ b/packages/rpc/src/generated/micropayment/v1/micro_payment_service_connect.ts @@ -0,0 +1,69 @@ +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" +// @generated from file micropayment/v1/micro_payment_service.proto (package code.micropayment.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CodifyRequest, CodifyResponse, GetPathMetadataRequest, GetPathMetadataResponse, GetStatusRequest, GetStatusResponse, RegisterWebhookRequest, RegisterWebhookResponse } from "./micro_payment_service_pb"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service code.micropayment.v1.MicroPayment + */ +export const MicroPayment = { + typeName: "code.micropayment.v1.MicroPayment", + methods: { + /** + * GetStatus gets basic micro payment status + * + * @generated from rpc code.micropayment.v1.MicroPayment.GetStatus + */ + getStatus: { + name: "GetStatus", + I: GetStatusRequest, + O: GetStatusResponse, + kind: MethodKind.Unary, + }, + /** + * RegisterWebhook registers a webhook for a micro payment + * + * todo: Once Kik codes can encode the entire payment request details, we can + * remove the messaging service component and have a Create RPC that + * reserves the intent ID with payment details, plus registers the webhook + * at the same time. Until that's possible, we're stuck with two RPC calls. + * + * @generated from rpc code.micropayment.v1.MicroPayment.RegisterWebhook + */ + registerWebhook: { + name: "RegisterWebhook", + I: RegisterWebhookRequest, + O: RegisterWebhookResponse, + kind: MethodKind.Unary, + }, + /** + * Codify adds a trial micro paywall to any URL + * + * @generated from rpc code.micropayment.v1.MicroPayment.Codify + */ + codify: { + name: "Codify", + I: CodifyRequest, + O: CodifyResponse, + kind: MethodKind.Unary, + }, + /** + * GetPathMetadata gets codified website metadata for a given path + * + * Important Note: This RPC's current implementation is insecure and + * it's sole design is to enable PoC and trials. + * + * @generated from rpc code.micropayment.v1.MicroPayment.GetPathMetadata + */ + getPathMetadata: { + name: "GetPathMetadata", + I: GetPathMetadataRequest, + O: GetPathMetadataResponse, + kind: MethodKind.Unary, + }, + } +} as const; + diff --git a/packages/rpc/src/generated/micropayment/v1/micro_payment_service_pb.ts b/packages/rpc/src/generated/micropayment/v1/micro_payment_service_pb.ts new file mode 100644 index 0000000..f5d036d --- /dev/null +++ b/packages/rpc/src/generated/micropayment/v1/micro_payment_service_pb.ts @@ -0,0 +1,525 @@ +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" +// @generated from file micropayment/v1/micro_payment_service.proto (package code.micropayment.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import { IntentId, Signature, SolanaAccountId } from "../../common/v1/model_pb"; + +/** + * @generated from message code.micropayment.v1.GetStatusRequest + */ +export class GetStatusRequest extends Message { + /** + * @generated from field: code.common.v1.IntentId intent_id = 1; + */ + intentId?: IntentId; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.GetStatusRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "intent_id", kind: "message", T: IntentId }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetStatusRequest { + return new GetStatusRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetStatusRequest { + return new GetStatusRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetStatusRequest { + return new GetStatusRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetStatusRequest | PlainMessage | undefined, b: GetStatusRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetStatusRequest, a, b); + } +} + +/** + * @generated from message code.micropayment.v1.GetStatusResponse + */ +export class GetStatusResponse extends Message { + /** + * Does the payment request exist? + * + * @generated from field: bool exists = 1; + */ + exists = false; + + /** + * Has the user scanned the code at least once? + * + * @generated from field: bool code_scanned = 2; + */ + codeScanned = false; + + /** + * Has the user sumbmitted a payment? + * + * @generated from field: bool intent_submitted = 3; + */ + intentSubmitted = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.GetStatusResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "exists", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 2, name: "code_scanned", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 3, name: "intent_submitted", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetStatusResponse { + return new GetStatusResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetStatusResponse { + return new GetStatusResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetStatusResponse { + return new GetStatusResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetStatusResponse | PlainMessage | undefined, b: GetStatusResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetStatusResponse, a, b); + } +} + +/** + * @generated from message code.micropayment.v1.RegisterWebhookRequest + */ +export class RegisterWebhookRequest extends Message { + /** + * @generated from field: code.common.v1.IntentId intent_id = 1; + */ + intentId?: IntentId; + + /** + * @generated from field: string url = 2; + */ + url = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.RegisterWebhookRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "intent_id", kind: "message", T: IntentId }, + { no: 2, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterWebhookRequest { + return new RegisterWebhookRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterWebhookRequest { + return new RegisterWebhookRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegisterWebhookRequest { + return new RegisterWebhookRequest().fromJsonString(jsonString, options); + } + + static equals(a: RegisterWebhookRequest | PlainMessage | undefined, b: RegisterWebhookRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RegisterWebhookRequest, a, b); + } +} + +/** + * @generated from message code.micropayment.v1.RegisterWebhookResponse + */ +export class RegisterWebhookResponse extends Message { + /** + * @generated from field: code.micropayment.v1.RegisterWebhookResponse.Result result = 1; + */ + result = RegisterWebhookResponse_Result.OK; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.RegisterWebhookResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(RegisterWebhookResponse_Result) }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RegisterWebhookResponse { + return new RegisterWebhookResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RegisterWebhookResponse { + return new RegisterWebhookResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RegisterWebhookResponse { + return new RegisterWebhookResponse().fromJsonString(jsonString, options); + } + + static equals(a: RegisterWebhookResponse | PlainMessage | undefined, b: RegisterWebhookResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RegisterWebhookResponse, a, b); + } +} + +/** + * @generated from enum code.micropayment.v1.RegisterWebhookResponse.Result + */ +export enum RegisterWebhookResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * A webhook has already been registered + * + * @generated from enum value: ALREADY_REGISTERED = 1; + */ + ALREADY_REGISTERED = 1, + + /** + * A payment request does not exist for the provided intent ID + * + * @generated from enum value: PAYMENT_REQUEST_NOT_FOUND = 2; + */ + PAYMENT_REQUEST_NOT_FOUND = 2, + + /** + * A user has already submitted a payment + * + * @generated from enum value: INTENT_EXISTS = 3; + */ + INTENT_EXISTS = 3, + + /** + * The webhook URL is invalid + * + * @generated from enum value: INVALID_URL = 4; + */ + INVALID_URL = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(RegisterWebhookResponse_Result) +proto3.util.setEnumType(RegisterWebhookResponse_Result, "code.micropayment.v1.RegisterWebhookResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "ALREADY_REGISTERED" }, + { no: 2, name: "PAYMENT_REQUEST_NOT_FOUND" }, + { no: 3, name: "INTENT_EXISTS" }, + { no: 4, name: "INVALID_URL" }, +]); + +/** + * @generated from message code.micropayment.v1.CodifyRequest + */ +export class CodifyRequest extends Message { + /** + * The URL to Codify + * + * @generated from field: string url = 1; + */ + url = ""; + + /** + * ISO 4217 alpha-3 currency code the payment should be made in + * + * @generated from field: string currency = 2; + */ + currency = ""; + + /** + * The amount that should be paid in the native currency + * + * @generated from field: double native_amount = 3; + */ + nativeAmount = 0; + + /** + * The verified owner account public key + * + * @generated from field: code.common.v1.SolanaAccountId owner_account = 4; + */ + ownerAccount?: SolanaAccountId; + + /** + * The primary account public key where payment will be sent + * + * @generated from field: code.common.v1.SolanaAccountId primary_account = 5; + */ + primaryAccount?: SolanaAccountId; + + /** + * The signature is of serialize(CodifyRequest) without this field set using the + * private key of the owner account. This provides an authentication mechanism + * to the RPC and can be used to validate payment details. + * + * @generated from field: code.common.v1.Signature signature = 6; + */ + signature?: Signature; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.CodifyRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "currency", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "native_amount", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 4, name: "owner_account", kind: "message", T: SolanaAccountId }, + { no: 5, name: "primary_account", kind: "message", T: SolanaAccountId }, + { no: 6, name: "signature", kind: "message", T: Signature }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CodifyRequest { + return new CodifyRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CodifyRequest { + return new CodifyRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CodifyRequest { + return new CodifyRequest().fromJsonString(jsonString, options); + } + + static equals(a: CodifyRequest | PlainMessage | undefined, b: CodifyRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CodifyRequest, a, b); + } +} + +/** + * @generated from message code.micropayment.v1.CodifyResponse + */ +export class CodifyResponse extends Message { + /** + * @generated from field: code.micropayment.v1.CodifyResponse.Result result = 1; + */ + result = CodifyResponse_Result.OK; + + /** + * The URL to view the content with a Code micro paywall + * + * @generated from field: string codified_url = 2; + */ + codifiedUrl = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.CodifyResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(CodifyResponse_Result) }, + { no: 2, name: "codified_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CodifyResponse { + return new CodifyResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CodifyResponse { + return new CodifyResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CodifyResponse { + return new CodifyResponse().fromJsonString(jsonString, options); + } + + static equals(a: CodifyResponse | PlainMessage | undefined, b: CodifyResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CodifyResponse, a, b); + } +} + +/** + * @generated from enum code.micropayment.v1.CodifyResponse.Result + */ +export enum CodifyResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * The URL to Codify is invalid + * + * @generated from enum value: INVALID_URL = 1; + */ + INVALID_URL = 1, + + /** + * The primary account is invalid + * + * @generated from enum value: INVALID_ACCOUNT = 2; + */ + INVALID_ACCOUNT = 2, + + /** + * The currency isn't supported for micro payments + * + * @generated from enum value: UNSUPPORTED_CURRENCY = 3; + */ + UNSUPPORTED_CURRENCY = 3, + + /** + * The payment amount exceeds the minimum/maximum allowed amount + * + * @generated from enum value: NATIVE_AMOUNT_EXCEEDS_LIMIT = 4; + */ + NATIVE_AMOUNT_EXCEEDS_LIMIT = 4, +} +// Retrieve enum metadata with: proto3.getEnumType(CodifyResponse_Result) +proto3.util.setEnumType(CodifyResponse_Result, "code.micropayment.v1.CodifyResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "INVALID_URL" }, + { no: 2, name: "INVALID_ACCOUNT" }, + { no: 3, name: "UNSUPPORTED_CURRENCY" }, + { no: 4, name: "NATIVE_AMOUNT_EXCEEDS_LIMIT" }, +]); + +/** + * @generated from message code.micropayment.v1.GetPathMetadataRequest + */ +export class GetPathMetadataRequest extends Message { + /** + * @generated from field: string path = 1; + */ + path = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.GetPathMetadataRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetPathMetadataRequest { + return new GetPathMetadataRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetPathMetadataRequest { + return new GetPathMetadataRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetPathMetadataRequest { + return new GetPathMetadataRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetPathMetadataRequest | PlainMessage | undefined, b: GetPathMetadataRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetPathMetadataRequest, a, b); + } +} + +/** + * @generated from message code.micropayment.v1.GetPathMetadataResponse + */ +export class GetPathMetadataResponse extends Message { + /** + * @generated from field: code.micropayment.v1.GetPathMetadataResponse.Result result = 1; + */ + result = GetPathMetadataResponse_Result.OK; + + /** + * The account where the payment should be sent to + * + * @generated from field: code.common.v1.SolanaAccountId destination = 2; + */ + destination?: SolanaAccountId; + + /** + * ISO 4217 alpha-3 currency code the payment should be made in + * + * @generated from field: string currency = 3; + */ + currency = ""; + + /** + * The amount that should be paid in the native currency + * + * @generated from field: double native_amount = 4; + */ + nativeAmount = 0; + + /** + * The URL to redirect upon successful payment + * + * @generated from field: string redirct_url = 5; + */ + redirctUrl = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.micropayment.v1.GetPathMetadataResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(GetPathMetadataResponse_Result) }, + { no: 2, name: "destination", kind: "message", T: SolanaAccountId }, + { no: 3, name: "currency", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "native_amount", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ }, + { no: 5, name: "redirct_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetPathMetadataResponse { + return new GetPathMetadataResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetPathMetadataResponse { + return new GetPathMetadataResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetPathMetadataResponse { + return new GetPathMetadataResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetPathMetadataResponse | PlainMessage | undefined, b: GetPathMetadataResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetPathMetadataResponse, a, b); + } +} + +/** + * @generated from enum code.micropayment.v1.GetPathMetadataResponse.Result + */ +export enum GetPathMetadataResponse_Result { + /** + * @generated from enum value: OK = 0; + */ + OK = 0, + + /** + * @generated from enum value: NOT_FOUND = 1; + */ + NOT_FOUND = 1, +} +// Retrieve enum metadata with: proto3.getEnumType(GetPathMetadataResponse_Result) +proto3.util.setEnumType(GetPathMetadataResponse_Result, "code.micropayment.v1.GetPathMetadataResponse.Result", [ + { no: 0, name: "OK" }, + { no: 1, name: "NOT_FOUND" }, +]); + diff --git a/packages/rpc/src/generated/phone/v1/phone_verification_service_connect.ts b/packages/rpc/src/generated/phone/v1/phone_verification_service_connect.ts index 6cacc5e..8f1774f 100644 --- a/packages/rpc/src/generated/phone/v1/phone_verification_service_connect.ts +++ b/packages/rpc/src/generated/phone/v1/phone_verification_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file phone/v1/phone_verification_service.proto (package code.phone.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -13,9 +13,9 @@ export const PhoneVerification = { typeName: "code.phone.v1.PhoneVerification", methods: { /** - * Sends a verification code to the provided phone number over SMS. If an - * active verification is already taking place, the existing code will be - * resent. + * SendVerificationCode sends a verification code to the provided phone number + * over SMS. If an active verification is already taking place, the existing code + * will be resent. * * @generated from rpc code.phone.v1.PhoneVerification.SendVerificationCode */ @@ -26,8 +26,8 @@ export const PhoneVerification = { kind: MethodKind.Unary, }, /** - * CheckVerificationCode validates a verification code. On success, a - * one-time use token to link an owner account is provided. + * CheckVerificationCode validates a verification code. On success, a one-time use + * token to link an owner account is provided. * * @generated from rpc code.phone.v1.PhoneVerification.CheckVerificationCode */ @@ -38,7 +38,7 @@ export const PhoneVerification = { kind: MethodKind.Unary, }, /** - * Gets the latest verified phone number linked to an owner account. + * GetAssociatedPhoneNumber gets the latest verified phone number linked to an owner account. * * @generated from rpc code.phone.v1.PhoneVerification.GetAssociatedPhoneNumber */ diff --git a/packages/rpc/src/generated/phone/v1/phone_verification_service_pb.ts b/packages/rpc/src/generated/phone/v1/phone_verification_service_pb.ts index c6c39db..474461e 100644 --- a/packages/rpc/src/generated/phone/v1/phone_verification_service_pb.ts +++ b/packages/rpc/src/generated/phone/v1/phone_verification_service_pb.ts @@ -1,11 +1,11 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file phone/v1/phone_verification_service.proto (package code.phone.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import { PhoneNumber, Signature, SolanaAccountId } from "../../common/v1/model_pb"; +import { DeviceToken, PhoneNumber, Signature, SolanaAccountId } from "../../common/v1/model_pb"; /** * @generated from message code.phone.v1.SendVerificationCodeRequest @@ -18,6 +18,13 @@ export class SendVerificationCodeRequest extends Message) { super(); proto3.util.initPartial(data, this); @@ -27,6 +34,7 @@ export class SendVerificationCodeRequest extends Message [ { no: 1, name: "phone_number", kind: "message", T: PhoneNumber }, + { no: 2, name: "device_token", kind: "message", T: DeviceToken }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): SendVerificationCodeRequest { diff --git a/packages/rpc/src/generated/push/v1/push_service_connect.ts b/packages/rpc/src/generated/push/v1/push_service_connect.ts index 3cbf864..82714cb 100644 --- a/packages/rpc/src/generated/push/v1/push_service_connect.ts +++ b/packages/rpc/src/generated/push/v1/push_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file push/v1/push_service.proto (package code.push.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck diff --git a/packages/rpc/src/generated/push/v1/push_service_pb.ts b/packages/rpc/src/generated/push/v1/push_service_pb.ts index f98712a..eff9116 100644 --- a/packages/rpc/src/generated/push/v1/push_service_pb.ts +++ b/packages/rpc/src/generated/push/v1/push_service_pb.ts @@ -1,11 +1,11 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file push/v1/push_service.proto (package code.push.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import { DataContainerId, Signature, SolanaAccountId } from "../../common/v1/model_pb"; +import { AppInstallId, DataContainerId, Signature, SolanaAccountId } from "../../common/v1/model_pb"; /** * @generated from enum code.push.v1.TokenType @@ -78,6 +78,14 @@ export class AddTokenRequest extends Message { */ tokenType = TokenType.UNKNOWN; + /** + * The instance of the app install where the push token was generated. Ideally, + * the push token is unique to the install. + * + * @generated from field: code.common.v1.AppInstallId app_install = 6; + */ + appInstall?: AppInstallId; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -91,6 +99,7 @@ export class AddTokenRequest extends Message { { no: 3, name: "container_id", kind: "message", T: DataContainerId }, { no: 4, name: "push_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 5, name: "token_type", kind: "enum", T: proto3.getEnumType(TokenType) }, + { no: 6, name: "app_install", kind: "message", T: AppInstallId }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): AddTokenRequest { diff --git a/packages/rpc/src/generated/support/v1/index.ts b/packages/rpc/src/generated/support/v1/index.ts deleted file mode 100644 index c6ea64a..0000000 --- a/packages/rpc/src/generated/support/v1/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './support_service_connect'; -export * from './support_service_pb'; diff --git a/packages/rpc/src/generated/support/v1/support_service_connect.ts b/packages/rpc/src/generated/support/v1/support_service_connect.ts deleted file mode 100644 index 80cc7aa..0000000 --- a/packages/rpc/src/generated/support/v1/support_service_connect.ts +++ /dev/null @@ -1,28 +0,0 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" -// @generated from file support/v1/support_service.proto (package code.support.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { GetFAQsRequest, GetFAQsResponse } from "./support_service_pb"; -import { MethodKind } from "@bufbuild/protobuf"; - -/** - * @generated from service code.support.v1.Support - */ -export const Support = { - typeName: "code.support.v1.Support", - methods: { - /** - * GetFAQs returns a list of frequently asked questions. - * - * @generated from rpc code.support.v1.Support.GetFAQs - */ - getFAQs: { - name: "GetFAQs", - I: GetFAQsRequest, - O: GetFAQsResponse, - kind: MethodKind.Unary, - }, - } -} as const; - diff --git a/packages/rpc/src/generated/support/v1/support_service_pb.ts b/packages/rpc/src/generated/support/v1/support_service_pb.ts deleted file mode 100644 index edddefe..0000000 --- a/packages/rpc/src/generated/support/v1/support_service_pb.ts +++ /dev/null @@ -1,162 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" -// @generated from file support/v1/support_service.proto (package code.support.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import { Locale } from "../../common/v1/model_pb"; - -/** - * @generated from message code.support.v1.GetFAQsRequest - */ -export class GetFAQsRequest extends Message { - /** - * The locale of the user requesting the FAQs. - * - * If a translation specific to the locale's region is available, it will be returned, - * otherwise the service will fall back to a translation in the locale's language. - * - * @generated from field: code.common.v1.Locale locale = 1; - */ - locale?: Locale; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.support.v1.GetFAQsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "locale", kind: "message", T: Locale }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetFAQsRequest { - return new GetFAQsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetFAQsRequest { - return new GetFAQsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetFAQsRequest { - return new GetFAQsRequest().fromJsonString(jsonString, options); - } - - static equals(a: GetFAQsRequest | PlainMessage | undefined, b: GetFAQsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(GetFAQsRequest, a, b); - } -} - -/** - * @generated from message code.support.v1.GetFAQsResponse - */ -export class GetFAQsResponse extends Message { - /** - * @generated from field: code.support.v1.GetFAQsResponse.Result result = 1; - */ - result = GetFAQsResponse_Result.OK; - - /** - * If result == Result::OK, the returned FAQs are in the requested locale's language. - * If result == Result::LANG_UNAVAILABLE, the returned FAQs are in English. - * - * @generated from field: repeated code.support.v1.FAQ faqs = 2; - */ - faqs: FAQ[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.support.v1.GetFAQsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "result", kind: "enum", T: proto3.getEnumType(GetFAQsResponse_Result) }, - { no: 2, name: "faqs", kind: "message", T: FAQ, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): GetFAQsResponse { - return new GetFAQsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): GetFAQsResponse { - return new GetFAQsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): GetFAQsResponse { - return new GetFAQsResponse().fromJsonString(jsonString, options); - } - - static equals(a: GetFAQsResponse | PlainMessage | undefined, b: GetFAQsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(GetFAQsResponse, a, b); - } -} - -/** - * @generated from enum code.support.v1.GetFAQsResponse.Result - */ -export enum GetFAQsResponse_Result { - /** - * @generated from enum value: OK = 0; - */ - OK = 0, - - /** - * FAQs for the requested language are currently unavailable. - * - * @generated from enum value: LANG_UNAVAILABLE = 1; - */ - LANG_UNAVAILABLE = 1, -} -// Retrieve enum metadata with: proto3.getEnumType(GetFAQsResponse_Result) -proto3.util.setEnumType(GetFAQsResponse_Result, "code.support.v1.GetFAQsResponse.Result", [ - { no: 0, name: "OK" }, - { no: 1, name: "LANG_UNAVAILABLE" }, -]); - -/** - * @generated from message code.support.v1.FAQ - */ -export class FAQ extends Message { - /** - * @generated from field: string question = 1; - */ - question = ""; - - /** - * @generated from field: string answer = 2; - */ - answer = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "code.support.v1.FAQ"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "question", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "answer", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): FAQ { - return new FAQ().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): FAQ { - return new FAQ().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): FAQ { - return new FAQ().fromJsonString(jsonString, options); - } - - static equals(a: FAQ | PlainMessage | undefined, b: FAQ | PlainMessage | undefined): boolean { - return proto3.util.equals(FAQ, a, b); - } -} - diff --git a/packages/rpc/src/generated/transaction/v2/transaction_service_connect.ts b/packages/rpc/src/generated/transaction/v2/transaction_service_connect.ts index ed21731..7527396 100644 --- a/packages/rpc/src/generated/transaction/v2/transaction_service_connect.ts +++ b/packages/rpc/src/generated/transaction/v2/transaction_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file transaction/v2/transaction_service.proto (package code.transaction.v2, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -14,7 +14,8 @@ export const Transaction = { methods: { /** * SubmitIntent is the mechanism for client and server to agree upon a set of - * transactions to execute on the blockchain. + * client actions to execute on the blockchain using the Code sequencer for + * fulfillment. * * Transactions are never exchanged between client and server. Instead, the * required accounts and arguments for instructions known to each actor are @@ -105,6 +106,8 @@ export const Transaction = { /** * GetPaymentHistory gets an owner account's payment history inferred from intents * + * Deprecated: Payment history has migrated to chats + * * @generated from rpc code.transaction.v2.Transaction.GetPaymentHistory */ getPaymentHistory: { diff --git a/packages/rpc/src/generated/transaction/v2/transaction_service_pb.ts b/packages/rpc/src/generated/transaction/v2/transaction_service_pb.ts index 3af914a..9f981d4 100644 --- a/packages/rpc/src/generated/transaction/v2/transaction_service_pb.ts +++ b/packages/rpc/src/generated/transaction/v2/transaction_service_pb.ts @@ -1,11 +1,11 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file transaction/v2/transaction_service.proto (package code.transaction.v2, syntax proto3) /* eslint-disable */ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64, Timestamp } from "@bufbuild/protobuf"; -import { AccountType, Blockhash, Hash, IntentId, Signature, SolanaAccountId, Transaction } from "../../common/v1/model_pb"; +import { AccountType, Blockhash, DeviceToken, Hash, IntentId, Relationship, Signature, SolanaAccountId, Transaction } from "../../common/v1/model_pb"; /** * @generated from enum code.transaction.v2.AirdropType @@ -129,6 +129,13 @@ export class SubmitIntentRequest_SubmitActions extends Message) { super(); proto3.util.initPartial(data, this); @@ -142,6 +149,7 @@ export class SubmitIntentRequest_SubmitActions extends Message): SubmitIntentRequest_SubmitActions { @@ -1465,6 +1473,12 @@ export class Metadata extends Message { */ value: ReceivePaymentsPubliclyMetadata; case: "receivePaymentsPublicly"; + } | { + /** + * @generated from field: code.transaction.v2.EstablishRelationshipMetadata establish_relationship = 8; + */ + value: EstablishRelationshipMetadata; + case: "establishRelationship"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -1482,6 +1496,7 @@ export class Metadata extends Message { { no: 5, name: "migrate_to_privacy_2022", kind: "message", T: MigrateToPrivacy2022Metadata, oneof: "type" }, { no: 6, name: "send_public_payment", kind: "message", T: SendPublicPaymentMetadata, oneof: "type" }, { no: 7, name: "receive_payments_publicly", kind: "message", T: ReceivePaymentsPubliclyMetadata, oneof: "type" }, + { no: 8, name: "establish_relationship", kind: "message", T: EstablishRelationshipMetadata, oneof: "type" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Metadata { @@ -1549,7 +1564,7 @@ export class OpenAccountsMetadata extends Message { * should also reorganize their bucket accounts and rotate their temporary outgoing * account. * - * Action Spec (Code Payment or Withdrawal): + * Action Spec (In Person Cash Payment or Withdrawal): * * actions = [ * // Section 1: Transfer ExchangeData.Quarks from BUCKET_X_KIN accounts to TEMPORARY_OUTGOING account with reogranizations @@ -1593,6 +1608,25 @@ export class OpenAccountsMetadata extends Message { * // Section 4: Close REMOTE_SEND_GIFT_CARD if not redeemed after period of time * * CloseDormantAccount(REMOTE_SEND_GIFT_CARD), + * + * Action Spec (Micro Payment): + * + * actions = [ + * // Section 1: Transfer ExchangeData.Quarks from BUCKET_X_KIN accounts to TEMPORARY_OUTGOING account with reogranizations + * + * TemporaryPrivacyExchangeAction(BUCKET_X_KIN, BUCKET_X_KIN, multiple * bucketSize), + * TemporaryPrivacyTransferAction(BUCKET_X_KIN, TEMPORARY_OUTGOING[index], multiple * bucketSize), + * ..., + * TemporaryPrivacyExchangeAction(BUCKET_X_KIN, BUCKET_X_KIN, multiple * bucketSize), + * TemporaryPrivacyTransferAction(BUCKET_X_KIN, TEMPORARY_OUTGOING[index], multiple * bucketSize), + * + * // Section 2: Rotate TEMPORARY_OUTGOING account + * + * // Below must appear last in this exact order + * FeePayment(TEMPORARY_OUTGOING[index], feeAccount, $0.01 USD of Kin), + * NoPrivacyWithdrawAction(TEMPORARY_OUTGOING[index], destination, ExchangeData.Quarks - $0.01 USD of Kin), + * OpenAccountAction(TEMPORARY_OUTGOING[index + 1]), + * CloseDormantAccount(TEMPORARY_OUTGOING[index + 1]), * ] * * @generated from message code.transaction.v2.SendPrivatePaymentMetadata @@ -1663,11 +1697,21 @@ export class SendPrivatePaymentMetadata extends Message { + /** + * The primary or relatinship account where funds will be sent from. The primary + * account is assumed if this field is not set for backwards compatibility with + * old clients. + * + * @generated from field: code.common.v1.SolanaAccountId source = 4; + */ + source?: SolanaAccountId; + /** * The destination token account to send funds to. This cannot be a Code * temporary account. @@ -1698,6 +1742,7 @@ export class SendPublicPaymentMetadata extends Message [ + { no: 4, name: "source", kind: "message", T: SolanaAccountId }, { no: 1, name: "destination", kind: "message", T: SolanaAccountId }, { no: 2, name: "exchange_data", kind: "message", T: ExchangeData }, { no: 3, name: "is_withdrawal", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, @@ -1726,7 +1771,7 @@ export class SendPublicPaymentMetadata extends Message { /** - * The temporary incoming or primary account to receive funds from + * The temporary incoming, primary or relationship account to receive funds from * * @generated from field: code.common.v1.SolanaAccountId source = 1; */ @@ -1773,9 +1819,9 @@ export class ReceivePaymentsPrivatelyMetadata extends Message { + /** + * @generated from field: code.common.v1.Relationship relationship = 1; + */ + relationship?: Relationship; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.transaction.v2.EstablishRelationshipMetadata"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "relationship", kind: "message", T: Relationship }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): EstablishRelationshipMetadata { + return new EstablishRelationshipMetadata().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): EstablishRelationshipMetadata { + return new EstablishRelationshipMetadata().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): EstablishRelationshipMetadata { + return new EstablishRelationshipMetadata().fromJsonString(jsonString, options); + } + + static equals(a: EstablishRelationshipMetadata | PlainMessage | undefined, b: EstablishRelationshipMetadata | PlainMessage | undefined): boolean { + return proto3.util.equals(EstablishRelationshipMetadata, a, b); + } +} + /** * Action is a well-defined, ordered and small set of transactions for a unit of work * that the client wants to perform on the blockchain. Clients provide parameters known @@ -2058,6 +2151,12 @@ export class Action extends Message { */ value: PermanentPrivacyUpgradeAction; case: "permanentPrivacyUpgrade"; + } | { + /** + * @generated from field: code.transaction.v2.FeePaymentAction fee_payment = 10; + */ + value: FeePaymentAction; + case: "feePayment"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -2077,6 +2176,7 @@ export class Action extends Message { { no: 7, name: "temporary_privacy_transfer", kind: "message", T: TemporaryPrivacyTransferAction, oneof: "type" }, { no: 8, name: "temporary_privacy_exchange", kind: "message", T: TemporaryPrivacyExchangeAction, oneof: "type" }, { no: 9, name: "permanent_privacy_upgrade", kind: "message", T: PermanentPrivacyUpgradeAction, oneof: "type" }, + { no: 10, name: "fee_payment", kind: "message", T: FeePaymentAction, oneof: "type" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): Action { @@ -2126,8 +2226,7 @@ export class OpenAccountAction extends Message { owner?: SolanaAccountId; /** - * The index used to for accounts that are derived from owner. Ignore this for - * the primary account. + * The index used to for accounts that are derived from owner * * @generated from field: uint64 index = 3; */ @@ -2334,8 +2433,6 @@ export class CloseDormantAccountAction extends Message destination) * Client Signature Required: Yes * - * Note: Currently no use cases for this action - * * @generated from message code.transaction.v2.NoPrivacyTransferAction */ export class NoPrivacyTransferAction extends Message { @@ -2680,6 +2777,73 @@ export class PermanentPrivacyUpgradeAction extends Message fee account) + * Client Signature Required: Yes + * + * Note: This is exactly a NoPrivacyTransferAction, except the destination + * account is controlled by Code and provided in a server parameter. + * Note: The fee amount is hardcoded at the client and validated by server. + * Currently, its set to $0.01 USD. + * + * @generated from message code.transaction.v2.FeePaymentAction + */ +export class FeePaymentAction extends Message { + /** + * The public key of the private key that has authority over source + * + * @generated from field: code.common.v1.SolanaAccountId authority = 1; + */ + authority?: SolanaAccountId; + + /** + * The source account where funds are transferred from + * + * @generated from field: code.common.v1.SolanaAccountId source = 2; + */ + source?: SolanaAccountId; + + /** + * The Kin quark amount to transfer + * + * @generated from field: uint64 amount = 3; + */ + amount = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.transaction.v2.FeePaymentAction"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "authority", kind: "message", T: SolanaAccountId }, + { no: 2, name: "source", kind: "message", T: SolanaAccountId }, + { no: 3, name: "amount", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): FeePaymentAction { + return new FeePaymentAction().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): FeePaymentAction { + return new FeePaymentAction().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): FeePaymentAction { + return new FeePaymentAction().fromJsonString(jsonString, options); + } + + static equals(a: FeePaymentAction | PlainMessage | undefined, b: FeePaymentAction | PlainMessage | undefined): boolean { + return proto3.util.equals(FeePaymentAction, a, b); + } +} + /** * ServerParameter are a set of parameters known and returned by server that * enables clients to complete transaction construction. Any necessary proofs, @@ -2757,6 +2921,12 @@ export class ServerParameter extends Message { */ value: PermanentPrivacyUpgradeServerParameter; case: "permanentPrivacyUpgrade"; + } | { + /** + * @generated from field: code.transaction.v2.FeePaymentServerParameter fee_payment = 11; + */ + value: FeePaymentServerParameter; + case: "feePayment"; } | { case: undefined; value?: undefined } = { case: undefined }; constructor(data?: PartialMessage) { @@ -2777,6 +2947,7 @@ export class ServerParameter extends Message { { no: 8, name: "temporary_privacy_transfer", kind: "message", T: TemporaryPrivacyTransferServerParameter, oneof: "type" }, { no: 9, name: "temporary_privacy_exchange", kind: "message", T: TemporaryPrivacyExchangeServerParameter, oneof: "type" }, { no: 10, name: "permanent_privacy_upgrade", kind: "message", T: PermanentPrivacyUpgradeServerParameter, oneof: "type" }, + { no: 11, name: "fee_payment", kind: "message", T: FeePaymentServerParameter, oneof: "type" }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): ServerParameter { @@ -3185,6 +3356,45 @@ export class PermanentPrivacyUpgradeServerParameter extends Message { + /** + * The destination account where the fee payment should be sent. + * + * @generated from field: code.common.v1.SolanaAccountId destination = 1; + */ + destination?: SolanaAccountId; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "code.transaction.v2.FeePaymentServerParameter"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "destination", kind: "message", T: SolanaAccountId }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): FeePaymentServerParameter { + return new FeePaymentServerParameter().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): FeePaymentServerParameter { + return new FeePaymentServerParameter().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): FeePaymentServerParameter { + return new FeePaymentServerParameter().fromJsonString(jsonString, options); + } + + static equals(a: FeePaymentServerParameter | PlainMessage | undefined, b: FeePaymentServerParameter | PlainMessage | undefined): boolean { + return proto3.util.equals(FeePaymentServerParameter, a, b); + } +} + /** * @generated from message code.transaction.v2.ErrorDetails */ @@ -3393,7 +3603,7 @@ export class UpgradeableIntent_UpgradeablePrivateAction extends Message { */ isMicroPayment = false; + /** + * The intent ID associated with this history item + * + * @generated from field: code.common.v1.IntentId intent_id = 12; + */ + intentId?: IntentId; + constructor(data?: PartialMessage) { super(); proto3.util.initPartial(data, this); @@ -3586,6 +3803,7 @@ export class PaymentHistoryItem extends Message { { no: 9, name: "is_airdrop", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 10, name: "airdrop_type", kind: "enum", T: proto3.getEnumType(AirdropType) }, { no: 11, name: "is_micro_payment", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 12, name: "intent_id", kind: "message", T: IntentId }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): PaymentHistoryItem { @@ -3835,9 +4053,16 @@ export class MicroPaymentLimit extends Message { /** * Maximum native amount that can be applied per micro payment transaction * - * @generated from field: float per_transaction = 1; + * @generated from field: float max_per_transaction = 1; + */ + maxPerTransaction = 0; + + /** + * Minimum native amount that can be applied per micro payment transaction + * + * @generated from field: float min_per_transaction = 2; */ - perTransaction = 0; + minPerTransaction = 0; constructor(data?: PartialMessage) { super(); @@ -3847,7 +4072,8 @@ export class MicroPaymentLimit extends Message { static readonly runtime: typeof proto3 = proto3; static readonly typeName = "code.transaction.v2.MicroPaymentLimit"; static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "per_transaction", kind: "scalar", T: 2 /* ScalarType.FLOAT */ }, + { no: 1, name: "max_per_transaction", kind: "scalar", T: 2 /* ScalarType.FLOAT */ }, + { no: 2, name: "min_per_transaction", kind: "scalar", T: 2 /* ScalarType.FLOAT */ }, ]); static fromBinary(bytes: Uint8Array, options?: Partial): MicroPaymentLimit { diff --git a/packages/rpc/src/generated/user/v1/identity_service_connect.ts b/packages/rpc/src/generated/user/v1/identity_service_connect.ts index 9cbe696..55ce4dd 100644 --- a/packages/rpc/src/generated/user/v1/identity_service_connect.ts +++ b/packages/rpc/src/generated/user/v1/identity_service_connect.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-connect-es v0.11.0 with parameter "target=ts" +// @generated by protoc-gen-connect-es v0.13.0 with parameter "target=ts" // @generated from file user/v1/identity_service.proto (package code.user.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -13,15 +13,13 @@ export const Identity = { typeName: "code.user.v1.Identity", methods: { /** - * LinkAccount links an owner account to: - * * the user identified and authenticated by a one-time use token - * * any identifying features that support remote send + * LinkAccount links an owner account to the user identified and authenticated + * by a one-time use token. + * * Notably, this RPC has the following side effects: * * A new user is automatically created if one doesn't exist. * * Server will create a new data container for at least every unique * owner account linked to the user. - * * Previous links to identifying features that support remote send are - * invalidated. Relinking must occur to restore previous state. * * @generated from rpc code.user.v1.Identity.LinkAccount */ @@ -34,14 +32,12 @@ export const Identity = { /** * UnlinkAccount removes links from an owner account. It will NOT remove * existing associations between users, owner accounts and identifying - * features. Currently, the RPC will remove: - * * remote send features for any applicable identifying features + * features. + * * The following associations will remain intact to ensure owner accounts * can continue to be used with a consistent login experience: * * the user continues to be associated to existing owner accounts and * identifying features - * * identifying features whose remote send was disabled continue to be - * associated with the owner account * * Client can continue mainting their current login session. Their current * user and data container will remain the same. diff --git a/packages/rpc/src/generated/user/v1/identity_service_pb.ts b/packages/rpc/src/generated/user/v1/identity_service_pb.ts index 0e11554..944da80 100644 --- a/packages/rpc/src/generated/user/v1/identity_service_pb.ts +++ b/packages/rpc/src/generated/user/v1/identity_service_pb.ts @@ -1,4 +1,4 @@ -// @generated by protoc-gen-es v1.3.0 with parameter "target=ts" +// @generated by protoc-gen-es v1.4.2 with parameter "target=ts" // @generated from file user/v1/identity_service.proto (package code.user.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck @@ -202,8 +202,7 @@ export class UnlinkAccountRequest extends Message { */ identifyingFeature: { /** - * The phone number associated with the owner account. Remote send features - * will be disabled on success. + * The phone number associated with the owner account. * * @generated from field: code.common.v1.PhoneNumber phone_number = 4; */ @@ -403,11 +402,11 @@ export class GetUserResponse extends Message { } | { case: undefined; value?: undefined } = { case: undefined }; /** - * Whether client beta flags are enabled for this user + * Whether client internal flags are enabled for this user * - * @generated from field: bool enable_beta_flags = 6; + * @generated from field: bool enable_internal_flags = 6; */ - enableBetaFlags = false; + enableInternalFlags = false; /** * Set of which airdrops the user is eligible to receive @@ -428,7 +427,7 @@ export class GetUserResponse extends Message { { no: 2, name: "user", kind: "message", T: User }, { no: 3, name: "data_container_id", kind: "message", T: DataContainerId }, { no: 5, name: "phone", kind: "message", T: PhoneMetadata, oneof: "metadata" }, - { no: 6, name: "enable_beta_flags", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 6, name: "enable_internal_flags", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, { no: 7, name: "eligible_airdrops", kind: "enum", T: proto3.getEnumType(AirdropType), repeated: true }, ]);