Skip to content

Commit 055f92c

Browse files
Google APIscopybara-github
authored andcommitted
feat: add CreateContractTokenManager and TransferContractTokenManager transactions
fix!: An existing enum `FeePayer` is removed fix!: An existing message `FractionalFee` is removed fix!: An existing field `fractional_fee` is removed from message `.google.cloud.universalledger.v1.Transfer` docs: clarify list of supported transactions PiperOrigin-RevId: 869710913
1 parent d84d3c2 commit 055f92c

5 files changed

Lines changed: 100 additions & 60 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
exports_files(glob(["*.yaml"]))
2+
3+
load(
4+
"@com_google_googleapis_imports//:imports.bzl",
5+
"nodejs_gapic_combined_pkg"
6+
)
7+
8+
9+
nodejs_gapic_combined_pkg(
10+
name = "google-cloud-universalledger-nodejs",
11+
default_version = "v1",
12+
templates_excludes = ["package.json"],
13+
deps = [
14+
"//google/cloud/universalledger/v1:universalledger-v1-nodejs",
15+
],
16+
)

google/cloud/universalledger/v1/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ proto_library_with_info(
4747
deps = [
4848
":universalledger_proto",
4949
"//google/cloud:common_resources_proto",
50+
"//google/cloud/location:location_proto",
5051
],
5152
)
5253

@@ -83,11 +84,13 @@ java_gapic_library(
8384
service_yaml = "universalledger_v1.yaml",
8485
test_deps = [
8586
":universalledger_java_grpc",
87+
"//google/cloud/location:location_java_grpc",
8688
],
8789
transport = "grpc+rest",
8890
deps = [
8991
":universalledger_java_proto",
9092
"//google/api:api_java_proto",
93+
"//google/cloud/location:location_java_proto",
9194
],
9295
)
9396

@@ -145,6 +148,7 @@ go_gapic_library(
145148
transport = "grpc+rest",
146149
deps = [
147150
":universalledger_go_proto",
151+
"//google/cloud/location:location_go_proto",
148152
],
149153
)
150154

