Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ export class BroadridgeSettlementAuthorizationBuilder extends CantonCommandBuild
},
};
this.command(command);
const createArguments = operation === 'Create' ? params.choiceArgument ?? {} : {};
const client = typeof createArguments.client === 'string' ? createArguments.client : undefined;
const executor = typeof createArguments.executor === 'string' ? createArguments.executor : undefined;
this._broadridge = {
protocol: 'broadridge',
standard: 'CIP-56',
Expand All @@ -182,7 +185,8 @@ export class BroadridgeSettlementAuthorizationBuilder extends CantonCommandBuild
...(operation !== 'Create' ? { choice: operation } : {}),
role,
actors: [...params.actAs],
...(params.contractId ? { contractId: params.contractId } : {}),
...(client ? { client } : {}),
...(executor ? { executor } : {}),
...(params.requestCid ? { requestCid: params.requestCid } : {}),
...(params.agreementCid ? { agreementCid: params.agreementCid } : {}),
...(params.settlement ? { settlement: params.settlement } : {}),
Expand Down
2 changes: 1 addition & 1 deletion modules/sdk-coin-canton/src/lib/clearSigning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface DecodedCantonTransaction {
choice?: string;
/** Contract ID being exercised — present for ExerciseCommand only */
contractId?: string;
/** Parties acting on this command — present for ExerciseCommand only */
/** Parties acting on this command — submitter actAs for CreateCommand, root acting parties for ExerciseCommand */
actingParties?: string[];
}

Expand Down
4 changes: 3 additions & 1 deletion modules/sdk-coin-canton/src/lib/iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export interface BroadridgeProtocolDescriptor {
choice?: string;
role: 'client' | 'executor' | 'trading-party' | 'agreement' | 'request' | 'allocation';
actors: string[];
client?: string;
executor?: string;
contractId?: string;
requestCid?: string;
agreementCid?: string;
Expand Down Expand Up @@ -421,5 +423,5 @@ export interface CantonCommandInfo {
argument: unknown;
choice?: string; // ExerciseCommand only
contractId?: string; // ExerciseCommand only
actingParties?: string[]; // ExerciseCommand only
actingParties?: string[]; // Submitter actAs for CreateCommand; root acting parties for ExerciseCommand
}
1 change: 1 addition & 0 deletions modules/sdk-coin-canton/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ export class Utils implements BaseUtils {
entityName: createNode.templateId.entityName,
},
argument: this.damlValueToJson(createNode.argument),
actingParties: [...(decoded.metadata?.submitterInfo?.actAs ?? [])],
};
}
if (nodeType.oneofKind === 'exercise') {
Expand Down
14 changes: 14 additions & 0 deletions modules/sdk-coin-canton/test/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,17 @@ export const TransferPreapprovalCancelPrepareResponse = {
preparedTransactionHash: 'placeholder-hash-not-cryptographically-verified==',
hashingSchemeVersion: 'HASHING_SCHEME_VERSION_V2',
};

export const CantonStandingDelegationPrepareResponse = {
preparedTransaction:
'CuAICgMyLjESATAasQgKATDCPqoICqcICgMyLjESQjAwYmU0YWI1OTdmNzMwNWVkMzdiM2VlYjgzYzQwNWVhMDc3ZGVlZjlkNDBmY2M2ZmIzZGU0ZjEwZDMxMzExYWQzMBopYnJvYWRyaWRnZS1zZXR0bGVtZW50LWF1dGhvcml6YXRpb24tY2lwNTYimQEKQDNmZTVjMzQyNDUyMDE0NmU1NGY0M2IyYzc0NTQzZmEzODdiMDA3NzJmZDE5OGIwYTI3MDc5NzA4Y2M1OTg2NjMSOkJyb2FkcmlkZ2UuVG9rZW4uSW1wbGVtZW50YXRpb25zLlN0YW5kaW5nRGVsZWdhdGlvbkltcGxfdjEaGVN0YW5kaW5nRGVsZWdhdGlvbkltcGxfdjEqkQRyjgQKmQEKQDNmZTVjMzQyNDUyMDE0NmU1NGY0M2IyYzc0NTQzZmEzODdiMDA3NzJmZDE5OGIwYTI3MDc5NzA4Y2M1OTg2NjMSOkJyb2FkcmlkZ2UuVG9rZW4uSW1wbGVtZW50YXRpb25zLlN0YW5kaW5nR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kZjA1ZGE1Yjc0Mjk1NmQ1NmE2MmFlMjM2Nzc2OTA3OWQyEiQ3M2Q2YTViYi1jYzM4LTRkZTYtOWU1YS04ZTA0NDc5OTk0NjIaWWdsb2JhbC1kb21haW46OjEyMjBmMjJhOGI4ZjJkODEzYzI1YjlhNjg0ZGM0ZGQ1MmI1MzJhMDE3NGQ4ZTczYTEzY2RmMmJhYWJmZmY3NTE4MzM3OjozNS0zKiRkNTBlYzFjZS0wMDQ4LTQ2ZWQtOTI2Ni0zY2MzYzk0ODZiODQwxt+S97DNlwM=',
preparedTransactionHash: 'ksIGb7rHHuKuVP8RDe1f2NBTuUeeJTXfdYm1HonctHs=',
hashingSchemeVersion: 'HASHING_SCHEME_VERSION_V2',
hashingDetails: null,
costEstimation: {
estimationTimestamp: '2026-10-22T10:09:19.086839Z',
confirmationRequestTrafficCostEstimation: 3491,
confirmationResponseTrafficCostEstimation: 0,
totalTrafficCostEstimation: 3491,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ describe('Broadridge Settlement Authorization Builder', function () {
});
assert.equal(request.broadridge?.standard, 'CIP-56');
assert.equal(request.broadridge?.role, 'client');
assert.equal(request.broadridge?.client, client);
assert.equal(request.broadridge?.executor, executor);
assert.equal(request.broadridge?.entityName, 'StandingDelegationImpl_v1');
});

Expand Down
27 changes: 27 additions & 0 deletions modules/sdk-coin-canton/test/unit/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CANTON_ADDRESSES,
CANTON_BLOCK_HEIGHT,
CantonAllocationAllocatePrepareResponse,
CantonStandingDelegationPrepareResponse,
CantonAllocationAllocateNativePrepareResponse,
CantonAllocationAllocateNativeV2ReceiveOnlyPreparedResponse,
CantonAllocationAllocateTokenV2ReceiveOnlyPreparedResponse,
Expand Down Expand Up @@ -236,6 +237,32 @@ describe('Canton Util', function () {
assert.equal(parsedData.amount, '5000000000');
assert.equal(parsedData.token, 'tcanton:tt');
});

it('should parse the Broadridge standing delegation prepared transaction', () => {
const parsedData = utils.parseRawCantonTransactionData(
CantonStandingDelegationPrepareResponse.preparedTransaction,
TransactionType.CantonCommand
);
should.exist(parsedData.broadridgeSettlementAuthorizationData);
assert.equal(parsedData.sender, '');
assert.equal(parsedData.receiver, '');
assert.equal(parsedData.amount, '0');
assert.equal(
parsedData.broadridgeSettlementAuthorizationData?.descriptor.entityName,
'StandingDelegationImpl_v1'
);
assert.equal(
parsedData.broadridgeSettlementAuthorizationData?.client,
'test-delegation::122092e7d33ac10c0f3d55976342f37555df05da5b742956d56a62ae2367769079d2'
);
assert.equal(
parsedData.broadridgeSettlementAuthorizationData?.executor,
'btgo-operator::1220eb693ade486ff8a112f999e6392fc0427bc14da42ee20e51998575a53efef0cd'
);
assert.deepStrictEqual(parsedData.broadridgeSettlementAuthorizationData?.descriptor.actors, [
'test-delegation::122092e7d33ac10c0f3d55976342f37555df05da5b742956d56a62ae2367769079d2',
]);
});
});

describe('Wallet init transaction', function () {
Expand Down
Loading