implement encode for walletOffset and snapshotOffsetTable