Skip to content

Commit

Permalink
WIP - Uncomment code and update kda-token
Browse files Browse the repository at this point in the history
  • Loading branch information
Peixer committed Sep 18, 2023
1 parent 474e63e commit e33dc29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 53 deletions.
21 changes: 1 addition & 20 deletions packages/extension/src/providers/kadena/types/kda-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,7 @@ export class KDAToken extends KDABaseToken {
amount: string,
options: SendOptions
): Promise<any> {
const modules = Pact.modules as any;
return Pact.builder
.execution(
modules.coin.transfer(to, to, {
decimal: amount,
})
)
.addData("ks", {
keys: [to],
pred: "keys-all",
})
.addSigner(to, (withCap: any) => [
withCap("coin.TRANSFER", to, to, {
decimal: amount,
}),
withCap("coin.GAS"),
])
.setMeta({ chainId: "1", senderAccount: to })
.setNetworkId("testnet04")
.createTransaction();
throw new Error("EVM-send is not implemented here");
}

public async sendLocal(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ import PublicKeyRing from "@/libs/keyring/public-keyring";
import { GenericNameResolver, CoinType } from "@/libs/name-resolver";
import { KadenaNetwork } from "../../types/kadena-network";
import KadenaAPI from "@/providers/kadena/libs/api";
import getUiPath from "@/libs/utils/get-ui-path";
import { ProviderName } from "@/types/provider";
import Browser from "webextension-polyfill";
const props = defineProps({
network: {
Expand Down Expand Up @@ -399,22 +402,6 @@ const isDisabled = computed(() => {
});
const sendAction = async () => {
// const sendAmount = toBase(amount.value!, selectedAsset.value.decimals!);
// const sendOptions: SendOptions | undefined = sendMax.value
// ? { type: "all" }
// : undefined;
// const api = (await props.network.api()).api as ApiPromise;
// await api.isReady;
// const tx = await selectedAsset.value?.send!(
// api,
// addressTo.value,
// sendAmount,
// sendOptions
// );
debugger;
const keyring = new PublicKeyRing();
const fromAccount = await keyring.getAccount(addressFrom.value);
const txVerifyInfo: VerifyTransactionParams = {
Expand Down Expand Up @@ -451,23 +438,22 @@ const sendAction = async () => {
},
});
router.push(routedRoute);
// if (fromAccount.isHardware) {
// await Browser.windows.create({
// url: Browser.runtime.getURL(
// getUiPath(
// `dot-hw-verify?id=${routedRoute.query.id}&txData=${routedRoute.query.txData}`,
// ProviderName.polkadot
// )
// ),
// type: "popup",
// focused: true,
// height: 600,
// width: 460,
// });
// } else {
// router.push(routedRoute);
// }
if (fromAccount.isHardware) {
await Browser.windows.create({
url: Browser.runtime.getURL(
getUiPath(
`dot-hw-verify?id=${routedRoute.query.id}&txData=${routedRoute.query.txData}`,
ProviderName.polkadot
)
),
type: "popup",
focused: true,
height: 600,
width: 460,
});
} else {
router.push(routedRoute);
}
};
</script>
Expand Down

0 comments on commit e33dc29

Please sign in to comment.