Skip to content

Commit 942af4f

Browse files
authored
Merge pull request #6908 from WalletConnect/fix/tvf
fix: tvf
2 parents 8d62ad2 + 69f4b68 commit 942af4f

File tree

3 files changed

+55
-43
lines changed

3 files changed

+55
-43
lines changed

.changeset/metal-socks-invent.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@walletconnect/sign-client": patch
3+
"@walletconnect/core": patch
4+
"@walletconnect/react-native-compat": patch
5+
"@walletconnect/types": patch
6+
"@walletconnect/utils": patch
7+
"@walletconnect/ethereum-provider": patch
8+
"@walletconnect/signer-connection": patch
9+
"@walletconnect/universal-provider": patch
10+
---
11+
12+
Flattens TVF params instead of nesting them

packages/core/src/controllers/publisher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class Publisher extends IPublisher {
6666
prompt,
6767
tag,
6868
attestation: opts?.attestation,
69-
...(opts?.tvf && { tvf: opts.tvf }),
69+
...opts?.tvf,
7070
},
7171
};
7272

packages/sign-client/test/sdk/client.spec.ts

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ describe("Sign Client Integration", () => {
874874

875875
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
876876
checkedWalletPublish = true;
877-
const tvf = publishPayload.tvf;
877+
const tvf = publishPayload.params;
878878
expect(tvf).to.exist;
879879
expect(tvf?.chainId).to.eq(params.chainId);
880880
expect(tvf?.rpcMethods).to.eql([params.request.method]);
@@ -921,7 +921,7 @@ describe("Sign Client Integration", () => {
921921

922922
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
923923
checkedDappPublish = true;
924-
const tvf = publishPayload.tvf;
924+
const tvf = publishPayload.params;
925925
expect(tvf).to.exist;
926926
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
927927
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -957,7 +957,7 @@ describe("Sign Client Integration", () => {
957957

958958
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
959959
checkedWalletPublish = true;
960-
const tvf = publishPayload.tvf;
960+
const tvf = publishPayload.params;
961961

962962
expect(tvf).to.exist;
963963
expect(tvf?.chainId).to.eq(params.chainId);
@@ -1005,7 +1005,7 @@ describe("Sign Client Integration", () => {
10051005

10061006
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
10071007
checkedDappPublish = true;
1008-
const tvf = publishPayload.tvf;
1008+
const tvf = publishPayload.params;
10091009
expect(tvf).to.exist;
10101010
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
10111011
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1044,7 +1044,7 @@ describe("Sign Client Integration", () => {
10441044

10451045
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
10461046
checkedWalletPublish = true;
1047-
const tvf = publishPayload.tvf;
1047+
const tvf = publishPayload.params;
10481048

10491049
expect(tvf).to.exist;
10501050
expect(tvf?.chainId).to.eq(params.chainId);
@@ -1095,7 +1095,7 @@ describe("Sign Client Integration", () => {
10951095

10961096
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
10971097
checkedDappPublish = true;
1098-
const tvf = publishPayload.tvf;
1098+
const tvf = publishPayload.params;
10991099
expect(tvf).to.exist;
11001100
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
11011101
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1131,7 +1131,7 @@ describe("Sign Client Integration", () => {
11311131

11321132
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
11331133
checkedWalletPublish = true;
1134-
const tvf = publishPayload.tvf;
1134+
const tvf = publishPayload.params;
11351135

11361136
expect(tvf).to.exist;
11371137
expect(tvf?.chainId).to.eq(params.chainId);
@@ -1179,7 +1179,7 @@ describe("Sign Client Integration", () => {
11791179

11801180
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
11811181
checkedDappPublish = true;
1182-
const tvf = publishPayload.tvf;
1182+
const tvf = publishPayload.params;
11831183
expect(tvf).to.exist;
11841184
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
11851185
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1214,7 +1214,7 @@ describe("Sign Client Integration", () => {
12141214
let checkedWalletPublish = false;
12151215

12161216
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1217-
const tvf = publishPayload.tvf;
1217+
const tvf = publishPayload.params;
12181218
console.log("tvf", tvf);
12191219
if (!tvf) {
12201220
return console.error("solana tvf is undefined");
@@ -1256,7 +1256,7 @@ describe("Sign Client Integration", () => {
12561256

12571257
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
12581258
checkedDappPublish = true;
1259-
const tvf = publishPayload.tvf;
1259+
const tvf = publishPayload.params;
12601260
expect(tvf).to.exist;
12611261
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
12621262
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1292,7 +1292,7 @@ describe("Sign Client Integration", () => {
12921292
let checkedWalletPublish = false;
12931293

12941294
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1295-
const tvf = publishPayload.tvf;
1295+
const tvf = publishPayload.params;
12961296
if (!tvf) {
12971297
return console.error("solana tvf is undefined");
12981298
}
@@ -1334,7 +1334,7 @@ describe("Sign Client Integration", () => {
13341334

13351335
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
13361336
checkedDappPublish = true;
1337-
const tvf = publishPayload.tvf;
1337+
const tvf = publishPayload.params;
13381338
expect(tvf).to.exist;
13391339
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
13401340
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1380,7 +1380,7 @@ describe("Sign Client Integration", () => {
13801380
];
13811381
let checkedWalletPublish = false;
13821382
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1383-
const tvf = publishPayload.tvf;
1383+
const tvf = publishPayload.params;
13841384
if (!tvf) {
13851385
return console.error("solana tvf is undefined");
13861386
}
@@ -1422,7 +1422,7 @@ describe("Sign Client Integration", () => {
14221422

14231423
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
14241424
checkedDappPublish = true;
1425-
const tvf = publishPayload.tvf;
1425+
const tvf = publishPayload.params;
14261426
expect(tvf).to.exist;
14271427
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
14281428
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1461,7 +1461,7 @@ describe("Sign Client Integration", () => {
14611461
const expectedTxHashes = ["C98G1Uwh5soPMtZZmjUFwbVzWLMoAHzi5jrX2BtABe8v"];
14621462
let checkedWalletPublish = false;
14631463
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1464-
const tvf = publishPayload.tvf;
1464+
const tvf = publishPayload.params;
14651465
if (!tvf) {
14661466
return console.error("sui tvf is undefined");
14671467
}
@@ -1501,7 +1501,7 @@ describe("Sign Client Integration", () => {
15011501

15021502
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
15031503
checkedDappPublish = true;
1504-
const tvf = publishPayload.tvf;
1504+
const tvf = publishPayload.params;
15051505
expect(tvf).to.exist;
15061506
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
15071507
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1539,7 +1539,7 @@ describe("Sign Client Integration", () => {
15391539

15401540
let checkedWalletPublish = false;
15411541
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1542-
const tvf = publishPayload.tvf;
1542+
const tvf = publishPayload.params;
15431543
if (!tvf) {
15441544
return console.error("sui tvf is undefined");
15451545
}
@@ -1585,7 +1585,7 @@ describe("Sign Client Integration", () => {
15851585

15861586
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
15871587
checkedDappPublish = true;
1588-
const tvf = publishPayload.tvf;
1588+
const tvf = publishPayload.params;
15891589
expect(tvf).to.exist;
15901590
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
15911591
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1623,7 +1623,7 @@ describe("Sign Client Integration", () => {
16231623

16241624
let checkedWalletPublish = false;
16251625
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1626-
const tvf = publishPayload.tvf;
1626+
const tvf = publishPayload.params;
16271627
if (!tvf) {
16281628
return console.error("hedera tvf is undefined");
16291629
}
@@ -1669,7 +1669,7 @@ describe("Sign Client Integration", () => {
16691669

16701670
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
16711671
checkedDappPublish = true;
1672-
const tvf = publishPayload.tvf;
1672+
const tvf = publishPayload.params;
16731673
expect(tvf).to.exist;
16741674
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
16751675
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1707,7 +1707,7 @@ describe("Sign Client Integration", () => {
17071707

17081708
let checkedWalletPublish = false;
17091709
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1710-
const tvf = publishPayload.tvf;
1710+
const tvf = publishPayload.params;
17111711
if (!tvf) {
17121712
return console.error("hedera tvf is undefined");
17131713
}
@@ -1753,7 +1753,7 @@ describe("Sign Client Integration", () => {
17531753

17541754
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
17551755
checkedDappPublish = true;
1756-
const tvf = publishPayload.tvf;
1756+
const tvf = publishPayload.params;
17571757
expect(tvf).to.exist;
17581758
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
17591759
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1800,7 +1800,7 @@ describe("Sign Client Integration", () => {
18001800

18011801
let checkedWalletPublish = false;
18021802
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1803-
const tvf = publishPayload.tvf;
1803+
const tvf = publishPayload.params;
18041804
if (!tvf) {
18051805
return console.error("near tvf is undefined");
18061806
}
@@ -1843,7 +1843,7 @@ describe("Sign Client Integration", () => {
18431843

18441844
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
18451845
checkedDappPublish = true;
1846-
const tvf = publishPayload.tvf;
1846+
const tvf = publishPayload.params;
18471847
expect(tvf).to.exist;
18481848
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
18491849
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1893,7 +1893,7 @@ describe("Sign Client Integration", () => {
18931893

18941894
let checkedWalletPublish = false;
18951895
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1896-
const tvf = publishPayload.tvf;
1896+
const tvf = publishPayload.params;
18971897
if (!tvf) {
18981898
return console.error("near tvf is undefined");
18991899
}
@@ -1939,7 +1939,7 @@ describe("Sign Client Integration", () => {
19391939

19401940
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
19411941
checkedDappPublish = true;
1942-
const tvf = publishPayload.tvf;
1942+
const tvf = publishPayload.params;
19431943
expect(tvf).to.exist;
19441944
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
19451945
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -1979,7 +1979,7 @@ describe("Sign Client Integration", () => {
19791979

19801980
let checkedWalletPublish = false;
19811981
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
1982-
const tvf = publishPayload.tvf;
1982+
const tvf = publishPayload.params;
19831983
if (!tvf) {
19841984
return console.error("tron tvf is undefined");
19851985
}
@@ -2022,7 +2022,7 @@ describe("Sign Client Integration", () => {
20222022

20232023
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
20242024
checkedDappPublish = true;
2025-
const tvf = publishPayload.tvf;
2025+
const tvf = publishPayload.params;
20262026
expect(tvf).to.exist;
20272027
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
20282028
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -2064,7 +2064,7 @@ describe("Sign Client Integration", () => {
20642064

20652065
let checkedWalletPublish = false;
20662066
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
2067-
const tvf = publishPayload.tvf;
2067+
const tvf = publishPayload.params;
20682068
if (!tvf) {
20692069
return console.error("xrpl tvf is undefined");
20702070
}
@@ -2107,7 +2107,7 @@ describe("Sign Client Integration", () => {
21072107

21082108
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
21092109
checkedDappPublish = true;
2110-
const tvf = publishPayload.tvf;
2110+
const tvf = publishPayload.params;
21112111
expect(tvf).to.exist;
21122112
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
21132113
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -2149,7 +2149,7 @@ describe("Sign Client Integration", () => {
21492149

21502150
let checkedWalletPublish = false;
21512151
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
2152-
const tvf = publishPayload.tvf;
2152+
const tvf = publishPayload.params;
21532153
if (!tvf) {
21542154
return console.error("xrpl tvf is undefined");
21552155
}
@@ -2195,7 +2195,7 @@ describe("Sign Client Integration", () => {
21952195

21962196
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
21972197
checkedDappPublish = true;
2198-
const tvf = publishPayload.tvf;
2198+
const tvf = publishPayload.params;
21992199
expect(tvf).to.exist;
22002200
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
22012201
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -2235,7 +2235,7 @@ describe("Sign Client Integration", () => {
22352235

22362236
let checkedWalletPublish = false;
22372237
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
2238-
const tvf = publishPayload.tvf;
2238+
const tvf = publishPayload.params;
22392239
if (!tvf) {
22402240
return console.error("algorand tvf is undefined");
22412241
}
@@ -2278,7 +2278,7 @@ describe("Sign Client Integration", () => {
22782278

22792279
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
22802280
checkedDappPublish = true;
2281-
const tvf = publishPayload.tvf;
2281+
const tvf = publishPayload.params;
22822282
expect(tvf).to.exist;
22832283
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
22842284
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -2318,7 +2318,7 @@ describe("Sign Client Integration", () => {
23182318

23192319
let checkedWalletPublish = false;
23202320
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
2321-
const tvf = publishPayload.tvf;
2321+
const tvf = publishPayload.params;
23222322
if (!tvf) {
23232323
return console.error("bip122 tvf is undefined");
23242324
}
@@ -2361,7 +2361,7 @@ describe("Sign Client Integration", () => {
23612361

23622362
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
23632363
checkedDappPublish = true;
2364-
const tvf = publishPayload.tvf;
2364+
const tvf = publishPayload.params;
23652365
expect(tvf).to.exist;
23662366
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
23672367
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -2401,7 +2401,7 @@ describe("Sign Client Integration", () => {
24012401

24022402
let checkedWalletPublish = false;
24032403
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
2404-
const tvf = publishPayload.tvf;
2404+
const tvf = publishPayload.params;
24052405
if (!tvf) {
24062406
return console.error("stacks tvf is undefined");
24072407
}
@@ -2444,7 +2444,7 @@ describe("Sign Client Integration", () => {
24442444

24452445
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
24462446
checkedDappPublish = true;
2447-
const tvf = publishPayload.tvf;
2447+
const tvf = publishPayload.params;
24482448
expect(tvf).to.exist;
24492449
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
24502450
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -2487,7 +2487,7 @@ describe("Sign Client Integration", () => {
24872487

24882488
let checkedWalletPublish = false;
24892489
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
2490-
const tvf = publishPayload.tvf;
2490+
const tvf = publishPayload.params;
24912491
if (!tvf) {
24922492
return console.error("polkadot tvf is undefined");
24932493
}
@@ -2546,7 +2546,7 @@ describe("Sign Client Integration", () => {
25462546

25472547
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
25482548
checkedDappPublish = true;
2549-
const tvf = publishPayload.tvf;
2549+
const tvf = publishPayload.params;
25502550
expect(tvf).to.exist;
25512551
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
25522552
expect(tvf?.rpcMethods).to.eql([requestParams.method]);
@@ -2603,7 +2603,7 @@ describe("Sign Client Integration", () => {
26032603

26042604
let checkedWalletPublish = false;
26052605
clients.B.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
2606-
const tvf = publishPayload.tvf;
2606+
const tvf = publishPayload.params;
26072607
if (!tvf) {
26082608
return console.error("cosmos tvf is undefined");
26092609
}
@@ -2642,7 +2642,7 @@ describe("Sign Client Integration", () => {
26422642

26432643
clients.A.core.relayer.once(RELAYER_EVENTS.publish, (publishPayload: any) => {
26442644
checkedDappPublish = true;
2645-
const tvf = publishPayload.tvf;
2645+
const tvf = publishPayload.params;
26462646
expect(tvf).to.exist;
26472647
expect(tvf?.chainId).to.eq(TEST_REQUEST_PARAMS.chainId);
26482648
expect(tvf?.rpcMethods).to.eql([requestParams.method]);

0 commit comments

Comments
 (0)