import "../../../_dnt.polyfills.js"; import { MultiAddress } from "@capi/polkadot" import { Chain, ChainRune, Rune, RunicArgs } from "../../../mod.js" // TODO: constrain export function replaceDelegateCalls( chain: ChainRune, ...[real, from, to]: RunicArgs ) { return [ chain.extrinsic(Rune.object({ type: "Proxy", value: Rune.object({ type: "proxy", real, forceProxyType: undefined, call: Rune.object({ type: "Proxy", value: Rune.object({ type: "addProxy", proxyType: "Any", delegate: to, delay: 0, }), }), }), }) as any), chain.extrinsic(Rune.object({ type: "Proxy", value: Rune.object({ type: "proxy", real, forceProxyType: undefined, call: Rune.object({ type: "Proxy", value: Rune.object({ type: "removeProxy", proxyType: "Any", delegate: from, delay: 0, }), }), }), }) as any), ] }