Skip to content

Commit d16a60a

Browse files
authored
chore(dapp/sdk): Stop using deprecated APIs from @iota/iota-sdk (#1160)
* chore(dapp/sdk): Stop using deprecated APIs from `@iota/iota-sdk` * changesets
1 parent 48e2a8a commit d16a60a

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

.changeset/khaki-parrots-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@iota/iota-names-sdk': patch
3+
---
4+
5+
Stopped using deprecated APIs from `@iota/iota-sdk`

dapp/src/auctions/hooks/useAuctionHouse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { graphql } from '@iota/iota-sdk/graphql/schemas/2025.2';
5-
import { fromB64 } from '@iota/iota-sdk/utils';
5+
import { fromBase64 } from '@iota/iota-sdk/utils';
66
import { useQuery, UseQueryResult } from '@tanstack/react-query';
77

88
import { useIotaNamesClient } from '@/contexts';
@@ -62,7 +62,7 @@ export function useAuctionHouse(): UseQueryResult<AuctionHouseData | null, Error
6262
return null;
6363
}
6464

65-
const auctionHouse = AuctionHouseBcs.parse(fromB64(auctionHouseBcsB64));
65+
const auctionHouse = AuctionHouseBcs.parse(fromBase64(auctionHouseBcsB64));
6666

6767
return {
6868
auctionHouseId: auctionHouseData.address,

dapp/src/auctions/lib/utils/metadata.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { getNameType } from '@iota/iota-names-sdk';
55
import { IotaGraphQLClient } from '@iota/iota-sdk/graphql';
66
import { graphql } from '@iota/iota-sdk/graphql/schemas/2025.2';
7-
import { fromB64 } from '@iota/iota-sdk/utils';
7+
import { fromBase64 } from '@iota/iota-sdk/utils';
88

99
import { queryKey } from '@/hooks';
1010

@@ -112,7 +112,7 @@ function parseAuctionDataBcs(
112112
}
113113

114114
try {
115-
return AuctionFieldBcs.parse(fromB64(auctionBcsB64));
115+
return AuctionFieldBcs.parse(fromBase64(auctionBcsB64));
116116
} catch (error) {
117117
return null;
118118
}

scripts/utils/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Ed25519Keypair } from '@iota/iota-sdk/keypairs/ed25519';
1313
import { Secp256k1Keypair } from '@iota/iota-sdk/keypairs/secp256k1';
1414
import { Secp256r1Keypair } from '@iota/iota-sdk/keypairs/secp256r1';
1515
import { Transaction, UpgradePolicy } from '@iota/iota-sdk/transactions';
16-
import { toB64 } from '@iota/iota-sdk/utils';
16+
import { toBase64 } from '@iota/iota-sdk/utils';
1717

1818
import { PackageInfo } from '../package-info/constants';
1919

@@ -239,7 +239,7 @@ export const prepareMultisigTx = async (tx: Transaction, network: string, addres
239239
tx.build({
240240
client,
241241
}).then((bytes) => {
242-
let serializedBase64 = toB64(bytes);
242+
let serializedBase64 = toBase64(bytes);
243243

244244
const output_location =
245245
process.env.NODE_ENV === 'development' ? './tx/tx-data-local.txt' : './tx/tx-data.txt';

sdk/src/iota-names-client.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { bcs } from '@iota/iota-sdk/bcs';
66
import { IotaGraphQLClient } from '@iota/iota-sdk/graphql';
77
import { graphql } from '@iota/iota-sdk/graphql/schemas/2025.2';
8-
import { fromB64, toB64 } from '@iota/iota-sdk/utils';
8+
import { fromBase64, toBase64 } from '@iota/iota-sdk/utils';
99
import { blake2b } from '@noble/hashes/blake2b';
1010
import { bytesToHex, hexToBytes } from '@noble/hashes/utils';
1111

@@ -89,7 +89,7 @@ export class IotaNamesClient {
8989
const iotaNamesObjectId = this.getPackage('iotaNamesObjectId', 'v1');
9090
const packageId = this.getPackage('packageId', 'v1');
9191

92-
const coreConfigBcsB64 = toB64(
92+
const coreConfigBcsB64 = toBase64(
9393
DummyFieldBcs.serialize({
9494
dummy_field: false,
9595
}).toBytes(),
@@ -136,7 +136,7 @@ export class IotaNamesClient {
136136
const packageId = this.getPackage('packageId', 'v1');
137137
const subnamesPackageId = this.getPackage('subnamesPackageId', 'v1');
138138

139-
const subnamesConfigBcsB64 = toB64(
139+
const subnamesConfigBcsB64 = toBase64(
140140
DummyFieldBcs.serialize({
141141
dummy_field: false,
142142
}).toBytes(),
@@ -187,7 +187,7 @@ export class IotaNamesClient {
187187
const iotaNamesObjectId = this.getPackage('iotaNamesObjectId', 'v1');
188188
const packageId = this.getPackage('packageId', 'v1');
189189

190-
const pricingConfigBcsB64 = toB64(
190+
const pricingConfigBcsB64 = toBase64(
191191
DummyFieldBcs.serialize({
192192
dummy_field: false,
193193
}).toBytes(),
@@ -250,7 +250,7 @@ export class IotaNamesClient {
250250
const iotaNamesObjectId = this.getPackage('iotaNamesObjectId', 'v1');
251251
const packageId = this.getPackage('packageId', 'v1');
252252

253-
const pricingConfigBcsB64 = toB64(
253+
const pricingConfigBcsB64 = toBase64(
254254
DummyFieldBcs.serialize({
255255
dummy_field: false,
256256
}).toBytes(),
@@ -326,7 +326,7 @@ export class IotaNamesClient {
326326
const iotaNamesObjectId = this.getPackage('iotaNamesObjectId', 'v1');
327327
const packageId = this.getPackage('packageId', 'v1');
328328

329-
const denyListBcsB64 = toB64(
329+
const denyListBcsB64 = toBase64(
330330
DummyFieldBcs.serialize({
331331
dummy_field: false,
332332
}).toBytes(),
@@ -436,7 +436,7 @@ export class IotaNamesClient {
436436
const registryTableId = this.getPackage('registryTableId', 'v1');
437437
const packageId = this.getPackage('packageId', 'v1');
438438

439-
const nameBcsB64 = toB64(
439+
const nameBcsB64 = toBase64(
440440
NameBcs.serialize({
441441
labels: normalizeIotaName(name, 'dot').split('.').reverse(),
442442
}).toBytes(),
@@ -538,7 +538,7 @@ export class IotaNamesClient {
538538
throw new Error('Coupon house not found or is invalid');
539539
}
540540

541-
return CouponHouseBcs.parse(fromB64(couponsHouseDynamicFieldBcsValue));
541+
return CouponHouseBcs.parse(fromBase64(couponsHouseDynamicFieldBcsValue));
542542
}
543543

544544
async resolveCoupon(couponCode: string): Promise<Coupon | null> {
@@ -585,7 +585,7 @@ export class IotaNamesClient {
585585
return null;
586586
}
587587

588-
const couponData = CouponBcs.parse(fromB64(couponBcsBase64));
588+
const couponData = CouponBcs.parse(fromBase64(couponBcsBase64));
589589

590590
return { ...couponData, couponCode };
591591
}

0 commit comments

Comments
 (0)