Skip to content

Commit bd2b90e

Browse files
fix: examples
1 parent 2f39e4c commit bd2b90e

File tree

6 files changed

+270
-75
lines changed

6 files changed

+270
-75
lines changed

examples/dapp/near/vanilla/src/pages/Home.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const Home: React.FC = () => {
2727
setAccountId(account.accountID);
2828
setIsSignedIn(true);
2929
} else if (accountID && signingURL) {
30-
const isSignedIn = client.signIn(accountID, signingURL);
30+
const isSignedIn = client.isSignedIn(accountID, signingURL);
3131
if (isSignedIn) {
3232
setAccountId(accountID);
3333
setIsSignedIn(true);
@@ -48,7 +48,7 @@ const Home: React.FC = () => {
4848
return;
4949
}
5050

51-
const url = client.signInitialTx({
51+
const url = client.requestSignInitialTx({
5252
accountID: accountId,
5353
signingURL: signingUrl,
5454
permissions: new FunctionCallPermission({

examples/dapp/near/vanilla/src/pages/Main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Main: React.FC = () => {
2626
}
2727

2828
console.log("Signing URL:", activeAccount.signingURL);
29-
const url = client.signWithFullAccessKey({
29+
const url = client.requestSignWithFullAccessKey({
3030
transaction: Transaction.decode(
3131
Buffer.from(
3232
"DAAAAG1vY2tTaWduZXJJZACcdRJ+JQOaKfqxr8M0e4Ylfcz1E107wi1yLO+td5FwvAEAAAAAAAAADgAAAG1vY2tSZWNlaXZlcklko7RnCT5MjkhJMV2ASLYPwYZorzhqPrGdadCYH6KZGxQAAAAA",

examples/dapp/near/vanilla/src/providers/NearDAppProvider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { createContext, useContext, useMemo } from "react";
2-
import { NearDAppClientFactory, NearDAppClient } from "@one-click-connect/vanilla-dapp/near";
2+
import { ClientFactory, Client } from "@one-click-connect/browser-dapp/near";
33

44
interface NearDAppContextType {
5-
client: NearDAppClient;
5+
client: Client;
66
}
77

88
const NearDAppContext = createContext<NearDAppContextType | null>(null);
@@ -21,7 +21,7 @@ interface NearDAppProviderProps {
2121

2222
export const NearDAppProvider: React.FC<NearDAppProviderProps> = ({ children }) => {
2323
const client = useMemo(() => {
24-
return NearDAppClientFactory.fromConfig({
24+
return ClientFactory.newClient({
2525
redirectURL: window.location.origin + "/main",
2626
});
2727
}, []);

examples/wallet/web/src/pages/Sign.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useEffect, useState } from "react";
22
import { useSearchParams } from "react-router-dom";
33
import "./Sign.css"; // Import CSS for styling
4+
import { Transaction } from "near-api-js/lib/transaction";
45

56
const Sign: React.FC = () => {
67
const [searchParams] = useSearchParams();
@@ -68,7 +69,12 @@ const Sign: React.FC = () => {
6869
)}
6970
{transaction && (
7071
<li>
71-
Transaction: <span className="param-value">{transaction}</span>
72+
Transaction:{" "}
73+
<span className="param-value">
74+
{JSON.stringify(Transaction.decode(Buffer.from(transaction, "base64")), (_, value) =>
75+
typeof value === "bigint" ? value.toString() : value,
76+
)}
77+
</span>
7278
</li>
7379
)}
7480
</ul>

0 commit comments

Comments
 (0)