Skip to content

Commit 5e7b17c

Browse files
committed
chore: update opencode protos
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent a5127d0 commit 5e7b17c

5 files changed

Lines changed: 29 additions & 11 deletions

File tree

definitions/opencode/protos/src/main/proto/account/v1/account_service.proto

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,30 @@ message IsCodeAccountResponse {
4747
}
4848

4949
message GetTokenAccountInfosRequest {
50-
// The owner account, which can also be thought of as a parent account for this
51-
// RPC that links to one or more token accounts.
50+
// The owner account to fetch balances for, which can also be thought of as a
51+
// parent account for this RPC that links to one or more token accounts.
5252
common.v1.SolanaAccountId owner = 1;
5353

5454

55-
// The signature is of serialize(GetTokenAccountInfosRequest) without this field set
56-
// using the private key of the owner account. This provides an authentication
57-
// mechanism to the RPC.
55+
// The signature is of serialize(GetTokenAccountInfosRequest) without signature
56+
// fields set using the private key of the owner account. This provides
57+
// an authentication mechanism to the RPC.
5858
common.v1.Signature signature = 2;
5959

60+
61+
// A requesting owner account that is requesting the balance for owner. Additional
62+
// metadata that is considered private will be provided, if applicable. An example
63+
// use case includes a user owner account requesting account info for a gift card
64+
// owner account.
65+
common.v1.SolanaAccountId requesting_owner = 3;
66+
67+
// The signature is of serialize(GetTokenAccountInfosRequest) without signature
68+
// fields set using the private key of the requesting_owner_signature account.
69+
// This provides an authentication mechanism to the RPC when requesting_owner is
70+
// present.
71+
//
72+
// This must be set when requesting_owner is present.
73+
common.v1.Signature requesting_owner_signature = 4;
6074
}
6175

6276
message GetTokenAccountInfosResponse {
@@ -194,4 +208,8 @@ message TokenAccountInfo {
194208
// the time of intent submission. Otherwise, for external accounts, it is
195209
// the tiem created on the blockchain.
196210
google.protobuf.Timestamp created_at = 17;
211+
212+
// For REMOTE_SEND_GIFT_CARD, if requesting_owner was provided, was
213+
// requesting_owner the issuer of the account.
214+
bool is_gift_card_issuer = 18;
197215
}

definitions/opencode/protos/src/main/proto/transaction/v2/transaction_service.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ message FeePaymentAction {
409409
FeeType type = 1;
410410
enum FeeType {
411411
UNKNOWN = 0;
412-
WITHDRAWAL_CREATE_ON_SEND = 1; // Server-defined fee for creating an external ATA for withdrawals on send
412+
CREATE_ON_SEND_WITHDRAWAL = 1; // Server-defined fee for creating an external ATA on withdrawals on send
413413
}
414414
// The public key of the private key that has authority over source
415415
common.v1.SolanaAccountId authority = 2;
@@ -464,7 +464,7 @@ message NoPrivacyWithdrawServerParameter {
464464
message FeePaymentServerParameter {
465465
// The destination account where OCP fee payments should be sent. This will
466466
// only be set when the corresponding FeePaymentAction.Type:
467-
// - WITHDRAWAL_CREATE_ON_SEND
467+
// - CREATE_ON_SEND_WITHDRAWAL
468468
common.v1.SolanaAccountId destination = 1;
469469
}
470470
//

services/opencode/src/main/kotlin/com/getcode/opencode/controllers/TransactionController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class TransactionController @Inject constructor(
126126
): Result<IntentType> {
127127
val intent = IntentWithdraw.create(
128128
amount = amount,
129-
fee = fee?.let { Fee(it, FeeType.WithdrawalCreateOnSend) },
129+
fee = fee?.let { Fee(it, FeeType.CreateOnSendWithdrawal) },
130130
sourceCluster = owner,
131131
destination = destination,
132132
destinationOwner = destinationOwner,

services/opencode/src/main/kotlin/com/getcode/opencode/internal/network/api/intents/actions/ActionFeePayment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ internal class ActionFeePayment(
2222
val configs = serverParameter?.configs ?: return emptyList()
2323

2424
val destination = when (fee.type) {
25-
FeeType.WithdrawalCreateOnSend -> {
25+
FeeType.CreateOnSendWithdrawal -> {
2626
(serverParameter?.parameter as? ServerParameter.Parameter.FeePayment)?.publicKey
2727
?: return emptyList()
2828
}
@@ -51,7 +51,7 @@ internal class ActionFeePayment(
5151
.setSource(source.vaultPublicKey.asSolanaAccountId())
5252
.setType(
5353
when (fee.type) {
54-
FeeType.WithdrawalCreateOnSend -> TransactionService.FeePaymentAction.FeeType.WITHDRAWAL_CREATE_ON_SEND
54+
FeeType.CreateOnSendWithdrawal -> TransactionService.FeePaymentAction.FeeType.CREATE_ON_SEND_WITHDRAWAL
5555
}
5656
)
5757
.setAuthority(source.authority.keyPair.asSolanaAccountId())

services/opencode/src/main/kotlin/com/getcode/opencode/model/financial/Fee.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ data class Fee(
66
)
77

88
sealed interface FeeType {
9-
data object WithdrawalCreateOnSend: FeeType
9+
data object CreateOnSendWithdrawal: FeeType
1010
}

0 commit comments

Comments
 (0)