@@ -330,6 +334,7 @@ load(
330334

331335
csharp_proto_library(
332336
name = "universalledger_csharp_proto",
337+
extra_opts = [],
333338
deps = [":universalledger_proto"],
334339
)
335340

google/cloud/universalledger/v1/transactions.proto

Lines changed: 77 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,6 @@ option java_package = "com.google.cloud.universalledger.v1";
2828
option php_namespace = "Google\\Cloud\\UniversalLedger\\V1";
2929
option ruby_package = "Google::Cloud::UniversalLedger::V1";
3030

31-
// Specifies who pays the transaction fees.
32-
enum FeePayer {
33-
// Unspecified fee payer. This value is invalid.
34-
FEE_PAYER_UNSPECIFIED = 0;
35-
36-
// Indicates that the sender should be charged the fees in addition to the
37-
// transfer amount. For example, if A is sending `$100` to B and the fee is
38-
// `$1`, then A's account is debited `$100 + $1 = $101` and B's account is
39-
// credited `$100`.
40-
FEE_PAYER_SENDER = 1;
41-
42-
// Indicates that the receiver should be charged the fees. For example,
43-
// if A is sending `$100` to B and the fee is `$1`, then A's account is
44-
// debited `$100` and B's account is credited `$100 - $1 = $99`.
45-
FEE_PAYER_RECEIVER = 2;
46-
47-
// Indicates that a separate fee account should be charged the fees. For
48-
// example, if A is sending `$100` to B and the fee is `$1`, then A's account
49-
// is debited `$100` and B's account is credited `$100`. The fee of `$1` will
50-
// be debited from a separate fee account specified elsewhere.
51-
FEE_PAYER_OTHER = 3;
52-
}
53-
5431
// Specifies the format a public key is provided in.
5532
enum KeyFormat {
5633
// The key format is unspecified. This value is invalid and should not be
@@ -85,37 +62,6 @@ enum SettlementMode {
8562
SETTLEMENT_MODE_INSTANT = 2;
8663
}
8764

88-
// Fee structure where the fee is proportional to some reference amount.
89-
// The reference amount would usually be the payment amount but the specific
90-
// choice is up to each transaction type that includes this fee stanza.
91-
message FractionalFee {
92-
// Required. A percentage expressed in multiples of hundredths of a basis
93-
// point, where 1 basis point = 0.01%. For example, 1% is expressed as an
94-
// amount of 10000, while 0.01% (= 1 bp) is expressed as an amount of 100.
95-
int64 amount = 1 [(google.api.field_behavior) = REQUIRED];
96-
97-
// Optional. Indicates who pays the fee. By default, it will be the
98-
// transaction sender. If set to `FEE_PAYER_OTHER`, then a valid fee account
99-
// must also be supplied in `fee_account_id` (or the deprecated `fee_account`
100-
// field).
101-
FeePayer fee_payer = 2 [(google.api.field_behavior) = OPTIONAL];
102-
103-
// Optional. Optional fee account in case the fee is to be paid from an
104-
// account other than the transaction sender or receiver. If a fee account is
105-
// specified, fee payer must be set to `FEE_PAYER_OTHER` and the transaction
106-
// must also be signed by the fee account. Deprecated: use `fee_account_id`
107-
// instead.
108-
Entity fee_account = 3
109-
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
110-
111-
// Optional. The ID of the account from which the fee is paid. This is an
112-
// optional field which is only required if the fee is to be paid from an
113-
// account other than the transaction sender or receiver. If a fee account ID
114-
// is specified, fee payer must be set to `FEE_PAYER_OTHER` and the
115-
// transaction must also be signed by the fee account.
116-
string fee_account_id = 4 [(google.api.field_behavior) = OPTIONAL];
117-
}
118-
11965
// Initiates a settlement operation between two token managers.
12066
// The sender must be a clearinghouse account.
12167
//
@@ -422,10 +368,6 @@ message Transfer {
422368

423369
// Required. The amount to transfer. The amount must be positive.
424370
CurrencyValue amount = 2 [(google.api.field_behavior) = REQUIRED];
425-
426-
// Optional. The transaction fee to be paid, as a fraction of the amount to
427-
// transfer.
428-
FractionalFee fractional_fee = 3 [(google.api.field_behavior) = OPTIONAL];
429371
}
430372

431373
// Creates a new token manager associated to the currency of the operator
@@ -710,3 +652,80 @@ message InvokeContractMethod {
710652
// non-payable ones.
711653
CurrencyValue payment = 4;
712654
}
655+
656+
// Creates a new contract token manager associated with the currency of the
657+
// operator sending the request. The sender must be a currency operator.
658+
// The newly created contract token manager will be active by default. If the
659+
// contract token manager has to be replaced, the TransferContractTokenManager
660+
// transaction should be sent instead. If another contract token manager
661+
// associated to the same currency exists, this transaction will fail.
662+
//
663+
// Unlike regular token managers, contract token managers are not allowed to
664+
// execute transactions such as mint or burn. They can, however, participate in
665+
// settlement operations.
666+
//
667+
// If the transaction is successful, the ID of the newly created account is
668+
// returned as an event in the
669+
// [TransactionCertificate][google.cloud.universalledger.v1.TransactionCertificate]
670+
// of the finalized transaction.
671+
message CreateContractTokenManager {
672+
// Required. The public key of the new contract token manager. Note that this
673+
// is *not* the public key of the operator. This public key will be associated
674+
// with the contract token manager and stored on the ledger. It will be used
675+
// to validate the signature of the transactions emanating from the contract
676+
// token manager's account.
677+
//
678+
// The format of the public key is defined by the `key_format` field.
679+
bytes public_key = 1 [(google.api.field_behavior) = REQUIRED];
680+
681+
// Optional. Immutable. An opaque comment field that is not interpreted by the
682+
// system but stored on the ledger in the account. Maximum length is 128
683+
// characters. May be left empty. Once created, the field is immutable.
684+
string account_comment = 2 [
685+
(google.api.field_behavior) = OPTIONAL,
686+
(google.api.field_behavior) = IMMUTABLE
687+
];
688+
689+
// Optional. Immutable. The key format of the public key. If not
690+
// specified, defaults to a binary serialized keyset in [Tink wire
691+
// format](https://developers.google.com/tink/wire-format#keyset_serialization).
692+
KeyFormat key_format = 3 [
693+
(google.api.field_behavior) = OPTIONAL,
694+
(google.api.field_behavior) = IMMUTABLE
695+
];
696+
}
697+
698+
// Transfers the ownership of the contract token manager to a new account. The
699+
// sender must be the current currency operator for the currency.
700+
//
701+
// If the transaction is successful, deactivates the current contract token
702+
// manager for the currency, and the ID of the newly created account is returned
703+
// as an event in the
704+
// [TransactionCertificate][google.cloud.universalledger.v1.TransactionCertificate]
705+
// of the finalized transaction.
706+
message TransferContractTokenManager {
707+
// Required. The public key of the new contract token manager. Note that this
708+
// is *not* the public key of the operator. This is the public key of the
709+
// *new* contract token manager and it will be stored on the ledger. It will
710+
// be used to validate the signature of the transactions emanating from the
711+
// contract token manager's account.
712+
//
713+
// The format of the public key is defined by the `key_format` field.
714+
bytes public_key = 1 [(google.api.field_behavior) = REQUIRED];
715+
716+
// Optional. Immutable. An opaque comment field that is not interpreted by the
717+
// system but stored on the ledger in the account. Maximum length is 128
718+
// characters. May be left empty. Once created, the field is immutable.
719+
string account_comment = 2 [
720+
(google.api.field_behavior) = OPTIONAL,
721+
(google.api.field_behavior) = IMMUTABLE
722+
];
723+
724+
// Optional. Immutable. The key format of the public key. If not
725+
// specified, defaults to a binary serialized keyset in [Tink wire
726+
// format](https://developers.google.com/tink/wire-format#keyset_serialization).
727+
KeyFormat key_format = 3 [
728+
(google.api.field_behavior) = OPTIONAL,
729+
(google.api.field_behavior) = IMMUTABLE
730+
];
731+
}

google/cloud/universalledger/v1/types.proto

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ message ClientTransaction {
6161
// - [InvokeContractMethod][google.cloud.universalledger.v1.InvokeContractMethod]
6262
// - [CreateContractTokenManager][google.cloud.universalledger.v1.CreateContractTokenManager]
6363
// - [TransferContractTokenManager][google.cloud.universalledger.v1.TransferContractTokenManager]
64-
// - [RemoveSigningPublicKey][google.cloud.universalledger.v1.RemoveSigningPublicKey]
65-
// - [ReplaceSigningPublicKey][google.cloud.universalledger.v1.ReplaceSigningPublicKey]
6664
// <!--
6765
// clang-format on
6866
// -->

google/cloud/universalledger/v1/universalledger_v1.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ types:
1717
- name: google.cloud.universalledger.v1.CreateAccountManager
1818
- name: google.cloud.universalledger.v1.CreateClearinghouse
1919
- name: google.cloud.universalledger.v1.CreateContract
20+
- name: google.cloud.universalledger.v1.CreateContractTokenManager
2021
- name: google.cloud.universalledger.v1.CreateCurrencyOperator
2122
- name: google.cloud.universalledger.v1.CreateSnapshot
2223
- name: google.cloud.universalledger.v1.CreateTokenManager
@@ -30,6 +31,7 @@ types:
3031
- name: google.cloud.universalledger.v1.SettlementRequest
3132
- name: google.cloud.universalledger.v1.SignedTransaction
3233
- name: google.cloud.universalledger.v1.Transfer
34+
- name: google.cloud.universalledger.v1.TransferContractTokenManager
3335
- name: google.cloud.universalledger.v1.TransferCurrencyOperator
3436
- name: google.cloud.universalledger.v1.TransferPlatformOperator
3537

0 commit comments

Comments
 (0)