Skip to content

Commit 23382f8

Browse files
authored
Merge branch 'master' into passkey/ticket-6-remove-passkey-from-account
2 parents 98dfc2d + c4a3039 commit 23382f8

10 files changed

Lines changed: 61 additions & 11 deletions

File tree

modules/abstract-lightning/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
]
4040
},
4141
"dependencies": {
42-
"@bitgo/public-types": "5.96.2",
42+
"@bitgo/public-types": "5.97.0",
4343
"@bitgo/sdk-core": "^36.42.0",
4444
"@bitgo/statics": "^58.37.0",
4545
"@bitgo/utxo-lib": "^11.22.0",

modules/bitgo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
"superagent": "^9.0.1"
140140
},
141141
"devDependencies": {
142-
"@bitgo/public-types": "5.96.2",
142+
"@bitgo/public-types": "5.97.0",
143143
"@bitgo/sdk-opensslbytes": "^2.1.0",
144144
"@bitgo/sdk-test": "^9.1.40",
145145
"@openpgp/web-stream-tools": "0.0.14",

modules/express/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"superagent": "^9.0.1"
6161
},
6262
"devDependencies": {
63-
"@bitgo/public-types": "5.96.2",
63+
"@bitgo/public-types": "5.97.0",
6464
"@bitgo/sdk-lib-mpc": "^10.11.1",
6565
"@bitgo/sdk-test": "^9.1.40",
6666
"@types/argparse": "^1.0.36",

modules/sdk-coin-canton/src/lib/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,17 @@ export class Utils implements BaseUtils {
247247
extractFromTransferRecord(transferSum.record?.fields ?? [], 'instrumentId', 'admin');
248248
}
249249
}
250+
// USDCx/two-step token fallback: TransferRule_TwoStepTransfer exercise node
251+
// → transfer.{sender, receiver, amount, instrumentId.{admin, id}}
252+
if (!sender) {
253+
const twoStepTransferFields = findExerciseNodeFields('TransferRule_TwoStepTransfer');
254+
if (twoStepTransferFields) {
255+
const transferSum = getField(twoStepTransferFields, 'transfer');
256+
if (transferSum?.oneofKind === 'record') {
257+
extractFromTransferRecord(transferSum.record?.fields ?? [], 'instrumentId', 'admin');
258+
}
259+
}
260+
}
250261
break;
251262
}
252263

modules/sdk-coin-canton/test/resources.ts

Lines changed: 14 additions & 0 deletions
Large diffs are not rendered by default.

modules/sdk-coin-canton/test/unit/builder/transferAccept/transferAcceptBuilder.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { CantonTransferAcceptRejectRequest } from '../../../../src/lib/iface';
99
import {
1010
CantonTokenAcceptPrepareResponse,
1111
CBTCTokenAcceptancePrepareResponse,
12+
USDCxTokenAcceptancePrepareResponse,
1213
TransferAcceptance,
1314
TransferAcceptancePrepareResponse,
1415
} from '../../../resources';
@@ -72,6 +73,30 @@ describe('Transfer Acceptance Builder', () => {
7273
assert.equal(txData.token, 'canton:cbtc');
7374
});
7475

76+
it('should get the transfer acceptance request object for usdcx token', function () {
77+
const txBuilder = new TransferAcceptanceBuilder(coins.get('tcanton'));
78+
const transferAcceptanceTx = new Transaction(coins.get('tcanton'));
79+
txBuilder.initBuilder(transferAcceptanceTx);
80+
txBuilder.setTransaction(USDCxTokenAcceptancePrepareResponse);
81+
const commandId = '3935a06d-3b03-41be-99a5-95b2ecaabf7d';
82+
const partyId = '1220d::1220dc555fb89a30ab098ffb28b8cf1532053076a736bf6ed3b3c7da6fb4d710b4aa';
83+
const { contractId } = TransferAcceptance;
84+
txBuilder.commandId(commandId).contractId(contractId).actAs(partyId);
85+
const requestObj: CantonTransferAcceptRejectRequest = txBuilder.toRequestObject();
86+
const txData = txBuilder.transaction.toJson();
87+
should.exist(requestObj);
88+
assert.equal(requestObj.commandId, commandId);
89+
assert.equal(requestObj.contractId, contractId);
90+
assert.equal(requestObj.actAs.length, 1);
91+
const actAs = requestObj.actAs[0];
92+
assert.equal(actAs, partyId);
93+
should.exist(txData);
94+
assert.equal(txData.sender, '12201::1220175583b704cbb493393c1dbe17b9909ee4cf55ef345e8147cd6900c5768f861d');
95+
assert.equal(txData.receiver, partyId);
96+
assert.equal(txData.amount, '10000000000');
97+
assert.equal(txData.token, 'canton:usdcx');
98+
});
99+
75100
it('should validate raw transaction', function () {
76101
const txBuilder = new TransferAcceptanceBuilder(coins.get('tcanton'));
77102
const transferAcceptanceTx = new Transaction(coins.get('tcanton'));

modules/sdk-coin-flrp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@bitgo/sdk-test": "^9.1.40"
4848
},
4949
"dependencies": {
50-
"@bitgo/public-types": "5.96.2",
50+
"@bitgo/public-types": "5.97.0",
5151
"@bitgo/sdk-core": "^36.42.0",
5252
"@bitgo/secp256k1": "^1.11.0",
5353
"@bitgo/statics": "^58.37.0",

modules/sdk-coin-sol/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
"dependencies": {
5959
"@bitgo/logger": "^1.4.0",
60-
"@bitgo/public-types": "5.96.2",
60+
"@bitgo/public-types": "5.97.0",
6161
"@bitgo/sdk-core": "^36.42.0",
6262
"@bitgo/sdk-lib-mpc": "^10.11.1",
6363
"@bitgo/statics": "^58.37.0",

modules/statics/src/networks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,8 @@ class XtzEvmTestnet extends Testnet implements EthereumNetwork {
743743
family = CoinFamily.XTZEVM;
744744
explorerUrl = 'https://shadownet.explorer.etherlink.com/tx/';
745745
accountExplorerUrl = 'https://shadownet.explorer.etherlink.com/address/';
746-
chainId = 128123;
747-
nativeCoinOperationHashPrefix = '128123';
746+
chainId = 127823;
747+
nativeCoinOperationHashPrefix = '127823';
748748
}
749749

750750
class Pyrmont extends Testnet implements AccountNetwork {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -999,10 +999,10 @@
999999
"@scure/base" "1.1.5"
10001000
micro-eth-signer "0.7.2"
10011001

1002-
"@bitgo/public-types@5.96.2":
1003-
version "5.96.2"
1004-
resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.96.2.tgz#ae5ffe68a94742e72def3cec15bf236adaed50f5"
1005-
integrity sha512-fUwUXP0MLitOyg2blaAxCC04aplrj7XqsTEMFENxJg21ovHyO2mB4vz3IGOnwNipgx6jaCgplZAnPxcKu7N/nw==
1002+
"@bitgo/public-types@5.97.0":
1003+
version "5.97.0"
1004+
resolved "https://registry.npmjs.org/@bitgo/public-types/-/public-types-5.97.0.tgz#d75f19e92863cdeed297da9e6fd52b6883207624"
1005+
integrity sha512-jQiBXMAcc1hSzTtScDaqQGtFIC6hyyQ5ZWhs1IoOHrg8XLQe6BbgZb/t997kXp1i0KIp2EapJFhpmVlVURh62A==
10061006
dependencies:
10071007
fp-ts "^2.0.0"
10081008
io-ts "npm:@bitgo-forks/io-ts@2.1.4"

0 commit comments

Comments
 (0)