This Spell can be used to withdraw a Maker Vault back to the owner address. Maker Vaults withdrawn this way will require an update to the vault settings before it is visible on Oasis.
/**
* Spell to Withdraw Maker Vault back to Owner Address
*
*/
console.log('Connected address', USER_ADDRESS)
const dsaWallets = await dsa.getAccounts(USER_ADDRESS)
// If you don't have a Instadapp DeFi Smart Account
if (dsaWallets.length == 0) return alert("Create a DSA")
const vault = "#####"
const OwnerAddr = "0xOWNERADDRESS"
let spells = new dsa.Spell()
// Transfer Vault back to Metamask
spells.add({
connector: "MAKERDAO-A",
method: "transfer",
args: [vault, OwnerAddr]
});
console.log(dsa.instance)
console.log(dsa.encodeSpells(spells))
// keep adding spells across DeFi protocols to execute.
console.log("Transaction hash:",
await dsa.cast({
spells
})
)