Skip to content

Instantly share code, notes, and snippets.

@jameshih
jameshih / build_sign_polkadot_rawtx.ts
Created February 20, 2024 11:55 — forked from islishude/build_sign_polkadot_rawtx.ts
Polkadot transfer transaction build and sign(with SDK @polkadot/api@4.6.1 & Polkadot Node v0.8.30)
import { ApiPromise, WsProvider, Keyring } from "@polkadot/api";
import { expandMetadata } from "@polkadot/metadata";
import { stringCamelCase, u8aToHex } from "@polkadot/util";
import {
blake2AsHex,
cryptoWaitReady,
encodeAddress,
} from "@polkadot/util-crypto";
import type { SignerPayloadJSON, AnyJson } from "@polkadot/types/types";